<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Posts on aliquote.org</title><link>https://aliquote.org/post/</link><description>Recent content in Posts on aliquote.org</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Thu, 05 Feb 2026 09:32:43 +0100</lastBuildDate><atom:link href="https://aliquote.org/post/index.xml" rel="self" type="application/rss+xml"/><item><title>January in review</title><link>https://aliquote.org/post/micro-review-031/</link><pubDate>Thu, 05 Feb 2026 09:32:43 +0100</pubDate><guid>https://aliquote.org/post/micro-review-031/</guid><description>&lt;p&gt;Here&amp;rsquo;s a bunch of links that I didn&amp;rsquo;t manage to post on the micro blog in due time.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://samuelhewitt.com/blog/2018-06-05-time-machine-style-backups-with-rsync"&gt;Time Machine-style Backups with rsync&lt;/a&gt;: I always forget about hard links and this post explains how to take advantage of rsync&amp;rsquo;s &lt;code&gt;--link-dest&lt;/code&gt; option.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Yet another blog post about rsync: &lt;a href="https://www.jeffgeerling.com/blog/2025/4x-faster-network-file-sync-rclone-vs-rsync/"&gt;4x faster network file sync with rclone (vs rsync)&lt;/a&gt;. I once complained that rsync was very slow on my MacBook for my own backups, and it looks that I may need to rely on &lt;a href="https://rclone.org"&gt;rclone&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.jamisbuck.org/mazes/"&gt;Maze Algorithms&lt;/a&gt;: Astonishing online demo and algorithms. All the code is available on GitHub. It&amp;rsquo;s Coffeescript, long time I never heard of this.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Rust-like typedef for C as a short way of referring to fixed-length types: &lt;a href="https://www.unix.dog/~yosh/blog/c-habits-for-me.html"&gt;some C habits I employ for the modern day&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://eieio.games/blog/bad-apple-with-regex-in-vim/"&gt;Bad apple but it&amp;rsquo;s 6,500 regexes that i search for in vim&lt;/a&gt;, if you want to give vim golfing another try&amp;hellip; On a related note, Evan Hahn explains how he &lt;a href="https://evanhahn.com/i-set-all-376-vim-options-and-im-still-a-fool/"&gt;set all 376 Vim options and I&amp;rsquo;m still a fool&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://jon.bo/posts/nano-texture/"&gt;Notes on Apple’s Nano Texture&lt;/a&gt;: I do not work outside but I can confirm that the Nano texture display on my MacBook looks way better compared to the previous glossy displays I used to use.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.robinlinacre.com/recommend_duckdb/"&gt;Why DuckDB is my first choice for data processing&lt;/a&gt;. I&amp;rsquo;ve tried it in the past and I always forget that often times it may provide a better alternative to SQLite, if only for dynamic column selection, queries that start with the FROM clause, function chaining, and list comprehensions, but see &lt;a href="https://duckdb.org/2023/08/23/even-friendlier-sql#function-chaining"&gt;Even Friendlier SQL with DuckDB&lt;/a&gt;. For a more challenging review, see Andy Pavlo&amp;rsquo;s &lt;a href="https://www.cs.cmu.edu/~pavlo/blog/2026/01/2025-databases-retrospective.html"&gt;Databases in 2025: A Year in Review&lt;/a&gt;, although it does not deal with DuckDB.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.undeadly.org/cgi?action=article;sid=20260115203619"&gt;OpenBSD-current now runs as guest under Apple Hypervisor&lt;/a&gt;. I need to give it a try with UTM at some point.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://mkennedy.codes/posts/python-numbers-every-programmer-should-know/"&gt;Python Numbers Every Programmer Should Know&lt;/a&gt;: interesting summary of latencies as found in web framework, coroutines, list and dict operations, etc.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://nry.me/posts/2020-05-14/simulated-annealing-with-python/"&gt;Effective Simulated Annealing with Python&lt;/a&gt;, with zero dependencies.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://austinhenley.com/blog/vowels.html"&gt;The fastest way to detect a vowel in a string&lt;/a&gt;. On the importance of trying to swap the inner and outer loops.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;Replicating human perception is hard, and it&amp;rsquo;s made harder when constrained to the limitations of display technology or printed images. You don&amp;rsquo;t have to be ashamed about adjusting a photo when automated algorithms make the wrong call. &amp;mdash; &lt;a href="https://maurycyz.com/misc/raw_photo/"&gt;What an unprocessed photo looks like&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Front 242 • &lt;em&gt;First In/First Out&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in December</title><link>https://aliquote.org/post/micro-12-2025/</link><pubDate>Wed, 31 Dec 2025 18:27:43 +0100</pubDate><guid>https://aliquote.org/post/micro-12-2025/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-12-05&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_0291.jpeg" alt=""&gt;&lt;small&gt;Quai de la Garonne, Toulouse, Dec. 2025&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-12-05&lt;/a&gt;: /me is listening to &amp;ldquo;If I wanted someone&amp;rdquo; by Dawes&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-12-05&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;There seems to be some resurgence into the old web now, time will tell if it gains any real ground. It&amp;rsquo;s an uphill battle: Besides most online eyeballs now being glued to social media apps, we&amp;rsquo;re seeing AI take over the way people interact with the internet altogether. Back in the old days if you wanted to know more about something you&amp;rsquo;d google the term and start going through the websites Google said are most relevant. &amp;mdash; &lt;a href="https://askmike.org/articles/blogging-in-2025-screaming-into-the-void/"&gt;Blogging in 2025: Screaming into the void&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-12-05&lt;/a&gt;: &lt;a href="https://christopherkrapu.com/blog/2022/nonparametric-changepoint-model-pymc/"&gt;Modeling temporal data with an unknown number of changepoints&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-12-05&lt;/a&gt;: &lt;a href="https://timothyfraser.com/sigma/index.html"&gt;System Reliability and Six Sigma in R and Python&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-12-07&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I’ve seen a number of editors grow popular and then wane. At various times I’ve seen Emacs, Eclipse, IntelliJ IDEA, Atom, SlickEdit, gedit, Notepad++, Sublime, NetBeans, Visual Studio, Xcode, IDLE, PyCharm, Android Studio, and more. Some of those aren’t around any more. I’m not worried about Vim getting eaten by a big tech company, or enshittified to feed advertising or AI ambitions. &amp;mdash; &lt;a href="https://alexsci.com/blog/vim-over-vscode/"&gt;Choosing Vim over VSCode&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-12-07&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;So, while I agree that it&amp;rsquo;s wrong to generalise that &amp;lsquo;Perl 6 killed Perl&amp;rsquo;, I would say that Perl 6 was a symptom of the irreconcilable internal forces that killed Perl. Although, I also intend to go on to point out that Perl isn&amp;rsquo;t dead, nothing has actually killed Perl. Killed Perl is a very stupid way to frame the discussion, but here we are. &lt;a href="https://www.beatworm.co.uk/blog/computers/perls-decline-was-cultural-not-technical"&gt;Perl&amp;rsquo;s decline was cultural&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-12-07&lt;/a&gt;: &lt;a href="https://anders.unix.se/2015/12/10/screenshots-from-developers--2002-vs.-2015/"&gt;Screenshots from developers: 2002 vs. 2015&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-12-08&lt;/a&gt;: &lt;a href="https://github.com/RhetTbull/osxphotos"&gt;osxphotos&lt;/a&gt; looks like a blessing to manage iPhoto library. The same applies to &lt;a href="https://github.com/ReagentX/imessage-exporter"&gt;imessage-exporter&lt;/a&gt;. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-12-09&lt;/a&gt;: &lt;a href="https://tali.link/posts/syntax-plotting/"&gt;QuickSort in 61 characters&lt;/a&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;quicksort = # &amp;amp; @@@ {# //. x : {__} :&amp;gt; (## &amp;amp; @@ Reverse /@ GatherBy[x, (# &amp;lt; x[[1]] &amp;amp;)])} &amp;amp;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-12-09&lt;/a&gt;: &lt;a href="https://math.tali.link/rainbow-array-algebra/"&gt;Rainbow array algebra&lt;/a&gt;: I really like syntax-highlighted math notation and all those pretty diagrams. See also &lt;a href="https://github.com/taliesinb/MathTools?tab=readme-ov-file"&gt;MathTools&lt;/a&gt;. &lt;code&gt;#mathematica&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-12-09&lt;/a&gt;: &lt;a href="https://github.com/scicloj/wolframite?tab=readme-ov-file"&gt;wolframite&lt;/a&gt;: An interface between Clojure and Wolfram Language (the language of Mathematica). It works like a charm with latest release of Wolfram engine on macOS. &lt;code&gt;#clojure&lt;/code&gt; &lt;code&gt;#mathematica&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-12-11&lt;/a&gt;: &lt;a href="https://cdegroot.com/programming/commonlisp/2025/11/26/cl-ql-asdf.html"&gt;Common Lisp, ASDF, and Quicklisp: packaging explained&lt;/a&gt;: It is important to realize that a “system” and a package are entirely different things: one is an entity in an add-on tool, the other is intrinsic to Common Lisp’s namespacing. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-12-14&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/2025-12-12-10-35-42.jpeg" alt=""&gt;&lt;small&gt;Cathédrale Notre-Dame de l&amp;rsquo;Assomption, Rodez, Dec. 2025&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-12-14&lt;/a&gt;: /me is listening to &amp;ldquo;Zombie&amp;rdquo; by YUNGBLUD&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-12-14&lt;/a&gt;: &lt;a href="https://susam.net/fed-24-years-of-posts-to-markov-model.html"&gt;I Fed 24 Years of My Blog Posts to a Markov Model&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-12-16&lt;/a&gt;: /me is listening to &amp;ldquo;Gallowdance&amp;rdquo; by Lebanon Hanover&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-12-16&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The speakers are pretty good. And for a laptop, they’re actually amazing. They have depth, the upmp, and are loud enough to watch films with comfort - can’t say this about any other laptop I’ve had before. &amp;mdash; &lt;a href="https://andreyor.st/posts/2025-11-23-gnome-is-better-macos-than-macos/"&gt;GNOME is better macOS than macOS&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-12-16&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Why readable math still matters in a world aided by LLM-assisted code generation. &amp;mdash; &lt;a href="https://runmat.org/blog/in-defense-of-matlab-whiteboard-style-code"&gt;In Defense of MATLAB: Why Engineers Still Need Whiteboard-Style Code&lt;/a&gt;I too am a firm believer in simple syntax (R, Mathematica, or even Scilab or Octave): &amp;ldquo;The math is identical. But in the Python version, the engineer is thinking about computer science concepts.&amp;quot;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-12-16&lt;/a&gt;: Interesting discussion on matrix multiplication with Mathematica: &lt;a href="https://mathematica.stackexchange.com/questions/115087/speedup-matrix-number-multiplication"&gt;Speedup matrix number multiplication&lt;/a&gt;. &lt;code&gt;#mathematica&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-12-18&lt;/a&gt;: New kid on the blocks: &lt;a href="https://astral.sh/blog/ty"&gt;ty: An extremely fast Python type checker and LSP&lt;/a&gt;. I&amp;rsquo;m pretty happy with &lt;a href="https://github.com/DetachHead/basedpyright"&gt;basedpyright&lt;/a&gt; at present, but I will check this new tool. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-12-18&lt;/a&gt;: &lt;a href="https://bernsteinbear.com/isdt/"&gt;Introduction to Software Development Tooling&lt;/a&gt;: Lot of good stuff and very clear handouts.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-12-23&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I agree that it can be difficult to make sense of a model containing billions of parameters. Certainly a human can&amp;rsquo;t understand such a model by inspecting the values of each parameter individually. But one can gain insight by examing the properties of the model—where it succeeds and fails, how well it learns as a function of data, etc. &amp;mdash; &lt;a href="https://norvig.com/chomsky.html"&gt;On Chomsky and the Two Cultures of Statistical Learning&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-12-23&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Note that this updates cells live in response to previous cells that they depend on. Not pictured is that it doesn&amp;rsquo;t update cells if their dependencies haven&amp;rsquo;t changed. You can think of this as a spreadsheet-like Jupyter, where code is only rerun when necessary. &amp;mdash; &lt;a href="https://jyn.dev/the-terminal-of-the-future/"&gt;the terminal of the future&lt;/a&gt;Still I don&amp;rsquo;t really like web-based notebooks.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-12-23&lt;/a&gt;: &lt;a href="https://www.lbjgruppen.com/en/posts/flocking-quadtrees"&gt;Flocking Quadtrees&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-12-23&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2025-12-20-17-40-32.jpeg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2025-12-20-17-40-32.jpeg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2025-12-20-19-00-19.jpeg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2025-12-20-19-00-19.jpeg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;small&gt;Night road, Dec. 2025&lt;/small&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-12-27&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/2025-12-26-14-40-11.jpeg" alt=""&gt;&lt;small&gt;Jardin Tino Rossi, Paris, Dec. 2025&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-12-27&lt;/a&gt;: /me is listening to &amp;ldquo;Albatross&amp;rdquo; by Alela Diane&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-12-27&lt;/a&gt;: Recent Python bookmarks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://nesbitt.io/2025/12/26/how-uv-got-so-fast.html"&gt;How uv got so fast&lt;/a&gt;: uv is fast because of what it doesn’t do, not because of what language it’s written in.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.python.org/3.15/library/profiling.sampling.html"&gt;profiling.sampling&lt;/a&gt;: statistical profiler via periodic stack sampling introduced in Python 3.15.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://coe.psu.ac.th/ad/explore/"&gt;Exploring Mathematics with Python&lt;/a&gt;: mathematics with Python as a replacement to Turbo Pascal.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-12-29&lt;/a&gt;: &lt;a href="https://github.com/tw93/Mole"&gt;Mole&lt;/a&gt;: Deep clean and optimize your Mac. &lt;code&gt;#apple&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;br&gt;&lt;img src="https://aliquote.org/img/2025-12-29-12-46-57.png" alt=""&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>Micro posting in November</title><link>https://aliquote.org/post/micro-11-2025/</link><pubDate>Tue, 02 Dec 2025 17:02:16 +0100</pubDate><guid>https://aliquote.org/post/micro-11-2025/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-11-03&lt;/a&gt;: Recently added:&lt;img src="https://aliquote.org/img/2025-11-03-18-53-51.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-11-05&lt;/a&gt;: &lt;a href="https://zserge.com/posts/grayskull/"&gt;By the power of grayscale!&lt;/a&gt;: A nice review of common techniques for image processing, with applications in C. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-11-16&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/2025-11-10-17-17-15.jpeg" alt="img"&gt;&lt;small&gt;Jardin des Plantes, Paris, Nov. 2025&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-11-16&lt;/a&gt;: /me is listening to &amp;ldquo;Familiar Fields&amp;rdquo; by Duster&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-11-16&lt;/a&gt;: Nice read on GNU Awk: &lt;a href="https://maximullaris.com/awk_tech_notes.html"&gt;AWK technical notes&lt;/a&gt;. It reminds me of all the good Awk programs I happened to find on &lt;a href="https://programmingpraxis.com"&gt;Programming Praxis&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-11-16&lt;/a&gt;: Not sure I haven&amp;rsquo;t bookmarked this one already, but in case: &lt;a href="https://www.jmeiners.com/common-lisp-scripts/"&gt;Deploying Common Lisp Scripts&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-11-16&lt;/a&gt;: &lt;a href="https://random.tastemaker.design"&gt;Randomness Testing Guide&lt;/a&gt;: a beginner&amp;rsquo;s guide to randomness testing with a focus on simplicity and explainability.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-11-30&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/2025-11-26-14-22-32.jpeg" alt="img"&gt;&lt;small&gt;Jardin Public, Bordeaux, Nov. 2025&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-11-30&lt;/a&gt;: &lt;a href="https://webr.sh"&gt;https://webr.sh&lt;/a&gt;. Reminds me of this &lt;a href="https://stats.stackexchange.com/a/9700"&gt;old thread&lt;/a&gt; on CV. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-11-30&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If there is any reason why people use Vim/Emacs, it’s because at some point, when they let someone use their computer, they get to nonchalantly, seemingly in passing mention “oh, you don’t know how to use Vim?” while watching that someone struggle to exit it. Everyone likes feeling superior. &amp;mdash; &lt;a href="https://www.lopaciuk.eu/2017/10/13/zsh-and-why-i-use-it.html"&gt;ZSH Tricks and Why I Use It&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-11-30&lt;/a&gt;: &lt;a href="https://kevinboone.me/fingerprinting.html"&gt;The privacy nightmare of browser fingerprinting&lt;/a&gt;. See also &lt;a href="https://neberej.github.io/exposedbydefault/"&gt;Exposed By Default&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;</description></item><item><title>Micro posting in October</title><link>https://aliquote.org/post/micro-10-2025/</link><pubDate>Tue, 28 Oct 2025 08:52:59 +0100</pubDate><guid>https://aliquote.org/post/micro-10-2025/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-10-20&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Oh my god! They linked in more than 64k of floating point library to compute the sqrt of an integer that is always less than 128!? For gods sake, just use a for loop counting up to 12! Or if a for loop seems liek too much work, how about a 128 byte look up table?&amp;rdquo; &amp;mdash; &lt;a href="https://blogsystem5.substack.com/p/the-ides-we-had-30-years-ago-and"&gt;The IDEs we had 30 years ago&amp;hellip; and we lost&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-10-20&lt;/a&gt;: On kerning vs. letterspacing: &lt;a href="https://willcrichton.net/notes/typography-misconceptions/"&gt;kerning&lt;/a&gt; is more specific: it refers to special cases where pairs of adjacent characters are pushed towards each other.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-10-21&lt;/a&gt;: /me is listening to &amp;ldquo;Tell Me Who You Are Today&amp;rdquo; by Beth Gibbons&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-10-21&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The biggest misconception about Rust is that it’s &amp;ldquo;harder&amp;rdquo; than other languages. But that’s only true if you measure difficulty by how fast you can start writing code. If you measure difficulty by how long it takes to debug, maintain, and make a system reliable, the playing field levels out. &amp;mdash; &lt;a href="https://marma.dev/articles/2025/rust-is-not-harder-than-other-languages"&gt;Rust is not harder than other languages&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-10-21&lt;/a&gt;: &lt;a href="https://salykova.github.io/gemm-cpu"&gt;Advanced Matrix Multiplication Optimization on Modern Multi-Core Processors&lt;/a&gt;: Lot of micro-optimization like caching and kernel tricks.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-10-21&lt;/a&gt;: &lt;a href="https://cp-algorithms.com"&gt;Algorithms for Competitive Programming&lt;/a&gt; (via Nima Aghdaii&amp;rsquo;s post on &lt;a href="https://nima101.github.io/suffix-arrays"&gt;Suffix Arrays&lt;/a&gt;).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-10-21&lt;/a&gt;: &lt;a href="https://blog.miguelgrinberg.com/post/python-3-14-is-here-how-fast-is-it"&gt;Python 3.14 Is Here. How Fast Is It?&lt;/a&gt;: The 3.14 JIT interpreter does not appear to provide any significant gains in speed, at least not with my test scripts. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-10-21&lt;/a&gt;: &lt;a href="https://explodi.tubatuba.net/2025/09/26/using-deno-as-my-game-engine"&gt;Using deno as my game engine&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-10-21&lt;/a&gt;: &lt;a href="http://www.goodmath.org/blog/2010/01/13/zippers-making-functional-updates-efficient/"&gt;Zippers: Making Functional &amp;ldquo;Updates&amp;rdquo; Efficient&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-10-23&lt;/a&gt;: /me is listening to &amp;ldquo;And No More Shall We Part&amp;rdquo; by Nick Cave &amp;amp; The Bad Seeds&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-10-27&lt;/a&gt;: /me is listening to &amp;ldquo;The Rip&amp;rdquo; by Portishead&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-10-27&lt;/a&gt;: Homebrew nice update: download in progress now showing like other cli tools (npm, deno).&lt;br&gt;&lt;img src="https://aliquote.org/img/2025-10-27-09-13-38.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-10-27&lt;/a&gt;: &lt;a href="https://okmij.org/ftp/Algorithms/map-monoid-reduce.html"&gt;Folding in Parallel&lt;/a&gt;: The input sequence can be arbitrarily partitioned (and recursively sub-partitioned, if desired) among workers, which would run in parallel with no races, dependencies or even memory bank conflicts. Such embarrassing parallelism is ideal for multi-core, GPU or distributed processing.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-10-27&lt;/a&gt;: &lt;a href="http://0x80.pl/notesen/2023-04-30-lookup-in-strings.html"&gt;Modern perfect hashing for strings&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-10-28&lt;/a&gt;: /me is listening to &amp;ldquo;The Suit&amp;rdquo; by Public Image Ltd&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-10-28&lt;/a&gt;: I don&amp;rsquo;t think I need notmuch search and tagging facilities since &lt;a href="https://www.djcbsoftware.nl/code/mu/"&gt;mu&lt;/a&gt; and Neomutt cover all my needs. But in case I change my mind, I leave this links here:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the &lt;a href="https://wiki.archlinux.org/title/Notmuch"&gt;Arch wiki&lt;/a&gt; on notmuch&lt;/li&gt;
&lt;li&gt;&lt;a href="https://desfontain.es/blogue/client-mail-3bis-mutt.html"&gt;Gérer ses mails en local : étape 3 bis, du rab&amp;rsquo; de mutt&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://neomutt.org/feature/notmuch"&gt;Notmuch feature&lt;/a&gt; for Neomutt&lt;/li&gt;
&lt;li&gt;&lt;a href="https://bostonenginerd.com/posts/notmuch-of-a-mail-setup-part-2-notmuch-and-emacs/"&gt;Notmuch of mail a setup Part 2 - notmuch and Emacs&lt;/a&gt;- this &lt;a href="https://brianlovin.com/hn/33568388"&gt;HN thread&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I especially liked reading &lt;a href="https://www.kmjn.org/notes/unix_style_mail_tools.html"&gt;Search-oriented tools for Unix-style mail&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-10-28&lt;/a&gt;: &lt;a href="https://elvishjerricco.github.io/2017/03/23/applicative-sorting.html"&gt;Applicative Sorting&lt;/a&gt;: On using Applicative to sort any collection. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-10-28&lt;/a&gt;: &lt;a href="https://lalinsky.com/2009/10/28/ssh-to-a-machine-behind-firewall.html"&gt;SSH to a machine behind firewall&lt;/a&gt;. On a related note, &lt;code&gt;LocalCommand&lt;/code&gt; and &lt;code&gt;RemoteCommand&lt;/code&gt; are also handy in some cases, e.g., &lt;code&gt;LocalCommand osascript -e &amp;quot;tell application \&amp;quot;Terminal\&amp;quot; to set current settings of window 1 to settings set \&amp;quot;ssh\&amp;quot;&amp;quot;&lt;/code&gt; to change Apple Terminal theme when ssh&amp;rsquo;ing on a remomte machine, or &lt;code&gt;RemoteCommand tmux new -A -s remote -n main&lt;/code&gt; to start Tmux right when connecting to a remote server.&lt;br&gt;&lt;/p&gt;</description></item><item><title>Micro posting in September</title><link>https://aliquote.org/post/micro-09-2025/</link><pubDate>Tue, 30 Sep 2025 09:59:16 +0200</pubDate><guid>https://aliquote.org/post/micro-09-2025/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-09-01&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If someone’s subscribed to your blog with RSS they can read the full text of your article in their RSS reader of choice. RSS readers are good at rendering articles. When you publish a summary with a link to the full article on your website, you’re making them come out of the RSS reader’s window or app into another. It’s annoying. Doubly so if you still have unread articles to return to. &amp;mdash; &lt;a href="https://www.thisdaysportion.com/posts/please-publish-the-full-article-in-your-rss-feed/"&gt;Please publish the full article in your RSS feed&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-09-01&lt;/a&gt;: &lt;a href="https://chizkidd.github.io//2025/05/30/machine-learning-key-math-eqns/#gradient-descent"&gt;The Most Important Machine Learning Equations: A Comprehensive Guide&lt;/a&gt;, using Numpy. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-09-02&lt;/a&gt;: /me is listening to &amp;ldquo;The Last Beat of my Heart&amp;rdquo; by Siouxie and the Banshees&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-09-02&lt;/a&gt;: Good old Automator folder actions&amp;hellip; I didn&amp;rsquo;t remember it was so tedious to rename default screenshots (there&amp;rsquo;s no option to add date and time, we must chain both actions together).&lt;br&gt;&lt;img src="https://aliquote.org/img/2025-09-02-09-43-38.png" alt="img"&gt;&lt;small&gt;Not shown in this workflow, this &lt;a href="https://apple.stackexchange.com/a/418897"&gt;AppleScript&lt;/a&gt; (without messing with file extension guard) to copy filename to the clipboard.&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-09-02&lt;/a&gt;: Hacky way to get &lt;code&gt;gf&lt;/code&gt; works with Hugo rooted inline links (e.g., &lt;code&gt;/post/bla/&lt;/code&gt;):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-vim" data-lang="vim"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;setlocal&lt;/span&gt; &lt;span class="nx"&gt;includeexpr&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;~/Sites/aliquote/content&amp;#39;&lt;/span&gt;.&lt;span class="nx"&gt;substitute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;v&lt;/span&gt;:&lt;span class="nx"&gt;fname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;/\$&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;g&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;.&lt;span class="s1"&gt;&amp;#39;.md&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I&amp;rsquo;ve tried several combination of &lt;code&gt;path&lt;/code&gt;, &lt;code&gt;suffixesadd&lt;/code&gt; and &lt;code&gt;includeexpr&lt;/code&gt; with no success, so I ended up with this ugly harcoded combinaion of root path and extension as prefix and suffix. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-09-02&lt;/a&gt;: Lot of VimL here&amp;hellip;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;~/.config/nvim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» tokei -e pack -s &lt;span class="nv"&gt;files&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;===============================================================================&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Language Files Lines Code Comments &lt;span class="nv"&gt;Blanks&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;===============================================================================&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Vim script &lt;span class="m"&gt;78&lt;/span&gt; &lt;span class="m"&gt;6095&lt;/span&gt; &lt;span class="m"&gt;5761&lt;/span&gt; &lt;span class="m"&gt;128&lt;/span&gt; &lt;span class="m"&gt;206&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Lua &lt;span class="m"&gt;17&lt;/span&gt; &lt;span class="m"&gt;1674&lt;/span&gt; &lt;span class="m"&gt;1567&lt;/span&gt; &lt;span class="m"&gt;37&lt;/span&gt; &lt;span class="m"&gt;70&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Scheme &lt;span class="m"&gt;2&lt;/span&gt; &lt;span class="m"&gt;99&lt;/span&gt; &lt;span class="m"&gt;91&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="m"&gt;7&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Plain Text &lt;span class="m"&gt;2&lt;/span&gt; &lt;span class="m"&gt;418&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;334&lt;/span&gt; &lt;span class="m"&gt;84&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; BASH &lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="m"&gt;8&lt;/span&gt; &lt;span class="m"&gt;4&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Python &lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Swift &lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="m"&gt;13&lt;/span&gt; &lt;span class="m"&gt;11&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="nv"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;===============================================================================&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Total &lt;span class="m"&gt;102&lt;/span&gt; &lt;span class="m"&gt;8308&lt;/span&gt; &lt;span class="m"&gt;7434&lt;/span&gt; &lt;span class="m"&gt;503&lt;/span&gt; &lt;span class="nv"&gt;371&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;===============================================================================&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-09-02&lt;/a&gt;: &lt;a href="https://software.mcgoron.com/hascheme/about/"&gt;HaScheme&lt;/a&gt; is a library that implements a subset of the R7RS&amp;rsquo;s libraries in a lazy way, using force and delay-force. When HaScheme is used by itself, it is a lazy functional programming language with the same syntax as Scheme, embedded within Scheme. &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-09-03&lt;/a&gt;: If you installed the XCode command-line tools and you did notice there&amp;rsquo;s no longer &lt;code&gt;/usr/local&lt;/code&gt; on macOS, you probably want to add the following to your &lt;code&gt;after/ftplugin/c.vim&lt;/code&gt; for &lt;code&gt;gf&lt;/code&gt; to work properly on included headers:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-vim" data-lang="vim"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;setlocal&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;+=&lt;/span&gt;&lt;span class="sr"&gt;/Library/&lt;/span&gt;&lt;span class="nx"&gt;Developer&lt;/span&gt;&lt;span class="sr"&gt;/CommandLineTools/&lt;/span&gt;&lt;span class="nx"&gt;SDKs&lt;/span&gt;&lt;span class="sr"&gt;/MacOSX.sdk/&lt;/span&gt;&lt;span class="nx"&gt;usr&lt;/span&gt;/&lt;span class="nx"&gt;include&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-09-04&lt;/a&gt;: /me is listening to &amp;ldquo;Beautiful is Boring&amp;rdquo; by BONES UK&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-09-04&lt;/a&gt;: &lt;a href="https://w3m.rocks"&gt;https://w3m.rocks&lt;/a&gt;: Site dedicated to the finer aspects of W3M, an open-source terminal web browser (and pager) available for any Unix-like OS.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-09-04&lt;/a&gt;: Comfy macOS setup: Neomutt running inside Tmux in a separate tab) so that I can completely wipe out Apple terminal and get back to it at any time. Also, setting &lt;code&gt;beep_new = yes&lt;/code&gt; put a little bell on the tab when I got mail.&lt;br&gt;&lt;img src="https://aliquote.org/img/2025-09-04-12-44-44.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-09-11&lt;/a&gt;: /me is listening to &amp;ldquo;Papillon&amp;rdquo; by Editors&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-09-15&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Why are bookmarks dismal? Because they tend to accumulate way too fast. &amp;mdash; &lt;a href="https://unixdigest.com/articles/how-i-manage-my-bookmarks.html"&gt;How I manage my bookmarks&lt;/a&gt;Whence the micro section on this website&amp;hellip;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-09-16&lt;/a&gt;: Looks like Tahoe is ready, as well as another sequel of Sequoia. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;&lt;img src="https://aliquote.org/img/2025-09-16-08-53-38.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-09-16&lt;/a&gt;: &lt;a href="https://www.apple.com/os/pdf/All_New_Features_macOS_Tahoe_Sept_2025.pdf"&gt;New features available with macOS Tahoe&lt;/a&gt;: Apple Terminal gets Powerline glyphs and 24-bit color support. What else? More detailed review &lt;a href="https://www.cultofmac.com/how-to/macos-26-tahoe-new-features"&gt;here&lt;/a&gt;. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-09-16&lt;/a&gt;: &lt;a href="https://log.bede.im/2025/09/12/zstandard-long-range-genomes.html"&gt;Zstandard&amp;rsquo;s long range mode works wonders for genome sequences without newlines&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-09-17&lt;/a&gt;: /me is listening to &amp;ldquo;Let Us Be Loving&amp;rdquo; by Alice Russell&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-09-17&lt;/a&gt;: I finally got this &amp;ldquo;rounded upgrade&amp;rdquo;, or macOS 26. As someone who spend almost all the day in a Terminal, it&amp;rsquo;s pretty okay since I&amp;rsquo;m only exposed to changes made to the menu bar (Dock has always been hidden on my laptops, and I don&amp;rsquo;t store files or folders on the Desktop). Safari 26 was no longer working with comact mode on Sequoia 15.7 (no way to interacti with the address bar other than with using keyword shortcuts). The floating buttons and panels are a minor inconvenience on most apps I use, but still it&amp;rsquo;s a drastic shift in macOS UI. Maybe this is becuase I still own a very old iPhone with a very outdated iOS, or maybe this is just me, like many others. Also, they revamped the nifty &lt;a href="https://arstechnica.com/gadgets/2025/08/rip-to-the-macintosh-hd-hard-drive-icon-2000-2025/"&gt;volume icons&lt;/a&gt; we used to have on the Desktop. At least we got a useable Spotlight again. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-09-17&lt;/a&gt;: More than 5k pages left here.&lt;br&gt;&lt;img src="https://aliquote.org/img/2025-09-17-08-17-41.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-09-17&lt;/a&gt;: &lt;a href="https://changelog.complete.org/archives/10881-i-just-want-an-80x25-console-but-thats-no-longer-possible"&gt;I just want an 80×25 console, but that’s no longer possible&lt;/a&gt;. Reminds me of my playing with &lt;a href="https://aliquote.org/post/monochromatic-theme"&gt;virtual consoles&lt;/a&gt; all along on Linux distros. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-09-18&lt;/a&gt;: &lt;a href="https://labs.iximiuz.com/tutorials/container-filesystem-from-scratch"&gt;How Container Filesystem Works: Building a Docker-like Container From Scratch&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-09-18&lt;/a&gt;: &lt;a href="https://www.scheme.com/debug/debug.html"&gt;How to Debug Chez Scheme Programs&lt;/a&gt;. Note that this applies to Chez Scheme. &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-09-18&lt;/a&gt;: &lt;a href="https://randorithms.com/2020/12/26/rendezvous-hashing.html"&gt;Rendezvous hashing&lt;/a&gt; is an algorithm to solve the distributed hash table problem &amp;ndash; a common and general pattern in distributed systems.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-09-19&lt;/a&gt;: /me is listening to &amp;ldquo;The Suburbs&amp;rdquo; by Arcade Fire&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-09-19&lt;/a&gt;: &lt;a href="https://www.teamten.com/lawrence/style/"&gt;Elements of C Style&lt;/a&gt;: Oldies but goodies. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-09-23&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Since I’m back to work tomorrow I got it out to see if it was charged enough for the train journey in the morning. 90% remaining. After 3 weeks. It wasn’t turned off, just closed. &lt;a href="https://simonhartcher.com/posts/2025-09-22-why-im-spoiled-by-apple-silicon-but-still-love-framework/"&gt;Why I&amp;rsquo;m Spoiled By Apple Silicon (But Still Love Framework)&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-09-23&lt;/a&gt;: &lt;a href="https://swatson555.github.io/posts/2025-09-16-compiling-with-continuations.html"&gt;Compiling with Continuations&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-09-24&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Why use a language with 0-based indexing for linear algebra other than putting an additional cognitive burden on the students learning the subject? This is a recipe for the nefarious off-by-one error. And these errors are sneaky. The code might run but produce incorrect results and it’s a nightmare for the students (or the poor TA helping them) to figure out why. &amp;mdash; &lt;a href="https://loiseaujc.github.io/posts/blog-title/fortran_vs_python.html"&gt;Is Fortran better than Python for teaching the basics of numerical linear algebra?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-09-25&lt;/a&gt;: &lt;a href="https://clayto.com/2025/vim-rust-termdebug/"&gt;Debugging Rust with Vim’s Termdebug&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-09-29&lt;/a&gt;: &lt;a href="https://pyrefly.org/blog/why-typed-python/"&gt;Why Today’s Python Developers Are Embracing Type Hints&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-09-30&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A recommendation engine that looks at my browsing history, sees what blog posts or articles I spent the most time on, then searches the web every night for things I should be reading that I’m not. In the morning I should get a digest of links. I also want to be able to give feedback on which were good suggestions and which weren’t to improve the next day’s digest. &amp;mdash; &lt;a href="https://sharif.io/28-ideas-2025"&gt;The 28 AI tools I wish existed&lt;/a&gt;Back in the days, I used to use &lt;a href="https://en.wikipedia.org/wiki/Prismatic_(app)"&gt;Prismatic&lt;/a&gt;, and I was very happy with its recommendation engine. Recommendation engines and collaborative filtering are everywhere since then. What&amp;rsquo;s next?&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;</description></item><item><title>Writing in Markdown with Neovim</title><link>https://aliquote.org/post/neovim-markdown/</link><pubDate>Sun, 31 Aug 2025 09:50:36 +0200</pubDate><guid>https://aliquote.org/post/neovim-markdown/</guid><description>&lt;p&gt;I don&amp;rsquo;t use any plugin for writing Markdown in Neovim. I used to have some function to navigate between headings, select code block, or for folding sections, code block and things like that. But now all of this is builtin. To enable folding via Treesitter, just add:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-vim" data-lang="vim"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;setlocal&lt;/span&gt; &lt;span class="nx"&gt;foldmethod&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;expr&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;setlocal&lt;/span&gt; &lt;span class="nx"&gt;foldexpr&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;v&lt;/span&gt;:&lt;span class="nx"&gt;lua&lt;/span&gt;.&lt;span class="nx"&gt;vim&lt;/span&gt;.&lt;span class="nx"&gt;treesitter&lt;/span&gt;.&lt;span class="nx"&gt;foldexpr&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;[[&lt;/code&gt; and &lt;code&gt;]]&lt;/code&gt; to jump between headers are available too, and &lt;code&gt;vab&lt;/code&gt; will select a code block (even &lt;code&gt;%&lt;/code&gt; works to jump to matching fences&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;). I like to use reference rather inline links. Fortunately, Seth Brown&amp;rsquo;s &lt;a href="https://github.com/seth-brown/formd"&gt;formd&lt;/a&gt; still works, and I added a shortcut to put all link rightly numbered at the end of the document. I also have a dedicated function to put all heading in the quickfix list, which I find more convenient than folding all the document and navigating between headers with &lt;code&gt;zj&lt;/code&gt; and &lt;code&gt;zk&lt;/code&gt;. Previously, I was relying on &lt;code&gt;ctags&lt;/code&gt; to generate tags for me, and I used &lt;a href="https://github.com/ibhagwan/fzf-lua"&gt;fzf-lua&lt;/a&gt; &lt;code&gt;btags&lt;/code&gt; to live query the table of contents. I can preview any Markdown file with &lt;a href="https://marked2app.com"&gt;Marked2.app&lt;/a&gt; &amp;ndash; I have custom preprocessor and processor to render images from my website properly or to use the same custom CSS file that I use to export document to HTML. Finally, I use &lt;a href="https://www.soimort.org/translate-shell/"&gt;translate-shell&lt;/a&gt; for brief translation from French to English.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-vim" data-lang="vim"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;nnoremap&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;gra&lt;/span&gt; :&lt;span class="nx"&gt;call&lt;/span&gt; &lt;span class="nx"&gt;Formd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;-r&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;xnoremap&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;silent&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;grn&lt;/span&gt; :&lt;span class="p"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;trans&lt;/span&gt; :&lt;span class="nx"&gt;en&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;brief&lt;/span&gt; &lt;span class="p"&gt;-&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;nnoremap&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;gO&lt;/span&gt; :&lt;span class="nx"&gt;call&lt;/span&gt; &lt;span class="nx"&gt;MarkdownHeaders&lt;/span&gt;&lt;span class="p"&gt;()&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;nnoremap&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;silent&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;gl&lt;/span&gt; :&lt;span class="p"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;open&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;Marked&lt;/span&gt;\ &lt;span class="m"&gt;2&lt;/span&gt;.&lt;span class="nx"&gt;app&lt;/span&gt; %&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;nnoremap&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;leader&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;# :&lt;span class="m"&gt;-1&lt;/span&gt; &lt;span class="nx"&gt;read&lt;/span&gt; &lt;span class="p"&gt;~&lt;/span&gt;&lt;span class="sr"&gt;/.config/&lt;/span&gt;&lt;span class="nx"&gt;nvim&lt;/span&gt;&lt;span class="sr"&gt;/templates/&lt;/span&gt;&lt;span class="nx"&gt;md&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Some folks use the &lt;code&gt;K&lt;/code&gt; mapping to call macOS default dictionary, but I use &lt;code&gt;setlocal keywordprg=nvim-keywordprg\ dict&lt;/code&gt;, where &lt;code&gt;nvim-keywordprg&lt;/code&gt; is a little shell script that handles several external doc commands (Stata, Lisp, R, Python) with &lt;a href="https://w3m.sourceforge.net"&gt;w3m&lt;/a&gt;, although I only use it for Common Lisp actually. Here is the corresponding entry for &lt;code&gt;dict&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-vim" data-lang="vim"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;term&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;$&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;echo&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;$2&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="nx"&gt;jq&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;Rr&lt;/span&gt; @&lt;span class="nx"&gt;uri&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;curl&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;dict://dict.org/d:$term&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2025-09-02]&lt;/small&gt;&lt;br&gt;
Finally, I found it more convenient to use &lt;a href="https://github.com/johngrib/vim-mac-dictionary/tree/master"&gt;vim-mac-dictionary&lt;/a&gt;. With little effort, you can extract the useful part of the code. Be sure to sort your local dictionaries in the right order since the Swift code will only lookup the first entry. Since you can use any VimL or Lua function as &lt;code&gt;keywordprg&lt;/code&gt; (when prefixed by a colon), you only need to modify the defualt command so that it reads: &lt;code&gt;command! -nargs=+ MacDictWord :silent! call Find(expand('&amp;lt;cword&amp;gt;'))&amp;lt;CR&amp;gt;&lt;/code&gt;. Much more pleasant than the above ad-hoc solution.
&lt;/div&gt;
&lt;p&gt;To manage my bibliographic entries, I use Bibtex and a wrapper around &lt;code&gt;fzf-lua&lt;/code&gt; which can be called in normal or insert mode. It was very useful when I was writing tutorial and slides, but now I rarely use it since I mostly write on this blog.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2025-08-31-10-30-28.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2025-08-31-10-30-28.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2025-08-31-10-08-16.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2025-08-31-10-08-16.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Treesitter now include both the &lt;code&gt;markdown&lt;/code&gt; and &lt;code&gt;markdown_inline&lt;/code&gt; parsers, which means you get highlighting for free everywhere, including code blocks. I do not use any linter, but &lt;a href="https://prettier.io"&gt;prettier&lt;/a&gt; does a nice job when it comes to formatting the whole document:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-vim" data-lang="vim"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;compiler&lt;/span&gt; &lt;span class="nx"&gt;quarto&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;setlocal&lt;/span&gt; &lt;span class="nx"&gt;formatprg&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;prettier&lt;/span&gt;\ &lt;span class="p"&gt;--&lt;/span&gt;&lt;span class="nx"&gt;parser&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;markdown&lt;/span&gt;\ &lt;span class="p"&gt;--&lt;/span&gt;&lt;span class="nx"&gt;stdin&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;filepath&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As can be seen, I also use &lt;a href="https://quarto.org"&gt;quarto&lt;/a&gt; as my &lt;code&gt;make&lt;/code&gt; program. Actually it&amp;rsquo;s not very elaborated,a nd I need to fix the &lt;code&gt;errorformat&lt;/code&gt;, but at least it allows me to export Markdown or Quarto documents to PDF or HTML using &lt;code&gt;make pdf&lt;/code&gt; or &lt;code&gt;make html&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-vim" data-lang="vim"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;&amp;#34; compiler/quarto.vim&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nx"&gt;exists&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;current_compiler&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="nx"&gt;finish&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="k"&gt;endif&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;current_compiler&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;quarto&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;:&lt;span class="nx"&gt;cpo_save&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &amp;amp;&lt;span class="nx"&gt;cpo&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;set&lt;/span&gt; &lt;span class="nx"&gt;cpo&lt;/span&gt;&amp;amp;&lt;span class="nx"&gt;vim&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;silent&lt;/span&gt; &lt;span class="nx"&gt;CompilerSet&lt;/span&gt; &lt;span class="nx"&gt;makeprg&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;quarto&lt;/span&gt;\ &lt;span class="nx"&gt;render&lt;/span&gt;\ %\ &lt;span class="p"&gt;--&lt;/span&gt;&lt;span class="nx"&gt;to&lt;/span&gt;\ $*
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;let&lt;/span&gt; &amp;amp;&lt;span class="nx"&gt;cpo&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;:&lt;span class="nx"&gt;cpo_save&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;unlet&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;:&lt;span class="nx"&gt;cpo_save&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Linkin Park • &lt;em&gt;Castle of Glass&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Or maybe not, I didn&amp;rsquo;t really check, but I still have this piece of code: &lt;code&gt;let b:match_words = b:match_words . ',^```.\+$:^```$'&lt;/code&gt;.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in August</title><link>https://aliquote.org/post/micro-08-2025/</link><pubDate>Fri, 29 Aug 2025 21:34:39 +0200</pubDate><guid>https://aliquote.org/post/micro-08-2025/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-08-02&lt;/a&gt;: I just noticed that Neovim now allow for full case-insensitive tab completion in command mode, which means I can now enter path as I do in Zsh. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-08-10&lt;/a&gt;: &lt;a href="https://leahneukirchen.org/blog/archive/2012/02/10-new-zsh-tricks-you-may-not-know.html"&gt;10 new zsh tricks you may not know&amp;hellip;&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-08-13&lt;/a&gt;: /me is listening to &amp;ldquo;There is a light that never goes out&amp;rdquo; by The Smiths&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-08-13&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Generally speaking, if you want to have very very good performance, we should avoid cache misses as much as possible.&amp;rdquo; But Python is prone to having a memory layout that is cache-unfriendly. &amp;mdash; &lt;a href="https://lwn.net/SubscriberLink/1031707/73cb0cf917307a93/"&gt;Python performance myths and fairy tales&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-08-13&lt;/a&gt;: &lt;a href="https://www.etalabs.net/sh_tricks.html"&gt;Rich’s sh (POSIX shell) tricks&lt;/a&gt;: lots of little details indeed. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-08-13&lt;/a&gt;: &lt;a href="https://tangled.sh/@oppi.li/journal"&gt;journaling system cobbled together with nix, vim, coreutils&lt;/a&gt;. How to make things simple. See also &lt;a href="https://www.al3rez.com/todo-txt-journey"&gt;I Tried Every Todo App and Ended Up With a .txt File&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-08-14&lt;/a&gt;: Apparently, external evaluation cells in Wolfram 14.3 are in trouble with personal &lt;code&gt;.Renviron&lt;/code&gt; file. If I remove mine, everything goes well, otherwise I get a permission issue with renv. My &lt;code&gt;$HOME/.Renviron&lt;/code&gt; only modifies the path for renv cache:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;R_LIBS_USER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;~/.local/lib/R/library&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;R_PROFILE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;~/.config/R/Rprofile&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;RENV_CONFIG_USER_PROFILE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;TRUE
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;RENV_PATHS_ROOT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;~/.cache/org.R-project.R/R/renv&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Once R virtual environment is created, I can reinstate my personal config file, and everything is okay, but I guess next time if an R expression that requires to install external dependencies I will face a similar issue. Otherwise, external evaluation cell and the whole &lt;code&gt;ExternalEvaluate&lt;/code&gt; stuff looks pretty interesting.&lt;br&gt;&lt;img src="https://aliquote.org/img/2025-08-14-13-40-05.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-08-18&lt;/a&gt;: TIL about &lt;a href="https://github.com/bgreenwell/doxx"&gt;doxx&lt;/a&gt;, which is a MS docx viewer for the terminal that preserves formatting and provides an interactive experience.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-08-19&lt;/a&gt;: /me is listening to &amp;ldquo;Facility Girls&amp;rdquo; by Soft Cell&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-08-19&lt;/a&gt;: Are you looking for an online NBT editor for minecraft? &lt;a href="https://offroaders123.github.io/Dovetail/"&gt;https://offroaders123.github.io/Dovetail/&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-08-19&lt;/a&gt;: I got tired of &lt;a href="https://aliquote.org/micro/2025-06-12-09-36-20"&gt;NNW&lt;/a&gt; and I&amp;rsquo;m back with Newsboat. The &lt;a href="https://aliquote.org/micro/2025-06-10-09-46-48"&gt;bug&lt;/a&gt; I mentioned earlier on was due to a problem with my config file (probably related to multi-threading).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-08-19&lt;/a&gt;: I tried them all (recently, Ghostty, for a day). My preferred terminal emulator was probably foot, back when I was on Linux.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» ls .config/archived
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;alacritty/ ghostty/ kitty/ matterbridge.toml tig/ zed/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;foot/ helix/ lazygit/ psql/ wezterm/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-08-19&lt;/a&gt;: TIL about &lt;a href="https://brushedtype.co/doppler/"&gt;Doppler&lt;/a&gt;. Drag&amp;rsquo;n drop and just press play. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-08-19&lt;/a&gt;: TIL we can open multiple PDF files as tabs in Preview.app (h/t &lt;a href="https://github.molgen.mpg.de/pages/bs/macOSnotes/mac/mac_texpdf_preview.html#how-can-i-enable-tabs-in-preview"&gt;Burkhard Schmidt&lt;/a&gt;). On Sequoia, the corresponding setting is now in the Desktop and Dock panel. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-08-20&lt;/a&gt;: I recently switched to vi keymap for Zsh. Here are some useful remapping to make it feels smoother:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bindkey -M vicmd &lt;span class="s1"&gt;&amp;#39;~&amp;#39;&lt;/span&gt; vi-swap-case
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bindkey -M vicmd &lt;span class="s1"&gt;&amp;#39;u&amp;#39;&lt;/span&gt; undo
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bindkey -M vicmd &lt;span class="s1"&gt;&amp;#39;U&amp;#39;&lt;/span&gt; redo
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bindkey -M vicmd &lt;span class="s2"&gt;&amp;#34;?&amp;#34;&lt;/span&gt; history-incremental-pattern-search-backward
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bindkey -M vicmd &lt;span class="s2"&gt;&amp;#34;/&amp;#34;&lt;/span&gt; history-incremental-pattern-search-forward
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bindkey -M viins &lt;span class="s1"&gt;&amp;#39;^?&amp;#39;&lt;/span&gt; backward-delete-char &lt;span class="c1"&gt;# backspace&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bindkey -M viins &lt;span class="s1"&gt;&amp;#39;^[[Z&amp;#39;&lt;/span&gt; reverse-menu-complete &lt;span class="c1"&gt;# shift-tab&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bindkey -M viins &lt;span class="s1"&gt;&amp;#39;^a&amp;#39;&lt;/span&gt; beginning-of-line
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bindkey -M viins &lt;span class="s1"&gt;&amp;#39;^e&amp;#39;&lt;/span&gt; end-of-line
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bindkey -M viins &lt;span class="s1"&gt;&amp;#39;^h&amp;#39;&lt;/span&gt; backward-delete-char
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bindkey -M viins &lt;span class="s1"&gt;&amp;#39;^k&amp;#39;&lt;/span&gt; kill-line
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bindkey -M viins &lt;span class="s1"&gt;&amp;#39;^n&amp;#39;&lt;/span&gt; down-history
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bindkey -M viins &lt;span class="s1"&gt;&amp;#39;^p&amp;#39;&lt;/span&gt; up-history
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bindkey -M viins &lt;span class="s1"&gt;&amp;#39;^u&amp;#39;&lt;/span&gt; backward-kill-line
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bindkey -M viins &lt;span class="s1"&gt;&amp;#39;^w&amp;#39;&lt;/span&gt; backward-delete-word
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bindkey -M viins &lt;span class="s1"&gt;&amp;#39;^y&amp;#39;&lt;/span&gt; yank
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;autoload -U edit-command-line
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;zle -N edit-command-line
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bindkey &lt;span class="s1"&gt;&amp;#39;^f&amp;#39;&lt;/span&gt; edit-command-line
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;small&gt;I don&amp;rsquo;t use &lt;code&gt;^r&lt;/code&gt; for backward search since it is managed by Fzf directly.&lt;/small&gt;And in Tmux:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;bind&lt;/span&gt; -T copy-mode-vi u send-keys -X halfpage-up
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;bind&lt;/span&gt; -T copy-mode-vi d send-keys -X halfpage-down
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;bind&lt;/span&gt; -T copy-mode-vi v send-keys -X begin-selection
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;bind&lt;/span&gt; -T copy-mode-vi C-l send-keys -X clear-selection
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;bind&lt;/span&gt; -T copy-mode-vi y send-keys -X copy-selection-and-cancel
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;bind&lt;/span&gt; -T copy-mode-vi &lt;span class="s1"&gt;&amp;#39;C-v&amp;#39;&lt;/span&gt; send-keys -X rectangle-toggle &lt;span class="se"&gt;\;&lt;/span&gt; send -X begin-selection
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;bind&lt;/span&gt; -T copy-mode-vi n send-keys -X search-forward &lt;span class="s2"&gt;&amp;#34;» &amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;bind&lt;/span&gt; -T copy-mode-vi p send-keys -X search-backward &lt;span class="s2"&gt;&amp;#34;» &amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;bind&lt;/span&gt; -T copy-mode-vi / command-prompt -i -I &lt;span class="s2"&gt;&amp;#34;#{pane_search_string}&amp;#34;&lt;/span&gt; -p &lt;span class="s2"&gt;&amp;#34;(search down)&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; send -X search-forward-incremental &lt;span class="s1"&gt;&amp;#39;%%%&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;bind&lt;/span&gt; -T copy-mode-vi ? command-prompt -i -I &lt;span class="s2"&gt;&amp;#34;#{pane_search_string}&amp;#34;&lt;/span&gt; -p &lt;span class="s2"&gt;&amp;#34;(search up)&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; send -X search-backward-incremental &lt;span class="s1"&gt;&amp;#39;%%%&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;%if &lt;span class="s2"&gt;&amp;#34;#{!=:&lt;/span&gt;&lt;span class="nv"&gt;$EDITOR&lt;/span&gt;&lt;span class="s2"&gt;,}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;set&lt;/span&gt; editor &lt;span class="nv"&gt;$EDITOR&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;bind&lt;/span&gt; -T copy-mode-vi C-f send-keys -X pipe-and-cancel &lt;span class="s1"&gt;&amp;#39;xargs -I% tmux send-keys $EDITOR Space % Enter&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;%endif
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Which means in both case you can edit a command or a visual selection in your &lt;code&gt;$EDITOR&lt;/code&gt; using &lt;code&gt;^f&lt;/code&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-08-21&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;More importantly, though, feed readers put your subscriptions under your control. There’s no risk that the administrator of an RSS feed sells your details to spammers, or accidentally leaks them like the aforementioned world renowned expert on account information leaks, because there’s no administrator. If you decide you don’t want to see a particular feed any more, you just instruct your reader to stop fetching it. There’s no sending of mail or clicking of unsubscribe links. Nothing changes in the content creator’s system; they don’t even need to know it happened. &amp;mdash; &lt;a href="https://www.nmichaels.org/musings/simple-syndication/"&gt;Really Simple Syndication&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-08-21&lt;/a&gt;: No more Python or Bash or Javascript to fetch title or other metadata from Youtube link required if you have &lt;a href="https://github.com/yt-dlp/yt-dlp"&gt;yt-dlp&lt;/a&gt; installed on your system:&lt;br&gt;&lt;img src="https://aliquote.org/img/2025-08-21-16-19-25.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-08-21&lt;/a&gt;: Recently I settled on &lt;a href="https://github.com/charmbracelet/glow"&gt;glow&lt;/a&gt; and &lt;a href="https://github.com/bgreenwell/doxx"&gt;doxx&lt;/a&gt;. See also &lt;a href="https://terminaltrove.com"&gt;Terminal Trove&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-08-21&lt;/a&gt;: &lt;a href="https://mavericksforever.com"&gt;Mavericks Forever&lt;/a&gt;. This reminded me that I still have my old &lt;a href="https://aliquote.org/post/os-x-mavericks/"&gt;MacBook Pro&lt;/a&gt; from late 2013, which came with Mavericks pre-installed. I ended up my Apple journey with &lt;a href="https://aliquote.org/post/osx-mojave/"&gt;Mojave&lt;/a&gt; running on a &lt;a href="post/setup-2018/"&gt;Macbook 12”&lt;/a&gt;, which has always been my preferred version of OSX, and one of the best laptop I used to use over the years. Now the MBP is waiting for Ubuntu to upgrade thousand of packages (I haven&amp;rsquo;t used it for two years now) before I perform a &lt;code&gt;do-release-upgrade&lt;/code&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-08-25&lt;/a&gt;: Tonight I updated my default colorscheme (&lt;code&gt;quiet&lt;/code&gt;) in Neovim when I noticed there was a monochrome version. Since we cannot set &lt;code&gt;t_Co&lt;/code&gt; in Neovim, I create a user colorscheme named &lt;code&gt;morequiet&lt;/code&gt; using these specs only. I added a few tweaks for diff mode (I like the look&amp;rsquo;n feel of the &lt;code&gt;quiet&lt;/code&gt; colors in this case) and TODO-like &lt;code&gt;@comment.*&lt;/code&gt; identified by Treesitter. So far so good. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-08-25&lt;/a&gt;: &lt;a href="https://gwern.net/everything"&gt;Everything Is Correlated&lt;/a&gt;. Great article, as always, full of historical references.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-08-25&lt;/a&gt;: &lt;a href="https://thevaluable.dev/vim-browsing-remote-netrw/"&gt;Managing Local and Remote Filesystems with Vim and netrw&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-08-27&lt;/a&gt;: I don&amp;rsquo;t use Cabal that often, and I manage almost everything with Stack. I accidently installed a package (bhoogle) that adds nothing to Hoogle, but there&amp;rsquo;s no &lt;code&gt;cabal delete&lt;/code&gt; or &lt;code&gt;cabal uninstall&lt;/code&gt;, you know. So I simply nuked the whole &lt;code&gt;$HOME/.cabal&lt;/code&gt; directory that GHCup installed for me with an older version of Cabal. And now I can&amp;rsquo;t get it back. Instead, Cabal now follows the &lt;a href="https://github.com/haskell/cabal/pull/7386"&gt;XDG Base Directory Specification&lt;/a&gt;, which means compiled stuff will end up in &lt;code&gt;$HOME/.local/state&lt;/code&gt;. Let&amp;rsquo;s go for another env variable (&lt;code&gt;CABAL_DIR&lt;/code&gt;) then. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-08-27&lt;/a&gt;: Now playing from Apple Music right into Tmux status line!&lt;br&gt;&lt;img src="https://aliquote.org/img/2025-08-27-09-06-55.png" alt="img"&gt;Put this script somewhere in your &lt;code&gt;$PATH&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#!/bin/sh
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;unset&lt;/span&gt; title
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;title&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;osascript -e &lt;span class="s1"&gt;&amp;#39;if application &amp;#34;Music&amp;#34; is running then&amp;#39;&lt;/span&gt; -e &lt;span class="s1"&gt;&amp;#39;tell application &amp;#34;Music&amp;#34; to get name of current track&amp;#39;&lt;/span&gt; -e &lt;span class="s1"&gt;&amp;#39;end if&amp;#39;&lt;/span&gt;&lt;span class="k"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;artist&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;osascript -e &lt;span class="s1"&gt;&amp;#39;if application &amp;#34;Music&amp;#34; is running then&amp;#39;&lt;/span&gt; -e &lt;span class="s1"&gt;&amp;#39;tell application &amp;#34;Music&amp;#34; to get artist of current track&amp;#39;&lt;/span&gt; -e &lt;span class="s1"&gt;&amp;#39;end if&amp;#39;&lt;/span&gt;&lt;span class="k"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;title&lt;/span&gt;&lt;span class="p"&gt;+&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;true&amp;#34;&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$artist&lt;/span&gt;&lt;span class="s2"&gt; ♪ &lt;/span&gt;&lt;span class="nv"&gt;$title&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;small&gt;If you don&amp;rsquo;t mind using the &lt;code&gt;-e&lt;/code&gt; switch as your line separator; otherwise just write a &lt;code&gt;.scpt&lt;/code&gt; file and load it directly.&lt;/small&gt;See &lt;a href="https://gist.github.com/even4void/b207c1e402fd7787e00e6685f843aee1"&gt;this gist&lt;/a&gt; for a more elaborated solution that accounts for both Cmus and Apple Music.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-08-27&lt;/a&gt;: &lt;a href="https://cheats.rs"&gt;Rust Language Cheat Sheet&lt;/a&gt;. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-08-28&lt;/a&gt;: &lt;a href="https://wickstrom.tech/2024-08-12-a-flexible-minimalist-neovim.html"&gt;A Flexible Minimalist Neovim for 2024&lt;/a&gt;. I wish people favor builtin stuff more often, as does the author here, rather than installing every single plugin available on GitHub. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-08-29&lt;/a&gt;: While preparing a short tutorial on using Stack to manage Haskell projects, I noticed that my screenshots include drop shadow from macOS screenshot builtin app. I was reminded that the key is to &lt;code&gt;⇧⌘4&lt;/code&gt;, then press the Space bar as usual, but before clicking hold down the option (&lt;code&gt;⌥&lt;/code&gt;) key. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>ArXiving on August 2025</title><link>https://aliquote.org/post/arxiv-18/</link><pubDate>Tue, 26 Aug 2025 16:22:28 +0200</pubDate><guid>https://aliquote.org/post/arxiv-18/</guid><description>&lt;h3 id="statistical-methods-basic-concepts-interpretations-and-cautions-"&gt;Statistical methods: Basic concepts, interpretations, and cautions (&lt;a href="https://arxiv.org/abs/2508.10168"&gt;https://arxiv.org/abs/2508.10168&lt;/a&gt;)&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;The study of associations and their causal explanations is a central research
activity whose methodology varies tremendously across fields. Even within
specialized subfields, comparisons across textbooks and journals reveals that
the basics are subject to considerable variation and controversy. This
variation is often obscured by the singular viewpoints presented within
textbooks and journal guidelines, which may be deceptively written as if the
norms they adopt are unchallenged. Furthermore, human limitations and the
vastness within fields imply that no one can have expertise across all
subfields and that interpretations will be severely constrained by the
limitations of studies of human populations.
The present chapter outlines an approach to statistical methods that attempts
to recognize these problems from the start, rather than assume they are absent
as in the claims of &amp;lsquo;statistical significance&amp;rsquo; and &amp;lsquo;confidence&amp;rsquo; ordinarily
attached to statistical tests and interval estimates. It does so by grounding
models and statistics in data description, and treating inferences from them as
speculations based on assumptions that cannot be fully validated or checked
using the analysis data.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is a chapter from the 3rd edition of the &lt;em&gt;Handbook of Epidemiology&lt;/em&gt; (Pigeot and Ahrens, eds.). It&amp;rsquo;s been a long time since I haven&amp;rsquo;t read papers or textbook on epidemiology, but I had this one on my bookshelf at some point in my life. This is all about the study of associations and causal relationships outside the field of randomized clinical trials, which are discussed upfront:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The methods thus provide logically sound inferences only in ideal cases, rather
than correct answers for our actual imperfect applications. They are however widely applied and
misinterpreted in studies that fall far short of their assumptions, as when actual participation and
treatment are not random. These problems are only partially accounted for by discussions of
study limitations; occasionally they are further analyzed with speculative models for the non-
random (systematic) aspects of the causal processes generating the data.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;But the simplifying assumptions are a recurring theme in the rest of the chapter, as well as that of a fictional world in which all assumptions hold. There is a very enlightning discussion on $p$-values, how they are often misinterpreted, and how they should be regarded in light of observed data (see pp.19 ff.). And basically, the whole paper is about statistical significance and how not to fool onto the trap of significant or non-signifcant $p$-values. Of note, Bayesian statistics are briefly discussed. I must admit I never encountered a single epidemiological paper using Bayesian inference.&lt;/p&gt;
&lt;h3 id="a-comprehensive-comparison-of-the-wald-wilson-and-adjusted-wilson-confidence-intervals-for-proportions-"&gt;A Comprehensive Comparison of the Wald, Wilson, and adjusted Wilson Confidence Intervals for Proportions (&lt;a href="https://arxiv.org/abs/2508.10223"&gt;https://arxiv.org/abs/2508.10223&lt;/a&gt;)&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;The standard confidence interval for a population proportion covered in the
overwhelming majority of introductory and intermediate statistics textbooks
surprisingly remains the Wald confidence interval despite having a poor
coverage probability, especially for small sample sizes or when the unknown
population proportion is close to either 0 or 1. Using the mean coverage
probability, and for some sample sizes, Agresti and Coull showed not only that
the 95% Wilson confidence interval performs better, but also showed that 95%
adjusted Wilson of type 4 confidence interval, obtained by simply adding four
pseudo-observations, outperforms both the Wald and the Wilson confidence
intervals. In this paper, we introduce a rainbow color code and pixel-color
plots as ways to comprehensively compare the Wald, Wilson, and adjusted-Wilson
of type $\epsilon$ confidence intervals across all sample sizes $n=1, 2, \dots,
1000$, population proportion values $p=0.01, 0.02, \dots, 0.99$, and for the
three typical confidence levels. We show not only that adding 3 (resp., 4 and
6) pseudo-observations is the best for the 90% (resp., 95% and 99%) adjusted
Wilson confidence interval, but it also performs better than both the 90%
(resp., 95% and 99%) Wald and Wilson confidence intervals.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;While two-group comparisons with a continuous outcome are generally easily understood and carried out using a $t$ or Wilcoxon test (although, in the latter case, with bad assumptions), estimating the precision of proportion estimates always rely on Wald confidence intervals, aka the &amp;ldquo;normal approximation&amp;rdquo;. In this case, the proprtion of success is estimated as $\hat p \pm z_{\alpha}\sqrt{\frac{\hat p(1 - \hat p)}{n}}$, where $z_{\alpha}$ is the $1-\alpha/2$ quantile of the standard normal distribution ($z=1.96$ for a 95% confidence interval). An alternative option is to rely on Wilson&amp;rsquo;s CI, and the well-known Agresti-Couli interval provides a very good approximation to it. You may recall that in the case of proportion, the standard error may be computed from the estimated proportion, $\hat p$, which yield Wald CIs, or from the proportion under $H_0$, $p_0$, which is the &lt;a href="https://en.wikipedia.org/wiki/Score_test"&gt;score test&lt;/a&gt; statistic (also called $z$-test in most statistical packages).&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; The Wilson CIs are more tedious to compute (see Formula 2 in the paper and this &lt;a href="https://www.econometrics.blog/post/the-wilson-confidence-interval-for-a-proportion/"&gt;blog post&lt;/a&gt;). The authors describe adjusted Wilson intervals for 90, 95, and 99% confidence level. The color scheme retained for these analyses remain, however, quite surprising.&lt;/p&gt;
&lt;h3 id="better-bootstrap-t-confidence-intervals-for-the-mean-"&gt;Better bootstrap t confidence intervals for the mean (&lt;a href="https://arxiv.org/abs/2508.10083"&gt;https://arxiv.org/abs/2508.10083&lt;/a&gt;)&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;This article explores combinations of weighted bootstraps, like the Bayesian
bootstrap, with the bootstrap $t$ method for setting approximate confidence
intervals for the mean of a random variable in small samples. For this problem
the usual bootstrap $t$ has good coverage but provides intervals with long and
highly variable lengths. Those intervals can have infinite length not just for
tiny $n$, when the data have a discrete distribution. The BC$_a$ bootstrap
produces shorter intervals but tends to severely under-cover the mean.
Bootstrapping the studentized mean with weights from a Beta$(1/2,3/2)$
distribution is shown to attain second order accuracy. It never yields infinite
length intervals and the mean square bootstrap $t$ statistic is finite when
there are at least three distinct values in the data, or two distinct values
appearing at least three times each. In a range of small sample settings, the
beta bootstrap $t$ intervals have closer to nominal coverage than the BC$_a$
and shorter length than the multinomial ootstrap $t$. The paper includes a
lengthy discussion of the difficulties in constructing a utility function to
evaluate nonparametric approximate confidence intervals.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;For small samples and/or skewed data, the Bayesian $t$-test is a good option (see this &lt;a href="https://aliquote.org/post/bayesian-t-test/"&gt;unfinished post&lt;/a&gt; of mine). BCA correction for a bootstrap $t$-test usually undercovers the mean, and other problems appear when we consider the studentized rather than the arithmetic mean. In this paper the authors consider various techniques to overcome limitations arising from small samples and they show that the power law bootstrap $t$ and the beta bootstrap $t$ (decsribed in §2.5) provide good results, the latter being second order accurate.&lt;/p&gt;
&lt;p&gt;See also, Hall, P. (1988). &lt;a href="https://projecteuclid.org/journals/annals-of-statistics/volume-16/issue-3/Theoretical-Comparison-of-Bootstrap-Confidence-Intervals/10.1214/aos/1176350933.full"&gt;Theoretical comparisons of bootstrap confidence intervals&lt;/a&gt;. The Annals of Statistics, 16(3):927–953.&lt;/p&gt;
&lt;h3 id="dissecting-microbial-community-structure-and-heterogeneity-via-multivariate-covariate-adjusted-clustering-"&gt;Dissecting Microbial Community Structure and Heterogeneity via Multivariate Covariate-Adjusted Clustering (&lt;a href="https://arxiv.org/abs/2508.11036"&gt;https://arxiv.org/abs/2508.11036&lt;/a&gt;)&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;In microbiome studies, it is often of great interest to identify clusters or
partitions of microbiome profiles within a study population and to characterize
the distinctive attributes of each resulting microbial community. While raw
counts or relative compositions are commonly used for such analysis, variations
between clusters may be driven or distorted by subject-level covariates,
reflecting underlying biological and clinical heterogeneity across individuals.
Simultaneously detecting latent communities and identifying covariates that
differentiate them can enhance our understanding of the microbiome and its
association with health outcomes. To this end, we propose a
Dirichlet-multinomial mixture regression (DMMR) model that enables joint
clustering of microbiome profiles while accounting for covariates with either
homogeneous or heterogeneous effects across clusters. A novel symmetric link
function is introduced to facilitate covariate modeling through the
compositional parameters. We develop efficient algorithms with convergence
guarantees for parameter estimation and establish theoretical properties of the
proposed estimators. Extensive simulation studies demonstrate the effectiveness
of the method in clustering, feature selection, and heterogeneity detection. We
illustrate the utility of DMMR through a comprehensive application to
upper-airway microbiota data from a pediatric asthma study, uncovering distinct
microbial subtypes and their associations with clinical characteristics.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I had to help a student two years ago for a microbial analysis, and she found an arcane R package on GitHub which relied on Spearman correlation of table of counts, IIRC, and allowed to build a network of co-occurring species, but this didn&amp;rsquo;t allow to take into account co-factors of interest. Unfortunately, the experimental design was flawed, so the analysis ended up early. It is interesting to see that covariates can be taken into account in the analysis of such large dataset .&lt;/p&gt;
&lt;h3 id="what-makes-a-study-design-quasi-experimental-the-case-of-difference-in-differences-"&gt;What makes a study design quasi-experimental? The case of difference-in-differences (&lt;a href="https://arxiv.org/abs/2508.13945"&gt;https://arxiv.org/abs/2508.13945&lt;/a&gt;)&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;Study designs classified as quasi- or natural experiments are typically
accorded more face validity than observational study designs more broadly.
However, there is ambiguity in the literature about what qualifies as a
quasi-experiment. Here, we attempt to resolve this ambiguity by distinguishing
two different ways of defining this term. One definition is based on
identifying assumptions being uncontroversial, and the other is based on the
ability to account for unobserved sources of confounding (under assumptions).
We argue that only the former deserves an additional measure of credibility for
reasons of design. We use the difference-in-differences approach to illustrate
our discussion.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This papers provides a use case of difference-in-differences, and its relation with the parallel trends assumption, which usually holds if the exposure is randomly assigned. Random treatment allocation, however, does not mean we need to use a DID estimator, and post-treatment comparison should be preferred.&lt;/p&gt;
&lt;h3 id="perspective-an-outlook-on-fluorescence-tracking-"&gt;Perspective: An outlook on fluorescence tracking (&lt;a href="https://arxiv.org/abs/2508.13668"&gt;https://arxiv.org/abs/2508.13668&lt;/a&gt;)&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;Tracking single fluorescent molecules has offered resolution into dynamic
molecular processes at the single-molecule level. This perspective traces the
evolution of single-molecule tracking, highlighting key developments across
various methodological branches within fluorescence microscopy. We compare the
strengths and limitations of each approach, ranging from conventional widefield
offline tracking to real-time confocal tracking. In the final section, we
explore emerging efforts to advance physics-inspired tracking techniques, a
possibility for parallelization and artificial intelligence, and discuss
challenges and opportunities they present toward achieving higher
spatiotemporal resolution and greater computational and data efficiency in
next-generation single-molecule studies.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;For someone like me who deal with data coming from cellular biology, this provides an excellent overview of fluorescence microscopy.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Stone Temple Pilots • &lt;em&gt;Crackerman&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;See also &lt;a href="https://aliquote.org/post/coin-tossing-experiment/"&gt;Coin tossing experiment: Score and Wald tests&lt;/a&gt;.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Mathematica shorthand notation</title><link>https://aliquote.org/post/mathematica-shorthand-notation/</link><pubDate>Sat, 23 Aug 2025 10:23:40 +0200</pubDate><guid>https://aliquote.org/post/mathematica-shorthand-notation/</guid><description>&lt;p&gt;Like APL, J or Haskell, Wolfram comes up with a lot of shorthand notation, in addition to the prefix, postfix or infix notation. For instance, you can write &lt;code&gt;Normal[•]&lt;/code&gt; or &lt;code&gt;• // Normal&lt;/code&gt;, where &lt;code&gt;•&lt;/code&gt; is any valid Wolfram expression. Here is a brief list of what I&amp;rsquo;ve collected over the years, &lt;a href="https://mathematica.stackexchange.com/questions/18393/what-are-the-most-common-pitfalls-awaiting-new-users/25616#25616"&gt;from&lt;/a&gt; &lt;a href="https://reference.wolfram.com/language/howto/UseShorthandNotations.html"&gt;various&lt;/a&gt; &lt;a href="http://xahlee.info/M/WolframLang_syntax.html"&gt;sources&lt;/a&gt;. Usually, I tend to stick to plain text expression (so called circumfix notation), i.e. &lt;code&gt;Length[{1,2,3}]&lt;/code&gt; rather than &lt;code&gt;Length@{1,2,3}&lt;/code&gt; or &lt;code&gt;{1,2,3}//Length&lt;/code&gt;. I tend to use the &lt;code&gt;//&lt;/code&gt; postfix notation for things like &lt;code&gt;Normal&lt;/code&gt; or &lt;code&gt;MatrixForm&lt;/code&gt;. The only exception is for pure function and &lt;code&gt;Apply&lt;/code&gt; (&lt;code&gt;@@&lt;/code&gt;) or &lt;code&gt;Map&lt;/code&gt; (&lt;code&gt;/@&lt;/code&gt;). Sometimes I combine them all, like in the example provided on Wolfram &lt;a href="https://reference.wolfram.com/language/howto/UseShorthandNotations.html"&gt;Howto&amp;rsquo;s&lt;/a&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;#&lt;/span&gt;&lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/@&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Anyway, here&amp;rsquo;s the list of expression that I am aware of:&lt;/p&gt;
&lt;small&gt;
&lt;table border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;Expression&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;&lt;em&gt;Alternative&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;&lt;em&gt;Role&lt;/em&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;@&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code&gt;f[•]&lt;/code&gt;&lt;td&gt;function application&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;/@&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code&gt;Map[f, •]&lt;/code&gt;&lt;/td&gt;&lt;td&gt;map function to list&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;//@&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code&gt;MapAll[f, •]&lt;/code&gt;&lt;/td&gt;&lt;td&gt;map function to every subexpression&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;@@&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code&gt;Apply[f, •]&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Apply list to function&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;@@@&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code&gt;Apply[f, •, {1}]&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Apply list to function at first level&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;@*&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code&gt;Composition[f, g]&lt;/code&gt;&lt;/td&gt;&lt;td&gt;composition of functions, e.g. &lt;code&gt;f[g[x]]&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;/*&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code&gt;RightComposition[f, g]&lt;/code&gt;&lt;/td&gt;&lt;td&gt;right composition of functions, e.g. &lt;code&gt;g[f[x]]&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;&gt;&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code&gt;StringJoin[•, •]&lt;/code&gt;&lt;/td&gt;&lt;td&gt;concatenate string&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;/.&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code&gt;Replace[•, •]&lt;/code&gt;&lt;/td&gt;&lt;td&gt;replace expression by pattern&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;//=&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code&gt;ApplyTo[•, f]&lt;/code&gt;&lt;/td&gt;&lt;td&gt;assignment with function application&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;+=&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code&gt;AddTo[•, •]&lt;/code&gt;&lt;/td&gt;&lt;td&gt;like in C or Python&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;++&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code&gt;Increment[•]&lt;/code&gt;&lt;/td&gt;&lt;td&gt;like in C&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;/.&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code&gt;ReplaceAll[•, •]&lt;/code&gt;&lt;/td&gt;&lt;td&gt;applies a rule to transform each subpart of an expression&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;;;&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code&gt;Span[•, •]&lt;/code&gt;&lt;/td&gt;&lt;td&gt;span of elements from start to stop&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;{}&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code&gt;List[•]&lt;/code&gt;&lt;td&gt;create a list&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;#^2&amp;[3]&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code&gt;Function[x, x^2][3]&lt;/code&gt;&lt;td&gt;example of a pure function&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/small&gt;
&lt;p&gt;I don&amp;rsquo;t know of any shortcut for &lt;code&gt;Thread&lt;/code&gt; or &lt;code&gt;MapThread&lt;/code&gt;&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Evanescence • &lt;em&gt;Bring Me to Life&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Loess fitting in Mathematica</title><link>https://aliquote.org/post/loess-fitting-mathematica/</link><pubDate>Thu, 21 Aug 2025 08:57:48 +0200</pubDate><guid>https://aliquote.org/post/loess-fitting-mathematica/</guid><description>&lt;p&gt;Wolfram, né Mathematica, 14.3 introduced a cool new feature for graphical exploratory data analysis: loess fitting. It is already discussed at length on Stephen Wolfram&amp;rsquo;s &lt;a href="https://writings.stephenwolfram.com/2025/08/new-features-everywhere-launching-version-14-3-of-wolfram-language-mathematica/"&gt;blog post&lt;/a&gt; about this last release, but I was interested in trying it myself. Needless to say I don&amp;rsquo;t do much applied statistical work these days. I miss compitational statistics a lot and I expect to come back to it at some point, though.&lt;/p&gt;
&lt;p&gt;Without further ado, let&amp;rsquo;s consider data analyzed in this &lt;a href="https://even4void.github.io/rstats-biostats/practical02.html"&gt;old course&lt;/a&gt; of mine, specifically the FEV dataset. It is &lt;a href="https://aliquote.org/pub/fev.rds"&gt;available&lt;/a&gt; in R format, which is well managed by the omnibus &lt;code&gt;Import&lt;/code&gt; function:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Import&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;fev.rds&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Dataset&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;;;&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;All&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We are interested in describing the relationship between the FEV (&lt;code&gt;fev&lt;/code&gt;) and age (&lt;code&gt;age&lt;/code&gt;) in male and female (&lt;code&gt;sex&lt;/code&gt;). Here is a basic scatterplot:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ListPlot&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;age&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;fev&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The Wolfram help center does a good job at explaining what is LOESS smoothing. Here we are interested in small departure from the linearity assumption in usual OLS.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2025-08-22-09-10-25.png"&gt;
&lt;/figure&gt;
&lt;p&gt;There are various ways to displays a scatterplot smoother. First, we can just fit a local smoother:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;LocalModelFit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ToTabular&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;All&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;age&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;fev&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;}]]]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We use the tabular data structure introduced in version 14.2. It returns a FittedModel, like other statistical models in Wolfram (e.g., &lt;code&gt;LinearModelFit&lt;/code&gt;), although there&amp;rsquo;s no best fitting model such that we cannot use &lt;code&gt;Normal&lt;/code&gt; (despite what the online help says about the &amp;ldquo;BestFit&amp;rdquo; slot), We can obtained the predicted (interpolated) values using the &amp;ldquo;PredictedResponse&amp;rdquo; slot.&lt;/p&gt;
&lt;p&gt;Here is another way to perform the same task: we can directly ask for a plot using &lt;code&gt;ListPlot[data[All, {&amp;quot;age&amp;quot;, &amp;quot;fev&amp;quot;}], PlotFit -&amp;gt; &amp;quot;Local&amp;quot;]&lt;/code&gt;. We could also work directly with a list of pairwise values, instead of association lists:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;trend&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;LocalModelFit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;@@@&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Normal&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;All&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;age&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;fev&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;}]]];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Show&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ListPlot&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;All&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;age&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;fev&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;}]],&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Plot&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;trend&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;18&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;PlotRange&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;All&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;PlotStyle&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Red&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;PlotRange&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;All&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Finally, we can fit a separate loess curve for male and female using &lt;code&gt;GroupBy&lt;/code&gt; on the structured dataset:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;GroupBy&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;All&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;age&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;fev&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;sex&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;}],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;sex&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;][[&lt;/span&gt;&lt;span class="n"&gt;All&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;All&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;male&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;LocalModelFit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;@@@&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Normal&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]]]];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;female&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;LocalModelFit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;@@@&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Normal&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]]]];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Show&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ListPlot&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;PlotStyle&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Blue&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;PlotLabels&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Placed&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Male&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Above&lt;/span&gt;&lt;span class="p"&gt;]],&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Plot&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;male&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;18&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;PlotStyle&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Blue&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ListPlot&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;PlotStyle&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Orange&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;PlotLabels&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Placed&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Female&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Below&lt;/span&gt;&lt;span class="p"&gt;]],&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Plot&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;female&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;18&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;PlotStyle&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Orange&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Frame&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ImageSize&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Large&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;FrameLabel&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Age (yr.)&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;FEV (l/s)&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/fev-wolfram.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Of course, we could also play with the bandwidth parameter, as illustrated in &lt;a href="https://mathematica.stackexchange.com/a/314903"&gt;this example&lt;/a&gt; on Stack Exchange.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Cats on Trees • &lt;em&gt;Sirens Call&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>XDG Base Directory and macOS</title><link>https://aliquote.org/post/xdg-specs-on-macos/</link><pubDate>Thu, 14 Aug 2025 17:59:34 +0200</pubDate><guid>https://aliquote.org/post/xdg-specs-on-macos/</guid><description>&lt;p&gt;Last month I spent a few hours configuring my system (macOS Sequoia) to follow the &lt;a href="https://specifications.freedesktop.org/basedir-spec/latest/"&gt;XDG Base Directory Specification&lt;/a&gt;. I like the idea of having common paths defined for most applications. It worked quite well for me on Ubuntu, and I wanted to &lt;a href="https://aliquote.org/micro/2025-03-10-12-44-08/"&gt;declutter&lt;/a&gt; my &lt;code&gt;$HOME&lt;/code&gt; dotfiles.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2025-08-26]&lt;/small&gt;&lt;br&gt;
Two weeks later, I came across this blog post by Rebecca Turner on &lt;a href="https://becca.ooo/blog/macos-dotfiles/"&gt;macOS and user configuration files&lt;/a&gt;. I share her thoughts about &amp;ldquo;When should you use ~/Library/Application Support&amp;rdquo;, and I always expected other devs do too. &lt;a href="https://github.com/kruseio/hygg"&gt;Hygg&lt;/a&gt; is a nice alternative to &lt;a href="https://github.com/bgreenwell/doxx"&gt;doxx&lt;/a&gt;, and in addition it supports PDF and EPUB, but its configuration and state files are written in &lt;code&gt;$HOME/Library&lt;/code&gt;.
&lt;/div&gt;
&lt;p&gt;I already follow part of the XDG specs by putting everything I can in &lt;code&gt;$HOME/.config&lt;/code&gt;. I also make heavy use of &lt;code&gt;$HOME/.local&lt;/code&gt; to store additional programs (&lt;code&gt;/bin&lt;/code&gt;), libraries (&lt;code&gt;/lib&lt;/code&gt;) and extra stuff (&lt;code&gt;share&lt;/code&gt;). To automate things a little I defined specific environment variables to point to the right directories. Here is what I have in my &lt;code&gt;$HOME/.config/profile.d/00-path.sh&lt;/code&gt; which is sourced for every login shell (Apple Terminal use login shell by default):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;XDG_CONFIG_HOME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/.config&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;XDG_CACHE_HOME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/.cache&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;XDG_DATA_HOME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/.local/share&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;XDG_STATE_HOME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/.local/state&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;TERMINFO&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/usr/share/terminfo/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;LEIN_HOME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$XDG_CONFIG_HOME&lt;/span&gt;/leiningen
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;HOMEBREW_NO_EMOJI&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;HOMEBREW_NO_AUTO_UPDATE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;W3M_DIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$XDG_STATE_HOME&lt;/span&gt;/w3m
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;SQLITE_HISTORY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$XDG_STATE_HOME&lt;/span&gt;/sqlite_history
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;LESSHISTFILE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$XDG_STATE_HOME&lt;/span&gt;/less_history
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;PYTHON_HISTORY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$XDG_STATE_HOME&lt;/span&gt;/python_history
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;NCFTPDIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$XDG_CONFIG_HOME&lt;/span&gt;/ncftp
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;GNUPGHOME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$XDG_CONFIG_HOME&lt;/span&gt;/gnupg
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;IPYTHONDIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$XDG_CONFIG_HOME&lt;/span&gt;/ipython
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;JUPYTER_CONFIG_DIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$XDG_CONFIG_HOME&lt;/span&gt;/jupyter
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;MYPY_CACHE_DIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$XDG_CACHE&lt;/span&gt;/.mypy_cache
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;MPLCONFIGDIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$XDG_CONFIG_HOME&lt;/span&gt;/matplotlib
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;CHICKEN_DOC_REPOSITORY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;/.local/lib/scheme/chicken-doc
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;CHICKEN_EGG_CACHE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$XDG_CACHE&lt;/span&gt;/chicken
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;CHICKEN_INSTALL_REPOSITORY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;/.local/lib/scheme/chicken
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;CL_SOURCE_REGISTRY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;/cwd/common-lisp
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# export PKG_CONFIG_PATH=/opt/homebrew/lib/pkgconfig&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Yes, that&amp;rsquo;s a lot of global settings. Also, please note that the aim is not to follow &lt;em&gt;stricto sensu&lt;/em&gt; the XDG specs, just to organise things a little. The first four lines are what is of interest in this case. Things get a little more interesting when we read the documentation related to Python and its ecosystem as we learn that we can modify the default path for the IPython or Jupyter config directory, as well as Matplotlib, or get ride of Mypy stuff. I use &lt;code&gt;$XDG_STATE_HOME&lt;/code&gt; to store all my histories (zsh, sqlite, etc.). By defining such environment variables I was able to remove almost everything in my home directory. I know we can move &lt;a href="https://ghcup.readthedocs.io/en/latest/"&gt;GHCUp&lt;/a&gt;, &lt;a href="https://rustup.rs"&gt;rustup&lt;/a&gt;, and other frameworks to other places, but I prefer to keep them in place. Here is the whole picture:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» ls -a ~
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;./ .config/ .juliaup/ .ssh/ cwd/ Music/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;../ .cups/ .local/ .stack/ Desktop/ Pictures/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.cabal/ .deno/ .mail/ .Trash/ Documents/ Public/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.cache/ .DS_Store .Renviron .zprofile Downloads/ Sites/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.cargo/ .ghcup/ .roswell/ .zshenv@ Library/ tmp/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.CFUserTextEncoding .julia/ .rustup/ backup/ Movies/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» ls ~/.config
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;asciinema/ gh/ htop/ leiningen/ neomutt/ racketrc wtwitch/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bandcamp-dl.json ghc/ ipython/ matplotlib/ newsboat/ ripgreprc yt-dlp/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;beets/ ghostty/ irssi/ mdlrc npm/ starship.toml zed/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;clojure/ git/ isyncrc mpv/ nvim/ tmux/ zsh/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cmus/ gnupg/ jupyter/ msmtp/ profile.d/ uv/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ctags/ gnuplot/ latexmk/ ncftp/ R/ w3m/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» ls ~/.cache
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bibtex-ls/ gh/ m2/ neomutt/ stack/ wtwitch/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;chicken/ ghcide/ matplotlib/ nvim/ starship/ yt-dlp/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;clojure-lsp/ hie-bios/ maven/ org.R-project.R/ textual/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;common-lisp/ lua-language-server/ mu/ slime/ uv/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Everything zsh-related can be stored in &lt;code&gt;XDG_CONFIG_HOME&lt;/code&gt;, provided you define the &lt;code&gt;ZDOTDIR&lt;/code&gt; location. Here is what I put in &lt;code&gt;$HOME/.zprofile&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;ZDOTDIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;/.config/zsh
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; file in &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;/.config/profile.d/*.sh&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; . &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note that the &lt;code&gt;zsh&lt;/code&gt; config file (&lt;code&gt;zshrc&lt;/code&gt;) will still need to be prefixed by a dot. I also symlink &lt;code&gt;$HOME/.zshenv&lt;/code&gt; to &lt;code&gt;$HOME/.zprofile&lt;/code&gt; to avoid issue with some CLI tools that won&amp;rsquo;t initialize zsh as a login shell (e.g., Neovim terminal). I guess it&amp;rsquo;s not difficult to avoid this issue, but I&amp;rsquo;m lazy as you know.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Hooverphonic • &lt;em&gt;Mad About You&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>I am a recovering Mac user</title><link>https://aliquote.org/post/recovering-mac-user/</link><pubDate>Wed, 13 Aug 2025 02:16:54 +0200</pubDate><guid>https://aliquote.org/post/recovering-mac-user/</guid><description>&lt;p&gt;It&amp;rsquo;s been a little more than 6 months that I got back to using a MacBook as my daily driver. The laptop I use is a MacBook Pro M4 14″, with 24 Go of RAM and 14 cores (10 performance + 4 efficiency; also 20 cores for the inbuilt GPU). The screen is a Retina 3024 x 1964, which I use at its default resolution It&amp;rsquo;s just a beast among all of the MacBook I have own over my entire life. It&amp;rsquo;s also the first Mac machine I didn&amp;rsquo;t bought myself. The only thing I miss is the the lightness of the 12-inch MacBook, but I definitely do not regret the shitty keyboard on that machine.&lt;/p&gt;
&lt;p&gt;Still, I don&amp;rsquo;t use most of what Apple offers nowadays. I don&amp;rsquo;t use Apple Intelligence (ChatGPT in disguise if I understand correctly), I don&amp;rsquo;t use iCloud sync for my Documents (just for casual PDFs or images I want to share with my iPhone or other machines via iCloud on the web), and above all I barely use any Mac apps except Apple Mail, Safari, Music, Photos and the Terminal. Other than that, I also use Messages (better to type on my MacBook, now that it has a decent keyboard), Preview (I only miss synctex support), and that&amp;rsquo;s pretty all! I usually have only one or two apps visible at the same time on my desktop and I rarely use the new window tiling facilities introduced in recent version of macOS.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2025-08-13-02-36-14.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Previous posts are all about the &lt;a href="https://aliquote.org/post/on-leaving-mac-apps/"&gt;same&lt;/a&gt; &lt;a href="https://aliquote.org/post/bye-bye-apple/"&gt;story&lt;/a&gt;. Mots of what I need is managed by Homebrew and various command-line utilities I built over the years. I could easily replace Mail and Music with Neomutt and Cmus. In fact, I keep my emails synchronized in a xapian database managed via &lt;a href="https://www.djcbsoftware.nl/code/mu/"&gt;mu&lt;/a&gt;, and in macOS own mbox format. Oftentimes I find myself using Neomutt for boring tasks like deleting and archiving a bunch of emails, which I prefer to Apple Mail. I use Time Machine for a daily backup on an external SSD, but I also have hourly backups handled by &lt;a href="https://kopia.io"&gt;Kopia&lt;/a&gt;, which never failed in the past 4 or 5 years.&lt;/p&gt;
&lt;p&gt;I only installed the command-line tools, not XCode. The biggest app I have in my Applications folder is Mathematica. I think I don&amp;rsquo;t need to add an extra 10 Go slot for an application I won&amp;rsquo;t use except for Instruments.app, maybe. In sum, my &lt;a href="https://aliquote.org/post/setup-2018/"&gt;setup&lt;/a&gt; hasn&amp;rsquo;t changed a lot, except I no longer use Emacs and I barely do any serious statistical stuff using R these days.&lt;/p&gt;
&lt;p&gt;To sum up, the M4 Pro is a great MacBook (I&amp;rsquo;m happy I didn&amp;rsquo;t have to pay the bill myself), as much for its design as for its hardware capabilities. As I said, software coming along the MacBook are pretty okay and integrate well together. This is a big win compared to what comes natively on any Linux-based distro. Above all, I like how &lt;a href="https://blog.xoria.org/macos-tips/"&gt;macOS feels like a rather unique operating system&lt;/a&gt; despite the fact that I barely use the mouse for interacting with the OS. I like things that look simple in macOS and not in other OSes, and I like that it doesn&amp;rsquo;t crash or update all way long. I&amp;rsquo;m definitely feeling older, and I think I can&amp;rsquo;t move back now. Also, my work habits and technical requirements have changed. I mostly work on remote servers these days, and do casual stuff that don&amp;rsquo;t require much CPU or GPU power. When I&amp;rsquo;m back at home, this laptop is a mean to process my email, write some code for fun, play Minecraft (I can now enable shaders or play full vanilla at 120 fps!), or listen to music relayed through AirPlay. Well, I&amp;rsquo;m no longer looking for performance, just stability, that is things that don&amp;rsquo;t break every three months or so. That&amp;rsquo;s also why I don&amp;rsquo;t have so many Neovim plugins (only 5), no Tmux or zsh plugin manager, and so on. I want to use my computer, not spend time tinkering my setup.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Alice on the Roof • &lt;em&gt;Easy Come Easy Go&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in July</title><link>https://aliquote.org/post/micro-07-2025/</link><pubDate>Wed, 30 Jul 2025 11:26:36 +0200</pubDate><guid>https://aliquote.org/post/micro-07-2025/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-07-07&lt;/a&gt;: I often want to delete a line matching a pattern in Vim, as well as, say, the next one. Here&amp;rsquo;s how to do it: &lt;code&gt;:g/pattern/.,+1d&lt;/code&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-07-07&lt;/a&gt;: TIL about the &lt;a href="https://data-star.dev"&gt;Datastar&lt;/a&gt; framework. Looks good and a bit different from HTMX.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-07-07&lt;/a&gt;: &lt;a href="https://jacob.gold/posts/serving-200-million-requests-with-cgi-bin/"&gt;Serving 200 million requests per day with a cgi-bin&lt;/a&gt; (via &lt;a href="https://simonwillison.net/2025/Jul/5/cgi-bin-performance/"&gt;Simon Willison&lt;/a&gt;). I built many online quizzes and online survey using cgi-bin back in the days.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-07-09&lt;/a&gt;: &lt;a href="https://github.com/koji-kojiro/cl-repl"&gt;cl-repl&lt;/a&gt; looks much better than linedit which is still broken, btw. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-07-10&lt;/a&gt;: If you want to disable syntax highlighting in Neovim 0.11+, you&amp;rsquo;ll need to disable lsp-semantic_tokens (&lt;code&gt;lua vim.lsp-semantic_tokens.Stop(0, 1)&lt;/code&gt;), in addition to treesitter (&lt;code&gt;TSBufDisable highlight&lt;/code&gt;; if you rely on Treesitter, it should disable stock syntax, &lt;code&gt;syntax off&lt;/code&gt;). Better off using the &lt;code&gt;quiet&lt;/code&gt; colorscheme as I do for quite a few months now. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-07-10&lt;/a&gt;: New kid on the blocks: &lt;a href="https://jank-lang.org"&gt;jank&lt;/a&gt;, based on Clojure but with an LLVM-based JIT backend.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-07-10&lt;/a&gt;: &lt;a href="https://eugeneyan.com/writing/uncommon-python/"&gt;Uncommon Uses of Python in Commonly Used Libraries&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-07-15&lt;/a&gt;: /me is listening to &amp;ldquo;Pictures on My Wall&amp;rdquo; by Echo &amp;amp; the Bunnymen&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-07-15&lt;/a&gt;: An old series of [blog posts](Debugging Lisp Part 1: Recompilation) on debugging Lisp. The author also covered &lt;a href="https://malisper.me/loops-in-lisp-part-1-goto/"&gt;series&lt;/a&gt; and various macros. Be aware there&amp;rsquo;s no index, though. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-07-15&lt;/a&gt;: &lt;a href="https://blog.decryption.net.au/posts/macpaint.html"&gt;MacPaint Art From The Mid-80s Still Looks Great Today&lt;/a&gt;. Oldies but goodies. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-07-15&lt;/a&gt;: &lt;a href="https://gpanders.com/blog/state-of-the-terminal/"&gt;State of the Terminal&lt;/a&gt;: A nice review with lot of technical discussion on key encoding and the xterm-256color falaccy. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-07-15&lt;/a&gt;: &lt;a href="https://macos-defaults.com"&gt;macOS defaults list&lt;/a&gt;: Useful if you&amp;rsquo;re looking for a particular settings that you&amp;rsquo;d like to update in your terminal. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-07-16&lt;/a&gt;: I don&amp;rsquo;t even know what to think about this, but it was interesting to read: &lt;a href="https://herecomesthemoon.net/2024/11/leetcode-with-racket/"&gt;Solving LeetCode™ problems with Racket&lt;/a&gt;. &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-07-16&lt;/a&gt;: Since I haven&amp;rsquo;t looked back at my Neovim config for months, except for fixing occasional deprecations or API changes, I&amp;rsquo;m just reviewing how past projects evolved over time. I noticed that Lazyvim no longer relies on telescope but is now using fzf, which is great. It looks like &lt;a href="https://cmp.saghen.dev/recipes"&gt;Blink&lt;/a&gt; is the new rockstar for auto-completion. I only use builtin Vim stuff, but it looks nice. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-07-16&lt;/a&gt;: &lt;a href="https://bleuje.com/physarum-explanation/"&gt;Algorithms for making interesting organic simulations&lt;/a&gt;: Lot of interesting stuff, which reminds me of Anders Hoff&amp;rsquo;s work at &lt;a href="https://inconvergent.net"&gt;https://inconvergent.net&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-07-17&lt;/a&gt;: /me is listening to &amp;ldquo;Unsent&amp;rdquo; by Minuit Macine&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-07-20&lt;/a&gt;: /me is listening to &amp;ldquo;Salute Your Solution&amp;rdquo; by The Raconteurs&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-07-20&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Nowadays, Apple includes the system upgrades in the upfront cost of its computers, so the incentive to constantly roll out ten or twenty or three hundred “new features” should be lower. Inexplicably, since the company adopted that no extra charge, yearly release cadence, it has seemingly been more reticent to do a disciplined “Snow” release, no matter how necessary. &amp;mdash; &lt;a href="https://reviews.ofb.biz/safari/article/1300.html"&gt;Apple Needs a Snow Sequoia&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-07-20&lt;/a&gt;: &lt;a href="https://mattrighetti.com/2023/03/16/cool-python-functions"&gt;Cool Python Functions&lt;/a&gt;. I already came across this post a while ago, but it&amp;rsquo;s interesting to read or reread, especially on how to iterate backward or how to merge two dictionnaries. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-07-21&lt;/a&gt;: I spent some time figuring out why my Zsh startup time became so slow over time. Initially I thought about &lt;code&gt;compinit&lt;/code&gt;, and I added this fix mentioned everywhere on the internet (read &lt;code&gt;zcompdump&lt;/code&gt; once per day):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# autoload -U compinit &amp;amp;&amp;amp; compinit&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;autoload -Uz compinit
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="k"&gt;$(&lt;/span&gt;date +&lt;span class="s1"&gt;&amp;#39;%j&amp;#39;&lt;/span&gt;&lt;span class="k"&gt;)&lt;/span&gt; !&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;$(&lt;/span&gt;stat -f &lt;span class="s1"&gt;&amp;#39;%Sm&amp;#39;&lt;/span&gt; -t &lt;span class="s1"&gt;&amp;#39;%j&amp;#39;&lt;/span&gt; ~/.config/zsh/.zcompdump&lt;span class="k"&gt;)&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; compinit
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;else&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; compinit -C
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This helped, but the real culprint was NVM which considerably slows down Zsh startup with its loading script &lt;code&gt;nvm.sh&lt;/code&gt;. I use the &lt;a href="https://superuser.com/a/1611283"&gt;following trick&lt;/a&gt;. In retrospect, &lt;code&gt;compinit&lt;/code&gt; isn&amp;rsquo;t accounting for that much time when checked agaisnt &lt;code&gt;zprof&lt;/code&gt;, but Zsh now starts like a breeze again:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;~/.config/zsh
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» &lt;span class="nb"&gt;time&lt;/span&gt; zsh -i -c &lt;span class="nb"&gt;exit&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Saving session...completed.zsh -i -c &lt;span class="nb"&gt;exit&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;0,03s user 0,03s system 90% cpu 0,073 total
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-07-21&lt;/a&gt;: Still wasting time looking at possible micro-optimizations on the CLI side. The MacBook M4 Pro is a beast, and I found it reduced by a fair amount (~ 40%) Neovim startup time. Digging into how fast it starts now (using [vim-startuptime](https://github.com/rhysd/vim-startuptime) and hyperfine), I found the following:
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;scratch master* 2m44s
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» hyperfine &lt;span class="s2"&gt;&amp;#34;nvim --headless +qa&amp;#34;&lt;/span&gt; --warmup &lt;span class="m"&gt;5&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Benchmark 1: nvim --headless +qa
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Time &lt;span class="o"&gt;(&lt;/span&gt;mean ± σ&lt;span class="o"&gt;)&lt;/span&gt;: 32.5 ms ± 0.4 ms &lt;span class="o"&gt;[&lt;/span&gt;User: 19.0 ms, System: 7.1 ms&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Range &lt;span class="o"&gt;(&lt;/span&gt;min … max&lt;span class="o"&gt;)&lt;/span&gt;: 31.4 ms … 33.7 ms &lt;span class="m"&gt;85&lt;/span&gt; runs
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;scratch master*
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» vim-startuptime --vimpath nvim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Extra options: &lt;span class="o"&gt;[]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Measured: &lt;span class="m"&gt;10&lt;/span&gt; &lt;span class="nb"&gt;times&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Total Average: 22.782900 msec
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Total Max: 28.338000 msec
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Total Min: 21.359000 msec
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; AVERAGE MAX MIN
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;------------------------------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;14.312000 18.240000 13.348000: /Users/chl/.config/nvim/init.lua
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 5.226100 6.687000 4.827000: require&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;fzf-lua&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 2.576100 3.206000 2.425000: require&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;nvim-treesitter.configs&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 2.393600 2.972000 2.255000: require&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;nvim-treesitter.query&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 2.110400 2.705000 1.979000: require&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;vim.lsp&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 1.709600 2.168000 1.511000: require&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;fzf-lua.config&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 1.443200 1.824000 1.330000: require&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;fzf-lua.path&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 1.227300 1.388000 1.181000: loading rtp plugins
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 1.133800 1.385000 1.052000: require&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;nvim-treesitter.tsrange&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 1.064300 1.333000 1.004000: require&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;nvim-treesitter.compat&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 1.053900 1.290000 0.977000: require&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;nvim-treesitter.ts_utils&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 1.016600 1.270000 0.961000: require&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;vim.treesitter&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 0.990800 1.184000 0.943000: /Users/chl/.config/nvim/plugin/lisp.lua
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 0.973200 1.165000 0.927000: nvim_exec2&lt;span class="o"&gt;()&lt;/span&gt; called at /Users/chl/.config/nvim/plugin/lisp.lua:0
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;lisp.lua&lt;/code&gt; custom plugin is just here to load slimv which sits as an optional plugin, and so I realized that there was no gain in this case. Better to leave it as a start plugin and remove the custom plugin itself. It makes no difference whatsoever. It&amp;rsquo;s still much higher than &lt;a href="https://aliquote.org/post/speed-up-neovim/"&gt;three years&lt;/a&gt; ago when I was using a proper package manager and much less Lua code in my &lt;code&gt;init.lua&lt;/code&gt;. However, I found that using &lt;code&gt;vim.loader.enable()&lt;/code&gt; introduced in Neovim 0.9 resulted in a slight improvement:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;~/.config/nvim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» hyperfine &lt;span class="s2"&gt;&amp;#34;nvim --headless +qa&amp;#34;&lt;/span&gt; --warmup &lt;span class="m"&gt;5&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Benchmark 1: nvim --headless +qa
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Time &lt;span class="o"&gt;(&lt;/span&gt;mean ± σ&lt;span class="o"&gt;)&lt;/span&gt;: 25.7 ms ± 0.5 ms &lt;span class="o"&gt;[&lt;/span&gt;User: 12.8 ms, System: 6.7 ms&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Range &lt;span class="o"&gt;(&lt;/span&gt;min … max&lt;span class="o"&gt;)&lt;/span&gt;: 24.3 ms … 26.9 ms &lt;span class="m"&gt;112&lt;/span&gt; runs
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Loading my &lt;code&gt;init.lua&lt;/code&gt; is now two times faster as reported by vim-startuptime. &lt;code&gt;#vim&lt;/code&gt; &lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-07-26&lt;/a&gt;: I didn&amp;rsquo;t even know that Apple dropped rsync and replaced it with &lt;a href="https://news.ycombinator.com/item?id=43605003"&gt;openrsync&lt;/a&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» rsync --version
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;openrsync: protocol version &lt;span class="m"&gt;29&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;rsync version 2.6.9 compatible
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-07-26&lt;/a&gt;: I ran into &lt;a href="https://github.com/cmus/cmus/issues/1421"&gt;this issue&lt;/a&gt; when reinstating Cmus on my MacBook. The locale fix works for me. I also had to set &lt;code&gt;softvol=true&lt;/code&gt; to change volume (don&amp;rsquo;t know why but I didn&amp;rsquo;t need this on Mojave, IIRC).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-07-26&lt;/a&gt;: It&amp;rsquo;s 2025, and here&amp;rsquo;s the &lt;a href="https://github.com/orgs/Homebrew/discussions/3404#discussioncomment-8738672"&gt;state of Python on macOS&lt;/a&gt;. I only use virtual environments and &lt;a href="https://astral.sh"&gt;uv&lt;/a&gt;, but I wish we could go all &lt;code&gt;uv tool install&lt;/code&gt;. &lt;code&gt;#apple&lt;/code&gt; &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-07-26&lt;/a&gt;: TIL about &lt;a href="https://macosbin.com"&gt;macOS / binaries&lt;/a&gt;, to look up macOS binaries lying all around System Monitor. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-07-26&lt;/a&gt;: &lt;a href="https://nochlin.com/blog/6-techniques-hacker-news-uses-to-create-great-shell-scripts"&gt;6 Techniques Hacker News Uses to Create Great Shell Scripts&lt;/a&gt;: Some good advices here and there. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-07-26&lt;/a&gt;: &lt;a href="https://koaning.io/posts/svg-gifs/"&gt;SVGs that feel like GIFs&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-07-26&lt;/a&gt;: &lt;a href="https://github.com/jayadamsmorgan/Yatoro"&gt;Yatoro&lt;/a&gt;: VIM-like Apple Music Player in Terminal. &lt;code&gt;#apple&lt;/code&gt; &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>ArXiving on July 2025</title><link>https://aliquote.org/post/arxiv-17/</link><pubDate>Wed, 23 Jul 2025 15:27:46 +0200</pubDate><guid>https://aliquote.org/post/arxiv-17/</guid><description>&lt;h3 id="multiple-hypothesis-testing-in-genomics-"&gt;Multiple Hypothesis Testing in Genomics (&lt;a href="https://arxiv.org/abs/2506.23428"&gt;https://arxiv.org/abs/2506.23428&lt;/a&gt;)&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;This analysis report presents an in-depth exploration of multiple hypothesis
testing in the context of Genomics RNA-seq differential expression (DE)
analysis, with a primary focus on techniques designed to control the false
discovery rate (FDR). While RNA-seq has become a cornerstone in transcriptomic
research, accurately detecting expression changes remains challenging due to
the high-dimensional nature of the data. This report delves into the
Benjamini-Hochberg (BH) procedure, Benjamini-Yekutieli (BY) approach, and
Storey&amp;rsquo;s method, emphasizing their importance in addressing multiple testing
issues and improving the reliability of results in large-scale genomic studies.
We provide an overview of how these methods can be applied to control FDR while
maintaining statistical power, and demonstrate their effectiveness through
simulated data analysis.&lt;br&gt;
The discussion highlights the significance of using adaptive methods like
Storey&amp;rsquo;s q-value, particularly in high-dimensional datasets where traditional
approaches may struggle. Results are presented through typical plots (e.g.,
Volcano, MA, PCA) and confusion matrices to visualize the impact of these
techniques on gene discovery. The limitations section also touches on
confounding factors like gene correlations and batch effects, which are often
encountered in real-world data.&lt;br&gt;
Ultimately, the analysis achieves a robust framework for handling multiple
hypothesis comparisons, offering insights into how these methods can be used to
interpret complex gene expression data while minimizing errors. The report
encourages further validation and exploration of these techniques in future
research.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;An overview of different approach to control the false discovery rate in multiple testing: Benjamini-Hochberg (BH), Benjamini-Yekutieli (BY), and Storey&amp;rsquo;s method. The BH method is already available in R&amp;rsquo;s &lt;code&gt;p.adjust()&lt;/code&gt;. The BY method is just an extension of the BH method that accounts for positive correlations among test statistics, while Storey’s technique estimates the proportion of null hypotheses $\pi_0$ among the tested CDS. Whether you rely on a nominal $\alpha$ level or $q$-value cutoffs, as in proteomics analyses, all those methods work equally well. The author&amp;rsquo;s conclusion is as follows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;BH is best for balanced performance between false discovery control and power.&lt;/li&gt;
&lt;li&gt;BY is suited for avoiding false positives but sacrifices true positive identification.&lt;/li&gt;
&lt;li&gt;StoreyQ is optimal for maximizing significant discoveries in exploratory genomics research.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Note that although this targets RNA-Seq analysis, where Multiple Hypothesis Testing is one of the many challenges raised by the big data omics era, this should apply to other contexts as well. It is worth noting that the authors included a simulation model for count data, using a Negative Binomial Model, which is what is usually found in pipeline like &lt;a href="https://bioconductor.org/packages/devel/bioc/vignettes/DESeq2/inst/doc/DESeq2.html"&gt;DESeq2&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I appreciated that the author provided a sidenote on statistical significance and biological relevance: &amp;ldquo;It is also crucial to recognize that statistical significance does not always imply biological importance, nor does a lack of significance disprove a biological hypothesis. In highly variable, small-sample contexts, meaningful changes may evade detection, reinforcing the need for well-powered experiments. Similarly, even a modest difference can be flagged as significant in extremely large datasets. These nuances highlight that DE detection should be interpreted within the broader scope of effect sizes, reproducibility, and biological validation.&amp;rdquo;&lt;/p&gt;
&lt;h3 id="controlling-the-false-discovery-rate-under-a-non-parametric-graphical-"&gt;Controlling the false discovery rate under a non-parametric graphical (&lt;a href="https://arxiv.org/abs/2506.24126"&gt;https://arxiv.org/abs/2506.24126&lt;/a&gt;)&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;We propose sufficient conditions and computationally efficient procedures for
false discovery rate control in multiple testing when the $p$-values are
related by a known \emph{dependency graph} &amp;ndash; meaning that we assume
independence of $p$-values that are not within each other&amp;rsquo;s neighborhoods, but
otherwise leave the dependence unspecified. Our methods&amp;rsquo; rejection sets
coincide with that of the Benjamini&amp;ndash;Hochberg (BH) procedure whenever there are
no edges between BH rejections, and we find in simulations and a genomics data
example that their power approaches that of the BH procedure when there are few
such edges, as is commonly the case. Because our methods ignore all hypotheses
not in the BH rejection set, they are computationally efficient whenever that
set is small. Our fastest method, the IndBH procedure, typically finishes
within seconds even in simulations with up to one million hypotheses.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Yet another paper on controlling the false discovery rate. As mentioned above, when there&amp;rsquo;s some correlation between tested markers, modification of the default FDR correction (Benjamini–Hochberg) is in order. The trick the authors used in this work is to take into account a dependecy graph for $p$-values, allowing to assume independence of $p$-values that are not within each other’s neighborhoods, and otherwise leave the dependence unspecified.&lt;/p&gt;
&lt;h3 id="clustra-a-multi-platform-k-means-clustering-algorithm-for-analysis-of-longitudinal-trajectories-in-large-electronic-health-records-data-"&gt;clustra: A multi-platform k-means clustering algorithm for analysis of longitudinal trajectories in large electronic health records data (&lt;a href="https://arxiv.org/abs/2507.00962"&gt;https://arxiv.org/abs/2507.00962&lt;/a&gt;)&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;Background and Objective: Variables collected over time, or longitudinally,
such as biologic measurements in electronic health records data, are not simple
to summarize with a single time-point, and thus can be more holistically
conceptualized as trajectories over time. Cluster analysis with longitudinal
data further allows for clinical representation of groups of subjects with
similar trajectories and identification of unique characteristics, or
phenotypes, that can be investigated as risk factors or disease outcomes. Some
of the challenges in estimating these clustered trajectories lie in the
handling of observations at inconsistent time intervals and the usability of
algorithms across programming languages.
Methods: We propose longitudinal trajectory clustering using a k-means
algorithm with thin-plate regression splines, implemented across multiple
platforms, the R package clustra and corresponding \SAS macros. The \SAS macros
accommodate flexible clustering approaches, and also include visualization of
the clusters, and silhouette plots for diagnostic evaluation of the appropriate
cluster number. The R package, designed in parallel, has similar functionality,
with additional multi-core processing and Rand-index-based diagnostics.
Results: The package and macros achieve comparable results when applied to an
example of simulated blood pressure measurements based on real data from
Veterans Affairs Healthcare recipients who were initiated on anti-hypertensive
medication.
Conclusion: The R package clustra and the SAS macros integrate a K-means
clustering algorithm for longitudinal trajectories that operates with large
electronic health record data. The implementations provide comparable results
in both platforms, satisfying the needs of investigators familiar with, or
constrained by access to, one or the other platform.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It&amp;rsquo;s been years I&amp;rsquo;m no longer involved in healths analytics and patient-reported outcomes, but this one reminded me of &lt;a href="https://stats.stackexchange.com/a/3363"&gt;a post&lt;/a&gt; on Cross Validated about clustering of longitudinal data. Since I&amp;rsquo;m barely reminescent of those days, I remember &lt;a href="https://stats.stackexchange.com/a/3673"&gt;one answer&lt;/a&gt; of mine which took up my entire morning and into which I put a lot of effort and attention.&lt;/p&gt;
&lt;h3 id="targeted-tuning-of-random-forests-for-quantile-estimation-and-prediction-intervals-"&gt;Targeted tuning of random forests for quantile estimation and prediction intervals (&lt;a href="https://arxiv.org/abs/2507.01430"&gt;https://arxiv.org/abs/2507.01430&lt;/a&gt;)&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;We present a novel tuning procedure for random forests (RFs) that improves
the accuracy of estimated quantiles and produces valid, relatively narrow
prediction intervals. While RFs are typically used to estimate mean responses
(conditional on covariates), they can also be used to estimate quantiles by
estimating the full distribution of the response. However, standard approaches
for building RFs often result in excessively biased quantile estimates. To
reduce this bias, our proposed tuning procedure minimizes &amp;ldquo;quantile coverage
loss&amp;rdquo; (QCL), which we define as the estimated bias of the marginal quantile
coverage probability estimate based on the out-of-bag sample. We adapt QCL
tuning to handle censored data and demonstrate its use with random survival
forests. We show that QCL tuning results in quantile estimates with more
accurate coverage probabilities than those achieved using default parameter
values or traditional tuning (using MSPE for uncensored data and C-index for
censored data), while also reducing the estimated MSE of these coverage
probabilities. We discuss how the superior performance of QCL tuning is linked
to its alignment with the estimation goal. Finally, we explore the validity and
width of prediction intervals created using this method.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Again, it&amp;rsquo;s been a long time since I ever ran an RF algorithm on real data points. It looks like the RF framework has been extended far and long, and even for quantile regression. In this regard, the out-of-bag sample is used to estimate the bias of the marginal quantile coverage probability estimate.&lt;/p&gt;
&lt;h3 id="tensor-product-interactions-in-markov-switching-models-"&gt;Tensor-product interactions in Markov-switching models (&lt;a href="https://arxiv.org/abs/2507.01555"&gt;https://arxiv.org/abs/2507.01555&lt;/a&gt;)&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;Markov-switching models are a powerful tool for modelling time series data
that are driven by underlying latent states. As such, they are widely used in
behavioural ecology, where discrete states can serve as proxies for behavioural
modes and enable inference on latent behaviour driving e.g. observed movement.
To understand drivers of behavioural changes, it is common to link model
parameters to covariates. Over the last decade, nonparametric approaches have
gained traction in this context to avoid unrealistic parametric assumptions.
Nonetheless, existing methods are largely limited to univariate smooth
functions of covariates, based on penalised splines, while real processes are
typically complex requiring consideration of interaction effects. We address
this gap by incorporating tensor-product interactions into Markov-switching
models, enabling flexible modelling of multidimensional effects in a
computationally efficient manner. Based on the extended Fellner-Schall method,
we develop an efficient automatic smoothness selection procedure that is robust
and scales well with the number of smooth functions in the model. The method
builds on a random effects view of the spline coefficients and yields a
recursive penalised likelihood procedure. As special cases, this general
framework accommodates bivariate smoothing, function-valued random effects, and
space-time interactions. We demonstrate its practical utility through three
ecological case studies of an African elephant, common fruitflies, and Arctic
muskoxen. The methodology is implemented in the LaMa R package, providing
applied ecologists with an accessible and flexible tool for semiparametric
inference in hidden-state models. The approach has the potential to drastically
improve the level of detail in inference, allowing to fit HMMs with hundreds of
parameters, 10-20 (potentially bivariate) smooths to thousands of observations.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is a novel approach for semiparametric inference in hidden-state models, which relies on incorporating tensor-product interactions into Markov-switching models, also known as Hidden Markov Model, a mix of two stochastic processes (one observed and the other latent). It&amp;rsquo;s dense and I need to read this when I&amp;rsquo;ll have more time. Now, let&amp;rsquo;s go back to holidays, FWIW.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Within Temptation • &lt;em&gt;Faster&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>July in review</title><link>https://aliquote.org/post/micro-review-030/</link><pubDate>Sun, 20 Jul 2025 19:49:55 +0200</pubDate><guid>https://aliquote.org/post/micro-review-030/</guid><description>&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://news.ycombinator.com/item?id=11071754"&gt;https://news.ycombinator.com/item?id=11071754&lt;/a&gt;: It&amp;rsquo;s been a long since I deleted all my dotfiles on GitHub. Who cares? I have my own setup backed up on external HD and private repos if I need to deploy them on new machines. It has been working fine so far. Also, I must say I&amp;rsquo;m now barely maintaining a few CLI tools: Zsh, Neovim, Tmux, and Neomutt. Anyway, I&amp;rsquo;ve been using this approach for a while ten years ago and it&amp;rsquo;s pretty simple and efficient.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://news.ycombinator.com/item?id=29612209"&gt;Lisp in Vim with Slimv or Vlime&lt;/a&gt; on HN. This provides a reasoned account of why a true REPL is better than any send-to-terminal plugin, like vim-slime. I always enjoy reading Susam Pal&amp;rsquo;s articles. It seems I didn&amp;rsquo;t bookmarked the right HN threads, but there are plenty other posts around this very nice post of him. See also &lt;a href="https://news.ycombinator.com/item?id=40436926"&gt;this thread&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://news.ycombinator.com/item?id=42517447"&gt;Ghostty 1.0&lt;/a&gt; on HN. Yet another interesting thread where I learned a lot about pseudo terminal and technical details like missing damage tracking or the use of rendering threads as QoS background. In a similar vein, I highly recommend Gregory Anders&amp;rsquo;s discussion on the &lt;a href="https://gpanders.com/blog/state-of-the-terminal/"&gt;State of the Terminal&lt;/a&gt; to learn more about key encoding and capabilities as reported by &lt;code&gt;infocmp&lt;/code&gt;. At present, I&amp;rsquo;m happy with Apple Terminal, especially since I mostly use B&amp;amp;W color scheme everywhere, &lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; and Tmux takes care of the rest for me. I may change my mind later.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I recently learned about &lt;a href="https://github.com/ds26gte/tex2page"&gt;tex2page&lt;/a&gt; which looks like an interesting alternative to &lt;a href="https://hevea.inria.fr"&gt;Hevea&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://endtimes.dev/why-your-website-should-be-under-14kb-in-size/"&gt;Why your website should be under 14kB in size&lt;/a&gt;. I don&amp;rsquo;t really care how long it takes to load each pahe of this website as long as it is not too much. I really care about the fact that pages don&amp;rsquo;t look too much bloated and that they are readable on almost any browsers. I cry whenever I came across websites where we can barely read anything because of bad design or unreadable text with crazy background.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.cesarsotovalero.net/blog/i-am-switching-to-python-and-actually-liking-it.html"&gt;I&amp;rsquo;m Switching to Python and Actually Liking It&lt;/a&gt;: If you&amp;rsquo;re into &lt;a href="https://github.com/astral-sh/uv"&gt;uv&lt;/a&gt;, this post might be of interest. I learned about &lt;a href="https://github.com/astral-sh/ty"&gt;ty&lt;/a&gt; by reading this post. More than uv, the author mentions many tools and techniques that should be considered good practises nowadays.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;I strongly believe the maximum quality of work is reached using the human+LLM equation. I believe that humans and LLMs together are more productive than just humans, but this requires a big “if”, that is, if such humans have extensive communication capabilities and LLMs experiences: the ability to communicate efficiently is a key factor in using LLMs. &amp;mdash; &lt;a href="https://antirez.com/news/154"&gt;Coding with LLMs in the summer of 2025&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ LeAnn Rimes • &lt;em&gt;How Do I Live&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;I became so lazy over the years that I didn&amp;rsquo;t bother to make a truly B&amp;amp;W theme for Neomutt. I just configured the mono color scheme and made an alias for Zsh: &lt;code&gt;alias mutt=&amp;quot;TERM=vt100 neomutt&amp;quot;&lt;/code&gt;.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>The unquantified self #33</title><link>https://aliquote.org/post/unquantified-self-033/</link><pubDate>Fri, 11 Jul 2025 06:20:11 +0200</pubDate><guid>https://aliquote.org/post/unquantified-self-033/</guid><description>&lt;p&gt;Hoodie, the last entry dates back to June 2024. In the meantime, a lot has happened: last year, I spent an uninspiring summer resting up a storm, before getting back into the swing of things at the start of the new academic year in September. Several scientific articles published since the start of the year and numerous students to supervise. A busy academic life. This blog has been quite dead for a while. It&amp;rsquo;s almost like since I switched to my new MacBook I stopped doing anything fancy on my own. So, where do we stand today?&lt;/p&gt;
&lt;p&gt;Well, I&amp;rsquo;ll be soon be on vacation, so I&amp;rsquo;ve got nothing to do but rest, read and wander around. If I find enough motivation, I&amp;rsquo;ll get back to drawing, but in the meantime I&amp;rsquo;m still in this state of stupor in front of my pencils, which I don&amp;rsquo;t really like: either I have ideas and no energy to get started, or I draw without really wanting to and end up throwing everything away in the process.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0181.jpeg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0181.jpeg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/77045823007__4CD88929-C310-4EA2-AFD0-DAC0AF085D91.jpeg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/77045823007__4CD88929-C310-4EA2-AFD0-DAC0AF085D91.jpeg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;I haven&amp;rsquo;t made any progress on the goals I set myself last year. That&amp;rsquo;s why I don&amp;rsquo;t like setting goals, other than as possible todo lists. I stopped watching Netflix and TV shows altogether. I just kept &lt;a href="https://aliquote.org/files/books.txt"&gt;reading books&lt;/a&gt; (even for that I haven&amp;rsquo;t found much energy lately) and listening to my digital library. I haven&amp;rsquo;t processed all 25k tracks in my Apple Music library, but I listened several times to the same albums. I still use Beets to manage automatic tagging and renaming of all songs I grab from Youtube or Bandccamp from time to time. I haven&amp;rsquo;t downloaded any new songs since a few months now, I believe I&amp;rsquo;m almost done with my current library. Now it&amp;rsquo;s time to listen to every pieces of music again and again.&lt;/p&gt;
&lt;p&gt;I gave &lt;a href="https://zed.dev"&gt;Zed&lt;/a&gt; yet another try but I can&amp;rsquo;t stand by anything other than Neovim now. My config hasn&amp;rsquo;t changed since last year, which shows that I&amp;rsquo;ve finally managed to satisfy myself with a more or less stable and complete editor. More or less stable, I&amp;rsquo;m afraid, because I&amp;rsquo;ve still spent some time fixing deprecations and API changes since the switch to version 0.11. This is mostly related to LSP and diagnostic stuff, but at least it was doable in half an hour or so. Zed is really great, though. It is a well crafted and well thought piece of software and I believe it will become a strong contender to VS Code. I upgrade to Mathematica 14.2.1 a few months ago but I haven&amp;rsquo;t had time to look at the new features (other than the tabular data structure). I kept busy writing Python and Bash stuff for bioinformatics applications. I really want to go back to Lisp and Haskell side projects.&lt;/p&gt;
&lt;p&gt;I don&amp;rsquo;t miss Linux, except for all those things I lost since my laptop crashed last year. I&amp;rsquo;ve recovered or rebuilt the essentials and set up a stronger backup system. Still, there&amp;rsquo;re a lot of photos missing from my digital library. My current setup is increasingly minimalist and consists of a combination of tmux and Neovim for everything related to text processing. Evrything is done in Apple Terminal. I have Neovim configured for all programming languages I use, for $\TeX$ and Markdown-related stuff (I still use &lt;a href="https://orgmode.org/"&gt;Org&lt;/a&gt; for oldie stuff), and for Git as well. I have LSP and REPL configured as I want them to be, and I rely on the same 5 plugins (fzf-lua, nvim-treesitter, nvim-treesitter-textobjects, neogen, vim-table-mode). Other than Apple Terminak, I use Apple Mail and Safari all day (I still have a local copy of all my emails managed by mu and Neomutt), as well as NetNewsWire. Nothing fancy, really.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Lady Gaga • &lt;em&gt;Dance in the Dark&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in June</title><link>https://aliquote.org/post/micro-06-2025/</link><pubDate>Mon, 30 Jun 2025 10:04:42 +0200</pubDate><guid>https://aliquote.org/post/micro-06-2025/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-06-08&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;by failing to provide programmers with features they need to make the best use of modern hardware, programmers instead resort to enabling an option that is known to be blatantly unsafe. &amp;mdash; &lt;a href="https://simonbyrne.github.io/notes/fastmath/"&gt;Beware of fast-math&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-06-08&lt;/a&gt;: &lt;a href="https://storytotell.org/sad-sad-apple-tears"&gt;Sad Sad Apple Tears&lt;/a&gt;: A thoughtful review and commentary on Apple&amp;rsquo;s evolution from a developer&amp;rsquo;s point of view. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-06-10&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The fundamental difference between streaming and downloading is what your device does with those frames of video. &amp;mdash; &lt;a href="https://danq.me/2025/05/26/downloading-vs-streaming/"&gt;The Difference Between Downloading and Streaming&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-06-10&lt;/a&gt;: I never could get used to Pandas data frame (while I&amp;rsquo;m able to use any Scheme or Lisp data frame frameworks, and Mathematica association lists or tabular data structure). Good points discussed here, although I&amp;rsquo;m a vanailla R user (no tidyverse): &lt;a href="https://www.sumsar.net/blog/pandas-feels-clunky-when-coming-from-r/"&gt;Why pandas feels clunky when coming from R&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-06-10&lt;/a&gt;: I was a happy user of &lt;a href="https://newsboat.org"&gt;newsboat&lt;/a&gt; until it stopped working on my MacBook, for whatever reason. It probably just works right now, but since I&amp;rsquo;m definitely out of sync with my RSS feeds, I was looking for a way to have it both on my old iPhone (this excludes de facto most modern readers, including NNW) and my MacBook. It looks like &lt;a href="https://lireapp.com"&gt;lire&lt;/a&gt; fits the bill, although there are occasional iCloud syncing issues (sync time and rate limit). Anyway, that&amp;rsquo;s still better than &lt;a href="https://aliquote.org/post/reeder-app"&gt;Reeder&lt;/a&gt; which does not sync to iCloud at all. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-06-10&lt;/a&gt;: It’s not going to put me out of a job. This is from 2017 but still relevant as of today.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;At least 75% of the actual job of programming is figuring out what a person means when they ask for something. This is not a problem that a machine can solve for you, for the same reason that it’s harder to build a robot that builds other robots than to just build a robot. Have you had words with Siri lately? Do you think Siri is in a good position to understand your intent, or it’s maybe just searching for command words in a limited lexicon? Do you really think it could find Henry’s stool? Or does it seem more likely that it would get confused and require a human… trained to translate… high-level human-language… into language suitable for… the machine?&lt;a href="https://storytotell.org/why-im-not-especially-interested-in-machine-learning"&gt;Why I&amp;rsquo;m not especially interested in machine learning&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-06-10&lt;/a&gt;: &lt;a href="https://blog.djnavarro.net/posts/2025-05-18_multivariate-normal-sampling-floating-point/"&gt;When good pseudorandom numbers go bad&lt;/a&gt;: An interesting discussion about eigen decomposition with applications to sampling from multivariate distribution. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-06-10&lt;/a&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» brew info --cask &lt;span class="nv"&gt;container&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;==&lt;/span&gt;&amp;gt; container: 0.1.0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;https://github.com/apple/container
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Not installed
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;From: https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/c/container.rb
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;==&lt;/span&gt;&amp;gt; &lt;span class="nv"&gt;Namecontainer&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;==&lt;/span&gt;&amp;gt; Description
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Create and run Linux containers using lightweight virtual &lt;span class="nv"&gt;machines&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;==&lt;/span&gt;&amp;gt; Artifactscontainer-0.1.0-installer-signed.pkg &lt;span class="o"&gt;(&lt;/span&gt;Pkg&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;==&lt;/span&gt;&amp;gt; Analyticsinstall: &lt;span class="m"&gt;63&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="m"&gt;30&lt;/span&gt; days&lt;span class="o"&gt;)&lt;/span&gt;, &lt;span class="m"&gt;63&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="m"&gt;90&lt;/span&gt; days&lt;span class="o"&gt;)&lt;/span&gt;, &lt;span class="m"&gt;63&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="m"&gt;365&lt;/span&gt; days&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;More info: &lt;a href="https://www.apple.com/newsroom/2025/06/apple-supercharges-its-tools-and-technologies-for-developers/"&gt;Apple supercharges its tools and technologies for developers to foster creativity, innovation, and design&lt;/a&gt;. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-06-12&lt;/a&gt;: LOL I just switched back to NetNewsWire as my default feed reader. Lire app uses too much RAM and does not sync correctly to iCLoud. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-06-14&lt;/a&gt;: &lt;a href="http://0x80.pl/notesen/2016-11-28-simd-strfind.html"&gt;SIMD-friendly algorithms for substring searching&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-06-14&lt;/a&gt;: &lt;a href="https://btxx.org/posts/openbsd-mac-utm/"&gt;Setup an OpenBSD VM on macOS Using UTM&lt;/a&gt;. &lt;code&gt;#apple&lt;/code&gt; &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-06-14&lt;/a&gt;: &lt;a href="https://kobzol.github.io/rust/rustc/2025/06/09/why-doesnt-rust-care-more-about-compiler-performance.html"&gt;Why doesn&amp;rsquo;t Rust care more about compiler performance?&lt;/a&gt;. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-06-18&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The distinction some make between prototyping and software development has vexed me my whole career. I have never seen a version 1.0 of a system that was acceptable. I find that every software group messes with the software up until the very time it&amp;rsquo;s deployed or delivered. &amp;mdash; &lt;a href="https://www.dreamsongs.com/ArtOfLisp.html"&gt;The Art of Lisp &amp;amp; Writing&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-06-18&lt;/a&gt;: TIL about &lt;a href="https://github.com/bgreenwell/lstr"&gt;lstr&lt;/a&gt;, a fast and minimalist directory tree viewer, with interactive mode.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-06-23&lt;/a&gt;: /me is listening to &amp;ldquo;Shanghaï Gesture&amp;rdquo; by The Names&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-06-25&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/77248777599__950B8F2E-5A18-478C-B970-C62108BE8D8F" alt="img"&gt;&lt;small&gt;Summertime&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-06-25&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Software development needs more simple joy, and I’ve found that creating toy programs is a great way to remember why I started working with computers again. &amp;mdash; &lt;a href="https://blog.jsbarretto.com/post/software-is-joy"&gt;Writing Toy Software Is A Joy&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-06-25&lt;/a&gt;: I have the following Jupyter kernels installed on my HD:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» jupyter kernelspec list
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Available kernels:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python3 /Users/chl/.local/lib/jupyter/share/jupyter/kernels/python3
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;clojupyter /Users/chl/Library/Jupyter/kernels/clojupyter
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;common-lisp /Users/chl/Library/Jupyter/kernels/common-lisp
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;racket /Users/chl/Library/Jupyter/kernels/racket
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;wolfram /Users/chl/Library/Jupyter/kernels/wolframlanguage14.1
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I renamed clojupyter snapshot to something more convenient to handle when calling &lt;code&gt;jupyter console&lt;/code&gt;. I&amp;rsquo;m using OpenJDK 24.0.1 from Homebrew (which I symlinked in macOS default &lt;code&gt;$JAVA_HOME&lt;/code&gt;, using &lt;code&gt;sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk&lt;/code&gt;) and I kept getting this annoying warning:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;WARNING: A restricted method in java.lang.System has been calledWARNING: java.lang.System::load has been called by org.sqlite.SQLiteJDBCLoader in an unnamed module &lt;span class="o"&gt;(&lt;/span&gt;file:/Users/chl/Library/Jupyter/kernels/clojupyter/clojupyter-standalone.jar&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;WARNING: Use --enable-native-access&lt;span class="o"&gt;=&lt;/span&gt;ALL-UNNAMED to avoid a warning &lt;span class="k"&gt;for&lt;/span&gt; callers in this module
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;WARNING: Restricted methods will be blocked in a future release unless native access is enabled
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To get ride of the warning, simply add &lt;code&gt;--enable-native-access=ALL-UNNAMED&lt;/code&gt; in the &lt;code&gt;kernel.json&lt;/code&gt; init file.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-06-25&lt;/a&gt;: TIL about this little trick: &lt;a href="https://dgl.cx/2024/10/restricted-sftp-with-userns"&gt;Restrict sftp with Linux user namespaces&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-06-25&lt;/a&gt;: &lt;a href="https://www.cottongeeks.com/articles/2025-06-24-fun-with-uv-and-pep-723"&gt;Fun with uv and PEP 723&lt;/a&gt;: I came across many similar posts about this new way to run Python scripts via &lt;a href="https://docs.astral.sh/uv/"&gt;uv&lt;/a&gt;. I switched to uv for managing python version and dependencies in virtual environments and I think it&amp;rsquo;s been one of the best addition to the language ecosystem in a while. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-06-26&lt;/a&gt;: I guess my &lt;a href="https://aliquote.org/post/scheme-in-vim/"&gt;Scheming with Vim&lt;/a&gt; will be easier to &lt;a href="https://medium.com/@iamalexcarter/scheming-with-vim-a-practical-setup-for-scheme-6a6b7e07ad9f"&gt;find&lt;/a&gt; on the www.&lt;br&gt;&lt;/p&gt;</description></item><item><title>Micro posting in May</title><link>https://aliquote.org/post/micro-05-2025/</link><pubDate>Sun, 08 Jun 2025 18:00:29 +0200</pubDate><guid>https://aliquote.org/post/micro-05-2025/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-05-12&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/2025-05-12-13-30-09" alt="img"&gt;&lt;small&gt;What happens when you neglected your feed reader for two months or so.&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-05-12&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;SBCL hash tables have been adaptive for almost a year now, gaining some speed in common cases, and robustness in others. &amp;mdash; &lt;a href="https://quotenil.com/adaptive-hashing.html"&gt;Adaptive hashing&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-05-12&lt;/a&gt;: I already read this a while ago but in case I forgot to post it (and today I&amp;rsquo;m too lazy to search for it in the archives), here it is : &lt;a href="https://mako.cc/copyrighteous/google-has-most-of-my-email-because-it-has-all-of-yours"&gt;Google Has Most of My Email Because It Has All of Yours&lt;/a&gt;. TL;DR &amp;ldquo;They have delivered more than a third of all the email I’ve replied to every year since 2006 and more than half since 2010.&amp;quot;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-05-12&lt;/a&gt;: Interesting read from weeks ago (yeah, I&amp;rsquo;ve been pretty suiet lately): &lt;a href="https://liorsinai.github.io/mathematics/2020/08/27/secant-mercator.html"&gt;100 years to solve an integral&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-05-12&lt;/a&gt;: &lt;a href="https://blog.edward-li.com/tech/advanced-python-features/"&gt;14 Advanced Python Features&lt;/a&gt;. Note that this covers features introduced in Python 3.10+. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-05-12&lt;/a&gt;: &lt;a href="https://kevingal.com/blog/cl-livecoding.html"&gt;Graphics livecoding in Common Lisp&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-05-13&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Apparently, vibe coding is when you explain to your AI-based editor what the heck you wanted to do, except you’re much more into debugging code written for you. WTF it is calling vibe coding? I wouldn’t mind it being called AI coding, but vibe? &amp;mdash; &lt;a href="https://andreyor.st/posts/2025-04-22-am-i-becoming-obsolete-or-just-older/"&gt;Am I becoming obsolete or just older?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-05-13&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Other languages may share some of these features, but Lisp has them all together. It is a language that was designed to be used as a tool for thinking about problems, and that is the fun part of programming. &amp;mdash; &lt;a href="https://funcall.blogspot.com/2025/04/why-i-program-in-lisp.html"&gt;Why I Program in Lisp&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-05-13&lt;/a&gt;: TIL about &lt;a href="https://localsend.org/"&gt;LocalSend&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-05-13&lt;/a&gt;: &lt;a href="https://borretti.me/article/two-years-of-rust"&gt;Two Years of Rust&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-05-16&lt;/a&gt;: On macOS, relying on &lt;code&gt;ZDOTDIR=$HOME/.config/zsh&lt;/code&gt; helps to declutter hidden files in &lt;code&gt;$HOME&lt;/code&gt;. I initially put it in my &lt;code&gt;$HOME/.zprofile&lt;/code&gt;, but you will need to use &lt;code&gt;.zshenv&lt;/code&gt; (a symlink to &lt;code&gt;.zprofile&lt;/code&gt; also works) in order to make your &lt;code&gt;$PATH&lt;/code&gt; available in Neovim terminal. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-05-16&lt;/a&gt;: The web today.&lt;br&gt;&lt;img src="https://aliquote.org/img/2025-05-16-11-49-15.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-05-16&lt;/a&gt;: &lt;a href="https://hueffner.de/falk/blog/a-leap-year-check-in-three-instructions.html"&gt;A leap year check in three instructions&lt;/a&gt;. In Racket:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;leap-year?&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;bitwise-and&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;*&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="mi"&gt;1073750999&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;3221352463&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;126976&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;br&gt;&lt;img src="https://aliquote.org/img/2025-05-16-16-26-02.png" alt="img"&gt;See also this &lt;a href="https://www.johndcook.com/blog/2025/05/20/a-bit-twiddling-marvel/"&gt;followup post&lt;/a&gt; by John Cook.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-05-16&lt;/a&gt;: &lt;a href="https://gpanders.com/blog/whats-new-in-neovim-0-11/"&gt;What&amp;rsquo;s New in Neovim 0.11&lt;/a&gt;. I upgraded via Homebrew some weeks ago and didn&amp;rsquo;t notice any breaking changes. However, after reading this article, I tried to setup my LSP configurations via the new facilities, and it works like a charm: &lt;code&gt;root_dir&lt;/code&gt; has to be replaced with &lt;code&gt;root_markers&lt;/code&gt;, and the &lt;code&gt;filetypes&lt;/code&gt; parameters is equivalent to the basename (e.g., &lt;code&gt;filetype.lua&lt;/code&gt;) that I put in my ftplugin directory. It is much easier to manage basic autocompletion via &lt;code&gt;omnifunc&lt;/code&gt;. I don&amp;rsquo;t use virtual text and I don&amp;rsquo;t really care about virtual lines either, but it looks great. I revamped some of my custom mappings since Neovim now ships with default meningful keymaps for goto actions. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-05-17&lt;/a&gt;: /me is listening to &amp;ldquo;Gravity (Still)&amp;rdquo; by Hooverphonic&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-05-18&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;[Numpy] took away indices and replaced them with broadcasting. And broadcasting cannot fill indices’ shoes. &amp;mdash; &lt;a href="https://dynomight.net/numpy/"&gt;I don&amp;rsquo;t like NumPy&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-05-18&lt;/a&gt;: &lt;a href="https://www.nature.com/articles/d41586-025-01246-1"&gt;P hacking — Five ways it could happen to you&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-05-19&lt;/a&gt;: &lt;a href="https://bitbashing.io/haskell-concurrency.html"&gt;Concurrency in Haskell: Fast, Simple, Correct&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-05-19&lt;/a&gt;: &lt;a href="https://thenumb.at/Autodiff/"&gt;Differentiable Programming from Scratch&lt;/a&gt;: A clear and concise exposition of DP applied to computer graphics.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-05-20&lt;/a&gt;: /me is listening to &amp;ldquo;Danny&amp;rdquo; by The Durutti Column&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-05-20&lt;/a&gt;: TIL about &lt;a href="https://docs.basedpyright.com/latest/"&gt;basedpyright&lt;/a&gt;, which provides better defaults and additional capabilities compared to pyright, like inlay hints. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-05-20&lt;/a&gt;: &lt;a href="https://bernsteinbear.com/blog/simple-search/"&gt;A simple search engine from scratch&lt;/a&gt;. Looks interesting.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-05-21&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I am not saying that it&amp;rsquo;s not useful at all. If what you&amp;rsquo;re doing to begin with is copying and pasting code from e.g. Stack Overflow, then sure, because Google and other search engines have become so bad, AI can often provide you with relevant answers much faster than you shifting through page after page of useless Google junk. &lt;a href="https://unixdigest.com/articles/the-reason-why-i-dont-use-ai-or-even-code-completion.html"&gt;The reason why i don&amp;rsquo;t use AI or even code completion&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-05-21&lt;/a&gt;: &lt;a href="https://specbranch.com/posts/fp-rand/"&gt;Perfect Random Floating-Point Numbers&lt;/a&gt;. TL;DR generate floating-point numbers with probabilities given by drawing a real number and then rounding to floating point.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-05-23&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/papillon.jpg" alt="img"&gt;&lt;small&gt;Happy birthday to you dearest &amp;hellip;&lt;/small&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>Micro posting in March</title><link>https://aliquote.org/post/micro-03-2025/</link><pubDate>Sun, 30 Mar 2025 18:11:26 +0200</pubDate><guid>https://aliquote.org/post/micro-03-2025/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-03-04&lt;/a&gt;: A new version of Racket (8.16) has just been released. There&amp;rsquo;s now full support for Student t distribution. Easy upgrade (pending a minor issue with Homebrew installed libzmq):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;brew upgrade
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;raco pkg migrate 8.15
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;rm -rf ~/Library/Racket/8.15
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cp /opt/homebrew/Cellar/zeromq/4.3.5_1/lib/libzmq.5.dylib ~/Library/Racket/8.16/lib
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;raco iracket install
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-03-09&lt;/a&gt;: Found this very old screenshots of podcasts I was listening to on iTunes.&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-06-13-11-14-56.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-03-09&lt;/a&gt;: How many busy years before the poison?&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-01-10-14-21-27.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-03-10&lt;/a&gt;: /me is listening to &amp;ldquo;Blood Moon&amp;rdquo; by Concrete Blonde&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-03-10&lt;/a&gt;: I just spent half an hour decluterring my &lt;code&gt;$HOME&lt;/code&gt; dotfiles and movinf everything I could to standard XDG config, data and state directories. Looks much cleaner now.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;~
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.CFUserTextEncoding .cargo/ .local/ .ssh/ Library/ backup/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.DS_Store .config/ .mail/ .stack/ Movies/ cwd/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.Renviron .ctags .npm/ .zprofile Music/ tmp/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.Trash/ .cups/ .nvm/ Desktop/ Pictures/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.cabal/ .deno/ .roswell/ Documents/ Public/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.cache/ .ghcup/ .rustup/ Downloads/ Sites/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The cornerstone for running zsh properly is to point &lt;code&gt;ZDOTDIR&lt;/code&gt; to the relevant XDG data directory.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;ZDOTDIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;/.config/zsh
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; file in &lt;span class="nv"&gt;$HOME&lt;/span&gt;/.config/profile.d/*.sh&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; . &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-03-11&lt;/a&gt;: If you&amp;rsquo;re interested in Advent of Code challenge and Lisp, go take a look at Joe Marshall series on his blog. Last blog post &lt;a href="https://funcall.blogspot.com/2025/03/advent-of-code-2024-day-25.html"&gt;here&lt;/a&gt;, with accompagnying &lt;a href="https://github.com/jrm-code-project/Advent2024"&gt;GitHub repo&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-03-11&lt;/a&gt;: &lt;a href="https://statmodeling.stat.columbia.edu/2024/04/19/the-data-are-on-a-1-5-scale-the-mean-is-4-61-and-the-standard-deviation-is-1-64-whats-so-wrong-about-that/"&gt;The data are on a 1-5 scale, the mean is 4.61, and the standard deviation is 1.64&amp;hellip; What’s so wrong about that?&lt;/a&gt;: Nice read.&lt;br&gt;&lt;/p&gt;</description></item><item><title>Micro posting in February</title><link>https://aliquote.org/post/micro-02-2025/</link><pubDate>Sun, 02 Mar 2025 17:46:28 +0100</pubDate><guid>https://aliquote.org/post/micro-02-2025/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-02-11&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Boring tech behaves in predictable ways. It’s a well trodden path others have evaluated, optimised, troubleshooted, and understood. Using tech that has been subjected to all those people hours of use means you’re less likely to run into edge cases, unexpected behaviour, or attributes and features that lack documentation or community knowledge. &amp;mdash; &lt;a href="https://rubenerd.com/boring-tech-is-mature-not-old/"&gt;Boring tech is mature, not old&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-02-11&lt;/a&gt;: &lt;a href="https://modernstatisticswithr.com"&gt;Modern Statistics with R: From wrangling and exploring data to inference and predictive modelling&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-02-18&lt;/a&gt;: Almost two months with new MacBook and I&amp;rsquo;m back to my old habits using Tmux and Neomutt all day. Apple Mail is fine but I manage my e-mails 3 times faster with neomutt. Likewise, Apple Terminal has been enhanced over the years but nothing beats Tmux when it comes to manage long-running sessions, multiple panes, and paste buffers. That being said I&amp;rsquo;m happy everything is kept in sync and I can switch to whichever software to suit my mood. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-02-18&lt;/a&gt;: &lt;a href="https://simonsafar.com/2022/lisp_server/"&gt;Lisp as a System Service&lt;/a&gt;, or how to use UNIX domain sockets for managing SBCL on a remote machine. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-02-18&lt;/a&gt;: &lt;a href="https://agilescientific.com/blog/2020/2/25/visual-explanations-of-mathematics"&gt;Visual explanations of mathematics&lt;/a&gt;: Oldies but goodies. &lt;code&gt;#math&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-02-24&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;(&amp;hellip;) it’s a good idea to first understand how the system was designed to be used before decrying it as ill-conceived or making it something it isn’t using third-party window managers, app switchers, and so on. &amp;mdash; &lt;a href="https://blog.xoria.org/macos-tips"&gt;macOS Tips&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-02-24&lt;/a&gt;: More &lt;a href="https://saurabhs.org/macos-tips"&gt;macOS Tips &amp;amp; Tricks&lt;/a&gt;. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-02-24&lt;/a&gt;: &lt;a href="https://github.com/0xType/0xProto"&gt;0xProto&lt;/a&gt;, with its subtle ligatures, looks great. (via &lt;a href="https://leahneukirchen.org/trivium/2025-02-16"&gt;Leah Neukirchen&lt;/a&gt;)&lt;br&gt;&lt;/p&gt;</description></item><item><title>February in review</title><link>https://aliquote.org/post/micro-review-029/</link><pubDate>Tue, 25 Feb 2025 20:31:04 +0100</pubDate><guid>https://aliquote.org/post/micro-review-029/</guid><description>&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://curiouscoding.nl/"&gt;Ragnar Groot Koerkamp&lt;/a&gt; is posting interesting and detailed overview of common algorithms in bioinformatics, specifically minimizers and pairwise alignments, as well as Rust benchmarks, e.g. on the &lt;a href="https://curiouscoding.nl/posts/1brc/"&gt;one billion row Challenge&lt;/a&gt;.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://byorgey.github.io/blog/posts/2024/11/27/stacks-queues.html"&gt;Sliding window&lt;/a&gt; technique from a functional point of view, by Brent Yorgey.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://github.com/nst/PSTris"&gt;A Tetris implementation in PostScript&lt;/a&gt;, because why not.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://danielsz.github.io/blog/2019-08-05T21_14.html"&gt;Lisp is not a realization of the Lambda Calculus&lt;/a&gt;. I came across this blog post after reading &lt;a href="https://babbagefiles.xyz/lambda-calculus-and-lisp-01/"&gt;Lambda Calculus and Lisp, part 1&lt;/a&gt;. A good overview of lambda&amp;rsquo;s from an historical perspective as far as I can tell. Other stuff read almost at the same time: &lt;a href="https://elmord.org/blog/?entry=20160528-lisp-without-cons-cells"&gt;Lisp without cons cells&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://prog21.dadgum.com/154.html"&gt;Do You Really Want to be Doing This When You&amp;rsquo;re 50?&lt;/a&gt;. Even if I know the weblog is dead now, I can&amp;rsquo;t help coming back to it from time to time, or when it pops up on Hacker News.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://lisp-journey.gitlab.io/blog/these-years-in-common-lisp-2023-2024-in-review/"&gt;These years in Common Lisp: 2023-2024 in review&lt;/a&gt;: the annual review by Vincent Vindarel.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.bitecode.dev/p/a-year-of-uv-pros-cons-and-should"&gt;A year of uv: pros, cons, and should you migrate&lt;/a&gt;: I&amp;rsquo;m a very happy user too, it helps installing and managing with virtual environments and pip recent versions of Python on quite old systems (e.g. Ubuntu 18.04). See &amp;ldquo;A good Python project manager, therefore, should have the following properties&amp;rdquo;, points 2, 3 and 4.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://reference.wolfram.com/language/example/SimulateADerivedDistribution.html"&gt;Simulate a Derived Distribution&lt;/a&gt;: I came across this page while looking for builtin way to simulate random draws from a mixture of heavy-tailed Gaussian distribution in Mathematica. The term &amp;ldquo;derived&amp;rdquo; sounds great, but confusing. Just a sidenote.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://phiresky.github.io/blog/2025/visualizing-all-books-in-isbn-space/"&gt;Visualizing all books of the world in ISBN-Space&lt;/a&gt;. Lot of interesting technical stuff going on.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://tensorcookbook.com"&gt;The Tensor Cookbook&lt;/a&gt;: Not as much visual pictures I&amp;rsquo;d expected and strange $\TeX$ notation (but congrats for the TikZ or whatever technique used in the PDF handout).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"&gt;
&lt;iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/EtZ-pqHB1c4?autoplay=0&amp;amp;controls=1&amp;amp;end=0&amp;amp;loop=0&amp;amp;mute=0&amp;amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"&gt;&lt;/iframe&gt;
&lt;/div&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Memory Cassette • &lt;em&gt;Last One Awake&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;See also &lt;a href="https://defn.io/page/about/"&gt;Bogdan Popa&lt;/a&gt;&amp;rsquo;s take in Racket.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in January</title><link>https://aliquote.org/post/micro-01-2025/</link><pubDate>Thu, 30 Jan 2025 20:07:23 +0100</pubDate><guid>https://aliquote.org/post/micro-01-2025/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-01-03&lt;/a&gt;: Neomutt tip: To escape space in folder name (e.g., iCloud Sent or Deleted Messages), you can use either &lt;code&gt;\&lt;/code&gt; when defining your inboxes in your muttrc or &lt;code&gt;^V&lt;/code&gt; for your bindings. E.g.:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mailboxes =icloud/Drafts =icloud/Sent\ Messages =icloud/Deleted\ Messages =icloud/Archive
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;macro index,pager gs &amp;#34;&amp;lt;change-folder&amp;gt;+icloud/Sent^V Messages&amp;lt;return&amp;gt;&amp;#34; &amp;#34;go to sent messages&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-01-11&lt;/a&gt;: After today&amp;rsquo;s quick testing, it looks like &lt;a href="https://github.com/WolframResearch/WolframLanguageForJupyter"&gt;Wolfram Jupyter kernel&lt;/a&gt; is working as expected under Quarto (see this blog post for a previous &lt;a href="post/stata-quarto/"&gt;attempt with Stata&lt;/a&gt;). The Racket kernel works as well (minor caveat, you&amp;rsquo;ll probably have to &lt;a href="https://github.com/rmculpepper/iracket/issues/20"&gt;symlink your Homebrewed libzmq&lt;/a&gt;).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-01-12&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I can&amp;rsquo;t use Emacs, so it&amp;rsquo;s got to be usable in Vim. &amp;mdash; &lt;a href="https://blog.djhaskin.com/blog/why-i-chose-common-lisp/"&gt;Why I Chose Common Lisp&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-01-12&lt;/a&gt;: I&amp;rsquo;ve been listening to some music on Apple Music app for one and half a hour and the battery still tops at its max. It&amp;rsquo;s incredible the level of micro-optimization that must be behind all this. Likewise, I can work unplugged for all day long, I will have a fair amount of time left for the day after. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-01-15&lt;/a&gt;: /me is listening to &amp;ldquo;Lands End&amp;rdquo; by Siouxie and the Banshees&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-01-15&lt;/a&gt;: /me is listening to &amp;ldquo;Other Side of Love&amp;rdquo; by Sixth June&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-01-15&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I would not accept this Dock placement blasphemy from anyone else, but from Thomson, well, OK. (The correct location is on the right. Left, we’ll let you argue for. But definitely not on the bottom.) &amp;mdash; &lt;a href="https://daringfireball.net/linked/2025/01/10/thomson-dock"&gt;James Thomson on the origins of the macOS Dock&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-01-15&lt;/a&gt;: I migrated a bunch of stuff to keep Neomutt and Apple Mail in sync, and I still use mu to manage complex search in my maildir. Here are the results of the last &lt;code&gt;mu index&lt;/code&gt; which accounts for the integration of listservers and digests directly into proper iCloud folders, in no more than 5s:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» mu index
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;indexing maildir /Users/chl/.mail -&amp;gt; store /Users/chl/.cache/mu/xapian
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;|&lt;/span&gt; indexing messages&lt;span class="p"&gt;;&lt;/span&gt; checked: 14443&lt;span class="p"&gt;;&lt;/span&gt; updated/new: 3103&lt;span class="p"&gt;;&lt;/span&gt; cleaned-up: &lt;span class="m"&gt;4144&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-01-15&lt;/a&gt;: Related to the previous micro-post, see &lt;a href="https://matt.sh/python-project-structure-2024"&gt;Proper Python Project Structure 2024&lt;/a&gt; by the same author, which argues against the use of requirements.txt in favor of Poetry. I used Poetry for a work project but I&amp;rsquo;m now betting on &lt;a href="https://docs.astral.sh/uv/"&gt;uv&lt;/a&gt;. See also &lt;a href="https://valatka.dev/2025/01/12/on-killer-uv-feature.html"&gt;Uv has a killer feature you should know about&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-01-15&lt;/a&gt;: &lt;a href="https://ffmpegbyexample.com"&gt;FFmpeg By Example&lt;/a&gt; is a documentation website to showcase all the unique and different ways to use FFmpeg.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-01-15&lt;/a&gt;: &lt;a href="https://matt.sh/howto-c"&gt;How to C in 2016&lt;/a&gt;. See also some rejoinder like &lt;a href="https://blog.erratasec.com/2016/01/some-notes-c-in-2016.html"&gt;Some notes C in 2016&lt;/a&gt; and &lt;a href="https://github.com/Keith-S-Thompson/how-to-c-response"&gt;A critique of &amp;ldquo;How to C in 2016&amp;rdquo;&lt;/a&gt;. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-01-22&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Discord, overwhelmingly. Every IRC community I used to be a part of even a year ago has made the jump. It&amp;rsquo;s just more convenient for all concerned- the only holdouts are people clinging to their CLIs and people objecting for ideological reasons. &amp;mdash; &lt;a href="https://news.ycombinator.com/item?id=15731193"&gt;LocutusOfBorges on HN&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-01-22&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I don&amp;rsquo;t understand the desire to shove everything into a web browser. Other than the fact that it is how tech startups extract money from venture capitalists, spy on your user base, and lock out interoperability I don&amp;rsquo;t see why a web browser is a better place to implement most things and yet, here we are. &amp;mdash; &lt;a href="https://www.going-flying.com/blog/discord-irc.html"&gt;Discord in my IRC client&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-01-24&lt;/a&gt;: /me is listening to &amp;ldquo;Beware of Darkness&amp;rdquo; by Concrete Blonde&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-01-24&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The lie-to-children here is that we pretend the do block is magical and that when it executes, it also executes side effects of functions called in it. This mental model will take the beginner a long way, but at some point, one will want to break free of it. That is when Haskell starts to really shine as a procedural language. &amp;mdash; &lt;a href="https://entropicthoughts.com/haskell-procedural-programming"&gt;Haskell: A Great Procedural Language&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-01-24&lt;/a&gt;: I was surprised to find R in this list of &lt;a href="https://darwinsys.com/history/origins.html"&gt;Common Unix Programs&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-01-24&lt;/a&gt;: So be it, &lt;a href="https://reference.wolfram.com/language/tutorial/Expressions.html#4715"&gt;everything is an expression&lt;/a&gt;. &lt;code&gt;#wolfram&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-01-24&lt;/a&gt;: &lt;a href="https://stats.stackexchange.com/questions/476424/what-are-the-worst-commonly-adopted-ideas-principles-in-statistics"&gt;What are the worst (commonly adopted) ideas/principles in statistics?&lt;/a&gt;. So long CV, but I&amp;rsquo;m glad to see that the site can still generate very interesting discussions.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2025-01-25&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/2025-01-25-20-55-44.png" alt="img"&gt;&lt;small&gt;Listening to old music that changed my musical world back then&amp;hellip;&lt;/small&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-01-29&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Less is more. Avoid grand designs. Keep the codebase as small as possible. &amp;mdash; &lt;a href="https://www.defmacro.org/2013/06/03/engineering-commandments.html"&gt;The ten project management commandments&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-01-29&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;To put it briefly, human experience is characterized by Dasein (a technical term for Heidegger that can be translated literally as “being-there” or “being-here”), which tends to overcome spatial distance through meaningful action or symbolic understanding, to bring even the world close to itself, a tendency that Heidegger calls de-severance. With various modern technologies, however, this tendency of Dasein is made more complicated. &amp;mdash; &lt;a href="https://hedgehogreview.com/web-features/thr/posts/a-phenomenology-of-spotify-and-vinyl"&gt;A Phenomenology of Spotify and Vinyl&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2025-01-29&lt;/a&gt;: &lt;a href="https://gitlab.common-lisp.net/mantoniotti/rho"&gt;RHO&lt;/a&gt;: A Common Lisp library implementing R ideas. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>Introduction to Statistics with Mathematica</title><link>https://aliquote.org/post/statistics-with-mathematica/</link><pubDate>Wed, 29 Jan 2025 20:43:59 +0100</pubDate><guid>https://aliquote.org/post/statistics-with-mathematica/</guid><description>&lt;p&gt;I just finished reading the &lt;a href="https://www.wolfram-media.com/products/introduction-to-statistics-with-the-wolfram-language/"&gt;Notebook version&lt;/a&gt; of Koppler&amp;rsquo;s &lt;em&gt;Introduction to Statistics with Mathematica&lt;/em&gt;. If you&amp;rsquo;re new to Mathematica and/or statistics, chapters 3 to 5 will teach you the basic building blocks and data structures useful for statistical analysis. Even if you are familiar with lists and nested lists, &lt;code&gt;Dataset&lt;/code&gt;s provide useful abstraction for representing statistical data and they come with great utilities, e.g. &lt;code&gt;GroupBy&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;This is an introductory course on descriptive and inferential statistical. There&amp;rsquo;s no linear algebra, no digressions on mathematical or computational statistics but it does the job at explaining basic concepts to newcomers, in particular the sampling distribution of a test statistic, standard error and confidence intervals, and how to interpret null hypothesis testing. I yet have to explore how far Mathematica goes with Bayesian, non-parametric and robust statistics.&lt;/p&gt;
&lt;p&gt;Regarding the basic material itself, you will learn about &lt;code&gt;List&lt;/code&gt; comprehension using &lt;code&gt;Table&lt;/code&gt; and to deal with lists and nested lists, which can be flattened or viewed in a matrix form. &lt;a href="https://reference.wolfram.com/language/tutorial/Expressions.html"&gt;Everything is an expression&lt;/a&gt; and the basic object of interaction is a list, which must bring back fond memories for Lisp regulars. I would say it is even more striking than with R. As said above, &lt;code&gt;Dataset&lt;/code&gt; extends the capabilities offered by nested lists to associations, which is the term used to denote a specific hash table which links elements of nested lists with distinct keys.&lt;/p&gt;
&lt;p&gt;You can view a &lt;code&gt;Dataset&lt;/code&gt; as is in a notebook &amp;ndash; it&amp;rsquo;s pretty well displayed and useable, btw, and you can import rectangular datasets (e.g., tab-delimited or CSV data files) into a &lt;code&gt;Dataset&lt;/code&gt; using &lt;code&gt;SemanticImport&lt;/code&gt; rather than the omnipotent &lt;code&gt;Import&lt;/code&gt; function. One thing that I struggled with when I started using Mathematica two years ago as a replacement to Stata was how to alternate between the &lt;code&gt;Dataset&lt;/code&gt; and &lt;code&gt;List&lt;/code&gt; views. It turns out that something like &lt;code&gt;Normal[dataset[All, &amp;quot;column&amp;quot;]]&lt;/code&gt;, where &lt;code&gt;column&lt;/code&gt; is the variable of interest, will turn a &lt;code&gt;Dataset&lt;/code&gt; column to a regular list. Another thing I really like is that you can address any value in a &lt;code&gt;Dataset&lt;/code&gt; like you would do in R, with &lt;code&gt;All&lt;/code&gt; and &lt;code&gt;;;&lt;/code&gt; as secret keywords you must retain. Like in R, you can address variable (column) by name or index, which was not easy in Stata (where almost every entry is a variable).&lt;/p&gt;
&lt;p&gt;I like the fact there&amp;rsquo;s an implicit apply function for dataset, e.g. &lt;code&gt;dataset[Mean, &amp;quot;column&amp;quot;]&lt;/code&gt;. Should you want the whole split-apply-combine strategy, combine &lt;code&gt;Select&lt;/code&gt; and &lt;code&gt;GroupBy&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Mathematica already provides a lot of builtin functions for data visualization (with great defaults!) and summary statistics. There&amp;rsquo;s a lot more to see on &lt;a href="https://resources.wolframcloud.com/FunctionRepository"&gt;Wolfram Function Repository&lt;/a&gt;. For casual statistical tests, you will need the HypothesisTesting and ANOVA package, but they are already available in the base installation of Mathematica.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Tindersticks • &lt;em&gt;Drunk Tank&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Common Lisp tooling in 2025</title><link>https://aliquote.org/post/cl-tooling-in-2025/</link><pubDate>Wed, 22 Jan 2025 21:00:57 +0100</pubDate><guid>https://aliquote.org/post/cl-tooling-in-2025/</guid><description>&lt;p&gt;Transitioning to macOS after 4 years of Linux happened to be smoother than I anticipated. Most of the tools I relied on previously were already right there in the OS (e.g. Terminal or Safari), and the rest is easily available via Homebrew. That being said, I decided to keep the bare minimum of what I need to get my work done, and to focus on PLs I want to explore more practically this year: Common Lisp, Racket, Mathematica and Haskell.&lt;/p&gt;
&lt;p&gt;Regarding Racket and Haskell, everything is already configured with appropriate linters and fixers in my Neovim config. The LSP do the job I expect from them, that is they provide hover information, go to definition and references, and warning/error appear as expected in the Quickfix. Code actions are available in the case of Haskell.&lt;/p&gt;
&lt;p&gt;I used to use various strategies for dealing with Lisp in the past. The best solution is probably to rely on &lt;a href="https://github.com/kovisoft/slimv"&gt;slimv&lt;/a&gt;, but I wanted something simpler, especially given that I can fire a REPL myself and interact with it without relying on an external plugin.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The idea is that all functionality available in any editor or plugin is also available in the &amp;ldquo;vanilla&amp;rdquo; REPL. &amp;mdash; &lt;a href="https://blog.djhaskin.com/blog/developing-common-lisp-using-vim-with-tmux-or-conemu"&gt;Developing Common Lisp using Vim with tmux or ConEMU&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I use msotly the same apparoach as Daniel Jay Haskin except that I have my own implementation of &amp;ldquo;send line or selection to the REPL&amp;rdquo;, a custom &lt;code&gt;keywordprg&lt;/code&gt; to query the Hyperspec online and display it in w3m, an omnicomplete function taken from &lt;a href="https://github.com/jabbourb/visper"&gt;visper&lt;/a&gt;, and a folding function grabbed from Steve Losh&amp;rsquo;s &lt;a href="https://hg.stevelosh.com/dotfiles/file/e7642253ffde/vim/ftplugin/lisp/lispfolding.vim"&gt;dot files&lt;/a&gt;. In addition to Dan&amp;rsquo;s &lt;a href="https://git.sr.ht/~skin/roswell-sbcl.vim"&gt;compiler&lt;/a&gt;, the following two keybindings take care of most of the rest:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-vim" data-lang="vim"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;nnoremap&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;gs&lt;/span&gt; :&lt;span class="m"&gt;10&lt;/span&gt; &lt;span class="nx"&gt;split&lt;/span&gt; &lt;span class="nx"&gt;term&lt;/span&gt;:&lt;span class="sr"&gt;//&lt;/span&gt;&lt;span class="nx"&gt;ros&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;Q&lt;/span&gt; &lt;span class="p"&gt;--&lt;/span&gt; %&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;:&lt;span class="nx"&gt;startinsert&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;nnoremap&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;leader&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;!&lt;/span&gt; :&lt;span class="nx"&gt;sp&lt;/span&gt; &lt;span class="nx"&gt;term&lt;/span&gt;:&lt;span class="sr"&gt;//&lt;/span&gt;&lt;span class="nx"&gt;ros&lt;/span&gt; &lt;span class="nx"&gt;run&lt;/span&gt; &lt;span class="p"&gt;--&lt;/span&gt;&lt;span class="nx"&gt;eval&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;(ql:quickload :swank)&amp;#39;&lt;/span&gt; &lt;span class="p"&gt;--&lt;/span&gt;&lt;span class="nx"&gt;eval&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;(swank:create-server :dont-close t)&amp;#39;&lt;/span&gt; \&lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="nx"&gt;SendHere&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;C&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;w&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;C&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;w&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As can be seen I use &lt;a href="https://roswell.github.io"&gt;Roswell&lt;/a&gt; to launch SBCL and to manage Quicklisp packages. Ultimately, I would like to have an automated way of generating &lt;a href="https://blog.djhaskin.com/blog/release-common-lisp-on-your-first-day"&gt;binary executables&lt;/a&gt; or &lt;a href="https://github.com/dnaeon/cl-skeleton"&gt;Docker images&lt;/a&gt;, but for the time being I&amp;rsquo;m mostly interested in scripting at large. I encountered some problems when installing the &lt;a href="https://gsll.common-lisp.dev"&gt;GSLL&lt;/a&gt; and &lt;a href="https://github.com/yitzchak/common-lisp-jupyter"&gt;common-lisp-jupyter&lt;/a&gt;; there appears to be some issues with the current CFFI bindings, but &lt;a href="https://github.com/yitzchak/common-lisp-jupyter/issues/32"&gt;this patch&lt;/a&gt; fixed the issue. I was able to install &lt;a href="https://github.com/quil-lang/magicl"&gt;magicl&lt;/a&gt; without any issue, as well as various high-level utilities, like &lt;a href="https://github.com/ruricolist/serapeum"&gt;serapeum&lt;/a&gt;. No luck with cl-ana, or any other packages from Gary Hollis since they all depend on hdf5 and FFi which grovel skates endlessly. &lt;a href="https://github.com/ghollisjr/cl-ana/wiki/Installation"&gt;This&lt;/a&gt; may solve the issue but I&amp;rsquo;m not willing to try all that (either downgrading hdf5 or using a staled branch of cl-ana and a CFII fork).&lt;/p&gt;
&lt;p&gt;I mentioned &lt;a href="https://github.com/yitzchak/common-lisp-jupyter"&gt;common-lisp-jupyter&lt;/a&gt; since I tried to use Quarto with CL Jupyter kernel, and it worked like a charm. Same for the Racket kernel, by the way.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Broadcast • &lt;em&gt;Long Was the Year&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;I&amp;rsquo;m using a pretty slick Neovim config with only 5 plugins, including 2 opt plugins, all managed via the builtin plugin manager.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>lost+found 2024</title><link>https://aliquote.org/post/lost-found-2024/</link><pubDate>Wed, 01 Jan 2025 20:51:15 +0100</pubDate><guid>https://aliquote.org/post/lost-found-2024/</guid><description>&lt;h2 id="customizing-mpv-2024-08-21"&gt;Customizing Mpv (2024-08-21)&lt;/h2&gt;
&lt;p&gt;Random links to elaborate on how I built my own Mpv config.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/mpv-player/mpv/wiki/User-Scripts"&gt;https://github.com/mpv-player/mpv/wiki/User-Scripts&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/mpv-player/mpv/wiki/FAQ"&gt;https://github.com/mpv-player/mpv/wiki/FAQ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://wiki.archlinux.org/title/Mpv"&gt;https://wiki.archlinux.org/title/Mpv&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://kokomins.wordpress.com/2019/10/14/mpv-config-guide/"&gt;https://kokomins.wordpress.com/2019/10/14/mpv-config-guide/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/iwalton3/default-shader-pack"&gt;https://github.com/iwalton3/default-shader-pack&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="on-trend-tests-2024-01-25"&gt;On trend tests (2024-01-25)&lt;/h2&gt;
&lt;p&gt;A few weeks ago I discussed the &lt;a href="https://aliquote.org/post/cochran-mantel-haenszel/"&gt;Cochran-Mantel-Haenszel test&lt;/a&gt;. Another widely used test to assess linear trend in two-way tables is the Mantel-Haenszel trend test. There&amp;rsquo;s a very interesting discussion about &lt;a href="https://www.stata.com/support/faqs/statistics/test-for-trend/"&gt;trend tests&lt;/a&gt; on Stata FAQs, by William Sribney from StataCorp.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://arxiv.org/pdf/2401.13010.pdf"&gt;https://arxiv.org/pdf/2401.13010.pdf&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://arxiv.org/pdf/2011.13758v1.pdf"&gt;https://arxiv.org/pdf/2011.13758v1.pdf&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="approximating-sine-2024-01-25"&gt;Approximating sine (2024-01-25)&lt;/h2&gt;
&lt;p&gt;A few weeks ago I came across this blog post: &lt;a href="https://nes.is-a.dev/out/2022/approximating-sin.html"&gt;Approximating sin(x)&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;It functions very similarly to the taylor polynomial, except the constants have been replaced to achieve greather accuracy, (&amp;hellip;)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Except this is not based on a Taylor expansion, but it rather relies on Chebyshev polynomials.&lt;/p&gt;
&lt;p&gt;In &lt;a href="https://www.ams.org/journals/mcom/1954-08-047/S0025-5718-1954-0063487-2/S0025-5718-1954-0063487-2.pdf"&gt;Polynomial Approximations to Elementary Functions&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://hal.science/hal-02517784v2/document"&gt;Elementary Functions and Approximate Computing&lt;/a&gt;, see also &lt;a href="https://perso.ens-lyon.fr/jean-michel.muller/TruncToms.pdf"&gt;Computing Machine-Efficient Polynomial Approximations&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Remez algorithm, see &lt;a href="https://arxiv.org/abs/2202.05472"&gt;Dandelion: Certified Approximations of Elementary Functions&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="generating-all-or-next-permutation-2024-01-12"&gt;Generating all or next permutation (2024-01-12)&lt;/h2&gt;
&lt;p&gt;In a &lt;a href="https://aliquote.org/post/permutation-test-in-lisp/"&gt;previous post&lt;/a&gt;, I mention a way to suffle labels of a two-group dataset in order to carry out a permutation test. Usually, it&amp;rsquo;s more efficient to randomize the highest level unit of an experimental design, i.e. rather than shuffling observations use the group level.&lt;/p&gt;
&lt;p&gt;A recursive solution to the problem of generating all permutation of a given list or array is as follows:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;If the length of Permutation equals the length of Array
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Permutation Found.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Else
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; For each position ‘p’ from 0 till the length of Array
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; If element at position ‘p’ has been taken
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Continue to check for next position.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Mark position ‘p’ as Taken.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Append the element at position ‘p’ to the Permutation.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Generate_Permutation ( Permutation, Array, Positions )
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Remove the element at position ‘p’ from the Permutation.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Mark position ‘p’ as Available.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;other algorithms&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;heap&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;domain-specific applications &lt;a href="https://rdrr.io/cran/permute/"&gt;https://rdrr.io/cran/permute/&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Sedgewick and Wayne&amp;rsquo;s algorithm &lt;a href="https://introcs.cs.princeton.edu/java/23recursion/Permutations.java.html"&gt;https://introcs.cs.princeton.edu/java/23recursion/Permutations.java.html&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Steinhaus%E2%80%93Johnson%E2%80%93Trotter_algorithm"&gt;https://en.wikipedia.org/wiki/Steinhaus%E2%80%93Johnson%E2%80%93Trotter_algorithm&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;base case&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Racket&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;cl-permutation&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Rosetta code&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;numpy and &lt;code&gt;itertools.permutations()&lt;/code&gt;, &lt;a href="https://numpy.org/doc/stable/reference/random/generated/numpy.random.Generator.permutation.html#numpy.random.Generator.permutation"&gt;https://numpy.org/doc/stable/reference/random/generated/numpy.random.Generator.permutation.html#numpy.random.Generator.permutation&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;next permutation &lt;a href="https://www.nayuki.io/page/next-lexicographical-permutation-algorithm"&gt;https://www.nayuki.io/page/next-lexicographical-permutation-algorithm&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;stream, generator&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Phillip Good (2004) &lt;em&gt;Permutation, Parametric, and Bootstrap Tests of Hypotheses&lt;/em&gt;, New York: Springer-Verlag&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Sixth June • &lt;em&gt;Night Before&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in December</title><link>https://aliquote.org/post/micro-12-2024/</link><pubDate>Sat, 28 Dec 2024 15:13:03 +0100</pubDate><guid>https://aliquote.org/post/micro-12-2024/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2024-12-04&lt;/a&gt;: /me is listening to &amp;ldquo;I Can&amp;rsquo;t Be&amp;rdquo; by Sally Dige&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-12-04&lt;/a&gt;: Musing with three types of backup systems on my old Macbook: Arq, Borg and Kopia. I was able to mount every backup folder correctly. Now I just need to put the years end-to-end!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-12-21&lt;/a&gt;: I got a new MacBook Pro. It&amp;rsquo;s gorgeous!&lt;br&gt;&lt;img src="https://aliquote.org/img/2024-12-21-21.29.20.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-12-21&lt;/a&gt;: Tip of the day: To rename a bunch of photos on your HD according to the original date, the following works well: &lt;code&gt;exiftool '-filename&amp;lt;CreateDate' -d %Y-%m-%d-%H%M%S%%-c.%%le -ext jpg -r .&lt;/code&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-12-26&lt;/a&gt;: /me is listening to &amp;ldquo;Flesh Dance&amp;rdquo; by Gothic Tropic&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-12-27&lt;/a&gt;: I switched my default mail provider to iCloud, instead of this domain name. Back in time, I guess. This way I can manage my emails using Neomutt or Apple Mail (via IMAP), depending on my mood, and everything keeps sync&amp;rsquo;ed. I needed to convert my archives folder from Maildir to Mbox but Neomutt failed me when I used the &lt;a href="https://stackoverflow.com/a/78563498"&gt;following command&lt;/a&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;neomutt -f ~/.mail/archives -e &lt;span class="s1"&gt;&amp;#39;set mbox_type=mbox; set confirmcreate=no; set delete=no; push &amp;#34;T.*&amp;lt;enter&amp;gt;;s/Users/chl/tmp/archives.mbox&amp;lt;enter&amp;gt;&amp;lt;quit&amp;gt;&amp;#34;&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I believe this doesn&amp;rsquo;t handle multiple aliases for sender correctly. However, this &lt;a href="https://github.com/bluebird75/maildir2mbox"&gt;Python module&lt;/a&gt; worked like a charm and I was able to get 10k messages with correct threading in no time at all.&lt;br&gt;&lt;/p&gt;</description></item><item><title>December in review</title><link>https://aliquote.org/post/micro-review-028/</link><pubDate>Mon, 23 Dec 2024 19:07:58 +0100</pubDate><guid>https://aliquote.org/post/micro-review-028/</guid><description>&lt;ul&gt;
&lt;li&gt;&lt;a href="http://0x80.pl/notesen/2024-12-21-uint8-division.html"&gt;Dividing unsigned 8-bit numbers&lt;/a&gt;: Interesting technical articles with lot of benchmarks on SIMD-based floating point (long) division. The takeaway message is that AVX-512 implementation performs best over all other competitors.&lt;/li&gt;
&lt;li&gt;Besides lot of stuff to read from his &lt;a href="https://code.dblock.org"&gt;tech blog&lt;/a&gt;, I particularly like Daniel Doubrovkine&amp;rsquo;s art gallery, e.g. the &lt;a href="https://art.dblock.org/2015/01/02/large-sanguine-drawings.html"&gt;Large Sanguine Drawings&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://milescole.dev/data-engineering/2024/12/12/Should-You-Ditch-Spark-DuckDB-Polars.html"&gt;Should You Ditch Spark for DuckDb or Polars?&lt;/a&gt;: I&amp;rsquo;ve used DuckDB in the past, and I was impressed by its performance and how easy it was to install &lt;a href="https://duckdb.org/docs/extensions/overview.html"&gt;extensions&lt;/a&gt;. Spark, uh, it was a long time ago and I no longer have any calculations that require this type of distributed calculation. I&amp;rsquo;m sticking with the &lt;a href="https://datatable.readthedocs.io/en/latest/"&gt;datatable&lt;/a&gt; module whenever I can, but I don&amp;rsquo;t that much stuff in Python these days. From what I read, the author suggests that Polars offers very good performance when it comes to Small Result Aggregation but overall DuckDB is a winner in most benchmarks. This is not surprising, after all, since Polars primarily targets data structures that are best represented as data frames.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://jaketae.github.io/study/prime-spirals/"&gt;Plotting Prime Numbers&lt;/a&gt;: Not something new to me since I already came across a post like this but this was refreshing.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://bdash.net.nz/posts/sandboxing-on-macos/"&gt;Sandboxing on macOS&lt;/a&gt;: And to think I was reading this kind of article when my Linux laptop hadn&amp;rsquo;t yet crashed! Anyway, I was just curious to understood how it all works under the hood. It is noteworthy that OpenBSD (pledge and unveil) and Qubes OS (domains and app qubes) offer equivalent gatekeeping strategies.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://alok.github.io/2024/09/28/discontinuous-derivative/"&gt;Derivative AT a Discontinuity&lt;/a&gt;: Or how to differentiate the Heaviside function using actual functions rather than distributions.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://imaginarytext.ca/posts/2024/pandoc-typst-tutorial/"&gt;Using Pandoc and Typst to Produce PDFs&lt;/a&gt;: I always enjoy learning how folks think about their workflow, and the tools they use. I learned about Typst one or two years ago maybe, but I never gave it a try. I&amp;rsquo;m stuck with my arcaned Markown or Org -&amp;gt; $\TeX$ workflows, usually processed via Emacs&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; or Pandoc.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hez2010.github.io/async-runtimes-benchmarks-2024/"&gt;How Much Memory Do You Need in 2024 to Run 1 Million Concurrent Tasks?&lt;/a&gt;: A comparison of coroutine vs. multiple threads (older post).&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.iamcal.com/tags/minecraft/"&gt;Minecraft Enchantment Ordering Tool&lt;/a&gt;: Because why not.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.andreinc.net/2024/11/18/a-function-to-approximate-raising-small-numbers-to-small-irrational-powers"&gt;A joke in approximating numbers raised to irrational powers&lt;/a&gt;: I let you dive into the &amp;ldquo;monster&amp;rdquo; function ;-)&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;I was really excited to also find a document that I had created in 1991 or so listing the games and “creator codes” that I had used in these games. Creator codes were like a very crude “bundle identifier” back in the pre-OS-X era of the Macintosh. They were supposed to be unique from all other application creator codes. The document is interesting to me today because in it I had cataloged the projects that I had worked on up to that point. &amp;mdash; &lt;a href="https://engineersneedart.com/blog/movefast/movefast.html"&gt;Move Fast and Abandon Things&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://macowners.club/posts/text-based-email-workflow-macos/"&gt;Text based email workflow on macOS&lt;/a&gt;: Neomutt with a Mu backend for finding contact and fast indexing/searching facilities is great, trust me.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Arcade Fire • &lt;em&gt;Vampire/Forest Fire&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Okay, I gave up on Emacs, but I still have dozens of Makefile that rely on it.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Hello macOS again</title><link>https://aliquote.org/post/hello-macos-again/</link><pubDate>Sun, 22 Dec 2024 20:11:47 +0100</pubDate><guid>https://aliquote.org/post/hello-macos-again/</guid><description>&lt;p&gt;I thought I would write a blog post a month ago after &lt;a href="https://aliquote.org/micro/2024-11-25-21-09-42/"&gt;my laptop blew up&lt;/a&gt;, then when I spent a week reconfiguring my &lt;a href="https://aliquote.org/micro/2024-11-26-21-42-11/"&gt;old MacBook 12&amp;quot;&lt;/a&gt;. I gave up, it was certainly better to let things go at that time. Now I got a new MacBook, the top of the line, and it&amp;rsquo;s refreshing. First, I never had a laptop as powerful as this one. Still, it&amp;rsquo;s a little annoying since I lost a lot of personal stuff.&lt;/p&gt;
&lt;h2 id="ground-0"&gt;Ground 0&lt;/h2&gt;
&lt;p&gt;I came back at home after my day&amp;rsquo;s work, and when I plugged the power supply back onto my laptop (Dell Latitude 7310) the screen remain blank, I mean nothing happened. It occured in the past, so I tried to hard reboot the OS to no avail. I then dismantled the computer and realized that the power supply unit was out of order. I removed the SSD but could never mount it for reading. After a few days, I had to face the fact that there was nothing left to save and that I could go back to my July general backup. Sadly, I just finished consolidating my music library with Beets and I was going to backup everything right away. That&amp;rsquo;s life, I guess. I also lost 1 year or so of pictures taken with my ageing iPhone, a collection of desktop background I made recently, dozens of shell scripts I wrote during the quiet Summer days to automate things here and there, as well as my Newboat archives ans 4 months worth of emails &amp;ndash; which I don&amp;rsquo;t really care about but still&amp;hellip; Since everything I do at work is synced on Github or local servers, nothing was lost on this side.&lt;/p&gt;
&lt;h2 id="round-1"&gt;Round 1&lt;/h2&gt;
&lt;p&gt;I came back to my beloved MacBook 12&amp;quot;. I haven&amp;rsquo;t used it in years, except to backup my text messages. It was hardly usable at first, and I had to reinstall all the stuff I removed since 2018. I reinstalled Homebrew, and then I realized that there was no longer any bottle for the software I was asking for, which means I needed to recompile everything from scratch. That&amp;rsquo;s fine, I already did this for a living in the past. It took me a week, though. The hell of dependencies on top of a slow processor, if you see what I mean. Finally, I made it and I got a working workstation which helped me to continue my activities at work. Two things came to my mind after the fact: I was glad to get my MacBook back with its retina display, and listening to my playlists on this device was much better compared to the Dell laptop. I don&amp;rsquo;t know how I put up with that one for so long. Anyway, that was funny as I happened to recompile Neomutt and Cmus, with all their dependencies, from scratch. I gave up reagrding Newsboat as it required so much dependencies. Of interest, everything Rust-related worked with no problem at all, even on Mojave which is now 6 years old and deprecated all over the place, including Homebrew.&lt;/p&gt;
&lt;h2 id="round-2"&gt;Round 2&lt;/h2&gt;
&lt;p&gt;My benevolent colleagues helped me get a new computer when I was ready to buy a macbook myself. Instead of a MacBook Air, I ended up with a MacBook Pro M4 14&amp;quot;. It&amp;rsquo;s a beast without further ado. I fired up Homebrew and installed a bunch of utilities, in addition to rustup, ghcup, uv, and roswell for which I used the provided install shell scripts. I now let Homebrew manage whole applications (aka &amp;ldquo;Cask&amp;rdquo;) for me, which means I do not install things by myself: either they are on the AppStore (pre paid or newly released), or as Homebrew formula or casks. My workflow hasn&amp;rsquo;t change. I still use Neovim as my daily driver, Neomutt for managing my emails, and Newsboat for RSS. I just replaced ncmcpp with Apple Music as I find it more convenient. As &lt;a href="https://aliquote.org/post/bye-bye-apple/"&gt;I once said&lt;/a&gt;,&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;These days, I’m happy with a few tools that allow me to do 90% of my work in an efficient manner.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Well, it&amp;rsquo;s time to go back to the future for now.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ The Other Two • &lt;em&gt;Movin&amp;rsquo; On&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in November</title><link>https://aliquote.org/post/micro-11-2024/</link><pubDate>Mon, 02 Dec 2024 21:24:37 +0100</pubDate><guid>https://aliquote.org/post/micro-11-2024/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2024-11-11&lt;/a&gt;: /me is listening to &amp;ldquo;Love Hides&amp;rdquo; by The Doors&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-11-11&lt;/a&gt;: Apparently, they will soon get a new home!
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_4062.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_4062.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_4072.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_4072.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_4132.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_4132.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-11-11&lt;/a&gt;: I&amp;rsquo;m pretty happy with new management system for my audio file. Thanks to &lt;a href="https://beets.io"&gt;Beets&lt;/a&gt; I now have access to the whole power of command line utilities. Here&amp;rsquo;s a brief overview of the top genres in my library:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» beet summarize &lt;span class="p"&gt;|&lt;/span&gt; head -n &lt;span class="m"&gt;12&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;genre &lt;span class="p"&gt;|&lt;/span&gt; count
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;---------------------- &lt;span class="p"&gt;|&lt;/span&gt; -----
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Rock &lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="m"&gt;3045&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Post-Punk &lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="m"&gt;2754&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Jazz &lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="m"&gt;2509&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Alternative &lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="m"&gt;1212&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Electronic &lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="m"&gt;948&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Indie Rock &lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="m"&gt;838&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Pop &lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="m"&gt;817&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Classic Rock &lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="m"&gt;679&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Alternative Rock &lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="m"&gt;497&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Indie Pop &lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="m"&gt;424&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;How many total tracks having a genre tag, excluding tracks from playlists which contain, following poor design choice, duplicate records?&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» beet summarize ^context:playlist &lt;span class="p"&gt;|&lt;/span&gt; head -n &lt;span class="m"&gt;12&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; cut -f2 -d&lt;span class="se"&gt;\|&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; tail -n +3 &lt;span class="p"&gt;|&lt;/span&gt; paste -sd+ &lt;span class="p"&gt;|&lt;/span&gt; bc
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="m"&gt;10603&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And so on… Wanna looks at the tlistening stats for the current song?&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» beet ls -f &lt;span class="s1"&gt;&amp;#39;$artist ($album): $title ($length) [$genre, $play_count, $last_played]&amp;#39;&lt;/span&gt; &lt;span class="k"&gt;$(&lt;/span&gt;mpc current &lt;span class="p"&gt;|&lt;/span&gt; sed s/-//&lt;span class="k"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Diana Krall &lt;span class="o"&gt;(&lt;/span&gt;The Girl in the Other Room&lt;span class="o"&gt;)&lt;/span&gt;: Narrow Daylight &lt;span class="o"&gt;(&lt;/span&gt;3:31&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;Contemporary Jazz, 12, 2024-11-11 20:38:09&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2024-11-11&lt;/a&gt;: &lt;a href="https://nitens.org/w/latex/"&gt;The Beauty of $\LaTeX$&lt;/a&gt;: Some of the crap that has kept me from using MS Word for years. Now I&amp;rsquo;m too old and remain a happy $\TeX$er for the days ahead. Fun thing: we did the same MSc (which was called a DEA at that time in France) one year apart!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-11-25&lt;/a&gt;: I&amp;rsquo;ve spent a few more or less pleasant days, long ones in any case, reconfiguring my old 12-inch macbook. Guess what about my &lt;a href="https://aliquote.org/post/bye-bye-apple/"&gt;Dell laptop&lt;/a&gt; and my fresh configuration of &lt;a href="https://aliquote.org/post/ubuntu-24.04/"&gt;Ubuntu 24.04 LTS&lt;/a&gt;: the power supply blew up and the SSD along with it. Now everything seems workable (at the very best, for a 6-year old OS). More to come in a blog post later.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-11-26&lt;/a&gt;: I&amp;rsquo;m not in the mood of writing a full blog post to summarize my recent comeback to OS X. It&amp;rsquo;s still OS X on my machine, but I know it evolved as something else since 2018. I don&amp;rsquo;t know if I&amp;rsquo;m ready to buy a new Macbook &lt;em&gt;with&lt;/em&gt; the accompagnying OS. I liked and I still like Mojave so much. Yet it was pretty painful to resurrect this &lt;a href="https://aliquote.org/post/setup-2018/"&gt;laptop&lt;/a&gt;: Homebrew has no &amp;ldquo;bottles&amp;rdquo; for oldy software, which means I had to recompile everything from scratch for 60% of the software I reinstalled. I got into trouble with GPG, GitHub https auth, zsh misbehaving on OS X for no reason, minor annoyances with the Linux -&amp;gt; OS X switch, and so on. Finally, I&amp;rsquo;m close to the end of the migration process. It took me 5 full days! And I had to somehow relearn macOS shorcuts. Muscle memory helped in most cases, but still&amp;hellip; &lt;a href="https://aliquote.org/post/micro-10-2020/"&gt;So long, Apple&lt;/a&gt; &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-11-26&lt;/a&gt;: TIL that &lt;code&gt;TERM=xtermm&lt;/code&gt; on Darwin behaves like &lt;code&gt;TERM=xterm-mono&lt;/code&gt; on Linux. That was helpful to force Neomutt or Cmus to use mono color by default. Moreover, if you use &lt;code&gt;TERM=vt100&lt;/code&gt; for Neomutt, it behaves more smoothly when fetching new mail with mbsync. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-11-28&lt;/a&gt;: Currently rebuilding my iTunes library. Back in 2016 it wasn&amp;rsquo;t the time to switch to Apple Music and TV. I&amp;rsquo;m on an unsupported laptop and OS right now, but it feels so good. Yet, congrats to Apple because I can retrieve all my data in just two or three clicks. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-11-29&lt;/a&gt;: With that damn machine crash last week, I&amp;rsquo;m in the process of retagging my music library (after re-downloading some albums from YT for the second time), and soon everything should be ready to join my iTunes library, neglected since 2016. The last title I bought from Apple was the Glenn Gould album, BTW.&lt;br&gt;&lt;/p&gt;</description></item><item><title>Back to Beets</title><link>https://aliquote.org/post/back-to-beets/</link><pubDate>Sun, 10 Nov 2024 20:36:11 +0100</pubDate><guid>https://aliquote.org/post/back-to-beets/</guid><description>&lt;p&gt;It&amp;rsquo;s a been a few weeks with ncmpcpp as my &lt;a href="https://aliquote.org/post/mpd-and-ncmpcpp/"&gt;daily driver&lt;/a&gt; to the mpd daemon. So far so good, it&amp;rsquo;s lightweight and it allows you to make very precise settings. Once I learned how to &lt;a href="https://aliquote.org/micro/2024-10-29-18-16-40/"&gt;remove all the fancy colors&lt;/a&gt; (this is simply &lt;code&gt;colors_enabled = no&lt;/code&gt;), I think I got a very decent music player and I no longer miss Cmus since it covers the same set of features plus many additional options (tag editor, display information on tracks or artists, fetching lyrics, among others).&lt;/p&gt;
&lt;p&gt;Now I wanted to cleanup my database, and soon after I started using mpd I configured Beets to import and auto-tag my whole music directory. Other authors already described &lt;a href="https://whine.fr/beets-mpd-ncmpcpp/"&gt;their&lt;/a&gt; &lt;a href="https://ssrubin.com/posts/music-library-with-mpd-ncmpcpp-beets.html"&gt;workflow&lt;/a&gt;, mostly as a way to bypass Apple Music (aka iTunes). Last time I used Beets I was left with a &lt;a href="https://aliquote.org/post/auto-tagging-my-music/#beets"&gt;mixed impression&lt;/a&gt;. This time I took some time to think about it. First I did not import everything (18k tracks) at once and I disabled the auto-tagging and moving option. I simply gathered all my albums in a dedicated folder, and likewise I kept separate folders of playlists in another parent directory. In the end I only have two directories (collection and playlists which hold all my music). Incoming music is stored in a temporary folder which is ignored by mpd (thanks to an &lt;code&gt;.mpdignore&lt;/code&gt; file). Playlists were imported as is (they are supposed to be well crafted since they dated back from my time with Apple and iTunes). Albums were also imported as is, and I tagged them later in sort of a batch mode, i.e. albums I ripped from my own CDs or albums I fetched from the interwebz. I assumed that albums downloaded from Bandcamp were already well annotated. It took me a week or so to get a clean &lt;code&gt;beet update&lt;/code&gt;.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;p&gt;&lt;small&gt;[2025-01-12]&lt;/small&gt;&lt;br&gt;
See also &lt;a href="https://blog.yossarian.net/2022/02/21/Enjoying-music-curation-again"&gt;Enjoying music curation again&lt;/a&gt; to learn more about others&amp;rsquo; config (I learned about the scrub plugin, for instance.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;MusicBrainz has accurate metadata for well over 95% of the albums that I’ve passed through beet import, meaning that normalizing and checking everything is as simple as pressing “Enter” a handful of times.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/div&gt;
&lt;p&gt;I learned a few things along the way. First, it&amp;rsquo;s good to add Discogs as a source for auto-tagging in addition to MusicBrainz and Bandcamp. In case you already have cover art, disable auto-fetching album art otherwise you&amp;rsquo;re likely to end up with a cover.jpg and cover.1.jpg (on Linux) file for each album. I had to cleanup the SQLite database manually. Take your time to review the suggested options when album matches aren&amp;rsquo;t very high (&amp;lt; 50%); sometimes it&amp;rsquo;s good time to look for a Discogs ID rather than trust the low confidence matches (especially for special or deluxe edition, particular rare LP or collaborative work). Several pass of &lt;code&gt;beet update&lt;/code&gt; may be necessary in order to get a cleaned database. A final note: you may notice that audio tags seem to not be updated right after running Beets (e.g., if you use id3 like me) but &lt;a href="https://docs.beets.io/en/latest/faq.html#not-change-my-id3-tags"&gt;Beets relies on ID3v2.4&lt;/a&gt;. I was disappointed for a long seeing the correct annotation in ncmpcpp but not when querying audio file properties using &lt;code&gt;id3info&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;I gathered a fair amount of live, EPs and LPs from the web archives a few months ago. Most of the records are of acceptable quality (usually 128 Kbps) bur for live events don&amp;rsquo;t except more than bad broadcast FM recordings! We all miss Napster, right? However, despite my aversion to Google products, I realized that YouTube Music is quite a decent option to complete missing tracks from albums you like or to fetch whole albums. Things to keep in mind is that oftentimes album are not complete or need you to be logged in to download specific tracks. Finally, all tracks need to be retagged (e.g., default track number is 63 for all tracks related to the same album if I trust Beets). I use &lt;a href="https://github.com/yt-dlp/yt-dlp"&gt;yt-dlp&lt;/a&gt; with the following settings (as a Bash script) to fetch music from YT:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; i in &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$@&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; yt-dlp -f bestaudio &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -x --audio-format mp3 &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --audio-quality 320k &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --embed-thumbnail &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --add-metadata &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --postprocessor-args &lt;span class="s2"&gt;&amp;#34;-id3v2_version 3&amp;#34;&lt;/span&gt; &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --output &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/Media/Music/tmp/%(playlist_title)s/%(playlist_index)s - %(title)s.%(ext)s&amp;#34;&lt;/span&gt; &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$i&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="alert alert-note"&gt;
&lt;p&gt;&lt;small&gt;[2025-01-12]&lt;/small&gt;&lt;br&gt;
Slightly updated yt-dlp config follows: (we barely need to require 320k when quality is around 256k or less on YT.)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# $HOME/.config/yt-dlp/config&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;-o &lt;span class="s1"&gt;&amp;#39;/Users/chl/Music/downloads/%(album_artist)s/%(album)s/%(playlist_index)s - %(title)s.%(ext)s&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;--no-mtime
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;-f &lt;span class="s1"&gt;&amp;#39;ba*&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;-x --audio-format mp3 --audio-quality &lt;span class="m"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;--embed-thumbnail
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;--embed-metadata
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;--parse-metadata &lt;span class="s1"&gt;&amp;#39;%(album_artist,channel,creator,artist|Unknown)s:%(album_artist)s&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then put your URLs in a dedicated text file and just call Bash:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="nb"&gt;read&lt;/span&gt; url&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; yt-dlp &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$url&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;done&lt;/span&gt; &amp;lt;youtube
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;I then import YT audio tracks with Beets to get automagically tagging and renaming. It is also able to automagically fetch cover art, or you may disable it and download an image file yourself. I must admit YT music is amazing. I was able to find quite old OSTs like the one for The Crow with Brandon Lee, as well as Delux edition for some album I own.&lt;/p&gt;
&lt;p&gt;Even after you get a clean output from &lt;code&gt;beet update&lt;/code&gt; you may still want to manually curate some artifacts like incorrect dates (original date are usually fine, but dates are often wrong &amp;ndash; for instance, because they are for a deluxe or remix) or missing genres. I used the lastgenre plugin to get a more consistent classification (from lastfm), and I manually edited the 1000 tracks that were still missing genre information. I still have to fix the issue with improper tagging of date. Note that &lt;code&gt;beet summarize&lt;/code&gt; and &lt;code&gt;beet list&lt;/code&gt; are very handy to catch incorrect dates and find relevant tracks.&lt;/p&gt;
&lt;p&gt;Along the way, I removed the &lt;a href="https://github.com/hardfau1t/mscout"&gt;mscout&lt;/a&gt; service I set up earlier since I&amp;rsquo;m now using the &lt;a href="https://docs.beets.io/en/stable/plugins/mpdstats.html"&gt;mpdstats&lt;/a&gt; plugin. It will be more convenient to store the play counts in the Beets database itself rather than mpd sticker databasE. Initially I started writing a shell script to retrieve my old listening statistics (which I first converted from Cmus to mscout) and integrate them in the Beets database, until I realized that Beets completely changed hundred of pathnames during importation. I&amp;rsquo;m too lazy to write a script relying on a hash for each track, so I will update the play count manually (this is already done for all my playlists, but this was the easy part!).&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Blue Cranes • &lt;em&gt;I Forgive You&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in October</title><link>https://aliquote.org/post/micro-10-2024/</link><pubDate>Fri, 01 Nov 2024 17:36:01 +0100</pubDate><guid>https://aliquote.org/post/micro-10-2024/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2024-10-03&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In fact, you rarely have anything to do with the operating system on a PC desktop or laptop, you mostly only deal with desktop applications - and they can suck equally bad regardless of operating system. &amp;mdash; &lt;a href="https://unixdigest.com/articles/only-one-reason-why-windows-is-the-dominating-os-on-the-pc-desktop.html"&gt;There is only one reason why Microsoft Windows is the dominating operating system on the PC desktop&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2024-10-03&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The nice thing about boringness (so constrained) is that the capabilities of these things are well understood. But more importantly, their failure modes are well understood. &amp;mdash; &lt;a href="https://mcfunley.com/choose-boring-technology"&gt;Choose Boring Technology&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2024-10-03&lt;/a&gt;: I believe the Haskell LSP already provides that, but in case you don&amp;rsquo;t use it here are two blog posts that explain how to integrate ghcid into your (Neo)vim workflow: &lt;a href="https://ro-che.info/articles/2020-07-08-integrate-ghcid-vim"&gt;How I integrate ghcid with vim/neovim&lt;/a&gt;, &lt;a href="https://jeancharles.quillet.org/posts/2024-09-04-Haskell-dev-workflow-with-ghcid-and-neovim.html"&gt;Haskell dev workflow with ghcid and neovim&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-10-03&lt;/a&gt;: &lt;a href="https://rust-exercises.com/100-exercises/"&gt;100 Exercises To Learn Rust&lt;/a&gt;. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-10-03&lt;/a&gt;: &lt;a href="https://www.janert.me/blog/2024/computing-the-normal-distribution-function/"&gt;Computing the Normal Distribution Function&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-10-03&lt;/a&gt;: &lt;a href="https://github.com/francisrstokes/githublog/blob/main/2024/5/29/fast-inverse-sqrt.md"&gt;Everything I Know About The Fast Inverse Square Root Algorithm&lt;/a&gt;. Dealing with floating point math from Quake 3 to the present day.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-10-03&lt;/a&gt;: &lt;a href="https://entropicthoughts.com/failing-at-combinatorics-with-haskell"&gt;Failing at Combinatorics with Haskell&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-10-03&lt;/a&gt;: ♪ Mini Trees · Carrying On&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-10-21&lt;/a&gt;: /me is listening to &amp;ldquo;Back In Black&amp;rdquo; by AC/DC&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-10-21&lt;/a&gt;: I guess all is working now ;-) I&amp;rsquo;ve converted my automated script that shows current track on the micro-blog (for casual IRC users), I&amp;rsquo;ll just need to figure out how to manage tagging and playlist management under ncmpcpp.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-10-21&lt;/a&gt;: Trying out mpd in combination with &lt;a href="https://github.com/ncmpcpp/ncmpcpp"&gt;ncmpcpp&lt;/a&gt; as a replacement for my long-time friendly TUI Cmus. I&amp;quot;m still in the process of discovering the functionalities. Everything seems okay on the mpd side &amp;ndash; I even got MPRIS support after reading the &lt;a href="https://wiki.archlinux.org/title/Music_Player_Daemon/Tips_and_tricks"&gt;Arch wiki&lt;/a&gt; (&lt;a href="https://strugglers.net/posts/2023/ncmpcpp-a-modernish-text-based-music-setup-on-linux/"&gt;this&lt;/a&gt; Go solution didn&amp;rsquo;t work for me). I&amp;rsquo;m just looking for a direct way to listen to my music library without resorting on virtual playlist in ncmpcpp.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-10-22&lt;/a&gt;: /me is listening to &amp;ldquo;Amor Fati&amp;rdquo; by Washed Out&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-10-25&lt;/a&gt;: /me is listening to &amp;ldquo;Man of Anatomy&amp;rdquo; by Tom Hickox&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-10-27&lt;/a&gt;: I was going to spent some times trying to output the sound of my built-in speakers to my old Apple TV which is connected via a DAC to my wi-fi system, until I realized it is as simple as loading Pipewire RAOP module, &lt;code&gt;pactl load-module module-raop-discover&lt;/code&gt;. Then, launch pavucontrol and switch to your Airplay device.
&lt;br&gt;&lt;img src="https://aliquote.org/img/2024-10-27-10-43-45.png" alt="img"&gt;&lt;/p&gt;
&lt;p&gt;The Airplay system is now listed in the list of available devices.
We can even make it the default output audio channel:
&lt;br&gt;&lt;img src="https://aliquote.org/img/2024-10-27-11-14-57.png" alt="img"&gt;&lt;/p&gt;
&lt;p&gt;Now, since Pipewire supports multiple streaming output devices, much like mpd, I just need to configure the audio source in their config files to get everything right for the next time.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-10-29&lt;/a&gt;: Ncmpcpp with no color enabled. Much better for my eyes!&lt;br&gt;&lt;br&gt;&lt;img src="https://aliquote.org/img/2024-10-29-18-16-05.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-10-30&lt;/a&gt;: /me is listening to &amp;ldquo;Darkening of the Light&amp;rdquo; by Concrete Blonde&lt;br&gt;&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ XXX • &lt;em&gt;XXX&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>mpd and ncmpcpp</title><link>https://aliquote.org/post/mpd-and-ncmpcpp/</link><pubDate>Tue, 22 Oct 2024 10:55:14 +0200</pubDate><guid>https://aliquote.org/post/mpd-and-ncmpcpp/</guid><description>&lt;p&gt;I recently gave &lt;a href="https://mpd.readthedocs.io/en/stable"&gt;mpd&lt;/a&gt; a try for my music setup. I&amp;rsquo;ve been a long time user of Cmus which served me well. Before upgrading to Ubuntu 24.04, I used to use a fork which allow to show cover art in the notification menu bar (via MPRIS and D-BUS).&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; I&amp;rsquo;ve tried several other alternative players, which all support displaying cover art by the way. Audacious and Gapless (formerly, G4Music) are really great with their minimalistic yet efficient UIs, but I guess I just want to stick to TUIs for the moment. Enter &lt;a href="https://github.com/ncmpcpp/ncmpcpp"&gt;ncmpcpp&lt;/a&gt; which serves as a frontend to a running mpd server.&lt;/p&gt;
&lt;p&gt;Clearly, mpd is a different beast. While I always appreciated the simplicity and usability of Cmus, and its speed as well, I must say that using a daemon to interact with my music library is something new to me. For instance, when I reboot my machine this morning, I was surprised to hear the song I started listening yesterday evening before I shutdown the machine. There&amp;rsquo;s an option whihc I did not set properly, &lt;code&gt;restore_paused &amp;quot;yes&amp;quot;&lt;/code&gt;, meaning mpd started playing its queue as soon as it was up and running. The good thing is that it is easy to manage the mpd daemon using a user unit via &lt;code&gt;systemctl&lt;/code&gt;. MPd indexed my whole library (&amp;gt; 15k tracks) in a very decent amount of time. I tagged it using beats a long time ago, and I added proper tags manually since then, as well as many cover art, but I should definitively do this again, and clean up the duplicates thare spread across full album or disc sets and individual tracks in separate playlists.&lt;/p&gt;
&lt;p&gt;I use &lt;a href="https://musicpd.org/clients/mpc/"&gt;mpc&lt;/a&gt; to interact with mpd for low-level operations (toggle play/pause via system hotkey, display stats, etc.). It is a command-line application which It would be great if I could integrate the 3 years of listening data gathered through Cmus someday. For the moment, it&amp;rsquo;s just the beginning, and the stats are pretty dumb. And I still don&amp;rsquo;t know if I will keep the same library structure which consists basically in a bunch of folder with artist/album and another set of folders with separate playlists, which seems silly after all although it was quite handy with Cmus.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» mpc stats
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Artists: &lt;span class="m"&gt;3410&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Albums: &lt;span class="m"&gt;4513&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Songs: &lt;span class="m"&gt;18532&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Play Time: &lt;span class="m"&gt;0&lt;/span&gt; days, 1:38:32
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Uptime: &lt;span class="m"&gt;0&lt;/span&gt; days, 6:50:44
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;DB Updated: Mon Oct &lt;span class="m"&gt;21&lt;/span&gt; 18:02:28 &lt;span class="m"&gt;2024&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;DB Play Time: &lt;span class="m"&gt;55&lt;/span&gt; days, 15:51:08
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It is also possible to manage a &amp;ldquo;sticker&amp;rdquo; database, which is composed of added features specific to songs, albums or playlists, like play counts, ratings, comments and the like. This is specific to mpd and not all clients support it. However, I can imagine that populating a &lt;code&gt;playCount&lt;/code&gt; field with data from Cmus could be interesting, in addition to an hourly shell script gathering information from mpg log files for current events.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;p&gt;&lt;small&gt;[2024-10-24]&lt;/small&gt;&lt;br&gt;
I successfully imported all my play counts from Cmus in the mpd sticker database. First, I started recording new listening statistics with &lt;a href="https://github.com/hardfau1t/mscout"&gt;mscout&lt;/a&gt;. It works great, and it is simple to setup as a user unit to be managed by systemd. This program has options to get statistics from individual songs as well as playlists. One minor annoyance was that it fired up a new notification for every song, but this can easily be disabled in the source code by commenting out the relevant section of code. It can also export or import statistics from or to the sticker database. Therefore I hacked one of psyomn&amp;rsquo;s &lt;a href="https://gist.github.com/psyomn/55b5711d14ac763259cacfbbf7ce9c81"&gt;gists&lt;/a&gt; to extract relevant information from Cmus cache (full pathname and play counts for all the songs in my library) and reformat them according to the format expected by mscout. It worked perfectly fine!&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2024-10-24-19-02-54.png"&gt;
&lt;/figure&gt;
&lt;/div&gt;
&lt;p&gt;The first time I launched ncmpcpp, I was a bit lost. With the default config, you end up on an empty window, which stands for the current playlist. Here, a playlist is just a set of tracks you selected to play in a row, and not a pre-recorded list of tracks in an m3u file. Like in Cmus, there are different windows or views that you can navigate using the {1-8,=} keys (if you compiled ncmpcpp with all available options). The browser (2) and media library (4) are the ones you want to explore first: the browser summarize your media library as seen on you hard drive, while the media library is much like the first view in Cmus, a tree view of your artist/album collection. At first, I used the 4th view to select albums to play. Once you click Enter, the whole album is added to the current playlist (1) and the first track starts playing. It was cumbersome as I keep adding different albums along the way, and the playlist kept growing. Fortunately, there&amp;rsquo;s the C shortcut which allows to clean the current playlist. Then I learned that we can add tracks directly from the browser view (2) by pressing Space (instead of Enter). Finally, I learned that we can just populate &lt;code&gt;$HOME/.config/mpd/playlists&lt;/code&gt; with m3u files, and I was good to go. I now feel at home since I got the same experience as in Cmus. Easy peasy.&lt;/p&gt;
&lt;p&gt;In addition, things you get for free (no plugin, no additional configuration) with ncmpcpp: a playlist and tag editor, an FFT-based spectrum visualizer among other displays), the ability to stream live music from radio stations, information fetched from last.fm for artists or albums, cover art and lyrics support, dozens of keybindings to toggle cross-fading, replay gain, forward or backward seek, etc. Additionally, mpd provides logging facilities which allow to track your listening experience along the day &amp;ndash; nothing hardcoded in a binary database like is the case for Cmus and its track counts.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Class Actress • &lt;em&gt;Weekend&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;You can use &lt;a href="https://github.com/eonpatapon/mpDris2"&gt;mpDris2&lt;/a&gt; which provides similar facilities for mpd. It also comes with a user unit for systemd.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;Indeed, you just need to add a whole folder as a playlist (instead of manually adding track one after the other) and you&amp;rsquo;re done.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in September</title><link>https://aliquote.org/post/micro-09-2024/</link><pubDate>Mon, 30 Sep 2024 20:39:33 +0200</pubDate><guid>https://aliquote.org/post/micro-09-2024/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2024-09-01&lt;/a&gt;: It looks like &lt;a href="https://0x0.st/"&gt;0x0.st&lt;/a&gt; is up and running again. I believe it was down for a few months and I had to resort to &lt;a href="https://transfer.sh/"&gt;https://transfer.sh/&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-09-02&lt;/a&gt;: TIL about a nice replacement for tldr: &lt;a href="https://github.com/dbrgn/tealdeer/"&gt;tealdeer&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-09-04&lt;/a&gt;: ♪ Antony &amp;amp; The Johnsons · You Are My Sister&lt;small&gt;(Special dedicace to K.)&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-09-06&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_4307.JPEG" alt="img"&gt;&lt;small&gt;Pesto tart with goat cheese and pine nuts. It wasn&amp;rsquo;t too bad a job after all.&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-09-06&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;It’s both delightful and surreal to see that Valgrind is still in wide use today. &amp;mdash; &lt;a href="https://nnethercote.github.io/2022/07/27/twenty-years-of-valgrind.html"&gt;Twenty years of Valgrind&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2024-09-06&lt;/a&gt;: A small table of &lt;a href="https://funloop.org/post/2017-11-11-useful-manpages.html"&gt;interesting manpages&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-09-06&lt;/a&gt;: Old post but still an interesting &lt;a href="https://blog.trk.in.rs/2015/12/01/vim-tips/"&gt;personal roadmap with Vim&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-09-06&lt;/a&gt;: &lt;a href="https://leejo.github.io/2021/12/08/curiosities-in-vinyl/"&gt;Curiosities in Vinyl&lt;/a&gt;: Nice read. Looks like the author has a really comfy setup. I&amp;rsquo;ll keep the references handy.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-09-06&lt;/a&gt;: &lt;a href="https://miguelraz.github.io/blog/juliatorust/"&gt;From Julia to Rust&lt;/a&gt;. See also &lt;a href="https://qsantos.fr/2023/09/03/where-to-start-with-rust/"&gt;Where to Start with Rust&lt;/a&gt;. I&amp;rsquo;ve been wanting to learn both of those languages but I&amp;rsquo;ve never really found the time for it, or perhaps the motivation to embark on new adventures. One day, maybe one day.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-09-11&lt;/a&gt;: &lt;a href="https://www.michaelpj.com/blog/2024/09/03/lsp-good-bad-ugly.html"&gt;LSP: the good, the bad, and the ugly&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-09-11&lt;/a&gt;: &lt;a href="https://www.datafix.com.au/BASHing/2019-06-21.html"&gt;Plotting data in the terminal with gnuplot&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-09-11&lt;/a&gt;: &lt;a href="https://dev.to/twilio/zsh-tricks-to-blow-your-mind-291f"&gt;Zsh Tricks to Blow your Mind&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-09-11&lt;/a&gt;: ♪ The Cure · A Night Like ThisRecorded live at the &lt;a href="https://en.wikipedia.org/wiki/Roskilde_Festival_2019"&gt;Roskilde Festival 2019&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-09-16&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;All mainstream, general purpose programming languages are (basically) Turing-complete, and therefore any programme you can write in one you can, in fact, write in another. There is a computational equivalence between them. The main differences are instead in the expressiveness of the languages, the guardrails they give you, and their performance characteristics (although this is possibly more of a runtime/compiler implementation question). &amp;mdash; &lt;a href="https://www.gtf.io/musings/why-haskell"&gt;Why Haskell?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2024-09-16&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Stick with the mainstream &amp;amp; boring unless a competing alternative that is so much simpler and/or more powerful, and that has an acceptable learning curve, so that it will justify leaving the flock, exists. Best &lt;a href="https://gwn.wtf/resume.html"&gt;resume&lt;/a&gt; I read in a while.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2024-09-16&lt;/a&gt;: If you need an easy way to convert MS docx to a PDF from the command line, don&amp;rsquo;t forget that &lt;code&gt;lowriter&lt;/code&gt; (from Libre Office) has option to convert any document on the fly.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-09-17&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Accept multiple ways that users can ask for help and respond in kind. &amp;mdash; &lt;a href="https://sharats.me/posts/shell-script-best-practices/"&gt;Shell Script Best Practices&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2024-09-17&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If we do not understand both the data and the models completely, it becomes very difficult to spot problems in the software we use to work on them: unexpected behaviour arising from software bugs may be mistaken for a peculiarity in either of them. It is then crucial that we minimise the chances of this happening by applying all the best engineering practices we have at our disposal. &amp;mdash; &lt;a href="https://ppml.dev/"&gt;The Pragmatic Programmer for Machine Learning&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2024-09-17&lt;/a&gt;: One of my favorite post-punk band from the 80&amp;rsquo;s. &lt;a href="https://daily.bandcamp.com/big-ups/big-ups-bauhaus"&gt;Big Ups: Bauhaus’ Kevin Haskins Dompe and David J Haskins Pick Their Bandcamp Favorites&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-09-17&lt;/a&gt;: Some &lt;a href="https://www.pauldickman.com/software/stata/"&gt;Stata tutorials&lt;/a&gt; on survival analysis that are worth a read. &lt;code&gt;#stata&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-09-17&lt;/a&gt;: &lt;a href="https://www.infinitepartitions.com/art001.html"&gt;Dissecting the GZIP format&lt;/a&gt;. Very interesting read for those interested in compressing techniques. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-09-17&lt;/a&gt;: &lt;a href="https://www.datafix.com.au/BASHing/2019-06-21.html"&gt;Plotting data in the terminal with gnuplot&lt;/a&gt;. Still one of the most underated plotting tool for quick one-liner.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-09-17&lt;/a&gt;: &lt;a href="https://pythonspeed.com/articles/faster-multiprocessing-pickle/"&gt;Python’s multiprocessing performance problem&lt;/a&gt;. Lot of interesting tips and tricks for those using the multiprocessing module. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-09-24&lt;/a&gt;: ♪ Romain Dubois · Ardoise&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-09-25&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If there is ONE THING the Unix world needs, it is for bash/ksh/sh to stop diverging further by permitting STUPID INPUT that cannot plausibly work in all other shells. We are in a post-Postel world. &amp;mdash; &lt;a href="https://www.undeadly.org/cgi?action=article;sid=20240924105732"&gt;OpenBSD now enforcing no invalid NUL characters in shell scripts&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2024-09-26&lt;/a&gt;: ♪ Siouxsie And The Banshees · Arabian Knights&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-09-27&lt;/a&gt;: Hot off the kitchen!&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_4326.JPEG" alt="img"&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>TUIs best of</title><link>https://aliquote.org/post/tui-best-of/</link><pubDate>Sun, 01 Sep 2024 21:08:19 +0200</pubDate><guid>https://aliquote.org/post/tui-best-of/</guid><description>&lt;p&gt;Here&amp;rsquo;s a list of TUIs I use on my OS. They are ranked according to daily usage, from top to bottom. Since I spent my time in a Terminal managed by Tmux, with almost inevitably cmus and neomutt running in separate windows,&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; they are ranked first. I do not mention sed, awk, fzf, rg, and all the good stuff from GNU coreutils, nor zsh itself.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/tmux/tmux"&gt;tmux&lt;/a&gt; for it is the best multiplexer available and it is highly customizable.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://neovim.io/"&gt;neovim&lt;/a&gt; because it has a decent terminal and good defaults.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://neovim.io/https://cmus.github.io/"&gt;cmus&lt;/a&gt; for everything that&amp;rsquo;s related to music stored on my HD.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://mpv.io/"&gt;mpv&lt;/a&gt; for all things related to video and music (when I&amp;rsquo;m not using cmus).&lt;/li&gt;
&lt;li&gt;&lt;a href="https://neomutt.org/"&gt;neomutt&lt;/a&gt; because, well, there&amp;rsquo;s a lot of emails going on when you&amp;rsquo;re employed and I also like answering questions about statistics or this site in general.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://newsboat.org/"&gt;newsboat&lt;/a&gt; to read everything I like from the internet, i.e. people who love to share good stuff.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://irssi.org/"&gt;irssi&lt;/a&gt; to read and occasionally chat with others (channels: #lisp, #commonlisp, #scheme, #clojure, #chicken).&lt;/li&gt;
&lt;li&gt;&lt;a href="https://jonas.github.io/tig/"&gt;tig&lt;/a&gt; to browser the history of my Git repos.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/phiresky/ripgrep-all"&gt;rga&lt;/a&gt; to augment ripgrep with PDF support.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://bioinf.shenwei.me/csvtk/"&gt;csvtk&lt;/a&gt; and &lt;a href="https://github.com/YS-L/csvlens"&gt;csvlens&lt;/a&gt; when working with Excel or CSV files.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/dylanaraps/neofetch"&gt;neofetch&lt;/a&gt; to quickly share my config.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/o2sh/onefetch"&gt;onefetch&lt;/a&gt; when I want to get a basic summary of a Git repository.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/krathalan/wtwitch"&gt;wtwitch&lt;/a&gt; to check streamers and their VODs; also &lt;a href="https://github.com/pystardust/ytfzf"&gt;ytfzf&lt;/a&gt; to check video or music available on YT without all the fuzz of the YT web API &amp;ndash; these tools rely on mpv of course.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://asciinema.org/"&gt;asciinema&lt;/a&gt; to share terminal input/output when I do not want to perform live recording.&lt;/li&gt;
&lt;li&gt;a bunch of Git addons saved in &lt;code&gt;$HOME/bin&lt;/code&gt; folder that allow me, e.g., to update all remote repos, get various stats, rewrite author and/or history and so on.&lt;/li&gt;
&lt;li&gt;various shell scripts to convert movie to jpeg or gif, and pdf to png or tikz to pdf, interact with tarball, etc.&lt;/li&gt;
&lt;li&gt;some utilities for interacting with tmux or cmus, as well as neomutt, and a script named &lt;code&gt;radio&lt;/code&gt; that triggers mpv with online radios.&lt;/li&gt;
&lt;li&gt;I also have several handy alias in my zsh config.&lt;/li&gt;
&lt;/ul&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2024-09-07-10-12-10.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Here&amp;rsquo;s a raw list of binaries I installed over the time. I won&amp;rsquo;t show my &lt;code&gt;$HOME/bin&lt;/code&gt; folder, whcih I purged recently from old X11-only or defunct shell scripts. I still have a dozens of those lying around.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» ls .local/bin
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;akku@ csvtk* gen-hie* marksman* pylyzer* ruff* streamlink@ viu*
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;alen* deno* haskell-debug-adapter* matterbridge* py-spy* rust-analyzer* stylish-haskell* wtwitch*
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ark* difft* hdc* mdbook* qlot@ scc* stylua* xlispstat*
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bandcamp-dl@ duckdb* hoogle* mdcat* qr* seqkit* swish-lint@ xstata@
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bb* dut* ihaskell* nvimpager* qsv* seqtk* tdf* xstata-mp@
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bibclean* elm* joker* onefetch* reader* shellharden* texlab* ya@
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cabal-fmt* fast-tags* lein* ormolu* rfc* sixcat* theme.sh* yazi@
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;clojure-lsp* floskell* lsix* pandoc-crossref* rga* stack-clean-old* ueberzug* ytfzf*
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;csslint* fourmolu* ltex-ls@ pdfcpu* rga-fzf* stan* ueberzugpp* zaread*
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;csvlens* fzf* lua-language-server* poetry@ rga-preproc* statweave.jar vale*
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Apart from LSPs, I like to keep in this XDG folder stuff installed from GitHub and alike, or binaries that are too old in Ubuntu official repositories (e.g., fzf). I still need to write an &lt;code&gt;install.sh&lt;/code&gt; shell script to download and/or update binaries from latest GitHub release. I removed everything installed with pip after I upgraded to &lt;a href="post/ubuntu-24.04/"&gt;Ubuntu 24.04 LTS&lt;/a&gt; and I&amp;rsquo;m now symlinking binaries from package installed in separate virtual environments in my &lt;code&gt;$HOME/.Local/lib&lt;/code&gt; folder. I also keep binaries like &lt;a href="https://aliquote.org/micro/2021-06-18-13-05-36/"&gt;matterbridge&lt;/a&gt; for memories. Many are still installed for testing purpose, e.g. marksman.
I know this is a lot and for many of those binaries, I must admit I don&amp;rsquo;t use them often. Some binaries are also simple shell scripts for old X sessions (i3 or Regolith) and are not relevant anymore since I&amp;rsquo;m on Wayland.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ A Certain Ratio • &lt;em&gt;The Fox&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;I used to launch each one in separate sessions, but I now use mostly the same session for media and news consumption, along regular off-hand tasks, and I create dedicated session for projects I&amp;rsquo;m working on.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in August</title><link>https://aliquote.org/post/micro-08-2024/</link><pubDate>Sat, 31 Aug 2024 21:02:31 +0200</pubDate><guid>https://aliquote.org/post/micro-08-2024/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2024-08-01&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Creating and managing a package seemed much harder than I expected. &amp;mdash; &lt;a href="https://alpopkes.com/posts/python/packaging_tools/"&gt;An unbiased evaluation of environment management and packaging tools&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&amp;hellip; to put it very mildly&amp;hellip; This, however, does constitue a very good overview of what&amp;rsquo;s available in the Python ecocystem as of this writing. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-08-01&lt;/a&gt;: ♪ The Doors · The Crystal Ship&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-08-02&lt;/a&gt;: And so, &lt;a href="https://writings.stephenwolfram.com/2024/01/the-story-continues-announcing-version-14-of-wolfram-language-and-mathematica/"&gt;one year later&lt;/a&gt;, we got a few dozens of additional functions and a &lt;a href="https://writings.stephenwolfram.com/2024/07/yet-more-new-ideas-and-new-functions-launching-version-14-1-of-wolfram-language-mathematica/"&gt;brand new name&lt;/a&gt;.&lt;br&gt;&lt;img src="https://aliquote.org/img/2024-08-02-16-15-50.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-08-06&lt;/a&gt;: I wanted to get rid of raw &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt; tags and replace then with &lt;code&gt;&amp;lt;figure&amp;gt;&lt;/code&gt;, available as a &lt;a href="https://gohugo.io/content-management/shortcodes/#figure"&gt;shortcode&lt;/a&gt; in Hugo. It turned out I had a lot of replacements to perform:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» rg -nc &lt;span class="s2"&gt;&amp;#34;\!\[.*\]\(&amp;#34;&lt;/span&gt; content/post &lt;span class="p"&gt;|&lt;/span&gt; cut -d: -f2 &lt;span class="p"&gt;|&lt;/span&gt; paste -sd+ &lt;span class="p"&gt;|&lt;/span&gt; bc
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="m"&gt;688&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here&amp;rsquo;s a classical one-liner using Sed:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sed &lt;span class="s2"&gt;&amp;#34;s/^\!\[.*\](\(.*\))/{{&amp;lt; figure src=\&amp;#34;\1\&amp;#34; &amp;gt;}}/ content/post/*.md
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I took the opportunity to add a small colored insert to each figure using the following CSS code:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-css" data-lang="css"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;figure&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="k"&gt;box-shadow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mf"&gt;.5&lt;/span&gt;&lt;span class="kt"&gt;em&lt;/span&gt; &lt;span class="mh"&gt;#f3f3ed&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="k"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="kt"&gt;em&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="kt"&gt;em&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-08-06&lt;/a&gt;: TIL that `\%V` can be used to replace only in a visual selection (very handy for rectangular selection with `&lt;C-V&gt;`). `#vim`&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-08-13&lt;/a&gt;: Flat is a good thing but at some point I wish there could be a way to avoid unecessary duplication of core frameworks. I mean, below you'll find that I need 4 versions of the Qt goodies that I don't even use on my system.&lt;br&gt;![img](/img/2024-08-13-21-39-01.png)This all results in several Gig of wasted space, IMO. But this probaby is the way to go, as far as containerization is concerned.
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» du -sh /var/lib/flatpak
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;11G /var/lib/flatpak
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-08-13&lt;/a&gt;: [Someone’s Been Messing With My Subnormals!](https://moyix.blogspot.com/2022/09/someones-been-messing-with-my-subnormals.html): one can only appreciate the obstinacy and quality of the data munging using Python and shell scripting!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-08-14&lt;/a&gt;: Yet another round of computer cleansing today. I also removed VirtualBox since I can certainly manage everything with qemu, and lot of unused Gnome garbage that I installed for testing purpose. Ironically, I also uninstalled [Gapless](micro/2024-07-25-09-44-52/) since I always returned to Cmus with which I am so comfortable and which fits my TUI workflow so perfectly. `#unix`&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-08-14&lt;/a&gt;: ♪ Tindersticks · Raindrops (John Peel 1993)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-08-15&lt;/a&gt;: Just when I spent about half an hour compiling swayimg with all its dependencies, wondering how long it would take to compile the latest version of zathura and zathura-mupdf, it just came up to my mind that Ubuntu 24.04 LTS was released a few months ago. Time to upgrade the whole system I guess. `#vim`&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-08-16&lt;/a&gt;:
&lt;blockquote&gt;
&lt;p&gt;Hopefully other email clients can get to state where they too can do all of this. &amp;mdash; &lt;a href="http://www.kroah.com/log/blog/2019/08/14/patch-workflow-with-mutt-2019/"&gt;Patch Workflow With Mutt 2019&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2024-08-16&lt;/a&gt;: Configuration, scripts and tips for using &lt;a href="https://github.com/occivink/mpv-image-viewer"&gt;mpv as an image viewer&lt;/a&gt;. See also this &lt;a href="https://github.com/mpv-player/mpv/issues/7983"&gt;GH issue&lt;/a&gt; for extended discussion.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-08-16&lt;/a&gt;: ♪ Tindersticks · Factory Girls&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-08-16&lt;/a&gt;: ♪ Tindersticks · Raindrops (John Peel 1993)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-08-19&lt;/a&gt;: Looks interesting: Render and include &lt;a href="https://github.com/LaurentRDC/pandoc-plot"&gt;figures in Pandoc&lt;/a&gt; documents using your plotting toolkit of choice .&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-08-19&lt;/a&gt;: &lt;a href="https://laurentrdc.xyz/posts/rolling-stats.html"&gt;Efficient rolling statistics&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-08-19&lt;/a&gt;: ♪ Timber Timbre · Moment&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-08-20&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;kitty has to run on what I’m remoting from. tmux can work on what I’m remoting into. And that makes all the difference. &amp;mdash; &lt;a href="https://hiandrewquinn.github.io/til-site/posts/tmux-is-worse-is-better/"&gt;tmux is worse is better&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2024-08-21&lt;/a&gt;: &lt;img src="https://aliquote.org/img/IMG_4289.JPEG" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-08-21&lt;/a&gt;: &lt;a href="https://benknoble.github.io/blog/2024/08/07/churn-and-weight/"&gt;Churn and Weight&lt;/a&gt;: Or how to get interesting statistics for your Git projects.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-08-22&lt;/a&gt;: Racket parallel build in action.&lt;br&gt;&lt;img src="https://aliquote.org/img/2024-08-22-17-08-21.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-08-22&lt;/a&gt;: ♪ Wire · The Boiling Boy&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-08-24&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;IRC has historically been one of the most important chat programs in my life. &amp;mdash; &lt;a href="https://xeiaso.net/blog/2024/k8s-irc-client/"&gt;My IRC client runs on Kubernetes&lt;/a&gt;Poor or lazy solution on my side: irrsi runs on a uni server, and I rsync the logs on my laptop when I&amp;rsquo;m in. I also concatenate all channel logs into monthly logs so that it&amp;rsquo;s easier to read what&amp;rsquo;s going on. This is why I may be slow to respond to /msg sometimes.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2024-08-24&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Putting Xs into squares is all the rage with statisticians. We should test that they can use bitstring macros for that. &amp;mdash; &lt;a href="https://marc.info/?l=openbsd-cvs&amp;amp;m=172443349326851&amp;amp;w=2"&gt;CVS: cvs.openbsd.org: src&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2024-08-24&lt;/a&gt;: Cleaning up the mess accumulated in my &lt;code&gt;~/.local/bin&lt;/code&gt; and updating binary releases here and there. I wish I was not so lazy and wrote a quick &lt;code&gt;install.sh&lt;/code&gt; script once for all.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-08-24&lt;/a&gt;: Some really nice Gnome extensions are landing on GitHub, see &lt;a href="https://github.com/neuromorph/openbar?tab=readme-ov-file"&gt;openbar&lt;/a&gt; and &lt;a href="https://github.com/forge-ext/forge"&gt;forge&lt;/a&gt;. See also &lt;a href="https://itsfoss.com/ubuntu-tiling-windows/"&gt;Exploring the Default Tiling Windows Feature in Ubuntu 24.04 (and Enhancing it)&lt;/a&gt;. I still have &lt;a href="https://extensions.gnome.org/extension/4548/tactile/"&gt;Tactile&lt;/a&gt; around, but I rarely used it these days, unless I&amp;rsquo;m mirroring my desktop on a larger screen. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-08-24&lt;/a&gt;: Sometimes I miss my time with macOS Mojave.&lt;br&gt;&lt;img src="https://aliquote.org/img/2024-08-24-22-00-24.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-08-24&lt;/a&gt;: TIL about &lt;a href="https://github.com/lemnos/theme.sh"&gt;theme.sh&lt;/a&gt; which is amazing: no dependency, self-contained, and it can be used online without setting up anything in your bashrc or zshrc config. You can not only preview colorscheme using Fzf, but you can also import your own colorscheme (it will be added in &lt;code&gt;theme.sh&lt;/code&gt; itself. See also Foot FAQ to implement &lt;a href="https://codeberg.org/dnkl/foot/wiki#dynamic-color-changes"&gt;dynamic color changes&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-08-24&lt;/a&gt;: Yet another TUI app that I recently added to my toolbet, with the hope that it will improve over time: &lt;a href="https://github.com/itsjunetime/tdf"&gt;tdf&lt;/a&gt;. I heavily rely on Zathura for things related to PDF (espacially for bidirectional sync when using Texlab), altough I came to appreciate Evince with time (it can open DVI and PS file, by the way). With async rendering and hot reloading, I can imagine that tdf could be a great add-on for previewing $\TeX$ compilation results.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-08-24&lt;/a&gt;: &lt;a href="https://viralinstruction.com/posts/hardware/"&gt;What scientists must know about hardware to write fast code&lt;/a&gt;: Great read, even for those not familiar with Julia.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-08-24&lt;/a&gt;: ♪ Wire · Outdoor Miner&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-08-26&lt;/a&gt;: Installing wxpython on Ubuntu just takes 25 min. on an Intel i7-10610U (8 cores) @ 4.900GHz (389 Mo, virtual environment included). BTW, there&amp;rsquo;s no wheel for GTK4. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-08-31&lt;/a&gt;: This &lt;a href="http://lenna.org/"&gt;photo&lt;/a&gt; reminds me of the time when I was studying computer vision. Back in the time, we were happy with newly released LCD displays, although we got some CRTs lurking around. Now I can display images in my terminal (foot + sixel).&lt;br&gt;&lt;img src="https://aliquote.org/img/2024-08-31-15-46-00.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-08-31&lt;/a&gt;: &lt;a href="https://github.com/eigilnikolajsen/commit-mono"&gt;Commit Mono&lt;/a&gt; is an anonymous and neutral programming typeface focused on creating a better reading experience.&lt;br&gt;&lt;/p&gt;</description></item><item><title>August in review</title><link>https://aliquote.org/post/micro-review-027/</link><pubDate>Wed, 21 Aug 2024 14:47:12 +0200</pubDate><guid>https://aliquote.org/post/micro-review-027/</guid><description>&lt;p&gt;Here are some recent bookmarks that are worth a mention somehow.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://amontalenti.com/2024/05/28/good-python-software"&gt;Good Python Software&lt;/a&gt;: This post rang a bell as I was also in the middle of transitioning all my previous Python workflows to Poetry or rye. See also &lt;a href="https://lucumr.pocoo.org/2024/8/21/harvest-season/"&gt;Rye and uv: August is Harvest Season for Python Packaging&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;I recently learned that there&amp;rsquo;s still a place for Javascript-free utilities in the world of YT and Twitch, see &lt;a href="https://github.com/krathalan/wtwitch"&gt;wtwitch&lt;/a&gt; and &lt;a href="https://github.com/pystardust/ytfzf"&gt;ytfzf&lt;/a&gt;. Sadly, the latter will probably go in quiet mode. Everything works smoothly with mpv, no subscription or OAUTH token required.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; See also &lt;a href="https://blog.sergeantbiggs.net/posts/youtube-without-youtube-watching-videos-on-the-command-line/"&gt;Youtube Without Youtube; Watching Videos on the Command Line&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Francis Bach has made his draft book, &lt;a href="https://www.di.ens.fr/~fbach/ltfp_book.pdf"&gt;Learning Theory from First Principles&lt;/a&gt;, available for free on his website. I don&amp;rsquo;t have time to read it right now, but it now sits in my inbox.&lt;/li&gt;
&lt;li&gt;I&amp;rsquo;m still experimenting a bit with &lt;a href="https://jasp-stats.org/"&gt;Jasp&lt;/a&gt;. It&amp;rsquo;s pretty impressive whet they achieved with R as a backend. Here&amp;rsquo;s the &lt;a href="https://jasp-stats.org/r-package-list/"&gt;list of packages&lt;/a&gt; they incorporated into Jasp.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://metapost.gutenberg-asso.fr/?page=accueil"&gt;Examples logo MetaPost&lt;/a&gt;: I totally forgot about this site and it was funny to browse some of the samples. If you&amp;rsquo;re interested in $\LaTeX$ and MP, be sure to check &lt;a href="https://borgelt.net/"&gt;Christian Borgelt&lt;/a&gt; website where he hosts a bunch of nice looking slides and MP samples. And yes, he&amp;rsquo;s the author of the Apriori and Eclat algorithms (among others).&lt;/li&gt;
&lt;li&gt;I came across the &lt;a href="https://github.com/ronisbr/nano-theme.nvim"&gt;Neovim N Λ N O Theme&lt;/a&gt;, which is inpired by Nicolas Rougier&amp;rsquo;s Emacs theme. Originally, it was this &lt;a href="https://github.com/Bekaboo/nvim"&gt;GH repo&lt;/a&gt; which led me to search for a Nano theme.&lt;/li&gt;
&lt;li&gt;I&amp;rsquo;m trying out a few Gnome extensions for a few days, in particular &lt;a href="https://github.com/fflewddur/tophat"&gt;tophat&lt;/a&gt;. It looks good so far.&lt;/li&gt;
&lt;li&gt;I just noticed that &lt;a href="https://macwright.com/"&gt;Tom MacWright&lt;/a&gt; now uses a &lt;a href="https://macwright.com/micro/"&gt;micro&lt;/a&gt;-blogging system. Looks nice.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Wire • &lt;em&gt;I Am the Fly&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;You will need to install &lt;a href="https://streamlink.github.io/"&gt;streamlink&lt;/a&gt; &amp;ndash; even if mpv handles live streams perfectly well. The best option for Ubuntu so far is to create a virtual environment and &lt;code&gt;pip install streamlink&lt;/code&gt;. The binary will be available in the &lt;code&gt;bin&lt;/code&gt; directory and you can symlink to it from any directory in your &lt;code&gt;$PATH&lt;/code&gt;.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Plain tex'ing again</title><link>https://aliquote.org/post/plain-tex/</link><pubDate>Sun, 18 Aug 2024 21:38:06 +0200</pubDate><guid>https://aliquote.org/post/plain-tex/</guid><description>&lt;p&gt;Lately I&amp;rsquo;ve been interested in plain $\TeX$ again. I briefly talked about my own customization in Neovim with vimtex in a &lt;a href="https://aliquote.org/post/vimtex-plaintex/"&gt;preceding post&lt;/a&gt; but since then I stopped using &lt;a href="https://github.com/lervag/vimtex"&gt;vimtex&lt;/a&gt; because reasons.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;I want to be able to write in English, with all the typos and grammatical errors you know me capable of, and in French with easy input of accented characters. I started writing in $\TeX$ a long time ago and I remember the days where I had to type &lt;code&gt;\'e&lt;/code&gt; to get an accented &lt;em&gt;é&lt;/em&gt;. Then we had latin1, ucs, babel with french/francais, etc. Finally I switched to Context for several years, and came back to $\LaTeX$ because of Sweave and knitr. There used to be a Context filter to process inline code chunk but it was not on par with Sweave, Statweave or Pweave. Anyway, these were old days but plain $\TeX$ is still a thing, right?&lt;/p&gt;
&lt;p&gt;I offered a solution for accented letters via luatex last time. It&amp;rsquo;s okay, we just need to find an appropriate OTF font (there are plenty of them in &lt;code&gt;/usr/share/fonts/opentype&lt;/code&gt; and you can probably install more from your package manager), and run luatex. Of course, this won&amp;rsquo;t solve the problem of French spacing or hyphenation. You&amp;rsquo;ll get a nicely formatted PDF output, and above all it comes with synctex support which means you&amp;rsquo;ll get forward and reverse synchronization between your text editor and your PDF viewer. If you&amp;rsquo;re using Vim or Neovim, set your compiler as &lt;code&gt;luatex&lt;/code&gt;, as defined below, and you&amp;rsquo;re good to go.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-vim" data-lang="vim"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;--&lt;/span&gt; &lt;span class="nx"&gt;compiler&lt;/span&gt;/&lt;span class="nx"&gt;luatex&lt;/span&gt;.&lt;span class="nx"&gt;vim&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nx"&gt;exists&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;current_compiler&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="nx"&gt;finish&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="k"&gt;endif&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;current_compiler&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;luatex&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;:&lt;span class="nx"&gt;cpo_save&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &amp;amp;&lt;span class="nx"&gt;cpo&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;set&lt;/span&gt; &lt;span class="nx"&gt;cpo&lt;/span&gt;&amp;amp;&lt;span class="nx"&gt;vim&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;silent&lt;/span&gt; &lt;span class="nx"&gt;CompilerSet&lt;/span&gt; &lt;span class="nx"&gt;makeprg&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;luatex&lt;/span&gt;\ &lt;span class="p"&gt;--&lt;/span&gt;&lt;span class="nx"&gt;interaction&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;\&lt;span class="s2"&gt;&amp;#34;nonstopmode\&amp;#34;&lt;/span&gt;\ &lt;span class="p"&gt;--&lt;/span&gt;&lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;line&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;\ &lt;span class="p"&gt;--&lt;/span&gt;&lt;span class="nx"&gt;synctex&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="m"&gt;15&lt;/span&gt;\ %
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;CompilerSet&lt;/span&gt; &lt;span class="nx"&gt;errorformat&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;%&lt;span class="nx"&gt;f&lt;/span&gt;:%&lt;span class="nx"&gt;l&lt;/span&gt;:\ %&lt;span class="nx"&gt;m&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;let&lt;/span&gt; &amp;amp;&lt;span class="nx"&gt;cpo&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;:&lt;span class="nx"&gt;cpo_save&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;unlet&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;:&lt;span class="nx"&gt;cpo_save&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Yet there&amp;rsquo;s another option to alleviate the need for obscure typing of accented letters, namely xetex. As far as I know it cannot be called from latexmk (well, latexmk is for $\LaTeX$ backend after all), and it doesn&amp;rsquo;t support synctex. I used to use the $Xe\LaTeX$ backend a lot because after Context this was the easiest solution to get extra fonts incoporated in our PDFs. Using xetex as compiler also means that we need to handle bibtex (or makeindex) and the whole compilation toolchain. Usually, I would use texi2dvi for plain $\TeX$ (the texi2* suite is really handy and I relied on it a lot when I was using Sweave or knitr for my statistical reports) but it doesn&amp;rsquo;t support xetex either.&lt;/p&gt;
&lt;p&gt;A third option to use xetex is &lt;a href="https://islandoftex.gitlab.io/arara"&gt;arara&lt;/a&gt; and it works right out of the box. If you are curious about it all works, the rules that arara relies on are located under &lt;code&gt;/usr/share/texlive/texmf-dist/scripts/arara/rules&lt;/code&gt;. If we add the following directives at the top of our document, we&amp;rsquo;ll get xetex + bibtex and a nicely formatted PDF.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-tex" data-lang="tex"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;% arara: xetex: {synctex: yes}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;% arara: bibtex: { options: [ &amp;#39;-terse&amp;#39; ] }
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;% arara: xetex: {synctex: yes}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;% arara: xetex: {synctex: yes}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\ifx\eplain\undefined&lt;/span&gt; &lt;span class="k"&gt;\input&lt;/span&gt; eplain &lt;span class="k"&gt;\fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\font\bodyfont&lt;/span&gt;=&amp;#34;Fontin&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\bodyfont&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\parindent&lt;/span&gt; 0pt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Bienvenue aux caractères accentués français grâce à &lt;span class="s"&gt;$&lt;/span&gt;&lt;span class="nv"&gt;\TeX&lt;/span&gt;&lt;span class="s"&gt;$&lt;/span&gt;.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Here&amp;#39;s a test for eplain: &lt;span class="k"&gt;\cite&lt;/span&gt;&lt;span class="na"&gt;[note]&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;knuth-1984-texbook&lt;span class="nb"&gt;}&lt;/span&gt;.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\beginsection&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;References.&lt;span class="nb"&gt;}&lt;/span&gt;&lt;span class="k"&gt;\par&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\bibliography&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;references&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\bibliographystyle&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;plain&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;small&gt;You can use any font you like, e.g. &lt;code&gt;fc-list : family file | grep -i fontin&lt;/code&gt;.&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s the output on my machine:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;~/tmp 1m12s
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» arara plain.tex
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; __ _ _ __ __ _ _ __ __ _
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; / _&lt;span class="sb"&gt;`&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;__/ _` | &amp;#39;&lt;/span&gt;__/ _&lt;span class="sb"&gt;`&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;_&lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;_&lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;_&lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="se"&gt;\_&lt;/span&gt;_,_&lt;span class="p"&gt;|&lt;/span&gt;_&lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="se"&gt;\_&lt;/span&gt;_,_&lt;span class="p"&gt;|&lt;/span&gt;_&lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="se"&gt;\_&lt;/span&gt;_,_&lt;span class="p"&gt;|&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Processing &lt;span class="s2"&gt;&amp;#34;plain.tex&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;size: 3.3 kB, last modified: 2024-08-18
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;20:05:35&lt;span class="o"&gt;)&lt;/span&gt;, please wait.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;(&lt;/span&gt;XeTeX&lt;span class="o"&gt;)&lt;/span&gt; XeTeX engine .................................... SUCCESS
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;(&lt;/span&gt;BibTeX&lt;span class="o"&gt;)&lt;/span&gt; The BibTeX reference management software ....... SUCCESS
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;(&lt;/span&gt;XeTeX&lt;span class="o"&gt;)&lt;/span&gt; XeTeX engine .................................... SUCCESS
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;(&lt;/span&gt;XeTeX&lt;span class="o"&gt;)&lt;/span&gt; XeTeX engine .................................... SUCCESS
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Total: 1.744 seconds
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If it looks a bit tedious to add so many directives at the top of our document, we can rely on a global or local &lt;a href="https://islandoftex.gitlab.io/arara/manual/configuration/"&gt;configuration file&lt;/a&gt;. For instance, this allows to pass a default preamble when calling arara on a $\TeX$ document. The exact structure of the configuration file may not be obvious when reading the manual, but after some trials I got something working as expected. Put the following in a file named &lt;code&gt;$HOME/.araraconfig.yaml&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;!&lt;span class="l"&gt;config&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;defaultPreamble&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;xetex-mp&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;preambles&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;xetex-mp&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="sd"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="sd"&gt; % arara: xetex: {options: [&amp;#34;-synctex=15&amp;#34;]}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="sd"&gt; % arara: bibtex: {options: [&amp;#34;-terse&amp;#34;]}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="sd"&gt; % arara: xetex: {options: [&amp;#34;-synctex=15&amp;#34;]}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="sd"&gt; % arara: xetex: {options: [&amp;#34;-synctex=15&amp;#34;]}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You may notice that I expanded the synctex option to benefit from all optimizations, especially better compression support. You can add as many compilation directives as you want, and of course define other preambles which may then be called with the &lt;code&gt;--preamble&lt;/code&gt; option. In this case, setting a default one ensures that we can simply call &lt;code&gt;arara ourdoc.tex&lt;/code&gt; and that all the above directives will be proceeded.&lt;/p&gt;
&lt;p&gt;You can plug &lt;code&gt;arara&lt;/code&gt; as your makeprg in Vim or Neovim but if you want to get useful information in case something went wrng, you&amp;rsquo;re better off adding &lt;code&gt;--verbose&lt;/code&gt; to arara and maybe &lt;code&gt;-interaction=nonstopmode&lt;/code&gt; to the xetex processor. Finally, you can add many &lt;a href="https://www.overleaf.com/learn/latex/TeX_engine_command_line_options_for_pdfTeX%2C_XeTeX_and_LuaTeX"&gt;more options&lt;/a&gt; to &lt;code&gt;xetex&lt;/code&gt; itself, e.g. &lt;code&gt;-etex&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Bonus point: You can use whatever tool you like to cleanup the artifacts generated by arara, e.g. &lt;code&gt;latexmk -C&lt;/code&gt;, but there&amp;rsquo;s a specific rule for that in arara as well so it&amp;rsquo;s up to you:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-latex" data-lang="latex"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;% arara: latexmk: { clean: partial }
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;% arara: clean: { extensions: [ aux, log ] }
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I perfer keeping the log files around in case something went wrong during the compilation, but at least you know.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Warsaw • &lt;em&gt;As You Said&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;This really is a great plugin, and it&amp;rsquo;s probably better than Texlab or other competitors that I never tried. But to be honest I don&amp;rsquo;t really need all of these goodies. I have my own way of fetching bibliographic entries via fzf, latexmk takes care of cleaning up the mess after a PDF has been produced. I wrote a quite complete interface to Texlab in Lua (i.e., similar to what you&amp;rsquo;ll get from nvim-lspconfig), which provides me with omni-completion and goto definition/reference. That&amp;rsquo;s really all what I need.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Ubuntu 24.04: The sequel</title><link>https://aliquote.org/post/ubuntu-24.04-sequel/</link><pubDate>Fri, 16 Aug 2024 17:37:19 +0200</pubDate><guid>https://aliquote.org/post/ubuntu-24.04-sequel/</guid><description>&lt;p&gt;Quickly jotted post-install steps of my previous post. It was a joy, really.&lt;/p&gt;
&lt;h3 id="node"&gt;Node&lt;/h3&gt;
&lt;p&gt;I know there are various way to install the full-stack on Ubuntu, either via apt, dedicated PPAs, or &lt;a href="https://github.com/nvm-sh/nvm"&gt;nvm&lt;/a&gt;. Previously I was using an imported deb repository. Ubuntu is known to be somewhat lagging a little behind the latest versions, so this was the best chance to get a decent nodejs with the 22.04 LTS at some point. I&amp;rsquo;m not particularly interested in managing multiple versions of Node since I barely do any serious stuff in JS for web dev.&lt;/p&gt;
&lt;p&gt;Currently, the official Ubuntu repository offers nodejs/noble 18.19.1+. That&amp;rsquo;s okay, but if you try to install npm, unless you&amp;rsquo;ll end up with a giant list of packages! Installing the combo nodejs + npm, with nodejs-doc (because we like to read the doc, right?) results in a mess:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;0 mis à jour, 394 nouvellement installés, 0 à enlever et 2 non mis à jour.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Il est nécessaire de prendre 28,0 Mo dans les archives.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Après cette opération, 169 Mo d&amp;#39;espace disque supplémentaires seront utilisés.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note that you would get almost nothing by asking apt for &lt;code&gt;--no-install-recommends&lt;/code&gt; (about forty packages less at best).&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s try with the NodeSource repo instead, with the LTS release. Notice that several blog posts suggest &lt;a href="https://deb.nodesource.com"&gt;https://deb.nodesource.com&lt;/a&gt; as a primary repo, but this is not from the NodeJS organization, AFAICT. In retrospect, this is probably what I installed last time:&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nodejs/nodistro,now 20.12.2-1nodesource1 amd64 [installé]
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Anyway, there are prebuilt binaries available on &lt;a href="https://nodejs.org"&gt;https://nodejs.org&lt;/a&gt;, as well as a suggestion to use nvm. I finally choose the later. Everything went fine except that I lost my custom lib directory (so-called &amp;ldquo;prefix&amp;rdquo; in Node parlance). I&amp;rsquo;ll check back later!&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» nvm install &lt;span class="m"&gt;20&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Downloading and installing node v20.16.0...
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Downloading https://nodejs.org/dist/v20.16.0/node-v20.16.0-linux-x64.tar.xz...
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;################################################################################# 100.0%&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Computing checksum with sha256sum
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Checksums matched!
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Your user’s .npmrc file &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;HOME&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;/.npmrc&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;has a &lt;span class="sb"&gt;`&lt;/span&gt;globalconfig&lt;span class="sb"&gt;`&lt;/span&gt; and/or a &lt;span class="sb"&gt;`&lt;/span&gt;prefix&lt;span class="sb"&gt;`&lt;/span&gt; setting, which are incompatible with nvm.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Run &lt;span class="sb"&gt;`&lt;/span&gt;nvm use --delete-prefix v20.16.0&lt;span class="sb"&gt;`&lt;/span&gt; to &lt;span class="nb"&gt;unset&lt;/span&gt; it.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» nvm use --delete-prefix v20.16.0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Now using node v20.16.0 &lt;span class="o"&gt;(&lt;/span&gt;npm v10.8.1&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» node -v
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;v20.16.0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» npm -v
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;10.8.1
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="python"&gt;Python&lt;/h3&gt;
&lt;p&gt;Canonical apparently wants to use Python more and more for the back office. It is now harder to pip install a Python package. If you try to install Poetry using their online shell script, you will be redirected to an error message about installing packages outside a virtual environment. Same goes with pip in your &lt;code&gt;$HOME&lt;/code&gt; directory:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» pip install --user poetry
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;error: externally-managed-environment
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;× This environment is externally managed
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;╰─&amp;gt; To install Python packages system-wide, try apt install
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; python3-xyz, where xyz is the package you are trying to
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; install.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; If you wish to install a non-Debian-packaged Python package,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; create a virtual environment using python3 -m venv path/to/venv.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; sure you have python3-full installed.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; If you wish to install a non-Debian packaged Python application,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; it may be easiest to use pipx install xyz, which will manage a
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; virtual environment &lt;span class="k"&gt;for&lt;/span&gt; you. Make sure you have pipx installed.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; See /usr/share/doc/python3.12/README.venv &lt;span class="k"&gt;for&lt;/span&gt; more information.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;hint: See PEP &lt;span class="m"&gt;668&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; the detailed specification.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I&amp;rsquo;m not against banning system-wide installations, on the contrary. But it seems to me that user install don&amp;rsquo;t really harm. I personally use virtual environments for every projects, but keep installing in my $HOME directory packages that I use regularly when firing up an IPython shell, e.g. numpy, scipy, statsmodels, plotnine, biopython, networkx. I don&amp;rsquo;t want to override the official policy in this case, and I note that I could install most of those package from Ubuntu repos as well, meaning I may even benefit from Ubuntu package management itself, which reminds me of this:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I manage my Python packages in the only way which I think is sane: installing them from my Linux distribution’s package manager. I maintain a few dozen Python packages for Alpine Linux myself. It’s from this perspective that, throughout all of this turmoil in Python’s packaging world, I have found myself feeling especially put out. &amp;mdash; &lt;a href="https://drewdevault.com/2021/11/16/Python-stop-screwing-distros-over.html"&gt;Python: Please stop screwing over Linux distros&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Quick fact checking: There are a lot of R (thanks to &lt;a href="https://eddelbuettel.github.io/r2u/"&gt;r2u&lt;/a&gt;) and Python packages (this includes documentation packages) already available on Ubuntu 24.04!&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» apt search r-cran- &lt;span class="p"&gt;|&lt;/span&gt; wc -l
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="m"&gt;3428&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» apt search python3- &lt;span class="p"&gt;|&lt;/span&gt; wc -l
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="m"&gt;13580&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I&amp;rsquo;m waiting to see how I&amp;rsquo;ll proceed, but frankly I think I&amp;rsquo;ll just install the deb packages I use frequently and create a sandbox for the rest.&lt;/p&gt;
&lt;p&gt;In the meantime, I just deleted my Python 3.10 library and everything that was installed under &lt;code&gt;$HOME/.local/bin&lt;/code&gt; with pip (&lt;code&gt;rg -l &amp;quot;\#\!/usr/bin/python3&amp;quot; | xargs rm&lt;/code&gt;).&lt;/p&gt;
&lt;h3 id="r"&gt;R&lt;/h3&gt;
&lt;p&gt;After reinstalling R from the official Ubuntu source list, I got R 4.3. I was running v4.4.0 but it is not a big deal. I had a total of 498 packages (2.4 Go) in my personal library. Rather than keeping stuff compiled with another version, I took the opportunity to shorten the list of packages I will have installed by default, and use &lt;a href="https://rstudio.github.io/renv/"&gt;renv&lt;/a&gt; to manage additional packages on a per-project basis. This is in line with the approach usually taken in other PLs I use.&lt;/p&gt;
&lt;p&gt;I selected the following list of &amp;ldquo;essential&amp;rdquo; packages, meaning I will probably use two or three of them each time I fire up R for a quick statistical investigation, excluding LSP and editor stuff, i.e. languageserver, lintr and styler: car, coin, cowplot, data.table, directlabels, ggplot2, glmnet, haven, Hmisc, languageserver, lintr, lme4, mclust, multcomp, patchwork, plotly, remotes, reshape2, renv, readxl, rms, skimr, styler, tinytest, vegan. Skimr is surely the only exotic piece of a package in this list, and it adds little to the bill after all.&lt;/p&gt;
&lt;p&gt;This whole set of packages is going to install a bunch of additional software, but not that much compared to what testthat alone would require:&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;bit&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;rappdirs&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;Deriv&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;modelr&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;microbenchmark&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;bit64&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;cachem&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;memoise&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;sass&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;ps&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;pkgbuild&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;askpass&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;broom&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;numDeriv&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;doBy&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;MatrixModels&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;farver&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;labeling&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;munsell&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;fansi&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;pkgconfig&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;iterators&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;clipr&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;crayon&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;vroom&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;tzdb&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;checkmate&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;rstudioapi&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;fastmap&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;bslib&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;evaluate&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;fontawesome&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;jquerylib&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;tinytex&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;xfun&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;yaml&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;highr&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;processx&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;brew&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;commonmark&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;desc&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;pkgload&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;remotes&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;zoo&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;curl&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;mime&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;openssl&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;generics&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;later&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;rematch&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;prettyunits&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;utf8&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;methodsS3&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;oo&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;utils&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;carData&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;abind&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;pbkrtest&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;quantreg&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;scales&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;libcoin&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;matrixStats&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;modeltools&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;mvtnorm&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;gtable&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;rlang&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;quadprog&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;cli&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;glue&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;isoband&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;lifecycle&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;tibble&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;vctrs&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;withr&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;foreach&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;shape&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;Rcpp&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;RcppEigen&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;forcats&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;hms&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;readr&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;tidyselect&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;cpp11&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;gridExtra&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;htmlTable&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;viridis&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;htmltools&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;base64enc&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;colorspace&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;rmarkdown&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;knitr&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;Formula&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;callr&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;collections&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;fs&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;jsonlite&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;R6&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;roxygen2&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;stringi&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;xml2&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;xmlparsedata&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;backports&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;cyclocomp&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;digest&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;rex&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;minqa&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;nloptr&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;TH&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;sandwich&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;httr&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;magrittr&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;viridisLite&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;htmlwidgets&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;tidyr&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;RColorBrewer&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;dplyr&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;lazyeval&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;crosstalk&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;purrr&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;promises&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;plyr&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;stringr&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;cellranger&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;progress&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;SparseM&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;polspline&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;pillar&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;repr&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cache&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;rprojroot&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;permute&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Results: 157 packages, 408 Mo.&lt;/p&gt;
&lt;p&gt;In summary, I just installed and deleted a total of xxx packages (where xxx &amp;gt; 500) on various places on my laptop, from various sources on the internet, using various package manager (having almost zero reverse or orphaned dependencies management,&lt;sup id="fnref:4"&gt;&lt;a href="#fn:4" class="footnote-ref" role="doc-noteref"&gt;4&lt;/a&gt;&lt;/sup&gt; unless you use your distro own package manager). &lt;a href="https://tonsky.me/blog/disenchantment/"&gt;Everything is HUUUUGE&lt;/a&gt;.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Tindersticks • &lt;em&gt;My Sister&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;I&amp;rsquo;ve long been using a simple Makefile to keep track of my packages list:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;all:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; @echo &amp;#34;\033[0;32m[+] Staging local changes\033[0m&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; (apt list --installed &amp;gt; packages) &amp;gt;/dev/null 2&amp;gt;&amp;amp;1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; git add .
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; git diff-index --quiet HEAD || git commit -m &amp;#34;Update packages&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;Sadly, no &lt;a href="https://plotnine.org/"&gt;plotnine&lt;/a&gt;!&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:3"&gt;
&lt;p&gt;Installing testthat on a fresh and empty libPath means a mare addition of packages (35 Mo) already : ‘utf8’, ‘crayon’, ‘pillar’, ‘pkgconfig’, ‘vctrs’, ‘glue’, ‘fs’, ‘pkgbuild’, ‘rprojroot’, ‘diffobj’, ‘fansi’, ‘rematch2’, ‘tibble’, ‘brio’, ‘callr’, ‘cli’, ‘desc’, ‘digest’, ‘evaluate’, ‘jsonlite’, ‘lifecycle’, ‘magrittr’, ‘pkgload’, ‘praise’, ‘processx’, ‘ps’, ‘R6’, ‘rlang’, ‘waldo’, ‘withr’. Remember the &lt;a href="https://www.tinyverse.org/"&gt;tinyverse&lt;/a&gt;?&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:4"&gt;
&lt;p&gt;While r2u is a great initiative, I keep the habits of &lt;a href="https://gist.github.com/even4void/99e40b772ec84b82eaef9bd2e5de0ace"&gt;compiling everything from source&lt;/a&gt;, at least on my machine. And please note that using bspm to get native binary via the r2u apt repo doesn&amp;rsquo;t work with renv, rig (and probably pak).&amp;#160;&lt;a href="#fnref:4" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Ubuntu 24.04</title><link>https://aliquote.org/post/ubuntu-24.04/</link><pubDate>Thu, 15 Aug 2024 20:35:19 +0200</pubDate><guid>https://aliquote.org/post/ubuntu-24.04/</guid><description>&lt;p&gt;I just installed and configured Ubuntu 24.04 LTS. This is the second dist upgrade I apply on the &lt;a href="https://aliquote.org/post/welcome-ubuntu/"&gt;same laptop&lt;/a&gt;. Everything went well but this time I wanted to polish things a bit, especially remove old artifcats from multiple upgrade while keeping all my &lt;a href="https://aliquote.org/post/how-to-do-without-wm/"&gt;customizations&lt;/a&gt;. By the way, the extensions I were using (Tactile and Simply Workspaces are now useless with the new features introduced in Gnome desktop).&lt;/p&gt;
&lt;p&gt;I won&amp;rsquo;t comment about the new Desktop, WM or app UI, there&amp;rsquo;s already a good deal of information on the web. It&amp;rsquo;s pretty slick as far as I can tell (e.g., Nautilus or the desktop menu bar). However, I should note that Ubuntu mono font now looks quite crappy in a Terminal. Since I downloaded the Nerd font equivalent a while ago, I switched to that temporarily (I know nostalgics can get the &amp;ldquo;legacy&amp;rdquo; font from a package). What follows is is merely an installation log.&lt;/p&gt;
&lt;p&gt;After updating all packages installed on my laptop, I ran the classical &lt;code&gt;do-upgrade-release -d&lt;/code&gt; at the shell prompt. This didn&amp;rsquo;t work. First, there appeared to be some problem with custom PPAs. I started to remove them one by one then forgot a leading asterisk which removed them altogether. A good start to say the least&amp;hellip; Afterwards, there still was a pending issue with postgresql-12 (which may date from the 20.04 release?). Finally, the dist upgrade went fine, although some packages like texlive highlighted minor errors while some other packages were forcibly removed.&lt;/p&gt;
&lt;p&gt;Upon rebooting the system, my plan was to remove packages tagged jammy (obs-studio), remove packages installed from custom PPA, check orphaned packages if any and record packages with residual config files for further investigation. It took me a few more minutes.&lt;/p&gt;
&lt;p&gt;I deleted old Linux kernels (headers and images), totalling 640 Mo on my HD! I used a &lt;a href="https://askubuntu.com/a/1315976"&gt;shell script&lt;/a&gt; slighty adpated from SO.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» dpkg --list &lt;span class="p"&gt;|&lt;/span&gt; grep linux-headers
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ii linux-headers-5.15.0-118 5.15.0-118.128
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ii linux-headers-5.15.0-118-generic 5.15.0-118.128
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ii linux-headers-5.19.0-50-generic 5.19.0-50.50
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ii linux-headers-6.5.0-45-generic 6.5.0-45.45&lt;span class="se"&gt;\~&lt;/span&gt;22.04.1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ii linux-headers-6.8.0-40 6.8.0-40.40
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ii linux-headers-6.8.0-40-generic 6.8.0-40.40
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ii linux-headers-generic 6.8.0-40.40
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ii linux-headers-generic-hwe-22.04 6.8.0-40.40&lt;span class="se"&gt;\~&lt;/span&gt;22.04.3
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Next, I wanted to get ride of resiudal config files from uninstalled packages. For whatever reason (e.g., packages flagged as manually installed), even all packages were supposed to be &amp;ldquo;purged&amp;rdquo; and &amp;ldquo;autoremoved&amp;rdquo; from the system, there remained dozens of such files.&lt;/p&gt;
&lt;p&gt;I listed all relevant packages as follows:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dpkg --get-selections &lt;span class="p"&gt;|&lt;/span&gt; grep &lt;span class="s1"&gt;&amp;#39;deinstall$&amp;#39;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; cut -f1
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I then tried to pipe this list to &lt;code&gt;xargs sudo apt --yes purge&lt;/code&gt; but I got stuck in the middle of a dialog box asking whether I really wanted to delete everything from Postgresql 12. Shortly after C-c&amp;rsquo;ing and killing the whole process, dpkg was no longer working. I reconfigured dpkg and then all packages were flagged as purge and not deinstall this time. I finally was able to cleanup everythign and checked that I got the same number of installed packages as highlighted by neofetch:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo dpkg --configure -a
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dpkg --get-selections &lt;span class="p"&gt;|&lt;/span&gt; grep &lt;span class="s1"&gt;&amp;#39;purge$&amp;#39;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; cut -f1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo apt clean &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; sudo apt autoclean &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; sudo apt autoremove
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dpkg --get-selections &lt;span class="p"&gt;|&lt;/span&gt; wc -l
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I also cleaned up &lt;code&gt;/usr/share/applications&lt;/code&gt; and &lt;code&gt;$HOME/.local/share/applications&lt;/code&gt; for unused desktop entries, my &lt;code&gt;/opt&lt;/code&gt; directory full of application for testing purposes, and a bunch of unused software.&lt;/p&gt;
&lt;p&gt;I still need to filter out broken executables installed by Python in $HOME/.local/bin (e.g., streamlink), install nodejs, npm and yarn, and handle software that were installed via custom PPAs (e.g., Racket). Also, I would need to review log files in &lt;code&gt;/var/log/dist-upgrade&lt;/code&gt; to see if I missed something.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» neofetch
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;OS: Ubuntu 24.04 LTS x86_64
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Host: Latitude &lt;span class="m"&gt;7310&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Kernel: 6.8.0-40-generic
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Packages: &lt;span class="m"&gt;3623&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;dpkg&lt;span class="o"&gt;)&lt;/span&gt;, &lt;span class="m"&gt;17&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;flatpak&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Shell: zsh 5.9
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Terminal: alacritty
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;CPU: Intel i7-10610U &lt;span class="o"&gt;(&lt;/span&gt;8&lt;span class="o"&gt;)&lt;/span&gt; @ 4.900GHz
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="sidenote"&gt;Sidenote&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Alacritty 0.13 is available via apt. However I encountered some issue with the mouse pointer that disappeared from sight when above window, so that I reinstalled version 0.14-dev from GitHub that I compiled last week.&lt;/li&gt;
&lt;li&gt;There&amp;rsquo;s a new version for Cmus available in Ubuntu repos, still without album art support; I reinstalled my old fork, messed up with various GH clones (including one which used to work, and then I deleted everything. I&amp;rsquo;ll see how to bring album art back in my notification popup if I really miss that.&lt;/li&gt;
&lt;li&gt;Newsboat not available in official repos, don&amp;rsquo;t know why, but there&amp;rsquo;s a deb package for 23.10 and apparently a snap package for the current relese. Hey, I don&amp;rsquo;t want to use Snap, I removed it from my laptop two releases ago already!&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2024-08-17]&lt;/small&gt;&lt;br&gt;
As advised on &lt;a href="https://forums.linuxmint.com/viewtopic.php?t=426783"&gt;Linux Mint Forums&lt;/a&gt;, you can just install the latest available deb package (23.10 Mantic), and it works right out of the box.
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Now got NeoMutt 20231103, which is a 4 yr.bump (latest version in 22.04 dated back to 2019 if I remember correctly). Got some issues with my color definition but this was &lt;a href="https://github.com/neomutt/neomutt/issues/4095"&gt;easily fixed&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Tmux 3.4 works as expected.&lt;/li&gt;
&lt;li&gt;swayimg no &lt;code&gt;--gallery&lt;/code&gt; option with current version from apt, while the version I compiled from the master branch on GitHub works fine.&lt;/li&gt;
&lt;li&gt;Zathura is working fine with poppler as a PDF backend; should install mupdf backend but got stuck with dependencies (it would require mupdf &amp;gt; 1.19, and when I checkout the latest tag which accepts mupdf I got another conflict with a now defunct library). For the moment, I will use Foliate for Epub. And I realized that using a single app for all publication formats isn&amp;rsquo;t very realistic. After all, Evince is able to open PS and DVI files, while Zathura needs a plugin for Postscript and can&amp;rsquo;t open DVI file.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Oh, I forgot to say that Minecraft is still working ;-)&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Tindersticks • &lt;em&gt;See my Girls&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>The unquantified self #32</title><link>https://aliquote.org/post/unquantified-self-032/</link><pubDate>Tue, 06 Aug 2024 20:44:43 +0200</pubDate><guid>https://aliquote.org/post/unquantified-self-032/</guid><description>&lt;p&gt;Yet another one of these posts to reflect on recent moments in my life. I just finisehd watching Season 2 of the &lt;a href="https://en.wikipedia.org/wiki/House_of_the_Dragon"&gt;House of the Dragons&lt;/a&gt;. It was great and I am now just awaiting the third Season. I wouldn&amp;rsquo;t say it&amp;rsquo;s on the same level as Game of Thrones, but maybe it&amp;rsquo;s that there&amp;rsquo;s less of a profusion of characters, which makes House of the Dragons more intimate and closer to a classic series or mini-series. I watched other mini-series previously but only &lt;a href="https://en.wikipedia.org/wiki/The_Queen%27s_Gambit_(miniseries)"&gt;The Queen&amp;rsquo;s Gambit&lt;/a&gt; and &lt;a href="https://en.wikipedia.org/wiki/Ripley_(TV_series)"&gt;Ripley&lt;/a&gt; got my attention.&lt;/p&gt;
&lt;p&gt;This site has been pretty quiet for the past 3 months, partly because of the busy workload, but also because of a lack of motivation. I took the opportunity to read a lot of &lt;a href="https://aliquote.org/files/books.txt"&gt;books&lt;/a&gt; and draw whatever came to mind, or sometimes to mind. An excerpt follows.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_3783.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_3783.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_4007.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_4007.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_4027.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_4027.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;I still &lt;a href="https://www.youtube.com/watch?v=v0nmHymgM7Y"&gt;want it darker&lt;/a&gt; as he said.&lt;/p&gt;
&lt;p&gt;Anyway, the good thing is that I&amp;rsquo;m on holidays, for a good two weeks yet. I needed this to disconnect from everything, to recompose myself in a way. I&amp;rsquo;m afraid it&amp;rsquo;s not going to get any better &amp;ndash; just turned 50, still alive.&lt;/p&gt;
&lt;p&gt;I finally decided it was time to update the base colors of the site. Everything remains the same except for the background color of the body and note. I acknowledged source of inspiration in the &lt;a href="https://aliquote.org/changelog"&gt;Changelog&lt;/a&gt;. I also added rounded corner to code blocks, but I still don&amp;rsquo;t want to provide syntax highlighting. I like it when it&amp;rsquo;s just black &amp;amp; white, with bold statements, like in my text editor. I&amp;rsquo;m becoming increasingly allergic to garish colors and uniform white. Speaking of &lt;em&gt;the&lt;/em&gt; text editor (Neovim), I reworked my config once again, as described in &lt;a href="https://aliquote.org/post/neovim-revamped/"&gt;this post&lt;/a&gt;, but there was more to come later on. I ended up with an even more dry setup, based on 6 plugins but a lot of hand crafted VimL functions and settings.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;~/.config/nvim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» tree -L &lt;span class="m"&gt;3&lt;/span&gt; pack
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pack
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;└── plugins
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── opt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; │   ├── neogen
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; │   └── vim-table-mode
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; └── start
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── fzf-lua
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── nvim-treesitter
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; └── nvim-treesitter-textobjects
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="m"&gt;9&lt;/span&gt; directories, &lt;span class="m"&gt;0&lt;/span&gt; files
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That being said, if it hadn&amp;rsquo;t been for treesitter and the terminal facilities, I could have started from scratch with vim 9, &lt;a href="https://github.com/dense-analysis/ale"&gt;ALE&lt;/a&gt; and &lt;a href="https://github.com/junegunn/fzf.vim"&gt;fzf.vim&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;There are so many drafts waiting for me that I&amp;rsquo;d better get some rest&amp;hellip;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;aliquote master?
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» hugo list drafts
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;content/post/trend-tests.md
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;content/post/approximating-sine.md
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;content/post/generating-permutation.md
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;content/post/party-more-party.md
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;content/post/debugging-gdb-cutter.md
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;content/post/ols-in-c.md
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;content/post/git-for-tracking-changes.md
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;content/post/suffix-tree-in-scheme.md
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;content/post/bridge-sampling.md
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;content/post/how-many-bootstrap-replicates.md
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;content/post/islp.md
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;content/post/bootstrap-bca.md
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;content/post/racket-sqlite-api.md
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ The Gun Club • &lt;em&gt;Watermelon Man&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in July</title><link>https://aliquote.org/post/micro-07-2024/</link><pubDate>Wed, 31 Jul 2024 21:53:08 +0200</pubDate><guid>https://aliquote.org/post/micro-07-2024/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2024-07-07&lt;/a&gt;: ♪ Archive · Sleep&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-07-15&lt;/a&gt;: Lot of useful &lt;a href="https://www.arp242.net/zshrc.html"&gt;tips and tricks&lt;/a&gt; for Zsh users. I particularly like the &lt;code&gt;hash -d&lt;/code&gt; approach for directory bookmarks. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-07-15&lt;/a&gt;: ♪ Editors · Formaldehyde&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-07-25&lt;/a&gt;: From time to time, I make a few infidelities with cmus and use &lt;a href="https://github.com/neithern/g4music"&gt;gapless&lt;/a&gt; (formerly g4music). It&amp;rsquo;s a great piece of software which I initially compiled from scratch until I decided to rely on the Flathub version. I once generate &lt;code&gt;m3u&lt;/code&gt; playlists for relevant folders in my global library and they come up nicely in the playlist view. See my review &lt;a href="https://aliquote.org/posts/g4music"&gt;here&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-07-27&lt;/a&gt;: I try to use all the features of fzf-lua, and it&amp;rsquo;s quite easy to reproduce a Git time machine with the &lt;code&gt;bcommit&lt;/code&gt; command. If you&amp;rsquo;re not, you may want to give a shot to &lt;a href="https://github.com/junkblocker/git-time-lapse"&gt;git-time-lapse&lt;/a&gt;: It does the job pretty well with zero dependencies (e.g. Telescope, plenary), and it can be installed as a simple optional plugin. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>Writing plain TeX using vimtex</title><link>https://aliquote.org/post/vimtex-plaintex/</link><pubDate>Wed, 24 Jul 2024 21:02:57 +0200</pubDate><guid>https://aliquote.org/post/vimtex-plaintex/</guid><description>&lt;p&gt;I very much like &lt;a href="https://github.com/lervag/vimtex"&gt;vimtex&lt;/a&gt;, even if I&amp;rsquo;m not writing as much $\TeX$ stuff as I used to do in the past. It works very well with standard Latex documents that I still have on my HD. I get live compiling and forward/reverse search with the Zathura PDF viewer for free, and I can also toggle a pretty TOC along the way. I no longer use Context (maybe I should) but I know it is supposed to work similarly. As I said in a &lt;a href="https://aliquote.org/post/latex-beamer-21-century/"&gt;previous post&lt;/a&gt;, &lt;a href="https://www.luatex.org/"&gt;luatex&lt;/a&gt; is great for it allows us to write &amp;ldquo;plain $\TeX$&amp;rdquo; (for whatever definition of plain we agree on) using custom fonts and forget about accented letters for non-US writers. Since this last post, I haven&amp;rsquo;t write a single line of $\TeX$. However, since I was digging into my Neovim config for $\TeX$ stuff, I wanted to know how Vimtex handles the &lt;code&gt;plaintex&lt;/code&gt; filetype.&lt;/p&gt;
&lt;p&gt;And so, it all started with me trying to replicate the toy example mentioned above. It failed early. Okay, let&amp;rsquo;s forget I missed to add a final &lt;code&gt;\bye&lt;/code&gt; statement. Moving on, I soon realized that vimtex is way more friendly with Latex than plain old tex. Since I already have my own &lt;code&gt;$HOME/.latexmkrc&lt;/code&gt;, I never bothered checking how vimtex proceeds in this case. It looks like it has its own setting for running &lt;a href="https://ctan.org/tex-archive/support/latexmk"&gt;latexmk&lt;/a&gt;. Fair enough, but I couldn&amp;rsquo;t find my way to tell it to use an option like &lt;code&gt;-pdlatex=luatex&lt;/code&gt;. Hence I tried to use a different compiler, namely &lt;a href="https://islandoftex.gitlab.io/"&gt;arara&lt;/a&gt;. It allows to define the compiler and its options directly in the tex file, which is fine since I would like to avoid adding &lt;code&gt;.latexmkrc&lt;/code&gt; or &lt;code&gt;.nvimrc&lt;/code&gt; local config files to a simple project like this one. I also needed to define a &lt;code&gt;Tex root&lt;/code&gt; directive to please vimtex, otherwise it complains with a &amp;ldquo;failed mainfile detection&amp;rdquo; &amp;ndash; again because it &lt;a href="https://github.com/lervag/vimtex/issues/2491"&gt;primarily targets Latex documents&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;So far, I have the following in my &lt;code&gt;after/ftplugin/plaintex.vim&lt;/code&gt; file:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-vim" data-lang="vim"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;setlocal&lt;/span&gt; &lt;span class="nx"&gt;autoindent&lt;/span&gt; &lt;span class="nx"&gt;expandtab&lt;/span&gt; &lt;span class="nx"&gt;tabstop&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt; &lt;span class="nx"&gt;shiftwidth&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;set&lt;/span&gt; &lt;span class="nx"&gt;spelllang&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;en_gb&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;g&lt;/span&gt;:&lt;span class="nx"&gt;vimtex_format_enabled&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;g&lt;/span&gt;:&lt;span class="nx"&gt;vimtex_compiler_method&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;arara&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;nmap&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;gs&lt;/span&gt; :&lt;span class="nx"&gt;VimtexReload&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; \&lt;span class="p"&gt;|&lt;/span&gt; :&lt;span class="nx"&gt;VimtexCompile&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;nmap&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;g&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt; :%&lt;span class="p"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;fmt&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;w80&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;nmap&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;silent&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;go&lt;/span&gt; :&lt;span class="nx"&gt;VimtexTocToggle&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;nmap&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;silent&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;gO&lt;/span&gt; :&lt;span class="nx"&gt;lua&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;fzf-lua&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;.&lt;span class="nx"&gt;btags&lt;/span&gt;&lt;span class="p"&gt;()&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;nmap&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;leader&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;# :&lt;span class="m"&gt;-1&lt;/span&gt; &lt;span class="nx"&gt;read&lt;/span&gt; &lt;span class="p"&gt;~&lt;/span&gt;&lt;span class="sr"&gt;/.config/&lt;/span&gt;&lt;span class="nx"&gt;nvim&lt;/span&gt;&lt;span class="sr"&gt;/templates/&lt;/span&gt;&lt;span class="nx"&gt;plaintex&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I encountered some problem when trying to refomat using Vim&amp;rsquo;s &lt;code&gt;gq&lt;/code&gt; but &lt;code&gt;gw&lt;/code&gt; works fine, so that may just be a conflict somewhere in my config. Note that I overwrite global settings for vimtex, but I assume that I may rarely have to switch from plain $\TeX$ to $\LaTeX$ during the same writing session. Finally, I don&amp;rsquo;t really why I need to reload vimtex in order to apply the compilation directive that are defined in the header, but since I may forget about this later I chose to reload systematically before recompiling. Here&amp;rsquo;s the template I defined for my $\TeX$ documents:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-latex" data-lang="latex"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;% vim: set ft=plaintex:
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;% arara: luatex: {synctex: yes}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;%! TeX root = test.tex
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\ifdefined\directlua&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;\input&lt;/span&gt; luaotfload.sty
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\font\tenrm&lt;/span&gt;=&amp;#34;Alegreya&amp;#34; at 10pt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\tenrm&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\parindent&lt;/span&gt; 0pt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\bye&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I will probably update the above template when I will really write something more elaborated than a toy example.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Claire Welles • &lt;em&gt;Waiting In The Sun&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Develop good habits from the start</title><link>https://aliquote.org/post/reflecting-on-25-years-of-stats/</link><pubDate>Wed, 10 Jul 2024 20:42:46 +0200</pubDate><guid>https://aliquote.org/post/reflecting-on-25-years-of-stats/</guid><description>&lt;p&gt;Last month I came across a blog entry posted on HN: &lt;a href="https://mbuffett.com/posts/programming-advice-younger-self"&gt;A Bunch of Programming Advice I’d Give To Myself 15 Years Ago&lt;/a&gt;. I couldn&amp;rsquo;t help thinking that some of the advices discussed here are good ones even for managing a statistical project:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Spending time sharpening the axe is almost always worth it&lt;/li&gt;
&lt;li&gt;If you can’t easily explain why something is difficult, then it’s incidental complexity, which is probably worth addressing&lt;/li&gt;
&lt;li&gt;Don’t underestimate the value of digging into history to investigate some bugs&lt;/li&gt;
&lt;li&gt;Make debugging easier&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;All the above apply equally well to statistical analysis. Even if should select the best statistical package for the task at hand (while running a t-test is a common task that most software offer nowadays, analyzing survey data is not something to be taken lightly). As someone who value good software and the command-line (not much because I like typing commands but because I can record them for later use or review) I&amp;rsquo;ve almost always relied on R, Stata and a few dedicated software (e.g., jags, stan, xgboost). Writing code also means you should value your text editor (Emacs first, then Vim, then Neovim in my case). About the second point, I faced it both when teaching medium-to-hard techniques to graduate students or during corporate training, and by presenting my own analysis results, most of the time resulting from multivariate analysis. I was using Git mostly for mono repos so that I could track changes along project timeline (my changes, and their &amp;ndash; i.e., the client or colleagues &amp;ndash; changes as well). As for debugging, especially making it easier to detect errors or misbehaving programs, I believe it comes with experience and good practices.&lt;/p&gt;
&lt;p&gt;Other rule-of-thumbs I adopted over time:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Make a &lt;a href="https://stats.stackexchange.com/a/2724"&gt;plot for every p-value&lt;/a&gt; you report.&lt;/li&gt;
&lt;li&gt;We have computer to do the hard work, but it&amp;rsquo;s always good to know how dof are derived, for instance. It helps checking if we are working with the correct data, but see below.&lt;/li&gt;
&lt;li&gt;Be careful with variable encoding and missing values.&lt;/li&gt;
&lt;li&gt;Be careful with default values of your preferred statistical package for certain routines, they may differ from other well acknowledged software (continuity correction, population vs. sample dof, etc.).&lt;/li&gt;
&lt;li&gt;Reproducibility is a thing, but you should first be able to reproduce your own results (think about the 2-year cycle or so before publishing a paper; you may be asked to re-run the whole analysis to please one picky reviewer, who might be right by the way).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To sum up, developing good habits from the start is always worth it. I can&amp;rsquo;t count the number of times I&amp;rsquo;ve been asked to produce a result with slightly updated data 6 or 12 months after the end of a project: having a solid, well-tested script has made things easier every time.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Passenger • &lt;em&gt;Wicked Man&amp;rsquo;s Rest&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Stata and Quarto</title><link>https://aliquote.org/post/stata-quarto/</link><pubDate>Tue, 09 Jul 2024 20:48:03 +0200</pubDate><guid>https://aliquote.org/post/stata-quarto/</guid><description>&lt;p&gt;I&amp;rsquo;m a bit late with &lt;a href="https://quarto.org/"&gt;Quarto&lt;/a&gt;, which I only started to use a few months ago. I&amp;rsquo;ve heard good news about this new rendering engine for literate coding on Frank Harrell&amp;rsquo;s blog, but since I rarely write RMarkdown reports these days, I tested the command-line program and then just forgot about it.&lt;/p&gt;
&lt;p&gt;However, a few days ago I came across a Neovim plugin which offers all the goodies you might expect to render and/or preview Quarto documents from Neovim directly. I think I found it when browsing about use cases for &lt;a href="https://github.com/benlubas/molten-nvim"&gt;molten-nvim&lt;/a&gt; that I finally kept in my toolbox (I&amp;rsquo;m rather thrifty in this respect since I only have 8 plugins in my &lt;code&gt;pack&lt;/code&gt; folder &amp;ndash; no plugin manager, no nvim-lspconfig!). I don&amp;rsquo;t really care about the plugin itself since I manage to write a one-liner compiler for Vim:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;silent CompilerSet makeprg=quarto\ render\ %\ --to\ $*
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;small&gt;I don&amp;rsquo;t really care about messing up with the &lt;code&gt;erroformat&lt;/code&gt; since quarto will stop running after the first error.&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;And for the remaining stuff, I just added &lt;code&gt;set ft=markdown&lt;/code&gt; and &lt;code&gt;runtime! ftplugin/markdown.vim&lt;/code&gt; to my &lt;code&gt;after/ftplugin/quarto.vim&lt;/code&gt; config. That&amp;rsquo;s all folks!&lt;/p&gt;
&lt;p&gt;Anyway, great news for Quarto users using Stata with version below 17: you can declare &lt;a href="https://kylebarron.dev/stata_kernel/getting_started/"&gt;stata_kernel&lt;/a&gt; as a custom kernel rather than the default &lt;a href="https://hugetim.github.io/nbstata/"&gt;nbstata&lt;/a&gt;. Since I only owe a license for Stata 13 MP, I don&amp;rsquo;t know what&amp;rsquo;s new in the Stata world other than what I read on the www, but it works perfectly well, including graphical output. This was the most cumbersome thing I happened to deal with when I was writing my &lt;a href="https://aliquote.org/articles/stata-sk/"&gt;Stata Starter Kit&lt;/a&gt; using org-mode some years ago. Since I&amp;rsquo;m using Stata 13, I needed to export graphics as encapsulated PS file, and then convert them to PNG files. Of course this was automated via a Makefile, but when you find that a version number (13 &amp;lt; 14) prevents you from exporting your figures as PNG or SVG files, it really sucks. Now it&amp;rsquo;s all over, and I can just write Stata code and let Quarto produce a well-formatted PDF or HTML file using Pandoc. MRE follows.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;---
title: Hello Stata
author: chl
jupyter:
kernelspec:
display_name: Stata
language: Stata
name: stata
format:
html:
toc: true
html-math-method: mathjax
highlight-style: monochrome
embed-resources: true
anchor-sections: true
citations-hover: false
footnotes-hover: false
code-copy: true
---
Trying out to run some Stata code:
```{stata}
sysuse auto
su mpg
hist mpg
```
That's it!
&lt;/code&gt;&lt;/pre&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2024-07-09-21-14-17.png"&gt;
&lt;/figure&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Bauhaus • &lt;em&gt;Double Dare&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;You&amp;rsquo;ll need to install &lt;a href="https://kylebarron.dev/stata_kernel/getting_started/"&gt;stata_kernel&lt;/a&gt; first.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Neovim 0.10</title><link>https://aliquote.org/post/neovim-revamped/</link><pubDate>Wed, 03 Jul 2024 20:11:23 +0200</pubDate><guid>https://aliquote.org/post/neovim-revamped/</guid><description>&lt;p&gt;&lt;a href="https://aliquote.org/post/lazy-nvim/"&gt;I&lt;/a&gt; &lt;a href="https://aliquote.org/post/vim-revamp-again/"&gt;did&lt;/a&gt; &lt;a href="https://aliquote.org/post/neovim-lsp-easy/"&gt;it&lt;/a&gt; again: I cleaned up unused or defunct stuff in my Neovim config. I have one excuse, though: Since I upgraded to version 0.10, I needed to account for API breaking changes but also to accommodate &lt;a href="https://gpanders.com/blog/whats-new-in-neovim-0.10/"&gt;all the goodies&lt;/a&gt;, especially regarding LSP &amp;amp; Co.&lt;/p&gt;
&lt;p&gt;Neovim gained a builtin commenting system, probably inherited from &lt;a href="https://github.com/echasnovski/mini.nvim"&gt;mini.nvim&lt;/a&gt;. Since I removed the plugin I was using, I&amp;rsquo;m glad this is now shipped as a default. The default theme (on the right below) has been redesigned, and it looks great (except for the diff view), but I much prefer the quiet theme (on the left) which removes almost everything and yields a very slick UI, IMO. See &lt;code&gt;:help dev_theme&lt;/code&gt; for more info on the design of the new colorscheme.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2024-07-05-13-34-43.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2024-07-05-13-34-43.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2024-07-05-13-34-58.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2024-07-05-13-34-58.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;div class="alert alert-note"&gt;
&lt;p&gt;&lt;small&gt;[2024-07-06]&lt;/small&gt;&lt;br&gt;
If I ever change my mind, I could still rely on the default theme when I&amp;rsquo;m working on my local computer and switch to the quiet theme for remote sessions. Something like that, maybe:[^1]&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lua" data-lang="lua"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;vim.api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nvim_command&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;[[
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; augroup updatecolorscheme
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; autocmd colorscheme * :hi normal guibg=NONE ctermbg=NONE |
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; hi! link QuickFixLine Visual
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; augroup END
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;if&lt;/span&gt; &lt;span class="n"&gt;vim.env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XDG_SESSION_TYPE&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;wayland&amp;#34;&lt;/span&gt; &lt;span class="kr"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vim.cmd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;colorscheme&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;default&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;fzf_theme&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;light&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;else&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vim.cmd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;colorscheme&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;quiet&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;fzf_theme&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;bw&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Regarding LSP, omnifunc and tagfunc are now automatically set up when attaching an LSP. There are now default mapping to navigate diagnostics and to pop up the diagnostic window. It is also easier to determine the root folder for a project (see &lt;code&gt;vim.fs.root&lt;/code&gt;). Inlay hints have landed in the 0.10 release (it works great with rust-analyzer and clangd), which means we can show them on demand using a simple mapping:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lua" data-lang="lua"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;if&lt;/span&gt; &lt;span class="n"&gt;client.supports_method&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;textDocument/inlayHint&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="kr"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vim.keymap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;n&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;zI&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&amp;lt;cmd&amp;gt;lua vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())&amp;lt;cr&amp;gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{})&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I found &lt;a href="https://www.reddit.com/r/neovim/comments/q6lvsl/lsphelp_simple_script_to_place_a_sign_where_code/"&gt;a way&lt;/a&gt; to get ride of &lt;a href="https://github.com/kosayoda/nvim-lightbulb"&gt;nvim-lightbulb&lt;/a&gt; using the following snippet:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lua" data-lang="lua"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;code_action_listener&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;bufnr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;vim.api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nvim_get_current_buf&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;diagnostics&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;vim.lsp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;diagnostic.get_line_diagnostics&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;params&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;vim.lsp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;util.make_range_params&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;ns_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;vim.api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nvim_create_namespace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;code_action&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;unpack&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;vim.api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nvim_win_get_cursor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;curr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;params.context&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;params.range&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;start.line&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vim.lsp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;buf_request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bufnr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;textDocument/codeAction&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kr"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;actions&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kr"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;actions&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;actions&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;~=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;table&amp;#34;&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;vim.tbl_isempty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;actions&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="kr"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vim.api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nvim_buf_del_extmark&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bufnr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ns_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;curr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kr"&gt;else&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vim.api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nvim_buf_del_extmark&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bufnr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ns_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;curr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vim.api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nvim_buf_set_extmark&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bufnr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ns_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;curr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;virt_text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;░&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;DiagnosticInfo&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;}},&lt;/span&gt; &lt;span class="n"&gt;virt_text_pos&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;eol&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kr"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kr"&gt;end&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;if&lt;/span&gt; &lt;span class="n"&gt;client.server_capabilities&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;codeActionProvider&lt;/span&gt; &lt;span class="kr"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vim.api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nvim_create_autocmd&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;CursorHold&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;CursorHoldI&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;group&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;vim.api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nvim_create_augroup&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;code_action_sign&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;clear&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;}),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;callback&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kr"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;code_action_listener&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kr"&gt;end&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;})&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vim.keymap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;n&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;z=&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&amp;lt;cmd&amp;gt;lua require(&amp;#39;fzf-lua&amp;#39;).lsp_code_actions({ previewer = &amp;#39;codeaction&amp;#39; })&amp;lt;cr&amp;gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is all great news from people who like to keep their editor free of any IDE fancy things. There&amp;rsquo;s an interesting &lt;a href="https://news.ycombinator.com/item?id=40378218"&gt;thread on HN&lt;/a&gt; regarding all those goodies.&lt;/p&gt;
&lt;p&gt;As an aside, following my &lt;a href="https://aliquote.org/post/scheming-in-vim/"&gt;recent post&lt;/a&gt;, I briefly tried to get used to Conjure but I couldn&amp;rsquo;t find my way with the log buffer. The thing that I will probably miss is the ability to set marks and reevaluate them at will. But to be honest, I reverted back to &lt;a href="https://github.com/benlubas/molten-nvim"&gt;molten-nvim&lt;/a&gt; which provides the best compromise between inline evaluation and my full REPL driven (with a terminal opened in a split) workflow. And I like the idea that I can plot almost anything in R, Stata or Python (with plotnine) and get a nice PDF almost instantaneously.&lt;/p&gt;
&lt;p&gt;In passing, I also reworked my whole &lt;code&gt;after/ftplugin/markdown.vim&lt;/code&gt; settings. Treesitter now handles most the stuff I implemented myself, especially navigating between section, folding, or block selection. I still need this stuff for &lt;code&gt;org.vim&lt;/code&gt; since I removed the orgmode plugin so nothing&amp;rsquo;s lost. I added one package, &lt;a href="https://github.com/dhruvasagar/vim-table-mode"&gt;vim-table-mode&lt;/a&gt;, which I used to use occasionally in the past.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ ANOHNI and the Johnsons • &lt;em&gt;Epilepsy is Dancing&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;[^1]:
Further improvement to the quiet theme would be to remove diagnostic colors altogether:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;```lua
hi DiagnosticUnderlineError guisp=Black |
hi DiagnosticUnderlineWarn guisp=Black |
hi DiagnosticUnderlineHint guisp=Black |
hi DiagnosticUnderlineInfo guisp=Black |
hi! link DiagnosticFloatingError NormalFloat |
hi! link DiagnosticFloatingWarn NormalFloat |
hi! link DiagnosticFloatingHint NormalFloat |
hi! link DiagnosticFloatingInfo NormalFloat |
hi! link DiagnosticFloatingOk NormalFloat
```
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>Micro posting in June</title><link>https://aliquote.org/post/micro-06-2024/</link><pubDate>Sun, 30 Jun 2024 13:37:33 +0200</pubDate><guid>https://aliquote.org/post/micro-06-2024/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2024-06-20&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_4072.JPEG" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-06-20&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A good understanding of Vim’s various lists is a massive productivity boost — it’s taken me many years of Vim use to truly appreciate this. &amp;mdash; &lt;a href="https://codeinthehole.com/tips/vim-lists/#tip-custom-makeprg-programs"&gt;Vim&amp;rsquo;s useful lists&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2024-06-20&lt;/a&gt;: TIL that Racket comes with a migration utility for packages installed using a preceding release: &lt;code&gt;raco pkg migrate&lt;/code&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-06-20&lt;/a&gt;: ♪ New Order · Truth&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-06-21&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Vim experts&amp;rdquo; don&amp;rsquo;t prefer buffers over tabs: they use buffers as the file proxies they are and tab pages as the workspaces they are. Buffers and tab pages have different purposes so preferring one to the other makes no sense whatsoever. &amp;mdash; &lt;a href="https://stackoverflow.com/questions/26708822/why-do-vim-experts-prefer-buffers-over-tabs/26710166"&gt;Why do Vim experts prefer buffers over tabs?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2024-06-25&lt;/a&gt;: After 4 years I think &lt;a href="https://github.com/ibhagwan/fzf-lua"&gt;fzf-lua&lt;/a&gt; remains one of my favorite Neovim plugin. That being said, it is also one of the most astonishing GitHub project where the author is so active that all issues are resolved in due time while he is also providing useful tips all time. Last find is how live grep could potentially handle &lt;a href="https://github.com/ibhagwan/fzf-lua/issues/1262"&gt;current word&lt;/a&gt; (&lt;code&gt;C-r C-w&lt;/code&gt; doesn&amp;rsquo;t work when using Fzf terminal). &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-06-27&lt;/a&gt;: I finally got ride of most of the (Neo)vim packages I was only using on an occasional basis, which led me to the following setup: (I barely use Rust, but I happen to read some Rust code from time to time.)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» tree -L &lt;span class="m"&gt;3&lt;/span&gt; pack
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pack
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;└── plugins
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── opt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; │   ├── haskell-tools.nvim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; │   ├── molten-nvim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; │   └── rustaceanvim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; └── start
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── fzf-lua
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── nvim-treesitter
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── nvim-treesitter-textobjects
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; └── vimtex
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Also, I deleted my custom colorscheme, even if I was just using &lt;a href="https://github.com/zenbones-theme/zenbones.nvim"&gt;zenbones&lt;/a&gt; for the past few months, and I switched to the builtin &lt;code&gt;quiet&lt;/code&gt; colorscheme, which is great (pending some minor changes which I implemented in an &lt;code&gt;autocommand&lt;/code&gt;). Good-bye &lt;a href="https://github.com/nvim-orgmode/orgmode"&gt;orgmode&lt;/a&gt; as well, especially since I don&amp;rsquo;t use the agenda and capture stuff. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-06-27&lt;/a&gt;: ♪ Northside · Tour de World&lt;br&gt;&lt;/p&gt;</description></item><item><title>ArXiving on February 2024</title><link>https://aliquote.org/post/arxiv-16/</link><pubDate>Thu, 27 Jun 2024 12:24:09 +0200</pubDate><guid>https://aliquote.org/post/arxiv-16/</guid><description>&lt;p&gt;Old reads&amp;hellip;&lt;/p&gt;
&lt;h3 id="looking-back-at-postgres-"&gt;Looking Back at Postgres (&lt;a href="https://arxiv.org/abs/1901.01973"&gt;https://arxiv.org/abs/1901.01973&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;I rarely use Postgres for my personal hobbies (I usually find that SQLite provides me with convenient cost-effectiveness tradeoff for pet projects), but I always appreciated it for long term projects as well as its extensions. This paper is a recollection of the early days of Postgres in the 80s.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Postgres was Stonebraker’s second system, and it was certainly chock full of features and ideas. Yet the system succeeded in prototyping many of the ideas, while delivering a software infrastructure that carried a number of the ideas to a successful conclusion. This was not an accident—at base, Postgres was designed for extensibility, and that design was sound. With extensibility as an architectural core, it is possible to be creative and stop worrying so much about discipline: you can try many extensions and let the strong succeed.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id="prediction-of-causal-genes-at-gwas-loci-with-pleiotropic-gene-regulatory-effects-using-sets-of-correlated-instrumental-variables-"&gt;Prediction of causal genes at GWAS loci with pleiotropic gene regulatory effects using sets of correlated instrumental variables (&lt;a href="https://arxiv.org/abs/2401.06261"&gt;https://arxiv.org/abs/2401.06261&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;I wrote about &lt;a href="https://aliquote.org/post/mendelian-randomization"&gt;Mendelian randomization&lt;/a&gt; a while ago. This paper is about its multivariate extension in the context of causal inference using instrumental variables in a study of genome-wide significant GWAS loci. When the &lt;a href="https://academic.oup.com/biomet/advance-article/doi/10.1093/biomet/asad066/7342182?login=false"&gt;instrumental set condition&lt;/a&gt; is satisfied, direct causal effects of all exposures in the model on the outcome variable of interest can be identified.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/gwas_mendelian_instruments.png"&gt;
&lt;/figure&gt;
&lt;h3 id="asymptotic-online-fwer-control-for-dependent-test-statistics-"&gt;Asymptotic Online FWER Control for Dependent Test Statistics (&lt;a href="https://arxiv.org/abs/2401.09559"&gt;https://arxiv.org/abs/2401.09559&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;If you ever applied Bonferroni correction (or any stepwise procedure) for multiple comparison, you know that we assume that tests are independent, and in the case of Bonferonni it may be way too much conservative. This is even more complicated in the case of online testing. An alternative approach is proposed in this article, namely an adaptive version of the alpha-spending algorithm used, e.g., in interim analyses, &lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; where we update the p-values depending on whether they are believed to have arisen under the null hypothesis or the alternative.&lt;/p&gt;
&lt;p&gt;A Computationally Efficient Approach to False Discovery Rate Control and Power Maximisation via Randomisation and Mirror Statistic (&lt;a href="https://arxiv.org/abs/2401.12697"&gt;https://arxiv.org/abs/2401.12697&lt;/a&gt;) is yet another paper on FDR rather than FWER control. See also &lt;a href="https://arxiv.org/abs/2401.12865"&gt;Gridsemble: Selective Ensembling for False Discovery Rates&lt;/a&gt; for related to estimating local false discovery rates in large-scale multiple hypothesis testing.&lt;/p&gt;
&lt;h3 id="likelihood-ratio-inference-on-differences-in-quantiles-"&gt;Likelihood-ratio inference on differences in quantiles (&lt;a href="https://arxiv.org/pdf/2401.10233"&gt;https://arxiv.org/pdf/2401.10233&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;I barely used quantile regression in my previous life (aka when I was working as a full-time statistician), except in a few cases when dealing with growth curves and newborn data. I came across this paper because I&amp;rsquo;ve been a long time follower of Evan Miller&amp;rsquo;s posts. He&amp;rsquo;s actually discussing how to implement a two-sample difference-in-quantile hypothesis test and how to construct confidence intervals based on a likelihood ratio test.&lt;/p&gt;
&lt;h3 id="on-the-visualisation-of-the-correlation-matrix-"&gt;On the visualisation of the correlation matrix (&lt;a href="https://arxiv.org/abs/2401.12730"&gt;https://arxiv.org/abs/2401.12730&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;I like biplot graphical displays, despite their subtleties regarding how rows and/or columns of a correlation or distance matrix are adjusted. In this paper, the author suugests &amp;ldquo;a weighted alternating least squares algorithm is used, with either a single scalar ad- justment, or a column-only adjustment with symmetric factorization; these choices form a compromise between the numerical accuracy of the approximation and the comprehensibility of the obtained correlation biplots.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://arxiv.org/abs/2401.12937"&gt;Are the Signs of Factor Loadings Arbitrary in Confirmatory Factor Analysis? Problems and Solutions&lt;/a&gt; was also mentioned in my daily arxiv digest. As I am slowly forgetting 15 years of previous work in psychometrics, I find it particularly hard to come back from time to time to such papers. Anyway, I&amp;rsquo;m happy to see that research continues in this field, especially for old questions like those. Finally, I came across this related work on PCA: &lt;a href="https://arxiv.org/abs/2401.12905"&gt;Estimating the construct validity of Principal Components Analysis&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="pretraining-and-the-lasso-"&gt;Pretraining and the Lasso (&lt;a href="https://arxiv.org/abs/2401.12911"&gt;https://arxiv.org/abs/2401.12911&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;A potentially interesting paper I should read.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In this paper, we ask the question “Can pretraining help the lasso?”. We develop a framework for the lasso in which an overall model is fit to a large set of data, and then fine-tuned to a specific task on a smaller dataset. This latter dataset can be a subset of the original dataset, but does not need to be. We find that this framework has a wide variety of applications, including stratified models, multinomial targets, multi-response models, conditional average treatment estimation and even gradient boosting.&lt;br&gt;
In the stratified model setting, the pretrained lasso pipeline estimates the coefficients common to all groups at the first stage, and then group-specific coefficients at the second “fine-tuning” stage. We show that under appropriate assumptions, the support recovery rate of the common coefficients is superior to that of the usual lasso trained only on individual groups. This separate identification of common and individual coefficients can also be useful for scientific understanding.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Keith Jarrett Trio • &lt;em&gt;Sun Prayer&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;DeMets, D.L. and Lan, K.K. Interim analysis: the alpha spending function approach. &lt;em&gt;Statistics in Medicine&lt;/em&gt; 13(13-14): 1341-1352, 1994. See also &lt;a href="https://jfiksel.github.io/2021-02-03-alpha_spending_explained/"&gt;Introduction to Conducting Interim Analyses Using Alpha Spending&lt;/a&gt;.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Cochran-Mantel-Haenszel test</title><link>https://aliquote.org/post/cochran-mantel-haenszel/</link><pubDate>Fri, 21 Jun 2024 20:53:23 +0200</pubDate><guid>https://aliquote.org/post/cochran-mantel-haenszel/</guid><description>&lt;p&gt;Yesterday I was looking for some implementation of the Cochran-Mantel-Haenszel test in Python. Inasmuch as I like Python for web dev and string processing, I always find it surprising that people prefer to stay in Python rather than use dedicated statistical packages. Anyway, here&amp;rsquo;s how I went to benchmark the &lt;a href="https://pypi.org/project/CMH/"&gt;CMH&lt;/a&gt; package against R and Stata.&lt;/p&gt;
&lt;p&gt;First of all, I started looking at whta&amp;rsquo;s available in the &lt;a href="https://www.statsmodels.org/stable/index.html"&gt;statsmodels&lt;/a&gt; package. I remain impressed by the progress developers have made over the last ten years in terms of the quality, usability and diversity of the procedures available. However, while there&amp;rsquo;s an homogeneity test for stratified tables (along with the Breslow–Day test), it is limited to &lt;a href="https://www.statsmodels.org/stable/generated/statsmodels.stats.contingency_tables.StratifiedTable.html#statsmodels.stats.contingency_tables.StratifiedTable"&gt;2x2 tables&lt;/a&gt;.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; Soon after I found the CMH package whihc looks like what was I was looking for since it handles extensions of Cochran–Mantel–Haenszel statistics to K-way tables with more than two categories.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s a little benchmark taken from the R on-line help for stats::mantelhaen.test in R:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Satisfaction&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;as.table&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;c&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="m"&gt;11&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;17&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;6&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;dim&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;c&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;dimnames&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Income&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;c&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&amp;lt;5000&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;5000-15000&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;15000-25000&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;&amp;gt;25000&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;Job Satisfaction&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;c&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;V_D&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;L_S&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;M_S&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;V_S&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Gender&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;c&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Female&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;Male&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;ftable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;. &lt;/span&gt;&lt;span class="o"&gt;~&lt;/span&gt; &lt;span class="n"&gt;Gender&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;Income&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Satisfaction&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Job&lt;/span&gt; &lt;span class="n"&gt;Satisfaction&lt;/span&gt; &lt;span class="n"&gt;V_D&lt;/span&gt; &lt;span class="n"&gt;L_S&lt;/span&gt; &lt;span class="n"&gt;M_S&lt;/span&gt; &lt;span class="n"&gt;V_S&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Gender&lt;/span&gt; &lt;span class="n"&gt;Income&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Female&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="m"&gt;5000&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt; &lt;span class="m"&gt;11&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="m"&gt;5000-15000&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt; &lt;span class="m"&gt;17&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="m"&gt;15000-25000&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="m"&gt;8&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="m"&gt;25000&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt; &lt;span class="m"&gt;4&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Male&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="m"&gt;5000&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="m"&gt;5000-15000&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="m"&gt;15000-25000&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;7&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="m"&gt;25000&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="m"&gt;9&lt;/span&gt; &lt;span class="m"&gt;6&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;mantelhaen.test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Satisfaction&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Cochran&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Mantel&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Haenszel&lt;/span&gt; &lt;span class="n"&gt;test&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Satisfaction&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Cochran&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Mantel&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Haenszel&lt;/span&gt; &lt;span class="n"&gt;M^2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;10.2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;df&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0.3345&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I exported the above dataset as a dataframe with one row per observation as follows:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;dd&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;as.data.frame&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Satisfaction&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;write.csv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dd&lt;/span&gt;&lt;span class="nf"&gt;[rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;row.names&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dd&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;dd&lt;/span&gt;&lt;span class="o"&gt;$&lt;/span&gt;&lt;span class="n"&gt;Freq&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="n"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;satisfaction.csv&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;row.names&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;FALSE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I got the same result in Stata:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="n"&gt;import&lt;/span&gt; &lt;span class="n"&gt;delimited&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;home&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;chl&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;tmp&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;satisfaction&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;csv&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;varnames&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="n"&gt;foreach&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;varlist&lt;/span&gt; &lt;span class="n"&gt;income&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;gender&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mf"&gt;2.&lt;/span&gt; &lt;span class="n"&gt;encode&lt;/span&gt; &lt;span class="err"&gt;`&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;, gen(`v&amp;#39;&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mf"&gt;3.&lt;/span&gt; &lt;span class="n"&gt;drop&lt;/span&gt; &lt;span class="err"&gt;`&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mf"&gt;4.&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="n"&gt;rename&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="n"&gt;emh&lt;/span&gt; &lt;span class="n"&gt;income&lt;/span&gt; &lt;span class="n"&gt;jobsatisfaction&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;strata&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;gender&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;general&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Extended&lt;/span&gt; &lt;span class="n"&gt;Mantel&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Haenszel&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Cochran&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Mantel&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Haenszel&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;Stratified&lt;/span&gt; &lt;span class="n"&gt;Test&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;Association&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;General&lt;/span&gt; &lt;span class="n"&gt;Association&lt;/span&gt; &lt;span class="n"&gt;Statistic&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Q&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;10.2001&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;P&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.3345&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Transformation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Table&lt;/span&gt; &lt;span class="n"&gt;Scores&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Untransformed&lt;/span&gt; &lt;span class="n"&gt;Data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then, in Python, it is as simple as the following snippet:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;pandas&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;pd&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;cmh&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;CMH&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;df&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read_csv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;satisfaction.csv&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;CMH&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;Income&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;Job.Satisfaction&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stratifier&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Gender&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;r&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Cochran&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Mantel&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Haenszel&lt;/span&gt; &lt;span class="n"&gt;Chi2&lt;/span&gt; &lt;span class="n"&gt;test&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;&amp;#34;Income&amp;#34;&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Job.Satisfaction&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stratified&lt;/span&gt; &lt;span class="n"&gt;by&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Gender&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Cochran&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Mantel&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Haenszel&lt;/span&gt; &lt;span class="n"&gt;M&lt;/span&gt;&lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;12.29047&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dof&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.1974&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And so it begins. The test statistics and their respective p-values do not match. Querying the online help from IPython suggests there&amp;rsquo;s an &lt;code&gt;adjustment&lt;/code&gt; option, with no indication of what it means actually. I thought it would maybe related to some kind of continuity correction&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; and I went right away check the source code on GitHub. Sadly, there was not &lt;code&gt;adjustment&lt;/code&gt; parameter in the GH code, although there&amp;rsquo;s one in my local package (installed via &lt;code&gt;pip&lt;/code&gt;):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# -%&amp;lt;---------------&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# Create stratified contingency tables&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;K&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cat&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;stratifier&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cat&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;categories&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;subset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;loc&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;stratifier&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;cat&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;outcome&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;xs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;crosstab&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;subset&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;outcome&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;subset&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;dropna&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;False&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;contingency_tables&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt; &lt;span class="p"&gt;:,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;xs&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;adjustment&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# -&amp;gt;%---------------&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Since the author claims his code is based on Agresti (&lt;em&gt;Categorical Data Analysis&lt;/em&gt;, 2002), I should have checked the textbook since it was long time since I didn&amp;rsquo;t open it, and compare the code with the suggested algorithm. But then I came to other interesting problems, and I think I&amp;rsquo;ll get back to this later.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ New Order • &lt;em&gt;Blue Monday&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;It&amp;rsquo;s worth noting that they apply a continuity correction by default.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;If I&amp;rsquo;m not mistaken, Fisher-Yates correction only applies in the case of 2x2 tables.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Scheming in Vim (con't)</title><link>https://aliquote.org/post/scheming-in-vim/</link><pubDate>Mon, 17 Jun 2024 21:21:32 +0200</pubDate><guid>https://aliquote.org/post/scheming-in-vim/</guid><description>&lt;p&gt;See also &lt;a href="https://aliquote.org/post/scheme-in-vim"&gt;Scheme in Vim&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve already given up on the idea of using &lt;a href="https://aliquote.org/post/scheme-langserver/"&gt;molten-nvim&lt;/a&gt; to evaluate code in Neovim via Jupyter kernels. It looks great, really it is, but I always find myself in need of interacting with a live REPL or shell. I left &lt;a href="https://aliquote.org/post/jupyter-kernels-in-vim/"&gt;Magma&lt;/a&gt; when it introduced serious UX changes; this time, I feel like it&amp;rsquo;s just not for me. Without a touch of interactivity, I can&amp;rsquo;t understand the appeal compared to, say, my poor-man &amp;ldquo;send line or visual selection&amp;rdquo; to a running terminal. That being said, there&amp;rsquo;s still no proper implementation of a Swank server or a Jupyter kernel for Scheme.&lt;/p&gt;
&lt;p&gt;I said in my previous post that I was using &lt;a href="https://github.com/kovisoft/slimv"&gt;slimv&lt;/a&gt;, which works fine for Common Lisp, but only allows the user to interact with MIT Scheme. I want to use Chicken or Chez Scheme. And so I replaced molten with &lt;a href="https://github.com/Olical/conjure"&gt;Conjure&lt;/a&gt;. Initially, I tought it would be easy to just tweak my filetype-specific settings so that I could trigger a Chez or Chicken client depending on file extension (I don&amp;rsquo;t mind using &lt;code&gt;*.ss&lt;/code&gt; for Chez Scheme source file). This is until I realized that Conjure rely on &amp;ldquo;universal&amp;rdquo; filetype to decide which client to launch, and so in the case of Scheme files the assumed extension is &lt;code&gt;*.scm&lt;/code&gt;. So, for the time being I defined some guards based on a buffer-local or global variable, like in the following snippet of my &lt;code&gt;after/ftplugin/scheme.vim&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;if exists(&amp;#39;b:is_chicken&amp;#39;) || exists(&amp;#39;g:is_chicken&amp;#39;)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; exe &amp;#39;ru! syntax/chicken.vim&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; setl keywordprg=chicken-doc
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; setl makeprg=csc
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; setl complete+=,k~/.local/share/scheme/words
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; setl include=\^\(\\(use\\\|require-extension\\)\\s\\+
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; setl includeexpr=substitute(v:fname,&amp;#39;$&amp;#39;,&amp;#39;.scm&amp;#39;,&amp;#39;&amp;#39;)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; setl path+=/home/chl/.cache/chicken-install
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; setl suffixesadd=.scm
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; setl lispwords+=condition-case
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; setl lispwords+=with-input-from-string
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; setl lispwords+=with-output-to-string
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; setl lispwords+=handle-exceptions
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; setl lispwords+=call/cc
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; setl lispwords+=rec
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; setl lispwords+=receive
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; setl lispwords+=call-with-output-file
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; let g:conjure#client#scheme#stdio#command = &amp;#34;csi -quiet -:c&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; let g:conjure#client#scheme#stdio#prompt_pattern = &amp;#34;\n-#;%d-&amp;gt; &amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; let g:conjure#client#scheme#stdio#value_prefix_pattern = v:false
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; nmap &amp;lt;buffer&amp;gt; gs :10 split term://csi -s %&amp;lt;cr&amp;gt;:startinsert&amp;lt;cr&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; nmap &amp;lt;buffer&amp;gt; &amp;lt;leader&amp;gt;! :10 split term://rlwrap csi&amp;lt;cr&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; nnoremap &amp;lt;buffer&amp;gt; &amp;lt;leader&amp;gt;# :-1 read ~/.config/nvim/templates/scm&amp;lt;cr&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;endif
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I realize this is awful, especially since I need to set the appropriate variable value before loading a buffer. Even if I wrote a custom Lua user command to update the variable &lt;code&gt;is_chicken&lt;/code&gt; and &lt;code&gt;is_chezscheme&lt;/code&gt;, I still need to find a way to activate the correct client with a user-defined command. Relying on file extension is unreliable, IMHO (e.g., what about &lt;code&gt;*.sls&lt;/code&gt; or &lt;code&gt;*.sps&lt;/code&gt; files in this case?).&lt;/p&gt;
&lt;p&gt;Anyway, I find Conjure quiet pleasant to use actually. It&amp;rsquo;s much like a real REPL, but you mostly get the &amp;ldquo;PL&amp;rdquo; since the primary output is a log buffer, also displayed in a pop window (aka HUD) which I disabled rigth away. You can still evaluate expressions in the log buffer. There&amp;rsquo;s no support for R and Stata, but I can still rely on my poor-man send-to-repl mappings (i.e., send current line or visual selection to a running terminal in a split window). I&amp;rsquo;ll see how it goes in the near future, stay tuned!&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Magazine • &lt;em&gt;Parade&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Scheme, language server &amp; Co.</title><link>https://aliquote.org/post/scheme-langserver/</link><pubDate>Mon, 03 Jun 2024 14:32:17 +0200</pubDate><guid>https://aliquote.org/post/scheme-langserver/</guid><description>&lt;p&gt;So far, my &lt;a href="https://aliquote.org/post/scheme-in-vim/"&gt;setup for Scheme&lt;/a&gt; was pretty simple, and it mostly targeted Chicken Scheme. Recently, I wanted to use Chez Scheme a bit more, and I was looking for a better UX in Neovim. I&amp;rsquo;ve tried to configure several REPL-like features for Scheme, including Jupyter kernels, swank or language servers. Only the later is really of importance to me since I already get REPL features from &lt;a href="https://github.com/kovisoft/slimv"&gt;slimv&lt;/a&gt;, albeit limited to MIT Scheme.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="https://codeberg.org/rgherdt/scheme-lsp-server"&gt;chicken-lsp-server&lt;/a&gt;: easy to install but doesn&amp;rsquo;t quite work&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/ecraven/r7rs-swank"&gt;r7rs-swank&lt;/a&gt;: I wasn&amp;rsquo;t able to get the Chicken or Chez swank servers to run (moreover, for Chicken, you have to install additional libraries, which are not compatible with Thunderchez naming convention for, e.g., SRFIs)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/ufo5260987423/scheme-langserver"&gt;scheme-langserver&lt;/a&gt;: didn&amp;rsquo;t work (I grabbed the run executable released on GitHub, but I also tried to compile all the stuff myself, which led me to try to install chez-exe, after which I gave up).&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/becls/swish-lint"&gt;swish-lint&lt;/a&gt;: it works smoothly although there&amp;rsquo;s no hover information&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I had to compile and install Chez Scheme v10 in order to compile swish and get ride of minor error message in the log file for swish-lint. But it didn&amp;rsquo;t help getting hover information to work with Chez. Note that compiling csv10 is just a matter of &lt;code&gt;configure &amp;amp;&amp;amp; make&lt;/code&gt; and you&amp;rsquo;re done in a few minutes with a working install; only &lt;code&gt;make test&lt;/code&gt; takes a lot of time.&lt;/p&gt;
&lt;p&gt;I am currently trying out &lt;a href="https://github.com/benlubas/molten-nvim"&gt;molten-nvim&lt;/a&gt; (without image support and other fancy settings) to evaluate code snippets for which I have associated Jupyter kernels. This mostly mimic my old &lt;a href="https://aliquote.org/post/jupyter-kernels-in-vim/"&gt;Magma setup&lt;/a&gt; that I abandoned in the meantime. It remains quite non-obtrusive, and I can still fire up a terminal with the appropriate shell (mostly R, Python and Stata) and get my poor-man REPL features (i.e., send current line or selection to the other split window) to work right away. Anyway, here&amp;rsquo;s the list of kernels I have on my HD:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;aliquote master? 1h21m9s +
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» jupyter kernelspec list
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Available kernels:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; clojupyter-0.4.325 /home/chl/.local/share/jupyter/kernels/clojupyter-0.4.325
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; common-lisp /home/chl/.local/share/jupyter/kernels/common-lisp
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ir /home/chl/.local/share/jupyter/kernels/ir
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; python3 /home/chl/.local/share/jupyter/kernels/python3
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; racket /home/chl/.local/share/jupyter/kernels/racket
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; stata /home/chl/.local/share/jupyter/kernels/stata
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; wolframlanguage14 /home/chl/.local/share/jupyter/kernels/wolframlanguage14
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And here are the settings I use in my &lt;code&gt;init.lua&lt;/code&gt; file:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lua" data-lang="lua"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;vim.g&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;molten_auto_open_output&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;vim.g&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;molten_auto_image_popup&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;-- vim.g.molten_output_win_style = &amp;#34;minimal&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;-- vim.g.molten_use_border_highlights = true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;-- vim.keymap.set(&amp;#34;n&amp;#34;, &amp;#34;&amp;lt;localleader&amp;gt;ss&amp;#34;, &amp;#34;:MoltenEvaluateOperator&amp;lt;CR&amp;gt;&amp;#34;, { silent = true })&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;vim.keymap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;n&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;ss&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;:MoltenEvaluateLine&amp;lt;CR&amp;gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;silent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;vim.keymap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;v&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;ss&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;:&amp;lt;C-u&amp;gt;MoltenEvaluateVisual&amp;lt;CR&amp;gt;gv&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;silent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And here is an example of Racket code evaluated using Molten (left) or in a terminal directly (right):&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2024-06-03-16-11-26.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2024-06-03-16-11-26.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2024-06-03-16-12-55.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2024-06-03-16-12-55.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;There&amp;rsquo;s not much support for Scheme languages in the existing Jupyter kernels, except for &lt;a href="https://github.com/joeltg/mit-scheme-kernel"&gt;MIT Scheme&lt;/a&gt;, &lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; but there&amp;rsquo;s one for Common Lisp which actually works. However, I should say that in this case slimv is way better. Slimv also supports Scheme and Clojure, although Racket support is pretty outdated. As for replacing MIT Scheme with Chez Scheme, no luck here.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; As I said above, r7rs-swank which looks promising isn&amp;rsquo;t working for me.&lt;/p&gt;
&lt;p&gt;The following screenshots show slimv and swish-lint working in combination on a Scheme file, providing a REPL and a handy shortcut to evaluate a defun, as well as auto-completion and linting.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2024-06-03-14-47-31.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2024-06-03-14-47-31.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2024-06-03-15-15-16.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2024-06-03-15-15-16.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Grateful Dead • &lt;em&gt;Loser&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;I haven&amp;rsquo;t tried &lt;a href="https://github.com/Calysto/calysto_scheme"&gt;Calysto Scheme&lt;/a&gt;, though.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;Also, note that by default Chez Scheme is installed as &lt;code&gt;scheme&lt;/code&gt; under &lt;code&gt;/usr/bin&lt;/code&gt;, and slimv expects MIT Scheme to be available under the same executable name. Using default settings work perfectly well since newer versions of MIT Scheme bundle a swank server. However I do not want to update alternatives for Scheme on Ubuntu once again, so I ended up overwriting the default Scheme implementation in my slimv copy.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in April</title><link>https://aliquote.org/post/micro-04-2024/</link><pubDate>Tue, 30 Apr 2024 21:56:33 +0200</pubDate><guid>https://aliquote.org/post/micro-04-2024/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2024-04-29&lt;/a&gt;: I just tried &lt;a href="https://musikcube.com/"&gt;musikcube&lt;/a&gt; as an alternative to cmus. The UI is really great, but I fear I will miss some cmus features, like having different views for albums and playlists, filters, and so on.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-04-29&lt;/a&gt;: &lt;a href="https://gagor.pro/2024/02/how-i-stopped-worrying-and-loved-makefiles/"&gt;How I stopped worrying and loved Makefiles&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-04-29&lt;/a&gt;: &lt;a href="https://huijzer.xyz/posts/roc-history/"&gt;The history of the ROC curve&lt;/a&gt;: Interesting read which highlights how it is worth double checking Wikipedia with historical records.&lt;br&gt;&lt;/p&gt;</description></item><item><title>Micro posting in March</title><link>https://aliquote.org/post/micro-03-2024/</link><pubDate>Thu, 04 Apr 2024 09:18:35 +0200</pubDate><guid>https://aliquote.org/post/micro-03-2024/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2024-03-18&lt;/a&gt;: &lt;a href="https://kobzol.github.io/rust/python/2023/05/20/writing-python-like-its-rust.html"&gt;Writing Python like it&amp;rsquo;s Rust&lt;/a&gt;. Or how to make use of Python types in a meaningful way.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-03-25&lt;/a&gt;: I have almost two years of backup data for my home directory, thanks to &lt;a href="https://aliquote.org/post/kopia"&gt;kopia&lt;/a&gt;. It works great, it runs smoothly and doesn&amp;rsquo;t harm the RAM or disk, and it wakes up nicely when the laptop returns from idle.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;chl@aliquote:/home/chl
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2022-10-31 21:00:37 CET k105eb1435351bfdfba85874cd06ebf75 14.9 GB drwxr-xr-x files:226411 dirs:45856 (monthly-18)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2022-11-30 22:00:39 CET k01dd605c67ca579cbec33fb5eb386648 15.5 GB drwxr-xr-x files:232391 dirs:46879 (monthly-17)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2022-12-31 23:00:38 CET k5a01672b76af59461061c3fe25003785 15.7 GB drwxr-xr-x files:234220 dirs:47516 (monthly-16,annual-3)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2023-01-31 21:00:13 CET kec7a24dd874b20376f160f1fe3e0acd8 15.4 GB drwxr-xr-x files:226071 dirs:45741 (monthly-15)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2023-02-28 21:00:08 CET kc707921ee53be6aa7ff2be4da99387c4 14.6 GB drwxr-xr-x files:228097 dirs:46041 (monthly-14)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;--%&amp;lt;-----------------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2024-03-25 08:12:51 CET k9cb5afcc7ce355e2b64c8f980ef6bb24 14.1 GB drwxr-xr-x files:218701 dirs:35849 (hourly-11)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2024-03-25 09:00:14 CET kdec17d1a1ed35833b0eed730c491ed87 14.1 GB drwxr-xr-x files:218716 dirs:35849 (latest-10,hourly-10)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2024-03-25 10:00:35 CET ka52066cb5588c88a7d259140e5c02683 14.1 GB drwxr-xr-x files:218702 dirs:35849 (latest-9,hourly-9)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2024-03-25 11:00:35 CET kd96a4c841b76c75e4b5b569594f9e87b 14.1 GB drwxr-xr-x files:218704 dirs:35849 (latest-8,hourly-8)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2024-03-25 12:00:35 CET k0ec385fbd40ce68a14250da3e4e72ac9 14.1 GB drwxr-xr-x files:218710 dirs:35849 (latest-7,hourly-7)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2024-03-25 13:00:35 CET k635fb4cf4fd0e3f4c45c58b7a14ed690 14.1 GB drwxr-xr-x files:218730 dirs:35850 (latest-6,hourly-6)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2024-03-25 14:00:35 CET k722ecc32f98028829e258d2582548281 14.1 GB drwxr-xr-x files:218741 dirs:35851 (latest-5,hourly-5)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2024-03-25 15:00:35 CET k87f64132d71b14eccbc7f5bb362b53aa 14.1 GB drwxr-xr-x files:218732 dirs:35851 (latest-4,hourly-4)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2024-03-25 18:07:22 CET k4af30387d39daf1dd1b3002dffde3543 14.1 GB drwxr-xr-x files:218733 dirs:35851 (latest-3,hourly-3)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2024-03-25 19:00:35 CET k66f7a97a2b50611e047524da6cc0e640 14.1 GB drwxr-xr-x files:218745 dirs:35851 (latest-2,hourly-2)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2024-03-25 20:26:20 CET kbd44c2958916a894deab100da949f302 14.1 GB drwxr-xr-x files:218745 dirs:35851 (latest-1,hourly-1,daily-1,weekly-1,monthly-1,annual-1)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-03-25&lt;/a&gt;: ♪ Flock of Dimes · Given/Electric Life&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-03-26&lt;/a&gt;: "When the underlying measurements are normally distributed, you can "convert" a range measurement into an estimate for the standard deviation" using the [D2 constant](https://blogs.sas.com/content/iml/2024/02/21/range-d2.html). As always, Rick Wicklin wrote a very interesting article for those involved in QC or dealing with small samples. See also [On using flexible distributions to fit data](https://blogs.sas.com/content/iml/2024/02/26/fit-flexible-distribution.html) for another interesting story.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-03-26&lt;/a&gt;: Lasagna were tasty last week!&lt;br&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/73297114772__B17ED8CD-BE6C-455B-8AB5-DDD2B3E842AC.JPG"&gt;
&lt;/figure&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-03-26&lt;/a&gt;: Some estimators provide reasonable estimates even when there are correlations among observations, but estimatesof uncertainties of estimates can be badly affected by correlations. --- [What Does a Statistical Method Assume?](https://fharrell.com/post/assume/).&lt;br&gt;</description></item><item><title>Micro posting in January</title><link>https://aliquote.org/post/micro-01-2024/</link><pubDate>Tue, 30 Jan 2024 08:03:15 +0100</pubDate><guid>https://aliquote.org/post/micro-01-2024/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2024-01-08&lt;/a&gt;: I still hold 14 draft posts in my inbox, but for now let&amp;rsquo;s start this fresh new year with some good vibes.&lt;/p&gt;
&lt;iframe style="border: 0; width: 100%; height: 120px;" src="https://bandcamp.com/EmbeddedPlayer/album=3988878580/size=large/bgcol=ffffff/linkcol=0687f5/tracklist=false/artwork=small/transparent=true/" seamless&gt;&lt;a href="https://adamwakeman.bandcamp.com/album/a-handful-of-memories"&gt;A Handful Of Memories de Adam Wakeman&lt;/a&gt;&lt;/iframe&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-01-08&lt;/a&gt;: It looks like this site renders properly on sixel-aware terminal with w3m (&lt;code&gt;w3m -sixel -o auto_image=TRUE https://aliquote.org&lt;/code&gt;):
&lt;p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2024-01-08-21-06-37.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2024-01-08-21-06-37.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2024-01-08-21-07-34.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2024-01-08-21-07-34.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-01-11&lt;/a&gt;: A simplified boxplot, with (much) fewer Stata commands than the one proposed in this &lt;a href="https://aliquote.org/post/stata-plot-02/"&gt;old post&lt;/a&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;sysuse&lt;/span&gt; &lt;span class="n"&gt;auto&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;graph&lt;/span&gt; &lt;span class="n"&gt;box&lt;/span&gt; &lt;span class="n"&gt;mpg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;over&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;foreign&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;box&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;white&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;///&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;medtype&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;marker&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;medmarker&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mcolor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;black&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;mlwidth&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;///&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cwhiskers&lt;/span&gt; &lt;span class="n"&gt;alsize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;lines&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lpattern&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;solid&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;lwidth&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;medium&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;///&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ylabel&lt;/span&gt;&lt;span class="p"&gt;(,&lt;/span&gt; &lt;span class="n"&gt;nogrid&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;yscale&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;noline&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;///&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;{bf}Box Plot&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;2.75&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;///&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;subtitle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;City Mileage over number of cylinders&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;graph&lt;/span&gt; &lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;home&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;chl&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;tmp&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;better&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;bxp&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;eps&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/better-bxp.png"&gt;
&lt;/figure&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-01-15&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;No, really, I’m astonished at how much software is basically useless without an internet connection. Net is no longer something additional to your daily tasks, it is essential for your daily tasks. &amp;mdash; &lt;a href="https://andreyor.st/posts/2023-12-26-weve-become-overdependent-on-the-net/"&gt;We&amp;rsquo;ve become overdependent on the net&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2024-01-15&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;What strikes me about my personal experience with LLMs is that I have learned precisely when to use them and when their use would only slow me down. I have also learned that LLMs are a bit like Wikipedia and all the video courses scattered on YouTube: they help those with the will, ability, and discipline, but they are of marginal benefit to those who have fallen behind. I fear that at least initially, they will only benefit those who already have an advantage. &amp;mdash; &lt;a href="http://antirez.com/news/140"&gt;LLMs and Programming in the first days of 2024&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2024-01-15&lt;/a&gt;: Wanna get a plain text list of your Pocket bookmarks? Go to getpocket.com/export, then apply the following snippet on the HTML result file:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cat YOURFILE.html &lt;span class="p"&gt;|&lt;/span&gt; grep -o &lt;span class="s1"&gt;&amp;#39;&amp;lt;a .*href=.*&amp;gt;&amp;#39;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; sed -e &lt;span class="s1"&gt;&amp;#39;s/&amp;lt;a /\n&amp;lt;a /g&amp;#39;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; sed -e &lt;span class="s1"&gt;&amp;#39;s/&amp;lt;a .*href=[&amp;#39;&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&amp;#39;&amp;#34;&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&amp;#34;]//&amp;#39;&lt;/span&gt; -e &lt;span class="s1"&gt;&amp;#39;s/[&amp;#34;&amp;#39;&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&amp;#39;&amp;#34;&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;].*$//&amp;#39;&lt;/span&gt; -e &lt;span class="s1"&gt;&amp;#39;/^$/ d&amp;#39;&lt;/span&gt; &amp;gt; pocket.txt
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-01-15&lt;/a&gt;: ♪ Jelly Cleaver · Black Line&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-01-16&lt;/a&gt;:
&lt;blockquote&gt;
&lt;p&gt;When optimising code, never guess, always measure. &amp;mdash; &lt;a href="https://www.solipsys.co.uk/new/WhenOptimisingCodeMeasure.html"&gt;When Optimising Code Measure&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2024-01-16&lt;/a&gt;: Lots of &lt;a href="https://www.verbeia.com/mathematica/tips/Tricks.html"&gt;tips and tricks&lt;/a&gt; for Mathematica aficionados.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-01-16&lt;/a&gt;: TIL about &lt;a href="https://asahilinux.org/"&gt;Asahi Linux&lt;/a&gt;. Looks cool, although Ubuntu LTS already runs fine on my Mac, but it&amp;rsquo;s an old one, not one of the newest cool kids made in Silicon.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-01-16&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_3539.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_3539.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_3558.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_3558.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-01-22&lt;/a&gt;: ♪ Kendra Morris · Dry&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-01-24&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;This difficulty is often not due to math - because of the aforementioned frameworks machine learning implementations do not require intense mathematics. An aspect of this difficulty involves building an intuition for what tool should be leveraged to solve a problem. This requires being aware of available algorithms and models and the trade-offs and constraints of each one. &amp;mdash; &lt;a href="https://ai.stanford.edu/~zayd/why-is-machine-learning-hard.html"&gt;Why is machine learning &amp;lsquo;hard&amp;rsquo;?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2024-01-24&lt;/a&gt;: I recently switch from MC 1.19.4 with Forge and Optifine to MC 1.20.4 with Iris and Sodium. Now I got a lot more mods available with less frictions overall. And it looks like we can now play MC on a laptop with texture packs and shaders all time long.It&amp;rsquo;s probably time to stop building on 1.19.4 I guess, and just start a new survival journey.&lt;br&gt;&lt;img src="https://aliquote.org/img/2024-01-07_16.04.39.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-01-24&lt;/a&gt;: TIL about &lt;a href="https://simonrepp.com/faircamp/"&gt;Faircamp&lt;/a&gt; which looks amazing.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-01-24&lt;/a&gt;: &lt;a href="https://xosc.org/timemachine.html?utm_source=pocket_saves"&gt;Time Machine like Backups on OpenBSD&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2024-01-25&lt;/a&gt;: ♪ Passenger · Summer Rain&lt;br&gt;&lt;/p&gt;</description></item><item><title>Managing Scheme libraries</title><link>https://aliquote.org/post/managing-scheme-libraries/</link><pubDate>Thu, 18 Jan 2024 20:42:11 +0100</pubDate><guid>https://aliquote.org/post/managing-scheme-libraries/</guid><description>&lt;p&gt;A quick note on the packaging system for some of the Scheme implementations I use. It is rather incomplete at this point, I will eventually update it later.&lt;/p&gt;
&lt;p&gt;Recently I&amp;rsquo;ve been looking at Chez Scheme documentation and various places on the intertubes to learn how to create or manage Scheme libraries. I&amp;rsquo;m used to Racket and Chicken, which both ship with a great package manager, something that is currently lacking in some of Scheme distros, especially Chez Scheme. Unlike Quicklisp, you don&amp;rsquo;t end up with every version of a single package once you update your package list, although I understand why it may be interesting to keep a copy of older packages, especially when they are linked to a working repository.&lt;/p&gt;
&lt;p&gt;With Chicken, we usually add repositories to the exported variable &lt;code&gt;CHICKEN_REPOSITORY_PATH&lt;/code&gt;. We can also check where system-wide is installed with &lt;code&gt;chicken-install -repository&lt;/code&gt;. User-compiled modules usually go under &lt;code&gt;$HOME/.cache/chicken-install&lt;/code&gt;, but I always install modules as root. Be sure to check the man page for &lt;code&gt;chicken-install&lt;/code&gt; in any case. Racket has its own conventions to &lt;a href="https://docs.racket-lang.org/guide/module-basics.html"&gt;manage modules&lt;/a&gt; (see also &lt;a href="https://beautifulracket.com/explainer/modules.html"&gt;Beautiful Racket&lt;/a&gt;); likewise, there are well-defined steps to create your &lt;a href="https://docs.racket-lang.org/pkg/getting-started.html"&gt;own package&lt;/a&gt; and make it available from Racket REPL or programs. There are some &lt;a href="https://github.com/jackfirth/racket-package-template"&gt;package&lt;/a&gt; &lt;a href="https://github.com/spdegabrielle/racket-package"&gt;templates&lt;/a&gt; for Racket, but see &lt;a href="https://blog.racket-lang.org/2017/10/tutorial-creating-a-package.html"&gt;Tutorial: Creating a Package&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;As regards Chez Scheme, it seems that the best way to define a local repository for your package is via an exported variable:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;[&lt;/span&gt; -d &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/.local/lib/scheme&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;CHEZSCHEMELIBDIRS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;/home/chl/.local/lib/scheme:&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We can check that everything is all right as follows:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt;»&lt;/span&gt; &lt;span class="nv"&gt;chezscheme&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;Chez&lt;/span&gt; &lt;span class="nv"&gt;Scheme&lt;/span&gt; &lt;span class="nv"&gt;Version&lt;/span&gt; &lt;span class="mf"&gt;9.5&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;Copyright&lt;/span&gt; &lt;span class="mi"&gt;1984-2020&lt;/span&gt; &lt;span class="nv"&gt;Cisco&lt;/span&gt; &lt;span class="nv"&gt;Systems,&lt;/span&gt; &lt;span class="nv"&gt;Inc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;library-directories&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;/home/chl/.local/lib/scheme&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;/home/chl/.local/lib/scheme&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;.&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;.&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;/usr/share/r6rs&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;/usr/share/r6rs&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I also heard of &lt;a href="https://akkuscm.org/"&gt;Akku&lt;/a&gt;, after reading one of &lt;a href="https://www.travishinkelman.com/getting-started-with-chez-scheme-and-emacs-ubuntu/"&gt;Travis Hinkelman&lt;/a&gt;&amp;rsquo;s posts, I even installed on my HD but I never used it.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Joy Divsion • &lt;em&gt;A Means to an End&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Book review: Mathematica (2)</title><link>https://aliquote.org/post/mathematica-book-review-2/</link><pubDate>Sun, 14 Jan 2024 19:53:37 +0100</pubDate><guid>https://aliquote.org/post/mathematica-book-review-2/</guid><description>&lt;p&gt;As a sequel of &lt;a href="https://aliquote.org/post/mathematica-book-review"&gt;this previous post&lt;/a&gt;, here are two other books on Mathematica that I read this year.&lt;/p&gt;
&lt;h3 id="an-engineers-guide-to-mathematica-magrad-2014"&gt;An Engineer&amp;rsquo;s Guide to Mathematica (Magrad, 2014)&lt;/h3&gt;
&lt;p&gt;This book is organized in two independent parts. Part 1 summarizes Mathematica syntax. It covers basic math expressions, but also strings and quantities, which were introduced as &lt;code&gt;Quantity&lt;/code&gt; in Mathematica 9. The author then describes how to manipulate lists and arrays, and how to define pure functions or custom modules. Symbolic and numerical mathematical applications are discussed in chapters 4 and 5, while the last two chapters deal with static and interactive graphics.&lt;/p&gt;
&lt;p&gt;Part 2 is about engineering applications, but I was only interested in chapter 9 which deals with statistics, specifically probability distribution &amp;ndash; and to estimate best-fitting distribution parameters, and linear and non-linear regression. Surprisingly, there&amp;rsquo;s even a section on factorial ANOVA&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2024-01-15-14-07-13.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2024-01-15-14-07-13.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2024-01-15-14-09-06.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2024-01-15-14-09-06.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Except for the first chapters, explanations are rather scarce and the author usually just shows sample instructions. It&amp;rsquo;s up to you to adapt the commands and options to your own problem. Good thing is that the author provides many summary tables of commands and/or options. Also, several exercises are proposed at the end of each chapter, which I find a great way to practice all the packed information. Solutions are available &lt;a href="https://www.wiley.com//legacy/wileychi/magrab/"&gt;on request&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="essentials-of-programming-in-mathematica-wellin-2016"&gt;Essentials of Programming in Mathematica (Wellin, 2016)&lt;/h3&gt;
&lt;p&gt;This book also features introductory chapters which I found more interesting since the author explains the how and why of each command. This is quite normal after all since the emphasis of this book is on programming rather than using dedicated functions for specific applications. I said this book is full of explanation and it also applies to small programs developed along the way, e.g., the sieve of Eratosthenes in chapter 6.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Once your code is written, your job as a programmer is not done. You must test your code under both &amp;ldquo;regular&amp;rdquo; and &amp;ldquo;abnormal&amp;rdquo; conditions, that is, using what you think is typical input and also testing the code when given pathological or atypical input. You should include tests for correctness and efficiency.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The chapter on visualization is also quite interesting since it describes some not so usual displays (dot plots, path plots). The last two chapters are especially useful if you&amp;rsquo;re a serious Mathematica developer, which I&amp;rsquo;m certainly not, and I found it particularly interesting as a complement to this already brilliant list of &lt;a href="https://mathematica.stackexchange.com/questions/18/where-can-i-find-examples-of-good-mathematica-programming-practice"&gt;Mathematica resources&lt;/a&gt;. At the moment, this is certainly the book I would recommend to learn the intrinsics of Mathematica and to develop efficiently with Mathematica notebooks (there&amp;rsquo;s no mention of Wolframscript).&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ The Jesus and Mary Chain • &lt;em&gt;Down On Me&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>How many permutations</title><link>https://aliquote.org/post/how-many-permutations/</link><pubDate>Thu, 11 Jan 2024 11:53:15 +0100</pubDate><guid>https://aliquote.org/post/how-many-permutations/</guid><description>&lt;p&gt;Usually, we would determine the number of permutations required to carry out a Monte Carlo permutation test based on the precision we wish to attain for the p-value. In fact, Stata provides a confidence interval for the estimated p-value when you use the &lt;a href="https://www.stata.com/manuals/rpermute.pdf"&gt;permute&lt;/a&gt; procedure. This confidence interval is based on a binomial proportion (this is what we are estimating after all). With the example discussed in a &lt;a href="https://aliquote.org/post/permutation-test-in-lisp/"&gt;previous post&lt;/a&gt;, converted as a &lt;a href="https://aliquote.org/pub/how-many-permutations.csv"&gt;tabular dataset&lt;/a&gt;, here is a sample run from Stata 13:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="n"&gt;insheet&lt;/span&gt; &lt;span class="n"&gt;using&lt;/span&gt; &lt;span class="n"&gt;how&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;many&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;permutations&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;csv&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="n"&gt;gen&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;_n&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="n"&gt;reshape&lt;/span&gt; &lt;span class="n"&gt;long&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="n"&gt;permute&lt;/span&gt; &lt;span class="n"&gt;_j&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mu_1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;reps&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10000&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="n"&gt;ttest&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;by&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_j&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="o"&gt;-%----&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Monte&lt;/span&gt; &lt;span class="n"&gt;Carlo&lt;/span&gt; &lt;span class="n"&gt;permutation&lt;/span&gt; &lt;span class="n"&gt;results&lt;/span&gt; &lt;span class="n"&gt;Number&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;obs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;command&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ttest&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;by&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_j&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;_pm_1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mu_1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;permute&lt;/span&gt; &lt;span class="k"&gt;var&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;_j&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;------------------------------------------------------------------------------&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;T&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;obs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="n"&gt;SE&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;95&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;Conf&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="n"&gt;Interval&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;-------------+----------------------------------------------------------------&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;_pm_1&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mf"&gt;14.48&lt;/span&gt; &lt;span class="mi"&gt;5229&lt;/span&gt; &lt;span class="mi"&gt;10000&lt;/span&gt; &lt;span class="mf"&gt;0.5229&lt;/span&gt; &lt;span class="mf"&gt;0.0050&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;513055&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;5327317&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;------------------------------------------------------------------------------&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Note&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Confidence&lt;/span&gt; &lt;span class="n"&gt;interval&lt;/span&gt; &lt;span class="n"&gt;is&lt;/span&gt; &lt;span class="n"&gt;with&lt;/span&gt; &lt;span class="n"&gt;respect&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Note&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="c1"&gt;#{|T| &amp;gt;= |T(obs)|}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note that we get a p-value close to the one estimated using Lisp or R. It is also possible to carry out an exact permutation test using the &lt;code&gt;enumerate&lt;/code&gt; option. Philip Good provides illustrations with various statistical software in chapter 3 of one of his textbook.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;The approximate 95% CI for a proportion estimated from a sample of size $n$ is&lt;/p&gt;
&lt;p&gt;$$ \hat p \pm 2\sqrt{\frac{\hat p(1-\hat p}{n}}, $$&lt;/p&gt;
&lt;p&gt;which can be approximated as $\hat p \pm \sqrt{\hat p/n}$ for small $\hat p$. As an example, to get a precision of two decimal places for a proportion of 0.01, we would need $n &amp;gt; 1600$ rearrangements ($0.01 &amp;gt; 4\sqrt{0.01/n}$, then solve for $n$). This is probably why the rule of thumb is to use 1000 to 10000 permutations, when not &amp;ldquo;use the maximum number of permutations&amp;rdquo;. Of course, this only applies to Monte Carlo re-rerandomization, since in the case of exact permutation tests you get the &amp;ldquo;exact&amp;rdquo; p-value you get, which is tied to your sample size. E.g., with five observations you only have 32 possibilities and 1 extreme observation out of 32 means a p-value of 0.03125.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;And here is yet another way to carry out a permutation test, although it is suboptimal (in many ways). This time, we will simply shuffle the whole sequence of observation and take the first half part of the sequence. Again, we will rely on a Monte Carlo approach and only carry out a limited number of random draws from the original sample. Last but not least, we will replace Scheme with Clojure.&lt;/p&gt;
&lt;p&gt;As before, we will consider the sum of the observations in one group (the original, then the randomized one) as our test statistic. Other solutions such as taking the difference in means or the detrended Student t statistic are also possible.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-clojure" data-lang="clojure"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;def &lt;/span&gt;&lt;span class="nv"&gt;xs&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;12.9&lt;/span&gt; &lt;span class="mf"&gt;13.5&lt;/span&gt; &lt;span class="mf"&gt;12.8&lt;/span&gt; &lt;span class="mf"&gt;15.6&lt;/span&gt; &lt;span class="mf"&gt;17.2&lt;/span&gt; &lt;span class="mf"&gt;19.2&lt;/span&gt; &lt;span class="mf"&gt;12.6&lt;/span&gt; &lt;span class="mf"&gt;15.3&lt;/span&gt; &lt;span class="mf"&gt;14.4&lt;/span&gt; &lt;span class="mf"&gt;11.3&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;def &lt;/span&gt;&lt;span class="nv"&gt;ys&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;12.7&lt;/span&gt; &lt;span class="mf"&gt;13.6&lt;/span&gt; &lt;span class="mf"&gt;12.0&lt;/span&gt; &lt;span class="mf"&gt;15.2&lt;/span&gt; &lt;span class="mf"&gt;16.8&lt;/span&gt; &lt;span class="mf"&gt;20.0&lt;/span&gt; &lt;span class="mf"&gt;12.0&lt;/span&gt; &lt;span class="mf"&gt;15.9&lt;/span&gt; &lt;span class="mf"&gt;16.0&lt;/span&gt; &lt;span class="mf"&gt;11.1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;def &lt;/span&gt;&lt;span class="nv"&gt;xy&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;concat &lt;/span&gt;&lt;span class="nv"&gt;xs&lt;/span&gt; &lt;span class="nv"&gt;ys&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;def &lt;/span&gt;&lt;span class="nv"&gt;stat0&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;apply + &lt;/span&gt;&lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;def &lt;/span&gt;&lt;span class="nv"&gt;k&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;defn &lt;/span&gt;&lt;span class="nv"&gt;stat&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;apply + &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;take &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;shuffle&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;def &lt;/span&gt;&lt;span class="nv"&gt;pdist&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;repeatedly&lt;/span&gt; &lt;span class="nv"&gt;k&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;partial &lt;/span&gt;&lt;span class="nv"&gt;stat&lt;/span&gt; &lt;span class="nv"&gt;xy&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;def &lt;/span&gt;&lt;span class="nv"&gt;events&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;count &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;filter &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;fn &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;&amp;gt; &lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="nv"&gt;stat0&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="nv"&gt;pdist&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;double &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;/ &lt;/span&gt;&lt;span class="nv"&gt;events&lt;/span&gt; &lt;span class="nv"&gt;k&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; 0.525&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Run time is quite decent in this case, even for large &lt;code&gt;k&lt;/code&gt;. Now let&amp;rsquo;s check the distribution of the permuted test statistic? Here&amp;rsquo;s one with 10000 iterations (p=0.5156) and the venerable Gnuplot backend.&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;set&lt;/span&gt; terminal png size 600, &lt;span class="m"&gt;300&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;set&lt;/span&gt; output &lt;span class="s2"&gt;&amp;#34;~/tmp/pdist.png&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;set&lt;/span&gt; xrange &lt;span class="o"&gt;[&lt;/span&gt;130:165&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;set&lt;/span&gt; yrange &lt;span class="o"&gt;[&lt;/span&gt;0:7&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;unset&lt;/span&gt; key
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;unset&lt;/span&gt; ytics
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;set&lt;/span&gt; arrow &lt;span class="m"&gt;1&lt;/span&gt; from 144.8,0 to 144.8,0.8 lc &lt;span class="s2"&gt;&amp;#34;orange&amp;#34;&lt;/span&gt; nohead
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;set&lt;/span&gt; label &lt;span class="s2"&gt;&amp;#34;Original test statistic&amp;#34;&lt;/span&gt; at 145,0.75 tc &lt;span class="s2"&gt;&amp;#34;orange&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;plot &lt;span class="s2"&gt;&amp;#34;pdist.dat&amp;#34;&lt;/span&gt; u 1:&lt;span class="o"&gt;(&lt;/span&gt;1/100.&lt;span class="o"&gt;)&lt;/span&gt; s kdens bandwidth &lt;span class="m"&gt;1&lt;/span&gt; lw &lt;span class="m"&gt;2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/pdist.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Overall, I was pleasantly surprised by how easy it was to perform this task in Clojure by using builtin stuff only.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Happy Mondays • &lt;em&gt;Olive Oil&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Phillip Good (2005) &lt;em&gt;Resampling Methods: A Practical Guide to Data Analysis&lt;/em&gt;, Boston: Birkhäuser&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;Another approach to devise the number of Monte Cralo experiments to run would be to consider the worst situation $p=0.5$, in which case we find that for $n=10000$ and $n=100000$ we get a standard deviation of 0.005 and 0.0016. Hence with $n=100000$, the most pessimistic 95% confidence interval on the $p$-value has width 0.0031 = 0.31%. See Olivier Thas, Comparing Distribution (Springer, 2010), § 7.1.2.3.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:3"&gt;
&lt;p&gt;Not sure how to properly export the lazy sequence into a text file, so I&amp;rsquo;ll be using &lt;code&gt;(spit &amp;quot;/home/chl/tmp/pdist.dat&amp;quot; (vec pdist))&lt;/code&gt; but I need to remove the enclosing bracket afterwards and replace space with carriage return to please Gnuplot. The final file is available &lt;a href="https://aliquote.org/pub/pdist.dat"&gt;here&lt;/a&gt;.&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Probabilistic approximations of Pi</title><link>https://aliquote.org/post/approximating-pi-probability/</link><pubDate>Wed, 10 Jan 2024 13:07:10 +0100</pubDate><guid>https://aliquote.org/post/approximating-pi-probability/</guid><description>&lt;p&gt;In his &lt;a href="https://www.gutenberg.org/ebooks/26839"&gt;&lt;em&gt;Mathematical Recreations and Essays&lt;/em&gt;&lt;/a&gt;, W.W. Rouse Ball mentions two ways to estimate the value of of $\pi$ to a few digit places &amp;ldquo;using probability.&amp;rdquo; I would say this is more of a frequentist estimation problem than a purely probabilistic method since it involves collecting experimental data.&lt;/p&gt;
&lt;p&gt;The first approach considers a number of equidistant parallel straight lines lying on a plane, distance apart $a$; if we drop a stick of length $l &amp;lt; a$ on to the plane, then the probability that it will fall so as to lie across one of the lines is $2l / \pi a$. This means we can estimate this quantity, and therefore $\pi$, by repeating this experiment a large number of times. For instance, $\pi = 3.1419$ was found with 1120 trials by Captain Fox in 1864.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;The second approach relies on prime numbers: If two numbers are written down at random, the probability that they will be prime to each other (i.e., &lt;a href="https://en.wikipedia.org/wiki/Coprime_integers"&gt;co-prime&lt;/a&gt;) is &lt;a href="https://math.stackexchange.com/questions/64498/probability-that-two-random-numbers-are-coprime-is-frac6-pi2"&gt;$6/\pi^2$&lt;/a&gt;. Here is a little simulation in Mathematica that considers the first 250 positive integers to mimic the author&amp;rsquo;s report of an experiment in which each of 50 students wrote down 5 pairs of numbers at random, where it was found that 154 of the pairs were found to consist of co-prime numbers:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;14&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Total&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Boole&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;CoprimeQ&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;250&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;250&lt;/span&gt;&lt;span class="p"&gt;}]],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;250&lt;/span&gt;&lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Out&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;14&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.608752&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;17&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Sqrt&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="err"&gt;%&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Out&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;17&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;3.12094&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Assuming you have enough RAM, we would get closer with a larger sample size:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;18&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Total&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Boole&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;CoprimeQ&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;10000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10000&lt;/span&gt;&lt;span class="p"&gt;}]],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;10000&lt;/span&gt;&lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Out&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;18&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.60795&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;19&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Sqrt&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="err"&gt;%&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Out&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;19&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;3.14153&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Finally, here is a plot of random co-prime numbers in the range $[3;100]$, as suggested in the help desk:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;randomCoprime&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;x_Integer&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;RandomChoice&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Pick&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Range&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;CoprimeQ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Range&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]]]];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ListPlot&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="nv"&gt;#&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;randomCoprime&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;#&lt;/span&gt;&lt;span class="p"&gt;]}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/@&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;RandomInteger&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/coprime-random.png"&gt;
&lt;/figure&gt;
&lt;p&gt;The above function could be used to draw random integer instead of the first consecutive integers used in the previous simulation.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Happy Apple • &lt;em&gt;Ella by Night&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;&lt;em&gt;Messenger of Mathematics&lt;/em&gt;, Cambridge, 1873, vol. ii, pp. 113, 114.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>lost + found 2023</title><link>https://aliquote.org/post/lost-found-2023/</link><pubDate>Mon, 08 Jan 2024 16:19:24 +0100</pubDate><guid>https://aliquote.org/post/lost-found-2023/</guid><description>&lt;h2 id="party-more-party-2023-12-12"&gt;Party More Party (2023-12-12)&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://bmcbioinformatics.biomedcentral.com/articles/10.1186/1471-2105-8-25"&gt;https://bmcbioinformatics.biomedcentral.com/articles/10.1186/1471-2105-8-25&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.zeileis.org/papers/Hothorn+Hornik+Zeileis-2006.pdf"&gt;https://www.zeileis.org/papers/Hothorn+Hornik+Zeileis-2006.pdf&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://rdrr.io/github/nicolas-robette/moreparty/man/fastcforest.html"&gt;https://rdrr.io/github/nicolas-robette/moreparty/man/fastcforest.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;But to my understanding rforest and fastcforest do not produce binary splits following the same procedure. While rforest chooses the feature and the value of the feature that minimizes the MSE in the resulting child nodes, fastcforest instead splits based on a statistical test to reject the null hypothesis of independence between the dependent variable and any of the features. Is that correct?&lt;/p&gt;
&lt;h2 id="bridge-sampling-2023-09-18"&gt;Bridge sampling (2023-09-18)&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.tandfonline.com/doi/full/10.1080/00031305.2018.1562983"&gt;https://www.tandfonline.com/doi/full/10.1080/00031305.2018.1562983&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://mvuorre.github.io/posts/2017-01-02-how-to-compare-two-groups-with-robust-bayesian-estimation-using-r-stan-and-brms/"&gt;https://mvuorre.github.io/posts/2017-01-02-how-to-compare-two-groups-with-robust-bayesian-estimation-using-r-stan-and-brms/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;R packages:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://cran.r-project.org/web/packages/bridgesampling/"&gt;https://cran.r-project.org/web/packages/bridgesampling/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://discourse.mc-stan.org/t/bayesian-t-test-using-pystan/25126"&gt;https://discourse.mc-stan.org/t/bayesian-t-test-using-pystan/25126&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="how-many-bootstrap-replicates-2023-09-04"&gt;How Many Bootstrap Replicates (2023-09-04)&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://pubmed.ncbi.nlm.nih.gov/20377449/"&gt;How many bootstrap replicates are necessary?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stats.stackexchange.com/questions/80025/required-number-of-permutations-for-a-permutation-based-p-value"&gt;https://stats.stackexchange.com/questions/80025/required-number-of-permutations-for-a-permutation-based-p-value&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.webpages.uidaho.edu/~stevel/565/lectures/4%20Bootstrap.pdf"&gt;https://www.webpages.uidaho.edu/~stevel/565/lectures/4%20Bootstrap.pdf&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The primary difference is that while bootstrap analyses typically seek to quantify the sampling distribution of some statistic computed from the data, permutation analyses typically seek to quantify the null distribution. That is, they seek to break whatever structure might be preset in a dataset, and quantify the kinds of patterns one expects to see by chance.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://stats.stackexchange.com/a/344694"&gt;https://stats.stackexchange.com/a/344694&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stats.stackexchange.com/a/610115"&gt;https://stats.stackexchange.com/a/610115&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Maarten Buis on Stata list, &lt;a href="https://www.statalist.org/forums/forum/general-stata-discussion/general/293546-bootstrap-number-of-replications"&gt;https://www.statalist.org/forums/forum/general-stata-discussion/general/293546-bootstrap-number-of-replications&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Stata&amp;rsquo;s &lt;code&gt;bssize&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Andrews, D. W. K. and M. Buchinsky. 2000. A three-step method for choosing the number of bootstrap
repetitions. Econometrica 68: 213-251.&lt;/li&gt;
&lt;li&gt;Poi, B. P. 2004. From the helpdesk: Some bootstrapping techniques. Stata Journal 4: 312-328&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="racket-and-its-sqlite-api-2023-02-18"&gt;Racket and its sqlite API (2023-02-18)&lt;/h2&gt;
&lt;p&gt;Everyone has its bindings for splite these days because, well, sqlite is great. There are two main packages for Racket that I know about: &lt;a href="https://docs.racket-lang.org/db/"&gt;db&lt;/a&gt; and &lt;a href="https://docs.racket-lang.org/sqlite-table/"&gt;sqlite-table&lt;/a&gt;.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Bauhaus • &lt;em&gt;Bela Lugosi&amp;rsquo;s Dead&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Algorithms for statistical computing</title><link>https://aliquote.org/post/algorithms-statistical-computing/</link><pubDate>Mon, 08 Jan 2024 12:44:33 +0100</pubDate><guid>https://aliquote.org/post/algorithms-statistical-computing/</guid><description>&lt;p&gt;Here are very short reviews of books I have read or reread over the years, in no particular order.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;Foundations of Statistical Algorithms&lt;/em&gt; (Weihs, Mersmann &amp;amp; Ligges, CRC Press 2014): I read this book three or four years ago, and I found it interesting although quite heavy on math. It includes a chapter on verification which is close to an experimental design of testing, as the authors said. Apart from one or two papers about Stata or SAS own verification routines and &lt;em&gt;Numerical Issues in Statistical Computing for the Social Scientist&lt;/em&gt;, by Altman, Gill and McDonald (Wiley, 2004) that I mentioned in &lt;a href="post/statistical-software-evaluation/"&gt;this post&lt;/a&gt;, there are few books dedicated to this topic, AFAICT. Here, the authors focus on Linear Least Squares Solvers and the use of &lt;a href="https://aliquote.org/post/condition-number"&gt;condition numbers&lt;/a&gt;. Interestingly, Partial Least Squares is mentioned on several occasions, both from an algorithmic perspective (chapter 5) and when dealing with model selection in multivariate regression settings. Convex problems like coordinate descent and gradient-based or Quasi-Newton methods are discussed at length in chapter 4.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;Algorithms for Data Science&lt;/em&gt; (Steele, Chandler &amp;amp; Reddy, Springer 2016): This is more a textbook about data analysis &lt;em&gt;per se&lt;/em&gt; rather than a summary of specialized algorithms for statistical computing, so I was a bit disappointed after a few chapters.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;Numerical Methods of Statistics&lt;/em&gt; (Monahan, 2nd ed. Cambridge University Press 2011): I studied most of &lt;a href="https://www4.stat.ncsu.edu/~monahan/nmos2/toc.html"&gt;R code&lt;/a&gt; (and I did some Fortran as well!) that comes along this textbook, and I learned a lot from the extended discussion and exercises. I long considered it the Numerical Recipes (in R) of statistics.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;Elements of Statistical Computing&lt;/em&gt; (Thisted, Chapman and Hall 1988): One of the first textbook I used to teach statistical computing using R. Although it is a bit dated, it remains very relevant for most tasks at hand, and it features several algorithms that help sharpen our understanding of common implementation of, e.g., least-squares, bracketing methods in non-linear models, QR and SVD decomposition, or density estimators and smoothers.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;Computational Statistics&lt;/em&gt; (Givens &amp;amp; Hoeting, Wiley 2nd ed. 2013): This is the book I read after the one written by Thisted. I seem to remember coming across it after seeing one of Chris Fonnesbeck or Radford Neale&amp;rsquo;s (or both, maybe) course outline. It features many additional topics: markov chains, genetic algorithms and more generally dynamic programming, a full chapter on the bootstrap, and several sections on multivariate methods. Overall, it is more geared toward optimization and bayesian inference. &lt;a href="https://www.stat.colostate.edu/computationalstatistics/"&gt;R code&lt;/a&gt; is available for this 2nd edition.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;Computational Statistics&lt;/em&gt; (Gentle, Springer 2009): Christian Robert already wrote a &lt;a href="https://www.ceremade.dauphine.fr/~xian/Gentle.pdf"&gt;review&lt;/a&gt; of this textbook. I have read several book written by Gentle, but this one remains my reference when both numerical computing and computational statistics are of interest.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ The John Butler Trio • &lt;em&gt;Life Ain&amp;rsquo;t What It Seems&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in December</title><link>https://aliquote.org/post/micro-12-2023/</link><pubDate>Sat, 30 Dec 2023 09:50:15 +0100</pubDate><guid>https://aliquote.org/post/micro-12-2023/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-12-06&lt;/a&gt;: A good explanation of &lt;a href="https://www.cameronmacleod.com/blog/how-does-shazam-work"&gt;how Shazam work&lt;/a&gt; in practice, and an &lt;a href="https://github.com/notexactlyawe/abracadabra"&gt;implementation&lt;/a&gt; in Python.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-12-06&lt;/a&gt;: &lt;a href="https://jjtech.dev/reverse-engineering/imessage-explained/"&gt;iMessage, explained&lt;/a&gt;: When you learn what &lt;code&gt;com.apple.madrid&lt;/code&gt; does on your machine, and all the other goodies Apple put into their APNs.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-12-11&lt;/a&gt;: ♪ Jelly Cleaver · Black Line&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-12-12&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;To choose an implementation is to choose a tribe. Since Scheme is so minimal, you begin to rely on extensions that are only present in your implementation, and so through code you bind yourself to a world of code, people, and practice, loosely bound to the rest of the Scheme world through a fictional first-person-plural. This is OK! Going deep into a relationship with an implementation is the only way to do great work. The looser ties to the rest of the Scheme world in the form of the standards, the literature, the IRC channel, and the mailing lists provide refreshing conversation among fellow travellers, not marching orders for a phalanx. &amp;mdash; &lt;a href="https://wingolog.org/archives/2013/01/07/an-opinionated-guide-to-scheme-implementations"&gt;an opinionated guide to scheme implementations&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-12-13&lt;/a&gt;: Just when I was about to try out boosting and bagging in Stata (&lt;a href="https://ideas.repec.org/c/boc/bocode/s458614.html"&gt;rforest&lt;/a&gt; and &lt;a href="https://journals.sagepub.com/doi/pdf/10.1177/1536867X0500500304"&gt;boost&lt;/a&gt;), I realized that most programs now require Stata 15 or newer. Even Lasso penalization has been integrated in the core modeling facilities starting with Stata 18. At least, I can still run &lt;a href="https://statalasso.github.io/"&gt;lassopack&lt;/a&gt; to perform L1, L2 regularization or a combination thereof. They use the same convention as in glmnet, where the parameter $\alpha$ stands for the elasticnet mixing parameter ($\alpha=0$ corresponds to the ridge penalty while $\alpha=1$ is the lasso penalty). The authors compared Stata builtin and R regularized estimation, which is great: &lt;a href="https://statalasso.github.io/docs/lassopack/lasso2_replication/"&gt;Replication of glmnet and StataCorp’s lasso&lt;/a&gt;. See also &lt;a href="https://blog.stata.com/2019/09/09/an-introduction-to-the-lasso-in-stata/"&gt;An introduction to the lasso in Stata&lt;/a&gt; on the Stata blog. &lt;code&gt;#stata&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-12-13&lt;/a&gt;: Micro-posting goes well as far as I can tell.&lt;img src="https://aliquote.org/img/cal-heatmap-2023.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-12-18&lt;/a&gt;: TIL that you can use xeyes to check if an app is running under &lt;a href="https://medium.com/@bugaevc/how-to-easily-determine-if-an-app-runs-on-xwayland-or-on-wayland-natively-8191b506ab9a"&gt;Wayland or XWayland&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;</description></item><item><title>Permutation test in Lisp</title><link>https://aliquote.org/post/permutation-test-in-lisp/</link><pubDate>Fri, 22 Dec 2023 09:26:56 +0100</pubDate><guid>https://aliquote.org/post/permutation-test-in-lisp/</guid><description>&lt;p&gt;I drafted this post in March, along &lt;a href="https://aliquote.org/post/wilcoxon-test-in-lisp/"&gt;Wilcoxon test in Lisp&lt;/a&gt;, then forgot about it. How about using a permutation test? Since I ran out of time with implementing a proper version in Common Lisp, and get bored of Hollander &amp;amp; Wolfe&amp;rsquo;s dataset, let&amp;rsquo;s look at this quick &lt;a href="https://stats.stackexchange.com/a/43967"&gt;one-liner&lt;/a&gt; in R.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="nv"&gt;xs&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;12.9&lt;/span&gt; &lt;span class="mf"&gt;13.5&lt;/span&gt; &lt;span class="mf"&gt;12.8&lt;/span&gt; &lt;span class="mf"&gt;15.6&lt;/span&gt; &lt;span class="mf"&gt;17.2&lt;/span&gt; &lt;span class="mf"&gt;19.2&lt;/span&gt; &lt;span class="mf"&gt;12.6&lt;/span&gt; &lt;span class="mf"&gt;15.3&lt;/span&gt; &lt;span class="mf"&gt;14.4&lt;/span&gt; &lt;span class="mf"&gt;11.3&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="nv"&gt;ys&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;12.7&lt;/span&gt; &lt;span class="mf"&gt;13.6&lt;/span&gt; &lt;span class="mf"&gt;12.0&lt;/span&gt; &lt;span class="mf"&gt;15.2&lt;/span&gt; &lt;span class="mf"&gt;16.8&lt;/span&gt; &lt;span class="mf"&gt;20.0&lt;/span&gt; &lt;span class="mf"&gt;12.0&lt;/span&gt; &lt;span class="mf"&gt;15.9&lt;/span&gt; &lt;span class="mf"&gt;16.0&lt;/span&gt; &lt;span class="mf"&gt;11.1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;From there on, we need a way to generate all pairwise differences for permuted sequences. Although it is tempting to implement a procedure to permute a list of numbers,&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; and take the first half of the sequence as the first (resampled) sample, we can equivalently generate all combinations of k elements chosen among n ones.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; My own implementation in R is shown in &lt;a href="https://aliquote.org/post/bootstrap-test"&gt;another post&lt;/a&gt;. Note that I use the unstandardized difference in means, not the test statistic typically computed from a t-test or its non-parametric alternative.&lt;/p&gt;
&lt;p&gt;Now, let&amp;rsquo;s do this in Scheme:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;combn&lt;/span&gt; &lt;span class="nv"&gt;k&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;cond &lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nb"&gt;= &lt;/span&gt;&lt;span class="nv"&gt;k&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(()))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nb"&gt;null? &lt;/span&gt;&lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;else &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;append &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;map &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cons &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;car &lt;/span&gt;&lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;combn&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;- &lt;/span&gt;&lt;span class="nv"&gt;k&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cdr &lt;/span&gt;&lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;combn&lt;/span&gt; &lt;span class="nv"&gt;k&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cdr &lt;/span&gt;&lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;))))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We could mimic the R code above by computing the difference in means between each combination and its complement (i.e. the element of &lt;code&gt;xs&lt;/code&gt; or &lt;code&gt;ys&lt;/code&gt; not already present in the combination), but let&amp;rsquo;s simplify the problem a bit: the two samples are of equal size, hence the sum provides the same amount of information as the mean. Furthermore, we only need to compute one of the two sums since the other one can be deduced from the grand sum. Hence the sum of the permuted sequence is a sufficient statistic. Let&amp;rsquo;s test the above code by computing the sum of each sub-lists formed using 9 elements taken in &lt;code&gt;xy&lt;/code&gt;, which results from the concatenation of &lt;code&gt;x&lt;/code&gt; and &lt;code&gt;ys&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="nv"&gt;xy&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;append &lt;/span&gt;&lt;span class="nv"&gt;xs&lt;/span&gt; &lt;span class="nv"&gt;ys&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;map &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;apply &lt;/span&gt;&lt;span class="nv"&gt;+&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;combn&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;length &lt;/span&gt;&lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;xy&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; (144.8 146.2 147.1 ...&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The original value is &lt;code&gt;(apply + xs)&lt;/code&gt;, and it will be our reference to compute the proportion of values that are at least more extreme on the distribution of permuted test statistics. The answer only requires to modify the previous code a little bit:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="nv"&gt;pdist&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;combn&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;length &lt;/span&gt;&lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;xy&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="nv"&gt;stat&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;apply &lt;/span&gt;&lt;span class="nv"&gt;+&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="nv"&gt;pos&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;map &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;cond &lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nb"&gt;&amp;gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;apply &lt;/span&gt;&lt;span class="nv"&gt;+&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;stat&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;else &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="nv"&gt;pdist&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;exact-&amp;gt;inexact &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;/ &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;foldr&lt;/span&gt; &lt;span class="nv"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="nv"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;length &lt;/span&gt;&lt;span class="nv"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; 0.514332416809197&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;small&gt;&lt;code&gt;(apply + pos)&lt;/code&gt; yields a stack overflow in this case, hence the use of right folding. Using a similar approach, I got 0.5210061 from R.&lt;/small&gt;&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Alina Bzhezhinska &amp;amp; Hip Harp Collective • &lt;em&gt;Meditation&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Regarding permutation in Scheme, I would recommend using algorithm from Shmuel Zaks, &lt;a href="https://link.springer.com/article/10.1007/BF01937486"&gt;A new algorithm for generation of permutations&lt;/a&gt; (Technical Report 220, Technion-Israel Institute of Technology, 1981), from Programming Praxis prelude (originally &lt;a href="https://programmingpraxis.com/contents/standard-prelude/#comment-2790"&gt;written in Scheme&lt;/a&gt;). It works well for small n, but not that well when n=20 (because of heap size limit). Should you rather prefer using Lisp, you certainly want to use &lt;code&gt;flet&lt;/code&gt;, &lt;code&gt;zerop&lt;/code&gt;, and &lt;code&gt;nthcdr&lt;/code&gt; in place of local &lt;code&gt;define&lt;/code&gt;, &lt;code&gt;zero?&lt;/code&gt; and &lt;code&gt;list-tail&lt;/code&gt; (and maybe some other substitutes that I have overlooked).&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;See also Combinations from a Set in &lt;a href="https://people.eecs.berkeley.edu/~bh/ssch1/showing.html"&gt;Chapter 1&lt;/a&gt; of &lt;em&gt;Simply Scheme&lt;/em&gt;.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Using R from Mathematica</title><link>https://aliquote.org/post/using-r-from-mathematica/</link><pubDate>Thu, 21 Dec 2023 18:10:31 +0100</pubDate><guid>https://aliquote.org/post/using-r-from-mathematica/</guid><description>&lt;p&gt;Just a quick note for myself, since I don&amp;rsquo;t use that often but I may forget it once again (like I did before). The R connector, RLink, was introduced in Mathematica v9, if I remember correctly, it was sometimes a pain in the ass to use it properly, but now things seem to go smoothly once you get the right setup, although you may get some occasional crashed which require that you perform the install step again (this is just the first instruction below).&lt;/p&gt;
&lt;p&gt;Working environment: Ubuntu 22.04 LTS, R 4.3.2, Mathematica 13.3.&lt;/p&gt;
&lt;p&gt;First, we need to ensure that RLink is actually working (you&amp;rsquo;ll likely need to install rJava from R, which is a required step to get a working Java link):&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;59&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;InstallR&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;RHomeLocation&amp;#34;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;/usr/lib/R&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If everything went fine, you can check which version of R was linked to the active session:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;REvaluate&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;R.version.string&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Out&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;R version 4.3.2 (2023-10-31)&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then, in order to pass &lt;a href="https://reference.wolfram.com/language/RLink/tutorial/DataTypes.html"&gt;data structure&lt;/a&gt; from Mathematica to R, we need to use &lt;code&gt;RSet&lt;/code&gt; and pass both the Mathematica object and an internal name that will be recognized when subsequently evaluating R code.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; We can then use &lt;code&gt;REvaluate&lt;/code&gt; or type &lt;code&gt;&amp;gt;&lt;/code&gt; at the prompt to get an evaluation cell targeting Julia, Python, Octave, R, and many other DSLs.&lt;/p&gt;
&lt;p&gt;Here is a working example where we use bootstrap resampling and distribution fitting using Mathematica builtins and R&amp;rsquo;s venerable &lt;code&gt;fitdistr&lt;/code&gt; from the MASS package.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;53&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mf"&gt;7.05&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;2.49&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;16.09&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;21.3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;19.21&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;14.88&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;16.41&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;0.19&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;9.71&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;10.18&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;8.81&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;2.93&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;18.11&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;22.2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;9.79&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;14.74&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;4.54&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;16.76&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;8.46&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;24.9&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Skewness&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Out&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;54&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;-0.0333154&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;skews&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;Table&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Skewness&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;RandomChoice&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;Length&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;]]],{&lt;/span&gt;&lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;}];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;44&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;StandardDeviation&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;skews&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Out&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;44&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.333235&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The histogram for the sampling distribution of the skewness (1000 bootstrap samples) is shown on the left, together with the best fitting gaussian PDF:&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/histogram_skews_mma.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/histogram_skews_mma.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/histogram_skews_r.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/histogram_skews_r.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The density estimator was obtained as follows:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;dist&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;EstimatedDistribution&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;skews&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;NormalDistribution&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;mu&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;sigma&lt;/span&gt;&lt;span class="p"&gt;]];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Show&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Histogram&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;skews&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Automatic&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;PDF&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Plot&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;PDF&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;dist&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;-2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;PlotStyle&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;Orange&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We can also use &lt;code&gt;FindDistributionParameters&lt;/code&gt; to find the MLE assuming a gaussian distribution; moreover, we could rely on &lt;a href="https://reference.wolfram.com/language/howto/PerformABootstrapAnalysis.html"&gt;bootstrap&lt;/a&gt; to perform the same estimation.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;67&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;FindDistributionParameters&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;skews&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;NormalDistribution&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Alpha&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Beta&lt;/span&gt;&lt;span class="p"&gt;]]]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Out&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;67&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Alpha&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="mf"&gt;-0.0460534&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Beta&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="mf"&gt;0.333068&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now let&amp;rsquo;s estimate the parameters of the normal distribution from the data using R:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;73&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;RSet&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;skews&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;skews&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;74&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;fit&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;MASS&lt;/span&gt;&lt;span class="err"&gt;::&lt;/span&gt;&lt;span class="n"&gt;fitdistr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;skews&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;normal&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Out&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;74&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;RObject&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="n"&gt;RObject&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="mf"&gt;-0.0460534&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;0.333068&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="n"&gt;RAttributes&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;names&lt;/span&gt;&lt;span class="o"&gt;:&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;sd&lt;/span&gt;&lt;span class="p"&gt;}]],&lt;/span&gt;&lt;span class="n"&gt;RObject&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="mf"&gt;0.0105325&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;0.00744763&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="n"&gt;RAttributes&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;names&lt;/span&gt;&lt;span class="o"&gt;:&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;sd&lt;/span&gt;&lt;span class="p"&gt;}]],&lt;/span&gt;&lt;span class="n"&gt;RObject&lt;/span&gt;&lt;span class="p"&gt;[{{&lt;/span&gt;&lt;span class="mf"&gt;0.000110934&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;0.&lt;/span&gt;&lt;span class="p"&gt;},{&lt;/span&gt;&lt;span class="mf"&gt;0.&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;0.0000554671&lt;/span&gt;&lt;span class="p"&gt;}},&lt;/span&gt;&lt;span class="n"&gt;RAttributes&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;dimnames&lt;/span&gt;&lt;span class="o"&gt;:&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="n"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;sd&lt;/span&gt;&lt;span class="p"&gt;},{&lt;/span&gt;&lt;span class="n"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;sd&lt;/span&gt;&lt;span class="p"&gt;}}]],{&lt;/span&gt;&lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;},{&lt;/span&gt;&lt;span class="mf"&gt;-319.53&lt;/span&gt;&lt;span class="p"&gt;}},&lt;/span&gt;&lt;span class="n"&gt;RAttributes&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;names&lt;/span&gt;&lt;span class="o"&gt;:&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;estimate&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;sd&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;vcov&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;loglik&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="o"&gt;:&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;fitdistr&lt;/span&gt;&lt;span class="p"&gt;}]]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;78&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;sd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;skews&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Out&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;78&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mf"&gt;0.333235&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;There are some convenient functions to get a prettier display of the results, but let&amp;rsquo;s note that with R the mean and standard deviation are estimated as -0.0460534 and 0.333068, which comparable to the values estimated by Mathematica. Since Rlink is systematically crashing with ggplot2, I will resort on lattice to display an histogram of the data together with a density plot.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;110&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;REvaluate&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;library(lattice)&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Out&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;110&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;lattice&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;stats&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;graphics&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;grDevices&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;utils&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;datasets&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;methods&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;base&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;112&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;histogram&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="err"&gt;~&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;skews&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="err"&gt;.&lt;/span&gt;&lt;span class="n"&gt;frame&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;skews&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;density&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;panel&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;panel&lt;/span&gt;&lt;span class="err"&gt;.&lt;/span&gt;&lt;span class="n"&gt;histogram&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;col&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;lightblue&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;panel&lt;/span&gt;&lt;span class="err"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mathdensity&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dmath&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;dnorm&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mean&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;-0.0460534&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;sd&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;0.333068&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;col&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;black&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;lwd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}))&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The result is shown in the right panel of the above figure.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Antony &amp;amp; The Johnsons • &lt;em&gt;Bird Guhl&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;See &lt;a href="http://szhorvat.net/pelican/setting-up-rlink-for-mathematica.html"&gt;this old post&lt;/a&gt; to learn more about the installation process.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;There were more &lt;a href="https://mathematica.stackexchange.com/questions/22942/using-non-trivial-objects-in-rlink"&gt;convoluted ways&lt;/a&gt; to get the job done apparently.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>The unquantified self #31</title><link>https://aliquote.org/post/unquantified-self-031/</link><pubDate>Mon, 18 Dec 2023 20:34:48 +0100</pubDate><guid>https://aliquote.org/post/unquantified-self-031/</guid><description>&lt;p&gt;Public holidays are coming, four days left. I&amp;rsquo;m listening to my music with Cmus, and I&amp;rsquo;m still happy with my full blown TUI environment. That being said, I installed G4Music from Flathub since I was too lazy to recompile it myself, like I did &lt;a href="https://aliquote.org/post/g4music"&gt;before&lt;/a&gt;. I came to eventually appreciate having graphical app running as containers on Ubuntu. Something like Fedora Silverblue, but without Fedora, and not even blue. Next time I install a Linux distro like Ubuntu, I will try to use only Flatpack apps for everything graphical, and compile from scratch the latest version of TUI apps I use the most (neovim, tmux, cmus, irssi, newsboat), for some of them were already seriously outdated at the time I installed them from Ubuntu official depositories. For instance, my neomutt is v20211029.&lt;/p&gt;
&lt;p&gt;I made some drawings lately. Ink or charcoal, depending on my mood. I often shoot them using my iPhone, to keep a digital copy and because I often like them better this way. Yesterday, I arranged some of them in a booklet, which will make for a quick and dirty gift for a friend of mine, although I know she will like it.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_3366.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_3366.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_3368.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_3368.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_3367.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_3367.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;I&amp;rsquo;m past my schedule for posting on this blog, partly because I was quite busy at work, and also busy at home cooking or playing Minecraft. We&amp;rsquo;ve made a lot of progress: most of the buildings are now fitted out, terraforming has gained momentum in the past weeks and we&amp;rsquo;re still fine-tuning the details in many places of the map. I don&amp;rsquo;t plan to build other big stuff, except the castle/monastery and 2 or 3 supplementary farmhouses. I will probably make a screencast to showcase everything I built during the last 5 months.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2023-12-14_21.12.47.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Finally, I&amp;rsquo;m quite happy with how reading went for the second half of the year since I read about 60 books (out of 85). This does not include technical books. It keeps me in line with previous years, and above all it allows me to disconnect a little. The same applies to drawing and writing, of course.&lt;/p&gt;
&lt;p&gt;I was finally able to repair my vinyl turntable after buying a stylus. It took me a while and I had to wait with internet radio (&lt;a href="https://www.abc-lounge.com/radio/"&gt;ABC Lounge&lt;/a&gt; is quite good actually), my MP3s and bandcamp in the meantime.&lt;/p&gt;
&lt;iframe style="border: 0; width: 100%; height: 120px;" src="https://bandcamp.com/EmbeddedPlayer/album=1098942231/size=large/bgcol=ffffff/linkcol=0687f5/tracklist=false/artwork=small/track=4255534408/transparent=true/" seamless&gt;&lt;a href="https://isobelcampbell.bandcamp.com/album/there-is-no-other"&gt;There Is No Other... de Isobel Campbell&lt;/a&gt;&lt;/iframe&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Alan Pasqua • &lt;em&gt;A Sleeping Child&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Stata: A retrospective</title><link>https://aliquote.org/post/stata-retrospective/</link><pubDate>Tue, 05 Dec 2023 20:46:57 +0100</pubDate><guid>https://aliquote.org/post/stata-retrospective/</guid><description>&lt;p&gt;I&amp;rsquo;m afraid I haven&amp;rsquo;t made much progress on my &lt;a href="https://aliquote.org/articles/stata-sk/"&gt;Stata Starter Kit&lt;/a&gt; since I started the original draft. Partly because I&amp;rsquo;m busy with other interests, partly because I don&amp;rsquo;t use Stata that much these days (and my paid licence is for Stata 13 MP), and because I give a lot of projects along the way, almost surely as they use to say in mathematical statistics. My bad! So I thought I would write down some notes I took when studying the history of Stata, a few years ago. I warmly recommend reading the proper retrospectives published in the Stata Journal, see below (there are other interesting special volumes, IIRC). Interestingly, I&amp;rsquo;ve done most of my professional statistical analyses using statistical packages that provide scripting facilities (and not menu-driven interaction), mostly R (90%) and Stata (10%). While I used Stata for real work (I mean, from data cleansing/management to statistical modelling) late, I always kept an eye on data analysis &lt;em&gt;using&lt;/em&gt; Stata and I learned a lot from the great collection of books published by Stata Press.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/IMG_3355.JPG"&gt;
&lt;/figure&gt;
&lt;p&gt;Stata is almost &lt;a href="https://www.stata.com/support/faqs/resources/history-of-stata/"&gt;40 years old&lt;/a&gt;. The latest stable release (v18) was released on April 25, 2023. Stata is written in C, but users can access the source code of commands/programs using viewsource. Pre-compiled code cannot be accessed, though. The article &lt;a href="https://www.stata-journal.com/article.html?article=pr0001"&gt;Statistical software certification&lt;/a&gt; describes the process of certification adopted by StataCorp. &lt;a href="https://www.stata.com/bookstore/thirty-years-with-stata/"&gt;Thirty Years with Stata: A Retrospective&lt;/a&gt; is a good read, as well as &lt;a href="https://www.stata-journal.com/sj5-1.html"&gt;volume 5(1)&lt;/a&gt; of the Stata Journal which celebrated the 20 years of Stata. Needless to say, Stata comes with extensive documentation. There are 23 manuals bundled with Stata v13, totalling 11365 pages.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;Of course there are the &lt;a href="https://www.stata.com/manuals13/u27.pdf"&gt;41 commands&lt;/a&gt; that every Stata user should know (as of Stata v13), but there are also those 42 commands, originally found in Stata v1.0:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;append dir infile plot spool beep do input query summarize by drop label
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;regress tabulate capture erase list rename test confirm exit macro
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;replace type convert expand merge run use correlate format modify save
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;count generate more set describe help outfile sort
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As can be inferred, the above commands are mostly concerned with data management for rectangular datasets and regression.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The first version of Stata was a regression package and really nothing more than that. It did a little bit in the way of calculations, and it did some summary statistics, but it was all built around a regression engine. It was written over a one-year period by me initially and by Sean Becketti, who helped me later. I wrote the C code; Sean Becketti helped me a lot with the design. I would say that half of the design is mine and half the design is Sean’s in terms of what the user actually saw. A number of things became available just at that time when we started this project, and it was those things that actually caused the project to start. The first C compiler was available for the PC.
&amp;mdash; William Gould (A conversation with William Gould, in &lt;em&gt;Thirty Years with Stata: A Retrospective&lt;/em&gt;, Enrique Pinzon (ed.), Stata Press 2015)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The plotting system has been entirely reworked starting with Stata v2.0 but you can still get good ol&amp;rsquo; looking inline plot, e.g.:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;. sysuse auto
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;(1978 Automobile Data)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;. plot mpg weight
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 41 +
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; | *
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; |
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; |
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; M |
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; i | **
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; l | *
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; e |
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; a | *
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; g | * *
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; e | * *
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; | * * *
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ( | ** * *
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; m | * * * * **
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; p | ** * **
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; g | * * * * ** * *
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ) | ** ***
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; | * * * * ** * ****
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; | * * * *
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; | * * ** *** *
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 12 + * *
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; +----------------------------------------------------------------+
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 1760 Weight (lbs.) 4840
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Most commands are still available, except &lt;code&gt;modify&lt;/code&gt; which has been superseded by &lt;code&gt;replace&lt;/code&gt;, while &lt;code&gt;spool&lt;/code&gt;, &lt;code&gt;beep&lt;/code&gt; and &lt;code&gt;convert&lt;/code&gt; have simply been deleted.&lt;/p&gt;
&lt;p&gt;I started rewritting part of the above Stata system in Scheme,&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; and my hope is to provide a Racket &lt;code&gt;#lang stata&lt;/code&gt; one day. One day&amp;hellip;&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Nirvana • &lt;em&gt;Breed&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;On Linux you can run, e.g., &lt;code&gt;for i in /usr/local/stata/docs/*.pdf; \ do pdfinfo &amp;quot;$i&amp;quot; | grep &amp;quot;^Pages:&amp;quot;; done | awk '{s+=$2} END {print s}'&lt;/code&gt;&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;I always considered Stata as primarily column-based even if it&amp;rsquo;s written in C and not in Fortran (at least, it&amp;rsquo;s way easier and way more common to use the &lt;code&gt;if&lt;/code&gt; than the &lt;code&gt;in&lt;/code&gt; statement), which is a perfect fit for list/vector processing. Sean Becketti talks about how useful such a &amp;ldquo;data rectangle&amp;rdquo; was back at the time in &lt;a href="https://www.stata.com/bookstore/thirty-years-with-stata/"&gt;Thirty Years with Stata: A Retrospective&lt;/a&gt;.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>ArXiving on November 2023</title><link>https://aliquote.org/post/arxiv-15/</link><pubDate>Thu, 30 Nov 2023 12:24:09 +0200</pubDate><guid>https://aliquote.org/post/arxiv-15/</guid><description>&lt;h3 id="the-41-model-of-data-science-"&gt;The 4+1 Model of Data Science (&lt;a href="https://arxiv.org/abs/2311.07631"&gt;https://arxiv.org/abs/2311.07631&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;I&amp;rsquo;m still not a big fan of the term &lt;a href="https://aliquote.org/post/50-years-data-science"&gt;data science&lt;/a&gt; (as a discipline), and I much prefer statistician or data engineer, but let&amp;rsquo;s forget about that for a moment. In this article, Rafael Alvarado offers to extend the consensual view according to which data science lies at the intersection between three main domains of expertise: computer science and technology, mathematics and statistics, and domain knowledge, which I found even more confusing. Specifically, he considers the following four main domains: value, design, systems, and analytics, to which a fifth domain may be added, namely practice. In a &lt;a href="https://arxiv.org/abs/2311.03292"&gt;related article&lt;/a&gt;, his review led him to conclude that the three driving factors of all the buzz around the sexiest job the 21st century are &amp;ldquo;(1) the long-standing opposition between data analysts and data miners that continues to animate the field, (2) an established definition of the term as the practice of managing and processing scientific data that has been occluded by recent usage, and (3) the phenomenon of data impedance.&amp;rdquo; Much ado about nothing in my opinion, unless you consider that the volume and nature of data being processed these days implies a major change in terminology. But is it really that important if it&amp;rsquo;s just a question of terminology? Because the job remains fundamentally the same, after all.&lt;/p&gt;
&lt;h3 id="resampling-free-bootstrap-inference-for-quantiles-"&gt;Resampling-free bootstrap inference for quantiles (&lt;a href="https://arxiv.org/abs/2202.10992"&gt;https://arxiv.org/abs/2202.10992&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;A paper I read last year, thanks to Evan Miller, but go read his own &lt;a href="https://www.evanmiller.org/bootstrapping-sample-medians.html"&gt;blog post&lt;/a&gt; which covers pretty all the math. While the authors originally proposed a Poisson model for bootstrapping differences in quantiles, whereby each observation in the original sample is included in each bootstrap sample according to a Poisson distribution with parameter 1, Evan Miller suggested an approximation which involves a Bessel function.&lt;/p&gt;
&lt;h3 id="frame-to-frame-interpolation-for-high-dimensional-data-visualisation-using-the-woylier-package-"&gt;Frame to frame interpolation for high-dimensional data visualisation using the woylier package (&lt;a href="https://arxiv.org/abs/2311.08181"&gt;https://arxiv.org/abs/2311.08181&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;A new paper by Dianne Cook, whose contributions I have always greatly appreciated since I discovered &lt;a href="http://ggobi.org/"&gt;ggobi&lt;/a&gt; (the website is still alive apparently). The &amp;ldquo;grand tour&amp;rdquo; (and other derivatives) is a method that allows to view data in more than three dimensions using linear projection, essentially by using rotations of a lower-dimensional projection in high-dimensional space. I&amp;rsquo;ve only seen this implemented efficiently in ggobi, but there may have been other attempts. Frames are stacked together with small interpolation to create a smooth motion. However, projection are usually rotationally invariant (when using geodesic interpolation algorithm) which may not be a desirable property when, e.g., we are looking for non-linear association in a high-dimensional dataset. The present package works along the &lt;a href="https://cran.r-project.org/web/packages/tourr/index.html"&gt;tourr&lt;/a&gt; package.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2023-11-30-18-54-51.png"&gt;
&lt;/figure&gt;
&lt;h3 id="visualizing-adverse-events-in-clinical-trials-using-correspondence-analysis-with-r-package-visae-"&gt;Visualizing adverse events in clinical trials using correspondence analysis with R-package visae (&lt;a href="https://arxiv.org/abs/2101.03454"&gt;https://arxiv.org/abs/2101.03454&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;Although I&amp;rsquo;m no longer involved in medical statistics, I keep an eye open on data visualization and applied methodology in the field. This article drew my attention a few weeks ago because it relies on multivariate projection methods, in this case correspondance analysis and biplots. There&amp;rsquo;s an associated &lt;a href="https://github.com/cran/visae"&gt;GitHub&lt;/a&gt; repository where you will find code (shiny and ggplot) and illustrations. The advantage of biplots as summary displays is that they help highlighting complex relationship (or, in some cases, interactions). For instance, in the associated BMC paper the authors published alongside this preprint, they used biplots to highlight discrepancies between single agent treatments and their combinations with oxaliplatin at all levels of AE classes, which explain most of the variability among treatments.&lt;/p&gt;
&lt;h3 id="identifiable-and-interpretable-nonparametric-factor-analysis-"&gt;Identifiable and interpretable nonparametric factor analysis (&lt;a href="https://arxiv.org/abs/2311.08254"&gt;https://arxiv.org/abs/2311.08254&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;Contrary to Gaussian models or deep neural networks, which show poor performance in terms of identifiability, interpretability, and reproducibility, the authors propose to use the &amp;ldquo;NIFTY framework, which parsimoniously transforms uniform latent variables using one-dimensional nonlinear mappings and then applies a linear generative model.&amp;rdquo; Briefly stated, such an approach allows to work with a standard linear latent factor model, which is easier to interpret compared to the aforementioned models, which amounts to a Bayesian independent component analysis under certain conditions.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2023-11-30-20-57-42.png"&gt;
&lt;/figure&gt;
&lt;h3 id="generating-signed-permutations-by-twisting-two-sided-ribbons-"&gt;Generating Signed Permutations by Twisting Two-Sided Ribbons (&lt;a href="https://arxiv.org/abs/2311.06974"&gt;https://arxiv.org/abs/2311.06974&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;An interesting review of algorithms available to generate permutations, and specifically signed permutations which are permutations of $[n]$ objects with a $\pm$ sign. In the case of permutations, there are $n!$ solutions, while for signed permutations there are $2^n\cdot n!$ solutions. Not something I am really interested in at the moment, but I&amp;rsquo;ll keep it in mynd in case I need it. There are a lot of nice illustrations, BTW.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Mini Trees • &lt;em&gt;Cracks in the Pavement&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in November</title><link>https://aliquote.org/post/micro-11-2023/</link><pubDate>Wed, 29 Nov 2023 09:19:35 +0100</pubDate><guid>https://aliquote.org/post/micro-11-2023/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-11-02&lt;/a&gt;: I generated a docset for Purescript with &lt;a href="https://github.com/SEIAROTg/pursuit.docset"&gt;pursuit.docset&lt;/a&gt;. However, I&amp;rsquo;m skeptical about its added value. I&amp;rsquo;m using Dash docset in Neovim via &lt;a href="https://github.com/sunaku/vim-dasht"&gt;vim-dasht&lt;/a&gt;, and I noticed that oftentimes the online help for simple query like &lt;code&gt;filter&lt;/code&gt; or &lt;code&gt;partition&lt;/code&gt; are pretty vague. E.g., in the case of &lt;code&gt;filter&lt;/code&gt; the very first hits are all about &lt;code&gt;_filter :: forall r a. Lens' { ... } a&lt;/code&gt;, while none of the first matches for &lt;code&gt;partition&lt;/code&gt; yields the same result as a simple query on Pursuit (&lt;code&gt;filter :: forall a. (a -&amp;gt; Boolean) -&amp;gt; Array a -&amp;gt; Array a&lt;/code&gt;).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-11-06&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Almost 50, I remain philosophical because I spent about the first ~45 of them living without Youtube. Did that well enough. &amp;mdash; &lt;a href="https://lists.ubuntu.com/archives/ubuntu-users/2023-November/311452.html"&gt;https://lists.ubuntu.com/mailman/listinfo/ubuntu-users&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-11-06&lt;/a&gt;: ♪ sean thornton · edith says&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-11-07&lt;/a&gt;: If you get such a garbage when launching Firefox (official deb package, not the crappy snap one) from the command line or as an external browser for Newsboat, try force disabling accessibility as suggested [here](https://bugzilla.mozilla.org/show_bug.cgi?id=1851240).
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» firefox
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;~
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;»
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;[&lt;/span&gt;Parent 25471, Main Thread&lt;span class="o"&gt;]&lt;/span&gt; WARNING: invalid &lt;span class="o"&gt;(&lt;/span&gt;NULL&lt;span class="o"&gt;)&lt;/span&gt; pointer instance: &lt;span class="s1"&gt;&amp;#39;glib warning&amp;#39;&lt;/span&gt;, file /build/firefox-LOPdVD/firefox-119.0+build2/toolkit/xre/nsSigHandlers.cpp:167
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;(&lt;/span&gt;firefox:25471&lt;span class="o"&gt;)&lt;/span&gt;: GLib-GObject-WARNING **: 11:46:47.027: invalid &lt;span class="o"&gt;(&lt;/span&gt;NULL&lt;span class="o"&gt;)&lt;/span&gt; pointer instance
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;[&lt;/span&gt;Parent 25471, Main Thread&lt;span class="o"&gt;]&lt;/span&gt; WARNING: g_signal_emit_by_name: assertion &lt;span class="s1"&gt;&amp;#39;G_TYPE_CHECK_INSTANCE (instance)&amp;#39;&lt;/span&gt; failed: &lt;span class="s1"&gt;&amp;#39;glib warning&amp;#39;&lt;/span&gt;, file /build/firefox-LOPdVD/firefox-119.0+build2/toolkit/xre/nsSigHandlers.cpp:167
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;(&lt;/span&gt;firefox:25471&lt;span class="o"&gt;)&lt;/span&gt;: GLib-GObject-CRITICAL **: 11:46:47.027: g_signal_emit_by_name: assertion &lt;span class="s1"&gt;&amp;#39;G_TYPE_CHECK_INSTANCE (instance)&amp;#39;&lt;/span&gt; failed
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;[&lt;/span&gt;Parent 25471, Main Thread&lt;span class="o"&gt;]&lt;/span&gt; WARNING: invalid &lt;span class="o"&gt;(&lt;/span&gt;NULL&lt;span class="o"&gt;)&lt;/span&gt; pointer instance: &lt;span class="s1"&gt;&amp;#39;glib warning&amp;#39;&lt;/span&gt;, file /build/firefox-LOPdVD/firefox-119.0+build2/toolkit/xre/nsSigHandlers.cpp:167
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;(&lt;/span&gt;firefox:25471&lt;span class="o"&gt;)&lt;/span&gt;: GLib-GObject-WARNING **: 11:46:47.027: invalid &lt;span class="o"&gt;(&lt;/span&gt;NULL&lt;span class="o"&gt;)&lt;/span&gt; pointer instance
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;[&lt;/span&gt;Parent 25471, Main Thread&lt;span class="o"&gt;]&lt;/span&gt; WARNING: g_signal_emit_by_name: assertion &lt;span class="s1"&gt;&amp;#39;G_TYPE_CHECK_INSTANCE (instance)&amp;#39;&lt;/span&gt; failed: &lt;span class="s1"&gt;&amp;#39;glib warning&amp;#39;&lt;/span&gt;, file /build/firefox-LOPdVD/firefox-119.0+build2/toolkit/xre/nsSigHandlers.cpp:167
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;(&lt;/span&gt;firefox:25471&lt;span class="o"&gt;)&lt;/span&gt;: GLib-GObject-CRITICAL **: 11:46:47.027: g_signal_emit_by_name: assertion &lt;span class="s1"&gt;&amp;#39;G_TYPE_CHECK_INSTANCE (instance)&amp;#39;&lt;/span&gt; failed
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-11-07&lt;/a&gt;: &lt;em&gt;Scheme from Scratch&lt;/em&gt; by Peter Michaux: &lt;a href="http://peter.michaux.ca/articles/scheme-from-scratch-introduction"&gt;intro&lt;/a&gt;, and &lt;a href="http://peter.michaux.ca/"&gt;full list of posts&lt;/a&gt;. &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-11-08&lt;/a&gt;: &lt;br&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/IMG_3314.JPG"&gt;
&lt;/figure&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-11-08&lt;/a&gt;: Editing Lisp dialect in Neovim like a pro: beside Vim&amp;rsquo;s builtin (e.g., &lt;code&gt;vib&lt;/code&gt; to select inside brackets), &lt;a href="https://github.com/kovisoft/paredit"&gt;paredit.vim&lt;/a&gt; (e.g., &lt;code&gt;[[&lt;/code&gt; go to top-level form), treesitter and &lt;a href="https://github.com/nvim-treesitter/nvim-treesitter-textobjects"&gt;nvim-treesitter-textobjects&lt;/a&gt; lets you navigate around your code easily, and incremental selection is a breeze. I originally used &lt;code&gt;vv&lt;/code&gt; (init the selection), &lt;code&gt;va&lt;/code&gt; (aka increase or &lt;code&gt;&amp;lt;C-a&amp;gt;&lt;/code&gt;) and &lt;code&gt;vx&lt;/code&gt; (aka decrease or &lt;code&gt;&amp;lt;C-x&amp;gt;&lt;/code&gt;), but now I just use &lt;code&gt;&amp;lt;tab&amp;gt;&lt;/code&gt; that other folks often use as an alias for &lt;code&gt;%&lt;/code&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lua" data-lang="lua"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;incremental_selection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;enable&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;keymaps&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;init_selection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&amp;lt;tab&amp;gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;node_incremental&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&amp;lt;tab&amp;gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;node_decremental&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&amp;lt;S-tab&amp;gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;br&gt;&lt;br&gt;&lt;img src="https://aliquote.org/img/2023-11-08-19-03-12.gif" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-11-08&lt;/a&gt;: &lt;a href="https://a.skh.am/2023/08/06/tetris-haskell.html"&gt;Learning (Some) Haskell by Building Tetris&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-11-09&lt;/a&gt;: &lt;a href="https://graphics.stanford.edu/~seander/bithacks.html"&gt;Bit Twiddling Hacks&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-11-09&lt;/a&gt;: &lt;a href="https://blog.jez.io/profiling-in-haskell/#further-speedups"&gt;Profiling in Haskell for a 10x Speedup&lt;/a&gt;: Great read. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-11-10&lt;/a&gt;: ♪ Marianne Faithfull · Broken English (12&amp;quot; Remix)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-11-13&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;During the Internet’s adolescence, words (and thus blogs) were easier to come by, because for the most part, almost all of the interaction we had online was using devices designed for interaction via text. With the shift to phones as a more popular interaction device, the ease of pouring thoughts into a textual medium has decreased. &amp;mdash; &lt;a href="https://writequit.org/book/posts/blogging-shift/"&gt;Blogging Shift&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-11-13&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Recursive data suggest recursive solutions. This is the key insight you need for understanding recursion. Not only does it make sense once you think about it, it also demonstrates why most other approaches to teaching recursion are essentially incorrect. &amp;mdash; &lt;a href="https://parentheticallyspeaking.org/articles/how-not-to-teach-recursion/"&gt;How Not to Teach Recursion&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-11-13&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;pytest supports running Python unittest-based tests out of the box. &amp;mdash; &lt;a href="https://docs.pytest.org/en/7.1.x/how-to/unittest.html"&gt;How to use unittest-based tests with pytest&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is great since it allows me to use the same compiler (pytest) in Neovim, independent of the testing framework.
&lt;br&gt;&lt;img src="https://aliquote.org/img/2023-11-13-11-29-39.png" alt="img"&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-11-13&lt;/a&gt;: Still decent timing&amp;hellip;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;aliquote master*
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» make deploy
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[+] Building public files in /home/chl/Sites/aliquote/public
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;hugo --gc --minify
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Start building sites …
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;hugo v0.92.2+extended linux/amd64 BuildDate=2023-01-31T11:11:57Z VendorInfo=ubuntu:0.92.2-1ubuntu0.1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; | EN
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;-------------------+-------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Pages | 4705
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Paginator pages | 381
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Non-page files | 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Static files | 1318
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Processed images | 0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Aliases | 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Sitemaps | 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Cleaned | 0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Total in 10170 ms
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-11-13&lt;/a&gt;: &lt;a href="https://dcic-world.org/"&gt;A Data-Centric Introduction to Computing&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-11-15&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Human optimism leads us to believe that we can easily know where a program spends most of its time. &amp;mdash; &lt;a href="https://tratt.net/laurie/blog/2023/four_kinds_of_optimisation.html"&gt;Four Kinds of Optimisation&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-11-15&lt;/a&gt;: ♪ Millie Turner · January&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-11-16&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A computer game taking the shape of instant messaging software. The inherently paradoxical goal of the game requires no small amount of strategy, wit and cunning: The main objective is gaining as large a following of people as possible while simultaneously getting as many people as possible banned from the game. &amp;mdash; &lt;a href="https://datagubbe.se/intexpl/"&gt;Explaining the Internet in 2020&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-11-16&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;There are a lot of small websites on the Internet: Interesting websites, beautiful websites, unique websites. Unfortunately they are incredibly hard to find. You cannot find them on Google or Reddit, and while you can stumble onto them with my search engine, it is not in a very directed fashion. &amp;mdash; &lt;a href="https://www.marginalia.nu/log/19-website-discoverability-crisis/"&gt;The Small Website Discoverability Crisis&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-11-16&lt;/a&gt;: &lt;a href="https://discourse.ubuntu.com/t/environment-variables-for-wayland-hackers/12750"&gt;Environment variables for Wayland hackers&lt;/a&gt;.Note to myself:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$MOZ_ENABLE_WAYLAND
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Enables Wayland for Mozilla products (notably Firefox) if set to 1. Firefox uses GTK so setting GTK_BACKEND=wayland will force it to run on Wayland regardless of if MOZ_ENABLE_WAYLAND. However, it will default to X on GDK_BACKEND=wayland,x11 unless MOZ_ENABLE_WAYLAND=1 is set.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-11-21&lt;/a&gt;: TIL that Spotify originally relied on &lt;a href="https://aliquote.org/post/fisher-yates-shuffling/"&gt;Fisher-Yates&lt;/a&gt; algorithm to &lt;a href="https://engineering.atspotify.com/2014/02/how-to-shuffle-songs/"&gt;shuffle their playlists&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-11-21&lt;/a&gt;: The &lt;a href="https://github.com/matloff/qeML"&gt;qeML&lt;/a&gt; package: &amp;ldquo;Quick and easy&amp;rdquo; wrappers for machine learning. Norm Matloff also published a &lt;a href="https://github.com/matloff/ArtOfML"&gt;new book&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-11-21&lt;/a&gt;: ♪ New Order · Sub-Culture&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-11-22&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;My general advice for maximizing the battery is only use your battery as much as you need, i.e. charge it as often as possible, and as little as possible. If you need a rule of thumb, stay within 30%-80%. &lt;a href="https://electronics.stackexchange.com/a/623375"&gt;Wouldn&amp;rsquo;t charging a lithium battery to 80% only defeat the purpose of putting the battery into longer use in the first place?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-11-22&lt;/a&gt;: Poor man &amp;ldquo;fd(find)&amp;rdquo; command:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#!/bin/sh
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;find . -iname &lt;span class="s2"&gt;&amp;#34;*&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;*&amp;#34;&lt;/span&gt; 2&amp;gt;/dev/null
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-11-22&lt;/a&gt;: &lt;a href="https://blog.nelhage.com/2010/02/a-very-subtle-bug/"&gt;A Very Subtle Bug&lt;/a&gt;, or how to re-enable SIGPIPE in the subprocess child. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>How I manage my startup shell scripts</title><link>https://aliquote.org/post/unix-geekery/</link><pubDate>Tue, 28 Nov 2023 20:48:45 +0100</pubDate><guid>https://aliquote.org/post/unix-geekery/</guid><description>&lt;p&gt;I have been using a custom setup to organize my init shell scripts for more more than one year long now, and I believe it&amp;rsquo;s pretty robust both for local and remote use. The idea came after I read a nice blog post about how best to manage a set of dotfiles (at the time of this writing I can&amp;rsquo;t find the blog but I will update this post if I came across it again).&lt;/p&gt;
&lt;p&gt;The only things you really need to know, beside writing proper shell scripts, is what a login vs. interactive shell is and which init files are loaded in each cases. Briefly, an interactive shell runs in your preferred terminal emulator and this is where you usually type your commands, while a non-interactive process involves some kind of I/O operations which the user can&amp;rsquo;t interact with. A login shell is used whenever you log in on your system (after the X or Wayland server is started, this is probably the one at the top of all child processes), while a non-login shell is everything else that is started in userland after you logged in, including external process launched by separate programs without user&amp;rsquo;s action.&lt;/p&gt;
&lt;p&gt;My &lt;code&gt;.profile&lt;/code&gt; simply reads:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# $HOME/.profile&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# the default umask is set in /etc/profile; for setting the umask&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# for ssh logins, install and configure the libpam-umask package.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# umask 022&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; file in &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;/.config/profile.d/*.sh&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; . &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I use zsh as my shell interpreter, so here&amp;rsquo;s my &lt;code&gt;.zprofile&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;[&lt;/span&gt; -r &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;/.profile &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;source&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;/.profile &amp;gt;/dev/null 2&amp;gt;&lt;span class="p"&gt;&amp;amp;&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="nv"&gt;$-&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;~ i &lt;span class="o"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; -r &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;/.zshrc &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;source&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;/.zshrc
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;.bash_profile&lt;/code&gt; is identical, so that I can rely on the exact same config to load everything I need independent of the shell I&amp;rsquo;m using, or more precisely the machine I interact since I do a lot of remote work through ssh where I generally only use Bash and BW colorscheme. In sum, the above scheme allows to manage login shells by sourcing a common set of relevant init files. The &lt;code&gt;.config/profile.d&lt;/code&gt; directory follows Bash scripts organization for environment variables (&lt;code&gt;/etc/profile&lt;/code&gt;) and application-specific startup files (&lt;code&gt;/etc/profile.d&lt;/code&gt;). I currently have three main files there:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» tree .config/profile.d
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.config/profile.d
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── 00-path.sh
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── 10-editor.sh
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;└── 20-shell.sh
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The main file is of course &lt;code&gt;00-path.sh&lt;/code&gt; where I set up all relevant paths for libraries and executables on my HD. Since I use Ubuntu on other machines too, this applies equally well to remote server. Here is an excerpt from this file:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# vim: noai:ts=2:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Fix API server issue with Podman&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# https://github.com/containers/podman/issues/13468#issuecomment-1062764637&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;DOCKER_HOST&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;unix:&lt;/span&gt;&lt;span class="nv"&gt;$XDG_RUNTIME_DIR&lt;/span&gt;&lt;span class="s2"&gt;/podman/podman.sock&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Scheme&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;[&lt;/span&gt; -d &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/.local/lib/scheme&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;CHEZSCHEMELIBDIRS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;/home/chl/.local/lib/scheme:&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Racket&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;[&lt;/span&gt; -d &lt;span class="s2"&gt;&amp;#34;/usr/local/racket&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nv"&gt;PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;/usr/local/racket/bin:&lt;/span&gt;&lt;span class="nv"&gt;$PATH&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Node&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; -d &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/.local/lib/npm&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;NPM_STORE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/.local/lib/npm&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$NPM_STORE&lt;/span&gt;&lt;span class="s2"&gt;/bin:&lt;/span&gt;&lt;span class="nv"&gt;$PATH&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;MANPATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;MANPATH&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;manpath&lt;span class="k"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="nv"&gt;$NPM_STORE&lt;/span&gt;&lt;span class="s2"&gt;/share/man&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# global and user&amp;#39;s local systems&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;[&lt;/span&gt; -d &lt;span class="s2"&gt;&amp;#34;/opt/bin&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nv"&gt;PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$PATH&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;:/opt/bin
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;[&lt;/span&gt; -d &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/bin&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nv"&gt;PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/bin:&lt;/span&gt;&lt;span class="nv"&gt;$PATH&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;[&lt;/span&gt; -d &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/.local/bin&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nv"&gt;PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/.local/bin:&lt;/span&gt;&lt;span class="nv"&gt;$PATH&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Nothing&amp;rsquo;s really exceptional except that I use guarded statements for portability across machines. Same idea for &lt;code&gt;20-shell.sh&lt;/code&gt;, where I setup default config and directories for various applications:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# vim: noai:ts=2:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Rg&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;command&lt;/span&gt; -v rg &amp;gt; /dev/null 2&amp;gt;&lt;span class="p"&gt;&amp;amp;&lt;/span&gt;1&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;RIPGREP_CONFIG_PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/.config/ripgreprc&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Bibtex (for Org and FZF)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# NOTE: Bibtex file hardcoded&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;command&lt;/span&gt; -v bibtex-ls &amp;gt; /dev/null 2&amp;gt;&lt;span class="p"&gt;&amp;amp;&lt;/span&gt;1&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;BIBINPUTS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/Documents/notes/:&lt;/span&gt;&lt;span class="nv"&gt;$BIBINPUTS&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;FZF_BIBTEX_CACHEDIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/.cache/bibtex-ls&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;FZF_BIBTEX_SOURCES&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/Documents/notes/references.bib&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# News&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;NNTPSERVER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;news.eternal-september.org&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Python&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;VIRTUAL_ENV_DISABLE_PROMPT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# export PYTHONDONTWRITEBYTECODE=1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The startup sequence when I log on my computer for the first time is then:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.zprofile -&amp;gt; .profile -&amp;gt; .config/profile.d/* -&amp;gt; .zshrc -&amp;gt; .config/zsh/*
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;From &lt;code&gt;.zshrc&lt;/code&gt; I source various other shell scripts specific to Zsh (e.g., completion) or common with Bash (alias and functions). When I&amp;rsquo;m on ssh or on virtual console, I disable some extra stuff like Starship prompt or colors.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nv"&gt;$XDG_SESSION_TYPE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;tty&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;unset&lt;/span&gt; LS_COLORS
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;TERM&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;xterm-mono
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;NO_COLOR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;alias&lt;/span&gt; &lt;span class="nv"&gt;ll&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;ls -alF&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;PROMPT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;%~ %(!.#.%%) &amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;else&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;eval&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;starship init zsh&lt;span class="k"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;TRAPEXIT&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; ! -o login &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; . ~/.zlogout
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;.zlogout&lt;/code&gt; file takes care of cleaning the mess introduced by some programs, who insists on creating various directories here and there.&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s it!&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Nick Cave and the Bad Seeds • &lt;em&gt;Wonderful Life&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Revisiting Random Forests</title><link>https://aliquote.org/post/revisiting-random-forests/</link><pubDate>Wed, 22 Nov 2023 10:40:52 +0100</pubDate><guid>https://aliquote.org/post/revisiting-random-forests/</guid><description>&lt;p&gt;I&amp;rsquo;ve been a heavy user of &lt;a href="https://aliquote.org/post/visualizing-what-random-forests-really-do/"&gt;Random Forests&lt;/a&gt; in the past (both for applied work and theoretical foundations of ensemble learning and bagging techniques). I very much like &lt;a href="https://www.stat.berkeley.edu/~breiman/"&gt;Leo Breiman&lt;/a&gt;&amp;rsquo;s work, and I warmly recommend you to take a look at his WALD lectures if you haven&amp;rsquo;t already done so. I&amp;rsquo;ve lost track of all the packages I tried back at the time (mostly R and C), and recently I came across Norm Matloff&amp;rsquo;s new package, &lt;a href="https://github.com/matloff/qeML"&gt;qeML&lt;/a&gt;, which provides standard R code to perform ML workflow in seamingless fashion (much like caret did once upon a time, but it looks like folks are using &lt;a href="https://www.rebeccabarter.com/blog/2020-03-25_machine_learning"&gt;pipe-oriented tidy stuff&lt;/a&gt; these days).&lt;/p&gt;
&lt;p&gt;We could use the Boston Housing dataset from Breiman &amp;amp; Cutler, available as &lt;a href="https://www.stat.berkeley.edu/~breiman/RandomForests/reg_examples/boshouse.txt"&gt;boshouse.txt&lt;/a&gt;.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; It features 13 numerical variables for a total of 506 observations. However, it&amp;rsquo;s missing the outcome (median value of owner-occupied homes). Let&amp;rsquo;s grab the data from the &lt;a href="https://search.r-project.org/CRAN/refmans/mlbench/html/BostonHousing.html"&gt;mlbench&lt;/a&gt; package. Here&amp;rsquo;s how I would usually do using R, without splitting the dataset into a training and test sample:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;library&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;randomForest&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;data&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BostonHousing&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;package&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;mlbench&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## Codebook&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## --------&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## CRIM: Per capita crime rate by town&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## ZN: Proportion of residential land zoned for lots over 25,000 sq. ft&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## INDUS: Proportion of non-retail business acres per town&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## CHAS: Charles River dummy variable (= 1 if tract bounds river; 0 otherwise)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## NOX: Nitric oxide concentration (parts per 10 million)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## RM: Average number of rooms per dwelling&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## AGE: Proportion of owner-occupied units built prior to 1940&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## DIS: Weighted distances to five Boston employment centers&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## RAD: Index of accessibility to radial highways&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## TAX: Full-value property tax rate per $10,000&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## PTRATIO: Pupil-teacher ratio by town&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## B: 1000(Bk — 0.63)², where Bk is the proportion of [people of African American descent] by town&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## LSTAT: Percentage of lower status of the population&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## MEDV: Median value of owner-occupied homes in $1000s (*outcome*)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;set.seed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;101&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;randomForest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;medv&lt;/span&gt; &lt;span class="o"&gt;~&lt;/span&gt; &lt;span class="n"&gt;.,&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;BostonHousing&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;importance&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;TRUE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Metrics&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;mae&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BostonHousing&lt;/span&gt;&lt;span class="o"&gt;$&lt;/span&gt;&lt;span class="n"&gt;medv&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;predict&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I got 88.18% of explained variance with a residual mean square error of 9.98. The mean absolute error is estimated as 2.10. Note that using default settings, this function considered 500 trees, and we didn&amp;rsquo;t bother optimizing the &lt;code&gt;mtry&lt;/code&gt; parameter (or other subtleties, like &lt;code&gt;nodesize&lt;/code&gt; and &lt;code&gt;sampsize&lt;/code&gt;). Okay, this is just looking at raw results, and we could do way better for reporting purpose, see, e.g., this &lt;a href="https://uc-r.github.io/random_forests"&gt;tutorial&lt;/a&gt;. Now, with &lt;code&gt;qeML&lt;/code&gt;, we can perform the above steps using a one-liner:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;library&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;qeML&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;qeRF&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BostonHousing&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;medv&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="o"&gt;$&lt;/span&gt;&lt;span class="n"&gt;trainAcc&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# replicMeans(100,&amp;#34;qeRF(BostonHousing, &amp;#39;medv&amp;#39;)$testAcc&amp;#34;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The accuracy on the training set (to keep close to the previous analysis which did not consider an holdout sample) again relies on the averaged prediction for the outcome (mean absolute prediction error) is now 1.17. The last expression will take longer since it runs the RF algorithm 100 times, but you&amp;rsquo;ll get more a reliable estimate of prediction accuracy on a test sample. There are some interesting &lt;a href="https://cloud.r-project.org/web/packages/qeML/vignettes/"&gt;vignettes&lt;/a&gt; on CRAN if you want to learn more about prediction using ML methods, feature selection, class imbalances, etc.&lt;/p&gt;
&lt;p&gt;Last but not least, did you known Random Forests can be fitted directly in Common Lisp? We will first need to convert the R dataset to a &lt;a href="https://aliquote.org/pub/boshous.txt"&gt;plain text&lt;/a&gt; file (&lt;code&gt;write.table(format(transform(BostonHousing, chas = as.numeric(chas) - 1), digits = 2, nsmall = 1, scientific = FALSE), file = &amp;quot;boshous.txt&amp;quot;, sep = &amp;quot;\t&amp;quot;, col.names = FALSE, row.names = FALSE, quote = FALSE)&lt;/code&gt;), load it into SBCL REPL and convert it to a Lisp 2D array. I spent a lot of time debugging a type error in Lisp because I didn&amp;rsquo;t notice that the &lt;code&gt;chas&lt;/code&gt; variable was stored as a factor (with levels {1,2}) which get exported as {0,1}, and not {0.0,1.0} despite the call to &lt;code&gt;format&lt;/code&gt; above.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;ql:quickload&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;cl-csv&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;ql:quickload&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;parse-number&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;ql:quickload&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;cl-slice&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;ql:quickload&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;cl-random-forest&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defun&lt;/span&gt; &lt;span class="nv"&gt;numlist&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;mapcar&lt;/span&gt; &lt;span class="nf"&gt;#&amp;#39;&lt;/span&gt;&lt;span class="nv"&gt;parse-number:parse-number&lt;/span&gt; &lt;span class="nv"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defun&lt;/span&gt; &lt;span class="nv"&gt;as-array&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;make-array&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;list&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;length&lt;/span&gt; &lt;span class="nv"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;length&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;car&lt;/span&gt; &lt;span class="nv"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="ss"&gt;:element-type&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;single-float&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="ss"&gt;:initial-contents&lt;/span&gt; &lt;span class="nv"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defparameter&lt;/span&gt; &lt;span class="vg"&gt;*data*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;as-array&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;cl-csv:read-csv&lt;/span&gt; &lt;span class="l"&gt;#P&amp;#34;boshous.txt&amp;#34;&lt;/span&gt; &lt;span class="ss"&gt;:separator&lt;/span&gt; &lt;span class="sc"&gt;#\Tab&lt;/span&gt; &lt;span class="ss"&gt;:map-fn&lt;/span&gt; &lt;span class="nf"&gt;#&amp;#39;&lt;/span&gt;&lt;span class="nv"&gt;numlist&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defparameter&lt;/span&gt; &lt;span class="vg"&gt;*X*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;cl-slice:slice&lt;/span&gt; &lt;span class="vg"&gt;*data*&lt;/span&gt; &lt;span class="no"&gt;t&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;cons&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defparameter&lt;/span&gt; &lt;span class="vg"&gt;*Y*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;cl-slice:slice&lt;/span&gt; &lt;span class="vg"&gt;*data*&lt;/span&gt; &lt;span class="no"&gt;t&lt;/span&gt; &lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defparameter&lt;/span&gt; &lt;span class="vg"&gt;*rforest*&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;cl-random-forest:make-regression-forest&lt;/span&gt; &lt;span class="vg"&gt;*X*&lt;/span&gt; &lt;span class="vg"&gt;*Y*&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="ss"&gt;:n-tree&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt; &lt;span class="ss"&gt;:bagging-ratio&lt;/span&gt; &lt;span class="mf"&gt;0.6&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="ss"&gt;:max-depth&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="ss"&gt;:min-region-samples&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="ss"&gt;:n-trial&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;test-regression-forest&lt;/span&gt; &lt;span class="vg"&gt;*rforest*&lt;/span&gt; &lt;span class="vg"&gt;*test*&lt;/span&gt; &lt;span class="vg"&gt;*test-target*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It&amp;rsquo;s pretty fast and it can even be parallelized using the &lt;a href="https://lparallel.org/"&gt;lparallel&lt;/a&gt; library. I wasted enough time with a simple typing error for today, so in a future post, I will try to extend the previous code in order to compute the RMSE using a holdout sample and to plot the fitted values with Gnuplot.&lt;/p&gt;
&lt;p&gt;That was quick, but there are many other &lt;a href="https://cloud.r-project.org/web/packages/qeML/vignettes/ML_Overview.html#random-forests"&gt;RF models&lt;/a&gt; that you can try from the qeML package. Finally, let&amp;rsquo;s pay attention to Breiman&amp;rsquo;s own &lt;a href="https://www.stat.berkeley.edu/~breiman/RandomForests/reg_philosophy.htm"&gt;advice&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;RF is an example of a tool that is useful in doing analyses of scientific data.&lt;br&gt;
But the cleverest algorithms are no substitute for human intelligence and knowledge of the data in the problem.&lt;br&gt;
Take the output of random forests not as absolute truth, but as smart computer generated guesses that may be helpful in leading to a deeper understanding of the problem.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Nick Cave and the Bad Seeds • &lt;em&gt;Bring it on&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;The augmented version of this dataset is also available from the &lt;a href="https://search.r-project.org/CRAN/refmans/mlbench/html/BostonHousing.html"&gt;mlbench&lt;/a&gt; package, and the original and augmented datasets can be downloaded directly from &lt;a href="https://lib.stat.cmu.edu/datasets/"&gt;Statlib&lt;/a&gt;. It is no longer available in the &lt;em&gt;de facto&lt;/em&gt; standard ML library for Python, though:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;sklearn.datasets&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;load_boston&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="ne"&gt;ImportError&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt;`&lt;/span&gt;&lt;span class="n"&gt;load_boston&lt;/span&gt;&lt;span class="err"&gt;`&lt;/span&gt; &lt;span class="n"&gt;has&lt;/span&gt; &lt;span class="n"&gt;been&lt;/span&gt; &lt;span class="n"&gt;removed&lt;/span&gt; &lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;scikit&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;learn&lt;/span&gt; &lt;span class="n"&gt;since&lt;/span&gt; &lt;span class="n"&gt;version&lt;/span&gt; &lt;span class="mf"&gt;1.2&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;The&lt;/span&gt; &lt;span class="n"&gt;Boston&lt;/span&gt; &lt;span class="n"&gt;housing&lt;/span&gt; &lt;span class="n"&gt;prices&lt;/span&gt; &lt;span class="n"&gt;dataset&lt;/span&gt; &lt;span class="n"&gt;has&lt;/span&gt; &lt;span class="n"&gt;an&lt;/span&gt; &lt;span class="n"&gt;ethical&lt;/span&gt; &lt;span class="n"&gt;problem&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;investigated&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;authors&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;this&lt;/span&gt; &lt;span class="n"&gt;dataset&lt;/span&gt; &lt;span class="n"&gt;engineered&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;non&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;invertible&lt;/span&gt; &lt;span class="n"&gt;variable&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;B&amp;#34;&lt;/span&gt; &lt;span class="n"&gt;assuming&lt;/span&gt; &lt;span class="n"&gt;that&lt;/span&gt; &lt;span class="n"&gt;racial&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;segregation&lt;/span&gt; &lt;span class="n"&gt;had&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;positive&lt;/span&gt; &lt;span class="n"&gt;impact&lt;/span&gt; &lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="n"&gt;house&lt;/span&gt; &lt;span class="n"&gt;prices&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="n"&gt;Furthermore&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;goal&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;research&lt;/span&gt; &lt;span class="n"&gt;that&lt;/span&gt; &lt;span class="n"&gt;led&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;creation&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;this&lt;/span&gt; &lt;span class="n"&gt;dataset&lt;/span&gt; &lt;span class="n"&gt;was&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;study&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;impact&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;air&lt;/span&gt; &lt;span class="n"&gt;quality&lt;/span&gt; &lt;span class="n"&gt;but&lt;/span&gt; &lt;span class="n"&gt;it&lt;/span&gt; &lt;span class="n"&gt;did&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;give&lt;/span&gt; &lt;span class="n"&gt;adequate&lt;/span&gt; &lt;span class="n"&gt;demonstration&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;validity&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;this&lt;/span&gt; &lt;span class="n"&gt;assumption&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;The&lt;/span&gt; &lt;span class="n"&gt;scikit&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;learn&lt;/span&gt; &lt;span class="n"&gt;maintainers&lt;/span&gt; &lt;span class="n"&gt;therefore&lt;/span&gt; &lt;span class="n"&gt;strongly&lt;/span&gt; &lt;span class="n"&gt;discourage&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;this&lt;/span&gt; &lt;span class="n"&gt;dataset&lt;/span&gt; &lt;span class="n"&gt;unless&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;purpose&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;code&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;study&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;educate&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;about&lt;/span&gt; &lt;span class="n"&gt;ethical&lt;/span&gt; &lt;span class="n"&gt;issues&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="n"&gt;science&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;machine&lt;/span&gt; &lt;span class="n"&gt;learning&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>A quick glance at the distribution of Pi digits</title><link>https://aliquote.org/post/pi-chisq-test/</link><pubDate>Mon, 20 Nov 2023 22:20:03 +0100</pubDate><guid>https://aliquote.org/post/pi-chisq-test/</guid><description>&lt;p&gt;To follow up on my &lt;a href="https://aliquote.org/post/computing-pi-again"&gt;previous post&lt;/a&gt;, here is a quick investigation of the distribution of the digits of $\pi$, using a chi-squared test. Whether $\pi$ is a &lt;a href="https://en.wikipedia.org/wiki/Normal_number"&gt;normal number&lt;/a&gt; is out of scope for this toy example. Don Knuth also discussed the use of Pearson $\chi^2$ test for studying random data in Vol. 2 of the TAOCP, &lt;em&gt;Seminumerical Algorithms&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s count how many times each digits (0..9) appears in the first 1000 decimal places of $\pi$, as computed from the preceding post: (Note that we need to discard the very first digit in this case.)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defun&lt;/span&gt; &lt;span class="nv"&gt;times&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;lst&lt;/span&gt; &lt;span class="nf"&gt;elt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;count&lt;/span&gt; &lt;span class="nf"&gt;elt&lt;/span&gt; &lt;span class="nv"&gt;lst&lt;/span&gt; &lt;span class="ss"&gt;:test&lt;/span&gt; &lt;span class="nf"&gt;#&amp;#39;equal&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defun&lt;/span&gt; &lt;span class="nv"&gt;explode&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;num&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;list&lt;/span&gt; &lt;span class="nf"&gt;#&amp;#39;digit-char-p&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;prin1-to-string&lt;/span&gt; &lt;span class="nv"&gt;num&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defparameter&lt;/span&gt; &lt;span class="vg"&gt;*data*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;cdr&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;explode&lt;/span&gt; &lt;span class="mi"&gt;31415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;dotimes&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;prin1&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;times&lt;/span&gt; &lt;span class="vg"&gt;*data*&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; 0 93&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; 1 116&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; 2 103&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; 3 102&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; 4 93&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; 5 97&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; 6 94&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; 7 95&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; 8 101&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; 9 106&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; nil&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This doesn&amp;rsquo;t seem too incompatible with a hypothesis of equidistribution in which case we would expect a value of 100 for each digit. Let&amp;rsquo;s run a $\chi^2$ test, which compute the sum of the squared difference between observed and expected counts, standardized by the expected counts:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defun&lt;/span&gt; &lt;span class="nv"&gt;int-to-float&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;mapcar&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;lambda&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;coerce&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;single-float&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defparameter&lt;/span&gt; &lt;span class="vg"&gt;*xs*&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;93&lt;/span&gt; &lt;span class="mi"&gt;116&lt;/span&gt; &lt;span class="mi"&gt;103&lt;/span&gt; &lt;span class="mi"&gt;102&lt;/span&gt; &lt;span class="mi"&gt;93&lt;/span&gt; &lt;span class="mi"&gt;97&lt;/span&gt; &lt;span class="mi"&gt;94&lt;/span&gt; &lt;span class="mi"&gt;95&lt;/span&gt; &lt;span class="mi"&gt;101&lt;/span&gt; &lt;span class="mi"&gt;106&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defparameter&lt;/span&gt; &lt;span class="vg"&gt;*expected*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;list-length&lt;/span&gt; &lt;span class="vg"&gt;*data*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;list-length&lt;/span&gt; &lt;span class="vg"&gt;*xs*&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defparameter&lt;/span&gt; &lt;span class="vg"&gt;*dof*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;list-length&lt;/span&gt; &lt;span class="vg"&gt;*xs*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defparameter&lt;/span&gt; &lt;span class="vg"&gt;*statistic*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;apply&lt;/span&gt; &lt;span class="nf"&gt;#&amp;#39;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;mapcar&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;lambda&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;expt&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;-&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="vg"&gt;*expected*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="vg"&gt;*expected*&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;int-to-float&lt;/span&gt; &lt;span class="vg"&gt;*xs*&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; 4.7400002&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To get the associated p-value, I will use Larry Hunter&amp;rsquo;s legacy package, augmented by Jeff Shrager, which can be found, e.g., on &lt;a href="https://github.com/mrc/lhstats"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;require&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;asdf&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;asdf:load-asd&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;/home/chl/Documents/misc/lisp/lhstats/lhstats.asd&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;asdf:load-system&lt;/span&gt; &lt;span class="ss"&gt;:lhstats&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;nth-value&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;statistics::gamma-incomplete&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt; &lt;span class="vg"&gt;*dof*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt; &lt;span class="vg"&gt;*statistic*&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; 0.8563586405247742d0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And just when I finished drafting this post, I found this related study published by Rick Wicklin on the SAS blog: &lt;a href="https://blogs.sas.com/content/iml/2015/03/12/digits-of-pi.html"&gt;Analyzing the first 10 million digits of pi: Randomness within structure&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Researchers have run dozens of statistical tests for randomness on the digits of pi. They all reach the same conclusion. Statistically speaking, the digits of pi seems to be the realization of a process that spits out digits uniformly at random. &lt;br&gt; Nevertheless, mathematicians have not yet been able to prove that the digits of pi are random. One of the leading researchers in the quest commented that if they are random then you can find in the sequence (appropriately converted into letters) the &amp;ldquo;entire works of Shakespeare&amp;rdquo; or any other message that you can imagine (Bailey and Borwein, 2013).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ New Order • &lt;em&gt;Blue Monday&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Computing Pi again</title><link>https://aliquote.org/post/computing-pi-again/</link><pubDate>Wed, 15 Nov 2023 21:40:38 +0100</pubDate><guid>https://aliquote.org/post/computing-pi-again/</guid><description>&lt;p&gt;Some time ago, I wrote about &lt;a href="https://aliquote.org/post/computing-pi/"&gt;computing Pi&lt;/a&gt; using dedicated approximating formulae and continued fractions. TIL that the Corman Lisp distribution has an example of computing $\Pi$ to any number of decimal places. The &lt;a href="https://github.com/sharplispers/cormanlisp/blob/master/examples/pi.lisp"&gt;code&lt;/a&gt; (MIT license) is shown below:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defun&lt;/span&gt; &lt;span class="nv"&gt;pi-atan&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;k&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;do*&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nv"&gt;a&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;w&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;*&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="nv"&gt;k&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;k2&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;*&lt;/span&gt; &lt;span class="nv"&gt;k&lt;/span&gt; &lt;span class="nv"&gt;k&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="mi"&gt;-1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;w&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;setq&lt;/span&gt; &lt;span class="nv"&gt;w&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;truncate&lt;/span&gt; &lt;span class="nv"&gt;w&lt;/span&gt; &lt;span class="nv"&gt;k2&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;incf&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;incf&lt;/span&gt; &lt;span class="nv"&gt;a&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;truncate&lt;/span&gt; &lt;span class="nv"&gt;w&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;setq&lt;/span&gt; &lt;span class="nv"&gt;w&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;truncate&lt;/span&gt; &lt;span class="nv"&gt;w&lt;/span&gt; &lt;span class="nv"&gt;k2&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;incf&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;decf&lt;/span&gt; &lt;span class="nv"&gt;a&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;truncate&lt;/span&gt; &lt;span class="nv"&gt;w&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defun&lt;/span&gt; &lt;span class="nv"&gt;calc-pi&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;digits&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let*&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="nv"&gt;digits&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;m&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;+&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;tenpower&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;expt&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="nv"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;values&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;truncate&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;-&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;pi-atan&lt;/span&gt; &lt;span class="mi"&gt;18&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;*&lt;/span&gt; &lt;span class="nv"&gt;tenpower&lt;/span&gt; &lt;span class="mi"&gt;48&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;pi-atan&lt;/span&gt; &lt;span class="mi"&gt;57&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;*&lt;/span&gt; &lt;span class="nv"&gt;tenpower&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;pi-atan&lt;/span&gt; &lt;span class="mi"&gt;239&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;*&lt;/span&gt; &lt;span class="nv"&gt;tenpower&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It works, and it&amp;rsquo;s kinda fast for $n &amp;lt; 10^5$!&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;CL-USER&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;calc-pi&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mi"&gt;3141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mi"&gt;0938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mi"&gt;7120190914564856692346034861045432664821339360726024914127372458700660631558817488152092096282925409171536436789259036001&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mi"&gt;1330530548820466521384146951941511609433057270365759591953092186117381932611793105118548074462379962749567351885752724891&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mi"&gt;2279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mi"&gt;6812714526356082778577134275778960917363717872146844090122495343014654958537105079227968925892354201995611212902196086403&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mi"&gt;4418159813629774771309960518707211349999998372978049951059731732816096318595024459455346908302642522308253344685035261931&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mi"&gt;1881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mi"&gt;066130019278766111959092164201989&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As you may already have guessed, it relies on the use of arctan, which we covered in the aforementioned post.&lt;/p&gt;
&lt;p&gt;The following expansion is used: $\sum_{n=0}^{\infty}\frac{(-1)^nx^{2n+1}}{2n+1}$ for $-1&amp;lt;x&amp;lt;1$, and we look for combination of arctan such that $\text{arctan}(1)=\pi/4$. In other words, the formula can be rewritten as:&lt;/p&gt;
&lt;p&gt;$$ \pi = 4\sum_{n=0}^{\infty}\frac{(-1)^nx^{2n+1}}{2n+1}\left( \text{something} \right). $$&lt;/p&gt;
&lt;p&gt;Smaller &amp;ldquo;something&amp;rdquo; means faster convergence.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;There are some magic numbers in the above code: 18, 57, etc. Where do they come from? There are &lt;a href="https://mathworld.wolfram.com/PiFormulas.html"&gt;many formulae&lt;/a&gt;, but this one is from Gauss:&lt;/p&gt;
&lt;p&gt;$$ \pi = \sum_{n=0}^{\infty}\frac{(-1)^n}{k}\left( 48\left(\frac{1}{18}\right)^k + 32\left(\frac{1}{57}\right)^k - 20\left(\frac{1}{239}\right)^k\right), $$&lt;/p&gt;
&lt;p&gt;with $k=2n+1$. Other formulae are available on this &lt;a href="http://pi314.net/fr/machin.php"&gt;French blog post&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Note that in the GitHub repository, you will also find some sieves for prime numbers.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Monodrama • &lt;em&gt;Sarabande&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Machin&amp;rsquo;s formula ($\pi/4 = 4\text{arctan}(1/5) - \text{arctan}(1/239)$) is probably the easiest to use as it amounts to $\pi = \sum_{n=0}^{\infty}\frac{(-1)^n}{2n+1}\left( 4\left(\frac{1}{5}\right)^{2n+1} - \left(\frac{1}{239}\right)^{2n+1}\right)$.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Trying out cl-lsp</title><link>https://aliquote.org/post/cl-lsp/</link><pubDate>Wed, 08 Nov 2023 10:51:39 +0100</pubDate><guid>https://aliquote.org/post/cl-lsp/</guid><description>&lt;p&gt;I tried using &lt;a href="https://github.com/roswell/roswell/"&gt;roswell&lt;/a&gt; as my daily Common Lisp (CL) driver a few years ago, and then got back to good old SBCL for quick scripting. Note that if you rely on Ubuntu apt repos, sbcl is likely outdated (SBCL 2.1.11.debian at the time I write this post). Roswell looks great since it allows us to install multiple flavors and/or versions of CL programs (e.g., sbcl, ccl), but also to use a simple shebang for CL scripts, like the one below:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#!/bin/sh
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;#|-*- mode:lisp -*-|#&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;#|&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;exec&lt;/span&gt; ros -Q -- &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$0&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$@&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="c1"&gt;#&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;(&lt;/span&gt;with-output-to-string &lt;span class="o"&gt;(&lt;/span&gt;*standard-output*&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;(&lt;/span&gt;asdf:load-system :hyperspec&lt;span class="o"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;(&lt;/span&gt;defun main &lt;span class="o"&gt;(&lt;/span&gt;cword &lt;span class="p"&gt;&amp;amp;&lt;/span&gt;rest argv&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;declare&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;ignore argv&lt;span class="o"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;(&lt;/span&gt;format t &lt;span class="s2"&gt;&amp;#34;~D~%&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;hyperspec:lookup &lt;span class="o"&gt;(&lt;/span&gt;read-from-string cword&lt;span class="o"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;small&gt;This allows to fetch the Hyperspec documentation for, e.g., symbol at point if you use it as a keywordprg in (Neo)vim.&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;Furthermore, there was an implementation of a CL &lt;a href="https://github.com/cxxxr/cl-lsp"&gt;LSP&lt;/a&gt; that apparently &lt;a href="https://github.com/cxxxr/cl-lsp/issues/5"&gt;requires roswell&lt;/a&gt;, plus additional dependencies that I could not manage to install with quicklisp alone. Thus I gave up. Today, I reinstalled roswell and started again to compile the whole system to see if I could get cl-lsp working this time.&lt;/p&gt;
&lt;p&gt;First, the install instructions are not really clear or probably just incomplete on GitHub. We are told to run &lt;code&gt;ros install lem-project/lem cxxxr/cl-lsp&lt;/code&gt;, but this does not quite work. I keep getting a fatal error, even after installing lem-project/micros and lem-project/lem-mailbox as suggested in &lt;a href="https://github.com/cxxxr/cl-lsp/issues/29"&gt;issue #29&lt;/a&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;[&lt;/span&gt;1/3&lt;span class="o"&gt;]&lt;/span&gt; System &lt;span class="s1"&gt;&amp;#39;lem&amp;#39;&lt;/span&gt; found. Loading the system..
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;While evaluating the form starting at line 1, column &lt;span class="m"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; of &lt;span class="c1"&gt;#P&amp;#34;/home/chl/.roswell/local-projects/lem-project/lem/lem.asd&amp;#34;:Aborted during step [1/3].&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Unhandled LOAD-SYSTEM-DEFINITION-ERROR in thread &lt;span class="c1"&gt;#&amp;lt;SB-THREAD:THREAD tid=180321 &amp;#34;main thread&amp;#34; RUNNING {10013E0003}&amp;gt;: Error while trying to load definition for system lem from pathname /home/chl/.roswell/local-projects/lem-project/lem/lem.asd: Couldn&amp;#39;t execute &amp;#34;qlot&amp;#34;: No such file or directory&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So, qlot is missing, even after installing qlot or fukamachi/qlot. I went to &lt;a href="https://qlot.tech/"&gt;https://qlot.tech/&lt;/a&gt; directly and install it in my home directory, symlinked &lt;code&gt;$HOME/.qlot/bin/qlot&lt;/code&gt; to a directory that is already reachable in my &lt;code&gt;$PATH&lt;/code&gt;, and this solved all the problems mentioned above. You likely need to add roswell bin directory to your path, e.g. &lt;code&gt;[ -d &amp;quot;$HOME/.roswell&amp;quot; ] &amp;amp;&amp;amp; PATH=&amp;quot;$HOME/.roswell/bin:$PATH&amp;quot;&lt;/code&gt;. I did not bother to check if we really need micros and lem-mailbox. So now, in addition to my local quicklisp folder, I have an additional one which is managed by roswell, and additional stuff from qlot in the lem project itself:&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;~/.roswell
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» tree -L &lt;span class="m"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── archives
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── bin
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── config
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── env
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── impls
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── lisp
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── local-projects
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── src
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;└── tmp
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="m"&gt;8&lt;/span&gt; directories, &lt;span class="m"&gt;1&lt;/span&gt; file
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;~/.roswell
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» &lt;span class="nb"&gt;cd&lt;/span&gt; local-projects/lem-project/lem
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;lem main
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» &lt;span class="nb"&gt;pwd&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;/home/chl/.roswell/local-projects/lem-project/lem
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;lem main
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» ls .qlot
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;asdf.lisp bin/ dists/ local-init/ local-projects/ quicklisp/ setup.lisp source-registry.conf tmp/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;lem main
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» du -sh .qlot
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;172M .qlot
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For testing purpose, I set up Neovim very basically using a filetype-specific init file (&lt;code&gt;ftplugin/lips.lua&lt;/code&gt;):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lua" data-lang="lua"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;vim.lsp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;cl_lsp&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cmd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;cl-lsp&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;root_dir&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;vim.fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dirname&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vim.fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;find&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;.&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;upward&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;})[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here are the server functionnalities obtained from &lt;code&gt;vim.lsp.get_active_clients()[1].server_capabilities&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;{
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; completionProvider = {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; completionItem = {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; labelDetailsSupport = true
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; },
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; resolveProvider = true,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; triggerCharacters = { &amp;#34;:&amp;#34; }
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; },
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; definitionProvider = {},
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; documentFormattingProvider = vim.empty_dict(),
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; documentHighlightProvider = vim.empty_dict(),
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; documentOnTypeFormattingProvider = {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; firstTriggerCharacter = &amp;#34;(&amp;#34;,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; moreTriggerCharacter = { &amp;#34;)&amp;#34; }
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; },
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; documentRangeFormattingProvider = vim.empty_dict(),
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; documentSymbolProvider = vim.empty_dict(),
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; executeCommandProvider = {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; commands = { &amp;#34;cl-lsp.interrupt&amp;#34;, &amp;#34;cl-lsp.eval-range&amp;#34;, &amp;#34;cl-lsp.eval-last-expression&amp;#34; }
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; },
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; hoverProvider = {},
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; referencesProvider = vim.empty_dict(),
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; signatureHelpProvider = {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; retriggerCharacters = {},
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; triggerCharacters = { &amp;#34; &amp;#34; }
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; },
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; textDocumentSync = {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; change = 2,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; openClose = true,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; save = true
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Mandatory screenshot:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2023-11-08-11-45-33.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Formatting does not seem to work correctly (see &lt;a href="https://github.com/cxxxr/cl-lsp/issues/26"&gt;#26&lt;/a&gt;), while hover information is okay. No luck with goto actions (definition, reference), nor with omnicompletion (&lt;code&gt;C-X C-O&lt;/code&gt;). I don&amp;rsquo;t know if it is able to report diagnostics. It doesn&amp;rsquo;t even produce a log file that we could inspect for diagnostic purpose. Also, sbcl is consuming a significant amount of CPU in the background, at least enough to trigger the fans on my laptop. The process is detached correctly upon quitting Neovim, though. This looked like a really cool project, although &lt;a href="https://github.com/kovisoft/slimv"&gt;slimv&lt;/a&gt; or &lt;a href="https://github.com/vlime/vlime"&gt;vlime&lt;/a&gt; are probably better shaped for interactive Lisp development.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m back with my original config: hyperspec via &lt;a href="https://github.com/sunaku/vim-dasht"&gt;dasht&lt;/a&gt; for documentation, and &lt;a href="https://github.com/kovisoft/paredit"&gt;paredit.vim&lt;/a&gt;. And I removed all the intermediate junk files right away. That was a fun exercise anyway!&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Sad Lovers &amp;amp; Giants • &lt;em&gt;Like Thieves&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;I understand that this is useful for &lt;a href="https://github.com/fukamachi/qlot#what-qlot-is-trying-to-solve"&gt;project-based management of quicklisp libraries&lt;/a&gt;.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>The unquantified self #30</title><link>https://aliquote.org/post/unquantified-self-030/</link><pubDate>Thu, 02 Nov 2023 20:38:12 +0200</pubDate><guid>https://aliquote.org/post/unquantified-self-030/</guid><description>&lt;p&gt;Fresh new month here, November. Not much to say, so this post will be short.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve been fiddling with my TUI config (eh, mostly Neovim) for some days and I feel better, or sort of. At least, it&amp;rsquo;s now a purely homemade zero useless packages or package manager config. See &lt;a href="https://aliquote.org/post//post/vim-revamp-again/"&gt;here&lt;/a&gt; and &lt;a href="https://aliquote.org/post/neovim-lsp-easy/"&gt;there&lt;/a&gt; for more details.&lt;/p&gt;
&lt;p&gt;Along the way, I&amp;rsquo;ve been writing and sketching a bit (charcoal straight away) but it&amp;rsquo;s all very disjointed.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_3230.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_3230.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_3231.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_3231.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;I watched some nice mini-series recently: &lt;a href="https://en.wikipedia.org/wiki/1899_(TV_series)"&gt;1899&lt;/a&gt; and &lt;a href="https://en.wikipedia.org/wiki/Bodies_(2023_TV_series)"&gt;Bodies&lt;/a&gt;. After several series of moderate quality and interest, this was refreshing indeed. I also decided I couldn&amp;rsquo;t wait for my son to be ready to watch the latest season of &lt;a href="https://en.wikipedia.org/wiki/The_Walking_Dead_(TV_series)"&gt;The Walking Dead&lt;/a&gt;, so I am currently watching it in the evening. I remember when he introduced me to this series: after the first episode I was like &amp;ldquo;Meh, it will not be possible to go through all those episodes this year or the year after.&amp;rdquo; Finally, I liked it but I was probably biased since I liked watching it together with my son. Anyway, the show must go on.&lt;/p&gt;
&lt;p&gt;Finally, after 3 months off, I&amp;rsquo;m back with my little city in Minecraft. Thanks to WorldEdit mod, I was able to transfer some of my previous builds onto the new map.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2023-11-02_13.02.44.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2023-11-02_13.02.44.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2023-11-02_11.22.03.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2023-11-02_11.22.03.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Side note: I can&amp;rsquo;t believe I&amp;rsquo;m already at the 30th selfish post.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Shaka Ponk • &lt;em&gt;Palabra Mi Amor&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in October</title><link>https://aliquote.org/post/micro-10-2023/</link><pubDate>Mon, 30 Oct 2023 07:56:59 +0100</pubDate><guid>https://aliquote.org/post/micro-10-2023/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-10-02&lt;/a&gt;: I&amp;rsquo;d gone to buy some charcoal fixative but there was none in the bookshop. Hold my beer, I came away with these books:&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_3240.JPG" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-10-02&lt;/a&gt;: TIL about paps, as a replacement for a2ps for printing to a PS file (this is useful to print Neomutt email when there&amp;rsquo;s no default printer on your machine). h/t &lt;a href="https://stackoverflow.com/a/66961800"&gt;jimifiki&lt;/a&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set print_command=&amp;#34;paps --font=&amp;#39;Monospace 10&amp;#39; &amp;gt; /home/chl/tmp/mail.ps&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-10-03&lt;/a&gt;: Software used to be less demanding at one time.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Cc: haskell-cafe &amp;lt;haskell-cafe@haskell.org&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Date: Tue, 3 Oct 2023 06:46:02 +0200
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Subject: Re: [Haskell-cafe] two HLS processes with same namemac
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;OS needs just 1-2GiB of wired RAM, don’t worry…
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-10-04&lt;/a&gt;: ♪ Arlo Parks · Black Dog&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-10-08&lt;/a&gt;: Out of curiosity, I plugged my DAC (the little box above the Denon amp in &lt;a href="https://aliquote.org/post/music-setup/"&gt;this post&lt;/a&gt;) onto my computer and, guess what, it just worked!&lt;br&gt;&lt;img src="https://aliquote.org/img/2023-10-08-20-45-32.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-10-08&lt;/a&gt;:
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_3241.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_3241.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_3258.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_3258.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;small&gt;Stuff I made recently.&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-10-09&lt;/a&gt;: &lt;a href="https://awk.dev/eda.html"&gt;Exploratory Data Analysis for Humanities Data&lt;/a&gt;, and a load of Awk and Python scripts on the &lt;a href="https://www.hum307.com/"&gt;Literature as Data&lt;/a&gt; homepage.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-10-09&lt;/a&gt;: &lt;a href="https://blog.meain.io/2022/modern-text-editor/"&gt;What is in a modern code editor?&lt;/a&gt; Auto-formatters and terminal emulators are really a plus, indeed.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-10-12&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Linux is borrowing unused memory for disk caching. This makes it look like you are low on memory, but you are not! Everything is fine! &amp;mdash; &lt;a href="https://www.linuxatemyram.com/"&gt;Linux ate all my RAM&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-10-12&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Picking when to assert is much like picking when to comment, except more explicit and more effective. &amp;mdash; &lt;a href="https://www.aarsen.me/posts/2022-11-18-i-assert-thee.html"&gt;How to assert for fun and profit&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-10-12&lt;/a&gt;: There was a time we were able to wait the end of film or series credits to learn about the song titles and things like that. Thanks to Netflix, this is no longer possible, you will switch to the next ep. before you have time to reach the end of (all due) credits. Old times good times.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-10-16&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;There is a phenomenon in society which I find quite bizarre. Upon our entry to this mortal coil, we are endowed with self-awareness, agency, and free will. Each of the 8 billion members of this human race represents a unique person, a unique worldview, and a unique agency. Yet, many of us have the same fundamental goals and strive to live the same life. &amp;mdash; &lt;a href="https://drewdevault.com/2023/10/13/Going-off-script.html"&gt;Going off-script&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-10-16&lt;/a&gt;: &lt;a href="https://blog.plover.com/2024/10/15/#irish-logarithm-3"&gt;The discrete logarithm&lt;/a&gt;. &lt;code&gt;#math&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-10-18&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Over the last decade or so, Apple has been hard at work in simplifying the user interfaces that power its myriad platforms. I’ve welcomed most of that work, but it’s hard to deny that we’ve all lost some things along the way. &amp;mdash; &lt;a href="https://512pixels.net/2023/10/the-history-of-cover-flow/"&gt;The History of Cover Flow&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-10-18&lt;/a&gt;: Interesting read on &lt;a href="https://doisinkidney.com/posts/2020-12-14-enumerating-trees.html"&gt;enumerating trees&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-10-19&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_3266.JPG" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-10-19&lt;/a&gt;: Vim is great for cleaning a text file using search and replace, but sometimes Unix tools are even better: if you want to remove consecutive blank lines, just call &lt;code&gt;cat -s&lt;/code&gt; on your text file.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-10-19&lt;/a&gt;: ♪ Foo Fighters · Shame Shame&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-10-23&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;But just think back. In the past say ten years, what changes and innovations have had a real and true life changing impact on you? I am sure you can think of something, but I am also pretty sure that nothing has happened on a monthly or weekly basis that was so important that you absolutely had to know about it at that very moment. &amp;mdash; &lt;a href="https://unixsheikh.com/articles/do-you-feel-overwhelmed-trying-to-stay-up-to-date-with-the-latest-tech-news.html"&gt;Do you feel overwhelmed trying to stay up to date with the latest tech news?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-10-23&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;But let’s just put it this way (and here I’m being charitable): in all my years of using Word, this happened more than once. In all the time I’ve used text editors, it’s never happened, even once. &amp;mdash; &lt;a href="http://wcaleb.org/blog/my-academic-book-in-plain-text"&gt;Why (and How) I Wrote My Academic Book in Plain Text&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-10-23&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The most important thing to learn correctly about Vim is to understand that you talk to Vim when you edit text. Vim has a grammar. The next important thing is to learn how to use Vim macros. &lt;a href="https://unixsheikh.com/articles/vim-i-hate-to-love-you.html"&gt;Vim - I hate to love you&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-10-23&lt;/a&gt;: No more plugin manager, yet a fast startup time. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;&lt;img src="https://aliquote.org/img/2023-10-23-11-19-46.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-10-23&lt;/a&gt;: &lt;a href="https://www.openbsdhandbook.com/"&gt;OpenBSD Handbook&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-10-24&lt;/a&gt;: If you are using &lt;a href="https://github.com/lervag/vimtex"&gt;vimtex&lt;/a&gt; and are interested in using Evince for forward/reverse synchronization, be sure to check &lt;a href="https://github.com/peterbjorgensen/sved/"&gt;sved&lt;/a&gt; which at least provides reverse sync in Neovim. Otherwise, Zathura works as expected. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-10-24&lt;/a&gt;: TIL that you can &lt;a href="https://github.com/tmux/tmux/issues/2305#issue-655418215"&gt;clear your Tmux paste buffers&lt;/a&gt; by tagging everything (&lt;code&gt;C-t&lt;/code&gt;) then deleting it (&lt;code&gt;D&lt;/code&gt;).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-10-24&lt;/a&gt;: &lt;a href="https://phelipetls.github.io/posts/code-formatting-vim/"&gt;Ergonomic mappings for code formatting in Vim&lt;/a&gt;: Very nice tutorial on code formatting and how to write VimL functions that exploit &lt;code&gt;gq&lt;/code&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-10-24&lt;/a&gt;: &lt;a href="https://docs.pytest.org/en/7.4.x/"&gt;Pytest&lt;/a&gt; is really great: even simple &lt;code&gt;assert&lt;/code&gt; statements get processed, no need to write complex fixtures or test suite. This means you can write your scripts as usual and just &lt;code&gt;import pytest&lt;/code&gt;. To avoid contaminating your current directory with &lt;code&gt;__pycache__&lt;/code&gt; and &lt;code&gt;.pytest_cache&lt;/code&gt; directories, set the exported variable &lt;code&gt;PYTHONDONTWRITEBYTECODE=1&lt;/code&gt; and call pytest with &lt;code&gt;-p no:cacheprovider&lt;/code&gt;. You can set a simple compiler and errorformat for (Neo)vim by following this &lt;a href="https://phelipetls.github.io/posts/vim-errorformat-for-pytest/"&gt;blog post&lt;/a&gt;. Personally, I use &lt;code&gt;makeprg=pytest\ --tb=short\ -vv\ --no-header\ -p\ no:cacheprovider\ $*&lt;/code&gt; instead. &lt;code&gt;#python&lt;/code&gt; &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-10-26&lt;/a&gt;: No more &lt;a href="https://github.com/neovim/nvim-lspconfig"&gt;nvim-lspconfig&lt;/a&gt; means 15 ms less time spent in &lt;a href="https://aliquote.org/micro/2023-10-23-11-40-22/"&gt;starting up&lt;/a&gt;! &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;&lt;img src="https://aliquote.org/img/2023-10-26-21-17-34.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-10-27&lt;/a&gt;: Everything you ever wanted to know on how to execute &lt;a href="https://irian.to/blogs/executing-a-command-in-multiple-files-in-vim/"&gt;a command in multiple files in Vim&lt;/a&gt;. I mostly use &lt;code&gt;argo&lt;/code&gt; and &lt;code&gt;cdo&lt;/code&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-10-27&lt;/a&gt;: TIL that there are some interesting &lt;a href="https://github.com/neovim/neovim/wiki/C-programming"&gt;C programming&lt;/a&gt; tips on Neovim wiki. &lt;code&gt;#vim&lt;/code&gt; &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-10-27&lt;/a&gt;: &lt;a href="https://christophm.github.io/interpretable-ml-book/"&gt;Interpretable Machine Learning: A Guide for Making Black Box Models Explainable&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-10-28&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;This document is a sort of &lt;a href="https://everything2.com/?node=quine"&gt;quine&lt;/a&gt;. If you select the whole page in your browser and paste it into a file, this text shows up encoded in a weird &lt;a href="https://en.wikipedia.org/wiki/Markdown"&gt;Markdown&lt;/a&gt; variant embedded in a string literal inside a &lt;a href="https://racket-lang.org/"&gt;Racket lisp&lt;/a&gt; script. Evaluating the file with &lt;code&gt;racket -f $FILE&lt;/code&gt; evaluates the lisp, converting the weird Markdown and producing the same HTML document that your browser received. &amp;mdash; &lt;a href="https://cgad.ski/"&gt;https://cgad.ski/&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-10-28&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Vim is not an IDE. It can be customized to look like one, but the more you try to make it to look like an IDE, the less it behaves like vim (fast and lightweight). If you need a full-fledged IDE features, use a real IDE. &amp;mdash; &lt;a href="https://irian.to/blogs/why-i-use-vim/"&gt;Why I Use Vim&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-10-28&lt;/a&gt;: I keep getting this kind of weird stuff on my pretty old iPhone. Internet was less complicated back in the time, especially when Apple was not tying up software to hardware to such an extent.&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_3280.PNG" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-10-28&lt;/a&gt;: &lt;a href="http://pespmc1.vub.ac.be/ASHBBOOK.html"&gt;Ashby&amp;rsquo;s book &amp;ldquo;Introduction to Cybernetics&amp;rdquo;&lt;/a&gt;: One of the very first English textbook I bought when I was a PhD student involved in some kind of Neurosciences back at the time.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-10-28&lt;/a&gt;: &lt;a href="https://marache.net/post/chicken-scheme-thoughts.html"&gt;Compiling Chicken Scheme scripts&lt;/a&gt;. &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-10-28&lt;/a&gt;: ♪ Fay Claassen · Almost Blue&lt;br&gt;&lt;/p&gt;</description></item><item><title>Neovim and LSP made easy</title><link>https://aliquote.org/post/neovim-lsp-easy/</link><pubDate>Fri, 27 Oct 2023 18:02:14 +0200</pubDate><guid>https://aliquote.org/post/neovim-lsp-easy/</guid><description>&lt;p&gt;Continuing the rewrite of my Neovim config described in &lt;a href="https://aliquote.org/post/vim-revamp-again/"&gt;this post&lt;/a&gt;, I decided to get ride of &lt;a href="https://github.com/neovim/nvim-lspconfig"&gt;nvim-lspconfig&lt;/a&gt;. Indeed, since version 0.8 Neovim offers some convenient functions and autocommands to start an LSP server with predefined mappings which can be made aware of available server capabilities. This is well explained by &lt;a href="https://zignar.net/2022/10/01/new-lsp-features-in-neovim-08/"&gt;Mathias Fußenegger&lt;/a&gt;. I came across his post some months ago and forgot about it. And then I found a similar discussion on another &lt;a href="https://f1sty.github.io/neovim/nvim/lsp/language-server/config/dotfiles/completion/2023/09/10/simple-nvim-lsp-setup.html"&gt;blog post&lt;/a&gt;. So why not remove nvim-lspconfig and define LSP settings in my ftplugin directory. This way, I get all vimL stuff in after/ftplugin, with appropriate guards for nvim and executable that I use for linting and formatting, and all Lua stuff in my init.lua and ftplugin.&lt;/p&gt;
&lt;p&gt;This solved many problems at the same time. First, nvim-lspconfig doesn&amp;rsquo;t let me loop over a series of server so easily. For instance, the following loop must account for specific servers that need additional settings (e.g., clangd to get background indexing, etc.) or slight modification from the default config (e.g., racket_langserver which is defined for racket and scheme filetype &amp;ndash; we really don&amp;rsquo;t want the second one):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lua" data-lang="lua"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;servers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;...&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lsp&lt;/span&gt; &lt;span class="kr"&gt;in&lt;/span&gt; &lt;span class="n"&gt;ipairs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;servers&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="kr"&gt;do&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;nvim_lsp&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;lsp&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;setup&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;on_attach&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;on_attach&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;capabilities&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;capabilities&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;})&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Second, there are some edge cases, which I think are related to the definition of the project root directory for LSP that really need a &lt;code&gt;root_dir&lt;/code&gt; (e.g., clojure_lsp), meaning that the server will start if I open a file with the associated filetype directly but not after a simple &lt;code&gt;vim .&lt;/code&gt; from the root directory. On the other hand, nvim-lspconfig provides some interesting functions to define the root directory of a project (pending the minor issue just mentioned) or to query the server state, and to restart it if required.&lt;/p&gt;
&lt;p&gt;So, how does the in-built facilities of Neovim solve my concerns? I can now isolate the logic of writing specific settings for each LSP in separate files that live in ftplugin, while defining common guarded features relevant to all LSPs. Here is a simple example in the case of Python (I use pyright in this case):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lua" data-lang="lua"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;-- ftplugin/python.lua&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;pyright&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cmd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;pyright-langserver&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;--stdio&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;root_dir&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;vim.fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dirname&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vim.fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;find&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;setup.py&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;pyproject.toml&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;setup.cfg&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;requirements.txt&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;.git&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;upward&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;})[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;vim.lsp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;reuse_client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kr"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;conf&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kr"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;client.name&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;conf.name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;client.config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;root_dir&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;conf.root_dir&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;conf.root_dir&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;vim.startswith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;api.nvim_buf_get_name&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/usr/lib/python&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kr"&gt;end&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;augroup&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;vim.api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nvim_create_augroup&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;PythonFormatting&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{})&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;vim.api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nvim_clear_autocmds&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="n"&gt;group&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;augroup&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;buffer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;bufnr&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;vim.api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nvim_create_autocmd&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;BufWritePre&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;group&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;augroup&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buffer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;bufnr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;callback&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kr"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vim.api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nvim_command&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;call FormatFile()&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kr"&gt;end&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The last block allow to complement pyright with autoformatting thanks to a custom VimL function, inspired from &lt;a href="https://phelipetls.github.io/posts/code-formatting-vim/"&gt;this post&lt;/a&gt;, that checks the value of &lt;code&gt;formatprg&lt;/code&gt; associated with that filetype. This is defined in &lt;code&gt;after/ftplugin&lt;/code&gt;, which further allows me to use &lt;code&gt;gq&lt;/code&gt; whenever I want.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-vim" data-lang="vim"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;&amp;#34; after/ftplugin/python.vim&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;setlocal&lt;/span&gt; &lt;span class="nx"&gt;formatprg&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;python3&lt;/span&gt;\ &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;m&lt;/span&gt;\ &lt;span class="nx"&gt;macchiato&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2024-08-18]&lt;/small&gt;&lt;br&gt;
Heiker Curiel has several blog posts that describe how to setup LSP in Neovim without relying on nvim-lspconfig, in particular &lt;a href="https://vonheikemen.github.io/devlog/tools/manage-neovim-lsp-client-without-plugins/"&gt;Can we manage neovim&amp;rsquo;s LSP client without plugins?&lt;/a&gt; and &lt;a href="https://vonheikemen.github.io/devlog/tools/neovim-lsp-client-guide/"&gt;A guide on Neovim&amp;rsquo;s LSP client&lt;/a&gt;.
&lt;/div&gt;
&lt;p&gt;Then I defined mappings and an autocommand in my &lt;code&gt;init.lua&lt;/code&gt; file:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lua" data-lang="lua"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;vim.api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nvim_create_autocmd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;LspAttach&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;callback&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kr"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;vim.lsp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get_client_by_id&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;args.data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;client_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;augroup&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;vim.api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nvim_create_augroup&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;LspFormatting&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{})&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vim.keymap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;i&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&amp;lt;C-k&amp;gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;vim.lsp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;buf.signature_help&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;buffer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;args.buf&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vim.keymap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;n&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;K&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;vim.lsp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;buf.hover&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;buffer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;args.buf&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vim.keymap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;n&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;gd&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&amp;lt;cmd&amp;gt;lua require(&amp;#39;fzf-lua&amp;#39;).lsp_definitions({ jump_to_single_result = true })&amp;lt;cr&amp;gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vim.keymap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;n&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;gr&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&amp;lt;cmd&amp;gt;lua require(&amp;#39;fzf-lua&amp;#39;).lsp_references()&amp;lt;cr&amp;gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kr"&gt;if&lt;/span&gt; &lt;span class="n"&gt;client.server_capabilities&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;codeActionProvider&lt;/span&gt; &lt;span class="kr"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vim.keymap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;n&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;z=&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&amp;lt;cmd&amp;gt;lua require(&amp;#39;fzf-lua&amp;#39;).lsp_code_actions()&amp;lt;cr&amp;gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kr"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kr"&gt;if&lt;/span&gt; &lt;span class="n"&gt;client.server_capabilities&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;renameProvider&lt;/span&gt; &lt;span class="kr"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vim.keymap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;n&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;zr&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;vim.lsp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;buf.rename&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;buffer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;args.buf&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kr"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kr"&gt;if&lt;/span&gt; &lt;span class="n"&gt;client.server_capabilities&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;documentSymbolProvider&lt;/span&gt; &lt;span class="kr"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vim.keymap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;n&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;go&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&amp;lt;cmd&amp;gt;lua require(&amp;#39;fzf-lua&amp;#39;).lsp_document_symbols()&amp;lt;cr&amp;gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kr"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kr"&gt;if&lt;/span&gt; &lt;span class="n"&gt;client.server_capabilities&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;workspaceSymbolProvider&lt;/span&gt; &lt;span class="kr"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vim.keymap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;n&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;gO&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&amp;lt;cmd&amp;gt;lua require(&amp;#39;fzf-lua&amp;#39;).lsp_workspace_symbols()&amp;lt;cr&amp;gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kr"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kr"&gt;if&lt;/span&gt; &lt;span class="n"&gt;client.server_capabilities&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;codeLensProvider&lt;/span&gt; &lt;span class="kr"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vim.api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nvim_create_autocmd&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;CursorMoved &amp;#34;&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;callback&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kr"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vim.lsp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;codelens.refresh&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kr"&gt;end&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;})&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vim.keymap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;n&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;z!&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;vim.lsp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;codelens.run&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;buffer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;args.buf&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;silent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kr"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kr"&gt;if&lt;/span&gt; &lt;span class="n"&gt;client.supports_method&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;textDocument/formatting&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="kr"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;-- vim.api.nvim_buf_create_user_command(bufnr, &amp;#39;Format&amp;#39;, function() vim.lsp.buf.format() end)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vim.keymap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;n&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;g=&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;vim.lsp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;buf.format&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;buffer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;args.buf&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vim.api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nvim_clear_autocmds&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="n"&gt;group&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;augroup&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;buffer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;bufnr&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vim.api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nvim_create_autocmd&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;BufWritePre &amp;#34;&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;group&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;augroup&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buffer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;bufnr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;callback&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kr"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vim.lsp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;buf.format&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="n"&gt;async&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kr"&gt;end&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;})&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kr"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kr"&gt;end&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note that I use &lt;a href="https://github.com/ibhagwan/fzf-lua"&gt;fzf-lua&lt;/a&gt; as a fuzzy picker for many things in this case.&lt;/p&gt;
&lt;p&gt;Needless to say, my Neovim &lt;a href="https://aliquote.org/micro/2023-10-26-21-18-02/"&gt;starts even faster now&lt;/a&gt;.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Editors • &lt;em&gt;Like Treasure&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>A minimalistic Lua-based Neovim config</title><link>https://aliquote.org/post/vim-revamp-again/</link><pubDate>Mon, 23 Oct 2023 20:15:38 +0200</pubDate><guid>https://aliquote.org/post/vim-revamp-again/</guid><description>&lt;p&gt;It hasn&amp;rsquo;t taking long before I decided to trash my new &lt;a href="https://aliquote.org/post/lazy-nvim/"&gt;Lua config&lt;/a&gt;. I originally wanted to give &lt;a href="https://github.com/folke/lazy.nvim"&gt;lazy.nvim&lt;/a&gt; a try since packer has been discontinued. I was not able to reduce my startup time further, and this wasn&amp;rsquo;t in par with my old packer-based config. Independent of this, I felt quite unhappy with the added layer of complexity provided by &lt;a href="https://github.com/williamboman/mason.nvim"&gt;mason.nvim&lt;/a&gt; and satellite plugins. More to the point, some LSPs, linters (for &lt;a href="https://github.com/mfussenegger/nvim-lint"&gt;nvim-lint&lt;/a&gt;) or formatters (for &lt;a href="https://github.com/stevearc/conform.nvim"&gt;conform.nvim&lt;/a&gt;) were not available in Mason registry, meaning that I add to configure them outside of Mason handlers, in addition to installing them myself. That makes these plugins rather limited in their usefulness, IMHO. So, let&amp;rsquo;s rewrite it from scratch!&lt;/p&gt;
&lt;p&gt;First, I&amp;rsquo;ve stuck to the aim of working on a single configuration file, rather than splitting it up into different files in the dedicated &lt;code&gt;lua&lt;/code&gt; directory. Also, I decided to stop using a plugin manager since Vim and Neovim both ship with a decent plugin system. What&amp;rsquo;s more, it will help me not to update my plugins every two days or so. And I get the full Git log as well. In a few words, I ended up with the following set of plugins:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;~/.config/nvim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» tree -L &lt;span class="m"&gt;3&lt;/span&gt; pack
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pack
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;└── plugins
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── opt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; │   ├── neogen
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; │   ├── nvim-colorizer
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; │   ├── vim-dasht
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; │   └── vim-sexp
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; └── start
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── Comment
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── fzf-lua
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── nvim-lspconfig
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── nvim-treesitter
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── nvim-treesitter-textobjects
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── orgmode
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; └── vimtex
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="m"&gt;14&lt;/span&gt; directories, &lt;span class="m"&gt;0&lt;/span&gt; files
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As can be seen, I put orgmode and vimtex in the &amp;ldquo;start&amp;rdquo; folder, which means they are loaded when Neovim is fired up. My own benchmarks suggest this has no noticeable effect on startup time. With only fzf-lua, I&amp;rsquo;m at 25 ms of startup time, while the full config increases it by about 20-25 ms. That&amp;rsquo;s cheap. Note that I don&amp;rsquo;t use a lot of plugins, I have a lot of custom settings living in my &lt;code&gt;after/ftplugin&lt;/code&gt; directory, plus additional commands and autocommands.&lt;/p&gt;
&lt;p&gt;I think about it this way: you really want a clever fuzzy picker, and I already Fzf to manage my shell history, browsing directory, or managing my bibliographic entries in the shell. By the way, I upgraded my very outdated version of Fzf that I got via the official apt repository. Now I&amp;rsquo;m running version 0.43.0 (d3311d9) and I can use &lt;code&gt;git_bcommits&lt;/code&gt; and &lt;code&gt;git_commits&lt;/code&gt; again (it stopped working in recent months, which I bissected to &lt;a href="https://github.com/ibhagwan/fzf-lua/commit/64c980d8aaaf493a768a4cf6158d7f2a384b0368"&gt;this commit&lt;/a&gt;). Besides, the availability of default LSP settings as well as treesitter &amp;ldquo;text objects&amp;rdquo; is often an underrated value: you get both linting and formatting for free (Neovim builtins and Fzf can take care of the rest for you), as well as semantic and/or structural editing capabilities. When no fixer is available, yuo can always rely on &lt;a href="https://phelipetls.github.io/posts/code-formatting-vim/"&gt;&lt;code&gt;formatprg&lt;/code&gt;&lt;/a&gt; or &lt;a href="https://gist.github.com/romainl/ce55ce6fdc1659c5fbc0f4224fd6ad29"&gt;autocommands&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I use &lt;a href="https://github.com/sunaku/vim-dasht/"&gt;vim-dasht&lt;/a&gt; to complement the LSP hover provider, or simply as a documentation handler when there&amp;rsquo;s no LSP in use (e.g., Scheme, Lisp); it also proved to be useful with Python for which &lt;code&gt;pyright&lt;/code&gt; provides nothing more than function signature in most cases. I use &lt;a href="https://github.com/danymat/neogen"&gt;neogen&lt;/a&gt; to generate Python and C&amp;rsquo;s docstrings. I&amp;rsquo;m too lazy to think about it (or even remember how to format Google and Numpy docstrings), so this comes handy in this particular case. As said above, I can manage &lt;a href="https://aliquote.org/post/neovim-compiler/"&gt;formatting and linting&lt;/a&gt; myself, and Neovim has excellent support for completion via &lt;code&gt;C-x C-o&lt;/code&gt;, &lt;code&gt;C-x C-n&lt;/code&gt;, &lt;code&gt;C-x C-f&lt;/code&gt;, and friends. The rest is already builtin, e.g., want a tree explorer, try &lt;code&gt;:15Lex&lt;/code&gt;; need some Git info, FzfLua get you covered. Everything that is not related to text editing &lt;em&gt;per se&lt;/em&gt; is probably better handled in your terminal by a dedicated application.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Dead Can Dance • &lt;em&gt;Carnival of Light&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>More useful Vim tips</title><link>https://aliquote.org/post/more-useful-vim-tips/</link><pubDate>Wed, 18 Oct 2023 21:36:37 +0200</pubDate><guid>https://aliquote.org/post/more-useful-vim-tips/</guid><description>&lt;p&gt;It&amp;rsquo;s been 3 years that I am using Neovim as my daily driver. I learned a lot of things in the mean time. The only things left are macros and registers, which I don&amp;rsquo;t really use, except registers for basic stuff. Here is a list of things that come to my mind when I think about Vim (not the modal editor, rather the builtins):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Be lazy&lt;/em&gt; when you load plugins: I&amp;rsquo;ve been using &lt;a href="https://github.com/wbthomason/packer.nvim"&gt;packer&lt;/a&gt; for two years and it was all good, I could get a startup time below 50 ms with a dozen of packages. Now that I use &lt;a href="https://github.com/folke/lazy.nvim"&gt;lazy&lt;/a&gt;, I got comparable improvements in startup time with even more packages.&lt;/li&gt;
&lt;li&gt;Don&amp;rsquo;t forget &lt;em&gt;builtin commands&lt;/em&gt;: There are a lot of useful commands already available in Vim, and many shortcuts that are worth learning, e.g., for manipulating windows and tabs or the &lt;code&gt;z&lt;/code&gt; and &lt;code&gt;g&lt;/code&gt; prefixed commands.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Search and replace using regex&lt;/em&gt; are powerful tools: Use capture groups eagerly, like in &lt;code&gt;:%s/\([0-9]*\).*/\1/&lt;/code&gt;; also, don&amp;rsquo;t forget you can save search results in a file, e.g. &lt;code&gt;g/pattern/.w! &amp;gt;&amp;gt; out.txt&lt;/code&gt;, if you need to process them afterwards.&lt;/li&gt;
&lt;li&gt;Prefer a &lt;em&gt;low contrast monochromatic colorscheme&lt;/em&gt; to avoid Christmas tree-like effects; &lt;a href="https://github.com/nvim-treesitter/nvim-treesitter"&gt;treesitter&lt;/a&gt; should take care of highlighting the right stuff, and it will be helpful to perform &lt;a href="https://github.com/nvim-treesitter/nvim-treesitter-textobjects"&gt;structural editing&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2023-11-21]&lt;/small&gt;&lt;br&gt;
See this excellent discussion on &lt;a href="https://andreyor.st/posts/2023-11-17-overcolorization/"&gt;Overcolorization&lt;/a&gt;: &amp;ldquo;Syntax highlighting is a tool, and highlighting important parts of the code makes programming less convoluted. Pretty colors are nice to have, but if the point is only to make the code look fancy, there’s no real value for what we’re trying to do in the end - write better code. Let’s help each other at least at that.&amp;rdquo;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Use &lt;em&gt;templates for your one-liner&lt;/em&gt;: You can define a set of autocommands or a simple mapping to insert a file right into your buffer; in the latter case, &lt;code&gt;:-1 read&lt;/code&gt; allows to place a template file above the insertion point, in contrast to the default behavior of &lt;code&gt;:read&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;formatprg&lt;/code&gt; and &lt;code&gt;equalprog&lt;/code&gt; are invaluable if you don&amp;rsquo;t use or don&amp;rsquo;t have a relevant LSP at hand. Vim is quite good at indenting, so you&amp;rsquo;re more likely to deal with &lt;code&gt;formatprg&lt;/code&gt;. For instance, to format bibliographic entries in a Bibtex file, you could define &lt;code&gt;setlocal formatprg=bibclean\ -align-equals\ -brace-protect\ -delete-empty-values\ -fix-accents\ -quiet&lt;/code&gt; in your &lt;code&gt;after/ftplugin/bib.vim&lt;/code&gt;, and then &lt;code&gt;gqip&lt;/code&gt; the current entry.&lt;/li&gt;
&lt;li&gt;You usually want to put your custom settings in &lt;code&gt;after/ftplugin&lt;/code&gt; rather than &lt;code&gt;plugin&lt;/code&gt;. If possible, keep it orthogonal to your init file so that you can use a minimal init file that is shareable across machines while your &lt;code&gt;after&lt;/code&gt; folder get you load of enhancements to the core config.&lt;/li&gt;
&lt;li&gt;Read the documentation (and learn to navigate inside) rather than spending hours browsing the internet to learn about the latest cool plugins (which is only compatible with the next-to-last version of Neovim); that is, write small functions or commands that do 90% of what you expect, rather than plugging in yet another plugin. Most of what you will read from past &lt;a href="https://vim.fandom.com/wiki/Vim_Tips_Wiki"&gt;Vim wikis&lt;/a&gt; still apply as of today in Neovim, so don&amp;rsquo;t reinvent the wheel.&lt;/li&gt;
&lt;li&gt;We rarely need to &lt;code&gt;&amp;lt;C-z&amp;gt;&lt;/code&gt; these days, thanks to the builtin terminal emulator.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2023-10-25]&lt;/small&gt;&lt;br&gt;
See also &lt;a href="https://www.hillelwayne.com/post/intermediate-vim/"&gt;At least one Vim trick you might not know&lt;/a&gt; and &lt;a href="https://codeinthehole.com/tips/vim-lists/"&gt;Vim&amp;rsquo;s useful lists&lt;/a&gt; for useful tips.
&lt;/div&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Yasmin Levy • &lt;em&gt;Mano Suave&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>On the use of triplicate in biology</title><link>https://aliquote.org/post/triplicate-and-repeated/</link><pubDate>Mon, 16 Oct 2023 20:05:57 +0200</pubDate><guid>https://aliquote.org/post/triplicate-and-repeated/</guid><description>&lt;p&gt;In behavioral quantitative measurement, we are used to repetition within and between condition, that is a given subject is exposed to all conditions, or a subset thereof, in a complete or incomplete factorial design, and for each condition a certain number of repetitions of the same measurement are done. This is the so-called repeated measure design. In biology, researchers rather talk about technical and biological replicates. They are not the same: technical replicates are readings collected from the same statistical unit, while biological replicates are independent statistical units. Usually, both type of replication are carried out. Note that this is different from repeated measurements since biological replicates which involve different samples are exposed to different experimental conditions. But technically, technical replicates are repeated measures within a subject $\times$ condition treatment.&lt;/p&gt;
&lt;p&gt;Next, there are two questions that always puzzled me: (1) technical replication is often performed using triplicates; (2) mixed-effect models are rarely used in practice, rather technical replicates are averaged and the analysis is performed using statistical tests for independent group (ANOVA, t-test, etc.).&lt;/p&gt;
&lt;p&gt;I don&amp;rsquo;t think there&amp;rsquo;s any statistical justification for the use of $k=3$ technical replicates rather than, say, $k=10$. Three observations are enough to gauge the precision of the measurement, and discard an outlying value if necessary, but larger sample sizes for &lt;a href="https://www.walesgenepark.cardiff.ac.uk/wp-content/uploads/2020/10/WGPtech_replicates.pdf"&gt;biological replicates&lt;/a&gt; (PDF) are better especially when we want to get a more precise averaged or pooled estimate and/or we are dealing with small effect sizes. It is common in RNA-Seq experiments to consider only 3 biological replicates, although it would be considered as the absolute minimum.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;My small Dr. DuckDuckGo literature review yielded the following articles or tech notes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3321166/"&gt;Replicates and repeats—what is the difference and is it significant?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.molbiolcell.org/doi/10.1091/mbc.E15-02-0076"&gt;Empowering statistical methods for cellular and molecular biologists&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.nature.com/articles/nmeth.3091"&gt;Replication&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3658022/"&gt;Bioanalytical method validation: An updated review&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In &lt;a href="https://www.sciencedirect.com/science/article/pii/S0169743906001687"&gt;To triplicate or not to triplicate?&lt;/a&gt;, the authors used mixed-effect models to assess the contribution of the between variance to the total variance and they showed that (it can be shown that the intraclass correlation coefficient $\rho &amp;lt; 1$ ($\rho = 0$ only in the case where the within sample units are independent), when the numbr of replicates $m \geq 2$, the width of the 95% CI for the average of the $m$ within sample units is reduced by a factor $\sqrt{\hat\rho + (1 - \hat\rho)/m}$. For $m=1$ the maximum reduction of the CI width equals $1 - \sqrt{1/m}$ when $\rho = 0$. With triplicates, we can achieve about 20% reduction for $\rho = 0.5$.&lt;/p&gt;
&lt;p&gt;Cell lines remain problematic anyway: Imagine the case where a cell line is split into different colonies which are then left to grow either as control (untreated) vs. experimental (treated) condition; since all cells were extracted from the same tube. In this case, these are not biological replicates. See also &lt;a href="https://biology.stackexchange.com/questions/111030/cell-culture-experiments-technical-or-biological-replicates"&gt;Cell culture experiments, technical or biological replicates?&lt;/a&gt;.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Joy Division • &lt;em&gt;Transmission&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Schurch, N. J. et al. 2016. How many biological replicates are needed in an RNA-seq experiment and which differential expression tool should you use? &lt;em&gt;RNA&lt;/em&gt; 22(6): 839-851. The authors show that with only three biological replicates, &amp;ldquo;nine of the 11 tools evaluated found only 20%–40% of the significantly differentially expressed (SDE) genes identified with the full set of 42 clean replicates,&amp;rdquo; and that 20 replciates are reuquired to achieve &amp;gt;85% accuracy.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>ArXiving on October 2023</title><link>https://aliquote.org/post/arxiv-14/</link><pubDate>Fri, 13 Oct 2023 12:24:09 +0200</pubDate><guid>https://aliquote.org/post/arxiv-14/</guid><description>&lt;h3 id="fishers-pioneering-work-on-discriminant-analysis-and-its-impact-on-ai-"&gt;Fisher&amp;rsquo;s Pioneering work on Discriminant Analysis and its Impact on AI (&lt;a href="https://arxiv.org/abs/2309.04774v1"&gt;https://arxiv.org/abs/2309.04774v1&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;It&amp;rsquo;s a little bit funny to see the name of Ronald Fisher associated to AI in the title of scientific paper, especially since AI now means LLMs and other brilliant foundations for the future millennium. Anyway, the iris dataset is used to illustrate the use of a discriminant function (as the ratio of squared mean and variance) to demonstrate whether &amp;ldquo;when we use the linear compound of the four measurements most appropriate for discriminating three such species, the mean value for &lt;em&gt;I. versicolor&lt;/em&gt; takes an intermediate value and, if so, whether it differs twice as much from &lt;em&gt;I. setosa&lt;/em&gt; as from &lt;em&gt;I. virginica&lt;/em&gt;, as might be expected, if the effect of genes are simply additive, in a hybrid between a diploid and a tetraploid species.&amp;rdquo; &lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; Hence, a genetic hypothesis, which can be exploited to find the optimal linear combination of population means, $\mu_1 -3\mu2 + 2\mu_3 = 0$ (respectively, setosa, versicola and virginica), was at the heart of Fisher&amp;rsquo;s seminal paper, like many of his other contributions. Sadly, the iris dataset is mostly used in the context of unsupervised classification (k-means, for instance), as if people forgot that it relies at its heart on a well-defined hypothesis (much like people forgot or still ignore that Student (Gosset&amp;rsquo;s nom de plume) developed his test while working in a brewery). It seems the point of the authors is the notion of a discriminating rule, which, when applied to AI problems, amounts to a supervised approach that aims to find a &amp;ldquo;rule to separate distinct populations, and then to use that rule (or a different classification scheme) to allocate a new observation to the given populations.&amp;rdquo;&lt;/p&gt;
&lt;h3 id="a-compendium-of-data-sources-for-data-science-machine-learning-and-artificial-intelligence-"&gt;A compendium of data sources for data science, machine learning, and artificial intelligence (&lt;a href="https://arxiv.org/abs/2309.05682"&gt;https://arxiv.org/abs/2309.05682&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;This article summarizes a long list of data repositories spanning a dozen or so domains (including satellite data or sports, for instance). I will keep it on hand just in case I need some dataset one day.&lt;/p&gt;
&lt;h3 id="demystifying-statistical-matching-algorithms-for-big-data-"&gt;Demystifying Statistical Matching Algorithms for Big Data (&lt;a href="https://arxiv.org/abs/2309.05859"&gt;https://arxiv.org/abs/2309.05859&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;Propensity scoring is widely used in the absence of a controlled experiment, e.g. in observational studies, where as the authors say matching is used to pair treated and control units with similar value of potential confounders (aka, the propensity score). Usually, matching is done with replacement, that is a control is paired to several treated units (1-to-n matching, with replacement). There are &lt;a href="https://www.stata.com/features/causal-inference/"&gt;other estimators&lt;/a&gt; (e.g., inverse probability weighting or doubly robust methods), though. &lt;a href="https://bmcmedresmethodol.biomedcentral.com/articles/10.1186/s12874-021-01454-z"&gt;Oversampling and replacement strategies&lt;/a&gt; may alter the balance between bias and variance. In the case of matching without replacement, greedy approaches are used; in Stata, there&amp;rsquo;s a command &lt;code&gt;calipmatch&lt;/code&gt; which does the job for you, while in R the /de facto/ packages are probably &lt;code&gt;Matching&lt;/code&gt; and &lt;code&gt;MatchIt&lt;/code&gt;. In this paper, the authors review alternative approaches, namely optimal statistical matching (linear balanced and unbalanced assignment problem, maximum cardinality matching, and minimal cost matching).&lt;/p&gt;
&lt;h3 id="subgroup-detection-in-linear-growth-curve-models-with-generalized-linear-mixed-model-glmm-trees-"&gt;Subgroup detection in linear growth curve models with generalized linear mixed model (GLMM) trees (&lt;a href="https://arxiv.org/abs/2309.05862"&gt;https://arxiv.org/abs/2309.05862&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;Here is another paper by Achim Zeilis on regression trees. This time, it deals with &amp;ldquo;extended&amp;rdquo; GLMMs for identifying subgroups in growth curve modeling. It&amp;rsquo;s been a long time since I first used &lt;a href="https://cran.r-project.org/web/packages/partykit/index.html"&gt;partykit&lt;/a&gt; for tree-structured regression and classification models, and this was in a benchmark with classical CART, &lt;a href="https://www.tandfonline.com/doi/abs/10.1198/1061860032238"&gt;logic regression&lt;/a&gt;, and ensemble methods (random forests and boosting); this didn&amp;rsquo;t end up in a paper, but it was a fun exercise. Since then, a lot of work has been put forward into this framework and I&amp;rsquo;m not really up to date. Unlike other methods for partitioning latent growth curves, this modeling framework set up a mixed approach: &amp;ldquo;GLMM trees do not fit a full parametric model in each of the subgroups defined by the terminal nodes of the tree. Instead, fixed-effects parameters are estimated locally, using the observations within a terminal node, and the random-effects parameters are estimated globally, using all observations.&amp;rdquo;&lt;/p&gt;
&lt;h3 id="a-change-point-approach-to-estimating-the-proportion-of-false-null-hypotheses-in-multiple-testing-"&gt;A Change-Point Approach to Estimating the Proportion of False Null Hypotheses in Multiple Testing (&lt;a href="https://arxiv.org/abs/2309.10017"&gt;https://arxiv.org/abs/2309.10017&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;I have used FDR correction for multiple comparisons here and there, as an alternative to sequential methods like Holm&amp;rsquo;s approach (which is the default in R&amp;rsquo;s &lt;code&gt;p.adjust&lt;/code&gt;, btw). The authors offer an alternative data-driven method to the classical Storey&amp;rsquo;s method (i.e., a family of true null proportion of false null hypotheses estimators) for estimating the FDR. In this case, the sorted p-values are approximated using a piecewise linear function with one change point (inversion of slope), as illustrated below. This is somewhat akin to the knee/elbow method or scree plots for determining the number of principal components or factors to retain in PCA or FA, which is discussed in section C.1.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2023-10-16-20-45-29.png"&gt;
&lt;/figure&gt;
&lt;h3 id="a-new-bootstrap-goodness-of-fit-test-for-normal-linear-regression-models-"&gt;A New Bootstrap Goodness-of-Fit Test for Normal Linear Regression Models (&lt;a href="https://arxiv.org/abs/2309.10614"&gt;https://arxiv.org/abs/2309.10614&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;Yet another article discussing the benefit of using bootstrap to assess model goodness-of-fit. Rather than visual inspection of so-called residual plots (residuals vs. fitted values), especially in multivariate regression, or relying on either the White or Breusch-Pagan test. The test presented here allows to test all assumptions of normal linear regression:&lt;/p&gt;
&lt;p&gt;For test level $\alpha$, candidate normal linear model $\mathcal{M}$, bootstrap iterations $B$, sample size $n$, and a null hypothesis that $\mathcal{M}$ is adequately specified:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Resample, with replacement, outcomes with covariates to generate a bootstrap sample of size $n$.&lt;/li&gt;
&lt;li&gt;Fit model $\mathcal{M}$ to this bootstrap sample, and with this fitted model, calculate $\text{Var}[\text{GOF}]$and record this statistic.&lt;/li&gt;
&lt;li&gt;Repeat steps 1-2 $B$ times to generate an empirical bootstrap distribution for $\text{Var}[\text{GOF}]$.&lt;/li&gt;
&lt;li&gt;Construct a $100\times (1−\alpha)$% bootstrap confidence interval for $\text{Var}[\text{GOF}]$.&lt;/li&gt;
&lt;li&gt;If this interval does not contain $2n$, reject the null hypothesis at the $\alpha$ level. If it does contain $2n$, the null hypothesis was not rejected and model $\mathcal{M}$ does not appear to exhibit lack-of-fit.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id="unveiling-challenges-in-mendelian-randomization-for-gene-environment-interaction-"&gt;Unveiling Challenges in Mendelian Randomization for Gene-Environment Interaction (&lt;a href="https://arxiv.org/abs/2309.12152"&gt;https://arxiv.org/abs/2309.12152&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;As a sequel to this 10-years &lt;a href="https://aliquote.org/post/mendelian-randomization/"&gt;old post&lt;/a&gt;, here is a paper that uses genetic variants as instrumental variables (2-stage predictor substitution and the 2-stage residual inclusion) to estimate causal effects in GWAS on lifestyle and environmental factors.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Public Image Ltd • &lt;em&gt;Rise&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Fisher, R. A. (1936) The use of multiple measurements in taxonomic problems. &lt;em&gt;Ann. Eugen.&lt;/em&gt;, 7, 179–188.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Neovim revamp</title><link>https://aliquote.org/post/lazy-nvim/</link><pubDate>Thu, 12 Oct 2023 11:34:11 +0200</pubDate><guid>https://aliquote.org/post/lazy-nvim/</guid><description>&lt;p&gt;Recently, I switched to &lt;a href="https://github.com/folke/lazy.nvim"&gt;lazy.nvim&lt;/a&gt; to manage my Neovim plugins. I&amp;rsquo;m thus writing yet another post on Vim with a fresh new configuration. Reasons are multiple but quite simple: I wanted a more minimalistic set of config files (ideally one or two Lua files) allowing me to keep my &lt;code&gt;after/ftplugin&lt;/code&gt; directory as optional in case I need to transfer my config to other machines; &lt;a href="https://github.com/wbthomason/packer.nvim"&gt;packer&lt;/a&gt; looks like it will no longer be in use (it is already archived), like is the case for &lt;a href="https://github.com/jose-elias-alvarez/null-ls.nvim/issues/1621"&gt;null-ls.nvim&lt;/a&gt;; I still want blazing fast startup time (before moving to that new config, I was well under 30 ms, as measured by hyperfine or vim-startuptime).&lt;/p&gt;
&lt;p&gt;TL;DR I got a twofold increase in startup time, but I only need to manage a single lua file now.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;~/.config/nvim 16m18» hyperfine &lt;span class="s2"&gt;&amp;#34;nvim --headless +qa&amp;#34;&lt;/span&gt; --warmup &lt;span class="m"&gt;5&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Benchmark 1: nvim --headless +qa
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Time &lt;span class="o"&gt;(&lt;/span&gt;mean ± σ&lt;span class="o"&gt;)&lt;/span&gt;: 67.4 ms ± 1.0 ms &lt;span class="o"&gt;[&lt;/span&gt;User: 52.3 ms, System: 15.0 ms&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Range &lt;span class="o"&gt;(&lt;/span&gt;min … max&lt;span class="o"&gt;)&lt;/span&gt;: 65.9 ms … 70.4 ms &lt;span class="m"&gt;44&lt;/span&gt; runs
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/2023-10-06-21-40-30.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Yes, I&amp;rsquo;m back to the good old era of the 500+ LOC vimrc. In my case, I now have a single &lt;code&gt;init.lua&lt;/code&gt; file to manage my plugins and general settings, nicely organized and presented thanks to native (and efficient) Vim folding. I still have various directories lying around, though. Here is the big picture:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;~/.config/nvim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» tree -L &lt;span class="m"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── after
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── compiler
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── ftdetect
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── init.lua
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── lazy-lock.json
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── spell
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;└── templates
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="m"&gt;5&lt;/span&gt; directories, &lt;span class="m"&gt;2&lt;/span&gt; files
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I discarded part of a forked version of mini.nvim that I was using for completion, as well as several hand-made helper functions. Meanwhile I also cleanup stuff dispatched in several Lua files and put stuff in either my &lt;code&gt;after&lt;/code&gt; directory, or directly into my &lt;code&gt;init.lua&lt;/code&gt; file. Overall, nothing really changed, except that I&amp;rsquo;m now relying on dedicated packages to manage the colorscheme and statusline of Neovim stable release (v0.9.2 at the time of this writing). Breaking changes are inevitable with &amp;ldquo;over-the-beta&amp;rdquo; software, which is why I stopped using the dev version of Neovim in recent months. And since I don&amp;rsquo;t have the time nor inclination to read the changelog every two weeks, or after every new stable release, I let package maintainers do the right stuff for me. I&amp;rsquo;ve been using a bare bone custom monochromatic theme for three years now, but as I said in a &lt;a href="https://aliquote.org/post/unified-colors-of-tuis/"&gt;previous post&lt;/a&gt;, the &lt;a href="https://github.com/mcchrish/zenbones.nvim"&gt;zenbones&lt;/a&gt; plugin is quite good and I very much like the zenbones and zenwritten themes on light background. They also render nice on a dark background by the way. &lt;a href="https://github.com/nvim-lualine/lualine.nvim"&gt;Lualine&lt;/a&gt; is okay for most part and it fulfills all my requirements.&lt;/p&gt;
&lt;p&gt;The biggest issue for me was to replace &lt;code&gt;null-ls&lt;/code&gt;&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; since it provided me with a bunch of useful linters and fixers but it came out it was not too difficult to get rid of it since &lt;a href="https://github.com/stevearc/conform.nvim"&gt;conform.nvim&lt;/a&gt; and &lt;a href="https://github.com/mfussenegger/nvim-lint"&gt;nvim-lint&lt;/a&gt; came to the rescue shortly. I am aware it can be done with autocommands as &lt;a href="https://stackoverflow.com/a/77153991"&gt;explained on SO&lt;/a&gt; or simple mappings (which is what I already have in some of my &lt;code&gt;after/ftplugin&lt;/code&gt; files, but these two packages allow to manage linters and formatters in a more comfortable way.&lt;/p&gt;
&lt;p&gt;Startup time is a bit longer (60-70 ms instead of 30 ms with my previous config), but I use a different set of plugins so it&amp;rsquo;s hard to compare. The most notable changes are the addition of auto-installers, like &lt;a href="https://github.com/williamboman/mason.nvim"&gt;mason.nvim&lt;/a&gt; (with &lt;a href="https://github.com/williamboman/mason-lspconfig.nvim"&gt;mason-lspconfig.nvim&lt;/a&gt; and &lt;a href="https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim"&gt;mason-tool-installer.nvim&lt;/a&gt;, which works alongside &lt;a href="https://github.com/neovim/nvim-lspconfig"&gt;nvim-lspconfig&lt;/a&gt;, and linting/formatting packages cited above). I already installed all LSPs, linters and formatters I need using pip, npm, curl or whatever, but the big advantage of this approach is that everything is self-contained so that I can transfer my config files to any other computer and get everything installed right away. Mason-based tools will install everything (using a &lt;a href="https://mason-registry.dev/registry/list"&gt;registry list&lt;/a&gt; in the case of Mason itself) within a single click or config line.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; It also means you end up with a huge &lt;code&gt;$HOME/local/share/nvim&lt;/code&gt; directory (3.3 Go with 9 LSPs, compared to less than 180 Mo with my previous config). This is not a big deal if you have a large HD, but if you make regular backup using Kopia, you may want to exclude that directory from your hourly or daily backups. As an example, consider the following listing, in the middle of my configuration: some LSPs, formatters and linters take up some space, really:&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ .local/share/nvim/mason/packages
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» du -sh ./* &lt;span class="p"&gt;|&lt;/span&gt; sort -h
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2,8M ./shfmt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;4,0M ./purescript-language-server
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;14M ./stylua
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;15M ./shellcheck
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;19M ./texlab
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;20M ./docformatter
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;20M ./isort
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;27M ./black
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;28M ./pyright
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;28M ./sqlfmt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;29M ./clojure-lsp
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;41M ./typescript-language-server
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;44M ./rust-analyzer
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;105M ./r-languageserver
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;124M ./clangd
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2,8G ./haskell-language-server
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2023-10-19]&lt;/small&gt;&lt;br&gt;
Some after-thoughts: chktex is not available to install via mason-installer while racket-languageserver must be set up manually (it cannot be configured with mason-lsp). This means you still have to add extra stuff unless you submit a patch to the maintainers. You can define an auto-format command with conform, which may render some of your own function call or autocommands useless in your &lt;code&gt;after/ftplugin&lt;/code&gt; folder. This means we must be careful with synchronizing all filetype-specific settings. I would prefer that everything could be centralized within conform setup function.
&lt;/div&gt;
&lt;p&gt;I tried &lt;a href="https://github.com/hrsh7th/nvim-cmp"&gt;nvim-cmp&lt;/a&gt; as a replacement of my personal fork of &lt;a href="https://github.com/echasnovski/mini.nvim"&gt;mini.nvim&lt;/a&gt; completion module (this was before the &lt;code&gt;mini.nvim&lt;/code&gt; project introduced submodules), but I removed it after a few days. I never really like autocomplete and popup windows after every two keystrokes, and I&amp;rsquo;m probably fine with Vim&amp;rsquo;s omni complete (&lt;code&gt;C-x C-o&lt;/code&gt;), when I need it.&lt;/p&gt;
&lt;p&gt;And then comes &lt;a href="https://github.com/nvim-orgmode/orgmode"&gt;nvim-orgmode&lt;/a&gt;, which is so great compared to my previous half hand-made configuration. But I will talk a bit more bout this in a separate post.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Bauhaus • &lt;em&gt;Exquisite Corpse&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;By the end of writing this post, I learned it has been forked as &lt;a href="https://github.com/nvimtools/none-ls.nvim"&gt;none-ls.nvim&lt;/a&gt;.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;Compared to nvimlsp-config, Mason uses a different naming convention, so be careful.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:3"&gt;
&lt;p&gt;Of note, the R language server took a lot of time to install, compared to other LSPs. At this point, I&amp;rsquo;m thinking of removing it since I don&amp;rsquo;t really need it except for the &lt;code&gt;keywordprg&lt;/code&gt; (on-line help), which I can manage by my side.&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Rule of three and the Chebyshev inequality</title><link>https://aliquote.org/post/rule-of-three/</link><pubDate>Mon, 02 Oct 2023 14:11:06 +0200</pubDate><guid>https://aliquote.org/post/rule-of-three/</guid><description>&lt;p&gt;In medical statistics, especially studies on adverse events, there&amp;rsquo;s a well-known rule of three (different from &lt;a href="https://en.wikipedia.org/wiki/Rule_of_three_(writing)"&gt;other&lt;/a&gt; &lt;a href="https://en.wikipedia.org/wiki/Cross-multiplication#Rule_of_three"&gt;rules&lt;/a&gt; of &lt;a href="https://pubmed.ncbi.nlm.nih.gov/34061563/"&gt;three&lt;/a&gt;) which states that for binary outcomes, if no event has been observed on $n$ individuals a 95% confidence interval is constructed as $[0; 3/n]$. We can derive a confidence interval for the opposite (100% of events) by symmetry ($[1−3/n,1]$). Hence the name, because the chance of such an extreme event is at most three in $n$. The derivation is given in, e.g., &lt;a href="http://www.med.mcgill.ca/epidemiology/hanley/tmp/Proportion/zero_numerator.pdf"&gt;If Nothing Goes Wrong, Is Everything All Right? Interpreting Zero Numerators&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;There&amp;rsquo;s another handy (sort of) rule of thumb. If you remember what you learned from your intro course in statistics and probability density functions, you probably know that you can expect 95% of your data to lie within 2 standard deviations around the mean, and that there&amp;rsquo;s close to 3‰ chance that data lies above 3 standard deviation from either side of the mean. This is sometimes referred to as the &lt;a href="https://en.wikipedia.org/wiki/68%E2%80%9395%E2%80%9399.7_rule"&gt;68–95–99.7 rule&lt;/a&gt;. &lt;a href="https://en.wikipedia.org/wiki/Chebyshev%27s_inequality"&gt;Chebyshev&amp;rsquo;s inequality&lt;/a&gt; is generally used to justify the fact that a certain fraction of values can be no more than a certain distance from the mean. Contrary to the rule discussed previously, it specifically states that: $$ \Pr(\mid X - \mu \mid \geq k\sigma) \leq \frac{1}{k^2}. $$ It applies to any continuous distribution that has a mean and a variance. When $k=2$, for example, 75% of the observations are found to lie in the range $\mu\pm 2\sigma$.&lt;/p&gt;
&lt;p&gt;Now, assuming a unimodal distribution with mean $\mu$ and finite variance $\sigma^2$, for any $\lambda &amp;gt; \sqrt{8/3} \approx 1.633$, $$ \Pr(\mid X - \mu \mid \geq \lambda\sigma) \leq \frac{4}{9\lambda^2}. $$ This is known as the Vysochanskiï-Petunin inequality. When $\lambda = 3$, the upper probability bound equals $4/81 \approx 0.05$.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; To my knowledge, applications of this inequality mainly are in &lt;a href="https://www.wikidoc.org/index.php/Control_chart"&gt;control charts&lt;/a&gt; or &lt;a href="https://www.sciencedirect.com/science/article/abs/pii/S0377221721001545"&gt;financial&lt;/a&gt; statistics, but there may be some other interesting applications.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2024-02-07]&lt;/small&gt;&lt;br&gt;
See also &lt;a href="https://www.johndcook.com/blog/2024/02/06/chevyshev-variations/"&gt;How likely is a random variable to be far from its center?&lt;/a&gt;.
&lt;/div&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Antony &amp;amp; The Johnsons • &lt;em&gt;Cripple and the Starfish&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Chebyshev&amp;rsquo;s inequality would yield about twice that value.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in September</title><link>https://aliquote.org/post/micro-09-2023/</link><pubDate>Thu, 28 Sep 2023 08:24:22 +0200</pubDate><guid>https://aliquote.org/post/micro-09-2023/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-09-03&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_3182.JPG" alt="img"&gt;&lt;small&gt;Carole Zalberg, Tes ombres sur les talons (Grasset).&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-09-04&lt;/a&gt;: 13 ways to look at &lt;a href="https://justinjaffray.com/joins-13-ways/"&gt;table joins&lt;/a&gt;. &lt;code&gt;#database&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-09-04&lt;/a&gt;: &lt;a href="https://thasso.xyz/"&gt;An Intuition for Logarithms&lt;/a&gt;. &lt;code&gt;#math&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-09-04&lt;/a&gt;: &lt;a href="https://brushedtype.co/doppler/"&gt;Doppler&lt;/a&gt; looks like iTunes reinvented. (via &lt;a href="https://macwright.com/2023/09/01/recently.html"&gt;Tom Macwright&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-09-04&lt;/a&gt;: &lt;a href="https://rtheunissen.github.io/bst/"&gt;binary search trees&lt;/a&gt;: A thorough treatment of binary search trees enriched by an interesting &lt;a href="https://news.ycombinator.com/item?id=37130200"&gt;comment thread&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-09-05&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Curl supports a crazy number of protocols, from HTTP, FTP and TELNET to IMAP, LDAP and GOPHER. It runs on 92 operating systems and has over 20 billion installations worldwide. &amp;mdash; &lt;a href="https://antonz.org/mastering-curl/"&gt;Mastering curl: interactive text guide&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-09-06&lt;/a&gt;: TIL about CIEL, an &lt;a href="https://ciel-lang.org/"&gt;an Extended Lisp&lt;/a&gt; that looks really cool. It includes a bunch of useful libraries (Alexandria, Trivia, arrow macros, etc.) and provide an IPython-like REPL experience (shell pass-through, helper commands, documentation and lisp-critic). &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-09-06&lt;/a&gt;: ♪ Angel Olsen · All The Good Times&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-09-07&lt;/a&gt;: &lt;a href="https://mlu-explain.github.io/"&gt;Visual explanations of core machine learning concepts&lt;/a&gt;: Very nice and interactive illustrations. &lt;code&gt;#statistics&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-09-11&lt;/a&gt;: ♪ Bentley · Left Right Goodnight&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-09-12&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/2023-09-12-15-25-35.png" alt="img"&gt;&lt;small&gt;A little wrapper around the terminal version of &lt;a href="https://format.wtf/"&gt;What-The-Format&lt;/a&gt;.&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-09-12&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;One of the guiding lights of the UNIX utilities or software tools has been the deeply-felt conviction that text should be stored in as simple, as general a format as possible so that any program can easily process it. This idea (it seems to have been present from the beginning) has had the widest impact possible on UNIX in all its varieties. However, there has been a regrettable tendency to move away from it in recent times, especially among commercial software developers. &amp;mdash; &lt;a href="http://www.collyer.net/who/geoff/history.html"&gt;UNIX Evolution: 1975-1984&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-09-12&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The point is, there’s no reason why this bug — and it is a bug! — should have stuck around for so long. If your terminal emulator gets told to make text blue, and instead it makes it unreadable, then you can’t say that’s not a problem with the terminal emulator. &amp;mdash; &lt;a href="https://bsago.me/posts/that-annoying-shade-of-blue"&gt;That Annoying Shade of Blue&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-09-12&lt;/a&gt;: A slightly updated version of all my emails as discussed in a &lt;a href="https://aliquote.org/post/statistics-mu4e/"&gt;post&lt;/a&gt; in 2014. Note that I&amp;rsquo;ve reduced my mailbox to 20% of its original size since I wrote the blog post, and I keep archiving very few new messages. Also I resubscribed to a bunch of mailing-lists in 2022, which I keep in separate Maildirs but they are included in this chart. I&amp;rsquo;m still a happy user of &lt;a href="https://www.djcbsoftware.nl/code/mu/"&gt;mu&lt;/a&gt;.&lt;br&gt;&lt;img src="https://aliquote.org/img/allmyemails.png" alt="img"&gt;Updated code (because &lt;code&gt;mu-find&lt;/code&gt; now uses the system locale to format dates):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ &lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;LC_ALL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;C
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ mu find --sortfield&lt;span class="o"&gt;=&lt;/span&gt;date --fields&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;d&amp;#34;&lt;/span&gt; date:17y..1d &lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="se"&gt;\a&lt;/span&gt;wk -F &lt;span class="s2"&gt;&amp;#34; &amp;#34;&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;{print $5 &amp;#34;-&amp;#34; $2}&amp;#39;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="se"&gt;\u&lt;/span&gt;niq -c &lt;span class="p"&gt;|&lt;/span&gt; awk &lt;span class="s1"&gt;&amp;#39;{print $2 &amp;#34; &amp;#34; $1}&amp;#39;&lt;/span&gt; &amp;gt; 1.dat
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;library&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ggplot2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;library&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;scales&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;library&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;zoo&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;Sys.setlocale&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;LC_ALL&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;C&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;read.table&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;1.dat&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;header&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;FALSE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="o"&gt;$&lt;/span&gt;&lt;span class="n"&gt;V1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;paste&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="o"&gt;$&lt;/span&gt;&lt;span class="n"&gt;V1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;15&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sep&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;-&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="o"&gt;$&lt;/span&gt;&lt;span class="n"&gt;V1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;as.Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;as.POSIXct&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="o"&gt;$&lt;/span&gt;&lt;span class="n"&gt;V1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;format&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;%Y-%b-%d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tz&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;GMT&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;names&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;c&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Time&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;Emails&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;ggplot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;aes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Time&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Emails&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;geom_line&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nf"&gt;grey&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;.5&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;geom_line&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;aes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nf"&gt;rollmean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Emails&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;na.pad&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;TRUE&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt; &lt;span class="n"&gt;linewidth&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1.5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;scale_x_date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;breaks&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;1 year&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;minor_breaks&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;2 months&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;labels&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;date_format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%Y&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;xlab&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;theme_bw&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;ggsave&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;allmyemails.png&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;width&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;height&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-09-13&lt;/a&gt;:
&lt;blockquote&gt;
&lt;p&gt;In the end, the main thought here is the following: build using simple proven techniques even if you’re using a technology like Haskell. For anything extra (like dependent types, formal verification, etc.) you might want to think twice and thrice. And still remain uncertain. &amp;mdash; &lt;a href="https://www.tweag.io/blog/2019-02-13-types-got-you/"&gt;The types got you&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-09-13&lt;/a&gt;: OMG, now they call it Drive&amp;hellip; &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;&lt;img src="https://aliquote.org/img/2023-09-13-21-57-05.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-09-13&lt;/a&gt;: &lt;a href="https://novaspec.org/cl/"&gt;Common Lisp Nova Spec&lt;/a&gt;: A better (?) help center than the CLHS. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-09-13&lt;/a&gt;: &lt;a href="https://yarr.fyi/"&gt;Yet Another Rust Resource (YARR!)&lt;/a&gt;: If you ever wanted to quickly get some insights about Rust, it offers a nice overview of the language.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-09-15&lt;/a&gt;: &lt;a href="https://abuseofnotation.github.io/category-theory-illustrated/"&gt;Category Theory Illustrated&lt;/a&gt; &amp;ldquo;is a primer in category theory and other mathematical theories that is made to be really accessible to people with no prior exposure to the subject, without being dumbed down, by utilizing visual explanations.&amp;quot;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-09-18&lt;/a&gt;: Another nice article by Brian Hayes, on &lt;a href="http://bit-player.org/2023/ai-and-the-end-of-programming"&gt;AI and the end of programming&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-09-18&lt;/a&gt;: It appears that Neomutt can be quite slow when filtering/searching emails using body keyword or patterns and the &amp;ldquo;limit&amp;rdquo; (&lt;code&gt;l&lt;/code&gt;) command. It seems that Neomutt needs to open all emails beforehand, which makes sense but slow down any search operation. Now, as suggested in &lt;a href="https://github.com/neomutt/neomutt/issues/3273"&gt;#3273&lt;/a&gt;, we can speed up things a lot by disabling the &lt;code&gt;auto_view text/html&lt;/code&gt; feature. My benchmarks confirm those of the poster, with around 13K messages in my Archives. I don&amp;rsquo;t know how to disable auto_view temporarily, but since I can use &lt;code&gt;mu-find&lt;/code&gt; to search my email database, with almost the same syntax, I do&amp;rsquo;nt have to worry much: results are almost instantaneous!&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;macro index \Cf &amp;#34;&amp;lt;shell-escape&amp;gt;mutt-mu &amp;#34; &amp;#34;mu find&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;macro index gf &amp;#34;&amp;lt;change-folder-readonly&amp;gt;~/.mu/results&amp;lt;enter&amp;gt;&amp;#34; &amp;#34;mu find results&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;small&gt;Here, &lt;code&gt;mutt-mu&lt;/code&gt; is a short shell script for &lt;code&gt;mu find --clearlinks --format=links --linksdir=~/.mu/results &amp;quot;$1&amp;quot;&lt;/code&gt;.&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-09-19&lt;/a&gt;: Lovely: &lt;a href="https://github.com/sharkdp/pastel"&gt;pastel&lt;/a&gt;.&lt;br&gt;&lt;img src="https://aliquote.org/img/2023-09-19-14-51-30.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-09-20&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;(Python) types are very broad hints and they are sometimes lies. &amp;mdash; &lt;a href="https://bernsteinbear.com//blog/typed-python/"&gt;Compiling typed Python&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-09-20&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The idea is to take a train somewhere (unspecified) for four hours, have lunch, then take another train home. The train would be my 90mph office with scenery for those four hours in each direction, and I’d get to enjoy lunch somewhere new. I’d do a full days work with the view out the window constantly changing. &amp;mdash; &lt;a href="https://popey.com/blog/2023/09/the-90mph-office/"&gt;The 90mph office&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-09-20&lt;/a&gt;: Trying out &lt;a href="https://github.com/latex-lsp/texlab"&gt;texlab&lt;/a&gt; since yesterday. So far it has been working smoothly alongside vimtex and null-ls (to format bibtex files). Last year I played with &lt;a href="https://tectonic-typesetting.github.io/en-US/index.html"&gt;Tectonic&lt;/a&gt;, which looks great, especially if you don&amp;rsquo;t want to manage a full installation of the $\TeX$ system. &lt;a href="https://github.com/latex-lsp/texlab/wiki/Tectonic"&gt;Both&lt;/a&gt; seem to play well together. &lt;code&gt;#vim&lt;/code&gt; &lt;code&gt;#tex&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-09-20&lt;/a&gt;: &lt;a href="https://medium.com/@adaml.poniatowski/exploring-the-top-neovim-distributions-lazyvim-lunarvim-astrovim-and-nvchad-which-one-reigns-3adcdbfa478d"&gt;Exploring the Top Neovim Distributions: LazyVim, LunarVim, AstroVim, and NVChad — Which One Reigns Supreme?&lt;/a&gt;: either you get limited capabilities or you are blowing your RAM, right? &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-09-21&lt;/a&gt;: TIL about &lt;a href="https://harlequin.sh/"&gt;Harlequin&lt;/a&gt; which looks really great. &lt;code&gt;#database&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-09-21&lt;/a&gt;: Thanks to &lt;a href="https://github.com/vlevit/notify-send.sh"&gt;notify-send.sh&lt;/a&gt; I can now update the mail notification from Neomutt in Ubuntu notification center since it allows to replace an existing notification. This should be available in more &lt;a href="https://askubuntu.com/q/161851"&gt;recent versions&lt;/a&gt; of &lt;code&gt;notify-send&lt;/code&gt; (Ubuntu ≥ 22.10).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set new_mail_command=&amp;#34;notify-send.sh --replace-file=/tmp/muttnotification -a neomutt -u low -i neomutt &amp;#39;New Email&amp;#39; &amp;#39;%n new messages, %u unread.&amp;#39; &amp;amp;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Beforehand I tried &lt;a href="https://github.com/phuhl/notify-send.py"&gt;notify-send.py&lt;/a&gt; which didn&amp;rsquo;t quite work.&lt;br&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-09-24&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_3230.JPG" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-09-24&lt;/a&gt;: &lt;a href="https://www.lwh.jp/lisp/"&gt;Building LISP&lt;/a&gt;, in under 6 C files (876 LOC). &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-09-24&lt;/a&gt;: &lt;a href="https://gwern.net/sidenote"&gt;Sidenotes In Web Design&lt;/a&gt;: I didn&amp;rsquo;t know there were so many JS and non-JS based framework for HTML sidenotes.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-09-24&lt;/a&gt;: ♪ P!nk · Glitter In the Air&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-09-25&lt;/a&gt;: &lt;a href="https://tomscii.sig7.se/2021/01/Typing-latency-of-Zutty"&gt;Measured: Typing latency of Zutty (compared to others)&lt;/a&gt;: Sadly no stats for &lt;a href="https://codeberg.org/dnkl/foot"&gt;foot&lt;/a&gt;. Given the existing &lt;a href="https://codeberg.org/dnkl/foot/wiki/Performance"&gt;benchmarks&lt;/a&gt;, I would expect it to be in lowest range of typing latency as well but this would need some perf tests. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-09-25&lt;/a&gt;:
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_3186.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_3186.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_3218.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_3218.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_3227.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_3227.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;small&gt;Weekend cookery.&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-09-25&lt;/a&gt;: ♪ Portishead · The Rip&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-09-28&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;It was the precursor of what was later known as the Gifi System, which is a large reorganization of descriptive multivariate analysis techniques in such a way that they apply both to numerical and non-numerical data. That covers regression and principal components analysis, factor analysis, all those techniques in one common framework and ultimately in a series of computer programs as well. My dissertation was basically the first programmatic statement of that program. The Gifi project itself ran until about 1990, I left in 1987, but there was still some ends to wrap up and the Data Theory group in Leiden that still existed at the time, wrapped up those loose ends. They produced a book, the final version of the Gifi book. &amp;mdash; &lt;a href="https://jansweb.netlify.app/post/wijsen/"&gt;Interview of Jan de Leeuw by Lisa Wijsen&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I was surprised to learn that he&amp;rsquo;s still publishing &lt;a href="https://www.tandfonline.com/doi/full/10.1080/00031305.2023.2186952"&gt;peer-reviewed papers&lt;/a&gt; and I was also very impressed to see that he&amp;rsquo;s still hard at work on &lt;a href="https://jansweb.netlify.app/publication/"&gt;working papers and books&lt;/a&gt;. h/t&lt;br&gt;&lt;/p&gt;</description></item><item><title>Null zone vs. error bars</title><link>https://aliquote.org/post/null-zone/</link><pubDate>Wed, 27 Sep 2023 07:04:35 +0200</pubDate><guid>https://aliquote.org/post/null-zone/</guid><description>&lt;p&gt;Maarten Boers wrote a paper entitled &lt;a href="https://www.sciencedirect.com/science/article/abs/pii/S0895435604000800"&gt;Null bar and null zone are usually better than the error bar to compare group means in graphs&lt;/a&gt;. Frank Harrell also mentioned null bars in one of his technical articles on his &lt;a href="https://www.fharrell.com/"&gt;website&lt;/a&gt; if my memory serves me right, but I can&amp;rsquo;t get my hands on it again. Null bars depict the range within which the means of the groups fall if the null hypothesis cannot be rejected at the selected $\alpha$-level. Considering a two-group comparison, it reflects $\bar X \pm \tfrac{1}{4} \text{95% CI}$ where $\bar X$ is the the grand mean. Hence, the range covered by the null zone amounts to half the CI for the difference in means.&lt;/p&gt;
&lt;p&gt;For one I always preferred displaying confidence intervals to standard error or standard deviation, even in the case of ANOVA design,&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; with the exception of standard error of measurement in psychometrics. The null bar is not that much different except it is centered on the grand mean and, for large sample, it is equivalent to $\bar X \pm \text{SE}_\text{d}$. I recently tried to circumvent the problem of frequentist inference using Bayesian approaches, which are common in molecular phylogenetics, even if Bayesian credible intervals are not stricly equivalent to frequentist confidence intervals.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;I found no R package to plot null zone like in Figure 3 of the aforementioned paper. Here is a quick and dirty R script that mimics null zone for a line graph using data that I discussed in an old &lt;a href="https://even4void.github.io/rstats-biostats/practical04.html"&gt;handout of mine&lt;/a&gt; for the analysis longitudinal data. First, let&amp;rsquo;s load and plot &lt;a href="https://aliquote.org/pub/sepsis.dta"&gt;the data&lt;/a&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;library&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Hmisc&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;library&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ggplot2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;library&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;hrbrthemes&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;library&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;directlabels&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;library&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data.table&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;options&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;digits&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;show.signif.stars&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;FALSE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;hrbrthemes&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;import_roboto_condensed&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;theme_set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;theme_ipsum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;base_size&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;11&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;sepsis&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="n"&gt;foreign&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;read.dta&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;sepsis.dta&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;sepsis&lt;/span&gt;&lt;span class="o"&gt;$&lt;/span&gt;&lt;span class="n"&gt;treat&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;as.factor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sepsis&lt;/span&gt;&lt;span class="o"&gt;$&lt;/span&gt;&lt;span class="n"&gt;treat&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;sepsis&lt;/span&gt;&lt;span class="o"&gt;$&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;factor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sepsis&lt;/span&gt;&lt;span class="o"&gt;$&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;sepsis.long&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;melt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;data.table&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sepsis&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;measure.vars&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;8&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="m"&gt;14&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;id.vars&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;celsius2fahr&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="kr"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="m"&gt;-32&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="m"&gt;1.8&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;sepsis.long&lt;/span&gt;&lt;span class="o"&gt;$&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;celsius2fahr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sepsis.long&lt;/span&gt;&lt;span class="o"&gt;$&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;with&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sepsis.long&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;summarize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;llist&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;treat&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;variable&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;smean.cl.normal&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;ggplot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;aes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;variable&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;shape&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;treat&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;treat&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;geom_point&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;geom_line&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;aes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;group&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;treat&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;geom_errorbar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;aes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ymin&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;Lower&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ymax&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;Upper&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;width&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;.1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;scale_color_manual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;values&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;c&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;steelblue&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;orange&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;scale_x_discrete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;labels&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;seq&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;6&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;by&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;guides&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;color&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;none&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;shape&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;none&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;geom_dl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;aes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;label&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;treat&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;method&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;smart.grid&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cex&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;.8&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;labs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;Durée de suivi (heure)&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;Température (°C)&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;p&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/fig-sepsis.png"&gt;
&lt;/figure&gt;
&lt;p&gt;And the code that computes the null zone:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;null.zone&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="kr"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;conf.int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0.95&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="n"&gt;data[[1]]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="n"&gt;data[[2]]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;stat&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;t.test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;conf.level&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;conf.int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;var.equal&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;TRUE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;c&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;na.rm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;TRUE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;se&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;as.numeric&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;stat&lt;/span&gt;&lt;span class="o"&gt;$&lt;/span&gt;&lt;span class="n"&gt;stderr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;df&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;as.numeric&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;stat&lt;/span&gt;&lt;span class="o"&gt;$&lt;/span&gt;&lt;span class="n"&gt;parameter&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ci&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;c&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;-1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nf"&gt;qt&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;conf.int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;se&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;c&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Mean&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Lower&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ci[1]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Upper&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ci[2]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sepsis.long&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;by&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;variable&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;data.frame&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;lapply&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kr"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nf"&gt;null.zone&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;with&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;treat&lt;/span&gt;&lt;span class="p"&gt;)))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;r&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# temp0 temp1 temp2 temp3 temp4 temp5 temp6&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Mean 38.0149 37.6909 37.5240 37.4363 37.3514 37.2299 37.2808&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Lower 37.9111 37.5864 37.4240 37.3379 37.2502 37.1326 37.1817&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Upper 38.1187 37.7954 37.6241 37.5347 37.4527 37.3273 37.3799&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;small&gt;First call to &lt;code&gt;split&lt;/code&gt; uses &lt;code&gt;data.table&lt;/code&gt;, second one is base R.&lt;/small&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;dr&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;transpose&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;names&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;rownames&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;dr&lt;/span&gt;&lt;span class="o"&gt;$&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;seq&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;nrow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dr&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;geom_ribbon&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;dr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;aes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ymin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Lower&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ymax&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Upper&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;inherit.aes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;FALSE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fill&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;grey&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;.3&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;alpha&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0.2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;p&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/fig-sepsis-2.png"&gt;
&lt;/figure&gt;
&lt;p&gt;The shaded area above corresponds to the area in which the two means at each time point should lie if the null hypothesis cannot be rejected at a two-sided 5% level. Unprotected t-test assuming equal variance at each time point confirm that the two groups only differ on the first occasion:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;as.numeric&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;lapply&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kr"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nf"&gt;t.test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;~&lt;/span&gt; &lt;span class="n"&gt;treat&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;var.equal&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;TRUE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;$&lt;/span&gt;&lt;span class="n"&gt;p.value&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# [1] 0.499 0.001 0.000 0.000 0.000 0.000 0.000&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As an alternative, one may look at the &lt;a href="https://cran.r-project.org/web/packages/nullabor/"&gt;nullabor&lt;/a&gt; R package, which provides functions to support quantifying the significance of structure seen in plots of data.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Queens of the Stone Age • &lt;em&gt;I never Came&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;W. D. Dupont (2009) &lt;em&gt;&lt;a href="https://hbiostat.org/data/repo/wddtext.html"&gt;Statistical Modeling for Biomedical Researchers&lt;/a&gt;&lt;/em&gt;, Cambridge University Press.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;See, e.g., &lt;a href="https://online.ucpress.edu/collabra/article/5/1/13/112982/Pragmatism-should-Not-be-a-Substitute-for"&gt;Pragmatism should Not be a Substitute for Statistical Literacy, a Commentary on Albers, Kiers, and Van Ravenzwaaij (2018)&lt;/a&gt;.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Confidence intervals and coverage</title><link>https://aliquote.org/post/confidence-interval-coverage/</link><pubDate>Tue, 26 Sep 2023 08:48:37 +0200</pubDate><guid>https://aliquote.org/post/confidence-interval-coverage/</guid><description>&lt;p&gt;A blog post I found in my draft folder which I put here, without further ado.&lt;/p&gt;
&lt;p&gt;According to the frequentist definition of a confidence interval, the 95% lower and upper bounds can be interpreted as follows: for 100 independent samples, we expect 95 of the CIs to include the true parameter. While I was working on &lt;a href="https://aliquote.org/post/gaussian-credible-interval"&gt;another post&lt;/a&gt;, I wrote a quick Python script to estimate how well confidence intervals for a mean or a proportion cover the true parameter value. Since the arithmetic mean applies equally to continuous or binary outcomes (in the latter case, we get the proportion as desired), the code is quite simple. Also note that I use a normal approximation, which may not be that suitable with very small samples. Needless to say, I ended up drafting a little script by the end of August and forgot to highlight misbehaving CIs (i.e., the 5 not so in a row)&amp;hellip;.&lt;/p&gt;
&lt;p&gt;Here is my own implementation, which assumes raw data (i.e., a series of observations for each sample):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;numpy&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;np&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;matplotlib.pyplot&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;plt&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;scipy.stats&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;norm&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;twosamp_ci&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ys&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;level&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;0.95&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;alpha&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;level&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ys&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;asarray&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;asarray&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ys&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;nx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ny&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;shape&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;ys&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;shape&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;px&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;py&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ys&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;diff&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;px&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;py&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;unique&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;shape&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;se&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sqrt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;px&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;px&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;nx&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;py&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;py&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ny&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;sx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sqrt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nx&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nx&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;sy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ys&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sqrt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ny&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ny&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;se&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sqrt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sx&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;nx&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;sy&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ny&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;qz&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;norm&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ppf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;alpha&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;lower&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;diff&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;qz&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;se&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;upper&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;diff&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;qz&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;se&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;upper&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;iter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;cis&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;iter&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;xs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;normal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;loc&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;scale&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;1.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ys&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;normal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;loc&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;scale&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;1.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cis&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;twosamp_ci&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ys&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cis&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;zip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cis&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="p"&gt;())))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hlines&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/fig-ci-coverage.png"&gt;
&lt;/figure&gt;
&lt;p&gt;It could be rewritten without even using Numpy since the &lt;a href="https://docs.python.org/3/library/math.html"&gt;math&lt;/a&gt; and &lt;a href="https://docs.python.org/3/library/statistics.html"&gt;statistics&lt;/a&gt; modules include the stuff we need.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Agnes Obel • &lt;em&gt;Familiar&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Foot terminal for Wayland</title><link>https://aliquote.org/post/foot-terminal/</link><pubDate>Mon, 25 Sep 2023 20:14:06 +0200</pubDate><guid>https://aliquote.org/post/foot-terminal/</guid><description>&lt;p&gt;I&amp;rsquo;ve been playing out of the blue with the &lt;a href="https://codeberg.org/dnkl/foot"&gt;foot&lt;/a&gt; terminal emulator after several months in Gnome terminal. It&amp;rsquo;s incredibly fast compared to the latter, of course. You&amp;rsquo;ll get noticeable improvement in terms of response and typing latency when listing directory using &lt;a href="https://github.com/ogham/exa"&gt;exa&lt;/a&gt; or running &lt;code&gt;sudo apt update &amp;amp;&amp;amp; apt list --upgradable&lt;/code&gt;, for instance. Typing in Vim goes even smoothly. I know I can achieve the same results with &lt;a href="https://sw.kovidgoyal.net/kitty/"&gt;Kitty&lt;/a&gt;, but foot itself is advertised as a fast and minimalist terminal emulator for Wayland. I&amp;rsquo;m on Wayland, and I like trying things out, especially if this improves my workflow.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve used Alacritty for one year and finally came back to Kitty. The latest additions (e.g., switching themes or update notifications) were life changing and made it close to the bare bone terminal emulator available system-wide on Ubuntu (aka, Gnome terminal). You&amp;rsquo;ll get many additional capabilities, though: image support, pipes to external programs (also known as kitten), good URL support, multiplexing for free, and so on. Overall, with foot there&amp;rsquo;s not much difference compared to Kitty except you&amp;rsquo;ll get less additional capabilities. However, image support (via &lt;a href="https://en.wikipedia.org/wiki/Sixel"&gt;sixel&lt;/a&gt;, see this &lt;a href="https://konfou.xyz/posts/sixel-for-terminal-graphics/"&gt;excellent overview&lt;/a&gt;) and handling URL is quite good. Search capabilities in the scrollback are great too, and it even works under Tmux: Try typing &lt;code&gt;Ctrl+Shift+R&lt;/code&gt; and you&amp;rsquo;ll get a search box in the bottom-right of your terminal. Note that the version of foot available in Ubuntu 22.04 LTS stock apt packages is 1.11, and to align with recent development you&amp;rsquo;ll need to add the following to your &lt;code&gt;$HOME/.config/foot/foot.ini&lt;/code&gt; config file:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;[&lt;/span&gt;key-bindings&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;show-urls-launch&lt;span class="o"&gt;=&lt;/span&gt;Control+Shift+o
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/2023-09-25-20-36-34.png"&gt;
&lt;/figure&gt;
&lt;p&gt;You may also want to disable the extra space on the right of the terminal windwo by disabling the scrollback marker. Otherwise, you&amp;rsquo;ll get strange looking horizontal menu/status bar (e.g., tmux, vim, newsboat). This is easily achieved as follows:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;[&lt;/span&gt;scrollback&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;indicator-position&lt;span class="o"&gt;=&lt;/span&gt;none
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you miss the Ubuntu mono font from Gnome terminal, just add &lt;code&gt;font=Ubuntu Mono:size=8&lt;/code&gt; in the &lt;code&gt;[main]&lt;/code&gt; section.&lt;/p&gt;
&lt;p&gt;Unfortunately, Neovim terminal does not support sixel for displaying image, only &lt;a href="https://github.com/hpjansson/chafa/"&gt;chafa&lt;/a&gt; and &lt;a href="https://github.com/atanunq/viu"&gt;viu&lt;/a&gt;, which means you cannot benefit from foot&amp;rsquo;s support when using &lt;a href="https://github.com/ibhagwan/fzf-lua"&gt;fzf-lua&lt;/a&gt; for previewing images in the fuzzy file finder.&lt;/p&gt;
&lt;p&gt;Quick post, but if you are looking for cheap alternative to Gnome terminal with better input latency give foot a shot.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Portishead • &lt;em&gt;Mourning Air&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Some interesting R packages</title><link>https://aliquote.org/post/r-packages-in-2023/</link><pubDate>Tue, 19 Sep 2023 09:23:08 +0200</pubDate><guid>https://aliquote.org/post/r-packages-in-2023/</guid><description>&lt;p&gt;It&amp;rsquo;s interesting to see how few R code I write these days, compared to my early professional carrier as a medical statistician. I could have some opportunities to do biostatistical stuff but most of the time I am never asked to and my job resolves around genomics these days. That&amp;rsquo;s fine by me, I still have some opportunities to learn new things, especially in NGS and bioinformatics. At work I mostly use Python and Bash, because they fulfill their role for string processing and task orchestration. When I&amp;rsquo;m not involved in programming, I&amp;rsquo;m using more or less esoteric bioinformatic software, for which my rough estimate of their lifetime is about 2 years after having been described in a peer-reviewed paper. Anyway, I still do some statistical stuff, mostly for fun at home, and most of the time R comes to the rescue, even if I also use Stata and Mathematica.&lt;/p&gt;
&lt;p&gt;Here are some R packages I discovered or reinstalled in 2023:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;First, I learned that there&amp;rsquo;s a dedicated webiste for &lt;a href="https://exts.ggplot2.tidyverse.org/"&gt;ggplot extensions&lt;/a&gt;. There you will find ggstance (horizontal boxplots, for instance), ggalt (useful for spline fitting) or ggradar (radar or spider charts, which I implemented in base R 14 years ago!). There is many cool stuff that been developed around ggplot, which is great.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.danieldsjoberg.com/gtsummary/"&gt;gtsummary&lt;/a&gt; as a quick replacement for gt when one to summarize a data frame. It produces an HTML page by design. However, it supports several backends, including &lt;a href="https://gt.rstudio.com/articles/intro-creating-gt-tables.html"&gt;gt&lt;/a&gt;, to output PNG (requires the webshot2 package, and one of chrome-based browser), DOCX or TEX (as a longtable) files. Quick one-liner:&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;library&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;library&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;gtsummary&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;tbl_summary&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;iris&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;|&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;as_gt&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;|&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;gtsave&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;filename&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;/tmp/out.tex&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.rdocumentation.org/packages/janitor"&gt;janitor&lt;/a&gt; to manage your dirty dataset. There&amp;rsquo;s no magic incantation, though, so I believe it does not prevent the user to closely inspect, and not only eye-balling, the data.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.rdocumentation.org/packages/parameters"&gt;parameters&lt;/a&gt; for managing and displaying model estimates; not sure I would really need this, but I&amp;rsquo;ll keep it in mind.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://cran.r-project.org/web/packages/emmeans/index.html"&gt;emmeans&lt;/a&gt; and &lt;a href="https://cran.r-project.org/web/packages/margins/vignettes/Introduction.html"&gt;margins&lt;/a&gt;, although I&amp;rsquo;m used to the effects and rms packages.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://dbplyr.tidyverse.org/"&gt;dbplyr&lt;/a&gt; and &lt;a href="https://multidplyr.tidyverse.org/"&gt;multidplyr&lt;/a&gt;: I&amp;rsquo;m still not versed into the tidyverse, but I must admit that the dbplyr package offers the best of the two worlds, a robust query language on top of an efficient database system. As such, instead of using the &lt;a href="https://github.com/Rdatatable/data.table"&gt;data.table&lt;/a&gt; package, we can imagine using Arrow to read and/or write large data files, and duckdb to query the collected data using their efficient streaming algorithms, but see some examples of use in &lt;a href="https://hbs-rcs.github.io/large_data_in_R/"&gt;this tutorial&lt;/a&gt;. I&amp;rsquo;d like to benchmark this approach with a full-blown &lt;a href="https://github.com/h2oai"&gt;H2O&lt;/a&gt; solution. I was quite surprised by the performance and ease of use of the Python &lt;a href="https://aliquote.org/post/python-datatable"&gt;datatable&lt;/a&gt; package from the H20 team.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There are many other packages that I once installed but removed soon after using them. There are also lot of packages that I am not aware of. In fact, I stopped my technological watch years ago, and never really came back, so that I&amp;rsquo;m mostly comfortable with what I&amp;rsquo;ve learned long time ago. By the way, it was &lt;a href="https://kbroman.org/hipsteR/"&gt;already cool&lt;/a&gt;. Curiously, while I was using the Bioconductor project and its packages 13 years ago for GWAS analysis, I no longer use them, except for RNASeq or metagenomics-related stuff.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Benoît Delbecq • &lt;em&gt;Anamorphoses&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Helix looks great indeed</title><link>https://aliquote.org/post/helix-looks-great/</link><pubDate>Mon, 18 Sep 2023 20:22:20 +0200</pubDate><guid>https://aliquote.org/post/helix-looks-great/</guid><description>&lt;p&gt;I already talked about the &lt;a href="https://aliquote.org/post/helix-editor"&gt;Helix editor&lt;/a&gt;. I try to use it on a daily basis from time to time. It works perfectly on virtual consoles in Ubuntu or via ssh if you don&amp;rsquo;t need an X server. I now have some consequent muscle memory anchored in my Neovim key bindings, and I often make some mistake when working with Helix. I believe I don&amp;rsquo;t use it often enough to really enjoy its capabilities and the editing model underlying this Kakoune/Vim hydra. I know there are some support for &lt;a href="https://github.com/helix-editor/helix/wiki/FAQ#is-a-vivim-keymap-planned"&gt;Vim keymapping&lt;/a&gt;, but I try to work with builtins.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;What I really like:&lt;/em&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It works out of the box. Just install the binary (from a tarball or Flathub), any additional LSP stuff you need (e.g., lldb-vscode, pyright, black), and check that it has been detected with &lt;code&gt;hx --health&lt;/code&gt;. Then you&amp;rsquo;re probably good to go. There&amp;rsquo;s barely anything to configure (unless you use pyright LSP for Python).&lt;/li&gt;
&lt;li&gt;There are a few fuzzy pickers builtin, and they are great: LSP finder and gotos, file picker, etc. Everything comes with a popup menu &amp;ldquo;à la which-key&amp;rdquo; which helps finding the right binding in case you forgot it. Otherwise, the popup menu is rather unintrusive if you are quick enough for any two key mapping.&lt;/li&gt;
&lt;li&gt;Since it is a single app with everything bundled, it will work across different machines the same way. Even with no configuration (see above), you&amp;rsquo;ll get a very capable text editor.&lt;/li&gt;
&lt;li&gt;Git support is acceptable, at least there&amp;rsquo;s a Git gutter and goto next/prev change. Bonus, you get a visual selection for free in the later cases.&lt;/li&gt;
&lt;li&gt;Tree sitter support is excellent, and unlike Neovim you don&amp;rsquo;t need to install extra plugins (which &lt;a href="https://github.com/helix-editor/helix/discussions/3806"&gt;don&amp;rsquo;t exist&lt;/a&gt; anyway, at the time of this writing).&lt;/li&gt;
&lt;li&gt;Native DAP support is nice, especially when you see how picky it is to configure everything in Neovim with &lt;a href="https://github.com/mfussenegger/nvim-dap"&gt;nvim-dap&lt;/a&gt; (the plugin is great, it&amp;rsquo;s just that it is a lot of extra configuration for lldb-vscode, debugpy, etc.). I&amp;rsquo;m eagerly awaiting full support for Python.&lt;/li&gt;
&lt;li&gt;So many good defaults, e.g., start in a directory with &lt;code&gt;hx .&lt;/code&gt; and you get a file picker.&lt;/li&gt;
&lt;li&gt;I don&amp;rsquo;t use builtin colorschemes but they look gorgeous as advertised. Here is my boring colorless theme, by the way:&lt;/li&gt;
&lt;/ul&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2023-09-18-20-56-05.png"&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;em&gt;What I miss:&lt;/em&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;No built-in terminal. I use it a lot, be it for simply launching a program alongside or for running REPL or test suites.&lt;/li&gt;
&lt;li&gt;Muscle memory, as I said. I wish there were a better way to add support for, e.g., &lt;code&gt;$&lt;/code&gt;, &lt;code&gt;0&lt;/code&gt; or &lt;code&gt;_&lt;/code&gt;. Switching from Neovim to Helix too often means wandering through the vagaries of keyboard shortcuts to navigate text.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cw&lt;/code&gt; and &lt;code&gt;yiw&lt;/code&gt;. Argh, you need to make a selection first. Muscle memory again&amp;hellip;&lt;/li&gt;
&lt;li&gt;Filetype-based text soft/hard wraping, reflowing, and things like that, although I am aware of the hard-wraping (&lt;code&gt;:reflow&lt;/code&gt;) capabilities. I would really like soft-wraping and I miss Vim&amp;rsquo;s &lt;code&gt;gqip&lt;/code&gt; for hard-wraping.&lt;/li&gt;
&lt;li&gt;I miss Vim&amp;rsquo;s visual blocks which I find especially useful to add comment at the start of several lines or remove extra whitespace, etc. I know we can do the same with multiple selections, but it&amp;rsquo;s, well, different.&lt;/li&gt;
&lt;li&gt;No spell checke, but &lt;a href="https://github.com/helix-editor/helix/discussions/3637#discussioncomment-6868540"&gt;this may change soon&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;I still need to find my way through the use of pipes instead of Vim&amp;rsquo;s &lt;code&gt;r!&lt;/code&gt; although it is a minor issue.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Patricia Brennan • &lt;em&gt;Improvisation VI&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>JASP for Bayesian statistics</title><link>https://aliquote.org/post/jasp-bayesian-statistics/</link><pubDate>Fri, 15 Sep 2023 18:05:41 +0200</pubDate><guid>https://aliquote.org/post/jasp-bayesian-statistics/</guid><description>&lt;p&gt;I installed &lt;a href="https://jasp-stats.org/"&gt;JASP&lt;/a&gt; recently as I wanted to see how it evolves since the last time I used it (several years ago). Unfortunately, there&amp;rsquo;s no package, tarball or AppImage so you need to install it from Flathub, using flatpak. With regard to my &lt;a href="https://aliquote.org/post/why-i-like-ubuntu"&gt;last post&lt;/a&gt;, this also was an occasion to try out flatpak. Overall, it works quite well, it doesn&amp;rsquo;t update itself or its packages &lt;em&gt;de manière impromptue&lt;/em&gt;, and it is simple to use. Of course, you end up with giant applications since it bundles every dependencies it needs. For instance, JASP is as large as 2.6 Go once installed in &lt;code&gt;/var/lib/flatpak&lt;/code&gt;. Anyway, the installation went smoothly, and I came to appreciate the flatpak way of installing desktop app. I might even replace all my AppImage&amp;rsquo;s with those from Flathub.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2023-09-13-15-42-56.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Back to Bayesian statistics. Several years ago I mentioned a &lt;a href="https://aliquote.org/post/bayesian-t-test/"&gt;Bayesian alternative&lt;/a&gt; to the traditional Student t-test, but the post found its way into the draft folder forever. Rather than writing and submitting to Stan or JAGS a model file, here is what I would do in R. First, using the &lt;a href="https://paul-buerkner.github.io/brms/"&gt;brms&lt;/a&gt; package, we can mimic a t-test assuming unequal variance as follows:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;library&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;brms&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;brm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;bf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;~&lt;/span&gt; &lt;span class="n"&gt;supp&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sigma&lt;/span&gt; &lt;span class="o"&gt;~&lt;/span&gt; &lt;span class="n"&gt;supp&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ToothGrowth&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;family&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;student&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cores&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="m"&gt;-8&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;------&lt;/span&gt; &lt;span class="n"&gt;snip&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;summary&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Family&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;student&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Links&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;mu&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;identity&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;sigma&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;nu&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;identity&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Formula&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;~&lt;/span&gt; &lt;span class="n"&gt;supp&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;sigma&lt;/span&gt; &lt;span class="o"&gt;~&lt;/span&gt; &lt;span class="n"&gt;supp&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Data&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;ToothGrowth &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Number&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;observations&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="m"&gt;60&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Draws&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="m"&gt;4&lt;/span&gt; &lt;span class="n"&gt;chains&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;each&lt;/span&gt; &lt;span class="n"&gt;with&lt;/span&gt; &lt;span class="n"&gt;iter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;2000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;warmup&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;thin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="n"&gt;post&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;warmup&lt;/span&gt; &lt;span class="n"&gt;draws&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;4000&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Population&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Level&lt;/span&gt; &lt;span class="n"&gt;Effects&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Estimate&lt;/span&gt; &lt;span class="n"&gt;Est.Error&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="m"&gt;-95&lt;/span&gt;&lt;span class="o"&gt;% CI u-95%&lt;/span&gt; &lt;span class="n"&gt;CI&lt;/span&gt; &lt;span class="n"&gt;Rhat&lt;/span&gt; &lt;span class="n"&gt;Bulk_ESS&lt;/span&gt; &lt;span class="n"&gt;Tail_ESS&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Intercept&lt;/span&gt; &lt;span class="m"&gt;20.89&lt;/span&gt; &lt;span class="m"&gt;1.27&lt;/span&gt; &lt;span class="m"&gt;18.41&lt;/span&gt; &lt;span class="m"&gt;23.45&lt;/span&gt; &lt;span class="m"&gt;1.00&lt;/span&gt; &lt;span class="m"&gt;5225&lt;/span&gt; &lt;span class="m"&gt;2737&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;sigma_Intercept&lt;/span&gt; &lt;span class="m"&gt;1.87&lt;/span&gt; &lt;span class="m"&gt;0.14&lt;/span&gt; &lt;span class="m"&gt;1.59&lt;/span&gt; &lt;span class="m"&gt;2.15&lt;/span&gt; &lt;span class="m"&gt;1.00&lt;/span&gt; &lt;span class="m"&gt;4015&lt;/span&gt; &lt;span class="m"&gt;2762&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;suppVC&lt;/span&gt; &lt;span class="m"&gt;-4.01&lt;/span&gt; &lt;span class="m"&gt;2.00&lt;/span&gt; &lt;span class="m"&gt;-7.84&lt;/span&gt; &lt;span class="m"&gt;-0.13&lt;/span&gt; &lt;span class="m"&gt;1.00&lt;/span&gt; &lt;span class="m"&gt;4398&lt;/span&gt; &lt;span class="m"&gt;2992&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;sigma_suppVC&lt;/span&gt; &lt;span class="m"&gt;0.22&lt;/span&gt; &lt;span class="m"&gt;0.20&lt;/span&gt; &lt;span class="m"&gt;-0.16&lt;/span&gt; &lt;span class="m"&gt;0.61&lt;/span&gt; &lt;span class="m"&gt;1.00&lt;/span&gt; &lt;span class="m"&gt;4197&lt;/span&gt; &lt;span class="m"&gt;2944&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Family&lt;/span&gt; &lt;span class="n"&gt;Specific&lt;/span&gt; &lt;span class="n"&gt;Parameters&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Estimate&lt;/span&gt; &lt;span class="n"&gt;Est.Error&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="m"&gt;-95&lt;/span&gt;&lt;span class="o"&gt;% CI u-95%&lt;/span&gt; &lt;span class="n"&gt;CI&lt;/span&gt; &lt;span class="n"&gt;Rhat&lt;/span&gt; &lt;span class="n"&gt;Bulk_ESS&lt;/span&gt; &lt;span class="n"&gt;Tail_ESS&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;nu&lt;/span&gt; &lt;span class="m"&gt;25.77&lt;/span&gt; &lt;span class="m"&gt;14.91&lt;/span&gt; &lt;span class="m"&gt;6.55&lt;/span&gt; &lt;span class="m"&gt;62.61&lt;/span&gt; &lt;span class="m"&gt;1.00&lt;/span&gt; &lt;span class="m"&gt;4616&lt;/span&gt; &lt;span class="m"&gt;2776&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Draws&lt;/span&gt; &lt;span class="n"&gt;were&lt;/span&gt; &lt;span class="n"&gt;sampled&lt;/span&gt; &lt;span class="n"&gt;using&lt;/span&gt; &lt;span class="nf"&gt;sampling&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;NUTS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="n"&gt;. For&lt;/span&gt; &lt;span class="n"&gt;each&lt;/span&gt; &lt;span class="n"&gt;parameter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Bulk_ESS&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;and&lt;/span&gt; &lt;span class="n"&gt;Tail_ESS&lt;/span&gt; &lt;span class="n"&gt;are&lt;/span&gt; &lt;span class="n"&gt;effective&lt;/span&gt; &lt;span class="n"&gt;sample&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt; &lt;span class="n"&gt;measures&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;and&lt;/span&gt; &lt;span class="n"&gt;Rhat&lt;/span&gt; &lt;span class="n"&gt;is&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;potential&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;scale&lt;/span&gt; &lt;span class="n"&gt;reduction&lt;/span&gt; &lt;span class="n"&gt;factor&lt;/span&gt; &lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="n"&gt;split&lt;/span&gt; &lt;span class="nf"&gt;chains &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;at&lt;/span&gt; &lt;span class="n"&gt;convergence&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Rhat&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="n"&gt;.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;a href="https://mjskay.github.io/tidybayes/articles/tidy-brms.html"&gt;tidybayes&lt;/a&gt; package is a handy companion if you work with brms objetcs. We can compare the above results with what would be obtained from the now archived &lt;a href="https://cran.r-project.org/web/packages/BEST/index.html"&gt;BEST&lt;/a&gt; package (latest version is from 2021):&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;library&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BEST&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;grp&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;with&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ToothGrowth&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;supp&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;BESTmcmc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;grp[[1]]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;grp[[2]]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;parallel&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;TRUE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Waiting&lt;/span&gt; &lt;span class="kr"&gt;for&lt;/span&gt; &lt;span class="n"&gt;parallel&lt;/span&gt; &lt;span class="n"&gt;processing&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;complete...done.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;MCMC&lt;/span&gt; &lt;span class="n"&gt;fit&lt;/span&gt; &lt;span class="n"&gt;results&lt;/span&gt; &lt;span class="kr"&gt;for&lt;/span&gt; &lt;span class="n"&gt;BEST&lt;/span&gt; &lt;span class="n"&gt;analysis&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="m"&gt;100002&lt;/span&gt; &lt;span class="n"&gt;simulations&lt;/span&gt; &lt;span class="n"&gt;saved.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;mean&lt;/span&gt; &lt;span class="n"&gt;sd&lt;/span&gt; &lt;span class="n"&gt;median&lt;/span&gt; &lt;span class="n"&gt;HDIlo&lt;/span&gt; &lt;span class="n"&gt;HDIup&lt;/span&gt; &lt;span class="n"&gt;Rhat&lt;/span&gt; &lt;span class="n"&gt;n.eff&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;mu1&lt;/span&gt; &lt;span class="m"&gt;20.797&lt;/span&gt; &lt;span class="m"&gt;1.2951&lt;/span&gt; &lt;span class="m"&gt;20.798&lt;/span&gt; &lt;span class="m"&gt;18.254&lt;/span&gt; &lt;span class="m"&gt;23.372&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="m"&gt;61131&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;mu2&lt;/span&gt; &lt;span class="m"&gt;16.889&lt;/span&gt; &lt;span class="m"&gt;1.6041&lt;/span&gt; &lt;span class="m"&gt;16.890&lt;/span&gt; &lt;span class="m"&gt;13.796&lt;/span&gt; &lt;span class="m"&gt;20.098&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="m"&gt;62000&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;nu&lt;/span&gt; &lt;span class="m"&gt;42.396&lt;/span&gt; &lt;span class="m"&gt;31.2307&lt;/span&gt; &lt;span class="m"&gt;34.208&lt;/span&gt; &lt;span class="m"&gt;3.113&lt;/span&gt; &lt;span class="m"&gt;104.074&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="m"&gt;24364&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;sigma1&lt;/span&gt; &lt;span class="m"&gt;6.765&lt;/span&gt; &lt;span class="m"&gt;0.9835&lt;/span&gt; &lt;span class="m"&gt;6.666&lt;/span&gt; &lt;span class="m"&gt;4.953&lt;/span&gt; &lt;span class="m"&gt;8.723&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="m"&gt;47897&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;sigma2&lt;/span&gt; &lt;span class="m"&gt;8.449&lt;/span&gt; &lt;span class="m"&gt;1.2427&lt;/span&gt; &lt;span class="m"&gt;8.314&lt;/span&gt; &lt;span class="m"&gt;6.178&lt;/span&gt; &lt;span class="m"&gt;10.928&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="m"&gt;43607&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;&amp;#39;HDIlo&amp;#39;&lt;/span&gt; &lt;span class="n"&gt;and&lt;/span&gt; &lt;span class="s"&gt;&amp;#39;HDIup&amp;#39;&lt;/span&gt; &lt;span class="n"&gt;are&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;limits&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="m"&gt;95&lt;/span&gt;% &lt;span class="n"&gt;HDI&lt;/span&gt; &lt;span class="n"&gt;credible&lt;/span&gt; &lt;span class="n"&gt;interval.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;&amp;#39;Rhat&amp;#39;&lt;/span&gt; &lt;span class="n"&gt;is&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;potential&lt;/span&gt; &lt;span class="n"&gt;scale&lt;/span&gt; &lt;span class="n"&gt;reduction&lt;/span&gt; &lt;span class="nf"&gt;factor &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;at&lt;/span&gt; &lt;span class="n"&gt;convergence&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Rhat&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="n"&gt;.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;&amp;#39;n.eff&amp;#39;&lt;/span&gt; &lt;span class="n"&gt;is&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;crude&lt;/span&gt; &lt;span class="n"&gt;measure&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;effective&lt;/span&gt; &lt;span class="n"&gt;sample&lt;/span&gt; &lt;span class="n"&gt;size.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This takes a much shorter amount of time. Kruschke wrote a paper about this approach, &lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt; which is implemented by the above function call. From the on-line help:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The function uses a t-distribution to model each sample, and
generates vectors of random draws from the posterior distribution
of the &lt;em&gt;center&lt;/em&gt; (mu) and &lt;em&gt;spread&lt;/em&gt; or &lt;em&gt;scale&lt;/em&gt; (sigma) of the
distribution, as well as a measure of &lt;em&gt;normality&lt;/em&gt; (nu). The
procedure uses a Bayesian MCMC process implemented in JAGS &lt;sup id="fnref:4"&gt;&lt;a href="#fn:4" class="footnote-ref" role="doc-noteref"&gt;4&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Kruschke also discussed two-group comparisons in section 16.3 of the second edition of his famous textbook.&lt;sup id="fnref:5"&gt;&lt;a href="#fn:5" class="footnote-ref" role="doc-noteref"&gt;5&lt;/a&gt;&lt;/sup&gt; As noted by the author, &amp;ldquo;When using t distributions for robust estimation, we could also estimate the normality of each group separately. But because there usually are relatively few outliers, we will use a single normality parameter to describe both groups, so that the estimate of the normality is more stably estimated.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;Now, it&amp;rsquo;s time to try out JASP. Here&amp;rsquo;s what we get after specifying an informed prior (Student t distribution with default scale factor of 0.707 and df=1) instead of a scaled Cauchy distribution:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2023-09-18-14-26-34.png"&gt;
&lt;/figure&gt;
&lt;p&gt;This module relies on the &lt;a href="https://cran.r-project.org/web/packages/BayesFactor/index.html"&gt;BayesFactor&lt;/a&gt; package, where the ttestBF implements work made by Morey and coll.&lt;sup id="fnref:6"&gt;&lt;a href="#fn:6" class="footnote-ref" role="doc-noteref"&gt;6&lt;/a&gt;&lt;/sup&gt; JASP also offers a &lt;em&gt;Robust T-Tests&lt;/em&gt; module which provides Bayesian model-averaged t-test, as implemented in the &lt;a href="https://cran.csail.mit.edu/web/packages/RoBTT/"&gt;RoBTT&lt;/a&gt; package. See also &lt;a href="https://journals.sagepub.com/doi/full/10.1177/2515245919898657"&gt;A conceptual introduction to Bayesian Model Averaging&lt;/a&gt; for an introduction. This involves longer computation time, but with default parameters we obtain the following results:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2023-09-18-14-38-26.png"&gt;
&lt;/figure&gt;
&lt;p&gt;There are various options that I did not try, but overall I find that this is a great way to get started with Bayesian statistics for beginner students. No need to learn complex R code or to install various stuff. However, we need to carefully check what packages are used under the hood, what priors are used, and what statistics are reported (e.g., Bayes Factor, posterior estimates, etc.).&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Anna Weber • &lt;em&gt;Idiom IV&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;I just noticed that the latest release of the &lt;a href="https://flathub.org/apps/com.helix_editor.Helix"&gt;Helix&lt;/a&gt; editor is available on Flahub as well.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;If you are using R in your terminal, &lt;code&gt;R CMD INSTALL&lt;/code&gt; from a shell is your best friend. Note that you will also need to install the &lt;code&gt;HDINterval&lt;/code&gt;.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:3"&gt;
&lt;p&gt;Kruschke, J. K. (2013). Bayesian estimation supersedes the &lt;em&gt;t&lt;/em&gt; test. &lt;em&gt;Journal of Experimental Psychology: General&lt;/em&gt; 142(2):573-603. Please note that the author reported modes rather than means.&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:4"&gt;
&lt;p&gt;Plummer, M. (2003). JAGS: A Program for Analysis of Bayesian Graphical Models Using Gibbs Sampling, &lt;em&gt;Proceedings of the 3rd International Workshop on Distributed Statistical Computing (DSC 2003)&lt;/em&gt;, March 20-22, Vienna, Austria.&amp;#160;&lt;a href="#fnref:4" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:5"&gt;
&lt;p&gt;Kruschke, J. K. (2015) &lt;em&gt;Doing Bayesian Data Analysis&lt;/em&gt; (2nd ed.), Academic Press.&amp;#160;&lt;a href="#fnref:5" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:6"&gt;
&lt;p&gt;Rouder, J. N., Speckman, P. L., Sun, D., Morey, R. D., &amp;amp; Iverson, G. (2009). Bayesian t-tests for accepting and rejecting the null hypothesis. &lt;em&gt;Psychonomic Bulletin &amp;amp; Review&lt;/em&gt;, 16, 225-237&amp;#160;&lt;a href="#fnref:6" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>ArXiving on September 2023</title><link>https://aliquote.org/post/arxiv-13/</link><pubDate>Wed, 06 Sep 2023 12:19:00 +0100</pubDate><guid>https://aliquote.org/post/arxiv-13/</guid><description>&lt;h3 id="unidimensionality-in-rasch-models-efficient-item-selection-and-hierarchical-clustering-methods-based-on-marginal-estimates-"&gt;Unidimensionality in Rasch Models: Efficient Item Selection and Hierarchical Clustering Methods Based on Marginal Estimates (&lt;a href="https://arxiv.org/abs/2309.00553"&gt;https://arxiv.org/abs/2309.00553&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;Since I am no longer involved in psychometrics or this kind of stuff (even on Cross Validated), I rarely read this kind of papers nowadays. Selecting misfitting items on a scale has a long history, especially for Rasch modellers. This paper exposes a sort of clustering method that allows to flag item, based on the variance of a mixing distribution, that do not belong with a set of items sharing a commin trait.&lt;/p&gt;
&lt;h3 id="optimal-scaling-transformations-to-model-non-linear-relations-in-glms-with-ordered-and-unordered-predictors-"&gt;Optimal Scaling transformations to model non-linear relations in GLMs with ordered and unordered predictors (&lt;a href="https://arxiv.org/abs/2309.00419"&gt;https://arxiv.org/abs/2309.00419&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;Still a memory of my previous job where I used to use optimal scaling a lot, but in the context of &lt;a href="https://link.springer.com/chapter/10.1007/978-3-662-01131-7_6"&gt;projection methods&lt;/a&gt; in multivariate exploratory data analysis. Here, Meulman and collaborators consider optimal scaling as an alterantive framework to GAM to allow non linearity in discrete predictors. In particular, this alleviares the need for dummy coded variable levels, via quantization with monotonicity constraints, which facilitates the interpretation of the resulting output. There will probably an R package available at some point. See also &lt;a href="https://projecteuclid.org/journals/statistical-science/volume-34/issue-3/ROS-Regression-Integrating-Regularization-with-Optimal-Scaling-Regression/10.1214/19-STS697.full"&gt;ROS Regression: Integrating Regularization with Optimal Scaling Regression&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="an-introduction-to-graph-theory-"&gt;An introduction to graph theory (&lt;a href="https://arxiv.org/abs/2308.04512"&gt;https://arxiv.org/abs/2308.04512&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;A complete course on graph theory, including network flows, for graduate students. It is rather extensive (422 pp.) and there are a lot of illustrations.&lt;/p&gt;
&lt;h3 id="permutation-testing-in-high-dimensional-linear-models-an-empirical-investigation-"&gt;Permutation testing in high-dimensional linear models: an empirical investigation (&lt;a href="https://arxiv.org/abs/2001.01466"&gt;https://arxiv.org/abs/2001.01466&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;This is an extension to the permutation testing framework to the case where the number of predictors exceeds the sample size. In classical settings ($p &amp;lt; n$), the startegy amounts to compute the test statistics under random permutation of the residuals.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; When $n \ll p$, however, regularization methos like the elastic net appoach msut be used. The authors recall that for minimizing prediction error, ridge regression is often preferrable to Lasso, principal components regression, variable subset selection and partial least squares. Moreover, ridge regression is close to the Freedman-Lane approach, which is based on semi-partial correlations. The authors finally suggest to use double residualization, which is inspired by the Kennedy method, which residualizes both $Y$ and $X$ and proceeds to permute the $Y$-residuals, &lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; but in this paper the authors replace the least squares regression by ridge regression.&lt;/p&gt;
&lt;h3 id="tutorial-a-priori-estimation-of-sample-size-effect-size-and-statistical-power-for-cluster-analysis-latent-class-analysis-and-multivariate-mixture-models-"&gt;Tutorial: a priori estimation of sample size, effect size, and statistical power for cluster analysis, latent class analysis, and multivariate mixture models (&lt;a href="https://arxiv.org/abs/2309.00866"&gt;https://arxiv.org/abs/2309.00866&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;This is a short review of power analysis for k-means, Ward agglomerative hierarchical clustering, c-means fuzzy clustering, latent class analysis, latent profile analysis, and Gaussian mixture modelling. Results based on simulated datasets are summarized in Table 1 of the paper, reproduced below.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2023-09-07-10-32-51.png"&gt;
&lt;/figure&gt;
&lt;h3 id="supervised-dimensionality-reduction-for-multiple-imputation-by-chained-equations-"&gt;Supervised dimensionality reduction for multiple imputation by chained equations (&lt;a href="https://arxiv.org/abs/2309.01608"&gt;https://arxiv.org/abs/2309.01608&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;In this paper, the authors discuss the use of principal component, principal covariates, and partial least squares regression, instead of unsupervised PCA, with &lt;a href="https://amices.org/mice/"&gt;MICE&lt;/a&gt;. Results show that supervised appraoches perform better, and that supervised principal component regression has smaller bias and better confidence interval coverage for a wider range of retained components, independent of the number of latent variables.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Bauhaus • &lt;em&gt;Stigmata Martyr&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Freedman, D. and Lane, D. A nonstochastic interpretation of reported significance levels. &lt;em&gt;Journal of Business &amp;amp; Economic Statistics&lt;/em&gt;, 1(4):292–298, 1983.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;Kennedy, F. E. Randomization tests in econometrics. &lt;em&gt;Journal of Business &amp;amp; Economic Statistics&lt;/em&gt;, 13 (1):85–94, 1995.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Why I like Ubuntu, eventually</title><link>https://aliquote.org/post/why-i-like-ubuntu/</link><pubDate>Mon, 04 Sep 2023 15:34:30 +0200</pubDate><guid>https://aliquote.org/post/why-i-like-ubuntu/</guid><description>&lt;p&gt;A few years ago I switched to Linux after having been a fervent Mac user for over 13 years. I somewhat lost interest in the Apple ecosystem on my Macbook, and I was mostly using TUI applications anyway. I never upgrade past Mojave, and I&amp;rsquo;ve been following the up and down of each new release afterwards. My phone is an iPhone 6 which can&amp;rsquo;t be upgraded anymore. I don&amp;rsquo;t plan to buy a new one: too expensive, too large. I only bought the iPhone 13 mini for my son for his birthday, at a reduced price. Anyway, I wish the iPhone 3 was still a thing. I don&amp;rsquo;t really like the idea that OS upgrade are so much tighted to the device. And the sandboxing policy, which I always found at an angle with what OpenBSD offers, for example. Well, I already wrote &lt;a href="https://aliquote.org/post/bye-bye-apple/"&gt;my thoughts&lt;/a&gt; about all of that, apparently.&lt;/p&gt;
&lt;p&gt;Switching to Ubuntu was like going back in time since I was a Linux user during my PhD, and I used a lot of distros: Madrake (1 yr), Red Hat (1 yr), Slackware (6 mo) and finally Debian (2 or 3 yr). I didn&amp;rsquo;t really miss anything when I started using &lt;a href="https://aliquote.org/post/one-week-with-ubuntu/"&gt;Ubuntu&lt;/a&gt; as I was comfortable with the command line, and all the applications I used on the Mac mainly ran on the command line. I also installed OpenBSD on another laptop, but no other Linux boxes. Note that I did not try any other mainline or fancy Linux distros, so in this post I am only speaking of Ubuntu.&lt;/p&gt;
&lt;p&gt;Recently, I came across a nice blog post by Alan Pope: &lt;a href="https://popey.com/blog/2023/08/why-i-use-ubuntu/"&gt;Why I use Ubuntu&lt;/a&gt;. Among the key points, I like that it works and that it offers a relatively secure and consistent UI. Compared to Debian, it is way easier to bring back to life an old Macbook pro with retina display and specific wireless driver. I may try Fedora at some point, at least to remind me of my RPMs days. I should not that there are things that I don&amp;rsquo;t really like, but snap is probably one of the &lt;a href="https://hackaday.com/2020/06/24/whats-the-deal-with-snap-packages/"&gt;ugly thing&lt;/a&gt; that comes to my mind. You will even find outdated versions of deb packages (e.g., the &lt;code&gt;tree&lt;/code&gt; program). I already purged everything related to snap on my machine, but I keep seeing applications that are only available via snap or flatpak (e.g., the statistical packages Jasp or Jamovi) along with Docker sometimes. At this point, I don&amp;rsquo;t really know if flatpak is a better option or not. Maybe I should give it a try. Anyway, here&amp;rsquo;s a good thread on how to uninstall snap and/or install flatpak instead: &lt;a href="https://askubuntu.com/questions/1170688/how-to-completely-remove-snap-and-replace-with-flatpak"&gt;How to completely remove snap and replace with flatpak?&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I’ve been using Ubuntu now for eighteen years. I know (roughly) how it works. I am familiar with the release cadence and set my expectations accordingly. I can manage to upgrade from one release to another without the sky falling in. When something does go wrong, I’m able to fix it or find out how to. I rarely ’nuke and pave’ a system, even if it seems beyond repair.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I am probably a lucky guy but my Ubuntu personal machine never crashed. I had occasional problems on one of the two servers I manage at work, but this was easy to fix. I have a very spartan use of graphical applications, and I mostly work in a terminal. I discussed this extensively in &lt;a href="https://aliquote.org/tags/unix/"&gt;previous posts&lt;/a&gt;. What I really like is the package manager: compared to Homebrew on my Macbook, everything is in order, perfectly in sync with upstream versions, without any dependency issues (most of the time). When you remove a program, the OS takes care of properly (most of the time) removing its dependencies as well.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve tried various setups in the past (i3 or Regolith on x11), pseudo-tiling WM (Tactile extension for Gnome) and then settled upon the default settings, pending minor customizations (e.g., removing the Dock, enhancing the menu bar), but see &lt;a href="https://aliquote.org/post/how-to-do-without-wm/"&gt;How to get by without using a tiling WM&lt;/a&gt;. Tmux is really all what I need to manage my terminal sessions, and you know, it&amp;rsquo;s just &lt;a href="https://archive.org/details/aquartercenturyofunixpeterh.salus_201910"&gt;plain text&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Software should be well designed because good design avoids many problems during its lifetime. Also, because good design can offer much additional gain. Indeed, much effort should be spent on good design to make software more valuable. The Unix Philosophy pro- vides a way to design software well. It offers guidelines to achieve good quality and high gain for the effort spent. &amp;mdash; &lt;a href="https://aliquote.org/pub/unix-philosophy.pdf"&gt;Why the Unix Philosophy still matters&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Adam Wakeman • &lt;em&gt;The Island&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in August</title><link>https://aliquote.org/post/micro-08-2023/</link><pubDate>Thu, 31 Aug 2023 09:22:17 +0200</pubDate><guid>https://aliquote.org/post/micro-08-2023/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-08-21&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_3155.JPG" alt="img"&gt;&lt;small&gt;Home sweet home.&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-08-21&lt;/a&gt;: &lt;a href="https://alexplescan.com/posts/2023/08/20/gnu-parallel/"&gt;GNU Parallel, where have you been all my life?&lt;/a&gt;: Yet another nice example of why &lt;code&gt;parallel&lt;/code&gt; is such a great program. I learned to use it a while ago, after having read Jearoen Janssens&amp;rsquo; wonderful book, &lt;em&gt;Data Science at the Command Line&lt;/em&gt;, in its first edition. BTW, the 2nd edition is available &lt;a href="https://jeroenjanssens.com/dsatcl/"&gt;online&lt;/a&gt; for free.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-08-21&lt;/a&gt;: &lt;a href="https://pi.math.cornell.edu/~mec/mircea.html"&gt;Non-Euclidean Geometry Online: a Guide to Resources&lt;/a&gt;: As the title suggests, a bunch of online resources to learn more about elliptical and hyperbolic geometries.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-08-22&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;This post is a detailed discussion into user profiles, their directories, and how they are—to put it bluntly—in total disarray on Windows and Linux (I haven&amp;rsquo;t used a Mac in ages, but I assume the situation is very similar there, too). Applications treat the user profile as a dumping ground, and any user with a reasonably wide list of installed software will find their user profile very difficult to traverse after some time in use. There are platform conventions and attempts to standardise things on more open-source platforms, but a lot of developers resolutely refuse to change the behaviour of their software for a variety of reasons (some less valid than others). &amp;mdash; &lt;a href="https://gist.github.com/sharadhr/39b804236c1941e9c30d90af828ad41e"&gt;&lt;code&gt;$HOME&lt;/code&gt;, Not So Sweet &lt;code&gt;$HOME&lt;/code&gt;&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-08-22&lt;/a&gt;: TIL about &lt;a href="https://public-inbox.org/INSTALL.html"&gt;lei&lt;/a&gt;: &lt;a href="https://josefbacik.github.io/kernel/2021/10/18/lei-and-b4.html"&gt;Using lei, b4, and mutt to do kernel development&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-08-23&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If you cannot solve the proposed problem try to solve first some related problem. Could you imagine a more accessible related problem? A more general problem? A more special problem? An analogous problem? Could you solve a part of the problem? &amp;mdash; &lt;a href="https://www.math.utah.edu/~alfeld/math/polya.html"&gt;G. Polya, How to Solve It&lt;/a&gt;Which is probably why we face so many times the &lt;a href="https://en.wikipedia.org/wiki/XY_problem"&gt;XY problem&lt;/a&gt; on forum, QAs sites, and mailing lists.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-08-23&lt;/a&gt;: &lt;a href="https://blog.matthieud.me/2023/the-missing-cpp-smart-pointer/"&gt;The missing C++ smart pointer&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-08-23&lt;/a&gt;:
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_3100.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_3100.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_3132.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_3132.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_3149.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_3149.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;small&gt;Sneak preview of summer&amp;rsquo;s latest culinary preparations.&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-08-28&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Also, whenever someone tells me that Arch never breaks, “You just have to read the blog”. Uh, okay. No thanks. I’m not reading all the latest news about any other device I allow updates to. I’m not starting that nonsense in my fifties. &amp;mdash; &lt;a href="https://popey.com/blog/2023/08/why-i-use-ubuntu/"&gt;Why I use Ubuntu&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-08-28&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Now, I&amp;rsquo;ll be quick to admit that you probably shouldn&amp;rsquo;t spend a huge amount of time trying to install something from source. For many packages the best case scenario is a complicated process requiring&amp;gt; specific build tools and dependencies with their own complications. The worst case scenario is poor or lacking documentation and no idea how to even get started. &amp;mdash; &lt;a href="https://www.aolium.com/karlseguin/721a356f-4596-dcce-3f5d-febb026d0705"&gt;Try installing from source first&lt;/a&gt;I did install from scratch almost any app/program on my Mac &lt;a href="https://aliquote.org/post/back-in-mac/"&gt;15 years ago&lt;/a&gt;. At that time, Mac systems were transitioning from 32 to 64 bits, and it was kind of a mess for some programs. Then I got bored and I choose to rely on Homebrew. Then Homebrew got sort of broken on my Macbook, and I was back at the magic incantation &lt;code&gt;configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install&lt;/code&gt;.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-08-28&lt;/a&gt;: As a sequel of one of my last &lt;a href="https://aliquote.org/post/duckdb/"&gt;benchmarking post&lt;/a&gt;, here&amp;rsquo;s a rough estimate of Polars vs. Datatable performance when reading a 34 Mb file (NYC Flights Dataset, available from avrious sources; see e.g., &lt;a href="https://aliquote.org/post/racket-data-frames"&gt;this post&lt;/a&gt;):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;time&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;datatable&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;polars&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;tic&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;flights&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;polars&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read_csv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;nycflights.csv&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;null_values&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;NA&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;toc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;Elapsed time: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;toc&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;tic&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;.2f&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; ms&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## =&amp;gt; Elapsed time: 54.61 ms&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;tic&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;flights&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;datatable&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fread&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;nycflights.csv&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;toc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;Elapsed time: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;toc&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;tic&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;.2f&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; ms&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## =&amp;gt; Elapsed time: 57.60 ms&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Polars also offers a lazy CSV reader using &lt;code&gt;scan_csv&lt;/code&gt;, which is way faster (1.22 ms). &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-08-28&lt;/a&gt;: &lt;a href="https://interrupt.memfault.com/blog/a-modern-c-dev-env"&gt;A Modern C Development Environment&lt;/a&gt;: A complete step by step tutorial to develop using Docker and GitHub workflow. Note that &lt;a href="https://clang.llvm.org/extra/clang-tidy/"&gt;clang-tidy&lt;/a&gt; is available in ALE for Vim. If you use Neovim, the the clangd LSP already uses clang-tidy, or you can just add &lt;code&gt;--clang-tidy&lt;/code&gt; to clangd parameters. Extra &lt;a href="https://clang.llvm.org/extra/clang-tidy/checks/list.html"&gt;options&lt;/a&gt; can also be added in a &lt;code&gt;.clang-tidy&lt;/code&gt; file. See also &lt;code&gt;clang --help-hidden&lt;/code&gt;.&lt;br&gt;&lt;img src="https://aliquote.org/img/2023-08-28-15-54-39.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-08-28&lt;/a&gt;: &lt;a href="https://resend.com/blog/email-authentication-a-developers-guide"&gt;Email Authentication: A Developer&amp;rsquo;s Guide&lt;/a&gt;: I got my emails treated as spam by Gmail when using my www provider (OVH), which is probably why. And this doesn&amp;rsquo;t happen when I send emails via may mac.com account. Note that Google only started rejecting my principal domain name a few months ago, or maybe last year.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-08-28&lt;/a&gt;: &lt;a href="https://lord.io/usernames/"&gt;Identity Beyond Usernames&lt;/a&gt;. For random UUIDs, see also &lt;a href="https://susam.net/blog/fixed-bits-of-version-4-uuid.html"&gt;Fixed Bits of Version 4 UUID&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-08-29&lt;/a&gt;: &lt;a href="https://marcosampellegrini.com/thoughts-on-haskell-2020"&gt;My thoughts on Haskell in 2020&lt;/a&gt;. tl;dr Stick to Simple Haskell. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-08-29&lt;/a&gt;: &lt;a href="https://vmartin.fr/understanding-automatic-differentiation-in-30-lines-of-python.html"&gt;Understanding Automatic Differentiation in 30 lines of Python&lt;/a&gt;: A simplified yet effective illustration of AD in the context of neural network training. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-08-29&lt;/a&gt;: &lt;a href="https://blog.carlmjohnson.net/post/2020/python-square-of-opposition/"&gt;Why does all() return True if the iterable is empty?&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-08-29&lt;/a&gt;: &lt;div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"&gt;
&lt;iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/6w0im3LHazY?autoplay=0&amp;amp;controls=1&amp;amp;end=0&amp;amp;loop=0&amp;amp;mute=0&amp;amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"&gt;&lt;/iframe&gt;
&lt;/div&gt;
&lt;small&gt;Mood of the day.&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-08-30&lt;/a&gt;: Until now when reading my feeds using &lt;a href="https://newsboat.org/"&gt;Newsboat&lt;/a&gt;, I was simply filtering unread feeds, sorted by count using a dedicated keybinding (&lt;code&gt;bind-key S rev-sort&lt;/code&gt;, which allows me to simply press &lt;code&gt;Su&lt;/code&gt; to get the desired output). Now, I learned about &lt;code&gt;l&lt;/code&gt; which filters unread feeds. It is quite handy since it acts as a filter and the list of unread feeds empties itself as you read articles.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-08-30&lt;/a&gt;: ♪ Benoît Delbecq · Anamorphoses&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-08-31&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Nushell isn&amp;rsquo;t exactly a shell, at least not in the traditional Unix sense of the word. Nushell is trying to answer the question: &amp;ldquo;what if we asked more of our shells?&amp;rdquo; &amp;mdash; &lt;a href="https://www.jntrnr.com/case-for-nushell/"&gt;The case for Nushell&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;With recent support for &lt;a href="https://www.nushell.sh/book/dataframes.html"&gt;data frames&lt;/a&gt;, it becomes an interesting challenger for tiny on-the-fly data wrangling scripts. Beware that it relies on &lt;a href="https://github.com/pola-rs/polars"&gt;polars-arrow&lt;/a&gt; which (most of the time) require a recent stable Rust. Also, if you encounter an E0034 (&amp;ldquo;multiple applicable items in scope&amp;rdquo;) when compiling polars-related dependencies, try adding &lt;a href="https://stackoverflow.com/q/76989793"&gt;&lt;code&gt;--locked&lt;/code&gt;&lt;/a&gt; to &lt;code&gt;cargo install&lt;/code&gt;. When you&amp;rsquo;re done, enjoy the power of data frames right into your shell!With my &lt;a href="https://aliquote.org/micro/2023-08-28-12-46-04/"&gt;last timing&lt;/a&gt; for processing a 30 Mb CSV file, loading the file in Nu shell is a breeze:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;~/tmp&amp;gt; timeit &lt;span class="o"&gt;{&lt;/span&gt;dfr open ./nycflights.csv&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;70ms 682µs 766ns
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;~/tmp&amp;gt; timeit &lt;span class="o"&gt;{&lt;/span&gt;open ./nycflights.csv&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;1sec 194ms 477µs 961ns
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;small&gt;First instruction uses &lt;code&gt;dfr open&lt;/code&gt; while the second instruction relies on builtin &lt;code&gt;open&lt;/code&gt; command.&lt;/small&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-08-31&lt;/a&gt;: Among many of the text-based UIs advantages, I found that the ability to copy-paste almost anything using Vim shortcuts via tmux or the shift+ctrl combo of my terminal emulator is one of my preferred. Here is an excerpt from my long-running (server side) Irssi session, as a tribute to Vim&amp;rsquo;s creator:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;23:57 -A_Dragon(A_D@libera/staff/dragon)- [Global Notice] The Matrix bridge is experiencing continued stability and privacy issues; we have requested it be shut down until they are resolved. Matrix have agreedto shut down the bridge no later than 1400UTC on Saturday. Feel free to ask further questions in #libera-matrix
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;---- Day changed to 05 août 202317:35 WALLOP kline: Bram Moolenaar finally :wq after many years contributing to free software, his relentless hard work making vim arguably the #1 editor in the world. RIP Bram, and thank you for your work.https://groups.google.com/g/vim_announce/c/tWahca9zkt4
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;---- Day changed to 06 août 2023
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-08-31&lt;/a&gt;: TIL that GitHub renders warning or note blocks with a special formatting in Markdown document, e.g. &lt;a href="https://github.com/nushell/tree-sitter-nu/blob/main/installation/neovim.md"&gt;here&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;</description></item><item><title>Bayesian power analysis and confidence intervals</title><link>https://aliquote.org/post/gaussian-credible-interval/</link><pubDate>Wed, 30 Aug 2023 09:33:34 +0200</pubDate><guid>https://aliquote.org/post/gaussian-credible-interval/</guid><description>&lt;p&gt;We are often tasked with computing the number of subjects needed to achieve a certain statistical power, especially in biomedical sciences. Various formulae are available online or in dedicated textbooks.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; Here is a simple illustration with a two-sample proportion: Let&amp;rsquo;s say we want to compare the efficacy of a new treatment (N) with that of the reference treatment (R) in a clinical trial. The outcome is the percentage of complete remission after one week. We know that this percentage equals 50% with R, and we expect 80% of recovery with N.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; To achieve 95% statistical power, how many patients do we need to enroll?&lt;/p&gt;
&lt;p&gt;First, let&amp;rsquo;s say we can only enroll 50 patients per group. Then, using standard formulae and considering a 5% type I error, $\Phi = \frac{1.107 - 0.785}{\sqrt{0.25 \times 2/50}} = 3.22$, which means we will end up with 90% power.&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt; Now, to achieve 95% statistical power, $\Phi = 3.61$, hence $n = \frac{2 \times 0.25 \times 3.61^2}{(1.107 - 0.785)^2} = 63$ subjects per group. Dealing with proportions usually involves the arcsin transformation, which can be applied to raw data or directly to estimated proportions. This is discussed in Ryan&lt;sup id="fnref1:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;, pp. 116-117. Here is what I get with Stata 13 for a two-sample proportions likelihood-ratio test: (Note that we get N=63 when using a chi-squared test)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;. power twoproportions 0.5 0.8, test(lrchi2) power(0.95)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Performing iteration ...
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Estimated sample sizes for a two-sample proportions test
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Likelihood-ratio test
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Ho: p2 = p1 versus Ha: p2 != p1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Study parameters:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; alpha = 0.0500
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; power = 0.9500
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; delta = 0.3000 (difference)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; p1 = 0.5000
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; p2 = 0.8000
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Estimated sample sizes:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; N = 130
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; N per group = 65
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The same principle applies to the case of the arithmetic mean and a two-sample Student t-test, of course. Note that in the case of small proportion (here, the difference between $P_N$ and $P_R$, the number of subjects required to achieve a certain power $1-\beta$ will grow up quickly as $\beta$ decreases: to detect a 5% difference in proportion, with $P_R=0.5$, using 1000 subjects per arm will give you only 61% power; for a 2.5% difference with the same number of subjects, don&amp;rsquo;t expect to get more than 20% power.&lt;/p&gt;
&lt;p&gt;Bayesian approaches&lt;sup id="fnref:4"&gt;&lt;a href="#fn:4" class="footnote-ref" role="doc-noteref"&gt;4&lt;/a&gt;&lt;/sup&gt; usually yield smaller sample sizes compared to frequentist approaches, and most of the time no closed-form solutions do exist which means numerical computation must be undergone. I found an interesting review of the pros and cons of those approaches in a recent article of The American Statistician: &lt;a href="https://www.tandfonline.com/doi/full/10.1080/00031305.2021.1901782"&gt;A Review of Bayesian Perspectives on Sample Size Derivation for Confirmatory Trials&lt;/a&gt;. And here is a blog post that discusses a simulation-based approach for power analysis using posterior distributions: &lt;a href="https://www.rdatagen.net/post/2021-06-01-bayesian-power-analysis/"&gt;Sample size determination in the context of Bayesian analysis&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Likewise, computing confidence intervals most of the time relies on the use of a normal approximation in the case of two-sample proportions, and it is covered in most textbooks in the case of two-sample experiments. Basically, we would compute a 95% CI for the difference between two proportions as follows: $(P_N–P_R) \pm \Phi^{-1}(\alpha/2)\sqrt{P_N(1-P_N)/n_N + P_R(1-P_R)/n_R}$, where $\Phi$ is the cumulative distribution function for the standard normal distribution (with mean 0 and variance 1), and $\alpha$ is the predefined type I error rate. Typically, $\alpha=0.05$, and $\Phi^{-1}(0.025)=-1.96$ and $\Phi^{-1}(0.975)=1.96$.&lt;/p&gt;
&lt;p&gt;Now, we can take a different approach and rely on credible intervals, as illustrated in Murphy&amp;rsquo;s updated edition of his famous ML textbook,&lt;sup id="fnref:5"&gt;&lt;a href="#fn:5" class="footnote-ref" role="doc-noteref"&gt;5&lt;/a&gt;&lt;/sup&gt; which I am currently reading. The problem is stated as follows: Let $X\sim\mathcal{N}(\mu, \sigma^2=4)$ where $\mu$ is unknown but has prior $\mu\sim\mathcal{N}(\mu_0,\sigma_0^2=9)$. The posterior after seeing $n$ samples is $\mu_n\sim\mathcal{N}(\mu_n,\sigma_n^2)$. How big does $n$ have to be to ensure $P(l\leq\mu_n\leq u\mid D) \geq 0.95$, where $(l,u)$ is an interval centered on $\mu_n$ of width 1, and $D$ is the data?&lt;/p&gt;
&lt;p&gt;Here is the full derivation in the case of a two-sample problem with a continuous outcome. As stated, we want an interval that verifies $P(l\leq \mu_n \leq u\mid D) \geq 0.95$, where as usual:&lt;/p&gt;
&lt;p&gt;$$
\begin{equation}
\begin{aligned}
l &amp;amp; = \mu_n + \Phi^{-1}(\alpha/2)\sigma_n = \mu - 1.96\sigma_n \cr
u &amp;amp; = \mu_n + \Phi^{-1}(1-\alpha/2)\sigma_n = \mu + 1.96\sigma_n
\end{aligned}
\end{equation}
$$&lt;/p&gt;
&lt;p&gt;We need to find $n$ such that $u - l = 1$, that is $2(1.96)\sigma_n = 1$, or $\sigma_n^2 = \frac{1}{4(1.96)^2}$ with $\sigma_n^2 = \frac{\sigma^2\sigma_0^2}{n\sigma_0^2+\sigma^2}$. Hence we have&lt;/p&gt;
&lt;p&gt;$$
\begin{equation}
\begin{aligned}
n\sigma_0^2 + \sigma^2 &amp;amp; = (\sigma^2\sigma_0^2)4(1.96)^2 \cr
n &amp;amp; = \frac{\sigma^2(\sigma_0^24(1.96)^2-1}{\sigma_0^2} \cr
&amp;amp; = \frac{4(9\times (1.96)^2-1}{9} = 61.0212
\end{aligned}
\end{equation}
$$&lt;/p&gt;
&lt;p&gt;We would need at least $n\geq 62$ subjects per group.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Jean Carn, Adrian Younge &amp;amp; Ali Shaheed Muhammad • &lt;em&gt;Black Rainbows&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Thomas P. Ryan. &lt;em&gt;Sample Size and Determination and Power&lt;/em&gt;. Wiley, 2013.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&amp;#160;&lt;a href="#fnref1:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;Bouvenot &amp;amp; Vray. &lt;em&gt;Essais Cliniques. Théorie, Pratique et Critique&lt;/em&gt; (4ème éd.). Lavoisier, 2006 (p. 248).&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:3"&gt;
&lt;p&gt;An other interesting question would be to ask what is the minimal expected recovery percentage we would get with 50 patients per group at 80% power. The derivation is as follows: $\Pi_N - \Pi_R = 2.80\sqrt{(2 \times 0.25)/50} = 0.28$, so that $\Pi_N = \Pi_R + 0.28 = 0.785 + 0.28 = 1.065$. In other words, $P_N = 76%$.&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:4"&gt;
&lt;p&gt;I&amp;rsquo;m not talking about Bayesian updating whereby we sample size is increased during the course of a study by using the Bayes factor to quantify the degree of support for a hypothesis agaisnt the alternative given the observed data.&amp;#160;&lt;a href="#fnref:4" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:5"&gt;
&lt;p&gt;&lt;em&gt;Probabilistic Machine Learning: An introduction&lt;/em&gt;. See all available textbooks &lt;a href="https://probml.github.io/pml-book/"&gt;here&lt;/a&gt;.&amp;#160;&lt;a href="#fnref:5" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>August in review (2)</title><link>https://aliquote.org/post/micro-review-026/</link><pubDate>Mon, 21 Aug 2023 13:41:36 +0200</pubDate><guid>https://aliquote.org/post/micro-review-026/</guid><description>&lt;p&gt;As a sequel of one omy last posts, here are some more bookmarks that were awaiting some kind of a short review.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.seebs.net/faqs/c-iaq.html"&gt;Infrequently asked questions in comp.lang.c&lt;/a&gt;: I once thought about writing a similar thing for common questions on Cross Validated, then gave up since it became clear that it would require way much more time that I could possibly allow for this task.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://dpk.io/r7rswtf"&gt;WTF is going on with R7RS Large?&lt;/a&gt;: Besides a short but nice summary on how Scheme implementations evolved overtime, this post tries to explain what happened behind the scenes regarding the future of R&lt;sup&gt;7&lt;/sup&gt;RS Large which should be entirely SRFI-based, contrary to previous revisions of the Scheme language.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blog.regehr.org/archives/213"&gt;A Guide to Undefined Behavior in C and C++, Part 1&lt;/a&gt;: A 3-part series on undefined behavior (resulting from erroneous operations like accessing a null pointer or dividing by zero) in C, as the title suggests.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://probml.github.io/pml-book/"&gt;Probabilistic Machine Learning: Advanced Topics&lt;/a&gt;: I enjoyed reading the very first book written by Kevin Murphy, &lt;em&gt;Machine Learning: A Probabilistic Perspective&lt;/em&gt;. Then I discovered that he wrote two other books totalling more than 2000 pp. of fresh material.&lt;/li&gt;
&lt;li&gt;Here is new version of &lt;a href="https://www.moderncsv.com/modern-csv-2-is-now-available/"&gt;Modern CSV&lt;/a&gt; if you happen to process raw CSV files in your terminal.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://lord.io/spreadsheets/"&gt;How to Recalculate a Spreadsheet&lt;/a&gt;: Lot of useful tips and informations regaridng the management of live spreadsheets.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://mattwidmann.net/notes/web-reading-list/"&gt;Web reading list&lt;/a&gt;: I like when bloggers provide a list of the blog they follow themselves, or directly an RSS or Atom feed. Check out his website too, it is beautifully organized and laid out.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://leancrew.com/all-this/2023/08/decimal-to-fraction/"&gt;Decimal to fraction&lt;/a&gt;: Another great post by Dr. Drang on continued fractions and their convergents (i.e., rational approximations to an irrational number represented as an infinte continued fraction).&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;Code is not literature and we are not readers. Rather, interesting pieces of code are specimens and we are naturalists. So instead of trying to pick out a piece of code and reading it and then discussing it like a bunch of Comp Lit. grad students, I think a better model is for one of us to play the role of a 19th century naturalist returning from a trip to some exotic island to present to the local scientific society a discussion of the crazy beetles they found: “Look at the antenna on this monster! They look incredibly ungainly but the male of the species can use these to kill small frogs in whose carcass the females lay their eggs.” &amp;mdash; &lt;a href="https://gigamonkeys.com/code-reading/"&gt;Code is not literature&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;a href="https://thomer.com/vi/vi.html"&gt;Vi Lovers Home Page&lt;/a&gt; &amp;hellip; this makes a great starting point. Agree. See also this &lt;a href="https://news.ycombinator.com/item?id=37100833"&gt;HN thread&lt;/a&gt;. And &lt;a href="https://neovim.io/news/2023/08"&gt;RIP&lt;/a&gt; Bram Moolenaar.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://paulbourke.net/fractals/symmetryinchaos/"&gt;Symmetry in Chaos&lt;/a&gt;: Beautiful illustrations of various attractors.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/streamers.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/streamers.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/pentagonal2.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/pentagonal2.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/davidstar.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/davidstar.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://hirrolot.github.io/posts/why-static-languages-suffer-from-complexity.html"&gt;Why Static Languages Suffer From Complexity&lt;/a&gt;: A sound review of statically and dynamically typed PLs, where the statics level is where all linguistic machinery is being performed at compile-time, while the dynamics level is where code is being executed at run-time, according to the author.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://clojure-goes-fast.com/blog/clojures-deadly-sin/"&gt;Clojure&amp;rsquo;s deadly sin&lt;/a&gt;: Interesting discussion of Clojure&amp;rsquo;s lazyness (as a feature).&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pboyd.io/posts/securing-a-linux-vm/"&gt;The Reluctant Sysadmin&amp;rsquo;s Guide to Securing a Linux Server&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://catskull.net/html.html"&gt;I&amp;rsquo;m betting on HTML&lt;/a&gt;: &amp;ldquo;What I mean is that people are not typically motivated to adopt new social media platforms for reasons that may not be entirely clear. I’m not condemning these efforts - I believe there’s a future there, and I’m watching as the development progresses. However, I believe we’re already sitting on a tried and tested solution: HTML.&amp;rdquo;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://log.schemescape.com/posts/programming-languages/learning-lisp-in-2023.html"&gt;It&amp;rsquo;s 2023, so of course I&amp;rsquo;m learning Common Lisp&lt;/a&gt;: TL;DR CL looks great for interactive development, including debugging.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://nxdomain.no/~peter/what_every_it_person_needs_to_know_about_openbsd.html"&gt;What every IT person needs to know about OpenBSD&lt;/a&gt;. That says it all!&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Estrada Real • &lt;em&gt;Chico Pinheiro&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>August in review</title><link>https://aliquote.org/post/micro-review-025/</link><pubDate>Mon, 21 Aug 2023 09:53:01 +0200</pubDate><guid>https://aliquote.org/post/micro-review-025/</guid><description>&lt;p&gt;Here is a not so short list of things I bookmarked during the summer.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://claytonwramsey.github.io/2023/06/20/fiddler-const-magic.html?utm_source=pocket_saves"&gt;Blowing up my compile times for dubious benefits&lt;/a&gt;: An interesting discussion (and application in Rust) on optimizing move generators in chess engines.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/noctuid/dotfiles/blob/master/emacs/editing.org"&gt;Why Modality and Chording?&lt;/a&gt;: Probably one of the best discussion I&amp;rsquo;ve seen on Vim modal editing vs. Emacs chording.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://computers-are-fast.github.io/"&gt;Do you know how much your computer can do in a second?&lt;/a&gt;: Nicely packaged and very instructive.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://allendowney.github.io/ElementsOfDataScience/README.html"&gt;Elements of Data Science&lt;/a&gt;: A new textbook by Allen Downey on data science, with applications in Python. What I like with Downey&amp;rsquo;s books is what he said upfront: &amp;ldquo;When I use a term, I try to define it immediately, and when I use a programming feature, I try to explain it.&amp;rdquo;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://deta.defn.io/"&gt;deta: Functional Database Mapping&lt;/a&gt;: It provides a handy way of mapping data between database tables and Racket structs. I will need to try this at some point.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://abstractexpr.com/2023/06/29/structures-in-c-from-basics-to-memory-alignment/"&gt;Structures in C: From Basics to Memory Alignment&lt;/a&gt;: For those interested in C programming.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cs.uwaterloo.ca/~plragde/flaneries/FICS/"&gt;A Functional Introduction To Computer Science&lt;/a&gt;: This is a two-part textbook on functional programming with Racket, with lot of exercises.&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;When I first started teaching using Racket in first year, I was inspired to change my research focus to functional programming languages. Consequently, when I set out to design the two-course sequence whose materials I adapted for FICS, I had a wealth of recent reading to draw on. Among the sources I used, besides the first edition of HtDP, were the early editions of &amp;ldquo;Programming Languages: Application and Interpretation&amp;rdquo; by Shriram Krishnamurthi, the second edition of &amp;ldquo;Essentials of Programming Languages&amp;rdquo; by Friedman, Wand, and Haynes, &amp;ldquo;LISP In Small Pieces&amp;rdquo; by Christian Quienniec, &amp;ldquo;The Scheme Programming Language&amp;rdquo; by Kent Dybvig, &amp;ldquo;ML For The Working Programmer&amp;rdquo; by Larry Paulson, and the papers of Chris Okasaki. There are others I’m forgetting because I’m writing this away from my office bookshelves.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://mnieper.github.io/scheme-macros/README.html"&gt;Extending a Language — Writing Powerful Macros in Scheme&lt;/a&gt;: The author uses Chez Scheme (and Emacs) to illustrate the definition and use of syntax objects and syntax-case macros. For another in-depth account of Scheme macros, see &lt;a href="http://www.phyast.pitt.edu/~micheles/scheme/"&gt;The Adventures of a Pythonista in Schemeland&lt;/a&gt;, and Alexis King&amp;rsquo;s posts on that very &lt;a href="https://lexi-lambda.github.io/tags/macros.html"&gt;specific topic&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://mathematica.stackexchange.com/questions/4454/is-there-an-open-source-implementation-of-mathematica-the-language"&gt;Is there an open source implementation of Mathematica-the-language?&lt;/a&gt;: Some useful links are to be found in this thread and associated comments.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.brendangregg.com/blog/2017-05-09/cpu-utilization-is-wrong.html"&gt;CPU Utilization is Wrong&lt;/a&gt;: In which we learn that CPU utilization is a misleading metric, most of the time.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://embeddedgurus.com/stack-overflow/2009/06/division-of-integers-by-constants/"&gt;Division of integers by constants&lt;/a&gt;: Even if the focus is on embedded systems, the two recipes discussed in this post are highly instructive (TL;DR division by a constant is equivalent to multiplication by the reciprocal of that constant).&lt;/li&gt;
&lt;li&gt;&lt;a href="https://eklitzke.org/how-tail-call-optimization-works"&gt;How Tail Call Optimization Works&lt;/a&gt;: A short illustration of recursive tail-call in C.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://owen.cafe/posts/six-times-faster-than-c/"&gt;{n} times faster than C - part one&lt;/a&gt;: On how to overoptimize a simple C loop.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blog.phronemophobic.com/mairio.html"&gt;Clojure Plays Mario&lt;/a&gt;: In which tha uthor describes an AI that could complete all of the levels in the original Super Mario Bros for the NES (except for the Bowser levels that have mazes).&lt;/li&gt;
&lt;li&gt;&lt;a href="https://browser.engineering/"&gt;Web Browser Engineering&lt;/a&gt;: An online book on designing a small bu efficient web browser in Python.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.statlearning.com/"&gt;An Introduction to Statistical Learning&lt;/a&gt;: I never realized that there was also a Python version of the ISLR textbook. I guess we should call it ISLP then.&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;Even if the ideas you’re sharing with the world aren’t original you can enrich them with your personal view. As Bill Thurson said 2 all of us have clear understanding of a few things and murky concepts of many more. There is no way to run out of ideas in need of clarification. &amp;mdash; &lt;a href="https://www.alexmolas.com/2023/07/15/nobody-cares-about-your-blog.html"&gt;Nobody cares about your blog&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Aaron Goldberg • &lt;em&gt;Poinciana&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>The unquantified self #29</title><link>https://aliquote.org/post/unquantified-self-029/</link><pubDate>Thu, 10 Aug 2023 10:07:43 +0200</pubDate><guid>https://aliquote.org/post/unquantified-self-029/</guid><description>&lt;p&gt;A whole month without writing anything. What a salutary change of scenery after all! I must say I was getting a bit fed up with the computer and I really needed some holiday away from it all. Done. Back to the blog, whatever that means these days.&lt;/p&gt;
&lt;p&gt;I have a draft which dates back from mid July, and a long list of bookmarks which are awaiting for my review. Other than that, nothing&amp;rsquo;s really new. I took some days off, played Minecraft for many long hours, helped a friend of mine renovating his flat, done a lot of tidying up and renovating in my own flat, and here we are.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/71215120353__5685D54D-29EF-45C7-9B85-C4D59254638D.JPG"&gt;
&lt;/figure&gt;
&lt;small&gt;Work in progress&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;I watched a lot of not-so-great TV series recently, but I dicovered a nice internet radio (ABC Lounge). I also have a long list of books from the &lt;em&gt;Actes Sud&lt;/em&gt; collection to read or reread, but see below. I haven&amp;rsquo;t read a lot this year, which is somewhat surprising since I&amp;rsquo;m used to read almost 100 books a year.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_3119.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_3119.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_3118.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_3118.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;As can be seen in the above picture (right), the gaming station for my son is ready as well.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Phidel • &lt;em&gt;The Stag vs the Hare&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in July</title><link>https://aliquote.org/post/micro-07-2023/</link><pubDate>Sun, 30 Jul 2023 11:56:26 +0200</pubDate><guid>https://aliquote.org/post/micro-07-2023/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-07-06&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Data-oriented design takes its cues from the data which is seen or expected. Instead of planning for all eventualities, or planning to make things adaptable, there is a preference for using the most probable input to direct the choice of algorithm. Instead of planning to be extendable, it plans to be simple and replaceable, and get the job done. Extendable can be added later, with the safety net of unit tests to ensure it remains working as it did while it was simple. Luckily, there is a way to make your data layout extendable without requiring much thought, by utilising techniques developed many years ago for working with databases. &amp;mdash; &lt;a href="https://www.dataorienteddesign.com/dodbook/"&gt;Data-Oriented Design&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-07-06&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Usually I send read-only documents to clients. They don’t know or care what program created the&amp;gt; PDF I sent them. The fact that they cannot edit my reports is a feature, not a bug: if I’m going&amp;gt; to sign off on something, I need to be sure that it doesn’t include any changes that someone else&amp;gt; made that I’m unaware of. &lt;a href="https://www.johndcook.com/blog/2023/07/05/convert-latex-to-microsoft-word/"&gt;Convert LaTeX to Microsoft Word&lt;/a&gt;I used to do the same for years when I was consulting. Main issue was tabular output, which can be beautifully rendered in $\LaTeX$, but not so in plain MS Word.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;</description></item><item><title>Regression and DFBETAS</title><link>https://aliquote.org/post/regression-dfbetas/</link><pubDate>Tue, 11 Jul 2023 20:55:58 +0100</pubDate><guid>https://aliquote.org/post/regression-dfbetas/</guid><description>&lt;p&gt;In a previous post, we discussed how influence measures can provide some insights on data quality or model fit. There are various &lt;a href="https://www.sfu.ca/sasdoc/sashtml/stat/chap55/sect38.htm"&gt;cutoff values&lt;/a&gt; that are used to interpret each of these quantities, e.g., $\text{Cook&amp;rsquo;s d} &amp;gt; 4/(n-k-1)$, $\text{DFFITS} &amp;gt; 2\sqrt{p/n}$, $\text{DFBETAS} &amp;gt; 2/\sqrt{n}$. The latter emphasizes regression coefficients themselves.&lt;/p&gt;
&lt;p&gt;Considering a linear predictor $\beta_0 + \sum_{j=1}^k\beta_jx$, the DFBETA value for the $j$th coefficient for the $i$th observation is $\hat\beta_j - \hat\beta_j^{(-i)}$, where $\hat\beta_j^{(-i)}$ is the $j$th coefficient of the regression estimated without the $i$th observation. It&amp;rsquo;s mostly the jacknife approach to validating a regression model by discarding one observation at a time. From a computational perspective, it is not necessary to compute all $n$ full model since we can rely on &lt;a href="https://stats.stackexchange.com/a/19293"&gt;linear algebra&lt;/a&gt; to relate OLS fit for all $n$ observations to that of any based on $n-1$ observations.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; Often times, absolute values of DFBETAs are considered instead of signed values, and it is also common to standardize those values since their scale depend on that of the variable of interest. Standardization is done by dividing DFBETAs by the corresponding standard deviation of the $i$th-deleted regression model, and statistical packages often refer to them as DFBETAS instead of DFBETA (note the extra S).&lt;/p&gt;
&lt;p&gt;The threshold or reference value, $2/\sqrt{n}$, can be seen as a size-adjusted influence effect accounting for the standard error estimate of the corresponding coefficient. In effect, it amounts to highlight the same theoretical number of influnetial points regardless of sample size, much like when using standardized residuals and referring their distribution to a Student $t$ or $\mathcal{N}$ distribution.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://data.library.virginia.edu/detecting-influential-points-in-regression-with-dfbetas/"&gt;Detecting Influential Points in Regression with DFBETA(S)&lt;/a&gt; provides an illustration using simulated datasets of varying size in R. There are some other great articles on the StatLab Archives from the University of Virginia. I am familiar with resistant or robust regression methods (the aforementioned blog post shows how to use DFBETAS to overcome the effect of influential points on a regression line). Here is some old R code illustrating the use of robust regression, as described in &lt;a href="http://users.stat.umn.edu/~sandy/courses/8053/handouts/robust.pdf"&gt;Fox &amp;amp; Weisberg&lt;/a&gt; on a subset of the Ascombe dataset:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;options&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;hrbrthemes.loadfont&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;TRUE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;library&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;MASS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;library&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ggplot2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;library&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;gridExtra&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;library&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;hrbrthemes&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;library&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;directlabels&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;set.seed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;101&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;theme_set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;theme_ipsum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;base_size&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;11&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;clr6&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;ipsum_pal&lt;/span&gt;&lt;span class="p"&gt;()(&lt;/span&gt;&lt;span class="m"&gt;6&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;ggplot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;anscombe&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;aes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y3&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;geom_point&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;geom_smooth&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;method&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;lm&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;se&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;FALSE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;col&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;clr6[1]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;geom_smooth&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;method&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;rlm&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;col&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;clr6[2]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;labs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;annotate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;geom&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;text&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;13.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;10.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;label&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;LM&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;2.8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;col&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;clr6[1]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;annotate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;geom&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;text&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;13.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;label&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;RLM&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;2.8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;col&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;clr6[2]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;ggsave&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;~/fig-lrm-anscombe.png&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dpi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;300&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/fig-lrm-anscombe.png"&gt;
&lt;/figure&gt;
&lt;p&gt;I just learned about &lt;a href="https://library.virginia.edu/data/articles/theil-sen-regression-programming-and-understanding-an-outlier-resistant-alternative-to-least-squares"&gt;Theil-Sen Regression&lt;/a&gt;. Instead of minimizing squared residuals, the slope is calculated by taking the median of the slopes between each pair of points in the data, which basically amounts to compute every possible $(y_j - y_i)/(x_j - x_i)$ if $x_i \neq x_j$.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; It follows that the OLS estimate of a simple regression slope can be conceptualized as a weighted average of pairwise slopes, with weights $(x_j - x_i)^2$. Go read the rest of the blog post if you are interested in robust regression.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Grateful Dead • &lt;em&gt;Viola Lee Blues&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Belsley, D. A., Kuh, E., and Welsch, R. E. (1980). &lt;em&gt;Regression diagnostics: Identifying influential data and sources of collinearity&lt;/em&gt;. John Wiley &amp;amp; Sons.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;Young, D. S. (2017). &lt;em&gt;Handbook of regression methods&lt;/em&gt;. Chapman and Hall/CRC.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Data frames for Racket</title><link>https://aliquote.org/post/racket-data-frames/</link><pubDate>Mon, 10 Jul 2023 14:02:08 +0200</pubDate><guid>https://aliquote.org/post/racket-data-frames/</guid><description>&lt;p&gt;Lately, I&amp;rsquo;ve been playing with another implementation of data frames in Racket: &lt;a href="https://github.com/massung/tabular-asa/"&gt;tabular-asa&lt;/a&gt;. The data-frame package by Alex Harsányi is the first one I used (one or two years ago) and I found it comfortable to use except it doesn&amp;rsquo;t handle categorical variables, but see my preceding &lt;a href="https://aliquote.org/post/quick-csv-reader/"&gt;review&lt;/a&gt;.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; This one doesn&amp;rsquo;t either, but it handles missing values, like the data-frame package, and grouping or aggregating functions are a bit more intuitive to use (no need to rely on an external index) and closer in spirit to the R or Python ecosystem.&lt;/p&gt;
&lt;p&gt;Here is a toy example inspired by Travis Hinkleman&amp;rsquo;s &lt;a href="https://www.travishinkelman.com/data-transformation-scheme/"&gt;recent post&lt;/a&gt; about his own implementation of data frame for Chez Scheme. Note that the NYC flights dataset is a 29 Mo file, so it stands for a relatively honest benchmark for Racket&amp;rsquo;s data processing capabilities. In what follows I am mostly interested in the time it takes to load such a dataset.&lt;/p&gt;
&lt;p&gt;First, let&amp;rsquo;s try the default CSV reader. Hereafter I&amp;rsquo;ll be using a poor-man solution for timing the whole process of loading the dataset in Racket REPL (I&amp;rsquo;m using Racket 8.6 [cs]). As a result, the data will not be available outside the scope of this block. You will need to define the variable properly to access it later.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;require&lt;/span&gt; &lt;span class="n"&gt;csv-reading&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;require&lt;/span&gt; &lt;span class="n"&gt;net/url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="k"&gt;file&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;get-pure-port&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;string-&amp;gt;url&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;https://www.travishinkelman.com/data/nycflights.tsv&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;time&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;csv-&amp;gt;list&lt;/span&gt; &lt;span class="k"&gt;file&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;void&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;; =&amp;gt; cpu time: 4366 real time: 9121 gc time: 410&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Not very convenient since we get a list of lists that would require some post-processing, but it&amp;rsquo;s fast enough. Here is a quick benchmark of the data-frame package for the sake of comparison. Note that I converted the TSV to a proper CSV format since this package doesn&amp;rsquo;t handle &lt;a href="https://github.com/alex-hhh/data-frame/issues/11"&gt;other separator&lt;/a&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;require&lt;/span&gt; &lt;span class="n"&gt;data-frame&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="k"&gt;file&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/home/chl/tmp/nycflights.csv&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;time&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df-read/csv&lt;/span&gt; &lt;span class="k"&gt;file&lt;/span&gt; &lt;span class="kd"&gt;#:headers?&lt;/span&gt; &lt;span class="no"&gt;#t&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;void&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;; =&amp;gt; cpu time: 3708 real time: 3708 gc time: 759&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Since it doesn&amp;rsquo;t handle categorical variables or dates (meaning they are stored as raw strings) some procedures like &lt;code&gt;df-describe&lt;/code&gt; are pretty useless for variables like &lt;code&gt;carrier&lt;/code&gt;, &lt;code&gt;dest&lt;/code&gt;, or &lt;code&gt;time_hour&lt;/code&gt;, and there&amp;rsquo;s not much you can do unless you recode then using numeric codes, which is what I ended up doing once. Anyway, there&amp;rsquo;s a handy &lt;a href="https://alex-hhh.github.io/2018/08/racket-data-frame.html"&gt;tutorial&lt;/a&gt; on the author&amp;rsquo;s website if you want to learn about this package.&lt;/p&gt;
&lt;p&gt;Now, here is what we get with tabular-asa:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;require&lt;/span&gt; &lt;span class="n"&gt;tabular-asa&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;time&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;call-with-input-file&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;nycflights.csv&amp;#34;&lt;/span&gt; &lt;span class="n"&gt;table-read/csv&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;void&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;; =&amp;gt; cpu time: 7135 real time: 7142 gc time: 1271&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It looks like it takes a bit longer to process the whole file, but that&amp;rsquo;s okay. We&amp;rsquo;ll get plenty of useful procedures to inspect and munge this dataset.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;subset&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;table-cut&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;distance&lt;/span&gt; &lt;span class="ss"&gt;dep_delay&lt;/span&gt; &lt;span class="ss"&gt;dest&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;display-table&lt;/span&gt; &lt;span class="n"&gt;subset&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;; =&amp;gt; distance dep_delay dest&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;; 0 1400 2 IAH&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;; 1 1416 4 IAH&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;; 2 1089 2 MIA&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;; 3 1576 -1 BQN&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;; 4 762 -6 ATL&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;; .. ... ... ...&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;; 336771 213 #f DCA&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;; 336772 198 #f SYR&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;; 336773 764 #f BNA&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;; 336774 419 #f CLE&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;; 336775 431 #f RDU&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;; [336776 rows x 3 cols]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;table-shape&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;table-distinct&lt;/span&gt; &lt;span class="n"&gt;subset&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;dest&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;; =&amp;gt; 105&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;grouped-data&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;group-count&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;table-groupby&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;table-cut&lt;/span&gt; &lt;span class="n"&gt;subset&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;dest&lt;/span&gt; &lt;span class="ss"&gt;dep_delay&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;dest&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;grouped-data&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;; =&amp;gt; dest dep_delay&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;; 0 ABQ 254&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;; 1 ACK 265&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;; 2 ALB 419&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;; 3 ANC 8&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;; 4 ATL 16898&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;; .. ... ...&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;; 100 TPA 7407&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;; 101 TUL 299&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;; 102 TVC 96&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;; 103 TYS 579&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;; 104 XNA 1011&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;; [105 rows x 2 cols]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It appears this package provides a load of useful features, which may be familiar to R&amp;rsquo;s data.table users. We need to be careful since some procedures return a &lt;a href="https://docs.racket-lang.org/reference/sequences.html"&gt;sequence&lt;/a&gt; (which you may need to convert to a stream to consume its first or rest values eventually) or a table, depending on the context. With the above grouped data table, we can easily build a kernel density estimate of departure delays with a few additional commands:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;require&lt;/span&gt; &lt;span class="n"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;xs&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;for/list&lt;/span&gt; &lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;table-column&lt;/span&gt; &lt;span class="n"&gt;grouped-data&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="ss"&gt;dep_delay&lt;/span&gt;&lt;span class="p"&gt;)])&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;parameterize&lt;/span&gt; &lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;plot-font-face&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Roboto Condensed&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;plot-font-size&lt;/span&gt; &lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;plot&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;density&lt;/span&gt; &lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;#:x-label&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Departure delay&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;#:y-label&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Density&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;#:out-file&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/tmp/plot.png&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/fig-density-depdelay.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Of course, most of the above grouping and aggregating operations could be performed with the data-frame package. What&amp;rsquo;s interesting in this case is that author makes heavy use of lazy data structures and relies on a column-major internal representation of rectangular datasets.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Glenn Gould • &lt;em&gt;Goldberg Variations&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;I also came across &lt;a href="https://github.com/samdphillips/uke"&gt;uke&lt;/a&gt; in addition to the packages mentioned in my &lt;a href="https://aliquote.org/post/quick-csv-reader/"&gt;previous post&lt;/a&gt;, and the &lt;a href="https://docs.racket-lang.org/dataframe/index.html"&gt;dataframe&lt;/a&gt; package. I will review them when time allows.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in June</title><link>https://aliquote.org/post/micro-06-2023/</link><pubDate>Sat, 01 Jul 2023 09:41:19 +0200</pubDate><guid>https://aliquote.org/post/micro-06-2023/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-06-06&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;But the language landscape has changed a lot since then, and realistically no programmer today cares about what made a language stand out 50 years ago. Clearly, the good ideas have been copied into other languages. Paul Graham even suggests this convergence towards Lisp is inevitable. I wouldn’t go so far. But this begs the question: Is there anything left? Are there any features that couldn’t be copied so easily into the various descendants of Algol? &amp;mdash; &lt;a href="https://elliottslaughter.com/2022/12/lisp"&gt;What Are the Enduring Innovations of Lisp?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-06-06&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The idea is that if I found it confusing, lots of other people probably did too, even though the information might theoretically be out there on the internet somewhere. Just because there is information on the internet, it doesn’t get magically teleported into people’s brains! &amp;mdash; &lt;a href="https://jvns.ca/blog/2023/06/05/some-blogging-myths/"&gt;Some blogging myths&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-06-06&lt;/a&gt;: &lt;a href="https://www.n16f.net/blog/reduce-vs-fold-in-common-lisp/"&gt;Reduce vs fold in Common Lisp&lt;/a&gt;: Interestingly, R whihc is often referred to as a Scheme-like language has &lt;code&gt;Reduce&lt;/code&gt; as one of its higher-order function, but no fold[lr] functions in base. &lt;a href="https://cartesianfaith.files.wordpress.com/2014/05/rowe-modeling-data-with-functional-programming.pdf"&gt;Modeling Data With Functional Programming in R&lt;/a&gt; (whole book available in 2024 maybe?) looks like an interesting take on this topic. &lt;code&gt;#rstats&lt;/code&gt; &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-06-12&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Your true audience (those who care) is about 1% of your subscribers. 1000 followers on Twitter?&amp;gt; Your audience is 10 people. 10000 email subscribers? 100 people. &amp;mdash; &lt;a href="https://antonz.org/blogging-myths/"&gt;Blogging Myths You Should Care About&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-06-12&lt;/a&gt;: ♪ Johanna Warren · I&amp;rsquo;d Be Orange&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-06-15&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In my view this isn&amp;rsquo;t about adhering to the XDG standard[3], it&amp;rsquo;s about getting things out of &lt;code&gt;$HOME&lt;/code&gt;. Unix dotfiles were always a (somewhat accidental) hack[4], and over the years we&amp;rsquo;ve accumulated entirely too many of them in our &lt;code&gt;$HOME&lt;/code&gt;s. The XDG option isn&amp;rsquo;t particularly perfect, but it&amp;rsquo;s at least a standard approach and it achieves the goal of getting dotfiles out of &lt;code&gt;$HOME&lt;/code&gt;. As a side effect the XDG approach makes things more legible if you look in &lt;code&gt;~/.config&lt;/code&gt;. &amp;mdash; &lt;a href="https://utcc.utoronto.ca/~cks/space/blog/unix/DotfilesWhereToday"&gt;Where your program&amp;rsquo;s configuration files (&amp;lsquo;dotfiles&amp;rsquo;) should go today&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-06-19&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Shell programming is remarkably easy in many cases; what’s sad is that this common case (file processing) is far complicated than it needs to be. This is not a problem limited to shell; while shell is especially tricky, it is difficult to correctly process POSIX pathnames in all languages. &amp;mdash; &lt;a href="https://dwheeler.com/essays/filenames-in-shell.html"&gt;Filenames and Pathnames in Shell: How to do it Correctly&lt;/a&gt; (via &lt;a href="https://www.arp242.net/shell-scripting-trap.html"&gt;The shell scripting trap&lt;/a&gt;)&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-06-19&lt;/a&gt;: &lt;a href="https://antonz.org/sqlean-py/"&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; import sqlean as sqlite3&lt;/code&gt;&lt;/a&gt;. &lt;code&gt;#database&lt;/code&gt; &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-06-20&lt;/a&gt;: Interesting Lisp-related stuff on this &lt;a href="https://news.ycombinator.com/item?id=36367241"&gt;HN thread&lt;/a&gt; about Reddit. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-06-20&lt;/a&gt;: Just found out that we can get cover art with cmus thanks to &lt;a href="https://github.com/MicahBird/cmus-mpris-album-art"&gt;this fork&lt;/a&gt;!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-06-20&lt;/a&gt;: Never used them, but I noticed there are now two alternative workflow to barebone Git: &lt;a href="https://sapling-scm.com/"&gt;sapling&lt;/a&gt; and &lt;a href="https://gitless.com/"&gt;gitless&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-06-20&lt;/a&gt;: &lt;a href="https://towardsdatascience.com/functional-programing-in-data-science-projects-c909c11138bb"&gt;Functional Programming in Data Science Projects&lt;/a&gt;: Interesting thoughts about FP for statistical computing. Another take was once available on Brian Lee Yung Rowe&amp;rsquo;s weblog, soon to be published as &lt;em&gt;Modeling Data With Functional Programming In R&lt;/em&gt;. Thomas Mailund also wrote some words about that approach (see &lt;em&gt;Functional Data Structures in R&lt;/em&gt;). And of course, Mathematica with its native support for multiple programming paradigms would be a good candidate too. &lt;code&gt;#statistics&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-06-22&lt;/a&gt;: &lt;a href="https://privsec.dev/posts/linux/desktop-linux-hardening/"&gt;Desktop Linux Hardening&lt;/a&gt;. Lot of useful advices in this article. E.g.,&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;snapd (Snap) assigns a unique ID to your installation and uses it for telemetry. While this is generally not a problem, if your threat model calls for anonymity, you should avoid using Snap packages and uninstall snapd.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-06-22&lt;/a&gt;: &lt;a href="https://www.barbarianmeetscoding.com/boost-your-coding-fu-with-vscode-and-vim/moving-blazingly-fast-with-the-core-vim-motions/"&gt;Moving Blazingly Fast With The Core Vim Motions&lt;/a&gt;, but see the whole tutorial. The author makes use of sound illustrations and takes us on a tour of Vim&amp;rsquo;s core concepts, with casual or VS Code users in mind. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>Micro posting in May</title><link>https://aliquote.org/post/micro-05-2023/</link><pubDate>Tue, 30 May 2023 09:17:33 +0200</pubDate><guid>https://aliquote.org/post/micro-05-2023/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-05-03&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Functors and monads are powerful design patterns used in Haskell. They give us two cool tricks for analyzing data. First, we can “preprocess” data after we’ve already trained a model. The model will be automatically updated to reflect the changes. Second, this whole process happens asymptotically faster than the standard method of preprocessing. In some cases, you can do it in constant time no matter how many data points you have! &amp;mdash; &lt;a href="https://izbicki.me/blog/functors-and-monads-for-analyzing-data.html"&gt;Functors and monads for analyzing data&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-05-03&lt;/a&gt;: Interesting blog post if you want to learn more about Chicken Scheme&amp;rsquo;s internals: &lt;a href="https://www.more-magic.net/posts/internals-data-representation.html"&gt;CHICKEN internals: data representation &lt;/a&gt;. &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-05-07&lt;/a&gt;: Back to Kitty, as a replacement for Alacritty which I enjoyed using the past few months. I still use Tmux, though. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-05-07&lt;/a&gt;: I will probably watch &lt;em&gt;Millenium&lt;/em&gt; again, and I thought I need to watch Noomi Rapace&amp;rsquo;s recent movies. Seven sisters (which is not listed on his filmography on Wikipedia) was so great after all. I watched &lt;a href="https://en.wikipedia.org/wiki/Close_(2019_film)"&gt;Close&lt;/a&gt; two days ago; quite bad, actually. &lt;a href="https://en.wikipedia.org/wiki/Bright_(film)"&gt;Bright&lt;/a&gt; was better, though.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-05-09&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/2023-05-09-20-59-05.png" alt="img"&gt;&lt;small&gt;Spinach, goat cheese and chorizo.&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-05-09&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;But there’ll be winners and losers – everyone agrees. If it’s good, then the productivity gains will be unevenly distributed and those with only basic abilities - in programming, writing, music will be replaced by the machines, or by someone using a machine to produce a lot more of the product. If it’s bad, the people using the AI will benefit but those at the other end of the algorithm, those subjected to AI-powered policing, healthcare, or hiring are subject to the inaccuracy, bias, or malice built into the system. &amp;mdash; &lt;a href="https://macwright.com/2023/04/15/ai.html"&gt;The one about AI&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-05-09&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Config (282.0 total hours, 5.0% of all time): Time spent on actual Emacs configuration. &amp;mdash; &lt;a href="https://sqrtminusone.xyz/posts/2023-04-13-emacs/"&gt;916 days of Emacs&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-05-09&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;For example, you remove an attribute from a class definition. Your existing objects get (lazily) updated to reflect that change, following a rule you even have control upon. You don&amp;rsquo;t have to restart a process and then re-create your objects. The same is true for Lisp web development. You can create a new route, compile it and try it live without restarting the server. You didn&amp;rsquo;t have to restart a process. It&amp;rsquo;s all very interactive with instant feedback! &amp;mdash; &lt;a href="https://nyxt.atlas.engineer/article/why-lisp.org"&gt;Why Lisp?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-05-09&lt;/a&gt;: Today I had to rollback nvim to a previous state: one or some of the last pushes on the nightly branch broke my LSP setup, which would no longer autostart. No luck, just when &lt;a href="https://aliquote.org/post/nvim-fzf-lua/"&gt;I said&lt;/a&gt; I never encountered a single breaking change in Neovim core in months. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-05-15&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_2946.JPG" alt="img"&gt;&lt;small&gt;First peonies of the year.&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-05-17&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Autocompletion is not an aid to make it easier to write code. It does not do that. What it does actually do is make it easier to architect code. Writing code is easy; all it involves is writing text. Any trained monkey can write code. Deciding what to write is decidedly harder. That’s the true task that programmers do. Following from that assertion, writing code and deciding what code to write (designing or architecting) are distinctly separate tasks. Therefore you should not decide what to write as you are writing code. &amp;mdash; &lt;a href="https://blog.ircmaxell.com/2011/07/why-i-dont-use-autocomplete.html"&gt;Why I Don’t Use Autocomplete&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-05-17&lt;/a&gt;: TIL about &lt;a href="https://click.palletsprojects.com/en/8.1.x/"&gt;click&lt;/a&gt;, a package for creating beautiful command line interfaces in a composable way with as little code as necessary. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-05-23&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;At the time, however, Linux didn’t seem to have a word processor (I’m sure it actually did). What did people use to write documents? When I asked someone at the local Linux Users’ Group about this, they told me about LaTeX. And that began a very long love affair with typesetting in general and TeX in particular. I have used some variation of TeX/LaTeX to write pretty much every paper, every article, every talk, every letter, every slide, and every lecture I’ve written for the last twenty-five years. &amp;mdash; &lt;a href="https://stephenramsay.net/posts/groff-mom.html"&gt;Beautiful Documents with Groff&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-05-23&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;It basically boils down to two things - using type hints as much as possible, and upholding the good ol’ making illegal states unrepresentable principle. &amp;mdash; &lt;a href="https://kobzol.github.io/rust/python/2023/05/20/writing-python-like-its-rust.html"&gt;Writing Python like it&amp;rsquo;s Rust&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-05-24&lt;/a&gt;: Nice stuff. &lt;a href="https://erkin.party/blog/200715/evolution/"&gt;The evolution of a Scheme programmer&lt;/a&gt;. You may also like &lt;a href="https://willamette.edu/~fruehr/haskell/evolution.html"&gt;The Evolution of a Haskell Programmer&lt;/a&gt;. &lt;code&gt;#scheme&lt;/code&gt; &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-05-25&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The people who insist that the manpages are all you need will sometimes dismiss guide-type documentation as tedious to work through; they’d rather learn things from a reference, they say, because that way they can jump around in it and look for the specific bits that are relevant to them right now. And that’s fine—if they’re right that the stuff they’re skipping over isn’t relevant to them. But it also has negative practical consequences. &amp;mdash; &lt;a href="https://www.owlfolio.org/research/i-didnt-learn-unix-by-reading-all-the-manpages/?utm_source=pocket_saves"&gt;I Didn’t Learn Unix By Reading All The Manpages&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-05-27&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/2023-05-27-13-54-58.png" alt="img"&gt;&lt;small&gt;Pretty little music player. See this &lt;a href="https://aliquote.org/post/g4music"&gt;review&lt;/a&gt; for more details.&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-05-27&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Or maybe I’m just an old guy looking back and romanticizing the early days. I’m back to coding in C again, writing little inconsequential games to amuse myself. Or maybe there was something a little magical then. Simpler times? &amp;mdash; &lt;a href="https://www.engineersneedart.com/blog/samestop/samestop.html"&gt;Same Stop&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-05-27&lt;/a&gt;: ♪ P!nk · Bad Influence&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-05-30&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_2958.JPG" alt="img"&gt;&lt;small&gt;Shoot at night&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-05-30&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Everyone knows that debugging is twice as hard as writing a program in the first place. So if you’re as clever as you can be when you write it, how will you ever debug it? (Brian Kernighan) &amp;mdash; &lt;a href="https://www.joshwcomeau.com/career/clever-code-considered-harmful/"&gt;Clever Code Considered Harmful&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-05-30&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;it also confirmed another sad aspect of being on the spectrum: you can have a very large tolerance for people having bad expectations of you because you learn at an early age that you must accommodate others in order to survive. &amp;mdash; &lt;a href="https://www.jntrnr.com/autism-is-everywhere-and-in-everything/"&gt;Autism is everywhere and in everything&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;</description></item><item><title>G4Music</title><link>https://aliquote.org/post/g4music/</link><pubDate>Sat, 27 May 2023 12:17:37 +0200</pubDate><guid>https://aliquote.org/post/g4music/</guid><description>&lt;p&gt;While browsing &lt;a href="https://deskto.ps/u/oceane/d/dhlexn"&gt;deskto.ps&lt;/a&gt; I noticed a good looking music player, &lt;a href="https://apps.gnome.org/fr/app/io.bassi.Amberol/"&gt;Amberol&lt;/a&gt;. Unfortunately, it is only available as a Flatpak and it failed to compile on my machine because of a conflicting version of lib-gtk4-dev. Then, I came across &lt;a href="https://gitlab.gnome.org/neithern/g4music"&gt;G4Music&lt;/a&gt;, which is inspired by Amberol and comes with a bunch of additional features. Here it is in action:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2023-05-27-12-21-26.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Once dependencies were resolved (valac, meson, libgtk-4-dev, libadwaita-1-dev, libgstreamer1.0-dev, libgstreamer-plugins-base1.0-dev), the compilation and building stages took less than 30 seconds. This is the first time I use &lt;a href="https://mesonbuild.com/"&gt;Meson&lt;/a&gt; as a build system and it looks really fast.&lt;/p&gt;
&lt;p&gt;G4Music is presented as a low memory application, and a fast indexer of local music. Indeed G4Music found my 14k files when I first launched the application. I didn&amp;rsquo;t test the drag&amp;rsquo;n drop support from Gnome file manager. The gapless and replay gain features work great. It makes use of embedded album cover art, without caching image thumbnails which is really a nice idea. We also get notifications in Gnome menu bar for free. Tracks can be sorted by album, artist or tracks, or souffle altogether. As I am writing this post, there&amp;rsquo;s currently no play counts or option to manage custom playlists.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2023-05-27-12-38-00.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2023-05-27-12-38-00.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2023-05-27-12-38-14.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2023-05-27-12-38-14.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2023-05-27-12-38-23.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2023-05-27-12-38-23.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The UI is really slick and useable, with minimal settings that are actionable in a few motions. If you are looking for a simple music player, give it a try. Overall, I like it a lot.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2023-12-16]&lt;/small&gt;&lt;br&gt;
See &lt;a href="https://andreyor.st/posts/2023-11-19-linux-music-players/"&gt;this post&lt;/a&gt; by Andrey Listopadov for an extensive review of available players for Linux.
&lt;/div&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ New Order • &lt;em&gt;5 8 6&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>April in review</title><link>https://aliquote.org/post/micro-review-024/</link><pubDate>Tue, 09 May 2023 21:04:48 +0200</pubDate><guid>https://aliquote.org/post/micro-review-024/</guid><description>&lt;p&gt;Interesting things I found while browsing the internet.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://eli.thegreenplace.net/2023/twenty-years-of-blogging/"&gt;Eli Bendersky&lt;/a&gt;&amp;rsquo;s blog turned 20 recently. Last year it was the turn of &lt;a href="https://simonwillison.net/2022/Jun/12/twenty-years/"&gt;Simon Willison&lt;/a&gt;&amp;rsquo;s one. So much nice stuff and things to learn on those weblogs.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://atuin.sh/"&gt;Atuin&lt;/a&gt; might be a handy replacement for fzf when it comes to manage my shell history. From what I&amp;rsquo;ve read, there are some interesting features like fuzzy search using &lt;a href="https://github.com/lotabout/skim"&gt;Skim&lt;/a&gt;, pattern-based deletion, activity log, custom filters and statistics, and many more.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Reading &lt;a href="https://gist.github.com/kconner/cff08fe3e0bb857ea33b47d965b3e19f"&gt;macOS Internals&lt;/a&gt; reminds me of my old days with macOS (I still prefer the old &lt;em&gt;Mac OS&lt;/em&gt; naming scheme), especially the good parts since I stopped upgrading all my machines after Mojave. If you still work on macOS, go read some of those items, which were published on Ars technica, you will surely learn useful stuff and understand macOS became the OS it is nowadays.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I came across one of Rachel Kroll&amp;rsquo;s post where she shared her &lt;a href="https://rachelbythebay.com/w/2018/12/21/env/"&gt;minimalistic setup&lt;/a&gt;, including interesting pieces of config for nano, her daily driver editor (but see her &lt;a href="https://rachelbythebay.com/w/2011/09/24/editor/"&gt;related post&lt;/a&gt;). I find it fascinating that the same config has been used for so many years.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I&amp;rsquo;ve used &lt;a href="https://github.com/pola-rs/polars"&gt;polars&lt;/a&gt; in Python, yet I did not run any serious comparison or benchmark against pandas or &lt;a href="https://aliquote.org/post/python-datatable/"&gt;datatable&lt;/a&gt;. It would be nice to have something like that for Racket, as well as Apache &lt;a href="https://github.com/apache/arrow"&gt;Arrow&lt;/a&gt; (I thought I saw a related package on GitHub, but I cant&amp;rsquo; get my hands on it anymore).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://cstack.github.io/db_tutorial/"&gt;Let&amp;rsquo;s Build a Simple Database&lt;/a&gt;. Not the first time I came across this kind of blog posts, but I wanted to mention it here, for the record.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;I&amp;rsquo;m not exaggerating when I say assertions are the greatest thing since sliced arrays, and have cut my debugging time by half.&lt;br&gt;
Rule of thumb: Every time you think something is true about your data, and it&amp;rsquo;s not ensured by the type system, add an assertion that checks it.&lt;br&gt;
Don&amp;rsquo;t just occasionally use them, drench your code in them. When your code so much as sneezes, they should shake off like sand after the beach. This is the way. &amp;mdash; &lt;a href="https://verdagon.dev/blog/first-100k-lines"&gt;How To Survive Your Project&amp;rsquo;s First 100,000 Lines&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;John D. Cook once wrote about posits, and here is &lt;a href="https://nhaehnle.blogspot.com/2017/09/posits.html?m=1"&gt;another article&lt;/a&gt; on this topic. Besides the cost-accuracy trade-off, the TL;DR seems to be: &amp;ldquo;Posits have an elegant design based on thinking about numbers projectively, but the lack of NaNs, the two&amp;rsquo;s complement representation, and not having signed zeros and infinities may be alien to some floating point practicioners.&amp;rdquo;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Yet another X11-based terminal emulator which I never tried, but the benchmarks look impressive: &lt;a href="https://tomscii.sig7.se/2021/01/Typing-latency-of-Zutty"&gt;Measured: Typing latency of Zutty (compared to others)&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I watched strager&amp;rsquo;s YT video on &lt;a href="https://www.youtube.com/watch?v=DMQ_HcNSOAI"&gt;hashing&lt;/a&gt; and I highly recommend it, much like any of his live streams on Twitch or blog posts. Incidentally, I found this interesting post (after landing on &lt;a href="https://probablydance.com/2023/04/27/beautiful-branchless-binary-search/"&gt;Beautiful Branchless Binary Search&lt;/a&gt;) about another way of defining a hash function: &lt;a href="https://probablydance.com/2018/06/16/fibonacci-hashing-the-optimization-that-the-world-forgot-or-a-better-alternative-to-integer-modulo/"&gt;Fibonacci Hashing: The Optimization that the World Forgot (or: a Better Alternative to Integer Modulo)&lt;/a&gt;. See also &lt;a href="http://0x80.pl/notesen/2023-04-30-lookup-in-strings.html"&gt;Modern perfect hashing for strings&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I keep getting some of the emails I send from this domain name to Gmail users rejected by Google. I find it a pity, but go read &lt;a href="https://tutanota.com/blog/posts/gmail-independent-email"&gt;Is Gmail killing independent email?&lt;/a&gt; if you want to learn more. I may be wrong, since I&amp;rsquo;m not using a self-hosted email provider, but sadly I left Gmail to not live at the expense of a single supplier and I&amp;rsquo;m left with undelivered messages on the other end.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://nathanrooy.github.io/posts/2023-04-12/visual-book-recommender/"&gt;A visual book recommender&lt;/a&gt;. Lovely.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Michael Foster • &lt;em&gt;Resin Rain&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in April</title><link>https://aliquote.org/post/micro-04-2023/</link><pubDate>Thu, 27 Apr 2023 11:18:06 +0200</pubDate><guid>https://aliquote.org/post/micro-04-2023/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-04-03&lt;/a&gt;: Trying out &lt;a href="https://jsoftware.com/"&gt;J&lt;/a&gt;!&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; comb=: [:;(,.&amp;amp;.&amp;gt;&amp;lt;@:&amp;gt;:@;\.)^:(i.@&amp;gt;:@-~`[`(1:&amp;lt;@i.@{.~&amp;lt;:@-,2:))
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 2 comb 3
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;0 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;0 2
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;1 2
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Reading answer &lt;a href="https://stackoverflow.com/a/73944783"&gt;like this&lt;/a&gt; makes me think I should have spent more times with J when I first discovered it years ago.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-04-03&lt;/a&gt;: ♪ Avenged Sevenfold · So Far Away&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-04-04&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The immediate future is easy to predict, because the same things that has been happening for years will continue to happen: Some of the exciting recent advances will be cancelled out by new compiler regressions due to fancy new compiler features. We users will create still deeper code stacks that racks up latency, even more so with Julia 1.9 now that latency has improved and we can &amp;ldquo;afford&amp;rdquo; to do so. &amp;mdash; &lt;a href="https://viralinstruction.com/posts/latency/index.html#impact_of_efforts_so_far"&gt;Julia&amp;rsquo;s latency: Past, present and future&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-04-06&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If you see a count: int, what kind of guarantee do you have that the count name is actually bound to an int object at runtime? &amp;mdash; &lt;a href="https://lukeplant.me.uk/blog/posts/the-different-uses-of-python-type-hints/"&gt;The different uses of Python type hints&lt;/a&gt;No guarantee at all since Python&amp;rsquo;s &lt;a href="https://docs.python.org/3/library/typing.html"&gt;type hints&lt;/a&gt; do not enforce type safety: &amp;ldquo;The Python runtime does not enforce function and variable type annotations.&amp;rdquo; However, the author makes a good point in exposing the different use cases of type hinting.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-04-06&lt;/a&gt;: TIL about &lt;a href="https://pypi.org/project/ruff/"&gt;ruff&lt;/a&gt;, for linting Python code. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-04-06&lt;/a&gt;: &lt;a href="http://fmnt.info/blog/20190218_srfi.html"&gt;Fast reference to common SRFI&lt;/a&gt;. Handy bookmark. &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-04-10&lt;/a&gt;: Farewell @kinkybambou. Even after I left Twitter, I have been following you irregularly to hear from you. I have no words. All of my thoughts to you, Minette, Loulou and Nono.&lt;br&gt;&lt;img src="https://aliquote.org/img/xanax.png" alt="xanax"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-04-11&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Writing lets me do that while also helping me avoid going around in circles. When thoughts are in my head, it&amp;rsquo;s easy for them to get jumbled up. I miss things, and I keep coming back to the same thoughts, leading to the unproductive ruminating. But writing my thoughts down stops that process. I am forced to organize my thoughts in a coherent manner and to acknowledge when they don&amp;rsquo;t make sense. Thoughts in my head are like a mixture of dirty water, while writing is like a filter. It removes the nonsense from my thinking. &amp;mdash; &lt;a href="https://www.dannyguo.com/blog/why-i-blog"&gt;Why I Blog&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-04-11&lt;/a&gt;: TIL about &lt;a href="https://davidisaksson.dev/posts/closing-stale-ssh-connections/"&gt;closing a stale SSH connection&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-04-11&lt;/a&gt;: &lt;a href="https://github.com/marcoheisig/common-lisp-tweaks"&gt;Common Lisp Tweaks&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-04-13&lt;/a&gt;: Looks nice: &amp;ldquo;I like Janet so much that I wrote an entire book about it, and put it on The Internet for free, in the hopes of attracting more Janetors to the language.&amp;rdquo; &amp;mdash; &lt;a href="https://ianthehenry.com/posts/why-janet/"&gt;Why Janet?&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-04-13&lt;/a&gt;: Time to go back watching &lt;a href="https://en.wikipedia.org/wiki/God%27s_Crooked_Lines"&gt;God&amp;rsquo;s Crooked Lines&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-04-13&lt;/a&gt;: &lt;a href="https://maplant.com/gc.html"&gt;Writing a Simple Garbage Collector in C&lt;/a&gt;. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-04-15&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_2903.JPG" alt="img"&gt;&lt;small&gt;Back from the old town.&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-04-19&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_2907.JPG" alt="img"&gt;&lt;small&gt;Today&amp;rsquo;s lunch.&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-04-19&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In a perfect world, I imagine a little robot reading everything alongside me. He records the references and key ideas of each piece. After I write a post, he’d comb through my post sentence by sentence, linking every important phrase to its source. &amp;mdash; &lt;a href="https://animaomnium.github.io/keep-stuff-linkable/"&gt;Keep Stuff Linkable&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-04-19&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;You want to work with a co-worker on a piece of software? If you&amp;rsquo;re in the same room, sitting at the same table, looking at screens side-by-side, any communication between those two computers is actually happening [by sending signals] across the ocean to some data center, to some other server and then coming back to you. One: that&amp;rsquo;s crazy. But two, it&amp;rsquo;s also very slow and expensive and it doesn&amp;rsquo;t have to be that way. &amp;mdash; &lt;a href="https://blog.jim-nielsen.com/2023/offline-is-online-with-extreme-latency/"&gt;Offline Is Just Online With Extreme Latency&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-04-19&lt;/a&gt;: ♪ Adam Wakeman · Sunrise Over L.A.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-04-21&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Most of the software I write is not for sure going to become a big system. &amp;mdash; &lt;a href="https://two-wrongs.com/why-perl"&gt;Why Perl?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-04-21&lt;/a&gt;: TIL about another DB backend: &lt;a href="https://artem.krylysov.com/blog/2023/04/19/how-rocksdb-works/"&gt;How RocksDB works&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-04-21&lt;/a&gt;: &lt;a href="https://xenodium.com/a-chatgpt-emacs-shell/"&gt;A ChatGPT Emacs shell&lt;/a&gt;. Of course. What if we can&amp;rsquo;t put this right under an Emacs key chord? ;-) Nice work by the way! See also &lt;a href="https://isthisit.nz/posts/2023/building-a-chat-gpt-enhanced-python-repl/"&gt;Building A ChatGPT-enhanced Python REPL&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-04-21&lt;/a&gt;: ♪ Cabaret Voltaire · Be Free&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-04-22&lt;/a&gt;: At some point, I should make a chart to inspect how the tags on the main blog evolved over time. I expect that R progressively faded in after 2016, and that the rate of functional programming language-related posts increase in recent years, while readings and other technical reviews actually remain quite the same as in previous years. &lt;code&gt;#this&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-04-22&lt;/a&gt;: TIL about &lt;a href="https://github.com/vifm/vifm"&gt;vifm&lt;/a&gt;. It looks like a much more improved version of &lt;a href="https://github.com/gokcehan/lf"&gt;lf&lt;/a&gt;, and I should probably give it a try some day.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-04-22&lt;/a&gt;: The &lt;a href="https://serokell.io/blog"&gt;Serokell&lt;/a&gt; and &lt;a href="https://www.tweag.io/blog/"&gt;Tweag&lt;/a&gt; blog are really amazing if you are interested in Haskell (or Rust, or Python). Even older posts are still relevant today: &lt;a href="https://www.tweag.io/blog/2017-08-31-hmatrix/"&gt;Enter the matrix, Haskell style&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-04-22&lt;/a&gt;: &lt;a href="https://en.wikipedia.org/wiki/Blade_Runner_2049"&gt;Blade Runner 2049&lt;/a&gt;: +1. Although, (1) it is fair too long (163&amp;rsquo;), and (2) the end (I mean, the last hour really) leaves much to be desired. Now, I started watching &lt;a href="https://en.wikipedia.org/wiki/The_Last_Kingdom_(TV_series)"&gt;The Last Kingdom&lt;/a&gt;, after &lt;a href="https://en.wikipedia.org/wiki/Vikings_(TV_series)"&gt;Vikings&lt;/a&gt; and &lt;a href="https://en.wikipedia.org/wiki/Vikings:_Valhalla"&gt;Vikings Valhala&lt;/a&gt;. I guess I will still prefer Vikings over the two other ones. &lt;code&gt;#self&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-04-25&lt;/a&gt;: ♪ Lady Blackbird · It&amp;rsquo;ll Never Happen Again&lt;br&gt;&lt;/p&gt;</description></item><item><title>Book review: Mathematica</title><link>https://aliquote.org/post/mathematica-book-review/</link><pubDate>Mon, 24 Apr 2023 19:53:37 +0100</pubDate><guid>https://aliquote.org/post/mathematica-book-review/</guid><description>&lt;p&gt;Here are my very first impressions on some of the books on Mathematica that I read recently.&lt;/p&gt;
&lt;h3 id="mathematica-data-analysis-suchok-2015"&gt;Mathematica Data Analysis (Suchok, 2015)&lt;/h3&gt;
&lt;p&gt;I did not really like this book&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; but I did learn some useful trick for munging data using Mathematica. Note that when I say I did not like the book, it mostly has to do with like the structure of the book itself, and the shortcuts that the author took here and there. It is like the author assumes that the reader already know Mathematica higher-order functions or that &lt;code&gt;/@&lt;/code&gt; is a shorthand for &lt;code&gt;Map&lt;/code&gt;, and there&amp;rsquo;s no logic about how data are processed. It looks like a series of recipes, and we don&amp;rsquo;t learn how to think &amp;ldquo;in Mathematica&amp;rdquo; to manage data. Furthermore, I found it lacks some structure: just after talking about image analysis (face recognition, or barcode analysis), we are (not so) deep inside time series analysis, and then this is all about classical inference and two-sample tests. I was a little bit worried when I read that for a single simulated series of values, the result table mentioned paired T or Z tests,&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; as shown below (left), and I just stopped reading at this point.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2023-04-24-22-03-20.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2023-04-24-22-03-20.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2023-04-24-21-33-35.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2023-04-24-21-33-35.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3 id="mathematica-data-visualization-saquib-2014"&gt;Mathematica Data Visualization (Saquib, 2014)&lt;/h3&gt;
&lt;p&gt;Same complaint here. Again, it assumes that the reader is already familiar with data munging in Mathematica, and the introductory second chapter only covers basic properties of lists and functions. Then, CSV data files are imported using the magic &lt;code&gt;Import&lt;/code&gt;, and some illustrations using &lt;code&gt;ListPLot&lt;/code&gt; are given together with information about customizing the resulting output. Chapter 3 deals with time series while chapter 4 introduces more elaborated charts (histograms, similarity maps, wordcloud, graph and chord diagrams). Together with the short discussion on high-dimensional data, these were the most interesting parts of the book. We should acknowledge the fact that Mathematica provides great defaults, especially for plotting and displaying data in a notebook. The image on the right in the above panel is an example taken from the book.&lt;/p&gt;
&lt;h3 id="mathematica-by-example-abell--braselton-2021"&gt;Mathematica by Example (Abell &amp;amp; Braselton, 2021)&lt;/h3&gt;
&lt;p&gt;This is a book I would recommend for someone who wants to learn Mathematica to do applied mathematics. This is not a book about Mathematica programming per se, but how to get your job done using the many facets of Mathematica. Chapter 2 describes baisc operations on numbers, including rationales. The authors sometimes raise subtle issues regarding Mathematica&amp;rsquo;s rules for evaluating, e.g. Input or Traditional form like &lt;code&gt;Sin[Pi/6]^2&lt;/code&gt; versus &lt;code&gt;Sin^2[Pi/6]&lt;/code&gt; (the latter is interpreted as the former only in &lt;code&gt;TraditionalForm&lt;/code&gt;). Typesetting is not so great (a mix of mono and bold fonts, image or screenshots of running notebooks, or various mention of US universities for the choice of qualitative color palette,&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt; etc.), but it is not hard to follow. After you finish reading this chapter, you already know how to write and simplify simple mathematical expressions, define your own function and use &lt;code&gt;Plot&lt;/code&gt; (including the &lt;code&gt;Epilog&lt;/code&gt; option!). After Chapter 2, you should be able to represent graphically many mathematical expression surely. Chapter 2 deals with calculus, and it comes with very nice illustrations (Fig. 3.7 reminds me of one of my &lt;a href="https://aliquote.org/post/newton-raphson-racket/"&gt;earlier post&lt;/a&gt; about the Newton-Raphson algorithm). It introduces the &lt;code&gt;Manipulate&lt;/code&gt; command which brings dynamic and interactive visualization in Mathematica. I learned most of this stuff using a French textbook (&lt;em&gt;Mathématiques pour les sciences de l’ingénieur avec Mathematica&lt;/em&gt; (tome 1), by Carmasol, 2013) but it was a great refresher.&lt;/p&gt;
&lt;p&gt;In Mathematica, lists and tables are the core elements you often end up manipulating. Chapter 4 will help learn you more about that, and I learned a lot about that too. Chpaters 5 and 6 discuss more advanced math stuff.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2023-04-25-12-19-27.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2023-04-25-12-19-27.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2023-04-25-12-39-53.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2023-04-25-12-39-53.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Killing Joke • &lt;em&gt;Darkness Before Dawn&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;This pretty applies to most of Packt&amp;rsquo;s published stuff, with few exception regarding &lt;a href="https://www.packtpub.com/product/python-machine-learning/9781783555130"&gt;Python&lt;/a&gt; and &lt;a href="https://www.packtpub.com/product/clojure-high-performance-programming-second-edition/9781785283642"&gt;Clojure&lt;/a&gt;. My impression is that over time the quality of published works has constantly deteriorated, like PLoS One in the scientific field: easy come, easy go, sure, but also the easier it is to publish, the less attention is paid to the competition.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;This somewhat reminded me of SAS who insists on displaying the results of non-parametric testing as well as normmality or equality-of-variance when you explicitly ask for a Student t-test.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:3"&gt;
&lt;p&gt;Apparently, the blue-dark yellow colorscheme is from the University of California-San Diego :-)&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Using fzf-lua</title><link>https://aliquote.org/post/nvim-fzf-lua/</link><pubDate>Sun, 23 Apr 2023 20:29:50 +0200</pubDate><guid>https://aliquote.org/post/nvim-fzf-lua/</guid><description>&lt;p&gt;I use a boring TUI low-color setup, and I have never been as happy since it allows to focus on the task at hand. Anyway, my Neovim configuration has been relatively stable for the past few months, and since Neovim 0.7-dev I haven&amp;rsquo;t encountered a single breaking change in Neovim core, which is pretty good sign. At the time of this writing, the nightly version of Neovim is 0.10.0-dev (LuaJIT 2.1.0-beta3).&lt;/p&gt;
&lt;p&gt;Today I decided to give a try to &lt;a href="https://github.com/ibhagwan/fzf-lua"&gt;fzf-lua&lt;/a&gt; as a replacement for &lt;a href="https://github.com/junegunn/fzf.vim"&gt;fzf.nvim&lt;/a&gt;. Since it is my daily driver to navigating files, history, etc. in Neovim, it must be at least as efficient as Junegunn Choi&amp;rsquo;s wonderful plugin. It looks like it is. Everything works perfectly, with the added benefits of a more comfortable Git UI (you can stage or unstage files, and preview local changes), an online help for available shortcuts depending on the context, more utilities (just &lt;a href="https://github.com/ibhagwan/fzf-lua#search"&gt;take a look&lt;/a&gt; at the number of functions to grep for something in your files); last but not least, it support Neovim builtin &lt;a href="https://github.com/ibhagwan/fzf-lua#lspdiagnostics"&gt;LSP and diagnostics&lt;/a&gt;, which I was missing from fzf.vim.&lt;/p&gt;
&lt;p&gt;I easily updated my custom grep function, which fuzzy search project directory when on a blank line or the word under the cursor, with FzfLua &lt;code&gt;grep_*&lt;/code&gt; utilities:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;#34; fzf.vim version
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;#34; fzf.vim version
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;#34; function! misc#fzf_rg() abort
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;#34; let currWord = expand(&amp;#39;&amp;lt;cword&amp;gt;&amp;#39;)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;#34; if len(currWord) &amp;gt; 0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;#34; execute &amp;#39;:Rg &amp;#39; . currWord
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;#34; else
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;#34; execute &amp;#39;:Rg&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;#34; endif
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;#34; endfunction
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;#34; fzf.lua version
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;function! misc#fzf_rg() abort
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; let currWord = expand(&amp;#39;&amp;lt;cword&amp;gt;&amp;#39;)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; if len(currWord) &amp;gt; 0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; execute &amp;#39;:FzfLua grep_cword&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; else
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; execute &amp;#39;:FzfLua grep_project&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; endif
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;endfunction
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Ok, not a big deal. No other configuration required, except for displaying all Fzf window as before, in a bottom split. This was easy to configure, though:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;require(&amp;#34;fzf-lua&amp;#34;).setup({
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; winopts = {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; split = &amp;#34;belowright 10new&amp;#34;,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; border = &amp;#34;single&amp;#34;,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; preview = {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; hidden = &amp;#34;hidden&amp;#34;,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; border = &amp;#34;border&amp;#34;,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; title = false,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; layout = &amp;#34;horizontal&amp;#34;,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; horizontal = &amp;#34;right:50%&amp;#34;,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; },
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; },
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;})
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So, I think I&amp;rsquo;ll be switching definitely in a few days if nothing bad happens in the mean time.&lt;/p&gt;
&lt;p&gt;Finally, I really like the quote on the GH README:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Why Fzf-Lua&lt;br&gt;
&amp;hellip; and not telescope or any other vim/neovim household name?&lt;br&gt;
As @junegunn himself put it, “because you can and you love fzf”.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="alert alert-note"&gt;
&lt;p&gt;&lt;small&gt;[2023-04-24]&lt;/small&gt;&lt;br&gt;
Well, actually it didn&amp;rsquo;t take long before I realized how magical this plugin is, and what kind of enhancements it brigs to fzf.vim. The integration with LSP and the quickfix which I use a lot is simply wonderful, and all the defaults and options were carefully crafted! The lua bindings for &lt;a href="https://github.com/msprev/fzf-bibtex"&gt;fzf-bibtex&lt;/a&gt; also work like a charm, and I added a simple helper function to open the PDF file right from the Fzf prompt:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lua" data-lang="lua"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;file_open&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kr"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;selected&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;vim.fn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;system&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;bibtex-cite&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;selected&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;fh&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/home/chl/Documents/papers/&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;..&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;sub&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;..&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;.pdf&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vim.api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nvim_command&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;silent !zathura &amp;#34;&lt;/span&gt; &lt;span class="o"&gt;..&lt;/span&gt; &lt;span class="n"&gt;fh&lt;/span&gt; &lt;span class="o"&gt;..&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34; &amp;amp;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;small&gt;This assumes that the name of the PDF file is the Bibtex key. If that&amp;rsquo;s not the case, I guess it will be harder unless the filename is available in the Bibte entry itself (and you will need to parse that entry specifically).&lt;/small&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Chico Hamilton • &lt;em&gt;Goodbye Baby Blues&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Parsing CSV files in Racket</title><link>https://aliquote.org/post/quick-csv-reader/</link><pubDate>Fri, 21 Apr 2023 12:21:08 +0200</pubDate><guid>https://aliquote.org/post/quick-csv-reader/</guid><description>&lt;p&gt;This ought to be a place to post some code about reading/writing CSV files in Racket, then I realized I had a draft in my inbox regarding Racket packages to import rectangular datasets. In fine, I will simply review what I expect from such a package, and how it could be interconnected with a package for data preprocessing. I&amp;rsquo;m currently writing one for Newlisp, so maybe I can factor in the ideas and code a bit.&lt;/p&gt;
&lt;p&gt;First off, Racket offers excellent support for reading CSV files. Since I often need to import data in CVS format, this is kind of great. As in one of my &lt;a href="https://aliquote.org/post/ols-and-svd/"&gt;previous post&lt;/a&gt;, I usually rely on &lt;code&gt;make-csv-reader-maker&lt;/code&gt; from the &lt;a href="https://docs.racket-lang.org/csv-reading/index.html"&gt;csv-reading&lt;/a&gt; package. Reader specs are generally easy to define, at least for the kind of rectangular dataset I used to process. However, I don&amp;rsquo;t use the built-in iterator to process each row one at a time (same as a &lt;code&gt;yield&lt;/code&gt; statement in Python&amp;rsquo;s generators), and just call &lt;code&gt;csv-&amp;gt;list&lt;/code&gt;. This has the advantage (and inconvenient, because then we&amp;rsquo;ll need a lot of lambda&amp;rsquo;s to process the elements of the sublists) of returning a list of sublists.&lt;/p&gt;
&lt;p&gt;Even if I tend to use a combination of &lt;code&gt;apply&lt;/code&gt; and &lt;code&gt;map&lt;/code&gt; a lot, as can be seen in my related posts, I should mention that most Scheme implementations come with &lt;code&gt;append-map&lt;/code&gt; (same as &lt;a href="http://www.lispworks.com/documentation/HyperSpec/Body/f_mapc_.htm"&gt;CL&lt;/a&gt;&amp;rsquo;s &lt;code&gt;mapcan&lt;/code&gt;), which is often used to &amp;ldquo;flatten&amp;rdquo; a list of sublists, or to apply a procedure to a list and return a new transformed list. Sometimes it may simplify our workflow. All three following expressions return the same results (a list of squared integers):&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;map&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;expt&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;append-map&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;expt&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;apply&lt;/span&gt; &lt;span class="nb"&gt;append&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;map&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;expt&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Regarding the &lt;code&gt;csv-reading&lt;/code&gt; package itself, I discovered that there are some builtins, namely &lt;code&gt;csv-for-each&lt;/code&gt; and &lt;code&gt;csv-map&lt;/code&gt;, to apply some stuff on each row or records from the CSV file. As convenient as these utilities are, we also often want to work by column (think variable in statistical computing), or to select a subset of data (row by column) or to filter rows and return some specific comumns. You can think of the &lt;code&gt;subset&lt;/code&gt; function in R, or the &lt;code&gt;egen&lt;/code&gt; (or &lt;code&gt;bysort&lt;/code&gt; for simple queries) procedure in Stata.&lt;/p&gt;
&lt;p&gt;Of course, it would be great to have some additional procedures to support the use of &lt;code&gt;csv-reading&lt;/code&gt;, keeping in mind that they should apply to other flat files as well (e.g., JSON): &lt;code&gt;select&lt;/code&gt; (select one or more columns), &lt;code&gt;subset&lt;/code&gt; (select one or more rows), &lt;code&gt;group&lt;/code&gt; (create a view using row x column), &lt;code&gt;aggregate&lt;/code&gt; (compute some statistics on a view, which is mostly the &lt;a href="https://aliquote.org/post/plyr-in-scheme/"&gt;split-apply-combine&lt;/a&gt; strategy). Also, we would want to get rownames and colnames, like in R, such that we can refer to row or column using proper labels and see what&amp;rsquo;s left in a view or subset when printing it in the REPL. Finally, we need to handle categorical data and missing values nicely. In the latter case, we could simply use a pair of (value . weight), instead of relying on bit masking or a shadow table. This means we will need to use weighted statistics,&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; but it is already implemented in math/statistics for the most import ones. Additionally, it would be interesting if we could exploit an SQL backend like SQLite or DuckDB instead of working with arrays, lists or sequences.&lt;/p&gt;
&lt;p&gt;While I would prefer to roll my own version, my previous review of the available Racket packages led me to the following candidates:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.racket-lang.org/data-frame/index.html"&gt;data-frame&lt;/a&gt;, which is the package I used for some time.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/jadudm/data-table"&gt;data-table&lt;/a&gt;, &amp;ldquo;a library for manipulating tabular data in Racket.&amp;rdquo; It has interesting features like working with remote data structures but it seems pretty limited in terms data manipulation, and the project hasn&amp;rsquo;t received any update in several years.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/jackfirth/rebellion"&gt;rebellion&lt;/a&gt;, &amp;ldquo;a suite of libraries for defining new struct-based types including record types and enum types, and much more.&amp;rdquo; It features a &lt;a href="https://docs.racket-lang.org/rebellion/Tables.html"&gt;tabular data structure&lt;/a&gt;, where column names are stored as keywords.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/ralsei/sawzall"&gt;sawzall&lt;/a&gt;, &amp;ldquo;A grammar of data manipulation for Racket, inspired by dplyr.&amp;rdquo; It is probably the closer in spirit to R&amp;rsquo;s (new) way of data munging. However, the project hasn&amp;rsquo;t received any update in the last two years. It depends on the &lt;code&gt;data-frame&lt;/code&gt; package, and it comes with a companion package for pgraphics (&lt;a href="https://github.com/ralsei/graphite"&gt;graphite&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There may be other packages I am missing, of course. The &lt;code&gt;data-frame&lt;/code&gt; package is really great except it doesn&amp;rsquo;t quite support categorical data, at least last time I tried it. I&amp;rsquo;m working on it, though, which eventually will mean we could write things like that:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;require&lt;/span&gt; &lt;span class="n"&gt;data-frame&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;require&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;utils.rkt&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df-read/csv&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;../data/fev.csv&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df-describe&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;recode&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;vector-&amp;gt;list&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df-select&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;sex&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I&amp;rsquo;m interested in Jack Firth&amp;rsquo;s package, though, for it provides handy data structures, including tables iterations and comprehensions. It&amp;rsquo;s just that I&amp;rsquo;m not familiar with this package, and I would need to benchamrk the record (with constant-time lookup of field values by name) and table objects. It is well documented, like the &lt;code&gt;data-table&lt;/code&gt; package.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2023-11-16]&lt;/small&gt;&lt;br&gt;
TIL there&amp;rsquo;s another package which I didn&amp;rsquo;t find when I drafted this post: &lt;a href="https://github.com/bommysk/RacketFrames"&gt;RacketFrames&lt;/a&gt;.
&lt;/div&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Bentley • &lt;em&gt;Been a While&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;There&amp;rsquo;s also &lt;code&gt;filter-map&lt;/code&gt;, at least in Racket, which is probably a better fit in this case: &lt;code&gt;(filter-map (lambda (x) (expt x x)) '(1 2 3 4 5))&lt;/code&gt; (no need to construct a list explicitely). Note that &lt;code&gt;filter-map&lt;/code&gt; may be more interesting when one wants to filter items in a row depending on a certain predicate.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;This was suggested a long time ago by Evan Miller. See 3rd paragraph in this &lt;a href="https://aliquote.org/post/micro-review-006"&gt;technical review&lt;/a&gt;.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>ArXiving on January 2023</title><link>https://aliquote.org/post/arxiv-12/</link><pubDate>Wed, 19 Apr 2023 12:19:00 +0100</pubDate><guid>https://aliquote.org/post/arxiv-12/</guid><description>&lt;p&gt;(I know, I know, it&amp;rsquo;s a bit late for a January review.)&lt;/p&gt;
&lt;h3 id="polynomial-spline-regression-theory-and-application-"&gt;Polynomial spline regression: Theory and Application (&lt;a href="https://arxiv.org/abs/2212.14777"&gt;https://arxiv.org/abs/2212.14777&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;The Box-Cox transformation is one of the many tools one can use to ease traditional linear modeling of data.Semi-parametric regression, whihc I never really used for real work is also an option. Flexible regression methods, as emphasized in Harrell&amp;rsquo;s RMS textbook&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; or the use of generalized additive models&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; are another. I&amp;rsquo;ve been doing some research on orthogonal polynomial, restricted cubic splines, and other spline fitting procedures, and then I found this paper. It introduces different frameworks (Truncated Power, B-spline, and P-Spline), and a quick application on a time-series dataset.&lt;/p&gt;
&lt;h3 id="parametrization-cookbook-a-set-of-bijective-parametrizations-for-using-machine-learning-methods-in-statistical-inference-"&gt;Parametrization Cookbook: A set of Bijective Parametrizations for using Machine Learning methods in Statistical Inference (&lt;a href="https://arxiv.org/abs/2301.08297"&gt;https://arxiv.org/abs/2301.08297&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;Looks interesting at first sight, but I haven&amp;rsquo;t had time to read it. Maybe you will be interested, though.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Unlike the parametrizations classically used in Machine Learning, the parametrizations introduced here are all bijective and are even diffeomorphisms, thus allowing to keep the important properties from a statistical inference point of view, first of all identifiability&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id="an-introduction-to-probabilistic-programming-"&gt;An Introduction to Probabilistic Programming (&lt;a href="https://arxiv.org/abs/1809.10756"&gt;https://arxiv.org/abs/1809.10756&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;This is a 300-page long tutorial on probabilistic programming written by one of the authors of &lt;a href="https://probprog.github.io/anglican/index.html"&gt;Anglican&lt;/a&gt;, which seems like a staled project at this time. Still, it is a very valuable account of probabilistic programming at large and a peculiar implementation targeting the JVM. See also these &lt;a href="https://jwvdm.github.io/slides/inference-learning-prob-prog/"&gt;slides&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="a-practical-introduction-to-regression-discontinuity-designs-extensions-"&gt;A Practical Introduction to Regression Discontinuity Designs: Extensions (&lt;a href="https://arxiv.org/abs/2301.08958"&gt;https://arxiv.org/abs/2301.08958&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;This is a rather long monograph on RDDs. It covers local randomization (which assumes that the assignment of units above or below the cutoff was as if random inside a given window and that in this window the potential outcomes are unrelated to the score), fuzzy RDD (which accounts for non-compliance), and discrete and multidimensional designs. There&amp;rsquo;s a preliminary &lt;a href="https://arxiv.org/abs/1911.09511"&gt;monograph&lt;/a&gt; from the same authors that only deals with the classical RDD, as well as a practical for &lt;a href="https://arxiv.org/abs/2302.07413"&gt;medical applications&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="improving-software-engineering-in-biostatistics-challenges-and-opportunities-"&gt;Improving Software Engineering in Biostatistics: Challenges and Opportunities (&lt;a href="https://arxiv.org/abs/2301.11791"&gt;https://arxiv.org/abs/2301.11791&lt;/a&gt;)&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;Programming is ubiquitous in applied biostatistics; adopting software engineering skills will help
biostatisticians do a better job.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A few months ago, I read on a blog that statisticians were very bad at programming because they lack skills in software engineering. Let me suggest two additional remarks: applied statisticians must provide results, quickly whenever possible, and when they can use agile programming they do, most of the time. This does not mean they will deliver a product of industrial grade, but if they can reproduce their own results six months later, this already is good news. I guess many software engineers never looked at statlib or established algorithms; you can use TDD, CI, regression tests and the like; if your algorithm is far from the standards, it won&amp;rsquo;t do any good.&lt;/p&gt;
&lt;h3 id="a-statistical-framework-for-planning-and-analysing-test-retest-studies-for-repeatability-of-quantitative-biomarker-measurements-"&gt;A statistical framework for planning and analysing test-retest studies for repeatability of quantitative biomarker measurements (&lt;a href="https://arxiv.org/abs/2301.11690"&gt;https://arxiv.org/abs/2301.11690&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;Sometimes, I feel like I&amp;rsquo;m reading the same story every year: &amp;ldquo;biomarkers&amp;rdquo;, measurement error, practical significant difference, etc. &lt;a href="https://en.wikipedia.org/wiki/Why_Most_Published_Research_Findings_Are_False"&gt;Ioannidis&lt;/a&gt; warned us a long time ago.&lt;/p&gt;
&lt;h3 id="from-classification-accuracy-to-proper-scoring-rules-elicitability-of-probabilistic-top-list-predictions-"&gt;From Classification Accuracy to Proper Scoring Rules: Elicitability of Probabilistic Top List Predictions (&lt;a href="https://arxiv.org/abs/2301.11797"&gt;https://arxiv.org/abs/2301.11797&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;The authors hereby suggests &amp;ldquo;probabilistic top lists as a novel type of prediction in classification, which bridges the gap between single-class predictions and predictive distributions.&amp;rdquo; His conclusion is that the Brier score is a good candidate. The problem with discrimination indices is that they perform poorly when the observed prevalence of the outcome is very low (which happens pretty often in medical applications) despite highly significant variables.&lt;/p&gt;
&lt;h3 id="getting-to-the-point-index-sets-and-parallelism-preserving-autodiff-for-pointful-array-programming-"&gt;Getting to the Point. Index Sets and Parallelism-Preserving Autodiff for Pointful Array Programming (&lt;a href="https://arxiv.org/abs/2104.05372"&gt;https://arxiv.org/abs/2104.05372&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;I learned about &lt;a href="https://github.com/google-research/dex-lang"&gt;Dex&lt;/a&gt; on Darren Wilkinson&amp;rsquo;s blog. Later on, I learned about Futhark, but see &lt;a href="https://futhark-lang.org/blog/2020-12-28-futhark-and-dex.html"&gt;A comparison of Futhark and Dex&lt;/a&gt;. I never used any one of these DSLs, but I warmly recommend reading what Darren Wilkinson has to say about those frameworks.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Train • &lt;em&gt;Drops of Jupiter&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Frank E Harrell (2015) &lt;em&gt;Regression Modeling Strategies&lt;/em&gt;, Cham: Springer International Publishing&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;T. J. Hastie &amp;amp; R. J. Tibshirani (1990) &lt;em&gt;Generalized Additive Models&lt;/em&gt;, Chapman &amp;amp; Hall/CRC; Wood, S. N. (2017). &lt;em&gt;Generalized Additive Models: An Introduction with R&lt;/em&gt; (2nd ed). Chapman &amp;amp; Hall/CRC.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>The unquantified self #28</title><link>https://aliquote.org/post/unquantified-self-028/</link><pubDate>Mon, 17 Apr 2023 11:09:39 +0200</pubDate><guid>https://aliquote.org/post/unquantified-self-028/</guid><description>&lt;p&gt;I&amp;rsquo;m still tired all day long (it looks like it spans the half-life of my beta blocker, but I&amp;rsquo;m not really sure that it&amp;rsquo;s all about that). Anyway, at least I&amp;rsquo;m on vacation for two good weeks. And that which cannot be seen does not exist.&lt;/p&gt;
&lt;p&gt;I know I often change my mind and move from one project to another at the speed of light. I also do what I do when I feel like it. Natural disposition we&amp;rsquo;ll say. So, after spending two months drawing with ink or charcoal during the last quarter of 2022, after going back to computational statistics and applied biostatistics on this blog or on Github, here is where I spent some of my evenings laying down blocks&amp;hellip; in Minecraft during one month or so.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2023-03-25_21.41.47.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2023-03-25_21.41.47.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2023-04-18_21.23.30.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2023-04-18_21.23.30.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Things are going well, and the village should be ready in a couple of weeks. It has been extraordinarily relaxing to get back to building on MC, after a hiatus of several years. Now, I&amp;rsquo;m not done with statistical computing. I still have to finish my &lt;a href="https://github.com/even4void/biostats"&gt;ongoing project&lt;/a&gt; and get back to writing an efficient statistical library for Racket.&lt;/p&gt;
&lt;p&gt;I watched two good movies recently: &lt;a href="https://en.wikipedia.org/wiki/God%27s_Crooked_Lines"&gt;God&amp;rsquo;s Crooked Lines&lt;/a&gt; and &lt;a href="https://en.wikipedia.org/wiki/Anon_(film)"&gt;Anon&lt;/a&gt;. It was some good time after a few series without much quality. Also, I listened at least twice to all of my music collection, which is about 14k MP3 files, and the vinyl player works hard when I&amp;rsquo;m at home (actually listening to Nick Cave&amp;rsquo;s &lt;a href="https://www.nickcave.com/b-sides-rarities/"&gt;B sides &amp;amp; Rarities&lt;/a&gt; a lot)!&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Adam Wakeman • &lt;em&gt;Draa Valley&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Solving OLS problem using SVD</title><link>https://aliquote.org/post/ols-and-svd/</link><pubDate>Fri, 07 Apr 2023 09:12:39 +0200</pubDate><guid>https://aliquote.org/post/ols-and-svd/</guid><description>&lt;p&gt;I came across a Racket package which aims to provide basic linear regression fitting utilities to Schemers. Unfortunately, it relies on the use of normal equations to solve the linear systems, which is rarely a good idea (think about what happens if the design matrix has a very irregular shape, or even &lt;a href="https://stats.stackexchange.com/a/343075"&gt;condition number&lt;/a&gt;). Moreover, it is not very flexible regarding data i/o, but that&amp;rsquo;s not the point of this post.&lt;/p&gt;
&lt;p&gt;Direct methods (i.e., matrix decomposition) have been discussed beforehand, e.g. &lt;a href="https://aliquote.org/post/lisp-qr-regression/"&gt;here&lt;/a&gt; (Lisp) and &lt;a href="https://aliquote.org/post/newton-raphson-racket/"&gt;here&lt;/a&gt; (Racket). Here is another direct method which relies on the SVD. Considering the linear system $X\beta = y$, the idea is to decompose $X$ as $\underset{m\times m}{U}\overset{m\times n}{\Sigma}\underset{n\times n}{V^T}$, where $U$ and $V$ are unitary matrices, and $\Sigma$ is a diagonal matrix filled with 0 for rows $n+1,\dots,m$.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; Then, $\hat\beta$ is obtained as $V^T\Sigma^{-1}U^Ty$. See &lt;a href="https://blogs.mathworks.com/cleve/2019/08/05/the-qr-algorithm-computes-eigenvalues-and-singular-values/"&gt;The QR Algorithm Computes Eigenvalues and Singular Values&lt;/a&gt; to learn more about the relationship between the QR and SVD matrix decompositions.&lt;/p&gt;
&lt;p&gt;To sum up, although solving normal equations is usually the fastest method, its squared condition number renders it less stable; QR decomposition is more stable at the expense of a larger cost, and SVD works well even in case $X$ is rank-deficient.&lt;/p&gt;
&lt;p&gt;Here is a direct application in Racket, using the same example we used in a &lt;a href="https://aliquote.org/post/newlisp-ols/"&gt;previous post&lt;/a&gt;. I&amp;rsquo;ll be using the excellent &lt;a href="https://docs.racket-lang.org/manual-flomat/"&gt;flomat&lt;/a&gt; package by Axel Søgaard.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;#lang &lt;/span&gt;&lt;span class="nn"&gt;racket&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;require&lt;/span&gt; &lt;span class="n"&gt;flomat&lt;/span&gt; &lt;span class="n"&gt;csv-reading&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="k"&gt;file&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;csv-&amp;gt;list&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;make-csv-reader-maker&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="ss"&gt;separator-chars&lt;/span&gt; &lt;span class="sc"&gt;#\,&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;quote-char&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="no"&gt;#f&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;open-input-file&lt;/span&gt; &lt;span class="k"&gt;file&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;map&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;map&lt;/span&gt; &lt;span class="nb"&gt;string-&amp;gt;number&lt;/span&gt; &lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cdr&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/home/chl/tmp/birthwt.csv&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;xs&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;matrix&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;map&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list-ref&lt;/span&gt; &lt;span class="n"&gt;xs&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;ys&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;matrix&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;map&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list-ref&lt;/span&gt; &lt;span class="n"&gt;xs&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;X&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;augment&lt;/span&gt; &lt;span class="n"&gt;xs&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;flomat-ones&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nrows&lt;/span&gt; &lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define-values&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;U&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt; &lt;span class="n"&gt;V&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;svd&lt;/span&gt; &lt;span class="n"&gt;X&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;times&lt;/span&gt; &lt;span class="n"&gt;V&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;inv&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;diag&lt;/span&gt; &lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;transpose&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sub&lt;/span&gt; &lt;span class="n"&gt;U&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nrows&lt;/span&gt; &lt;span class="n"&gt;U&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="n"&gt;ys&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; (flomat: ((12.429712027714643) (2655.74446970517)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2023-05-02]&lt;/small&gt;&lt;br&gt;
To learn about more &amp;ldquo;traditional&amp;rdquo; Racket &lt;a href="https://docs.racket-lang.org/math/array.html"&gt;arrays&lt;/a&gt;, check the documentation or the following blog post, by Alex Harsányi: &lt;a href="https://alex-hhh.github.io/2023/04/array-tutorial.html"&gt;A Racket Array Tutorial&lt;/a&gt;.
&lt;/div&gt;
&lt;p&gt;Note that the above procedure returns a full matrix (m x m) for U, but we don&amp;rsquo;t really need the extra columns, hence the subsetting to the first two columns of $U$. For the record, we got the following results using Newlisp:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;gsl:QR-solve&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt; &lt;span class="nv"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; (2655,744469705172 12,4297120277146)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The Python version follows:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;numpy&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;np&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;pandas&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pandas&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read_csv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;/home/chl/tmp/birthwt.csv&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;c_&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ones&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;shape&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;age&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;bwt&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;U&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;V&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;linalg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;svd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;full_matrices&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;False&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;V&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt; &lt;span class="o"&gt;@&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;linalg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;inv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;diag&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;@&lt;/span&gt; &lt;span class="n"&gt;U&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt; &lt;span class="o"&gt;@&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# =&amp;gt; array([2655.74446971, 12.42971203])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Emma Ruth Rundle • &lt;em&gt;Blooms of Oblivion&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;The number of columns can also be reduced (i.e. discarding the smallest singular values).&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;If you get an error regarding a missing libgfortran (likely v3), be sure to install the latest version of the sci package which includes a &lt;a href="https://github.com/soegaard/sci/pull/14"&gt;fix&lt;/a&gt; for Ubuntu 22.04.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in March</title><link>https://aliquote.org/post/micro-03-2023/</link><pubDate>Wed, 29 Mar 2023 19:36:38 +0200</pubDate><guid>https://aliquote.org/post/micro-03-2023/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-03-08&lt;/a&gt;: Testing my new mapping of the month:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nnoremap &amp;lt;expr&amp;gt; &amp;lt;tab&amp;gt; tabpagenr(&amp;#39;$&amp;#39;) ==? 1 ? &amp;#34;&amp;lt;C-^&amp;gt;&amp;#34; : &amp;#34;:tabnext&amp;lt;cr&amp;gt;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Basically, use TAB to switch to the alternate buffer when there&amp;rsquo;s no other tab, otherwise go to next tab (and cycle). &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-03-17&lt;/a&gt;: Peonia is waiting for its time&amp;hellip;&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_2889.JPG" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-03-20&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If you type something that looks like a filename, you probably want to prioritize filename matches. When your search query looks like a filepath, you probably want to use an algorithm designed for filepath matching. This makes zf a “do what I mean” program. &amp;mdash; &lt;a href="https://nathancraddock.com/blog/2023/a-different-approach-to-fuzzy-finding/"&gt;A different approach to fuzzy finding&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-03-20&lt;/a&gt;: Together with &lt;a href="https://github.com/alx741/vinfo"&gt;Vinfo&lt;/a&gt;, &lt;a href="https://github.com/rebcabin/dpans2texi"&gt;dpans2texi&lt;/a&gt; makes it easy to navigate through CL help files. Be sure to apply the following &lt;a href="https://chalaev.com/emacs"&gt;patch&lt;/a&gt; as well. &lt;code&gt;#vim&lt;/code&gt; &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-03-20&lt;/a&gt;: ♪ Plain White T&amp;rsquo;s · Hey There Delilah&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-03-23&lt;/a&gt;: &lt;a href="https://ryxcommar.com/2022/09/15/multiple-linear-regression-in-sql-with-only-sum-and-avg/"&gt;Multiple Linear Regression in SQL with Only SUM() and AVG()&lt;/a&gt;. For those interested in multiple regression and residualized regressors as well! &lt;code&gt;#statistics&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-03-27&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Deforming programs so they are ‘iterative’ in order that they do not run out of the stack we imagine to be so costly is ridiculous: if you have a program which is inherently recursive, let it be recursive. &amp;mdash; &lt;a href="https://www.tfeb.org/fragments/2023/03/25/the-absurdity-of-stacks/"&gt;The absurdity of stacks&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-03-27&lt;/a&gt;: The LAPACK (Linear Algebra PACKage) online document browser is really nice. TIL there&amp;rsquo;s even a routine to perform QR factorization without pivoting to a real or complex matrix (related R package: &lt;a href="https://cran.r-project.org/web/packages/QR/index.html"&gt;QR&lt;/a&gt;).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-03-27&lt;/a&gt;: &lt;a href="https://jakob.space/blog/thoughts-on-lisps.html"&gt;The Many Faces of an Undying Programming Language&lt;/a&gt;. An entertaining discussion of Lisp, Scheme(s), and other dialects. &lt;code&gt;#lisp&lt;/code&gt; &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-03-27&lt;/a&gt;: &lt;a href="https://dirk.eddelbuettel.com/blog/2023/03/26/#littler-0.3.18"&gt;littler 0.3.18 on CRAN&lt;/a&gt;. It&amp;rsquo;s been a faithful and reliable alternative to Rscript for a long time now (17 years and counting). &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>Welford algorithm in Newlisp</title><link>https://aliquote.org/post/welford-in-lisp/</link><pubDate>Mon, 20 Mar 2023 11:54:10 +0100</pubDate><guid>https://aliquote.org/post/welford-in-lisp/</guid><description>&lt;p&gt;A few years ago we discussed the Welford algorithm to &lt;a href="https://aliquote.org/post/computing-variance/"&gt;compute the variance&lt;/a&gt; of a vector of numerical values &lt;a href="https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance"&gt;without catastrophic cancellation&lt;/a&gt;. In addition to being numerically stable, the difference with Kahan-compensated two-pass computations for large data sets are very small. See also &lt;a href="https://nullbuffer.com/articles/welford_algorithm.html"&gt;Numerically stable algorithm for computing the running mean&lt;/a&gt; for related approaches, and John D. Cook&amp;rsquo;s &lt;a href="https://www.johndcook.com/blog/2008/09/28/theoretical-explanation-for-numerical-results/"&gt;original post&lt;/a&gt;. The stability and numerical accuracy of one-pass algorithms are also discussed in several textbooks.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;While reviewing Newlisp statistical function in the &lt;a href="http://www.newlisp.org/code/modules/stat.lsp.html"&gt;stat&lt;/a&gt; module, I noticed it should get it wrong in this case:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;module&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;stat.lsp&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;x&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;sequence&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;stat:var&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; 2.5&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;stat:var&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;lambda&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;1e10&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; -16384&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The author uses the formula &lt;code&gt;(sub (sum-sq X) (div (mul (sum X) (sum X)) (length X)))&lt;/code&gt; (later corrected for bias), which is the same that was discussed in the previous post.&lt;/p&gt;
&lt;p&gt;Note that Racket has no problem with this cornercase.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; Let&amp;rsquo;s implement the single-pass Welford algorithm in Newlisp, as a rough translation of the R code provided in the previous post:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;variance&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nv"&gt;mean&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;variance&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;length&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;dotimes&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;setq&lt;/span&gt; &lt;span class="nv"&gt;curr&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;nth&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;setq&lt;/span&gt; &lt;span class="nv"&gt;tmp&lt;/span&gt; &lt;span class="nv"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;setq&lt;/span&gt; &lt;span class="nv"&gt;mean&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;add&lt;/span&gt; &lt;span class="nv"&gt;mean&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;div&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;sub&lt;/span&gt; &lt;span class="nv"&gt;curr&lt;/span&gt; &lt;span class="nv"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;+&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;setq&lt;/span&gt; &lt;span class="nv"&gt;variance&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;add&lt;/span&gt; &lt;span class="nv"&gt;variance&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;mul&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;sub&lt;/span&gt; &lt;span class="nv"&gt;curr&lt;/span&gt; &lt;span class="nv"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;sub&lt;/span&gt; &lt;span class="nv"&gt;curr&lt;/span&gt; &lt;span class="nv"&gt;tmp&lt;/span&gt;&lt;span class="p"&gt;)))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;div&lt;/span&gt; &lt;span class="nv"&gt;variance&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;-&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;variance&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;lambda&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;1e10&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; 2.5&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;A more idiomatic way of writing a standard function in CL, which follows Racket&amp;rsquo;s two-pass approach, would be:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defun&lt;/span&gt; &lt;span class="nv"&gt;mean&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;reduce&lt;/span&gt; &lt;span class="nf"&gt;#&amp;#39;+&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;length&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defun&lt;/span&gt; &lt;span class="nv"&gt;variance&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nv"&gt;mean&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;mean&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;length&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;reduce&lt;/span&gt; &lt;span class="nf"&gt;#&amp;#39;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;list&lt;/span&gt; &lt;span class="nf"&gt;#&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;lambda&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;square&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;-&lt;/span&gt; &lt;span class="nv"&gt;mean&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;1-&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I should not that Tom MacWright gets it right too in his &lt;a href="https://simple-statistics.github.io/"&gt;simple-statistics&lt;/a&gt; module:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-javascript" data-lang="javascript"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ss&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;../dist/simple-statistics.js&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;ss&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sampleVariance&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;1e10&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The take away message is that you should either rely on a two-pass algorithm (i.e., compute the mean first, then the squared deviations from the mean) or the Welford algorithm, especially if you are interested in running statistics.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;p&gt;&lt;small&gt;[2023-11-23]&lt;/small&gt;&lt;br&gt;
As I was surveying the various statistical packages lying around on GitHub, I found many buggy implementations (e.g., &lt;code&gt;basic-statistics.lisp&lt;/code&gt; in &lt;a href="https://github.com/MBcode/LispUtils"&gt;LispUtils&lt;/a&gt;). However, &lt;a href="https://github.com/ghollisjr/cl-ana"&gt;cl-ana&lt;/a&gt; got it right:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;ql:quickload&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;cl-ana&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defparameter&lt;/span&gt; &lt;span class="vg"&gt;*xs*&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;cl-ana::variance&lt;/span&gt; &lt;span class="vg"&gt;*xs*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; 5/2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;cl-ana::variance&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;mapcar&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;lambda&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;10000000&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="vg"&gt;*xs*&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; 5/2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Tracy Chapman • &lt;em&gt;Fast Car&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;See, e.g., N.J. Higham, &lt;em&gt;Accuracy and Stability of Numerical Algorithms&lt;/em&gt; (2nd ed.), SIAM 2002. (section 1.9)&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;Here&amp;rsquo;s the test case:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;require&lt;/span&gt; &lt;span class="nv"&gt;math&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;exact-&amp;gt;inexact &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;variance&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="o"&gt;#&lt;/span&gt;&lt;span class="nv"&gt;:bias&lt;/span&gt; &lt;span class="no"&gt;#t&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; 2.5&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;exact-&amp;gt;inexact &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;variance&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;map &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;+ &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="nv"&gt;e10&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;#&lt;/span&gt;&lt;span class="nv"&gt;:bias&lt;/span&gt; &lt;span class="no"&gt;#t&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; 2.5&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Fitting an OLS model in Newlisp</title><link>https://aliquote.org/post/newlisp-ols/</link><pubDate>Sat, 18 Mar 2023 20:55:42 +0100</pubDate><guid>https://aliquote.org/post/newlisp-ols/</guid><description>&lt;p&gt;Yet a new post on Newlisp for statistical computing. This time we will try to fit a simple linear regression model using the GSL facilities offered by Newlisp modules. Unfortunately, the FFI bindings are rather sparse, and only a few linear algebra functions are implemented. Since the QR decomposition is available, we will use it, as we did in an &lt;a href="https://aliquote.org/post/lisp-qr-regression/"&gt;another post&lt;/a&gt;. Recall that the vector of estimated parameters can be computed as $R^{-1}Q^Ty$, where $Rx = \bar y$, $y$ is rotated as $\bar y = Q^Ty$ and $R$ is triangular.&lt;/p&gt;
&lt;p&gt;Same example &lt;a href="https://aliquote.org/post/newlisp-plotting"&gt;as before&lt;/a&gt; (Hosmer &amp;amp; Lemeshow&amp;rsquo;s birth weight dataset), where we are interested in regressing the baby weights (g) onto mother&amp;rsquo;s age (years).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;module&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;gsl.lsp&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;define&lt;/span&gt; &lt;span class="nv"&gt;zip&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;lambda&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="nv"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt; &lt;span class="nc"&gt;list&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="nv"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;data&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;read-file&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;/home/chl/tmp/birthwt.csv&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;,&amp;#34;&lt;/span&gt; &lt;span class="nv"&gt;data&lt;/span&gt; &lt;span class="s"&gt;&amp;#34; &amp;#34;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;values&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt; &lt;span class="nv"&gt;int&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;parse&lt;/span&gt; &lt;span class="nv"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;x&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;rest&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;select&lt;/span&gt; &lt;span class="nf"&gt;values&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;sequence&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;length&lt;/span&gt; &lt;span class="nf"&gt;values&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;y&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;rest&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;select&lt;/span&gt; &lt;span class="nf"&gt;values&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;sequence&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;length&lt;/span&gt; &lt;span class="nf"&gt;values&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;xs&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;zip&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;series&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;length&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;gsl:QR-solve&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt; &lt;span class="nv"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; (2655,744469705172 12,4297120277146)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Great! Compare to the built-in function:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;module&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;stat.lsp&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;stat:regression&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="nv"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; (2655,744469705173 12,42971202771453)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;yhat&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;stat:fit&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="nv"&gt;y&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;out&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;zip&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;zip&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="nv"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;yhat&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;write-file&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;/home/chl/tmp/lbw_fit.dat&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;stat:list2ascii&lt;/span&gt; &lt;span class="nv"&gt;out&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;At this point, I&amp;rsquo;m afraid there&amp;rsquo;s not much we can do to go forward since the stat module does not offer a way to build a regression or ANOVA table.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ sed -i -e &lt;span class="s1"&gt;&amp;#39;s/(//g&amp;#39;&lt;/span&gt; -e &lt;span class="s1"&gt;&amp;#39;s/)//g&amp;#39;&lt;/span&gt; -e &lt;span class="s1"&gt;&amp;#39;s/,/./&amp;#39;&lt;/span&gt; lbw_fit.dat
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ gnuplot -p -e &lt;span class="s2"&gt;&amp;#34;set terminal png size 800, 600; set output &amp;#39;~/tmp/lbw_fit.png&amp;#39;; \
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; set grid; set xlabel &amp;#39;Mother age (yr.)&amp;#39;; set ylabel &amp;#39;Baby weight (g)&amp;#39;; \
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; plot &amp;#39;lbw_fit.dat&amp;#39; u 1:2 w p pt 6 notitle, \
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; &amp;#39;lbw_fit.dat&amp;#39; u 1:3 w l lc rgb &amp;#39;black&amp;#39; lw 2 notitle&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/lbw_fit.png"&gt;
&lt;/figure&gt;
&lt;p&gt;By the way, Gnuplot itself is able to fit a linear regression from raw data. Finally, here are Stata&amp;rsquo;s results for reference:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;. import delimited /home/chl/tmp/birthwt.csv
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;. regress bwt age
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Source | SS df MS Number of obs = 189
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;-------------+------------------------------ F( 1, 187) = 1.54
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Model | 815483.22 1 815483.22 Prob &amp;gt; F = 0.2165
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Residual | 99154172.6 187 530236.217 R-squared = 0.0082
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;-------------+------------------------------ Adj R-squared = 0.0029
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Total | 99969655.8 188 531753.488 Root MSE = 728.17
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;------------------------------------------------------------------------------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; bwt | Coef. Std. Err. t P&amp;gt;|t| [95% Conf. Interval]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;-------------+----------------------------------------------------------------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; age | 12.42971 10.02278 1.24 0.216 -7.342539 32.20196
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; _cons | 2655.744 238.8571 11.12 0.000 2184.544 3126.945
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;------------------------------------------------------------------------------
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Rebound • &lt;em&gt;Sebadoh&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Plotting with Newlisp</title><link>https://aliquote.org/post/newlisp-plotting/</link><pubDate>Thu, 16 Mar 2023 14:57:46 +0100</pubDate><guid>https://aliquote.org/post/newlisp-plotting/</guid><description>&lt;p&gt;I installed newlisp manually, although I now realize there&amp;rsquo;s a deb package available for Ubuntu 22.04. Anyway, I was missing two files: &lt;code&gt;guiserver.lsp&lt;/code&gt; and &lt;code&gt;guiserver.jar&lt;/code&gt;. The Lisp file is easy to get from the &lt;a href="http://www.newlisp.org/modules/"&gt;modules&lt;/a&gt; page, and I just copied it to the right place (&lt;code&gt;/usr/local/share/newlisp&lt;/code&gt;) but I found no indication on how to get the Java file. So I grabbed a copy of &lt;code&gt;guiserver.jar&lt;/code&gt; from the guiserver.tgz tarball referenced on &lt;a href="http://www.newlisp.org/index.cgi?Code_Contributions"&gt;Links and Code Contributions&lt;/a&gt;, and it just works. Note that I also had to install &lt;code&gt;libcanberra-gtk-module&lt;/code&gt; along the way, in order to remove a minor warning when issuing plotting commands.&lt;/p&gt;
&lt;p&gt;The statitstics module only contains very basic stuff, but there&amp;rsquo;s also a gsl module which gives us more power. Unfortunately, it expects GSL library in &lt;code&gt;/usr/local/lib&lt;/code&gt;, and not &lt;code&gt;/usr/lib&lt;/code&gt;. I symlinked &lt;code&gt;libgslcblas.so&lt;/code&gt; and &lt;code&gt;libgsl.so&lt;/code&gt; into &lt;code&gt;/usr/local/lib&lt;/code&gt;, and this solved the problem.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s get &lt;a href="https://aliquote.org/pub/birthwt.csv"&gt;some data&lt;/a&gt;:&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;load&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;env&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;NEWLISPDIR&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;/modules/plot.lsp&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;data&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;read-file&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;birthwt.csv&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;,&amp;#34;&lt;/span&gt; &lt;span class="nv"&gt;data&lt;/span&gt; &lt;span class="s"&gt;&amp;#34; &amp;#34;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;values&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt; &lt;span class="nv"&gt;int&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;parse&lt;/span&gt; &lt;span class="nv"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;x&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;rest&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;select&lt;/span&gt; &lt;span class="nf"&gt;values&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;sequence&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;length&lt;/span&gt; &lt;span class="nf"&gt;values&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;y&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;rest&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;select&lt;/span&gt; &lt;span class="nf"&gt;values&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;sequence&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;length&lt;/span&gt; &lt;span class="nf"&gt;values&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;x&lt;/code&gt; and &lt;code&gt;y&lt;/code&gt; variable defined above represent the weight of the mother and of the baby, respectively. There might be a better way to mine those values from the tabular dataset, but contrary to xlispstat, newlisp isn&amp;rsquo;t really a col-major language. Anyway, we are ready to generate a basic scatterplot:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;plot:title&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;Birthweight dataset&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;plot:sub-title&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;Hosmer &amp;amp; Lemeshow, Wiley 2000 (2nd ed.)&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;plot:unit-x&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;Mother weight (lbs)&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;plot:unit-y&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;Baby weight (g)&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;plot:XY&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="nv"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;plot:export&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;fig-bwt-newlisp.png&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/fig-bwt-newlisp.png"&gt;
&lt;/figure&gt;
&lt;p&gt;That was quite easy, but I fear there&amp;rsquo;s not much plotting functions available except &lt;code&gt;plot&lt;/code&gt;, which produces univariate line plot. I guess we will have to resort to Gnuplot or plotutils for more capabilities. However, let that not stop us investigate into this scripting language. In future posts, I expect to show how to fit basic linear models using GSL and to perform some data mining tasks.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Ray Mantilla • &lt;em&gt;Martinez&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;The birthwt dataset is described &lt;a href="https://aliquote.org/post/hmisc-and-rms/"&gt;here&lt;/a&gt;.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Wilcoxon test in Lisp</title><link>https://aliquote.org/post/wilcoxon-test-in-lisp/</link><pubDate>Tue, 14 Mar 2023 18:33:21 +0100</pubDate><guid>https://aliquote.org/post/wilcoxon-test-in-lisp/</guid><description>&lt;p&gt;As a sequel of this previous post, &lt;a href="https://aliquote.org/post/mann-whitney/"&gt;Mann Whitney test&lt;/a&gt;, let&amp;rsquo;s revisit the Wilcoxon-Mann-Whitney test for independent samples. In the case of paired samples, it amounts to a one-sample test, as is the case of Student t-test, since we can simply consider the signed difference between the two series of observations. The only difference with the parametric approach is that we will work with the rank of each observation, rather their raw value.&lt;/p&gt;
&lt;p&gt;Unfortunately, there&amp;rsquo;s almost zero standard function for classical test of hypothesis in LispStat. Most of user-friendly statistical routines were implemented separately for the &lt;a href="https://www.visualstats.org/"&gt;Vista&lt;/a&gt; or &lt;a href="https://www.stat.umn.edu/arc/"&gt;Arc&lt;/a&gt; statistical packages. There once was a dedicated repository for xlispstat on the UCLA server, but now there&amp;rsquo;s only the CMU library of code which contains LispStat-related routines (when their server is not down). So let us roll our own routine.&lt;/p&gt;
&lt;p&gt;Regarding the Wilcoxon family of non-parametric tests, the subtleties are mainly about handling tied values, and using an approximate or exact distribution, which also means dealing with continuity correction. Note that Stata, SPSS, SAS, or Mathematica, as far as I can tell, do not offer continuity correction.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;LispStat has a &lt;code&gt;rank&lt;/code&gt; function, but unfortunately it does not compute the average rank in case of ties. Here is an improved version which return average rank for ties: (Note that rank indexing start at 1 and not 0 as in LispStat&amp;rsquo;s &lt;code&gt;rank&lt;/code&gt;.)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defun&lt;/span&gt; &lt;span class="nv"&gt;rank2&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let*&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nv"&gt;rs&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;rank&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;dotimes&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;length&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;length&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;which&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;nth&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;setf&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;select&lt;/span&gt; &lt;span class="nv"&gt;rs&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;which&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;nth&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;repeat&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;mean&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;select&lt;/span&gt; &lt;span class="nv"&gt;rs&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;which&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;nth&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;length&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;which&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;nth&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)))))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;rs&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;setf&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;rank2&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; (1 2.5 5 4 2.5 6)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;There&amp;rsquo;s more than one way to report results from a Wilcoxon-Mann-Whitney, and the test statistic is usually labelled either as U (SPSS &amp;amp; Co.) or W (R), statistic (Python) or TestStatistic (Mathematica), or directly as a standard normal quantile ($z$, in Stata). Even the definition of the test itself (Wilcoxon rank sum or Mann-Whitney test) is not clear, as noted in the R on-line help for &lt;code&gt;wilcox.test&lt;/code&gt;. Similar comments are made in Stata manuals, or by the author of the Haskell&amp;rsquo;s &lt;a href="https://hackage.haskell.org/package/statistics"&gt;statistics&lt;/a&gt; package.&lt;/p&gt;
&lt;p&gt;Hence, it may happen that only the sum of ranks is reported, or the sum of ranks minus a correction factor ($n_{\star}(n_{\star}+1)/2$, where $\star$ denotes the index for the first or second group&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;), which is the case of the first two naming schemes (although, technically, U is the shifted version of the test statistic), while the $z$ value refers to the standardized test statistic that follows a normal distribution.&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt; Assuming $n_1 &amp;lt; n_2$, we define $W_R$ the sum of the ranks assigned to the $n_1$ observations in the first sample. Critical values for this statistic for small $n$ can be used.&lt;sup id="fnref:4"&gt;&lt;a href="#fn:4" class="footnote-ref" role="doc-noteref"&gt;4&lt;/a&gt;&lt;/sup&gt; When $\text{min}(n_1, n_2) &amp;gt; 10$, we use the following Gaussian approximation:&lt;/p&gt;
&lt;p&gt;$$ Z = \frac{W_R-\mu_{W_R}}{\sigma_{W_R}}, $$&lt;/p&gt;
&lt;p&gt;where $\mu_{W_R} = \frac{n_1(n+1)}{2}$ and $\sigma_{W_R} = \sqrt{\frac{n_1n_2(n+1)}{12}}$ ($n = n_1+n_2$). The formula for the variance is only valid in the case of large samples, though. A corrected estimate, based on Fisher&amp;rsquo;s randomization principles, is $\sqrt{n_1n_2s^2/n}$ with $s=\frac{1}{n-1}\sum_{i=1}^n(r_i - \bar r)^2$, which remains valid even in case of tied ranks, see the Stata [R] manual.&lt;/p&gt;
&lt;p&gt;For this illustration, we will compute the Mann-Whitney test statistic as follows. This mostly follows the R&amp;rsquo;s way since I got lost with Stata&amp;rsquo;s formula:&lt;sup id="fnref:5"&gt;&lt;a href="#fn:5" class="footnote-ref" role="doc-noteref"&gt;5&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defun&lt;/span&gt; &lt;span class="nv"&gt;duplicates&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;;; https://stackoverflow.com/a/65788371&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;endp&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;count&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;count-if&lt;/span&gt; &lt;span class="nf"&gt;#&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;lambda&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;eql&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;car&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;cons&lt;/span&gt; &lt;span class="nf"&gt;count&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;duplicates&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;nthcdr&lt;/span&gt; &lt;span class="nf"&gt;count&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;))))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defun&lt;/span&gt; &lt;span class="nv"&gt;wilcoxon-test&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let*&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nv"&gt;n1&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;length&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;nth&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="nv"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;n2&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;length&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;nth&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="nv"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;+&lt;/span&gt; &lt;span class="nv"&gt;n1&lt;/span&gt; &lt;span class="nv"&gt;n2&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;rs&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;rank2&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;combine&lt;/span&gt; &lt;span class="nv"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;nties&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;duplicates&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;combine&lt;/span&gt; &lt;span class="nv"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;w&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;z&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;p&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;setf&lt;/span&gt; &lt;span class="nv"&gt;tobs&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;sum&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;select&lt;/span&gt; &lt;span class="nv"&gt;rs&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;iseq&lt;/span&gt; &lt;span class="nv"&gt;n1&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;setf&lt;/span&gt; &lt;span class="nv"&gt;w&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;-&lt;/span&gt; &lt;span class="nv"&gt;tobs&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;*&lt;/span&gt; &lt;span class="nv"&gt;n1&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;1+&lt;/span&gt; &lt;span class="nv"&gt;n1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;setf&lt;/span&gt; &lt;span class="nv"&gt;mu&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;*&lt;/span&gt; &lt;span class="nv"&gt;n1&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;/&lt;/span&gt; &lt;span class="nv"&gt;n2&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;setf&lt;/span&gt; &lt;span class="nv"&gt;sigma&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;sqrt&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;*&lt;/span&gt; &lt;span class="nv"&gt;n1&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;/&lt;/span&gt; &lt;span class="nv"&gt;n2&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;+&lt;/span&gt; &lt;span class="nv"&gt;n1&lt;/span&gt; &lt;span class="nv"&gt;n2&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;sum&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;mapcar&lt;/span&gt; &lt;span class="nf"&gt;#&amp;#39;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;^&lt;/span&gt; &lt;span class="nv"&gt;nties&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;nties&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;+&lt;/span&gt; &lt;span class="nv"&gt;n1&lt;/span&gt; &lt;span class="nv"&gt;n2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;+&lt;/span&gt; &lt;span class="nv"&gt;n1&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;-&lt;/span&gt; &lt;span class="nv"&gt;n2&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))))))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;setf&lt;/span&gt; &lt;span class="nv"&gt;z&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;-&lt;/span&gt; &lt;span class="nv"&gt;w&lt;/span&gt; &lt;span class="nv"&gt;mu&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;sigma&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;setf&lt;/span&gt; &lt;span class="nv"&gt;p&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;normal-cdf&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;abs&lt;/span&gt; &lt;span class="nv"&gt;z&lt;/span&gt;&lt;span class="p"&gt;)))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;list&lt;/span&gt; &lt;span class="nv"&gt;w&lt;/span&gt; &lt;span class="nv"&gt;z&lt;/span&gt; &lt;span class="nv"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note that we do adjust the estimate of variance for the case of tied ranks, as does R or as described on &lt;a href="https://en.wikipedia.org/wiki/Mann%E2%80%93Whitney_U_test#Normal_approximation_and_tie_correction"&gt;Wikipedia&lt;/a&gt;, which in this case implies using a different formula for $\mu_{W_R}$ ($\frac{n_1n_2}{2}$). However, if there&amp;rsquo;s no tied values, &lt;code&gt;nties&lt;/code&gt; contains only 1&amp;rsquo;s values and &lt;code&gt;(sum (mapcar #'- (^ nties 3) nties))&lt;/code&gt; = 0, which means the correction term has no effect and $\sigma = \sqrt{n_1n_2/12 \times (n_1+n_2-1)}. The rest msotly agrees with R intermediate computation.&lt;sup id="fnref:6"&gt;&lt;a href="#fn:6" class="footnote-ref" role="doc-noteref"&gt;6&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s test this implementation using an example taken from R. The two series shown below summarize permeability constants of the human chorioamnion (a placental membrane) at term (x) and between 12 to 26 weeks gestational age (y). The alternative of interest is greater permeability of the human chorioamnion for the term pregnancy (Hollander &amp;amp; Wolfe (1973), 69f.). For simplicity, and because we only implemented a bilateral test, we will consider a two-sided p-value:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;setf&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.80&lt;/span&gt; &lt;span class="mf"&gt;0.83&lt;/span&gt; &lt;span class="mf"&gt;1.89&lt;/span&gt; &lt;span class="mf"&gt;1.04&lt;/span&gt; &lt;span class="mf"&gt;1.45&lt;/span&gt; &lt;span class="mf"&gt;1.38&lt;/span&gt; &lt;span class="mf"&gt;1.91&lt;/span&gt; &lt;span class="mf"&gt;1.64&lt;/span&gt; &lt;span class="mf"&gt;0.73&lt;/span&gt; &lt;span class="mf"&gt;1.46&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;setf&lt;/span&gt; &lt;span class="nv"&gt;y&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;1.15&lt;/span&gt; &lt;span class="mf"&gt;0.88&lt;/span&gt; &lt;span class="mf"&gt;0.90&lt;/span&gt; &lt;span class="mf"&gt;0.74&lt;/span&gt; &lt;span class="mf"&gt;1.21&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;; (sum (first-n (length x) (rank2 (combine x y))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;sum&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;select&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;rank2&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;combine&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="nv"&gt;y&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;iseq&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;length&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; 90&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;wilcoxon-test&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;list&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="nv"&gt;y&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; (35 1.224744871391589 0.22067136191984682)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/fig-mann-whitney-hollander.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Here are the results I got for the same dataset with other statistical packages, using default parameters:&lt;/p&gt;
&lt;small&gt;
&lt;table border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;Software&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;&lt;em&gt;Test statistic&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;&lt;em&gt;P-value&lt;/em&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;R&lt;/td&gt;&lt;td&gt;35&lt;/td&gt;&lt;td&gt;0.2544&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Python&lt;/td&gt;&lt;td&gt;35&lt;/td&gt;&lt;td&gt;0.2544&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Stata&lt;/td&gt;&lt;td&gt;1.225&lt;/td&gt;&lt;td&gt;0.2207&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Mathematica&lt;/td&gt;&lt;td&gt;35&lt;/td&gt;&lt;td&gt;0.2446&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/small&gt;
&lt;p&gt;As a final remark, the Wilcoxon-Mann-Whitney is technically a permutation test, at least in the case of not too large sample size, as we&amp;rsquo;ve seen above. This means it is valid only when all the rearrangements of the data are equally likely under the null. When the variances differ, the test is no longer a test for the difference in location, strictly speaking.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Adele • &lt;em&gt;All Night Parking&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Stata does offer a continuity correction for the median test, though.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;Once you determined the sum of ranks in one group, you get the sum of ranks for the other group since the sum of all ranks equals $N(N+1)/2$, with $N=n_1+n_2$, so it doesn&amp;rsquo;t really matter which group we base our calculation upon (usually, we take the first or the smallest in size).&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:3"&gt;
&lt;p&gt;Indrayan, A. and Malhotra, R.K., &lt;em&gt;Medical Biostatistics&lt;/em&gt; (4th ed.), CRC Press, 2018.&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:4"&gt;
&lt;p&gt;Wilcoxon, F., and Wilcox, R.A., Some Rapid Approximate Statistical Procedures, Lederle Laboratories, 1964.&amp;#160;&lt;a href="#fnref:4" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:5"&gt;
&lt;p&gt;If I read the formulae correctly, this should work:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(setf mu (/ (* n1 (1+ n)) 2))
(setf ss (standard-deviation rs))
(setf sigma (sqrt (/ (* n1 n2 (* ss ss)) n)))
(setf z (/ (- tobs mu) sigma))
&lt;/code&gt;&lt;/pre&gt;
&amp;#160;&lt;a href="#fnref:5" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/li&gt;
&lt;li id="fn:6"&gt;
&lt;p&gt;We see that $W_X = 3 + 4 + 14 + 7 + 11 + 10 + 15 + 13 + 1 + 12 = 90 $. The sum of all ranks equals 120. Inspecting the relevant R code for &lt;code&gt;wilcox.test&lt;/code&gt;,&lt;sup id="fnref:7"&gt;&lt;a href="#fn:7" class="footnote-ref" role="doc-noteref"&gt;7&lt;/a&gt;&lt;/sup&gt; it is clear that they use the corrected statistic $W_X - n_X(n_X+1)/2$, hence $W = 90 - 10\times 11/2 = 35 $ ($10\times 11/2$ is the sum of ranks we would get for $X$ should we compute rank separately in $X$ and $Y$).&amp;#160;&lt;a href="#fnref:6" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:7"&gt;
&lt;p&gt;R code from &lt;code&gt;getAnywhere(wilcox.test.default)&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;--8&amp;lt;--------
r &amp;lt;- c(x - mu, y)
r &amp;lt;- rank(if (is.finite(digits.rank))
signif(r, digits.rank)
else r)
n.x &amp;lt;- as.double(length(x))
n.y &amp;lt;- as.double(length(y))
if (is.null(exact))
exact &amp;lt;- (n.x &amp;lt; 50) &amp;amp;&amp;amp; (n.y &amp;lt; 50)
STATISTIC &amp;lt;- c(W = sum(r[seq_along(x)]) - n.x * (n.x +
1)/2)
--------&amp;gt;8--
&lt;/code&gt;&lt;/pre&gt;
&amp;#160;&lt;a href="#fnref:7" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Generating variable names in Lispstat</title><link>https://aliquote.org/post/xlisp-arange/</link><pubDate>Thu, 02 Mar 2023 10:04:01 +0100</pubDate><guid>https://aliquote.org/post/xlisp-arange/</guid><description>&lt;p&gt;For a side-project I went back into Lispstat, which was developed in the 90s, to perform basic biostatistical analysis. At that time, there was no such thing like a data frame, but only data arrays composed of numerical values thta could be imported from a space delimited text file. Usually, you &amp;ldquo;selected&amp;rdquo; the variables you were interested in one at a time. Assuming you have two series of values (i.e., two variables), you can split a response variable by a grouping factor like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;def&lt;/span&gt; &lt;span class="nv"&gt;geno1&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;select&lt;/span&gt; &lt;span class="nv"&gt;age&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;which&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="nv"&gt;genotype&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;def&lt;/span&gt; &lt;span class="nv"&gt;geno2&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;select&lt;/span&gt; &lt;span class="nv"&gt;age&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;which&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="nv"&gt;genotype&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;def&lt;/span&gt; &lt;span class="nv"&gt;geno3&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;select&lt;/span&gt; &lt;span class="nv"&gt;age&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;which&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="nv"&gt;genotype&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I often use a loop to generate variable name with a common prefix or suffix. In R it is easily done using a &lt;code&gt;for&lt;/code&gt; loop and &lt;code&gt;assign&lt;/code&gt; (see &lt;a href="https://stackoverflow.com/a/9565095"&gt;this example&lt;/a&gt;), while in Stata it can be done in a &lt;code&gt;forvalues&lt;/code&gt; or &lt;code&gt;foreach&lt;/code&gt; construct. Here is an example from my &lt;a href="https://aliquote.org/articles/stata-sk/"&gt;Stata Starter Kit&lt;/a&gt; (draft):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;xtile&lt;/span&gt; &lt;span class="n"&gt;weightc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;weight&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;nq&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;quietly&lt;/span&gt; &lt;span class="n"&gt;tabulate&lt;/span&gt; &lt;span class="n"&gt;weightc&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;gen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;weightc&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;drop&lt;/span&gt; &lt;span class="n"&gt;weightc&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;local&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;foreach&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;varlist&lt;/span&gt; &lt;span class="n"&gt;weightc1&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;weightc4&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;local&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="err"&gt;`&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39; + 1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;rename&lt;/span&gt; &lt;span class="err"&gt;`&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39; w`i&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;list&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Lispstat was built on the XLISP dialect of Lisp, which means it is mostly the same as Common Lisp except that something are missing here and there, most notably the &lt;code&gt;loop&lt;/code&gt; macro. There are several constructs available for iterating over a range or a list, like &lt;code&gt;do&lt;/code&gt;, &lt;code&gt;dotimes&lt;/code&gt; and &lt;code&gt;dolist&lt;/code&gt;. Since we cannot use &lt;code&gt;dotimes&lt;/code&gt; to iterate over a sequence starting at a value other than zero,&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; let&amp;rsquo;s try with &lt;code&gt;dolist&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;dolist&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;iseq&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;intern&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;concatenate&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;string&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;GENO&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;write-to-string&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;select&lt;/span&gt; &lt;span class="nv"&gt;age&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;which&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="nv"&gt;genotype&lt;/span&gt;&lt;span class="p"&gt;)))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;small&gt;Dont&amp;rsquo; forget that variables are represented internally as uppercase symbol, so even if you call your variable &lt;code&gt;geno1&lt;/code&gt; at the prompt or in an expression, it really is &lt;code&gt;GENO1&lt;/code&gt; in the environment.&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;It is a little more verbose than the previous expressions, but once converted to a macro, it can be reused many times.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Arcade Fire • &lt;em&gt;Rebellion&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;In Common Lisp, we can write a &lt;a href="https://stackoverflow.com/a/72355135"&gt;little macro&lt;/a&gt; for that purpose, but it requires using &lt;code&gt;loop&lt;/code&gt;.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Mono color scheme for tty</title><link>https://aliquote.org/post/monochromatic-theme/</link><pubDate>Wed, 01 Mar 2023 09:20:22 +0100</pubDate><guid>https://aliquote.org/post/monochromatic-theme/</guid><description>&lt;p&gt;I already discussed the use of &lt;a href="post/monochrome-color-scheme/"&gt;monochrome color scheme&lt;/a&gt; in the past. The main benefit for me has been to avoid the &amp;ldquo;christmas tree&amp;rdquo; effect&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; in my text editor (Neovim), but see &lt;a href="https://aliquote.org/post/on-color-scheme/"&gt;On choosing your colorscheme&lt;/a&gt;. Such minimalist settings helps me focus on the task at hand, while while maintaining high portability depending on the capabilities of the machines I work on (macOS and OpenBSD sometimes, ssh access to computing servers most of the time).&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2024-09-02]&lt;/small&gt;&lt;br&gt;
See also &lt;a href="https://oppi.li/posts/color_conundrum/"&gt;Color Conundrum&lt;/a&gt; by Akshay who made a good point here: &amp;ldquo;Imagine highlighting an entire book because all of it is important.&amp;rdquo;
&lt;/div&gt;
&lt;p&gt;I use Zsh as my main shell, but sometimes I also use Bash. I keep a minimal &lt;code&gt;bashrc&lt;/code&gt; config file in case I need to use my default settings on a remote server, and I have the following settings in my &lt;code&gt;.bashrc&lt;/code&gt;, which I mostly use on virtual consoles or when connected via ssh:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$XDG_SESSION_TYPE&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;tty&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;unset&lt;/span&gt; LS_COLORS
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;TERM&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;xterm-mono
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;NO_COLOR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;alias&lt;/span&gt; &lt;span class="nv"&gt;ll&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;ls -alF&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;alias&lt;/span&gt; &lt;span class="nv"&gt;vim&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;nvim -c &amp;#34;:set notermguicolors&amp;#34; -c &amp;#34;:colorscheme mono&amp;#34;&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;PS1&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;\W \$ &amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;else&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;eval&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;starship init bash&lt;span class="k"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As can be seen, if we are connected via ssh or a simple tty, we&amp;rsquo;ll be disabling most of the fuzz defined elsewhere to prettify the prompt, using &lt;a href="https://the.exa.website/"&gt;exa&lt;/a&gt; for nice listing, etc. I also use these settings for running a terminal inside Neovim, for example.&lt;/p&gt;
&lt;p&gt;Regarding other TUIs, I have chosen color schemes that can accommodate black &amp;amp; white screen either by using few colors (Tmux or Irssi) or by defining mono color (Neomutt). The &amp;ldquo;mono&amp;rdquo; colorscheme for Vim is inspired by Joshua Stein &lt;a href="https://github.com/jcs/dotfiles/blob/master/.vim/colors/jcs.vim"&gt;own color scheme&lt;/a&gt;,&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; who also authored the &lt;a href="https://no-color.org/"&gt;NO_COLOR&lt;/a&gt; site. Here is my default theme (left) and the mono theme (right) when editing this post:&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2023-02-28-20-42-10.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2023-02-28-20-42-10.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2023-02-28-20-43-57.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2023-02-28-20-43-57.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Overall I quite like working on a virtual console, especially since I can still listen to music running on Cmus in a regular X session, so here is a screenshot of the same editing session on a virtual console:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/tty3.png"&gt;
&lt;/figure&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Dave Gahan &amp;amp; Soulsavers • &lt;em&gt;Metal Heart&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Nicolas P. Rougier. &lt;a href="https://arxiv.org/abs/2008.06030"&gt;On the design of text editors&lt;/a&gt;. arXiv:2008.06030 [cs.HC], 2020.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;Basically, I just removed the underline attribute for most text elements.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in February</title><link>https://aliquote.org/post/micro-02-2023/</link><pubDate>Tue, 28 Feb 2023 09:07:58 +0100</pubDate><guid>https://aliquote.org/post/micro-02-2023/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-02-06&lt;/a&gt;: Best way to learn about recent (non-breaking) changes in &lt;a href="https://ggplot2.tidyverse.org/"&gt;ggplot2&lt;/a&gt; is to rerun your old R code. Now I know that :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mysql" data-lang="mysql"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;Using&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;`&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="o"&gt;`&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;aesthetic&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;lines&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;was&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;deprecated&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ggplot2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Please&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;use&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;`&lt;/span&gt;&lt;span class="n"&gt;linewidth&lt;/span&gt;&lt;span class="o"&gt;`&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;instead&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;The&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;`&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;scale&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;`&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;argument&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;of&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;`&lt;/span&gt;&lt;span class="nf"&gt;guides&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;`&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;cannot&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;be&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;`&lt;/span&gt;&lt;span class="no"&gt;FALSE&lt;/span&gt;&lt;span class="o"&gt;`&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;Use&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;none&amp;#34;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;instead&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;as&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;of&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ggplot2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Other than that, I found that the &lt;code&gt;theme_minimal()&lt;/code&gt; is as good as the &lt;code&gt;hrbrthemes:theme_ipsum&lt;/code&gt;. Less dependencies, clear and elegant graphical output.&lt;br&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-02-07&lt;/a&gt;: I just made my GH &lt;a href="https://github.com/even4void/biostats"&gt;biostats&lt;/a&gt; public, just so you know how I like playing with translating R code to other languages, without any hope of finishing this new side project anytime soon. Details in this longer &lt;a href="https://aliquote.org/post/biostatistical-methods/"&gt;blog post&lt;/a&gt;. Want some crazy plots? Go to the &lt;code&gt;figs&lt;/code&gt; directory in each language and compare the output. Be aware this is highly work-in-progress, as advertised on the GH repo, and there are many bugs lying around. Anyway, no more raw Matplotlib for me, I felt in love with &lt;a href="https://aliquote.org/post/python-plotnine/"&gt;plotnine&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-02-07&lt;/a&gt;: ♪ Sheri Weldon · A Taste Of Honey&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-02-08&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The GIL is a major obstacle to concurrency. For scientific computing tasks, this lack of concurrency is often a bigger issue than speed of executing Python code, since most of the processor cycles are spent in optimized CPU or GPU kernels. The GIL introduces a global bottleneck that can prevent other threads from making progress if they call any Python code. There are existing ways to enable parallelism in CPython today, but those techniques come with significant limitations (see Alternatives). &amp;mdash; &lt;a href="https://peps.python.org/pep-0703/"&gt;PEP 703 – Making the Global Interpreter Lock Optional in CPython&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-02-08&lt;/a&gt;: I&amp;rsquo;ve been following Darren Wilkinson&amp;rsquo;s work for a long time now, and even if I&amp;rsquo;m not really interested in Scala I keep checking his blog and GitHub from time to time. He just released a course on functional programming for scientific computing, available at GH. Go check his blog to learn more: &lt;a href="https://darrenjw.wordpress.com/2023/02/04/an-introduction-to-functional-programming-for-scalable-statistical-computing-and-machine-learning/"&gt;An introduction to functional programming for scalable statistical computing and machine learning&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-02-08&lt;/a&gt;: &lt;a href="https://borretti.me/article/shells-are-two-things"&gt;Shells are Two Things&lt;/a&gt;. The Python scripting example reminds me of a blog post written by Mathias Fußenegger who uses Haskell in interpreted mode as one of his scripting engine (see &lt;a href="https://zignar.net/2021/07/09/why-haskell-became-my-favorite-scripting-language/"&gt;Why Haskell became my favorite scripting language&lt;/a&gt;), even if this totally unrelated to the points raised by Fernando Borretti.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-02-11&lt;/a&gt;: Made with ♡ using Stata. See this &lt;a href="https://aliquote.org/post/stata-plot-04/"&gt;blog post&lt;/a&gt; for details.&lt;br&gt;&lt;img src="https://aliquote.org/img/fig-01-06-v2.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-02-13&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Perhaps I’m on one of my periodic ‘minimalist’ adventures (which would seem to be borne out by my keyboard choice), but Emacs has recently felt a bit much to me, and made me curious about the current state of the art in Neovim. &amp;mdash; &lt;a href="https://www.rousette.org.uk/archives/neovim-again/"&gt;Neovim again&lt;/a&gt;I&amp;rsquo;m also quite happy with my &lt;a href="https://aliquote.org/post/riced-desktop/"&gt;minimal setup&lt;/a&gt; these days. It&amp;rsquo;s been running smoothly for several months now.&lt;br&gt;&lt;img src="https://aliquote.org/img/2023-02-13-10-57-55.png" alt="img"&gt;&lt;small&gt;Alacritty with font ligature support, Tmux, Cmus, Neovim nightly.&lt;/small&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-02-14&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Dear LazyWeb: Setting up a new Mac, what are some groovy new monospace fonts for terminals and IDEs? &amp;mdash; &lt;a href="https://www.tbray.org/ongoing/When/202x/2023/02/09/Monospace"&gt;Modern Mono&lt;/a&gt;I like screenshots. See also &lt;a href="https://justine.lol/dox/unicode.html"&gt;Monospace Acid Test&lt;/a&gt; for a more elaborated overview of modern monospace fonts.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-02-16&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;So basically, I pay a yearly fee to get access to their SDK? Most manufactures provide that to you for free because they really want you to build apps for their platform. &amp;mdash; &lt;a href="https://www.bennettnotes.com/notes/why-does-apple-restrict-hobby-development/"&gt;Apple doesn’t want you developing hobby apps&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-02-16&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;UNIX contains a number of features very seldom offered even by larger systems. &amp;mdash; &lt;a href="https://doc.cat-v.org/unix/v0/"&gt;Unix Edition Zero&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-02-18&lt;/a&gt;: I recently came across some Racket code on &lt;a href="https://www.reddit.com/r/RacketHomeworks/comments/10e5wih/how_to_implement_a_fenwick_tree/"&gt;Reddit&lt;/a&gt; that implements Fenwick trees, aka binary indexed trees (BIT). Fenwick&amp;rsquo;s article, which is not the original paper on that particular data structure, &lt;a href="https://static.aminer.org/pdf/PDF/001/073/976/a_new_data_structure_for_cumulative_frequency_tables.pdf"&gt;A New Data Structure for Cumulative Frequency Tables&lt;/a&gt; (PDF) explains all the details, but there&amp;rsquo;s also a &lt;a href="https://robert1003.github.io/2020/01/27/fenwick-tree.html"&gt;nice tutorial&lt;/a&gt;, as well as some &lt;a href="https://cp-algorithms.com/data_structures/fenwick.html#one-based-indexing-approach"&gt;applications&lt;/a&gt; for competitive programming.&lt;/p&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-02-20&lt;/a&gt;: The highest upvotes I got on Cross Validated is for a quick reply where I mentioned the Gifi &amp;ldquo;nom de plume&amp;rdquo;, which I miss a lot. Enjoy your &amp;ldquo;unfinished&amp;rdquo; retirement, Mr./Dr. &lt;a href="https://en.wikipedia.org/wiki/Jan_de_Leeuw"&gt;Jan de Leeuw&lt;/a&gt;, and happy &lt;a href="https://aliquote.org/cours/2011_health_measures/03-psychometrics_screen.pdf"&gt;&lt;em&gt;foo&lt;/em&gt;metrics&lt;/a&gt; (PDF)!&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If Foo is a science then Foo often has both an area Foometrics and an area Mathematical Foo. Mathematical Foo applies mathematical modeling to the Foo subject area, while Foometrics develops and studies data analysis techniques for empirical data collected in Foo. Each of the social and behavioural sciences has a form of Foometrics, although they may not all use a name in this family. &amp;mdash; de Leeuw, 2006&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-02-20&lt;/a&gt;: The thing I really appreciate under Ubuntu or OpenBSD compared to macOS is the package manager. So bad Apple decided to move away from the Un*x world. I miss the old good stuff that was lying around there. &lt;code&gt;#apple&lt;/code&gt; &lt;code&gt;#unix&lt;/code&gt;Also, I deleted Apple Music on my iPhone. Thanks for the goodies. Back to listening to ripped CDs!&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-12-27-21-23-26.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-02-20&lt;/a&gt;: ♪ Lou Reed · Lisa Says&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-02-23&lt;/a&gt;: I successfully installed Forge and Controllable for the Minecraft (Java Edition) running on my laptop. Now I can use a PS5 controller to play instead of keyboard shortcuts. Okay, it must be 5 years since I last played, but I&amp;rsquo;m glad to find a game environment close to the PS4. Sadly, I can&amp;rsquo;t play my old PS4 maps on the Java edition, which means I need to create a new one.&lt;br&gt;&lt;img src="https://aliquote.org/img/2023-02-23-12-27-06.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-02-23&lt;/a&gt;: &lt;a href="https://kopia.io/"&gt;Kopia&lt;/a&gt; is ridiculously fast and over-optimized. I don&amp;rsquo;t miss Arq or Borg. I have an hourly schedule for local snapshots, and a weekly sync to an external HD, which never failed me so far.&lt;br&gt;&lt;img src="https://aliquote.org/img/2023-01-31-21-02-18.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-02-23&lt;/a&gt;: ♪ Marianne Faithfull · Crazy Love&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-02-23&lt;/a&gt;: ♪ Memory Tapes · Bicycle&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-02-27&lt;/a&gt;: Each time I take a look at &lt;em&gt;This week in Neovim&lt;/em&gt; (#33 &lt;a href="https://this-week-in-neovim.org/2023/Feb/27"&gt;right there&lt;/a&gt;), I feel like there&amp;rsquo;s so much new stuff published every week that we will get another (M)ELPA for Neovim packages at some point. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-02-27&lt;/a&gt;: I&amp;rsquo;ve been using part of &lt;a href="https://github.com/echasnovski/mini.nvim"&gt;mini.nvim&lt;/a&gt; last year but for now I&amp;rsquo;m just loading the completion module. I noticed there&amp;rsquo;s an increased number of modules developed since last time I checked. I warmly recommend those modules if you want something light, easy to install and to setup. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-02-27&lt;/a&gt;: My IRC bouncer (BNC4FREE) has been down for one week. Time to go back running Irssi in a detached Tmux session on a local server.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-02-27&lt;/a&gt;: &lt;a href="https://tech.marksblogg.com/route-planning-europe-postgresql-pgrouting.html"&gt;European Route Planning&lt;/a&gt;: Clear and elegant use of postgres and shell scripting.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-02-27&lt;/a&gt;: &lt;a href="https://dickbrus.github.io/SpatialSamplingwithR/"&gt;Spatial sampling with R&lt;/a&gt;. Lot of pretty illustrations and good old base R code. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-02-27&lt;/a&gt;: ♪ Washed Out · Amor Fati&lt;br&gt;&lt;/p&gt;</description></item><item><title>February in review</title><link>https://aliquote.org/post/micro-review-023/</link><pubDate>Mon, 27 Feb 2023 08:33:14 +0100</pubDate><guid>https://aliquote.org/post/micro-review-023/</guid><description>&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/iggredible/Learn-Vim"&gt;Learn Vim (the Smart Way)&lt;/a&gt;: Yet another tutorial on using Vim effectively. The author highlights the use of fzf as a fuzzy finder, which further motivates taking advantage of Vim inner features.&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;Everyone programs differently. Upon introspection, you will find that there are one or two features from your favorite editor / IDE that you use all the time. Maybe it was fuzzy-search, jump-to-definition, or quick compilation. Whatever they may be, identify them quickly and learn how to implement those in Vim (chances are Vim can probably do them too). Your editing speed will receive a huge boost.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;It&amp;rsquo;s been a long time since I last read some obfuscated code, and it was always &lt;a href="https://www.ioccc.org/"&gt;C code&lt;/a&gt;. This one does the job, and it is written in Haskell: &lt;a href="https://www.cole-k.com/2023/02/21/tiny-games-hs/"&gt;Squeezing a sokoban game into 10 lines of code&lt;/a&gt;. See also &lt;a href="https://bostick.github.io/blog/2022/05/fizz-buzz/"&gt;How I would do FizzBuzz&lt;/a&gt;, by the author of the LSP ecosystem in Mathematica.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://poste.io/"&gt;poste.io&lt;/a&gt; offers SMTP + IMAP + POP3 + Antispam + Antivirus Web administration + Web email. I know it&amp;rsquo;s a hard job, and I won&amp;rsquo;t host my own mail server, even if Gmail sucks with randomly blacklisting my own email address with error code 550 5.7.26. Anyway, in case someone is looking for a quick way to handle his/her emails from a local computer.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In &lt;a href="https://blog.joren.ga/less-known-c"&gt;Few lesser known tricks, quirks and features of C&lt;/a&gt;, I learned about a fun way to use &lt;a href="https://blog.joren.ga/less-known-c#named-function-parameters"&gt;named parameters&lt;/a&gt; in function call.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://m-clark.github.io/posts/2022-07-25-programming/#coalesceifelse"&gt;Programming Odds &amp;amp; Ends&lt;/a&gt;: There&amp;rsquo;s a lot to learn and keep in mind when using R and/or Python (sadly, there&amp;rsquo;s no real benchmark with Pandas or &lt;a href="https://aliquote.org/post/python-datatable/"&gt;datatable&lt;/a&gt;). And now I know there&amp;rsquo;s something new called the &lt;a href="https://fastverse.github.io/fastverse/"&gt;fastverse&lt;/a&gt;, which includes the &lt;a href="https://github.com/Rdatatable/data.table"&gt;data.table&lt;/a&gt; package. As the author suggests, &amp;ldquo;you may not [always] want an additional package dependency beyond what you’re using, and may need a base R approach.&amp;rdquo;. Keeping it small and low on external dependencies is always good.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://sqliteviz.com/"&gt;sqliteviz&lt;/a&gt;: Instant offline SQL-powered data visualisation in your browser. Looks great. Here&amp;rsquo;s what I came up in a few clicks with our ToothGrowth dataset from previous posts:&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2023-02-27-10-29-02.png"&gt;
&lt;/figure&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Chip Wickham • &lt;em&gt;Sais&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>The unquantified self #27</title><link>https://aliquote.org/post/unquantified-self-027/</link><pubDate>Thu, 23 Feb 2023 20:21:41 +0100</pubDate><guid>https://aliquote.org/post/unquantified-self-027/</guid><description>&lt;p&gt;The last entry in this series was in October, four months ago. Not much has changed, I guess, with the exception of an exceptionally long-lasting and painful fatigue from time to time.&lt;/p&gt;
&lt;p&gt;No more drawing, at least for the time being. I took a few days off to rest and take a break from the daily routine. I watched three movies and I only appreciated one (&lt;a href="https://www.netflix.com/title/81465109"&gt;Jung_e&lt;/a&gt;), sort of. TV shows are still listed on their &lt;a href="https://aliquote.org/articles/movies/"&gt;own page&lt;/a&gt;, but I must admit I haven&amp;rsquo;t found anything very exciting.&lt;/p&gt;
&lt;p&gt;As advertised &lt;a href="https://aliquote.org/micro/2023-02-23-12-12-36/"&gt;recently&lt;/a&gt;, I configured my Minecraft (Java Edition) installation to allow for the use of an USB PS5 controller. This was easier than I originally thought since you just need to install the latest &lt;a href="https://files.minecraftforge.net/net/minecraftforge/forge/"&gt;Forge&lt;/a&gt; for your current version of MC and then the &lt;a href="https://mrcrayfish.com/mods?id=controllable"&gt;Controllable&lt;/a&gt; mod. However, my son who is more versed into PVP needed MC 1.8.9, so I looked for the corresponding version of Forge (1.8.9-forge1.8.9-11.15.1.2318-1.8.9) but I didn&amp;rsquo;t find any relevant version for the controller mod. Hopefully, there&amp;rsquo;s Joypad-Mod-1.8.9.jar which you can find &lt;a href="https://www.9minecraft.net/joypad-mod/"&gt;here&lt;/a&gt;. You will likely need to ensure that the controller is activated and also reconfigure the default settings.&lt;/p&gt;
&lt;p&gt;A screenshot lost in my files follows, which is one of my last screenshots on &lt;a href="https://aliquote.org/post/one-year-scrobbling/"&gt;Last.fm&lt;/a&gt;. I heard about &lt;a href="https://kodi.tv/"&gt;Kodi&lt;/a&gt; but finally I think I&amp;rsquo;m fine with &lt;a href="https://aliquote.org/post/cmus/"&gt;cmus&lt;/a&gt; and &lt;a href="https://mpv.io/"&gt;mpv&lt;/a&gt;, and everything is going well on the music side, I still have to listen to 7-8 hours a day.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2023-01-02-18-44-12.png"&gt;
&lt;/figure&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Active Child • &lt;em&gt;You Are All I See&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Bootstrap t-test</title><link>https://aliquote.org/post/bootstrap-test/</link><pubDate>Wed, 22 Feb 2023 20:55:34 +0100</pubDate><guid>https://aliquote.org/post/bootstrap-test/</guid><description>&lt;p&gt;A few years ago I ran a &lt;a href="https://github.com/even4void/rstats-ssample"&gt;workshop&lt;/a&gt; where I showed how to carry out a simple (bilateral) permutation test in R. Assuming you have a matrix &lt;code&gt;d&lt;/code&gt; with two columns of values, and no missing values, it reads:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;s0&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d[&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="n"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nf"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d[&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="n"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;## observed statistic&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;c&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d[&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="n"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;d[&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="n"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;idx&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;combn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;seq&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;along&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="m"&gt;20&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;## {20 \choose 10}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="kr"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nf"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x[k]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nf"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;k]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;apply&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;## test statistic s&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;pobs&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="nf"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s0&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nf"&gt;length&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Using the &lt;a href="https://cran.r-project.org/web/packages/coin/index.html"&gt;coin&lt;/a&gt; package the same test is done as follows:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;library&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;coin&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;oneway_test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;~&lt;/span&gt; &lt;span class="n"&gt;variable&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;reshape2&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;melt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d[1&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="n"&gt;]&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;alternative&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;two.sided&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;distribution&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;exact&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I also showed how to devise a bootstrap test of hypothesis in R. This time, we need to take care of correctly centering the group means, though:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;x1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="n"&gt;d[&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="n"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nf"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d[&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="n"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;## x is c(d[,1], d[,2])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;x2&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="n"&gt;d[&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="n"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nf"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d[&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="n"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;B&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="m"&gt;999&lt;/span&gt; &lt;span class="c1"&gt;## no. bootstrap samples&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;numeric&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;B&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;## vector of test statistics&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="kr"&gt;in&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;B&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;x1s&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;sample&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;replace&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;TRUE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;x2s&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;sample&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;replace&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;TRUE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;s[i]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x1s&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nf"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x2s&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;pobs&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s0&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;B&lt;/span&gt;&lt;span class="m"&gt;+1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;## s0 is mean(d[,1]) - mean(d[,2])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note that the &lt;code&gt;for&lt;/code&gt; loop can easily be replaced with a function call in a &lt;code&gt;replicate&lt;/code&gt; statement, of course. Here is some results with the ToothGrowth dataset we discussed &lt;a href="https://aliquote.org/post/python-datatable/"&gt;earlier&lt;/a&gt;, which can be prepared as follows:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;data&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ToothGrowth&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;as.data.frame&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;with&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ToothGrowth&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;supp&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="n"&gt;ToothGrowth&lt;/span&gt;&lt;span class="o"&gt;$&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;s0&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d[&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="n"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nf"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d[&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="n"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="m"&gt;-8&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;--&lt;/span&gt; &lt;span class="n"&gt;copy&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;paste&lt;/span&gt; &lt;span class="n"&gt;code&lt;/span&gt; &lt;span class="n"&gt;above&lt;/span&gt; &lt;span class="o"&gt;---&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;pobs&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;[1]&lt;/span&gt; &lt;span class="m"&gt;0.043&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Of course, we could compute confidence normal, percentile or BCA confidence intervals, with little effort. Stata does it &lt;a href="https://www.stata.com/features/overview/bootstrap-sampling-and-estimation/"&gt;smoothly&lt;/a&gt;, as usual:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;. use toothgrowth, clear
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;. bootstrap dobs = (r(mu_1) - r(mu_2)), reps(1000) seed(101): ttest len, by(supp)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;. estat bootstrap, all
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Bootstrap results Number of obs = 60
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Replications = 1000
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; command: ttest len, by(supp)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; diff: r(mu_1) - r(mu_2)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;------------------------------------------------------------------------------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; | Observed Bootstrap
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; | Coef. Bias Std. Err. [95% Conf. Interval]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;-------------+----------------------------------------------------------------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; diff | 3.7 .0643175 1.8568749 .0605921 7.339408 (N)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; | -.0248661 7.282081 (P)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; | -.178198 7.126667 (BC)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;------------------------------------------------------------------------------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;(N) normal confidence interval
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;(P) percentile confidence interval
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;(BC) bias-corrected confidence interval
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;small&gt;You can download the dataset &lt;a href="https://aliquote.org/pub/toothgrowth.dta"&gt;here&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Three Days Grace • &lt;em&gt;I Hate Everything About You&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Python for quick statistical computing</title><link>https://aliquote.org/post/python-boot/</link><pubDate>Tue, 21 Feb 2023 18:58:44 +0100</pubDate><guid>https://aliquote.org/post/python-boot/</guid><description>&lt;p&gt;Python has a lot of base packages that can be used to perform most of our statistical computing tasks. There&amp;rsquo;s a good review of &lt;a href="https://aliquote.org/post/python-getting-functional/"&gt;what&amp;rsquo;s available&lt;/a&gt; when you install Python in &lt;em&gt;Serious Python&lt;/em&gt;, by Julien Danjou (No Starch Press, 2018), and often times you don&amp;rsquo;t really need extra stuff.&lt;/p&gt;
&lt;p&gt;Here are two small illustrations of my wanderings with Python for basic statistical stuff. For a project at work, I needed a quick implementation of bootstrapping. This was just to ensure that the statistic I was computing on the full dataset was reliable enough. I was not interested in drawing confidence intervals or anything more fancy from the bootstrapped statistics. Initially, I tried using the &lt;code&gt;asyncio&lt;/code&gt; module, but finally I ended up using &lt;code&gt;multiprocessing&lt;/code&gt; (see &lt;a href="https://aliquote.org/post/multi-blast/"&gt;Multi-blast and parallel processing&lt;/a&gt; for another use of this module).&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s my code:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;multiprocessing&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;B&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;boot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;multiprocessing&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Pool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;processes&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;multiprocessing&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cpu_count&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;tic&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;numpy&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;loadtxt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;shape&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;idx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;numpy&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;choice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;B&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;boot&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;map&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="n"&gt;foo&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;:]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tolist&lt;/span&gt;&lt;span class="p"&gt;())))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;toc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&amp;gt;&amp;gt;&amp;gt; Elapsed time: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;toc&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;tic&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;.2f&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;s&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;small&gt;Replace &lt;code&gt;{foo}&lt;/code&gt; with the function that returns a statistic of interest.&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;Of course, for serious work you would need to compute 95 or 99% percentiles as well as correct for bias and skewness of the bootstrap distribution (BCA correction).&lt;/p&gt;
&lt;p&gt;Here is another case: a toy implementation of k-fold cross-validation. I know various libraries, including the &lt;a href="https://scikit-learn.org/stable/index.html"&gt;scikit-learn&lt;/a&gt;, offers much more elaborated solution to the design of cross-validated statistics, but this time I was in a hurry and I just needed a quick way to rely on training/test datasets. The basic idea was just to create a partition of my dataset using numpy and a reducing function to rearrange the train and test datasets. At a glance, it looks like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;functools&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;reduce&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;statistics&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;mean&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;numpy&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;np&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;normal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;partition&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;array_split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;partition&lt;/span&gt;&lt;span class="p"&gt;)):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;curr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;partition&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;other&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;concatenate&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;enumerate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;partition&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;curr (&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;) = &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;curr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;, other = &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;other&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Again, there&amp;rsquo;s room for improvement since usually we would first shuffle the data indices before partitioning the array in k sets.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Cinderella • &lt;em&gt;Don&amp;rsquo;t Know What You Got&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Using managed functions in sqlite</title><link>https://aliquote.org/post/sqlite-managed-functions/</link><pubDate>Sun, 19 Feb 2023 10:09:26 +0100</pubDate><guid>https://aliquote.org/post/sqlite-managed-functions/</guid><description>&lt;p&gt;Sqlite comes with a bundle of &lt;a href="https://www.sqlite.org/lang_corefunc.html"&gt;built-in functions&lt;/a&gt; including aggregate functions such as &lt;code&gt;count()&lt;/code&gt;, &lt;code&gt;sum()&lt;/code&gt;,&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; or &lt;code&gt;avg()&lt;/code&gt;. No function to compute standard deviation, though. There are ways to compute the variance in a query directly, and its square root, but hopefully sqlite3 comes with a set of &lt;a href="https://www.sqlite.org/contrib?orderby=date"&gt;extensions&lt;/a&gt; that can be loaded directly into sqlite command. See also &lt;a href="https://www.sqlite.org/src/file/ext/misc"&gt;miscellaneous function&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The following assumes that you already downloaded the &lt;code&gt;extension-functions.c&lt;/code&gt; from the link above file and compiled it as shared library. On Linux, this is as easy as:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;% gcc -g -fPIC -shared extension-functions.c -o extension-functions.so
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here is a toy example:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sql" data-lang="sql"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;sqlite&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;load&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;extension&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;functions&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;sqlite&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;create&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;table&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;data&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;real&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;not&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;sqlite&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;insert&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;into&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;data&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;select&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;as&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;generate_series&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;sqlite&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;select&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;stdev&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;as&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;sd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;data&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;sd&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;----
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;56&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;small&gt;Note that &lt;a href="https://sqlite.org/series.html"&gt;&lt;code&gt;generate_series()&lt;/code&gt;&lt;/a&gt; is already loaded in the command-line shell.&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;How about writing a custom function, e.g. a &lt;code&gt;percentile()&lt;/code&gt; function which would return the percentile rank of an observation in a series of values? There&amp;rsquo;s a two-part series on this topic, which explains the basics: &lt;a href="https://www.openmymind.net/Writing-A-Custom-Sqlite-Function-Part-1/"&gt;Writing a Custom SQLite Function (in C)&lt;/a&gt;. Such functions are known as &lt;a href="https://www.sqlite.org/loadext.html"&gt;Run-Time Loadable Extensions&lt;/a&gt;, and there&amp;rsquo;s some boilerplate C code to get started.&lt;/p&gt;
&lt;p&gt;If you are in a hurry, though, &lt;a href="https://github.com/nalgeon/sqlean"&gt;sqlean&lt;/a&gt; provides a bunch of domain-specific functions.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; In the case of statistical functions, you will find the median, various pre-defined percentile as well as a percentile rank function, Pearson correlation coefficient, as well as sample and population estimate of the variance or the standard deviation, and &lt;a href="https://github.com/nalgeon/sqlean/issues/27#issuecomment-1000902666"&gt;many&lt;/a&gt; &lt;a href="https://github.com/nalgeon/sqlean/issues/27#issuecomment-1002703581"&gt;more&lt;/a&gt;. Installation is quite simple since there are binaries available for each OS.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sql" data-lang="sql"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;sqlite&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;load&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;stats&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;sqlite&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;create&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;table&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;data&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;real&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;not&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;sqlite&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;insert&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;into&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;data&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;select&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;as&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;generate_series&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;sqlite&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;select&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;avg&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;as&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;avg&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;data&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;avg&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;----
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;55&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;sqlite&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;select&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;percentile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;as&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;p25&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;percentile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;as&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;p50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;percentile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;75&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;as&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;p75&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;data&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;p25&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;p50&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;p75&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;--- --- ---
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2023-06-19]&lt;/small&gt;&lt;br&gt;
Recently, sqlean was made available for Python as a dedicated package, see &lt;a href="https://antonz.org/sqlean-py/"&gt;Python&amp;rsquo;s sqlite3 with extensions&lt;/a&gt;.
&lt;/div&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Lauren Bush • &lt;em&gt;In a Mellow Tone&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;There&amp;rsquo;s also a &lt;code&gt;total()&lt;/code&gt; function which behaves a little bit differently as it returns &amp;ldquo;0.0&amp;rdquo; in case the query returns only NULL values, while &lt;code&gt;sum()&lt;/code&gt; will return NULL like other SQL variants.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;See also &lt;a href="https://github.com/pawelsalawa/sqlitestudio"&gt;SQLiteStudio&lt;/a&gt; which seems to provide a function editor.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Processing large data: Duckdb vs. datatable</title><link>https://aliquote.org/post/duckdb/</link><pubDate>Fri, 17 Feb 2023 19:06:33 +0100</pubDate><guid>https://aliquote.org/post/duckdb/</guid><description>&lt;p&gt;I read Rasmus Bååth&amp;rsquo;s last post, &lt;a href="https://www.sumsar.net/blog/three-strategies-for-big-data/"&gt;Three strategies to tackle Big Data in R and Python&lt;/a&gt;, and I thought I would run my own benchmark on &lt;a href="https://duckdb.org/"&gt;duckdb&lt;/a&gt; with the data discussed in my review of &lt;a href="https://aliquote.org/post/exploratory-desktop-app/"&gt;Exploratory Desktop&lt;/a&gt; some years ago.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; Moreover, I&amp;rsquo;m interested in trying out Python &lt;a href="https://aliquote.org/post/python-datatable/"&gt;datatable&lt;/a&gt; &lt;code&gt;fread&lt;/code&gt; function.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2023-04-06]&lt;/small&gt;&lt;br&gt;
See also &lt;a href="https://yetanothermathprogrammingconsultant.blogspot.com/2023/04/in-process-in-memory-databases.html"&gt;In-process, in-memory databases&lt;/a&gt; for a more detailed comparison of DuckDB vs. SQLite.
&lt;/div&gt;
&lt;p&gt;Duckdb has long been a database backend I wanted to try, along with &lt;a href="https://github.com/TileDB-Inc/TileDB"&gt;TileDB&lt;/a&gt; (I followed &lt;a href="https://github.com/eddelbuettel"&gt;Dirk Eddelbuettel&lt;/a&gt; work on its R frontend, but go checkout &lt;a href="https://dirk.eddelbuettel.com/"&gt;his website&lt;/a&gt; for more information; I also warmly recommend his online course on &lt;a href="https://stat447.com/"&gt;Data Science Programming Methods&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s benchmark loading some data then. I fetched data for year 2021 (1.6 Go), which includes 3,669,928 records according to the &lt;a href="https://data.nber.org/nvss/natality/code/nat2021us.html"&gt;codebook&lt;/a&gt;.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; For the sake of comparison, loading the same data file in sqlite took less than 1,5 minutes, with little RAM caching. Simple queries are a breeze as expected, although I forgot to enable proper timing (&lt;code&gt;.timer on&lt;/code&gt;):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sql" data-lang="sql"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;sqlite&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;mode&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;csv&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;nat2021us&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;sqlite&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;import&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;nat2021us&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;csv&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;nat2021us&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;sqlite&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;DISTINCT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;dob_mm&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;AS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;count&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;nat2021us&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;GROUP&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;BY&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;dob_mm&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;ORDER&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;BY&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;CAST&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dob_mm&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;AS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;UNSIGNED&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;ASC&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;dob_mm&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="k"&gt;count&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;277533&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;266725&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;303139&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;293630&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;301343&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;314024&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;326611&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;330740&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;326280&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;315909&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;302309&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;311685&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now using &lt;code&gt;duckdb&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;duckdb&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;time&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;tic&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;con&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;duckdb&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;database&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;duckdb_python_db&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;con&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;drop table if exists nat2021us&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;con&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&amp;#34;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; create table nat2021us as
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; select * from read_csv_auto(&amp;#34;nat2021us.csv&amp;#34;)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;&amp;#34;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;toc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;con&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;close&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;Elapsed time: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;toc&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;tic&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;.2f&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; ms&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It shortly raised 99% but then we have to wait for about 1 minute for the data to be available at the IPython prompt:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;100% ▕████████████████████████████████████████████████████████████▏
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Elapsed time: 62689.09 ms
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And here is the &lt;code&gt;datatable&lt;/code&gt; approach:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;datatable&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;dt&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;tic&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;nat2021us&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fread&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;nat2021us.csv&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;toc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;Elapsed time: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;toc&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;tic&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;.2f&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; ms&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I was a little bit surprised at first: it took less than 5s (!) , without much more RAM caching:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;100% |██████████████████████████████████████████████████| Reading data [done]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Elapsed time: 4136.24 ms
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then, again results are computed at the speed of light:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="n"&gt;nat2021us&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt; &lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;by&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dob_mm&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Out&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;dob_mm&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;int32&lt;/span&gt; &lt;span class="n"&gt;int64&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;--&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="o"&gt;------&lt;/span&gt; &lt;span class="o"&gt;------&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;277533&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;266725&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="mi"&gt;303139&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="mi"&gt;293630&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="mi"&gt;301343&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt; &lt;span class="mi"&gt;314024&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;6&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt; &lt;span class="mi"&gt;326611&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;7&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt; &lt;span class="mi"&gt;330740&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;8&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt; &lt;span class="mi"&gt;326280&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;9&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="mi"&gt;315909&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;11&lt;/span&gt; &lt;span class="mi"&gt;302309&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mi"&gt;11&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt; &lt;span class="mi"&gt;311685&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt; &lt;span class="n"&gt;rows&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="n"&gt;columns&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Clearly, the &lt;code&gt;datatable&lt;/code&gt; package is a winner here. I&amp;rsquo;ll keep these quick results in mind when I have to load large datasets in Python.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Latarnik • &lt;em&gt;Marianna&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;See also &lt;a href="https://aliquote.org/post/processing-large-csv-files/"&gt;Processing large CSV files&lt;/a&gt;.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;National Center for Health Statistics (2021). Data File Documentations, U.S. Natality Data Files, 2021 (machine readable data file and documentation, CD-ROM Series), National Center for Health Statistics, Hyattsville, Maryland.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>On the sweep operator in regression settings</title><link>https://aliquote.org/post/lu-sweep/</link><pubDate>Thu, 16 Feb 2023 08:32:57 +0100</pubDate><guid>https://aliquote.org/post/lu-sweep/</guid><description>&lt;p&gt;Regression involves many linear algebra tricks. We already discussed the case of influence measure which can be computed most of the time in one pass, even in the case of ML.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; Beside model diagnostics, several other algebraic properties are in use when dealing with the normal equations. Recall that parameters of a linear regression model can be found using iterative solution (e.g., gradient descent) or the following algebraic equation: $\hat\theta =(X^TX)^{-1}X^Ty$, where $\theta$ is the parameter of interest (a vector of regression coefficients), $X$ the design matrix and $y$ the response variable. This requires inverting a matrix but there are ways to alleviate its cost as we&amp;rsquo;ve seen in a &lt;a href="https://aliquote.org/post/lisp-qr-regression/"&gt;previous post&lt;/a&gt; on matrix decomposition.&lt;/p&gt;
&lt;p&gt;Under the OLS framework, two elimination methods gained popularity long ago. Since we are dealing with a system of linear equations, Doolittle method, which is based on Gaussian elimination, is one option, the other being the Gauss-Jordan (full) elimination. The latter leads to the sweep operator.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; Rick Wicklin wrote &lt;a href="https://blogs.sas.com/content/iml/2018/04/18/sweep-operator-sas.html"&gt;two&lt;/a&gt; nice &lt;a href="https://blogs.sas.com/content/iml/2021/08/11/sweep-operator-ls-regression.html"&gt;blog&lt;/a&gt; posts on this topic. Basically, the sweep operator allows to &amp;ldquo;sweep in&amp;rdquo; or &amp;ldquo;sweep out&amp;rdquo; rows of the $X^TX$ matrix, and you can even &amp;ldquo;sweep in&amp;rdquo; columns in any order, which amounts to add effects to a model.&lt;/p&gt;
&lt;p&gt;The algorithm is discussed in one of Richard B. Darlington&amp;rsquo;s &lt;a href="http://node101.psych.cornell.edu/Darlington/sweep.htm"&gt;note&lt;/a&gt;. Julia code is available on these &lt;a href="https://ucla-biostat-257-2020spring.github.io/slides/14-sweep/sweep.html"&gt;blog&lt;/a&gt; &lt;a href="https://hua-zhou.github.io/teaching/biostatm280-2017spring/slides/11-sweep/sweep.html"&gt;posts&lt;/a&gt;, while R code is provided in &lt;a href="http://meanmean.me/2016/12/13/swp.html"&gt;The Statistician&amp;rsquo;s Apprentice: An Introduction to the SWP Operator&lt;/a&gt;. Finally, it is worth noting that:&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The SWEEP operator can be programmed to produce generalized inverses and create, as by-products, such items as the Forward Doolittle matrix, the Cholesky decomposition matrix, the Hermite canonical form matrix, the determinant of the original matrix, Type I sums of squares, the error sum of squares, a solution to the normal equations, and the general form of estimable functions.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Poppy • &lt;em&gt;Flux&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;W.J. Shih and S. Weisberg. &lt;a href="https://aliquote.org/pub/v2803231.pdf"&gt;Assessing Influence in Multiple Linear Regression With Incomplete Data&lt;/a&gt;. Technometrics, 28(3): 231-239, 1986.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;John F. Monahan. &lt;em&gt;Numerical Methods in Statistics&lt;/em&gt;. Cambridge University Press (2011).&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:3"&gt;
&lt;p&gt;James H. Goodnight. &lt;a href="https://www.jstor.org/stable/2683825"&gt;A Tutorial on the SWEEP Operator. A Tutorial on the SWEEP Operator&lt;/a&gt;. The American Statistician, 33(3): 149-158, 1979.&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Statistical charts using Mathematica</title><link>https://aliquote.org/post/mathematica-graphics/</link><pubDate>Wed, 15 Feb 2023 08:09:39 +0100</pubDate><guid>https://aliquote.org/post/mathematica-graphics/</guid><description>&lt;p&gt;This is yet another post on Mathematica where I am trying to document my journey through statistical analysis using this very beast. In previous posts, I show how to draw interaction plots using Python or Stata. Now it&amp;rsquo;s time to see what we can do with Mathematica.&lt;/p&gt;
&lt;p&gt;First we will make a little digression with a very basic plot of group means with confidence intervals. The &lt;code&gt;HypothesisTesting&lt;/code&gt; package provide the &lt;code&gt;MeanCI&lt;/code&gt; function which returns a list of lower and upper 95% confidence limits. Let&amp;rsquo;s load the same genotype data as before, and I&amp;rsquo;ll keep using plain lists rather than associations:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Import&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;polymorphism.dta&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Dataset&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ds&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Flatten&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/@&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;@@@&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Normal&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then, we easily get our desired confidence intervals: (output is prefixed with &lt;code&gt;=&amp;gt;&lt;/code&gt;)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Needs&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;HypothesisTesting`&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;cis&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Table&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;MeanCI&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="n"&gt;All&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;-2&lt;/span&gt;&lt;span class="p"&gt;]]]},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;GatherBy&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ds&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;#&lt;/span&gt;&lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="p"&gt;]}]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="mf"&gt;1.&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mf"&gt;58.1871&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;71.0986&lt;/span&gt;&lt;span class="p"&gt;}},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mf"&gt;2.&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mf"&gt;59.3357&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;69.423&lt;/span&gt;&lt;span class="p"&gt;}},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mf"&gt;3.&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mf"&gt;44.706&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;56.044&lt;/span&gt;&lt;span class="p"&gt;}}}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;small&gt;The values {1, 2, 3} correspond to the genotype 1.6/1.6, 1.6/0.7, and 0.7/0.7, respectively.&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;This is fine, but to manage error bars in a scatterplot, it is now recommended to use &lt;code&gt;ListPlot&lt;/code&gt; instead of &lt;code&gt;ErrorListPlot&lt;/code&gt; (as of Mathematica v12). Moreover, rather than creating a list with two values (the lower and upper limits of the 95% CI), why not use the &lt;code&gt;Around&lt;/code&gt; function, which works directly with &lt;code&gt;ListPlot&lt;/code&gt;? Here is my take, considering a Gaussian distribution rather than a Student t distribution:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ErrorMarginNormal&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;x_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;p_&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Quantile&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;NormalDistribution&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;StandardDeviation&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;Sqrt&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Length&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;MeanCINormal&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;x_&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Around&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Mean&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ErrorMarginNormal&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;.05&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;cis&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Table&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;MeanCINormal&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="n"&gt;All&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]]]},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;GatherBy&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ds&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;#&lt;/span&gt;&lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="p"&gt;]}];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="mf"&gt;1.&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Around&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;64.64285714285714&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;5.856898699924958&lt;/span&gt;&lt;span class="p"&gt;]},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mf"&gt;2.&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Around&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;64.37931034482759&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;4.825889674452653&lt;/span&gt;&lt;span class="p"&gt;]},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mf"&gt;3.&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Around&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;50.375&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;5.212899350342959&lt;/span&gt;&lt;span class="p"&gt;]}}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;From there on, it&amp;rsquo;s just a matter of Listplotting the whole thing:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ddn&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;MapAt&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;RandomReal&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="mf"&gt;-.05&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;.05&lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ds&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;All&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;}];&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c"&gt;(* jittering on x-axis *)&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;xlabs&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;1.6/1.6&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;1.6/0.7&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;0.7/0.7&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;}};&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Show&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ListPlot&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ddn&lt;/span&gt;&lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="n"&gt;All&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;}]],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Ticks&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;xlabs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Automatic&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;AxesLabel&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;Genotype&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Age&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;PlotRange&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;3.5&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Automatic&lt;/span&gt;&lt;span class="p"&gt;}],&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ListPlot&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;cis&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I did not find an option to add a bit of jittering on the x-axis, hence the derived data table &lt;code&gt;ddn&lt;/code&gt; where I added random noise on the abscissae. Results is shown in the left panel below.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/fig-mathematica-1.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/fig-mathematica-1.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/fig-mathematica-2.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/fig-mathematica-2.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;As an another illustration of the flexibility of Mathematica regarding statistical graphics, here is our interaction plot from the &lt;a href="https://aliquote.org/post/python-datatable/"&gt;previous&lt;/a&gt; &lt;a href="https://aliquote.org/post/stata-plot-04/"&gt;posts&lt;/a&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Import&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;../data/toothgrowth.dta&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Dataset&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ds&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Flatten&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/@&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;@@@&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Normal&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;avg&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Table&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Mean&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="n"&gt;All&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]]]},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;GatherBy&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ds&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;#&lt;/span&gt;&lt;span class="p"&gt;[[{&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;}]]&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="p"&gt;]}];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ddn&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;MapAt&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;RandomReal&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="mf"&gt;-.05&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;.05&lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ds&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;All&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;}];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ddn&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;SplitBy&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ddn&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;#&lt;/span&gt;&lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Show&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ListPlot&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ddn&lt;/span&gt;&lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="n"&gt;All&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;All&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;}]],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;AxesLabel&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;Dose&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Length&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;PlotRange&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="mf"&gt;0.25&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;2.25&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Automatic&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;GridLines&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Automatic&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ListPlot&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Take&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;avg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Joined&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;PlotStyle&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ColorData&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;97&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]],&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ListPlot&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Take&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;avg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;-3&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Joined&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;PlotStyle&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ColorData&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;97&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]]]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The result is displayed in the right panel of the above figure.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Joan As Police Woman • &lt;em&gt;Holiday&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Dealing with categorical variables in Mathematica</title><link>https://aliquote.org/post/categorical-variables-in-mathematica/</link><pubDate>Tue, 14 Feb 2023 11:23:10 +0100</pubDate><guid>https://aliquote.org/post/categorical-variables-in-mathematica/</guid><description>&lt;p&gt;Until now, I was always defining a design matrix by hand to fit, say, a linear regression model with categorical covariates in Mathematica. If you know how to define a linear model in Mathematica, &lt;a href="https://reference.wolfram.com/language/ref/DesignMatrix.html"&gt;DesignMatrix&lt;/a&gt; works exactly the same. I suggested this approach to a &lt;a href="https://stats.stackexchange.com/a/12102"&gt;Matlab user&lt;/a&gt; a long time ago. Then I realized that Mathematica provides &lt;a href="https://reference.wolfram.com/language/ref/NominalVariables.html"&gt;NominalVariables&lt;/a&gt; since at least version 7. Of course, I was searching using different keywords (e.g., &amp;ldquo;categorical predictors&amp;rdquo; or &amp;ldquo;dummy coding&amp;rdquo; &amp;ndash; the latter being used for dummy variables in a mathematical sense) all time long.&lt;/p&gt;
&lt;p&gt;The take away message is that if you happen to work with a rectangular table where categorical predictors are stored using their labels rather than a numerical code, and you want to perform a one- or two-way ANOVA, or an analysis of covariance, then &lt;code&gt;NominalVariables -&amp;gt; Automatic&lt;/code&gt; is your best friend.&lt;/p&gt;
&lt;p&gt;As an illustrtaion, consider the following Stata dataset, &lt;a href="https://aliquote.org/pub/polymorphism.dta"&gt;polymorphism.dta&lt;/a&gt;,&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; which includes 3 variables (participant ID, age, genotype with three levels). The magic of &lt;a href="http://reference.wolfram.com/language/guide/ListingOfAllFormats.html"&gt;&lt;code&gt;Import&lt;/code&gt;&lt;/a&gt; is that it works with Stata data format too, especially when it is imported as a Dataset:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Import&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;polymorphism.dta&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Dataset&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2023-02-14-10-56-14.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2023-02-14-10-56-14.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2023-02-14-10-59-29.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2023-02-14-10-59-29.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;If you prefer the traditional Table view (right panel in the above figure), you can omit the last option, and if you really need to add a header, you can add it in the front of the list:&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;labels&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;id&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;age&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;genotype&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Prepend&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Import&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;polymorphism.dta&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;labels&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note that you can also flatten your Dataset using ̀&lt;code&gt;Flatten /@ List @@@ Normal @ d&lt;/code&gt; (h/t &lt;a href="https://mathematica.stackexchange.com/a/176896"&gt;kglr&lt;/a&gt;. I much prefer working with lists than Dataset, but that may well be because I have had bad experiences with &lt;code&gt;GroupBy&lt;/code&gt; and &lt;code&gt;GatherBy&lt;/code&gt; on Datasets so far.&lt;/p&gt;
&lt;p&gt;Back to model fitting. To change the reference category, say consider the third category as the baseline, I did not find an easier way than recoding the numerical values using an anonymous function like so:&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;dd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;MapAt&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;#&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;All&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then we can fit a one-way ANOVA and print an ANOVA table using the following commands:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;LinearModelFit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;dd&lt;/span&gt;&lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="n"&gt;All&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;}]],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;NominalVariables&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Normal&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;ANOVATable&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note that regressors come first, and the response variable is the last one (age is the second column in our case). If you have multiple explanatory variables, use a list instead, e.g. &lt;code&gt;{x1, x1^2, x2}, {x1, x2}&lt;/code&gt;. It is also possible to let Mathematica build indicator variables for categorical variables using &lt;code&gt;NominalVariables -&amp;gt; Automatic&lt;/code&gt;; it works well when categorical variables are stored as strings and not as integers in your Table.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Jeff Beck Group • &lt;em&gt;Situation&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;William D. Dupont (2009). &lt;em&gt;Statistical Modeling for Biomedical Researchers&lt;/em&gt; (2nd ed.), Cambridge.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;You could also create a Dataset on the fly:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;d = Import[&amp;quot;polymorphism.dta&amp;quot;]
MakeDataset[data_List, header_List] := Dataset[AssociationThread[header, #] &amp;amp; /@ data]
MakeDataset[d, labels]
&lt;/code&gt;&lt;/pre&gt;
&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/li&gt;
&lt;li id="fn:3"&gt;
&lt;p&gt;Note that this is equivalent to defining a named function instead of using an anonymous function, e.g.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;f[x_] = 4 - x
MapAt[f, d, {All, 1}]
&lt;/code&gt;&lt;/pre&gt;
&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Stata plot of the week #4</title><link>https://aliquote.org/post/stata-plot-04/</link><pubDate>Fri, 10 Feb 2023 20:40:06 +0100</pubDate><guid>https://aliquote.org/post/stata-plot-04/</guid><description>&lt;p&gt;This is a continuation of a previous post on building &lt;a href="https://aliquote.org/post/stata-plot-03/"&gt;interaction plots&lt;/a&gt; in Stata, where I briefly mentioned the margins and marginsplot commands. As I am working on some &lt;a href="https://aliquote.org/post/biostatistical-methods/"&gt;statistical code&lt;/a&gt; as a side project, I need to reproduce a lot of R plots made with &lt;a href="https://cran.r-project.org/web/packages/ggplot2/"&gt;ggplot2&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s say we want to reproduce the picture shown at the end of &lt;a href="https://aliquote.org/post/python-datatable/"&gt;this post&lt;/a&gt;. It is a combination of jittered scatterplot with (mean) line plot superimposed. There are surely some Stata packages that are lying around the internet to do this with a magic command, but let&amp;rsquo;s do this the hard way using built-in commands only. Note that I generally set &lt;a href="https://journals.sagepub.com/doi/10.1177/1536867X1701700313"&gt;&lt;code&gt;plotplain&lt;/code&gt;&lt;/a&gt; as my default color scheme in Stata.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; So we also need to manage color at some point. But let&amp;rsquo;s get &lt;a href="https://aliquote.org/pub/toothgrowth.dta"&gt;some data&lt;/a&gt; first.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;use toothgrowth, clear
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;summarize
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;egen dosec = group(dose), label
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;quietly anova len dosec#supp
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;quietly margins dosec#supp
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;At this point, we can use &lt;code&gt;marginsplot&lt;/code&gt; directly and start customizing its display options:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;marginsplot, noci title(&amp;#34;&amp;#34;) xtitle(Dose (mg/day)) ytitle(Length (oc. unit)) ///
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; addplot(scatter len dosec if supp == 1, ms(oh) jitter(5) ///
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; mc(ebblue) text(20 1 &amp;#34;OJ&amp;#34;, color(ebblue) size(medlarge)) ///
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; xscale(r(0 4)) xlab(0(1)3) || scatter len dosec if supp == 2, ///
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ms(oh) jitter(5) mc(orange) text(10 2 &amp;#34;VC&amp;#34;, color(orange) ///
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; size(medlarge))) scheme(uncluttered)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In this case, we use the &lt;a href="https://github.com/graykimbrough/uncluttered-stata-graphs"&gt;&lt;code&gt;uncluttered&lt;/code&gt;&lt;/a&gt; color scheme (see also this &lt;a href="https://blog.stata.com/2018/10/02/scheming-your-way-to-your-favorite-graph-style/"&gt;review&lt;/a&gt; of various other schemes on the Stata blog), which gently manages the color for us (although I did not choose the right blue/orange combination in this case).&lt;/p&gt;
&lt;p&gt;Here is a similar command built using the menu dialog options for &lt;code&gt;marginsplot&lt;/code&gt;, which works with the &lt;code&gt;plotplain&lt;/code&gt; scheme:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;marginsplot, noci recast(line) ///
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; plot1opts(lcolor(ebblue)) plot2opts(lcolor(orange)) ///
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; addplot((scatter len dosec if supp == 1, mcolor(ebblue) jitter(5)) ///
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; (scatter len dosec if supp == 2, mcolor(orange) jitter(5))) ///
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ytitle(Length (oc. unit)) xtitle(Dose (mg/day)) xscale(range(0.75 3.25)) ///
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; title(&amp;#34;&amp;#34;) legend(off)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I should note taht I was not able to reorder the legend (to suppress the additional keys generated for the scatter added plots) via the menu options. Likewise, I did not bother standardizing the symbol shape as &lt;code&gt;oh&lt;/code&gt;. Anyway, this is not hard to fix and both results are shown side by side below:&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/fig-01-06.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/fig-01-06.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/fig-toothgrowth-margins-v2.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/fig-toothgrowth-margins-v2.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;anovaplot&lt;/code&gt; command works also quite well, actually:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;anovaplot dosec supp, scatter(jitter(5))
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Rammstein • &lt;em&gt;Amerika&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Here is my &lt;code&gt;profile.do&lt;/code&gt; configuration by the way:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sysdir set PLUS &amp;quot;~/.local/lib/ado/plus/&amp;quot;
sysdir set PERSONAL &amp;quot;~/.local/lib/ado/personal/&amp;quot;
sysdir set OLDPLACE &amp;quot;~/.local/lib/ado/&amp;quot;
set seed 101
set logtype text
set matastrict on
set maxvar 5000
set scrollbufsize 2000000
set tracedepth 1
// set varabbrev off
set scheme plotplain
graph set eps fontdir ~/.local/share/fonts
graph set window fontface &amp;quot;Roboto Condensed&amp;quot;
if &amp;quot;`c(console)'&amp;quot;!=&amp;quot;console&amp;quot; graph set eps preview on
graph set eps logo off
graph set eps fontface &amp;quot;Roboto Condensed&amp;quot;
graph set print logo off
// set autotabgraphs on, perm
set max_memory 8g, permanently
&lt;/code&gt;&lt;/pre&gt;
&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Biostatistical methods</title><link>https://aliquote.org/post/biostatistical-methods/</link><pubDate>Mon, 06 Feb 2023 20:30:52 +0100</pubDate><guid>https://aliquote.org/post/biostatistical-methods/</guid><description>&lt;p&gt;I am currently working on porting a &lt;a href="https://even4void.github.io/rstats-biostats/"&gt;workshop&lt;/a&gt; I held on several occasions in the past on Biostatistical modelling into different different languages. The exact title in French is &lt;em&gt;Méthodes biostatistiques&lt;/em&gt;, in honor of one of my first textbook on mathematical statistics (Philippe Tassi, &lt;a href="https://www.eyrolles.com/Sciences/Livre/methodes-statistiques-9782717848595/"&gt;Méthodes statistiques&lt;/a&gt;, 2004), although the handouts I wrote are mainly about applied and not theoretical statistics. The GitHub repository is &lt;a href="https://github.com/even4void/biostats"&gt;around there&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I refactor part of the R code, and then started to write Stata and Python scripts to reproduce the R textual and graphical outputs. I intend to write more translations, at least for Clojure, Mathematica and Racket. Of course, it is somewhat limited by the available capabilities of each language, since I don&amp;rsquo;t have time nor the inclination to rewrite everything from scratch. I know I won&amp;rsquo;t be in trouble with Stata, but I doubt I will be able to equate all R&amp;rsquo;s results with any other programming languages. The &lt;a href="https://cran.r-project.org/web/packages/rms/"&gt;rms&lt;/a&gt; and &lt;a href="https://cran.r-project.org/web/packages/ggplot2/"&gt;ggplot2&lt;/a&gt; packages are damned good. Fortunately, Python has a nice &lt;a href="https://aliquote.org/post/python-plotnine/"&gt;package&lt;/a&gt; for the grammar of graphics, which I started using lately &amp;ndash; I was really impressed that everything worked as expected for someone used to R syntax, and Stata has good facilities for faceted displays. We will see what&amp;rsquo;s doable in other languages.&lt;/p&gt;
&lt;p&gt;My original idea with this side project was to practice again, of course (otherwise we end up forgetting the good old reflexes), but also to get an idea of what can be done from one language to another and if the native features of a language influence the way to approach the &amp;ldquo;data problem&amp;rdquo;. I learned Stata after R (and SPSS and SAS and Statistica and Lisp-Stat), and I learned a lot about how to organize or recode data to optimize data processing and to benefit from built-in features.&lt;/p&gt;
&lt;p&gt;I had for a long time a big prejudice about Python because in my opinion if you can&amp;rsquo;t do interactive, specifically visual, exploratory analysis of the data then it&amp;rsquo;s better to turn to more adapted solutions. I still think that there&amp;rsquo;s room for improvements in the Python land for statistical computing &amp;ndash; and I do not pretend nor am I interested in fixing the problem, but I must admit things have improved in the past few years. And as I noted above, plotnine is really a great add-on to the Python &amp;ldquo;data stack&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s see how it goes then. I will write a more detailed review of what I&amp;rsquo;ve learned from this porting experiment, and what are the pros and cons of each of those languages with respect to biostatistical modelling at large.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Bauhaus • &lt;em&gt;Spirit&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Regression diagnostics and influence measures</title><link>https://aliquote.org/post/regression-influence/</link><pubDate>Thu, 02 Feb 2023 20:55:35 +0100</pubDate><guid>https://aliquote.org/post/regression-influence/</guid><description>&lt;p&gt;In one of my &lt;a href="https://stats.stackexchange.com/a/19293/930"&gt;answer&lt;/a&gt; on Cross Validated I discussed base R solution for diagnosing a regression model. Specifically, I said that &amp;ldquo;The function influence() (or its wrapper, influence.measures()) returns most of what we need for model diagnostic, including jacknifed statistics. As stated in Chambers and Hastie&amp;rsquo;s Statistical Models in S (Wadsworth &amp;amp; Brooks, 1992), it can be used in combination to summary.lm(). One of the example provided in the so-called &amp;ldquo;white book&amp;rdquo; (pp. 130-131) allows to compute standardized (residuals with equal variance) and studentized (the same with a different estimate for SE) residuals, DFBETAS (change in the coefficients scaled by the SE for the regression coefficients), DFFIT (change in the fitted value when observation is dropped), and DFFITS (the same, with unit variance) measures without much difficulty.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;All of this relies on linear algebra and does not require to perform matrix multiplication or inversions again and again. My impression is that few people really use influence measures (contrary to, say, variance influence factors) even if it may bring some insights into data or model quality. These are simple quantities, though. See one of my &lt;a href="https://aliquote.org/cours/2012_biomed/04-linear-model.pdf"&gt;old workshop&lt;/a&gt; (in French) on statistical modeling (slide #13). For instance, the leverage statistic, or hat value, is defined for observation $i$ as&lt;/p&gt;
&lt;p&gt;$$h_i = \frac{1}{n} + \frac{(x_i - \bar x)^2}{\sum_{i=1}^n (x_i - \bar x)^2} = \frac{1}{n} + \frac{(x_i - \bar x)^2}{(n-1)s_x^2}.$$&lt;/p&gt;
&lt;p&gt;Note that there is no strict correspondence between outlying and high leverage observations. The mean leverage value is $(k+1)/n$, where $k$ is the number of parameters in the linear model. In the case of simple linear regression, $k=2$. The rule of thumb is that an observation must be carefully checked if $h_i &amp;gt; \frac{2(k+1)}{n}$, which is usually what dedicated statistical packages highlight when asking to print individual diagnostic data.&lt;/p&gt;
&lt;p&gt;Fortunately, the Python statsmodels package provides &lt;a href="https://www.statsmodels.org/stable/generated/statsmodels.regression.linear_model.OLSResults.get_influence.html"&gt;OLSResults.get_influence()&lt;/a&gt;, which returns &lt;a href="https://www.statsmodels.org/stable/generated/statsmodels.stats.outliers_influence.OLSInfluence.html#statsmodels.stats.outliers_influence.OLSInfluence"&gt;everything we need&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Here is a sample &lt;a href="https://aliquote.org/pub/ols_influence.py"&gt;Python script&lt;/a&gt; which demonstrates how to compute Cook&amp;rsquo;s distance&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; from a multiple regression model as illustrated in R&amp;rsquo;s on-line help for &lt;code&gt;influence&lt;/code&gt;.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/fig-ols-influence.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Here are the (filtered) results from R:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;dfb.1_&lt;/span&gt; &lt;span class="n"&gt;dfb.pp15&lt;/span&gt; &lt;span class="n"&gt;dfb.pp75&lt;/span&gt; &lt;span class="n"&gt;dfb.dpi&lt;/span&gt; &lt;span class="n"&gt;dfb.ddpi&lt;/span&gt; &lt;span class="n"&gt;dffit&lt;/span&gt; &lt;span class="n"&gt;cov.r&lt;/span&gt; &lt;span class="n"&gt;cook.d&lt;/span&gt; &lt;span class="n"&gt;hat&lt;/span&gt; &lt;span class="n"&gt;inf&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Japan&lt;/span&gt; &lt;span class="m"&gt;0.63987&lt;/span&gt; &lt;span class="m"&gt;-0.65614&lt;/span&gt; &lt;span class="m"&gt;-0.67390&lt;/span&gt; &lt;span class="m"&gt;0.14610&lt;/span&gt; &lt;span class="m"&gt;0.388603&lt;/span&gt; &lt;span class="m"&gt;0.8597&lt;/span&gt; &lt;span class="m"&gt;1.085&lt;/span&gt; &lt;span class="m"&gt;1.43e-01&lt;/span&gt; &lt;span class="m"&gt;0.2233&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Libya&lt;/span&gt; &lt;span class="m"&gt;0.55074&lt;/span&gt; &lt;span class="m"&gt;-0.48324&lt;/span&gt; &lt;span class="m"&gt;-0.37974&lt;/span&gt; &lt;span class="m"&gt;-0.01937&lt;/span&gt; &lt;span class="m"&gt;-1.024477&lt;/span&gt; &lt;span class="m"&gt;-1.1601&lt;/span&gt; &lt;span class="m"&gt;2.091&lt;/span&gt; &lt;span class="m"&gt;2.68e-01&lt;/span&gt; &lt;span class="m"&gt;0.5315&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ The Loyal Seas • &lt;em&gt;Last of the great machines&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Cook%27s_distance"&gt;Cook&amp;rsquo;s distance&lt;/a&gt; can also be defined in terms of leverage values.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Data tables in Python</title><link>https://aliquote.org/post/python-datatable/</link><pubDate>Tue, 31 Jan 2023 13:21:30 +0100</pubDate><guid>https://aliquote.org/post/python-datatable/</guid><description>&lt;p&gt;Although Pandas is a great package to manipulate rectangular data structures, I often find myself a bit lost with its syntax (the use of &lt;code&gt;loc&lt;/code&gt; or &lt;code&gt;iloc&lt;/code&gt;, for instance). I learned about the &lt;a href="https://datatable.readthedocs.io/en/latest/"&gt;datatable&lt;/a&gt; package a while ago, then as usual forgot about it. Here is a short overview of how I generally use it for biostatistical stuff I happen to do during my free time.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s get some data first. We will consider the &lt;code&gt;ToothGrowth&lt;/code&gt; dataset from R builtin&amp;rsquo;s, which deals with the effect of vitamin C on tooth growth in guinea pigs:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The response is the length of odontoblasts (cells responsible for tooth growth) in 60 guinea pigs. Each animal received one of three dose levels of vitamin C (0.5, 1, and 2 mg/day) by one of two delivery methods, orange juice or ascorbic acid (a form of vitamin C and coded as &lt;code&gt;VC&lt;/code&gt;).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Fortunately, it is available in Python thanks to the &lt;a href="https://pypi.org/project/rdatasets/"&gt;rdatasets&lt;/a&gt; package:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;rdatasets&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;descr&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;plotnine&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;datatable&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;dt&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;descr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;ToothGrowth&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;dataset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;ToothGrowth&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;dataset&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;head&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## len supp dose&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## 0 4.2 VC 0.5&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## 1 11.5 VC 0.5&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## 2 7.3 VC 0.5&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## 3 5.8 VC 0.5&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## 4 6.4 VC 0.5&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For those familiar with the R &lt;a href="https://rdatatable.gitlab.io/data.table/"&gt;data.table&lt;/a&gt; package, the syntax will be easy to grasp since it is 95% the same in the most use cases. For example, if we want to aggregate data using group means, we can proceed as follows:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Frame&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dataset&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt; &lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;by&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;supp&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;dose&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## | supp dose len&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## | str32 float64 float64&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## -- + ----- ------- -------&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## 0 | OJ 0.5 13.23&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## 1 | OJ 1 22.7&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## 2 | OJ 2 26.06&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## 3 | VC 0.5 7.98&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## 4 | VC 1 16.77&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## 5 | VC 2 26.14&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## [6 rows x 3 columns]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Other variations are possible, e.g. count the number of unique or missing values, summarize the data table using mean, min or max, etc. Here are tow further examples:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## | len supp dose&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## | float64 float64 float64&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## -- + ------- ------- -------&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## 0 | 18.8133 NA 1.16667&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## [1 row x 3 columns]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt; &lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;by&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;supp&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## | supp count&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## | str32 int64&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## -- + ----- -----&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## 0 | OJ 30&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## 1 | VC 30&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## [2 rows x 2 columns]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Like the R data.table package, there&amp;rsquo;s an over-optimized &lt;code&gt;fread&lt;/code&gt; function which can handle CSV, Excel, and many more formats, while automagically detecting the appropriate type of variable. Moreover it is supposed to handle large data files.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;The H2O.ai team discusses the basic features of the datatable package on their blog: &lt;a href="https://h2o.ai/blog/introducing-datatableton-python-datatable-tutorials-exercises/"&gt;Introducing DatatableTon – Python Datatable Tutorials &amp;amp; Exercises&lt;/a&gt;. You may also like &lt;a href="https://towardsdatascience.com/an-overview-of-pythons-datatable-package-5d3a97394ee9"&gt;An Overview of Python’s Datatable package&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;As a sequel to my previous post on seaborn and plotnine, let&amp;rsquo;s see how we can reproduce the following plot (left panel), which was &lt;a href="https://even4void.github.io/rstats-biostats/practical01.html"&gt;made in R&lt;/a&gt;:&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/fig-toothgrowth-r.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/fig-toothgrowth-r.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/fig-toothgrowth-py.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/fig-toothgrowth-py.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;R code is shown below:&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;aggregate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;~&lt;/span&gt; &lt;span class="n"&gt;dose&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;supp&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ToothGrowth&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;ggplot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ToothGrowth&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;aes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;dose&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;supp&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;geom_point&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;position&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;position_jitterdodge&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;jitter.width&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;.1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dodge.width&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0.25&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;geom_line&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;aes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;dose&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;supp&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;scale_color_manual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;values&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;c&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;steelblue&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;orange&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;guides&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;color&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;FALSE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;geom_dl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;aes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;label&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;supp&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;method&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;smart.grid&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cex&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;.8&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;labs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;Dose (mg/day)&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;Length (oc. unit)&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;p&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And here is the Python version:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt; &lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;by&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;supp&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;dose&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ggplot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;aes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;dose&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;len&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;supp&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;geom_point&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;position&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;position_jitterdodge&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;jitter_width&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;.1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dodge_width&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;0.25&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;geom_line&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;aes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;dose&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;len&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;supp&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;scale_color_manual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;steelblue&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;orange&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;guide&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;False&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;labs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;Dose (mg/day)&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;Length (oc. unit)&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;theme_minimal&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Not much of a difference either way. See the final result on the right panel of the previous figure.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Badflower • &lt;em&gt;Ghost&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;It would be interesting to benchamrk datatable.fread against R data.table or pandas.read_csv, like I did in my review of &lt;a href="https://aliquote.org/post/exploratory-desktop-app/"&gt;Exploratory Desktop&lt;/a&gt;.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;Shorter version for the impatient: &lt;code&gt;lattice::xyplot(len ∼ dose, data = ToothGrowth, groups = supp, type = c (&amp;quot;p&amp;quot;, &amp;quot;a&amp;quot;))&lt;/code&gt;.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>A grammar of graphics for Python</title><link>https://aliquote.org/post/python-plotnine/</link><pubDate>Mon, 30 Jan 2023 13:21:25 +0100</pubDate><guid>https://aliquote.org/post/python-plotnine/</guid><description>&lt;p&gt;I use Matplotlib for all my plots in Python. &lt;a href="https://seaborn.pydata.org/"&gt;Seaborn&lt;/a&gt; is becoming a really great way to use Matplotlib backend for statistical graphics. I originally thought it was only working with &lt;a href="https://pandas.pydata.org/"&gt;Pandas&lt;/a&gt; data frames, but it also accepts Numpy libraries as well as built-in Python types like lists and dictionaries.&lt;/p&gt;
&lt;p&gt;Here is an example of plot from the on-line tutorial:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;seaborn&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;flights&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;seaborn&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;load_dataset&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;flights&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;seaborn&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;relplot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;flights&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;year&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;passengers&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;hue&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;month&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;kind&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;line&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/fig-python-plotnine-1.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/fig-python-plotnine-1.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/fig-python-plotnine-2.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/fig-python-plotnine-2.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;To produce this kind of plot using Matplotlib alone, it would requires a lot more instruction as we need to group data by month and use year on the x-axis. The syntax above is mostly comparable with &lt;code&gt;qplot&lt;/code&gt; from the &lt;a href="https://ggplot2.tidyverse.org/"&gt;ggplot2&lt;/a&gt; R package.&lt;/p&gt;
&lt;p&gt;This dataset is basically a data structure we studied in &lt;a href="https://aliquote.org/post/stata-plot-01/"&gt;another post&lt;/a&gt;. To reproduce our earlier small multiples (see right panel above), we would write:&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;seaborn&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;relplot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;flights&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;year&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;passengers&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;col&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;month&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;col_wrap&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;kind&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;line&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;linewidth&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;zorder&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;legend&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;False&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;month&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ax&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;axes_dict&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;seaborn&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;lineplot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;flights&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;year&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;passengers&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;units&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;month&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;estimator&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;.7&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;linewidth&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ax&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;ax&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;seaborn.relplot&lt;/code&gt; command is used for facetted displays. The on-line doc says that it&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;provides access to several different axes-level functions that show the relationship between two variables with semantic mappings of subsets. The kind parameter selects the underlying axes-level function to use&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In the above example, the same effect could be achieved using &lt;code&gt;seaborn.lineplot&lt;/code&gt; instead. There&amp;rsquo;s a lot more commands in the &lt;a href="https://seaborn.pydata.org/api.html"&gt;API&lt;/a&gt;, most of them targeting statistical applications (e.g., &lt;code&gt;rugplot&lt;/code&gt;, &lt;code&gt;ecdfplot&lt;/code&gt;, &lt;code&gt;kdeplot&lt;/code&gt;, &lt;code&gt;strippplot&lt;/code&gt;, &lt;code&gt;boxplot&lt;/code&gt;). Combined with &lt;a href="https://www.statsmodels.org/stable/index.html"&gt;statsmodels&lt;/a&gt; and (scipy](&lt;a href="https://scipy.org/)"&gt;https://scipy.org/)&lt;/a&gt;, I feel like it provides a complete statistical toolbox for newcomers to Python for statistical munging, albeit with less specialized routines compared to R or Stata.&lt;/p&gt;
&lt;p&gt;Next to Seaborn, there&amp;rsquo;s &lt;a href="https://plotnine.readthedocs.io/en/stable/"&gt;plotnine&lt;/a&gt;, which started to be developed six or seven years ago. Its syntax is even closer to ggplot2, so if you&amp;rsquo;re an R user you may want to start with plotnine directly. For instance, the above plot could be produced as follows:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;plotnine&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ggplot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;flights&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;aes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;year&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;passengers&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;factor(month)&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;geom_line&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note that you don&amp;rsquo;t need to call pyplot&amp;rsquo;s &lt;code&gt;show()&lt;/code&gt; in this case. The number of &lt;a href="https://plotnine.readthedocs.io/en/stable/api.html#geoms"&gt;geoms&lt;/a&gt; that are currently supported make it a good competitor to other ggplot-like alternative in Python. Actually, the &lt;a href="https://github.com/yhat/ggpy"&gt;ggplot&lt;/a&gt; package looks staled; I haven&amp;rsquo;t tested &lt;a href="https://lets-plot.org/"&gt;lets-plot&lt;/a&gt;, and I don&amp;rsquo;t remember the third option I tried a few years ago but it was nothing compared to plotnine.&lt;/p&gt;
&lt;p&gt;Our facetted small multiples would then be written as follows:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;plotnine&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;flights2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;flights&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;rename&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;columns&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;month&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;mmonth&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ggplot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;flights&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;geom_line&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;aes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;year&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;passengers&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;factor(month)&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;geom_line&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;flights2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;aes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;year&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;passengers&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;group&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;factor(mmonth)&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;grey&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;facet_wrap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;~ month&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;nrow&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;scale_color_discrete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;guide&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;False&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/fig-python-plotnine-3.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/fig-python-plotnine-3.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/fig-python-plotnine-4.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/fig-python-plotnine-4.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2023-05-09]&lt;/small&gt;&lt;br&gt;
Allen Downey makes a heavy use of Matplotlib, oftentimes through custom plotting functions. See figure 3 in this &lt;a href="https://www.allendowney.com/blog/2023/04/24/the-overton-paradox/"&gt;blog post&lt;/a&gt; for a variant of small multiples that I personally like a lot.
&lt;/div&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Face The Beat: Session 7 • &lt;em&gt;Dance My darling &amp;ndash; Love &amp;amp; Hate&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;There&amp;rsquo;s a slightly different illustration of &lt;a href="https://seaborn.pydata.org/examples/timeseries_facets.html"&gt;small multiple time series&lt;/a&gt; on Seaborn gallery.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Successful Lisp</title><link>https://aliquote.org/post/successful-lisp/</link><pubDate>Fri, 27 Jan 2023 10:09:25 +0100</pubDate><guid>https://aliquote.org/post/successful-lisp/</guid><description>&lt;p&gt;Here are some words about &lt;em&gt;Successful Lisp&lt;/em&gt;, by David Lamkins. I started reading it last Summer, then stopped, then get at it again before Christmas. Meanwhile, I haven&amp;rsquo;t wrote a single line of CL&amp;hellip; A short review appeared years ago on &lt;a href="https://eli.thegreenplace.net/2004/09/20/book-review-successful-lisp-by-david-lamkins"&gt;Eli Bendersky&lt;/a&gt;&amp;rsquo;s website.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In Lisp, the parenthesis is the punctuation.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This book is available on one of &lt;a href="https://dept-info.labri.fr/~strandh/Teaching/MTP/Common/David-Lamkins/contents.html"&gt;Gilbert Strandh&lt;/a&gt;&amp;rsquo;s websites. It aims at describing what Lisp is, what it is good for, and how the language differs from other languages mostly derived from Algol. The above quote is just a joke, since many newcomers to Lisp-based languages seem to dislike those pesky parentheses that sit everywhere in Lisp or Scheme code blocks.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;As stated above, this is a book about Lisp, the language, and not Lisp as used in scientific computing or AI applications. Chapter 3 provides a brief overview of essential Lisp concepts: syntax and evaluation of forms (atoms and lists) using prefix notation, special forms and macros, etc. It is organized as a set of 12 lessons, along with non-trivial illustrations sometimes (e.g., &lt;code&gt;setq&lt;/code&gt; versus &lt;code&gt;set&lt;/code&gt;). Most importantly, it covers data structures like vectors, arrays or structure and hash tables. Whenever I read about CL&amp;rsquo;s array, I think of one of Tamas Papp&amp;rsquo;s &lt;a href="https://www.tamaspapp.eu/post/common-lisp-to-julia/"&gt;older post&lt;/a&gt; but I think CL still provides workable solution for numerical applications, as can be seen from some of &lt;a href="https://github.com/stylewarning"&gt;Robert Smith&lt;/a&gt;&amp;rsquo;s projects. Chapters 4, 6, and 8 deal with local and global variable, namespace, lexical binding and the like. It is the &amp;ldquo;essentials&amp;rdquo; but I believe it is a disguised way to compare CL to other programming languages, with the exception of tail recursion and reader macros which are specific to functional languages. Chapter 5 discusses loops, and I&amp;rsquo;d learned to remember Stata&amp;rsquo;s own looping procedure thanks to the distinction between &lt;code&gt;dotimes&lt;/code&gt; and &lt;code&gt;dolist&lt;/code&gt; in CL. Chapters 7 and 14 is all about CLOS, the object system in CL. Chapter 9 discusses error handling; see &lt;a href="https://phoe.github.io/"&gt;The Common Lisp Condition System: Beyond Exception Handling with Control Flow Mechanisms&lt;/a&gt; for a modern approach to control flow in CL. Sequences and operations on sequences (map, filter, reduce) are described in chapters 12 and 13. Closures are discussed in chapter 15, while the infamous &amp;ldquo;equal&amp;rdquo; comparisons are summarized in chapter 17. Chpaterd 19 and 20 are about streams and macros:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Lisp macros are Lisp programs that generate other Lisp programs.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Except for chapters 32 and following, the rest of the book is merely about how to program in CL and to manage a CL project.&lt;/p&gt;
&lt;p&gt;People often recommend &lt;a href="https://gigamonkeys.com/book/"&gt;Practical Common Lisp&lt;/a&gt; to get started with Lisp. I think this book is also worth a look. &lt;a href="https://ane.iki.fi/2020/10/05/between-two-lisps.html"&gt;Between two Lisps&lt;/a&gt; also provides a good discussion of CL versus Scheme, Clojure or whatever.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Artic Monkeys • &lt;em&gt;R U Mine?&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;I do, on the contrary, like them from a purely syntactically viewpoint, at least much better than significant indentation like in Python or Haskell. If you think about it a little, there&amp;rsquo;s not much of a difference between the following two statements: &lt;code&gt;print(&amp;quot;Hello&amp;quot;)&lt;/code&gt; and &lt;code&gt;(pprint &amp;quot;Hello&amp;quot;)&lt;/code&gt;. By the way, John D. Cook already mentioned this on Twitter years ago. If your text editor supports bracket matching &amp;mdash; and you&amp;rsquo;re not forced to use Emacs &amp;mdash; you will easily navigate between balanced parenthesis, and more generally the highly structured code that Lisp or Scheme provide. I also hope that &lt;a href="https://tree-sitter.github.io/tree-sitter/"&gt;treesitter&lt;/a&gt; will be a great help in the future. After this brief parenthesis, let&amp;rsquo;s return to the subject of this post.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in January</title><link>https://aliquote.org/post/micro-01-2023/</link><pubDate>Thu, 26 Jan 2023 09:17:57 +0100</pubDate><guid>https://aliquote.org/post/micro-01-2023/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-01-04&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In the beginning, there were blogs, and they were the original social web. We built community. We found our people. We wrote personally. We wrote frequently. We self-policed, and we linked to each other so that newbies could discover new and good blogs. I want to go back there. &amp;mdash; &lt;a href="https://www.theverge.com/23513418/bring-back-personal-blogging"&gt;Bring back personal blogging&lt;/a&gt; (h/t &lt;a href="https://baty.net/2023/bring-back-personal-blogging"&gt;Jack Baty&lt;/a&gt;)&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-01-04&lt;/a&gt;: TIL that TeXlive now includes &lt;code&gt;pdfxup&lt;/code&gt; as a replacement for the good old &lt;code&gt;pdfnup&lt;/code&gt;. Time to update my oldie shell alias &lt;code&gt;alias p2x1=&amp;quot;pdfnup --nup 2x1 --landscape --suffix '2x1' --batch &amp;quot;&lt;/code&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-01-04&lt;/a&gt;: &lt;a href="https://www.timdbg.com/posts/fakers-guide-to-assembly/"&gt;The faker&amp;rsquo;s guide to reading (x86) assembly language&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-01-04&lt;/a&gt;: &lt;a href="https://ananthakumaran.in/2023/01/01/solving_n_plus_1_queries_on_rails.html"&gt;Understanding N + 1 queries problem 01 Jan 2023&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-01-04&lt;/a&gt;: ♪ Kaiser Chiefs · Ruby&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-01-17&lt;/a&gt;: ♪ John Scofield · Danny Boy&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-01-18&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The family therapist Salvador Minuchin declared, &amp;ldquo;The human experience of identity has two elements: a sense of belonging and a sense of being separate.&amp;rdquo; This is as good a description of digital identity as it is of our psychological identity. A digital identity contains data that uniquely describes a person or thing but also contains information about the subject&amp;rsquo;s relationships to other entities. &amp;mdash; &lt;a href="https://www.windley.com/archives/2023/01/defining_digital_identity.shtml"&gt;Defining Digital Identity&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-01-20&lt;/a&gt;: As a sequel of this &lt;a href="https://aliquote.org/post/archiving-stackexchange/"&gt;old post&lt;/a&gt; of mine, here is the &lt;a href="https://aliquote.org/pub/stackexchange-stats.html"&gt;complete archive&lt;/a&gt; of the 467 answers I provided on Cross Validated during ten years or so. Note that this a raw (unedited) HTML, with many tiny bugs along the way, mostly related to Unicode encoding and missing images from imgur. I can probably with the UTF-8 issue by using a different processor than &lt;a href="https://www.msweet.org/htmldoc/"&gt;htmldoc&lt;/a&gt;. As for the latter, I believe the issue comes from Pandoc, since I retrieved a larger number of images manually using curl (tarball &lt;a href="https://aliquote.org/pub/archive_416.tar.gz"&gt;archive&lt;/a&gt;).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-01-20&lt;/a&gt;: ♪ Carpenter Brut · Maniac (feat. Yann Ligner)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-01-21&lt;/a&gt;: RIP &lt;a href="https://tapbots.com/tweetbot/"&gt;Tweetbot&lt;/a&gt;. Ironically, I started my &lt;a href="https://aliquote.org/post/tweetbot-3/"&gt;review&lt;/a&gt; of this app by saying that Twitter retracted their own client for OS X long ago; now they simply suspended access to 3rd party clients.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-01-23&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In fact, the vast majority of my editing tasks – probably as much as 98% – are performed exactly as if I was in Vim. (For the other 2% I&amp;rsquo;ve invented my own Vim-style keybinds.) Normally, I don&amp;rsquo;t notice that I&amp;rsquo;m actually not in Vim. The fact that I happen to be running the Emacs process is a mere technicality. &amp;mdash; &lt;a href="https://two-wrongs.com/on-escape-meta-alt-control-shift-emacs.html"&gt;On Escape Meta Alt Control Shift&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-01-23&lt;/a&gt;: &lt;a href="https://en.algorithmica.org/hpc/"&gt;Algorithms for Modern Hardware&lt;/a&gt; is a gold mine in the field of high performance computing.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-01-23&lt;/a&gt;: &lt;a href="https://allendowney.github.io/ElementsOfDataScience/"&gt;Elements of Data Science&lt;/a&gt; is &amp;ldquo;an introduction to data science for people with no programming experience. My goal is to present a small, powerful subset of Python that allows you to do real work in data science as quickly as possible.&amp;rdquo; Great work by Allen Downey as always.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-01-24&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Users who want to block all such external mediaanalysisd look-ups can do so using a software firewall to block outgoing connections to Apple’s servers by that process through port 443. That may well disable other macOS features. &amp;mdash; &lt;a href="https://eclecticlight.co/2023/01/18/is-apple-checking-images-we-view-in-the-finder/"&gt;Is Apple checking images we view in the Finder?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-01-24&lt;/a&gt;: Twenty years-old stuff that are still lying around, even though I wear the ring most of the time.&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_2859.JPG" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-01-24&lt;/a&gt;: &lt;a href="https://dennisnotes.com/note/20180627-ubuntu-18.04-server-setup/"&gt;Secure Ubuntu 18.04 server setup&lt;/a&gt;: Never tried to use an encrypted LVM volume unlockable via SSH. It looks like an interesting approach:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Applying encryption is fast when it is done upon creation: since the initial contents of the partition are ignored, they are not encrypted; only new data will be encrypted as it is written. &amp;mdash; &lt;a href="https://security.stackexchange.com/a/39082"&gt;Ubuntu LVM Encryption&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2023-01-24&lt;/a&gt;: ♪ Massive Attack · Inertia Creeps&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2023-01-27&lt;/a&gt;: Listening to the last album from &lt;a href="https://tindersticks.co.uk/"&gt;Tindersticks&lt;/a&gt;, Stars at Noon. Great artwork, as always. Now I need to buy their Past Imperfect compilation, which featured a limited edition box set comes with a double LP of Live at Glasgow City Halls, 5th October 2008.&lt;br&gt;&lt;/p&gt;</description></item><item><title>Hash collision</title><link>https://aliquote.org/post/hash-collision/</link><pubDate>Wed, 25 Jan 2023 09:17:27 +0100</pubDate><guid>https://aliquote.org/post/hash-collision/</guid><description>&lt;p&gt;It is usually assumed that the probability of getting the same hash value for two different input items is approximately $\frac{k^2}{2N}$, for $k$ random hash keys ($0 &amp;lt; k &amp;lt; N$) taking up to $N$ possible values.&lt;/p&gt;
&lt;p&gt;In essence, it is a lot like the &lt;a href="https://aliquote.org/post/paradoxe-anniversaires/"&gt;birthday paradox&lt;/a&gt; that we discussed earlier. Let us start to enumerate the case where hash keys are all unique. With $N$ possible values, after we pick the first key, there are $N-1$ remaining keys out of $N$, hence the probability $\frac{N-1}{N}$ of randomly generating two distinct integers. Then, $N-2$ keys remains, and so forth, so that in the end the probability of randomly generating $k$ integers that are all unique is $\frac{N-1}{N} \times \frac{N-2}{N} \times \cdots \times \frac{N-(k-1)}{N}$. Using Taylor expansion, this last expression can be approximated by $e^{\frac{-k(k-1)}{2N}}$, which is what we ended up considering in the Birthday&amp;rsquo;s paradox as well. The probability of a hash collision is therefore&lt;/p&gt;
&lt;p&gt;$$1 - e^{\frac{-k(k-1)}{2N}}.$$&lt;/p&gt;
&lt;p&gt;However, it can further be shown that for $x$ small, $1-e^{-x} \approx x$, which means that the probability expressed above can also be approximated with $\frac{k(k-1)}{2N}$. No more floating points! FInally, if $k$ is large, then $k(k-1) \approx k^2$, and we find our $\frac{k^2}{2N}$ expression from the beginning.&lt;/p&gt;
&lt;p&gt;You may also like &lt;a href="https://stats.stackexchange.com/a/524418/930"&gt;How do you find quantiles in this balls-in-bins problem?&lt;/a&gt;, and &lt;a href="https://stackoverflow.com/questions/1155008/how-unique-is-uuid"&gt;How unique is UUID?&lt;/a&gt;.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Toggi Jonsson Quarted • &lt;em&gt;Von&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>January in review</title><link>https://aliquote.org/post/micro-review-022/</link><pubDate>Sat, 21 Jan 2023 18:41:31 +0100</pubDate><guid>https://aliquote.org/post/micro-review-022/</guid><description>&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://kevinheavey.github.io/modern-polars/"&gt;Modern Polars&lt;/a&gt; offers a side by side comparison of the Polars and Pandas libraries for working with rectangular datasets in Python. From reading the Polars documentation, I like the idea of having select or filter methods, instead of relying on Pandas default indexing facilities. We can even address rows and columns using numbers, like in R, which would make transitioning from R data frame less hard than when using Pandas. See also &lt;a href="https://www.confessionsofadataguy.com/replacing-pandas-with-polars-a-practical-guide/"&gt;Replacing Pandas with Polars. A Practical Guide&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://iximiuz.com/en/posts/ssh-tunnels/"&gt;A Visual Guide to SSH Tunnels: Local and Remote Port Forwarding&lt;/a&gt;: This is a handy tutorial for local and remote &lt;a href="https://www.ssh.com/academy/ssh/tunneling-example#remote-forwarding"&gt;port forwarding&lt;/a&gt; with great illustrations. It covers everything you need to know to use ssh tunnels confidently. &amp;ldquo;The mnemonics are &amp;ldquo;ssh -L local:remote&amp;rdquo; and &amp;ldquo;ssh -R remote:local&amp;rdquo; and it&amp;rsquo;s always the left-hand side that opens a new port.&amp;rdquo;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you are looking for a quick but opinionated overview of Vim&amp;rsquo;s for editing code at the speed of light, &lt;a href="https://www.trickster.dev/post/vim-is-touch-typing-on-steroids/"&gt;Vim is touch-typing on steroids&lt;/a&gt; does a great job.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="http://ivory.idyll.org/blog/2023-snakemake-slithering-section-1.html"&gt;snakemake for doing bioinformatics - a beginner&amp;rsquo;s guide &lt;/a&gt;: I&amp;rsquo;m still not convinced that &lt;a href="https://snakemake.readthedocs.io/en/stable/"&gt;snakemake&lt;/a&gt; is the best way to manage data processing using shell commands, and I&amp;rsquo;m still relying on Bash scripts and occasionally good old Makefile. Things that really rock, though, are job caching and multi-core capabilities (based on binary knapsack optimisation).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;A while ago I learned about phased packages in Ubuntu (there seems to be an increasing number of such phasing process in the 22.04 LTS, by the way), but Chris Siebenmann covers it elegantly in one of his recent &lt;a href="https://utcc.utoronto.ca/~cks/space/blog/linux/Ubuntu2204ServerPhasedUpdates"&gt;blog post&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://mort.coffee/home/fast-interpreters/"&gt;Faster virtual machines: Speeding up programming language execution&lt;/a&gt;: For compiler and static typing enthusiasts. See also &lt;a href="https://mark.masmcode.com/"&gt;Assembly Optimization Tips&lt;/a&gt; for more optimization on the dark side.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.robinlinacre.com/demystifying_arrow/"&gt;Demystifying Apache Arrow&lt;/a&gt;: A quick and decent summary of Apache Arrow main features for data munging.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.thatgeoguy.ca/blog/2023/01/04/reflections-on-transducers/"&gt;Reflecting on Transducers&lt;/a&gt;, or how to get around Scheme missing a generic way to operate over different collections.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://lisp-journey.gitlab.io/blog/these-years-in-common-lisp-2022-in-review/"&gt;These Years in Common Lisp: 2022 in review&lt;/a&gt;: A thorough overview of what happened last year in the CL ecosystem. This covers various topics like the previous year (concurrency, databases, games and graphics, etc.). I like this kind of year in review since it allows me to discover a lot of interesting projects like &lt;a href="https://github.com/kaveh808/kons-9"&gt;Kons-9&lt;/a&gt;, for instance. If you are into gaming (coding and/or playing), you probably heard of &lt;a href="https://github.com/Shirakumo/kandria"&gt;Kandria&lt;/a&gt; which was released in recent months. If you want to learn more about CL, the author is currently working on a &lt;a href="https://lisp-journey.gitlab.io/blog/i-am-creating-a-common-lisp-video-course-on-udemy/"&gt;Common Lisp Video Course&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://overexact.com/rust-for-professionals/"&gt;Rust for professionals&lt;/a&gt; is a short introduction to Rust, intended for developers that already know another language, according to its author. It is a bit like learn xx in xx hours/days/weeks, but it may help getting a taste of the language before delving in the &lt;a href="https://doc.rust-lang.org/book/index.html"&gt;Rust book&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ kim dracula • &lt;em&gt;Paparazzi&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Mathematica for statistics</title><link>https://aliquote.org/post/mathematica-for-statistics/</link><pubDate>Wed, 18 Jan 2023 21:12:13 +0100</pubDate><guid>https://aliquote.org/post/mathematica-for-statistics/</guid><description>&lt;p&gt;I have long been interested in replacing R or Stata with Mathematica. I know it&amp;rsquo;s not entirely possible due to the large amount of dedicated statistical routines (especially, post-fit procedures) available in these two statistical packages, but Mathematica is fine for most use cases I encountered the last two years, i.e. fitting a linear regression to a bivariate datasets, &lt;a href="https://mathematica.stackexchange.com/a/89148/167"&gt;fitting splines&lt;/a&gt;, computing pairwise correlation coefficient, working with &lt;a href="https://mathematica.stackexchange.com/q/153734/167"&gt;contingency tables&lt;/a&gt;, etc.&lt;/p&gt;
&lt;p&gt;Eralier on I wrote a quick tutorial on how to fit a simple &lt;a href="https://aliquote.org/post/logistic-fit-mathematica/"&gt;logistic regression&lt;/a&gt; model with Mathematica. Anton Antonov has a nice &lt;a href="https://mathematicaforprediction.wordpress.com/"&gt;blog&lt;/a&gt; which describes common tasks in statistics or machine learning, and plently of examples in his GitHub repository on &lt;a href="https://github.com/antononcube/MathematicaVsR"&gt;R vs. Mathematica&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;One of the nice feature of Mathematica is that the basic data structure for working with data is the &lt;a href="https://reference.wolfram.com/language/tutorial/ManipulatingLists.html"&gt;list&lt;/a&gt;. Expressions like &lt;code&gt;{{1, 0.8}, {2, 3.2}, ...}&lt;/code&gt; allows to construct a bivariate series, which can be manipulated using lot of built-in functions, and formatted accordingly in Matrix form or as a grid. Moreover, there&amp;rsquo;s now the &lt;code&gt;Dataset&lt;/code&gt; structure, although it is not ready to be consumed by most statistical fitting routines I&amp;rsquo;m interested in. Anyway, using lists as the basis for higher-order data structures is really nice, especially when you&amp;rsquo;re already involved in the Python ecosystem. I like the following reply on &lt;a href="https://news.ycombinator.com/item?id=9797936"&gt;HN&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Mathematica is an interesting case study for a general-purpose software package that happens to be more feature-full and functional &amp;ndash; not just &amp;ldquo;more convenient&amp;rdquo; or &amp;ldquo;better UX&amp;rdquo; &amp;ndash; than any open-source counterparts.&lt;br&gt;
I tend to use some proprietary scientific software, but a lot of it is because academia already has already invested in codebases for, say, Stata, GAMS, Matlab and so on. But Matlab is two steps removed from raw Fortran; and what sets it apart from the many identical-syntax clones are a few narrowly-oriented toolsets aimed at some kinds of engineers.&lt;br&gt;
Mathematica is the only one I buy versions for my home computer. It&amp;rsquo;s very, very good.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Same for me, except that I also have a paid license for Stata 13 MP.&lt;/p&gt;
&lt;p&gt;Here is a toy example of fitting a linear regression model in Mathematica:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Table&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;RandomReal&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="mi"&gt;-3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;}],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;RandomReal&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="mi"&gt;-2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;}]},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;}];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Dataset&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Prepend&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;x&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;y&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;}]]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;lm&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;LinearModelFit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;lm&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;BestFit&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Show&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ListPlot&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Plot&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;lm&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;}]]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Even if this is a contrived example, it shows how easy it is to generate an artificial dataset, which can be printed much like an R &lt;code&gt;data.table&lt;/code&gt; or Pandas data frame, to feed built-in functions. Most of Mathematica builtin functions are self-contained, which means there are a lot of optional parameters (but default values are usually good) and function names are generally well chosen. Default graphics are also well composed, as shown below:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/ols_mathematica.png"&gt;
&lt;/figure&gt;
&lt;p&gt;One day, I will probably translate my old &lt;a href="https://even4void.github.io/rstats-biostats/"&gt;biostatistics&lt;/a&gt; tutorial to Mathematica.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Lars Bygdén • &lt;em&gt;Fall Into The Night&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Recently</title><link>https://aliquote.org/post/recently-january-2023/</link><pubDate>Tue, 17 Jan 2023 20:41:53 +0100</pubDate><guid>https://aliquote.org/post/recently-january-2023/</guid><description>&lt;p&gt;Same desktop environment for over five or six months, similar window tiling across session, and same tools as well: Neovim, Irssi, Tmux, Alacritty, Zsh, Cmus, Newsboat. No more config tweaks, since almost everything work as expected. Once you get the right tools, properly configured, stick with them and use them everyday.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2023-01-17-21-13-06.png"&gt;
&lt;/figure&gt;
&lt;p&gt;I&amp;rsquo;ve been pretty busy the last two weeks with a new course on bioinformatics for genomic applications. I did a biostatistics refresher too, after a long hiatus (5 years with no teaching at all). It was exhausting, though. Some stuff need to be improved for the next session, but overall I was pretty happy with how things went along the course.&lt;/p&gt;
&lt;p&gt;I deleted my Last.fm account (I got the annual statistics I wanted to see, and I&amp;rsquo;m not interested in any tracking or recommendation system). I didn&amp;rsquo;t renewed my paid subscription to Apple TV and Music, since they decided to increase their rates (at least by 2 € each). I&amp;rsquo;m almost done with Apple products by now, but I will keep by email address as well as my MacBook which runs fine under &lt;a href="https://aliquote.org/post/bye-bye-apple/"&gt;Mojave&lt;/a&gt;. Mojave is v10.14 while we are now at Ventura v13. I think I never look at the new functionalities starting from Catalina, and I don&amp;rsquo;t think I missed a lot in hindsight. Newly released laptops look great, with top notch specs, even for the new MacBook Air, although there have now become unaffordable when you want to increase default RAM or HD capabilities. The same applies to iPhone, not to mention the fact that they are now only available in a format close to a tablet.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ La Rue Kétanou • &lt;em&gt;La fiancée de l&amp;rsquo;eau&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in December</title><link>https://aliquote.org/post/micro-12-2022/</link><pubDate>Fri, 30 Dec 2022 20:35:59 +0100</pubDate><guid>https://aliquote.org/post/micro-12-2022/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-12-05&lt;/a&gt;: &lt;a href="https://sqlfordevs.com/ebook"&gt;The Database Cookbook For Developers&lt;/a&gt;. &lt;code&gt;#database&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-12-05&lt;/a&gt;: ♪ Neil Young · Heart Of Gold&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-12-06&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;And we see that machines can fail Statistics, just like college students. &amp;mdash; &lt;a href="https://matloff.wordpress.com/2022/12/04/just-how-good-is-chatgpt-in-data-science/"&gt;Just How Good Is ChatGPT in Data Science?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-12-08&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Code can only ever be fast if it&amp;rsquo;s written with the contraints of computer hardware in mind, and idiomatic Python isn&amp;rsquo;t. &amp;mdash; &lt;a href="https://viralinstruction.com/posts/goodjulia/"&gt;What&amp;rsquo;s great about Julia?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-12-08&lt;/a&gt;: ♪ New Order · 5 8 6 (2020 Digital Master)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-12-15&lt;/a&gt;: ♪ Mal Waldron · Mistral Breeze / Sieg Haile&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-12-19&lt;/a&gt;: &lt;a href="https://mifi.no/losslesscut/"&gt;LosslessCut&lt;/a&gt;: The Swiss Army Knife of Lossless Video/Audio Editing.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-12-20&lt;/a&gt;: &lt;a href="https://jsxgraph.org/wp/index.html"&gt;JSXGraph&lt;/a&gt;: Dynamic Mathematics with JavaScript.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-12-22&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Wavefunction Collapse is a very independent-minded algorithm, and needs almost no outside help or instruction. You feed it an example of the vibe you’re going for, and it figures everything else out for itself. Despite this self-sufficiency, it is surprisingly simple. It doesn’t use any neural networks, random forests, or anything else that sounds like machine learning. &amp;mdash; &lt;a href="https://robertheaton.com/2018/12/17/wavefunction-collapse-algorithm/"&gt;The Wavefunction Collapse Algorithm explained very clearly&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-12-22&lt;/a&gt;: &lt;a href="https://google.github.io/comprehensive-rust/"&gt;Comprehensive Rust&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-12-22&lt;/a&gt;: &lt;a href="https://foon.uk/how-flash-2022/"&gt;How I still use Flash in 2022&lt;/a&gt;. I sometimes miss that time. CSS is great but Flash was really adding value to some indie websites back in the day.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-12-22&lt;/a&gt;: &lt;a href="https://reanimate.github.io/"&gt;Reanimate&lt;/a&gt;: Build declarative animations with SVG and Haskell. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-12-22&lt;/a&gt;: ♪ Joy Division · Love Will Tear Us Apart&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-12-26&lt;/a&gt;: &lt;a href="https://github.com/apitable/apitable"&gt;APITable&lt;/a&gt;, an API-oriented low-code platform for building collaborative apps and better than all other Airtable open-source alternatives.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-12-26&lt;/a&gt;: &lt;a href="https://austinhenley.com/blog/challengingalgorithms.html"&gt;Challenging algorithms and data structures every programmer should try&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-12-26&lt;/a&gt;: &lt;a href="https://tylerneylon.com/a/lsh1/"&gt;Introduction to Locality-Sensitive Hashing&lt;/a&gt;. &lt;code&gt;#statistics&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-12-26&lt;/a&gt;: &lt;a href="http://www.stat.columbia.edu/~gelman/research/published/augie4.pdf"&gt;The Boxer, the Wrestler, and the Coin Flip: A Paradox of Robust Bayesian Inference and Belief Functions&lt;/a&gt; (PDF, 5 pp.). &lt;code&gt;#statistics&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-12-26&lt;/a&gt;: ♪ Matthew E. White · Will You Love Me&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-12-28&lt;/a&gt;: Happy lazy loading of Neovim plugins (actually 15 plugins, including 13 opt plugins):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» vim-startuptime -vimpath nvim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Extra options: []
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Measured: 10 times
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Total Average: 15.662100 msec
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Total Max: 16.085000 msec
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Total Min: 15.505000 msec
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-12-28&lt;/a&gt;: &lt;a href="https://matt.might.net/articles/26-languages-part1/"&gt;26 programming languages in 25 days&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-12-28&lt;/a&gt;: &lt;a href="https://beepb00p.xyz/annotating.html"&gt;How to annotate literally everything&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-12-28&lt;/a&gt;: &lt;a href="https://ooh.directory/"&gt;ooh.directory&lt;/a&gt;: If you&amp;rsquo;re looking for unusual or hard-to-find websites via Google or friends&amp;hellip; (h/t &lt;a href="https://www.rousette.org.uk/archives/happy-20-year-blogiversary-to-me/"&gt;bsag&lt;/a&gt;).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-12-28&lt;/a&gt;: ♪ Wolfsheim · Once In a Lifetime&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-12-30&lt;/a&gt;: Have been sick during two weeks. One week later, here are my top tags on Last.fm:&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_2858.jpeg" alt="img"&gt;&lt;br&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Computing eigenvalues using QR decomposition</title><link>https://aliquote.org/post/computing-eigenvalues/</link><pubDate>Wed, 28 Dec 2022 09:31:49 +0100</pubDate><guid>https://aliquote.org/post/computing-eigenvalues/</guid><description>&lt;p&gt;&lt;a href="https://madrury.github.io/jekyll/update/statistics/2017/10/04/qr-algorithm.html"&gt;Matthew Drury&lt;/a&gt; made a great job explaining how eigenvalues are usually computed, via the QR decomposition. This is an iterative algorithm which is available in Numpy, &lt;code&gt;numpy.linalg.qr&lt;/code&gt;, while in R it is directly &lt;code&gt;qr&lt;/code&gt;. We already discussed the QR decomposition in a &lt;a href="https://aliquote.org/post/lisp-qr-regression/"&gt;previous post&lt;/a&gt;. Basically, the idea is as follows: Let $X$ be a symmetric matrix, compute $X_k = Q_kR_k$, for $k=1,\dots,n$, and update $X_{k+1}=R_kQ_k$. The sequence of $X_n$ converges to a diagonal matrix $D$ of eigenvalues, such that the eigenvectors are the columns of $\prod_i Q_i$.&lt;/p&gt;
&lt;p&gt;In Racket, the very first iteration would read:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;require&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;X0&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;matrix&lt;/span&gt; &lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt; &lt;span class="mi"&gt;-51&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt; &lt;span class="mi"&gt;167&lt;/span&gt; &lt;span class="mi"&gt;-68&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;-4&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt; &lt;span class="mi"&gt;-41&lt;/span&gt;&lt;span class="p"&gt;]]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;X&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;matrix+&lt;/span&gt; &lt;span class="n"&gt;X0&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;matrix-transpose&lt;/span&gt; &lt;span class="n"&gt;X0&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;; (define D (diagonal-matrix &amp;#39;(1 1 1)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;D&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;identity-matrix&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define-values&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Q&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;matrix-qr&lt;/span&gt; &lt;span class="n"&gt;X&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;D&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;matrix*&lt;/span&gt; &lt;span class="n"&gt;D&lt;/span&gt; &lt;span class="n"&gt;Q&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;X&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;matrix*&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt; &lt;span class="n"&gt;Q&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Wrap the above code in a function, iterate 20 to 30 times and then the $X$ matrix should contain the eigenvalues on its diagonal.&lt;/p&gt;
&lt;p&gt;Of note, the Householder method for computing the QR decomposition in Racket is available on &lt;a href="https://rosettacode.org/wiki/QR_decomposition#Racket"&gt;Rosetta&lt;/a&gt;.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2023-05-23]&lt;/small&gt;&lt;br&gt;
For other numerical approaches to computing eigenvectors and eigenvalues, see this excellent blog post by Marc Khoury: &lt;a href="https://marckhoury.github.io/blog/numerical-algorithms-for-computing-eigenvectors"&gt;Numerical Algorithms for Computing Eigenvectors&lt;/a&gt;.
&lt;/div&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Clan of Xymox • &lt;em&gt;A Day&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>December in review</title><link>https://aliquote.org/post/micro-review-021/</link><pubDate>Mon, 19 Dec 2022 10:33:05 +0100</pubDate><guid>https://aliquote.org/post/micro-review-021/</guid><description>&lt;p&gt;A quick summary of what I&amp;rsquo;ve read lately.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;I&amp;rsquo;ve been trying &lt;a href="https://github.com/exaloop/codon"&gt;codon&lt;/a&gt; recently. I didn&amp;rsquo;t make extensive benchmarks on some of my numerical code, but it already looks like it could be really interesting to speed up some computation, or at least to have sane static type checking ahead of time.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://biriukov.dev/docs/fd-pipe-session-terminal/"&gt;GNU/Linux shell related internals&lt;/a&gt;, by Viacheslav Biriukov, provides a very nice descritption of Unix shell, pipes &amp;amp; Co. I came across another good website about computing: &lt;a href="https://beautiful.software/"&gt;Beautiful Software&lt;/a&gt;, which is Christopher Alexander&amp;rsquo;s research initiative on computing and the environment.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;Ultimately, we want to help human intuition to do what it does best. That means people&amp;rsquo;s interactions with computers should only help them to do what is needed, to inform them, to help them connect to the real world, and to draw their attention towards important things they&amp;rsquo;ve forgotten, and away from unimportant things they&amp;rsquo;re too focused upon.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;People keep getting moving (GitHub, Twitter, Slack, etc.). Now, Gitea changed their mind and &lt;a href="https://blog.codeberg.org/codeberg-launches-forgejo.html"&gt;Codeberg launches Forgejo&lt;/a&gt;. I&amp;rsquo;m still on GitHub since I only host hobby projects there, plus a couple of work-related shared and private repositories. I was interested in Codeberg or SourceHut at some point, but finally ended up staying on GitHub. However, I should probably jutst host my own RCS system.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I still have a lot of Lisp and Scheme-related books to review (one of those reviews will probably end up on this blog by the end of the year), but in the meantime you may enjoy reading &lt;a href="https://www.tfeb.org/fragments/2022/12/16/the-empty-list/"&gt;The empty list&lt;/a&gt; by Tim Bradshaw. It&amp;rsquo;s always a pleasure to read his articles on Lisp.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The year of Linux on the desktop? &lt;a href="https://fabiensanglard.net/a_linux_evening/index.html"&gt;A Linux evening&lt;/a&gt; On a related note, the RAM used by &lt;a href="https://itvision.altervista.org/linux-desktop-environments-system-usage.html"&gt;some of the common WMs&lt;/a&gt; on Linux is astonishing, e.g. KDE or Gnome, compared to lightweight solutions.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;The magic disappeared and our optimism has since faded. Our websites are slow and insecure; our startups are creepy and unprofitable; our president Tweets hate speech; we don’t trust our social media apps, webcams, or voting machines. And in the era of coronavirus quarantining, we’re realizing just how inadequate the Internet turned out to be as a home of Mind. &amp;mdash; &lt;a href="https://blog.jse.li/posts/software/"&gt;Where Did Software Go Wrong?&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The above blog post somewhat reminds me of Niki Tonsky&amp;rsquo;s &lt;a href="https://tonsky.me/blog/disenchantment/"&gt;Software disenchantment&lt;/a&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://jacek.zlydach.pl/blog/2019-07-24-algebraic-effects-you-can-touch-this.html"&gt;Algebraic Effects - You Can Touch This!&lt;/a&gt;: An interesting discussion on condition systems in CL.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;It&amp;rsquo;s time for advent of code. I keep reading interesting blog posts on the subject. Here&amp;rsquo;s one: &lt;a href="https://www.mattkeeter.com/blog/2022-12-10-xor/"&gt;A Neat XOR Trick&lt;/a&gt;, to find the first W-character window in which every character is unique in O(N) running time, with no dependence on the window size.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Bauhaus • &lt;em&gt;Bela Lugosi&amp;rsquo;s Dead&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Recently</title><link>https://aliquote.org/post/recently-december-2022/</link><pubDate>Thu, 08 Dec 2022 09:23:53 +0100</pubDate><guid>https://aliquote.org/post/recently-december-2022/</guid><description>&lt;p&gt;I&amp;rsquo;ve been away from this blog for a while now, but I&amp;rsquo;ve have been busy elsewhere, mostly drawing in my sketchbooks at home, and tackling various projects at work. Recently we got a 96-core Xeon with 512 Go RAM and an NVidia GPU. I can&amp;rsquo;t wait to test what it does for intensive parallel computing.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_2773.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_2773.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_2808.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_2808.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_2819.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_2819.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;I deleted my Twitter account some time ago. Since then, most of my technological reviews come from my RSS feeds, Hacker News, ArXiv, and some targeted DDG queries. I don&amp;rsquo;t miss Twitter, my timeline was a just a giant mess even after several rounds of curation. I left some months before the mass transfer of users to Mastodon. Most of the bright people I was following on Twitter left as well, so I don&amp;rsquo;t regret my choice. But I don&amp;rsquo;t plan to join Mastodon or the Fediverse. Recent articles that discuss the Twitter-to-Mastodon switch and that attracted my attention are: soem of jwz&amp;rsquo;s post as referred to by Tom MacWright in his [montly review][] and &lt;a href="https://technomancy.us/199"&gt;in which legibility comes at a price&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve been working on a fun side project using Clojure, and I was pleasantly surprised by the quality of the &lt;a href="https://clojure-lsp.io/"&gt;language server&lt;/a&gt;. Clojure is a great langauge after all. It&amp;rsquo;s been 8 years since I promised myself to seriously invest in it and I procrastinate around missed opportunities or other more urgent projects. Same for Julia, since it appears to be much more stabilized nowadays.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve been trying &lt;a href="https://aliquote.org/post/helix-editor/"&gt;Helix editor&lt;/a&gt; again, but overall I like my Neovim configuration better. However, I should note this really is a great project and it&amp;rsquo;s good there&amp;rsquo;s some competitive solutions sitting around. Sadly, Onivim development has &lt;a href="https://github.com/onivim/oni2/issues/3811#issuecomment-910306404"&gt;stopped recently&lt;/a&gt;. Yes, I too love &lt;a href="https://andreyorst.gitlab.io/posts/2020-04-29-text-editors/"&gt;editors&lt;/a&gt;.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2023-05-23]&lt;/small&gt;&lt;br&gt;
See this recent review of Helix: &lt;a href="https://alpha2phi.medium.com/a-walkthrough-on-helix-a-post-modern-modal-text-editor-faf573d16892"&gt;A Walkthrough on Helix — A Post-Modern Modal Text Editor&lt;/a&gt;. It&amp;rsquo;s hard to fight muscle memory, though, even if there&amp;rsquo;s some support for &lt;a href="https://github.com/helix-editor/helix/wiki/FAQ#is-a-vivim-keymap-planned"&gt;Vim keybindings&lt;/a&gt;.
&lt;/div&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ New Order • &lt;em&gt;Leave Me Alone&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in November</title><link>https://aliquote.org/post/micro-11-2022/</link><pubDate>Tue, 29 Nov 2022 19:35:26 +0100</pubDate><guid>https://aliquote.org/post/micro-11-2022/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-11-03&lt;/a&gt;: ♪ Melanie De Biasio · Your Freedom Is the End of Me&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-04&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Before we embark on yet another defense of the language along the lines of: parentheses in Lisp are great, but only insiders can understand them. Let&amp;rsquo;s notice a second element that often confuses those who learn the language: in Lisp everything is prefixed. &amp;mdash; &lt;a href="https://github.com/naver/lispe/wiki/6.16-Why-Lisp"&gt;Why Lisp&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-11-04&lt;/a&gt;: &lt;a href="https://0pointer.net/blog/linux-boot-partitions.html"&gt;Linux Boot Partitions and How to Set Them Up&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-04&lt;/a&gt;: ♪ Joy Division · Transmission&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-08&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;It’s easy to get hung up on this. I’ve definitely felt the self-imposed pressure to only write something if it’s new, and unique, and feels like it’s never been said before. This is a mental trap that does nothing but hold you back. &amp;mdash; &lt;a href="https://simonwillison.net/2022/Nov/6/what-to-blog-about/"&gt;What to blog about&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-11-08&lt;/a&gt;: &lt;a href="https://blog.yossarian.net/2022/02/21/Enjoying-music-curation-again"&gt;Enjoying music curation again&lt;/a&gt; (via &lt;a href="https://otavio.dev/2022/10/05/newsletter-31-09-2022/"&gt;O. Valadares&amp;rsquo; Blog&lt;/a&gt;).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-08&lt;/a&gt;: &lt;a href="https://blog.broulik.de/2022/11/performance-musings/"&gt;Performance Musings&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-08&lt;/a&gt;: &lt;a href="https://stackoverflow.blog/2022/09/08/this-is-not-your-grandfathers-perl/"&gt;This is not your grandfather’s Perl&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-12&lt;/a&gt;: ♪ The White Stripes · Truth Doesn&amp;rsquo;t Make A Noise&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-14&lt;/a&gt;: &lt;a href="https://futhark-lang.org/"&gt;Futhark&lt;/a&gt; is a small programming language designed to be compiled to efficient parallel code.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-14&lt;/a&gt;: &lt;a href="https://coalton-lang.github.io/20220827-numbers/"&gt;Numbers in a Nutshell, an Update&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-14&lt;/a&gt;: &lt;a href="https://www.b-list.org/weblog/2022/aug/16/async/"&gt;Understanding async Python for the web&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-14&lt;/a&gt;: &lt;a href="https://pickard.cc/posts/why-does-zsh-start-slowly/"&gt;Why does zsh start so slowly?&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-14&lt;/a&gt;: ♪ Patti Smith Group · Seven Ways of Going&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-15&lt;/a&gt;: &lt;a href="https://simonbyrne.github.io/notes/fastmath/"&gt;Beware of fast-math&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-15&lt;/a&gt;: ♪ Anna Smyrk · Wallace Street&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-16&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Privacy is necessary for an open society in the electronic age. Privacy is not secrecy. A private matter is something one doesn&amp;rsquo;t want the whole world to know, but a secret matter is something one doesn&amp;rsquo;t want anybody to know. Privacy is the power to selectively reveal oneself to the world. &amp;mdash; &lt;a href="https://what.cd/"&gt;A Cypherpunk&amp;rsquo;s Manifesto&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-11-16&lt;/a&gt;: Great set of lecture notes: &lt;a href="https://quantecon.org/lectures/"&gt;QuantEcon Lectures&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-16&lt;/a&gt;: &lt;a href="https://vorpus.org/blog/why-does-calloc-exist/"&gt;Why does calloc exist?&lt;/a&gt;. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-16&lt;/a&gt;: &lt;a href="https://treevis.net/"&gt;treevis.net - A Visual Bibliography of Tree Visualization 2.0 by Hans-Jörg Schulz&lt;/a&gt;. &lt;code&gt;#dataviz&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-16&lt;/a&gt;: ♪ Bauhaus · In The Night&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-17&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Get ready to read a sentimental post about a data structure, and don&amp;rsquo;t tell I didn&amp;rsquo;t warn you. &amp;mdash; &lt;a href="http://antirez.com/news/138"&gt;In defense of linked lists&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-11-17&lt;/a&gt;: &lt;a href="https://mostlymaths.net/2020/05/blot-painting-p5js-sketch.html/"&gt;Blot/Painting p5js sketch&lt;/a&gt;. Lovely.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-17&lt;/a&gt;: &lt;a href="https://viewsourcecode.org/snaptoken/kilo/"&gt;Build Your Own Text Editor&lt;/a&gt;. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-17&lt;/a&gt;: ♪ Catherine Moan · Drop It!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-22&lt;/a&gt;: Today&amp;rsquo;s readings: &lt;a href="https://hypirion.com/musings/haskell-transducers"&gt;Clojure&amp;rsquo;s Transducers in Haskell&lt;/a&gt;, and &lt;a href="https://conscientiousprogrammer.com/blog/2014/08/07/understanding-cloure-transducers-through-types/"&gt;Understanding Clojure transducers through types&lt;/a&gt;. &lt;code&gt;#clojure&lt;/code&gt; &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-22&lt;/a&gt;: &lt;a href="https://chreke.com/python-tips-and-tricks.html"&gt;Python Tips &amp;amp; Tricks&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-22&lt;/a&gt;: &lt;a href="https://rust-hosted-langs.github.io/book/#writing-interpreters-in-rust-a-guide"&gt;Writing Interpreters in Rust: a Guide&lt;/a&gt;. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-23&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Using a 12-bit colour depth limits the available colours, so slight changes to hue, chroma, and luminance must be made, but these are small enough not to be noticeable. The resulting palette has evenly-spaced hues, only small variations in chroma, and smoothly increasing and decreasing luminance. &amp;mdash; &lt;a href="https://iamkate.com/data/12-bit-rainbow/"&gt;The 12-bit rainbow palette&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-11-23&lt;/a&gt;: &lt;a href="https://gist.github.com/fay59/5ccbe684e6e56a7df8815c3486568f01"&gt;Quirks of C&lt;/a&gt;. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-23&lt;/a&gt;: &lt;a href="https://www.felixcloutier.com/x86/"&gt;x86 and amd64 instruction reference&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-28&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Ranking is a farce. Apparent performance is actually attributable mostly to the system that the individual works in, not to the individual himself. &amp;mdash; W. Edwards Deming, via &lt;a href="https://www.2uo.de/deming/"&gt;Statistical process control after W. Edwards Deming&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-11-28&lt;/a&gt;: &lt;a href="http://blog.pkh.me/p/36-figuring-out-round,-floor-and-ceil-with-integer-division.html"&gt;Figuring out round, floor and ceil with integer division&lt;/a&gt;. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-28&lt;/a&gt;: &lt;a href="https://andreyorst.gitlab.io/posts/2022-10-07-gnome-doesnt-need-to-be-that-huge/"&gt;GNOME doesn&amp;rsquo;t need to be that huge&lt;/a&gt;. &lt;code&gt;#apple&lt;/code&gt; &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-28&lt;/a&gt;: ♪ Anthony Joseph · Swing Praxis (Kaidi Tatham Remix)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-29&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The short version is that most of your Instagram photos are hidden from your followers unless they receive engagement in the form of likes and comments. &amp;mdash; &lt;a href="https://criticalmas.org/2019/06/the-indie-web-is-dead-long-live-the-indie-web/"&gt;The Indie Web is Dead, Long Live the Indie Web&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-11-29&lt;/a&gt;: So many things already built-in in Mathematica&amp;hellip; via &lt;a href="https://www.rangakrish.com/index.php/2022/11/24/using-julia-from-mathematica/"&gt;Using Julia from Mathematica&lt;/a&gt;&lt;br&gt;&lt;img src="https://aliquote.org/img/2022-11-29-14-43-20.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-29&lt;/a&gt;: &lt;a href="https://tmewett.com/c-tips/"&gt;Everything I wish I knew when learning C&lt;/a&gt;. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-29&lt;/a&gt;: &lt;a href="https://learngenomics.dev/"&gt;Introduction to Genomics for Engineers&lt;/a&gt;. &lt;code&gt;#bioinformatics&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-29&lt;/a&gt;: &lt;a href="https://arnesonium.com/2022/11/pattern-matching-tail-recursion-emacs-lisp"&gt;Pattern Matching and Tail Recursion in Emacs Lisp&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-29&lt;/a&gt;: &lt;a href="https://www.rosipov.com/blog/sane-vim-defaults-from-neovim/"&gt;Sane Vim defaults (from Neovim)&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-29&lt;/a&gt;: &lt;a href="https://explained.ai/matrix-calculus/index.html"&gt;The Matrix Calculus You Need For Deep Learning&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-11-29&lt;/a&gt;: ♪ Norah Jones · To Live&lt;br&gt;&lt;/p&gt;</description></item><item><title>What not to compute</title><link>https://aliquote.org/post/what-not-to-compute/</link><pubDate>Sun, 30 Oct 2022 09:14:07 +0100</pubDate><guid>https://aliquote.org/post/what-not-to-compute/</guid><description>&lt;p&gt;Usually for odd powers of the sine function, we use a little trick that relies on &lt;a href="https://www.whitman.edu/mathematics/calculus_online/section08.02.html"&gt;trigonometric identities and substitution&lt;/a&gt;. For instance, $\int\sin^3(x)dx = \int\sin(x)\sin^2(x) = \int\sin(x)(1-\cos^2(x))$, then using the substitution $u=\cos(x)$, we get $\int -(1-u^2)du\vert_{u=\cos(x)} = \cos^3(x)/3 - \cos(x) + c$.&lt;/p&gt;
&lt;p&gt;In &lt;em&gt;Numerical Methods That (Usually) Work&lt;/em&gt;, Forman S. Acton included a short interlude on what not to compute. This section is intended as a way to think carefully about numerical computation with a computer based on analytic solutions and rather think whether good enough approximations can be used.&lt;/p&gt;
&lt;p&gt;As an example, consider the expression $\int_0^{0.3} \sin^8\theta\cdot d\theta$. We have&lt;/p&gt;
&lt;p&gt;$$
\begin{equation}
\begin{aligned}
\int_0^{0.3} \sin^8\theta\cdot d\theta &amp;amp;= \left[(-\frac{1}{8}\cos\theta)(\sin^4\theta + \frac{7}{6}\sin^2\theta + \frac{35}{24})(\sin^3\theta) + \frac{105}{384}(\theta - \sin 2\theta)\right]_0^{0.3}\cr
&amp;amp;= (-0.119417)(0.007627 + 0.101887 + 1.458333)(0.0258085) + 0.004341\cr
&amp;amp;= -0.0048320 + 0.0048341 = 0.0000021
\end{aligned}
\end{equation}
$$&lt;/p&gt;
&lt;p&gt;Note that this formula allows to compute a small number based on the difference between two much larger numbers. However, using a crude approximation for $\sin\theta$,&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; we get&lt;/p&gt;
&lt;p&gt;$$ \int_0^{0.3} \theta^8\cdot d\theta = \frac{1}{9}\left[\theta^9\right]_0^{0.3} = 0.00000219. $$&lt;/p&gt;
&lt;p&gt;A second term in the series can be added if more precision is required. You may also like &lt;a href="https://datagenetics.com/blog/july12019/index.html"&gt;Approximating the Sine Function&lt;/a&gt;.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Christian Death • &lt;em&gt;Spiritual Cramp&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Recall that $\sin(x) \approx x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + \dots$.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in October</title><link>https://aliquote.org/post/micro-10-2022/</link><pubDate>Sat, 29 Oct 2022 16:01:45 +0200</pubDate><guid>https://aliquote.org/post/micro-10-2022/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-10-03&lt;/a&gt;: Newsboat can use any external browser for displaying posts. E.g., Elinks instead of Firefox to allow for a more comfortable browsing experience while staying in a terminal:&lt;br&gt;&lt;img src="https://aliquote.org/img/2022-10-03-12-30-15.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-03&lt;/a&gt;: &lt;a href="https://zignar.net/2022/10/01/new-lsp-features-in-neovim-08/"&gt;New LSP features in Neovim 0.8&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-05&lt;/a&gt;: &lt;a href="https://math.recipes/"&gt;Mathematical recipes (early draft)&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-05&lt;/a&gt;: &lt;a href="https://duckdb.org/2022/09/30/postgres-scanner.html"&gt;Querying Postgres Tables Directly From DuckDB&lt;/a&gt;. &lt;code&gt;#database&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-05&lt;/a&gt;: ♪ This Mortal Coil · Song to the Siren&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-06&lt;/a&gt;: &lt;a href="https://www.cs.umd.edu/class/fall2022/cmsc430/index.html"&gt;Design and Implementation of Programming Languages&lt;/a&gt;. &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-06&lt;/a&gt;: &lt;a href="https://vi.stackexchange.com/questions/37397/how-to-configure-neovim-to-properly-format-python-code"&gt;How to configure neovim to properly format python code?&lt;/a&gt;. Simpler solution is to add this mapping to your &lt;code&gt;after/ftplugin/python.vim&lt;/code&gt;: &lt;code&gt;nmap &amp;lt;buffer&amp;gt; g= :!black --quiet %&amp;lt;cr&amp;gt;:redraw!&amp;lt;cr&amp;gt;:!isort -q %&amp;lt;cr&amp;gt;:redraw!&amp;lt;cr&amp;gt;&lt;/code&gt;. Not sure if we really need two &lt;code&gt;redraw&lt;/code&gt;, but it works quite well. This could be put in an autocommand if we want to format on save, say. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-06&lt;/a&gt;: &lt;a href="https://xai.sh/2020/10/16/Move-running-process-into-tmux-session.html"&gt;Move a running process into a tmux session&lt;/a&gt;. This happened to me in the past, and I came up with a different solution, which involves the same steps but without reptyr IIRC. Now I forgot how I did&amp;hellip;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-06&lt;/a&gt;: &lt;a href="https://terrytao.wordpress.com/2022/10/03/what-are-the-odds/"&gt;What are the odds?&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-06&lt;/a&gt;: ♪ Bauhaus · Bela Lugosi Is Dead&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-07&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If you just want the executive summary, here it is: these are definitely interesting algorithms from an arithmetic complexity theory standpoint – especially for the case of 4×4 matrices over finite fields, where (to the best of my knowledge) Strassen’s algorithm from 1969 was still the reigning champion. These algorithms are also practically relevant, meaning that not only do they have better asymptotic lower bounds than Strassen’s algorithm, they are still algorithms you might actually use in practice, unlike essentially everything else that has been written on the topic in the last 50 years: these algorithms are correct, and will in principle win over Strassen’s algorithm with large enough matrices, but that cut-off is well beyond the sizes that anyone is actually doing computations with. &amp;mdash; &lt;a href="https://fgiesen.wordpress.com/2022/10/06/on-alphatensors-new-matrix-multiplication-algorithms/"&gt;On AlphaTensor’s new matrix multiplication algorithms&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-10-07&lt;/a&gt;: &lt;a href="https://github.com/sandydoo/flux"&gt;An open-source tribute to the macOS Drift screensaver&lt;/a&gt;. I always enjoyed the &amp;ldquo;flame&amp;rdquo; screensaver, but that may well do the job as well! &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-07&lt;/a&gt;: &lt;a href="https://brandur.org/fragments/postgres-partitioning-2022"&gt;Partitioning in Postgres, 2022 edition&lt;/a&gt;. &lt;code&gt;#database&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-07&lt;/a&gt;: ♪ Front 242 · Headhunter&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-09&lt;/a&gt;: ♪ Dead or Alive · You Spin Me Round (Like a Record)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-10&lt;/a&gt;: &lt;a href="https://www.bitsgalore.org/2021/09/06/pdf-processing-and-analysis-with-open-source-tools"&gt;PDF processing and analysis with open-source tools&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-10&lt;/a&gt;: &lt;a href="https://developer.apple.com/documentation/virtualization/running_gui_linux_in_a_virtual_machine_on_a_mac"&gt;Running GUI Linux in a virtual machine on a Mac&lt;/a&gt;. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-10&lt;/a&gt;: ♪ London After Midnight · Demon&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-11&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;(&amp;hellip;) code should be as evident and transparent as possible in it’s intent and declarative programing (therefore functional programming) help us achieve this goal more effectively and efficiently than imperative programing. &amp;mdash; &lt;a href="http://luizsol.com/why-functional-programming/"&gt;Why I use typed functional programming&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-10-11&lt;/a&gt;: &lt;a href="https://plaintextproject.online/articles.html"&gt;The Plain Text Project&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-17&lt;/a&gt;: &lt;a href="https://www.solopianoradio.com/"&gt;https://www.solopianoradio.com/&lt;/a&gt;. A good deal of piano for everyone!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-17&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Instagram users can only write plaintext without any formatting and it even doesn’t look nice onthe phone and you have to insert an image even in case you only want to post a message and youknow what? Nobody cares. I can only talk about russian speaking segment of the platform but theamount of activity there is just crazy. People not only share cat photos there, but also buy andsell stuff, write analytical articles, do workshops and trainings without any problem. The factthat sometimes they have to literally edit the photo and put a text overlay on top of it (and itoften looks like some of the worst myspace examples) doesn’t bother anyone. And all thecommunication is solved with a restricted instagram account or a closed whatsapp group. &amp;mdash; &lt;a href="https://can3p.github.io//blog_draft/2022/10/14/no-html/"&gt;From the basics to complexity and back&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-10-17&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The academic prestige of Latin and Greek underwent a steady, centuries long decline. Where do C and assembly fit on this map? We certainly aren’t in a Medieval University, where these topics were mandatory, but neither are we in a post-modern sociology class, where the classics are not only dead, but whose distant memory haunts our conscience. &amp;mdash; &lt;a href="https://codeofhonor.substack.com/p/learn-enough-c-to-survive"&gt;Learn enough C to survive&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-10-17&lt;/a&gt;: Never got into J, but what a language! &lt;a href="https://asindu.xyz/2022/10/08/random-walk-in-2-lines-of-j/"&gt;Random walk in 2 lines of J&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-17&lt;/a&gt;: &lt;a href="https://thephd.dev/c23-is-coming-here-is-what-is-on-the-menu"&gt;C23 is Finished: Here is What is on the Menu&lt;/a&gt;. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-17&lt;/a&gt;: &lt;a href="https://amontalenti.com/2022/10/09/python-packaging-and-zig"&gt;How Python programmers can uncontroversially approach build, dependency, and packaging tooling (+ a note on Zig)&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-17&lt;/a&gt;: &lt;a href="https://web.cecs.pdx.edu/~mpj/thih/thih.pdf"&gt;Typing Haskell in Haskell&lt;/a&gt; (PDF, 38 pp.). &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-17&lt;/a&gt;: ♪ Clan of Xymox · Equal Ways&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-18&lt;/a&gt;: TIL about &lt;a href="https://bboxtype.com/typefaces/FiraGO/#!layout=specimen"&gt;FiraGO&lt;/a&gt;. Togther with &lt;a href="https://github.com/firamath/firamath"&gt;Fira Math&lt;/a&gt;, it makes for a perfect combination of fonts for handouts and slides. Now, it&amp;rsquo;s a matter of adding the following declaration in my $\LaTeX$ preamble:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-latex" data-lang="latex"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\documentclass&lt;/span&gt;&lt;span class="na"&gt;[presentation,9pt]&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;beamer&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\usepackage&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;fontspec&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\defaultfontfeatures&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;Mapping=tex-text,Scale=MatchLowercase&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\setmainfont&lt;/span&gt;&lt;span class="na"&gt;[Numbers={Tabular}]&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;Fira Sans&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\setsansfont&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;Fira Sans Condensed&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\setmonofont&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;Fira Code&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\usepackage&lt;/span&gt;&lt;span class="na"&gt;[mathrm=sym]&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;unicode-math&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\setmathfont&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;Fira Math&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\usepackage&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;lstfiracode&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And it works perfectly well using Emacs &lt;a href="https://aliquote.org/post/org-and-beamer/"&gt;Org export&lt;/a&gt; facilities!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-18&lt;/a&gt;: &lt;a href="https://nechtan.io/articles/openbsd_minimalist_desktop.html"&gt;OpenBSD Minimalist Desktop&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-18&lt;/a&gt;: &lt;a href="https://rgz.ee/ssg.html"&gt;make a static site with find(1), grep(1), and lowdown or Markdown.pl&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-24&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Despite the fact that I spend hundreds of dollars a year and hours of work to host my own email server, Google has about half of my personal email! Last year, Google delivered 57% of the emails in my inbox that I replied to. They have delivered more than a third of all the email I’ve replied to every year since 2006 and more than half since 2010. &amp;mdash; &lt;a href="https://mako.cc/copyrighteous/google-has-most-of-my-email-because-it-has-all-of-yours"&gt;Google Has Most of My Email Because It Has All of Yours&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-10-24&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I dread the day in which I will hear a loud knock on my door and one of those programmers will barge in informing me that he is going to store a piece of his furniture in the middle of my living room, if I don&amp;rsquo;t mind. &amp;mdash; &lt;a href="https://0x46.net/thoughts/2019/02/01/dotfile-madness/"&gt;Dotfile madness&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-10-24&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I&amp;rsquo;m definitely not in favor of fossilizing Unix, but there&amp;rsquo;s a difference between avoiding fossilization and the kind of minimal, mathematical purity that we see GNU Grep trying to impose here. Unix has long since passed the point where it had that sort of minimalism in the standard commands. Modern Unix has all sorts of duplications and flourishes that aren&amp;rsquo;t strictly necessary, and for good reasons. One of them is that it&amp;rsquo;s nicer for the actual people using Unix. &amp;mdash; &lt;a href="https://utcc.utoronto.ca/~cks/space/blog/unix/EgrepFgrepStuckWith"&gt;We are stuck with egrep and fgrep (unless you like beating people)&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-10-24&lt;/a&gt;: &lt;a href="https://sarcasm.github.io/notes/dev/compilation-database.html"&gt;Compilation database&lt;/a&gt;. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-24&lt;/a&gt;: &lt;a href="https://ahgamut.github.io/2022/10/23/debugging-c-with-cosmo/"&gt;Debugging C With Cosmopolitan Libc&lt;/a&gt;. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-24&lt;/a&gt;: &lt;a href="https://github.com/boreq/eggplant"&gt;Eggplant&lt;/a&gt; is a self-hosted music streaming service.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-24&lt;/a&gt;: ♪ Adam Wakeman · Speak&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-25&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I think it all stems from Apple’s desire to simplify things for themselves, architecture-wise — Apple Silicon is quite innovative in bringing the advantages of iOS devices to Macs (performance + power efficiency). The terrible decision, in my view, has been to also want to bring the iOS look and feel to the Mac. It was unnecessary, it has broken so many tried-and-true Mac interface guidelines, and it has delivered a massive blow to the whole operating system’s identity. Just to make the Mac what, more fashionable? &amp;mdash; &lt;a href="https://morrick.me/archives/9667"&gt;My next Mac might be the last&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-10-25&lt;/a&gt;: Howdie! &lt;a href="https://lists.gnu.org/archive/html/emacs-devel/2022-10/msg01609.html"&gt;Eglot has landed on master&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-25&lt;/a&gt;: &lt;a href="https://darkcoding.net/software/two-sum/"&gt;Overthinking Leetcode&amp;rsquo;s Two Sum with SIMD&lt;/a&gt;. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-25&lt;/a&gt;: &lt;a href="https://render.com/"&gt;Render&lt;/a&gt; looks like an interesting alternative to Heroku.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-26&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I find the developer experience of Common Lisp to be superior to almost anything imaginable, and this is not an empty statement: having used all sorts of IDEs and editors for over 25 years, I have seen many. &amp;mdash; &lt;a href="https://ane.iki.fi/2020/10/05/between-two-lisps.html"&gt;Between two Lisps&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-10-26&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;That&amp;rsquo;s right: what&amp;rsquo;s good for the lurkers is also good for everybody else. Just like all the great practices that enable remote work also made things better for anybody working in an office (if you remember what that was like and can believe that so many people just put up with that for so long), so does favoring transparency and following up on questions in the open improve all your team dynamics. &amp;mdash; &lt;a href="https://www.netmeister.org/blog/learning-by-lurking.html"&gt;Learning By Lurking&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-10-26&lt;/a&gt;: &lt;a href="https://jott.live/markdown/py3.11_vs_3.8"&gt;Python 3.11 is much faster than 3.8&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-26&lt;/a&gt;: &lt;a href="https://dspinellis.github.io/unix-history-man/"&gt;The history of documented Unix facilities&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-26&lt;/a&gt;: &lt;a href="https://www.netmeister.org/blog/epoch.html"&gt;Time is an illusion, Unix time doubly so&amp;hellip;&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-26&lt;/a&gt;: ♪ Johnny Klimek &amp;amp; Tom Tykwer · Neo and Trinity Theme (Johnny Klimek &amp;amp; Tom Tykwer Exomorph Remix) [from &amp;ldquo;The Matrix Resurrections&amp;rdquo;]&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-26&lt;/a&gt;: ♪ Kavinsky · Nightcall&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-27&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;On the one hand, the hardware is great and so is the performance. On the other, getting a new Mac today means it comes with Ventura or Monterey preinstalled, which is unfortunate, and of course there is no downgrade path. &amp;mdash; &lt;a href="https://morrick.me/archives/9667"&gt;My next Mac might be the last&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-10-27&lt;/a&gt;: Little shell script to listen to some free internet radios:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#!/usr/bin/env bash
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# sources&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;jazz&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;https://jazzradio.ice.infomaniak.ch/jazzradio-high.mp3&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;misc&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;https://www.lemellotron.com/stream&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;piano&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;https://pianosolo.streamguys1.com/live&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; injazz&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$jazz&lt;/span&gt;&lt;span class="p"&gt;;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; misc&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$misc&lt;/span&gt;&lt;span class="p"&gt;;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; piano&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="nv"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$piano&lt;/span&gt;&lt;span class="p"&gt;;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; *&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Unknown streaming source...&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;esac&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mpv --no-video &lt;span class="nv"&gt;$src&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-10-27&lt;/a&gt;: TIL that sending Fzf results to the quickfix list is as simple as pressing &lt;code&gt;&amp;lt;cr&amp;gt;&lt;/code&gt; after selecting items using &lt;code&gt;&amp;lt;tab&amp;gt;&lt;/code&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-27&lt;/a&gt;: &lt;a href="https://sharats.me/posts/shell-script-best-practices/"&gt;Shell Script Best Practices&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-10-27&lt;/a&gt;: ♪ Clan of Xymox · A Day&lt;br&gt;&lt;/p&gt;</description></item><item><title>The unquantified self #26</title><link>https://aliquote.org/post/unquantified-self-026/</link><pubDate>Wed, 26 Oct 2022 20:03:14 +0200</pubDate><guid>https://aliquote.org/post/unquantified-self-026/</guid><description>&lt;p&gt;October is going to an end. I have only partially recovered from the fatigue and other little worries of the last months, which are still under investigation. But, anyway, I am still around. I&amp;rsquo;ve been playing with my crayons lately. It&amp;rsquo;s been 25 years that I hadn&amp;rsquo;t made any drawing, so I was surprised to find myself spending each evening in front of a kraft paper notebook. The sixty or so drawings produced are partly the product of external sources of inspiration (Lee Zimmerman, Enki Bilal, Kandinsky, Matisse) and of more personal reflections. This is just ink, and a bit of charcoal, after all. No eraser whatsoever. Just sketches.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_2405.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_2405.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_2465.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_2465.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_2466.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_2466.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;I&amp;rsquo;ve been watching some new &lt;a href="https://aliquote.org/articles/movies/"&gt;TV series&lt;/a&gt; (Alice in Borderland, La disparue de Lørenskog &amp;ndash; I&amp;rsquo;m too lazy to look for the English title, and Deadwind). These were all great short movies for the past evenings. I still haven&amp;rsquo;t seriously started reading except for technical books. As a consequence, the number of books I will have read by the end of the year will probably be one of the lowest figure in years. But I&amp;rsquo;m confident I&amp;rsquo;ll find some gems in the pile of books waiting on my shelves.&lt;/p&gt;
&lt;p&gt;Lastly, I&amp;rsquo;m in the process of configuring a home server based on OpenBSD that will run on my old &lt;a href="https://aliquote.org/post/ubuntu-on-mac/"&gt;Macbook pro&lt;/a&gt;. It will be fun, eventually. I will also be managing a nice server (32 HT cores, 512 Go RAM, 832 iGPU cores) at work. Time to brush up my sysadmin skills, which are now close to zero to be honest. In the meantime, I&amp;rsquo;m an happy Linux user and I have no regret for my past macOS applications. I read some reviews of the latest OS (Ventura) and I realized that the UX keeps getting worser after each new release (see also &lt;a href="https://morrick.me/archives/9667"&gt;My next Mac might be the last&lt;/a&gt;).&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Jack Johnson • &lt;em&gt;Sitting, Waiting, Wishing&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>ArXiving on October 2022</title><link>https://aliquote.org/post/arxiv-11/</link><pubDate>Tue, 25 Oct 2022 10:09:25 +0100</pubDate><guid>https://aliquote.org/post/arxiv-11/</guid><description>&lt;h3 id="approximating-persistent-homology-for-large-datasets-"&gt;Approximating Persistent Homology for Large Datasets (&lt;a href="https://arxiv.org/abs/2204.09155"&gt;https://arxiv.org/abs/2204.09155&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;At first sight, it sounded really interesting, especially since the authors used bootstrap, and perhaps with bioinformatics applications in mind:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Persistent homology (&amp;hellip;) produces a statistical summary in the form of a persistence diagram, which captures the shape and size of the data.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Then, I realized that it&amp;rsquo;s a hard paper (for me at least). I&amp;rsquo;ll keep it under my hat for later, when I&amp;rsquo;ll have clearer ideas.&lt;/p&gt;
&lt;h3 id="a-new-preferential-model-with-homophily-for-recommender-systems-"&gt;A new preferential model with homophily for recommender systems (&lt;a href="https://arxiv.org/abs/2204.11819"&gt;https://arxiv.org/abs/2204.11819&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;I&amp;rsquo;ve been teaching the basis of recommender systems in an engineering school for two years. I liked it, especially when discussing matrix factorization algorithms and Co. Applications speak for themselves (everybody knows Amazon or Spotify, right?), and I missed Seth Brown&amp;rsquo;s beer recommendation engine. This paper is more about social networks and preferential attachment (rich-get-richer and homophily). The authors show that the number of vertices in their K-groups preferential attachment model follows a power law, and they dscuss two applications on real web data.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2022-10-26-20-54-05.png"&gt;
&lt;/figure&gt;
&lt;h3 id="locality-sensitive-hashing-for-structured-data-a-survey-"&gt;Locality Sensitive Hashing for Structured Data: A Survey (&lt;a href="https://arxiv.org/abs/2204.11209"&gt;https://arxiv.org/abs/2204.11209&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;Locality sensitive hashing (LSH) is used to hash alike items into the same buckets with high probability, which means it can be used as a data reduction or clustering method, bypassing any supervised learning process. However, this usually does not apply to ordered items, like trees, graphs or sequences. The authors survey relevant techniques for such hierarchical LSH algorithms.&lt;/p&gt;
&lt;h3 id="marginal-log-linear-models-and-mediation-analysis-"&gt;Marginal log-linear models and mediation analysis (&lt;a href="https://arxiv.org/abs/2204.08538"&gt;https://arxiv.org/abs/2204.08538&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;Yet another paper on log-linear analysis, this time in the context of mediation analysis (a hot topic in psychiatric and psychological studies in the last ten years when people realized that causal analysis may or should not be that easy).&lt;/p&gt;
&lt;h3 id="simultaneous-confidence-intervals-for-the-interpretation-of-primary-and-secondary-effects-in-factorial-designs-without-a-pre-test-on-interaction-"&gt;Simultaneous confidence intervals for the interpretation of primary and secondary effects in factorial designs without a pre-test on interaction (&lt;a href="https://arxiv.org/abs/2204.08336"&gt;https://arxiv.org/abs/2204.08336&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;Here, the author discusses the use of parametric or non-parametric simultaneous confidence intervals between the levels of a primary factor for both separate and joint secondary factor levels in an unbalanced factorial design with 2 or 3 factors (where one of the factor has more than 2 levels).&lt;/p&gt;
&lt;h3 id="a-note-on-simulation-based-inference-by-matching-random-features-"&gt;A Note on Simulation-Based Inference by Matching Random Features (&lt;a href="https://arxiv.org/abs/2111.09220"&gt;https://arxiv.org/abs/2111.09220&lt;/a&gt;)&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;We can, and should, do statistical inference on simulation models by adjusting the parameters in the simulation so that the values of &lt;em&gt;randomly chosen&lt;/em&gt; functions of the simulation output match the values of those same functions calculated on the data.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It reminds me of raking or margin adjustment in survey analysis.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Queens of the Stone Age • &lt;em&gt;Long Slow Goodbye&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Zero-plugin linting and fixing in Neovim</title><link>https://aliquote.org/post/neovim-compiler/</link><pubDate>Mon, 10 Oct 2022 10:13:45 +0200</pubDate><guid>https://aliquote.org/post/neovim-compiler/</guid><description>&lt;p&gt;Like Vim, Neovim comes with a bunch of preconfigured &amp;ldquo;compilers&amp;rdquo; (i.e., general settings for &lt;code&gt;makeprg&lt;/code&gt; and &lt;code&gt;errorformat&lt;/code&gt;), yet it is possible to define additional compilers when you&amp;rsquo;re not relying on a language server or, as in my case, when you want to use a specific linter via &lt;code&gt;makeprg&lt;/code&gt;. Indeed, when it does not make sense to use a build system, it might be interesting to consider a linter as an alternative for Vim&amp;rsquo;s &lt;code&gt;make&lt;/code&gt; feature. The results of invoking &lt;code&gt;:make&lt;/code&gt; are displayed in the quickfix window, which I particularly like. Likewise, the &lt;code&gt;formatprg&lt;/code&gt; option allows one to define a fixer for &lt;code&gt;gq&lt;/code&gt;&amp;lsquo;ing on a selection. We can also define a mapping to fix the whole buffer. This way, we can have linting and fixing facilities without relying on external plugins, like &lt;a href="https://github.com/jose-elias-alvarez/null-ls.nvim"&gt;null-ls&lt;/a&gt;, &lt;a href="https://github.com/dense-analysis/ale"&gt;ALE&lt;/a&gt; or &lt;a href="https://github.com/mattn/efm-langserver"&gt;efm-langserver&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Usually, I stand by the already defined compilers, but I added two specifications, one for pytest and the other for shellcheck. The following is for pytest, and it has been proposed by &lt;a href="https://phelipetls.github.io/posts/vim-errorformat-for-pytest/"&gt;Phelipe&lt;/a&gt;:&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-vim" data-lang="vim"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nx"&gt;exists&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;current_compiler&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;finish&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;endif&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;current_compiler&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;pytest&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nx"&gt;exists&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;:CompilerSet&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;!=&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt; &lt;span class="c"&gt;&amp;#34; older Vim always used :setlocal&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;command&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;nargs&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;* &lt;span class="nx"&gt;CompilerSet&lt;/span&gt; &lt;span class="nx"&gt;setlocal&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;args&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;endif&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;CompilerSet&lt;/span&gt; &lt;span class="nx"&gt;makeprg&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;pytest&lt;/span&gt;\ &lt;span class="p"&gt;--&lt;/span&gt;&lt;span class="nx"&gt;tb&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;short&lt;/span&gt;\ &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;vv&lt;/span&gt;\ $*
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;CompilerSet&lt;/span&gt; &lt;span class="nx"&gt;errorformat&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \%&lt;span class="nx"&gt;EE&lt;/span&gt;\ \ \ \ \ &lt;span class="nx"&gt;File&lt;/span&gt;\ \&lt;span class="s2"&gt;&amp;#34;%f\&amp;#34;&lt;/span&gt;\\&lt;span class="p"&gt;,&lt;/span&gt;\ &lt;span class="nx"&gt;line&lt;/span&gt;\ %&lt;span class="nx"&gt;l&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \%&lt;span class="nx"&gt;CE&lt;/span&gt;\ \ \ %&lt;span class="nx"&gt;p&lt;/span&gt;^&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \%&lt;span class="nx"&gt;ZE&lt;/span&gt;\ \ \ %[%^\ ]%\\@&lt;span class="p"&gt;=&lt;/span&gt;%&lt;span class="nx"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \%&lt;span class="nx"&gt;Afile&lt;/span&gt;\ %&lt;span class="nx"&gt;f&lt;/span&gt;\\&lt;span class="p"&gt;,&lt;/span&gt;\ &lt;span class="nx"&gt;line&lt;/span&gt;\ %&lt;span class="nx"&gt;l&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \%&lt;span class="p"&gt;+&lt;/span&gt;&lt;span class="nx"&gt;ZE&lt;/span&gt;\ %&lt;span class="nx"&gt;mnot&lt;/span&gt;\ &lt;span class="nx"&gt;found&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \%&lt;span class="nx"&gt;CE&lt;/span&gt;\ %.%#&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \%&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;G_&lt;/span&gt;%\\&lt;span class="p"&gt;+&lt;/span&gt;\ &lt;span class="nx"&gt;ERROR&lt;/span&gt;%.%#\ &lt;span class="nx"&gt;_&lt;/span&gt;%\\&lt;span class="p"&gt;+,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \%&lt;span class="nx"&gt;A_&lt;/span&gt;%\\&lt;span class="p"&gt;+&lt;/span&gt;\ %&lt;span class="nx"&gt;o&lt;/span&gt;\ &lt;span class="nx"&gt;_&lt;/span&gt;%\\&lt;span class="p"&gt;+,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \%&lt;span class="nx"&gt;C&lt;/span&gt;%&lt;span class="nx"&gt;f&lt;/span&gt;:%&lt;span class="nx"&gt;l&lt;/span&gt;:\ &lt;span class="nx"&gt;in&lt;/span&gt;\ %&lt;span class="nx"&gt;o&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \%&lt;span class="nx"&gt;ZE&lt;/span&gt;\ %\\{&lt;span class="m"&gt;3&lt;/span&gt;}%&lt;span class="nx"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \%&lt;span class="nx"&gt;EImportError&lt;/span&gt;%.%#\&lt;span class="s1"&gt;&amp;#39;%f\&amp;#39;&lt;/span&gt;\.&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \%&lt;span class="nx"&gt;C&lt;/span&gt;%.%#&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \%&lt;span class="p"&gt;+&lt;/span&gt;&lt;span class="nx"&gt;G&lt;/span&gt;%[&lt;span class="p"&gt;=&lt;/span&gt;]%\\&lt;span class="p"&gt;+&lt;/span&gt;\ %*\\&lt;span class="nx"&gt;d&lt;/span&gt;\ &lt;span class="nx"&gt;passed&lt;/span&gt;%.%#&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \%&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;G&lt;/span&gt;%[%^&lt;span class="nx"&gt;E&lt;/span&gt;]%.%#&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \%&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;G&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="p"&gt;!&lt;/span&gt; &lt;span class="nx"&gt;FixColumnNumber&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;:&lt;span class="nx"&gt;current_compiler&lt;/span&gt; &lt;span class="p"&gt;!=&lt;/span&gt;? &lt;span class="s1"&gt;&amp;#39;pytest&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;return&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;endif&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;qflist&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;getqflist&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;for&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="nx"&gt;in&lt;/span&gt; &lt;span class="nx"&gt;qflist&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;.&lt;span class="nx"&gt;col&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;.&lt;span class="nx"&gt;col&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;endfor&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;call&lt;/span&gt; &lt;span class="nx"&gt;setqflist&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;qflist&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;endfunction&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;augroup&lt;/span&gt; &lt;span class="nx"&gt;FixPytestQuickFix&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;au&lt;/span&gt;&lt;span class="p"&gt;!&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;autocmd&lt;/span&gt; &lt;span class="nx"&gt;QuickFixCmdPost&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;call&lt;/span&gt; &lt;span class="nx"&gt;FixColumnNumber&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;augroup&lt;/span&gt; &lt;span class="nx"&gt;END&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For shellcheck, I have the following in my &lt;code&gt;compiler&lt;/code&gt; directory:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-vim" data-lang="vim"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;CompilerSet&lt;/span&gt; &lt;span class="nx"&gt;makeprg&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;shellcheck&lt;/span&gt;\ &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;f&lt;/span&gt;\ &lt;span class="nx"&gt;gcc&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;CompilerSet&lt;/span&gt; &lt;span class="nx"&gt;errorformat&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;%&lt;span class="nx"&gt;f&lt;/span&gt;:%&lt;span class="nx"&gt;l&lt;/span&gt;:%&lt;span class="nx"&gt;c&lt;/span&gt;:\ %&lt;span class="nx"&gt;trror&lt;/span&gt;:\ %&lt;span class="nx"&gt;m&lt;/span&gt;\ [&lt;span class="nx"&gt;SC&lt;/span&gt;%&lt;span class="nx"&gt;n&lt;/span&gt;]&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \%&lt;span class="nx"&gt;f&lt;/span&gt;:%&lt;span class="nx"&gt;l&lt;/span&gt;:%&lt;span class="nx"&gt;c&lt;/span&gt;:\ %&lt;span class="nx"&gt;tarning&lt;/span&gt;:\ %&lt;span class="nx"&gt;m&lt;/span&gt;\ [&lt;span class="nx"&gt;SC&lt;/span&gt;%&lt;span class="nx"&gt;n&lt;/span&gt;]&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \%&lt;span class="nx"&gt;f&lt;/span&gt;:%&lt;span class="nx"&gt;l&lt;/span&gt;:%&lt;span class="nx"&gt;c&lt;/span&gt;:\ %&lt;span class="nx"&gt;tote&lt;/span&gt;:\ %&lt;span class="nx"&gt;m&lt;/span&gt;\ [&lt;span class="nx"&gt;SC&lt;/span&gt;%&lt;span class="nx"&gt;n&lt;/span&gt;]&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \%&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;G&lt;/span&gt;%.%#
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In both cases above, the tricky part is to manage the &lt;code&gt;errorformat&lt;/code&gt;. Once you have defined your custom compiler, you can declare it in your filetype file in &lt;code&gt;after/ftplugin&lt;/code&gt; and optionally defined an appropriate &lt;code&gt;makeprg&lt;/code&gt; command. For instance, in the case of shellcheck I use the following:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-vim" data-lang="vim"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;compiler&lt;/span&gt; &lt;span class="nx"&gt;shellcheck&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;setlocal&lt;/span&gt; &lt;span class="nx"&gt;makeprg&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;shellcheck&lt;/span&gt;\ &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;f&lt;/span&gt;\ &lt;span class="nx"&gt;gcc&lt;/span&gt;\ %
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;nmap&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;silent&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;g&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt; :&lt;span class="p"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;shfmt&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;ln&lt;/span&gt; &lt;span class="nx"&gt;posix&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;sr&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;ci&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;w&lt;/span&gt; %&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;:&lt;span class="nx"&gt;redraw&lt;/span&gt;&lt;span class="p"&gt;!&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The last line define a mapping to format the whole buffer using shfmt. I use &lt;code&gt;g=&lt;/code&gt; for &lt;code&gt;vim.lsp.buf.format()&lt;/code&gt; when a language server is available too. Of course I realize that the ALE or null-ls plugins handle all of that in a more elegant and efficient way, especially since it is asynchroneous contrary to the approach presented above and you are limited to one linter unless you write a shell script to gather several commands,&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; but that&amp;rsquo;s my take for exploiting Neovim&amp;rsquo;s builtins.&lt;/p&gt;
&lt;p&gt;I summarized sone of the options I have in my vimrc folder in the following table.&lt;/p&gt;
&lt;small&gt;
&lt;table border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;Filetype&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;&lt;em&gt;LSP&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;&lt;em&gt;Linter&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;&lt;em&gt;Fixer&lt;/em&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;c&lt;/td&gt;&lt;td&gt;clangd&lt;/td&gt;&lt;td&gt;built-in&lt;/td&gt;&lt;td&gt;built-in&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;python&lt;/td&gt;&lt;td&gt;pyright&lt;/td&gt;&lt;td&gt;built-in&lt;/td&gt;&lt;td&gt;black, isort&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;racket&lt;/td&gt;&lt;td&gt;racket-langserver&lt;/td&gt;&lt;td&gt;built-in&lt;/td&gt;&lt;td&gt;built-in&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;haskell&lt;/td&gt;&lt;td&gt;hls&lt;/td&gt;&lt;td&gt;built-in&lt;/td&gt;&lt;td&gt;built-in&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;purescript&lt;/td&gt;&lt;td&gt;purescriptls&lt;/td&gt;&lt;td&gt;built-in&lt;/td&gt;&lt;td&gt;built-in&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;sh&lt;/td&gt;&lt;td&gt;not used&lt;/td&gt;&lt;td&gt;shellcheck&lt;/td&gt;&lt;td&gt;shfmt&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;javascript&lt;/td&gt;&lt;td&gt;not used&lt;/td&gt;&lt;td&gt;quick-lint-js&lt;/td&gt;&lt;td&gt;prettier&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/small&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Greg Abate • &lt;em&gt;Sunshower&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;It is available on &lt;a href="https://github.com/phelipetls/dotfiles/blob/master/.config/nvim/compiler/pytest.vim"&gt;GitHub&lt;/a&gt;.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;I don&amp;rsquo;t really mind formatting a buffer using a shortcut, although it is possible to use an autocommand to format it on save.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>One year scrobbling</title><link>https://aliquote.org/post/one-year-scrobbling/</link><pubDate>Fri, 07 Oct 2022 09:28:48 +0200</pubDate><guid>https://aliquote.org/post/one-year-scrobbling/</guid><description>&lt;p&gt;It&amp;rsquo;s been a full year of scrobbling&amp;hellip; I registered an account on Last.fm last year. Originally, this was mostly to get recommendations and to track the music I listen to on Cmus, as an alternative to Apple Music which I no longer really use (even if they offer an online platform now). I prefer to stand by my offline records.&lt;/p&gt;
&lt;p&gt;Anyway, the statistics speak for themselves now: these are almost 36,000 scrobbles in one year, which means between 60 and 90 hours each week, and 700-800 tracks weekly on average. I don&amp;rsquo;t have a premium account so it&amp;rsquo;s hard to figure out a detailed report of my activities. Of course, I know what I listened too, this is mostly of the post-punk and jazz genres.&lt;/p&gt;
&lt;p&gt;Last year summary is shown below (October&amp;ndash;December):&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2022-10-07-10-13-36.png"&gt;
&lt;/figure&gt;
&lt;p&gt;My music library is composed of 13,632 tracks in MP3 format, as of today, and a bunch of additional music and video grabbed from Youtube or old MP3s not properly tagged yet. It&amp;rsquo;s by far the most reliable collection I had over the last 25 years, since I spent a fait amount of time cleaning dead records and tagging all valid records using beets and MusicBrainz. I don&amp;rsquo;t mind the cover, most of the time, but I know &lt;a href="https://aliquote.org/post/rhythmbox/"&gt;Rhythmbox&lt;/a&gt; is able to fetch them automagically, so I have most of them somewhere cached on my computer.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-10-07-10-16-12.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-10-07-10-16-12.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-10-07-10-16-47.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-10-07-10-16-47.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-10-07-10-17-11.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-10-07-10-17-11.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Of course, this does not mean that I only listen to digital music. I have some good old vinyles standing right there in my home office. &lt;em&gt;Best therapy ever&lt;/em&gt;. See you next year!&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/68500743319__496CF36A-5D30-470F-A124-A0933F167FD0.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/68500743319__496CF36A-5D30-470F-A124-A0933F167FD0.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/68500782808__55A24BB2-A435-4247-A9F0-9F2216BA1559.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/68500782808__55A24BB2-A435-4247-A9F0-9F2216BA1559.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Cocteau Twins • &lt;em&gt;Blood Bitch&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Alacritty</title><link>https://aliquote.org/post/alacritty/</link><pubDate>Thu, 06 Oct 2022 18:48:43 +0200</pubDate><guid>https://aliquote.org/post/alacritty/</guid><description>&lt;p&gt;Three weeks ago, I managed to solve a recurring problem on my Ubuntu workstation: using reliable and portable settings for Bash, Zsh and Tmux. I don&amp;rsquo;t use Bash as an interactive shell that often but I like having it configured anyway. Since most of my aliases and functions are written for Zsh, which is the shell I use all day, I needed to make them available for Bash, as well various environment variables and &lt;code&gt;PATH&lt;/code&gt; settings. I ended up using a common &lt;code&gt;$HOME/.config/profile.d&lt;/code&gt; directory, easy to stow or to version control, to store all my login settings, and keep using &lt;code&gt;$HOME/.config/zsh&lt;/code&gt; for interactive shell stuff, with appropriate links from &lt;code&gt;$HOME/.bashrc&lt;/code&gt;. Since I use &lt;a href="https://starship.rs/"&gt;starship&lt;/a&gt; to define my prompt, it applies equally well to Bash or Zsh. Problem solved.&lt;/p&gt;
&lt;p&gt;Even if I find Gnome terminal really great, I wanted to get ride of window decorations to really benefit from the &lt;a href="https://extensions.gnome.org/extension/4548/tactile/"&gt;Tactile&lt;/a&gt; shell extension. To my knowledge, only Kitty and Alacritty allow to remove window decoration. I decided to give Alacritty a try since I already know Kitty quite well but I don&amp;rsquo;t need an additional level of multiplexing since I am already happy with Tmux.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; Those who don&amp;rsquo;t use Screen or Tmux are probably less happy with Alacritty alone, except for its responsiveness. Because it is really fast, indeed. The very first days, I was kind of annoyed by the rendering process, which is far better than any other terminal I experienced in the past. Try to autocomplete path or command in Zsh and you will understand what I mean.&lt;/p&gt;
&lt;p&gt;The other nifty feature of Alacritty is that it has a scrollback buffer (activated with &lt;kbd&gt;Shift+Ctrl+Space&lt;/kbd&gt;) where you get Vim keybindings at your finger tip to navigate, select and yank any portion of text. That&amp;rsquo;s even better than under Tmux, to the point that I now often switch to this mode of selection inside Tmux itself. It also looks like there&amp;rsquo;s something called hint that allow to automagically highlight some regexed part of the screen, but I didn&amp;rsquo;t get into it at the time of this writing.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2022-10-06-21-48-23.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Like Kitty, Alacritty allows to define your own color scheme (the structure is quite identical, in fact &amp;ndash; just a plain text file with foreground/background colors, and all 16 terminal colors in Hex format) as well as a custom set of fonts. I switched to Fira Code (after Iosevska, JetBrains Mono and Ubuntu Mono, respectively) because I like it and it comes with SemiBold font shape, which I find less intrusive than plain Bold. There&amp;rsquo;s not italic font shape, though, but it can be overcomed by using a variant of the regular font shape, as shown below:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;font:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; normal:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; family: Fira Code
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; style: Regular
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; bold:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; family: Fira Code
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; style: SemiBold
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; italic:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; family: Fira Code
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; style: Medium
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; size: 11.0
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;John Cook discussed font that come with ligatures, like Fira Code, on &lt;a href="https://www.johndcook.com/blog/2022/10/03/ligatures-for-logic/"&gt;his blog&lt;/a&gt;. He seems to prefer plain text (i.e., no ligature) for code, and I tend to agree with him except that now that I mostly code in Python, Scheme or Haskell I find them convenient, especially for Haskell or Purescript. We both agree that ligatures add some values to prose documents, though:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;There’s one place where I believe Fira Code would be ideal: code examples inside a prose document. In that context you care about aesthetics and you want a monospaced font.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2022-10-06-21-51-38.png"&gt;
&lt;/figure&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ The Psychedelic Furs • &lt;em&gt;Love My Way&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;I stopped using Kitty on Ubuntu when I realized that it will probably never add support for terminal activity as what&amp;rsquo;s available in Tmux. I had other problems I don&amp;rsquo;t remember, but they may well be related to backward search in the scrollback buffer not available unless we had an extra Python plugin.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Speeding up Neovim</title><link>https://aliquote.org/post/speed-up-neovim/</link><pubDate>Wed, 05 Oct 2022 11:21:43 +0200</pubDate><guid>https://aliquote.org/post/speed-up-neovim/</guid><description>&lt;p&gt;This probably is the last and heaviest iteration of my Neovim setup cleansing days. Starting with a 36-40 ms &lt;a href="https://aliquote.org/post/haskell-and-vim/"&gt;startup time&lt;/a&gt; and 10-12 plugins, I ended up with a 26-30 ms startup time and a total of 9 plugins, with half of them not loaded most of the time. I could possible optimize this startup time by converting my color scheme to pure Lua, but I prefer to keep it as plain old VimL since I may reuse it with Vim instead of Neovim.&lt;/p&gt;
&lt;p&gt;There are a lot of useful (and less useful) advices on the web, which mostly amounts to relying on pure Lua-based plugins or general settings (except for autocommand), disabling unused built-in stuff, eventually disabling Shada (I didn&amp;rsquo;t), etc. Unlike others, I don&amp;rsquo;t use much plugins, so I am not concerned with plugins that can be properly lazy loaded or not. I like to have a bunch of settings in my &lt;code&gt;after/ftplugin&lt;/code&gt; directory, since I find it easier to manage language-specific options there. It&amp;rsquo;s all written in VimL but I may consider using &lt;code&gt;ftplugin&lt;/code&gt; directly with Lua code at some point.&lt;/p&gt;
&lt;p&gt;Here are the latest benchmarks using medium performance of my CPUs:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» hyperfine &lt;span class="s2"&gt;&amp;#34;nvim --headless +qa&amp;#34;&lt;/span&gt; --warmup &lt;span class="m"&gt;5&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Benchmark 1: nvim --headless +qa
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Time &lt;span class="o"&gt;(&lt;/span&gt;mean ± σ&lt;span class="o"&gt;)&lt;/span&gt;: 27.6 ms ± 0.2 ms &lt;span class="o"&gt;[&lt;/span&gt;User: 22.7 ms, System: 5.1 ms&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Range &lt;span class="o"&gt;(&lt;/span&gt;min … max&lt;span class="o"&gt;)&lt;/span&gt;: 27.3 ms … 28.3 ms &lt;span class="m"&gt;105&lt;/span&gt; runs
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I uninstalled &lt;a href="https://aliquote.org/post/vim-fuzzy-finder/"&gt;Telescope&lt;/a&gt; and got my way back to Fzf. Navigating my buffers or filesystem now works like a charm, unlike Telescope which I found less responsive and reliable (oftentimes the caret was not on the right spot). I also removed null-ls to get rid of plenary dependency. That&amp;rsquo;s a bit silly, because I really like this plugin and the author/maintainer does a really great job to keep up to date with Neovim upstream deprecations or changes. Yet I don&amp;rsquo;t want to rely on extra dependencies. I have to figure out how to replace null-ls linter/fixer facilities. At the moment, I delegated fixers to &lt;code&gt;formatprg&lt;/code&gt; option, but I though I will maybe configure the &lt;a href="https://github.com/mattn/efm-langserver"&gt;efm&lt;/a&gt; language server to simplify the task and get linting facilities. Finally, I moved all other plugins as opt plugins, either using filetype-based filters (vimtex, nvim-lspconfig, nvim-parinfer) or key or command-base triggers (Comment, nvim-colorizer). As for treesitter, I simply added a &lt;code&gt;event = 'BufRead'&lt;/code&gt; conditional, which allows to gain a little when firing up Neovim in a directory or without any file as I often do to define a proper working directory. Besides, I removed unused stuff in my &lt;code&gt;autoload&lt;/code&gt; directory, as well as useless autocommands.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s the list of plugins I&amp;rsquo;m currently using (in addition to packer), as of this writing: &lt;code&gt;junegunn/fzf&lt;/code&gt;, &lt;code&gt;junegunn/fzf.vim&lt;/code&gt;, &lt;code&gt;lervag/vimtex&lt;/code&gt;, &lt;code&gt;gpanders/nvim-parinfer&lt;/code&gt;, &lt;code&gt;norcalli/nvim-colorizer.lua&lt;/code&gt;, &lt;code&gt;numToStr/Comment.nvim&lt;/code&gt;, &lt;code&gt;nvim-treesitter/nvim-treesitter&lt;/code&gt;, &lt;code&gt;neovim/nvim-lspconfig&lt;/code&gt;. I could probably get ride of nvim-lspconfig since the built-in LSP can now be configured more easily starting with Neovim v0.8. See &lt;a href="https://zignar.net/2022/10/01/new-lsp-features-in-neovim-08/"&gt;New LSP features in Neovim 0.8&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I also reorganized my Lua files using a cleaner structure:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;» tree
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── config
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│   ├── diagnostics.lua
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│   ├── lsp.lua
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│   └── treesitter.lua
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── plugins.lua
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── settings
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│   ├── abbrev.lua
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│   ├── autocmd.lua
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│   ├── command.lua
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│   ├── init.lua
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│   └── mappings.lua
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;└── utils
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── completion.lua
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── jump.lua
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── statusline.lua
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; └── surround.lua
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="m"&gt;3&lt;/span&gt; directories, &lt;span class="m"&gt;13&lt;/span&gt; files
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It&amp;rsquo;s also been a week that I reconfigured my whole desktop using a light color theme and a mix of tiled and floating windows, thanks to the &lt;a href="https://extensions.gnome.org/extension/4548/tactile/"&gt;Tactile&lt;/a&gt; extension and Ubuntu built-in shortcuts to move or resize windows (&lt;code&gt;Alt-F7&lt;/code&gt; and &lt;code&gt;Alt-F8&lt;/code&gt;). Since I don&amp;rsquo;t move terminal window a lot, this works for me and I don&amp;rsquo;t feel like I need to install Sway.&lt;/p&gt;
&lt;p&gt;Here is a screenshot of the two workspaces I generally use all day:&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-10-05-11-43-42.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-10-05-11-43-42.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-10-05-11-44-15.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-10-05-11-44-15.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ New Order • &lt;em&gt;Bizarre Love Triangle&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in September</title><link>https://aliquote.org/post/micro-09-2022/</link><pubDate>Sat, 01 Oct 2022 19:01:45 +0200</pubDate><guid>https://aliquote.org/post/micro-09-2022/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-09-01&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Shane Quartet, &lt;em&gt;Stablemates&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-01&lt;/a&gt;: I think I still prefer Cmus and Irssi over Rhythmox and Element. Lean text interfaces forever. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-01&lt;/a&gt;: Regular cleaning of &lt;code&gt;$HOME&lt;/code&gt; done: +4 Go. Also removed a lot of unused stuff on &lt;code&gt;/&lt;/code&gt;, including Discord which I no longer use.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-04&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;  BENEE · Doesn&amp;rsquo;t Matter.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-04&lt;/a&gt;: Trying out &lt;a href="https://extensions.gnome.org/extension/4548/tactile/"&gt;Tactile&lt;/a&gt; as an additional Window Manager for Gnome shell. Looks great. No auto-tiling (you have to manually assign new windows to predefined tiles on a grid, but this is flexible. However, it works like a charm right (and out of the box), unlike Forge or gTile. Gnome default tiling behavior works alongside, which is great. Together with Simple terminal or Gnome terminal (preferred), this makes for a great tiling WM. Also, none of the shell extensions (Unite, undecorate, &amp;hellip;) I tried were able to properly remove window decorations, and it seems like there always are edge cases anyway.&lt;br&gt;&lt;img src="https://aliquote.org/img/2022-09-04-11-15-36.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-06&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The WHATWG spec follows the good old browser mantra of being very liberal in what it accepts and trying to guess what the users mean and bending backwards trying to fulfill. (Even though we all know by now that Postel’s Law is the wrong way to go about this.) It means it’ll handle too many slashes, embedded white space as well as non-ASCII characters. &amp;mdash; &lt;a href="https://daniel.haxx.se/blog/2016/05/11/my-url-isnt-your-url/"&gt;My URL isn’t your URL&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-09-06&lt;/a&gt;: Waiting for a reply to my query on Vim Vixen &lt;a href="https://github.com/ueokande/vim-vixen/issues/1447"&gt;GH repo&lt;/a&gt;. Would be great to have the same facilities as on Nyxt browser to yank both URL and title at some point.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-06&lt;/a&gt;: &lt;a href="https://www.anishathalye.com/2018/07/19/gemini-a-modern-beamerposter-theme/"&gt;Gemini: A Modern LaTeX Poster Theme&lt;/a&gt;. &lt;code&gt;#tex&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-06&lt;/a&gt;: &lt;a href="https://mazzo.li/posts/fast-pipes.html"&gt;How fast are Linux pipes anyway?&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-06&lt;/a&gt;: &lt;a href="https://mazzo.li/posts/autoscreen.html"&gt;Persistent SSH sessions with proper scrollback&lt;/a&gt;. I have to try this with both ssh jump and Tmux instead of Screen, and with scrolbback buffer enabled because i like it.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-06&lt;/a&gt;: ♪ Placebo · Teenage Angst&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-07&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I have had my eye on Julia for many years, and I now consider it ready to be my &amp;ldquo;everyday&amp;rdquo; programming language. &amp;mdash; &lt;a href="https://mfiano.net/posts/2022-09-04-from-common-lisp-to-julia/"&gt;From Common Lisp to Julia&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-09-07&lt;/a&gt;: &amp;gt; The story is different with a REPL: you will have played with each piece of code in isolation before running the whole program, which makes you quite confident that each of the sub-tasks is well implemented. &amp;mdash; &lt;a href="https://vvvvalvalval.github.io/posts/what-makes-a-good-repl.html"&gt;What makes a good REPL?&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-07&lt;/a&gt;: &lt;a href="https://www.wilfred.me.uk/blog/2022/09/06/difftastic-the-fantastic-diff/"&gt;Difftastic, the Fantastic Diff&lt;/a&gt;. &lt;code&gt;#git&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-07&lt;/a&gt;: ♪ Apoptygma Berzerk · Until The End Of The World&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-07&lt;/a&gt;: ♪ Lords of the New Church · Russian Roulette&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-08&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The historical justification for a /bin, /sbin and /lib separate from /usr no longer applies today. They were split off to have selected tools on a faster hard disk (which was small, because it was more expensive) and to contain all the tools necessary to mount the slower /usr partition. Today, a separate /usr partition already must be mounted by the initramfs during early boot, thus making the justification for a split-off moot. In addition a lot of tools in /bin and /sbin in the status quo already lost the ability to run without a pre-mounted /usr. There is no valid reason anymore to have the operating system spread over multiple hierarchies, it lost its purpose. &amp;mdash; &lt;a href="https://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge/"&gt;The Case for the /usr Merge&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-09-08&lt;/a&gt;: Tip of the day: If you want to get ride of Ubuntu putting screenshots with arbitrary filenames in arbitrary folder, without resorting on the good old &lt;code&gt;gnome-screenshot&lt;/code&gt; tool, just use:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;% xdg-user-dirs-update --set PICTURES ~/Media/Pictures
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;% &lt;span class="nb"&gt;cd&lt;/span&gt; ~/Media/Pictures/Captu* &lt;span class="c1"&gt;## NOTE: update according to your settings&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;% rename &lt;span class="s1"&gt;&amp;#39;s/Capture\ d’écran\ d[eu]\ //g;s/\s/-/g&amp;#39;&lt;/span&gt; *
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Don&amp;rsquo;t forget to update the last instruction to reflect basename on your system, use a Makefile or shell script to automate the process. Usually, Ubuntu will create a subfolder (&amp;ldquo;Screenshots&amp;rdquo; or &amp;ldquo;Captures d&amp;rsquo;écran&amp;rdquo; or whatever) in the default &lt;code&gt;PICTURES&lt;/code&gt; folder. What&amp;rsquo;s funny is that instead of a straight single quote, Ubuntu decided for whatever reason to use a curly quote! I used to use the following Bash script on X11, but it no longer works under Wayland:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;scrot &lt;span class="s1"&gt;&amp;#39;%Y-%m-%d-%H-%M-%S.png&amp;#39;&lt;/span&gt; --thumb 300x200 -e &lt;span class="s1"&gt;&amp;#39;mv $m $f ~/Media/Pictures/screenshots&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;small&gt;Here, &lt;code&gt;screenhots&lt;/code&gt; is a soft link to the default subfolder where screenshots are saved.&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-08&lt;/a&gt;: &lt;a href="https://www.tdpain.net/blog/a-year-of-reading"&gt;I Tracked Everything I Read on the Internet for a Year&lt;/a&gt;. It reminds me of my defunct Emacs &lt;a href="https://aliquote.org/pub/urls.html"&gt;refiled links&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-08&lt;/a&gt;: ♪ Antony &amp;amp; The Johnsons · You Are My Sister&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-09&lt;/a&gt;: &lt;a href="https://blog.phronemophobic.com/dewey-analysis.html"&gt;Analyzing Every Clojure Project on Github&lt;/a&gt;. &lt;code&gt;#clojure&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-09&lt;/a&gt;: &lt;a href="https://www.hillelwayne.com/post/intermediate-vim/"&gt;At least one Vim trick you might not know&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-09&lt;/a&gt;: &lt;a href="https://www.johndcook.com/blog/2012/09/25/ramanujans-factorial-approximation/"&gt;Ramanujan’s factorial approximation&lt;/a&gt;. &lt;code&gt;#math&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-12&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I have an IDE, but I keep going back to essentially the same setup you have. I find that GUI IDE&amp;rsquo;s tend to try to be too many things at the same time. I like having nothing on the screen that isn&amp;rsquo;t directly related to what I&amp;rsquo;m doing, and I strongly dislike ribbons of things I could click on but rarely, if ever, do. &amp;mdash; &lt;a href="https://news.ycombinator.com/item?id=24888590"&gt; I don&amp;rsquo;t use an IDE, should I be using one?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-09-12&lt;/a&gt;: &lt;a href="https://matt-rickard.com/sqlite-doesnt-use-git"&gt;SQLite Doesn&amp;rsquo;t Use Git&lt;/a&gt;. &lt;code&gt;#git&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-12&lt;/a&gt;: &lt;a href="https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html"&gt;Why you shouldn&amp;rsquo;t invoke setup.py directly&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-12&lt;/a&gt;: &lt;a href="https://andybrewer.github.io/mvp/"&gt;mvp.css&lt;/a&gt;: A minimalist stylesheet for HTML elements.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-12&lt;/a&gt;: ♪ Helen Merrill · You&amp;rsquo;ve Got a Date With the Blu&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-13&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Common Lisp is a fine language with exceptional interactivity, multiple implementations providing the potential for acceptable performance, useful features like condition system, and a stable standard base. This, in theory, makes is very much suited toward data processing and analysis. Although practice paints a less favorable picture, there are still use cases where Common Lisp could be considered to be a very good pick. Also, I simply like writing Lisp code. &amp;mdash; &lt;a href="https://github.com/sirherrbatka/vellum"&gt;sirherrbatka/vellum&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-09-13&lt;/a&gt;: &lt;a href="https://creativcoder.dev/what-is-lsm-tree"&gt;What is a LSM Tree?&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-13&lt;/a&gt;: &lt;a href="https://apenwarr.ca/log/20181113"&gt;mtime comparison considered harmful&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-13&lt;/a&gt;: ♪ Killing Joke · Sun Goes Down&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-16&lt;/a&gt;: ♪ New Order · Blue Monday (Instrumental Outtake)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-19&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Purely functional programs are easier to test, they make better and more reliable APIs, and our environments, compilers, and run-time systems take advantage of functional style. &amp;mdash; &lt;a href="https://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html"&gt;Getting rid of set-car! and set-cdr!&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-09-19&lt;/a&gt;: Lovely.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;One way to solve the delays is to disable your internet connection. This is tough medicine, but if you notice these delays, try it for an hour just to verify that indeed the issue is resolved by disabling internet connectivity. &amp;mdash; &lt;a href="https://sigpipe.macromates.com/2020/macos-catalina-slow-by-design/"&gt;macOS 10.15: Slow by Design&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-09-19&lt;/a&gt;: &lt;a href="https://cp-algorithms.com/"&gt;Algorithms for Competitive Programming&lt;/a&gt;. See also my review of &lt;a href="https://aliquote.org/post/the-competitive-programmer-s-handbook/"&gt;The Competitive Programmer&amp;rsquo;s Handbook&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-19&lt;/a&gt;: &lt;a href="https://artemis.sh/2022/09/18/wayland-from-an-x-apologist.html"&gt;An X11 Apologist Tries Wayland&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-19&lt;/a&gt;: &lt;a href="https://gist.github.com/ttesmer/948df432cf46ec6db8c1e83ab59b1b21"&gt;Automatic Differentiation in 38 lines of Haskell&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-19&lt;/a&gt;: ♪ The Only Ones · Peter and the Pets (2008 Remastered)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-25&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I don&amp;rsquo;t tap my own phone. I don&amp;rsquo;t xerox postcards before I mail them back from vacation. I don&amp;rsquo;t take a voice recorder when I go out with friends. And I don&amp;rsquo;t have a copy machine at home to duplicate hand written notes I may send. &amp;mdash; &lt;a href="https://mark.stosberg.com/the_cost_of_saving_sent_e-mail/"&gt;The cost of saving sent e-mail&lt;/a&gt;I do like having local copies, both of my handxritten notes and of my sent e-mails. Digital nomadism, with one foot in the analog world.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-09-25&lt;/a&gt;: &amp;gt; I keep trying to quit vim. I keep ending up inside a terminal, inside vim, writing code. Like SQLite, vim is an island of stability over my career. While I wish IDEs were better, I am extremely thankful for tools that work and respect the effort I have taken to learn them, decade after decade. &amp;mdash; &lt;a href="https://crawshaw.io/blog/thankful-for-technology"&gt;Software I’m thankful for&lt;/a&gt;&lt;br&gt;
f&lt;a href="#" style="text-decoration: none;"&gt;2022-09-25&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The internet is no longer a place where a relatively-small fraction of the human population go to find something different than everyday life. It is everyday life for billions of people. As long as life is megacorps and information gatekeepers, so too is the global ubiquitous internet. Mission accomplished. &amp;mdash; &lt;a href="https://crawshaw.io/blog/searching-the-creative-internet"&gt;Searching the Creative Internet&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-09-25&lt;/a&gt;: &lt;a href="https://travisdowns.github.io/blog/2019/08/26/vector-inc.html"&gt;Incrementing Vectors&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-25&lt;/a&gt;: &lt;a href="https://jacobbrazeal.wordpress.com/2022/09/23/gpt-3-can-find-paths-up-to-7-nodes-long-in-random-graphs/"&gt;Using GPT-3 to pathfind in random graphs&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-28&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/2022-09-28-15-34-53.png" alt="cmus"&gt;&lt;small&gt;Cmus revamped!&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-29&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The relationship between developers and App Store reviewers is tense at best. Most people are trying to build well-designed, useful mobile apps. Apple has instituted App Store reviews to maintain a high-quality bar for apps and weed out spammy or nefarious actors, using human evaluators to test individual apps and provide direct feedback. However, malicious apps are relatively rare; arguably, Apple doesn’t do a great job filtering them out anyway. &amp;mdash; &lt;a href="https://vivqu.com/blog/2022/09/25/outdated-apps/"&gt;Outdated vs. Complete&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-09-29&lt;/a&gt;: TIL about &lt;a href="https://rclone.org/"&gt;Rclone&lt;/a&gt;, thanks to the following blog post: &lt;a href="https://ivymike.dev/upside-down-backups.html"&gt;An Upside-Down Backup Strategy&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-29&lt;/a&gt;: &lt;a href="https://www.extrema.is/blog/2022/04/04/data-types-a-la-carte"&gt;Data types à la carte&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-29&lt;/a&gt;: &lt;a href="https://blintzbase.com/posts/pir-and-fhe-from-scratch/"&gt;Explained from scratch: private information retrieval using homomorphic encryption&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-29&lt;/a&gt;: &lt;a href="https://blog.meadsteve.dev/programming/2020/02/10/types-at-the-edges-in-python/"&gt;Types at the edges in Python&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-29&lt;/a&gt;: ♪ Nadje Noordhuis · Migration&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-30&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;My personal productivity cycle is tied to this industry hype cycle. My schoolfriend back in 2003 was my personal “technology trigger.” From him, I rapidly learned some standard tools from Gartner’s plateau of productivity: PHP, MySQL, Apache. Then I surveyed the plateau more widely, finding Python, Postgres, and Nginx. A little further away, I had heard of Gartner’s trough of disillusionment. I sneered at the Perl, Java, CORBA. I’ll keep my Python, thanks. &amp;mdash; &lt;a href="https://jameshfisher.com/2019/03/23/the-hacker-hype-cycle/"&gt;The hacker hype cycle&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-09-30&lt;/a&gt;: The full text of my Introduction to the Theory of Programming Languages book (second printing, 1991) is &lt;a href="https://bertrandmeyer.com/2022/09/28/introduction-theory-programming-languages-full-book-now-freely-available/"&gt;now available&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-30&lt;/a&gt;: &lt;a href="https://github.com/mayfrost/guides/blob/master/ALTERNATIVES.md"&gt;Alternatives to bloatware&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-30&lt;/a&gt;: &lt;a href="https://homotopytypetheory.org/book/"&gt;Homotopy Type Theory&lt;/a&gt;. &lt;code&gt;#maths&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-09-30&lt;/a&gt;: ♪ The Dresden Dolls · Coin-Operated Boy&lt;br&gt;&lt;/p&gt;</description></item><item><title>Unified colors of TUIs</title><link>https://aliquote.org/post/unified-colors-of-tuis/</link><pubDate>Wed, 28 Sep 2022 20:02:45 +0200</pubDate><guid>https://aliquote.org/post/unified-colors-of-tuis/</guid><description>&lt;p&gt;The other day I got tired of my terminal color scheme (&lt;a href="https://www.nordtheme.com/docs/colors-and-palettes"&gt;Nord&lt;/a&gt;) which makes no distinction between dark and light colors, except for white and black variants, and I was looking for a prettier color scheme that could be used in a light or dark theme as well. Indeed, I used to use a light theme for all my command-line tools, including Vim (see, e.g., the screenshot at the end of &lt;a href="https://aliquote.org/post/getting-into-neovim/"&gt;this post&lt;/a&gt;) until I switched to the Nord palette. However, when I&amp;rsquo;m tired, or at night, I prefer a dark theme. And, well, sometimes I happened to miss my good old light theme. So I devised yet another theme for my terminal, and then for Neovim.&lt;/p&gt;
&lt;p&gt;Here is what I finally decided to stand by for the next few weeks:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2022-09-28-21-00-45.png"&gt;
&lt;/figure&gt;
&lt;p&gt;This palette was grabbed from the homepage of &lt;a href="https://terminal.sexy"&gt;https://terminal.sexy&lt;/a&gt;, and the white/dark variants are based on the Nord palette and personal taste. I don&amp;rsquo;t know its name, though.&lt;/p&gt;
&lt;p&gt;The other reason I designed a new color theme for the terminal is that I wanted it to be useful for Neovim too. As I said, I have two main colorscheme, which are automatically set up based on the value of &lt;code&gt;background&lt;/code&gt;. This is done with an autocommand that looks like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-vim" data-lang="vim"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="p"&gt;!&lt;/span&gt; &lt;span class="nx"&gt;misc&lt;/span&gt;#&lt;span class="nx"&gt;set_theme&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="nx"&gt;abort&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &amp;amp;&lt;span class="nx"&gt;background&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt;# &lt;span class="s1"&gt;&amp;#39;dark&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;colorscheme&lt;/span&gt; &lt;span class="nx"&gt;nord&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;colorscheme&lt;/span&gt; &lt;span class="nb"&gt;light&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;endif&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;endfunction&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="m"&gt;-8&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;--------&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;augroup&lt;/span&gt; &lt;span class="nx"&gt;colortheme&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;autocmd&lt;/span&gt;&lt;span class="p"&gt;!&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;autocmd&lt;/span&gt; &lt;span class="nx"&gt;OptionSet&lt;/span&gt; &lt;span class="nx"&gt;background&lt;/span&gt; &lt;span class="nx"&gt;call&lt;/span&gt; &lt;span class="nx"&gt;misc&lt;/span&gt;#&lt;span class="nx"&gt;set_theme&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;augroup&lt;/span&gt; &lt;span class="nx"&gt;END&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The advantage is that this is all managed by Vim itself, as discussed in a &lt;a href="https://aliquote.org/post/neovim-and-tmux/"&gt;related post&lt;/a&gt;. I have an extra apocryptic command in my &lt;code&gt;init.lua&lt;/code&gt; file to handle possible Tmux glitches:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lua" data-lang="lua"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;-- HACK: work around bad detection of background in Tmux (no OSC11 support)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;-- https://github.com/neovim/neovim/issues/17070&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;vim.api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nvim_exec&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;[[
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;if $TERM ==# &amp;#34;tmux-256color&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; lua vim.loop.fs_write(2, &amp;#34;\27Ptmux;\27\27]11;?\7\27\\&amp;#34;, -1, nil)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;endif
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Later, I wrote a shell script that allows me to switch my color theme on the go. Since I now use Alacritty which has a hot reload capabilitites this works quite well. Alacritty is really great, but I am better talking about Alacritty in a another post. That&amp;rsquo;s how I manage to use two colorschemes in my terminal and Neovim.&lt;/p&gt;
&lt;p&gt;Those two colorschemes, which are based on &lt;a href="https://aliquote.org/post/on-color-scheme/"&gt;modified&lt;/a&gt; versions of Nord and Vimbones from the zenbones plugin, are great for daily use, but they are not consistent one each other. And I&amp;rsquo;m too lazy to find a good fit for a common color palettes. Less is better, most of the time, so I rewrote from a scratch a single colortheme, as I did three years ago for Vim. It tooks me less than an hour to get a working theme for both color themes (light and dark): no color, except for constant and stuff I want to be aware of (warning or error message, bad spelling, etc.). Again, I take advantage of Alacritty&amp;rsquo;s handling multiple fonts to highlight keywords or comments with medium or semi-bolded typefaces. It&amp;rsquo;s all good!&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2022-09-29-09-47-18.png"&gt;
&lt;/figure&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Morcheeba • &lt;em&gt;Trigger Hippie&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Currying and repeated calls of a function</title><link>https://aliquote.org/post/scheme-repeated-fn/</link><pubDate>Mon, 19 Sep 2022 14:06:44 +0200</pubDate><guid>https://aliquote.org/post/scheme-repeated-fn/</guid><description>&lt;p&gt;In my &lt;a href="https://aliquote.org/post/bootstrap-in-scheme/"&gt;previous post&lt;/a&gt; I discussed the repeated application of a function to build a list of results. This was done using a named let form first, then through currying. See what&amp;rsquo;s happening?&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;import&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;chicken&lt;/span&gt; &lt;span class="nv"&gt;random&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;curry&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="nv"&gt;f&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;= &lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;f&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;curry&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;- &lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;f&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;square&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;* &lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;curry&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cons &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;square&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; (4 4 4 4 4)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;random&lt;/span&gt; &lt;span class="nv"&gt;max&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;pseudo-random-integer&lt;/span&gt; &lt;span class="nv"&gt;max&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;curry&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cons &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;random&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; (9 6 5 3 7)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Since intermediate results are not exploited in successive calls to &lt;code&gt;f&lt;/code&gt; in the above example, this amounts to make &lt;code&gt;n&lt;/code&gt; independent calls to &lt;code&gt;f&lt;/code&gt;, unlike the following use of &lt;code&gt;curry&lt;/code&gt;, where intermediate results are reused:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;curry&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;square&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; 16&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;curry&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;square&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; 256&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In the first case, we compute $2\times 2 = 4$, then $4\times 4 = 16$, while in the second case we add an extra step with $16\times 16 = 256$.&lt;/p&gt;
&lt;p&gt;The most natural application of currying is probably to compute an iterated or cumulative sum in statistical computing. As an alternative one may consider a &amp;ldquo;reducer&amp;rdquo;, like &lt;code&gt;reduce&lt;/code&gt; or &lt;code&gt;foldl&lt;/code&gt;. Currying is also important in functional programming when it comes to manage function multiple arguments, since it allows to express $f(x, y)$ as $g(x)(y)$, for instance. In Python, the &lt;code&gt;partial&lt;/code&gt; function from the &lt;a href="https://docs.python.org/3/library/functools.html"&gt;functools&lt;/a&gt; package does just that. In Scheme, we can introduce as many lambdas as we need in a function, or use specialized macros.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; As an example, consider a function that expect two arguments, &lt;code&gt;(define (greater? x n) (&amp;gt; x n))&lt;/code&gt; &amp;ndash; I use such constructs in combination with &lt;code&gt;filter&lt;/code&gt; to select observations in a sequence of numerical values; it can be converted to a one-argument function using an extra lambda, &lt;code&gt;(define (greater? n) (lambda (x) (&amp;gt; x n)))&lt;/code&gt;. Then instead of &lt;code&gt;(greater? 3 1)&lt;/code&gt;, we would simply write &lt;code&gt;((greater? 1) 3)&lt;/code&gt;. The function now returns a new function that knows the value of &lt;code&gt;n&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The SICP has another application of repeated call to a function in exercise 1.43:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If f is a numerical function and n is a positive integer, then we can form the nth repeated application of f, which is defined to be the function whose value at x is f(f(&amp;hellip;(f(x))&amp;hellip;)). For example, if f is the function x + 1, then the nth repeated application of f is the function x + n. If f is the operation of squaring a number, then the nth repeated application of f is the function that raises its argument to the 2^nth power. Write a procedure that takes as inputs a procedure that computes f and a positive integer n and returns the procedure that computes the nth repeated application of f.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Unlike the previous case, this times it&amp;rsquo;s all about composing function using an auxiliary function, &lt;code&gt;compose&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;compose&lt;/span&gt; &lt;span class="nv"&gt;f&lt;/span&gt; &lt;span class="nv"&gt;g&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;f&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;g&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now, a recursive call to a function that calls itself $n$ times, e.g. $f(x) = x^2$ which for $x=5$ and $n=4$ is $(5 \times (5 \times (5 \times 5)))$, can be written as:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;repeated&lt;/span&gt; &lt;span class="nv"&gt;fn&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;= &lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;fn&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;compose&lt;/span&gt; &lt;span class="nv"&gt;fn&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;repeated&lt;/span&gt; &lt;span class="nv"&gt;fn&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;- &lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In the above, &lt;code&gt;fn&lt;/code&gt; isn&amp;rsquo;t called &lt;code&gt;n&lt;/code&gt; times, instead this function returns the function &lt;code&gt;fn&lt;/code&gt; itself $n-1$ times and the lambda from &lt;code&gt;compose&lt;/code&gt; takes care of calling those new functions, plus an extra call via the guard which makes for a total of $n$ calls. Getting ride of the &lt;code&gt;compose&lt;/code&gt; helper function, we simply have the following lambda in action:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;repeated&lt;/span&gt; &lt;span class="nv"&gt;fn&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;= &lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;fn&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;fn&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;repeated&lt;/span&gt; &lt;span class="nv"&gt;fn&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;- &lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;See the &lt;a href="http://community.schemewiki.org/?sicp-ex-1.43"&gt;Scheme wiki&lt;/a&gt; for further discussion on this exercise.&lt;/p&gt;
&lt;p&gt;As a sidenote, the following function is defined (and explained) in &lt;a href="https://aliquote.org/post/simply-scheme/"&gt;Simply Scheme&lt;/a&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="nv"&gt;repeated&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let &lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nb"&gt;= &lt;/span&gt;&lt;span class="nv"&gt;=&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;- &lt;/span&gt;&lt;span class="nv"&gt;-&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;fn&lt;/span&gt; &lt;span class="nv"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;= &lt;/span&gt;&lt;span class="nv"&gt;number&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;repeated&lt;/span&gt; &lt;span class="nv"&gt;fn&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;- &lt;/span&gt;&lt;span class="nv"&gt;number&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;fn&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)))))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ The Fall • &lt;em&gt;Totally Wired&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;There&amp;rsquo;s even an &lt;a href="https://srfi.schemers.org/srfi-232/"&gt;SRFI&lt;/a&gt; under review.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Bootstrap resampling using Scheme</title><link>https://aliquote.org/post/bootstrap-in-scheme/</link><pubDate>Sun, 18 Sep 2022 10:34:29 +0200</pubDate><guid>https://aliquote.org/post/bootstrap-in-scheme/</guid><description>&lt;p&gt;In a &lt;a href="https://aliquote.org/post/bootstraping-lisp/"&gt;previous post&lt;/a&gt;, we discussed bootstrap resampling in Lisp, using LispStat. Let&amp;rsquo;s revisit the idea of the bootstrap using Chicken Scheme.&lt;/p&gt;
&lt;p&gt;Recall the nonparametric bootstrap algorithm:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Let $X = (x_1, x_2, \dots, x_n)$ be a sample of i.i.d observations.&lt;/li&gt;
&lt;li&gt;Generate $B$ random samples of size $n$ by drawing with replacement from $X$. Let call those new samples ${X_1^{\star}, X_2^{\star},\dots, X_B^{\star}}$.&lt;/li&gt;
&lt;li&gt;Consider a statistic $S(X)$, which may be any estimator, test statistic or average prediction for instance. Any aspect of the distribution of $S(X)$ may be assessed from the distribution of the bootstrap samples directly, ${S(X_1^{\star}), S(X_2^{\star}),\dots, S(X_B^{\star})}$.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The variance of the bootstrap estimate, $\mathbb{V}[S(X)]$ is then:&lt;/p&gt;
&lt;p&gt;$$ \mathbb{\widehat V}[S(X)] = \frac{1}{B-1}\sum_{b=1}^B\left(S(X_b^{\star}) - \bar S^{\star}\right)^2. $$&lt;/p&gt;
&lt;p&gt;where $\bar S^{\star}$ is the bootstrap sample mean, $\frac{1}{B}\sum_{b=1}^BS(X_b^{\star})$.&lt;/p&gt;
&lt;p&gt;Basically, we need a way to (1) shuffle (with replacement) a list of indices (the observation index in a list or vector) &lt;em&gt;or&lt;/em&gt; to shuffle the data values directly, then (2) call the same function on $B$ random lists, and finally (3) compute a sum (or any other test statistic). Below is some Chicken Scheme code.&lt;/p&gt;
&lt;p&gt;To pick a random element from a list, the following lambda will do the job (replace &lt;code&gt;pseudo-random-integer&lt;/code&gt; with &lt;code&gt;random&lt;/code&gt; if you are using Racket):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;import&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;chicken&lt;/span&gt; &lt;span class="nv"&gt;random&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list-ref &lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;pseudo-random-integer&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;length &lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Let&amp;rsquo;s test it:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="nv"&gt;xs&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list-ref &lt;/span&gt;&lt;span class="nv"&gt;xs&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;pseudo-random-integer&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;length &lt;/span&gt;&lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; 9&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Of course, your result will likely be a different one, since I don&amp;rsquo;t use a fixed seed for the PRNG. To repeat the same call to the above procedure, &lt;code&gt;pick&lt;/code&gt; say, &lt;code&gt;(length xs)&lt;/code&gt; times we can use a simple iterator:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;pick&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list-ref &lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;pseudo-random-integer&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;length &lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="nv"&gt;len&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;length &lt;/span&gt;&lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let &lt;/span&gt;&lt;span class="nv"&gt;loop&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;rs&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;()))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;cond &lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nb"&gt;&amp;gt; &lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="nv"&gt;len&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;rs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;else &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;loop&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;add1&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cons &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;pick&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;rs&lt;/span&gt;&lt;span class="p"&gt;)))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; (6 6 9 4 8 3 4 2 4 10)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Since we sample with replacement, it is normal to expect some duplicates since the &lt;a href="https://blogs.sas.com/content/iml/2017/06/28/average-bootstrap-sample-omits-data.html"&gt;average bootstrap sample&lt;/a&gt; omits 36.8% of the original sample.&lt;/p&gt;
&lt;p&gt;Everything is now in place. We just need to add one more outer loop to build $n$-samples $k$ times.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s first get &lt;a href="https://aliquote.org/pub/birthwt2.csv"&gt;some data&lt;/a&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;import&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;chicken&lt;/span&gt; &lt;span class="nv"&gt;io&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="nv"&gt;fs&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;birthwt2.csv&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="nv"&gt;data&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;call-with-input-file &lt;/span&gt;&lt;span class="nv"&gt;fs&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;read-lines&lt;/span&gt; &lt;span class="nv"&gt;p&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The above is quite rudimentary and return a list of strings, with the header as the first element. We don&amp;rsquo;t really need the header, and we want to keep birth weight (&lt;code&gt;bwt&lt;/code&gt;), which is the last numerical value. To parse the data, we will split each string on a comma, using Chicken &lt;code&gt;string-split&lt;/code&gt;,&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; and extract the &lt;code&gt;bwt&lt;/code&gt; value. Here is how it works:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;import&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;chicken&lt;/span&gt; &lt;span class="nv"&gt;string&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;car &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;reverse &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;string-split&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list-ref &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cdr &lt;/span&gt;&lt;span class="nv"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;,&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; 2523&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now, we just have to iterate over the whole list. We&amp;rsquo;ll be using &lt;code&gt;map&lt;/code&gt; instead of &lt;code&gt;for-each&lt;/code&gt; since we want to build a list of values along the way:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;value&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;string-&amp;gt;number &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;car &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;reverse &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;string-split&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;,&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="nv"&gt;bwt&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;map &lt;/span&gt;&lt;span class="nv"&gt;value&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cdr &lt;/span&gt;&lt;span class="nv"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And, now the core algorithm for the bootstrap (I will only compute the sum of the values, since it is a sufficient statistic in this case). Note that I converted the preceding named loop to a currying function:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;curry&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="nv"&gt;f&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;= &lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;f&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;curry&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;- &lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;f&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;sample&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;null? &lt;/span&gt;&lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;curry&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;length &lt;/span&gt;&lt;span class="nv"&gt;bwt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cons &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;pick&lt;/span&gt; &lt;span class="nv"&gt;bwt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;())))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;boot&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt; &lt;span class="nv"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let &lt;/span&gt;&lt;span class="nv"&gt;loop&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;rs&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;()))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;cond &lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nb"&gt;&amp;gt; &lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="nv"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;rs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;else &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;loop&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;add1&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cons &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;apply &lt;/span&gt;&lt;span class="nv"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;sample&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="nv"&gt;rs&lt;/span&gt;&lt;span class="p"&gt;))))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;boot&lt;/span&gt; &lt;span class="nv"&gt;bwt&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; (562214 564519 548880 544008 569931 587845 564206 558517 546902 555674 544962 554010 560677 559470 548108 533815 556976 548125 571216 575198)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Done.&lt;/p&gt;
&lt;p&gt;From there on, it is not really diffcult to write a full standalone procedure for bootstraping a test statistic, especially since Chicken Scheme provides some basic summary statistic in the &lt;a href="https://wiki.call-cc.org/eggref/5/statistics"&gt;statistics&lt;/a&gt; module. In a future post, I will show how to compute a 95% confidence interval for a correlation coefficient, and compare this estimate with the asymptotic CI computed using &lt;a href="https://en.wikipeadia.org/wiki/Fisher_transformation"&gt;Fisher&lt;/a&gt;&amp;rsquo;s z transformation.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ The Durutti Column • &lt;em&gt;Experiment in Fifth&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;See also &lt;code&gt;string-tokenize&lt;/code&gt; (SRFI-13).&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Vim Vixen</title><link>https://aliquote.org/post/vim-vixen/</link><pubDate>Sat, 17 Sep 2022 09:57:23 +0200</pubDate><guid>https://aliquote.org/post/vim-vixen/</guid><description>&lt;p&gt;One or two years ago I tried Tridactyl to ease navigation in Firefox using familiar Vim shortcuts. It is not that I do not like Firefox&amp;rsquo;s shortcuts, but I find them limited in a certain sense. How do you navigate in a page without using a mouse? At some point, you often need to use the mouse to follow an hyperlink. Most &lt;a href="https://www.ghacks.net/2017/05/26/webextension-vimium-brings-vim-like-controls-to-firefox/"&gt;keyboard-driven navigators&lt;/a&gt; provide a way to highlight all links in a web page using consecutive alphabetical letters or digrams (often times, this is triggered with the f or F shortcut, like in Vim), and to use the corresponding label to follow the link. When there are a limited number of hyperlinks on a page this happens to be quite fine. The two other aspects of managing a running web browser instance that are important to me are: how to efficiently manage my opened tabs and the current web page I ma looking at (e.g., going straight to the bottom or the top of the page), and how to search in a web page. &lt;a href="https://aliquote.org/post/nyxt-v3/"&gt;Nyxt browser&lt;/a&gt; solves both problems very nicely using familiar Vim shortcuts. How about Firefox?&lt;/p&gt;
&lt;p&gt;Here comes Vim Vixen. This is yet another keyboard-driven extension to navigate in Firefox. Contrary to Tridactyl it does not require to alter the default starting page, and it comes with the same (sane) default keybindings, which will be familiar to Vim users of course. There are some additional shortcuts that are quite handy too. For instance, you can yank the current URL to the clipboard using &lt;code&gt;y&lt;/code&gt;, or delete a tab using &lt;code&gt;d&lt;/code&gt; (&lt;code&gt;u&lt;/code&gt; will reopen the last closed tab). Navigating your opened tabs is quite easy, using &lt;code&gt;J&lt;/code&gt; and &lt;code&gt;K&lt;/code&gt;, like is the case for opening a new page using &lt;code&gt;o&lt;/code&gt; (open in current tab), &lt;code&gt;t&lt;/code&gt; (open in new tab) and &lt;code&gt;w&lt;/code&gt; (open in new window). You can also duplicate the current page (&lt;code&gt;zd&lt;/code&gt;), and manage zoom level using the &lt;code&gt;z&lt;/code&gt; prefix as well: &lt;code&gt;zo&lt;/code&gt; to zoom out, &lt;code&gt;zi&lt;/code&gt; to zoom in, and &lt;code&gt;z=&lt;/code&gt; to reset default zoom.&lt;/p&gt;
&lt;p&gt;Overall, I like it a lot. I should note that sometimes it loose focus and we are back with usual Firefox shortcuts. For instance, Vim Vixen search shortcut (&lt;code&gt;/&lt;/code&gt;) becomes unavailable and we have to use Firefox&amp;rsquo;s own quick search box. There are sometimes some other glitches when dark theme are enabled on some websites: The search bar which normally sits at the bottom of the window appears bigger than it should be. This is easily solved by triggering the search shortcut once.&lt;/p&gt;
&lt;p&gt;Of note, I installed a bunch of other extensions for Firefox, which I find quite convenient to navigate the web these days (think GDPR, cookies, trackers, etc.): &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/"&gt;uBlock Origin&lt;/a&gt;, &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/decentraleyes/"&gt;Decentraleyes&lt;/a&gt;, and &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/i-dont-care-about-cookies/"&gt;I don&amp;rsquo;t care about cookies&lt;/a&gt;, which changed my life really. All of them were recommended by &lt;a href="https://lukesmith.xyz/programs/"&gt;Luke Smith&lt;/a&gt;, including Vim Vixen.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Leonard Cohen • &lt;em&gt;Traveling Light&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>ArXiving on August 2022</title><link>https://aliquote.org/post/arxiv-10/</link><pubDate>Fri, 16 Sep 2022 10:09:25 +0100</pubDate><guid>https://aliquote.org/post/arxiv-10/</guid><description>&lt;p&gt;Here are a few papers that I read over the past weeks, in the CS and Stat category as usual.&lt;/p&gt;
&lt;h3 id="inverse-probability-weighting-the-missing-link-between-survey-sampling-and-evidence-estimation-"&gt;Inverse Probability Weighting: the Missing Link between Survey Sampling and Evidence Estimation (&lt;a href="https://arxiv.org/abs/2204.14121"&gt;https://arxiv.org/abs/2204.14121&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;Inverse probability weighting is used in survey and epidemiological analysis. I only used this technique once, and it was in quick comparison with propensity score analysis, where the key idea was in both case to achieve balance between treated and control subjects in order to reduce confounding. See Chan, K. C. G., et al. Globally efficient non-parametric inference of average treatment effects by empirical balancing calibration weighting (Journal of the Royal Statistical Society: Series B 78(3), 2016) for recent work. In this article, the authors discuss the use of binning and smoothing, or, as an alternative, hierarchical modeling. Their conclusions are that those Bayesian estimators perform better (i.e., they have lower mean squared errors) compared to simple IPW estimators.&lt;/p&gt;
&lt;h3 id="redefining-populations-of-inference-for-generalizations-from-small-studies-"&gt;Redefining Populations of Inference for Generalizations from Small Studies (&lt;a href="https://arxiv.org/abs/2204.14156"&gt;https://arxiv.org/abs/2204.14156&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;This article deals with the inference population that small sample studies usually focus on, and how it can be improved to foster valid generalizations (of the population average treatment effect, or PATE). This is based on the results from a cluster randomized trials in educational assessment. The two approaches considered here are coined &amp;ldquo;quantitatively optimal&amp;rdquo; and &amp;ldquo;policy-relevant&amp;rdquo; approaches. In the former case, the analysis relies on propensity scoring with varying cutoffs or the distributions of covariates. In the latter case, the idea is to identify subgroups that may benefit from the intervention. To improve imprecision, bot approaches can be undertaken, while for bias reduction only the quantitatively optimal approaches seem relevant.&lt;/p&gt;
&lt;h3 id="practical-considerations-for-specifying-a-super-learner-"&gt;Practical considerations for specifying a super learner (&lt;a href="https://arxiv.org/abs/2204.06139"&gt;https://arxiv.org/abs/2204.06139&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;Along with classical parametric regression models or ensemble methods in machine learning, the super learner algorithm allows to learn a prediction function without needing to set on a fixed modeling approach: as an entire pre-specified and adaptive strategy, it allow the modeler to consider several predictive models at once. Here&amp;rsquo;s the big picture:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2022-09-16-20-25-01.png"&gt;
&lt;/figure&gt;
&lt;p&gt;For the practictioner, the core decisions are to (1) specify the performance metric for the discrete super learner, (2) derive the effective sample size, (3) define the V-fold cross-validation scheme, (4) form library of candidate learners, and (5) to use discrete super learner to select the candidate with the best cross-validated predictive performance.&lt;/p&gt;
&lt;h3 id="pac-trees-supporting-parallel-and-compressed-purely-functional-collections-"&gt;PaC-trees: Supporting Parallel and Compressed Purely-Functional Collections (&lt;a href="https://arxiv.org/abs/2204.06077"&gt;https://arxiv.org/abs/2204.06077&lt;/a&gt;)&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;This paper presents PaC-trees, a purely-functional data structure supporting functional interfaces for sets, maps, and sequences that provides a significant reduction in space over existing approaches. A PaC-tree is a balanced binary search tree which blocks the leaves and compresses the blocks using arrays. We provide novel techniques for compressing and uncompressing the blocks which yield practical parallel functional algorithms for a broad set of operations on PaC-trees such as union, intersection, filter, reduction, and range queries which are both theoretically and practically efficient.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;See also &lt;a href="https://cmuparlay.github.io/PAMWeb/"&gt;Parallel Augmented Maps&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="correction-of-overfitting-bias-in-regression-models-"&gt;Correction of overfitting bias in regression models (&lt;a href="https://arxiv.org/abs/2204.05827"&gt;https://arxiv.org/abs/2204.05827&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;This article describes solutions to correct for the biais arising from overfitting datastes where $p/n &amp;lt; 1$. Besides regularization techniques, the asymptotic characteristic function of the ML estimators can be used to estimate the overfitting bias using only a small set of non-linear equations. The maths are dense, and I will probably need to reread the hard part.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ New Order • &lt;em&gt;Video 5 8 6&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Debugging in Vim</title><link>https://aliquote.org/post/debugging-in-vim/</link><pubDate>Thu, 15 Sep 2022 07:18:22 +0200</pubDate><guid>https://aliquote.org/post/debugging-in-vim/</guid><description>&lt;p&gt;I learned recently about Termdebug, which is built-in debugger for Vim and Neovim. Since I stopped using nvim-dap and MS debug adapter protocol, I&amp;rsquo;ve been using good old GDB for C, and &lt;code&gt;print&lt;/code&gt; statements for Python. That&amp;rsquo;s fine. In the latter case, I also drop a &lt;code&gt;breakpoint()&lt;/code&gt; instruction sometimes, and use pdb. Apparently, we can&amp;rsquo;t use pdb with Termdebug, but gdb and rust-gdb work just fine. For Haskell, this is slightly a different problem arising from unavailable debug symbols. However, ghci works also just fine since it comes with a bunch of debugging commands.&lt;/p&gt;
&lt;p&gt;Here are the corresponding documentation: &lt;a href="https://is.gd/ZjzJP3"&gt;gdb&lt;/a&gt;, &lt;a href="https://is.gd/vQ1Gdi"&gt;ghci&lt;/a&gt;, &lt;a href="https://is.gd/1aHQ09"&gt;pdb&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Near the end of the day, I&amp;rsquo;ve succesfully configured Termdebug for C and Rust, as well as pdb and ghci for Python and Haskell. I defined some wommon mappings to launch the debugger in a split window, together with other utilities to make or launch an REPL. Also, inspired by Cheat40, I wrote a quick cheatsheet for the various commands available in each debugger. They are mostly comparable, especially between gdb and pdb, but Haskell&amp;rsquo;s ghci comes with additional settings like &lt;code&gt;:set -fbreak-on-exception&lt;/code&gt; to log steps until an exception occurs.&lt;/p&gt;
&lt;p&gt;A sample configuration for python is shown below:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-vim" data-lang="vim"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;augroup&lt;/span&gt; &lt;span class="nx"&gt;whitespace&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;au&lt;/span&gt; &lt;span class="nx"&gt;BufWinEnter&lt;/span&gt; *.&lt;span class="nx"&gt;py&lt;/span&gt; &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;w&lt;/span&gt;:&lt;span class="nx"&gt;m2&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;matchadd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;WarningMsg&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;\%&amp;gt;80v.\+&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;-1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;au&lt;/span&gt; &lt;span class="nx"&gt;BufWinLeave&lt;/span&gt; *.&lt;span class="nx"&gt;py&lt;/span&gt; &lt;span class="nx"&gt;call&lt;/span&gt; &lt;span class="nx"&gt;clearmatches&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;augroup&lt;/span&gt; &lt;span class="nx"&gt;END&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;compiler&lt;/span&gt; &lt;span class="nx"&gt;pyunit&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;setlocal&lt;/span&gt; &lt;span class="nx"&gt;makeprg&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;python3&lt;/span&gt;\ %
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;setlocal&lt;/span&gt; &lt;span class="nx"&gt;errorformat&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;setlocal&lt;/span&gt; &lt;span class="nx"&gt;foldmethod&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;indent&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;setlocal&lt;/span&gt; &lt;span class="nx"&gt;foldlevel&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="m"&gt;99&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;nmap&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;gs&lt;/span&gt; :&lt;span class="m"&gt;10&lt;/span&gt; &lt;span class="nx"&gt;split&lt;/span&gt; &lt;span class="nx"&gt;term&lt;/span&gt;:&lt;span class="sr"&gt;//&lt;/span&gt;&lt;span class="nx"&gt;python3&lt;/span&gt; %&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;:&lt;span class="nx"&gt;startinsert&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;nmap&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;gS&lt;/span&gt; :&lt;span class="m"&gt;10&lt;/span&gt; &lt;span class="nx"&gt;split&lt;/span&gt; &lt;span class="nx"&gt;term&lt;/span&gt;:&lt;span class="sr"&gt;//&lt;/span&gt;&lt;span class="nx"&gt;ipython&lt;/span&gt; &lt;span class="p"&gt;--&lt;/span&gt;&lt;span class="nx"&gt;simple&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;:&lt;span class="nx"&gt;startinsert&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;nmap&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;gK&lt;/span&gt; :&lt;span class="p"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;nvim&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;keywordprg&lt;/span&gt; &lt;span class="nx"&gt;python&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;cword&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;nmap&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;localleader&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;dd&lt;/span&gt; :&lt;span class="m"&gt;10&lt;/span&gt; &lt;span class="nx"&gt;split&lt;/span&gt; &lt;span class="nx"&gt;term&lt;/span&gt;:&lt;span class="sr"&gt;//&lt;/span&gt;&lt;span class="nx"&gt;python3&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;m&lt;/span&gt; &lt;span class="nx"&gt;pdb&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;%:p&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;nmap&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;silent&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;localleader&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;? :&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;C&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;u&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Cheatdebug&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;ia&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;pp&lt;/span&gt; &lt;span class="nx"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;DEBUG:&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Left&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Left&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;ia&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;bb&lt;/span&gt; &lt;span class="nx"&gt;breakpoint&lt;/span&gt;&lt;span class="p"&gt;()&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Esc&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;mb&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;highlight&lt;/span&gt; &lt;span class="nx"&gt;link&lt;/span&gt; &lt;span class="nx"&gt;myHighlight&lt;/span&gt; &lt;span class="nx"&gt;WarningMsg&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;match&lt;/span&gt; &lt;span class="nx"&gt;myHighlight&lt;/span&gt; &lt;span class="sr"&gt;/breakpoint()/&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;small&gt;Note that I use Neovim built-in LSP to get hover information on symbol at point, but I also have a custom mapping to launch pydoc3, or even Dasht.&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately, setting a breakpoint in pdb or ghci will not highlight the corresponding line in the buffer, and of course Termdebug output is more rich than those simple shells. However, note that this setup does not require any additional dependecies beside gdb and rust-gdb. No complex setup to attach to a running process or to download various adapters (this always worked fine, though; it&amp;rsquo;s just that it is far more advanced than what I discuss here, for results that are close in both approaches).&lt;/p&gt;
&lt;p&gt;Here is a preview of a fake debugging session on a Python script:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2022-09-15-13-29-01.png"&gt;
&lt;/figure&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Queens of the Stone Age • &lt;em&gt;Long Slow Goodbye&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Quick Bash script templates</title><link>https://aliquote.org/post/bash-templates/</link><pubDate>Mon, 12 Sep 2022 10:44:58 +0200</pubDate><guid>https://aliquote.org/post/bash-templates/</guid><description>&lt;p&gt;Over the years, I wrote a lot of little helper Bash scripts to automate things on macOS or Ubuntu. Most of the times it was simply a matter of putting a series of variables and commands, some &lt;code&gt;echo&lt;/code&gt; and the like, after a shebang line. In the end, this was messy but it worked as intended.&lt;/p&gt;
&lt;p&gt;Here are two templates that may simplify the process of writing small shell scripts. They both share the same principles: the use of &amp;ldquo;subcommand&amp;rdquo; and the display of a short help message in case argument &lt;code&gt;$1&lt;/code&gt; is empty (since there seems to be so much a lack of convention that I never remember if we need to pass &lt;code&gt;help&lt;/code&gt;, &lt;code&gt;--help&lt;/code&gt; or &lt;code&gt;-help&lt;/code&gt; after program name to get some help).&lt;/p&gt;
&lt;p&gt;The first template is minimalist. There&amp;rsquo;s no error checking, and it is assumed that instructions can be grouped logically into independent main options like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#!/usr/bin/env bash
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; in
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;fizz&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; -e &lt;span class="s2"&gt;&amp;#34;\033[0;32m[+] Process first option\033[0m&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;buzz&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; -e &lt;span class="s2"&gt;&amp;#34;\033[0;32m[+] Do some banana\033[0m&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;help&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; -e &lt;span class="s2"&gt;&amp;#34;Usage: &lt;/span&gt;&lt;span class="nv"&gt;$0&lt;/span&gt;&lt;span class="s2"&gt; {fizz|buzz}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;*&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; -e &lt;span class="s2"&gt;&amp;#34;Usage: &lt;/span&gt;&lt;span class="nv"&gt;$0&lt;/span&gt;&lt;span class="s2"&gt; {fizz|buzz}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;esac&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As can be seen, this is pretty basic stuff, and everything is handled via the first argument to the shell script (recall that &lt;code&gt;$0&lt;/code&gt; is the program name, &lt;code&gt;$1&lt;/code&gt; its first argument, etc.). Of course, feel free to add all sort of guards (&lt;code&gt;set -e&lt;/code&gt;, &lt;code&gt;set -u&lt;/code&gt;, &lt;code&gt;set -o pipefail&lt;/code&gt;) at the top of your script. My default Vim template for shell scripts include most of them, and I delete unnecessary ones depending on my needs.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2022-10-27]&lt;/small&gt;&lt;br&gt;
See also &lt;a href="https://sharats.me/posts/shell-script-best-practices/"&gt;Shell Script Best Practices&lt;/a&gt; to learn a lot more tips and tricks. It also features a nice Bash template.
&lt;/div&gt;
&lt;p&gt;The second template is a little more involved as it exemplifies the use of proper subcommands, as in Hugo or Git for instance. The following script is a real script that I use to update a changelog with Git revisions in specific Git repositories on my hard drive (my website and all Git projects that are in the same directory, &lt;code&gt;$HOME/cwd&lt;/code&gt;). Here&amp;rsquo;s the gist of it:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#!/usr/bin/env bash
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;whos&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;basename &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$0&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="k"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;tmpdir&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;/tmp
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;_help&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Usage: &lt;/span&gt;&lt;span class="nv"&gt;$whos&lt;/span&gt;&lt;span class="s2"&gt; &amp;lt;subcommand&amp;gt; [options]&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Subcommands:&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34; update Update log entries&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34; show Show log entries&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;For help with each subcommand run:&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$whos&lt;/span&gt;&lt;span class="s2"&gt; &amp;lt;subcommand&amp;gt; -h|--help&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;_update&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;cd&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;/Sites/aliquote &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; git log --author&lt;span class="o"&gt;=&lt;/span&gt;chl --pretty&lt;span class="o"&gt;=&lt;/span&gt;format:&lt;span class="s2"&gt;&amp;#34;* %as %an &amp;lt;%ae&amp;gt; - [&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;PWD&lt;/span&gt;&lt;span class="p"&gt;/*&lt;/span&gt;&lt;span class="se"&gt;\/&lt;/span&gt;&lt;span class="p"&gt;/&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/%h] %s&amp;#34;&lt;/span&gt; &amp;gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$tmpdir&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;/home-chl-sites-aliquote.log
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; d in &lt;span class="k"&gt;$(&lt;/span&gt;find &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;/cwd -maxdepth &lt;span class="m"&gt;1&lt;/span&gt; -type d ! -name &lt;span class="s2"&gt;&amp;#34;cwd&amp;#34;&lt;/span&gt;&lt;span class="k"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;WD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;d&lt;/span&gt;&lt;span class="p"&gt;##*/&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; -d &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/cwd/&lt;/span&gt;&lt;span class="nv"&gt;$WD&lt;/span&gt;&lt;span class="s2"&gt;/.git&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;cd&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;/cwd/&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$WD&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; git log --author&lt;span class="o"&gt;=&lt;/span&gt;chl --pretty&lt;span class="o"&gt;=&lt;/span&gt;format:&lt;span class="s2"&gt;&amp;#34;* %as %an &amp;lt;%ae&amp;gt; - [&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;WD&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/%h] %s&amp;#34;&lt;/span&gt; &amp;gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$tmpdir&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;/home-chl-cwd-&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$WD&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;.log
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; cat &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$tmpdir&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;/home-chl-*.log &amp;gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$tmpdir&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;/logger
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; sort -k2 -r &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$tmpdir&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;/logger &amp;gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;/Documents/logs/changelog
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; rm &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$tmpdir&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;/home-chl-*.log &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$tmpdir&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;/logger
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;_show&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; less &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;/Documents/logs/changelog &lt;span class="p"&gt;|&lt;/span&gt; rg &lt;span class="s2"&gt;&amp;#34;[0-9]+-[0-9]+-[0-9]+&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;subcommand&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="nv"&gt;$subcommand&lt;/span&gt; in
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;&amp;#34;&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;-h&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;--help&amp;#34;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; _help
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;*&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;shift&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; _&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;subcommand&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$@&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nv"&gt;$?&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;127&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Error: &amp;#39;&lt;/span&gt;&lt;span class="nv"&gt;$subcommand&lt;/span&gt;&lt;span class="s2"&gt;&amp;#39; is not a known subcommand.&amp;#34;&lt;/span&gt; &amp;gt;&lt;span class="p"&gt;&amp;amp;&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34; Run &amp;#39;&lt;/span&gt;&lt;span class="nv"&gt;$whos&lt;/span&gt;&lt;span class="s2"&gt; --help&amp;#39; for a list of known subcommands.&amp;#34;&lt;/span&gt; &amp;gt;&lt;span class="p"&gt;&amp;amp;&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;exit&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;esac&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In this case, each subcommand is implemented as its own function, and they are processed at the command line using a simple variable interpolation. If you need more flexibility to handle your subcommand, I think this is better suited than the preceding sample script. I came across a similar approach in a Gist a while ago but I forgot to bookmark it and I can&amp;rsquo;t credit the author unfortunately.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Gilad Hekselman • &lt;em&gt;Flower&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Haskell and Vim</title><link>https://aliquote.org/post/haskell-and-vim/</link><pubDate>Sun, 11 Sep 2022 11:21:42 +0200</pubDate><guid>https://aliquote.org/post/haskell-and-vim/</guid><description>&lt;p&gt;Between two procrastination sessions on my couch due to my recent unexplained health problems that force me to rest on bed most of the time, I spent a few hours (uh, over several days and in several times because of the general lack of energy) cleaning up the files that were lying around on my computer, writing some maintenance scripts, devising cleaner dark and light colorschemes for my terminal and Neovim, and reviewing my Neovim configuration. It now starts like a breeze, as you can see by yourself:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;~ » hyperfine &lt;span class="s2"&gt;&amp;#34;nvim --headless +qa&amp;#34;&lt;/span&gt; --warmup &lt;span class="m"&gt;5&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Benchmark 1: nvim --headless +qa
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Time &lt;span class="o"&gt;(&lt;/span&gt;mean ± σ&lt;span class="o"&gt;)&lt;/span&gt;: 36.1 ms ± 0.3 ms &lt;span class="o"&gt;[&lt;/span&gt;User: 29.1 ms, System: 7.4 ms&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Range &lt;span class="o"&gt;(&lt;/span&gt;min … max&lt;span class="o"&gt;)&lt;/span&gt;: 35.5 ms … 37.0 ms &lt;span class="m"&gt;78&lt;/span&gt; runs
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;~ » hyperfine &lt;span class="s2"&gt;&amp;#34;nvim --headless +qa&amp;#34;&lt;/span&gt; --warmup &lt;span class="m"&gt;5&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Benchmark 1: nvim --headless +qa
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Time &lt;span class="o"&gt;(&lt;/span&gt;mean ± σ&lt;span class="o"&gt;)&lt;/span&gt;: 28.1 ms ± 0.6 ms &lt;span class="o"&gt;[&lt;/span&gt;User: 22.6 ms, System: 5.6 ms&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Range &lt;span class="o"&gt;(&lt;/span&gt;min … max&lt;span class="o"&gt;)&lt;/span&gt;: 27.0 ms … 29.7 ms &lt;span class="m"&gt;103&lt;/span&gt; runs
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The above benchmarks were run with default (700-2,300 MHz) and high (up to 4,900 MHz) performance settings on my laptop. Most of the optimizations were done at the level of package management: I removed a bunch of unused stuff &amp;ndash; the list of plugins I used went down from 15 to 10 plugins in the last two months, and moved most of the plugins to the &lt;code&gt;opt&lt;/code&gt; directory. Lazy loading almost halved the above startup time indeed.&lt;/p&gt;
&lt;p&gt;I even wrote a little doc file for my custom commands. Other than that, I spent a little time working on a general helper Bash script for the &lt;code&gt;keywordprg&lt;/code&gt; utility, in order to get some help whether I&amp;rsquo;m using a Language server or not. As an example I have this little script that can be used from the command line or as a &lt;code&gt;K&lt;/code&gt; handler in (Neo)vim:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#!/usr/bin/env bash
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;BROWSER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;elinks
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; in
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;stata&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$BROWSER&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; https://www.stata.com/help.cgi&lt;span class="se"&gt;\?&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;2&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; pydoc3 &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;2&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;r&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Rscript -e &lt;span class="s1"&gt;&amp;#39;args &amp;lt;- commandArgs(TRUE); help(args[2], package=c(&amp;#34;base&amp;#34;, &amp;#34;stats&amp;#34;), help_type=&amp;#34;text&amp;#34;)&amp;#39;&lt;/span&gt; --args &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;2&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;lisp&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;rc&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;hyperspec_lookup.ros &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$2&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="k"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$BROWSER&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$rc&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;help&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Usage: &lt;/span&gt;&lt;span class="nv"&gt;$0&lt;/span&gt;&lt;span class="s2"&gt; {stata|python|r|lisp|help}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;*&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Usage: &lt;/span&gt;&lt;span class="nv"&gt;$0&lt;/span&gt;&lt;span class="s2"&gt; {stata|python|r|lisp|help}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;esac&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;exit&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Not very polished, but it works as intended. The Lisp case was discussed in a &lt;a href="https://aliquote.org/post/vim-and-lisp/"&gt;previous post&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Back to the matter of this post. I originally intended to write about (Neo)vim and Haskell. After some reviews, I found that most of what I expected to say is already available online. I&amp;rsquo;m a hobbyist programmer, and I don&amp;rsquo;t spend a lot of time with Haskell or Clojure. When I started to play with those languages some years ago this was always with Emacs, and I got Intero and Cider to assist me. For Clojure there seems to be something like &lt;a href="https://github.com/Olical/conjure"&gt;Conjure&lt;/a&gt;, but I usually rely on Clojure LSP myself. Regarding Haskell, there&amp;rsquo;s some &lt;a href="https://github.com/parsonsmatt/intero-neovim"&gt;Intero&lt;/a&gt; for Vim too. Starter kits relying on &lt;a href="https://github.com/begriffs/haskell-vim-now"&gt;ghcide, hlint, hoogle&lt;/a&gt; are also available, but I don&amp;rsquo;t like starter kits anymore.&lt;/p&gt;
&lt;p&gt;Without further ado, here are some retrospective posts on the state of Haskell and Vim in recent years:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.stephendiehl.com/posts/vim_2016.html"&gt;Vim and haskell in 2016&lt;/a&gt;: Stephen Diehl has a long history with Haskell, even if it is mostly outdated material now that Haskell LSP is a thing, you may want to take a look at this post and other related posts on his site.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blog.jez.io/haskell-development-with-neovim/"&gt;Haskell Development with Neovim&lt;/a&gt;: This is mostly the old-fashioned way (several tools tied together with the help of Vim plugins).&lt;/li&gt;
&lt;li&gt;&lt;a href="http://marco-lopes.com/articles/Vim-and-Haskell-in-2019/"&gt;Vim and Haskell in 2019&lt;/a&gt;: This is a more modern take on Haskell+Neovim, with the old way of installing HIE and its wrapper.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://0xd34df00d.me/posts/2021/10/vim-and-haskell-in-2021.html"&gt;(neo)vim and Haskell, 2021 edition&lt;/a&gt;: I ended up in the same position, using the now consolidated Haskell LSP and Neovim builtin stuff (instead of Coc, as the author does). In my view, Neovim builtins for LSPs are still inferior to Coc, but I came to like the defaults: less friction, more people behind them, and it&amp;rsquo;s always evolving, mostly for the better.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Galaxie 500 • &lt;em&gt;Today&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Algorithms for functional programming</title><link>https://aliquote.org/post/algorithms-functional-programming/</link><pubDate>Thu, 08 Sep 2022 19:52:36 +0200</pubDate><guid>https://aliquote.org/post/algorithms-functional-programming/</guid><description>&lt;p&gt;I started reading &lt;em&gt;Algorithms for Functional Programming&lt;/em&gt;, by John David Stone (Springer, 2018), and it&amp;rsquo;s one of my preferred technical book of this Summer. My plan is to finish reading it before the start of the new academic year, and then read &lt;a href="https://functional-algorithms-verified.org/"&gt;Functional Algorithms, Verified!&lt;/a&gt;, then &lt;em&gt;Purely Functional Data Structures&lt;/em&gt;, by Okasaki, and maybe Bird&amp;rsquo;s &lt;em&gt;Pearls of Functional Algorithm Design&lt;/em&gt; in the next few months. Stay tuned!&lt;/p&gt;
&lt;p&gt;In this book, the author uses Scheme to illustrate all the concepts discussed in the book. After a brief introduction to functional programming and Scheme (Chapter 1), the author starts discussing more involved concepts. I should note that even if Chapter 1 is an introductory chapter, it features material that you will not find in introductory tutorial on Scheme, like &lt;code&gt;receive&lt;/code&gt; expressions&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; or advanced &lt;code&gt;let&lt;/code&gt; constructs. In Chapter 2, the author discusses several add-ons for working with lists (e.g. &lt;code&gt;map&lt;/code&gt;) and procedures (adapters, couplers, etc.), which allows to define all kind of function composition or dispatiching. Later, reducers and iterators are implemented, which for a complete distinct set of operations one usually perform using recursion alone. An example if&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;ceiling-of-log-two&lt;/span&gt; &lt;span class="nv"&gt;bound&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;pipe&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;iterate&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;pipe&lt;/span&gt; &lt;span class="nv"&gt;&amp;gt;initial&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;sect&lt;/span&gt; &lt;span class="nv"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="nv"&gt;&amp;lt;&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;bound&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;cross&lt;/span&gt; &lt;span class="nv"&gt;double&lt;/span&gt; &lt;span class="nv"&gt;add1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;&amp;gt;next&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I find this formulation a bit heavy, and I prefer the more classical appraoch the author suggests as an alterntive a few paragraphs later:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;ceiling-of-log-two&lt;/span&gt; &lt;span class="nv"&gt;bound&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;rec&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;doubler&lt;/span&gt; &lt;span class="nv"&gt;most-recent-double&lt;/span&gt; &lt;span class="nv"&gt;count&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;&amp;gt;= &lt;/span&gt;&lt;span class="nv"&gt;most-recent-double&lt;/span&gt; &lt;span class="nv"&gt;bound&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;count&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;doubler&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;double&lt;/span&gt; &lt;span class="nv"&gt;most-recent-double&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;add1&lt;/span&gt; &lt;span class="nv"&gt;count&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;There is a nice overview of recursion using natural numbers, again using &amp;ldquo;recursion managers&amp;rdquo;. Later the author presents a &lt;code&gt;tally&lt;/code&gt; function, simialr to what&amp;rsquo;s available in Python or Clojure&lt;/p&gt;
&lt;p&gt;The rest of the book is organized around data structure (Chapter 3 covers sum and product types, unions, pairs and named pairs, boxes which are restrictions of pairs, and various operations that can be performed on lists, trees and bags, sets, tables, and buffers) and various kind of algorithms along with the data structures they are best tied to (sorting, graphs, and sublist search), which makes for another half of the book. I am still reading or rereading some parts, because despite everything this book remains quite dense unless you have a good Scheme and have many years of hindsight (which is not my case).&lt;/p&gt;
&lt;p&gt;In each chapter, or even in between sections, a useful recap of Scheme procedures currently discussed is provided, with type hinting and a brief description. I found this very handy as it allows to go back to previous chapter for quick checks.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Iggy Pop • &lt;em&gt;Some Weird Sin&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Quoting the author, in let-expressions, it is an error if any expression in a binding speciﬁcation has more than one value. Frequently, however, we want to have local names for the values of a multiple-valued expression. A third local-binding construction, the receive-expression, provides for this possibility.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>The unquantified self #25</title><link>https://aliquote.org/post/unquantified-self-025/</link><pubDate>Sun, 04 Sep 2022 12:27:15 +0200</pubDate><guid>https://aliquote.org/post/unquantified-self-025/</guid><description>&lt;p&gt;I&amp;rsquo;m trying out a new desktop setup, see below.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2022-09-04-12-28-07.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Little customizations here and there: terminal transparency (10%) and refined dark theme,&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; uniformized statusline (no background color, darkgrey foreground where possible) and uniform Neovim statusline (&lt;code&gt;vim.o.laststatus = 3&lt;/code&gt;), &lt;a href="https://extensions.gnome.org/extension/4548/tactile/"&gt;tactile&lt;/a&gt; extension for window placement (after many attempts to find a suitable way of tiling windows altogther on my screen). It feels good, especially when you are anxious while waiting for biomedical test results. Still, I &lt;a href="https://aliquote.org/post/how-to-do-without-wm/"&gt;stand by&lt;/a&gt; the idea that Gnome WM is already a good fit for how I use to use my desktop, but being able to snap window on a grid is an invaluable add-on, especially since it does not conflict with natural tiling behavior of Gnome WM; moreover, when you use focus-follow-mouse mode, it is quite easy to activate windows on the fly.&lt;/p&gt;
&lt;p&gt;I am also back to Irssi and Cmus as my daily drivers for IRC and music. Matrix and Element are nice, but I only need the IRC bridge to be honest. Rhythmbox is also a great aplpication, but sometimes it is easier to just have Cmus running in a terminal, alongside other programs I use in Tmux. What&amp;rsquo;s funny is that I can switch to a virtual console (&lt;kbd&gt;Ctrl+Alt+F3&lt;/kbd&gt;) and I can still listen to my current playlist.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;Other than my desktop, I spent a little more time in front of my TV, watching Secret City and Mindhunter (same main actress), Tribes of Europa (only one season, and I don&amp;rsquo;t think there will be a sequel), and lately Sandman. See my informal &lt;a href="https://aliquote.org/articles/movies/"&gt;movie ratings&lt;/a&gt;. Unfortunately I haven&amp;rsquo;t been able to read much books because of small vision problems, among others. No new musical playlist at the moment, except that I got myself a present &lt;a href="https://aliquote.org/micro/2022-08-23-13-56-00/"&gt;few days ago&lt;/a&gt;. I&amp;rsquo;m lsitening to my good old playlists all day, though.&lt;/p&gt;
&lt;p&gt;If you follow this blog more or less regularly, you will have noticed an increased rate of posting of the main section. I&amp;rsquo;m afraid this won&amp;rsquo;t last forever, since the frequency with which I was writing blog posts is mostly due to the fact that I haven&amp;rsquo;t slept much for 4 weeks. My body is beginning to reach its limits and I will have to rest from time to time, but with a little hope I will remain faithful to my posting habits. I&amp;rsquo;m mostly diving with Scheme at the moment, and I have other posts in mind.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Chase Elodia • &lt;em&gt;You&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;For aesthetics, but also to alleviate suffering after long sessions in front of my computer.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;I do not often need a virtual console except when I want to be in full retor computing atmosphere, or like recently when I need to check that my colorscheme equally apply to $XDG_SESSION_TYPE = &amp;ldquo;tty&amp;rdquo; and &lt;code&gt;TERM=xterm-mono&lt;/code&gt; settings.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Summing random Uniform deviates</title><link>https://aliquote.org/post/summing-random-uniform/</link><pubDate>Sat, 03 Sep 2022 17:37:55 +0200</pubDate><guid>https://aliquote.org/post/summing-random-uniform/</guid><description>&lt;p&gt;&lt;a href="https://nullprogram.com/blog/2013/02/25/"&gt;Chris Wellons&lt;/a&gt; once asked the following question before providing some code to estimate the result, which I call brute force estimate but I do it a lot too:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;How many times should a random number from [0, 1] be drawn to have it sum over 1?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Here is my brute force approach using Scheme and recursion only:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;import&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;chicken&lt;/span&gt; &lt;span class="nv"&gt;random&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;set-pseudo-random-seed!&lt;/span&gt; &lt;span class="mi"&gt;101&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let &lt;/span&gt;&lt;span class="nv"&gt;loop&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;sum&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;cond &lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nb"&gt;&amp;gt; &lt;/span&gt;&lt;span class="nv"&gt;sum&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;else &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;loop&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;add1&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;+ &lt;/span&gt;&lt;span class="nv"&gt;sum&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;pseudo-random-real&lt;/span&gt;&lt;span class="p"&gt;))))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; 1.77838275494088&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;A more involved solution using (typed) Racket and &lt;code&gt;for/fold&lt;/code&gt; is discussed on &lt;a href="https://stackoverflow.com/questions/8328564/efficient-random-number-list-sum-in-racket"&gt;Stack Overflow&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;How about the math? There are several solutions available on math.SO, &lt;a href="https://math.stackexchange.com/q/111314/26851"&gt;more&lt;/a&gt; or &lt;a href="https://math.stackexchange.com/q/214399/26851"&gt;less&lt;/a&gt; complicated. See also &lt;a href="https://www.fourmilab.ch/documents/random_sum/"&gt;this application&lt;/a&gt;. In essence, the probability that the sum of $n$ variables is $&amp;gt; 1$ while the other $n - 1$ are $&amp;lt; 1$ is:&lt;/p&gt;
&lt;p&gt;$$
\begin{equation}
\begin{aligned}
P(S &amp;gt; 1) &amp;amp; = \int_1^n P_{X_1 + \dots + X_n}(u)du - \int_1^n P_{X_1 + \dots + X_{n-1}}(u)du\cr
&amp;amp; = \left( 1 - \frac{1}{n!} \right) - \left( 1 - \frac{1}{(n-1)!} \right)\cr
&amp;amp; = \frac{1}{n(n-2)!}
\end{aligned}
\end{equation}
$$&lt;/p&gt;
&lt;p&gt;Then it follows that $\sum_{n=1}^{\infty}nP(S &amp;gt; 1)$ is equal to $\sum_{n=1}^{\infty}\frac{1}{(n-2)!}$, or after simplification $e$.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Bauhaus • &lt;em&gt;She&amp;rsquo;s in Parties&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>On wrapping and reflowing text</title><link>https://aliquote.org/post/wrap-and-reflow/</link><pubDate>Thu, 01 Sep 2022 13:47:34 +0200</pubDate><guid>https://aliquote.org/post/wrap-and-reflow/</guid><description>&lt;p&gt;I stopped hard wrapping my plain text documents a long time ago, when I was primarily using Emacs for all-things related to text. I believe soft wrapping is better, but when you really need hard wraps it is no longer a solution. We hardly know when things get soft- or hard-wrapped unless we have some indication about the formatting option in our Emacs or Vim statusline. For the latter, this is easy fixed as suggested on &lt;a href="http://blog.ezyang.com/2010/03/vim-textwidth/"&gt;ezyang’s blog&lt;/a&gt;.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; That&amp;rsquo;s when you write for yourself, though.&lt;/p&gt;
&lt;p&gt;Two things always bothered me. On the one hand, while it is easy to unwrap text in Emacs (or Vim), it is a pity to do that on more basic text editors (and, sometimes, even advanced ones). You can use awk, of course, but my colleagues on Windows won&amp;rsquo;t understand why they would need to install yet another program for that very specific purpose. On the other hand, there&amp;rsquo;s a netiquette and RFC 2022, which states:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;There are two limits that this standard places on the number of characters in a line. Each line of characters MUST be no more than 998 characters, and SHOULD be no more than 78 characters, excluding the CRLF.&lt;br&gt;
The 998 character limit is due to limitations in many implementations which send, receive, or store Internet Message Format messages that simply cannot handle more than 998 characters on a line. Receiving implementations would do well to handle an arbitrarily large number of characters in a line for robustness sake. However, there are so many implementations which (in compliance with the transport requirements of [RFC2821]) do not accept messages containing more than 1000 character including the CR and LF per line, it is important for implementations not to create such messages.&lt;br&gt;
The more conservative 78 character recommendation is to accommodate the many implementations of user interfaces that display these messages which may truncate, or disastrously wrap, the display of more than 78 characters per line, in spite of the fact that such implementations are non-conformant to the intent of this specification (and that of [RFC2821] if they actually cause information to be lost). Again, even though this limitation is put on messages, it is encumbant upon implementations which display messages.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In other words, when writing emails, do hard-wrap your message (and don&amp;rsquo;t put your signature on top when group-replying in a mailing-list!). The same applies to Git &lt;a href="https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html"&gt;commit messages&lt;/a&gt;, although we may wrap differently the header (or summary) and body of a commit message. Regarding the header line limiation, this is not an absolute rule and it is often not respected, as far as I can tell, especially when introducing Git leaders (feat, fix, docs or doc, etc.). I keep seeing people setting the number of max characters allowed on a line (&lt;code&gt;textwidth&lt;/code&gt; in Vim parlance) below this limit, when composing email, probably to accomodate the quoted messages included in a group-reply. The OpenBSD even recommends &lt;a href="https://www.openbsd.org/mail.html"&gt;Plain text, 72 characters per line&lt;/a&gt;. There&amp;rsquo;s another Git-related justification for the 72 vs. 78 char limit.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; But see &lt;a href="https://useplaintext.email/"&gt;Use plaintext email&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The other option is to let the text &amp;ldquo;flow&amp;rdquo;, which leads to using the &lt;a href="https://brianbuccola.com/line-breaks-in-mutt-and-vim/"&gt;text-flowed&lt;/a&gt; format. There&amp;rsquo;s even an option for that in (Neo)mutt. However, there are some caveats with those conventions for ordinary emails in the 21th century: many mail readers, including Gmail&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt; or Outlook, don&amp;rsquo;t honor this setting apparently. Here&amp;rsquo;s how Gmail renders an email when we enforce a textwidth of 68 chars, despite asking for &lt;code&gt;text-flowed&lt;/code&gt; content:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;--8&amp;lt;--------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;MIME-Version: 1.0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Content-Type: text/plain; charset=utf-8; format=flowed
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Content-Disposition: inline
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;--8&amp;lt;--------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Hello,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;I&amp;#39;m writing to myself to test my new Neovim settings for writing
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mail according to the netiquette. This should end up being wrapped
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;correctly (but flowed for most mail reader, hopefully), with
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;signature at bottom to not bother people when group-replying.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;--8&amp;lt;--------
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That&amp;rsquo;s lame. The header does indicate that the text should be reflowed.&lt;/p&gt;
&lt;p&gt;This also seems to cause trouble with &lt;a href="https://nullprogram.com/blog/2017/06/15/"&gt;quoted messages and on GitHub&lt;/a&gt;. There&amp;rsquo;s &lt;a href="https://vxlabs.com/2019/08/25/format-flowed-with-long-lines/"&gt;one solution&lt;/a&gt; to annoy those programs, but there may be a better alternative: don&amp;rsquo;t hard wrap for casual emails, but enforce 72 chars max (or whatever) for list-reply, which is what I ended up doing recently. Since I don&amp;rsquo;t know how to manage alternative settings in &lt;code&gt;ftplugin/mail.vim&lt;/code&gt; depending on Neomutt reply action (&lt;code&gt;message-reply&lt;/code&gt; or &lt;code&gt;group-reply&lt;/code&gt;) and I don&amp;rsquo;t want to add folder hooks for each list I subscribed to, I defined a shortcut to change the format options when I am writing to a list rather than a single person:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-vim" data-lang="vim"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;set&lt;/span&gt; &lt;span class="nx"&gt;spell&lt;/span&gt; &lt;span class="nx"&gt;spelllang&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;fr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;en&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;setlocal&lt;/span&gt; &lt;span class="nx"&gt;tw&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;set&lt;/span&gt; &lt;span class="nx"&gt;formatoptions&lt;/span&gt;&lt;span class="p"&gt;+=&lt;/span&gt;&lt;span class="nx"&gt;wq&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="p"&gt;!&lt;/span&gt; &lt;span class="nx"&gt;Reflow&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="nx"&gt;abort&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;setlocal&lt;/span&gt; &lt;span class="nx"&gt;tw&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="m"&gt;72&lt;/span&gt; &lt;span class="nx"&gt;et&lt;/span&gt; &lt;span class="nx"&gt;cc&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="m"&gt;73&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;setlocal&lt;/span&gt; &lt;span class="nx"&gt;list&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;endfunction&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;map&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;g&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Esc&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;:&lt;span class="nx"&gt;call&lt;/span&gt; &lt;span class="nx"&gt;Reflow&lt;/span&gt;&lt;span class="p"&gt;()&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;vipgq&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;iabbrev&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt; &lt;span class="p"&gt;--&lt;/span&gt;&lt;span class="nx"&gt;chl&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now, whenever I list-reply, I can just press &lt;code&gt;g=&lt;/code&gt; (this is a mapping I use for formatting in LSP as well) to get the message correctly hard-wrapped to the desired hard limit (72 chars), and later I have &lt;code&gt;gq&lt;/code&gt; to do the hard work for me. That may just be crap, but it looks like it works.&lt;/p&gt;
&lt;p&gt;Better looking email or not? To be honest, I don&amp;rsquo;t really know since I quite like plain old good hard-wrapped text. But given that my editor and my terminal support so called wrap-margin, unlike Edward Z. Yang I do not mind writing long-lines as long as I know that I can soft- or hard-wrap them at any time withing a single key press.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Jasmine Myra • &lt;em&gt;New Beginnings&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;I use a different setting and I only display &lt;code&gt;tw&lt;/code&gt; (with &lt;code&gt;text-flowed&lt;/code&gt; indicator appended if any), &lt;code&gt;cc&lt;/code&gt; and &lt;code&gt;et&lt;/code&gt;: &lt;code&gt;&amp;quot;[%{&amp;amp;tw}%{matchstr(&amp;amp;fo, 'w')}%{&amp;amp;cc?','.&amp;amp;cc:''}%{&amp;amp;et?',+':''}] &amp;quot;&lt;/code&gt;.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;On an 80 column terminal, if we subtract 4 columns for the indent on the left and 4 more for symmetry on the right, we’re left with 72 columns.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:3"&gt;
&lt;p&gt;I stopped writing email in Gmail UI so long time ago that I have vague memory that it was just plain crap, but see &lt;a href="https://mathiasbynens.be/notes/gmail-plain-text"&gt;Dear Google, please fix plain text emails in Gmail&lt;/a&gt;.&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in August</title><link>https://aliquote.org/post/micro-08-2022/</link><pubDate>Wed, 31 Aug 2022 10:15:16 +0200</pubDate><guid>https://aliquote.org/post/micro-08-2022/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-08-09&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   The Frames, &lt;em&gt;True&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-10&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Where things really got broken was when multithreaded applications became commonplace. That&amp;rsquo;s when ctrl-c basically stopping working at all. &amp;mdash; &lt;a href="https://kevinlawler.com/ctrl-c"&gt;Ctrl-C: Why Programmers Can’t &amp;ldquo;Reset&amp;rdquo; Programs With Ctrl-C, but Used to Be Able To, and Why They Should Be Able to Again&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-08-10&lt;/a&gt;: Hot days (again). Salad parties almost every day.
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/68090238490__0F513EE2-0258-4C97-A9E8-B70F61672253.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/68090238490__0F513EE2-0258-4C97-A9E8-B70F61672253.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/68173912036__4EEE2BD3-DDC9-4680-B6B2-8AD37181C42B.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/68173912036__4EEE2BD3-DDC9-4680-B6B2-8AD37181C42B.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_2173.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_2173.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-10&lt;/a&gt;: &lt;a href="https://unixsheikh.com/articles/technical-reasons-to-choose-freebsd-over-linux.html"&gt;Technical reasons to choose FreeBSD over GNU/Linux&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-10&lt;/a&gt;: &lt;a href="https://www.draketo.de/anderes/latex-fonts.html"&gt;Top 20 Latex Fonts&lt;/a&gt;. &lt;code&gt;#tex&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-10&lt;/a&gt;: &lt;a href="https://pypi.org/project/more-itertools/"&gt;more-itertools&lt;/a&gt; is yet another gem when working with Python&amp;rsquo;s iterables. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-11&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Expect to pay, now or later. &amp;mdash; &lt;a href="https://dissociatedpress.net/2022/08/10/give-nothing-expect-nothing-gitlabs-the-latest-punching-bag-for-entitled-users/"&gt;Give nothing, expect nothing: GitLab’s the latest punching bag for entitled users&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-08-14&lt;/a&gt;: I&amp;rsquo;m done with Season 1 of &lt;a href="https://en.wikipedia.org/wiki/Mindhunter_(TV_series)"&gt;Mindhunter&lt;/a&gt;. Beautiful script, brilliant actors, nicely orchestrated plots. Informal ratings of others TV shows available &lt;a href="https://aliquote.org/articles/movies/"&gt;here&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-14&lt;/a&gt;: &lt;a href="https://www.ctrl.blog/entry/dict-protocol-privacy.html"&gt;Stop using DICT dictionary apps (such as GNOME/MATE Dictionary)&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-16&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;SQLite works with hundreds of millions of records just fine. Regular INSERTs show about 240K records per second on my laptop. And if you connect the CSV file as a virtual table (there is an extension for that) - inserts become 2 times faster. &amp;mdash; &lt;a href="https://antonz.org/sqlite-is-not-a-toy-database/"&gt;SQLite is not a toy database&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-08-16&lt;/a&gt;: Tom Mitchell&amp;rsquo;s &lt;em&gt;Machine Learning&lt;/em&gt; book is a bit old but it&amp;rsquo;s &lt;a href="https://www.cs.cmu.edu/afs/cs.cmu.edu/user/mitchell/ftp/mlbook.html"&gt;now free&lt;/a&gt;. Note that the PDF version offered on the website is huge (60 Mo) since it&amp;rsquo;s a scanned copy.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-16&lt;/a&gt;: &lt;a href="http://blog.pkh.me/p/33-deconstructing-be%CC%81zier-curves.html"&gt;Deconstructing Bézier curves&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-16&lt;/a&gt;: &lt;a href="https://github.com/bbalasub1/glmnet_python"&gt;Glmnet for python&lt;/a&gt;. I somewhat missed or forgot about that package. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-17&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Jewel, &lt;em&gt;Foolish Games&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-17&lt;/a&gt;: &lt;a href="https://blog.debiania.in.ua/posts/2020-05-18-howto-auto-start-ssh-agent-with-systemd-on-debian-bullseye.html?utm_source=pocket_mylist"&gt;Howto: auto-start ssh-agent with systemd on Debian Bullseye — Debiania&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-18&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The way I look at it, the apps themselves are the workspaces. On a smaller screen I usually full screen everything and on larger display scenarios, I have nearly everything laid out in front of me so I really just want to be able to switch between apps as fast as possible. &amp;mdash; &lt;a href="https://joshtronic.com/2018/09/09/why-i-dont-use-a-tiling-window-manager/"&gt;How I GNOME or Why I Don&amp;rsquo;t Use a Tiling Window Manager by Josh Sherman&lt;/a&gt;That&amp;rsquo;s the conclusion I reached as well on OS X and Ubuntu when I started (re)using native window manager facilities. This remains so even after me trying i3 then Regolith, since Tmux can do a lot of tiling too, and the only thing I really need is to have apps maximized on screen, or split vertically (who need to fully split a 16:10 or 4:3 laptop screen horizontally these days?).&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-08-18&lt;/a&gt;: Great! You can now use default keybindings from &lt;a href="https://getpocket.com"&gt;https://getpocket.com&lt;/a&gt; in Nyxt 3 (pre release).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-18&lt;/a&gt;: &lt;a href="https://blog.sanctum.geek.nz/watching-with-tmux/"&gt;Watching with tmux | Arabesque&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-22&lt;/a&gt;: &lt;a href="https://vez.mrsk.me/freebsd-defaults.html"&gt;FreeBSD - a lesson in poor defaults&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-22&lt;/a&gt;: &lt;a href="https://dwheeler.com/readable/readable-s-expressions.html"&gt;Readable s-expressions and sweet-expressions: Getting the infix fix and fewer parentheses in Lisp-like languages&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-22&lt;/a&gt;: &lt;a href="https://eugeneyan.com/writing/uncommon-python/"&gt;Uncommon Uses of Python in Commonly Used Libraries&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-22&lt;/a&gt;: &lt;a href="https://x.st/visual-sum-of-cubes/"&gt;Visual Sum of Cubes&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-23&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Magazine, &lt;em&gt;Cut Out Shapes&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-23&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Mannequin Pussy, &lt;em&gt;Romantic&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-23&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I&amp;rsquo;ll take economy over excess any day - give me a nice, uncluttered interface, a simple man page and power to spare for those occasions when I need it, and I&amp;rsquo;m a happy guy. My dream email client is a lot like my dream car, the Ferrari F355 Spider: plain-vanilla seats, a simple dashboard and the ability to accelerate from 0 to 60 miles per hour in under six seconds. &amp;mdash; &lt;a href="https://www.melonfire.com/archives/trog/article/a-man-and-his-mutt"&gt;A Man And His Mutt&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-08-23&lt;/a&gt;: Look what came up in the mailbox a few days ago:&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_2261.JPG" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-23&lt;/a&gt;: &lt;a href="https://baruchel.github.io/"&gt;Playing with exceptions inside lambda expressions in Python &lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-23&lt;/a&gt;: &lt;a href="https://baty.net/2022/searching-this-site-using-pagefind/"&gt;Searching this site using Pagefind&lt;/a&gt;. Looks like it works quite well with Hugo website.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-24&lt;/a&gt;: A &lt;a href="https://github.com/cadars/john-doe"&gt;simple way&lt;/a&gt; to make HTML websites: &lt;a href="https://john-doe.neocities.org"&gt;https://john-doe.neocities.org&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-24&lt;/a&gt;: &lt;a href="https://www.tedinski.com/2018/05/08/case-study-unix-philosophy.html"&gt;Deconstructing the &amp;ldquo;Unix philosophy&amp;rdquo;&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-24&lt;/a&gt;: &lt;a href="https://leancrew.com/all-this/2022/08/integers-decibels-and-graphs/"&gt;Integers, decibels, and graphs&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-24&lt;/a&gt;: &lt;a href="https://blog.robertelder.org/signed-or-unsigned/"&gt;Should I use Signed or Unsigned Ints In C? (Part 1)&lt;/a&gt;. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-24&lt;/a&gt;: &lt;a href="https://useplaintext.email/"&gt;Use plaintext email&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-25&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Marianne Faithfull, &lt;em&gt;Guilt&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-25&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Beautiful code is likely to be simple &amp;ndash; clear and easy to understand. Beautitful code is likely to be compact &amp;ndash; just enough code to do the job and no more &amp;ndash; but not cryptic, to the point where it cannot be understood. Beautiful code may well be general, solving a broad class of problems in a uniform way. One might even describe it as elegant, showing good taste and refinement. &amp;mdash; &lt;a href="https://www.cs.princeton.edu/courses/archive/spr09/cos333/beautiful.html"&gt;A Regular Expression Matcher&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-08-25&lt;/a&gt;: &lt;a href="https://dotink.co/posts/macros/"&gt;Macro elegance: the magical simplicity of Lisp macros&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-25&lt;/a&gt;: &lt;a href="https://endtimes.dev/why-your-website-should-be-under-14kb-in-size/"&gt;Why your website should be under 14kb in size&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-26&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Michael R Oldham, &lt;em&gt;Two Pieces Ripe Fruit&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-26&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;With Vim as a sort of secondary editor, I want to be able to fire it up unconfigured and continue to be nearly as productive. A pile of remappings would prohibit this. In my mind this is like a form of emergency preparedness. Other people stock up food and supplies. I’m preparing myself to sit at a strange machine without any of my configuration so that I can start the rewrite of the software lost in the disaster, so long as that machine has vi, cc, and make. If I can’t code in C, then what’s the point in surviving anyway? &amp;mdash; &lt;a href="https://nullprogram.com/blog/2017/04/01/"&gt;My Journey with Touch Typing and Vim&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-08-26&lt;/a&gt;: &lt;a href="https://michaelwelford.com/posts/10-stages-of-vim/"&gt;The 10 stages of Vim&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-27&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   MIKA, &lt;em&gt;I See You&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-27&lt;/a&gt;: Hugo &lt;a href="https://github.com/alex-shpak/hugo-book"&gt;documentation theme&lt;/a&gt; as simple as plain book.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-27&lt;/a&gt;: &lt;a href="https://p-cos.blogspot.com/2014/07/a-lispers-first-impression-of-julia.html"&gt;A Lisper&amp;rsquo;s first impression of Julia &lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-27&lt;/a&gt;: &lt;a href="https://synthcode.com/scheme/fmt/"&gt;Combinator Formatting&lt;/a&gt;. &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-27&lt;/a&gt;: &lt;a href="https://blitiri.com.ar/p/other/mutt-labels/"&gt;Labeling mail with mutt&lt;/a&gt;. Interesting idea, especially for those who rely on notmuch for mail processing. But, well, it&amp;rsquo;s been a long time I left Gmail and I don&amp;rsquo;t regret those pesky virtual folders.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-27&lt;/a&gt;: &lt;a href="https://gopiandcode.uk/logs/log-unifying-folds.html"&gt;Unifying fold left and fold right&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-28&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Morcheeba, &lt;em&gt;What New York Couples Fight About&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-28&lt;/a&gt;: And a great Firefox plugin to review soon: &lt;a href="https://ueokande.github.io/vim-vixen/index.html"&gt;Vixen Vim&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-28&lt;/a&gt;: I somewhat forgot about this sticky TUI for processing spreadsheet data: &lt;a href="https://www.visidata.org/"&gt;VisiData&lt;/a&gt; is an interactive multitool for tabular data.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-28&lt;/a&gt;: Ubuntu Dock completely hidden now, which makes for a cleaner desktop!&lt;code&gt;shellgsettings set org.gnome.shell.extensions.dash-to-dock autohide falsegsettings set org.gnome.shell.extensions.dash-to-dock dock-fixed falsegsettings set org.gnome.shell.extensions.dash-to-dock intellihide false&lt;/code&gt;I also installed the &lt;a href="https://st.suckless.org/"&gt;Suckless terminal&lt;/a&gt;, as a popup terminal always opened on second workspace, with semi-transparency enabled thanks to &lt;a href="https://github.com/LukeSmithxyz/st"&gt;Luke Smith&lt;/a&gt;&amp;rsquo;s patch and no border (&lt;a href="https://github.com/bakkeby/patches/blob/master/st/st-no_window_decorations-0.8.5-20220824-72fd327.diff"&gt;Stein Gunnar Bakkeby &lt;/a&gt;&amp;rsquo;s path). I can launch Cmus without messing my current Tmux workspace, and forget about it.&lt;br&gt;&lt;img src="https://aliquote.org/img/2022-08-29-13-42-43.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-28&lt;/a&gt;: &lt;a href="https://medium.com/njiuko/using-fzf-instead-of-dmenu-2780d184753f"&gt;Using FZF instead of DMENU&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-28&lt;/a&gt;: &lt;a href="https://ptc-it.de/pairing-with-tmux-and-vim/"&gt;ssh, tmux and vim: A Simple Yet Effective Pair Programming Setup&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-29&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;All of a sudden, those brackets look kind of cool! &amp;mdash; &lt;a href="https://stopa.io/post/265"&gt;An Intuition for Lisp Syntax&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-08-29&lt;/a&gt;: Here&amp;rsquo;s a rather long list of &lt;a href="https://aliquote.org/pub/urls~"&gt;RSS feeds&lt;/a&gt; accumulated over the years. It has been purged on several occasions, depending on my mood and succesive jobs (e.g., &lt;code&gt;rstats&lt;/code&gt; and &lt;code&gt;stats&lt;/code&gt; stuff has been severely impacted in the past 6 years). It targets Newsboat, so all you have to do is put this file in your &lt;code&gt;$HOME/.config/newsboat&lt;/code&gt; directory. Tags are not always very accurate, as the original posters may have changed their posts over time.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-29&lt;/a&gt;: Suckless life.&lt;br&gt;&lt;img src="https://aliquote.org/img/2022-08-29-21-28-11.png" alt="img"&gt;&lt;small&gt;Ubuntu 22.04 LTS. Suckless terminal. Cmus music player.&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-29&lt;/a&gt;: TIL Ubuntu and its default WM allows to &lt;a href="https://help.ubuntu.com/stable/ubuntu-help/shell-windows-states.html.en"&gt;move and resize&lt;/a&gt; windows without even touching the mouse with &lt;code&gt;Alt-F7&lt;/code&gt; and &lt;code&gt;Alt-F8&lt;/code&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-29&lt;/a&gt;: Website&amp;rsquo;s look&amp;rsquo;n feel should now respect your system color theme. Dark theme heavily inspired from the Nord color palette of course. Last thing to fix is transparent background images.&lt;br&gt;&lt;img src="https://aliquote.org/img/2022-08-29-21-31-12.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-29&lt;/a&gt;: &lt;a href="https://www.ryanlue.com/posts/2017-05-21-mutt-the-vim-way"&gt;Mutt, the Vim Way&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-30&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If you spend a lot of time typing plain text, writing programs or HTML, you can save much of that time by using a good editor and using it effectively. &amp;mdash; &lt;a href="https://www.moolenaar.net/habits.html"&gt;Seven habits of effective text editing&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-08-30&lt;/a&gt;: TIL that I no longer need to worry with launching &lt;code&gt;ssh-agent&lt;/code&gt; automagically in case it isn&amp;rsquo;t already running in the background using the following hack:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;if [ -f ~/.ssh/agent.env ] ; then
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; . ~/.ssh/agent.env &amp;gt; /dev/null
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; if ! kill -0 $SSH_AGENT_PID &amp;gt; /dev/null 2&amp;gt;&amp;amp;1; then
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; echo &amp;#34;Stale agent file found. Spawning a new agent. &amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; eval `ssh-agent | tee ~/.ssh/agent.env`
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ssh-add
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; fi
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;else
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; echo &amp;#34;Starting ssh-agent&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; eval `ssh-agent | tee ~/.ssh/agent.env`
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ssh-add
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;fi
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;There&amp;rsquo;s probably a better way: &lt;a href="https://blog.debiania.in.ua/posts/2020-05-18-howto-auto-start-ssh-agent-with-systemd-on-debian-bullseye.html"&gt;Howto: auto-start ssh-agent with systemd on Debian Bullseye&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-30&lt;/a&gt;: &lt;a href="https://scottlocklin.wordpress.com/2011/11/30/only-fast-languages-are-interesting/"&gt;Only fast languages are interesting&lt;/a&gt;. Don&amp;rsquo;t know if &lt;a href="https://aliquote.org/post/time-to-lush/"&gt;lush&lt;/a&gt; is still a thing nowadays, but some benchmarks were quite impressive back in 2011. &lt;code&gt;#clojure&lt;/code&gt; &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-30&lt;/a&gt;: &lt;a href="http://blog.osv.io/blog/2014/11/17/ssh-without-trusting-bastion-host/"&gt;SSH Tip: Connecting to a Private Network Without Trusting the Bastion Host&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-31&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   New Order, &lt;em&gt;Blue Monday&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-31&lt;/a&gt;: Just replaced ranger with &lt;a href="https://github.com/dylanaraps/fff"&gt;fff&lt;/a&gt;. Looks great and lightweight, and ultra-fast. I had problem with displaying images with ranger now that I am under Wayland. With fff, I can simply open them in feh or eog and browse an entire directory using keyboard shortcuts only. (h/t DJ Adams, &lt;a href="https://qmacro.org/blog/posts/2021/11/07/exploring-fff-part-2-get_ls_colors/"&gt;Exploring fff part 2 - get_ls_colors&lt;/a&gt; &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-31&lt;/a&gt;: Some interesting &lt;a href="https://qmacro.org/blog/posts/2022/04/07/bash-notes/"&gt;Bash notes&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-31&lt;/a&gt;: &lt;a href="https://batsov.com/articles/2022/08/29/ocaml-at-first-glance/"&gt;OCaml at First Glance&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-08-31&lt;/a&gt;: &lt;a href="https://www.jonashietala.se/blog/2022/08/29/rewriting_my_blog_in_rust_for_fun_and_profit/"&gt;Rewriting my blog in Rust for fun and profit&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;</description></item><item><title>How to get by without using a tiling WM</title><link>https://aliquote.org/post/how-to-do-without-wm/</link><pubDate>Tue, 30 Aug 2022 09:36:19 +0200</pubDate><guid>https://aliquote.org/post/how-to-do-without-wm/</guid><description>&lt;p&gt;How do I do without a tiling Window Manager, after several months of using i3 and Regolith? A few weeks ago I started wondering whether I should give Sway a try now that Ubuntu defaults to Wayland and Gnome 42. However, I held back with the idea of better familiarizing myself with Ubuntu&amp;rsquo;s default WM. After all, I don&amp;rsquo;t have big requirements in terms of desktop management: I use a single workspace most of the time, I prefer to have windows maximized on screen or split side by side full-screen, there&amp;rsquo;s a launcher right under &lt;code&gt;Super+S&lt;/code&gt; or &lt;code&gt;Super+A&lt;/code&gt; which means I can just start typing the name of the application I want and press Enter, and the &lt;code&gt;Super+Tab&lt;/code&gt; hot key allows me to switch between applications very easily. This is very much in spirit with points raised by &lt;a href="https://joshtronic.com/2018/09/09/why-i-dont-use-a-tiling-window-manager/"&gt;Josh Sherman&lt;/a&gt; some time ago.&lt;/p&gt;
&lt;p&gt;Yet I do not like the Snap system (nor the idea of sandboxed applications tied to an OS, as Apple did) and I removed all components on my previous install. They were not reinstalled when I upgraded to LTS 22.04. And I still feel more comfortable with terminal-oriented applications, or TUIs.&lt;/p&gt;
&lt;p&gt;Anyway, here are some of the settings on my machine. First, as I said, I stand by maximized windows most of the time. When the application is up, if it is not maximized I can simply &lt;code&gt;Super+Up&lt;/code&gt; to make it so. When I have two windows on screen, I can arrange them maximized and side by side using &lt;code&gt;Super+Left&lt;/code&gt; and &lt;code&gt;Super+Right&lt;/code&gt;. I yet have to find a way to automate this a little since at present I must hover on each window separately.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I use &amp;ldquo;focus follow mouse&amp;rdquo; (&lt;code&gt;gsettings set org.gnome.desktop.wm.preferences focus-mode 'mouse'&lt;/code&gt;) and Emacs keybindings (&lt;code&gt;gsettings set org.gnome.desktop.interface gtk-key-theme &amp;quot;Emacs&amp;quot;&lt;/code&gt;) for graphical applications like Firefox.&lt;/li&gt;
&lt;li&gt;I modified the Caps lock key so that it acts as an Escape key (easier for me when using (Neo)vim) using &lt;code&gt;gsettings set org.gnome.desktop.input-sources xkb-options &amp;quot;['caps:escape']&amp;quot;&lt;/code&gt;. Previously, I was relying on &lt;code&gt;setxkbmap -option caps:escape&lt;/code&gt;, which no longer works under Wayland. See also &lt;a href="https://blog.debiania.in.ua/posts/2021-06-10-remapping-keys-under-wayland.html"&gt;Remapping keys under Wayland&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;I use two extensions for Gnome shell: auto-move windows, which allows to assign specific workspace to any applications, and simply workspace, which adds a workspace block in the menu bar, like i3bar or polybar.&lt;/li&gt;
&lt;li&gt;I hided the dock entirely can probably be done by either removing Gnome dock from the system or through the extension preference panel. I choose to use a &lt;a href="https://aliquote.org/micro/2022-08-28-19-36-44/"&gt;terminal incantation&lt;/a&gt;, instead.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;
&lt;li&gt;I defined some shortcuts to make navigating workspaces (&lt;code&gt;Ctrl+Super+Left&lt;/code&gt; and &lt;code&gt;Right&lt;/code&gt;) and moving windows from one workspace to the other easier (&lt;code&gt;Shit+Super+Left&lt;/code&gt; and &lt;code&gt;Right&lt;/code&gt;). Since I learned recently that we can also &lt;a href="https://aliquote.org/micro/2022-08-29-11-27-05/"&gt;move and resize&lt;/a&gt; window using keyboard shortcuts, I&amp;rsquo;m done with window and workspace management for now.&lt;/li&gt;
&lt;li&gt;I generally try to limit myself to two windows per workspace (easier to tab switch, and in case you have more than two applications opened on your desktop they keep being sorted by most recent use which means they should end up one after the other in the app switcher), and likewise to two pane per Tmux or Neovim window (again, easier to &lt;code&gt;M-o&lt;/code&gt; &amp;ndash; a specific shortcut of mine &amp;ndash; or &lt;code&gt;C-w C-w&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Originally, I updated the default applications for specific filetypes (PDF, images, etc.), but finally I reverted to default settings and I launch Zathura (PDF), ranger (Files) or Feh (Images) from a running terminal.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I also use the gorgeous &lt;a href="https://github.com/EliverLara/Nordic"&gt;Nord theme&lt;/a&gt; for Gnome, which you can activate as follows:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;% gsettings &lt;span class="nb"&gt;set&lt;/span&gt; org.gnome.desktop.interface gtk-theme &lt;span class="s2"&gt;&amp;#34;Nordic&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;% gsettings &lt;span class="nb"&gt;set&lt;/span&gt; org.gnome.desktop.wm.preferences theme &lt;span class="s2"&gt;&amp;#34;Nordic&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It goes without saying that this changes the visual experience a lot.&lt;/p&gt;
&lt;p&gt;Overall, I find that Gnome shell has been greatly improved over time, and it is now good enough for intensive daily use. I could hide Gnome terminal&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; window border as well (e.g., &lt;code&gt;gsettings set org.gnome.Terminal.Legacy.Settings headerbar false&lt;/code&gt;), but I found that just going fullscreen (&lt;code&gt;F11&lt;/code&gt;) is usually enough. I like the system tray icons, which is compact and remains interactive, and, contrary to polybar, I don&amp;rsquo;t have to bother configuring brightness, sound control, battery status, network settings and VPN myself.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Foals • &lt;em&gt;My Number&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;This can be done as follows: (forgot where I found the trick, sorry!)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gsettings &lt;span class="nb"&gt;set&lt;/span&gt; org.gnome.shell.extensions.dash-to-dock autohide &lt;span class="nb"&gt;false&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gsettings &lt;span class="nb"&gt;set&lt;/span&gt; org.gnome.shell.extensions.dash-to-dock dock-fixed false&lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gsettings &lt;span class="nb"&gt;set&lt;/span&gt; org.gnome.shell.extensions.dash-to-dock intellihide &lt;span class="nb"&gt;false&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;By the way, you can see or backup all your Terminal settings using &lt;code&gt;dconf dump /org/gnome/terminal/ &amp;gt; gnome_terminal_settings_backup.txt&lt;/code&gt;.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Named let in Scheme</title><link>https://aliquote.org/post/named-let-in-scheme/</link><pubDate>Sun, 28 Aug 2022 13:17:18 +0200</pubDate><guid>https://aliquote.org/post/named-let-in-scheme/</guid><description>&lt;p&gt;In &lt;a href="https://aliquote.org/post/cl-loop-macro/"&gt;one of my last posts&lt;/a&gt;, I discussed Common Lisp &lt;code&gt;loop&lt;/code&gt; &lt;a href="https://docs.scheme.org/guide/macros/"&gt;macro&lt;/a&gt;. I just finished reading &lt;a href="http://www.phyast.pitt.edu/~micheles/scheme/"&gt;The Adventures of a Pythonista in Schemeland&lt;/a&gt;, by Michele Simionato. Although it is now more than 10 years old, it is a very good read that I recommend to people interested in Scheme, especially if they want to learn more about macros. In this series of articles, the authors discusses some idiomatic construct in Scheme. Beside recursion, he shows an example of a for-loop form which I got interested in. Chicken Scheme, which is the current implementation of Scheme dialect I use,&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; has a for-each construct which allows to write stuff like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="nv"&gt;xs&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;for-each &lt;/span&gt;&lt;span class="nv"&gt;print&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is more limited than what&amp;rsquo;s available in Racket&amp;rsquo;s &lt;a href="https://docs.racket-lang.org/reference/for.html"&gt;iterations and comprehensions forms&lt;/a&gt; but it has the merit of being there. Note that there are more involved constructs for &lt;a href="https://wiki.call-cc.org/eggref/5/sequences#iteration-constructs"&gt;iterating over sequences&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In Scheme, a &lt;a href="https://people.csail.mit.edu/jaffer/r5rs_6.html#IDX130"&gt;named &lt;code&gt;let&lt;/code&gt;&lt;/a&gt; is the standard way to build such a for-like expression. Let&amp;rsquo;s see an example:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;import&lt;/span&gt; &lt;span class="nv"&gt;srfi-48&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;;; see also Chicken extras module&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let &lt;/span&gt;&lt;span class="nv"&gt;loop&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;i&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;unless&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;= &lt;/span&gt;&lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt; &lt;span class="no"&gt;#t&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;~a &amp;#34;&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;loop&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;+ &lt;/span&gt;&lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is well explained on &lt;a href="https://stackoverflow.com/questions/31909121/how-does-the-named-let-in-the-form-of-a-loop-work"&gt;Stack Overflow&lt;/a&gt;, especially how it relates to tail-recursion. See also &lt;a href="https://davidad.github.io/blog/2014/02/28/python-to-scheme-to-assembly-1/"&gt;Python to Scheme to Assembly, Part 1: Recursion and Named Let&lt;/a&gt;, for another use case of recursion and accumulators. Now, checking the SICP book, Abelson &amp;amp; coll. discuss an iterative Fibonacci procedure using a named let:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;fib&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let &lt;/span&gt;&lt;span class="nv"&gt;fib-iter&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;a&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;b&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;count&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;= &lt;/span&gt;&lt;span class="nv"&gt;coutn&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;b&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;fib-iter&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;+ &lt;/span&gt;&lt;span class="nv"&gt;a&lt;/span&gt; &lt;span class="nv"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;a&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;- &lt;/span&gt;&lt;span class="nv"&gt;count&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;A named let can also be an alternative to the following procedure (Exercise 4.8):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;let-&amp;gt;combination&lt;/span&gt; &lt;span class="nv"&gt;expr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cons &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;make-lambda&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;let-vars&lt;/span&gt; &lt;span class="nv"&gt;expr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;let-body&lt;/span&gt; &lt;span class="nv"&gt;expr&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;let-inits&lt;/span&gt; &lt;span class="nv"&gt;expr&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here is one solution from &lt;a href="http://community.schemewiki.org/?sicp-ex-4.8"&gt;Scheme wiki&lt;/a&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;let-&amp;gt;combination&lt;/span&gt; &lt;span class="nv"&gt;expr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;named-let?&lt;/span&gt; &lt;span class="nv"&gt;expr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;sequence-&amp;gt;exp&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;named-let-&amp;gt;func&lt;/span&gt; &lt;span class="nv"&gt;expr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cons &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;named-let-func-name&lt;/span&gt; &lt;span class="nv"&gt;expr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;named-let-func-inits&lt;/span&gt; &lt;span class="nv"&gt;expr&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cons &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;make-lambda&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;let-vars&lt;/span&gt; &lt;span class="nv"&gt;expr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;let-body&lt;/span&gt; &lt;span class="nv"&gt;expr&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;let-inits&lt;/span&gt; &lt;span class="nv"&gt;expr&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;See also &lt;a href="https://eli.thegreenplace.net/2007/12/06/sicp-sections-411-412"&gt;Eli Bendersky&lt;/a&gt;&amp;rsquo;s solutions in Common Lisp.&lt;/p&gt;
&lt;p&gt;Instead of a for loop, let&amp;rsquo;s consider a while loop. It is not much different, since in this case we have a predicate that helps stopping the iteration and a default case. See also this discussion on &lt;code&gt;call/cc&lt;/code&gt; on &lt;a href="https://stackoverflow.com/a/44110742/420055"&gt;SO&lt;/a&gt;. There&amp;rsquo;s a bunch of useful utilities in the &amp;ldquo;standard prelude&amp;rdquo; of &lt;a href="https://programmingpraxis.com/contents/standard-prelude/"&gt;Programming Praxis&lt;/a&gt;. It targets R5RS, and some of its forms are already available in Chicken Scheme or Racket, but it is worth taking a look at the code. For instance, it features a macro for a &lt;a href="https://programmingpraxis.com/contents/standard-prelude/#control-flow"&gt;while loop&lt;/a&gt; construct:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define-syntax &lt;/span&gt;&lt;span class="nv"&gt;while&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;syntax-rules &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;while&lt;/span&gt; &lt;span class="nv"&gt;pred?&lt;/span&gt; &lt;span class="nv"&gt;body&lt;/span&gt; &lt;span class="o"&gt;...&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;do &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nb"&gt;not &lt;/span&gt;&lt;span class="nv"&gt;pred?&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="nv"&gt;body&lt;/span&gt; &lt;span class="o"&gt;...&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Example of use:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let &lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;loop&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;&amp;lt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="nv"&gt;loop&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;display &lt;/span&gt;&lt;span class="nv"&gt;loop&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;set! &lt;/span&gt;&lt;span class="nv"&gt;loop&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;- &lt;/span&gt;&lt;span class="nv"&gt;loop&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;=&amp;gt; &lt;/span&gt;&lt;span class="mi"&gt;4321&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Incidentally, I just found that Jacques Chazarain also discussed the case of Fibonacci numbers and named let constructs, and he even proposed a different solution to the while loop macro, using pretty old syntax and non-hygienic macro:&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;define-macro&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;while&lt;/span&gt; &lt;span class="nv"&gt;test&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="nv"&gt;body&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;`&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;letrec &lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;loop&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="nv"&gt;test&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;begin &lt;/span&gt;&lt;span class="o"&gt;,@&lt;/span&gt;&lt;span class="nv"&gt;body&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;loop&lt;/span&gt;&lt;span class="p"&gt;))))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;loop&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;There is nevertheless a slight issue with the formulation above: the local function &lt;code&gt;loop&lt;/code&gt; may happen to mask a variable bound in the &lt;code&gt;let&lt;/code&gt; statement. To remedy this problem, one needs to use &lt;code&gt;gensym&lt;/code&gt; to generate the name of the local loop construct, as illustrated below:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;define-macro&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;while&lt;/span&gt; &lt;span class="nv"&gt;test&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="nv"&gt;body&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let &lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;loop&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;gensym&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;`&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;letrec &lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="nv"&gt;loop&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="nv"&gt;test&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;begin &lt;/span&gt;&lt;span class="o"&gt;,@&lt;/span&gt;&lt;span class="nv"&gt;body&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="nv"&gt;loop&lt;/span&gt;&lt;span class="p"&gt;))))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="nv"&gt;loop&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;A related topic is also discussed on &lt;a href="https://wiki.call-cc.org/man/5/Module%20(chicken%20syntax)#explicit-renaming-macros"&gt;Chicken Scheme&lt;/a&gt; website.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2022-09-12]&lt;/small&gt;&lt;br&gt;
Now that I&amp;rsquo;m catching up on my RSS feeds, I can suggest a further reading, especially for Lisp hackers: &lt;a href="http://funcall.blogspot.com/2022/07/named-lambda-and-named-let.html"&gt;Named Lambda and Named Let&lt;/a&gt;, by Joe Marshall.
&lt;/div&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ MIKA • &lt;em&gt;Blue Eyes&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;It is the first Scheme implementation I heard about, around 2007, via Jan de Leeuw&amp;rsquo;s mailing list on statistical computing. I wrote toy example, stopped using it and forgot about it until I got back to Scheme four or five years ago.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;Chazarain, J. &lt;em&gt;Programmer avec Scheme&lt;/em&gt;. International Thomson Publishing, 1996.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Usenet newsgroups with Neomutt</title><link>https://aliquote.org/post/neomutt-and-usenet/</link><pubDate>Sat, 27 Aug 2022 11:01:27 +0200</pubDate><guid>https://aliquote.org/post/neomutt-and-usenet/</guid><description>&lt;p&gt;A few days ago I was looking at some old messages on Usenet&amp;rsquo;s comp.lang.scheme, now attached to Google groups. I quit all groups I was subscribed to a while ago already, but I renabled one of them just to see how it feels. Well, you still feel the same, Google, but I&amp;rsquo;m happy comp.lang.lisp hasn&amp;rsquo;t been shutdown completely, and it is still possible to dig into the archives:&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2002-08-27-11-05-33.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Last time I installed &lt;a href="https://aliquote.org/post/usenet-and-slrn/"&gt;slrn&lt;/a&gt; (&lt;a href="https://slrn.info/"&gt;official website&lt;/a&gt;) and configured it to use &lt;a href="https://www.eternal-september.org/"&gt;eternal-september&lt;/a&gt; NNTP server. It worked great, and it still works after a few months without opening slrn. I spend some time digging on DDG for users&amp;rsquo; config for NNTP, and except for the &lt;a href="https://neomutt.org/feature/nntp#muttrc"&gt;official documentation&lt;/a&gt;, I found nothing. Noboody&amp;rsquo;s using (Neo)mutt for reading news via NNTP these days?&lt;/p&gt;
&lt;p&gt;Apparently, there&amp;rsquo;s nothing much to do to get Neomutt access Usenet. First, Neomutt is able to read newsgroup in addition to standard Maildir inboxes, just press &lt;code&gt;i&lt;/code&gt; and you&amp;rsquo;re right into Usenet provided the environment variable &lt;code&gt;$NNTPSERVER&lt;/code&gt; is set correctly. With a few additional settings, as shown below, and a &lt;code&gt;$HOME/.newsrc&lt;/code&gt; file, you&amp;rsquo;ll get a list of newsgroups you can subscribe to. Usually, it is enough to create the &lt;code&gt;.newsrc&lt;/code&gt; file and indicate on each line the name of the group (e.g., &lt;code&gt;comp.lang.lisp&lt;/code&gt;) followed by &lt;code&gt;:&lt;/code&gt;. If you already have such a file, you can edit it by hand, which is what I ended up doing with the &lt;code&gt;$HOME/.jnewsrc&lt;/code&gt; file created by slrn.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;set&lt;/span&gt; &lt;span class="n"&gt;newsrc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;~/.newsrc&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;set&lt;/span&gt; &lt;span class="n"&gt;news_cache_dir&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;~/.mutt/news&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;set&lt;/span&gt; &lt;span class="n"&gt;news_server&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;news://{USER}:{PASS}@news.eternal-september.org&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;set&lt;/span&gt; &lt;span class="n"&gt;nntp_authenticators&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;user&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;set&lt;/span&gt; &lt;span class="n"&gt;nntp_listgroup&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;yes&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;set&lt;/span&gt; &lt;span class="n"&gt;nntp_load_description&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;yes&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;set&lt;/span&gt; &lt;span class="n"&gt;nntp_pass&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;{PASS}&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;set&lt;/span&gt; &lt;span class="n"&gt;nntp_user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;{USER}&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Replace &lt;code&gt;{USER}&lt;/code&gt; and &lt;code&gt;{PASS}&lt;/code&gt; with your credentials form eternal-september.&lt;/p&gt;
&lt;p&gt;I found the experience of reading news more pleasant under Neomutt, especially given that the color scheme is already set up and that I have my usual keyboard shortcut. Note, however, that no shortcuts are defined for browser and news-specific index views. You will have to define a few handful bindings or macros for better navigation.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-08-27-01-04-20.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-08-27-01-04-20.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-08-27-01-04-06.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-08-27-01-04-06.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;Who ever said that Usenet is dead? It most certainly is not. Even though Usenet has changed it&amp;rsquo;s face over the last, say ten years, the simple idea of exchanging ideas and having discussions among a large number of people by posting articles on a global message-board has pertained. Yes, for those of you who still don&amp;rsquo;t know what this is all about, we are talking about Newsgroups, an important part of the Internet, albeit heavily neglected by the media, who usually equate &amp;ldquo;Internet&amp;rdquo; with &amp;ldquo;World Wide Web&amp;rdquo;. &amp;mdash; &lt;a href="https://www.netmeister.org/news/usenet/"&gt;Usenet is still a strange place&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That&amp;rsquo;s it! Happy reading with good old NNTP.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Miguel Zenzön • &lt;em&gt;Quitate de la Vía&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;If like me you don&amp;rsquo;t want to be tied to Goggle for reading newsgroups, you can subscribe by email using the regular way: Just send an email to &lt;a href="mailto:newsgroup+subscribe@googlegroups.com"&gt;newsgroup+subscribe@googlegroups.com&lt;/a&gt;, where newsgroup is the name of the newsgroup your are interested to follow.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>More Neomutt little hacks</title><link>https://aliquote.org/post/neomutt-more-tips/</link><pubDate>Fri, 26 Aug 2022 12:58:30 +0200</pubDate><guid>https://aliquote.org/post/neomutt-more-tips/</guid><description>&lt;p&gt;Some further tips and tricks on Neomutt after my &lt;a href="https://aliquote.org/post/neomutt/"&gt;original post&lt;/a&gt;. See also my related post on &lt;a href="https://aliquote.org/post/tmux-little-hacks/"&gt;Tmux hacking&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I will probably never regret switching from &lt;a href="https://www.emacswiki.org/emacs/mu4e"&gt;mu4e&lt;/a&gt; to Neomutt two years ago. Chris Wellons &lt;a href="https://nullprogram.com/blog/2017/06/15/"&gt;did the same&lt;/a&gt; apparently. It&amp;rsquo;s the same keyboard-driven experience, but with all the functionalities you would expect from a mail processor. Moreover, as they use to say:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;All mail clients suck. This one just sucks less. &amp;mdash; Michael R. Elkins&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I spent a lot of time configuring Neomutt to my liking, and to this end I happened to read a lot of blog posts,&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; the online documentation and the man pages, dotfiles available on Github, etc. Neomutt is great, but its configuration is harder than it seems because there are tons of options that you need to define carefully. Of course, default options are quite good, but you know when you start tinkering your setup&amp;hellip; My previous post explained how I ended up setting my default config. Here are a few additional tricks that I learned along the way.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2023-09-21]&lt;/small&gt;&lt;br&gt;
Not mentioned here is how to get notified when you receive new emails. See this &lt;a href="https://aliquote.org/micro/2023-09-21-08-41-50"&gt;micro post&lt;/a&gt; for a solution that circumvents some of &lt;code&gt;notify-send&lt;/code&gt; limitations.
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;using folder hooks: Folder hooks are actions that carried automatically when you enter a (local or remote) folder. I use a few of them, mostly to setup specific mailboxes. For instance, I have a different display mode depending on whether I&amp;rsquo;m in my Inbox or in the Archives folder (where I usually want a detailed timestamp, especially the year since messages can span more than 15 years), but see below:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;folder-hook archives/* &amp;#39;set read_inc=1000&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;folder-hook archives/* &amp;#39;set index_format=&amp;#34;[%[%Y-%m-%d %H:%M]] [%Z %?X?A&amp;amp;-? %?l?%4l&amp;amp;%4c?] %-25.25F %?M?&amp;lt;%M&amp;gt; ?%s &amp;#34;&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;folder-hook aliquote/* source ~/.config/neomutt/accounts/aliquote
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;folder-hook aliquote/* &amp;#39;set index_format=&amp;#34;[%[!%m-%d %H:%M]] %zt %-25.25F %?M?&amp;lt;%M&amp;gt;? %s &amp;#34;&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;folder-hook aliquote/Sent &amp;#39;set index_format=&amp;#34;[%[!%m-%d %H:%M]] [%Z %?X?A&amp;amp;-?] %-25.25F %s &amp;#34;&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;folder-hook aliquote/Sent &amp;#39;set sort=reverse-date-sent&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;folder-hook aliquote/Sent set strict_threads=yes
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;folder-hook aliquote/INBOX &amp;#39;push &amp;#34;Tscipy-dev-request&amp;lt;enter&amp;gt;&amp;lt;tag-prefix-cond&amp;gt;&amp;lt;save-message&amp;gt;=digests&amp;lt;enter&amp;gt;&amp;lt;end-cond&amp;gt;&amp;#34;&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;--8&amp;lt;--------
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you write a lot of macros, sometimes it is worth considering folder-hook or variation thereof. You often just have to replace your &lt;code&gt;macro&lt;/code&gt; statement with a &lt;code&gt;push&lt;/code&gt; command to let Mutt press all the keys for you.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;collapsing threads: I wanted all threads to be collapsed by default when entering my Archives folder. I originally used a hook for that, &lt;code&gt;folder-hook archives/* 'push &amp;lt;collapse-all&amp;gt;\n'&lt;/code&gt;, which has the undesired side-effect of making sidebar actions (navigating next and previous folders) to open the first message when entering the folder itself. Fortunately, there&amp;rsquo;s an even simpler solution using the following two options: &lt;code&gt;set collapse_all = yes&lt;/code&gt; and &lt;code&gt;set uncollapse_new = yes&lt;/code&gt;. This will affect all folder, but the last one will help in case there are new replies in the Inbox.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;navigating the sidebar: After reading Joshua Stein configuration on Github, I ended up using two macros to toggle the sidebar on or off. However, there&amp;rsquo;s a simple command that do the trick: &lt;code&gt;bind index,pager B sidebar-toggle-visible&lt;/code&gt;. I then use two macros to help navigating in the sidebar tree: &lt;code&gt;macro index K &amp;quot;&amp;lt;enter-command&amp;gt;push &amp;lt;sidebar-prev&amp;gt;&amp;lt;sidebar-open&amp;gt;&amp;lt;enter&amp;gt;&amp;quot;&lt;/code&gt; and &lt;code&gt;macro index J &amp;quot;&amp;lt;enter-command&amp;gt;push &amp;lt;sidebar-next&amp;gt;&amp;lt;sidebar-open&amp;gt;&amp;lt;enter&amp;gt;&amp;quot;&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;displaying all URLs in a message: I originally used &lt;a href="https://github.com/firecat53/urlscan"&gt;urlscan&lt;/a&gt; to show all URLs found in a message, but I found that &lt;code&gt;urlview&lt;/code&gt; is builtin and works better. By default, it is mapped on &lt;code&gt;C-b&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;colors: There are several sections to manage Neomutt color theme, the main parts being &lt;code&gt;index&lt;/code&gt;, &lt;code&gt;header&lt;/code&gt; and &lt;code&gt;body&lt;/code&gt;. In the &lt;code&gt;body&lt;/code&gt; section, you can even highlight Git diff or emojis if you like.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;PGP signing/encryption: I like to have the possibility to sign and/or encrypt my message, but I don&amp;rsquo;t want them to be signed on by default. For this, you can unset the &lt;code&gt;crypt_autoencrypt&lt;/code&gt; and &lt;code&gt;crypt_autosign&lt;/code&gt; variables, and when you save your message, the magic key is &lt;code&gt;p&lt;/code&gt; before confirming to send your message (&lt;code&gt;y&lt;/code&gt;): you will be prompted to sign and/or encrypt your outgoing email. To configure PGP stufff in neomutt, source the relevant sample file, &lt;code&gt;/usr/share/doc/neomutt/samples/gpg.rc.gz&lt;/code&gt;, which contains default values that should work if you have gpgme installed on your system, and the relevant settings in your muttrc file:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set crypt_autoencrypt = no
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set crypt_autopgp = yes
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set crypt_autosign = no
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set crypt_replysign = yes
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set crypt_replysignencrypted = yes
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set crypt_use_gpgme = yes
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set crypt_verify_sig = yes
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set pgp_self_encrypt = yes
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set pgp_sign_as = {PGP_KEY}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set pgp_use_gpg_agent = yes
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Finally, some words about my workflow. The main structure of my mailboxes is shown below:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;INBOX
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Drafts
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Sent
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Trash
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;archives
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;digests
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;@chicken-users
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;--8&amp;lt;--------
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I now use a single account setup because I found that juggling different accounts was kind of not that funny at times. My typical workflow is that every new mail end up in the INBOX, with some automatic filters to move messages from mailing-lists I subscribed to in their respective folders. Mailing digest may be archived manually into the &amp;ldquo;digests&amp;rdquo; folder, and I used to use a weird macro to automate this stuff.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; The &amp;ldquo;archives&amp;rdquo; folder is an all-in-one archive of all the messages I received since around 2006 (Gmail time, remember?). It held more than 45K messages at some point, but I did a drastic pruning a few years ago so that now there are just about fifteen thousand messages, which is more manageable, even for Neomutt. I have some handful macros that help keeps the digests and mailing folders clean: one macro allows to delete all message older than a certain amount of days, while another macro is used to mark all messages as read.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;macro index &amp;lt;Esc&amp;gt;x &amp;#34;&amp;lt;tag-pattern&amp;gt;~d &amp;gt;6m&amp;lt;enter&amp;gt;&amp;lt;tag-prefix-cond&amp;gt;&amp;lt;delete-message&amp;gt;&amp;#34; &amp;#34;delete old messages&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;macro index \Cx &amp;#34;T~U&amp;lt;enter&amp;gt;&amp;lt;tag-prefix&amp;gt;&amp;lt;clear-flag&amp;gt;N&amp;lt;untag-pattern&amp;gt;.&amp;lt;enter&amp;gt;&amp;#34; &amp;#34;mark all messages as read&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2022-08-27]&lt;/small&gt;&lt;br&gt;
TIL some Vim keybindings are defined in &lt;code&gt;/usr/share/doc/neomutt/vim-keys/vim-keys.rc&lt;/code&gt;. Unfortunately, there&amp;rsquo;s not much to see except some bindings for moving around, scrolling and managing threads (sort of).
&lt;/div&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Maxence Cyrin • &lt;em&gt;As the Darkness Falls&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;I may even have missed Steve Losh&amp;rsquo;s excellent &lt;a href="https://stevelosh.com/blog/2012/10/the-homely-mutt/"&gt;blog post&lt;/a&gt; at some point.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;Example of a weird macro, that I converted to more manageable folder hooks a while ago:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;macro index &amp;lt;Esc&amp;gt;s \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;Tr-devel-request&amp;lt;enter&amp;gt;&amp;lt;tag-prefix-cond&amp;gt;&amp;lt;save-message&amp;gt;=digests&amp;lt;enter&amp;gt;&amp;lt;end-cond&amp;gt; \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; T~Crabble@arXiv.org&amp;lt;enter&amp;gt;&amp;lt;tag-prefix-cond&amp;gt;&amp;lt;save-message&amp;gt;=digests&amp;lt;enter&amp;gt;&amp;lt;end-cond&amp;gt; \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Tnumpy-discussion-request&amp;lt;enter&amp;gt;&amp;lt;tag-prefix-cond&amp;gt;&amp;lt;save-message&amp;gt;=digests&amp;lt;enter&amp;gt;&amp;lt;end-cond&amp;gt; \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Tscipy-dev-request&amp;lt;enter&amp;gt;&amp;lt;tag-prefix-cond&amp;gt;&amp;lt;save-message&amp;gt;=digests&amp;lt;enter&amp;gt;&amp;lt;end-cond&amp;gt; \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --8&amp;lt;--------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Tcryptography-request&amp;lt;enter&amp;gt;&amp;lt;tag-prefix-cond&amp;gt;&amp;lt;save-message&amp;gt;=digests&amp;lt;enter&amp;gt;&amp;lt;end-cond&amp;gt;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Common Lisp loop</title><link>https://aliquote.org/post/cl-loop-macro/</link><pubDate>Thu, 25 Aug 2022 11:40:59 +0200</pubDate><guid>https://aliquote.org/post/cl-loop-macro/</guid><description>&lt;p&gt;The Common Lisp &lt;code&gt;loop&lt;/code&gt; macro is the most incredible thing I&amp;rsquo;ve seen so far when working with functional PL. It comes with so subtle variations that it is hard to summarize all of its functionalities in a few words. Let&amp;rsquo;s consider the following two statements:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;loop&lt;/span&gt; &lt;span class="nv"&gt;for&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="nv"&gt;in&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nb"&gt;do&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt; &lt;span class="no"&gt;t&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;~a &amp;#34;&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; 0 1 2 3 4&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;loop&lt;/span&gt; &lt;span class="nv"&gt;for&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="nv"&gt;on&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nb"&gt;do&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; (0 1 2 3 4)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; (1 2 3 4)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; (2 3 4)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; (3 4)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; (4)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The first instruction asks to iterate over each element of a list, while in the second we iterate over each cdr of a list. If you want to return a list for later consumption, you can use &lt;code&gt;(append (list i i))&lt;/code&gt; or simply &amp;ldquo;collect&amp;rdquo; the elements, but see below. Any other builtin or user function that accept the iterator variable (&lt;code&gt;i&lt;/code&gt;) as an argument will work too. Little subtelties&amp;hellip;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I don’t know if the loop macro in Common Lisp is genius or madness. It’s the idiomatic way to do iteration, but the syntax doesn’t resemble Lisp in any way, the number of variations is as long as your arm, and you can mix and match every which way. &amp;mdash; &lt;a href="https://www.flooey.org/commonlisp.html"&gt;A Closed and Common Lisp&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A standard for loop construct is written:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;loop&lt;/span&gt; &lt;span class="nv"&gt;for&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="nv"&gt;from&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt; &lt;span class="nv"&gt;to&lt;/span&gt; &lt;span class="mf"&gt;4.0&lt;/span&gt; &lt;span class="nv"&gt;by&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt; &lt;span class="nb"&gt;do&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt; &lt;span class="no"&gt;t&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;~a &amp;#34;&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note that &lt;code&gt;loop&lt;/code&gt; works with real number too, unlike some other functions or macros, and that you are not limited to generating sequences of increasing values &amp;ndash; replace start and end value and &lt;code&gt;to&lt;/code&gt; with &lt;code&gt;downto&lt;/code&gt; to get sequence in descending order.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; If you are an Alexandria&amp;rsquo;s user, you probably already know the &lt;code&gt;iota&lt;/code&gt; function, which helps in generating sequence of equally spaced integers (think of Python&amp;rsquo;s &lt;code&gt;range&lt;/code&gt; function). Here it is in action, and its equivalent version using &lt;code&gt;loop&lt;/code&gt; using keyword parameters:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;iota&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; (0 1 2 3 4)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;loop&lt;/span&gt; &lt;span class="ss"&gt;:for&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="ss"&gt;:below&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="ss"&gt;:collect&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; =&amp;gt; (0 1 2 3 4)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;loop&lt;/code&gt; macro also supports conditional statement in between, like in &lt;code&gt;(loop for i from 1 to 10 when (oddp i) collect i)&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The only contender to CL&amp;rsquo;s &lt;code&gt;loop&lt;/code&gt; macro is Racket&amp;rsquo;s &lt;a href="https://docs.racket-lang.org/reference/for.html"&gt;iterations and comprehensions forms&lt;/a&gt;, which I use a lot for little scripts. &lt;a href="https://wiki.call-cc.org/eggref/5/simple-loops"&gt;Chicken Scheme&lt;/a&gt; and &lt;a href="https://clojuredocs.org/clojure.core/loop"&gt;Clojure&lt;/a&gt; also have for loop constructs which are pretty handy. Many times, though, for loops are not really needed and can be safely replaced with &lt;code&gt;map&lt;/code&gt; or &lt;code&gt;fold&lt;/code&gt;, or variations thereof, even in &lt;a href="https://medium.com/python-pandemonium/never-write-for-loops-again-91a5a4c84baf"&gt;Python&lt;/a&gt;. There was an interesting discussion on for loop in Scheme on the IRC #scheme channel recently, but I forgot to bookmark the conversation. It&amp;rsquo;s probably &lt;a href="https://snailgeist.com/irc-logs"&gt;in the log&lt;/a&gt;, though.&lt;/p&gt;
&lt;p&gt;If you are interested in macros, I can suggest the following blog posts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://stuartsierra.com/2006/06/03/idiomatic-macros"&gt;Idiomatic Macros for Common Lisp&lt;/a&gt;, by Stuart Sierra&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.defmacro.org/ramblings/lisp.html"&gt;The Nature of Lisp&lt;/a&gt;, by Slava Akhmechet&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dotink.co/posts/macros/"&gt;Macro elegance: the magical simplicity of Lisp macros&lt;/a&gt;, by Linus Lee&lt;/li&gt;
&lt;li&gt;&lt;a href="https://lexi-lambda.github.io/racket-macro-exercises/index.html"&gt;Racket Macro Exercises&lt;/a&gt;, by Alexis King&lt;/li&gt;
&lt;li&gt;&lt;a href="https://willosborne.co.uk/coding/2019/11/16/iterators-and-for-loops-with-guile-scheme.html"&gt;Iterators and for loops with Guile Scheme&lt;/a&gt;, by Will Osborne&lt;/li&gt;
&lt;li&gt;&lt;a href="https://tfeb.org/fragments/2015/01/13/macros-in-racket-part-one/"&gt;Macros in Racket, part one&lt;/a&gt; and &lt;a href="https://www.tfeb.org/fragments/2021/11/11/the-proper-use-of-macros-in-lisp/"&gt;The proper use of macros in Lisp&lt;/a&gt;, by Tim Bradshaw&lt;/li&gt;
&lt;li&gt;&lt;a href="https://chrisdone.com/posts/haskell-doesnt-have-macros/"&gt;Haskell doesn&amp;rsquo;t have macros&lt;/a&gt;, by Chris Done&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Brad Mehldau Trio • &lt;em&gt;The Very Thought of You&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;They are known as the &lt;code&gt;arithmetic-up&lt;/code&gt; and &lt;code&gt;arithmetic-downto&lt;/code&gt; arguments. See the &lt;a href="http://www.lispworks.com/documentation/HyperSpec/Body/m_loop.htm"&gt;HyperSpec documentation&lt;/a&gt;.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Manipulating images using Numpy</title><link>https://aliquote.org/post/numpy-imshow/</link><pubDate>Tue, 23 Aug 2022 12:06:55 +0200</pubDate><guid>https://aliquote.org/post/numpy-imshow/</guid><description>&lt;p&gt;I always found that Python was great for manipulating strings, or even lists, which is why it remains my language of choice, as opposed to R, for bioinformatics stuff. Needless to say, I hate significant indentation, but other than that I find the language pleasant, and as they said it comes battery included. There&amp;rsquo;s lot to learn from the base module.&lt;/p&gt;
&lt;p&gt;Today, I was trying to make some graphic with Matplotlib and I happened to find some interesting side-effects that we can produce using &lt;code&gt;imshow()&lt;/code&gt; alone.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;matplotlib.pyplot&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;plt&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;numpy&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;np&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Credit: https://www.publicdomainpictures.net/pictures/210000/velka/rose-grayscale.jpg&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;img&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;imread&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;rose-grayscale.jpg&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;idx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;subplot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;imshow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;img&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;axis&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;off&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/rose-rgb.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Other manipulating RGB channels using simple matrix operations, we can also use more advanced techniques like adding blur or low-pass filter effects with &lt;a href="https://opencv.org/"&gt;OpenCV2&lt;/a&gt;. However, using Numpy alone we can also add some &lt;a href="https://stackoverflow.com/questions/22937589/how-to-add-noise-gaussian-salt-and-pepper-etc-to-image-in-python-with-opencv"&gt;salt and pepper&lt;/a&gt;-like effect: (Credit: Shubham Pachori)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;noisy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;noise_typ&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;noise_typ&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;gauss&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;col&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ch&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;shape&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;mean&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;var&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;sigma&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mf"&gt;0.5&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;gauss&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;normal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sigma&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;col&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ch&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;gauss&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;gauss&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;reshape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;col&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ch&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;noisy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;image&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;gauss&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;noisy&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;noise_typ&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;s&amp;amp;p&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;col&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ch&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;shape&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;s_vs_p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;amount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.004&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;copy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;num_salt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ceil&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;amount&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;s_vs_p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;coords&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;randint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num_salt&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;shape&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;coords&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;num_pepper&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ceil&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;amount&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;1.0&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;s_vs_p&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;coords&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;randint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num_pepper&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;shape&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;coords&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;noise_typ&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;poisson&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vals&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;unique&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vals&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ceil&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;vals&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;noisy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;poisson&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;image&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;vals&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nb"&gt;float&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;vals&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;noisy&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;noise_typ&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;speckle&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;col&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ch&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;shape&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;gauss&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;randn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;col&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ch&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;gauss&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;gauss&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;reshape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;col&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ch&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;noisy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;image&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;image&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;gauss&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;noisy&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;gauss&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;s&amp;amp;p&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;poisson&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;speckle&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;subplot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;imshow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;noisy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;img&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;axis&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;off&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/rose-filter.png"&gt;
&lt;/figure&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Magazine • &lt;em&gt;Back to Nature&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Migrating to Systemd</title><link>https://aliquote.org/post/systemd/</link><pubDate>Mon, 22 Aug 2022 14:37:44 +0200</pubDate><guid>https://aliquote.org/post/systemd/</guid><description>&lt;p&gt;I&amp;rsquo;ve been faithfully using cron jobs on Linux for twenty years now. It&amp;rsquo;s quite simple to schedule basic tasks using &lt;code&gt;crontab -e&lt;/code&gt;: simply write your shell script or call the application you want to run at a desired time, and then forget about it. Currently, I only have two crontab entries running: one for checking my mail (&lt;code&gt;mbsync&lt;/code&gt;), and the other for &lt;a href="https://aliquote.org/post/kopia/"&gt;Kopia&lt;/a&gt; hourly backup. Most Linux distros now favor the use of systemd schedulers, also called &amp;ldquo;timers&amp;rdquo;, instead of cron, and so I decided to move all my running jobs to systemd.&lt;/p&gt;
&lt;p&gt;One of the advantages of using systemd is that you can move your systemd files between your machine or over ssh. The other advantage, of course, is that you can manage your running jobs using &lt;code&gt;systemctl&lt;/code&gt;, which means you can stop or pause tasks at any time, or reschedule a timer easily. Finally, you can check when your task were run for the last time, and when they will be run next.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;As an example, consider the following cron task, which runs Kopia backup every hour on my machine:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="m"&gt;0&lt;/span&gt; * * * * kopia snapshot create --all
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To use systemd, you need two files in &lt;code&gt;$HOME/.config/systemd/user&lt;/code&gt;. Let&amp;rsquo;s call them &lt;code&gt;kopia-backup.service&lt;/code&gt; and &lt;code&gt;kopia-backup.timer&lt;/code&gt;. Here&amp;rsquo;s the content of the service file:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[Unit]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Description = Back up files using Kopia
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[Service]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Type = oneshot
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ExecStart = /usr/bin/env bash -c &amp;#39;kopia snapshot create --all&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[Install]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;WantedBy = default.target
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This basically tells to run the service once (&lt;code&gt;oneshot&lt;/code&gt;) using the command specified as in the above crontab entry. The &lt;code&gt;default.target&lt;/code&gt; has to do with unit dependencies, but this may be omitted in our case. For the timer file, the most important setting is the schedule, which differs slightly from cron syntax:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[Unit]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Description = Run kopia-backup every hour
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;RefuseManualStart = no
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[Timer]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Persistent = true
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;OnCalendar = *-*-* *:00:00
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Unit = kopia-backup.service
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[Install]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;WantedBy = timers.target
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;Persistent&lt;/code&gt; option informs systemd to launch the task if it was missed at the last start time because of some failure to run the task (e.g., system on sleep or done), much like anacron. There are also so-called monotonic timers, which just indicate how often a task should be run, not at what time precisely. This usually is performed with reference to system startup, using e.g., &lt;code&gt;OnStartupSec=&lt;/code&gt;. Note that both approaches can be interleaved, and the task will run whenever any of the two timers occurs. By default, timers in systemd have an accuracy of 1 minute, but you can ask for a more tight schedule, for instance &lt;code&gt;AccuracySec = 1us&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Here is a brief summary of most common settings for the scheduler:&lt;/p&gt;
&lt;small&gt;
&lt;table border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;Timer&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;&lt;em&gt;Description&lt;/em&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;*:*:00&lt;/kbd&gt;*&lt;/td&gt;&lt;td&gt;every minute&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;*:/30:00&lt;/kbd&gt;*&lt;/td&gt;&lt;td&gt;every 30 minute&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;*-*-* *:00:00&lt;/kbd&gt;*&lt;/td&gt;&lt;td&gt;every hour&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;*-*-* */3:00:00&lt;/kbd&gt;*&lt;/td&gt;&lt;td&gt;every three hour&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;*-*-* 00:00:00&lt;/kbd&gt;*&lt;/td&gt;&lt;td&gt;every day&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;*-*-* 01:00:00&lt;/kbd&gt;*&lt;/td&gt;&lt;td&gt;every day at 1am&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;Sun *-*-* 00:00:00&lt;/kbd&gt;*&lt;/td&gt;&lt;td&gt;every Sunday&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;Mon...Fri *-*-* 00:00:00&lt;/kbd&gt;*&lt;/td&gt;&lt;td&gt;Monday to Friday&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;Sun *-*-* 00:00:00&lt;/kbd&gt;*&lt;/td&gt;&lt;td&gt;every week&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;* *-01,07-01 00:00:00&lt;/kbd&gt;*&lt;/td&gt;&lt;td&gt;every 6 months&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;* *-01-01 00:00:00&lt;/kbd&gt;*&lt;/td&gt;&lt;td&gt;every year&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/small&gt;
&lt;p&gt;Once you have these two files, you just need to reload the systemd configuration and enable the timer (which, in this case, is the unit of interest):&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;% systemctl --user daemon-reload
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;% systemctl --user start kopia-backup.timer
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;% systemctl --user &lt;span class="nb"&gt;enable&lt;/span&gt; kopia-backup.timer
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To check that the timer is indeed enabled or active, just issue:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;% systemctl --user list-timers --all
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;NEXT LEFT LAST PASSED UNIT ACTIVATES
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Mon 2022-08-22 19:15:00 CEST 14min left Mon 2022-08-22 19:00:08 CEST 21s ago mail-sync.timer mail-sync.service
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Mon 2022-08-22 20:00:00 CEST 59min left Mon 2022-08-22 19:00:08 CEST 21s ago kopia-backup.timer kopia-backup.service
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="m"&gt;2&lt;/span&gt; timers listed.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I implemented my two cron jobs (fetch mail every 15&amp;rsquo; and backup my &lt;code&gt;$HOME&lt;/code&gt; folder every hour) using systemd timer, and it works like a charm.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2022-09-01]&lt;/small&gt;&lt;br&gt;
See also this excellent review, in which I leaerned that we can check if our &lt;code&gt;OnCalendar&lt;/code&gt; settings work as expected: &lt;a href="https://opensource.com/article/20/7/systemd-timers"&gt;Use systemd timers instead of cronjobs&lt;/a&gt;.
&lt;/div&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Jan Lundgreen Trio • &lt;em&gt;Rosemary&amp;rsquo;s Baby&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;One of the advantage of cron job is that the same job can be run again, in parallel, even if the previous instance hasn&amp;rsquo;t finished yet. This happens if you have long-running jobs that are launched at evry short interval. This at least is what I seem to remember from my early Linux days, and I didn&amp;rsquo;t check what the state of the rt is for this kind of situation.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;Thanks to Robert Lützner for having noticed an error in the wording of one of the commands.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Simply Scheme</title><link>https://aliquote.org/post/simply-scheme/</link><pubDate>Sun, 21 Aug 2022 09:39:09 +0200</pubDate><guid>https://aliquote.org/post/simply-scheme/</guid><description>&lt;p&gt;&lt;em&gt;Simply Scheme&lt;/em&gt;, by Brian Harvey and Matthew Wright, is available &lt;a href="https://people.eecs.berkeley.edu/~bh/ss-toc2.html"&gt;on line&lt;/a&gt; in PDF and HTML versions. It is presented as an introductory textbook on computer science, with six chapters covering the basis of (interactive) functional programming: functions, compositions of functions, functions as data, recursion, abstraction, and sequential programming. It is not the first book I read on Scheme. I started with The Little series some years ago, followed by two textbooks in French, and this book is different in that it follows an example-driven approach to teaching Scheme. If you are looking for a such an introduction in Scheme to functional programming, go take a look at the first four chapters to get an idea. For people coming from Python and interested in learning a bit of Scheme, I would also recommend &lt;a href="http://www.phyast.pitt.edu/~micheles/scheme/"&gt;The Adventures of a Pythonista in Schemeland&lt;/a&gt;. If you&amp;rsquo;re a Racket user, there&amp;rsquo;s even a dedicated library: &lt;a href="https://docs.racket-lang.org/manual@simply-scheme/index.html"&gt;simply-scheme&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Note that the authors use older syntax for Scheme expressions than what is now known as R6 or R7RS (but see below), and they also provide some helper functions in a separate file, &lt;code&gt;simply.scm&lt;/code&gt; (see Appendix A). It is important to download a copy of this file in order to be able to run the examples, since almost all of them use functions defined in that module. For instance, the &lt;code&gt;accumulate&lt;/code&gt; function is defined as follows:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="nv"&gt;accumulate&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let &lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nb"&gt;not &lt;/span&gt;&lt;span class="nv"&gt;not&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;empty?&lt;/span&gt; &lt;span class="nv"&gt;empty?&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;bf&lt;/span&gt; &lt;span class="nv"&gt;bf&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;first&lt;/span&gt; &lt;span class="nv"&gt;first&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;procedure? &lt;/span&gt;&lt;span class="nv"&gt;procedure?&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;whoops&lt;/span&gt; &lt;span class="nv"&gt;whoops&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;member &lt;/span&gt;&lt;span class="nv"&gt;member&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list &lt;/span&gt;&lt;span class="nv"&gt;list&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;combiner&lt;/span&gt; &lt;span class="nv"&gt;stuff&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;real-accumulate&lt;/span&gt; &lt;span class="nv"&gt;stuff&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;empty?&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;bf&lt;/span&gt; &lt;span class="nv"&gt;stuff&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;first&lt;/span&gt; &lt;span class="nv"&gt;stuff&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;combiner&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;first&lt;/span&gt; &lt;span class="nv"&gt;stuff&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;real-accumulate&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;bf&lt;/span&gt; &lt;span class="nv"&gt;stuff&lt;/span&gt;&lt;span class="p"&gt;)))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;cond &lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nb"&gt;not &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;procedure? &lt;/span&gt;&lt;span class="nv"&gt;combiner&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;whoops&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;Invalid first argument to ACCUMULATE (not a procedure):&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;combiner&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nb"&gt;not &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;empty?&lt;/span&gt; &lt;span class="nv"&gt;stuff&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;real-accumulate&lt;/span&gt; &lt;span class="nv"&gt;stuff&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nb"&gt;member &lt;/span&gt;&lt;span class="nv"&gt;combiner&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list &lt;/span&gt;&lt;span class="nv"&gt;+&lt;/span&gt; &lt;span class="nv"&gt;*&lt;/span&gt; &lt;span class="nv"&gt;word&lt;/span&gt; &lt;span class="nv"&gt;se&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;combiner&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;else&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;whoops&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;Can&amp;#39;t accumulate empty input with that combiner&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;small&gt;&lt;code&gt;whoops&lt;/code&gt; in an error-handler function.&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;Example of use:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;load &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;simply.scn&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;acronym&lt;/span&gt; &lt;span class="nv"&gt;phrase&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;accumulate&lt;/span&gt; &lt;span class="nv"&gt;word&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;every&lt;/span&gt; &lt;span class="nv"&gt;first&lt;/span&gt; &lt;span class="nv"&gt;phrase&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;acronym&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;american&lt;/span&gt; &lt;span class="nv"&gt;civil&lt;/span&gt; &lt;span class="nv"&gt;liberties&lt;/span&gt; &lt;span class="nv"&gt;union&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;aclu&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As such, the reader doesn&amp;rsquo;t necessarily get into Scheme&amp;rsquo;s subtleties until chapter 3 or 4 maybe. The very first chapters are here to illustrate some general concepts from computing science: what a statement is, data structures such as lists, sets, the logic behind basic algorithms (e.g., permutations, factorial), branching patterns and function composition. The concepts of predicate and special form only appears in chapter 6, but that&amp;rsquo;s not a big deal since the authors favour an approach based on examples and introduce important concept one after the other (usually, one or two main concepts per chapter). Chapter 9 introduces lambda expression, and things start to get more interesting, especially when discussing named and anonymous functions.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;An even more powerful use of lambda is to provide the value returned by some procedure that you write.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Chapter 10 deals with the Tic-Tac-Toe game and the author discuss how to solve the problem using reasoning and Scheme techniques available so far. This makes heavy use of helper functions available in &lt;code&gt;simply.scm&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Next comes some chapters dealing with recursion, with complete functions defined along the way. As an example, consider the following snippet:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;evens&lt;/span&gt; &lt;span class="nv"&gt;sent&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;&amp;lt;= &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;count&lt;/span&gt; &lt;span class="nv"&gt;sent&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;se&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;first&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;bf&lt;/span&gt; &lt;span class="nv"&gt;sent&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;evens&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;bf&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;bf&lt;/span&gt; &lt;span class="nv"&gt;sent&lt;/span&gt;&lt;span class="p"&gt;))))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This function takes a sentence as its argument and returns a sentence of the even-numbered words of the original sentence. The authors write three versions of the same procedure before offering the best option. They later discuss the case of simplifying base case in recursive functions. The last chapter on recursion presents several functions written by the authors (e.g., &lt;code&gt;every&lt;/code&gt;, &lt;code&gt;keep&lt;/code&gt;, &lt;code&gt;accumulate&lt;/code&gt;) and that were used previously. I found that this helps thinking back to previous exercises and how they could possibly be solved using the highlighted procedures.&lt;/p&gt;
&lt;p&gt;The authors sometimes use diagrams or illustrations to explain the behavior of some functions. Most of the examples discussed in the book deal with the manipulation of strings. All chapters end up with a series of exercises, some of which are just applications of what have been discussed in the chapter. There are also mini-projects at the end of some chapters. Together with the heuristic or example-based approach, this reminds me of &lt;a href="https://gigamonkeys.com/book/"&gt;Practical Common Lisp&lt;/a&gt;, by Peter Seibel.&lt;/p&gt;
&lt;p&gt;I wish I learned about this book earlier because it is both a good read (I like the authors&amp;rsquo; writing style) and a valuable tool for those who want to practice in Scheme. Don&amp;rsquo;t stop at your first impression after chapter 4, things start to get really interesting with Parts III and IV. Reader of &lt;em&gt;The Little Schemer&lt;/em&gt; may enjoy this book as well, especially the exercises and mini-projects. The only caveat is that following the textbook requires the authors&amp;rsquo; toolbox, and not only a base Scheme installation &amp;ndash; however, given that some of the concepts discussed in the book are quite advanced, it is somewhat expected to provide the reader with some additional tools as the authors acknowledge, which would otherwise deserve several chapters to expose.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Led Zeppelin • &lt;em&gt;You Shook Me&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Nyxt V3</title><link>https://aliquote.org/post/nyxt-v3/</link><pubDate>Sat, 20 Aug 2022 12:38:06 +0200</pubDate><guid>https://aliquote.org/post/nyxt-v3/</guid><description>&lt;p&gt;Two years ago I presented the &lt;a href="https://aliquote.org/post/nyxt-browser/"&gt;Nyxt browser&lt;/a&gt;, and how I thought at that time it fit well in my text-oriented workflow. This is still the case, although I had neglected this browser a bit because of big web developments these last twenty months. Now I&amp;rsquo;m back to it as my daily driver for browsing, using the v3 (pre release), after trying out v2.2.4 for a week or so. I must admit it changes the surfing experience quite a bit, but it&amp;rsquo;s all good.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2022-08-19-20-54-32.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Last time, I only scratched the surface of this wonderful app. Let&amp;rsquo;s go into the details of what I like:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;it&amp;rsquo;s quite fast, and largely less bloated than most other web browsers&lt;/li&gt;
&lt;li&gt;keyboard shortcuts are useful and well thought (both for Vi and Emacs users)&lt;/li&gt;
&lt;li&gt;you can easily jump to headings or opened buffers using dedicated panels, with fuzzy search&lt;/li&gt;
&lt;li&gt;if you&amp;rsquo;re a Lisp user, you also get an REPL for free (I didn&amp;rsquo;t try it, though)&lt;/li&gt;
&lt;li&gt;fuzzy search is available for almost everything (switching buffer, history, commands)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Vim users will get the comfort of modal mappings for free, and the normal mode can be defined for all but text input (e.g., input box in web document, status prompt in Nyxt). The Nyxt team even defined some &lt;code&gt;g&lt;/code&gt; mappings, like in Vim. As I said in the other post, I can simply &lt;code&gt;yt&lt;/code&gt; and &lt;code&gt;yu&lt;/code&gt; to get the title and URL of a web page in my primary clipboard. It doesn&amp;rsquo;t look like much but it saves so much copy/paste back and forth between my text editor and the browser. The shortcut &lt;code&gt;yy&lt;/code&gt; is used to copy (yank in Vim parlance) text, but you can safely add a &lt;code&gt;C-c&lt;/code&gt; shortcut in addition.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-08-19-20-54-47.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-08-19-20-54-47.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-08-19-20-55-06.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-08-19-20-55-06.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Here is a list of shortcuts I use in my daily browsing activities using Nyxt:&lt;/p&gt;
&lt;small&gt;
&lt;table border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;Mapping&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;&lt;em&gt;Mode&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;&lt;em&gt;Command&lt;/td&gt;
&lt;td&gt;&lt;em&gt;Role&lt;/em&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;C-w&lt;/kbd&gt;*&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;buffer-listing-mode&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;buffers-panel&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;list all buffers in a separate buffer&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;C-h&lt;/kbd&gt;*&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;history-mode&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;list-history&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;list history in a separate buffer&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;H&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;history-mode&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;history-backwards&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;go backward in history&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;L&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;history-mode&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;history-forwards&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;go forward in history&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;f&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;hint-mode&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;follow-hint&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;prompt for hint and follow in current buffer&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;F&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;hint-mode&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;follow-hint-new-buffer-focus&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;prompt for hint and follow in new buffer&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;/&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;search-buffer-mode&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;search-buffer&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;search in current buffer&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;C-j&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;download-mode&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;list-downloads&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;show all dowload in a separate buffer&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;+&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;document-mode&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;zoom-page&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;zoom in&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;-&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;document-mode&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;unzoom-page&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;zoom out&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;C-d&lt;/kbd&gt;*&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;document-mode&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;scroll-page-down&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;scroll down (one page height)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;C-u&lt;/kbd&gt;*&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;document-mode&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;scroll-page-up&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;scroll up (one page height)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;gh&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;document-mode&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;jump-to-heading&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;jump to a given heading (H1, H2, etc.)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;}&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;document-mode&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;next-heading&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;jump to next heading&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;{&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;document-mode&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;previous-heading&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;jump to previous heading&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;C-c&lt;/kbd&gt;*&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;document-mode&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;copy&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;copy highlighted text to clipboard&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;o&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;set-url&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;open URL in current buffer&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;O&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;set-url-new-buffer&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;open URL in new buffer&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;D&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;delete-current-buffer&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;close buffer&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;R&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;reload-current-buffer&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;reload page&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;yt&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;copy-title&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;save page title to clipboard&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;yu&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;copy-url&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;save URL to clipboard&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;gb&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;switch-buffer&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;switch buffer using fuzzy completion&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;]&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;switch-buffer-next&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;switch to next buffer&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;[&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;kbd&gt;switch-buffer-previous&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;switch to previous buffer&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/small&gt;
&lt;p&gt;In addition to the above mappings where custom mappings are highlighted using an asterisk, I also use a custom shortcut (&lt;kbd&gt;C-o&lt;/kbd&gt;) to open the current buffer in Firefox:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;define-command-global&lt;/span&gt; &lt;span class="nv"&gt;open-external-browser&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;Open the current url in Firefox&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;uiop:run-program&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;list&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;firefox&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;render-url&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;url&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;current-buffer&lt;/span&gt;&lt;span class="p"&gt;))))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As I said, Nyxt is great for basic navigation but when it comes to inspecting HTML or CSS elements I&amp;rsquo;m more comfortable using Firefox developer tools. Time will tell if I can manage to do even basic web dev tasks in Nyxt. Also, Nyxt 3 introduced some changes in how we defined our configuration files (&lt;code&gt;config.lisp&lt;/code&gt; versus &lt;code&gt;init.lisp&lt;/code&gt;) and how we address some components. Basic stuff I showed in my earlier post no longer works, unfortunately. You can start with &lt;a href="https://github.com/aartaka/nyxt-config"&gt;Artyom Bologov&lt;/a&gt;&amp;rsquo;s config to get an idea of how it feels to customize Nyxt a bit. I used some of his macros to define my own shortcuts, for example.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Kendra Morris • &lt;em&gt;This Life&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Low level psychology of goldfish</title><link>https://aliquote.org/post/the-mirage-of-social-networking/</link><pubDate>Fri, 19 Aug 2022 11:51:16 +0200</pubDate><guid>https://aliquote.org/post/the-mirage-of-social-networking/</guid><description>&lt;p&gt;I just finished reading an interesting book (in French), by Bruno Patino, on web and social network-induced attention disorder, and more generally the economy of attention: &lt;em&gt;La civilisation du poisson rouge&lt;/em&gt; (Grasset, 2019).&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Le poisson rouge tourne dans son bocal. Il semble redécouvrir le monde à chaque tour. Les ingénieurs de Google ont réussi à calculer la durée maximale de son attention : 8 secondes. Ces mêmes ingénieurs ont évalué la durée d’attention de la génération des millenials, celle qui a grandi avec les écrans connectés : 9 secondes. Nous sommes devenus des poissons rouges, enfermés dans le bocal de nos écrans, soumis au manège de nos alertes et de nos messages instantanés.&lt;br&gt;
Une étude du Journal of Social and Clinical Psychology évalue à 30 minutes le temps maximum d’exposition aux réseaux sociaux et aux écrans d’Internet au-delà duquel apparaît une menace pour la santé mentale. D’après cette étude, mon cas est désespéré, tant ma pratique quotidienne est celle d’une dépendance aux signaux qui encombrent l’écran de mon téléphone. Nous sommes tous sur le chemin de l’addiction : enfants, jeunes, adultes.&lt;br&gt;
Pour ceux qui ont cru à l’utopie numérique, dont je fais partie, le temps des regrets est arrivé. Ainsi de Tim Berners Lee, « l’inventeur » du web, qui essaie de désormais de créer un contre-Internet pour annihiler sa création première. L’utopie, pourtant, était belle, qui rassemblait, en une communion identique, adeptes de Teilhard de Chardin ou libertaires californiens sous acide.&lt;br&gt;
La servitude numérique est le modèle qu’ont construit les nouveaux empires, sans l’avoir prévu, mais avec une détermination implacable. Au cœur du réacteur, nul déterminisme technologique, mais un projet qui traduit la mutation d’un nouveau capitaliste : l’économie de l’attention. Il s’agit d’augmenter la productivité du temps pour en extraire encore plus de valeur. Après avoir réduit l’espace, il s’agit d’étendre le temps tout en le comprimant, et de créer un instantané infini. L’accélération générale a remplacé l’habitude par l’attention, et la satisfaction par l’addiction. Et les algorithmes sont aujourd’hui les machines-outils de cette économie&amp;hellip;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It is a quick read, go for it if you are interested in the psychology of conditioning and addictive or compulsive behaviors. Overall, the facts reported and discussed by the author agree with what I started feeling a few years ago. Figures speak for themselves, the style is clear, concise and punchy, which is not surprising from a journalist (specialist in new technologies). It would almost make me regret having thrown away most of my psychology books.&lt;/p&gt;
&lt;p&gt;TL;DR We spend way too much time on the internet or social networks, for nothing. I mean, there&amp;rsquo;s no intellectual reward to compulsive activity on those medias, but this has been known for a long time by now. Still, many people and not only teenagers continue this desperate quest toward a virtual world where they may have a more interesting place &amp;ndash; where &amp;ldquo;interesting&amp;rdquo; is only defined from one point of view, meaning this expectation is the only intra-personal aspect of those compulsive behaviors; the rest is sociology of crowds, or sociology, as you like to call it. That&amp;rsquo;s my personal take, of course. You may want to take a look at the more detailed perspective of the author who provides compelling evidence of the addiction induced by the raise of social web medias over time.&lt;/p&gt;
&lt;p&gt;After four years of &amp;ldquo;web cleansing&amp;rdquo;, I am now free of Google, Twitter, Stack Exchange, Signal, Discord, and many other social networks. I can enjoy my hours spent in front of my computer with nothing else to do but produce material, certainly not always useful, but at least staying away from the potential distractions induced by a permanent connection to social networks and the internet. Don&amp;rsquo;t get me wrong, I spent some time there too in the past. My first phone was a Blackberry, you remember that small device that blinked as soon as you had a new email because Blackberry, the company, had push technology for its email system at the time. And I loved it, I really did. Now I just want to be left alone, and not be disturbed while I&amp;rsquo;m trying to concentrate.&lt;/p&gt;
&lt;p&gt;The main point is that I always spend a lot of times on the internet, but now it is an asynchronous way of using the intertube. I check IRC channels from time to time, when I&amp;rsquo;m not engaged in public or private conversations, and &lt;a href="https://aliquote.org/post/back-to-matrix/"&gt;Matrix&lt;/a&gt; is great for that very specific purpose since you get message logs for free &amp;ndash; no need for a bouncer anymore. I also read blogs, via random searches on DDG or my loyal newsreader. But that&amp;rsquo;s about it.&lt;/p&gt;
&lt;p&gt;Likewise, I watch &lt;a href="https://aliquote.org/articles/movies/"&gt;TV shows&lt;/a&gt; on Apple TV or Netflix, but it&amp;rsquo;s limited to one or two episodes per night, and not every night. The downside is that I pay the rent for the year. If you don&amp;rsquo;t want to be brainwashed by tons of commercials on TV these days that&amp;rsquo;s the price you have to pay to have the choice to watch a series or a movie without being disturbed. I&amp;rsquo;m willing to pay in this case.&lt;/p&gt;
&lt;p&gt;And now, let&amp;rsquo;s go back to reading good old printed books in hard copy.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Joy Division • &lt;em&gt;Transmission&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Split-apply-combine in Scheme</title><link>https://aliquote.org/post/plyr-in-scheme/</link><pubDate>Thu, 18 Aug 2022 15:57:09 +0200</pubDate><guid>https://aliquote.org/post/plyr-in-scheme/</guid><description>&lt;p&gt;I&amp;rsquo;ve been a devotee of the &amp;ldquo;split-apply-combine&amp;rdquo; way, popularized in the &lt;a href="https://cran.r-project.org/web/packages/plyr/index.html"&gt;plyr&lt;/a&gt; (and legacy) package, of performing data operations in R. In its simplest form, and using base functions only, it amounts to:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;data&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;crabs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;package&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;MASS&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;spl&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;with&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;crabs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BD&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sp&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;apl&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;lapply&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;spl&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;cbn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;rbind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;apl&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;cbn&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Using plyr, this would simply be &lt;code&gt;ddply(data = crabs, .(sp), summarize, x = mean(BD))&lt;/code&gt;. Related tools include &lt;code&gt;subset&lt;/code&gt; and &lt;code&gt;transform&lt;/code&gt;, and higher-order variations thereof (&lt;code&gt;Filter&lt;/code&gt;, &lt;code&gt;Reduce&lt;/code&gt;, and &lt;code&gt;Map&lt;/code&gt;). I&amp;rsquo;ve seen few people using the later, but it really was not so common back in the days. Maybe &lt;a href="http://www.datajujitsu.co.uk/about/"&gt;David Springate&lt;/a&gt; talked about those functional recipes in one of his talks or tutorials, I don&amp;rsquo;t remember quite well, although I&amp;rsquo;m sure he blogged about &lt;a href="http://www.datajujitsu.co.uk/blog/2013/05/16/functional-programming-in-r/"&gt;functional programming in R&lt;/a&gt;. &lt;a href="https://mailund.dk/"&gt;Thomas Mailund&lt;/a&gt; did this too. If I were to resume the above aspects of data processing using keywords that bear some resemblance with functional PLs, I would say this all amounts to filter, apply (or map), reduce and collect (the later is specific to Common Lisp, though).&lt;/p&gt;
&lt;p&gt;On a related point, Eli Bendersky cites Ben Vandgrift and Alex Miller (&lt;em&gt;Clojure Applied&lt;/em&gt;) in one of his &lt;a href="https://eli.thegreenplace.net/2017/clojure-the-perfect-language-to-expand-your-brain/"&gt;Clojure-related blog post&lt;/a&gt;. Look at the following piece of code:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-clojure" data-lang="clojure"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;defn &lt;/span&gt;&lt;span class="nv"&gt;revenue-by-department&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;carts&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;-&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;filter &lt;/span&gt;&lt;span class="ss"&gt;:settled?&lt;/span&gt; &lt;span class="nv"&gt;carts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;mapcat &lt;/span&gt;&lt;span class="ss"&gt;:line-items&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;map &lt;/span&gt;&lt;span class="nv"&gt;line-summary&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;group-by&lt;/span&gt; &lt;span class="ss"&gt;:dept&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;reduce-kv&lt;/span&gt; &lt;span class="nv"&gt;dept-total&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Doesn&amp;rsquo;t it look like what we discussed above?&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; The point of Eli Bendersky is that soon or later, when processing large amount of data, we need the power and expressiveness of SQL-inspired queries:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Applications that process and extract useful bits of information from large datasets all look alike in many programming languages, at least to some extent. What we really want in many cases is SQL-like primitives built into our languages, but this is often challenging (.NET&amp;rsquo;s LINQ is one example of a successful approach).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Of course, filtering rows or columns, or aggregating numerical quantities with or without grouping first are all builtin in DSLs for statistical computing (R, Stata, LispStat, to name a few). And there have been some attempt at producing reliable Lisp or Scheme packages for data munging. This will probably de dealt with in a future post, especially for Common Lisp and Racket.&lt;/p&gt;
&lt;p&gt;In the mean time, since I&amp;rsquo;m reading a lot of Scheme books at the moment, I found a close analogy to this approach in &lt;a href="https://people.eecs.berkeley.edu/~bh/ssch8/higher.html"&gt;chapter 8&lt;/a&gt; (Higher-order functions) of &lt;em&gt;Simply Scheme&lt;/em&gt;, where the author explains and illustrates the behavior of three procedures:&lt;/p&gt;
&lt;small&gt;
&lt;table border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;Function&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;&lt;em&gt;Purpose&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;&lt;em&gt;First argument&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;every&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;transform&lt;/td&gt;&lt;td&gt;one-arg &lt;em&gt;transforming&lt;/em&gt; function&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;keep&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;select&lt;/td&gt;&lt;td&gt;one-arg &lt;em&gt;predicate&lt;/em&gt; function&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;kbd&gt;accumulate&lt;/kbd&gt;&lt;/td&gt;&lt;td&gt;combine&lt;/td&gt;&lt;td&gt;two-arg &lt;em&gt;combining&lt;/em&gt; function&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/small&gt;
&lt;p&gt;In this case, &lt;code&gt;every&lt;/code&gt; will usually play the role of the R &lt;code&gt;transform&lt;/code&gt; function, or &lt;code&gt;Map&lt;/code&gt;; &lt;code&gt;keep&lt;/code&gt; acts as a filter and does the job of (part of) &lt;code&gt;subset&lt;/code&gt; or &lt;code&gt;Filter&lt;/code&gt;; finally, &lt;code&gt;accumulate&lt;/code&gt; resembles to many of R&amp;rsquo;s builtin functions (e.g., &lt;code&gt;cumsum&lt;/code&gt;) and more generally acts as a reducer (&lt;code&gt;Reduce&lt;/code&gt;). It is the combination of those higher-order functions that makes Scheme so powerful, as in the following examples:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;every&lt;/span&gt; &lt;span class="nv"&gt;square&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;keep&lt;/span&gt; &lt;span class="nv"&gt;even?&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;87&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;accumulate&lt;/span&gt; &lt;span class="nv"&gt;word&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;keep&lt;/span&gt; &lt;span class="nv"&gt;vowel?&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;every&lt;/span&gt; &lt;span class="nv"&gt;first&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;and &lt;/span&gt;&lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="nv"&gt;love&lt;/span&gt; &lt;span class="nv"&gt;her&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Keith Jarrett &amp;amp; Charlie Haden • &lt;em&gt;Goodbye&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Clojure has been on my radar for 8 years now. Long time ago, I bought dozens of books, from which I barely scratched the surface. I never got into it really, except for writing toy examples based on my knowledge of Common Lisp and Scheme, but in a few months I think it will become my Lisp of choice for more serious development.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Zathura viewer</title><link>https://aliquote.org/post/zathura/</link><pubDate>Wed, 17 Aug 2022 10:51:22 +0200</pubDate><guid>https://aliquote.org/post/zathura/</guid><description>&lt;p&gt;Last year I briefly mentioned &lt;a href="https://aliquote.org/post/nyxt-browser/"&gt;Zathura&lt;/a&gt; as my default PDF viewer. Since my last upgrade to Ubuntu 22.04 LTS, I reverted back to Gnome default settings for most things. I still have Zathura defined as my PDF viewer for BibTeX entries&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; and TeX documents, and I customized it a lot since then. I just reenabled it as my default PDF/PS viewer for a couple of reasons:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;a single plain text configuration file&lt;/li&gt;
&lt;li&gt;support for EPUB format&lt;/li&gt;
&lt;li&gt;a nice index accessible via &lt;kbd&gt;tab&lt;/kbd&gt;&lt;/li&gt;
&lt;li&gt;easy bookmarks&lt;/li&gt;
&lt;li&gt;synctex support for $\LaTeX$ editing in Neovim with &lt;a href="https://github.com/lervag/vimtex"&gt;vimtex&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;copy/pasting via mouse selection&lt;/li&gt;
&lt;li&gt;keyboard-driven navigation, including zooming, adjusting, and page navigation&lt;/li&gt;
&lt;li&gt;a jump list like in Vim (&lt;kbd&gt;C-o&lt;/kbd&gt;/&lt;kbd&gt;C-i&lt;/kbd&gt;)&lt;/li&gt;
&lt;li&gt;and many other Vim-like features accessible form, e.g., the input bar.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here are my personal settings in &lt;code&gt;$HOME/.config/zathura/zathurarc&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set default-bg &amp;#34;#2E3440&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set default-fg &amp;#34;#D8DEE9&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set statusbar-fg &amp;#34;#D8DEE9&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set statusbar-bg &amp;#34;#2E3440&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set index-bg &amp;#34;#2E3440&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set index-fg &amp;#34;#D8DEE9&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set index-active-bg &amp;#34;#81A1C1&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set index-active-fg &amp;#34;#D8DEE9&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set inputbar-bg &amp;#34;#2E3440&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set inputbar-fg &amp;#34;#D8DEE9&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set notification-warning-bg &amp;#34;#EBCB8B&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set notification-warning-fg &amp;#34;#2E3440&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set highlight-color &amp;#34;#81A1C1&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set highlight-active-color &amp;#34;#81A1C1&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set completion-highlight-fg &amp;#34;#BF616A&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set completion-highlight-bg &amp;#34;#2E3440&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set completion-bg &amp;#34;#2E3440&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set completion-fg &amp;#34;#D8DEE9&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set notification-bg &amp;#34;#D8DEE9&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set notification-fg &amp;#34;#2E3440&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set recolor-darkcolor &amp;#34;#D8DEE9&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set recolor-lightcolor &amp;#34;#2E3440&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set recolor &amp;#34;true&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set incremental-search &amp;#34;true&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set adjust-open &amp;#34;best-fit&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set window-title-home-tilde &amp;#34;true&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set selection-clipboard &amp;#34;clipboard&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set statusbar-basename &amp;#34;true&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set statusbar-home-tilde &amp;#34;true&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set statusbar-h-padding &amp;#34;5&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set statusbar-v-padding &amp;#34;5&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set window-height 3000
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set window-width 3000
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set save_position &amp;#34;true&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set synctex-editor-command &amp;#34;nvim&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set font &amp;#34;Ubuntu Mono 13&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;map &amp;lt;C-b&amp;gt; feedkeys &amp;#34;:bmark &amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;map D set &amp;#34;first-page-column 1:1&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;map &amp;lt;C-d&amp;gt; set &amp;#34;first-page-column 1:2&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The color scheme follows the Nord dark theme, and it is on by default. If I want a light background as in Evince, I can &lt;code&gt;C-r&lt;/code&gt; to disable recoloring. The window height and width are defined such that Zathura looks maximized on my screen. I think the remaining options speak for themselves.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2022-08-17-11-52-45.png"&gt;
&lt;/figure&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Jewel • &lt;em&gt;Hands&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;I wrote a helper function in Vimscript that can &lt;code&gt;xdg-open&lt;/code&gt; the PDF or Postscript or DJVU file associated to a BIbTeX entry, which I can trigger using &lt;code&gt;gf&lt;/code&gt; shortcut.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;function! text#open_bibtex_key() abort
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; let s:uri = split(split(expand(&amp;#39;&amp;lt;cWORD&amp;gt;&amp;#39;), &amp;#39;{&amp;#39;)[1], &amp;#39;,&amp;#39;)[0]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; if s:uri !=# &amp;#39;&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; silent exec &amp;#34;!xdg-open ~/Documents/papers/&amp;#39;&amp;#34;.s:uri.&amp;#34;&amp;#39;.* &amp;amp;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; else
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; echo &amp;#39;No match found.&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; endif
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;endfunction
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Starship</title><link>https://aliquote.org/post/starship/</link><pubDate>Tue, 16 Aug 2022 14:20:29 +0200</pubDate><guid>https://aliquote.org/post/starship/</guid><description>&lt;p&gt;I&amp;rsquo;ve been a heavy Zsh users for years. I tried Fish some years ago, and although it was a great experience I came back to Zsh at some point, especially given that I could get &lt;a href="https://github.com/zsh-users/zsh-autosuggestions"&gt;autosuggestions&lt;/a&gt; as well in a POSIX-compliant shell. On deskto.ps I noticed a very &lt;a href="https://deskto.ps/u/fitrh/d/3ud2sw"&gt;nice setup&lt;/a&gt; and I wondered WTF is this.&lt;/p&gt;
&lt;p&gt;I spent some time configuring my Zsh prompt the way I like it to be: responsive and informative, no fuzzy stuff. The one we can see in the above screenshot looks too verbose to me, but that&amp;rsquo;s just me. My prompt-related &lt;a href="https://aliquote.org/pub/zsh-prompt.zsh"&gt;Zsh mess&lt;/a&gt; can be viewed online, and it looks like this:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2022-08-16-14-42-03.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Specifically, I highlight Python virtual environment, command duration (when &amp;gt; 5s) and exit code, as well as Git branch with overall repo status. I don&amp;rsquo;t need to indicate whether files were added, modified or deleted, or any departure from a remote branch; I just want to know whethert he repo is clean or dirty. I use the same idea in my Neovim modeline.&lt;/p&gt;
&lt;p&gt;Enters &lt;a href="https://starship.rs/"&gt;starship&lt;/a&gt;, which is supposed to be a&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;minimal, blazing-fast, and infinitely customizable prompt for any shell!&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Being one of these blazing fast CLI utilities developed in Rust (think exa, fdfind, etc.), I thought I would give it a try. My idea was that since it only requires a single config file (in addition to the executable itself, which can be obtained using &lt;code&gt;curl -sS https://starship.rs/install.sh | sh&lt;/code&gt;) I could reuse my setup on other machine quite easily.&lt;/p&gt;
&lt;p&gt;I was able to reproduce my handmade Zsh prompt using the following settings shown below. The only difference is that I kept information regarding the virtual environment and Python version in the left prompt, and put evry transient information in the right prompt:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;format = &amp;#39;$username$directory$python$haskell$git_branch$git_status$character&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;right_format = &amp;#39;$cmd_duration$jobs$sudo&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;add_newline = true
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[character]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;success_symbol = &amp;#34;[%](bold blue)&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;error_symbol = &amp;#34;[%](bold red)&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[directory]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;style = &amp;#34;bold blue&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[jobs]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;symbol = &amp;#39;+&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;format = &amp;#39;[\[$symbol$number\]]($style) &amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[cmd_duration]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;min_time = 5_000
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;format = &amp;#34;[$duration]($style) &amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;style = &amp;#34;bright-black&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[git_branch]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;format = &amp;#34;[$branch(:$remote_branch)]($style)&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;style = &amp;#34;bold purple&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[git_status]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;format = &amp;#34;([$all_status$ahead_behind]($style)) &amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;conflicted = &amp;#34;!&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;modified = &amp;#34;*&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ahead = &amp;#34;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;behind = &amp;#34;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;diverged = &amp;#34;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;untracked = &amp;#34;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;staged = &amp;#34;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;deleted = &amp;#34;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;renamed = &amp;#34;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;style = &amp;#34;bold purple&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[sudo]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;symbol = &amp;#34;#&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;format = &amp;#39;[$symbol]($style) &amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;style = &amp;#34;bold red&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;disabled = false
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[haskell]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;symbol = &amp;#34;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;format = &amp;#39;[\[hs v$symbol($version)\]]($style) &amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;style = &amp;#34;bold yellow&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;detect_extensions = [&amp;#34;cabal&amp;#34;, &amp;#34;hs-boot&amp;#34;]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[python]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;format = &amp;#39;[\[py ${pyenv_prefix}(${version})(\($virtualenv\))\]]($style) &amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;version_format = &amp;#34;v${major}(.${minor})&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;detect_extensions = []
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;style = &amp;#34;bold yellow&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Cleaner, simpler to manage, no need to deal with Zsh &lt;code&gt;precmd&lt;/code&gt; or use circomvoluted idioms to test whether we are in an SSH session or not. More to the point, once starship prompt is configured, it can be reused by any supported shell, including Fish.&lt;/p&gt;
&lt;p&gt;The only thing that I wasn&amp;rsquo;t able to reproduce from my sh settings is that I used to use a subtle trick to show when there were multiple jobs running in the background: rather than displaying a symbol or the number of jobs in my left prompt, I just changed the color of the prompt character itself (from blue to orange when there&amp;rsquo;s at least one hidden job; likewise, I used a red color to indicate that the previous command exited with no zero return code). Bonus point: the right prompt doesn&amp;rsquo;t move when you resize your terminal, that is it remains right-aligned and does not stay in the middle of nowhere after you reduced then maximized your terminal window.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ The Jesus and Mary Chain • &lt;em&gt;Darklands&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Of signals and trap</title><link>https://aliquote.org/post/signals-bash-scripting/</link><pubDate>Mon, 15 Aug 2022 22:54:54 +0200</pubDate><guid>https://aliquote.org/post/signals-bash-scripting/</guid><description>&lt;p&gt;I was reminded of signals in shell scripts, after reading some arcane Bash code a few months ago. What are signals, and how can they be used in shell scripts? The kernel sends signals to running processes about ongoing events. If you type &lt;code&gt;trap -l&lt;/code&gt; in your terminal you&amp;rsquo;ll a list of all available signals, with both their number and their name. Either one can be used to reference a given signal. See the &lt;a href="https://www.gnu.org/software/bash/manual/html_node/Signals.html"&gt;Bash manual&lt;/a&gt; for more information. Note that &lt;code&gt;trap&lt;/code&gt; is also aware of &lt;code&gt;ERR&lt;/code&gt; signals that occur when programs like &lt;code&gt;tar&lt;/code&gt; exits with non zero status code.&lt;/p&gt;
&lt;p&gt;I don&amp;rsquo;t remember what script caught my attention, but the gist of it is that you can easily monitor &lt;code&gt;SIGHUP&lt;/code&gt; or &lt;code&gt;SIGINT&lt;/code&gt; signals in a shell script, as you would do with other environmental variables or user input.&lt;/p&gt;
&lt;p&gt;Without further ado, here&amp;rsquo;s a sample script which catch up eventual user interrupt (&lt;code&gt;Ctrl-C&lt;/code&gt;) when an external program is running :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#!/usr/bin/env bash
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;trap&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;echo User interrupt; exit&amp;#34;&lt;/span&gt; SIGINT
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ghc -e &lt;span class="s1"&gt;&amp;#39;iterate (\x -&amp;gt; ((1103515245 * x) + 12345 `mod` 2^31)) 1&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Whatever follows &lt;code&gt;trap&lt;/code&gt; can also be wrapped in a Bash function. And of course, you can capture more than one signals.&lt;/p&gt;
&lt;p&gt;Of note, the congruential generator above is not great of course.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; To generate an infinite sequence of random number generator, consider the more elaborated solution below:&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-haskell" data-lang="haskell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;System.Random&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="ow"&gt;=&lt;/span&gt; &lt;span class="kr"&gt;do&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="ow"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="n"&gt;newStdGen&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;randoms&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="ow"&gt;::&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;Double&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;A similar approach is discussed in &lt;a href="https://lgfang.github.io/computer/2020/02/13/bash-signal-trap"&gt;this blog post&lt;/a&gt;. Other options are discussed on &lt;a href="https://stackoverflow.com/questions/15785522/catch-sigint-in-bash-handle-and-ignore"&gt;Stack Overflow&lt;/a&gt;. Another nice usage of the &lt;code&gt;trap&lt;/code&gt; command is to clean up intermediate or temporary files in case the program crashes. See an exemple in &lt;a href="https://phoenixnap.com/kb/bash-trap-command"&gt;this article&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I don&amp;rsquo;t have a clear idea of how to use &lt;code&gt;trap&lt;/code&gt; for anything really involved in my Bash script, but I will surely consider using &lt;code&gt;trap&lt;/code&gt; to clean up messy files from now on. In particular, I think the foloowing might be useful near the top of some of my Bash files (e.g., before carrying out large bioinformatics stuff), to offer a proper garbage collector to my scripts:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;trap&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;rm -f /tmp/out&amp;#34;&lt;/span&gt; EXIT SIGINT
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Keith Jarrett • &lt;em&gt;You&amp;rsquo;ve Changed&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;It was the original BSD &lt;code&gt;rand()&lt;/code&gt; function, though. But see &lt;a href="https://www.pnas.org/doi/pdf/10.1073/pnas.61.1.25"&gt;Random numbers fall mainly in the planes&lt;/a&gt; (PDF), by Marsaglia for a discussion of linear congruential generators.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;You will likely need to install the &lt;code&gt;random&lt;/code&gt; package since it does not come with default install of Stack or GHCup.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>GHCup and Haskell tooling in 2022</title><link>https://aliquote.org/post/ghcup/</link><pubDate>Sat, 13 Aug 2022 21:23:04 +0200</pubDate><guid>https://aliquote.org/post/ghcup/</guid><description>&lt;p&gt;For my Haskell toy scripts, I used to rely on &lt;a href="https://docs.haskellstack.org/en/stable/README/"&gt;Stack&lt;/a&gt; since &lt;a href="https://chrisdone.com/posts/haskell-repl/"&gt;Chris Done&lt;/a&gt; and &lt;a href="https://lexi-lambda.github.io/blog/2018/02/10/an-opinionated-guide-to-haskell-in-2018/"&gt;Alexis King&lt;/a&gt;, that I believe to be highly respectable in the field, recommend it. I only write small scripts, like I write small Scheme scripts. Maybe I should consider using those languages as my default scripting tools, but see &lt;a href="https://zignar.net/2021/07/09/why-haskell-became-my-favorite-scripting-language/"&gt;Why Haskell became my favorite scripting language&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Up to now, Stack was a great option : You can install global packages easily, so that System.Random is available after you launch a REPL with &lt;code&gt;stack ghci&lt;/code&gt;, or you can manage small projects using &lt;code&gt;stack&lt;/code&gt; directly. Getting &lt;a href="https://github.com/haskell/haskell-language-server"&gt;HLS&lt;/a&gt; to work with external or local projects was of great service after years of hazards regarding Haskell&amp;rsquo;s proper LSP plugin. Once properly configured, Neovim with its builtin LSP facilities makes writing Haskell code really enjoyable, especially thanks to the hints and linting/formatting facilities.&lt;/p&gt;
&lt;p&gt;Two or three months ago I heard about &lt;a href="https://www.haskell.org/ghcup/"&gt;GHCup&lt;/a&gt;, which might be seens as what &lt;a href="https://rustup.rs/"&gt;rustup&lt;/a&gt; is to Rust. Now, with only a single tool you&amp;rsquo;ll get everything you need, including &lt;code&gt;ghc&lt;/code&gt;, &lt;code&gt;cabal&lt;/code&gt;, &lt;code&gt;stack&lt;/code&gt; and &lt;code&gt;hls&lt;/code&gt;, which you no longer need to compile or download as a release tarball from Github every month or so.&lt;/p&gt;
&lt;p&gt;After you installed GHCup for the first time, you should have a working Haskell stack on your machine. You can upgrade or update at any time, much like you would do with &lt;code&gt;rustup&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;% ghcup list
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;% ghcup upgrade
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;% ghcup install ghc 9.4.1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;% ghcup install cabal 3.8.1.0
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you&amp;rsquo;re a Stack user, you can continue working as usual, you just got HLS for free.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2022-08-15-19-24-17.png"&gt;
&lt;/figure&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Keith Jarrett • &lt;em&gt;Never Let Me Go&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Recently on the commonplace book</title><link>https://aliquote.org/post/commonplace-book/</link><pubDate>Thu, 11 Aug 2022 13:30:56 +0200</pubDate><guid>https://aliquote.org/post/commonplace-book/</guid><description>&lt;p&gt;I spent a little time reading Matthew Lee Hinman&amp;rsquo;s current blog, and I came across two interesting articles. The first one, &lt;a href="https://writequit.org/book/posts/blogging-shift/"&gt;Blogging Shift&lt;/a&gt;, is about blogging &lt;em&gt;per se&lt;/em&gt;, which admittedly is in decline although there are up and down from one year to another. The author summarizes my own take on that particular matter, namely that the media has changed, along with the way we consume information. The internet, and more generally non-verbal communication, is not an all text place nowadays, and it has been largely impacted by the advent of social networks together with the (over)use of overpowered phones. Moreover, there&amp;rsquo;s this irrepressible need for some to give their opinion on everything and to follow sort of a normative approach. I left Twitter a few weeks ago, and I don&amp;rsquo;t regret it. It&amp;rsquo;s fallen into decay for years, IMHO, and I don&amp;rsquo;t see any value in checking in even once a week.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;This is like a post-experience survey asking you to rank your experience on a scale of 1-to-5. It says “here is a pre-cut reactionary channel for some experience, it would be easiest to follow the template” and by doing so, limits the scope of considered responses. Simultaneously the pre-cut reactions provided to users by most content brokers (of which social networks are one of the largest) skew towards the passive—I’m registering my like or dislike in something with minimal effort—rather than the creationary. The bar for entry of opinion into the public sphere has been lowered at the cost of the diversity in the type of reactions.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Another blog post that attracted my attention has to do with what I though was known as the Zettelkasten note-taking way of archiving personal knowledge, but see &lt;a href="https://blog.viktomas.com/books/ahrens-sonke--how-to-take-smart-notes/"&gt;How to Take Smart Notes&lt;/a&gt;. It happens to have yet another (older) name: a &lt;a href="https://writequit.org/book/posts/a-commonplace-book/"&gt;commonplace book&lt;/a&gt;. I did not go into the details to distinguish the etymology or the mode of data collection. However, I really like the idea of organizing ideas, thoughts or readings into a bulk of plain text notes, like much Org users I believe. I&amp;rsquo;m not really an Org user, but I do use Org for writing my notes and handouts. I once started collecting short notes into a &lt;a href="https://aliquote.org/pub/z.pdf"&gt;master file&lt;/a&gt;, but these days I rarely find time to update it. Rather, I guess this blog entries serve as my commonplace book as well.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;They differ from journals in that they aren’t necessarily a recording of personal action (though they can be), and they aren’t necessarily prone to introspective writing (though they may), but are more of a scrapbook of sorts, collecting ideas, quotations, diagrams, thoughts, observations, or anything else that may be useful for reference in the future. There is no prescribed format, and the author is also the intended reader, though in some cases, they have been published publicly.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Contrary to the author, I don&amp;rsquo;t get much from writing those notes, though. I mean, when I write some code to perform a task, I learn from writing the code itself, debugging and so on; but not from summarizing my experience into a blog post. However, when I need to find an old note or blog post, I usually have an idea of where to start, or what keywords to throw out in my terminal to retrieve that information.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Hubert-Félix Thiéfaine • &lt;em&gt;L&amp;rsquo;étranger dans la glace&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Life in a few words</title><link>https://aliquote.org/post/poesie/</link><pubDate>Tue, 09 Aug 2022 11:07:46 +0200</pubDate><guid>https://aliquote.org/post/poesie/</guid><description>&lt;p&gt;Just out of curiosity, I made a quick wordcloud using Mathematica with very few normalization (capital letters, punctuation characters, stop words, short words, etc.) to summarize some personal stuff I wrote during the last 15 years or so, and I thought I will just put it right there.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/wordcloud_poesie.png"&gt;
&lt;/figure&gt;
&lt;p&gt;My very basic script is shown below: (More solutions are available on &lt;a href="https://mathematica.stackexchange.com/questions/2334/how-to-create-word-clouds"&gt;Stack Exchange&lt;/a&gt;.)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Import&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;~/Documents/home/writings/combined.txt&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;junk&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;comme&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;quand&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;enfin&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;lorsque&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;après&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;jusqu&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;sinon&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;aujourd&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;autour&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;entre&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;aussi&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;toute&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;petit&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;avoir&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;encore&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;aurais&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;étais&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;avais&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;juste&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;leurs&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;parce&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;cleanedData&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;StringReplace&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;#&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;RegularExpression&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;\\b[0-9]+[/-][0-9]+([/-][0-9]+)?\\b&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/@&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;DeleteStopwords&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ToLowerCase&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;TextWords&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;]]];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;cleanedData&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Select&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Flatten&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;StringSplit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;StringReplace&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;cleanedData&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;PunctuationCharacter&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34; &amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]]],&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;StringLength&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;#&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;!=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;comme&amp;#34;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;cleanedData&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;DeleteCases&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;cleanedData&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;x_&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;MemberQ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;junk&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;WordCloud&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;cleanedData&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Disk&lt;/span&gt;&lt;span class="p"&gt;[],&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ColorFunction&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ColorData&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;AtlanticColors&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;small&gt;The sieve for junk words was quickly devised by trial and error. Nothing&amp;rsquo;s perfect to be expected.&lt;/small&gt;&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Bod Dylan • &lt;em&gt;Changing of the Guards&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>July in review</title><link>https://aliquote.org/post/micro-review-020/</link><pubDate>Tue, 02 Aug 2022 11:02:22 +0200</pubDate><guid>https://aliquote.org/post/micro-review-020/</guid><description>&lt;p&gt;In which I summarize what I&amp;rsquo;ve read recently on the &lt;a href="https://www.worldwidewords.org/turnsofphrase/tp-int5.htm"&gt;intertube&lt;/a&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;I haven&amp;rsquo;t touched my Neovim config during 30 days, except for minor adjustments of my custom mappings. Well, it may well be because I was on holidays as well. Anyway, things start to come up right, I think. The more stuff I delete, the more it let me think about internal stuff, much like in this nicely set up blog post by Joe Nelson that I already mentioned somewhere on this site: &lt;a href="https://begriffs.com/posts/2019-07-19-history-use-vim.html"&gt;History and effective use of Vim&lt;/a&gt;. Likewise, I reverted back to Ubuntu defualt settings (default display manager, defualt font, etc.), and it has been working great for me.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;TIL about &lt;a href="https://www.whonix.org/"&gt;whonix&lt;/a&gt;, which is a full operating system, including common chat and office applications, that runs inside your current one via Tor, with added security layers. It might be a good way to get a secured OS on a USB stick.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you&amp;rsquo;re looking for lightweight and minimalist, stop by the &lt;a href="https://inconsolation.wordpress.com/"&gt;Inconsolation&lt;/a&gt; blog. You will likely find useful suggestion for old-fashioned but resilient software for pretty everything. But see this blog post if you look for a &lt;a href="https://applied-langua.ge/posts/terminal-boredom.html"&gt;different take&lt;/a&gt; on so-called digital minimalism.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The Ghostscript suite got a new &lt;a href="https://www.ghostscript.com/blog/pdfi.html"&gt;PDF interpreter&lt;/a&gt;. It&amp;rsquo;s been a while since I no longer rely on DVI+PS conversion for $\LaTeX$ typesetting &amp;ndash; maybe I should, at least for the quality of the fonts in print form &amp;ndash; but I still use Ghostscript utilities from time to time. A recurrent command I use if &lt;code&gt;gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -dAutoRotatePages=/None -sOutputFile=merged.pdf *.pdf&lt;/code&gt; to assemble a series of individual PDF files.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://thenumb.at/Autodiff/"&gt;Differentiable Programming from Scratch&lt;/a&gt; covers the basics of numerical and symbolic differentiation, as well as automatic differentiation, with lot of pretty illustrations.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;An old but good post about page weight, by Chris Zacharias: &lt;a href="https://blog.chriszacharias.com/page-weight-matters"&gt;Page Weight Matters&lt;/a&gt;. For a related discussion, check out Tom MacWright&amp;rsquo;s opinion on web design, especially his &lt;a href="https://macwright.com/2016/05/03/the-featherweight-website.html"&gt;site redesign&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://blog.janetacarr.com/clojure-needs-a-rails/"&gt;Clojure needs a Rails, but not for the reason you think&lt;/a&gt;. If I were to use a functional language to write my genomic data apps, I would certainly chose either Clojure or a combination of Elm+Elixir. I&amp;rsquo;m surpised there&amp;rsquo;s nothing already for starting right away with Clojure. I remember the &lt;a href="https://github.com/noir-clojure/noir"&gt;Noir&lt;/a&gt; framework, but well it looks like 10 years old and unmaintained.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I always reading &amp;ldquo;naturalistic&amp;rdquo; data science or web scraping on real data. Here&amp;rsquo;s the most recent one: &lt;a href="https://jessimekirk.com/blog/hn_users_links/"&gt;Famous HNers and Their Sites&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://kevinlawler.com/refcount"&gt;Reference Count, Don&amp;rsquo;t Garbage Collect&lt;/a&gt;: An interesting overview with pros and cons of reference counting vs. garbage collection.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The best average time complexity of Timsort is $\mathcal{O}(n)$. Hard to beat. See more in &lt;a href="https://skerritt.blog/timsort/"&gt;Timsort &amp;ndash; the fastest sorting algorithm you’ve never heard of&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://joeyh.name/blog/entry/xmonad_layouts_for_netbooks/"&gt;How a window manager with tiling layouts makes a 1024x600 resolution livable&lt;/a&gt;. And, yes, he lives in a cabin. Since I&amp;rsquo;m now on Wayland, I may try &lt;a href="https://swaywm.org/"&gt;Sway&lt;/a&gt; at some point, but see &lt;a href="https://sagrista.info/blog/2022/wayland-sway/"&gt;Trying out Sway and Wayland&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://fly.io/blog/sqlite-internals-btree/"&gt;SQLite Internals: Pages &amp;amp; B-trees&lt;/a&gt;: A technical review of SQLite internals. Pretty good job!&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://11011110.github.io/blog/2022/07/21/flipping-until-lost.html"&gt;Flipping until you are lost&lt;/a&gt;: A summary of a recent paper on convex polygon triangulation flip walk (&lt;a href="https://arxiv.org/abs/2207.09972"&gt;arXiv:2207.09972&lt;/a&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;Still, the purists proclaim, it&amp;rsquo;s not enough. Python is not a replacement for Haskell. But does it matter? 90% of the impressive magic from early functional languages has been rolled into mainstream languages. That last 10%, well, it&amp;rsquo;s not clear that anyone is really wanting it or that the benefits are actually there. Purity has some advantages, but it&amp;rsquo;s so convenient and useful to directly modify a dictionary in Python. Fold and map are beautiful, but they work just as well in the guise of a foreach loop. &amp;mdash; &lt;a href="https://prog21.dadgum.com/31.html"&gt;Functional Programming Went Mainstream Years Ago&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Deep Sea Diver • &lt;em&gt;Shattering the Hourglass&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>More Tmux little hacks</title><link>https://aliquote.org/post/tmux-little-hacks/</link><pubDate>Fri, 29 Jul 2022 21:54:57 +0200</pubDate><guid>https://aliquote.org/post/tmux-little-hacks/</guid><description>&lt;p&gt;A few months ago I learned that we can add popup menus to Tmux, using &lt;code&gt;display-menu&lt;/code&gt;. I rarely use it, but I find it convenient. The more I learn about those little hacks in Tmux the more I like it. It&amp;rsquo;s worth all modern terminals by far.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2022-07-29-20-11-46.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Here&amp;rsquo;s mine:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-q display-menu -x W -y S \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;New Session&amp;#34; S &amp;#34;command-prompt -p \&amp;#34;New Session:\&amp;#34; \&amp;#34;new-session -A -s &amp;#39;%%&amp;#39;\&amp;#34;&amp;#34; \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;Kill Session&amp;#34; x &amp;#34;kill-session&amp;#34; \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;Kill Other Session(s)&amp;#34; X &amp;#34;kill-session -a&amp;#34; \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;&amp;#34; \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;New Window&amp;#34; ␍ new-window \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;Kill Window&amp;#34; k &amp;#34;killw&amp;#34; \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;Choose Window&amp;#34; w choose-window \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;Previous Window&amp;#34; 🡠 previous-window \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;Next Window&amp;#34; 🡢 next-window \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;Swap Window Right&amp;#34; ↑ &amp;#34;swap-window -t -1&amp;#34; \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;Swap Window Left&amp;#34; ↓ &amp;#34;swap-window -t +1&amp;#34; \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;Horizontal Split&amp;#34; v &amp;#34;split-window -h&amp;#34; \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;Vertical Split&amp;#34; s &amp;#34;split-window -v&amp;#34; \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;&amp;#34; \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;Layout Horizontal&amp;#34; h &amp;#34;select-layout even-horizontal&amp;#34; \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;Layout Vertical&amp;#34; k &amp;#34;select-layout even-horizontal&amp;#34; \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;&amp;#34; \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;Swap Pane Up&amp;#34; &amp;lt; &amp;#34;swap-pane -U&amp;#34; \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;Swap Pane Down&amp;#34; &amp;gt; &amp;#34;swap-pane -D&amp;#34; \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;Break Pane&amp;#34; t break-pane \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;Join Pane&amp;#34; j &amp;#34;choose-window &amp;#39;join-pane -h -s \&amp;#34;%%\&amp;#34;&amp;#39;&amp;#34; \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;#{?window_zoomed_flag,Unzoom,Zoom}&amp;#34; z &amp;#34;resize-pane -Z&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Copying/pasting in Tmux has always been a pain for me. In the end, I most of the time rely on what I call the &amp;ldquo;shift&amp;rdquo; selection and copy approach, meaning that you select text using your mouse while pressing the &lt;kbd&gt;Shift&lt;/kbd&gt; key, and you copy the highlighted text using &lt;kbd&gt;Shift+Ctrl+C&lt;/kbd&gt;. It works. Other than that, you can leverage Tmux&amp;rsquo;s facilities for copy-pasting text or whole buffers using the following shortcuts:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind Y copy-mode
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;setw -g mode-keys vi
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -T copy-mode-vi v send -X begin-selection
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -T copy-mode-vi &amp;#39;C-v&amp;#39; send -X rectangle-toggle
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set -g set-clipboard off
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel &amp;#34;xclip -i -selection clipboard&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel &amp;#34;xclip -i -selection clipboard&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In this case, you have two options: using the mouse to select text &amp;ndash; that&amp;rsquo;s the &lt;code&gt;MouseDragEnd1Pane&lt;/code&gt; snippet above, then you just &lt;kbd&gt;Shift+Ctrl+V&lt;/kbd&gt; to paste the highlighted text wherever you want; this even works to paste text from a shell into a Vim buffer. Other than that, you can use the keyboard after pressing the &lt;kbd&gt;Y&lt;/kbd&gt; key, then use Vim motion key to select your text &amp;ndash; these are the very first keybindings in the above snippet.&lt;/p&gt;
&lt;p&gt;If you don&amp;rsquo;t like window number in the status bar when you only have one window, you can add the following to your Tmux config:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set -g status off
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set-hook -g after-new-window &amp;#39;if &amp;#34;[ #{session_windows} -gt 1 ]&amp;#34; &amp;#34;set status on&amp;#34;&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set-hook -g pane-exited &amp;#39;if &amp;#34;[ #{session_windows} -lt 2 ]&amp;#34; &amp;#34;set status off&amp;#34;&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It will first disable the status bar, and then rely on a hook to activate it when there&amp;rsquo;s more than one window available in the current session. I&amp;rsquo;ve been using this for years and it&amp;rsquo;s really great.&lt;/p&gt;
&lt;p&gt;After much use, I found that binding the &lt;kbd&gt;Alt&lt;/kbd&gt; key as a pseudo-prefix key is a must (it&amp;rsquo;s close to the &lt;kbd&gt;Meta&lt;/kbd&gt; key used by Ubuntu). Here are some mappings I use almost every day:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-! split-window -f -l 10 -c &amp;#34;#{pane_current_path}&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-: command-prompt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-&amp;lt; swap-pane -U
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-= choose-buffer
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-&amp;gt; swap-pane -D
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-D choose-client
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-Down swap-window -t +1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-Enter new-window
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-Left previous-window
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-O switch-client -l
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-S command-prompt -p &amp;#34;New Session:&amp;#34; &amp;#34;new-session -A -s &amp;#39;%%&amp;#39;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-Right next-window
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-Up swap-window -t -1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-k select-layout even-vertical
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-j choose-window &amp;#39;join-pane -h -s &amp;#34;%%&amp;#34;&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-h select-layout even-horizontal
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-l last-window
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-m command-prompt -p &amp;#34;Search man pages for:&amp;#34; &amp;#34;new-window &amp;#39;exec man %%&amp;#39;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-o selectp -t :.+
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-p run &amp;#34;tmux split-window -p 10 &amp;#39;tmux send-keys -t #{pane_id} \&amp;#34;$(locate ~/ | fzf -m | paste -sd\\ -)\&amp;#34;&amp;#39;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-s split-window -v
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-t break-pane
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-v split-window -h
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-w choose-window
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# bind-key -n M-x confirm-before -p &amp;#34;kill-pane #P? (y/n)&amp;#34; kill-pane
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-y copy-mode
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-z resize-pane -Z
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2022-08-27]&lt;/small&gt;&lt;br&gt;
See my &lt;a href="https://aliquote.org/artciles/tmux/"&gt;Tmux cheatsheet&lt;/a&gt; for more up to date mappings.
&lt;/div&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2025-01-06]&lt;/small&gt;&lt;br&gt;
See also this &lt;a href="https://willhbr.net/2024/03/06/tmux-conf-with-commentary/"&gt;little gem&lt;/a&gt; on Will Richardson&amp;rsquo;s weblog.
&lt;/div&gt;
&lt;p&gt;Happy hacking on Tmux!&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Jean-Yves Thibaudet • &lt;em&gt;Liszt Consolations, S. 172 - No. 3 in D-Flat Major. Lento placido&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in July</title><link>https://aliquote.org/post/micro-07-2022/</link><pubDate>Fri, 29 Jul 2022 18:43:03 +0200</pubDate><guid>https://aliquote.org/post/micro-07-2022/</guid><description>&lt;p&gt;This was a pretty calm month, but I also wrote a lot of longer &lt;a href="https://aliquote.org/post/"&gt;blog posts&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-07-04&lt;/a&gt;: 25,011 scrobbles on Last.fm in 9 months.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-07-06&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Alain Kan, &lt;em&gt;Speed My Speed&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-07-07&lt;/a&gt;: &lt;a href="https://personal.math.ubc.ca/~pwalls/math-python/"&gt;Mathematical Python&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-07-08&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Nick Cave &amp;amp; The Bad Seeds, &lt;em&gt;The Mercy Seat&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-07-08&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Git is built on a graph. Almost every Git command manipulates this graph. To understand Git deeply, focus on the properties of this graph, not workflows or commands. &amp;mdash; &lt;a href="https://codewords.recurse.com/issues/two/git-from-the-inside-out"&gt;Git from the inside out&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-07-08&lt;/a&gt;: &lt;a href="https://mathematical-tours.github.io/"&gt;Mathematical Tours&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-07-08&lt;/a&gt;: &lt;a href="https://matt-rickard.com/what-comes-after-git/"&gt;What Comes After Git&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-07-10&lt;/a&gt;: &lt;a href="https://blog.landofcrispy.com/index.php/2021/01/06/clipboard-integration-between-tmux-nvim-zsh-x11-across-ssh-sessions/"&gt;Clipboard integration between tmux, nvim, zsh, x11, across SSH sessions&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Clan of Xymox • &lt;em&gt;A Day&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Scheming with Vim</title><link>https://aliquote.org/post/scheme-in-vim/</link><pubDate>Wed, 27 Jul 2022 20:50:59 +0200</pubDate><guid>https://aliquote.org/post/scheme-in-vim/</guid><description>&lt;p&gt;As a matter of fact, I use Neovim to wrote all my Chicken Scheme and Racket code. It works quite great, even if I do not have as much facilities as I had under Emacs with &lt;a href="https://www.nongnu.org/geiser/"&gt;Geiser&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I followed the recommendations available on Chicken &lt;a href="https://wiki.call-cc.org/vim"&gt;website&lt;/a&gt;, as well as Evan Hanson&amp;rsquo;s useful blog post, &lt;a href="https://www.foldling.org/scheme.html#2013-01-18"&gt;Editing Scheme in Vim&lt;/a&gt;, especially for completion. I found that setting &lt;code&gt;keywordprg&lt;/code&gt; to &lt;code&gt;chicken-doc scheme&lt;/code&gt; instead of &lt;code&gt;chicken-doc&lt;/code&gt; is most of the times what I really need.&lt;/p&gt;
&lt;p&gt;My &lt;code&gt;after/ftplugin/scheme.vim&lt;/code&gt; is short enough that I can post it right in this post:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-vim" data-lang="vim"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;:&lt;span class="nx"&gt;is_chicken&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;setl&lt;/span&gt; &lt;span class="nx"&gt;makeprg&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;csc&lt;/span&gt;\ %
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;setl&lt;/span&gt; &lt;span class="nx"&gt;complete&lt;/span&gt;&lt;span class="p"&gt;+=,&lt;/span&gt;&lt;span class="nx"&gt;k&lt;/span&gt;&lt;span class="p"&gt;~&lt;/span&gt;&lt;span class="sr"&gt;/.local/&lt;/span&gt;&lt;span class="nx"&gt;share&lt;/span&gt;&lt;span class="sr"&gt;/scheme/&lt;/span&gt;&lt;span class="nx"&gt;words&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;setl&lt;/span&gt; &lt;span class="nx"&gt;include&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;\^\&lt;span class="p"&gt;(&lt;/span&gt;\\&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;use&lt;/span&gt;\\\&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;extension&lt;/span&gt;\\&lt;span class="p"&gt;)&lt;/span&gt;\\&lt;span class="nx"&gt;s&lt;/span&gt;\\&lt;span class="p"&gt;+&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;setl&lt;/span&gt; &lt;span class="nx"&gt;includeexpr&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;substitute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;v&lt;/span&gt;:&lt;span class="nx"&gt;fname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;$&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;.scm&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;setl&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;+=&lt;/span&gt;&lt;span class="sr"&gt;/home/&lt;/span&gt;&lt;span class="nx"&gt;chl&lt;/span&gt;&lt;span class="sr"&gt;/.cache/&lt;/span&gt;&lt;span class="nx"&gt;chicken&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;setl&lt;/span&gt; &lt;span class="nx"&gt;suffixesadd&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;.&lt;span class="nx"&gt;scm&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;setl&lt;/span&gt; &lt;span class="nx"&gt;lispwords&lt;/span&gt;&lt;span class="p"&gt;+=&lt;/span&gt;&lt;span class="k"&gt;let&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;values&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;condition&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;case&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;with&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;from&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;string&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;setl&lt;/span&gt; &lt;span class="nx"&gt;lispwords&lt;/span&gt;&lt;span class="p"&gt;+=&lt;/span&gt;&lt;span class="nx"&gt;with&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;output&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;exceptions&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;call&lt;/span&gt;/&lt;span class="nx"&gt;cc&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;rec&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;receive&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;setl&lt;/span&gt; &lt;span class="nx"&gt;lispwords&lt;/span&gt;&lt;span class="p"&gt;+=&lt;/span&gt;&lt;span class="nx"&gt;call&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;with&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;output&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;file&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;fun&lt;/span&gt;&lt;span class="p"&gt;!&lt;/span&gt; &lt;span class="nx"&gt;Scheme_indent_top_sexp&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;pos&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;getpos&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;silent&lt;/span&gt;&lt;span class="p"&gt;!&lt;/span&gt; &lt;span class="nx"&gt;exec&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;normal! 99[(=%&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;call&lt;/span&gt; &lt;span class="nx"&gt;setpos&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;endfun&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;nmap&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;silent&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; :&lt;span class="nx"&gt;call&lt;/span&gt; &lt;span class="nx"&gt;Scheme_indent_top_sexp&lt;/span&gt;&lt;span class="p"&gt;()&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;nmap&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;gs&lt;/span&gt; :&lt;span class="m"&gt;10&lt;/span&gt; &lt;span class="nx"&gt;split&lt;/span&gt; &lt;span class="nx"&gt;term&lt;/span&gt;:&lt;span class="sr"&gt;//&lt;/span&gt;&lt;span class="nx"&gt;csi&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt; %&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;:&lt;span class="nx"&gt;startinsert&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;setlocal&lt;/span&gt; &lt;span class="nx"&gt;keywordprg&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;chicken&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;doc&lt;/span&gt;\ &lt;span class="nx"&gt;scheme&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The file &lt;code&gt;~/.local/share/scheme/words&lt;/code&gt; was generated as advertised by Evan Hanson. I just use a different directory to store Scheme keywords. I update the word list periodically, especially after I install new packages.&lt;/p&gt;
&lt;p&gt;For the time being, I&amp;rsquo;m not interested in other Scheme flavor, so I decided to target Chicken scheme only. Together with Racket, it is a solid Scheme implementation that further comes with a package manager and a nice FFI.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2023-10-27]&lt;/small&gt;&lt;br&gt;
I highly recommend installing &lt;a href="https://github.com/kovisoft/paredit"&gt;vim-paredit&lt;/a&gt; (still maintained despite being listed on &lt;a href="https://github.com/vim-scripts"&gt;vim-scripts&lt;/a&gt;). For some time I use to rely on &lt;a href="https://github.com/gpanders/nvim-parinfer"&gt;nvim-parinfer&lt;/a&gt;, and now there&amp;rsquo;s &lt;a href="https://github.com/julienvincent/nvim-paredit"&gt;nvim-paredit&lt;/a&gt; (and &lt;a href="https://github.com/dundalek/parpar.nvim"&gt;parpar&lt;/a&gt; if you prefer a combo). Tehre&amp;rsquo;s also &lt;a href="https://github.com/guns/vim-sexp"&gt;vim-sexp&lt;/a&gt;, with awful mappings, and &lt;a href="https://github.com/tpope/vim-sexp-mappings-for-regular-people"&gt;vim-sexp-mappings-for-regular-people&lt;/a&gt;, with far better mappings but a longer nick). I&amp;rsquo;ve tried them all, noticed some issues with nvim-parinfer when deleting enclosed forms, which led me to rely on Vim &lt;code&gt;dib&lt;/code&gt; and &lt;code&gt;dab&lt;/code&gt; instead. Finally, there&amp;rsquo;s &lt;a href="https://github.com/PaterJason/nvim-treesitter-sexp"&gt;nvim-treesitter-sexp&lt;/a&gt;, but it seems to be limited to &amp;ldquo;modern&amp;rdquo; Lisp languages (Clojure, Fennel and the like); I haven&amp;rsquo;t tried it. With vim-paredit you get part of parinfer, i.e., when you delete a line or an s-expression inside a top-level form in Lisp you get the correct result, and many additional goodies like slurping and barfing the easy way (&lt;code&gt;&amp;lt;&lt;/code&gt; and &lt;code&gt;&amp;gt;&lt;/code&gt;), join/slice/wrap lists and sublists, in normal or visual mode. As a final remark, I should note that there&amp;rsquo;s a &lt;a href="https://github.com/6cdh/tree-sitter-scheme"&gt;treesitter grammar&lt;/a&gt; for Scheme (as well as Common Lisp, Racket, and Clojure), which means indentation and formating should be all right.
&lt;/div&gt;
&lt;hr&gt;
&lt;p&gt;A final word: The &lt;code&gt;gs&lt;/code&gt; mapping is something that I implemented for most languages that offer some kind of a REPL or a quick compilation process. So far, I have it implemented for the folloing filetypes:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;~/.../after/ftplugin % rg &lt;span class="s2"&gt;&amp;#34;&amp;lt;buffer&amp;gt; gs&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;tex.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;29:nmap &amp;lt;buffer&amp;gt; gs :VimtexCompile&amp;lt;CR&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;r.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;5:nmap &amp;lt;buffer&amp;gt; gs :10 split term://Rscript %&amp;lt;cr&amp;gt;:startinsert&amp;lt;cr&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;org.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;10:nmap &amp;lt;buffer&amp;gt; gs :10 split term://org-babel -pdf % &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; zathura %:r.pdf&amp;lt;cr&amp;gt;:startinsert&amp;lt;cr&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;c.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;12:nmap &amp;lt;buffer&amp;gt; gs :10 split term://zig cc % &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; ./a.out&amp;lt;cr&amp;gt;:startinsert&amp;lt;cr&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;rmd.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;1:nmap &amp;lt;buffer&amp;gt; gs :w&amp;lt;CR&amp;gt;:cd %:p:h &amp;lt;CR&amp;gt;:!Rscript -e &lt;span class="s1"&gt;&amp;#39;library(knitr);knit(&amp;#34;%:p&amp;#34;)&amp;#39;&lt;/span&gt;&amp;lt;CR&amp;gt;:!latexmk -pdf -bibtex-cond -f %:r.tex &amp;lt;CR&amp;gt;:!xdg-open %:r.pdf &amp;lt;CR&amp;gt;&amp;lt;C &lt;span class="o"&gt;[&lt;/span&gt;... &lt;span class="m"&gt;0&lt;/span&gt; more matches&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;rnoweb.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;10:nmap &amp;lt;buffer&amp;gt; gs :w&amp;lt;CR&amp;gt;:cd %:p:h &amp;lt;CR&amp;gt;:!Rscript -e &lt;span class="s1"&gt;&amp;#39;library(knitr);knit(&amp;#34;%:p&amp;#34;)&amp;#39;&lt;/span&gt;&amp;lt;CR&amp;gt;:!latexmk -pdf -bibtex-cond -f %:r.tex &amp;lt;CR&amp;gt;:!xdg-open %:r.pdf &amp;lt;CR&amp;gt;&amp;lt;C &lt;span class="o"&gt;[&lt;/span&gt;... &lt;span class="m"&gt;0&lt;/span&gt; more matches&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;scheme.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;23:nmap &amp;lt;buffer&amp;gt; gs :10 split term://csi -s %&amp;lt;cr&amp;gt;:startinsert&amp;lt;cr&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;lisp.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;1:nmap &amp;lt;buffer&amp;gt; gs :10 split term://ros -l %&amp;lt;cr&amp;gt;:startinsert&amp;lt;cr&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;stata.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;3:nmap &amp;lt;buffer&amp;gt; gs :10 split term://stata -q %&amp;lt;cr&amp;gt;:startinsert&amp;lt;cr&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;markdown.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;9:nmap &amp;lt;buffer&amp;gt; gs :10 split term://pandoc -s --pdf-engine&lt;span class="o"&gt;=&lt;/span&gt;lualatex --filter pandoc-fignos --filter pandoc-citeproc --listings % -o %:r.pdf &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; zathura % &lt;span class="o"&gt;[&lt;/span&gt;... &lt;span class="m"&gt;0&lt;/span&gt; more matches&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;racket.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;80:nmap &amp;lt;buffer&amp;gt; gs :10 split term://racket %&amp;lt;cr&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;8:nmap &amp;lt;buffer&amp;gt; gs :10 split term://python3 %&amp;lt;cr&amp;gt;:startinsert&amp;lt;cr&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;haskell.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;6:nmap &amp;lt;buffer&amp;gt; gs :10 split term://chmod +x % &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; ./%&amp;lt;cr&amp;gt;:startinsert&amp;lt;cr&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;rust.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;3:nmap &amp;lt;buffer&amp;gt; gs :10 split term://cargo run&amp;lt;cr&amp;gt;:startinsert&amp;lt;cr&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note that I also use &lt;a href="https://github.com/hkupty/iron.nvim"&gt;iron&lt;/a&gt; to launch some REPL right into a running Neovim instance.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; It also works great with the interactive interpreter &lt;code&gt;csi&lt;/code&gt;.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2023-10-27]&lt;/small&gt;&lt;br&gt;
No more plugin providing REPL-like features. If I were to install one, I would choose either &lt;a href="https://github.com/kovisoft/slimv"&gt;slimv&lt;/a&gt; (almost surely) or &lt;a href="https://github.com/Olical/conjure"&gt;conjure&lt;/a&gt;. If this is just to send a line or a selection to a terminal running my favorite interpreter, I stand by my poor man mappings: &lt;code&gt;vim.keymap.set(&amp;quot;n&amp;quot;, &amp;quot;ss&amp;quot;, [[ Vy&amp;lt;C-w&amp;gt;wpa&amp;lt;CR&amp;gt;&amp;lt;C-\&amp;gt;&amp;lt;C-n&amp;gt;&amp;lt;C-w&amp;gt;pj ]])&lt;/code&gt; (current line), &lt;code&gt;vim.keymap.set(&amp;quot;x&amp;quot;, &amp;quot;s&amp;quot;, [[ y&amp;lt;C-w&amp;gt;wpa&amp;lt;CR&amp;gt;&amp;lt;C-\&amp;gt;&amp;lt;C-n&amp;gt;&amp;lt;C-w&amp;gt;p ]])&lt;/code&gt; (visual selection).
&lt;/div&gt;
&lt;p&gt;Happy scheming in (Neo)vim!&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2022-07-27-21-11-59.png"&gt;
&lt;/figure&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Nick Cave &amp;amp; The Bad Seeds • &lt;em&gt;Rock of Gibraltar&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;I locked Neovim packer at commit &lt;code&gt;bc9c596d6a97955f0306d2abcc10d9c35bbe2f5b&lt;/code&gt;, but that should not stop you trying it out.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Welch t-test in Scheme</title><link>https://aliquote.org/post/welch-test-scheme/</link><pubDate>Wed, 27 Jul 2022 09:41:22 +0200</pubDate><guid>https://aliquote.org/post/welch-test-scheme/</guid><description>&lt;h3 id="background"&gt;Background&lt;/h3&gt;
&lt;p&gt;For two independant samples, the Student test statistic is defined as follows:&lt;/p&gt;
&lt;p&gt;$$
t_{\text{obs}}=\frac{\bar x_1 - \bar x_2}{s_c\sqrt{\frac{1}{n_1}+\frac{1}{n_2}}},
$$&lt;/p&gt;
&lt;p&gt;with $s_c=\left(\frac{(n_1-1)s^2_1+(n_2-1)s^2_2}{n_1+n_2-2}\right)^{1/2}$, and where $\bar x_i$ and $n_i$ represent the means and sample sizes of the two samples, and $s_c$ is the pooled variance for the difference of means. Under $H_0$, this test statistic follows a Student distribution with $n_1+n_2-2$ degrees of freedom.&lt;/p&gt;
&lt;p&gt;A $100(1-\alpha)$% confidence interval for the difference $\bar x_1 - \bar x_2$ can be defined as&lt;/p&gt;
&lt;p&gt;$$
\bar x_1 - \bar x_2\pm t_{\alpha, n_1+n_2-2}s_c\sqrt{\frac{1}{n_1}+\frac{1}{n_2}},
$$&lt;/p&gt;
&lt;p&gt;with $P(t&amp;lt;t_{\alpha,n_1+n_2-2})=1-\alpha/2$.&lt;/p&gt;
&lt;p&gt;The above assumes equal variances at the population level.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; This hypothesis can be relaxed by approximating the degrees of freedom using a linear combination of the sample variances, $\tfrac{s_1^2}{n_1}+\tfrac{s_2^2}{n_2}$.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; The test statistic still follows a Student distribution, but with $\nu$ degrees of freedom.&lt;/p&gt;
&lt;p&gt;The Satterthwaite approximation considers:&lt;/p&gt;
&lt;p&gt;$$
\nu = \frac{ \left( s_1^2/n_1 + s_2^2/n_2 \right)^2 }
{ \frac{\left( s_1^2/n_1 \right)^2}{n_1-1} + \frac{\left( s_2^2/n_2 \right)^2}{n_2-1} }.
$$&lt;/p&gt;
&lt;p&gt;The formula proposed by Welch is close to the above formulation:&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;$$
\nu = -2 + \frac{ \left( s_1^2/n_1 + s_2^2/n_2 \right)^2 }
{ \frac{\left( s_1^2/n_1 \right)^2}{n_1 + 1} + \frac{\left( s_2^2/n_2 \right)^2}{n_2 + 1} }.
$$&lt;/p&gt;
&lt;h3 id="application-in-scheme"&gt;Application in Scheme&lt;/h3&gt;
&lt;p&gt;Here is an simple application in Scheme. It follows the approach proposed by Larry Hunter in his Statistical functions in Common Lisp (Version 1.01 July 27, 2001), except that we don&amp;rsquo;t use a lookup table for the p-value as can be found in certain versions available on the web. Instead, we use the incomplete Beta distribution discussed in &lt;a href="https://aliquote.org/post/student-approx/"&gt;previous&lt;/a&gt; &lt;a href="https://aliquote.org/post/computing-student-t/"&gt;posts&lt;/a&gt; which is available from the &lt;a href="https://www.gnu.org/software/gsl/doc/html/specfunc.html"&gt;GNU Scientific Library&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I will use Chicken Scheme since it is quite easy to use its FFI facilities (see, e.g., this post on the &lt;a href="https://aliquote.org/post/murmurhash/"&gt;Murmurhash&lt;/a&gt; algorithm). For CL users, &lt;a href="https://github.com/mrc/lhstats"&gt;Matt Curtis&lt;/a&gt; provide a standalone incomplete beta function in his port of Larry Hunter&amp;rsquo;s code. Fortunately, there&amp;rsquo;s also some &lt;a href="https://wiki.call-cc.org/eggref/5/statistics"&gt;Chicken code&lt;/a&gt; for the original Lisp code, provided by Peter Lane. Here&amp;rsquo;s the gist of it, using the interpreter (&lt;code&gt;csi&lt;/code&gt;):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;import&lt;/span&gt; &lt;span class="nv"&gt;statistics&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;t-test-two-sample&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt; &lt;span class="mi"&gt;11&lt;/span&gt; &lt;span class="mf"&gt;1.5&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt; &lt;span class="no"&gt;#f&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;0.0561191363596448&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Compare to the two-tailed p-value returned by Stata:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="n"&gt;ttesti&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt; &lt;span class="mi"&gt;11&lt;/span&gt; &lt;span class="mf"&gt;1.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;unequal&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Two&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;sample&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="n"&gt;test&lt;/span&gt; &lt;span class="n"&gt;with&lt;/span&gt; &lt;span class="n"&gt;unequal&lt;/span&gt; &lt;span class="n"&gt;variances&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;------------------------------------------------------------------------------&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;Obs&lt;/span&gt; &lt;span class="n"&gt;Mean&lt;/span&gt; &lt;span class="n"&gt;Std&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="n"&gt;Err&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="n"&gt;Std&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="n"&gt;Dev&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;95&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;Conf&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="n"&gt;Interval&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;---------+--------------------------------------------------------------------&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;4082483&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mf"&gt;11.15547&lt;/span&gt; &lt;span class="mf"&gt;12.84453&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt; &lt;span class="mi"&gt;11&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;3061862&lt;/span&gt; &lt;span class="mf"&gt;1.5&lt;/span&gt; &lt;span class="mf"&gt;10.36661&lt;/span&gt; &lt;span class="mf"&gt;11.63339&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;---------+--------------------------------------------------------------------&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;combined&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;48&lt;/span&gt; &lt;span class="mf"&gt;11.5&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;2627511&lt;/span&gt; &lt;span class="mf"&gt;1.820393&lt;/span&gt; &lt;span class="mf"&gt;10.97141&lt;/span&gt; &lt;span class="mf"&gt;12.02859&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;---------+--------------------------------------------------------------------&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;diff&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;5103104&lt;/span&gt; &lt;span class="o"&gt;-.&lt;/span&gt;&lt;span class="mi"&gt;0293791&lt;/span&gt; &lt;span class="mf"&gt;2.029379&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;------------------------------------------------------------------------------&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;diff&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1.9596&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Ho&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;diff&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="n"&gt;Satterthwaite&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;s degrees of freedom = 42.6558&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Ha&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;diff&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="n"&gt;Ha&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;diff&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="n"&gt;Ha&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;diff&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Pr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.9717&lt;/span&gt; &lt;span class="n"&gt;Pr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.0566&lt;/span&gt; &lt;span class="n"&gt;Pr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.0283&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now we would like to compute a 95% asymptotic confidence interval. According to Stata, using Satterthwaite&amp;rsquo;s approximation (42.7 df) it amounts to $[-0.0294;2.0294]$. Under the equal variance assumption (46 df), it is $[-.0272;2.0272]$. Not much of a difference between the two CIs. Here are the values computed using Scheme:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;pooled-sd&lt;/span&gt; &lt;span class="nv"&gt;s1&lt;/span&gt; &lt;span class="nv"&gt;n1&lt;/span&gt; &lt;span class="nv"&gt;s2&lt;/span&gt; &lt;span class="nv"&gt;n2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;sqrt &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;/ &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;+ &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;* &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;- &lt;/span&gt;&lt;span class="nv"&gt;n1&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;* &lt;/span&gt;&lt;span class="nv"&gt;s1&lt;/span&gt; &lt;span class="nv"&gt;s1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;* &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;- &lt;/span&gt;&lt;span class="nv"&gt;n2&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;* &lt;/span&gt;&lt;span class="nv"&gt;s2&lt;/span&gt; &lt;span class="nv"&gt;s2&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;+ &lt;/span&gt;&lt;span class="nv"&gt;n1&lt;/span&gt; &lt;span class="nv"&gt;n2&lt;/span&gt; &lt;span class="mi"&gt;-2&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="nv"&gt;sp&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;pooled-sd&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt; &lt;span class="mf"&gt;1.5&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We need to be careful when using the one-sample confidence interval routine (&lt;code&gt;normal-mean-ci&lt;/code&gt;), since it needs to get the right degrees of freedom. IT works great in the case of univariate statitics. The function reads:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;normal-mean-ci&lt;/span&gt; &lt;span class="nv"&gt;mean&lt;/span&gt; &lt;span class="nv"&gt;sd&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="nv"&gt;alpha&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let &lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;t-value&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;t-distribution&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;- &lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;- &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;/ &lt;/span&gt;&lt;span class="nv"&gt;alpha&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;values &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;- &lt;/span&gt;&lt;span class="nv"&gt;mean&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;* &lt;/span&gt;&lt;span class="nv"&gt;t-value&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;/ &lt;/span&gt;&lt;span class="nv"&gt;sd&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;sqrt &lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;+ &lt;/span&gt;&lt;span class="nv"&gt;mean&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;* &lt;/span&gt;&lt;span class="nv"&gt;t-value&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;/ &lt;/span&gt;&lt;span class="nv"&gt;sd&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;sqrt &lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)))))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In this case, the degree of freedom is the sample size minus 1, and the standard error is computed as &lt;code&gt;(/ sd (sqrt n))&lt;/code&gt;, which is defintely not what we want. The estimated standard error of the difference of means is the pooled SD, &lt;code&gt;sp&lt;/code&gt;, times $\sqrt{1/24 + 1/24}=\sqrt{1/12}$, in the case of equal variances. Hence the correct 95% CI is computed as follows:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="nv"&gt;se&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;* &lt;/span&gt;&lt;span class="nv"&gt;sp&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;sqrt &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;/ &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="nv"&gt;qt&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;t-distribution&lt;/span&gt; &lt;span class="mi"&gt;46&lt;/span&gt; &lt;span class="mf"&gt;0.975&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;values &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;- &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;* &lt;/span&gt;&lt;span class="nv"&gt;qt&lt;/span&gt; &lt;span class="nv"&gt;se&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;+ &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;* &lt;/span&gt;&lt;span class="nv"&gt;qt&lt;/span&gt; &lt;span class="nv"&gt;se&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;-0.0272016886019351&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;2.02720168860194&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Using separate variances, we would use the following standard error to compute te 95% CI:&lt;sup id="fnref:4"&gt;&lt;a href="#fn:4" class="footnote-ref" role="doc-noteref"&gt;4&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="nv"&gt;se&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;sqrt &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;+ &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;/ &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;* &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;/ &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;* &lt;/span&gt;&lt;span class="mf"&gt;1.5&lt;/span&gt; &lt;span class="mf"&gt;1.5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="nv"&gt;nu&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;/ &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;square&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;+ &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;/ &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;* &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;/ &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;* &lt;/span&gt;&lt;span class="mf"&gt;1.5&lt;/span&gt; &lt;span class="mf"&gt;1.5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;+ &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;/ &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;square&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;/ &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;* &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;- &lt;/span&gt;&lt;span class="mi"&gt;24&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;/ &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;square&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;/ &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;* &lt;/span&gt;&lt;span class="mf"&gt;1.5&lt;/span&gt; &lt;span class="mf"&gt;1.5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;- &lt;/span&gt;&lt;span class="mi"&gt;24&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="nv"&gt;qt&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;t-distribution&lt;/span&gt; &lt;span class="nv"&gt;nu&lt;/span&gt; &lt;span class="mf"&gt;0.975&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;values &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;- &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;* &lt;/span&gt;&lt;span class="nv"&gt;qt&lt;/span&gt; &lt;span class="nv"&gt;se&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;+ &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;* &lt;/span&gt;&lt;span class="nv"&gt;qt&lt;/span&gt; &lt;span class="nv"&gt;se&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;-0.0293791829211965&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;2.0293791829212&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This agrees with Stata&amp;rsquo;s summary table.&lt;/p&gt;
&lt;p&gt;Of course, it would be better to embed the computation of the confidence intervals into the testing procedure, which actually returns the p-value only.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Caroles Daughter • &lt;em&gt;My Mother Wants Me Dead&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;See the &lt;a href="https://en.wikipedia.org/wiki/Behrens%E2%80%93Fisher_problem"&gt;Behrens-Fisher problem&lt;/a&gt;.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;F. E. Satterthwaite (1946). An Approximate Distribution of Estimates of Variance Components. &lt;em&gt;Biometrics Bulletin&lt;/em&gt;, &lt;em&gt;2&lt;/em&gt;, 110-114.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:3"&gt;
&lt;p&gt;B. L. Welch (1947). The Generalization of Student&amp;rsquo;s Problem When Several Different Population Variances Are Involved. &lt;em&gt;Biometrika&lt;/em&gt;, &lt;em&gt;34&lt;/em&gt;, 28-35.&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:4"&gt;
&lt;p&gt;See William D. Dupont (2009). &lt;em&gt;Statistical Modeling for Biomedical Researchers&lt;/em&gt; (2nd ed.), Cambridge (p. 36).&amp;#160;&lt;a href="#fnref:4" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>NewLISP and memoization</title><link>https://aliquote.org/post/newlisp-memoization/</link><pubDate>Tue, 26 Jul 2022 11:37:04 +0200</pubDate><guid>https://aliquote.org/post/newlisp-memoization/</guid><description>&lt;p&gt;Surely, the Fibonacci recursive algorithm that is presented everywhere serves no purpose other than introducing the recursive way of thinking,&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; but anyway I&amp;rsquo;m here at writing another snippet of Lisp code to compute Fibonacci numbers. The real problem with those algorithms is that we are going to compute the same value over and over again. One solution is to rely on memoization, and in a &lt;a href="https://aliquote.org/post/on-memoization"&gt;previous post&lt;/a&gt; I discussed how to do so in Racket.&lt;/p&gt;
&lt;p&gt;Using typed Racket, I wrote:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;fib&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;Integer&lt;/span&gt; &lt;span class="nv"&gt;Integer&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="nv"&gt;fib&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;memoize&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda &lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="nv"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;Integer&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;&amp;lt; &lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;+ &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;fib&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;- &lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;fib&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;- &lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)))))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now, it appears that newLISP, which I&amp;rsquo;m playing with for the Summer, also comes with a &lt;a href="http://www.newlisp.org/downloads/CodePatterns.html#toc-5"&gt;memoization macro&lt;/a&gt;:&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;define&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;macro&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;memoize&lt;/span&gt; &lt;span class="n"&gt;mem&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="k"&gt;func&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;set&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sym&lt;/span&gt; &lt;span class="n"&gt;mem&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;mem&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;func&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;letex&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="n"&gt;mem&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;func&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lambda&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;apply&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;))))))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fibo&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fibo&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fibo&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;memoize&lt;/span&gt; &lt;span class="n"&gt;fibo&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="n"&gt;fibo&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The later expands to:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lambda&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;macro&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mem&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="k"&gt;func&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;set&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sym&lt;/span&gt; &lt;span class="n"&gt;mem&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;mem&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;func&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;letex&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="n"&gt;mem&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;func&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lambda&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;c&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;apply&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;))))))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lambda&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fibo&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fibo&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lambda&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt; &lt;span class="n"&gt;fibo&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt; &lt;span class="n"&gt;fibo&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;apply&lt;/span&gt; &lt;span class="n"&gt;fibo&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Benchmarking both functions is shown below:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;gt; (time (fibo 30))
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;339,198
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;gt; (time (fibo-m 30))
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;320,943
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;gt; (time (fibo-m 30))
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;0,012
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The execution time is almost instantaneous on the second run. Note, however, that it does not affect the first run, ince it first need to use a dedicated namespace to store intermediate results from recursive function calls.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Cigarettes After Sex • &lt;em&gt;Dreaming Of You&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;The same applies to the factorial, see, e.g., &lt;a href="https://eli.thegreenplace.net/2004/08/05/whats-up-with-the-factorial"&gt;what&amp;rsquo;s up with the factorial ?&lt;/a&gt;&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;The online documentation of NEWlisp reports that &amp;ldquo;when memoizing recursive functions, include the raw lambda specification of the function so recursive calls are memoized too&amp;rdquo;, which is what we did in our Racket example.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>ArXiving on July 2022</title><link>https://aliquote.org/post/arxiv-09/</link><pubDate>Sun, 24 Jul 2022 10:09:25 +0100</pubDate><guid>https://aliquote.org/post/arxiv-09/</guid><description>&lt;p&gt;Here are a few papers that I read over the past months, in the CS and Stat category as usual.&lt;/p&gt;
&lt;h3 id="marginal-effects-for-non-linear-prediction-functions-"&gt;Marginal Effects for Non-Linear Prediction Functions (&lt;a href="https://arxiv.org/abs/2201.08837"&gt;https://arxiv.org/abs/2201.08837&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;For everything related to &lt;a href="https://www.stata.com/features/overview/marginal-analysis/"&gt;marginal effects&lt;/a&gt;, I usually trust Stata margins command. By the way, there is a &lt;a href="https://www.stata.com/bookstore/interpreting-visualizing-regression-models/"&gt;dedicated book&lt;/a&gt; for this very useful command written by Michael N. Mitchell. The present article deals with estimating marginal effects in the case of non-linear models, which usually involves derivatives as discussed in an &lt;a href="https://aliquote.org/post/interaction-terms-in-nonlinear-models/"&gt;old post&lt;/a&gt;. Here the authors argue in favor of forward differences, hence the approach coined &amp;ldquo;forward marginal effects.&amp;rdquo;&lt;/p&gt;
&lt;h3 id="better-to-be-in-agreement-than-in-bad-company-a-critical-analysis-of-many-kappa-like-tests-assessing-one-million-2x2-contingency-tables-"&gt;Better to be in agreement than in bad company: a critical analysis of many kappa-like tests assessing one-million 2x2 contingency tables (&lt;a href="https://arxiv.org/abs/2203.09628"&gt;https://arxiv.org/abs/2203.09628&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;I once gave a &lt;a href="https://stats.stackexchange.com/a/4170/930"&gt;brief overview&lt;/a&gt; of recommend techniques for the cross tabulation of two categorical variables. This article goes a lot deeper by discussing agreement measures in 2x2 tables, inlcuding the cases of extreme tables where there&amp;rsquo;s a high level of agreement or a large imbalance between cells. The authors suggest that Holley and Guilford’s G and Gwet’s AC1 are the best candidates, among many other agreement measures (Cohen’s kappa, Pearson’s r, Yule’s Q and Y, Scott’s $\pi$, Shankar and Bangdiwala’s B, Dice’s F1 and McNemar’s $\chi^2$).&lt;/p&gt;
&lt;h3 id="selective-inference-for-k-means-clustering-"&gt;Selective inference for k-means clustering (&lt;a href="https://arxiv.org/abs/2203.15267"&gt;https://arxiv.org/abs/2203.15267&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;Unsupervised learning does not lead naturally to statistical inference, except maybe in the case of assessing clustering stability or choosing the optimal number of clusters. I discussed resampling-based appraoches in &lt;a href="https://aliquote.org/post/using-bootstrap-in-cluster-analysis/"&gt;another post&lt;/a&gt;. However, with added constraints like in &lt;a href="https://mclust-org.github.io/mclust/index.html"&gt;Mclust&lt;/a&gt;, we can work out the likelihood and optimize the number of clusters, for instance. Another inferential issue is that of testing whether cluster members differ on average on some attributes. Usually, we don&amp;rsquo;t test attributes that were used to build the partitioning: it is often meaningless since we are usually trying to maximize the separation between clusters based on those very specific attributes, and in any way this would lead to inflated Type I error rate. Most of the times, we establish and eventually test clustering profiles based on held out variables. In this paper, the authors propose a finite-sample p-value that controls the selective Type I error for a test of the difference in means between a pair of clusters obtained using k-means clustering.&lt;/p&gt;
&lt;h3 id="a-tutorial-for-using-propensity-score-weighting-for-moderation-analysis-an-application-to-smoking-disparities-among-lgb-adults-"&gt;A tutorial for using propensity score weighting for moderation analysis: an application to smoking disparities among LGB adults (&lt;a href="https://arxiv.org/abs/2204.03345"&gt;https://arxiv.org/abs/2204.03345&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;This aricle is in fact mostly a tutorial on moderation analysis using PS weighting, and illustrations in Stata (inline code) and R (external package) are provided.&lt;/p&gt;
&lt;h3 id="latent-trait-item-response-models-for-continuous-responses-"&gt;Latent Trait Item Response Models for Continuous Responses (&lt;a href="https://arxiv.org/abs/2204.03841"&gt;https://arxiv.org/abs/2204.03841&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;Usually, latent trait models apply to categorical response variable (dichotomous or polytomous items, or rating scales). The objective is to build a continuous score reflecting the position of an individual on the ltent trait being measured. For a more detailed overview, see &lt;a href="https://stats.stackexchange.com/a/31842/930"&gt;my answer&lt;/a&gt; on Cross Validated. This article deals with restricted continuous responses (e.g. positive only or interval-based responses), and extends &lt;a href="https://www.frontiersin.org/articles/10.3389/fpsyg.2019.00102/full"&gt;response time&lt;/a&gt; models.&lt;/p&gt;
&lt;h3 id="uniformly-valid-inference-based-on-the-lasso-in-linear-mixed-models-"&gt;Uniformly Valid Inference Based on the Lasso in Linear Mixed Models (&lt;a href="https://arxiv.org/abs/2204.03887"&gt;https://arxiv.org/abs/2204.03887&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;The authors use restricted maximum likelihood (REML) estimators to separate the estimation of the regression coefficients and covariance parameters in order to estimate fixed-effects with L1 penalization in Gaussian linear mixed models.&lt;/p&gt;
&lt;h3 id="the-replication-of-non-inferiority-and-equivalence-studies-"&gt;The replication of non-inferiority and equivalence studies (&lt;a href="https://arxiv.org/abs/2204.06960"&gt;https://arxiv.org/abs/2204.06960&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;The authors use the &lt;a href="https://pubmed.ncbi.nlm.nih.gov/9056588/"&gt;TOST&lt;/a&gt; technique to analyze replication equivalence studies. A &amp;ldquo;success interval&amp;rdquo; for the relative effect size is used to compare the replicate to the original study effect.&lt;/p&gt;
&lt;h3 id="flexible-marginal-models-for-dependent-data-"&gt;Flexible Marginal Models for Dependent Data (&lt;a href="https://arxiv.org/abs/2204.07188"&gt;https://arxiv.org/abs/2204.07188&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;An interesting paper to complement one &lt;a href="https://aliquote.org/pub/MDLD.pdf"&gt;companion textbook&lt;/a&gt; I worked on long time ago.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Benny Golson • &lt;em&gt;Little Karin&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Back to Matrix</title><link>https://aliquote.org/post/back-to-matrix/</link><pubDate>Sat, 23 Jul 2022 21:26:51 +0200</pubDate><guid>https://aliquote.org/post/back-to-matrix/</guid><description>&lt;p&gt;I&amp;rsquo;m back to &lt;a href="https://aliquote.org/post/matrix-riot/"&gt;Matrix&lt;/a&gt;, finally. Last time I interacted on the network was in 2021, from the web app, Element. Previously, I tried Riot.im on my MacBook. Now that Element is available as a Desktop app for Linux, I see no reason to use the web app and I happily spent a few time configuring Element on my Linux laptop. I had to quit the channels I joined through my IRC bouncer to avoid duplicating my identities on the IRC channels I&amp;rsquo;m usually following (#scheme, #chicken, #lisp, #commonlisp, #haskell, #clojure), and joined them again from Element after having being authentified on the IRC network (Libera.chat). The process is well described on various blogs or the Matrix documentation itself. From what I understood, a bot is spawned from the Matrix network onto the IRC network, and from there on acts as if it was you.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s been two years now that I&amp;rsquo;m logged on IRC every day. Although I have few interactions with others, I like it a lot better than all other chat applications I used before, except maybe chat rooms on Cross Validated from those days where I was still active there. I also deleted my Twitter account a few weeks ago. I haven&amp;rsquo;t had any interaction in years, and I think it simply wasn&amp;rsquo;t for me anymore. The only things left in the cloud are my Apple account and my Gmail which I only use as a catchup email service for some external providers now. Everything else has been deleted. There&amp;rsquo;re some online account that I probably forgot but they will be too, soon or later.&lt;/p&gt;
&lt;p&gt;So, why Matrix? As I said I like to stay using IRC but to keep up to date you either have to set up your own bouncer or rely on third-party ones. I&amp;rsquo;ve been very happy with BNC4FREE: you keep being logged in and get a backlog for the past 24 hours. You only need to connect once in a month, but of course you can launch your IRC application in the background on your local machine or a host server. I used both solutions, but finally I ended up spawning Irssi on my lab computer so it stays connected all time. The advantage of using the Matrix protocol is that you also stay connected all day and get a history of all messages (starting from the time you joined a channel). This also means you don&amp;rsquo;t need to have the application running in the background. And you get notification for free, via libnotify on Linux.&lt;/p&gt;
&lt;p&gt;About Element itself. The UI is nicely set up. Nothing too fancy, especially after it is configured using the IRC layout (this can be found in the general settings). I haven&amp;rsquo;t explored all settings since I just installed the app yesterday, but it looks promising, especially the additional features (see below). Here&amp;rsquo;s a screenshot of Element on my desktop, using the Nord color theme:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2022-07-24-16-45-49.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Compared to the previous version of Element, there&amp;rsquo;s now a &amp;ldquo;&lt;a href="https://github.com/vector-im/element-web/blob/develop/docs/labs.md"&gt;lab features&lt;/a&gt;&amp;rdquo; of some sort, so that you can enable further options. For instance, you can define your custom UI theme or use one of from &lt;a href="https://github.com/aaronraimist/element-themes/"&gt;GitHub&lt;/a&gt;. Note that you will need to add a configuration file, &lt;code&gt;$HOME/.config/Element/config.json&lt;/code&gt;, and not use the existing one (&lt;code&gt;$HOME/.config/Element/electron-config.json&lt;/code&gt;), including the option &lt;code&gt;&amp;quot;showLabsSettings&amp;quot;: true&lt;/code&gt; (camel case here, and not snake case as shown on GH). Here&amp;rsquo;s mine:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;settingDefaults&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;custom_themes&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;name&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Nord dark theme&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;is_dark&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;colors&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;accent-color&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;#a3be8c&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;primary-color&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;#88c0d0&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;warning-color&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;#bf616a&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;sidebar-color&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;#2e3440&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;roomlist-background-color&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;#3b4252&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;roomlist-text-color&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;#ebcb8b&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;roomlist-text-secondary-color&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;#e5e9f0&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;roomlist-highlights-color&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;#2e3440&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;roomlist-separator-color&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;#434c5e&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;timeline-background-color&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;#434c5e&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;timeline-text-color&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;#eceff4&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;secondary-content&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;#eceff4&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;tertiary-content&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;#eceff4&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;timeline-text-secondary-color&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;#81a1c1&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;timeline-highlights-color&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;#3b4252&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;reaction-row-button-selected-bg-color&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;#bf616a&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;showLabsSettings&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ BADBADNOTGOOD • &lt;em&gt;Signal from the Noise&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Logistic fit in Mathematica</title><link>https://aliquote.org/post/logistic-fit-mathematica/</link><pubDate>Tue, 19 Jul 2022 16:04:23 +0200</pubDate><guid>https://aliquote.org/post/logistic-fit-mathematica/</guid><description>&lt;p&gt;In an &lt;a href="https://aliquote.org/post/newton-raphson-racket/"&gt;older post&lt;/a&gt; I showed how we could fit a Logistic regression using Racket builtin linear algebra routines.&lt;/p&gt;
&lt;p&gt;It is not difficult to import a CSV file and get a working Table for a Logistic regression model, or any other model from the Exponential family really. Here&amp;rsquo;s how I did for the classical low birth weight dataset from Hosmer &amp;amp; Lemeshow&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;, where I consider a single predictor (age of the mother):&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Import&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;~/Documents/work/tutors/CESAM/cours/Stata/birthwt2.csv&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;;;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;}]];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;GeneralizedLinearModelFit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ExponentialFamily&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Binomial&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note that we could also use &lt;code&gt;SemanticImport&lt;/code&gt; to get a &amp;ldquo;Dataset&amp;rdquo; structured array, but since it is not callable from &lt;code&gt;GeneralizedLinearModelFit&lt;/code&gt;, let&amp;rsquo;s stay with classical list of lists. From here now, almost all we need is now available in our &amp;ldquo;FittedModel&amp;rdquo; &lt;code&gt;m&lt;/code&gt;, and we can even display the regression equation using the following incantation:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Normal&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now, what I really want is to display the logistic fitted curve together with observed proportions of low birth weights (&amp;lt; 2.5 kg) at each decile of age (see my other post to get an idea of this observed vs. fitted proportion display). In Mathematica, there are some grouping and binning functions (&lt;code&gt;AggregatedEntityClass&lt;/code&gt;, &lt;code&gt;SplitBy&lt;/code&gt;, &lt;code&gt;GatherBy&lt;/code&gt;, &lt;code&gt;BinLists&lt;/code&gt;, &lt;code&gt;BinCounts&lt;/code&gt;) or one could also rely on &lt;a href="https://mathematica.stackexchange.com/a/127734/167"&gt;histogram binning&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;First we need to add a column indicating to which decile each value of age belongs to. Here is my solution, which relies on the empirical distribution function instead of the &lt;code&gt;Quantile&lt;/code&gt; function. This is partly inspired by a solution proposed by &lt;a href="https://mathematica.stackexchange.com/a/42000/167"&gt;Sjoerd C. de Vries&lt;/a&gt; to a similar problem:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ecdf&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;EmpiricalDistribution&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="n"&gt;All&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]]];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;x_&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;CDF&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ecdf&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Floor&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;qvalues&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Map&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="n"&gt;All&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]]];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;qvalues&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;qvalues&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/.&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c"&gt;(* FIXME: account for max value *)&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here, an instruction like &lt;code&gt;MapThread[Append, {dt, qvalues}]&lt;/code&gt; will simply append a new column holding the decile index for each row. We would like, however, to replace each decile index with the corresponding class center from the real values, which can be computed as follows:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;tens&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Quantile&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="n"&gt;All&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Range&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;.1&lt;/span&gt;&lt;span class="p"&gt;]];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;centers&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Total&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="n"&gt;Most&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;tens&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Differences&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;tens&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;}];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then, we need a replacement rule to tell Mathematica how to perform the desired mapping:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;SetAttributes&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Listable&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;a_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;b_&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Finally, we will add a new column to our data set to reflect class membership for each observation, and plot both the prediction and the mean observed frequencies for each decile:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;MapThread&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Append&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;qvalues&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/.&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Table&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;}],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;centers&lt;/span&gt;&lt;span class="p"&gt;]}]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;obs&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;GroupBy&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Sort&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="n"&gt;All&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;;;&lt;/span&gt;&lt;span class="p"&gt;]]],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Last&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;First&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Mean&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Show&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ListPlot&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;obs&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Plot&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;14&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;45&lt;/span&gt;&lt;span class="p"&gt;}],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;AxesLabel&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Age&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Pr(low)&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/birthwt_glm.png"&gt;
&lt;/figure&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Daft Punk • &lt;em&gt;Da Funk&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;David W. Hosmer and Stanley Lemeshow, &lt;em&gt;Applied Logistic Regression&lt;/em&gt;, Wiley, 2000.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;Note that the response variable comes last, unlike Stata&amp;rsquo;s model formulation.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>The unquantified self #24</title><link>https://aliquote.org/post/unquantified-self-024/</link><pubDate>Sun, 17 Jul 2022 16:12:24 +0200</pubDate><guid>https://aliquote.org/post/unquantified-self-024/</guid><description>&lt;p&gt;I just finished watching &lt;a href="https://en.wikipedia.org/wiki/Sense8"&gt;Sense8&lt;/a&gt; (Seasons 1 and 2). It is a great TV show that I highly recommend. I&amp;rsquo;m now looking for the next serie that will be as entertaining as this one. For the moment, I&amp;rsquo;m watching &lt;a href="https://en.wikipedia.org/wiki/3%25"&gt;3%&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m fiddling with Lisp and Scheme when I have some free time. Of course, I&amp;rsquo;m using Neovim for editing Lisp code and I yet have to write a blog post about that, but I don&amp;rsquo;t miss Emacs. Trust me, Neovim is quite a decent editor for Lisp code by any standards. Meanwhile, I&amp;rsquo;m reading or re-reading some good books on Lisp, and even flame wars on Hacker News from time to time. My idea remains the same: doing everything I used to perform in R or Stata with Lisp or Scheme. This may eventually take a decade or two, most probably.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m on vacation for the whole month of July but I need to rest. I don&amp;rsquo;t waste my time though since I spend a good part of my days &lt;a href="https://aliquote.org/post/saint-malo/"&gt;traveling&lt;/a&gt; or cooking. Some ideas of appetizers below:&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_2037.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_2037.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_2066.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_2066.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_2084.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_2084.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;I also managed to get back to reading books more regularly than at the beginning of the year. I still don&amp;rsquo;t read enough in my opinion but I&amp;rsquo;m trying to correct that so that I can have decent statistics by the end of the year. One of my recent discoveries amazed me for a few days (I always need more time to absorb poetry than novels or essays):&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Je suis cassée comme un automate&lt;br&gt;
à la jambe fendue avance,&lt;br&gt;
en grinçant, sur une seule patte.&lt;br&gt;
Quoi qu&amp;rsquo;il en soit,&lt;br&gt;
il continue. On le croirait ivre.&lt;br&gt;
De son dos, il a su arracher la clé ;&lt;br&gt;
il n&amp;rsquo;a plus besoin, c&amp;rsquo;est fini, d&amp;rsquo;être remonté.&lt;br&gt;&lt;/p&gt;
&lt;p&gt;&amp;mdash; Cécile Coulon, Les ronces&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I also have some books to review in some future posts, including &lt;em&gt;Successful Lisp&lt;/em&gt;, &lt;em&gt;Paradigms of Artificial Intelligence Programming&lt;/em&gt;, or &lt;em&gt;Quickstart Molecular Biology&lt;/em&gt;. And a long list of TODOs to cleanup at some point&amp;hellip;&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Arlo Parks • &lt;em&gt;Too Good&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Sequences in Lisp</title><link>https://aliquote.org/post/sequences-in-lisp/</link><pubDate>Sat, 16 Jul 2022 19:35:36 +0200</pubDate><guid>https://aliquote.org/post/sequences-in-lisp/</guid><description>&lt;p&gt;In Common Lisp, sequences are made of lists, vectors, strings and [maybe other things]. In short, these are ordered &lt;a href="https://gigamonkeys.com/book/collections.html"&gt;collections&lt;/a&gt; of elements (or items for short). You can define a generic sequence using &lt;code&gt;maque-sequence&lt;/code&gt;, or rely on specialized functions (&lt;code&gt;make-list&lt;/code&gt;, &lt;code&gt;make-array&lt;/code&gt;,&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; &lt;code&gt;list&lt;/code&gt;, &lt;code&gt;vector&lt;/code&gt;, etc.) as shown below:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defparameter&lt;/span&gt; &lt;span class="vg"&gt;*x*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;make-sequence&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;vector&lt;/span&gt; &lt;span class="kt"&gt;double-float&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="ss"&gt;:initial-element&lt;/span&gt; &lt;span class="mf"&gt;1d0&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;*&lt;/span&gt; &lt;span class="vg"&gt;*x*&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;#(&lt;/span&gt;&lt;span class="mf"&gt;1.0d0&lt;/span&gt; &lt;span class="mf"&gt;1.0d0&lt;/span&gt; &lt;span class="mf"&gt;1.0d0&lt;/span&gt; &lt;span class="mf"&gt;1.0d0&lt;/span&gt; &lt;span class="mf"&gt;1.0d0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;vector&lt;/span&gt; &lt;span class="mf"&gt;1d0&lt;/span&gt; &lt;span class="mf"&gt;1d0&lt;/span&gt; &lt;span class="mf"&gt;1d0&lt;/span&gt; &lt;span class="mf"&gt;1d0&lt;/span&gt; &lt;span class="mf"&gt;1d0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;#(&lt;/span&gt;&lt;span class="mf"&gt;1.0d0&lt;/span&gt; &lt;span class="mf"&gt;1.0d0&lt;/span&gt; &lt;span class="mf"&gt;1.0d0&lt;/span&gt; &lt;span class="mf"&gt;1.0d0&lt;/span&gt; &lt;span class="mf"&gt;1.0d0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note that although they look the same, &lt;code&gt;make-sequence&lt;/code&gt; in this case returned an array, and not a simple vector like &lt;code&gt;vector&lt;/code&gt;. Also note that I&amp;rsquo;m using SBCL REPL so that &lt;code&gt;**&lt;/code&gt; means the last computed result.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;equalp&lt;/span&gt; &lt;span class="vg"&gt;*x*&lt;/span&gt; &lt;span class="nv"&gt;**&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="no"&gt;nil&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;type-of&lt;/span&gt; &lt;span class="vg"&gt;*x*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;simple-array&lt;/span&gt; &lt;span class="kt"&gt;double-float&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To generate a regular sequence à la Python&amp;rsquo;s &lt;code&gt;range&lt;/code&gt; function, we could define the following function:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defun&lt;/span&gt; &lt;span class="nv"&gt;iseq&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;end&lt;/span&gt; &lt;span class="k"&gt;&amp;amp;optional&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;start&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;step&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;loop&lt;/span&gt; &lt;span class="ss"&gt;:for&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="ss"&gt;:from&lt;/span&gt; &lt;span class="nv"&gt;start&lt;/span&gt; &lt;span class="ss"&gt;:below&lt;/span&gt; &lt;span class="nv"&gt;end&lt;/span&gt; &lt;span class="ss"&gt;:by&lt;/span&gt; &lt;span class="nb"&gt;step&lt;/span&gt; &lt;span class="ss"&gt;:collect&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;iseq&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;iseq&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will only work for numbers, of course. While playing with &lt;a href="http://www.newlisp.org/"&gt;newLISP&lt;/a&gt;, I learned that there&amp;rsquo;s a builtin &lt;code&gt;sequence&lt;/code&gt; function there, which works like LispStat&amp;rsquo;s &lt;code&gt;iseq&lt;/code&gt;:&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;setq&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;sequence&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;length&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mi"&gt;5&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mi"&gt;4&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;There&amp;rsquo;s even a &lt;code&gt;series&lt;/code&gt; function to create a geometric sequence of numbers. As shown in the above example, subsetting is a breeze (this is called implicit indexing per the &lt;a href="http://www.newlisp.org/ExpressionEvaluation.html"&gt;documentation&lt;/a&gt;), but there&amp;rsquo;s more: slicing a list or an array is even easier than in most Lisp-like languages I know, except perhaps Clojure using &lt;code&gt;subvec&lt;/code&gt; provided you&amp;rsquo;re using vectors:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Of course, we could do the same with arrays as shown below:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;setq&lt;/span&gt; &lt;span class="nv"&gt;z&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;array&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="nv"&gt;z&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="nv"&gt;z&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I think I&amp;rsquo;ll need to investigate more into this dialect to see if toy examples from LispStat could be ported to newLISP. Despite all the &lt;a href="https://hn.algolia.com/?q=newlisp"&gt;criticisms&lt;/a&gt; we can found on HN, I believe newLISP provides a handy way of writing quick scripts in Lisp, but see &lt;a href="https://lmf-ramblings.blogspot.com/2011/08/i-am-not-afraid-to-admit-that-ive-used.html"&gt;I am not afraid to admit that I&amp;rsquo;ve used Lisp for real work&lt;/a&gt;. See also &lt;a href="https://eli.thegreenplace.net/2006/04/20/newlisp-an-intriguing-dialect-of-lisp"&gt;newlisp - an intriguing dialect of Lisp&lt;/a&gt;, by Eli Bendersky, which also summarizes the point raised above. Other candidates on my list are PicoLisp and Janet. Stay tuned.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ As Animals • &lt;em&gt;By My Side&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;See also &lt;a href="https://tamaspapp.eu/post/common-lisp-to-julia/"&gt;this warning&lt;/a&gt; about portable scientific code in CL, especially when dealing with arrays.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;Or various implementation of the &lt;code&gt;iota&lt;/code&gt; function in CL, e.g. &lt;a href="https://dnaeon.github.io/generating-sequences-in-common-lisp/"&gt;Generating sequences in Common Lisp&lt;/a&gt; or the &lt;a href="https://quickref.common-lisp.net/alexandria.html"&gt;Alexandria&lt;/a&gt; library.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Saint-Malo</title><link>https://aliquote.org/post/saint-malo/</link><pubDate>Fri, 15 Jul 2022 21:12:31 +0200</pubDate><guid>https://aliquote.org/post/saint-malo/</guid><description>&lt;p&gt;De retour d&amp;rsquo;un petit séjour bien agréable avec mon fils à Saint-Malo. Nous avons eu beau temps, et surtout des températures beaucoup plus clémentes qu&amp;rsquo;en région parisienne. Nous avons quitté Saint-Malo le mercredi en fin d&amp;rsquo;après-midi par 24°C et nous sommes arrivés à Paris à 20h où il faisait encore 35°C !&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_2131.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_2131.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_2134.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_2134.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Cette petite escapade nous a fait un bien fou. La mer était magnifique, et les galettes excellentes comme il se doit en Bretagne. Nous étions déjà allés à Saint-Malo chacun de notre côté, lui il y a quelques années avec sa mère et moi lorsque j&amp;rsquo;étais enfant avec mes parents. S&amp;rsquo;y retrouver tous les deux, après tant d&amp;rsquo;années sans vraies vacances à la mer, a été un vrai bonheur.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/IMG_2160.JPG"&gt;
&lt;/figure&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Louis Ville &amp;amp; Mell • &lt;em&gt;Hôtel Pourri&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Palindromic numbers in Mathematica</title><link>https://aliquote.org/post/palindromic-number/</link><pubDate>Thu, 07 Jul 2022 21:13:59 +0200</pubDate><guid>https://aliquote.org/post/palindromic-number/</guid><description>&lt;p&gt;I described some of my solutions to Project Euler in &lt;a href="https://aliquote.org/tags/euler/"&gt;several posts&lt;/a&gt; I wrote in 2019. I&amp;rsquo;m now revisiting some of the code while playing with Mathematica. Indeed, Mathematica is an interesting language that is starting to interest me more than just for making small calculations or graphics on the fly. And it looks like many languages remind me of Stata &amp;ndash; delayed evaluation for Mathematica, command abbreviations for VimL.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://projecteuler.net/problem=4"&gt;Problem 4&lt;/a&gt; reads:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. Find the largest palindrome made from the product of two 3-digit numbers.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;With the Racket code provided in this &lt;a href="https://aliquote.org/post/numeric-palindrome/"&gt;previous post&lt;/a&gt;, I used the following &lt;code&gt;for*/list&lt;/code&gt; construct to compute the solution using brute force:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;apply&lt;/span&gt; &lt;span class="nb"&gt;max&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;for*/list&lt;/span&gt; &lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;in-range&lt;/span&gt; &lt;span class="mi"&gt;999&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="mi"&gt;-1&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;in-range&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="mi"&gt;-1&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;#:when&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;palindrome?&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Computers are fast enough nowadays, although there are &lt;a href="https://blog.dreamshire.com/solutions/project_euler/project-euler-problem-004-solution/"&gt;subtle optimizations&lt;/a&gt; available for such problems. Anyway, this means two functions and a main loop. Here is the same code in Mathematica, in short form without any consideration for optimization:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;IsPalindrome&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;x_&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;IntegerDigits&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Reverse&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;IntegerDigits&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Max&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Select&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Flatten&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Table&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;999&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;999&lt;/span&gt;&lt;span class="p"&gt;}]],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;IsPalindrome&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I like the functional route we can take with Mathematica, although it&amp;rsquo;s slighty slower than Racket code in this case.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Adam Wakeman • &lt;em&gt;Pristina&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>On consulting</title><link>https://aliquote.org/post/on-consulting/</link><pubDate>Thu, 30 Jun 2022 21:01:49 +0200</pubDate><guid>https://aliquote.org/post/on-consulting/</guid><description>&lt;p&gt;I have been working as a full-time statistical consultant (mostly in biomedical research) for something like 13 years. Sometimes I miss the job, but in the end I&amp;rsquo;m better served where I am now. The academic world is worth what it is worth, but when you are looking for a quiet place it is one of the best options. Consulting is both challenging and entertaining: you learn a lot, often in a short period of time, which means you get continuing education (almost) for free, and your network will rapidly grow provided your work is appreciated, which means you get a lot more opportunities, hence you may become more demanding when selecting new projects. I already mentioned this in a &lt;a href="https://aliquote.org/post/consulting/"&gt;previous post&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;After 13 years I had a serious accident that forced me to review my perspectives both professionally and from a more personal point of view. Concerning the first point, it turned out that I was getting tired of repeating the same thing over and over again to the doctors I was interacting with, not to mention the fact that from then on I was going to find myself in the position of a patient for a good part of my days.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; But the real problem, it seems to me, is that at a certain point it becomes difficult to take the place of the principal investigator and to suggest alternative interpretations of the results. My job was to organize and analyze the data with sound statistical methods. It&amp;rsquo;s not that I didn&amp;rsquo;t care that much about what they might do with the results afterwards, but honestly that was not part of my job. I&amp;rsquo;m willing to learn a lot about domains I was not trained in, but it would be hard to become a specialist in each new domain in a few months, right? And finally, I was most often involved at later stages of clinical studies. You know the famous adage:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. &amp;mdash; Sir R. A. Fisher&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;They rarely consulted me before carrying out their studies, so I was left with the eventually flawed design, and already collected data to analyze. No prior power analysis, no interim analysis, and so on. I always did the best I could do given the context, and I believe no one was ever unhappy with my job. However, I felt something was broken in this workflow. You get paid for analyzing data, without being involved in the design of the study, results come afterwards and people ask to carry out subgroup analysis or devise new hypotheses to explain or at least exploit unattended results. First it sounds at an angle with scientific reasoning, second I&amp;rsquo;m surely not the right person to ask. I ended up believing that some people would benefit from taking a course in experimental design and causal inference.&lt;/p&gt;
&lt;p&gt;A few days ago, I came across an &lt;a href="https://sinews.siam.org/Details-Page/a-conversation-with-mathematical-consultant-john-d-cook"&gt;interview with John D. Cook&lt;/a&gt; where he described his move to mathematical consulting after years in Academia and work in private sector. He has better words than me regarding part of the specific issue I mentioned above:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Applied statistics may be closer to epistemology than mathematics. You have to question what you know, why you think you know it, and how confident you are (or should be) in that knowledge. You must make simplifying assumptions and determine whether they are justified. Statistical modeling is hard to do well. It’s easy to write down a model if you’re not overly concerned with the accuracy of your results. As the old saying goes, fools rush in where angels fear to tread.&lt;br&gt; Sometimes I get to work on statistical problems with crisp mathematical statements, such as finding an efficient way to compute something. These projects are fun because the epistemological concerns are someone else’s responsibility.&lt;br&gt; My work in applied mathematics has been more objective than my work in statistics. When you’re dealing with voltages or velocities, what you’re measuring (and what it means) is pretty clear. There’s much less anxiety around modeling, and your level of success at the end is usually obvious. I prefer mathematical work, but there are more statistical opportunities in consulting. These days I often hand over statistical projects to someone else; I work on statistical problems about data privacy but am moving away from medical statistics.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Gerald Clayton • &lt;em&gt;Like Water&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;I spent a total of 10 weeks in intensive care type hospitalization over a period of 5 months, 7 of which were consecutive.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in June</title><link>https://aliquote.org/post/micro-06-2022/</link><pubDate>Tue, 28 Jun 2022 21:12:40 +0200</pubDate><guid>https://aliquote.org/post/micro-06-2022/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-06-01&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Saying that I’ve been maintaining my dotfiles for a decade is like saying that I’ve been decorating my home for a decade. I probably know what works for me, but that doesn’t mean I know what you’ll like! &amp;mdash; &lt;a href="https://evanhahn.com/a-decade-of-dotfiles/"&gt;A decade of dotfiles&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-06-01&lt;/a&gt;: &lt;a href="https://coredumped.dev/2022/05/19/a-vision-of-a-multi-threaded-emacs/"&gt;A vision of a multi-threaded Emacs&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-06-07&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Swamp Children, &lt;em&gt;Taste What&amp;rsquo;s Rhythm&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-06-14&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Miley Cyrus, &lt;em&gt;Nothing Else Matters&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-06-14&lt;/a&gt;: Now I know that even installing the &lt;code&gt;rms&lt;/code&gt; package implies crap packages from so-called &amp;ldquo;modern R&amp;rdquo;&amp;hellip;&lt;img src="https://aliquote.org/img/2022-06-14-21-22-37.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-06-15&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Lydia Loveless, &lt;em&gt;Let&amp;rsquo;s Make Out&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-06-16&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;(&amp;hellip;) being overly tense works against giving your best performance. &amp;mdash; &lt;a href="https://eugeneyan.com/writing/when-giving-your-100-gets-you-less-than-85/"&gt;The 85% Rule - When Giving It Your 100% Gets You Less than 85%&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-06-16&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Even with a lot of help from a good text editor, writing HTML can be a drag. Nice documents end up as tag-swamps with little bits of content perched atop hills of tabs. &amp;mdash; &lt;a href="https://lofi.limo/blog/write-html-right"&gt;Write HTML Right&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-06-16&lt;/a&gt;: &lt;a href="https://hplgit.github.io/bioinf-py/doc/pub/html/main_bioinf.html"&gt;Illustrating Python via Bioinformatics Examples&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-06-16&lt;/a&gt;: &lt;a href="https://lhbg-book.link/"&gt;Learn Haskell by building a blog generator&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-06-17&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Enrico Rava Quartet, &lt;em&gt;Choctaw&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-06-17&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;While it’s tempting to switch to one of the endless new apps out there, there are good reasons to trust old tools. &amp;mdash; &lt;a href="https://tylercipriani.com/blog/2022/06/15/choose-boring-desktop-technology/"&gt;Cool desktops don’t change&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-06-17&lt;/a&gt;: Run any code on any client. With WebAssembly and &lt;a href="https://wasmer.io/"&gt;Wasmer&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-06-17&lt;/a&gt;: &lt;a href="https://www.tfeb.org/fragments/2022/03/22/two-understandable-deficiencies-in-common-lisp/"&gt;Two understandable deficiencies in Common Lisp&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-06-17&lt;/a&gt;: &lt;a href="https://github.com/dspinellis/unix-history-repo"&gt;Unix History Repository&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-06-19&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Meredith Brooks, &lt;em&gt;Bitch&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-06-25&lt;/a&gt;: And another round of cleansing for my Neovim setup: down to 15 plugins now (the screenshot below includes &lt;code&gt;popup.nvim&lt;/code&gt; which is no longer needed).&lt;br&gt;&lt;img src="https://aliquote.org/img/2022-06-25-20-03-46.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-06-25&lt;/a&gt;: Just started watching &lt;a href="https://en.wikipedia.org/wiki/Sense8"&gt;Sense8&lt;/a&gt; a few days ago. Looks great so far. It&amp;rsquo;s the fourth TV shows I watch after a long break (December 2021).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-06-25&lt;/a&gt;: Time to quit, I guess.&lt;br&gt;&lt;img src="https://aliquote.org/img/2022-06-25-19-57-26.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-06-25&lt;/a&gt;: &lt;a href="https://chidiwilliams.com/post/crafting-interpreters-a-review/"&gt;Crafting Interpreters: A Review&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-06-25&lt;/a&gt;: &lt;a href="https://ohshitgit.com/"&gt;Oh Shit, Git!?!&lt;/a&gt;. &lt;code&gt;#git&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-06-27&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Iggy Pop, &lt;em&gt;Some Weird Sin&lt;/em&gt;.&lt;br&gt;&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ XXX • &lt;em&gt;XXX&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>June in review</title><link>https://aliquote.org/post/micro-review-019/</link><pubDate>Sat, 25 Jun 2022 21:08:13 +0200</pubDate><guid>https://aliquote.org/post/micro-review-019/</guid><description>&lt;p&gt;Things from the internet that I heard about recently, a &lt;a href="https://aliquote.org/post/micro-review-018/"&gt;year after&lt;/a&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;If I weren&amp;rsquo;t so satisfied of my &lt;a href="https://aliquote.org/post/welcome-ubuntu/"&gt;current laptop&lt;/a&gt;, I would surely look for another one from System76: &lt;a href="https://system76.com/laptops/lemur"&gt;this one&lt;/a&gt;, for example, looks gorgeous in terms of specs.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://rhodesmill.org/brandon/2009/commands-with-comma/"&gt;Start all of your commands with a comma&lt;/a&gt;: I like the idea of distinguishing user commands from system commands, but I find it weird to prefix all of them with a comma. Perl or Emacs Lisp users are used to use the &lt;code&gt;my&lt;/code&gt; prefix, I guess, and Zsh has underscore for builtin functions.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://pyscript.net/"&gt;https://pyscript.net/&lt;/a&gt; looks great. Wasm is the way to go IMHO, and it is surely as promising as the Electron framework some years ago. BTW, &lt;a href="https://github.blog/2022-06-08-sunsetting-atom/"&gt;atom is dead&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://effective-shell.com/"&gt;Effective Shell&lt;/a&gt;. As they said: &amp;ldquo;This book is for anyone who is interested in computing, and wants to learn more about the exciting, but sometimes daunting world of The Shell.&amp;rdquo;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://til.simonwillison.net/sqlite/one-line-csv-operations"&gt;One-liner for running queries against CSV files with SQLite&lt;/a&gt;. Interesting tibbits. Together with &lt;a href="https://github.com/multiprocessio/dsq"&gt;dsq&lt;/a&gt;, there&amp;rsquo;s plenty of opportunity to run SQL queries on flat files from the command-line.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you feel nostalgic at times, you can always download the &lt;a href="https://www.gryphel.com/c/minivmac/download.html"&gt;mini vMac 36.04&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.jackfranklin.co.uk/blog/using-ftplugin-in-vim/"&gt;Using ftplugin to tidy my Vim configuration&lt;/a&gt;. I used it a lot too:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;~/.config/nvim % tree after
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;after
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;└── ftplugin
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── bib.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── cmake.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── css.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── c.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── gitcommit.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── haskell.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── help.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── lisp.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── lua.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── markdown.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── org.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── python.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── qf.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── racket.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── rmd.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── rnoweb.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── rust.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── r.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── scheme.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── sql.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── stata.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── text.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── tex.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── vim.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; └── zsh.vim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="m"&gt;1&lt;/span&gt; directory, &lt;span class="m"&gt;25&lt;/span&gt; files
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.alexdebrie.com/posts/database-consistency/"&gt;Inconsistent thoughts on database consistency&lt;/a&gt;. I used to do a lot more SQL back in the days, so whenever I came across a post about SQL or NoSQL database I read it. This one is about consistency in ditributed DBs, which may be understodd differently depending on the point of view of the reader.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;Your language isn’t broken, it’s doing floating point math. Computers can only natively store integers, so they need some way of representing decimal numbers. This representation is not perfectly accurate. This is why, more often than not, 0.1 + 0.2 != 0.3. &amp;mdash; &lt;a href="https://0.30000000000000004.com/"&gt;Floating Point Math&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ The Clash • &lt;em&gt;Groovy Times&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Org and Beamer</title><link>https://aliquote.org/post/org-and-beamer/</link><pubDate>Thu, 23 Jun 2022 22:36:50 +0200</pubDate><guid>https://aliquote.org/post/org-and-beamer/</guid><description>&lt;p&gt;A few days ago, I decided to rewrite a MArkdown template that I occasionally use for talks or courses. Part of this has already been discussed in an &lt;a href="https://aliquote.org/post/new-pandoc-template/"&gt;another post&lt;/a&gt;. Since I always found Org documents better than Markdown ones, I wanted an Org template much like I have a template for &lt;a href="https://aliquote.org/post/emacs-org-tufte-handout/"&gt;short handouts&lt;/a&gt;. I followed the same idea and I created a small shell script that I call from a terminal or from a Vim shortcut:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#!/usr/bin/env bash
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;FILE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;ELISP&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;/home/chl/Documents/notes/assets/org-beamer.el&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;emacs --batch -l &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$ELISP&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; --eval &lt;span class="s2"&gt;&amp;#34;(progn (find-file \&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$FILE&lt;/span&gt;&lt;span class="s2"&gt;\&amp;#34;) (org-beamer-export-to-pdf))&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;org-beamer.el&lt;/code&gt; file holds all the default settings I wish to use. I changed things a bit, especially the main fonts. I could use xelatex or lualatex as before, but after all Bitstream Vera is a nice sans serif font, and it comes with builtin math support thanks via the &lt;a href="https://www.ctan.org/pkg/arev"&gt;arev&lt;/a&gt; package. My Emacs Lisp setup file now basically reads: (I skipped basic settings and org-babel related stuff.)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-emacs-lisp" data-lang="emacs-lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;eval-after-load&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;ox-latex&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;add-to-list&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;org-latex-classes&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;beamer&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;\\documentclass[presentation,9pt]{beamer}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\usepackage{arev}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\usepackage[backend=bibtex,style=numeric-comp,citestyle=numeric-comp,autocite=plain]{biblatex}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\addbibresource{/home/chl/Documents/notes/references.bib}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\usecolortheme[named=black]{structure}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\setbeamertemplate{navigation symbols}{}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\makeatletter
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\setbeamertemplate{title page}[default][left,colsep=-4bp]
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\makeatother
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\usepackage{tcolorbox}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\usepackage{textcomp}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\usepackage{ragged2e}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\usepackage{listings}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\definecolor{SlateGrey}{HTML}{708090}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\definecolor{CornflowerBlue}{HTML}{6495ed}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\definecolor{SandyBrown}{HTML}{f4a460}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\definecolor{White}{HTML}{ffffff}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\usepackage[font={color=SlateGrey,small}]{caption}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\setbeamercolor{frametitle}{bg=SlateGrey,fg=White}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\setbeamercolor{alerted text}{fg=SlateGrey}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\setbeamertemplate{itemize items}{\\scalebox{1.4}{\\raisebox{-.25ex}{\\text{\\textbullet}}}}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\addtobeamertemplate{block begin}{}{\\justifying\\small\\sffamily}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\captionsetup[figure]{labelformat=empty}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\captionsetup[table]{labelformat=empty}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\captionsetup[lstlisting]{labelformat=empty}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\renewcommand{\\textbf}{\\alert}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\definecolor{low}{named}{SandyBrown}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\definecolor{high}{named}{CornflowerBlue}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\newtcbox{\\texthigh}{nobeforeafter,colframe=high!15!white,colback=high!5!white,boxrule=0.5pt,arc=4pt,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; boxsep=0pt,left=2pt,right=2pt,top=2pt,bottom=2pt,tcbox raise base}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\newtcbox{\\textlow}{nobeforeafter,colframe=low!15!white,colback=low!5!white,boxrule=0.5pt,arc=4pt,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; boxsep=0pt,left=2pt,right=2pt,top=2pt,bottom=2pt,tcbox raise base}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\newcommand{\\mathhigh}[1]{\\textcolor{high}{#1}}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\newcommand{\\mathlow}[1]{\\textcolor{low}{#1}}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\newcommand{\\goto}[2]{\\quad\\hyperlink{#1}{\\beamerbutton{#2}}}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\renewcommand{\\footnoterule}{%
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\kern -3pt
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; {\\color{SlateGrey}\\hrule width \\textwidth height .25pt}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\kern 2.5pt
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\renewcommand{\\footnotesize}{\\scriptsize}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\author{\\url{https://aliquote.org}\\\\ \\url{mailto:chl@aliquote.org}}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\lstset{
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; basicstyle=\\small\\ttfamily,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; commentstyle=\\color{SlateGrey}\\textit,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; numbers=left,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; stepnumber=1,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; numbersep=8pt,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; numberfirstline=true,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; firstnumber=1,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; numberstyle=\\color{SlateGrey}\\footnotesize{},
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; captionpos=t,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; abovecaptionskip=3ex,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; aboveskip=20pt,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; identifierstyle=\\ttfamily,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; keywordstyle=\\ttfamily,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; escapeinside={(*@}{@*)}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; [NO-DEFAULT-PACKAGES]
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; [PACKAGES]
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; [EXTRA]&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;\\section{%s}&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;\\section*{%s}&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;\\subsection{%s}&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;\\subsection*{%s}&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;\\subsubsection{%s}&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;\\subsubsection*{%s}&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;\\paragraph{%s}&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;\\paragraph*{%s}&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;\\subparagraph{%s}&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;\\subparagraph*{%s}&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Short preview below.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-06-24-21-39-39.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-06-24-21-39-39.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-06-24-21-40-07.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-06-24-21-40-07.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-06-24-21-40-13.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-06-24-21-40-13.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;After having reviewed the new features of Context I do not exclude the idea of returning to pure tex slides soon, though. I still have some handouts to read.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-06-24-21-44-30-1.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-06-24-21-44-30-1.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-06-24-21-44-43.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-06-24-21-44-43.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-06-24-21-45-15.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-06-24-21-45-15.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Meredith Brooks • &lt;em&gt;Bitch&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>20 years with R: A retrospective</title><link>https://aliquote.org/post/r-retrospective/</link><pubDate>Tue, 14 Jun 2022 09:03:52 +0200</pubDate><guid>https://aliquote.org/post/r-retrospective/</guid><description>&lt;p&gt;I gave my first statistics lecture using R almost 20 years ago. At that time, I mostly working on behavioral data and R appeared as nice replacement for Statistica or SPSS. At that time, Octave was not as good a pretender to MATLAB as it is nowadays, and Python&amp;rsquo;s data stack has not even started. Old times good times. That was really exciting to dive into a new programming languages dedicated to applied statistics, with a dedicated graphical device, a vibrant community of senior statisticians, and a central repository of packages modeled after CTAN and CPAN.&lt;/p&gt;
&lt;p&gt;However, I lately became tired of all the new ways of doing R these days, and how the intrusion of modern packages impact at various degree the way I liked to do things in R. Although R has gained some popularity thanks to those packages, the whole ecosystem has been impacted, IMHO. I noticed there are now some hot debate between proponents of base R and those who prefer the tidyverse, much like the old R vs. Python flame that emerged 5 to 10 years ago. It&amp;rsquo;s probably time to stop worrying about all those things since I rarely need R these days, after all. But something is going on, for sure.&lt;/p&gt;
&lt;p&gt;Here are a series of plots I made in R for statistical reports, articles, and handouts. That&amp;rsquo;s it (for the retrospective).&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-4"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-06-14-09-53-12.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-06-14-09-53-12.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-4"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-06-14-09-54-11.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-06-14-09-54-11.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-4"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-06-14-09-55-09.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-06-14-09-55-09.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-4"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-06-14-10-17-36.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-06-14-10-17-36.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-4"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-06-14-09-59-07.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-06-14-09-59-07.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-4"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-06-14-10-00-12.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-06-14-10-00-12.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-4"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-06-14-10-02-06.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-06-14-10-02-06.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-4"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-06-14-10-18-30.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-06-14-10-18-30.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-06-14-10-16-50.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-06-14-10-16-50.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-06-14-10-06-13.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-06-14-10-06-13.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-06-14-10-07-58.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-06-14-10-07-58.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-4"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-06-14-10-09-04.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-06-14-10-09-04.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-4"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-06-14-10-13-54.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-06-14-10-13-54.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-4"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-06-14-10-16-08.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-06-14-10-16-08.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-4"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-06-14-10-05-29.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-06-14-10-05-29.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-4"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-06-14-10-29-04.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-06-14-10-29-04.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-4"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-06-14-10-29-43.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-06-14-10-29-43.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-4"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-06-14-10-30-45.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-06-14-10-30-45.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-4"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-06-14-10-30-59.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-06-14-10-30-59.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;On a related point, I recently started drafting a short tutorial on how not to use &amp;ldquo;modern R&amp;rdquo; tools, and then I came across Frank Harrell&amp;rsquo;s excellent handout on his &lt;a href="https://www.fharrell.com/post/rflow"&gt;R workflow&lt;/a&gt;. Since I was going to make the apology of his packages, I think it&amp;rsquo;s best to start working on another handout. I will leave the foreword untouched below.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Although the tidyverse provides lot of packages that may be useful to perform common data preparation and univariate or multivariate statistical summaries, other solutions do exist. I am pretty confident that base-only R packages have been developed since I last used R for intensive data analysis (I can think of &lt;a href="https://github.com/strengejacke"&gt;strengejacke&lt;/a&gt;&amp;rsquo;s packages for data visualization and data manipulation, for instance), but the &lt;a href="https://cran.r-project.org/web/packages/Hmisc/"&gt;Hmisc&lt;/a&gt; packages existed long before &lt;a href="https://cran.r-project.org/web/packages/plyr/"&gt;plyr&lt;/a&gt;, then &lt;a href="https://cran.r-project.org/web/packages/dplyr/"&gt;dplyr&lt;/a&gt;, were published on CRAN, and it already worked pretty well. It&amp;rsquo;s still the best piece of software ever written for R after &lt;a href="https://cran.r-project.org/web/packages/MASS/"&gt;MASS&lt;/a&gt;, in my view. Together with the &lt;a href="https://cran.r-project.org/web/packages/rms/"&gt;rms&lt;/a&gt; and &lt;a href="https://ggplot2.tidyverse.org/"&gt;ggplot2&lt;/a&gt; packages, you will get the data munging triumvirate almost for free. Almost because you will have to learn a lot and to choose wisely among the numerous options. In addition, remember that &amp;ldquo;&lt;a href="https://www.tinyverse.org/"&gt;lightweight is the right weight&lt;/a&gt;&amp;rdquo;. If you can perform 80% of your tasks with three packages and builtin stuff, then you&amp;rsquo;re on the right side of the Pareto law. Here&amp;rsquo;s your starter kit for Hmisc.&lt;/p&gt;
&lt;p&gt;Disclaimer: I have nothing against the tidyverse way of doing things (I just barely understand why we really need another &amp;ldquo;rlang&amp;rdquo;, and I regret the problems of &lt;a href="https://dirk.eddelbuettel.com/blog/2018/02/28/"&gt;reverse dependencies&lt;/a&gt; that it may have caused in the past). If that suits your needs, that&amp;rsquo;s all fine. If on the contrary you get stuck on basic data manipulation stuff, or built-in one-liner R functions don&amp;rsquo;t play well with &amp;ldquo;tibble&amp;rdquo;, then you&amp;rsquo;re probably going in the wrong direction. Start with Phil Spector&amp;rsquo;s textbook \cite{spector-2008-data-manip-r}, then eventually learn a bit of plyr \cite{wickham-2011-split-apply}. The 80% of time spent in data manipulation, as we use to say, is not a joke: You will likely spend most of your time switching from long to wide format, aggregating data all over again and again, and not just before even you start building your super nice statistical model.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2023-01-04]&lt;/small&gt;&lt;br&gt;
See also Norm Matloff&amp;rsquo;s take on the tidyverse: &lt;a href="https://github.com/matloff/TidyverseSkeptic"&gt;Teach Base-R, Not Just the Tidyverse&lt;/a&gt;.
&lt;/div&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ IAMDDB • &lt;em&gt;Silver Lines&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Du paradoxe des anniversaires</title><link>https://aliquote.org/post/paradoxe-anniversaires/</link><pubDate>Sun, 12 Jun 2022 21:20:39 +0200</pubDate><guid>https://aliquote.org/post/paradoxe-anniversaires/</guid><description>&lt;p&gt;Petite note de synthèse rédigée à l&amp;rsquo;attention de mon fils pour son grand oral du BAC.&lt;/p&gt;
&lt;p&gt;Le paradoxe des anniversaires, qui n&amp;rsquo;en est pas vraiment un, s&amp;rsquo;intéresse à la probabilité que deux personnes soient nées le même jour, plus précisément au nombre de personnes que l&amp;rsquo;on doit interroger avant que la probabilité de rencontrer deux personnes nées le même jour soit supérieure ou égale à 50 %.&lt;/p&gt;
&lt;p&gt;Les hypothèses que l&amp;rsquo;on fera sont les suivantes : l&amp;rsquo;année comporte 365 jours et on néglige les années bisextiles.&lt;/p&gt;
&lt;p&gt;On notera $p(n)$ la probabilité que au moins deux personnes prises parmi $n$ soient nées le même jour, et $n(p)$ le nombre de personnes nécessaires pour obtenir une probabilité $p$ donnée.&lt;/p&gt;
&lt;p&gt;Le paradoxe vient du fait que les gens s&amp;rsquo;imaginent que la probabilité recherchée porte sur l&amp;rsquo;événement &amp;ldquo;deux personnes sont nées un même jour donné&amp;rdquo;, comme dans la question &amp;ldquo;quelle est la probabilté que le jour du grand oral de maths tombe le jour de mon anniversaire, en supposant que celui-ci puisse être organisé n&amp;rsquo;importe quel jour de l&amp;rsquo;année&amp;rdquo;. On va considérer le complémentaire de cette probabilité, ce qui nous évite d&amp;rsquo;énumérer tous les cas, et le soustraire de 1, et on dénotera $n$ le nombre de personnes attendues. On cherche donc $n$ tel que :&lt;/p&gt;
&lt;p&gt;$$ 1-\left(\frac{364}{365}\right)^n = \frac{1}{2}. $$&lt;/p&gt;
&lt;p&gt;La résolution de cette équation montre que si $n=253$, alors la probabilité recherchée est $&amp;gt; 1/2$. Qu&amp;rsquo;en est-il s&amp;rsquo;il l&amp;rsquo;on ne considère pas de date d&amp;rsquo;anniversaire fixe dans l&amp;rsquo;année ? C&amp;rsquo;est le problème énoncé plus haut.&lt;/p&gt;
&lt;p&gt;Le plus simple est encore une fois de passer par le complémentaire en se demandant quelle est la probabilité que toutes les personnes interrogées ait un jour d&amp;rsquo;anniversaire différent.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; Par dénombrement, on constate que le nombre de cas où $n$ personnes ont des anniversaires différents équivaut à un arrangement de $n$ objets pris parmi 365, soit $\frac{365!}{(365-n)!}$. Pour chaque personne il y a 365 possibilités de jour d&amp;rsquo;anniversaire, et donc comme il y a $n$ personnes il y a au total $365^n$ choix possibles. Le nombre de cas où $n$ personnes ont des anniversaires différents divisé par le nombre de possibilités donne donc la probabilité que tout le monde soit né un jour différent. Le complémentaire de cette probabilité équivaut à la probabilité de l&amp;rsquo;événement &amp;ldquo;au moins deux personnes sont nées le même jour&amp;rdquo;, soit :&lt;/p&gt;
&lt;p&gt;$$ p(n) = 1 - \frac{365!}{(365-n)!} \cdot \frac{1}{365^n}. $$&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;In&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;365&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="mi"&gt;365-23&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="mi"&gt;365&lt;/span&gt;&lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="mi"&gt;23&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.507297&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;In&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;k_&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;365&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="mi"&gt;365&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="mi"&gt;365&lt;/span&gt;&lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Plot&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;GridLines&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="mi"&gt;23&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;23&lt;/span&gt;&lt;span class="p"&gt;]}}];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Table&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;22&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Out&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mf"&gt;0.475695&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;0.507297&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;0.538344&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;0.5687&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;^^^^^^^^&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/fig-birthday.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/fig-birthday.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;L&amp;rsquo;expression $p(n)$ ci-dessus peut être approximée par $1-e^{-\frac{n^2}{2|E|}}$. Cette approximation s&amp;rsquo;obtient par le développement limité de $e^x = 1 + x + \mathcal{o}(x)$ pour $x$ au voisinage de 0. Comme discuté sur Wikipédia, ceci donne une approximation du nombre de personnes nécessaires pour avoir une probabilité $p$ d&amp;rsquo;observer au moins deux personnes avec le même jour d&amp;rsquo;anniversaire :&lt;/p&gt;
&lt;p&gt;$$ n(p) \approx \sqrt{2\cdot 365\;\text{ln}\left(\frac{1}{1-p}\right)}. $$&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;In&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;k_&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Sqrt&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;365&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Log&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)]];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Table&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.1&lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Out&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mf"&gt;19.3107&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;22.4944&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;25.863&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;^^^^^^^&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Il existe d&amp;rsquo;autres approximations, et également d&amp;rsquo;autres façon de poser le problème (p.ex., nombre moyen de personnes nécessaires pour observer une paire d&amp;rsquo;anniversaires identiques, en supposant un échantillonnage avec ou sans remise).&lt;/p&gt;
&lt;p&gt;Le paradoxe des anniversaires trouve des applications dans divers domaines, puisqu&amp;rsquo;il suffit de remplacer le concept de jour d&amp;rsquo;anniversaire par n&amp;rsquo;importe quel élément pris dans un entier dénombrable, par exemple des mots de passe générés aléatoirement.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;p&gt;&lt;small&gt;[2022-06-13]&lt;/small&gt;&lt;br&gt;
Exemples d&amp;rsquo;application en bioinformatique :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.biorxiv.org/content/10.1101/2020.12.02.407999v2"&gt;Quantifying bacterial evolution in the wild: a birthday problem for Campylobacter lineages&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://europepmc.org/article/PMC/3361375"&gt;Degenerate Primer IDs and the birthday problem&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pubmed.ncbi.nlm.nih.gov/26239817/"&gt;The genomic birthday paradox: how much is enough? &lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ The Vaselines • &lt;em&gt;Jesus Wants Me for a Sunbeam&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Le paradoxe des anniversaires se généralise au problème suivant : si l&amp;rsquo;on considère un ensemble $E$ fini, quelle est la probabilité $p(n)$ que parmi $n$ éléments tirés uniformément et de manière indépendante dans $E$, deux éléments au moins soient identiques. On montre que celle-ci vaut :
$$ p(n) = 1 - \frac{|E|!}{(|E|-n)!} \cdot \frac{1}{|E|^n}. $$&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Rhythmbox</title><link>https://aliquote.org/post/rhythmbox/</link><pubDate>Sat, 11 Jun 2022 17:59:02 +0200</pubDate><guid>https://aliquote.org/post/rhythmbox/</guid><description>&lt;p&gt;I&amp;rsquo;ve been a faithful user of &lt;a href="https://cmus.github.io/"&gt;cmus&lt;/a&gt; for the past two years. It is fast and responsive, it handles tons of music with no worries, and it is quite easy to configure. Using &lt;a href="https://github.com/Arkq/cmusfm"&gt;cmusfm&lt;/a&gt;, we can even scrobble the tracks we listen to to Last.fm, and it all works great.&lt;/p&gt;
&lt;p&gt;Since I upgraded to Ubuntu 22.04 LTS I decided to try another music player. I&amp;rsquo;ve been trying Audacious on i3, but that&amp;rsquo;s was just to try it out. Last week, I decided to give Rhythmbox a try. I think it should normally be instaled on a full-featured Ubuntu distro, like Libreoffice, Thunderbird and the like. Since I decided to install the bare essentials, I don&amp;rsquo;t have default application for managing media files on Ubuntu.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2022-09-29]&lt;/small&gt;&lt;br&gt;
TIL about &lt;a href="https://wiki.gnome.org/Apps/Lollypop"&gt;Lollypop&lt;/a&gt; (via &lt;a href="https://www.reddit.com/r/linux/comments/8kmero/linux_needs_a_really_good_music_player/"&gt;Reddit&lt;/a&gt;), which also seems to handle metadata quite well, and provides audio scrobbling facilities. There apparently is the &lt;a href="https://sayonara-player.com/"&gt;Sayonara player&lt;/a&gt; in the race as well.
&lt;/div&gt;
&lt;p&gt;I imported my main libraries into Rhythmbox with no problem at all. All tracks were correctly classified by author/album/genre apparently. I could check with &lt;a href="https://beets.readthedocs.io/en/stable/"&gt;beets&lt;/a&gt;, except that it no longer works since I switched to Python 3.10. I then created new playlists using the following command, for each playlist folder:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;~/Media/Music/garbage % find . -name &lt;span class="s2"&gt;&amp;#34;*.mp3&amp;#34;&lt;/span&gt; -type f &lt;span class="p"&gt;|&lt;/span&gt; shuf &amp;gt; garbage.m3u
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I activated the Last.fm plugin and installed (later on) the &lt;a href="https://github.com/BramBonne/LastfmPlaycount"&gt;LastfmPlaycount&lt;/a&gt; 3rd party plugin. This allows me to get a synchronized view of my lsitening activities from Last.fm, which also means I would get desynchronized track counts when switching back and forth between cmus and Rhythmbox, unless I found something equivalent for cmus. Anyway, I&amp;rsquo;ve been using Rhythmox as my daily music player for two weeks now, and I&amp;rsquo;m pretty happy with it. The current song that is being played is nicely displayed in the notification widget in the middle of the top bar (I forgot about its name), with basic control (start/pause, previous/next track, and the album cover). Same happens when using Rhythmbox: you get a small album cover art that you can hover on, classification by genre, artist, and so on. Everything you would expect from a basic music player in fact.&lt;/p&gt;
&lt;p&gt;The advantage of usign Last.fm to get my track counts is that it doesn&amp;rsquo;t matter whether some tracks are included on more than one playlists, unlike cmus whose playcount is really a physical track count. In other words, I&amp;rsquo;m seeing an increase in my all-time playcount as I write this post. Meanwhile, I&amp;rsquo;m slowly updating track counts by listening to my music library again and again. Not a bad deal after all.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-06-12-20-55-54.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-06-12-20-55-54.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-06-12-20-38-51.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-06-12-20-38-51.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Timo Lassy • &lt;em&gt;Mountain Man Exit&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Computing the inverse CDF of a Gaussian</title><link>https://aliquote.org/post/computing-inverse-cdf-gaussian/</link><pubDate>Wed, 08 Jun 2022 16:08:28 +0200</pubDate><guid>https://aliquote.org/post/computing-inverse-cdf-gaussian/</guid><description>&lt;p&gt;There&amp;rsquo;s no closed-form solution to the inverse CDF for the normal distribution, also known as the &amp;ldquo;quantile&amp;rdquo; function, that was discussed in a &lt;a href="https://aliquote.org/post/inverse-cdf-random-sampling/"&gt;previous post&lt;/a&gt;. By glancing at the statistics module from &lt;a href="https://github.com/python/cpython"&gt;CPython&lt;/a&gt;, I noticed the authors actually rely on the rational approximation described in Wichura&amp;rsquo;s Algorithm AS 241: The Percentage Points of the Normal Distribution.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;The same algorithm is used by the authors of the Racket &lt;a href="https://docs.racket-lang.org/math/"&gt;math&lt;/a&gt; module, with an additional remark:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Added asymptotic expansions to increase range when given log probabilities, and a Newton iteration to fix up answers in the tricky spot between -20000 and -744.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Note that test cases are provided in the original article such that you can easily verify that your own implementation provides the expected results:&lt;/p&gt;
&lt;p&gt;$$
\begin{equation}
\begin{aligned}
z_{0.25} &amp;amp;= -0.6744897501960817,\cr
z_{0.001} &amp;amp;= -3.090232306167814,\cr
z_{10^{-20}} &amp;amp;= -9.262340089798408\cr
\end{aligned}
\end{equation}
$$&lt;/p&gt;
&lt;p&gt;Here is what I got from Racket:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;require&lt;/span&gt; &lt;span class="nv"&gt;math/distributions&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;for&lt;/span&gt; &lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="nv"&gt;q&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;in-list&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.25&lt;/span&gt; &lt;span class="mf"&gt;0.001&lt;/span&gt; &lt;span class="mf"&gt;10.0&lt;/span&gt;&lt;span class="nv"&gt;e-20&lt;/span&gt;&lt;span class="p"&gt;))])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;displayln&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;flnormal-inv-cdf&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt; &lt;span class="nv"&gt;q&lt;/span&gt; &lt;span class="no"&gt;#f&lt;/span&gt; &lt;span class="no"&gt;#f&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;-0.6744897501960817&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;-3.090232306167813&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;-9.013271153126675&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The last value does not agree with test values provided in the reference paper, and I got the same results in R using &lt;code&gt;qnorm(10e-20)&lt;/code&gt;).&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; When working with very low p-values, or when you suspect that something could get wrong with floating-point arithmetic, it&amp;rsquo;s always wise to double check the result you get. Mathematica, for instance, returns the expected result:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;InverseCDF&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;NormalDistribution&lt;/span&gt;&lt;span class="p"&gt;[],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="mi"&gt;-20&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Out&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;-9.262340089798408&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I learned a long time ago that for everything related to statistical distributions, it&amp;rsquo;s always worth double checking with Mathematica.&lt;/p&gt;
&lt;p&gt;On a related point, in the case of R, some strange things may happen, although the authors usually took care of the details for you. For instance, there&amp;rsquo;s a &lt;code&gt;lower.tail&lt;/code&gt; argument to the &lt;code&gt;p*&lt;/code&gt; and &lt;code&gt;q*&lt;/code&gt; family functions, which allows to correct for catastrophic cancellation; it even works when distribution are not symmetric (otherwise we could simply use &lt;code&gt;qnorm(1-p)&lt;/code&gt;).&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Shawn Mullins • &lt;em&gt;Lullaby&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Wichura, Michael J. Algorithm AS 241: The Percentage Points of the Normal Distribution. Journal of the Royal Statistical Society. Series C (Applied Statistics), 37(3): 477-484 (1988). &lt;a href="https://csg.sph.umich.edu/abecasis/gas_power_calculator/algorithm-as-241-the-percentage-points-of-the-normal-distribution.pdf"&gt;PDF&lt;/a&gt;&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;Same for Stata (&lt;code&gt;invnormal(10e-20)&lt;/code&gt;), or Python using scipy (&lt;code&gt;norm.ppf(10e-20)&lt;/code&gt;).&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Ubuntu 22.04</title><link>https://aliquote.org/post/ubuntu-22-04/</link><pubDate>Mon, 06 Jun 2022 20:59:59 +0200</pubDate><guid>https://aliquote.org/post/ubuntu-22-04/</guid><description>&lt;p&gt;In a &lt;a href="https://aliquote.org/post/unquantified-self-023/"&gt;recent post&lt;/a&gt;, I said that I will probably upgrade my Ubuntu soon or later. The day after I published it I finally did it. It took me a few hours to upgrade my laptop full of useless applications and libraries installed all along the last year, but finally I got the welcome screen before lunch. There are many reviews available on the web, so I will just mention what I did and what I find the most interesting updates for my use cases.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;There are important updates to the kernel, glibc and various other system libraries, but I noticed that now clang and Python are versions 14.0 and 3.10.4. Python 3.10 is supposed to be faster than previous versions, but I didn&amp;rsquo;t run any benchmarks so far. Nothing new regarding Neovim: still at version 0.6 from the official apt repositories, so I&amp;rsquo;m using the Neovim PPA for the unstable version.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The window manager has been improved, IMHO. The calendar widget is able to display all events stored in Gnome calendar, there&amp;rsquo;s a processor scheduler that can alternate between energy saving and high performance policy, and virtual desktops are now displayed horizontally rather than vertically. Gnome screen capture got a few enhancements as well.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-06-06-21-17-53.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-06-06-21-17-53.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-06-06-21-18-06.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-06-06-21-18-06.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;I deleted a bunch of unused or defunct applications, including Docker and bitlbee. I also manually cleanup up the old LLVM files that came with the previous installation of Ubuntu 20.04 and that were not cleaned up during the upgrade process. Finally, I re enabled Tracker, which I disabled a while ago, and some default settings, which I also disabled for i3 and Regolith desktop. I did not reinstall the Snap store. In fact, I deleted everything related to snap when I configured my laptop the first time, and then never looked back. At this point, I don&amp;rsquo;t even know how to reinstall snap on my machine.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;There were some quircks here and there: IPython was not happy with the missing Qt backend for matplotlib, so I now use &lt;code&gt;matplotlib.use(&amp;quot;GTK4Cairo&amp;quot;)&lt;/code&gt; instead, which is not a bad idea after all. Of course, switching to Python 3.10 instead of 3.8 also means that I had to reinstall every little applications that sit in my &lt;code&gt;$HOME/.local/bin&lt;/code&gt; folder, mostly from &lt;code&gt;pip3 install --user&lt;/code&gt;. To remap the CAPS lock key to &lt;Esc&gt;, I was previously invoking &lt;code&gt;setxkbmap -option caps:escape&lt;/code&gt; in my shell init scripts. This no longer works under Wayland, but I discovered that you can just ask Gnome shell to do that for you: &lt;code&gt;gsettings set org.gnome.desktop.input-sources xkb-options &amp;quot;['caps:escape']&amp;quot;&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I spent another couple hours fixing my Hugo theme, which stopped working with version 0.92. I am now aware of the fact: after each update of Hugo something goes wrong. I had not encountered such problem the last two years since I was on the 20.04 LTS, which means no update at all for most applications. However, I tor my hair out for a long time with rolling release on Apple Homebrew. Anyway, I fixed it, again, and now I hope we are quiet for some long months.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I also managed to install the &lt;a href="https://github.com/EliverLara/Nordic"&gt;Nordic&lt;/a&gt; theme, which is beautiful (especially compared to the default dark theme in Ubuntu) and reminds me of the one I had when I was using Regolith desktop. I didn&amp;rsquo;t reinstalled it yet, since I want write to try the default settings yet another time again.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Big Spider&amp;rsquo;s Back • &lt;em&gt;Black Chow&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Kopia backup</title><link>https://aliquote.org/post/kopia/</link><pubDate>Sun, 05 Jun 2022 20:36:43 +0200</pubDate><guid>https://aliquote.org/post/kopia/</guid><description>&lt;p&gt;For everything related to backup I used to use &lt;a href="https://www.arqbackup.com/"&gt;Arq&lt;/a&gt; back in my Apple days. I tried Borg on both Apple and Ubuntu, and I also tried &lt;a href="https://aliquote.org/post/timeshift-backup/"&gt;Timeshift&lt;/a&gt;, but finally I decided to use Duplicity and deja-dup for my weekly backup on Ubuntu 20.04. It worked well, although the cache files took a lot of place. At that time I was backing up my entire &lt;code&gt;$HOME&lt;/code&gt; system on an external HD connected on an USB-C port. I didn&amp;rsquo;t add a cron task for that and I managed to launch the backup process more or less carefully every Sunday.&lt;/p&gt;
&lt;p&gt;A week ago, I deleted my &lt;code&gt;~/.local/share&lt;/code&gt; folder by mistake. Fortunately, I was able to recover everything thanks to those weekly backups. However, the only way to recover this specific folder from Duplicity snapshots was to extract the full snapshot in a temporary folder and stopped the extraction process when I noticed that the folder in question was extracted. I was in a hurry, there may be a better option or better tool to use than deja-dup. Unlike Arq, there does not seem to be an easy way to view the inner structure of each snapshot.&lt;/p&gt;
&lt;p&gt;Yesterday, I decided to give &lt;a href="https://kopia.io/"&gt;Kopia&lt;/a&gt; a try. It uses deduplication, compression, encryption &amp;mdash; all the state of the art in terms of backup strategies. Moreover it allows to list all snapshots, mount them on your local filesystem, diff one snapshot against the other, and restore any snaphot with a few commands or via a nice GUI (&lt;a href="https://kopia.io/docs/release-notes/v0.9/#ui-changes"&gt;Kopia UI&lt;/a&gt;). Of course, you can set exclusion rules, schedule how often snapshots are taken, and so on. Finally, you can synchronize your local backup with other sources, like an external HD or a local home server. I choose to backup my HOME directory on my HOME directory, and to synchronize it to an external HD, while previously I only use external HD to store my backup. This way, I have a local copy from which I can restore anything if something goes wrong &amp;ndash; no need to take my external HD with me, and I use deduplication with the sftp transfer protocol. The documentation is also excellent, and there&amp;rsquo;s a &lt;a href="https://kopia.discourse.group"&gt;Discourse&lt;/a&gt; group.&lt;/p&gt;
&lt;p&gt;One thing I noticed is that it is blazing fast, especially compared to deja-dup.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; I excluded static folders which are unlikely to change more than once a week (pictures, music, and PDFs) and I ended up with a 30 Go backup repository.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;~ % du -sh ./* &lt;span class="p"&gt;|&lt;/span&gt; sort -h
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;364K ./bin
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;1,7G ./tmp
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2,1G ./Sites
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;6,0G ./cwd
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;6,9G ./Documents
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;18G ./Images
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;33G ./backup
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;74G ./Media
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I&amp;rsquo;m aware of the &lt;a href="https://www.backblaze.com/blog/the-3-2-1-backup-strategy/"&gt;3-2-1&lt;/a&gt; backup strategy, except that I no longer use any offsite storage (Dropbox or Google, previously). I&amp;rsquo;m expecting to setup a central backup on a NAS, and a local copy on an external HD. I also have a cron job to schedule backup every hour, with default retention policy (48 hourly snapshots are kept in the central repository).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;~ % kopia snapshot list
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;chl@aliquote:/home/chl
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 2022-06-05 19:05:21 CEST k295d3d6f42eeb3fa08c5d47e58af91bf 58.4 GB drwxr-xr-x files:504927 dirs:73697 &lt;span class="o"&gt;(&lt;/span&gt;hourly-17,daily-3,weekly-2&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 2022-06-06 20:22:20 CEST k96b2fb21131fbbfc0815dd5fb373a763 &lt;span class="m"&gt;44&lt;/span&gt; GB drwxr-xr-x files:506393 dirs:73202 &lt;span class="o"&gt;(&lt;/span&gt;hourly-16&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 2022-06-06 21:00:02 CEST kf916e1b0c60fa4f409a42684fb93019a &lt;span class="m"&gt;44&lt;/span&gt; GB drwxr-xr-x files:506629 dirs:73202 &lt;span class="o"&gt;(&lt;/span&gt;hourly-15&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 2022-06-06 22:00:01 CEST k728bb034a39a4ff650182b3059d49991 &lt;span class="m"&gt;44&lt;/span&gt; GB drwxr-xr-x files:506712 dirs:73203 &lt;span class="o"&gt;(&lt;/span&gt;hourly-14&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 2022-06-06 23:00:01 CEST k5f4017166b44946ca6259a4ae17f1e38 &lt;span class="m"&gt;44&lt;/span&gt; GB drwxr-xr-x files:506714 dirs:73203 &lt;span class="o"&gt;(&lt;/span&gt;hourly-13,daily-2&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 2022-06-07 00:00:01 CEST kbf3b9941f81be51b1165cfb6806b4251 44.1 GB drwxr-xr-x files:506716 dirs:73203 &lt;span class="o"&gt;(&lt;/span&gt;hourly-12&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 2022-06-07 01:00:01 CEST k97b62af55128160101b828d76e26256c 44.1 GB drwxr-xr-x files:506718 dirs:73203 &lt;span class="o"&gt;(&lt;/span&gt;hourly-11&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 2022-06-07 02:00:01 CEST k39386d816ded10cbc656a2e4c161e1bc 44.1 GB drwxr-xr-x files:506720 dirs:73203 &lt;span class="o"&gt;(&lt;/span&gt;latest-10,hourly-10&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 2022-06-07 03:00:01 CEST kc012f6b2bf5e8678e89b5d891603a168 44.1 GB drwxr-xr-x files:506722 dirs:73203 &lt;span class="o"&gt;(&lt;/span&gt;latest-9,hourly-9&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 2022-06-07 04:00:01 CEST k8947a49d41f253dd2938d29ffbd7f1a3 44.1 GB drwxr-xr-x files:506724 dirs:73203 &lt;span class="o"&gt;(&lt;/span&gt;latest-8,hourly-8&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 2022-06-07 05:00:02 CEST ka91ca4f30e5411edfa2ff196a4e0905f 44.1 GB drwxr-xr-x files:506726 dirs:73203 &lt;span class="o"&gt;(&lt;/span&gt;latest-7,hourly-7&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 2022-06-07 06:00:01 CEST k19705c3b296d13670f0cc9ac7e91ffb5 44.2 GB drwxr-xr-x files:506728 dirs:73203 &lt;span class="o"&gt;(&lt;/span&gt;latest-6,hourly-6&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 2022-06-07 07:00:02 CEST kadc58cb442efbd727441de745cbebd13 44.2 GB drwxr-xr-x files:506730 dirs:73203 &lt;span class="o"&gt;(&lt;/span&gt;latest-5,hourly-5&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 2022-06-07 08:00:01 CEST kdb87258b93ae8e3d3d83ac5a4d281426 44.2 GB drwxr-xr-x files:506973 dirs:73244 &lt;span class="o"&gt;(&lt;/span&gt;latest-4,hourly-4&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 2022-06-07 10:00:01 CEST k7d9b1c6f0d746e9b9ffdb63011299a2c 44.2 GB drwxr-xr-x files:507123 dirs:73244 &lt;span class="o"&gt;(&lt;/span&gt;latest-3,hourly-3&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 2022-06-07 11:00:01 CEST k22b5115235d9dceb0ec9f204be6e3ae7 44.3 GB drwxr-xr-x files:507782 dirs:73254 &lt;span class="o"&gt;(&lt;/span&gt;latest-2,hourly-2&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 2022-06-07 12:00:01 CEST k7dc38129e4011ef6c0e870e220094459 44.3 GB drwxr-xr-x files:507743 dirs:73229 &lt;span class="o"&gt;(&lt;/span&gt;latest-1,hourly-1,daily-1,weekly-1,monthly-1,annual-1&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It all looks very promising. I&amp;rsquo;m waiting to see what happens next, especially in case of accidental deletions or corruptions.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2022-08-25]&lt;/small&gt;&lt;br&gt;
Small update: I effectiveley had to use Kopia to restore some files that were accidently deleted, and to compared two directories at different points in time. The latter is made really easy thanks to the &lt;code&gt;diff&lt;/code&gt; utility inside Kopia. Also, after two months of daily backup, I came to the conclusion that compression (zstd or pgzip) is not that good as it consumes a lot of RAM and keep RAM cache increasing when your backup are schduled on an hourly basis. Finally, to keep your backup repository at a reasonable size don&amp;rsquo;t forget to set up appropriate exclusion rules using &lt;code&gt;kopia set policy&lt;/code&gt;.
&lt;/div&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Washed Out • &lt;em&gt;Amor Fati&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Backups to a local SSD are expected to be faster than backups whose destination is an external HD, though.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>The unquantified self #23</title><link>https://aliquote.org/post/unquantified-self-023/</link><pubDate>Sat, 28 May 2022 21:19:49 +0200</pubDate><guid>https://aliquote.org/post/unquantified-self-023/</guid><description>&lt;p&gt;I spent a few hours reconfiguring my Macbook pro from scratch, with Ubuntu 22.04 LTS. Indeed, &lt;a href="https://aliquote.org/post/ubuntu-on-mac/"&gt;last year&lt;/a&gt; I happily installed Ubuntu 20.04 LTS on my a Macbook pro dating from 2014, but I never really used it so far. The idea was to use it as a home server, which I never configured for that purpose anyway. It&amp;rsquo;s been dormant since then. Now it is up to date, and mostly synchronized with my &lt;a href="https://aliquote.org/post/welcome-ubuntu/"&gt;work machine&lt;/a&gt; so that I can use one laptop or the other depending on my mood. The synchronization is a mix of rsync between static folders (Documents and Media that are not supposed to evolve too much over time), GitHub for version controlled projects, and &lt;a href="https://kopia.io/"&gt;kopia&lt;/a&gt; for backup. I used to use &lt;a href="https://www.borgbackup.org/"&gt;borg&lt;/a&gt;, and then Déjà Dup, which leverages Duplicity and its rsync backend. However, Kopia looks cool since we can have multiple repositories over different backends that can be synced between each other on schedule.&lt;/p&gt;
&lt;p&gt;For my work machine, I still haven&amp;rsquo;t upgraded to the 22.04 LTS release. On the one hand, I&amp;rsquo;m still confused that Canonical is orienting itself toward snap-based distribution of applications. It sounds like a new AppStore in some ways. For instance, Firefox is just blowing slow on fist launch on my Macbook. On the other hand, Regolith Desktop is not available for the latets LTS release. I could set up a Nordic GTK theme for Gnome shell and switched back to i3-gaps, but I also customized my OS a lot (remove snap, disable tracker, and so on), which means I may just reinstall everythng from scratch using an USB stick at some point. Let&amp;rsquo;s wait and see.&lt;/p&gt;
&lt;p&gt;I watched &lt;a href="https://en.wikipedia.org/wiki/Severance_(TV_series)"&gt;Severance&lt;/a&gt; two weeks ago, and now I&amp;rsquo;m already on Season 2 of &lt;a href="https://en.wikipedia.org/wiki/Altered_Carbon"&gt;Altered Carbon&lt;/a&gt;. I didn&amp;rsquo;t watch any TV shows alone since last December at least. It&amp;rsquo;s been a while. With my son, we are watching &lt;a href="https://en.wikipedia.org/wiki/Vikings:_Valhalla"&gt;Vikings: Valhalla&lt;/a&gt; when we have soem free time together. In the meantime, I&amp;rsquo;m blowing up the counters on last.fm with around 800 tracks every week. So far so good. I still have some vinyls to listen to late in the night when I&amp;rsquo;m at home.&lt;/p&gt;
&lt;p&gt;Random pictures from the past days:&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_2056.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_2056.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_2066.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_2066.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_2073.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_2073.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;I spent a few days off, due to public holidays here. I&amp;rsquo;m eagerly waiting for the longer Summer break. In the meantime, I still have lot of work to do, and lot of side projects to tackle on. Anyway, I&amp;rsquo;m now listening to Berlin, &lt;em&gt;The Metro&lt;/em&gt;. Let&amp;rsquo;s all have a good evening then.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ &amp;lsquo;Til Tuesday • &lt;em&gt;Voices Carry&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in May</title><link>https://aliquote.org/post/micro-05-2022/</link><pubDate>Fri, 27 May 2022 22:20:22 +0200</pubDate><guid>https://aliquote.org/post/micro-05-2022/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-05-05&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/2022-05-05-22-07-41.png" alt="img"&gt;&lt;small&gt;4,000 static pages!&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-05&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Core values are self-reinforcing. They attract like-minded people, who will then defend them. &amp;mdash; &lt;a href="https://www.murilopereira.com/the-values-of-emacs-the-neovim-revolution-and-the-vscode-gorilla/"&gt;The values of Emacs, the Neovim revolution, and the VSCode gorilla&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-05-05&lt;/a&gt;: Pollen&amp;rsquo;s sequel? &lt;a href="https://docs.racket-lang.org/quad/"&gt;Quad&lt;/a&gt;: document processor. &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-05&lt;/a&gt;: &lt;a href="https://www.crunchydata.com/blog/parquet-and-postgres-in-the-data-lake"&gt;Parquet and Postgres in the Data Lake&lt;/a&gt;. &lt;code&gt;#database&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-05&lt;/a&gt;: &lt;a href="https://substrait.io/"&gt;Substrait: Cross-Language Serialization for Relational Algebra&lt;/a&gt;. &lt;code&gt;#database&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-05&lt;/a&gt;: &lt;a href="https://matthewbutterick.com/chron/what-we-can-deduce-from-a-leaked-pdf.html"&gt;What we can deduce from a leaked PDF&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-11&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_2061.JPG" alt="img"&gt;&lt;small&gt;Lush plants on the loggia&amp;hellip;&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-11&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Marianne Faithfull, &lt;em&gt;Love more or less&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-11&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The /bin vs /usr/bin split (and all the others) is an artifact of this, a 1970&amp;rsquo;s implementation detail that got carried forward for decades by bureaucrats who never question &lt;em&gt;why&lt;/em&gt; they&amp;rsquo;re doing things. It stopped making any sense before Linux was ever invented, for multiple reasons (&amp;hellip;) &amp;mdash; &lt;a href="http://lists.busybox.net/pipermail/busybox/2010-December/074114.html"&gt;Understanding the bin, sbin, usr/bin , usr/sbin split&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-05-11&lt;/a&gt;: &lt;a href="https://lual.dev/blog/how-to-use-autocompletion-in-vim/"&gt;How to Use Autocompletion in Vim&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-11&lt;/a&gt;: &lt;a href="https://www.sigbus.info/worse-is-better"&gt;My story on “worse is better”&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-11&lt;/a&gt;: &lt;a href="https://kevincox.ca/2022/05/06/rss-feed-best-practices/"&gt;RSS Feed Best Practises&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-12&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Running a personal website is an emotional roller coaster. This fact seems strange to me, because I feel I do a fairly good job of keeping my ego disengaged from the process. I realize that whether people like what I write or hate it has absolutely nothing to do with my worth as a human being. Yet, receiving comments and emails from readers who say they enjoy my website and understand its value feels good. &amp;mdash; &lt;a href="https://cheapskatesguide.org/articles/joys-and-sorrows.html"&gt;The Joys and Sorrows of Maintaining a Personal Website&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-05-12&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The point is to support programming interactively. You don’t want to have to kill your program and rebuild it from scratch just because you changed a definition. That’s silly; adding and changing definitions is most of what you do! If your development environment is going to support interactive development, then it had better know how to keep your program running when you change some definitions. &amp;mdash; &lt;a href="https://mikelevins.github.io/posts/2020-12-18-repl-driven/"&gt;On repl-driven programming&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-05-12&lt;/a&gt;: &lt;a href="https://vimways.org/2019/"&gt;Making Things Flow: Making the behaviour of Vim flow &lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-12&lt;/a&gt;: &lt;a href="https://swatson555.github.io/posts/2022-05-06-make-a-lisp-2.html"&gt;Roll A Lisp In C - Evaluation&lt;/a&gt;. &lt;code&gt;#clang&lt;/code&gt; &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-12&lt;/a&gt;: &lt;a href="https://jolynch.github.io/posts/use_fast_data_algorithms/"&gt;Use Fast Data Algorithms&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-12&lt;/a&gt;: &lt;a href="https://codeinthehole.com/tips/vim-lists/"&gt;Vim&amp;rsquo;s useful lists&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-13&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Vampire Weekend, &lt;em&gt;This Life&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-13&lt;/a&gt;: I just rewrote (again) the build policy for my Stata &lt;a href="https://aliquote.org/articles/stata-sk/"&gt;lecture notes&lt;/a&gt;. Org markup language is fantastic after all!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-14&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/2022-05-14-19-13-53.png" alt="img"&gt;&lt;small&gt;Tuning and overoptimizing Neovim startup time (19 plugins, including 7 opt ones).&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-14&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_2066.JPG" alt="img"&gt;&lt;small&gt;Giant salad for today&amp;rsquo;s lunch!&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-14&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   The Cure, &lt;em&gt;The Hanging Garden&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-14&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Lisp has a specific world view which makes it less compatible with the current outside world. &amp;mdash; &lt;a href="http://lispm.de/why-lisp-is-different"&gt;Why Lisp is different&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-05-14&lt;/a&gt;: &lt;a href="https://matt-rickard.com/why-did-heroku-fail/"&gt;Why Did Heroku Fail?&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-14&lt;/a&gt;: &lt;a href="https://htmx.org/"&gt;htmx&lt;/a&gt; gives you access to AJAX, CSS Transitions, WebSockets and Server Sent Events directly in HTML, using attributes, so you can build modern user interfaces with the simplicity and power of hypertext.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-16&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_2073.JPG" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-16&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Aaron Neville, &lt;em&gt;Tell It Like It Is&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-16&lt;/a&gt;: &amp;gt; My conclusion after using Julia for many years is that there are too many correctness and composability bugs throughout the ecosystem to justify using it in just about any context where correctness matters. &amp;mdash; &lt;a href="https://yuri.is/not-julia/"&gt;Why I no longer recommend Julia&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-16&lt;/a&gt;: &lt;a href="https://www.fharrell.com/post/rflow"&gt;R Workflow&lt;/a&gt; by Frank Harrel. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-16&lt;/a&gt;: &lt;a href="https://javascript.info/"&gt;The Modern JavaScript Tutorial&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-17&lt;/a&gt;: &lt;a href="https://ejmastnak.github.io/tutorials/vim-latex/intro.html"&gt;Real-time LaTeX Using (Neo)Vim&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt; &lt;code&gt;#tex&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-17&lt;/a&gt;: &lt;a href="https://dnaeon.github.io/starting-with-common-lisp-in-2020/"&gt;Starting with Common Lisp in 2020&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-17&lt;/a&gt;: &lt;a href="https://github.com/orhun/menyoki"&gt;menyoki&lt;/a&gt;: Screen{shot,cast} and perform ImageOps on the command line.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-18&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Iggy Pop, &lt;em&gt;Some Weird Sin&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-18&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;So, having spent hundreds of frustrating hours developing a working OAUTH2 solution for GMail, I am defeated at the final hurdle. Google&amp;rsquo;s demands mean that I am simply not going to be able to support GMail past May 31st, however much it hurts me to feel that I am letting my users down.&amp;gt; My deepest apologies to you all. &amp;mdash; &lt;a href="http://www.pmail.com/newsflash.htm"&gt;http://www.pmail.com/newsflash.htm&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-05-18&lt;/a&gt;: &lt;a href="https://thorstenball.com/blog/2022/05/17/professional-programming-the-first-10-years/"&gt;Professional Programming: The First 10 Years&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-19&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Kajagoogoo, &lt;em&gt;Too Shy&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-19&lt;/a&gt;: &amp;gt; I suppose this is another one of those things we all end up doing: Write a printf() implementation, create an IRC bot, and author a book about Open Source. &amp;mdash; &lt;a href="https://un.curl.dev/intro"&gt;Uncurled&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-19&lt;/a&gt;: &lt;a href="https://betaplane.github.io/programming/2018-07-24-Org-babel-as-an-alternative-to-Jupyter-notebooks/"&gt;Org-babel as an alternative to Jupyter notebooks&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-19&lt;/a&gt;: &lt;a href="https://nhigham.com/2022/05/18/the-big-six-matrix-factorizations/"&gt;The Big Six Matrix Factorizations&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-19&lt;/a&gt;: &lt;a href="https://www.craigkerstiens.com/2022/05/18/unfinished-business-with-postgres/"&gt;Unfinished Business with Postgres&lt;/a&gt;. &lt;code&gt;#database&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-20&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Laurie Anderson, &lt;em&gt;Slip Away&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-20&lt;/a&gt;: &lt;a href="https://www.farside.org.uk/201311/encoding_n_choose_k"&gt;A maximally-dense encoding for n-choose-k&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-20&lt;/a&gt;: &lt;a href="https://justine.lol/ftrace/"&gt;Logging C Functions&lt;/a&gt;. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-23&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Shy away from numbers or concrete analysis during design. Good engineers estimate. Great engineers speculate. &amp;mdash; &lt;a href="https://chriskiehl.com/article/the-tyranny-of-what-if-it-changes"&gt;The mindless tyranny of &amp;lsquo;what if it changes?&amp;rsquo; as a software design principle&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-05-23&lt;/a&gt;: &lt;a href="https://github.com/rhettinger/modernpython"&gt;Modern Python: Big ideas, Little Code&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-23&lt;/a&gt;: &lt;a href="https://antonz.org/python-stdlib-changes/"&gt;Python Standard Library changes in recent years&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-23&lt;/a&gt;: &lt;a href="https://www.vidarholen.net/contents/blog/?p=479"&gt;Useless Use Of dd&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-23&lt;/a&gt;: &lt;a href="https://nedbatchelder.com/text/which-py.html"&gt;What’s in which Python&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-24&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Elliott Smith, &lt;em&gt;Waltz #2&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-24&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The big endian advantages tend to be cosmetic or convention based, or of minor usefulness. The little endian advantages offer real world performance boosts in many cases (given the right algorithm or encoding to take advantage of it). &amp;mdash; &lt;a href="https://www.technicalsourcery.net/posts/on-endianness/"&gt;On Endianness&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-05-24&lt;/a&gt;: &lt;a href="https://blog.wolfram.com/2011/12/07/10-tips-for-writing-fast-mathematica-code/"&gt;10 Tips for Writing Fast Mathematica Code&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-24&lt;/a&gt;: &lt;a href="https://death.andgravity.com/f-re"&gt;The unreasonable effectiveness of f‍-‍strings and re.VERBOSE&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-24&lt;/a&gt;: &lt;a href="https://bytepawn.com/python-decorators-for-data-scientists.html"&gt;Useful Python decorators for Data Scientists&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-25&lt;/a&gt;: &lt;a href="https://graphics.stanford.edu/~seander/bithacks.html"&gt;Bit Twiddling Hacks&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-05-26&lt;/a&gt;: &lt;a href="https://shuvomoy.github.io/blogs/posts/Knuth-on-work-habits-and-problem-solving-and-happiness/"&gt;Donald Knuth on work habits, problem solving, and happiness&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;</description></item><item><title>Random sampling by the inverse CDF transformation</title><link>https://aliquote.org/post/inverse-cdf-random-sampling/</link><pubDate>Thu, 26 May 2022 11:45:44 +0200</pubDate><guid>https://aliquote.org/post/inverse-cdf-random-sampling/</guid><description>&lt;p&gt;There are many ways to generate random samples from a given distribution, including Monte Carlo simulation. In this case, the random number generation process consists in generating i.i.d. uniform $\mathcal{U}(0,1)$ RVs, convert them to independent $\mathcal{N}(0,1)$ RVs, and eventually convert them to correlated $\mathcal{N}(0,1)$ RVs. Once we get uniform random variables on $(0,1)$, we can use one of the following methods to convert them to gaussian RVs: the Box-Muller or the Marsaglia polar method, or the inverse CDF transformation.&lt;/p&gt;
&lt;p&gt;Regarding the Box-Muller approach the idea is as follows: You generate two independent $\mathcal{U}(0,1)$ RVs on $(0,1)$ and then you define two new independent $\mathcal{N}(0,1)$ RVs, $x_1$ and $x_2$, using this transformation:&lt;/p&gt;
&lt;p&gt;$$
\begin{equation}
\begin{aligned}
x_1 &amp;amp;= \sqrt{-2\log(y_1)}\; \text{cos}(2\pi y_2)\cr
x_2 &amp;amp;= \sqrt{-2\log(y_1)}\; \text{sin}(2\pi y_2).
\end{aligned}
\end{equation}
$$&lt;/p&gt;
&lt;p&gt;To get ride of the trigonometric functions, the Marsaglia&amp;rsquo;s polar method instead considers two independent $\mathcal{U}(0,1)$ RVs on $(-1,1)$ and accept them if $r^2 = y_1^2 + y_2^2 &amp;lt; 1$.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; Once accepted, generate $x_1$ and $x_2$ as follows:&lt;/p&gt;
&lt;p&gt;$$
\begin{equation}
\begin{aligned}
x_1 &amp;amp;= \sqrt{-2\log(r^2)/r^2}\; y_1\cr
x_2 &amp;amp;= \sqrt{-2\log(r^2)/r^2}\; y_2.
\end{aligned}
\end{equation}
$$&lt;/p&gt;
&lt;p&gt;Finally, the inverse CDF transformation is a little more involved. Recall that a standard gaussian variate $Z$, with mean 0 and variance 1, has the following probability density function (PDF):&lt;/p&gt;
&lt;p&gt;$$ \phi(z) = \frac{1}{\sqrt{2\pi}}\exp\left(-\frac{1}{2}z^2\right). $$&lt;/p&gt;
&lt;p&gt;Its cumulative distribution function (CDF) is then $\Phi(z) = \Pr(Z&amp;lt;z) = \int_{-\infty}^z\phi(s)ds$. The inverse CDF method is used to compute $x = \Phi^{-1}(y)$, with $y$ distributed uniformly on $(0,1)$.&lt;/p&gt;
&lt;p&gt;Note that the normal CDF $\Phi(x)$ is related to the error function $\text{erf}(x)$, as discussed on &lt;a href="https://en.wikipedia.org/wiki/Normal_distribution"&gt;Wikipedia&lt;/a&gt;. Indeed, $\Phi(x) = \frac{1}{2} + \frac{1}{2}\text{erf}(x/\sqrt{2})$, which implies:&lt;/p&gt;
&lt;p&gt;$$ \Phi^{-1}(y) = \sqrt{2}\;\text{erf}^{-1}(2y-1). $$&lt;/p&gt;
&lt;p&gt;If your programming language provides you with either an inverse erf or normal CDF, then you can generate a sequence of random normal deviates easily. Here is an example using Racket:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;require&lt;/span&gt; &lt;span class="nv"&gt;math/distributions&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;replicate&lt;/span&gt; &lt;span class="nv"&gt;f&lt;/span&gt; &lt;span class="nv"&gt;times&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;for&lt;/span&gt; &lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;in-range&lt;/span&gt; &lt;span class="nv"&gt;times&lt;/span&gt;&lt;span class="p"&gt;)])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;displayln&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;f&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;rnorm&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;mean&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;sd&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let &lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;random&lt;/span&gt;&lt;span class="p"&gt;)])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;flnormal-inv-cdf&lt;/span&gt; &lt;span class="nv"&gt;mean&lt;/span&gt; &lt;span class="nv"&gt;sd&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="no"&gt;#f&lt;/span&gt; &lt;span class="no"&gt;#f&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;replicate&lt;/span&gt; &lt;span class="nv"&gt;rnorm&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note that Racket&amp;rsquo;s &lt;code&gt;random&lt;/code&gt; produces random variates in the open interval $(0,1)$. If you need to include 0 and 1, for whatever reason, checkout &lt;a href="https://stackoverflow.com/a/51987441/420055"&gt;soegaard&lt;/a&gt;&amp;rsquo;s answer on SO.&lt;/p&gt;
&lt;p&gt;And here are two random samples of size 1000, depicted using a boxplot: (I yet have to write a quantile-quantile renderer for Racket&amp;rsquo;s &lt;code&gt;plot&lt;/code&gt;.)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;require&lt;/span&gt; &lt;span class="nv"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;plot-new-window?&lt;/span&gt; &lt;span class="no"&gt;#t&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="nv"&gt;xs&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;build-list&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;rnorm&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="nv"&gt;ys&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;build-list&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;rnorm&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;plot&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;for/list&lt;/span&gt; &lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="nv"&gt;data&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list &lt;/span&gt;&lt;span class="nv"&gt;xs&lt;/span&gt; &lt;span class="nv"&gt;ys&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;label&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;a&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;b&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;index&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;in-naturals&lt;/span&gt;&lt;span class="p"&gt;)])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;box-and-whisker&lt;/span&gt; &lt;span class="nv"&gt;data&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;#&lt;/span&gt;&lt;span class="nv"&gt;:x&lt;/span&gt; &lt;span class="nv"&gt;index&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;#&lt;/span&gt;&lt;span class="nv"&gt;:width&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="nv"&gt;/4&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/2022-05-27-22_09-30.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Relevant links for Scheme users:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://planet.racket-lang.org/package-source/williams/science.plt/4/2/planet-docs/science/random-numbers.html"&gt;Random Number Generation&lt;/a&gt;, from the old Science Collection or the &lt;a href="https://srfi.schemers.org/srfi-27/"&gt;SRFI 27&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;MIT Scheme &lt;a href="https://web.mit.edu/scheme_v9.2/doc/mit-scheme-ref/Random-Numbers.html"&gt;documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Philip Bewig&amp;rsquo;s own implementation, and &lt;a href="https://stackoverflow.com/a/14675103/420055"&gt;some of his answers&lt;/a&gt; on SO&lt;/li&gt;
&lt;li&gt;the &lt;a href="https://wiki.call-cc.org/eggref/5/random-mtzig"&gt;Mersenne Twister&lt;/a&gt; algorithm for Chicken Scheme&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ A Certain Ratio • &lt;em&gt;Do the Du&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;A rejection rate of 20% can be expected.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Wolfram Language Server</title><link>https://aliquote.org/post/wolfram-language-server/</link><pubDate>Tue, 24 May 2022 12:07:17 +0200</pubDate><guid>https://aliquote.org/post/wolfram-language-server/</guid><description>&lt;p&gt;Today I learned that Mathematica 13.0 ships with a builtin language server. There are actually two VS Code plugins that provide client-side code for Wolfram LSP: &lt;a href="https://github.com/kenkangxgwe/vscode-lsp-wl"&gt;lsp-wl&lt;/a&gt; and the official &lt;a href="https://github.com/WolframResearch/vscode-wolfram"&gt;wolfram&lt;/a&gt; extension.&lt;/p&gt;
&lt;p&gt;I first tried to configure lsp-wl with Neovim builtin lspconfig, using a custom server config. Neither of wolframscript or netcat proved to work in this case. However, I got something close to what we have in VS Code with the official extension using the following setup:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lua" data-lang="lua"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;nvim_lsp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;lspconfig&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;configs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;lspconfig.configs&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;configs.lsp_wl&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;default_config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cmd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;wolfram&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;kernel&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;-noinit&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;-noprompt&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;-nopaclet&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;-noicon&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;-nostartuppaclets&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;-run&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;Needs[&amp;#34;LSPServer`&amp;#34;];LSPServer`StartServer[]&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;filetypes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;mma&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;wl&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;root_dir&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;nvim_lsp.util&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path.dirname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;nvim_lsp.lsp_wl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setup&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="n"&gt;on_attach&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;lsp_attach&lt;/span&gt;&lt;span class="p"&gt;({})&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;small&gt;The &lt;code&gt;lsp_attach&lt;/code&gt; function does take care of formatting on save, completion and common key mappings across LSPs.&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;I mostly use the &lt;code&gt;mma&lt;/code&gt; filetype because I rely on &lt;a href="http://ai.eecs.umich.edu/people/dreeves/mash/"&gt;mash&lt;/a&gt; for batch processing Mathematica code in Org document, as described in &lt;a href="https://www.aliquote.org/pub/org-setup.pdf"&gt;a minimal Org setup to write scientific notebooks&lt;/a&gt;.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;I still have to manage how to get omnifunc completion working, but for the moment I have hover information, diagnostics and formatting.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-05-24-11-38-26.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-05-24-11-38-26.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-05-24-13-37-00.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-05-24-13-37-00.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Heather Nova • &lt;em&gt;Heal&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;This also seems to work with &lt;a href="https://github.com/hkupty/iron.nvim"&gt;iron.nvim&lt;/a&gt;, at least as well as with wolframscript when I last tried.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Org and Jupyter</title><link>https://aliquote.org/post/org-and-jupyter/</link><pubDate>Wed, 18 May 2022 12:48:23 +0200</pubDate><guid>https://aliquote.org/post/org-and-jupyter/</guid><description>&lt;p&gt;I do like Org in Vim, but I need Emacs to process my code chunks via Org babel. I already described my setup in earlier posts of mine, but I reached the point where I think that ESS is no longer the definite answer for Org + R or Org + Stata documents.&lt;/p&gt;
&lt;p&gt;I also realized that ESS support for Stata is going to an end (like was the case of xlispstat a few years ago). It&amp;rsquo;s probably time to rebase all subsequent batch processing of Org files to the corresponding Jupyter kernel.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;stata support is now obsolete since we were unable to elicit FSF paperwork from some of the original authors: see the lisp/obsolete sub-directory on the ESS github repo &amp;mdash; &lt;a href="https://ess.r-project.org/Manual/ess.html"&gt;Changes and New Features in 19.04 (unreleased)&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Needless to say, using Jupyter for interactive work in the terminal is also a better option since the terminal version of Stata does not have any support for readline. Since I pushed a PR for Stata base support to &lt;a href="https://github.com/hkupty/iron.nvim/pull/214"&gt;iron.nvim&lt;/a&gt;, I should better rewrite a proper alternative using the &lt;a href="https://aliquote.org/post/stata-jupyter/"&gt;stata kernel&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;As mentioned in the introduction, I still relies on Emacs for most of the work. Ubuntu 20.04 LTS comes with Emacs 26.3, which is pretty old by any standard, and does not support modules, which are a prerequisite for installing &lt;a href="https://github.com/nnicandro/emacs-jupyter"&gt;emacs-jupyter&lt;/a&gt;. Since my Emacs config was outdated and quite a mess actually (I installed some packages via apt, others manually, and yet a few other packages via Emacs &lt;code&gt;package-install&lt;/code&gt;), I decided it was time to install a fresh new version of Emacs. There are prebuilt binaries (Emacs 27 and 28) available for Ubuntu via a dedicated PPA:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ sudo add-apt-repository ppa:kelleyk/emacs
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ sudo apt install emacs28
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then, I installed a bunch of packages with &lt;code&gt;package-install&lt;/code&gt;. I know I should be using &lt;code&gt;straight&lt;/code&gt; but since I will only be using Emacs as a postprocessor for my Org files, I don&amp;rsquo;t want to bother with an alembicated &lt;code&gt;init.el&lt;/code&gt; file. Part of my config file is shown below:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-emacs-lisp" data-lang="emacs-lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;when&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;and&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;version&amp;lt;&lt;/span&gt; &lt;span class="nv"&gt;emacs-version&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;26.3&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="nv"&gt;libgnutls-version&lt;/span&gt; &lt;span class="mi"&gt;30603&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;setq&lt;/span&gt; &lt;span class="nv"&gt;gnutls-algorithm-priority&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;NORMAL:-VERS-TLS1.3&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;package&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;add-to-list&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;package-archives&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;melpa&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;https://melpa.org/packages/&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;with-eval-after-load&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;package&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;add-to-list&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;package-archives&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;nongnu&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;https://elpa.nongnu.org/nongnu/&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;package-initialize&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;unless&lt;/span&gt; &lt;span class="nv"&gt;package-archive-contents&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;package-refresh-contents&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;setq&lt;/span&gt; &lt;span class="nv"&gt;package-list&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;almost-mono-themes&lt;/span&gt; &lt;span class="nv"&gt;evil&lt;/span&gt; &lt;span class="nv"&gt;geiser&lt;/span&gt; &lt;span class="nv"&gt;slime&lt;/span&gt; &lt;span class="nv"&gt;paredit&lt;/span&gt; &lt;span class="nv"&gt;rainbow-delimiters&lt;/span&gt; &lt;span class="nv"&gt;org-contrib&lt;/span&gt; &lt;span class="nv"&gt;jupyter&lt;/span&gt; &lt;span class="nv"&gt;ess&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;dolist&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;package&lt;/span&gt; &lt;span class="nv"&gt;package-list&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;unless&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;package-installed-p&lt;/span&gt; &lt;span class="nv"&gt;package&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;package-install&lt;/span&gt; &lt;span class="nv"&gt;package&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So far, so good. I should now be able to use either ESS or Jupyter to process my Org code blocks. Let&amp;rsquo;s get back to Stata.&lt;/p&gt;
&lt;p&gt;Ironically, I reverted back to using ESS and ob-stata when I reworked my stata-sk handouts. Originally, I was interested in Jupyter because of &lt;a href="https://gitlab.com/robhicks/ob-stata.el/-/issues/10"&gt;bad support&lt;/a&gt; for Stata, even after some hacking (which &lt;a href="https://gitlab.com/robhicks/ob-stata.el/-/issues/10"&gt;no longer&lt;/a&gt; applies, by the way), and because at that same time I was using Stata 15 which has native support for SVG graphics, which are the default backend in &lt;a href="https://kylebarron.dev/stata_kernel/"&gt;stata_kernel&lt;/a&gt;. After blaming my GitHub repo once again, I reverted the changes I introduced in some of the &lt;a href="https://github.com/even4void/stata-sk/commit/d24b13817df321cd963970c8f948f66651caba63"&gt;previous commits&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;First diff:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="c1"&gt;#+begin_src stata :session :results output :exports both&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="c1"&gt;#+BEGIN_SRC jupyter-stata :exports both&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;sysuse&lt;/span&gt; &lt;span class="n"&gt;auto&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;clear&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;summarize&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="n"&gt;mpg&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;regress&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="n"&gt;mpg&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="c1"&gt;#+end_src&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="c1"&gt;#+END_SRC&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;small&gt;Doom Emacs used to use lowercase Org blocks.&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;Second diff:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="c1"&gt;#+BEGIN_SRC jupyter-stata :exports both&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="c1"&gt;#+BEGIN_SRC stata&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;sysuse&lt;/span&gt; &lt;span class="n"&gt;auto&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;clear&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;summarize&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="n"&gt;mpg&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;regress&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="n"&gt;mpg&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;small&gt;I moved common header arguments to a global &lt;code&gt;#+PROPERTY&lt;/code&gt;.&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;Third diff will be essentially identical to the first one.&lt;/p&gt;
&lt;p&gt;And so I&amp;rsquo;m back to using &lt;code&gt;jupyter-stata&lt;/code&gt; in my SRC block, instead of &lt;code&gt;stata&lt;/code&gt;. Besides replacing a few header options here and there, one of the consequence of using Stata 13 is that I also have to get ride of SVG or even PNG output. This means that I need to &lt;code&gt;quietly&lt;/code&gt; generate the charts and then save them to EPS. This was already what I was doing when using ob-stata, but now I need to silence out the graph otherwise Jupyter complains. All EPS files are then converted to PNG using a shell script:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; i in fig-*.eps&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; convert -density &lt;span class="m"&gt;300&lt;/span&gt; -quality &lt;span class="m"&gt;85&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$i&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;dist/&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;i&lt;/span&gt;&lt;span class="p"&gt;%%.*&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;.png&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So far it seems to work great. I just need to update my default &lt;a href="https://aliquote.org/pub/org-setup.pdf"&gt;Org config&lt;/a&gt;, in addition to my Stata handouts once again.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Hoodoo Gurus • &lt;em&gt;What&amp;rsquo;s My Scene&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Common Lisp Hyperspec in Vim</title><link>https://aliquote.org/post/vim-and-lisp/</link><pubDate>Tue, 17 May 2022 21:33:20 +0200</pubDate><guid>https://aliquote.org/post/vim-and-lisp/</guid><description>&lt;p&gt;I really like the &lt;code&gt;keywordprg&lt;/code&gt; mapping in Vim. It&amp;rsquo;s the capital K that you press to get help for the word under the cursor (known as &lt;code&gt;cword&lt;/code&gt; in Vim parlance). If you use an LSP client (builtin Neovim LSP, Coc or ALE, for example), you likely use it everyday since it is generally mapped onto the Hover method of the LSP server.&lt;/p&gt;
&lt;p&gt;When not in an LSP-aware environment, I write my own &lt;code&gt;keywordprg&lt;/code&gt;. You can find plenty of &lt;a href="https://til.codeinthehole.com/posts/about-how-to-use-keywordprg-effectively/"&gt;nice ideas&lt;/a&gt; on the web. Since I use some programming languages that don&amp;rsquo;t come with an LSP yet, I have the following in my &lt;code&gt;after/ftplugin/stata.vim&lt;/code&gt; settings, for instance:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-vim" data-lang="vim"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;setlocal&lt;/span&gt; &lt;span class="nx"&gt;keywordprg&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;stata_help&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As mentioned in a &lt;a href="https://aliquote.org/post/bioinformatics-data-skills/"&gt;footnote&lt;/a&gt; of one my older posts, I query Stata&amp;rsquo;s online documentation when working from TUIs. In this case, &lt;code&gt;stata_help&lt;/code&gt; is just a wrapper shell script for &lt;code&gt;links https://www.stata.com/help.cgi\?&amp;quot;${1}&amp;quot;&lt;/code&gt;. This way, when I&amp;rsquo;m over a Stata command, I just press K and I get its online help in a tab, with a proper text-mode browser. Note that I prefer &lt;a href="https://links.twibright.com/user_en.html"&gt;Links&lt;/a&gt; over Lynx for text-mode browsing the internet.&lt;/p&gt;
&lt;p&gt;This morning I wrote a little Lisp script using &lt;a href="https://github.com/roswell/roswell"&gt;Roswell&lt;/a&gt;, since I wanted to try it for a moment. I already configured Roswell to fetch the latest release of SBCL on my laptop because Ubuntu&amp;rsquo;s default version is pretty outdated. It works great but I never use the scripting facilities that Roswell offers. I wrote two versions of a small utility that allows to fetch the relevant documentation from Lispworks &lt;a href="http://www.lispworks.com/documentation/HyperSpec/Front/index.htm"&gt;Hyperspec&lt;/a&gt; online documentation. The first version was a simple lookup through the documentation to retrieve the URL corresponding to the symbol at point and to return a system call to open it in the default browser. The lookup step is performed thanks to the &lt;a href="http://www.lispworks.com/documentation/HyperSpec/Front/index.htm"&gt;hyperspec&lt;/a&gt; package. I used ASDF builtin facilities to launch external program (&lt;code&gt;uiop:run-program&lt;/code&gt;) but one could also makes use of SBCL&amp;rsquo;s builtin extensions (&lt;code&gt;sb-ext:run-program&lt;/code&gt;). Finally, I decided to just return the URL to the standard output, in case I need to reuse the script for another purpose. Both versions are shown below:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="nv"&gt;!/bin/sh&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cm"&gt;#|-*- mode:lisp -*-|#&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cm"&gt;#|
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cm"&gt;exec ros -Q -- &amp;#34;$0&amp;#34; &amp;#34;$@&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cm"&gt;|#&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;with-output-to-string&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="vg"&gt;*standard-output*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;asdf:load-system&lt;/span&gt; &lt;span class="ss"&gt;:hyperspec&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; (defun main (cword &amp;amp;rest argv)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; (declare (ignore argv))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; (uiop:run-program&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; (list &amp;#34;/usr/bin/xdg-open&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; (funcall #&amp;#39;hyperspec:lookup (read-from-string cword)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; :output nil))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defun&lt;/span&gt; &lt;span class="nv"&gt;main&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;cword&lt;/span&gt; &lt;span class="k"&gt;&amp;amp;rest&lt;/span&gt; &lt;span class="nv"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;declare&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;ignore&lt;/span&gt; &lt;span class="nv"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt; &lt;span class="no"&gt;t&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;~D~%&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;hyperspec:lookup&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;read-from-string&lt;/span&gt; &lt;span class="nv"&gt;cword&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Since I just fetch the URL, I need a way to tell Vim to display the online doc right inside a tab. This is done by adding &lt;code&gt;setlocal keywordprg=hyperspec_lookup&lt;/code&gt; in my &lt;code&gt;after/ftplugin/lisp.vim&lt;/code&gt; file, where &lt;code&gt;hyperspec_lookup&lt;/code&gt; is just a wrapper shell script:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#!/usr/bin/env bash
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;rc&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;hyperspec_lookup.ros &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="k"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;links &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$rc&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And now I get the full CLHS documentation for free when working in neovim!&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2022-05-17-22-41-44.png"&gt;
&lt;/figure&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2022-08-22]&lt;/small&gt;&lt;br&gt;
An even better soluton is to use &lt;a href="https://github.com/sunaku/dasht"&gt;dasht&lt;/a&gt; and the &lt;a href="https://github.com/sunaku/vim-dasht"&gt;dasht.vim&lt;/a&gt; plugin. The later detects filetype automagically and provides help for the relevant docset, although it is still possible to search the whole collection of docsets. It works great for Common Lisp and Racket, but I&amp;rsquo;m still looking for R5, R6 and R7RS docsets for Scheme. Note that for CSS? HTML and Javascript, the documentation is taken from Mozilla MDN and it&amp;rsquo;s a bit crapy since the whole page header is returned together with the result. Also, if you prefer to use Fzf from the command line, the following shortcut may come handy: &lt;code&gt;dasht-query-line $@ | perl -0777 -pe &amp;rsquo;s/name = (.&lt;em&gt;?)\ntype = (.&lt;/em&gt;?)\nfrom = (.&lt;em&gt;?)\nurl = (.&lt;/em&gt;?)\n/ $4 | $1 | $3 | $3\n\n/g&amp;rsquo; | column -ts&amp;rsquo;|&amp;rsquo; | fzf &amp;ndash;no-sort &amp;ndash;with-nth=2.. &amp;ndash;bind &amp;rsquo;enter:execute(w3m {1})+accept&amp;rsquo;&lt;/code&gt;. (Don&amp;rsquo;t remember where I found this snippet, sorry!)
&lt;/div&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Echo &amp;amp; The Bunnymen • &lt;em&gt;All That Jazz&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Neovim colorscheme switching and Tmux</title><link>https://aliquote.org/post/neovim-and-tmux/</link><pubDate>Fri, 13 May 2022 11:30:11 +0200</pubDate><guid>https://aliquote.org/post/neovim-and-tmux/</guid><description>&lt;p&gt;At work I am sometimes bothered by the ambient light. This was not much of a problem until recently when I switched to a &lt;a href="https://aliquote.org/post/regolith-desktop/"&gt;dark theme&lt;/a&gt;. The Nord theme is really great, but admittedly a light theme is more suitable in a bright room. Since I wanted to try out the vimbones theme from the &lt;a href="https://github.com/mcchrish/zenbones.nvim"&gt;zenbones&lt;/a&gt; plugin, I thought it would be a good idea to set up a dual theme for Neovim and Gnome terminal. Most of my other TUI settings depend on $TERM colors, so I only need the correct values for the terminal (16 colors). The zenbones plugin comes with extra configuration for various terminal emulators, including Kitty. I just grabbed the relevant settings for Gnome terminal, and copy the colorscheme Vim file. At this point, I do not want to rely on extra packages, like Lush, so I deleted part of the vim script file.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; And here we are:&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-05-13-12-21-01.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-05-13-12-21-01.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-05-13-12-21-53.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-05-13-12-21-53.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The light theme is clean and elegant, and it matches almost all of my &lt;a href="https://aliquote.org/post/on-color-scheme/"&gt;own settings&lt;/a&gt; for the Nord theme, which I modified heavily to discard fancy stuff that I am not interested in.&lt;/p&gt;
&lt;p&gt;Regarding automatic colorscheme switching in (Neo)vim, I saw various topics on the internet, including settings global environment variable to define the colorscheme from within (Neo)vim config file, see &lt;a href="https://joshtronic.com/2018/06/04/set-vim-background-based-on-your-terminals-background-color/"&gt;Set Vim background based on your terminal&amp;rsquo;s background color&lt;/a&gt;. I don&amp;rsquo;t really like depending on environment variable, so I continued to explore a bit on the internet and I discovered that we can simply test for the &lt;code&gt;&amp;amp;background&lt;/code&gt; value in Vim. Indeed, Vim and Neovim can detect the background color of the terminal where they are running, and &lt;code&gt;set background&lt;/code&gt; accordingly. Here&amp;rsquo;s the gist, as a vimL function:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;function! misc#set_theme() abort
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; if &amp;amp;background ==# &amp;#39;dark&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; colorscheme nord
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; else
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; colorscheme bones
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; endif
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;endfunction
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This has to be used in an autocommand like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;augroup colortheme
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; autocmd!
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; autocmd OptionSet background ++nested call misc#set_theme()
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;augroup END
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;At this point, I&amp;rsquo;m not sure we really need the &lt;code&gt;++nested&lt;/code&gt; option. This works great when Neovim runs in Gnome terminal. However, it doesn&amp;rsquo;t work in Tmux because it doesn&amp;rsquo;t handle &lt;a href="https://github.com/tmux/tmux/issues/1919"&gt;OSC 11&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;There&amp;rsquo;s a hacky solution, though. The gist comes from user &lt;a href="https://github.com/neovim/neovim/issues/17070#issuecomment-1086775760"&gt;erw7&lt;/a&gt; on &lt;a href="https://github.com/neovim/neovim/issues/17070"&gt;GitHub&lt;/a&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lua" data-lang="lua"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;vim.loop&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fs_write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="se"&gt;\27&lt;/span&gt;&lt;span class="s2"&gt;Ptmux;&lt;/span&gt;&lt;span class="se"&gt;\27\27&lt;/span&gt;&lt;span class="s2"&gt;]11;?&lt;/span&gt;&lt;span class="se"&gt;\7\27\\&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I wrapped the above in a conditional statement that checks whether we are running Neovim inside Tmux or not. Since I set Tmux as &amp;ldquo;tmux-256color&amp;rdquo;, this amounts to something like &lt;code&gt;if $TERM ==# &amp;quot;tmux-256color&amp;quot;&lt;/code&gt;. And, well, that&amp;rsquo;s it!&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Arctic Monkeys • &lt;em&gt;Fluorescent Adolescent&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;After two years using Neovim, I still use less than 20 plugins in my config set. No friction, no reverse dependencies to solve every two weeks.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in April</title><link>https://aliquote.org/post/micro-04-2022/</link><pubDate>Wed, 27 Apr 2022 21:42:05 +0200</pubDate><guid>https://aliquote.org/post/micro-04-2022/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-04-01&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/67053140909__CE030A7B-7BD4-463E-AA17-4EC1111AE9F5.JPG" alt="img"&gt;&lt;small&gt;Hot off the kitchen&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-01&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Like many here, I turned off commenting years ago. My motivation had less to do with spam. (I&amp;rsquo;m on WordPress and it does a pretty good job with that.) It had more to do with the conversations moving from my site to the social web. Folks wanted to talk about stuff where they already were, rather than centralizing that conversation on individual blogs. &amp;mdash; &lt;a href="https://news.ycombinator.com/item?id=30853565"&gt;Ask HN: Are blog comments a thing of the past?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-04-01&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Note that “semantic understanding” is mostly unrelated to the traditional interpretation of “IDE” as Integrated Development Environment. I personally don’t feel that the “Integrated” bit is all that important. I commit&amp;amp;push from the command line using Julia scripts, rebase in magit, and do code reviews in a browser. If anything, there’s an ample room for improvement for the integration bits. For me, I in “IDE” stands for “intelligent”, smart. &amp;mdash; &lt;a href="https://matklad.github.io//2020/11/11/yde.html"&gt;Why an IDE?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-04-01&lt;/a&gt;: &lt;a href="https://codecapsules.io/docs/tutorials/build-flask-htmx-app/"&gt;Building a Full Stack Application with Flask and HTMx&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-01&lt;/a&gt;: &lt;a href="https://austinhenley.com/blog/cosine.html"&gt;Implementing cosine in C from scratch&lt;/a&gt;. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-02&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Atom Editor was, and still is, an amazing piece of technology. It was the first practical example of web technologies running locally, applied to a really hard problem: text editors. It it was, and still is, darn good at handling code. &amp;mdash; &lt;a href="https://mauricio.szabo.link/blog/2022/02/17/the-impossibility-to-maintain-atom"&gt;The impossibility to maintain Atom&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-04-02&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Consume input from stdin, produce output to stdout. Put another way, your program should be a filter. Filters are easily integrated into shell pipelines, arguably the most important utility for Unix tools composition. &amp;mdash; &lt;a href="https://monkey.org/~marius/unix-tools-hints.html"&gt;Hints for writing Unix tools&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-04-02&lt;/a&gt;: Apparently, the formers developers of Atom (whose status remains &lt;a href="https://github.com/atom/atom/discussions/22847"&gt;unclear&lt;/a&gt; at the time of this writing) are now developing a new text editor, &lt;a href="https://zed.dev/"&gt;Zed&lt;/a&gt;. Note that there&amp;rsquo;s also &lt;a href="https://lapce.dev/"&gt;Lapce&lt;/a&gt; in the radar.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-04&lt;/a&gt;: &lt;a href="https://pca4ds.github.io/"&gt;Principal Component Analysis for Data Science &lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-04&lt;/a&gt;: &lt;a href="https://jerrington.me/posts/2019-01-29-self-hosted-ngrok.html"&gt;Roll your own Ngrok with Nginx, Letsencrypt, and SSH reverse tunnelling&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-04&lt;/a&gt;: &lt;a href="https://yiming.dev/blog/2018/01/28/using-vim-emacs-is-like-a-refactoring-process/"&gt;Using Vim/Emacs is like a refactoring process&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-04&lt;/a&gt;: &lt;a href="https://squeaky.ai/blog/development/why-we-dont-use-a-staging-environment"&gt;Why we don’t use a staging environment&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-06&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Sometimes, though, I think there’s a value in doing things the old fashioned way, if only to get a little “closer to the ground” on what our tools are doing behind the scenes. &amp;mdash; &lt;a href="https://benghancock.github.io/blog/2021/simple-joy-coding-by-hand.html"&gt;The Simple Joy of Coding by Hand&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-04-07&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Textbook examples are there to illustrate a method. The recommended approach is to first give two examples where the method works, then one where it fails. But we, the textbook writers, are busy, so we’ll often just give the one that works and stop. As I wrote once, “the book has a chapter on regression discontinuity designs. That’s fine. But all we see in the chapter are successes.” &amp;mdash; &lt;a href="https://statmodeling.stat.columbia.edu/2022/03/27/the-examples-you-see-in-the-textbooks-are-not-representative-of-the-sorts-of-problems-you-see-in-the-real-world/"&gt;The examples you see in the textbooks are not representative of the sorts of problems you see in the real world&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-04-08&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   P!nk, &lt;em&gt;So What&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-08&lt;/a&gt;: After &lt;a href="https://nova.app/"&gt;Nova&lt;/a&gt;, yet another code editor for Mac: &lt;a href="https://www.zeditor.app/"&gt;Zas Editor&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-08&lt;/a&gt;: &lt;a href="https://betterexplained.com/articles/linear-algebra-guide/"&gt;An Intuitive Guide to Linear Algebra&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-08&lt;/a&gt;: &lt;a href="https://www.ctrl.blog/entry/apple-music-nullbytes.html"&gt;The 0,5 MB of nothing in all Apple Music files&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-11&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/67130550456__9F4D50D5-C0C7-4B3D-B098-572D34B496BE.JPG" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-11&lt;/a&gt;: &lt;a href="https://stackoverflow.com/questions/8126311/what-every-programmer-should-know-about-memory"&gt;What Every Programmer Should Know About Memory?&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-11&lt;/a&gt;: &lt;a href="https://biojulia.net/post/hardware/"&gt;What scientists must know about hardware to write fast code&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-12&lt;/a&gt;: &lt;a href="https://empty.coffee/an-ode-to-apples-hide-my-email/"&gt;An Ode to Apple&amp;rsquo;s Hide My Email&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-12&lt;/a&gt;: &lt;a href="https://starship.rs/"&gt;Starship&lt;/a&gt;: The minimal, blazing-fast, and infinitely customizable prompt for any shell!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-12&lt;/a&gt;: &lt;a href="https://nora.codes/post/what-is-rusts-unsafe/"&gt;What Is Rust&amp;rsquo;s unsafe?&lt;/a&gt; &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-14&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Unlike systems software, the values demanded from text editors or IDEs vary greatly depending on who you ask. These are much more personal tools and make room for a diverse set of desires. &amp;mdash; &lt;a href="https://www.murilopereira.com/the-values-of-emacs-the-neovim-revolution-and-the-vscode-gorilla/"&gt;The values of Emacs, the Neovim revolution, and the VSCode gorilla&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-04-14&lt;/a&gt;: How I Vim: &lt;a href="http://howivim.com/2016/andy-stewart/"&gt;Andy Stewart, a.k.a airblade&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-14&lt;/a&gt;: &lt;a href="https://elianiva.my.id/post/prettify-screenshot-using-imagemagick"&gt;Prettify your screenshot using imagemagick&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-14&lt;/a&gt;: &lt;a href="https://www.huy.rocks/everyday/04-01-2022-typescript-how-the-compiler-compiles"&gt;TypeScript / How the compiler compiles&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-14&lt;/a&gt;: &lt;a href="https://keycombiner.com/collections/vim/"&gt;Vim Key Combinations&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-14&lt;/a&gt;: &lt;a href="https://stackoverflow.com/questions/726894/what-are-the-dark-corners-of-vim-your-mom-never-told-you-about"&gt;What are the dark corners of Vim your mom never told you about?&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-17&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Akira Kosemura, &lt;em&gt;Mercy&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-17&lt;/a&gt;: &lt;a href="https://srobb.net/mutt.html"&gt;A Quick Guide to Mutt&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-17&lt;/a&gt;: &lt;a href="https://evantravers.com/articles/2022/04/14/git-jump-to-vim-quickfix/"&gt;Git Jump to Vim Quickfix&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-19&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Alain Kan, &lt;em&gt;Speed My Speed&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-19&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Being `pure functional&amp;rsquo; does not eradicate state; it merely changes the way state is handled &amp;ndash; which could be either more or less clearer and convenient. &amp;mdash; &lt;a href="https://okmij.org/ftp/Algorithms/grasping-all-apples-at-once.html#epilogue"&gt;Grasping &amp;lsquo;all-the-apples-at-once&amp;rsquo;&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-04-19&lt;/a&gt;: &lt;a href="https://nixery.dev/"&gt;Nixery&lt;/a&gt; provides ad-hoc container images that contain packages from the Nix package manager.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-20&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Alice in CHains, &lt;em&gt;Down in a Hole&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-21&lt;/a&gt;: &lt;a href="https://www.thecodedmessage.com/posts/programming-integers/"&gt;Choosing the Right Integers&lt;/a&gt;. &lt;code&gt;#clang&lt;/code&gt; &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-21&lt;/a&gt;: &lt;a href="https://thenumbat.github.io/Exponential-Rotations/"&gt;Exponentially Better Rotations&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-21&lt;/a&gt;: &lt;a href="https://helix-editor.com/"&gt;Helix&lt;/a&gt;: A post-modern modal text editor. Looks cool.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-21&lt;/a&gt;: &lt;a href="https://daniel-j-h.github.io/post/latex-a-modern-approach/"&gt;LaTeX A Modern Approach&lt;/a&gt;. &lt;code&gt;#tex&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-21&lt;/a&gt;: &lt;a href="https://github.com/bloomberg/memray"&gt;Memray&lt;/a&gt; is a memory profiler for Python. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-21&lt;/a&gt;: &lt;a href="http://fmnt.info/blog/20181029_scheme.html"&gt;Scheme for scientific computing&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-25&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Jiři Horák, &lt;em&gt;Ravens Home&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-25&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I don’t think it was a big technical innovation (it’s obvious that you want to separate a language-agnostic editor and a language-specific server). I think it’s a rather bad (aka, “good enough”) technical implementation (stay tuned for “Why LSP sucks?” post I guess?). But it moved us from a world where not having a language IDE was normal and no one was even thinking about language servers, to a world where a language without working completion and goto definition looks unprofessional. &amp;mdash; &lt;a href="https://matklad.github.io//2022/04/25/why-lsp.html"&gt;Why LSP?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-04-25&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;You dumbass. You thought you needed media queries to be responsive, but no. Responsive means that it responds to whatever motherfucking screensize it&amp;rsquo;s viewed on. This site doesn&amp;rsquo;t care if you&amp;rsquo;re on an iMac or a motherfucking Tamagotchi. &amp;mdash; &lt;a href="https://motherfuckingwebsite.com/"&gt;This is a motherfucking website&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-04-25&lt;/a&gt;: &lt;a href="https://cassidy.codes/blog/2019-08-03-tmux-colour-theme/"&gt;Creating a tmux Colour Theme&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-26&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Dirk Maassen, &lt;em&gt;Still&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-26&lt;/a&gt;: Working at producing &lt;a href="https://aliquote.org/pub/lang-r-base.html"&gt;elegant (or at least less common) notebooks&lt;/a&gt; using Org babel.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-27&lt;/a&gt;: &lt;iframe style="border: 0; width: 100%; height: 120px;" src="https://bandcamp.com/EmbeddedPlayer/album=1110099553/size=large/bgcol=ffffff/linkcol=0687f5/tracklist=false/artwork=small/transparent=true/" seamless&gt;&lt;a href="https://bauhaus.bandcamp.com/album/the-bela-session"&gt;The Bela Session by Bauhaus&lt;/a&gt;&lt;/iframe&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-04-27&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I know you&amp;rsquo;re going to be tempted to reply with &amp;ldquo;you&amp;rsquo;re using it wrong&amp;rdquo; - but I&amp;rsquo;m not. This is how I like to use my computer. And it is clear that the MacBook isn&amp;rsquo;t my computer - it is Apple&amp;rsquo;s. &amp;mdash; &lt;a href="https://shkspr.mobi/blog/2020/04/things-i-cant-do-on-macos-which-i-can-do-on-ubuntu/"&gt;Things I can&amp;rsquo;t do on MacOS which I can do on Ubuntu&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-04-27&lt;/a&gt;: &lt;a href="https://aperiodical.com/2022/03/now-im-calculating-with-constructive-reals/"&gt;Now I’m calculating with constructive reals!&lt;/a&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>Helix editor</title><link>https://aliquote.org/post/helix-editor/</link><pubDate>Sat, 23 Apr 2022 20:28:05 +0200</pubDate><guid>https://aliquote.org/post/helix-editor/</guid><description>&lt;p&gt;And here&amp;rsquo;s a fresh new text editor: &lt;a href="https://helix-editor.com/"&gt;Helix&lt;/a&gt;. In fact, I heard about about Helix one year ago, when it was still in early alpha, but I didn&amp;rsquo;t pay much attention to it. It is written in Rust, as many of the little apps (fdfind, exa, tig, etc.) I use all the day, much like one of the best-selling &lt;a href="https://neovide.dev/"&gt;UI for Neovim&lt;/a&gt;(not tested).&lt;/p&gt;
&lt;p&gt;Apparently, Helix got inspired by both Vim and Kakoune. It ships with LSP-ready configurations, as well as a default picker. How long will it stay on the &amp;ldquo;market&amp;rdquo;, I don&amp;rsquo;t know, but I like the idea. The best comment I found on &lt;a href="HN"&gt;Hacker News&lt;/a&gt; thus far was the one by &lt;a href="https://news.ycombinator.com/user?id=rodgerd"&gt;rodgerd&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If you&amp;rsquo;re trying to get people to try your new editor, no matter how awesome the ideas that you&amp;rsquo;re trying, you&amp;rsquo;re going to lose a chunk of your audience if it doesn&amp;rsquo;t support C syntax highlighting, a chunk if it doesn&amp;rsquo;t support Python intellisense, and so on and so forth. You can have the best idea in the world, but people will play with it, and decide that they love it but can&amp;rsquo;t use it for &amp;ldquo;real work&amp;rdquo; unless you slog through adding native support for a bunch of languages and runtimes/compiler suites.&lt;br&gt;
That&amp;rsquo;s a huge burden.&lt;br&gt;
Now, if you implement LSP, you get &amp;ldquo;for free&amp;rdquo; support for C#, C, Python, Rust, etc etc. People can evaluate your editor on its merits as a text editor, not on whether you had the time and energy to add support for their favourite language.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Soon after this comment, the whole comment thread starts to be a replay of the Vim vs. Emacs flame, and point-and-click vs. keyboard-driven approaches to text editing. I hope HN will still be alive after Twitter burned out of Hell.&lt;/p&gt;
&lt;p&gt;I spent a few hours playing with Helix today. I compiled it from scratch using &lt;code&gt;cargo&lt;/code&gt; and followed the instructions to set up its runtime (865 Mo!) and so on. It works really great, I mean for a text editor written from scratch in Rust. I really like the experience, even if some keybindings are not that intuitive when coming from (Neo)vim. This is easily &lt;a href="https://raw.githubusercontent.com/LGUG2Z/helix-vim/master/config.toml"&gt;configurable&lt;/a&gt;, though. Modal editing is great in any case, and I suspect it would look even more natural for people coming from &lt;a href="https://kakoune.org/"&gt;Kakoune&lt;/a&gt; which I never tried. For those coming from Neovim, I would say it feels the same, with sane defaults. The built-in LSP and Treesitter integrations work as advertised, and you also get some DAP debugging for Rust and C/C++. The configuration is easy to manage (this is a simple toml file), and there are plenty of gorgeous color themes to choose from. I do not really like the popup window that presents available combination of keypresses (much like which-key in Emacs or Vim), but I guess some like it. I am more comfortable with my own config for Neovim, but I would surely recommend Helix for anyone interested in a zero-config powerful text editor for coding. Fron what I&amp;rsquo;ve read over GitHub, the authors do not plan to add support for &lt;a href="https://github.com/helix-editor/helix/discussions/3806"&gt;third-party plugins&lt;/a&gt;. Maybe it&amp;rsquo;s a good idea after all. Eventually, there may be a &lt;a href="https://github.com/helix-editor/helix/issues/39"&gt;GUI&lt;/a&gt; at some point (one &lt;a href="https://github.com/helix-editor/helix/issues/39#issuecomment-868931992"&gt;screenshot&lt;/a&gt; comes from this webiste, btw).&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2022-11-09-21-24-33.png"&gt;
&lt;/figure&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2023-06-22]&lt;/small&gt;&lt;br&gt;
Here is an &lt;a href="https://phaazon.net/blog/more-hindsight-vim-helix-kakoune"&gt;excellent review&lt;/a&gt; of Helix, from an experimented (Neo)vim user, and how it compares to Neovim or Kakoune when it comes to performing simple or more complex editing tasks.
&lt;/div&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Ida Sand • &lt;em&gt;Burning&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Random links from April</title><link>https://aliquote.org/post/random-links-april/</link><pubDate>Wed, 20 Apr 2022 21:45:28 +0200</pubDate><guid>https://aliquote.org/post/random-links-april/</guid><description>&lt;p&gt;Here are some random links collected the past few days, mostly about Scheme and related languages/tools.&lt;/p&gt;
&lt;p&gt;Various scientific packages for Chicken Scheme:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/iraikov/chicken-dataframe"&gt;iraikov/chicken-dataframe&lt;/a&gt;, so we get some useful data structure like in &lt;a href="https://docs.racket-lang.org/data-frame/index.html"&gt;Racket&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/iraikov/chicken-mpi"&gt;raikov/chicken-mpi&lt;/a&gt;, some MPI bindings for Chicken Scheme.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/iraikov/chicken-lapack"&gt;iraikov/chicken-lapack&lt;/a&gt;, Chicken Scheme bindings for ATLAS and LAPACK; looks old but maybe it is worth a try.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/dieggsy/csl"&gt;dieggsy/csl&lt;/a&gt;, the mandatory toolbox for rapid prototyping; must check if everything is included.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Others:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.racket-lang.org/eopl/index.html"&gt;Essentials of Programming Languages Language&lt;/a&gt; in Racket (see &lt;a href="https://github.com/chenyukang/eopl"&gt;chenyukang/eopl&lt;/a&gt; for Chicken solutions).&lt;/li&gt;
&lt;li&gt;&lt;a href="https://icfp20.sigplan.org/home/scheme-2020"&gt;The Scheme and Functional Programming Workshop&lt;/a&gt; for 2020.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pointlessprogramming.wordpress.com/lispy-in-scheme/"&gt;Lispy in Scheme&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gaultier.github.io/blog/advent_of_code_2018_5"&gt;Getting started with Scheme by solving an Advent of Code 2018 challenge&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://elmord.org/blog/?entry=20191114-sbcl-chez"&gt;Chez Scheme vs. SBCL: a comparison&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dieggsy.com/post/fun-with-speech-synthesis-and-chicken-scheme.html"&gt;Fun with speech synthesis and Chicken Scheme&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://taoofmac.com/space/blog/2019/06/20/2310"&gt;Scheme-ing&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;Lisp is a great language and you too can trust it if you write numerical programs of 5000 lines or less. You can probably trust it for other tasks as well but I don&amp;rsquo;t have such an experience with Lisp. Please tell the world that Lisp is a great language for numerical/statistical analysis. Those who dismiss it are wrong. There&amp;rsquo;s absolutely no reason to not give it a trial. &lt;a href="https://lmf-ramblings.blogspot.com/2011/08/i-am-not-afraid-to-admit-that-ive-used.html"&gt;I am not afraid to admit that I&amp;rsquo;ve used Lisp for real work&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Lisa Hilton • &lt;em&gt;More Than Another Day&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>On choosing your colorscheme</title><link>https://aliquote.org/post/on-color-scheme/</link><pubDate>Tue, 19 Apr 2022 19:29:19 +0200</pubDate><guid>https://aliquote.org/post/on-color-scheme/</guid><description>&lt;p&gt;I devised my own variant of the Nord color theme for Neovim. I started with the most up to date package I found on GitHub (&lt;a href="https://github.com/shaunsingh/nord.nvim"&gt;shaunsingh/nord.nvim&lt;/a&gt;) and updated the default settings, which means that I removed almost all colors. Surely Nord is a dark theme, but a pretty decent one. The only competitor to date is &lt;a href="https://github.com/mcchrish/zenbones.nvim"&gt;zenbones&lt;/a&gt;, IMHO. Both Neovim plugins provide Treesitter-specific highlighting, and a bunch of highlight groups for various plugins.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-04-21-10-24-30.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-04-21-10-24-30.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-04-21-11-15.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-04-21-11-15.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Previously, I devised a similar &lt;a href="https://aliquote.org/post/editor-war/"&gt;dark theme&lt;/a&gt; for Doom Emacs, and later on a &lt;a href="https://aliquote.org/post/monochrome-color-scheme/"&gt;light duotone colorscheme&lt;/a&gt; for Vim. Both themes rely on similar principles: highlight constant (strings and numbers, with a dimmed color for the latter) using soft (pastel) color, and &amp;ldquo;top-level&amp;rdquo; reserved keywords, e.g. functions or classes, import statements and things like that, mostly using bold typeface or a lighter color. The rest is left as is, as otherwise it becomes distracting in my view. And losing attentional sight is not a good idea when you spend most of your day in front of your editor. In this regard, Nicolas Rougier&amp;rsquo;s &lt;a href="https://arxiv.org/abs/2008.06030"&gt;article&lt;/a&gt;, &lt;em&gt;On the design of text editors&lt;/em&gt;, is a great read, especially section 4 on colorization:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Wayne goes a step further and denounces the use of syntax highlighting since it is a waste of an important information channel and suggest several alternative uses of color, among which, rainbow parenthesis, context highlighting, import highlighting, argument highlighting, type highlighting, etc. Instead of syntax or semantic colorization based on content, a simple alternative would be to adapt colorization to the reader, taking attentional constraints into account.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2022-09-08]&lt;/small&gt;&lt;br&gt;
For a more extreme take, see &lt;a href="https://www.linusakesson.net/programming/syntaxhighlighting/"&gt;A case against syntax highlighting&lt;/a&gt;. See also &lt;a href="https://jameshfisher.com/2014/05/11/your-syntax-highlighter-is-wrong/"&gt;Your syntax highlighter is wrong&lt;/a&gt;.
&lt;/div&gt;
&lt;p&gt;Of course, your mileage may vary. What is important is that your colorscheme fits with your own perception and way of working, or in other words that it brings a little more to the table than &lt;a href="https://no-color.org/"&gt;no color&lt;/a&gt; at all.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Arno • &lt;em&gt;Help Me Mary&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>The unquantified self #22</title><link>https://aliquote.org/post/unquantified-self-022/</link><pubDate>Sun, 17 Apr 2022 21:52:46 +0200</pubDate><guid>https://aliquote.org/post/unquantified-self-022/</guid><description>&lt;p&gt;Things are growing, outside. Compare those two pictures, taken two months apart:&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1891.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1891.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1969.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1969.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;It&amp;rsquo;s already April and I feel like I haven&amp;rsquo;t written that much. Neither on this blog, nor on my digital notebook by the way. Anyway, time passes even if it is not to catch up with it. Regarding side projects, I still have in mind the idea of writing a statistical library for Scheme. It will probably target Racket and/or Chicken Scheme. I started playing again with the latter, which is now Chicken 5. I first learned about Chicken Scheme more than 10 years on Jan de Leeuw&amp;rsquo;s tech listserv. I played with it a little bit, but that&amp;rsquo;s all. Now that I reinstalled it, reread the documentation, and discovered that the IRC room is pretty active on Libera.chat, I thought it would be a good idea to investigate more time into the language itself. I don&amp;rsquo;t really want to investigate too much into Chez Scheme for it lacks tooling and packaging (although there are some external package managers, e.g., &lt;a href="https://akkuscm.org/"&gt;akku&lt;/a&gt;, but see &lt;a href="https://www.travishinkelman.com/getting-started-with-akku-package-manager-for-scheme/"&gt;Travis Hankelman&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;I spent a fair amount of time tinkering my Neovim setup lately. Unlike my last adventures with Doom Emacs, though, I&amp;rsquo;m never restarting from scratching, just refining things here and there. I tried a lot of packages, then uninstalled them right away. Likewise, I try to stay close to the default key mappings so as to learn Vim the right way, or I think so. I don&amp;rsquo;t know if I made that much progress since I started using Vim, but surely I&amp;rsquo;m more productive with this text editor than I was with Emacs. I&amp;rsquo;m on the HEAD version of Neovim, and it never crashed a single time in one year. The only minor annoyances that I encountered occasionally were from minor updates regarding core helper functions or updated color scheme elements. I have other opinions on Neovim versus Emacs, but I&amp;rsquo;ll keep it for a separate post. All this also goes hand in hand with my switch to the Regolith tiling window manager, which makes everything super easier compared to Gnome desktop&lt;/p&gt;
&lt;p&gt;My son and I discovered we missed some episodes of &lt;a href="https://en.wikipedia.org/wiki/The_Walking_Dead_(TV_series)"&gt;The Walking Dead&lt;/a&gt;, Season 10. Things are now settled since we just finished watching them the night before last. We now just have to find our way thru Season 11. I was surprised to hear AC/DC in the middle of one of the episodes, by the way.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Jean-Yves Thibaudet • &lt;em&gt;Adagio, Op. 11&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Tinkering my Neovim setup</title><link>https://aliquote.org/post/tinkering-vim/</link><pubDate>Thu, 14 Apr 2022 22:16:31 +0200</pubDate><guid>https://aliquote.org/post/tinkering-vim/</guid><description>&lt;p&gt;Yesterday, I spent a fair amount of time cleaning up my Neovim config files. This mostly consisted in removing non-essential plugins, and replacing old Vimscript with Lua code, thanks to the &lt;a href="https://github.com/echasnovski/mini.nvim"&gt;mini.nvim&lt;/a&gt; project. If you&amp;rsquo;re using &lt;a href="https://github.com/tpope/vim-surround"&gt;vim-surround&lt;/a&gt;, &lt;a href="https://github.com/phaazon/hop.nvim"&gt;hop&lt;/a&gt; or other jumper, or even &lt;a href="https://github.com/rhysd/clever-f.vim"&gt;clever-f&lt;/a&gt;, please have a look at what mini.nvim has to offer. It even features a minimal completion engine that I adopted right away since the successor of &lt;a href="https://github.com/hrsh7th/nvim-compe"&gt;nvim-compe&lt;/a&gt; is a no-brainer for me (why would we need to install 4 to 7 plugins instead of one?!).&lt;/p&gt;
&lt;p&gt;At some point I was about to discard &lt;a href="https://github.com/wbthomason/packer.nvim"&gt;packer&lt;/a&gt; and just rely on the builtin &lt;code&gt;packadd&lt;/code&gt; approach, together with a set of Git submodules, that Evgeni Chasnovski uses for his own &lt;a href="https://github.com/echasnovski/nvim"&gt;Neovim setup&lt;/a&gt;, but packer is great for it manages everything so gently, including filetype-specific plugins. Lazy loading is really great sometimes.&lt;/p&gt;
&lt;p&gt;Finally, the number of packages I rely on is limited and I believe my startup time remains quite decent (&amp;lt; 100 ms):&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;~ % tree -L &lt;span class="m"&gt;2&lt;/span&gt; .local/share/nvim/site/pack/packer
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.local/share/nvim/site/pack/packer
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── opt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│   ├── iron.nvim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│   ├── magma-nvim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│   ├── neogen
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│   ├── parinfer-rust
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│   ├── vim-table-mode
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│   ├── vim-test
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│   └── vimtex
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;└── start
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── Comment.nvim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── gitsigns.nvim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── null-ls.nvim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── nvim-dap
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── nvim-lightbulb
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── nvim-lspconfig
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── nvim-treesitter
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── packer.nvim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── plenary.nvim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── popup.nvim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── telescope-bibtex.nvim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── telescope-fzf-native.nvim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── telescope-github.nvim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── telescope.nvim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── telescope-symbols.nvim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; └── telescope-ui-select.nvim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="m"&gt;25&lt;/span&gt; directories, &lt;span class="m"&gt;0&lt;/span&gt; files
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;~ % vim-profiler.py nvim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Running nvim to generate startup logs... &lt;span class="k"&gt;done&lt;/span&gt;.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Loading and processing logs... &lt;span class="k"&gt;done&lt;/span&gt;.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Plugin directory: /home/chl/.local/share/nvim/site/pack/packer/start
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;=====================================&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Top &lt;span class="m"&gt;10&lt;/span&gt; plugins slowing nvim&lt;span class="err"&gt;&amp;#39;&lt;/span&gt;s &lt;span class="nv"&gt;startup&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;=====================================&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;1 0.774 nvim-treesitter
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2 0.183 telescope.nvim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;3 0.093 nvim-lspconfig
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;4 0.044 plenary.nvim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;=====================================&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;times&lt;/span&gt; in msec
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; clock self+sourced self: sourced script
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; clock elapsed: other lines
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Results from &lt;code&gt;vim --startuptime&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;000.020&lt;/span&gt; &lt;span class="mf"&gt;000.020&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;---&lt;/span&gt; &lt;span class="n"&gt;NVIM&lt;/span&gt; &lt;span class="n"&gt;STARTING&lt;/span&gt; &lt;span class="o"&gt;---&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;000.965&lt;/span&gt; &lt;span class="mf"&gt;000.945&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;locale&lt;/span&gt; &lt;span class="n"&gt;set&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;001.487&lt;/span&gt; &lt;span class="mf"&gt;000.523&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;inits&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;001.499&lt;/span&gt; &lt;span class="mf"&gt;000.012&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;window&lt;/span&gt; &lt;span class="n"&gt;checked&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;--------&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;--------&amp;gt;&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;076.311&lt;/span&gt; &lt;span class="mf"&gt;001.266&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;loading&lt;/span&gt; &lt;span class="n"&gt;rtp&lt;/span&gt; &lt;span class="n"&gt;plugins&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;076.683&lt;/span&gt; &lt;span class="mf"&gt;000.085&lt;/span&gt; &lt;span class="mf"&gt;000.085&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;sourcing&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;home&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;chl&lt;/span&gt;&lt;span class="o"&gt;/.&lt;/span&gt;&lt;span class="n"&gt;local&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;share&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;nvim&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;site&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;pack&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;packer&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;nvim&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;lspconfig&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;plugin&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;lspconfig&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;vim&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;077.273&lt;/span&gt; &lt;span class="mf"&gt;000.501&lt;/span&gt; &lt;span class="mf"&gt;000.501&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;sourcing&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;home&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;chl&lt;/span&gt;&lt;span class="o"&gt;/.&lt;/span&gt;&lt;span class="n"&gt;local&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;share&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;nvim&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;site&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;pack&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;packer&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;nvim&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;treesitter&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;plugin&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;nvim&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;treesitter&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;vim&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;077.435&lt;/span&gt; &lt;span class="mf"&gt;000.045&lt;/span&gt; &lt;span class="mf"&gt;000.045&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;sourcing&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;home&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;chl&lt;/span&gt;&lt;span class="o"&gt;/.&lt;/span&gt;&lt;span class="n"&gt;local&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;share&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;nvim&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;site&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;pack&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;packer&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;plenary&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nvim&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;plugin&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;plenary&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;vim&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;077.813&lt;/span&gt; &lt;span class="mf"&gt;000.183&lt;/span&gt; &lt;span class="mf"&gt;000.183&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;sourcing&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;home&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;chl&lt;/span&gt;&lt;span class="o"&gt;/.&lt;/span&gt;&lt;span class="n"&gt;local&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;share&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;nvim&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;site&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;pack&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;packer&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;telescope&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nvim&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;plugin&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;telescope&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;vim&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;077.952&lt;/span&gt; &lt;span class="mf"&gt;000.827&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;loading&lt;/span&gt; &lt;span class="n"&gt;packages&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;077.986&lt;/span&gt; &lt;span class="mf"&gt;000.034&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;loading&lt;/span&gt; &lt;span class="n"&gt;after&lt;/span&gt; &lt;span class="n"&gt;plugins&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;077.998&lt;/span&gt; &lt;span class="mf"&gt;000.013&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;inits&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;081.488&lt;/span&gt; &lt;span class="mf"&gt;003.489&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;reading&lt;/span&gt; &lt;span class="n"&gt;ShaDa&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;081.647&lt;/span&gt; &lt;span class="mf"&gt;000.159&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;opening&lt;/span&gt; &lt;span class="n"&gt;buffers&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;081.673&lt;/span&gt; &lt;span class="mf"&gt;000.027&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;BufEnter&lt;/span&gt; &lt;span class="n"&gt;autocommands&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;081.676&lt;/span&gt; &lt;span class="mf"&gt;000.003&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;editing&lt;/span&gt; &lt;span class="n"&gt;files&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;windows&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;082.048&lt;/span&gt; &lt;span class="mf"&gt;000.373&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;VimEnter&lt;/span&gt; &lt;span class="n"&gt;autocommands&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;082.052&lt;/span&gt; &lt;span class="mf"&gt;000.003&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;UIEnter&lt;/span&gt; &lt;span class="n"&gt;autocommands&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;082.432&lt;/span&gt; &lt;span class="mf"&gt;000.280&lt;/span&gt; &lt;span class="mf"&gt;000.280&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;sourcing&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;usr&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;share&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;nvim&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;runtime&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;autoload&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;provider&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;clipboard&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;vim&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;082.440&lt;/span&gt; &lt;span class="mf"&gt;000.108&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;before&lt;/span&gt; &lt;span class="n"&gt;starting&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt; &lt;span class="n"&gt;loop&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;083.690&lt;/span&gt; &lt;span class="mf"&gt;001.250&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;first&lt;/span&gt; &lt;span class="n"&gt;screen&lt;/span&gt; &lt;span class="n"&gt;update&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;083.692&lt;/span&gt; &lt;span class="mf"&gt;000.003&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;---&lt;/span&gt; &lt;span class="n"&gt;NVIM&lt;/span&gt; &lt;span class="n"&gt;STARTED&lt;/span&gt; &lt;span class="o"&gt;---&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I rewrote 50% of my old pure Vim config. The remaining is just the &lt;code&gt;after/ftplugin/*&lt;/code&gt;, &lt;code&gt;ftplugin/*&lt;/code&gt;, and &lt;code&gt;autoload/*&lt;/code&gt; stuff, which I keep as Vimscript for compatibility issues.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Adam Wakeman • &lt;em&gt;Lean on Me&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;&lt;a href="https://github.com/bchretien/vim-profiler"&gt;vim-profiler&lt;/a&gt; is available from GitHub.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in March</title><link>https://aliquote.org/post/micro-03-2022/</link><pubDate>Mon, 28 Mar 2022 10:10:12 +0200</pubDate><guid>https://aliquote.org/post/micro-03-2022/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-03-02&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Every few years a new company says you should use their special format. You have to pay them a monthly fee to use it — or keep all of your documents in their care. They offer some convenience or features, but at the cost of flexibility, portability, and independence. &amp;mdash; &lt;a href="https://sive.rs/plaintext"&gt;Write plain text files&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-03-02&lt;/a&gt;: I&amp;rsquo;ve long been ignorant of i3 &lt;a href="https://i3wm.org/docs/userguide.html#_scratchpad"&gt;scratchpad&lt;/a&gt;. Now that I use it, my music dispatcher looks much more comfortable.&lt;br&gt;&lt;img src="https://aliquote.org/img/2022-03-02-21-07-25.png" alt="img"&gt;See also &lt;a href="https://aaronlauterer.com/blog/2018/01/i3-scratchpad-to-access-often-used-applications/"&gt;I3 Scratchpad to access often used applications&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-02&lt;/a&gt;: &lt;a href="https://cs.stanford.edu/people/shadjis/blas.html"&gt;BLAS-level CPU Performance in 100 Lines of C&lt;/a&gt;. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-02&lt;/a&gt;: &lt;a href="https://felix-knorr.net/blog/using_gdb_directly.html"&gt;Debugging with GDB&lt;/a&gt;. See also &lt;a href="https://github.com/cyrus-and/gdb-dashboard"&gt;GDB dashboard&lt;/a&gt;. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-02&lt;/a&gt;: &lt;a href="https://funcall.blogspot.com/2022/02/symbols-vs-strings.html"&gt;Symbols vs. Strings &lt;/a&gt; (via &lt;a href="https://irreal.org/blog/?p=10323"&gt;Irreal&lt;/a&gt;). &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-03&lt;/a&gt;: &lt;a href="https://fukamachi.hashnode.dev/day-5-roswell-hidden-feature-of-s-option"&gt;Roswell: Hidden feature of &amp;ldquo;-s&amp;rdquo; option&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-04&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Steve Cardenas, &lt;em&gt;Language of Love&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-06&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Yumi Zouma, &lt;em&gt;Give It Hell&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-06&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;When the software changes, people want to know why and how. &amp;mdash; &lt;a href="https://keepachangelog.com/en/1.0.0/"&gt;Keep a Changelog&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-03-06&lt;/a&gt;: &lt;a href="https://github.com/wolfgarbe/SymSpell"&gt;SymSpell&lt;/a&gt;: 1 million times faster spelling correction &amp;amp; fuzzy search through Symmetric Delete spelling correction algorithm.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-06&lt;/a&gt;: &lt;a href="https://arne.me/blog/youre-using-email-wrong/"&gt;You&amp;rsquo;re using email wrong&lt;/a&gt;. My philosophy is much simpler: Inbox zero, block toxic people as well as spams and hoaxes.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-09&lt;/a&gt;: &lt;a href="https://dabeaz-course.github.io/practical-python/"&gt;Practical Python Programming&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-09&lt;/a&gt;: &lt;a href="https://yurichev.com/news/20220205_maildir/"&gt;[Unix] Maildir, mutt and vim&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-11&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;By carefully examining every album you own, you get to become more familiar with your library, its extent, its variation, and its quirks. People used to spend hours lovingly sorting and resorting their shelves of LPs. In the iTunes age, many of us toss our music into a heap and forget about it. This is great for some people. But there’s value in intimate, complete familiarity with your collection. So instead of a chore, try thinking of correcting tags as quality time with your music collection. That’s what I do. &amp;mdash; &lt;a href="https://beets.readthedocs.io/en/stable/guides/tagger.html"&gt;Using the Auto-Tagger&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-03-11&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I love Emacs, but doing everything in it is the wrong move. Doing it with this site was proof of that for me. &amp;mdash; &lt;a href="https://wozniak.ca/journal/2021/12-30.html"&gt;Wherein org-mode was a pain&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-03-11&lt;/a&gt;: &lt;a href="https://blog.tylerhou.io/posts/binary-search-with-confidence/"&gt;Binary search with confidence&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-11&lt;/a&gt;: &lt;a href="https://treyhunner.com/2019/05/python-builtins-worth-learning/"&gt;Python built-in functions to know&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-11&lt;/a&gt;: &lt;a href="https://wozniak.ca/blog/2022/03/01/1/index.html"&gt;Software Design for Flexibility: a review&lt;/a&gt;. &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-11&lt;/a&gt;: &lt;a href="https://www.phatcode.net/res/223/files/html/toc.html"&gt;The Art of Assembly language programming&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-14&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Happy Mondays, &lt;em&gt;Step On&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-14&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The two most important ways to make your text easy to read are a short line-length and the copious use of paragraphs. Viewing a single large block of run-away text with no line breaks immediately puts stress on the reader, as absorbing the information provided therein requires a high degree of concentration and eye movement. &amp;mdash; &lt;a href="https://www.netmeister.org/blog/the-art-of-plain-text.html"&gt;The art of plain text&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-03-14&lt;/a&gt;: &lt;a href="https://jmtd.net/log/archiving_jan_2022/"&gt;Amateur archiving activities, January 2022&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-14&lt;/a&gt;: &lt;a href="https://python-patterns.guide/"&gt;Python Design Patterns&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-14&lt;/a&gt;: &lt;a href="https://aaronhertzmann.com/2022/03/10/photographic-tone.html"&gt;Why Dark and Light is Complicated in Photographs&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-15&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   John Cale, &lt;em&gt;Chinese Envoy&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-15&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Many services have self-service account deletion tools, but often hide them so well that I failed to locate them without deferring to their customer support. On average, it took 24 interactions (menu clicks, password entries, etc.) after an initial login to request and confirm a deletion request. &amp;mdash; &lt;a href="https://www.ctrl.blog/entry/account-deletions-2021.html"&gt;Some discouraging anecdotes on how services handle account deletions&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-03-15&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;My initial reasons for giving up on OS X / macOS were due to my frustrations around developer tooling and package management, problems now largely solved by Homebrew. I got tired of being able to easily do certain kind of development on Linux and then struggle to get all the required pieces set up in the same way on OS X. Then, as soon as Homebrew began to resolve all that, Apple decided to ruin its laptops through the introduction of the awful and annoyingly-loud butterfly keyboard and touchbar. &amp;mdash; &lt;a href="https://wesmckinney.com/blog/linux-laptop-experience/"&gt;Linux Developer Laptops: Dell&amp;rsquo;s Precision 5500 series reigns supreme&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-03-15&lt;/a&gt;: &lt;a href="https://www.peterbaumgartner.com/blog/intro-to-just-enough-cython-to-be-useful/"&gt;An Introduction to Just Enough Cython to be Useful&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-17&lt;/a&gt;: &lt;a href="https://blog.jim-nielsen.com/2022/cluttered-web/"&gt;The Cluttered Web: A Scrapbook of Sreenshots&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-21&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Nicole Glover, &lt;em&gt;Hive Queen&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-21&lt;/a&gt;: &lt;a href="https://johnfactotum.github.io/foliate/"&gt;Foliate&lt;/a&gt;: A simple and modern eBook viewer for Linux desktops. I should note that Zathura handles Epub documents perfectly well.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-21&lt;/a&gt;: &lt;a href="https://gankra.github.io/blah/fix-rust-pointers/"&gt;Rust&amp;rsquo;s Unsafe Pointer Types Need An Overhaul&lt;/a&gt;. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-21&lt;/a&gt;: &lt;a href="https://adambaskerville.github.io/posts/LespEigenvalues/"&gt;T&amp;gt;T: When Double Precision is Not Enough&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-21&lt;/a&gt;: &lt;a href="https://aduros.com/blog/xterm-its-better-than-you-thought/"&gt;XTerm: It&amp;rsquo;s Better Than You Thought&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-22&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/66966067355__8F40B6A7-7831-42E6-9F95-00A48E6B224B.JPG" alt="img"&gt;&lt;small&gt;First peony on the balcony.&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-22&lt;/a&gt;: &lt;a href="https://250bpm.com/blog:71/"&gt;Structured Concurrency&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-23&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Alice in Chains, &lt;em&gt;Rooster&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-23&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Authors always say the best way to write better is to read more, which I can vouch for in blogging. Building up some RSS feeds in an aggregator like The Old Reader can be a great source of inspiration.&lt;br&gt;&amp;gt; But it’s also important to stress that this is only one approach. 8,000 posts sounds superficially impressive, but doesn’t speak to quality or detail. Writing a few posts a year is just as valid and worthwhile. If you’re having fun doing it, who cares. &amp;mdash; &lt;a href="https://rubenerd.com/8000-post-feedback-and-regular-writing/"&gt;8,000 post feedback, and regular writing&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-03-23&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Random effects/mixed effects models shine for multi-level data such as measurements within cities within counties within states. They can also deal with measurements clustered within subjects. There are at least two contexts for the latter: rapidly repeated measurements where elapsed time is not an issue, and serial measurements spaced out over time for which time trends are more likely to be important. An example of the first is a series of tests on a subject over minutes when the subject does not fatigue. An example of the second is a typical longitudinal clinical trial where patient responses are assessed weekly or monthly. For the first setup, random effects are likely to capture the important elements of within-subject correlation. Not so much for the second setup, where serial correlation dominates and time ordering is essential. &amp;mdash; &lt;a href="https://www.fharrell.com/post/re/"&gt;Longitudinal Data: Think Serial Correlation First, Random Effects Second&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-03-23&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;[I]n biology, when one research team publishes something useful, then other labs want to use it too. Important work in biology gets replicatedall the time—not because people want to prove it’s right, not because people want to shoot it down, not as part of a “replication study,” but just because they want to use the method. So if there’s somethingthat everybody’s talking about, and it doesn’t replicate, word will get out. &amp;mdash; &lt;a href="https://statmodeling.stat.columbia.edu/2022/03/04/biology-as-a-cumulative-science-and-the-relevance-of-this-idea-to-replication/"&gt;Biology as a cumulative science, and the relevance of this idea to replication&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-03-23&lt;/a&gt;: Nice &lt;a href="https://github.com/MrOtherGuy/firefox-csshacks/blob/master/chrome/hide_tabs_with_one_tab.css"&gt;add-on&lt;/a&gt; to hide Firefox tab when there&amp;rsquo;s only one.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-23&lt;/a&gt;: &lt;a href="https://chrismorgan.info/blog/rust-ownership-the-hard-way/"&gt;Rust ownership, the hard way&lt;/a&gt;. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-23&lt;/a&gt;: &lt;a href="https://www.peterbaumgartner.com/blog/logging-beyond-print/"&gt;Two Logging Options Better than Print Statements&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-24&lt;/a&gt;: &lt;a href="https://latexref.xyz/"&gt;LaTeX2e unofficial reference manual&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-25&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Mo-Dettes, &lt;em&gt;White Mice&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-03-25&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Some developers won’t use an editor without a debugger, or linting, or Git built-in. For me, these aren’t hard requirements but are bonuses. Indeed, most good editors have these, or plugins that enable them. How useful they’re all depends on the language and platform you’re developing for. &amp;mdash; &lt;a href="https://console.dev/articles/neovim-best-code-editor-ide-for-developers/"&gt;Why Neovim is the best code editor / IDE for developers&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-03-25&lt;/a&gt;: Hot off the kitchen.
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/66992116526__1F68B90B-A120-41F6-BB17-BDF38CF0395F.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/66992116526__1F68B90B-A120-41F6-BB17-BDF38CF0395F.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/66992125824__FD08748E-3A34-43B1-A24B-EAB645901585.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/66992125824__FD08748E-3A34-43B1-A24B-EAB645901585.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;&lt;/p&gt;</description></item><item><title>Some handy shortcuts for Vim</title><link>https://aliquote.org/post/vim-handy-shortcuts/</link><pubDate>Wed, 23 Mar 2022 14:07:02 +0100</pubDate><guid>https://aliquote.org/post/vim-handy-shortcuts/</guid><description>&lt;p&gt;Over the past two years where I&amp;rsquo;ve been using Neovim exclusively, I settled upon a few keybindings that I found on the internet and that I came to appreciate. I should note that I am now using &lt;a href="https://github.com/nvim-telescope/telescope.nvim"&gt;Telescope&lt;/a&gt; instead of vim-fzf, and so many mappings are provided by this Neovim plugin:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;C-s&amp;gt;&lt;/code&gt; in insert mode, this is used to correct the last typo (using the first suggestion) while in normal mode it allows to replace the word under the cursor.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;C-p&amp;gt;&lt;/code&gt; to navigate files (&lt;code&gt;Telescope find_files&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;C-q&amp;gt;&lt;/code&gt; calls a little function to close or open the quickfix (if there&amp;rsquo;re some items to show).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;leader&amp;gt;g&lt;/code&gt; and &lt;code&gt;&amp;lt;leader&amp;gt;G&lt;/code&gt; to quickly check git status (for the whole directory or the current buffer).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;C-f&amp;gt;&lt;/code&gt; as a shortcut for &lt;code&gt;Telescope live_grep&lt;/code&gt;; using the Ivy theme and a 20% window at the bottom, it really shines. See the screenshot at the end of the post.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;C-x&amp;gt;&lt;/code&gt; is actually a shortcut for &lt;code&gt;&amp;quot;_dP&lt;/code&gt;, and it is pretty cool since it allows to visually select a region and paste it over and over again on visual blocks selected afterwards.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;C-h&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;C-j&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;C-k&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;C-l&amp;gt;&lt;/code&gt; to increase/decrease split width or height (e.g., &lt;code&gt;&amp;lt;C-h&amp;gt;&lt;/code&gt; stands for &lt;code&gt;:vertical resize -4&amp;lt;CR&amp;gt;&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;C-Left&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;C-Right&amp;gt;&lt;/code&gt; to navigate between tabs, since I can use w/b and W/B for horizontal word-wise motion. I also use &lt;code&gt;&amp;lt;localleader&amp;gt;&amp;lt;tab&amp;gt;&lt;/code&gt; to create new tabs.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;leader&amp;gt;&amp;lt;leader&amp;gt;&lt;/code&gt; to switch between opened buffers (&lt;code&gt;Telescope buffers&lt;/code&gt;). Note that &lt;code&gt;&amp;lt;C-b&amp;gt;&lt;/code&gt; would be better, but it&amp;rsquo;s already the primary key for Tmux and I became used to the space-space combo after 3 years of Doom Emacs.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;leader&amp;gt;e&lt;/code&gt; which is basically &lt;code&gt;:e &amp;lt;C-R&amp;gt;=expand(&amp;quot;%:p:h&amp;quot;) . &amp;quot;/&amp;quot; &amp;lt;CR&amp;gt;&lt;/code&gt;; I used it most of the day, since it allows to quickly open a file in the current working directory, with tab completion.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;leader&amp;gt;r&lt;/code&gt; as a shortcut for &lt;code&gt;Telescope oldfiles&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;leader&amp;gt;$&lt;/code&gt; and &lt;code&gt;&amp;lt;leader&amp;gt;!&lt;/code&gt; to open a terminal in a new tab or in a split, respectively.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;localleader&amp;gt;s&lt;/code&gt; or &lt;code&gt;&amp;lt;localleader&amp;gt;S&lt;/code&gt; to sort a region in lexicographic order (increasing or decreasing).&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;localleader&amp;gt;&amp;quot;&lt;/code&gt; for &lt;a href="https://github.com/danymat/neogen"&gt;Neogen&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See also this related post: &lt;a href="https://aliquote.org/post/vim-shortcuts/"&gt;Custom Vim shortcuts (2/n)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In addition to the above, I also have handy shortcuts for &lt;a href="https://aliquote.org/post/jupyter-kernels-in-vim/"&gt;Magma&lt;/a&gt;, &lt;code&gt;vim-surround&lt;/code&gt;-like stuff,&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt; etc.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2022-03-23-15-20-21.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Finally, I don&amp;rsquo;t really like or need snippet engines, so I just defined some handy abbreviations, like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-vim" data-lang="vim"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;iabbrev&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;&lt;span class="nx"&gt;w&lt;/span&gt; []&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;iabbrev&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;@ &lt;span class="nx"&gt;chl&lt;/span&gt;@&lt;span class="nx"&gt;aliquote&lt;/span&gt;.&lt;span class="nx"&gt;org&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;iabbrev&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;% &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="m"&gt;-8&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;--------&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;--------&amp;gt;&lt;/span&gt;&lt;span class="m"&gt;8&lt;/span&gt;&lt;span class="p"&gt;--&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Up&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;iabbrev&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;&amp;#39; ``
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;iabbrev&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;&amp;#34; ```&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;```&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Esc&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;k
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;iabbrev&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;:: ¯\&lt;span class="nx"&gt;_&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ツ&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nx"&gt;_&lt;/span&gt;/¯
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;iabbrev&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;:&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nx"&gt;ಠ_ಠ&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;iabbrev&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;:&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;ಠ‿ಠ&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Charlie Haden • &lt;em&gt;Conception&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;c-g&amp;gt;u&amp;lt;Esc&amp;gt;[s1z=`]a&amp;lt;c-g&amp;gt;u&lt;/code&gt; (Credit: &lt;a href="https://castel.dev/post/lecture-notes-1/"&gt;Gilles Castel&lt;/a&gt;, see also &lt;a href="https://spaceandtim.es/etc/vim_notetaking/"&gt;Francis Tseng&lt;/a&gt; or &lt;a href="https://stackoverflow.com/q/5312235/420055"&gt;SO&lt;/a&gt;), and &lt;code&gt;:let @s='\&amp;lt;'.expand('&amp;lt;cword&amp;gt;').'\&amp;gt;'&amp;lt;CR&amp;gt;:%s/&amp;lt;C-r&amp;gt;s//&amp;lt;Left&amp;gt;&lt;/code&gt; and &lt;code&gt;sy:%s/&amp;lt;C-r&amp;gt;s//&amp;lt;Left&amp;gt;&lt;/code&gt; (Credit: &lt;a href="https://bluz71.github.io/2019/03/11/find-replace-helpers-for-vim.html"&gt;bluz71&lt;/a&gt;)&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;&lt;code&gt;vip:sort u&amp;lt;CR&amp;gt;&lt;/code&gt; in visual mode and &lt;code&gt;:sort u&amp;lt;CR&amp;gt;&lt;/code&gt; in normal mode (Credit: &lt;a href="https://github.com/strager/dotfiles"&gt;strager&lt;/a&gt;)&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:3"&gt;
&lt;p&gt;E.g., &lt;code&gt;vnoremap _( :call text#surround('(', ')')&amp;lt;CR&amp;gt;&lt;/code&gt;&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Auto-tagging my music library</title><link>https://aliquote.org/post/auto-tagging-my-music/</link><pubDate>Sat, 12 Mar 2022 21:12:02 +0100</pubDate><guid>https://aliquote.org/post/auto-tagging-my-music/</guid><description>&lt;p&gt;I use &lt;a href="https://aliquote.org/post/cmus/"&gt;Cmus&lt;/a&gt; as my main media player, and occasionally &lt;a href="https://mpv.io/"&gt;mpv&lt;/a&gt; although I mostly use the later for video playback (including &lt;a href="https://streamlink.github.io/"&gt;streamlink&lt;/a&gt;). I&amp;rsquo;m pretty happy with my current setup. Everything runs from a terminal, there&amp;rsquo;s no fancy UI nor unwanted distraction, just the raw output. My music library actually weighs about 62 Go and it&amp;rsquo;s full of MP3, some OGG as well as some videos, but not everything is in order. I mean, I miss a lot of tags for some albums that I ripped from my personal CD collection. Here comes the idea of auto-tagging everything. I tried three solutions. Here are my very first impressions.&lt;/p&gt;
&lt;p&gt;I tested all three software on a specific folder in my database, which I know is not the easiest one, since it features a mix of A Certain Ratio and Joy Division&amp;rsquo;s live shows, among others. And I warmly recommend everything from &lt;a href="https://www.ilikeyouroldstuff.com/news/40-years-of-factory-records"&gt;The Factory Records&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="beets"&gt;Beets&lt;/h3&gt;
&lt;p&gt;At first, I was impressed by &lt;a href="https://beets.io/"&gt;beets&lt;/a&gt;, especially since it is a command-line only utility, which comes with many add-ons (aka plugins). I configured its settings based on the documentation and what I could find on the intertube.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Tagging:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Various Artists - Live at Leigh Rock Festival &lt;span class="m"&gt;1979&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;URL:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; https://musicbrainz.org/release/e01790b2-77ba-4b7d-8383-118a6cdc700d
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;(&lt;/span&gt;Similarity: 47.9%&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;missing tracks&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;2xCD, 2006, GB, Ozit&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;CD &lt;span class="m"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Missing tracks &lt;span class="o"&gt;(&lt;/span&gt;29/35 - 82.9%&lt;span class="o"&gt;)&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ! Leigh Festival Stage Announcements/Disorder &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="c1"&gt;# 1) (3:59)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ! Leaders of Men &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="c1"&gt;# 2) (2:35)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ! Colony &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="c1"&gt;# 3) (3:56)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ! Insight &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="c1"&gt;# 4) (3:39)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ! Digital &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="c1"&gt;# 5) (2:48)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ! Dead Souls &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="c1"&gt;# 6) (4:18)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ! Shadowplay &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="c1"&gt;# 7) (3:30)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ! She&lt;span class="s1"&gt;&amp;#39;s Lost Control (# 8) (3:24)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt; ! Transmission (# 9) (4:04)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt; ! Interzone (#10) (2:08)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt; ! Intro of Sound of Music (#11) (0:25)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt; ! Tony Wilson Fucker (#12) (3:01)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt; ! Messages (#19) (4:36)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt; ! Bunker Soldiers (#20) (2:52)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt; ! Julia&amp;#39;&lt;/span&gt;s Song &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="c1"&gt;#21) (4:16)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ! VCBXL &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="c1"&gt;#22) (4:07)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ! Almost &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="c1"&gt;#23) (3:56)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ! Red Frame White Light &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="c1"&gt;#24) (3:45)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ! Mystery Reality &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="c1"&gt;#25) (3:28)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ! Electricity &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="c1"&gt;#26) (3:54)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ! Second Head &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="c1"&gt;#27) (4:00)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ! Brave Boys Keep Their Promises &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="c1"&gt;#28) (2:31)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ! Sleeping Gas &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="c1"&gt;#29) (3:45)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ! Take a Chance &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="c1"&gt;#30) (2:30)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ! Ha Ha I&lt;span class="err"&gt;&amp;#39;&lt;/span&gt;m a Drowning &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="c1"&gt;#31) (4:16)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ! Read It in Books &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="c1"&gt;#32) (2:32)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ! Straight Reigns &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="c1"&gt;#33) (2:26)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ! Camera Camera &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="c1"&gt;#34) (3:07)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ! Went Crazy &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="c1"&gt;#35) (3:20)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Apply, More candidates, Skip, Use as-is, as Tracks, Group albums,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Enter search, enter Id, aBort, plaY? M
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Finding tags &lt;span class="k"&gt;for&lt;/span&gt; album &lt;span class="s2"&gt;&amp;#34;Various Artists - Live at Leigh Rock Festival 1979&amp;#34;&lt;/span&gt;.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Candidates:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;1. Various Artists - Live at Leigh Rock Festival &lt;span class="m"&gt;1979&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;47.9%&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;missing tracks&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;2xCD, 2006, GB, Ozit&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2. Joy Division - Leigh Rock Festival &lt;span class="o"&gt;(&lt;/span&gt;21.6%&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;tracks, id, missing tracks, ...&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;12&lt;span class="s2"&gt;&amp;#34; Vinyl, 2008, GB, Ozit-Morpheus Records, OZITLP8796)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;3. Whitesnake - Live at Reading Rock Festival 1979 (19.4%) (tracks, id, artist, ...) (CD, 2011, XE, EMI, 50999 679550 2 2)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;4. Bernard O Neill - Zumzeaux Live at Edinburgh Folk Festival 1993 (15.6%) (tracks, id, missing tracks, ...) (bandcamp, Vinyl, 2021, FR, Bernard O Neill)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;5. Betsy Bell &amp;amp; Mary Gray, Come A Maying, Gemma Khawaja - Live at Leigh Folk Festival 2014 (14.9%) (tracks, id, artist, ...) (bandcamp, Digital Media, 2014, GB, Gemma Khawaja)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;6. H.E.A.T - Live at Sweden Rock Festival (14.9%) (tracks, missing tracks, id, ...) (Digital Media, 2019, XW, earMUSIC)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;7. Various Artists - Rock On: 1979 (14.1%) (tracks, missing tracks, id, ...) (1996, US)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;8. Various Artists - Suomi-rock 1979 (13.5%) (missing tracks, tracks, id, ...) (CD, 1994, FI, Poko Rekords, CDROCK 79)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;9. Crazyhead - Live at Reading Rock Festival 1989 remastered audio. (13.3%) (id, unmatched tracks, artist, ...) (bandcamp, Digital Media, 2016, GB, Crazyhead)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;10. Steel Pulse - Live at Montreux Jazz Festival 1979 (11.9%) (tracks, id, artist, ...) (1979, CH)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;11. ETRON FOU LELOUBLAN - Live At The Rock In Opposition Festival, 1978 (11.8%) (tracks, id, artist, ...) (bandcamp, Vinyl, 2015, FR, Replica Records)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;12. 1978, Etron Fou Le Loublan,  “ Live At The Rock In Opposition Festival - New London Theatre »
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;par Dino (6.4%) (id, unmatched tracks, artist, ...) (bandcamp, Digital Media, 2018, FR, Revue &amp;amp; Corrigée)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;# selection (default 1), Skip, Use as-is, as Tracks, Group albums,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;Enter search, enter Id, aBort, plaY?
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It is nice that it asks us to decide what to do next. However, it may soon become cumbersome for mass retagging. Moreover, the returned results are not always very accurate, even if the above example doesn&amp;rsquo;t exemplify this claim. On the first run, the correct 2 CD set did not figure on the first position, although I don&amp;rsquo;t why it is the case when I replicated the import process later.&lt;/p&gt;
&lt;h3 id="onetagger"&gt;Onetagger&lt;/h3&gt;
&lt;p&gt;I came across this software by chance. I was surprised there was a Linux ready binary to download. The UI is quite nicely done, and it is easy to start the auto-tagging process. You must select one or more external sources, including iTunes (with limited queries) or Spotify (needs a free account). The results were quite deceptive. I got a lot of failed downloads from one source, and even if all queries to Apple Music were okay (but not that successful), I ended up with all ID3 infos removed from my tracks. Don&amp;rsquo;t know why.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;--8&amp;lt;--------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Mar &lt;span class="m"&gt;12&lt;/span&gt; 20:57:18.106 INFO &lt;span class="o"&gt;[&lt;/span&gt;ITunes&lt;span class="o"&gt;]&lt;/span&gt; State: Ok, Accuracy: Some&lt;span class="o"&gt;(&lt;/span&gt;1.0&lt;span class="o"&gt;)&lt;/span&gt;, Path: /home/chl/Media/Music/Albums/A Certain Ratio/Live At Leigh Rock Festiv
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;al &lt;span class="s1"&gt;&amp;#39;79 [Disc 1]/1-17 Crippled Child.mp3, module: onetagger::tagger
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;Mar 12 20:57:18.106 INFO iTunes rate limit delay: 2956, module: onetagger::tagger::itunes
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;Mar 12 20:57:21.489 INFO [ITunes] State: Ok, Accuracy: Some(1.0), Path: /home/chl/Media/Music/Albums/A Certain Ratio/Live At Leigh Rock Festiv
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;al &amp;#39;&lt;/span&gt;&lt;span class="m"&gt;79&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;Disc 1&lt;span class="o"&gt;]&lt;/span&gt;/1-15 All Night Party.mp3, module: onetagger::tagger
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Mar &lt;span class="m"&gt;12&lt;/span&gt; 20:57:21.490 INFO iTunes rate limit delay: 2952, module: onetagger::tagger::itunes
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Mar &lt;span class="m"&gt;12&lt;/span&gt; 20:57:24.748 INFO &lt;span class="o"&gt;[&lt;/span&gt;ITunes&lt;span class="o"&gt;]&lt;/span&gt; State: Ok, Accuracy: Some&lt;span class="o"&gt;(&lt;/span&gt;1.0&lt;span class="o"&gt;)&lt;/span&gt;, Path: /home/chl/Media/Music/Albums/A Certain Ratio/Live At Leigh Rock Festiv
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;al &lt;span class="s1"&gt;&amp;#39;79 [Disc 1]/1-13 Faceless.mp3, module: onetagger::tagger
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;Mar 12 20:57:24.748 INFO iTunes rate limit delay: 2963, module: onetagger::tagger::itunes
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;Mar 12 20:57:28.075 INFO [ITunes] State: Ok, Accuracy: Some(1.0), Path: /home/chl/Media/Music/Albums/A Certain Ratio/Live At Leigh Rock Festiv
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;al &amp;#39;&lt;/span&gt;&lt;span class="m"&gt;79&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;Disc 1&lt;span class="o"&gt;]&lt;/span&gt;/1-18 Flight.mp3, module: onetagger::tagger
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Mar &lt;span class="m"&gt;12&lt;/span&gt; 20:57:28.076 INFO iTunes rate limit delay: 2954, module: onetagger::tagger::itunes
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Mar &lt;span class="m"&gt;12&lt;/span&gt; 20:57:31.489 INFO &lt;span class="o"&gt;[&lt;/span&gt;ITunes&lt;span class="o"&gt;]&lt;/span&gt; State: Ok, Accuracy: Some&lt;span class="o"&gt;(&lt;/span&gt;1.0&lt;span class="o"&gt;)&lt;/span&gt;, Path: /home/chl/Media/Music/Albums/A Certain Ratio/Live At Leigh Rock Festiv
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;al &lt;span class="s1"&gt;&amp;#39;79 [Disc 1]/1-14 I Feel.mp3, module: onetagger::tagger
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;Mar 12 20:57:31.491 INFO iTunes rate limit delay: 2955, module: onetagger::tagger::itunes
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;Mar 12 20:57:35.100 INFO [ITunes] State: Ok, Accuracy: Some(1.0), Path: /home/chl/Media/Music/Albums/A Certain Ratio/Live At Leigh Rock Festiv
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;al &amp;#39;&lt;/span&gt;&lt;span class="m"&gt;79&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;Disc 1&lt;span class="o"&gt;]&lt;/span&gt;/1-16 The Choir.mp3, module: onetagger::tagger
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Mar &lt;span class="m"&gt;12&lt;/span&gt; 20:57:35.101 INFO iTunes rate limit delay: 2957, module: onetagger::tagger::itunes
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Mar
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;--------&amp;gt;8--
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="picard"&gt;Picard&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://musicbrainz.org/"&gt;MusicBrainz&lt;/a&gt; is a recognized platform for tagging. Picard uses its database to fetch track&amp;rsquo;s tags, album cover, etc. It is easy to install on Ubuntu (you just have to add the recommended PPA and ask for &lt;code&gt;sudo apt update &amp;amp;&amp;amp; sudo apt install picard&lt;/code&gt;). Last time I gave it a try, I found it not so intuitive. But now I realize that (1) it is fast and (2) it provides reliable results. It even added the lyrics. Deal.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;~/.../A Certain Ratio/Live At Leigh Rock Festival &lt;span class="s1"&gt;&amp;#39;79 [Disc 1] % id3v2 -l 1-13\ Faceless.mp3
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;id3v1 tag info for 1-13 Faceless.mp3:
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;Title : Faceless Artist: A Certain Ratio
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;Album : Live at Leigh Rock Festival 19 Year: 2006, Genre: Rock (17)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;Comment: Track: 13
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;id3v2 tag info for 1-13 Faceless.mp3:
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;TIT2 (Title/songname/content description): Faceless
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;TPE1 (Lead performer(s)/Soloist(s)): A Certain Ratio
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;TRCK (Track number/Position in set): 13/18
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;TALB (Album/Movie/Show title): Live at Leigh Rock Festival 1979
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;TPOS (Part of a set): 1/2
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;TCON (Content type): Rock (17)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;TBPM (BPM (beats per minute)): 0
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;TCMP (): frame
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;TMED (Media type): CD
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;TDAT (Date): 2407
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;TORY (Original release year): 2006
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;TPUB (Publisher): Ozit
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;TYER (Year): 2006
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;IPLS (Involved people list): ,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;TXXX (User defined text information): (SCRIPT): Latn
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;TPE2 (Band/orchestra/accompaniment): Various Artists
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;TSO2 (): frame
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;TSOP (): frame
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;TXXX (User defined text information): (ASIN): B000F9RME8
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;TXXX (User defined text information): (originalyear): 2006
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;TXXX (User defined text information): (ARTISTS): A Certain Ratio
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;UFID (Unique file identifier): http://musicbrainz.org, 36 bytes
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;TXXX (User defined text information): (MusicBrainz Album Status): official
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;TXXX (User defined text information): (MusicBrainz Album Release Country): GB
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;TXXX (User defined text information): (MusicBrainz Album Type): album/compilation/live
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;TXXX (User defined text information): (Acoustid Id): fcbc4ae0-1982-41d7-9961-1da4663c3021
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;TXXX (User defined text information): (MusicBrainz Album Id): e01790b2-77ba-4b7d-8383-118a6cdc700d
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;TXXX (User defined text information): (MusicBrainz Artist Id): 73577e86-4da8-4d76-949d-34c757e053be
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;TXXX (User defined text information): (MusicBrainz Album Artist Id): 89ad4ac3-39f7-470e-963a-56509c546377
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;TXXX (User defined text information): (MusicBrainz Release Group Id): 0ac9fd10-73e7-3d48-b1e0-c45b788130bb
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;TXXX (User defined text information): (MusicBrainz Release Track Id): 34e13319-80ff-32ca-9d07-73675a0d37b0
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;USLT (Unsynchronized lyric/text transcription): ()[XXX]: Tekst piosenki:
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;Go on, close the door
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;Leave me alone again
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;Hide the sun, bring me darkness
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;Let the walls come swallow me
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;I breathe in deep and taste my senses
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;For one last time, I know I&amp;#39;&lt;/span&gt;ll be free
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;I breathe in deep, vigilant senses
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;I&lt;span class="s1"&gt;&amp;#39;m not enslaved, I&amp;#39;&lt;/span&gt;ll fly again in my dreams
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Feeling sad and blue and lost and cold
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Counting hours, building towers, watch them all collapse
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;I breathe in deep and taste my senses
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;For one last time, I know I&lt;span class="s1"&gt;&amp;#39;ll be free
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;I breathe in deep, vigilant senses
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;I&amp;#39;&lt;/span&gt;m not enslaved, I&lt;span class="s1"&gt;&amp;#39;ll fly again in my dreams
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;All the cowards let&amp;#39;&lt;/span&gt;s step up and speak our minds, will you listen?
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Be the judge and face the fact. How you and me are both to blame
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;My spirit fades, my need remains untouched
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;My night has come, and it will be my last
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;I breathe in deep and taste my senses
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;For one last time, I know I&lt;span class="s1"&gt;&amp;#39;ll be free
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;I breathe in deep, vigilant senses
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;I&amp;#39;&lt;/span&gt;m not enslaved, I&lt;span class="s1"&gt;&amp;#39;ll fly again in my dreams
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;I breathe in deep and taste my senses
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;For one last time, I know I&amp;#39;&lt;/span&gt;ll be free
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;I breathe in deep, vigilant senses
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;I&lt;span class="s1"&gt;&amp;#39;m not enslaved, I&amp;#39;&lt;/span&gt;ll fly again in my dreams
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Dodaj interpretację &lt;span class="k"&gt;do&lt;/span&gt; tego tekstu »
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Historia edycji tekstu
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;APIC &lt;span class="o"&gt;(&lt;/span&gt;Attached picture&lt;span class="o"&gt;)&lt;/span&gt;: &lt;span class="o"&gt;(&lt;/span&gt;e&lt;span class="o"&gt;)[&lt;/span&gt;, 3&lt;span class="o"&gt;]&lt;/span&gt;: image/jpeg, &lt;span class="m"&gt;166930&lt;/span&gt; bytes
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I yet have to tag my all library database. Wishing me luck, then!&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Joy Bogat • &lt;em&gt;Sometimes&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Vim and clangd</title><link>https://aliquote.org/post/vim-clangd/</link><pubDate>Tue, 08 Mar 2022 21:35:53 +0100</pubDate><guid>https://aliquote.org/post/vim-clangd/</guid><description>&lt;p&gt;Bioinformatics is what I officially do for a living nowadays, along web dev &amp;ndash; yes, those pretty little command-line tools are often better served using a Bootstrap-based Flask or Django framework, you know. Bioinformatics is cool, but it takes as much time as running a multi-level Bayesian &lt;abbr title="Item Response Theory"&gt;IRT&lt;/abbr&gt; model, especially on those low cost servers we got at the University. Today I decided to enjoy my free time while processing several tasks in parallel in the background (read mapping and genome assembly) and to dive into my Neovim config.&lt;/p&gt;
&lt;p&gt;I removed a few unused packages, as usual. I tried a few other ones, because why not. The most surprising finding was that the successor of &lt;a href="https://github.com/hrsh7th/nvim-compe"&gt;&amp;lsquo;hrsh7th/nvim-compe&amp;rsquo;&lt;/a&gt; (now defunct), which is what I use as a basic completion engine for all things related to LSP, buffer and command-line management, is &lt;a href="https://github.com/hrsh7th/nvim-cmp"&gt;nvim-cmp&lt;/a&gt;. It is maintained by the same author but this plugin is just asking us to install a ton of additional plugins (e.g., one for LSP stuff, one for buffer, one for &lt;code&gt;:&lt;/code&gt; stuff, and so on). I can understand why (one target, one package), but I find it weird that we can&amp;rsquo;t get a unified UI for things like completion. After all, we only have to manage one package to get all LSP settings, isn&amp;rsquo;t it? Anyway, I tried this approach and just gave up: too much noise (why do we need to enable a snippet engine system, even if we don&amp;rsquo;t need one, BTW?), not that many improvements over my bare use of completion needs. I reverted back to &lt;code&gt;nvim-compe&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Later on, I wanted to test my c/c++ config more extensively, with two prerequisites: It should rely on clang-based workflow, and it should support both standard Makefile (for C) and CMake (for C and C++, but since I don&amp;rsquo;t do C++ the later is mostly to ensure that I can compile others&amp;rsquo; codebase).&lt;/p&gt;
&lt;p&gt;I came across a lot of posts dealing with how to setup Vim or Neovim and LSP/Clangd. I already had the bare config for &lt;a href="https://github.com/neovim/nvim-lspconfig"&gt;&amp;rsquo;neovim/nvim-lspconfig&amp;rsquo;&lt;/a&gt;, which is (mostly):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lua" data-lang="lua"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;nvim_lsp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;lspconfig&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;on_attach&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kr"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bufnr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="kr"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(...)&lt;/span&gt; &lt;span class="n"&gt;vim.api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nvim_buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bufnr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...)&lt;/span&gt; &lt;span class="kr"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="kr"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;buf_set_option&lt;/span&gt;&lt;span class="p"&gt;(...)&lt;/span&gt; &lt;span class="n"&gt;vim.api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nvim_buf_set_option&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bufnr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...)&lt;/span&gt; &lt;span class="kr"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_option&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;omnifunc&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;v:lua.vim.lsp.omnifunc&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;noremap&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;silent&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;n&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&amp;lt;localleader&amp;gt;w=&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&amp;lt;cmd&amp;gt;lua vim.lsp.buf.formatting_sync(nil, 100)&amp;lt;CR&amp;gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;localleader&amp;gt;wa&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;lua vim.lsp.buf.code_action()&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;localleader&amp;gt;wd&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;lua vim.diagnostic.open_float(buffer, {scope=&amp;#34;line&amp;#34;})&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;localleader&amp;gt;wl&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;lua vim.lsp.codelens.refresh()&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;localleader&amp;gt;wL&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;lua vim.lsp.codelens.run()&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;localleader&amp;gt;ws&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;Telescope lsp_document_symbols&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;localleader&amp;gt;wS&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;Telescope lsp_workspace_symbols&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;localleader&amp;gt;wr&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;lua vim.lsp.buf.references()&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;localleader&amp;gt;wq&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;lua vim.diagnostic.setqflist()&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;K&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;lua vim.lsp.buf.hover()&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;i&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;C-h&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;lua vim.lsp.buf.signature_help()&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;[d&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;lua vim.diagnostic.goto_prev()&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;]d&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;lua vim.diagnostic.goto_next()&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;gD&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;lua vim.lsp.buf.declaration()&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;gd&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;lua vim.lsp.buf.definition()&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;gr&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;Telescope lsp_references&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;gR&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;lua vim.lsp.buf.rename()&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;gi&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;lua vim.lsp.buf.implementation()&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;gy&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;lua vim.lsp.buf.type_definition()&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;servers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;pylsp&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;clangd&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;hls&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;r_language_server&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;racket_langserver&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;clojure_lsp&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;tsserver&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;julials&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;rust_analyzer&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;purescriptls&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;quick_lint_js&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lsp&lt;/span&gt; &lt;span class="kr"&gt;in&lt;/span&gt; &lt;span class="n"&gt;ipairs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;servers&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="kr"&gt;do&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;nvim_lsp&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;lsp&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;setup&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;on_attach&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;on_attach&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;flags&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;debounce_text_changes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;150&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And, that&amp;rsquo;s it: As I said in a &lt;a href="https://aliquote.org/post/vscode-no-more/"&gt;previous post&lt;/a&gt;, the built-in LSP tools together with a few well crafted package usually make my day. I mean, I get all the things we usually need form an IDE: diagnostics, goto definition/references, and so on. And with the progress of code actions, at least in Rust, C and Haskell, we will soon get powerful refactoring tools. Now, what additional packages are useful in the context of LSP/Clangd. Well, &lt;a href="https://github.com/p00f/clangd_extensions.nvim"&gt;clangd-extensions&lt;/a&gt; comes to the rescue, especially by adding inlay hints (you&amp;rsquo;ll need Clang-13 at least), type hierarchy and AST, and more.&lt;/p&gt;
&lt;p&gt;Regarding Makefile and CMake, I rely on bare Vim config in after/ftplugin/c.vim, namely:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;compiler gcc
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set makeprg=cd\ build\ &amp;amp;&amp;amp;\ cmake\ -DCMAKE_BUILD_TYPE=debug\ -DCMAKE_EXPORT_COMPILE_COMMANDS=1\ ..\ &amp;amp;&amp;amp;\ cmake\ --build\ .
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;autocmd QuickFixCmdPost [^l]* nested cwindow
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;autocmd QuickFixCmdPost l* nested lwindow
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nmap gZ :10 split term://zig cc % &amp;amp;&amp;amp; ./a.out&amp;lt;cr&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I use make in case I&amp;rsquo;m working with CMake (this assumes there&amp;rsquo;s a already a build directory that was defined beforehand; and you&amp;rsquo;ll need to link the &lt;code&gt;compile_command.json&lt;/code&gt; file at the root directory). For standard Makefile-based project, I use &lt;code&gt;:!make&lt;/code&gt; from Vim command prompt. Lastly, I tend to use the same mapping, &lt;code&gt;gZ&lt;/code&gt;, across multiples langauges to just fire a quick terminal and run the program.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Midnight Sister • &lt;em&gt;Satellite&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in February</title><link>https://aliquote.org/post/micro-02-2022/</link><pubDate>Sat, 26 Feb 2022 20:42:17 +0100</pubDate><guid>https://aliquote.org/post/micro-02-2022/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-02-01&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Elbow, &lt;em&gt;The Seldom Seen Kid&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-01&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Fundamentally I think C trusts developers while C++ trusts compilers. This is a massive difference that sharing the same native types or syntax for while loop cannot hide. &amp;mdash; &lt;a href="https://cor3ntin.github.io/posts/c/"&gt;The problem with C&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-02-01&lt;/a&gt;: Update on Regolith Desktop: Now installed on my own laptop for more precise control. Back to a dark theme (Nord) &amp;ndash; long time no see. One of the main advantage of Regolith over, say, i3 or i3-gaps, is that all Ubuntu apps and settings remain available, including controllers that would have to be defined manually otherwise (e.g., brightness or volume control, screen sharing or screen capture). The integration of native apps (e.g., nautilus or gnome-terminal) is also really nicely handled by the WM without excessive RAM usage (&amp;lt; 800 Mo).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-01&lt;/a&gt;: &lt;a href="https://ta180m.exozy.me/posts/installing-every-arch-package/"&gt;Installing Every Arch Package&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-01&lt;/a&gt;: &lt;a href="https://github.com/dccsillag/magma-nvim"&gt;Magma&lt;/a&gt;: Interact with Jupyter from NeoVim. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-01&lt;/a&gt;: &lt;a href="https://www.codercorner.com/RadixSortRevisited.htm"&gt;Radix Sort Revisited&lt;/a&gt;. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-01&lt;/a&gt;: &lt;a href="https://regolith-linux.org/"&gt;Regolith Desktop&lt;/a&gt; looks awesome. I&amp;rsquo;m currently testing it on a work machine: it worked right out of the box after reboot, and it provides sensible default settings to i3 WM. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-02&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Mike Caulfield invented the term “a chorus of explanations” several years ago to explain why sites like Stack Overflow are useful. Where a lesson typically explains something once, SO and similar sites present several explanations with different levels of detail, different assumptions about the reader’s background, and quite possibly different solutions to the original problem. Most readers may be satisfied by the top answer, but others can scroll down to find one that’s a better fit for who they are, what they are ready to understand, and what they’re trying to do. &amp;mdash; &lt;a href="https://third-bit.com/2022/01/16/cacaphony-of-explanations/"&gt;A Cacaphony of Explanations&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-02-02&lt;/a&gt;: The &lt;a href="https://cdr.common-lisp.dev/"&gt;Common Lisp Document Repository&lt;/a&gt; is a repository of documents that are of interest to the Common Lisp community. The most important property of a CDR document is that it will never change: if you refer to it, you can be sure that your reference will always refer to exactly the same document. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-03&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Whit Dickey, &lt;em&gt;Nothingness&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-03&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In December, in my article When dropping support feels like sabotage, I was complaining that Apple was limiting the support of security updates to just the two previous versions of Mac OS, and not extending such support to even older versions like High Sierra or Mojave given the amount of people that are still using them. But I was forgetting that on iOS the situation is even worse. &amp;mdash; &lt;a href="http://morrick.me/archives/9475"&gt;→ No more security updates for iOS 14&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Lovely, &lt;code&gt;#apple&lt;/code&gt;. I&amp;rsquo;m still on Mojave and iOS 12.5 ;-)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-05&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Bush Tetras, &lt;em&gt;Too Many Creeps&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-05&lt;/a&gt;: I still have 57 RSS feeds out of 727 unread in my inbox. Work in progress.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-05&lt;/a&gt;: &lt;a href="https://zignar.net/2022/01/21/a-boring-statusline-for-neovim/"&gt;A boring statusline for Neovim&lt;/a&gt;. &lt;code&gt;#neovim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-05&lt;/a&gt;: &lt;a href="https://leancrew.com/all-this/2022/01/reducing-the-size-of-large-pdfs/"&gt;Reducing the size of large PDFs&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-08&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Time finds problems, people fix them. &amp;mdash; &lt;a href="http://brooker.co.za/blog/2022/01/31/deployments.html"&gt;Software Deployment, Speed, and Safety&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-02-10&lt;/a&gt;: &lt;a href="https://kowainik.github.io/posts/hacktoberfest2020"&gt;Brave New Hacktoberfest — Learn4Haskell&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-10&lt;/a&gt;: &lt;a href="https://www.revk.uk/2022/02/crlf-has-long-history.html"&gt;CR+LF has a long history&amp;hellip;&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-10&lt;/a&gt;: &lt;a href="https://ketansingh.me/posts/how-postgres-stores-rows/"&gt;How Postgres Stores Rows&lt;/a&gt;. &lt;code&gt;#database&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-10&lt;/a&gt;: &lt;a href="https://yetanotherdevblog.com/lsm/"&gt;Understanding LSM Trees: What Powers Write-Heavy Databases&lt;/a&gt;. &lt;code&gt;#database&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-16&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Graham Collier, &lt;em&gt;Red Sky in the Morning&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-16&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Monad is the name of the class for “and_then”, defined in a sensible way, with some laws for how it should behave predictably, and then a bunch of library code works on anything that implements “and_then”. &amp;mdash; &lt;a href="https://chrisdone.com/posts/monads/"&gt;A plain English description of monads without Haskell code&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-02-16&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;What you don’t realize is that you’ve been self-censoring yourself from searching most of the things you would have wanted to search. You already know subconsciously that Google isn’t going to return a good result. &amp;mdash; &lt;a href="https://dkb.io/post/google-search-is-dying"&gt;Google Search Is Dying&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-02-16&lt;/a&gt;: &lt;a href="https://mywiki.wooledge.org/BashPitfalls"&gt;Bash Pitfalls&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-16&lt;/a&gt;: &lt;a href="https://eev.ee/blog/2016/09/15/music-theory-for-nerds/"&gt;Music theory for nerds&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-17&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   The Vaselines, &lt;em&gt;Son of a Gun&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-17&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Fancy algorithms are slow when n is small, and n is usually small. &amp;mdash; &lt;a href="https://users.ece.utexas.edu/~adnan/pike.html"&gt;Rob Pike&amp;rsquo;s 5 Rules of Programming&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-02-17&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;What makes old manuals so fascinating to me is that they document the history of applied computer science. This gives the entire field, including tech comms, the resemblance of a past. Let’s not dismiss that: in a sector where startups seem to build new things on top of blurry or nonexistent foundations, reading about old software reminds us that there’s indeed a giant upon whose shoulders we’ve climbed. &amp;mdash; &lt;a href="https://passo.uno/why-collect-read-old-computer-manuals"&gt;Why I collect and read old computer manuals&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-02-18&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Siouxsie &amp;amp; The Banshees, &lt;em&gt;Jigsaw Feeling&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-18&lt;/a&gt;: &lt;a href="http://www.fmwconcepts.com/imagemagick/index.php"&gt;Fred&amp;rsquo;s ImageMagick Scripts&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-18&lt;/a&gt;: &lt;a href="https://www.boucek.me/blog/from-mac-to-freebsd/"&gt;My journey from macOS to FreeBSD&lt;/a&gt;. &lt;code&gt;#apple&lt;/code&gt; &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-18&lt;/a&gt;: &lt;a href="https://github.com/preservim/vim-wordy"&gt;vim-wordy&lt;/a&gt;: Uncover usage problems in your writing. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-19&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Howard Devoto, &lt;em&gt;Rainy Season&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-19&lt;/a&gt;: Tired of Tmux prefix (&lt;kbd&gt;C-b&lt;/kbd&gt; or &lt;kbd&gt;C-a&lt;/kbd&gt;, depending on your taste)? Let&amp;rsquo;s rebind everything we used on the Alt key using &lt;kbd&gt;bind-key -n M-&lt;/kbd&gt; whatever. It may not work on all terminals, but let&amp;rsquo;s that not stop us adding more aliases to our Tmux config file.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-21&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Lee Ritenour, &lt;em&gt;Dreamcatcher&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-21&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I generally consider theory to be useful background knowledge but fastidious study a poor substitute for firsthand experience. I &amp;ldquo;learn with my hands,&amp;rdquo; is the way I&amp;rsquo;ve always put it. it has its upsides and downsides &amp;mdash; &lt;a href="https://www.alicemaz.com/writing/program.html"&gt;how I think when I think about programming&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-02-21&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Personally, in every activity I&amp;rsquo;ve participated in where it&amp;rsquo;s possible to get a rough percentile ranking, people who are 95%-ile constantly make mistakes that seem like they should be easy to observe and correct. &amp;ldquo;Real world&amp;rdquo; activities typically can&amp;rsquo;t be reduced to a percentile rating, but achieving what appears to be a similar level of proficiency seems similarly easy. &amp;mdash; &lt;a href="https://danluu.com/p95-skill/"&gt;95%-ile isn&amp;rsquo;t that good&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-02-21&lt;/a&gt;: &lt;a href="https://ratfactor.com/notes"&gt;My Notebook System&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-22&lt;/a&gt;: &lt;a href="https://jcs.org/2022/02/21/macplus_streaming"&gt;Live Streaming a Macintosh Plus (or Any Compact Mac)&lt;/a&gt;. Amazing stuff as always.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-22&lt;/a&gt;: &lt;a href="https://github.com/dccsillag/magma-nvim"&gt;magma-nvim&lt;/a&gt;: Interact with Jupyter from NeoVim. Great plugin! &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-23&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Read three books on a topic and you know more about it than 99% of the world. Watch news all day for years and you have a distant, water-cooler-level awareness of thousands of stories, at least for the few weeks each is popular. &amp;mdash; &lt;a href="https://www.raptitude.com/2016/12/five-things-you-notice-when-you-quit-the-news/"&gt;Five Things You Notice When You Quit the News&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-02-23&lt;/a&gt;: &lt;a href="https://codeinthehole.com/tips/vim-lists/"&gt;Vim&amp;rsquo;s useful lists&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-23&lt;/a&gt;: &lt;a href="https://fabiangunzinger.github.io/blog/tools/2021/03/27/vim.html"&gt;vim&lt;/a&gt; cheatsheet. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-24&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Lingua Ignota, &lt;em&gt;Wicked Game&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-24&lt;/a&gt;: Finally got a decent Twitter client&amp;hellip; No more unsolicited tweets from nowhere/nobody, maybe?&lt;br&gt;&lt;img src="https://aliquote.org/img/2022-02-24-21-33-24.png" alt="twterm"&gt;&lt;small&gt;Spoiler: &lt;a href="https://twterm.ryota-ka.me/"&gt;twterm&lt;/a&gt;&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-24&lt;/a&gt;: I thought I would write a short post to explain how to fetch genome data from NCBI the old way, but here&amp;rsquo;s the gist, assuming you want to fetch all bacterial genomes:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;% wget ftp://ftp.ncbi.nih.gov/genomes/refseq/bacteria/assembly_summary.txt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;% mkdir bacteria_refseq
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;% awk -F &amp;#39;\t&amp;#39; &amp;#39;{if($12==&amp;#34;Complete Genome&amp;#34;) print $20}&amp;#39; assembly_summary.txt &amp;gt; assembly_summary_complete_genomes.txt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;% for record in $(cat assembly_summary_complete_genomes.txt); \do wget -P bacteria_refseq -e robots=off -r --no-parent -A &amp;#34;*genomic.fna.gz&amp;#34; &amp;#34;$record&amp;#34;/; done
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then wait, like me.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-24&lt;/a&gt;: &lt;a href="http://0x80.pl/articles/simd-parsing-int-sequences.html"&gt;Parsing series of integers with SIMD&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-24&lt;/a&gt;: &lt;a href="https://www.ctrl.blog/entry/pop-up-blocker.html"&gt;The web is overrun by pop-ups and blockers haven’t worked in years&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-24&lt;/a&gt;: &lt;a href="https://www.guckes.net/irssi/"&gt;irssi (IRC client) - Questions and Answers&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-25&lt;/a&gt;: &lt;a href="https://nnethercote.github.io/2022/02/25/how-to-speed-up-the-rust-compiler-in-2022.html"&gt;How to speed up the Rust compiler in 2022&lt;/a&gt;. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-02-25&lt;/a&gt;: &lt;a href="https://jless.io/"&gt;jless&lt;/a&gt; — a command-line JSON viewer.&lt;br&gt;&lt;/p&gt;</description></item><item><title>ArXiving on January 2022</title><link>https://aliquote.org/post/arxiv-08/</link><pubDate>Fri, 25 Feb 2022 10:09:25 +0100</pubDate><guid>https://aliquote.org/post/arxiv-08/</guid><description>&lt;p&gt;Here are a few papers that I read over the past two months, in the CS and Stat category as usual.&lt;/p&gt;
&lt;p&gt;At the time of this writing you can replace the x in ar&lt;em&gt;x&lt;/em&gt;iv URL to get a pretty HTML rendering of the article. See below for the second article discussed above.&lt;/p&gt;
&lt;h3 id="type-stability-in-julia-avoiding-performance-pathologies-in-jit-compilation-"&gt;Type Stability in Julia: Avoiding Performance Pathologies in JIT Compilation (&lt;a href="https://arxiv.org/abs/2109.01950"&gt;https://arxiv.org/abs/2109.01950&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;I still haven&amp;rsquo;t really gotten into the Julia language. I follow the news here and there and I&amp;rsquo;m glad to know that there is now a native graphical backend, not just web output. The last time I tested Julia (v1.6), I found the runtime of a first script to be quite substantial, although I understand why that is the case. The language server is slow too, because of the initial indexing of the symbols contained in all the installed packages. Nevertheless, I think Julia has a future and I hope there will soon be a consolidated set of tools for statistical modeling, much like Frank Harrell&amp;rsquo;s &lt;a href="https://github.com/harrelfe/rms"&gt;rms&lt;/a&gt; package. As I said in a previous post, for the moment I want to investigate Racket and Lisp-like languages, or maybe Haskell, to see if they could provide a good fit for my own workflow (even if I rarely perform statistical analyses nowadays). Julia remains, however, an interesting approach to statistical computing nowadays.&lt;/p&gt;
&lt;h3 id="an-introduction-to-quantum-computing-for-statisticians-"&gt;An Introduction to Quantum Computing for Statisticians (&lt;a href="https://arxiv.org/abs/2112.06587"&gt;https://arxiv.org/abs/2112.06587&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;Just out of curiosity, and because I was reading &lt;a href="https://www.thomaswong.net/introduction-to-classical-and-quantum-computing.pdf"&gt;Introduction to Classical and Quantum Computing&lt;/a&gt; (PDF) by Thomas G. Wong, I fetched this paper on quantum computing for statisticians. Well, I haven&amp;rsquo;t read it actually, but this look interesting as far as I can tell.&lt;/p&gt;
&lt;h3 id="aitchisons-compositional-data-analysis-40-years-on-a-reappraisal-"&gt;Aitchison&amp;rsquo;s Compositional Data Analysis 40 Years On: A Reappraisal (&lt;a href="https://arxiv.org/abs/2201.05197"&gt;https://arxiv.org/abs/2201.05197&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;It&amp;rsquo;s been a long time since I last read a paper written by Michael Greenacre. Last time was probably when I was working on multi-block methods back in 2016. This paper discusses the original approach to compositional data analysis, which is usually associated with lot of zeros in the dataset, and suggests that, contrary to the classical use of isometric logratios, soft constraints may yield correct and almost identical interpretation of the data in most cases. I have only skimmed the article but I will probably come back to it if I need to go deeper into the subject and the relationship between this type of approach and the techniques based on correspondence analysis.&lt;/p&gt;
&lt;h3 id="how-iso-c-became-unusable-for-operating-systems-development-"&gt;How ISO C became unusable for operating systems development (&lt;a href="https://arxiv.org/abs/2201.07845"&gt;https://arxiv.org/abs/2201.07845&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;The take-away message is that the primary reason why ISO C is poorly designed for OS development relates to a &amp;ldquo;design approach in the ISO standard that has given priority to certain kinds of optimization over both correctness and the &amp;lsquo;high-level assembler&amp;rsquo; intentions of C, even while the latter remain enshrined in the rationale.&amp;rdquo; Among other things, pointers (casting from and aliasing to) remain problematic in several edge cases.&lt;/p&gt;
&lt;p&gt;I still use C because this is one of the first languages I learned when I was in grad school (after Turbo Pascal, you named it). I like it because of its syntax and its simplicity, but I usually only write toy programs so I don&amp;rsquo;t have to bother with all its &amp;ldquo;pitfalls&amp;rdquo; regarding low-level and hard-core programming. I don&amp;rsquo;t use C++, but I&amp;rsquo;m rather interested in learning Rust because I like the tooling as well as &lt;a href="https://rust-analyzer.github.io/"&gt;rust-analyzer&lt;/a&gt;. Yet, I know it&amp;rsquo;s a hard path.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Laura-Mary Carter • &lt;em&gt;Town Called Nothing&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Jupyter kernels in Neovim</title><link>https://aliquote.org/post/jupyter-kernels-in-vim/</link><pubDate>Tue, 22 Feb 2022 21:28:53 +0100</pubDate><guid>https://aliquote.org/post/jupyter-kernels-in-vim/</guid><description>&lt;p&gt;I spend a certain amount of time writing Python, Racket or Lisp scripts for my daily jobs or musings around PLs. I&amp;rsquo;m using Neovim since last year and I tested a number of plugins that bring REPL-like experience to (Neo)Vim. Lately, this was mostly &lt;a href="https://github.com/kassio/neoterm"&gt;neoterm&lt;/a&gt; and &lt;a href="https://github.com/hkupty/iron.nvim"&gt;iron&lt;/a&gt;. Both plugins are great, at least they do the job which amounts to taking a visual selection or whatever line is under the cursor and sending it to a live shell subprocess running IPython, Racket or SBCL. I even contributed a PR to &lt;a href="https://github.com/kassio/neoterm"&gt;neoterm&lt;/a&gt; for adding Stata support since I wanted to use this workflow with Stata code. Now, what if we could use an unified API to provide REPL-like experience in (Neo)vim, without relyingon the built-in terminal?&lt;/p&gt;
&lt;p&gt;Enter Jupyter! It&amp;rsquo;s the next iteration of IPython, with support for multiple languages. You can think of it as the &lt;a href="https://langserver.org/"&gt;LSP&lt;/a&gt; of all REPLs. In fact there&amp;rsquo;s a kernel available for every language I use to use. The advantage are clear: you have the same UI for any PL, and you can dispatch your IO operations in a console or in a web browser. Most people I know generally using the &amp;ldquo;notebook&amp;rdquo; version, which means working in your default web browser. I don&amp;rsquo;t like it, and I prefer to work from a console, maybe an enriched Qt console. I&amp;rsquo;ve tried it with pleasure in the past in the case of Stata, for example.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; You can also call Jupyter kernel directly from your plain text editor, which is what I did for a long time when I was working with Emacs, especially for &lt;a href="https://aliquote.org/post/wolfram-engine/"&gt;Mathematica&lt;/a&gt; and &lt;a href="https://aliquote.org/post/stata-jupyter/"&gt;Stata&lt;/a&gt; in addition to R and Python.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve been looking for a similar solution in Neovim. This would alleviate the need for and additional terminal window, especially if it could benefit from virtual text features, or things like that. And I discovered &lt;a href="https://github.com/dccsillag/magma-nvim"&gt;Magma&lt;/a&gt;, which is a Neovim plugin that provides exactly what I need: a simple way to start a given kernel (&lt;code&gt;MagmaInit&lt;/code&gt;, then select the language), no interference with a running LSP server, the possibility to evaluate the current line, a region or a motion.&lt;/p&gt;
&lt;p&gt;Like for &lt;a href="https://github.com/hkupty/iron.nvim"&gt;iron&lt;/a&gt; I settled upon the following mappings, which I find convenient for most use cases:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lua" data-lang="lua"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;vim.cmd&lt;/span&gt;&lt;span class="s"&gt;[[nnoremap &amp;lt;silent&amp;gt;&amp;lt;expr&amp;gt; gz :MagmaEvaluateOperator&amp;lt;CR&amp;gt;]]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;vim.cmd&lt;/span&gt;&lt;span class="s"&gt;[[xnoremap &amp;lt;silent&amp;gt; gz :&amp;lt;C-u&amp;gt;MagmaEvaluateVisual&amp;lt;CR&amp;gt;]]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;vim.cmd&lt;/span&gt;&lt;span class="s"&gt;[[nnoremap &amp;lt;silent&amp;gt; gz :MagmaEvaluateLine&amp;lt;CR&amp;gt;]]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I know there are other actions available, e.g. for reevaluating a certain code chunk or clearing current output, but I don&amp;rsquo;t need them often. Combined with LSP, however, this plugin provides decent IDE-like features, with the comfort of Vim editing.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-02-26-20-26-38.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-02-26-20-26-38.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-02-28-20-30-13.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-02-28-20-30-13.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-02-26-20-27-10.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-02-26-20-27-10.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Following the suggestions available on the Jupyter &lt;a href="https://github.com/jupyter/jupyter/wiki/Jupyter-kernels"&gt;project wiki&lt;/a&gt;, I installed the following kernels: common-lisp, haskell, iclojure, ipurescript, ir, javascript, python3, racket, rust, stata, wolframlanguage13. The hardest part was to get CL kernel working since I kept getting an error with ironclad when using quicklisp alone. Finally, everything went fine with &lt;a href="https://github.com/roswell/roswell"&gt;Roswell&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Note that you can still send the whole buffer to a terminal and run the appropriate program, thanks to &lt;code&gt;ftplugin&lt;/code&gt; directives. For instance, I have the following settings for Python, defined in &lt;code&gt;after/ftplugin/python.vim&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-vim" data-lang="vim"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;setlocal&lt;/span&gt; &lt;span class="nx"&gt;makeprg&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;python3&lt;/span&gt;\ %
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;setlocal&lt;/span&gt; &lt;span class="nx"&gt;errorformat&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;nmap&lt;/span&gt; &lt;span class="nx"&gt;gZ&lt;/span&gt; :&lt;span class="m"&gt;13&lt;/span&gt; &lt;span class="nx"&gt;split&lt;/span&gt; &lt;span class="nx"&gt;term&lt;/span&gt;:&lt;span class="sr"&gt;//&lt;/span&gt;&lt;span class="nx"&gt;python3&lt;/span&gt; %&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;nmap&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;localleader&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;k&lt;/span&gt; :&lt;span class="p"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;pydoc3&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;cword&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;ia&lt;/span&gt; &lt;span class="nx"&gt;pp&lt;/span&gt; &lt;span class="nx"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Left&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I use more or less similar mappings for Haskell, C, Rust and Racket.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Tkay Maidza • &lt;em&gt;Onto Me&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Unfortunately, the Stata kernel requires Stata 14 or higher for image display, and I only have Stata 13 MP.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>The unquantified self #21</title><link>https://aliquote.org/post/unquantified-self-021/</link><pubDate>Sun, 20 Feb 2022 20:23:59 +0100</pubDate><guid>https://aliquote.org/post/unquantified-self-021/</guid><description>&lt;p&gt;It&amp;rsquo;s already February. It also looks like Spring is coming, at least on my balcony:&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1889.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1889.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1890.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1890.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1891.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1891.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;We started watching a new TV show with my son, &lt;a href="https://en.wikipedia.org/wiki/See_(TV_series)"&gt;See&lt;/a&gt;. I originally thought it would make a good sequel to Vikings, but this was only based on the poster of the TV show on Apple TV. Now that I realized that the main characters are all blind, I find the series even more interesting. When my son is not with me, I&amp;rsquo;m just back to the basics: I &lt;a href="https://aliquote.org/files/books.txt"&gt;read&lt;/a&gt; or watch Twitch, mostly &lt;a href="https://www.twitch.tv/togglebit"&gt;strager&lt;/a&gt; and &lt;a href="https://www.twitch.tv/togglebit"&gt;togglebit&lt;/a&gt; &amp;mdash; give them a follow, you won&amp;rsquo;t regret it. I still listen to music all day long, and my latest streak according to Last.fm was around 1000 tracks a week.&lt;/p&gt;
&lt;p&gt;As discussed in one of my previous posts, I&amp;rsquo;m pretty happy with my current setup. Indeed I switched to Regolith desktop and I can now enjoy a useable window manager and Ubuntu built-in stuff (with a revamped GTK theme). This means I&amp;rsquo;m also back to a dark theme for my TUI stack, but I kept Firefox untouched because all dark theme I came across look so bad for most websites with lot of pictures or complex layout.&lt;/p&gt;
&lt;p&gt;Other than that, I remained diligent in the kitchen:&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1849.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1849.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1866.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1866.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1872.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1872.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;That&amp;rsquo;s all for now!&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Anja Lechner &amp;amp; François Couturier • &lt;em&gt;Vague / E la nave va&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Multi-blast and parallel processing</title><link>https://aliquote.org/post/multi-blast/</link><pubDate>Thu, 10 Feb 2022 20:57:39 +0100</pubDate><guid>https://aliquote.org/post/multi-blast/</guid><description>&lt;p&gt;Last year I was involved in running long series of blast of individual DNA sequences against one or more reference genome or ITS therein. For instance, I would be given a multi-fasta file with hundreds of ITS from fungi species which I have to blast individually against a builtin database of fungi ITS. I call this &amp;ldquo;multi-blast&amp;rdquo; but I&amp;rsquo;m not a bioinformatician and there might be a better term. The idea is to find the closest match for each sequence to the ones already available in our in-house database. Even if those individual sequences are not really big (400 to 800 bp), this is an embarassly parallel problem, which can be solved using Python multiprocessing capabilities or GNU &lt;a href="https://www.gnu.org/software/parallel/"&gt;parallel&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The following code uses Python, but since GNU parallel is invoked via a shell subprocess, it doesn&amp;rsquo;t really matter. Here is a simple function to perform blast queries in parallel:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;os&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;parallel_blast_its&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;&amp;#34;&amp;#34;Parallelized version of one-against-all Blast&amp;#34;&amp;#34;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cmd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;parallel --recstart &amp;#39;&amp;gt;&amp;#39; --recend &amp;#39;&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;&amp;#39; -N 1 --pipe &amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;blastn -query - -out &amp;#39;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;_{#}&amp;#39; &amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34; -outfmt 0 -max_target_seqs 5 -db &amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34; &amp;lt; &amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;system&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cmd&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The key here is how to pass individual record from a multi-fasta file to GNU parallel. This is done by specifying &lt;code&gt;recstart&lt;/code&gt; and &lt;code&gt;recend&lt;/code&gt; options, which allow to pass a raw string to blastn as for the sequence and then output each result in a temporary folder (&lt;code&gt;out&lt;/code&gt;) with the name of the original multi-fasta file suffixed with the record number.&lt;/p&gt;
&lt;p&gt;And here&amp;rsquo;s a complete program to blast individual sequence from a multi-fasta file against a reference db, which was used for a metagenomics study:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;multiprocessing&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;os&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;random&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;Bio&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;SeqIO&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;SAMPLES&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;representatives.fasta&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;CPUS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;multiprocessing&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cpu_count&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;PARA&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;False&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;chunks&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;yield&lt;/span&gt; &lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;blast&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;record&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;record&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;SeqIO&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;out/tmp.fasta&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;fasta&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cmd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;blastn -num_threads 4 -out out/blast/&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34; -outfmt 0&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34; -db db/db-its-2020-12 -query out/tmp.fasta&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34; -evalue 1e-60 -qcov_hsp_perc 90 -max_target_seqs 1 2&amp;gt;/dev/null&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;system&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cmd&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="vm"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;__main__&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;records&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;SeqIO&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;SAMPLES&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;fasta&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;PARA&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;nc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;records&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;CPUS&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;chunks&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;records&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;nc&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;multiprocessing&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Pool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;processes&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;CPUS&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;apply_async&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;blast&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;),))&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;blast&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;records&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The idea is to write each DNA sequence as a Fasta file in a temporary directory, and to process it from there using &lt;code&gt;blastn&lt;/code&gt;. Note that we could use the &lt;code&gt;subprocess&lt;/code&gt; module instead of &lt;code&gt;os&lt;/code&gt;. Likewise, the Biopython is only used to read Fasta files. Given the standardized format of those files, it would be easy to write a custom parser.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Metallica • &lt;em&gt;Nothing Else Matters&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>No more VS Code</title><link>https://aliquote.org/post/vscode-no-more/</link><pubDate>Thu, 03 Feb 2022 10:23:13 +0100</pubDate><guid>https://aliquote.org/post/vscode-no-more/</guid><description>&lt;p&gt;I think I reinstalled &lt;a href="https://aliquote.org/post/vscode-yet-again/"&gt;VS Code&lt;/a&gt; on my laptop one or two years ago. Since then, I never used it, and I found myself only updating the application and the limited set of extensions I installed alongside for one year long without even touching it. In fact, I was mostly interested in Language Server add-ons, but now that Neovim builtin LSP is quite stabilized, I believe I no longer need to check whether it works as expected (i.e., as it is expected to behave in VS Code or IntelliJ). In fact, I have everything at hand under Neovim, and it sparks joy.&lt;/p&gt;
&lt;p&gt;I have a long &lt;a href="https://aliquote.org/post/modern-neovim/"&gt;series of posts&lt;/a&gt; about how I configured Neovim during last summer. Most of those settings are still relevant today, but I added a few packages, including debugging capabilities, $\TeX$ (see &lt;a href="https://aliquote.org/post/texing-in-vim/"&gt;Texing in Vim&lt;/a&gt;) and Org (see &lt;a href="https://aliquote.org/post/org-in-vim/"&gt;Org in Vim&lt;/a&gt;) stuff, etc. Regarding LSP, I added specifically the following packages:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/kosayoda/nvim-lightbulb"&gt;nvim-lightbulb&lt;/a&gt;, because I wanted to have some idea of where code action were available. Since I don&amp;rsquo;t like intrusive help or notification, I choose to show them only for the current line thanks to an &lt;code&gt;autocommand&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/nvim-lua/lsp_extensions.nvim"&gt;lsp_extensions.nvim&lt;/a&gt;, only to display inlay for Rust code.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/ericpubu/lsp_codelens_extensions.nvim"&gt;lsp_codelens_extensions.nvim&lt;/a&gt;, to get pretty code lens actions right to a Rust test &lt;code&gt;fn&lt;/code&gt; or for inline Haskell snippets.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/mfussenegger/nvim-dap"&gt;nvim-dap&lt;/a&gt;, &lt;a href="https://github.com/rcarriga/nvim-dap-ui"&gt;nvim-dap-ui&lt;/a&gt;, &lt;a href="https://github.com/theHamsta/nvim-dap-virtual-text"&gt;nvim-dap-virtual-text&lt;/a&gt;, for debugging. I only trigger &lt;code&gt;dap&lt;/code&gt; UI on demand, but I have virtual text activated automagically when I started a debugging session. I use it mostly for Python scripts. As an update to a &lt;a href="https://aliquote.org/micro/2022-01-28-18-09-39/"&gt;previous micro-post&lt;/a&gt;, I even get this working for Haskell.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/danymat/neogen"&gt;neogen&lt;/a&gt;, because everyone likes &lt;code&gt;docstrings&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Below are some demos (Python, Rust, Haskell) of what&amp;rsquo;s available in a modern Vim world nowadays.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-02-03-21-51-22.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-02-03-21-51-22.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-02-03-21-52-45.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-02-03-21-52-45.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-02-03-21-55-37.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-02-03-21-55-37.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Left: highlight &lt;code&gt;dap&lt;/code&gt; debugging with virtual text and LSP error/warning highlights in the status line (syntax and formatting errors deliberately added);&lt;/li&gt;
&lt;li&gt;Middle: Rust with inlay hints and code lens for test cases;&lt;/li&gt;
&lt;li&gt;Right: Haskell with &lt;a href="https://haskellwingman.dev/"&gt;Wingman&lt;/a&gt; code action.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2021-03-08]&lt;/small&gt;&lt;br&gt;
See also &lt;a href="https://dev.to/casonadams/neovim-lsp-to-replace-vscode-n8c"&gt;Neovim LSP to replace VSCode&lt;/a&gt;, or &lt;a href="https://sharksforarms.dev/posts/neovim-rust/"&gt;Neovim and Rust&lt;/a&gt;, which was featured on the &lt;a href="https://blog.rust-lang.org/2022/02/21/rust-analyzer-joins-rust-org.html"&gt;Rust blog&lt;/a&gt; this month.
&lt;/div&gt;
&lt;p&gt;Happy coding in Neovim!&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Memory Cassett • &lt;em&gt;Asleep at a Party&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Regolith Desktop</title><link>https://aliquote.org/post/regolith-desktop/</link><pubDate>Wed, 02 Feb 2022 20:48:05 +0100</pubDate><guid>https://aliquote.org/post/regolith-desktop/</guid><description>&lt;p&gt;Out of curiosity, I tried &lt;a href="https://regolith-linux.org/"&gt;Regolith Desktop&lt;/a&gt; yesterday. I was looking at Pop OS for a long time before deciding on &lt;a href="https://aliquote.org/post/i3wm/"&gt;i3&lt;/a&gt; last year, mostly because Gnome shell and Gnome WM eat up too much memory to my taste, and because I was looking for a keyboard centric experience to manage and navigate my desktop environment. I must say that Regolith Desktop rocks!&lt;/p&gt;
&lt;p&gt;Regolith Desktop is originally based on &lt;a href="https://github.com/Airblader/i3"&gt;i3-gaps&lt;/a&gt;, but it adds further keyboard centric and TUIs specific to i3. Above all, it comes with sensible default settings and its installation is a breeze. Just issue &lt;code&gt;sudo add-apt-repository pa:megalith-Linux/release &amp;amp;&amp;amp; budo apt install megalith-desktop-standard&lt;/code&gt; in your terminal and you&amp;rsquo;re done after a reboot.&lt;/p&gt;
&lt;p&gt;If you have an existing i3 configuration file, you can reuse (part of) it for Regolith, whose config files are located under &lt;code&gt;$HOME/.config/regolith&lt;/code&gt;. The main config file is an &lt;code&gt;Xresources&lt;/code&gt; file. Note that your own &lt;code&gt;$HOME/.Xresources&lt;/code&gt; file is also read by Regolith at startup. Once you made some changes or update default settings, you can update the WM with &lt;code&gt;regolith-look refresh&lt;/code&gt;. For instance, I changed the default font for the terminal and various other settings:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gnome.terminal.font : JetBrains Mono &lt;span class="m"&gt;11&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gnome.wallpaper : &lt;span class="nv"&gt;$HOME&lt;/span&gt;/Media/Pictures/waves.jpg
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;i3-wm.font : pango:JetBrains Mono Medium &lt;span class="m"&gt;10&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;i3-wm.gaps.inner.size : &lt;span class="m"&gt;8&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;i3-wm.gaps.outer.size : &lt;span class="m"&gt;5&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;i3xrocks.value.font : JetBrains Mono Medium &lt;span class="m"&gt;10&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;rofi.font : JetBrains Mono Medium &lt;span class="m"&gt;10&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Not all i3 options are manageable from this file, though. You can copy the default config file from &lt;code&gt;/etc/regolith/i3/config&lt;/code&gt; and update its settings under your own &lt;code&gt;regolith&lt;/code&gt; directory.&lt;/p&gt;
&lt;p&gt;Except that I didn&amp;rsquo;t find any pleasant light theme for Regolith &amp;ndash; I currently use my beloved Nord theme &amp;ndash; the experience is close to what I was used to with my own i3 settings. I only tweak the default GTK theme so that Firefox is not using a dark theme as the default. And if I happen to get tired (again) of dark theme for the terminal and my editor, I can still switch back to Kitty since it uses its own color settings. I also disabled a lot of applets for the i3bar.&lt;/p&gt;
&lt;p&gt;What I really like, though, is that all Gnome applications work as if you were using the default Gnome shell desktop, with a pretty GTK theme. Here&amp;rsquo;s the default look&amp;rsquo;n feel of Gnome applications (here, the control panel):&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2022-02-03-09-33-45.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Gnome terminal nicely fits in the tiling framework (no menu bar, no title bar, etc.), and of course Tmux makes session and terminal management even easier:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2022-02-03-09-37-23.png"&gt;
&lt;/figure&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Marianne Faithfull • &lt;em&gt;Crazy Love&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Texing in Vim</title><link>https://aliquote.org/post/texing-in-vim/</link><pubDate>Wed, 26 Jan 2022 15:05:55 +0100</pubDate><guid>https://aliquote.org/post/texing-in-vim/</guid><description>&lt;p&gt;I rarely have to write $\LaTeX$ these days. I usually let Pandoc do the harder stuff, and simply write my plain text documents using Org or Markdown markup language. I used to rely on $\LaTeX$ in the case of R+Sweave/knitr reports, but I rarely have to write any statistical report these days. However, I may happen to write &lt;a href="https://aliquote.org/post/latex-beamer-21-century/"&gt;plain $\TeX$&lt;/a&gt; or edit $\LaTeX$ documents, in which case I appreciate a solid workflow to edit, compile and keep my text in sync with the PDF renderer.&lt;/p&gt;
&lt;p&gt;Under Emacs I had everything I needed thanks to Auctex and Pandoc, but under Vim I always used the bare minimum so far, that is native syntax highlighting and Vim motion. I don&amp;rsquo;t use snippets but I have a set of &lt;code&gt;iabbrev&lt;/code&gt; that alleviates the need to write cumbersome and recurrent $\LaTeX$ expressions:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-vim" data-lang="vim"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;iabbrev&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&amp;lt;&lt;/span&gt;@ &lt;span class="p"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;LABEL&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;gt;=&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;@&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Esc&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;?&lt;span class="nx"&gt;LABEL&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;cw&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;iabbrev&lt;/span&gt; &lt;span class="nx"&gt;chapter&lt;/span&gt;@ \&lt;span class="nx"&gt;begin&lt;/span&gt;{&lt;span class="nx"&gt;chapter&lt;/span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;iabbrev&lt;/span&gt; &lt;span class="nx"&gt;section&lt;/span&gt;@ \&lt;span class="nx"&gt;begin&lt;/span&gt;{&lt;span class="nx"&gt;section&lt;/span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;iabbrev&lt;/span&gt; &lt;span class="nx"&gt;subsection&lt;/span&gt;@ \&lt;span class="nx"&gt;begin&lt;/span&gt;{&lt;span class="nx"&gt;subsection&lt;/span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;iabbrev&lt;/span&gt; &lt;span class="nx"&gt;subsubsection&lt;/span&gt;@ \&lt;span class="nx"&gt;begin&lt;/span&gt;{&lt;span class="nx"&gt;subsubsection&lt;/span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;iabbrev&lt;/span&gt; &lt;span class="nx"&gt;paragraph&lt;/span&gt;@ \&lt;span class="nx"&gt;paragraph&lt;/span&gt;{&lt;span class="nx"&gt;TITLE&lt;/span&gt;}&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Esc&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;?&lt;span class="nx"&gt;TITLE&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;cw&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;iabbrev&lt;/span&gt; &lt;span class="nx"&gt;equation&lt;/span&gt;@ \&lt;span class="nx"&gt;begin&lt;/span&gt;{&lt;span class="nx"&gt;equation&lt;/span&gt;}&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;iabbrev&lt;/span&gt; &lt;span class="nx"&gt;align&lt;/span&gt;@ \&lt;span class="nx"&gt;begin&lt;/span&gt;{&lt;span class="nx"&gt;align&lt;/span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;iabbrev&lt;/span&gt; &lt;span class="nx"&gt;tabular&lt;/span&gt;@ \&lt;span class="nx"&gt;begin&lt;/span&gt;{&lt;span class="nx"&gt;tabular&lt;/span&gt;}{&lt;span class="nx"&gt;ALG&lt;/span&gt;}&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Esc&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;?&lt;span class="nx"&gt;ALG&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;cw&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;iabbrev&lt;/span&gt; &lt;span class="nx"&gt;table&lt;/span&gt;@ \&lt;span class="nx"&gt;begin&lt;/span&gt;{&lt;span class="nx"&gt;table&lt;/span&gt;}[&lt;span class="nx"&gt;POS&lt;/span&gt;]&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;\&lt;span class="nx"&gt;centering&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;\&lt;span class="nx"&gt;caption&lt;/span&gt;{}&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;\&lt;span class="nx"&gt;label&lt;/span&gt;{}&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Esc&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;?&lt;span class="nx"&gt;POS&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;cw&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;&amp;#34; FIXME: Add figure environment&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;iabbrev&lt;/span&gt; &lt;span class="nx"&gt;texttt&lt;/span&gt;@ \&lt;span class="nx"&gt;texttt&lt;/span&gt;{&lt;span class="nx"&gt;DATA&lt;/span&gt;}&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Esc&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;?&lt;span class="nx"&gt;DATA&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;cw&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;iabbrev&lt;/span&gt; &lt;span class="nx"&gt;frac&lt;/span&gt;@ \&lt;span class="nx"&gt;frac&lt;/span&gt;{&lt;span class="nx"&gt;DATA&lt;/span&gt;}{}&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Esc&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;?&lt;span class="nx"&gt;DATA&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;cw&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Enters &lt;a href="https://github.com/lervag/vimtex"&gt;Vimtex&lt;/a&gt; which I discovered when I was reading &lt;a href="https://castel.dev/post/lecture-notes-1/"&gt;How I&amp;rsquo;m able to take notes in mathematics lectures using LaTeX and Vim&lt;/a&gt; a while ago. Note that vimtex+&lt;a href="https://aliquote.org/post/nyxt-browser/"&gt;zathura&lt;/a&gt; is the &lt;em&gt;winning combo&lt;/em&gt; here. Contrary to the author of the blog post, I don&amp;rsquo;t use concealing, nor snippets (see above).&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2023-10-25]&lt;/small&gt;&lt;br&gt;
See this excellent tutorial to get started with using vimtex: &lt;a href="https://www.ejmastnak.com/tutorials/vim-latex/vimtex/"&gt;Getting started with the VimTeX plugin&lt;/a&gt;. I also tried texlab and ltex-ls, but finally vimtex alone already features everything we need (&lt;a href="https://www.nongnu.org/chktex/"&gt;chktex&lt;/a&gt; or &lt;a href="https://sylvainhalle.github.io/textidote/"&gt;textidote&lt;/a&gt; configured via &lt;code&gt;makeprg&lt;/code&gt;, auto-formatting with &lt;a href="https://github.com/cmhughes/latexindent.pl"&gt;latexindent&lt;/a&gt;, omni-completion). The documentation is also gorgeous, I&amp;rsquo;d be surprised if you didn&amp;rsquo;t find an answer to your questions inside.
&lt;/div&gt;
&lt;p&gt;Things I like: &lt;code&gt;]]&lt;/code&gt; will automagically close the current environment, Bibtex keys and labels can be autocompleted using builtin omnicomplete (&lt;code&gt;C-x C-o&lt;/code&gt;), you can toggle on/off a table of contents in a dedicated sidebar, the &lt;code&gt;%&lt;/code&gt; matching operator is redefined to highlight opening and closing $\LaTeX$ delimiters, you can compile and preview your file with pre-defined mappings, and there are specific motion operators (e.g., &lt;code&gt;ic&lt;/code&gt;, &lt;code&gt;id&lt;/code&gt;, &lt;code&gt;ie&lt;/code&gt;, &lt;code&gt;i$&lt;/code&gt;). And on top of that, you can use reverse (Ctrl+click from Zathura) and forward (&lt;code&gt;&amp;lt;localleader&amp;gt;lr&lt;/code&gt; from Vim) search. And it just works! Zathura is configured as the defaut PDF viewer, and all you have to do is to ensure that &lt;code&gt;synctex&lt;/code&gt; is active when compiling your $\LaTeX$ document. This is already defined in Vimtex default options. See also this review: &lt;a href="https://jdhao.github.io/2019/03/26/nvim_latex_write_preview/"&gt;A Complete Guide on Writing LaTeX with Vimtex in Neovim&lt;/a&gt;. (Note that you no longer need to spawn a server since Neovim 0.5+.)&lt;/p&gt;
&lt;p&gt;To compile Knitr standalone documents, I use the following mapping:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-vim" data-lang="vim"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;map&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;localLeader&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;k&lt;/span&gt; :&lt;span class="nx"&gt;w&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;:&lt;span class="nx"&gt;cd&lt;/span&gt; %:&lt;span class="nx"&gt;p&lt;/span&gt;:&lt;span class="nx"&gt;h&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;:&lt;span class="p"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;Rscript&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;library(knitr);knit(&amp;#34;%:p&amp;#34;)&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;:&lt;span class="p"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;latexmk&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;pdf&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;bibtex&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;cond&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;f&lt;/span&gt; %:&lt;span class="nx"&gt;r&lt;/span&gt;.&lt;span class="nx"&gt;tex&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;:&lt;span class="p"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;xdg&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;open&lt;/span&gt; %:&lt;span class="nx"&gt;r&lt;/span&gt;.&lt;span class="nx"&gt;pdf&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is basically what I have in my Makefile, except that I use &lt;code&gt;texi2pdf&lt;/code&gt; instead of &lt;a href="https://mg.readthedocs.io/latexmk.html"&gt;&lt;code&gt;latexmk&lt;/code&gt;&lt;/a&gt;. My &lt;code&gt;latexmk&lt;/code&gt; settings are as follows (&lt;code&gt;$HOME/.latexmkrc&lt;/code&gt;):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;@default_files = (&amp;#39;main.tex&amp;#39;);
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$clean_ext = &amp;#34;bbl nav out snm&amp;#34;;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$latex = &amp;#39;latex -interaction=nonstopmode -shell-escape&amp;#39;;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$pdflatex = &amp;#39;pdflatex -shell-escape -interaction=nonstopmode -synctex=1 -file-line-error&amp;#39;;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$pdf_previewer = &amp;#39;zathura&amp;#39;;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set_tex_cmds(&amp;#39;-synctex=1 -interaction=nonstopmode -shell-escape %O %S&amp;#39;);
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Finally, I use the &lt;a href="https://github.com/nvim-telescope/telescope-bibtex.nvim"&gt;Bibtex extension&lt;/a&gt; for Telescope, which provides a nice alternative to &lt;a href="https://github.com/tmalsburg/helm-bibtex"&gt;Helm-bibtex&lt;/a&gt; to display a list of available references (globally or in the current directory). Inserting the reference by pressing the enter key will take care of formatting the bibliographic key depending on the filetype (Markdown, Latex or plain text).&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2022-01-26-20-43-51.png"&gt;
&lt;/figure&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Sonic Youth • &lt;em&gt;The World Looks Red&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>15 years and 600 posts</title><link>https://aliquote.org/post/15y-600p/</link><pubDate>Tue, 25 Jan 2022 21:31:06 +0100</pubDate><guid>https://aliquote.org/post/15y-600p/</guid><description>&lt;p&gt;After 15 years, I realize I have now written 600 posts on this blog. On 4 different blogging platforms or site generators: Wordpress, &lt;a href="https://aliquote.org/post/blogging-about-this-blog/"&gt;Jekyll&lt;/a&gt;, &lt;a href="https://aliquote.org/post/switching-to-textpattern/"&gt;Textpattern&lt;/a&gt;, and &lt;a href="https://aliquote.org/post/migrating-to-hugo/"&gt;Hugo&lt;/a&gt;. I redesign the site several times, but there has been two main layouts over the time. I miss the good old days when I edited all pages, except the blog, by hand using HTML and CSS. I mostly write in English although this is not my mother tongue language; surely I make a lot of typos but also write many inconsistent expressions, but I hope that French and non-French speaking readers will forgive me. It always amazed me that I am able to find minor typos in others&amp;rsquo; writings, even English native speakers, and continue to make so many mistakes myself because I&amp;rsquo;m too lazy to reread what I&amp;rsquo;ve just written or to look for a better wording when I&amp;rsquo;ve already moved on to the next idea.&lt;/p&gt;
&lt;p&gt;Originally called Memos, this section has become a blog &lt;em&gt;per se&lt;/em&gt; even if the fashion of blogs comes and goes but is certainly not what it was in the 2000s. As I said in earlier posts, people start writing very nice blog posts and then stop. I always find it sad that it ends up so early, but that&amp;rsquo;s life. Personally, i don&amp;rsquo;t have a problem with writing, on the contrary: i have done practically nothing else for 30 years, despite a rather prolonged hiatus about 15 years ago. But basically, keeping the link with &amp;ldquo;public writing&amp;rdquo; makes it possible to keep a trace of one&amp;rsquo;s own peregrinations in life (professional most of the time, at least as far as i&amp;rsquo;m concerned) and of one&amp;rsquo;s constantly renewed learnings.&lt;/p&gt;
&lt;p&gt;After digging into the archives, I discovered that one of the oldest file in the &lt;a href="https://aliquote.org/pub/"&gt;public&lt;/a&gt; directory on this server dates back from 2005 and it happens to be a&amp;hellip; Flash applet. There&amp;rsquo;re also some gems from more than ten years ago, before Gist were available on GitHub. Note that many files were uploaded at a later time so that we cannot trust all timestamps for sure. This is the case, for instance, of my PhD dissertation in Postscript which was moved from one folder to another one without archive mode.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;testParamPass2.swf 2005-08-26 15:11 3.1K
test_minted.tex 2010-12-26 19:18 1.2K
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I&amp;rsquo;ve published various quick stats, especially in this &lt;a href="https://aliquote.org/post/ten-years/"&gt;anniversary post&lt;/a&gt;. Rather than publishing yet another histogram of post size or count, let&amp;rsquo;s just plot an aggregated content in the form of a wordcloud, which is inspired from one my &lt;a href="https://yurichev.com/news/20220116_wordcloud/"&gt;recent reading&lt;/a&gt;. I generated a wordcloud of all those 600 posts, and I plan to make a nice video when I have time. Here are individual wordcloud for the last three posts:&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/probleme-de-rencontres.md.wordcloud.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/probleme-de-rencontres.md.wordcloud.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/new-pandoc-template.md.wordcloud.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/new-pandoc-template.md.wordcloud.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/tipx-on-neomutt.md.wordcloud.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/tipx-on-neomutt.md.wordcloud.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;That&amp;rsquo;s it.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Mischa Blanos • &lt;em&gt;Steppe&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in January</title><link>https://aliquote.org/post/micro-01-2022/</link><pubDate>Tue, 25 Jan 2022 20:53:12 +0100</pubDate><guid>https://aliquote.org/post/micro-01-2022/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-01-02&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/2022-01-02-21-12-59.png" alt="img"&gt;&lt;small&gt;From Last.fm, this week&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-02&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;It&amp;rsquo;s all well and good that SQLite is scalable and reliable enough for most needs, but what&amp;rsquo;s the point of using it instead of a more traditional client/server database? &amp;mdash; &lt;a href="https://blog.wesleyac.com/posts/consider-sqlite"&gt;Consider SQLite&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-01-02&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;It’s been my experience that our intuition of what is and isn’t a pathological or malicious input is about as accurate as time estimates. Requirements change and any and all attack vectors will be found and exploited. The mental burden of remembering the assumptions made to correctly check for pathological or malicious inputs in all cases and keep them updated during refactoring is far too enormous to successfully maintain. &amp;mdash; &lt;a href="https://graphitemaster.github.io/aau/"&gt;Almost Always Unsigned&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-01-02&lt;/a&gt;: Haskell tutorials:- &lt;a href="https://github.com/smelc/tn-fp-haskell-course"&gt;Course on functional programming - Haskell&lt;/a&gt; (Clément Hurlin)- &lt;a href="https://github.com/google/haskell-trainings"&gt;Haskell training: 101 and 102&lt;/a&gt; (Google)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-02&lt;/a&gt;: &lt;a href="https://seeing-theory.brown.edu/"&gt;Seeing Theory&lt;/a&gt;: A visual introduction to probability and statistics. I already mentioned this amazing website but it is still worth a retweet.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-02&lt;/a&gt;: &lt;a href="https://emilyriederer.netlify.app/post/shiny-db/"&gt;Using databases with Shiny&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-03&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Joy Division, &lt;em&gt;Glass&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-03&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;All the functions in Abramowitz &amp;amp; Stegun are now fully computable in the Wolfram Language. &amp;mdash; &lt;a href="https://writings.stephenwolfram.com/2021/12/launching-version-13-0-of-wolfram-language-mathematica/"&gt;Launching Version 13.0 of Wolfram Language + Mathematica&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-01-03&lt;/a&gt;: &lt;a href="https://nullprogram.com/blog/2021/12/04/"&gt;Fast CSV processing with SIMD&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-03&lt;/a&gt;: &lt;a href="http://funcall.blogspot.com/2021/12/idle-puzzles.html"&gt;Idle puzzles&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-04&lt;/a&gt;: &lt;a href="https://www.flooey.org/commonlisp.html"&gt;A Closed and Common Lisp&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-04&lt;/a&gt;: &lt;a href="https://juliadatascience.io/"&gt;Julia Data Science&lt;/a&gt;. &lt;code&gt;#julia&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-05&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Firewater, &lt;em&gt;One Of Those&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-05&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;All I want to say with all these abstractions is that proper logging architecture is hard. It is not just about writing logger.log() here and there. It is a complex process of creating proper abstractions, composing them, and maintaining strict layers of pure and impure code. &amp;mdash; &lt;a href="https://sobolevn.me/2020/03/do-not-log"&gt;Do not log&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-01-05&lt;/a&gt;: Old times good times. I came across &lt;a href="https://leastfixedpoint.com/tonyg/kcbbs/lshift_archive/folds-and-continuation-passing-style-20070611.html"&gt;this (archived) post&lt;/a&gt; where comments on a blog really add values to the post itself. &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-05&lt;/a&gt;: &lt;a href="https://www.datavis.ca/milestones/"&gt;A graphic overview of the events in the history of data visualization&lt;/a&gt;, by Michael Friendly &amp;amp; Daniel J. Denis. &lt;code&gt;#dataviz&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-05&lt;/a&gt;: &lt;a href="https://cs.brown.edu/people/rtamassi/gdhandbook/"&gt;Handbook of Graph Drawing and Visualization&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-05&lt;/a&gt;: &lt;a href="https://jfiksel.github.io/2022-01-04-missdat/"&gt;The complexity of dealing with missing data, variable selection, and cross validation for prediction models&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-06&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Müncher Rundfunkorchester, &lt;em&gt;Arvo pärt: Works&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-06&lt;/a&gt;: I will always miss you.&lt;img src="https://aliquote.org/img/IMG_0783.jpg" alt=""&gt;&lt;small&gt;Circa. 2011&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-07&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Orange Juice, &lt;em&gt;I Can&amp;rsquo;t Help Myself&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-07&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Orchestra of the Swan, David Le Page, Eleanor Turner &amp;amp; Daniele Rosina, &lt;em&gt;Comptine d&amp;rsquo;un autre été, l&amp;rsquo;après-midi&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-07&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The inferential analogy here is that our knowledge grows by a process that is partly random but also involves a struggle for survival amongst ideas. &lt;a href="http://www.senns.uk/You_may_believe_you_are_a_Bayesian.pdf"&gt;You May Believe You Are a Bayesian But You Are Probably Wrong&lt;/a&gt; (PDF)&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-01-07&lt;/a&gt;: A &lt;a href="https://github.com/kevinthew/linuxgems"&gt;succinct cheat sheet&lt;/a&gt; for newbie linux coders and system administrators. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-07&lt;/a&gt;: Hugo &lt;a href="https://github.com/alex-shpak/hugo-book"&gt;documentation theme&lt;/a&gt; as simple as plain book.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-07&lt;/a&gt;: Strange little diff.&lt;img src="https://aliquote.org/img/2022-01-07-12-52-33.png" alt="diff"&gt;The &amp;ldquo;blast+&amp;rdquo; term get recognised as part of the diff even if I deleted the whole line beforehand.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-07&lt;/a&gt;: &lt;a href="https://chaidarun.com/bash-style"&gt;Bash Style Guide for Mac and Linux&lt;/a&gt;. ̀&lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-07&lt;/a&gt;: &lt;a href="https://beej.us/guide/bgipc/html/multi/index.html"&gt;Beej&amp;rsquo;s Guide to Unix IPC&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-07&lt;/a&gt;: &lt;a href="https://contains.dev/blog/optimizing-docker-image-size"&gt;Optimizing Docker image size and why it matters&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-08&lt;/a&gt;: Finally:&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_1841.JPG" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-08&lt;/a&gt;: Summary of the morning cooking session.
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1837.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1837.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/66333599959__3F04D94C-C0D4-4FFC-B58D-297D11EA233B.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/66333599959__3F04D94C-C0D4-4FFC-B58D-297D11EA233B.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-08&lt;/a&gt;: &lt;a href="https://bsless.github.io/fast-and-elegant-clojure/"&gt;Fast and Elegant Clojure&lt;/a&gt;: Idiomatic Clojure without sacrificing performance. &lt;code&gt;#clojure&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-08&lt;/a&gt;: &lt;a href="https://jacobobryant.com/post/2019/learn-clojure/"&gt;First Steps With Clojure&lt;/a&gt;. &lt;code&gt;#clojure&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-09&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;During discussions with my friends and colleagues, whenever the topic of chat protocols comes up, I often remark how simple the Internet Relay Chat (IRC) protocol is and how this simplicity has fostered creativity in the lives of many young computer hobbyists growing up in the late 1990s and early 2000s. &amp;mdash; &lt;a href="https://susam.net/maze/simplicity-of-irc.html"&gt;Simplicity of IRC&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-01-09&lt;/a&gt;: &lt;a href="https://bayesiancomputationbook.com/welcome.html"&gt;Bayesian Modeling and Computation in Python&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt; &lt;code&gt;#statistics&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-09&lt;/a&gt;: &lt;a href="https://www.ilmarilauhakangas.fi/irc_technology_news_from_the_second_half_of_2021/"&gt;IRC technology news from the second half of 2021&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-10&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Eusebius, &lt;em&gt;Water Lily&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-10&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Maxence Cyrin, &lt;em&gt;As the Darkness Falls&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-10&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;… there are thousands of reusable patterns I’ve picked up … Unfortunately, I’ve forgotten about 95% of them. … The point is to reflect on what actually stuck, so that others may save time by spendingtheir time learning what is more likely to stick. &amp;mdash; &lt;a href="https://zwischenzugs.com/2022/01/04/practical-shell-patterns-i-actually-use/"&gt;Practical Shell Patterns I Actually Use&lt;/a&gt; (via &lt;a href="https://www.johndcook.com/blog/2022/01/05/memorable-techniques/"&gt;John D. Cook&lt;/a&gt;)&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-01-10&lt;/a&gt;: &lt;a href="http://funcall.blogspot.com/2022/01/idle-puzzles-2-revenge-of-shift.html"&gt;Idle puzzles 2: Revenge of the Shift&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-10&lt;/a&gt;: &lt;a href="https://github.com/BurntSushi/xsv"&gt;xsv&lt;/a&gt;: A fast CSV command line toolkit written in Rust. Handy (and faster) alternative to csvkit.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-11&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The real enemy addressed by inlining is unexpected dependency and mutation of state, which functional programming solves more directly and completely. However, if you are going to make a lot of state changes, having them all happen inline does have advantages; you should be made constantly aware of the full horror of what you are doing. When it gets to be too much to take, figure out how to factor blocks out into pure functions (and don.t let them slide back into impurity!). &amp;mdash; &lt;a href="http://number-none.com/blow/john_carmack_on_inlined_code.html"&gt;John Carmack on Inlined Code&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-01-11&lt;/a&gt;: While browsing GitHub, I noticed that the &lt;a href="https://github.com/nvim-lua"&gt;nvim-lua&lt;/a&gt; organization offers a &amp;ldquo;starter kit&amp;rdquo; &lt;code&gt;init.lua&lt;/code&gt; file for Neovim users. It is a single Lua file, which is quite handy when you want to quickly bootstrap a sane config on external servers. I tested it in my own environment and it&amp;rsquo;s pretty good actually. If you are new to Neovim, and especially Lua config files, I recommend taking a look at how this file is organized. Except for a few packages (theme and snippets), and the default key mappings, you will likely find a working setup for your daily editing tasks. I like the idea of having a single file for the whole config, although I can understand why we may want to split our whole config in separate files, which is actually what I do.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-11&lt;/a&gt;: &lt;a href="https://github.com/wfxr/csview"&gt;csview&lt;/a&gt;: A high performance csv viewer with cjk/emoji support.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-12&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Cognitive load is important. I don’t expand much on this here, but if a programming language or a library makes me feel stupid, then I’m less likely to use it or like it. C++ does that a lot :) &amp;mdash; &lt;a href="https://aras-p.info/blog/2018/12/28/Modern-C-Lamentations/"&gt;&amp;ldquo;Modern&amp;rdquo; C++ Lamentations&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-01-12&lt;/a&gt;: Scientific computing with Rust:- &lt;a href="https://www.lpalmieri.com/posts/2019-02-23-scientific-computing-a-rust-adventure-part-0-vectors/"&gt;Rust Vectors&lt;/a&gt;- &lt;a href="https://miguelraz.github.io/blog/juliatorust/"&gt;From Julia to Rust&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-12&lt;/a&gt;: &lt;a href="https://h2oai.github.io/db-benchmark/"&gt;Database-like ops benchmark&lt;/a&gt;. Interesting to note that &lt;a href="https://docs.rs/polars/0.12.1/polars/"&gt;Polars&lt;/a&gt; wins over well-established competitors from Apache or Python. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-12&lt;/a&gt;: &lt;a href="https://dreamsongs.com/ArtOfLisp.html"&gt;The Art of Lisp &amp;amp; Writing&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-12&lt;/a&gt;: &lt;a href="https://nnethercote.github.io/perf-book/"&gt;The Rust Performance Book&lt;/a&gt;. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-12&lt;/a&gt;: &lt;a href="https://vitez.me/topological-data-analysis"&gt;Topological Data Analysis&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-12&lt;/a&gt;: &lt;a href="https://blog.pnkfx.org/blog/2022/01/10/why-i-use-a-debugger/"&gt;Why I Use a Debugger&lt;/a&gt;. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-13&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   The Feelies, &lt;em&gt;The Boy With the Perpetual Nervousness&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-14&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Glenn Gould, &lt;em&gt;Goldberg Variations, BWV 988&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-14&lt;/a&gt;: Halfway through my RSS reading list of the week. It&amp;rsquo;s amazing how much I learn from all those posts, even if I don&amp;rsquo;t necessarily have enough time to recollect all the interesting stuff I read. I should take more note, but I&amp;rsquo;ve became so lazy lately.&amp;gt; YYMMDDHHMM &amp;hellip; will no longer fit into a signed 32 bit number.&lt;br&gt;&amp;gt; The last value for last year is December 31, 2021 at 23:59, and in this format it becomes 2112312359. That just fits into a signed 32 bit number (which tops out at 2147483647).&lt;br&gt;&amp;gt; The first value for this year is January 1, 2022 at 00:00, which turns into 2201010000, and that does not fit! &amp;mdash; &lt;a href="https://rachelbythebay.com/w/2022/01/01/baddate/"&gt;YYMMDDHHMM just overflowed a signed 32 bit int&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-14&lt;/a&gt;: &lt;a href="https://fasterthanli.me/articles/my-ideal-rust-workflow"&gt;My ideal Rust workflow&lt;/a&gt;. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-14&lt;/a&gt;: &lt;a href="https://yurichev.com/news/20211223_Py_ptrs/"&gt;Pointers/references in Python&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-15&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_1850.JPG" alt="img"&gt;&lt;small&gt;Tasty&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-15&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Anja Lechner &amp;amp; François Coutu, &lt;em&gt;Vague / E la nave va&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-16&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Les Ogres de Barback, &lt;em&gt;Nos vies en couleurs&lt;/em&gt;. Clin d&amp;rsquo;oeil à Peyo.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-17&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The worst possible way to learn Rust is by vaguely looking at it, or trying some small stuff, in short scattered sessions at night after your demanding work. Sure you did learn a few languages like this before, so you may be confident in your abilities. But at some point in Rust, and it may come soon, you&amp;rsquo;ll encounter a higher step and if you don&amp;rsquo;t fight it with concentration and dedication, you risk not overcome it. &amp;mdash; &lt;a href="https://dystroy.org/blog/how-not-to-learn-rust/"&gt;How not to learn Rust&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-01-17&lt;/a&gt;: &lt;a href="https://leancrew.com/all-this/2021/12/automating-the-annotation-of-pdfs/"&gt;Automating the annotation of PDFs&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-17&lt;/a&gt;: &lt;a href="https://www.macadie.net/2021/12/29/climbing-mount-sicp/"&gt;Climbing Mount SICP&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-17&lt;/a&gt;: &lt;a href="https://mattbaker.blog/2021/12/21/counting-with-martingales/"&gt;Counting with martingales&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-17&lt;/a&gt;: &lt;a href="https://danilafe.com/blog/modulo_patterns/"&gt;Digit Sum Patterns and Modular Arithmetic&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-17&lt;/a&gt;: &lt;a href="https://hakibenita.com/postgresql-unknown-features"&gt;Lesser Known PostgreSQL Features&lt;/a&gt;. &lt;code&gt;#database&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-17&lt;/a&gt;: &lt;a href="https://www.peterbaumgartner.com/blog/testing-for-data-science/"&gt;Ways I Use Testing as a Data Scientist &lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-18&lt;/a&gt;: &lt;a href="https://pierrezemb.fr/posts/distsys-resources/"&gt;Best resources to learn about data and distributed systems&lt;/a&gt;. &lt;code&gt;#database&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-19&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Current 93, &lt;em&gt;All the Pretty Little Horses&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-19&lt;/a&gt;: &lt;a href="https://www.quora.com/What-goes-into-making-an-OS-to-be-Unix-compliant-certified"&gt;What goes into making an OS to be Unix compliant certified?&lt;/a&gt;. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-20&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Luschny&amp;rsquo;s webpage cites, for example, recent treatments of the subject by leading mathematicians such as Terence Tao. And his most compelling argument, from my personal perspective, is the way he unveils the early publications: I learned from him that my own presentation of the story, in The Art of Computer Programming and much more extensively in Concrete Mathematics, was a violation of history! I had put words and thoughts into Bernoulli and Euler&amp;rsquo;s minds that were not theirs at all. This hurt, because I&amp;rsquo;ve always tried to present the evolution of ideas faithfully; in this case I&amp;rsquo;d fooled myself, by trying to conform what they wrote to what I&amp;rsquo;d learned. &amp;mdash; &lt;a href="https://www-cs-faculty.stanford.edu/~knuth/news22.html"&gt;Concrete Mathematics and Bernoulli&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2022-01-20&lt;/a&gt;: &lt;a href="https://pythonspeed.com/articles/vectorization-python/"&gt;How vectorization speeds up your Python code&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-21&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Stefano di Battista, &lt;em&gt;Cosa avete fatto a Solande&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-21&lt;/a&gt;: &lt;a href="https://blog.crunchydata.com/blog/postgres-indexes-for-newbies"&gt;Postgres Indexes for Newbies&lt;/a&gt;. &lt;code&gt;#database&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-24&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Jacques Loussier Trio, &lt;em&gt;Gymnopédie No. 1, Variation 1&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-24&lt;/a&gt;: &lt;iframe style="border: 0; width: 100%; height: 42px;" src="https://bandcamp.com/EmbeddedPlayer/album=3988878580/size=small/bgcol=ffffff/linkcol=0687f5/transparent=true/" seamless&gt;&lt;a href="https://adamwakeman.bandcamp.com/album/a-handful-of-memories"&gt;A Handful Of Memories by Adam Wakeman&lt;/a&gt;&lt;/iframe&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-24&lt;/a&gt;: Hot end of the week in the kitchen ;-)
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1859.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1859.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1860.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1860.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/66463211640__51EA6376-A2C7-45C3-A9F5-3F88DE4F35C9.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/66463211640__51EA6376-A2C7-45C3-A9F5-3F88DE4F35C9.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;&lt;img src="https://aliquote.org/img/66462800165__5F8842DD-39BE-475F-AC88-6A8EF8921490.JPG" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-24&lt;/a&gt;: &lt;a href="http://cfenollosa.com/blog/do-you-feel-like-google-search-results-keep-getting-worse.html"&gt;Do you feel like Google search results keep getting worse?&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2022-01-25&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;What Gemini is doing, is saying “we don’t need no videos, images, stylesheets, nor JavaScripts, because we want to have a lightweight web experience, so we throw all that crap out!”. Fine, sounds great. But why does it require a new protocol for that? Why couldn’t one simply build on top of existing HTTP infrastructure, throw away all the baggage and instead implement a new Content-Type, which existing browsers then could parse? &amp;mdash; &lt;a href="https://xn--gckvb8fzb.com/gemini-is-solutionism-at-its-worst/"&gt;Gemini is Solutionism at its Worst&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;</description></item><item><title>Tips and tricks for Neomutt</title><link>https://aliquote.org/post/tipx-on-neomutt/</link><pubDate>Wed, 19 Jan 2022 20:15:24 +0100</pubDate><guid>https://aliquote.org/post/tipx-on-neomutt/</guid><description>&lt;p&gt;A few months ago, I talked about my new email client, &lt;a href="https://aliquote.org/post/neomutt/"&gt;neomutt&lt;/a&gt;, and the default settings I settled upon. Nothing has changed much, except that I now use a single catchup email address, which makes managing emails more comfortable over time.&lt;/p&gt;
&lt;p&gt;Here are a few other tricks that I learned (the hard way) in the meantime:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;If you use Vim or Neovim as your main editor for writing emails, you can enable spell checking as follows: &lt;code&gt;set editor = &amp;quot;nvim +8 -c 'set textwidth=0' -c 'set spell spelllang=fr,en'&amp;quot;&lt;/code&gt;. Note that you can use more than one language.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I don&amp;rsquo;t like notification, but you can get live notifications on your desktop using &lt;a href="https://neomutt.org/feature/new-mail"&gt;inotify&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you have multiple accounts (past or present), it is useful to define &lt;code&gt;alternates&lt;/code&gt;, e.g. &lt;code&gt;alternates (john@smith.com)|(john.smith@(mac\.com|gmail\.com))&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Folding may be enabled automagically for threads provided you ask for it, e.g., write &lt;code&gt;folder-hook archives/* 'push &amp;lt;collapse-all&amp;gt;\n'&lt;/code&gt; in your &lt;code&gt;muttrc&lt;/code&gt; config file, after replacing &lt;code&gt;archives&lt;/code&gt; with the mailbox of interest.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you prefer reading plain text message over, say, HTML version, don&amp;rsquo;t forget to add &lt;code&gt;alternative_order text/plain text/enriched text/html&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you use mu as your main backend to process your email archives, you can benefit from its search functionalities in addition to Neomutt builtin ones. I use the following bindings to query and retrieve results:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;macro index F &amp;#34;&amp;lt;shell-escape&amp;gt;mu find --clearlinks --format=links --linksdir=~/.mu/results &amp;#34; &amp;#34;mu find&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;macro index ,f &amp;#34;&amp;lt;change-folder-readonly&amp;gt;~/.mu/results&amp;lt;enter&amp;gt;&amp;#34; &amp;#34;mu find results&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Rather than reading then deleting a message, you can mark it as read and delete it altogether using the following macro: &lt;code&gt;macro index,pager X &amp;quot;:set confirmappend=no delete=yes resolve=no\n&amp;lt;clear-flag&amp;gt;N&amp;lt;tag-prefix&amp;gt;&amp;lt;delete-message&amp;gt;:set confirmappend=yes delete=ask-yes resolve=yes\n&amp;lt;next-undeleted&amp;gt;&amp;quot;&lt;/code&gt;. This way, to delete a message just press the &lt;kbd&gt;X&lt;/kbd&gt; key; it will be marked as read and moved to your Trash folder. No more unread message in your Trash folder!&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To mark all messages as read, you can use the following macro: &lt;code&gt;macro index \Cr &amp;quot;T~U&amp;lt;enter&amp;gt;&amp;lt;tag-prefix&amp;gt;&amp;lt;clear-flag&amp;gt;N&amp;lt;untag-pattern&amp;gt;.&amp;lt;enter&amp;gt;&amp;quot; &amp;quot;mark all messages as read&amp;quot;&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Finally, to view specific attachments, you can use the following settings:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;application/pdf; pdftotext -layout %s -; copiousoutput;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# application/pdf; /usr/bin/xdg-open %s ; copiousoutput
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;application/postscript ; /usr/bin/xdg-open %s ; copiousoutput
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;application/msword; pandoc --from docx --to plain %s; copiousoutput
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;application/rtf; pandoc --from rtf --to plain %s; copiousoutput
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Chris Bailey • &lt;em&gt;Bring It On Home to Me&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Un problème de rencontres</title><link>https://aliquote.org/post/probleme-de-rencontres/</link><pubDate>Fri, 14 Jan 2022 20:17:44 +0100</pubDate><guid>https://aliquote.org/post/probleme-de-rencontres/</guid><description>&lt;p&gt;Asking for the number of permutations of $n$ distinct elements such that element $k$ is not in the $k$th position, $k=1, \dots, n$, is just the &amp;ldquo;problème des rencontres&amp;rdquo;.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; As stated on Wikipedia, it amounts to determine the probability that a random permutation is a &lt;a href="https://en.wikipedia.org/wiki/Derangement"&gt;derangement&lt;/a&gt;.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;The total number of objects to be considered is $N=n!$, by definition. All those $a_n$ permutations are distinguished by the fact that element $a_k$ is in the $k$th position. The problem is symmetric because the selection of a set of size $j$ determines a number independent of the particular set that is being selected. For instance, if $b_1, b_2, \dots, b_j$ is such a subset, then $N(b_1b_2\dots b_j) = (n-j)!$. From there, the relative sum $S_j$ over such a subset turns out to be:&lt;/p&gt;
&lt;p&gt;$$ S_j = \frac{{n \choose j}(n-j)!}{n!} = \frac{1}{j!}. $$&lt;/p&gt;
&lt;p&gt;Riordan relies on symbolic development (pp. 52-53) to show that:&lt;/p&gt;
&lt;p&gt;$$
\begin{align}
p_n(0) &amp;amp;= 1 - S_1 + S_2 - S_3 + \dots + (-1)^nS_n\cr
&amp;amp;= 1 - 1 + \frac{1}{2!} - \frac{1}{3!} + \dots + \frac{(-1)^n}{n!}
\end{align}
$$&lt;/p&gt;
&lt;p&gt;and also that:&lt;/p&gt;
&lt;p&gt;$$
\begin{align}
p_n(k) &amp;amp;= S_k - (k+1)S_{k+1} + {k+2 \choose 2}S_{k+2} - \dots + (-1)^{n-k}{n \choose k}S_n\cr
&amp;amp;= \frac{1 - 1 + \frac{1}{2!} - \dots + \frac{(-1)^{n-k}}{(n-k)!}}{k!} \cr
&amp;amp;= \frac{p_{n-k}(0)}{k!}
\end{align}
$$&lt;/p&gt;
&lt;p&gt;The above indicates that all probabilities are determined by $p_n(0)$ which is the truncated exponential series $e^{-1}$,&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt; whose mean is $S_1=1$. For large $n$, the distribution is approximated by a Poisson distribution with mean 1 since $p_n(k) \approx e^{-1}/k!$.&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Riordan, John. &lt;em&gt;Introduction to Combinatorial Analysis&lt;/em&gt;. Dover Publications Inc., 2002.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;An $\mathcal{O}(N)$ algorithm to find a particular derangement of a sequence of $n$ items consists in dividing the original sequence in pairs of items and then swap each item from each pair; if $n$ is odd the last pair must be swapped twice, which means there are at most $n/2+1$ swaps. It does not help generating a random derangement, but it finds the derangement with the least perturbation in lexicographic order.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:3"&gt;
&lt;p&gt;Recall that well-known Taylor and Maclaurin series includes $e^x = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \dots + \frac{x^n}{n!} = \sum_{n=0}^\infty \frac{x^n}{n!}$ for all $x$. A truncated series is just an approximation of an infinite series using some maximum for the series. For instance, in the case of a geometric series, $1 + t + t^2 + t^3 + \dots = \sum_{n=0}^\infty t^n$, we know that when $|t|&amp;lt;1$, the solution converges to $\frac{1}{1-t}$. Instead of this, we could consider $\sum_{n=0}^N t^n$, which can be evaluated numerically.&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Pandoc templates are great</title><link>https://aliquote.org/post/new-pandoc-template/</link><pubDate>Mon, 10 Jan 2022 21:17:41 +0100</pubDate><guid>https://aliquote.org/post/new-pandoc-template/</guid><description>&lt;p&gt;In my &lt;a href="https://aliquote.org/post/org-in-vim/"&gt;previous post&lt;/a&gt;, I talked about writing Org file in Vim. While I much prefer the Org format, I often fall back on Markdown as the default markup for plain text files. I devised several Pandoc templates over the years, especially for RMarkdown documents. As discussed in an &lt;a href="https://aliquote.org/post/latex-beamer-21-century/"&gt;older post of mine&lt;/a&gt;, I use a Makefile and a YAML header to process my text MArkdown or RMarkdown documents. Having a separate YAML header as well as plain $\LaTeX$ file to add custom macros make it easy to define a common template for a series of handouts. The main font is Fira Sans, and its derivation (Fira Sans Condensed and Fira Code). It took me a longer time to understand how to use ligatures in listings-based code block. I&amp;rsquo;ve used various workarounds, like using Unicode characters (e.g., for the R assignment operator, &lt;code&gt;&amp;lt;-&lt;/code&gt;) or additional $\LaTeX$ packages for verbatim environments. Finally, the solution is quite easy once you learn it: Just add the &lt;a href="https://github.com/RuixiZhang42/lstfiracode"&gt;lstfiracode&lt;/a&gt; package, and customize your listings settings as follows: &lt;code&gt;\lstset{basicstyle=\small\ttfamily, style=FiraCodeStyle, ...}&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Lately, I&amp;rsquo;ve also used the Eisvogel template for some handouts. It works great, its design favors simple (sans) defaults, but I don&amp;rsquo;t really like the default settings for code chunks, for example. Needless to say, I wrote my own custom template to export Org file to Latex Tufte handout via Pandoc, as discussed elsewhere on this blog. I also have a similar workflow for Md -&amp;gt; Tex export, without using the Tufte handout Latex class. It reimplements part of the Tufte layout, but it relies on different base fonts (Fira and STIX Two Math) and verbatim environments. Here is an excerpt:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-latex" data-lang="latex"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\usepackage&lt;/span&gt;[a4paper, left=1cm, right=8cm, top=1cm, bottom=1cm,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;marginparwidth=6.5cm]&lt;span class="nb"&gt;{&lt;/span&gt;geometry&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\usepackage&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;sidenotes&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\usepackage&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;sectsty&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\subsectionfont&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\color&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;DarkSlateGrey&lt;span class="nb"&gt;}}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\usepackage&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;titlesec&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\titlespacing&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\section&lt;/span&gt;&lt;span class="nb"&gt;}{&lt;/span&gt;0pt&lt;span class="nb"&gt;}{&lt;/span&gt;&lt;span class="k"&gt;\parskip&lt;/span&gt;&lt;span class="nb"&gt;}{&lt;/span&gt;-&lt;span class="k"&gt;\parskip&lt;/span&gt;&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\titlespacing&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\subsection&lt;/span&gt;&lt;span class="nb"&gt;}{&lt;/span&gt;0pt&lt;span class="nb"&gt;}{&lt;/span&gt;&lt;span class="k"&gt;\parskip&lt;/span&gt;&lt;span class="nb"&gt;}{&lt;/span&gt;-&lt;span class="k"&gt;\parskip&lt;/span&gt;&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\renewcommand&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\baselinestretch&lt;/span&gt;&lt;span class="nb"&gt;}{&lt;/span&gt;1&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\usepackage&lt;/span&gt;&lt;span class="na"&gt;[justification=justified, singlelinecheck=false]&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;caption&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\DeclareCaptionFont&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;white&lt;span class="nb"&gt;}{&lt;/span&gt;&lt;span class="k"&gt;\color&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;white&lt;span class="nb"&gt;}}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\DeclareCaptionFormat&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;listing&lt;span class="nb"&gt;}{&lt;/span&gt;&lt;span class="k"&gt;\hspace*&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;-3.5pt&lt;span class="nb"&gt;}&lt;/span&gt;&lt;span class="c"&gt;%
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;\parbox&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\textwidth&lt;/span&gt;&lt;span class="nb"&gt;}{&lt;/span&gt;&lt;span class="k"&gt;\colorbox&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;LightSlateGrey&lt;span class="nb"&gt;}{&lt;/span&gt;&lt;span class="k"&gt;\parbox&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\dimexpr\textwidth&lt;/span&gt;+1pt&lt;span class="nb"&gt;}{&lt;/span&gt;#1#2#3&lt;span class="nb"&gt;}}&lt;/span&gt;&lt;span class="k"&gt;\vskip&lt;/span&gt;2.8pt&lt;span class="nb"&gt;}}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\captionsetup&lt;/span&gt;&lt;span class="na"&gt;[lstlisting]&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;labelformat=empty,format=listing,labelfont=white,textfont=white&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\renewenvironment&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;figure&lt;span class="nb"&gt;}&lt;/span&gt;[1][width=&lt;span class="k"&gt;\marginparwidth&lt;/span&gt;]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\begin&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;marginfigure&lt;span class="nb"&gt;}}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\end&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;marginfigure&lt;span class="nb"&gt;}}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\renewcommand&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\footnote&lt;/span&gt;&lt;span class="nb"&gt;}&lt;/span&gt;[1]&lt;span class="nb"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\let\thesidenote\relax\sidenotetext&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;#1&lt;span class="nb"&gt;}}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Pandoc templates are great because it reduces the $\LaTeX$ you have to write. I know most text editors will handle snippets or shortcuts that will create new environment or section or whatever on the fly. However, If you can stick to Markdown or Org syntax for 80% of the document, that&amp;rsquo;s not so bad either.&lt;/p&gt;
&lt;p&gt;Finally, a long time ago (if memory serves it was in 2009), I got inspired by Kieran Healy&amp;rsquo;s &lt;a href="https://github.com/kjhealy/pandoc-templates"&gt;own templates&lt;/a&gt; and I devised a simple Xe$\LaTeX$ article-based Pandoc template which used another set of great fonts:&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-latex" data-lang="latex"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\usepackage&lt;/span&gt;[xetex,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; colorlinks=true,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; urlcolor=BlueViolet,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; citecolor=greeny,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; filecolor=,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; linkcolor=greeny,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; plainpages=false,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; pdfpagelabels,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; bookmarksnumbered,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; pdftitle=&lt;span class="nb"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\mytitle&lt;/span&gt;&lt;span class="nb"&gt;}&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c"&gt;%pagebackref,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; pdfauthor=&lt;span class="nb"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\myauthor&lt;/span&gt;&lt;span class="nb"&gt;}&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; pdfkeywords=&lt;span class="nb"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\mykeywords&lt;/span&gt;&lt;span class="nb"&gt;}&lt;/span&gt;]&lt;span class="nb"&gt;{&lt;/span&gt;hyperref&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\setromanfont&lt;/span&gt;[Mapping=&lt;span class="nb"&gt;{&lt;/span&gt;tex-text&lt;span class="nb"&gt;}&lt;/span&gt;,Numbers=&lt;span class="nb"&gt;{&lt;/span&gt;OldStyle&lt;span class="nb"&gt;}&lt;/span&gt;,&lt;span class="c"&gt;%
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Ligatures=&lt;span class="nb"&gt;{&lt;/span&gt;Common&lt;span class="nb"&gt;}&lt;/span&gt;]&lt;span class="nb"&gt;{&lt;/span&gt;Minion Pro&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\setsansfont&lt;/span&gt;&lt;span class="na"&gt;[Mapping={tex-text},Scale=0.9]&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;Myriad Pro&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\setmonofont&lt;/span&gt;&lt;span class="na"&gt;[Mapping=tex-text,Colour=AA0000,Scale=0.9]&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;Inconsolata&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Today, I decided to rehabilitate this template using a much simpler Pandoc template, and to replace the Fira font triumvirate with the above settings. Rather than writing a separate YAML header, I put the header directly into the Markdown file.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-markdown" data-lang="markdown"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;---
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mainfont: Minion Pro
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sansfont: Myriad Pro
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;monofont: Fira Code
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mathfont: STIX Two Math
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;monofontoptions: &amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; [Scale = 0.8, Numbers = Lining,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; BoldFont = Fira Code Medium,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Contextuals = Alternate]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mainfontoptions: [Numbers = OldStyle, Ligatures = Rare]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mathfontoptions: [Scale = MatchLowercase]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;fontsize: 9pt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;linestretch: 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;classoption: [svgnames]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;lang: fr-FR
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;citecolor: DarkSlateGrey
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;urlcolor: SlateGrey
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;linkcolor: SlateGrey
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;link-citations: true
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bibliography: /home/chl/Documents/notes/references.bib
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;csl: apa-fr-provost.csl
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;header-includes:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;-&lt;/span&gt; \defaultfontfeatures{Extension = .otf}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;-&lt;/span&gt; \usepackage{fontawesome}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;-&lt;/span&gt; \usepackage{lstfiracode}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;-&lt;/span&gt; \usepackage{setspace}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;-&lt;/span&gt; &amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \AtBeginEnvironment{quote}{\sffamily\raggedright
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \frenchspacing\setstretch{1.0}}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;-&lt;/span&gt; &amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \lstset{basicstyle=\small\ttfamily,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; style=FiraCodeStyle,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; commentstyle=\color{DarkSlateGrey},
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; frame = single,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; rulecolor = \color{LightSlateGrey}}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;---
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here is a side by side preview of both variants (Adobe fonts on the left, Fira on the right):&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/template_adobe.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/template_adobe.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/template_fira.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/template_fira.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Of course, the same template can be applied to an Org file, with minor adaptation, using &lt;a href="https://orgmode.org/manual/LaTeX-header-and-sectioning.html"&gt;Latex header&lt;/a&gt; options.&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;See also &lt;a href="https://tex.stackexchange.com/questions/9533/what-best-combination-of-fonts-for-serif-sans-and-mono-do-you-recommend"&gt;What best combination of fonts for Serif, Sans, and Mono do you recommend?&lt;/a&gt;&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Generating partitions</title><link>https://aliquote.org/post/generating-partition/</link><pubDate>Sun, 09 Jan 2022 10:19:18 +0100</pubDate><guid>https://aliquote.org/post/generating-partition/</guid><description>&lt;p&gt;In a &lt;a href="https://aliquote.org/post/power-set"&gt;previous post&lt;/a&gt; we showed how to efficiently generate the power set of a given set of elements. Other than its relation to Binomial coefficient as documented on Wikipedia, I don&amp;rsquo;t know if they are of any use on statistics. We also mentioned the case of partitions, which are more interesting from a statistical point of view since they are at the heart of partitioning methods in cluster analysis. How do we generate all partitions? Don Knuth discusses two algorithms to generate integer (algorithm P) or set (algorithm H) partitions,&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; but see also &lt;a href="https://algorist.com/problems/Generating_Partitions.html"&gt;The Algorithm Design Manual&lt;/a&gt; (or this &lt;a href="https://www8.cs.umu.se/kurser/TDBAfl/VT06/algorithms/BOOK/BOOK2/NODE45.HTM"&gt;older course&lt;/a&gt; by Steven Skiena).&lt;/p&gt;
&lt;p&gt;The main idea of algorithm H to generate set partition is as follows:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Set $a_1\dots a_n \leftarrow 0\dots 0, b_1\dots b_{n-1} \leftarrow 1\dots 1, \text{and } m \leftarrow 1$.&lt;/li&gt;
&lt;li&gt;Visit the restricted growth string $a_1\dots a_n$,&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; which represents a partition into $m + [a_n=m]$ blocks. Then go to (4) if $a_n=m$.&lt;/li&gt;
&lt;li&gt;Set $a_n \leftarrow a_n + 1$ and return to (2).&lt;/li&gt;
&lt;li&gt;Set $j \leftarrow n - 1$; then, while $a_j = b_j$, set $j \leftarrow j - 1$.&lt;/li&gt;
&lt;li&gt;Terminate if $j = 1$. Otherwise set $a_j \leftarrow a_j + 1$.&lt;/li&gt;
&lt;li&gt;Set $m \leftarrow b_j + [a_j=b_j]$ and $j \leftarrow j + 1$. Then, while $j &amp;lt; n$, set $a_j \ leftarrow 0$, $b_j \leftarrow m$, and $j \leftarrow j + 1$. Finally set $a_n \leftarrow 0$ and go back to (2).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;An Haskell solution to multiset partitions is available in &lt;a href="https://wiki.haskell.org/wikiupload/d/dd/TMR-Issue8.pdf"&gt;Generating Multiset Partitions&lt;/a&gt;, by Brent Yorgey.&lt;/p&gt;
&lt;p&gt;What about the total number of partitions? The number of partition, $p(n)$, can be formulated using recursion. Let $p_1(k) = 1$ ($1\le k \le n$), then&lt;/p&gt;
&lt;p&gt;$$ p_m(k) = \begin{cases} p_{m-1}(k) &amp;amp; \mbox{if } k &amp;gt; n,\cr p_{m-1}(k) + p_m(k-m) &amp;amp; \mbox{if } k \ge m &amp;gt; 1, \end{cases} $$&lt;/p&gt;
&lt;p&gt;and we evaluate $p_m(k)$ for $1 \le m \le n$ and $m \ge k \ge n$. Note that $p(n) = p_n(n)$. Berstel et al. offer an implementation in Pascal to compute $p(n)$ as $\alpha 10^4 + \beta$, whose literal translation in C looks like this:&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt; (untested code)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-c" data-lang="c"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;stdlib.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;npartitions&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;alpha&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;beta&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;nmax&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;base&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;nmax&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;nmax&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;base&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;div_t&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;div&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;base&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;quot&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;alpha&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;beta&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Leisure • &lt;em&gt;Take You Higher&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;D. E. Knuth. &lt;em&gt;The Art of Computer Programming, Vol. 4A: Combinatorial Algorithms&lt;/em&gt;. Addison-Wesley, 2011.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;A restricted growth string is a string $a_1a_2\dots a_n$ of nonnegative integers in which we have $a_1=0$ and $a_{j+1} \le 1 + \text{max}(a_1,\dots, a_j)$ for $1 \le j &amp;lt; n$.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:3"&gt;
&lt;p&gt;J. Berstel, J.-E. Pin, and M. Pocchiola. &lt;em&gt;Mathématiques et Informatique : Combinatoire et Arithmétique&lt;/em&gt;. Ediscience International, 1991.&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Org in Vim</title><link>https://aliquote.org/post/org-in-vim/</link><pubDate>Thu, 06 Jan 2022 19:55:45 +0100</pubDate><guid>https://aliquote.org/post/org-in-vim/</guid><description>&lt;p&gt;It&amp;rsquo;s been a few years since I last discussed the benefits of using Org rather than, say, Markdown. In short, the syntax is cleaner, it add further structural editing elements (like example, verse, etc.), it adds Babel code block (which works quite well under Emacs), Org tables are easier to manage than Markdown or Pandoc ones, and it is well interfaced with Pandoc. And for those who like GTD and stuff like that it has its own agenda and appointment management tool chain.&lt;/p&gt;
&lt;p&gt;I wrote my &lt;a href="https://aliquote.org/post/standalone-org-babel/"&gt;last post&lt;/a&gt; about it when I stopped using Emacs full time.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; At this time, there were two competitors to Emacs org-mode in Vim: &lt;a href="https://github.com/jceb/vim-orgmode"&gt;vim-orgmode&lt;/a&gt; and &lt;a href="https://github.com/vimwiki/vimwiki"&gt;vimwiki&lt;/a&gt;. These plugins were surely not as powerful as org-mode, and neither provided agenda-like or code block facilities. I ended up writing Org mode as I do write Markdown, as plain text. Now, things have changed a little as far as Markdown is concerned since a &lt;a href="https://github.com/MDeiml/tree-sitter-markdown"&gt;Treesitter parser&lt;/a&gt; has been made available. And today I just came across &lt;a href="https://github.com/nvim-orgmode/orgmode"&gt;orgmode&lt;/a&gt;, which is specifically designed for Neovim users and relies on Treesitter for the most part.&lt;/p&gt;
&lt;p&gt;I installed this plugin alongside &lt;a href="https://github.com/dhruvasagar/vim-table-mode"&gt;vim-table-mode&lt;/a&gt;, and everything works as advertised. I didn&amp;rsquo;t tested the agenda facilities since I no longer rely on it in my daily workflow.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; In particular, I like the fact that I get automatic folding as one would expect when working with Emacs. I do not use the concealing feature for links and other emphasized pieces of text, but they look to work too, provided you &lt;code&gt;set conceallevel=2&lt;/code&gt; in your config or from the command line when editing your file. For editing purpose at least, it is enough for me. Below is a screenshot of my &lt;a href="https://aliquote.org/pub/vim-101.pdf"&gt;Vim 101 tutorial&lt;/a&gt;, which I wrote in Emacs &lt;a href="https://aliquote.org/post/emacs-org-tufte-handout/"&gt;two years ago&lt;/a&gt;.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2022-01-06-20-56-25.png"&gt;
&lt;/figure&gt;
&lt;p&gt;If you take a look at the online help for &lt;code&gt;orgmode&lt;/code&gt;, you will soon notice that it focus on agenda functionalities. I hope that automatic evaluation of code blocks will be integrated soon. I tried &lt;a href="https://github.com/michaelb/sniprun"&gt;sniprun&lt;/a&gt; breifly in the afternoon, and although it is very approachable and it provides a concise way to evaluate code block and displaying results using modern features like virtual text, it does not support Lisp-like PLs (Common Lisp, Scheme or Clojure). We&amp;rsquo;ll see how it goes then. In the meantime, the vim-table-mode is a killer feature since it even works for any filetype in Vim.&lt;/p&gt;
&lt;p&gt;This is my first post of the year, by the way. Happy new year to all of you!&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Camille Berthollet &amp;amp; Julie Berthollet • &lt;em&gt;The Leftovers, Suite&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;See also &lt;a href="https://aliquote.org/post/emacs-org-tufte-handout/"&gt;Emacs Org and Tufte handout&lt;/a&gt;, &lt;a href="https://aliquote.org/post/org-css-design/"&gt;Org custom CSS&lt;/a&gt;, or &lt;a href="https://aliquote.org/post/org-workflow/"&gt;Org exports&lt;/a&gt;.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;I&amp;rsquo;ve been using Org agenda for two years, and I used to manage everything (meeting notes, projects tasks and TODO lists, appointments) in Emacs using org-mode. Then I realized once again that GTD and workflow like that are definitely not for me. A simple TODO list in plain text and Changelog are enough for me, together with Git history.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Let's close the year</title><link>https://aliquote.org/post/end-2022/</link><pubDate>Fri, 31 Dec 2021 20:04:04 +0100</pubDate><guid>https://aliquote.org/post/end-2022/</guid><description>&lt;p&gt;And so, this is already the end of the year.&lt;/p&gt;
&lt;p&gt;No year in review today, I&amp;rsquo;m definitely too lazy tonight. All I could say is that the year went by very quickly in the end. I did the job I had planned to do, besides the move and the unexpected medical care, and I could have tinkered a bit more with Scheme and Lisp, but that&amp;rsquo;s for another time probably. Today, I&amp;rsquo;m sick (no COVID, though, just a heavy cold) and alone at home. I have, however, enough alcohol to finish my evening looking at the Christmas tree, reading a novel before falling asleep quietly until tomorrow.&lt;/p&gt;
&lt;p&gt;I wish I still felt like drawing, but I don&amp;rsquo;t think I feel like it anymore.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src=""
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/66137812700__90B2FFAD-74D9-4575-8714-3459519468DF.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/66137812700__90B2FFAD-74D9-4575-8714-3459519468DF.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src=""
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Same for writing.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;En tirant sur sa mèche&lt;br&gt;
Je vis apparaître des flocons encore vierges&lt;br&gt;
$\quad\quad\quad$ de toute trace d&amp;rsquo;encre&lt;br&gt;
Je décidais de prendre sa main&lt;br&gt;
Et tout mon bras se vida de son sang&lt;br&gt;
$\quad\quad\quad$ pour n&amp;rsquo;être plus qu&amp;rsquo;une aile repliée&lt;br&gt;
Lorsque j&amp;rsquo;ai caressé ses lèvres&lt;br&gt;
Le sol se déroba sous mes pieds&lt;br&gt;
$\quad\quad\quad$ me laissant en suspension au-dessus de son corps&lt;br&gt;
Elle prit enfin mon autre main&lt;br&gt;
Pour ne plus que je m&amp;rsquo;évapore&lt;br&gt;
Mais au lieu de la serrer&lt;br&gt;
Elle a souri et ses yeux sont devenus un reflet&lt;br&gt;
où je voyais danser de minuscules filaments&lt;br&gt;
$\quad\quad\quad$ de mon désir&lt;br&gt;&lt;/p&gt;
&lt;p&gt;Quand je m&amp;rsquo;éveillais et que je ne sentis plus sa main&lt;br&gt;
Je sus qu&amp;rsquo;elle m&amp;rsquo;avait dévoré durant mon sommeil&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I upgraded my Python, Racket and R packages yesterday, mad made a complete backup of my &lt;code&gt;$HOME&lt;/code&gt; directory today. While everything went fine with R and Racket, I broke my &lt;code&gt;pylsp&lt;/code&gt; installation, which occurs more often than I would. Every. Single. Time. (This time, the problem came from the &lt;code&gt;tomli&lt;/code&gt; dependency). I also added &amp;lsquo;kosayoda/nvim-lightbulb&amp;rsquo; to my list of Neovim plugins in order to make code actions more discoverable. Actually, they are available for Haskell, Rust, Python (although it looks like garbage most of the time), and Clojure. At least, those are the languages I use the most with LSP. I also added &amp;rsquo;eraserhd/parinfer-rust&amp;rsquo; recently. It works like a charm and it makes working with s-expressions much smoother, especially when deleting part of a form. Finally, I tried another polyglot REPL: &amp;lsquo;hkupty/iron.nvim&amp;rsquo; (as a replacement to neoterm, which appears to be on hold since a few months).&lt;/p&gt;
&lt;p&gt;If you haven&amp;rsquo;t listened to Led Zeppelin recently, I can recommend this beautiful cover of &lt;em&gt;Stairway to heaven&lt;/em&gt;.&lt;/p&gt;
&lt;div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"&gt;
&lt;iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/2cZ_EFAmj08?autoplay=0&amp;amp;controls=1&amp;amp;end=0&amp;amp;loop=0&amp;amp;mute=0&amp;amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"&gt;&lt;/iframe&gt;
&lt;/div&gt;
&lt;p&gt;Happy new year to all of you!&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Nick Cave &amp;amp; The Bad Seeds • &lt;em&gt;Slowly Goes The Night&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Generating power sets in Lisp</title><link>https://aliquote.org/post/power-set/</link><pubDate>Wed, 29 Dec 2021 20:16:50 +0100</pubDate><guid>https://aliquote.org/post/power-set/</guid><description>&lt;p&gt;A power set is the set of all subsets composed of one or more elements of the original set. Consider the set $\{1,2,3\}$, then its power set is: $\{\}$, $\{1\}$, $\{2\}$, $\{3\}$, $\{1,2\}$, $\{1,3\}$, $\{2,3\}$, $\{1,2,3\}$. It is different from a partition which considers mutually exclusive elements, excluding empty sets and considering only the union of all possible subsets. In this particular case, the corresponding partition would be: $\{\{1\}, \{2\}, \{3\}\}$, $\{\{1, 2\}, \{3\}\}$, $\{\{1, 3\}, \{2\}\}$, $\{\{1\}, \{2, 3\}\}$ and $\{\{1, 2, 3\}\}$.&lt;/p&gt;
&lt;p&gt;How to generate such a power set in a recursive manner? First, the power set of an empty list is of course the empty list. Second, the power set of $A = \{a,\dots\}$, where $\dots$ represents the &lt;code&gt;cdr&lt;/code&gt; of $A$ using Lisp notation (i.e., all elements after the first one, $a$) amounts to concatenating the power set of $A - \{a\}$ &amp;ndash; which means all subset of $A$ which do not include $a$ &amp;ndash; and, again, the power set of $A - \{a\}$, this time with a prepended to each subset. In the above example, the later point yields, on the one hand, $\{\}$, $\{2\}$, $\{3\}$, $\{2,3\}$, and on the other hand, $\{1\}$, $\{1,2\}$, $\{1,3\}$, $\{1,2,3\}$. I don&amp;rsquo;t remember the name of this algorithm.&lt;/p&gt;
&lt;p&gt;In Lisp, we can write the following:&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defun&lt;/span&gt; &lt;span class="nv"&gt;power-set&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;eq&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt; &lt;span class="nv"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(())&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nv"&gt;power-set-cdr&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;power-set&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;cdr&lt;/span&gt; &lt;span class="nv"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt; &lt;span class="nv"&gt;power-set-cdr&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;mapcar&lt;/span&gt; &lt;span class="nf"&gt;#&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;lambda&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;subset&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;cons&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;car&lt;/span&gt; &lt;span class="nv"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;subset&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;power-set-cdr&lt;/span&gt;&lt;span class="p"&gt;)))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;
&lt;div class="alert alert-note"&gt;
&lt;p&gt;&lt;small&gt;[2023-02-06]&lt;/small&gt;&lt;br&gt;
Daniel P. Friedman suggested this implementation of power set in Scheme, see his slides on &lt;a href="http://www.cs.indiana.edu/hyplan/dfried/intro-slides.ps"&gt;The Joys of Scheme&lt;/a&gt; (PS):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="nv"&gt;power-set&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;cond&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nb"&gt;null? &lt;/span&gt;&lt;span class="nv"&gt;set&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(()))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;else &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;extend&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;car &lt;/span&gt;&lt;span class="nv"&gt;set&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;power-set&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cdr &lt;/span&gt;&lt;span class="nv"&gt;set&lt;/span&gt;&lt;span class="p"&gt;)))))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="nv"&gt;extend&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;item&lt;/span&gt; &lt;span class="nv"&gt;power-set&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;map &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cons &lt;/span&gt;&lt;span class="nv"&gt;item&lt;/span&gt; &lt;span class="nv"&gt;set&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="nv"&gt;power-set&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;power-set&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Using our base example, this gives:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;CL-USER&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;power-set&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2023-03-14]&lt;/small&gt;&lt;br&gt;
For a related approach, see &lt;a href="https://kaygun.tumblr.com/post/710713944069816320/set-of-all-partitions-of-a-finite-set"&gt;Set of All Partitions of a Finite Set&lt;/a&gt; by Atabey Kaygun.
&lt;/div&gt;
&lt;p&gt;What&amp;rsquo;s more interesting is that it works with characters as well, so that we can compose an infinite number of words given a constrained alphabet. In the following example, I will consider the &lt;a href="https://fr.wikipedia.org/wiki/Fr%C3%A9quence_d%27apparition_des_lettres_en_fran%C3%A7ais"&gt;most frequently used letters&lt;/a&gt; in French:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defparameter&lt;/span&gt; &lt;span class="vg"&gt;*set*&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sc"&gt;#\e&lt;/span&gt; &lt;span class="sc"&gt;#\a&lt;/span&gt; &lt;span class="sc"&gt;#\i&lt;/span&gt; &lt;span class="sc"&gt;#\s&lt;/span&gt; &lt;span class="sc"&gt;#\n&lt;/span&gt; &lt;span class="sc"&gt;#\r&lt;/span&gt; &lt;span class="sc"&gt;#\t&lt;/span&gt; &lt;span class="sc"&gt;#\o&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And here is the result:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;CL-USER&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;22&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;mapcar&lt;/span&gt; &lt;span class="nf"&gt;#&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;lambda&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;~{~a~}&amp;#34;&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;power-set&lt;/span&gt; &lt;span class="vg"&gt;*set*&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;o&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;t&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;to&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;r&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;ro&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;rt&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;rto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;n&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;no&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;nt&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;nto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;nr&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;nro&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;nrt&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;nrto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;s&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;so&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;st&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;sto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;sr&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;sro&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;srt&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;srto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;sn&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;sno&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;snt&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;snto&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;snr&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;snro&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;snrt&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;snrto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;i&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;io&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;it&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;ito&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;ir&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;iro&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;irt&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;irto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;in&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;ino&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;int&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;into&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;inr&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;inro&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;inrt&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;inrto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;is&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;iso&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;ist&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;isto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;isr&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;isro&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;isrt&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;isrto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;isn&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;isno&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;isnt&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;isnto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;isnr&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;isnro&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;isnrt&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;isnrto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;a&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;ao&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;at&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;ato&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;ar&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;aro&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;art&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;arto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;an&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;ano&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;ant&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;anto&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;anr&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;anro&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;anrt&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;anrto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;as&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;aso&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;ast&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;asto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;asr&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;asro&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;asrt&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;asrto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;asn&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;asno&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;asnt&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;asnto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;asnr&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;asnro&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;asnrt&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;asnrto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;ai&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;aio&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;ait&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;aito&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;air&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;airo&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;airt&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;airto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;ain&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;aino&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;aint&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;ainto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;ainr&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;ainro&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;ainrt&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;ainrto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;ais&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;aiso&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;aist&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;aisto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;aisr&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;aisro&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;aisrt&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;aisrto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;aisn&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;aisno&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;aisnt&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;aisnto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;aisnr&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;aisnro&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;aisnrt&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;aisnrto&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;e&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eo&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;et&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;er&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;ero&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;ert&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;erto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;en&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eno&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;ent&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;ento&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;enr&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;enro&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;enrt&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;enrto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;es&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eso&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;est&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;esto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;esr&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;esro&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;esrt&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;esrto&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;esn&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;esno&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;esnt&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;esnto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;esnr&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;esnro&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;esnrt&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;esnrto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;ei&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eio&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eit&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;eito&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eir&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eiro&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eirt&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eirto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;ein&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eino&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eint&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;einto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;einr&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;einro&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;einrt&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;einrto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eis&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eiso&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eist&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eisto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eisr&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eisro&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eisrt&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eisrto&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;eisn&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eisno&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eisnt&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eisnto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eisnr&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eisnro&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eisnrt&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eisnrto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;ea&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eao&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;eat&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eato&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;ear&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;earo&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eart&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;earto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;ean&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eano&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eant&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eanto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eanr&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;eanro&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eanrt&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eanrto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eas&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;easo&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;east&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;easto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;easr&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;easro&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;easrt&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;easrto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;easn&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;easno&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;easnt&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;easnto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;easnr&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;easnro&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;easnrt&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;easnrto&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;eai&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eaio&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eait&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eaito&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eair&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eairo&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eairt&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eairto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eain&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eaino&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;eaint&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eainto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eainr&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eainro&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eainrt&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eainrto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eais&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eaiso&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eaist&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;eaisto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eaisr&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eaisro&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eaisrt&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eaisrto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eaisn&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eaisno&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eaisnt&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;eaisnto&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eaisnr&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eaisnro&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eaisnrt&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;eaisnrto&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Next step would be to ask how many of those &amp;ldquo;artificial&amp;rdquo; words are real words? In other words, how many of the above pseudo-words are found in your Unix or Mac dictionary (&lt;code&gt;/usr/share/dict/french&lt;/code&gt;)?&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2022-02-03]&lt;/small&gt;&lt;br&gt;
See also &lt;a href="https://leancrew.com/all-this/2022/01/wordle-letters/"&gt;Wordle letters&lt;/a&gt; for more &amp;ldquo;classical&amp;rdquo;, Perl-based, approaches to filtering dict files on Linux or Mac.
&lt;/div&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2024-02-01]&lt;/small&gt;&lt;br&gt;
Yet another shell-based workflow to solve wordle puzzle: &lt;a href="https://susam.net/maze/wordle-with-grep.html"&gt;Wordle With Grep&lt;/a&gt;.
&lt;/div&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Neon Indian • &lt;em&gt;Should Have Taken Acid With You&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;&lt;a href="http://www.newlisp.org"&gt;Newlisp&lt;/a&gt; makes it even easier:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;power-set&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;empty?&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;list&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;elt&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;first&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;p&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;power-set&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;rest&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;fn&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;s&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;cons&lt;/span&gt; &lt;span class="nf"&gt;elt&lt;/span&gt; &lt;span class="nv"&gt;s&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="nv"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;p&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Mon maître et mon vainqueur</title><link>https://aliquote.org/post/mon-maitre/</link><pubDate>Tue, 28 Dec 2021 22:14:40 +0100</pubDate><guid>https://aliquote.org/post/mon-maitre/</guid><description>&lt;blockquote&gt;
&lt;p&gt;Vous, je ne sais pas, mais moi je vois la vie comme deux lignes parallèles : la première représente ce à quoi l&amp;rsquo;on aspire, ce que l&amp;rsquo;on voudrait être ; la seconde, ce que l&amp;rsquo;on est réellement. Et bien sûr elles ne se superposent jamais tout à fait, mais tout l&amp;rsquo;enjeu est d&amp;rsquo;en réduire l&amp;rsquo;écart autant que possible. On en mesure pas la réussite d&amp;rsquo;une vie à l&amp;rsquo;écart entre ces deux lignes, mais à l&amp;rsquo;effort consenti pour le réduire. &amp;mdash; François-Henri Désérable&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Alors évidement on pense tout de suite à l&amp;rsquo;idée de la régression linéaire, n&amp;rsquo;est-ce pas ? Mais peu importe. J&amp;rsquo;écris des articles techniques la plupart du temps, alors parler de littérature, même si c&amp;rsquo;est une grande passion pour moi, serait un peu hors de propos sur ce blog.&lt;/p&gt;
&lt;p&gt;Au fond, j&amp;rsquo;écris sur des sujets scientifiques dont je ne retire quasiment rien, après coup, sinon la satisfaction d&amp;rsquo;avoir approfondi des sujets que je souhaitais maîtriser un peu plus, et d&amp;rsquo;avoir quelques notes dans mes archives. C&amp;rsquo;est la raison pour laquelle cette section du site s&amp;rsquo;appelait initialement Memos et non Blog. On peut aussi voir ça comme une forme de formation continue, en quelque sorte, ou une manière de m&amp;rsquo;échapper des contraintes du &amp;ldquo;bureau ordinaire&amp;rdquo; (comme dans métro-boulot-dodo). Rester éveillé &amp;ldquo;au chevet des mots&amp;rdquo;, au bout de la nuit, en revanche, ça c&amp;rsquo;est quelque chose qui est plus enrichissant, et voici encore un ouvrage, parmi la soixantaine de &lt;a href="https://aliquote.org/files/books.txt"&gt;livres lus&lt;/a&gt; cette année, que j&amp;rsquo;ai bien apprécié. À bon entendeur !&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ A Certain Ratio • &lt;em&gt;Berlin&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>lost+found 2021</title><link>https://aliquote.org/post/lost-found-2021/</link><pubDate>Mon, 27 Dec 2021 21:39:37 +0100</pubDate><guid>https://aliquote.org/post/lost-found-2021/</guid><description>&lt;p&gt;It is very unlikely these posts will ever end in anything other than rough drafts, so closing them right now.&lt;/p&gt;
&lt;h2 id="2020-10-04"&gt;2020-10-04&lt;/h2&gt;
&lt;p&gt;&lt;small&gt;I was about to benchmark some common statistical programs used to perform boosting, then forgot about it.&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;There has been a renewed interest in &lt;a href="https://en.wikipedia.org/wiki/Boosting_%28machine_learning%29"&gt;Boosting&lt;/a&gt; techniques over the past few years, possibly through Kaggle contests where it ranks among the &lt;a href="https://www.kdnuggets.com/2017/10/xgboost-top-machine-learning-method-kaggle-explained.html"&gt;top&lt;/a&gt; algorithms currently in use. &lt;a href="https://papers.nips.cc/paper/6907-lightgbm-a-highly-efficient-gradient-boosting-decision-tree.pdf"&gt;LightGBM&lt;/a&gt; and &lt;a href="https://arxiv.org/pdf/1603.02754.pdf"&gt;XGBoost&lt;/a&gt; (and &lt;a href="http://learningsys.org/nips17/assets/papers/paper_11.pdf"&gt;CatBoost&lt;/a&gt;) are probably the most used algorithms at the time of this writing.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; Packages are available for R, Python, &lt;a href="micro/clojure-xgboost"&gt;Clojure&lt;/a&gt;, and probably other scientific PLs.&lt;/p&gt;
&lt;p&gt;Boosting tree models have a number of advantages.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; They are (quite) easy to setup and to interpret (for simple datasets), they deal with continuous and categorical predictors (or monotonic transformations thereof) whether there are missing values or not, they are not that much sensitive to outliers compared to other supervised learning approaches, and they can capture simple or higher-order interactions between features. They, however, suffer from higher variance and lack of stability (like almost any tree-based models) and have poorer predictive performance compared to, say, well regularized linear or GLM models.&lt;/p&gt;
&lt;p&gt;The lead article is of course the one written by &lt;a href="https://web.stanford.edu/~hastie/ElemStatLearn/"&gt;Hastie&lt;/a&gt; and &lt;a href="https://projecteuclid.org/euclid.aos/1013203451"&gt;coll.&lt;/a&gt; in 2001, but see one of Hastie&amp;rsquo;s &lt;a href="https://web.stanford.edu/~hastie/TALKS/boost.pdf"&gt;talk&lt;/a&gt; (given at MIT in 2003). The H20 team also provides a nice &lt;a href="http://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science/gbm.html"&gt;summary of the algorithm&lt;/a&gt;. Briefly, the idea of this ensemble method is to aggregate multiple classifiers built sequentially on a training dataset where individual weights are updated online. Classifiers are then weighted based on their own performance, before delivering an averaged decision.&lt;/p&gt;
&lt;p&gt;In what follows, I&amp;rsquo;m going to use a dataset from the medical literature from the &lt;a href="https://archive.ics.uci.edu/ml/datasets/HCV+data"&gt;UCI&lt;/a&gt; archive to fit a GBM using Python, with the help of the H2O package. It should be possible to use Spark (with MLlib) instead. Originally, I thought about using a data set from &lt;em&gt;Statistical Learning for Biomedical Data&lt;/em&gt; (Malley, Malley &amp;amp; Pajevic, Cambridge University Press, 2011), where the authors used Random Forest using subsampling to account for class imbalance. Unfortunately, I realized that the &amp;ldquo;Stroke-A dataset&amp;rdquo; is not in the public domain.&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;h2o&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;h2o.estimators&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;H2OGradientBoostingEstimator&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;h2o&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;init&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;stroke&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;h2o&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;import_file&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="2021-06-07"&gt;2021-06-07&lt;/h2&gt;
&lt;p&gt;&lt;small&gt;Some rants against this &amp;ldquo;new&amp;rdquo; R (which will soon be called the modern R, but not as in &lt;em&gt;Modern Applied Statistics with S&lt;/em&gt;).&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;Something that has always struck me for years is that: Learning R is hard. However, I would say that it&amp;rsquo;s like the Vim learning curve, not the Emacs&amp;rsquo;s one, unless you learned it the rlang&amp;rsquo;s way. You know, there&amp;rsquo;s some business behind the &amp;ldquo;tidyverse&amp;rdquo; way of doing things. Above that, there are too much shortcuts to learn how to speak R. I&amp;rsquo;m not thinking of the R inferno or things like that, just the language itself.&lt;/p&gt;
&lt;p&gt;For the record, I learned R when it was at version one, and I&amp;rsquo;ve been teaching R for biostatistics during almost 15 years. A crude estimate suggests that I was successful 30 to 40% of the time. Still, I believe I was a good teacher. However I should note that I was not teaching R the easy way, but rather how to think in R for statistical computing. Maybe statistical computing is the problem here.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Alboran Trio • &lt;em&gt;Tema di pinicchio&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;More or less since I started drafting this post in April, 2020.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;Murphy, P., Kevin. 2012. &lt;a href="https://www.cs.ubc.ca/~murphyk/MLbook/"&gt;&lt;em&gt;Machine Learning: A Probabilistic Perspective&lt;/em&gt;&lt;/a&gt;. Cambridge, Massachusetts London, England: The MIT Press.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:3"&gt;
&lt;p&gt;Other interesting datasets are available on the &lt;a href="http://biostat.mc.vanderbilt.edu/wiki/Main/DataSets"&gt;Vanderbilt server&lt;/a&gt;/&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in December</title><link>https://aliquote.org/post/micro-12-2021/</link><pubDate>Sun, 26 Dec 2021 21:47:15 +0100</pubDate><guid>https://aliquote.org/post/micro-12-2021/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-12-01&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;It took little under a decade for the headline feature developer Jon Skinner added to Sublime Text’s second version to become one of the defining features of this decade’s software. &amp;mdash; &lt;a href="https://capiche.com/e/consumer-dev-tools-command-palette"&gt;The History of Command Palettes: How Typing Commands Became The Norm Again&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-12-01&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;When I first started using Rust, I really missed monads. But here’s the thing. Having used lots of monads in Haskell, and read lots of blog posts about monads, I’ve learned that in systems contexts, it’s often best to just have a simple monad stack that just consists of Reader + IO (and Maybe’s and Option’s sprinkled about occasionally). Huge monad transformer stacks often raise more problems than they solve. But Reader + IO is essentially the “default monad stack” of Rust. &amp;mdash; &lt;a href="https://owenlynch.org/posts/2020-09-16-haskells-children/"&gt;Haskell&amp;rsquo;s Children&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-12-01&lt;/a&gt;: &lt;a href="https://web.archive.org/web/20170315194527/http:/autocad.xarch.at/lisp/ffis.html"&gt;Design Issues for Foreign Function Interfaces&lt;/a&gt;: A survey of existing native interfaces for several languages and some suggestions.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-12-01&lt;/a&gt;: &lt;a href="https://www.emacsdocs.org/"&gt;Emacs Docs&lt;/a&gt;: The modern documentation website Emacs deserves. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-12-01&lt;/a&gt;: &lt;a href="https://coalton-lang.github.io/20211010-introducing-coalton/"&gt;Introducing Coalton: How to Have Our (Typed) Cake and (Safely) Eat It Too, in Common Lisp&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-12-01&lt;/a&gt;: &lt;a href="https://julialang.org/blog/2021/11/julia-1.7-highlights/"&gt;Julia 1.7 Highlights&lt;/a&gt;. &lt;code&gt;#julia&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-12-02&lt;/a&gt;: &lt;a href="https://research.nccgroup.com/2021/11/18/an-illustrated-guide-to-elliptic-curve-cryptography-validation/"&gt;An Illustrated Guide to Elliptic Curve Cryptography Validation&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-12-02&lt;/a&gt;: &lt;a href="https://github.com/cyrus-and/gdb-dashboard/"&gt;GDB dashboard&lt;/a&gt;. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-12-02&lt;/a&gt;: &lt;a href="https://tech.marksblogg.com/fastest-fizz-buzz.html"&gt;The Fastest FizzBuzz Implementation&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-12-07&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/66039836942__76C2E1CC-7A3C-48C4-8579-6C8515507B71.JPG" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-12-07&lt;/a&gt;: &lt;a href="https://plotdigitizer.com/"&gt;https://plotdigitizer.com/&lt;/a&gt;: really handy when you do not have raw data and want to revisit a 2D chart.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-12-07&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Using vi/vim properly, you don&amp;rsquo;t use it modally. You are always in normal mode, and only enter insert mode for short bursts of typing text, after which you press &lt;Esc&gt; to go to normal mode. Thus, the remembering-the-mode problem just doesn&amp;rsquo;t exist: you don&amp;rsquo;t answer the phone in insert mode to get back to vi and not remember where you were. If you are typing text and the phone rings, you exit insert mode and then answer the phone. Or you press &lt;Esc&gt; when you come back. But you never think about insert mode as a mode where you stay. &amp;mdash; &lt;a href="http://www.viemu.com/a-why-vi-vim.html"&gt;Why, oh WHY, do those #?@! nutheads use vi?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-12-07&lt;/a&gt;: &lt;a href="https://hacks.mozilla.org/2020/07/testing-firefox-more-efficiently-with-machine-learning/"&gt;Testing Firefox more efficiently with machine learning&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-12-08&lt;/a&gt;: &lt;a href="https://yulab-smu.top/treedata-book/"&gt;Data Integration, Manipulation and Visualization of Phylogenetic Trees&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt; &lt;code&gt;#bioinfo&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-12-08&lt;/a&gt;: &lt;a href="https://www.lihaoyi.com/post/WhatsFunctionalProgrammingAllAbout.html"&gt;What&amp;rsquo;s Functional Programming All About?&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-12-14&lt;/a&gt;: &lt;a href="" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Fiona Apple, &lt;em&gt;Under The Table&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-12-14&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Dependencies matter. Every dependency you add to your project is an invitation to break your project. &amp;mdash; &lt;a href="https://www.tinyverse.org/"&gt;Lightweight is the right weight&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-12-14&lt;/a&gt;: &lt;a href="https://gitlab.com/publicvoit/orgdown"&gt;Orgdown&lt;/a&gt; (in short “OD) is a lightweight markup language similar to Markdown but it’s consistent, easy to learn, simple. (via &lt;a href="https://irreal.org/blog/?p=10153"&gt;Irreal&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-12-14&lt;/a&gt;: &lt;a href="https://irreal.org/blog/?p=10165"&gt;Rethinking Email&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-12-14&lt;/a&gt;: &lt;a href="https://github.com/kellyjonbrazil/jc"&gt;jc&lt;/a&gt;: CLI tool and python library that converts the output of popular command-line tools and file-types to JSON or Dictionaries. (via &lt;a href="http://simonwillison.net/2021/Dec/5/jc/#atom-everything"&gt;Simon Willison&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-12-15&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Section 25, &lt;em&gt;Looking from a Hilltop&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-12-15&lt;/a&gt;: &lt;a href="https://biologicalmodeling.org/"&gt;Biological Modeling: A free course in modeling biological systems at multiple scales&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-12-15&lt;/a&gt;: &lt;a href="https://blog.yossarian.net/2021/12/05/Blockchains-dont-solve-problems-that-are-interesting-to-me"&gt;Blockchains don&amp;rsquo;t solve problems that are interesting to me&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-12-15&lt;/a&gt;: &lt;a href="https://coalton-lang.github.io/20211212-typeclasses/?utm_source=pocket_mylist"&gt;One Reason Typeclasses Are Useful&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-12-15&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1793.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1793.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1794.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1794.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;small&gt;Day &amp;amp; Night.&lt;/small&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-12-17&lt;/a&gt;: Again, amazing work by Nicolas Rougier hacking on GNU Emacs: &lt;a href="https://github.com/rougier/notebook-mode"&gt;GNU Emacs - Notebook&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-12-17&lt;/a&gt;: &lt;a href="https://www.pola.rs/"&gt;Polars&lt;/a&gt;: Lightning-fast DataFrame library for Rust and Python. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-12-20&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;You are here because you are somehow interested in what the “Web3” or “NFT” thing is about. Maybe someone gave you this link, maybe you follow me somewhere. In this document I’ll try to explain what those terms mean, what ideas and politics they are based on and what I think about them. I will do my best to represent the Web3/NFT ideas as fairly as possible but for transparency’s sake I should note that I am not a fan. &amp;mdash; &lt;a href="https://tante.cc/2021/12/17/the-third-web/?utm_source=pocket_mylist"&gt;The Third Web&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-12-20&lt;/a&gt;: &lt;a href="http://retro-style.software-by-mabe.com/blog/Common+Lisp+-+Oldie+but+goldie"&gt;Common Lisp - Oldie but goldie &lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-12-20&lt;/a&gt;: &lt;a href="https://www.micahlerner.com/2021/07/14/unix-shell-programming-the-next-50-years.html?utm_source=pocket_mylist"&gt;Unix Shell Programming: The Next 50 Years (The Future of the Shell, Part I)&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-12-20&lt;/a&gt;: &lt;a href="https://haskellwingman.dev/"&gt;Wingman for Haskell&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-12-20&lt;/a&gt;: &lt;a href="https://eddelbuettel.github.io/r-ci/"&gt;r-ci&lt;/a&gt;: Easy and portable CI for R packages. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-12-22&lt;/a&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/bodil/6bea70da6b946fc70cdab3a5473c8a05"&gt;Don&amp;rsquo;t Think We&amp;rsquo;re In Glasgow Any More: A Rust Survival Guide for Haskell Programmers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://chrisdone.com/posts/rust/"&gt;My negative views on Rust&lt;/a&gt;&lt;br&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-12-22&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Common Saints, &lt;em&gt;Idol Eyes&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-12-22&lt;/a&gt;: Off for Christmas.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-12-26&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_1812.JPG" alt="img"&gt;&lt;small&gt;I&amp;rsquo;m back.&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-12-26&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Nick Cave &amp;amp; The Bad Seeds, &lt;em&gt;The Ship Song&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-12-26&lt;/a&gt;: &lt;a href="https://github.com/sirherrbatka/vellum"&gt;Vellum&lt;/a&gt; is a data frame library build for Common Lisp. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>The unquantified self #20</title><link>https://aliquote.org/post/unquantified-self-020/</link><pubDate>Sat, 25 Dec 2021 20:43:20 +0100</pubDate><guid>https://aliquote.org/post/unquantified-self-020/</guid><description>&lt;p&gt;Yet another post about how life is going while I&amp;rsquo;m about to complete this year 2021. I&amp;rsquo;ll be on holidays for the next two weeks. I haven&amp;rsquo;t had time to write as much blog posts than I originally thought last month, but I&amp;rsquo;m not worried. I will have plenty of time later on, probably, and if not this means those blog posts can wait. In the meantime, I managed to finish &lt;a href="https://en.wikipedia.org/wiki/Homeland_(TV_series)"&gt;Homeland&lt;/a&gt;, and I listened to a lot of nice playlists of jazz but also from the post-punk era (close to 500 tracks each week for a month). You can check it out on Last.fm.&lt;/p&gt;
&lt;p&gt;Sometimes I miss my old good &lt;a href="https://www.nordtheme.com/"&gt;Nord&lt;/a&gt; dark theme. As an alternative to my current setup (kitty + zsh), I considered using xterm + tmux. This might provide an easy-to-getup setup for remote machine since I only need to copy two config files. I grabbed xterm settings on &lt;a href="https://github.com/arcticicestudio/nord-xresources"&gt;GitHub&lt;/a&gt; and I started hacking my xterm config by adding a few options in &lt;code&gt;$HOME/.Xresources&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;xterm*faceName: JetBrains Mono
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;xterm*faceSize: 11
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;xterm*selectToClipboard: true
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;XTerm*metaSendsEscape: true
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This set up xterm with a decent font, while allowing to copy from the clipboard (using &lt;kbd&gt;Shift-Insert&lt;/kbd&gt;) and using the &lt;kbd&gt;alt&lt;/kbd&gt; key (which I need for my tmux keybindings). My tmux setup is almost unchanged except that I wanted to replicate some kitty facilities, like the fact that we can hide the window status bar if there&amp;rsquo;s only one window opened. Here comes a little hack based on tmux hooks, which I found after reading this &lt;a href="https://gist.github.com/bartj3/6d3bd8efd2ceaf02d443"&gt;gist&lt;/a&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set -g status off
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set-hook -g after-new-window &amp;#39;if &amp;#34;[ #{session_windows} -gt 1 ]&amp;#34; &amp;#34;set status on&amp;#34;&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set-hook -g pane-exited &amp;#39;if &amp;#34;[ #{session_windows} -lt 2 ]&amp;#34; &amp;#34;set status off&amp;#34;&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now I have a nifty CLI setup based xterm and tmux, which remains available on almost all machines I deal with everyday.&lt;/p&gt;
&lt;p&gt;Other than those Unix geekeries, here are some good dishes cooked lately:&lt;/p&gt;
&lt;p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/66083029036__448FFF26-4D93-49A3-981D-1DAE9EFAA380.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/66083029036__448FFF26-4D93-49A3-981D-1DAE9EFAA380.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/66221356575__C99E3764-AD86-426F-9EB9-389A5515D846.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/66221356575__C99E3764-AD86-426F-9EB9-389A5515D846.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1792.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1792.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1800.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1800.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Mazzy Star • &lt;em&gt;Fade into you&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in November</title><link>https://aliquote.org/post/micro-11-2021/</link><pubDate>Fri, 26 Nov 2021 20:36:25 +0100</pubDate><guid>https://aliquote.org/post/micro-11-2021/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-11-02&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;BSD is what you get when a bunch of Unix hackers sit down to try to port a Unix system to the PC. Linux is what you get when a bunch of PC hackers sit down and try to write a Unix system for the PC. &amp;mdash; &lt;a href="https://www.over-yonder.net/~fullermd/rants/bsd4linux/01"&gt;BSD vs Linux&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-11-02&lt;/a&gt;: &lt;a href="https://amontalenti.com/2014/11/02/clojonic"&gt;Clojonic: Pythonic Clojure&lt;/a&gt;. &lt;code&gt;#clojure&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-11-02&lt;/a&gt;: &lt;a href="https://letsdecentralize.org/"&gt;Let&amp;rsquo;s Decentralize&lt;/a&gt;: Alternatives to the standard internet stack.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-11-02&lt;/a&gt;: &lt;a href="https://cfenollosa.com/blog/openbsd-from-a-veteran-linux-user-perspective.html"&gt;OpenBSD from a veteran Linux user perspective&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-11-05&lt;/a&gt;: &lt;a href="https://lowlevelbits.org/how-to-learn-compilers-llvm-edition/"&gt;How to learn compilers: LLVM Edition&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-11-05&lt;/a&gt;: &lt;a href="https://mjau-mjau.com/blog/rewind-web-2002/"&gt;Rewind the web to 2002&lt;/a&gt;. Thanks, that was one of my preferred website back in 1999. This also remember me of those &lt;a href="https://aliquote.org/micro/stile-project/"&gt;CD covers&lt;/a&gt; I was crafting together.&lt;br&gt;&lt;img src="https://aliquote.org/img/mjau.jpg" alt="mjau"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-11-15&lt;/a&gt;: &lt;a href="https://www.chrislaux.com/"&gt;Algorithms animated&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-11-15&lt;/a&gt;: &lt;a href="https://bayesoptbook.com/"&gt;Bayesian Optimization Book&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-11-15&lt;/a&gt;: &lt;a href="https://github.com/rougier/2021-Dataviz"&gt;Scientific visualization Course&lt;/a&gt;, by Nicolas Rougier.&lt;br&gt;&lt;img src="https://aliquote.org/img/gestalt.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-11-16&lt;/a&gt;: Project Euler, &lt;a href="https://projecteuler.net/problem=10"&gt;problem 10&lt;/a&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Mathematica: &lt;code&gt;Total @ Prime @ Range @ PrimePi[2*^6]&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Racket: ̀&lt;code&gt;(apply + (filter prime? (range 1 2e6)))&lt;/code&gt; (&lt;code&gt;(require math/number-theory)&lt;/code&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-11-17&lt;/a&gt;: Old times, good times.&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_1755.JPG" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-11-17&lt;/a&gt;: &lt;a href="https://cuddly-octo-palm-tree.com/posts/2021-11-07-clj-primes/"&gt;Computing prime numbers with Clojure&lt;/a&gt;. &lt;code&gt;#clojure&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-11-17&lt;/a&gt;: &lt;a href="https://www.tfeb.org/fragments/2021/11/11/the-proper-use-of-macros-in-lisp/"&gt;The proper use of macros in Lisp&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-11-23&lt;/a&gt;:&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;It is oddly satisfying to know that no matter the kind of machine I find myself on or the kind of restrictions it has (no network to download Emacs and/or my custom configuration, corporate policy against fetching packages from MELPA, etc.), that there will always be an editor that I can happily use without needing to make it “my own”. &amp;mdash; &lt;a href="https://vfoley.xyz/vi/"&gt;vi, my favorite config-less editor&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-11-23&lt;/a&gt;: &lt;a href="https://antonz.org/list-internals/"&gt;How Python List Works&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-11-23&lt;/a&gt;: &lt;a href="https://brainder.org/2021/04/05/how-many-principal-components/"&gt;How many principal components?&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-11-23&lt;/a&gt;: &lt;a href="https://iximiuz.com/en/posts/container-learning-path/"&gt;Learning Containers From The Bottom Up&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-11-23&lt;/a&gt;: &lt;a href="https://alextseng.net/blog/posts/20201122-kmer-shuffles/"&gt;Preserving k-mer frequencies in sequence shuffles&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-11-24&lt;/a&gt;: &lt;a href="" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Alice in Chains, &lt;em&gt;Facelift&lt;/em&gt;. Long time no see.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-11-24&lt;/a&gt;: If you are looking for some small or largish dataset for your statistical machinery, don&amp;rsquo;t forget&lt;a href="http://www.statsci.org/datasets.html"&gt;StatSci.org&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-11-24&lt;/a&gt;: Not to say, but this should be the 2958th post since 2018-02-15, when I first launch this micro-blog. Other than that there are 586 posts available on the &lt;a href="https://aliquote.org/post"&gt;regular blog&lt;/a&gt;, of which 319 were written the last 4 years. &lt;code&gt;#this&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-11-24&lt;/a&gt;: &lt;a href="https://hakibenita.com/postgresql-unknown-features"&gt;Lesser Known PostgreSQL Features&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-11-24&lt;/a&gt;: &lt;a href="https://www.algorithm-archive.org/"&gt;The Arcane Algorithm Archive&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-11-24&lt;/a&gt;: &lt;a href="https://www.gwern.net/Coin-flip"&gt;The Kelly Coin-Flipping Game: Exact Solutions&lt;/a&gt;. Also worth taking some time to explore the whole site which is beautifully &lt;a href="https://www.gwern.net/Design"&gt;designed&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-11-24&lt;/a&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;//
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;// Dear maintainer:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;//
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;// Once you are done trying to &amp;#39;optimise&amp;#39; this routine,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;// and have realized what a terrible mistake that was,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;// please increment the following counter as a warning
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;// to the next guy://// total_hours_wasted_here = 16
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;//
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="https://stackoverflow.com/q/184618/420055"&gt;https://stackoverflow.com/q/184618/420055&lt;/a&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>The unquantified self #19</title><link>https://aliquote.org/post/unquantified-self-019/</link><pubDate>Mon, 22 Nov 2021 19:30:26 +0100</pubDate><guid>https://aliquote.org/post/unquantified-self-019/</guid><description>&lt;p&gt;As I&amp;rsquo;m (temporarily) tired of reviewing the intertubes and posting more or less interesting links on this blog, I decided to focus on Lisp/Racket and statistical programming until the end of the year at least. Ideally, I would like to translate some of the APSTAT algorithms in Scheme, maybe write some bindings for the Apache &lt;a href="https://arrow.apache.org/"&gt;Arrow&lt;/a&gt; library for Racket, use Racket &lt;a href="https://github.com/soegaard/sketching"&gt;sketching&lt;/a&gt; or CL &lt;a href="https://github.com/vydd/sketch"&gt;sketch&lt;/a&gt; for data visualization, and explore related packages for data processing in Racket. Actually, I really like Chicken Scheme, since it was the first Scheme I used for real applications 10 years ago, after Jan de Leeuw mentioned it in one of his regular emails on the UCLA statcompute list. Its FFI module is easy to use, which could ease the integration of Fortran or C code into reliable statistical libraries. Still, I like Racket better, for it has a lot of convenient procdeure built-in, and it comes with a &lt;a href="https://alex-hhh.github.io/2021/04/box-and-whiskers-plot.html"&gt;powerful graphical backend&lt;/a&gt;. Stay tuned!&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m done with &lt;a href="https://en.wikipedia.org/wiki/Homeland_(TV_series)"&gt;Homeland&lt;/a&gt; Season 6. When I drafted this post, I was not quite sure to go on with the next seasons, but I didn&amp;rsquo;t find anything really exciting to fill my evenings. I guess I might as well read the pile of books waiting for me. Finally I did both: I started Season 7 and read a bunch of &lt;a href="https://aliquote.org/static/books.txt"&gt;books&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I listen to music (thanks to &lt;a href="https://aliquote.org/post/cmus/"&gt;Cmus&lt;/a&gt;) and Bandcamp almost all day for three weeks now, and it&amp;rsquo;s been great. When I look at my Last.fm stats, I see that I&amp;rsquo;m currently listening to 500 tracks each week. This does not include vinyls played at home, nor some of the iTunes tracks that don&amp;rsquo;t get scrobbled for whatever reason. Anyway, I&amp;rsquo;m quite happy with my current setup, and writing those blog posts has never been as comfortable now that I&amp;rsquo;m more used to (Neo)vim and that my blogging infrastructure doesn&amp;rsquo;t get updated every two weeks (which meant lot of breaking changes when I was on Homebrew). The only thing left from my Apple days is my photo library, which I haven&amp;rsquo;t relocated on my home server yet.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src=""
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0787.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0787.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src=""
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Caroline Davis • &lt;em&gt;Respite&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Student's t distribution</title><link>https://aliquote.org/post/student-approx/</link><pubDate>Fri, 19 Nov 2021 21:23:27 +0100</pubDate><guid>https://aliquote.org/post/student-approx/</guid><description>&lt;p&gt;In a previous post, we discussed how p-values are computed in the case of &lt;a href="https://aliquote.org/post/computing-student-t/"&gt;Student t-test&lt;/a&gt; in LispStat, R, Stata and Python. John Monahan has more to say about the Student&amp;rsquo;s t distribution in his book &lt;em&gt;Numerical Methods in Statistics&lt;/em&gt;,&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; and how it can be approximated.&lt;/p&gt;
&lt;p&gt;Specifically, let&amp;rsquo;s denote $Q(t\mid k) = \Pr(X &amp;gt; t)$, assuming $X$ follows a Student&amp;rsquo;s t distribution with $k$ df. As we noted earlier, the fact that $k$ ($\eta$ in our previous post) is an integer or not plays a role when one looks for an analytical solution. If $k$ is an integer, Abramowitz and Stegun gave the following formula:&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;$$ Q(t\mid k) =
\begin{cases}
\frac{1}{2} - \frac{\theta}{\pi}, \quad k=1 \cr
\frac{1}{2} - \frac{1}{\pi}\left[\theta + \sin\theta\left(\cos\theta + \frac{2}{3}\cos^3\theta + \dots + \frac{2\times 4\times\dots\times (k-3)}{1\times 3\times\dots\times (k-2)}\cos^{k-2}\theta\right)\right], \quad k\ \text{odd} \cr
\frac{1}{2} - \sin\theta\left[1 + \frac{1}{2}\cos^2\theta + \frac{1\times 3}{2\times 4}\cos^4\theta + \dots + \frac{1\times 3\times\dots\times (k-3)}{2\times 4\times\dots\times (k-2)}\cos^{k-2}\theta\right], \quad k\ \text{even}
\end{cases}
$$&lt;/p&gt;
&lt;p&gt;where $\theta = \text{arctan}(t/\sqrt{k})$.&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt; With large value of $k$, the incomplete beta function may be used as follows:&lt;/p&gt;
&lt;p&gt;$$ Q(t\mid k) = \frac{1}{2}I_x(k/2,1/2) \quad \text{for}\; x = k/(k+t^2). $$&lt;/p&gt;
&lt;p&gt;Note that the use of a Beta distribution was also at hand in our previous post. Furthermore, for large value of $t$, some of the trigonometric expressions above may be avoided by using the fact that $\sin(\theta) = 1/\sqrt{1+w}$ and $\cos(\theta) = \sqrt{\frac{w}{1+w}}$, with $w=k/t^2$. When $k$ is even, we have:&lt;/p&gt;
&lt;p&gt;$$ Q(t\mid k) = \frac{\sqrt{1+w} - B}{2\sqrt{1+w}}, \quad \text{where}\ B = \sum_{j=1}^{n/2-1} c_j\left(\frac{w}{1+w}\right)^j $$&lt;/p&gt;
&lt;p&gt;with $c_j = (2j-1)c_{j-1}/(2j)$, and $c_0 = 1$. To avoid cancellation, we can use the following power series: $\sqrt{1+w} = 1 + \frac{1}{2}w - \frac{1}{8}w^2 + \frac{1}{16}w^3 - \frac{5}{128}w^4 + \frac{7}{256}w^5 - \dots$, which allows to compute $\sqrt{1+w}-B$ by matching powers of $w$.&lt;/p&gt;
&lt;p&gt;Similarly, when $k$ is odd,&lt;/p&gt;
&lt;p&gt;$$ Q(t\mid k) = \frac{1}{\pi}\left[\frac{\pi}{2} - \text{arctan}\left(\frac{t}{\sqrt{k}}\right) - \frac{\sqrt{w}}{1+w}\sum_{j=1}^{(n-3)/2} d_jw^j\right], $$&lt;/p&gt;
&lt;p&gt;where $d_j = 2jd_{j-1}/(2j+1)$ and $d_0 = 1$. Again, the following series can be used: $\sqrt{1+w} = \frac{\pi}{2} - \text{arctan}\left(\frac{t}{\sqrt{k}}\right) = \frac{1}{\sqrt{w}}\left[1-\frac{w}{3} + \frac{w^2}{5} - \frac{w^3}{7} + \frac{w^4}{9} - \dots \right]$.&lt;/p&gt;
&lt;p&gt;The tail probabilities for Student&amp;rsquo;s $t$ distribution can also be represented using the Gamma distribution as:&lt;/p&gt;
&lt;p&gt;$$ Q(t\mid k) = \frac{\Gamma\big((k+1)/2\big)}{\Gamma(k/2)\sqrt{\pi}}u^{-k/2}\sum_{j=0}^\infty\frac{c_j}{(k+2)u^j}, $$&lt;/p&gt;
&lt;p&gt;where $c_0 = 1$, $c_j = \frac{2j-1}{2j}c_{j-1}$, and $u = 1 + \frac{t^2}{k}$.&lt;/p&gt;
&lt;p&gt;Currently, there&amp;rsquo;s no way to compute tail probability from the Student&amp;rsquo;s $t$ distribution in Racket math library, although it has everything we need for the Gamma or Beta distribution. Let&amp;rsquo;s do this by hand using Racket&amp;rsquo;s builtin facilities to compute the &lt;em&gt;regularized&lt;/em&gt; incomplete Beta function:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;require&lt;/span&gt; &lt;span class="n"&gt;math/special-functions&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pt&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="n"&gt;df&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;two-tailed?&lt;/span&gt; &lt;span class="no"&gt;#f&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;beta&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;beta-inc&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt; &lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;/&lt;/span&gt; &lt;span class="n"&gt;df&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt; &lt;span class="n"&gt;df&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;sqr&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="no"&gt;#f&lt;/span&gt; &lt;span class="no"&gt;#t&lt;/span&gt;&lt;span class="p"&gt;))])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;two-tailed?&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="n"&gt;beta&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;beta&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pt&lt;/span&gt; &lt;span class="mf"&gt;2.41&lt;/span&gt; &lt;span class="mi"&gt;36&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;; =&amp;gt; 0.010594171035128275&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;R returns $Q(2.41 \mid 36) = 0.01059417$ for the one-tailed probability.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2022-10-17]&lt;/small&gt;&lt;br&gt;
For those more versed into the Python ecosystem, John Cook wrote a nice summary of what&amp;rsquo;s available in Scipy: &lt;a href="https://www.johndcook.com/blog/2022/10/15/python-as-stat-calculator/"&gt;Using Python as a statistical calculator&lt;/a&gt;.
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;John F. Monahan. &lt;em&gt;Numerical Methods in Statistics&lt;/em&gt;. Cambridge University Press (2011).&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;Abramowitz and Stegun. &lt;a href="http://people.math.sfu.ca/~cbm/aands/"&gt;&lt;em&gt;Handbook of Mathematical Functions&lt;/em&gt;&lt;/a&gt;&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:3"&gt;
&lt;p&gt;As noted by Monahan, for large values of $t/\sqrt{k}$, which may happen for very large test statistic under low df distribution, this expression may yield to potential cancellation.&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Prime palindromes</title><link>https://aliquote.org/post/prime-palindrome/</link><pubDate>Tue, 16 Nov 2021 11:23:19 +0100</pubDate><guid>https://aliquote.org/post/prime-palindrome/</guid><description>&lt;p&gt;It&amp;rsquo;s been a long time since I last try to solve one of &lt;a href="https://projecteuler.net"&gt;Project Euler&lt;/a&gt; problems. A few days ago, I noticed a post on &lt;a href="https://programmingpraxis.com/2021/10/26/prime-palindromes/"&gt;Programming Praxis&lt;/a&gt; that deals with prime palindrome (a prime number which also happens to read as a palindrome, such as 101). I thought it should be easy to fire up my old code, but apparently none of the Euler problems I solved were about palprime.&lt;/p&gt;
&lt;p&gt;As an illustration, &lt;a href="https://projecteuler.net/problem=4"&gt;problem 4&lt;/a&gt; asks us to find the largest palindrome made from the product of two 3-digit numbers. Here is my solution using Racket: (I know we can write a procedure to check if a number is a palindrome without converting it first to a string, but this does not really impact the performance of the lookup here.)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rev-string&lt;/span&gt; &lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list-&amp;gt;string&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;reverse&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;string-&amp;gt;list&lt;/span&gt; &lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;palindrome?&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;equal?&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;number-&amp;gt;string&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rev-string&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;number-&amp;gt;string&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sol-004&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;apply&lt;/span&gt; &lt;span class="nb"&gt;max&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;for*/list&lt;/span&gt; &lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;in-range&lt;/span&gt; &lt;span class="mi"&gt;999&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="mi"&gt;-1&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;in-range&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="mi"&gt;-1&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;#:when&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;palindrome?&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sol-004&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So yesterday I wrote a quick script to list all prime palindromes, but it is quite inefficient. First, we could use Racket builtin math procedure more efficiently. For instance, &lt;code&gt;(next-primes z n)&lt;/code&gt; returns a list of the next n primes larger than z, from which we could filter out palindrome numbers I guess. But read on the solution proposed on Programming Praxis and you will learn that there&amp;rsquo;s even a clever way to find the 100th prime palindrome. Anyway, here&amp;rsquo;s my quick and dirty Racket script from yesterday:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;#lang &lt;/span&gt;&lt;span class="nn"&gt;racket&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;require&lt;/span&gt; &lt;span class="n"&gt;math/number-theory&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rev-string&lt;/span&gt; &lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list-&amp;gt;string&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;reverse&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;string-&amp;gt;list&lt;/span&gt; &lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;palindrome?&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;equal?&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;number-&amp;gt;string&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rev-string&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;number-&amp;gt;string&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;in-range&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mf"&gt;1e6&lt;/span&gt;&lt;span class="p"&gt;)])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;when&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;and&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;palindrome?&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prime?&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;display&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;format&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;~a &amp;#34;&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Unless you wrap the above code in an &lt;a href="https://docs.racket-lang.org/collections/collections-api.html#%28def._%28%28lib._data%2Fcollection..rkt%29._nth%29%29"&gt;nth&lt;/a&gt; form, you can run this in your terminal as follows:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;~ % racket palindromic-primes.rkt &lt;span class="p"&gt;|&lt;/span&gt; cut -d &lt;span class="s2"&gt;&amp;#34; &amp;#34;&lt;/span&gt; -f &lt;span class="m"&gt;100&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="m"&gt;94049&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2023-03-14]&lt;/small&gt;&lt;br&gt;
For other interesting problems on progression of primes, see &lt;a href="https://kaygun.tumblr.com/"&gt;Twin Primes, Cousin Primes, Sexy Primes, and Prime Triplets&lt;/a&gt;, by Atabey Kaygun.
&lt;/div&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Laura Stevenson • &lt;em&gt;Continental Divide&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>QR factorization and linear regression</title><link>https://aliquote.org/post/lisp-qr-regression/</link><pubDate>Wed, 03 Nov 2021 15:42:51 +0100</pubDate><guid>https://aliquote.org/post/lisp-qr-regression/</guid><description>&lt;p&gt;Consider the problem where there&amp;rsquo;s no direct solution to $Xb = y$, yet we may be looking for the best approximation of $y$ as a linear combination of the columns of $X$. One of the well-known application of this setting is the linear regression model, of course. Recall that the OLS solution is $\left(X^TX\right)^{-1}X^Ty$.&lt;/p&gt;
&lt;p&gt;Rather than inverting the $X$ matrix, we will use QR decomposition, as R does, since we assume a full (column) rank matrix $X$. The QR decomposition reads $X=\underset{m\times n}{Q}\overset{n\times n}{R}$, where $Q^TQ=I_n$ (columns are orthonormal) and $R$ is an upper-triangular invertible matrix. We already discussed this in a &lt;a href="https://aliquote.org/post/gaussian-elimination"&gt;previous post&lt;/a&gt;. Note that&lt;/p&gt;
&lt;p&gt;$$ \left(X^TX\right)^{-1}X^Ty = \left(R^TQ^TQR\right)^{-1}R^TQ^Ty = \left(R^TR\right)^{-1}R^TQ^Ty = R^{-1}Q^Ty. $$&lt;/p&gt;
&lt;p&gt;In the end, we only really need to solve $Rx = \bar y$, where $y$ is rotated as $\bar y = Q^Ty$ (in R, this is computed using &lt;code&gt;qr.qty()&lt;/code&gt;) and $R$ is triangular, using backward substitution.&lt;/p&gt;
&lt;p&gt;More information can be found in this &lt;a href="https://inst.eecs.berkeley.edu/~ee127/sp21/livebook/l_ols_ls_def.html"&gt;on-line course&lt;/a&gt;, which inspired the above notation, and this longer article on the Stan website: &lt;a href="https://mc-stan.org/users/documentation/case-studies/qr_regression.html"&gt;The QR Decomposition For Regression Models&lt;/a&gt;. For a more detailed treatment, I would suggest &lt;a href="https://www4.stat.ncsu.edu/~monahan/nmos2/toc.html"&gt;Numerical Methods of Statistics&lt;/a&gt; (2nd ed.), by John F. Monahan, especially for the connection with Householder transformations (§5.6.).&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2021-11-24]&lt;/small&gt;&lt;br&gt;
See also this excellent article by Matthew Drury: &lt;a href="https://madrury.github.io/jekyll/update/statistics/2017/10/04/qr-algorithm.html"&gt;How Does A Computer Calculate Eigenvalues?&lt;/a&gt;
&lt;/div&gt;
&lt;p&gt;Let&amp;rsquo;s implement this approach in Lisp using the &lt;a href="https://github.com/quil-lang/magicl"&gt;magicl&lt;/a&gt; package, which provides low-level bindings to BLAS/LAPACK as well as a high-level interface with everything we need for common linear algebra problems (e.g., SVD, Cholesky or QR decomposition, etc.). Other CL libraries are available but this one looks interesting because it is actively maintained by working heroes, including Robert Smith (@stylewarning), who also happens to play piano. As an illustration, here is how one compute the SVD ($U\Sigma V$) of a rectangular matrix:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defparameter&lt;/span&gt; &lt;span class="vg"&gt;*a*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;magicl:from-list&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;3.0&lt;/span&gt; &lt;span class="mf"&gt;2.0&lt;/span&gt; &lt;span class="mf"&gt;2.0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mf"&gt;2.0&lt;/span&gt; &lt;span class="mf"&gt;3.0&lt;/span&gt; &lt;span class="mf"&gt;-2.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;magicl:svd&lt;/span&gt; &lt;span class="vg"&gt;*a*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This returns the expected results:&lt;/p&gt;
&lt;p&gt;$$
\begin{array}{l}
U = {\pmatrix {1/\sqrt{2} &amp;amp; 1/\sqrt{2} \cr 1/\sqrt{2} &amp;amp; -1/\sqrt{2}}} \cr
\Sigma = {\pmatrix {5 &amp;amp; 0 &amp;amp; 0 \cr 0 &amp;amp; 3 &amp;amp; 0}} \cr
V^T = {\pmatrix {1/\sqrt{2} &amp;amp; 1/\sqrt{2} &amp;amp; 0 \cr 1/\sqrt{18} &amp;amp; -1/\sqrt{18} &amp;amp; 4/\sqrt{18} \cr 2/3 &amp;amp; -2/3 &amp;amp; -1/3 }}
\end{array}
$$&lt;/p&gt;
&lt;p&gt;We also need a toy dataset, which will be a subset of one the dataset used by Selvin in his book on S+ (see &lt;a href="https://aliquote.org/pub/MABMUSPlus/"&gt;here&lt;/a&gt; for a collection of plots and a recap&amp;rsquo; of the exercises). Here is a quick glance at the dataset, which describes how birth weight evolves with maternal age for smoking and non-smoking mothers:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/selvin-reg.png"&gt;
&lt;/figure&gt;
&lt;small&gt;Gnuplot &lt;a href="https://aliquote.org/img/selvin-reg.gp"&gt;script&lt;/a&gt; and raw &lt;a href="https://aliquote.org/pub/selvin-reg.dat"&gt;dataset&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;The regression line in the above plot reads $\text{weight} = 3.61 + 0.15\times\text{age} - 0.57\mathbb{I}_{\text{smoking}}$.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s first try to input the data: (be careful, values must be recognized as float, not integers, and of course we need to add a column of one&amp;rsquo;s for the intercept!)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;ql:quickload&lt;/span&gt; &lt;span class="ss"&gt;:magicl&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;setf&lt;/span&gt; &lt;span class="vg"&gt;*read-default-float-format*&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;double-float&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defparameter&lt;/span&gt; &lt;span class="vg"&gt;*y*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;magicl:from-list&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;9.1&lt;/span&gt; &lt;span class="mf"&gt;8.9&lt;/span&gt; &lt;span class="mf"&gt;8.5&lt;/span&gt; &lt;span class="mf"&gt;7.4&lt;/span&gt; &lt;span class="mf"&gt;7.5&lt;/span&gt; &lt;span class="mf"&gt;7.3&lt;/span&gt; &lt;span class="mf"&gt;6.7&lt;/span&gt; &lt;span class="mf"&gt;6.5&lt;/span&gt; &lt;span class="mf"&gt;7.2&lt;/span&gt; &lt;span class="mf"&gt;6.5&lt;/span&gt; &lt;span class="mf"&gt;6.6&lt;/span&gt; &lt;span class="mf"&gt;7.1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defparameter&lt;/span&gt; &lt;span class="vg"&gt;*X*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;magicl:from-list&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;1.0&lt;/span&gt; &lt;span class="mf"&gt;35.0&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt; &lt;span class="mf"&gt;29.0&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt; &lt;span class="mf"&gt;34.0&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt; &lt;span class="mf"&gt;32.0&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt; &lt;span class="mf"&gt;28.0&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt; &lt;span class="mf"&gt;28.0&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt; &lt;span class="mf"&gt;24.0&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt; &lt;span class="mf"&gt;24.0&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt; &lt;span class="mf"&gt;28.0&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt; &lt;span class="mf"&gt;26.0&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt; &lt;span class="mf"&gt;26.0&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt; &lt;span class="mf"&gt;26.0&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The instruction &lt;code&gt;(magicl:qr *X*)&lt;/code&gt; should return the two matrices $Q$ and $R$ discussed above. Then, from the expressions above we see that the vector of estimated parameters can be computed as $R^{-1}Q^Ty$, such that we can write:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;multiple-value-bind&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;Q&lt;/span&gt; &lt;span class="nv"&gt;R&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;magicl:qr&lt;/span&gt; &lt;span class="vg"&gt;*X*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;magicl:@&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;magicl:inv&lt;/span&gt; &lt;span class="nv"&gt;R&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;magicl:@&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;magicl:transpose&lt;/span&gt; &lt;span class="nv"&gt;Q&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="vg"&gt;*y*&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We get the estimated parameters $(3.606, 0.146, -0.574)$, and $R = {\pmatrix {3.464 &amp;amp; 98.150 &amp;amp; \hphantom{-}1.732 \cr 0.000 &amp;amp; 12.028 &amp;amp; -1.330 \cr 0.000 &amp;amp; 0.000 &amp;amp; \hphantom{-}1.109}}$.&lt;/p&gt;
&lt;p&gt;Well, that&amp;rsquo;s a bit convoluted but that worked. Next time, we&amp;rsquo;ll see how the &lt;a href="https://common-lisp.net/project/gsll/"&gt;GSLL&lt;/a&gt; can be used to solve similar problems.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Mini Trees • &lt;em&gt;Youth&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Bootstrap resampling in Lisp</title><link>https://aliquote.org/post/bootstraping-lisp/</link><pubDate>Fri, 29 Oct 2021 20:18:41 +0200</pubDate><guid>https://aliquote.org/post/bootstraping-lisp/</guid><description>&lt;p&gt;After reading some &lt;a href="https://kaygun.tumblr.com/"&gt;recent posts&lt;/a&gt; written by Atabey Kaygun, I thought I would go back to my old LispStat code to see whether it is still a thing.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; Back at that time I started to write tutorials about LispStat. It was &lt;a href="https://aliquote.org/post/diving-into-lisp-for-statistical-computing/"&gt;10 years ago&lt;/a&gt;, and long after the R&amp;rsquo;s era, that I learned some LispStat, and I even bought the book. I&amp;rsquo;m actually using xlispstat version 3.52.23, which I installed from &lt;a href="https://github.com/jhbadger/xlispstat"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Today, we&amp;rsquo;ll do some bootstrap resampling. First, we need a little helper function to compute a given statistic on a sample data $b$ times:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defun&lt;/span&gt; &lt;span class="nv"&gt;simulate&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;stat&lt;/span&gt; &lt;span class="nv"&gt;k&lt;/span&gt; &lt;span class="nv"&gt;fun&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nv"&gt;out&lt;/span&gt; &lt;span class="p"&gt;()))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;dotimes&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="nv"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;push&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;funcall&lt;/span&gt; &lt;span class="nv"&gt;stat&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;funcall&lt;/span&gt; &lt;span class="nv"&gt;fun&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;out&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;out&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Let&amp;rsquo;s test it using this simple instruction:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;simulate&lt;/span&gt; &lt;span class="nf"&gt;#&amp;#39;&lt;/span&gt;&lt;span class="nv"&gt;mean&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt; &lt;span class="nf"&gt;#&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;lambda&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;normal-rand&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note that we could easily write a little procedure to compute the estimated slope of a linear regression model and plug it in place of the &lt;code&gt;mean&lt;/code&gt; function above, like I did in an &lt;a href="https://stackoverflow.com/a/7838476/420055"&gt;R example&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Now we can implement our &lt;code&gt;bootstrap&lt;/code&gt; procedure. Note that LispStat comes with a built-in &lt;code&gt;sample&lt;/code&gt; function, so we don&amp;rsquo;t need to implement this part of the algorithm (the last parameter &lt;code&gt;t&lt;/code&gt; meansto sample with replacement):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defun&lt;/span&gt; &lt;span class="nv"&gt;bootstrap&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;stat&lt;/span&gt; &lt;span class="nv"&gt;data&lt;/span&gt; &lt;span class="nv"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;length&lt;/span&gt; &lt;span class="nv"&gt;data&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;simulate&lt;/span&gt; &lt;span class="nv"&gt;stat&lt;/span&gt; &lt;span class="nv"&gt;b&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;#&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;lambda&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;sample&lt;/span&gt; &lt;span class="nv"&gt;data&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="no"&gt;t&lt;/span&gt;&lt;span class="p"&gt;)))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Let&amp;rsquo;s see it in action:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;setf&lt;/span&gt; &lt;span class="nv"&gt;seed&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;make-random-state&lt;/span&gt; &lt;span class="vg"&gt;*random-state*&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;def&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;normal-rand&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;def&lt;/span&gt; &lt;span class="nv"&gt;bs&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;bootstrap&lt;/span&gt; &lt;span class="nf"&gt;#&amp;#39;&lt;/span&gt;&lt;span class="nv"&gt;mean&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;histogram&lt;/span&gt; &lt;span class="nv"&gt;bs&lt;/span&gt; &lt;span class="ss"&gt;:title&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;1000 bootstrap samples&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The bias is quite small (&lt;code&gt;(- (mean x) (mean bs))&lt;/code&gt; &amp;lt; 0.005 on my sample).&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2021-11-02-12-01-17.png"&gt;
&lt;/figure&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;I came across several projects that aim to provide a more or less statistical package in Lisp or Scheme. The later one is &lt;a href="https://github.com/Lisp-Stat/lisp-stat"&gt;lisp-stat&lt;/a&gt;, which does not offer much at the time of this writing. The name of the project itself, with part of the code re-copyrighted after AJ Rossini or Luke Tierney under a different licence, makes me wonder where this project is going on, but this has already been &lt;a href="https://news.ycombinator.com/item?id=26632429"&gt;discussed on HN&lt;/a&gt;. Anyway, if we get something close to Luke Tierney&amp;rsquo;s LispStat in Common Lisp, why not.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in October</title><link>https://aliquote.org/post/micro-10-2021/</link><pubDate>Thu, 28 Oct 2021 12:00:30 +0200</pubDate><guid>https://aliquote.org/post/micro-10-2021/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-10-04&lt;/a&gt;: &lt;a href="https://lisp-lang.org/"&gt;https://lisp-lang.org/&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-10-05&lt;/a&gt;: &lt;a href="https://www.inspiredpython.com/"&gt;https://www.inspiredpython.com/&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-10-05&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Why IRC?&lt;br&gt;&amp;gt; It’s free, in all senses of the word. A lot of others have done a great job of answering this question in further detail, this is by far my favourite:&lt;br&gt;&amp;gt; &lt;a href="https://drewdevault.com/2019/07/01/Absence-of-features-in-IRC.html"&gt;https://drewdevault.com/2019/07/01/Absence-of-features-in-IRC.html&lt;/a&gt; &amp;mdash; &lt;a href="https://icyphox.sh/blog/irc-for-dms/"&gt;IRC for DMs&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-10-05&lt;/a&gt;: &lt;a href="http://blog.thegrandlocus.com/2021/09/a-tutorial-on-t-sne-3"&gt;A tutorial on t-SNE (3)&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-10-05&lt;/a&gt;: &lt;a href="https://adventures.michaelfbryan.com/posts/rust-best-practices/bad-habits/"&gt;Common Newbie Mistakes and Bad Practices in Rust: Bad Habits&lt;/a&gt;. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-10-06&lt;/a&gt;: &lt;a href="https://tuhrig.de/my-logging-best-practices/"&gt;Log after, not before&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-10-07&lt;/a&gt;:&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2023-08-14]&lt;/small&gt;&lt;br&gt;
Unfortunately, the tweet with ID 1446146879985696769 is no longer available.
&lt;/div&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-10-08&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Type theory was developed to be an alternative to set theory as the foundation of mathematical proofs in symbolic logic due to its ability to solve some contradictions stemming from naive set theory. &amp;mdash; &lt;a href="http://blog.felipe.rs/2017/07/07/where-do-type-systems-come-from/"&gt;Where do Type Systems Come From?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-10-08&lt;/a&gt;: &lt;a href="https://explained.ai/decision-tree-viz/index.html"&gt;How to visualize decision trees&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-10-08&lt;/a&gt;: &lt;a href="https://www.argmin.net/2021/09/28/summarization/"&gt;Statistics as algorithmic summarization&lt;/a&gt;. Reminds me of Efron&amp;rsquo;s introductory chapter on statistical machinery in &lt;a href="https://web.stanford.edu/~hastie/CASI/"&gt;Computer Age Statistical Inference&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-10-08&lt;/a&gt;: &lt;a href="https://github.com/wimpysworld/quickemu"&gt;quickmenu&lt;/a&gt;: Quickly create and run optimised Windows, macOS and Linux desktop virtual machines.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-10-11&lt;/a&gt;: &lt;a href="https://blog.jakubholy.net/2021/awesome-babashka-dash/"&gt;Awesome Babashka: Parse &amp;amp; produce HTML and SQLite&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-10-14&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I need to put that on a Post-it note as an example of how to explain a script. The best part? It would fit on a Post-it note. &amp;mdash; &lt;a href="http://www.leancrew.com/all-this/2011/12/more-shell-less-egg/"&gt;More shell, less egg&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-10-14&lt;/a&gt;: &lt;a href="https://learnbyexample.github.io/cli_text_processing_coreutils/introduction.html"&gt;Command line text processing with GNU Coreutils&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-10-14&lt;/a&gt;: &lt;a href="https://github.com/Lisp-Stat/xls-archive"&gt;Statistics routines in Common Lisp and XLispStat&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-10-20&lt;/a&gt;: Back to Bandcamp.&lt;/p&gt;
&lt;iframe style="border: 0; width: 100%; height: 42px;" src="https://bandcamp.com/EmbeddedPlayer/album=3243051787/size=small/bgcol=ffffff/linkcol=0687f5/transparent=true/" seamless&gt;&lt;a href="https://annasmyrk.bandcamp.com/album/the-hour-between-us"&gt;The Hour Between Us by Anna Smyrk&lt;/a&gt;&lt;/iframe&gt;&lt;br&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-10-20&lt;/a&gt;: &lt;a href="https://functional-algorithms-verified.org/"&gt;Functional Algorithms, Verified!&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-10-20&lt;/a&gt;: &lt;a href="https://pages.tacc.utexas.edu/~eijkhout/istc/istc.html"&gt;Introduction to High Performance Scientific Computing&lt;/a&gt;, by the author of $\TeX$ by Topic.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-10-25&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_1749.JPG" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-10-25&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;One of my favorite definitions of “hacking” is the creative reuse of tools for new and unexpected purposes. Hacking is using your email account as a hard drive, using your bicycle seat to open a beer, using Minecraft’s red bricks to create a calculator in the game. &amp;mdash; &lt;a href="https://macwright.com/2021/07/24/hacking-is-the-opposite-of-marketing.html"&gt;Hacking is the opposite of marketing&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-10-25&lt;/a&gt;: &lt;a href="https://www.cs.nott.ac.uk/~pszgmh/pgp.html"&gt;Functional Programming&lt;/a&gt; and &lt;a href="https://www.cs.nott.ac.uk/~pszgmh/afp.html"&gt;Advanced Functional Programming&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-10-26&lt;/a&gt;: Interesting discussion on how to handle &lt;a href="https://blog.practical-scheme.net/gauche/20210826-negative-zero"&gt;negative zero&lt;/a&gt; (IEEE754) in Scheme. &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-10-26&lt;/a&gt;: &lt;a href="https://fml-fam.github.io/blog/2021/09/09/a-bit-about-checkpoint/restart/"&gt;A Bit About Checkpoint/Restart&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-10-26&lt;/a&gt;: &lt;a href="https://grinfeld.org/books/An-Introduction-To-Tensor-Calculus/"&gt;Introduction to Tensor Calculus&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-10-26&lt;/a&gt;: &lt;a href="https://kaygun.tumblr.com/post/661256853848719360/statistical-distributions-using-apache-commons"&gt;Statistical Distributions using Apache Commons Math in Clojure&lt;/a&gt;. &lt;code&gt;#clojure&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-10-27&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The short version of the answer is that Lisp is not merely a different notation, it&amp;rsquo;s a fundamentally different way of thinking about what programming is. The mainstream model is that programming consists of producing standalone artifacts called programs which operate on other artifacts called data. Of course, everyone knows that programs are data, but the mainstream model revolves around maintaining an artificial distinction between the two concepts. Yes, programs are data, but they are data only for a special kind of program called a compiler. &amp;mdash; &lt;a href="https://blog.rongarret.info/2015/05/why-lisp.html"&gt;Why Lisp&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-10-27&lt;/a&gt;: &lt;a href="https://www.jjj.de/fxt/"&gt;FXT: a library of algorithms&lt;/a&gt;. (via &lt;a href="https://github.com/stylewarning/hypergeometrica/blob/master/REFERENCES.md"&gt;@stylewarning&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-10-27&lt;/a&gt;: &lt;a href="https://abhinavg.net/posts/tig-easy-fixup/?utm_source=pocket_mylist"&gt;Fix-up Git commits with Tig&lt;/a&gt;. &lt;code&gt;#git&lt;/code&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>Alpha shape</title><link>https://aliquote.org/post/alpha_shape/</link><pubDate>Thu, 28 Oct 2021 10:40:33 +0200</pubDate><guid>https://aliquote.org/post/alpha_shape/</guid><description>&lt;p&gt;Yesterday I worked on an interesting problem in Python. Given a set of (x,y) points in a plane, I needed to compute the area of the whole cloud of points. An easy solution would be to compute the convex hull of the 2D points, but of course it would overestimate the total area in the presence of strong outlying values at the periphery. We could rely on Delaunay triangulation for that purpose, or maybe its dual (the Voronoi diagram) to minimize the overestimation, as shown in the Figure below (left panel). Another approach would consist in summing of the areas of all interior polygons, which is the same as the sum of the polygon areas defined by the Delaunay triangulation minus the exterior polygons, i.e., those not surrounded entirely by other polygons.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/alpha_shape.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Luckily, I found a &lt;a href="https://pypi.org/project/alpha-shapes/"&gt;nice package&lt;/a&gt; on Pypi that handles all that stuff right.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; Note that there&amp;rsquo;s a close relationship between alpha shape and Delaunay triangulation: As described on Wikipedia, each edge or triangle of the Delaunay triangulation may be associated with a characteristic radius, the radius of the smallest empty circle containing the edge or triangle. Furthermore, when $\alpha=0$, we get the classical convex hull. See also &lt;a href="https://graphics.stanford.edu/courses/cs268-11-spring/handouts/AlphaShapes/as_fisher.pdf"&gt;Introduction to Alpha Shapes&lt;/a&gt; (PDF).&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Intuitively an alpha shape can be conceptualized as follows. Imagine carving out the plane using a cookie scoop of radius 1/α, without removing any of the points in the point cloud. The shape that remains is the shape of the point cloud. If we replace the arc-like edges, due to the circular rim of the scoop, with straight segments, we are left with the alpha shape of parameter α.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It even features an &lt;code&gt;optimize&lt;/code&gt; utility that allows to find the best thresholding parameter value, which relies on brute force search. In the above figure, the middle and right panels show the result of using an arbitrary α value versus the optimized one. And since it internally relies on Python&amp;rsquo;s &lt;a href="https://shapely.readthedocs.io/en/stable/manual.html"&gt;shapely&lt;/a&gt; Polygon objects, you&amp;rsquo;ll get the area of the alpha shape for free.&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;See also the &lt;a href="https://github.com/bellockk/alphashape"&gt;alphashape&lt;/a&gt; project on Github.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>ArXiving on October 2021</title><link>https://aliquote.org/post/arxiv-07/</link><pubDate>Sat, 23 Oct 2021 10:09:25 +0100</pubDate><guid>https://aliquote.org/post/arxiv-07/</guid><description>&lt;p&gt;Here are some papers that I read this week, in the CS and Stat category, plus random stuff that were mentioned on IRC or Hacker News.&lt;/p&gt;
&lt;h3 id="accuracy-precision-and-agreement-statistical-tests-for-bland-altman-method-"&gt;Accuracy, precision, and agreement statistical tests for Bland-Altman method (&lt;a href="https://arxiv.org/abs/2108.12937"&gt;https://arxiv.org/abs/2108.12937&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;I&amp;rsquo;ve used Bland-Altman plots a lot when I was working on diagnostic tests and psychometric measurement. Interestingly, few medics really understood how to interpret those kind of graphical displays, and how they are used in &lt;a href="https://stats.stackexchange.com/a/2834/930"&gt;method comparison&lt;/a&gt; studies. I suspect they also dislike this approach since it does not provide formal tests of hypothesis. Here we go, with three tests for accuracy, precision and agreement.&lt;/p&gt;
&lt;h3 id="generalized-nearly-isotonic-regression-"&gt;Generalized nearly isotonic regression (&lt;a href="https://arxiv.org/abs/2108.13010"&gt;https://arxiv.org/abs/2108.13010&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;Fond memories of Jan de Leeuw&amp;rsquo;s (and the GIFI nom de plume) own work.&lt;/p&gt;
&lt;h3 id="lagged-couplings-diagnose-markov-chain-monte-carlo-phylogenetic-inference-"&gt;Lagged couplings diagnose Markov chain Monte Carlo phylogenetic inference (&lt;a href="https://arxiv.org/abs/2108.13328"&gt;https://arxiv.org/abs/2108.13328&lt;/a&gt;)&lt;/h3&gt;
&lt;h3 id="a-q-q-plot-aids-interpretation-of-the-false-discovery-rate-"&gt;A Q-Q plot aids interpretation of the False Discovery Rate (&lt;a href="https://arxiv.org/abs/2109.02118"&gt;https://arxiv.org/abs/2109.02118&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;A simple yet efficient graphical method to assess significant p-values computed using Benjamini-Hochberg approach.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The FDR is a property of a set of p-values, not of any individual value.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id="dynamic-network-regression-"&gt;Dynamic Network regression (&lt;a href="https://arxiv.org/abs/2109.02981"&gt;https://arxiv.org/abs/2109.02981&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;This article deals with &lt;a href="https://projecteuclid.org/journals/annals-of-statistics/volume-47/issue-2/Fr%c3%a9chet-regression-for-random-objects-with-Euclidean-predictors/10.1214/17-AOS1624.short"&gt;Fréchet regression&lt;/a&gt; on network data, using the corresponding space of graph Laplacians (with no restriction on their rank). It has two applications (NY taxi trips after COVID-19 and dynamic networks in aging brains) which I found quite interesting. Such an approach might prove superior to classical data mining on spatio-temporal data structures since we can capture both the structure and weight information of a networks given relevant covariates, and assess the quality of adjustement for projected trends.&lt;/p&gt;
&lt;h3 id="high-performance-implementation-of-the-hierarchical-likelihood-for-generalized-linear-mixed-models-an-application-to-estimate-the-potassium-reference-range-in-massive-electronic-health-records-datasets-"&gt;High Performance Implementation of the Hierarchical Likelihood for Generalized Linear Mixed Models. An Application to estimate the potassium reference range in massive Electronic Health Records datasets (&lt;a href="https://arxiv.org/abs/1910.08179"&gt;https://arxiv.org/abs/1910.08179&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;Not much of an interest for me except that it deals with Potassium reference level which is a subject I have been familiar with (for personal reason, unfortunately) for several years now. This remains, however, an interesting simulation study for mixed-effects models and big data aficionados.&lt;/p&gt;
&lt;h3 id="distcomp-comparing-distributions-"&gt;Distcomp: Comparing distributions (&lt;a href="https://arxiv.org/abs/2110.02327"&gt;https://arxiv.org/abs/2110.02327&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;This paper introduces a Stata command that allows to compare empirical CDFs. Contrary to the Kolmogorov-Smirnov approach, &lt;code&gt;distcomp&lt;/code&gt; allows to test the equality of the distribution functions point by point., using appropriate FWER control, and displays ranges of values in which the distributions&amp;rsquo; difference is statistically significant.&lt;/p&gt;</description></item><item><title>The unquantified self #18</title><link>https://aliquote.org/post/unquantified-self-018/</link><pubDate>Wed, 20 Oct 2021 20:32:39 +0200</pubDate><guid>https://aliquote.org/post/unquantified-self-018/</guid><description>&lt;p&gt;Meantime, London IPA, 7.4%. Alan Walker, Spectre (NCS Release).&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s been a while since the last entry in the &lt;a href="https://aliquote.org/post/unquantified-self-017/"&gt;Unquantified&lt;/a&gt; series. Not so many things happen, except that I came back to work early September. I&amp;rsquo;ve been listening to a lot of tracks recently, thanks to my new &lt;a href="https://aliquote.org/post/music-setup/"&gt;laptop setup&lt;/a&gt;, and reading some books, some of which I enjoyed a lot.&lt;/p&gt;
&lt;p&gt;I came home yesterday after visiting my aunt. Nice weather, great lunch&amp;rsquo;s and dinners during a few days.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/65618372545__D11A5C2B-85A3-43CC-8B6D-6C593094ECF0.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/65618372545__D11A5C2B-85A3-43CC-8B6D-6C593094ECF0.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/65618440947__4E5D52D1-98F8-4979-AEF7-D100B4DA19BE.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/65618440947__4E5D52D1-98F8-4979-AEF7-D100B4DA19BE.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Nothing more, nothing less.&lt;/p&gt;</description></item><item><title>My current music setup</title><link>https://aliquote.org/post/music-setup/</link><pubDate>Wed, 20 Oct 2021 18:53:14 +0200</pubDate><guid>https://aliquote.org/post/music-setup/</guid><description>&lt;p&gt;I am now scrobbling music I listen to on my laptop to Last.fm. Cmus has a &lt;a href="https://github.com/Arkq/cmusfm"&gt;small plugin&lt;/a&gt; for that purpose, and it works great. I like the idea of archiving everything I listen to and get statistics at a glance from Last.fm. This partly results from my attempt to move away from Apple services, like Apple Music, even if I&amp;rsquo;m still using it (I have a paid subscription) from times to times, and to get my music back on my HD. I used to have several gigs of music back in the day, and then online services came along, including Deezer or Apple Music. If you&amp;rsquo;re happy with the idea of renting your music (or movies), that&amp;rsquo;s probably okay. These are two of the top music streaming providers available on the market.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; I discovered &lt;a href="https://bandcamp.com/"&gt;Bandcamp&lt;/a&gt; three years ago, thanks to Tom Macwright, and I am now browsing the indie records available there, especially in the alternative and Jazz sections.&lt;/p&gt;
&lt;p&gt;Regarding my current setup, here is how I do on my laptop and at home. On my laptop, I discussed &lt;a href="https://aliquote.org/post/cmus/"&gt;Cmus&lt;/a&gt; in a previous post, and since then I use it almost every single day. I use &lt;a href="http://lly.org/~rcw/abcde/page/"&gt;abcde&lt;/a&gt; to rip my audio CDs (I found it easier to use and a little bit faster than iTunes own converter); the only minor problem is that I often have to retag some tracks or entire albums afterwards using &lt;code&gt;id3tag&lt;/code&gt;. This is somewhat cumbersome, but that&amp;rsquo;s not a big deal since it can be automated easily using shell scripts. I have something like 300 audio CDs, and as many vinyl records. I am now focusing on enriching my vinyl collection since I am no longer interested in audio CDs. (I haven&amp;rsquo;t even reconnected my CD player since I moved.)&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1744.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1744.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1743.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1743.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1745.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1745.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;I use a single Bluetooth JBL 3D audio speaker, which I activate using &lt;code&gt;bluetoothctl&lt;/code&gt; most of the time. I wrote a shell script to automate the connection, but I always forget about it &amp;mdash; I should probably add it to my polybar at some point. The sound is acceptable, and I can bring the audio speaker to my office if I want since it does not take too much space.&lt;/p&gt;
&lt;p&gt;My home setup is also quite simple, basically an amp, a DAC, an Apple TV, a record player and a pair of speakers (see picture above). I use the Apple TV to stream music from Apple Music (on my Macbook or my iPhone) eto the physical devices, via the Digital to Analog Converter. In the end I will probably transfer all my MP3s onto a NAS or an external drive available on my home network. And that will be fine I guess.&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;I stopped using Deezer a long time ago because I couldn&amp;rsquo;t get my playlist last more than one year because of regular removal of tracks I added in the past (due to copyright issue or author&amp;rsquo;s removal, probably).&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Desktop setup</title><link>https://aliquote.org/post/riced-desktop/</link><pubDate>Wed, 06 Oct 2021 21:01:50 +0200</pubDate><guid>https://aliquote.org/post/riced-desktop/</guid><description>&lt;p&gt;New (riced) desktop setup.&lt;/p&gt;
&lt;p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2021-10-06-19-43-42.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2021-10-06-19-43-42.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2021-10-06-20-48-14.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2021-10-06-20-48-14.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;small&gt; Gnome 20.04 LTS: i3-gaps, polybar, rofi (not shown), Kitty, Neomutt, Irssi, Cmus.&lt;/small&gt;&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2022-09-03]&lt;/small&gt;&lt;br&gt;
I will update this post with more screenshots as I continue updating my desktop setup on a regular basis. However, it is unlikely the main applications I use daily will change. If you like ricing your desktop too, go take a look at &lt;a href="https://deskto.ps"&gt;https://deskto.ps&lt;/a&gt; (crafted by &lt;a href="https://jcs.org"&gt;Joshua Stein&lt;/a&gt;).
&lt;/div&gt;
&lt;hr&gt;
&lt;p&gt;Update [2022-02-04]&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/2022-02-04-11-09-03.png"&gt;
&lt;/figure&gt;
&lt;small&gt; Ubuntu 20.04 LTS: Regolith/i3-gaps, i3bar, rofi (not shown), Tmux, Gnome terminal, Neomutt, cmus.&lt;/small&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Update [2022-09-03]&lt;/p&gt;
&lt;p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-09-04-09-43-38.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-09-04-09-43-38.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2022-09-04-11-15-36.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2022-09-04-11-15-36.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;small&gt;Ubuntu 22.04 LTS: Gnome Mutter/tactile, Tmux, Simple (Suckless) terminal or Gnome terminal, Neovim, Cmus, Irssi and Neomutt (not shown).&lt;/small&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Update [2023-02-13]&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/2023-02-13-10-57-55.png"&gt;
&lt;/figure&gt;
&lt;small&gt;Alacritty with font ligature support, Tmux, Cmus, Neovim nightly.&lt;/small&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Update [2024-08-23]&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/2024-08-23-22-19-36.png"&gt;
&lt;/figure&gt;
&lt;small&gt;Ubuntu 24.04 LTS: Foot terminal, Tmux, Neovim nightly 0.10.0 (release).&lt;/small&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Update [2025-09-02]&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/2025-09-02-06-52-12.png"&gt;
&lt;/figure&gt;
&lt;small&gt;macOS 15.6.1 Sequoia: Apple terminal, Apple Music, on a gorgeous display (3024x1964 @ 120 Hz (as 1512x982) in 14&amp;quot;).&lt;/small&gt;&lt;/p&gt;</description></item><item><title>Micro posting in September</title><link>https://aliquote.org/post/micro-09-2021/</link><pubDate>Mon, 27 Sep 2021 09:16:30 +0200</pubDate><guid>https://aliquote.org/post/micro-09-2021/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-09-01&lt;/a&gt;: &lt;a href="http://composed.nu/common-lisp-friday/"&gt;Common Lisp Friday&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-09-01&lt;/a&gt;: &lt;a href="https://serokell.io/blog/dependency-analysis-haskell"&gt;Dependency Analysis of Haskell Declarations&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-09-01&lt;/a&gt;: &lt;a href="https://t3x.org/lfn/index.html"&gt;Lisp from Nothing&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-09-01&lt;/a&gt;: &lt;a href="https://www.jamieweb.net/blog/tor-is-a-great-sysadmin-tool/"&gt;Tor is a Great SysAdmin Tool&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-09-02&lt;/a&gt;: &lt;a href="https://utcc.utoronto.ca/~cks/space/blog/unix/XTermQuiteSophisticated"&gt;The xterm terminal emulator can do a lot more than just display text&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-09-04&lt;/a&gt;: &lt;a href="https://aliquote.org/post/aparte-culinaire/"&gt;The show&lt;/a&gt; must go on.&lt;/p&gt;
&lt;p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1692.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1692.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/65246803331__E52D7AFA-05D8-41F8-9B3C-23C145B12C9E.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/65246803331__E52D7AFA-05D8-41F8-9B3C-23C145B12C9E.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;&lt;img src="https://aliquote.org/img/65246779870__B988B6B6-CACD-495C-948F-0E4F2E805D3E.JPG" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-09-06&lt;/a&gt;: As a consequence of switching to i3wm, my RAM usage dropped down to 550 Mo (instead of 950 Mo) when idle with only one terminal (Kitty). However, since I&amp;rsquo;m using i3+tmux+kitty+vim keybindings have become a thing, really: Shift+Ctrl for Kitty, C-b (and alt for navigating windows) for tmux, Win key for i3!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-09-06&lt;/a&gt;: Trying out i3 as a replacement for the default Gnome window manager, which is fine but I was looking for a more handy keyboard-driven app switcher and window management. As far as I can tell, Pop OS! looks really great, but i3 is simpler to install and to configure.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-09-06&lt;/a&gt;: &lt;a href="https://panicz.github.io/pamphlet/"&gt;A Pamphlet against R Computational Intelligence in Guile Scheme&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-09-06&lt;/a&gt;: &lt;a href="https://matklad.github.io//2021/09/04/fast-rust-builds.html"&gt;Fast Rust Builds&lt;/a&gt;. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-09-06&lt;/a&gt;: &lt;a href="https://erkin.party/scheme/bibliography/"&gt;Scheme books&lt;/a&gt;. &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-09-06&lt;/a&gt;: &lt;a href="https://www.chiark.greenend.org.uk/~sgtatham/cdescent/"&gt;The Descent to C&lt;/a&gt;, by Simon Tatham . &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-09-06&lt;/a&gt;:
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2021-09-06-21-50-16.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2021-09-06-21-50-16.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2021-09-06-21-51-24.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2021-09-06-21-51-24.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-09-07&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;For the past 30+ years in the industry (and generally in society) I have seen nothing more stupid and absolutely devastating than people following hype, trends and &amp;ldquo;majority&amp;rdquo; rule. Not only that, but the worst part is, and that is something that is really difficult to handle, when those very people actually believe that what they are doing is the right thing. They are utterly clueless about their own stupid behavior. &amp;mdash; &lt;a href="https://unixsheikh.com/articles/stop-submitting-to-social-conformity-and-use-your-brain-instead.html"&gt;Stop submitting to social conformity and use your brain instead&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-09-08&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Here&amp;rsquo;s the thing though, you never actually need to really learn your text editor&amp;hellip; Unless you use vim. &amp;mdash; &lt;a href="https://unixsheikh.com/articles/vim-i-hate-to-love-you.html"&gt;Vim - I hate to love you&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-09-08&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If your choice of operating system depends on any kind of formalities rather than on technical quality, OpenBSD is not the project you are looking for. &amp;mdash; &lt;a href="https://jamsek.dev/posts/2019/Oct/09/openbsd-clean-correct-code-by-default/"&gt;OpenBSD: Clean, Correct Code by Default&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-09-08&lt;/a&gt;: &lt;a href="https://bookdown.org/roback/bookdown-BeyondMLR/"&gt;Beyond Multiple Linear Regression: Applied Generalized Linear Models and Multilevel Models in R&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-09-13&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Once you choose the technology that runs your blog, use it. Don’t replace it, ever. Never ever rewrite it. &amp;mdash; &lt;a href="https://macwright.com/2019/02/06/how-to-blog.html"&gt;How to blog&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-09-13&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;There is hardly ever a good reason to invert a matrix. &amp;mdash; &lt;a href="https://www.johndcook.com/blog/2010/01/19/dont-invert-that-matrix/?utm_source=pocket_mylist"&gt;Don&amp;rsquo;t invert that matrix&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-09-13&lt;/a&gt;: &lt;a href="https://blog.kewah.com/2021/write-more-but-shorter/"&gt;Write more, but shorter&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-09-13&lt;/a&gt;: &lt;a href="https://github.com/TaKO8Ki/gobang/"&gt;gobang&lt;/a&gt;: A cross-platform TUI database management tool written in Rust. &lt;code&gt;#database&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-09-15&lt;/a&gt;: &lt;a href="https://nullprogram.com/blog/2021/09/14/?utm_source=pocket_mylist"&gt;Billions of Code Name Permutations in 32 bits&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-09-15&lt;/a&gt;: &lt;a href="http://c-faq.com/"&gt;comp.lang.c Frequently Asked Questions&lt;/a&gt;: A collection of hypertext pages by Steve Summit. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-09-16&lt;/a&gt;: &lt;a href="https://huemint.com/"&gt;https://huemint.com/&lt;/a&gt;: Color palette generator. (via &lt;a href="http://brett.trpstra.net/link/535/14714744/web-excursions-for-august-30-2021"&gt;Brett Terpstra&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-09-16&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I don’t consider myself a beginner to Unix or computers (I even have a PhD in the damn things), but I do consider myself a fairly inept and inexperienced systems administrator, with no great desire to spend the time to become better, and my needs are fairly basic - just the usual web/shell/IRC/mail server stuff, and other random infrastructure needs that come along for my work. Incidentally, this is exactly why I prefer OpenBSD. &amp;mdash; &lt;a href="https://sigkill.dk/blog/2020-02-09-why-i-run-openbsd.html"&gt;Why I run OpenBSD&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-09-16&lt;/a&gt;: &lt;a href="http://feedproxy.google.com/~r/TheEndeavour/~3/HARUlzCDYD4/"&gt;Parallel versus sequential binding&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-09-21&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;We&amp;rsquo;ve always had to wait for our code to compile. Now we need to wait for the Docker container to be built, pushed to a registry, pulled down by Kubernetes, and everything else too. &amp;mdash; &lt;a href="https://matt-rickard.com/frustrations-of-modern-development/"&gt;Frustrations of Modern Development&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-09-21&lt;/a&gt;: &lt;a href="http://www.modernstatisticswithr.com/"&gt;Modern Statistics with R: From wrangling and exploring data to inference and predictive modelling&lt;/a&gt;, by Måns Thulin. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-09-21&lt;/a&gt;: &lt;a href="https://benhoyt.com/writings/python-pattern-matching/"&gt;Structural pattern matching in Python 3.10&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-09-21&lt;/a&gt;: &lt;a href="https://sheer.tj/the_way_of_emacs.html"&gt;The way of Emancs&lt;/a&gt; (via &lt;a href="https://irreal.org/blog/?p=9986"&gt;Irreal&lt;/a&gt;). &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-09-21&lt;/a&gt;: &lt;a href="https://utcc.utoronto.ca/~cks/space/blog/tech/PackageManagersTwoTypes"&gt;There are (at least) two types of package managers&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-09-22&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_1714.JPG" alt="img"&gt;&lt;small&gt;That was the week that was. (Actually I cooked the quiche and cake last week.)&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-09-22&lt;/a&gt;: 3500+ posts and counting. And Hugo is still blazing fast&amp;hellip;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;~/Sites/aliquote master % hugo server
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; | EN
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;-------------------+-------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Pages | 3603
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Paginator pages | 290
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Non-page files | 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Static files | 1005
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Processed images | 0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Aliases | 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Sitemaps | 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Cleaned | 0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Built in 7072 ms
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-09-22&lt;/a&gt;: For RSS users: Starting now, my RSS entries should include full-length content, and not only the summary of each entry. Enjoy your RSS reader!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-09-22&lt;/a&gt;: &lt;a href="https://xn--gckvb8fzb.com/the-absurdity-of-modern-tools/"&gt;The Absurdity of Modern Tools&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-09-22&lt;/a&gt;: &lt;a href="https://github.com/extrawurst/gitui"&gt;gitui&lt;/a&gt; looks like a serious contender to &lt;a href="https://jonas.github.io/tig/"&gt;Tig&lt;/a&gt;. &lt;code&gt;#git&lt;/code&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>Random links from September</title><link>https://aliquote.org/post/random-links-september/</link><pubDate>Wed, 22 Sep 2021 18:47:47 +0200</pubDate><guid>https://aliquote.org/post/random-links-september/</guid><description>&lt;p&gt;Some sort of vacuum for my Pocket reading list which won&amp;rsquo;t stop growing.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://adventures.michaelfbryan.com/posts/daily/slice-patterns"&gt;Daily Rust: Slice Patterns&lt;/a&gt;: Slices are great, when you&amp;rsquo;re not off by one.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://thevaluable.dev/vim-expert/"&gt;A Vim Guide For Experts&lt;/a&gt;: I have read enough things about Vim config, starter kits like &lt;a href="https://www.lunarvim.org/#opinionated"&gt;Lunar&lt;/a&gt;, tips and tricks, and Vim philosophy the past few months that it is becoming difficult to pique my curiosity these days, but those kind of series are so great. There&amp;rsquo;s always something to learn.&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;Applications are bad enough in that they trap potentially useful building blocks for larger program ideas behind artificial barriers, but they fail at even their stated purpose of providing an &amp;lsquo;intuitive&amp;rsquo; interface to whatever fixed set of actions and functionality its creators have imagined. Here is why: the problem is that for all but the simplest applications, there are multiple contexts within the application and there needs to be a cohesive story for how to present only &amp;lsquo;appropriate&amp;rsquo; actions to the user and prevent nonsensical combinations based on context. This becomes serious business as the total number of actions offered by an application grows and the set of possible actions and contexts grows. As an example, if I just have selected a message in my inbox (this is a &amp;lsquo;context&amp;rsquo;), the &amp;lsquo;send&amp;rsquo; action should not be available, but if I am editing a draft of a message it should be. Likewise, if I have just selected some text, the &amp;lsquo;apply Kodachrome style retro filter&amp;rsquo; action should not be available, since that only makes sense applied to a picture of some sort. &amp;mdash; &lt;a href="https://pchiusano.blogspot.com/2013/05/the-future-of-software-end-of-apps-and.html"&gt;The future of software, the end of apps, and why UX designers should care about type theory &lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://bit-player.org/2021/riding-the-covid-coaster"&gt;Riding the Covid coaster&lt;/a&gt;: I usually don&amp;rsquo;t post about COVID &amp;mdash; because essentially we know nothing &amp;mdash; but every math article written by Brian Hayes are so enjoyable that I couldn&amp;rsquo;t resist.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://simonwillison.net/2021/Aug/30/datasette-app/"&gt;Building a desktop application for Datasette (and weeknotes)&lt;/a&gt;: This was some weeks ago, and it looks like it&amp;rsquo;s already there (Mac only).&lt;/li&gt;
&lt;li&gt;&lt;a href="https://danluu.com/keyboard-v-mouse/"&gt;Keyboard v. mouse&lt;/a&gt;: I think I already mentioned this article on the Micro section of this site, but it remains a great read. FWIW, I more of a keyboard guy because I always used laptops and mouse is not an option there.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://varianceexplained.org/r/empirical-bayes-book/"&gt;Announcing the release of my e-book: Introduction to Empirical Bayes&lt;/a&gt;: Great news! I always enjoy reading David&amp;rsquo;s posts, and its R code to solve math problem using simulation, even if I don&amp;rsquo;t watch his screencasts on real data analysis. I highly recommend this book.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://extremelearning.com.au/how-to-evenly-distribute-points-on-a-sphere-more-effectively-than-the-canonical-fibonacci-lattice/"&gt;How to evenly distribute points on a sphere more effectively than the canonical Fibonacci Lattice&lt;/a&gt;: This reminded me of a post by whuber on Cross Validated long ago.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://b-rodrigues.github.io/modern_R/"&gt;Modern R with the tidyverse&lt;/a&gt;: Yet another textbook on &amp;ldquo;modern&amp;rdquo; R.&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Neovim wrap up (6/n)</title><link>https://aliquote.org/post/neovim-wrapup/</link><pubDate>Tue, 21 Sep 2021 20:53:35 +0200</pubDate><guid>https://aliquote.org/post/neovim-wrapup/</guid><description>&lt;p&gt;« &lt;a href="https://aliquote.org/post/vim-fuzzy-finder/"&gt;Previous post&lt;/a&gt; in this series&lt;/p&gt;
&lt;p&gt;This is the last post in this series on my Neovim setup. I didn&amp;rsquo;t cover as much as I wished initially. However, as my current configuration has remained relatively stable for the last two months, I deduce that I have done what I really need in terms of plugins and additional features. I must confess I also rewrote from scratch a minimal Emacs config to deal with Lisp languages from times to times. I installed VS Code long ago, but I barely use it. I guess I&amp;rsquo;ll remain stuck in a terminal for quite some time to come.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s the list of plugins I have in my &lt;code&gt;init.lua&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;require(&amp;#39;packer&amp;#39;).startup(function()
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; use &amp;#34;wbthomason/packer.nvim&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; use {&amp;#39;lewis6991/gitsigns.nvim&amp;#39;, requires = &amp;#39;nvim-lua/plenary.nvim&amp;#39;}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; use {&amp;#39;nvim-treesitter/nvim-treesitter&amp;#39;, run = &amp;#39;:TSUpdate&amp;#39;}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; use {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;nvim-telescope/telescope.nvim&amp;#39;,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; requires = {&amp;#39;nvim-lua/popup.nvim&amp;#39;, &amp;#39;nvim-lua/plenary.nvim&amp;#39;}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; use &amp;#39;neovim/nvim-lspconfig&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; use &amp;#39;nvim-lua/lsp_extensions.nvim&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; use &amp;#39;hrsh7th/nvim-compe&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; use {&amp;#39;vlime/vlime&amp;#39;, rtp = &amp;#39;vim/&amp;#39;, ft = &amp;#39;lisp&amp;#39;}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; use &amp;#39;mhartington/formatter.nvim&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; use {&amp;#39;itspriddle/vim-shellcheck&amp;#39;, ft = &amp;#39;sh&amp;#39;}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; use &amp;#39;mfussenegger/nvim-dap&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; use {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;b3nj5m1n/kommentary&amp;#39;,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ft = {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;rust&amp;#39;, &amp;#39;python&amp;#39;, &amp;#39;haskell&amp;#39;, &amp;#39;c&amp;#39;, &amp;#39;cpp&amp;#39;,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;racket&amp;#39;, &amp;#39;julia&amp;#39;, &amp;#39;javascript&amp;#39;, &amp;#39;r&amp;#39;, &amp;#39;sh&amp;#39;,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;html&amp;#39;, &amp;#39;css&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; use {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;theHamsta/nvim-dap-virtual-text&amp;#39;,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ft = {&amp;#39;rust&amp;#39;, &amp;#39;python&amp;#39;, &amp;#39;haskell&amp;#39;, &amp;#39;c&amp;#39;, &amp;#39;cpp&amp;#39;}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;end)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Well, that&amp;rsquo;s it. I don&amp;rsquo;t really need &lt;code&gt;lualine&lt;/code&gt; (previously, I was using my own status line), but it&amp;rsquo;s fast enough that I don&amp;rsquo;t care. I know &lt;a href="https://github.com/hrsh7th/nvim-cmp"&gt;nvim-cmp&lt;/a&gt; superseded &lt;code&gt;nvim-compe&lt;/code&gt; some time ago, but I don&amp;rsquo;t really care as the later works for me. I really like &lt;code&gt;gitsigns&lt;/code&gt; since it comes with built-in blame and hunk preview. Surely &lt;code&gt;treesitter&lt;/code&gt; is a thing, but I&amp;rsquo;m waiting to see if &lt;a href="https://github.com/nvim-treesitter/nvim-treesitter-textobjects"&gt;nvim-treesitter-textobjects&lt;/a&gt; could be useable for Lisp/Scheme languages at some point. The &lt;code&gt;kommentary&lt;/code&gt; plugin is not really necessary for my day-to-day scripting tasks in Bash or Python, but I keep it in case I need to work on biggish Python or Rust projects. I know the Debug Adapter Protocol is used in VS Code and Emacs. I tested it in my Python projects, and it works great. Let&amp;rsquo;s see how it goes with C and Rust toy programs in the future. I know there are other alternatives to &lt;code&gt;formatter&lt;/code&gt;, especially those who are closer to ALE than others, but actually my config is okay.&lt;/p&gt;
&lt;p&gt;Here is my whole config in case you are interested (this includes Zsh and Tmux settings): &lt;a href="https://aliquote.org/pub/vim+zsh_2021-09-21.tar.gz"&gt;vim+zsh_2021-09-21.tar.gz&lt;/a&gt;.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2021-10-26]&lt;/small&gt;&lt;br&gt;
You may find this blog post very useful: &lt;a href="https://toroid.org/modern-neovim"&gt;Moving to modern Neovim&lt;/a&gt;.
&lt;/div&gt;
&lt;br&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2022-08-13]&lt;/small&gt;&lt;br&gt;
Finally, it took me almost two years to get a comfy setup which I use everyday without bothering tinkering my config files every two days or so. The hard part was to get used to what&amp;rsquo;s builtin, in both Vim and Neovim, how best to use available tools, and delete every bit of extraneous settings that won&amp;rsquo;t stand the test of time. Read the manual, seriously, there&amp;rsquo;s so much to learn. And use as few plugins as possible: I&amp;rsquo;m happy with 15 plugins ([opt] &lt;code&gt;iron.nvim&lt;/code&gt;, &lt;code&gt;neogen&lt;/code&gt;, &lt;code&gt;neogit&lt;/code&gt;, &lt;code&gt;nvim-parinfer&lt;/code&gt;, &lt;code&gt;vim-test&lt;/code&gt;, &lt;code&gt;vimtex&lt;/code&gt;; [start] &lt;code&gt;Comment.nvim&lt;/code&gt;, &lt;code&gt;null-ls.nvim&lt;/code&gt;, &lt;code&gt;nvim-lspconfig&lt;/code&gt;, &lt;code&gt;nvim-treesitter&lt;/code&gt;, ̀&lt;code&gt;packer.nvim&lt;/code&gt;, &lt;code&gt;plenary.nvim&lt;/code&gt;, &lt;code&gt;telescope-bibtex.nvim&lt;/code&gt;, &lt;code&gt;telescope-fzf-native.nvim&lt;/code&gt;, &lt;code&gt;telescope.nvim&lt;/code&gt;), and pieces of &lt;a href="https://github.com/echasnovski/mini.nvim"&gt;mini.nvim&lt;/a&gt; that I grabbed by the end of 2021 and customized to my liking.
&lt;/div&gt;</description></item><item><title>Cmus</title><link>https://aliquote.org/post/cmus/</link><pubDate>Fri, 17 Sep 2021 20:26:30 +0200</pubDate><guid>https://aliquote.org/post/cmus/</guid><description>&lt;p&gt;I&amp;rsquo;ve been using &lt;a href="https://cmus.github.io/"&gt;cmus&lt;/a&gt; as my main music for almost a year and I am pretty happy with it. It has a low memory fingerprint, and it easily parses large database of MP3. Of course, it is a lot different from Apple&amp;rsquo;s own music player, iTunes, which I used to love before they made so many updates to the app that it no longer resembles the app it was ten years ago. Cmus is simple, yet powerful.&lt;/p&gt;
&lt;p&gt;I also tried &lt;a href="https://mpv.io/"&gt;mpv&lt;/a&gt;, which I consider as the best CLI tool for multimedia files after &lt;a href="https://ffmpeg.org/"&gt;ffmpeg&lt;/a&gt; &amp;mdash; and not only because Glen Gould is on the cover, and &lt;a href="https://www.videolan.org/vlc/"&gt;VLC&lt;/a&gt;. VLC is fine but I mostly use mpv to watch videos or Youtube downloads on my computer. I even have a script, called &lt;code&gt;playme&lt;/code&gt;, to launch a playlist in the background:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#!/bin/sh
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; in
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; kitty&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; kitty @ launch --type tab --tab-title &lt;span class="s2"&gt;&amp;#34;mpv&amp;#34;&lt;/span&gt; mpv --shuffle --no-audio-display ~/Media/Music/Jazz&lt;span class="se"&gt;\ &lt;/span&gt;Chill
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; term&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; mpv --shuffle --no-audio-display --no-terminal ~/Media/Music/Jazz&lt;span class="se"&gt;\ &lt;/span&gt;Chill
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; *&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Usage: &lt;/span&gt;&lt;span class="nv"&gt;$0&lt;/span&gt;&lt;span class="s2"&gt; {kitty|term}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;exit&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;esac&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;exit&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It works fine to just launch 12 hours of music in the background and get back to work. I also found a little script that helps to display the current song in my status bar (which actually is a customized &lt;a href="https://aliquote.org/post/i3wm.md"&gt;polybar&lt;/a&gt;). Likewise I have a &lt;a href="https://github.com/polybar/polybar-scripts/tree/master/polybar-scripts/player-cmus"&gt;script&lt;/a&gt; to display the current track from cmus, with interactive mouse actions (stop, skip forward/backward in playlist). It looks like it is easier to manage cmus state thanks to &lt;code&gt;cmus-remote&lt;/code&gt; which handles most of the actions we expect from a mini player. See also &lt;a href="https://gideonwolfe.com/posts/workflow/sidekickprograms/"&gt;Workflow Optimization Part 3: Sidekick Programs for i3&lt;/a&gt; for a solution similar to mine.&lt;/p&gt;
&lt;p&gt;There&amp;rsquo;s a lot more to see with &lt;a href="https://github.com/cmus/cmus/wiki"&gt;cmus extensions&lt;/a&gt;.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2023-01-21]&lt;/small&gt;&lt;br&gt;
Should you want to fetch music directly from Youtube, you can use the &lt;a href="https://github.com/invicnaper/cmus-youtube"&gt;following hack&lt;/a&gt;. You will likely need to install a bunch of additional libraries on Ubuntu, but it works fine. This may help developing additional command to fetch music from external provider (e.g. Bandcamp, or &lt;a href="https://aliquote.org/micro/2022-10-27-21-32-49"&gt;online radio&lt;/a&gt;).
&lt;/div&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2023-06-20]&lt;/small&gt;&lt;br&gt;
If you use &lt;a href="https://specifications.freedesktop.org/mpris-spec/latest/"&gt;mpris&lt;/a&gt;, you can get cover art in Gnome notification applet almost for free, see this fork: &lt;a href="https://github.com/MicahBird/cmus-mpris-album-art"&gt;cmus-mpris-album-art&lt;/a&gt;.
&lt;/div&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2021-09-18-20-27-54.png"&gt;
&lt;/figure&gt;</description></item><item><title>Nyxt browser and other handy TUI apps</title><link>https://aliquote.org/post/nyxt-browser/</link><pubDate>Fri, 10 Sep 2021 09:14:41 +0200</pubDate><guid>https://aliquote.org/post/nyxt-browser/</guid><description>&lt;p&gt;When switching to i3, as discussed in my &lt;a href="https://aliquote.org/post/i3wm/"&gt;previous post&lt;/a&gt;, I was particularly interested in getting a more comfortable keyboard-centric user experience. This led me to drop or look for alternatives to the few Gnome applications I used to use (Evince, Nautilus, Firefox). Below is a quick summary of what I&amp;rsquo;ve found. (And yes I know that everything is already available under Emacs with eww, pdf-tools, dired and native image support in GUI version of Emacs.)&lt;/p&gt;
&lt;h3 id="nyxt-browser"&gt;Nyxt browser&lt;/h3&gt;
&lt;p&gt;I really like the design philosophy of &lt;a href="https://nyxt.atlas.engineer/"&gt;Nyxt&lt;/a&gt;, and you will certainly acknowledge, especially if you have some experience with keyboard-driven or TUI web browser, that the UI is beautiful. Moreover, it is designed with Emacs and Vim users in mind, since you can select the keybindings set you like best. I recommend reading the manual before using Nyxt for longer web sessions; it&amp;rsquo;s even &lt;a href="https://github.com/atlas-engineer/nyxt/blob/master/source/manual.lisp"&gt;available in Lisp&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Several keyboard-driven web browsers, like &lt;a href="https://qutebrowser.org/"&gt;Qutebrowser&lt;/a&gt;, &lt;a href="https://fanglingsu.github.io/vimb/"&gt;vimb&lt;/a&gt;, or &lt;a href="http://conkeror.org/"&gt;Conkeror&lt;/a&gt; (which I heard about a few years ago via Technomancy), notwithstanding Firefox plugins that can be used to emulate Vim motions like &lt;a href="http://vimperator.org/vimperator.html"&gt;Vimperator&lt;/a&gt; or &lt;a href="https://github.com/tridactyl/tridactyl"&gt;Tridactyl&lt;/a&gt;. I tried Tridactyl a few weeks but I was overall not very satisfied with the way it works. Above all, the only features I really want is that infamous easy motion selector (which usually goes by the shortcut F or f) and a quick search bar using /. Firefox native search tools are not really helpful: &lt;code&gt;Ctrl+F&lt;/code&gt; open a small dialog box at the bottom of the page, and it is hard to close without using the mouse once you start navigating around matched words in the HTML page. And there&amp;rsquo;s a quick lookup function available via &lt;code&gt;/&lt;/code&gt; but I never understood how it really works.&lt;/p&gt;
&lt;p&gt;Beside being less memory hungry than Firefox, Nyxt gives me all what I need : &lt;code&gt;gg&lt;/code&gt; and &lt;code&gt;G&lt;/code&gt; to go to the bottom or the top of the page, &lt;code&gt;F&lt;/code&gt; to emulate easy motion, and &lt;code&gt;d&lt;/code&gt; to delete buffer(s). The history tree is great, although I didn&amp;rsquo;t check how usable it is for longer web crawling sessions. I didn&amp;rsquo;t really customize the UI, but it seems to be pretty easy, especially if you&amp;rsquo;re versed into Emacs config file.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2021-09-13]&lt;/small&gt;&lt;br&gt;
See also: &lt;a href="https://drewdevault.com/2021/09/11/visurf-announcement.html"&gt;visurf, a web browser based on NetSurf&lt;/a&gt;.
&lt;/div&gt;
&lt;p&gt;For my micro-blog, I can simply &lt;code&gt;yt&lt;/code&gt; and &lt;code&gt;yu&lt;/code&gt; to get the title and url of a web page in my primary clipboard, which makes life so much easy. It is also quite easy to bookmark a page or to add additional search engine, provided you know a bit of Lisp. Here&amp;rsquo;s a minimal config file with Vim keybindings:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;define-configuration&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;buffer&lt;/span&gt; &lt;span class="nv"&gt;web-buffer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nv"&gt;default-modes&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;vi-normal-mode&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;%slot-default%&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;define-configuration&lt;/span&gt; &lt;span class="nv"&gt;prompt-buffer&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nv"&gt;default-modes&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;vi-insert-mode&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;%slot-default%&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;define-configuration&lt;/span&gt; &lt;span class="nv"&gt;buffer&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nv"&gt;download-path&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;make-instance&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;download-data-path&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="ss"&gt;:dirname&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;~/tmp/&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defvar&lt;/span&gt; &lt;span class="vg"&gt;*my-search-engines*&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;list&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;python3&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;https://docs.python.org/3/search.html?q=~a&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;https://docs.python.org/3&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;doi&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;https://dx.doi.org/~a&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;https://dx.doi.org/&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;google&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;https://www.google.com/search?q=~a&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;https://www.google.com/&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;List of search engines.&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;define-configuration&lt;/span&gt; &lt;span class="nv"&gt;buffer&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nv"&gt;search-engines&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;mapcar&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;lambda&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;engine&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;apply&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;make-search-engine&lt;/span&gt; &lt;span class="nv"&gt;engine&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="vg"&gt;*my-search-engines*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;%slot-default%&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For Firefox users, note that &lt;kbd&gt;Alt+Left&lt;/kbd&gt; arrow still work in addition to &lt;code&gt;[&lt;/code&gt; to navigate backward in the history of the current buffer.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2022-08-17]&lt;/small&gt;&lt;br&gt;
I&amp;rsquo;ve been using Nyxt as my daily driver for quick surfing on the web and it works really great. I only use Firefix when I have to do web development or to tweak CSS settings (thanks to the developer tools). Hopefully, with a single keystroke, I can send the current Nyxt buffer to Firefox and continue from there. I noticed Nyxt has a new release, &lt;a href="https://nyxt.atlas.engineer/article/release-3-pre-release-1.org"&gt;Nyxt 3&lt;/a&gt;. I&amp;rsquo;m eagerly waiting for an official release in the next weeks.
&lt;/div&gt;
&lt;h3 id="zathura-viewer"&gt;Zathura viewer&lt;/h3&gt;
&lt;p&gt;I was looking for a quick PDF viewer, and I came across &lt;a href="https://pwmt.org/projects/zathura/"&gt;Zathura&lt;/a&gt; on &lt;a href="https://vim.reversed.top/"&gt;Big Pile of Vim-like&lt;/a&gt;. I installed it right away, along with associated plugin to read PDF, DJVU and PS documents. It&amp;rsquo;s rare to see an application allowing to read both PDF and DJVU format. Some textbooks are still available in that old format, and I will no longer have to convert them to PDF beforehand. The UI is really minimalist, and this is mostly Vim-centric: &lt;code&gt;J&lt;/code&gt; and &lt;code&gt;K&lt;/code&gt; are used to go to the next or previous page, &lt;code&gt;gg&lt;/code&gt; and &lt;code&gt;G&lt;/code&gt; jump to the first or last page, &lt;code&gt;C-o&lt;/code&gt; and &lt;code&gt;C-i&lt;/code&gt; to navigate the jump list, etc. More keyboard shortcuts are documented &lt;a href="https://defkey.com/zathura-shortcuts"&gt;here&lt;/a&gt;. If you don&amp;rsquo;t like the dark background, you can use the color you want by editing the config file &lt;code&gt;$HOME/.config/zathura/zathurarc&lt;/code&gt;. I have these settings, for example:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set default-bg &amp;#34;#fffff8&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set statusbar-bg &amp;#34;#4c566a&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set statusbar-fg &amp;#34;#e5e9f0&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I particularly like the dual view (&lt;code&gt;d&lt;/code&gt;) and the index (&lt;code&gt;&amp;lt;tab&amp;gt;&lt;/code&gt;), as well as the easy zooming facilities (&lt;code&gt;+&lt;/code&gt; and &lt;code&gt;-&lt;/code&gt;).&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2021-10-20]&lt;/small&gt;&lt;br&gt;
With the aid of a few add-ons (available via &lt;code&gt;apt&lt;/code&gt;), Zathura can also become your default EPUB and DJVU browser. I used &lt;code&gt;xdg-mime default zathura.desktop application/pdf&lt;/code&gt; to make it mine.
&lt;/div&gt;
&lt;h3 id="feh-image-viewer"&gt;Feh image viewer&lt;/h3&gt;
&lt;p&gt;As suggested on the &lt;a href="https://i3wm.org/"&gt;i3&lt;/a&gt; website, &lt;a href="https://feh.finalrewind.org/"&gt;feh&lt;/a&gt; can be used to set a wallpaper for your desktop. You may not enjoy it much in tiling mode, but at least you can choose a picture to your liking. Besides, feh can be used as a simple image viewer, for those who don&amp;rsquo;t like ImageMagick display application. It works smoothly, and again hitting the &lt;code&gt;q&lt;/code&gt; key simply close the app, like Zathura. Above all, you can simply browse a whole directory, and the arrow keys help to switch to the previous/next (&lt;code&gt;left&lt;/code&gt;/&lt;code&gt;right&lt;/code&gt;) picture or to zoom in (&lt;code&gt;up&lt;/code&gt;) and out (&lt;code&gt;down&lt;/code&gt;). More information is available in the man page.&lt;/p&gt;
&lt;h3 id="ranger-file-manager"&gt;Ranger file manager&lt;/h3&gt;
&lt;p&gt;I don&amp;rsquo;t use a file manager in Neovim other than the builtin Netrw. I mapped the &lt;code&gt;-&lt;/code&gt; key to browse the current directory, and that&amp;rsquo;s fine. However, sometimes I need more: a directory browser, with preview available on demand. That&amp;rsquo;s all what we get when we install &lt;a href="https://ranger.github.io/"&gt;ranger&lt;/a&gt;. It is powerful, really. You use the arrow keys (yes, I like the arrow keys!) to navigate your directories, and you use some magic combo like &lt;code&gt;zi&lt;/code&gt; or &lt;code&gt;zp&lt;/code&gt; to display images or files online (image previewing doesn&amp;rsquo;t work in Tmux, though). And you can &lt;code&gt;:rename&lt;/code&gt; or &lt;code&gt;:move&lt;/code&gt; files using the command mode.&lt;/p&gt;</description></item><item><title>Now using i3wm as a window manager</title><link>https://aliquote.org/post/i3wm/</link><pubDate>Wed, 08 Sep 2021 09:14:47 +0200</pubDate><guid>https://aliquote.org/post/i3wm/</guid><description>&lt;p&gt;I decided to install the &lt;a href="https://i3wm.org/"&gt;i3 window manager&lt;/a&gt; (WM) on my main Linux laptop, and use it as a replacement for Gnome default WM (Mutter). Gnome WM is fine, to be honest. It offers a clean UI, and a few handy keyboard shortcuts to manage windows and workspaces. If you want more fancy stuff in your menu bar, you need to install Gnome Shell Extensions, at least for Ubuntu. I believe Linux Mint comes with shell extensions enabled by default. Since my main usage of a desktop consists in using maximized applications on screen, or sometimes side by side applications like in a vertical split (e.g., for web dev I may want to have a browser right to my Neovim instance to have a live preview).&lt;/p&gt;
&lt;p&gt;On my MacBook, I used to use &lt;a href="https://aliquote.org/post/amethyst-app/"&gt;Amethyst&lt;/a&gt;, which I configured to look like i3-gaps (i.e., i3 with inner and outer gap) because native apps look better with a bit of space around them especially when you cannot remove window border and/or titles. It worked great, until I switched to Linux. I was also using &lt;a href="https://aliquote.org/post/kitty-terminal/"&gt;Kitty terminal&lt;/a&gt; (both on my MacBook and my Linux machine) and its handy multiplexing capabilities, notwithstanding its font ligature support and remote management facilities. When I decided to use default Gnome apps, I had to resort on &lt;a href="https://aliquote.org/post/tmux-2021/"&gt;Tmux&lt;/a&gt; to manage my windows (the menu and tab bars in Gnome are just useless and take so much vertical space).&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2021-01-16-20-36-17.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2021-01-16-20-36-17.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2021-08-29-21-18-00.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2021-08-29-21-18-00.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Back in the days when I was using Linux in 2004, I used to use a tiling WM as well. I recently installed i3 on my OpenBSD laptop, and it was great. So why not trying out i3 on this machine, and see if it can help improving my daily workflow?&lt;/p&gt;
&lt;p&gt;Before I discuss my current setup, here&amp;rsquo;s what I really need from a WM: (1) handy shortcuts to navigate around windows arranged automagically in a convenient layout, i.e. fullscreen or maximized, or in split view (mostly as side by side windows since I rarely need more than two windows); (2) easy navigation between workspaces, including the ability to send focused window(s) to new workspace; (3) low RAM consumption &amp;mdash; I don&amp;rsquo;t really care about my RAM since I have 16 Go on my laptop, but I don&amp;rsquo;t see why meeting the above requirements would need more than 100-200 Mo of RAM; (4) a scriptable setup, that is I want to have a plain text config file. I already spent a lot of time customizing Gnome, like adding Readline compat for Firefox or updating default colors, but I never found a clean way to that other than firing some command in a shell, like:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ gsettings &lt;span class="nb"&gt;set&lt;/span&gt; org.gnome.desktop.background picture-uri &lt;span class="s2"&gt;&amp;#34;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ gsettings &lt;span class="nb"&gt;set&lt;/span&gt; org.gnome.desktop.background primary-color &lt;span class="s1"&gt;&amp;#39;#6e7f80&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ gsettings &lt;span class="nb"&gt;set&lt;/span&gt; org.gnome.desktop.interface gtk-key-theme &lt;span class="s2"&gt;&amp;#34;Emacs&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ gsettings &lt;span class="nb"&gt;set&lt;/span&gt; org.gnome.desktop.wm.preferences focus-mode &lt;span class="s1"&gt;&amp;#39;mouse&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ &lt;span class="nb"&gt;cd&lt;/span&gt; /usr/share/gnome-shell/extensions/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ sudo mv ubuntu-dock@ubuntu.com&lt;span class="o"&gt;{&lt;/span&gt;,.bak&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;small&gt;And of course you should not forget to reload Gnome Desktop afterwards (&lt;kbd&gt;ALT-F2, r&lt;/kbd&gt;).&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;Not to forget that I need to manually enter Hex codes using dialog box or color pickers and save my current color scheme for Gnome Terminal.&lt;/p&gt;
&lt;p&gt;So, I&amp;rsquo;m back to Kitty terminal and to a tiling WM. As far as I am concerned I didn&amp;rsquo;t have to read a lot of documentation or user config files to setup my WM. In fact, I added very few things to the bare defaults, which are already really good.&lt;/p&gt;
&lt;p&gt;Below I show what I added to the default config:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# class border backgr. text indicator child_border
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;client.focused #4c566a #4c566a #ffffff #2e9ef4 #285577
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;client.focused_inactive #5f676a #5f676a #ffffff #484e50 #5f676a
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;client.urgent #2f343a #ffb52a #222222 #900000 #900000
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Background jobs
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;exec_always --no-startup-id $HOME/.config/polybar/launch.sh
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork --image=/home/chl/Images/ilock.png
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;exec_always feh --bg-scale ~/Images/wp4627247-macos-mojave-wallpapers.jpg
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Take screenshot
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bindsym Print exec &amp;#34;scrot &amp;#39;%Y-%m-%d-%H-%M-%S.png&amp;#39; --thumb 300x200 -e &amp;#39;mv $m $f ~/Images&amp;#39;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bindsym --release Shift+Print exec &amp;#34;scrot -s -e &amp;#39;mv $f ~/Images/%Y-%m-%d-%H-%M-%S.png&amp;#39;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bindsym --release Ctrl+Print exec &amp;#34;scrot -u -d 2 -e &amp;#39;mv $f ~/Images/%Y-%m-%d-%H-%M-%S.png&amp;#39;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bindsym $mod+Tab workspace next
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bindsym $mod+Shift+Tab workspace prev
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;A default session may look like what I show in the following screenshot:&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2021-09-08-11-12-26.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2021-09-08-11-12-26.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2021-09-08-11-13-15.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2021-09-08-11-13-15.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The default menu bar once you launched i3 is kind of ugly, to say the least, but it can easily be customized to display only the information you want. I leave it below for posterity, but I definitely switched to polybar, see below:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;general {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; colors = true
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; color_good = &amp;#34;#a3be8c&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; color_bad = &amp;#34;#bf616a&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; color_degraded = &amp;#34;#d08770&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; output_format = &amp;#34;i3bar&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; interval = 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;order += &amp;#34;wireless wlan0&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;order += &amp;#34;ethernet enx00e04c68005b&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;order += &amp;#34;cpu_usage 0&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;order += &amp;#34;volume master&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;order += &amp;#34;battery 0&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;order += &amp;#34;tztime local&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;wireless wlan0 {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; format_up = &amp;#34;W: (%quality at %essid, %bitrate) %ip&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; format_down = &amp;#34;W: down&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ethernet enx00e04c68005b {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; format_up = &amp;#34;E: %ip&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; format_down = &amp;#34;E: down&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;battery 0 {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; format = &amp;#34;%status %percentage&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; last_full_capacity = true
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; low_threshold = 20
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cpu_usage {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; format = &amp;#34;CPU: %usage&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;tztime local {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; format = &amp;#34;%d/%m %H:%M&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;volume master {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; format = &amp;#34;♫ %volume&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; device = &amp;#34;default&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; mixer = &amp;#34;Master&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; mixer_idx = 0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Enter &lt;a href="https://polybar.github.io/"&gt;polybar&lt;/a&gt; which provides a lot of enhancements and allows for easy customization of the status bar. It comes with a lot of handy built-in plugins that can grab various informations from the system for you, e.g. CPU load and temperature, pulseaudio and ALSA sound controls, network status. External plugins are also available, like the &lt;a href="https://github.com/polybar/polybar-scripts/tree/master/polybar-scripts/player-cmus"&gt;cmus-player&lt;/a&gt; plugin which displays current song in a small interactive container (with right and left click enabled) in your status bar.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; This is what I settled upon finally, as you can see in the above screenshots. I started using the default config files, and ended up using the following pieces of modules:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;modules-left = i3
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;modules-center =
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;modules-right = cmus system-usb-mount cpu temperature battery pulseaudio wlan eth date
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So far I really like this new setup. It&amp;rsquo;s still a bit crazy to have 3 ways of arranging windows on a screen &amp;mdash; tmux, kitty and i3 &amp;mdash; but in the end not having to worry about window placement and maximization and having simple keyboard shortcuts to navigate and move windows is a huge plus. Kudos to the i3 and polybar developers.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2021-09-21]&lt;/small&gt;&lt;br&gt;
After having messed around with my polybar configuration for a week, I finally settled upon the &amp;ldquo;grayblocks&amp;rdquo; theme from &lt;a href="https://github.com/adi1090x/polybar-themes"&gt;polybar-themes&lt;/a&gt;, with lot of customizations of course. See below for the latest screenshot.
&lt;/div&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2021-09-21-15-22-23.png"&gt;
&lt;/figure&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Note that you can even use polybar itself to take a screenshot of your current config.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Aparté culinaire</title><link>https://aliquote.org/post/aparte-culinaire/</link><pubDate>Fri, 03 Sep 2021 20:22:34 +0200</pubDate><guid>https://aliquote.org/post/aparte-culinaire/</guid><description>&lt;p&gt;Petit aparté culinaire en cette veille de week-end, après la reprise du travail lundi. Voici donc les petits plats préparés ce matin, au sortir du lit ou presque.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Mini quiches au chorizo ou au poulet : la base est un mélange de chou chinois et d&amp;rsquo;oignons nouveaux grossièrement hâchés, des petits dés de feta, du chorizo ou du poulet coupé en lanières, le tout recouvert d&amp;rsquo;un mélange de trois fromages râpés (mozarella, comté et emmental) ; pour lier le tout sur la pâte feuilletée, 2 oeufs mélangés avec du ricotta et de la crème fraîche, avec un assortiment de poivre, coriandre et muscade moulues.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://aliquote.org/img/IMG_1685.JPG" alt="img1"&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Cake au chorizo : inspiré de la base des cakes de Sophie (3 oeufs, 150 g de farine, 1 sachet de levure chomique, 8 cl d&amp;rsquo;huile d&amp;rsquo;olive, 12,5 cl de lait, 100 g de gruyère râpé, 2 pincées de poivre, et &amp;hellip; ce qu&amp;rsquo;on a envie de mettre d&amp;rsquo;autre) &amp;ndash; avec quelques variations&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;, un cake salé comprenant des dés de chorizo, des dés de feta, des poivrons grillés en lamelles et des olives noires coupées en rondelles.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1684.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1684.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1690.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1690.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Ratatouille aux épices : une simple ratatouille de courgettes, aubergines et tomates (oignon et ail), sur une base de curry d&amp;rsquo;épices légers (nigelle noir, cumin, graines de coriandre, et poivrons marinés).&lt;/p&gt;
&lt;p&gt;&lt;img src="https://aliquote.org/img/IMG_1683.JPG" alt="img3"&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Gâteau (au yaourt) aux pépites de chocolat, pistaches torréfiées et nougatine, en utilisant de la farine de châtaigne.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1687.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1687.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1691.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1691.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;J&amp;rsquo;ai remplacé les 150 g de farine par un mélange 100 g de farine blanche T55 et 50 g de farine de châtaigne, et j&amp;rsquo;ai remplacé le lait de vache par du lait de coco. J&amp;rsquo;ai également saupoudré la préparation de cumin une fois versée dans le moule.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in August</title><link>https://aliquote.org/post/micro-08-2021/</link><pubDate>Mon, 30 Aug 2021 13:39:57 +0200</pubDate><guid>https://aliquote.org/post/micro-08-2021/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-08-02&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;What&amp;rsquo;s the difference? Why do all those formal doo-hickeys matter?&lt;br&gt; Performance! Compiled languages are fast. Lisp is WAY faster than Ruby, over the long haul. Smokes it. &amp;mdash; &lt;a href="https://sites.google.com/site/steveyegge2/the-emacs-problem"&gt;the-emacs-problem&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-08-03&lt;/a&gt;: Tonight I top at less than 2 Go of RAM. Great, especially since I&amp;rsquo;m only using Gnome terminal and a bunch of child processes, after 2 days uptime. Never happened when I was on macOS.&lt;br&gt;&lt;img src="https://aliquote.org/img/2021-08-03-21-15-05.png" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-08-04&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;After 10+ years of Linux distributions pushing CUPS on me. Over a decade of this complex stack of drivers and daemons that I never quite trusted but “couldn’t live without.” FreeBSD comes along and is like “yeah, just use netcat.” And they’re right. Just use netcat. &amp;mdash; &lt;a href="https://retrohacker.substack.com/p/bye-cups-printing-with-netcat"&gt;Bye CUPS: Printing with netcat&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-08-04&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Checking news once a day is enough. &amp;mdash; &lt;a href="https://dataswamp.org/~solene/2021-07-26-old-computer-challenge-after.html"&gt;The Old Computer Challenge: 10 days later, what changed?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-08-04&lt;/a&gt;: It looks like the new &amp;ldquo;Now&amp;rdquo; thing is: &lt;a href="https://uglyduck.ca/sharing-the-things-we-use/"&gt;Uses&lt;/a&gt; (via &lt;a href="https://kevq.uk/notes/adding-a-uses-page/"&gt;Kev Quirk&lt;/a&gt;). Here is mine, but it&amp;rsquo;s called &lt;a href="https://aliquote.org/articles/how-i-do/"&gt;How I do&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-08-04&lt;/a&gt;: TIL about &lt;a href="https://sr.ht/~ireas/rusty-man/"&gt;rusty-man&lt;/a&gt;, which is pretty handy to have a look at the Rust doc from a terminal. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-08-04&lt;/a&gt;: Using an Apple Magic Mouse on Ubuntu is kind of magic and ironic, yet it&amp;rsquo;s still better than PC touchpad. I should note that Bluetooth is working fine on Linux machines compared to 15 years ago&amp;hellip;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-08-04&lt;/a&gt;: &lt;a href="http://feedproxy.google.com/~r/TheEndeavour/~3/Z6skvdnCIBg/"&gt;Collatz analog in C&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-08-04&lt;/a&gt;: &lt;a href="https://berthub.eu/articles/posts/leapseconds-expose-bugs-even-when-they-dont-happen/"&gt;Leap seconds: Causing Bugs Even When They Don&amp;rsquo;t Happen&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-08-05&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_1624.JPG" alt="img"&gt;&lt;small&gt;Today&amp;rsquo;s art discount on the balcony.&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-08-06&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Build your own tools for repeated workflows. There is nothing faster than using a tool you made yourself. &amp;mdash; &lt;a href="https://matt-rickard.com/reflections-on-10-000-hours-of-programming/?utm_source=pocket_mylist"&gt;Reflections on 10,000 Hours of Programming&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-08-06&lt;/a&gt;: &lt;a href="https://vonheikemen.github.io/devlog/tools/configuring-neovim-using-lua/"&gt;Everything you need to know to configure neovim using lua&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-08-19&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_1638.JPG" alt="img"&gt;&lt;small&gt;Fuschia on the balcony&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-08-19&lt;/a&gt;: Old times good times: &lt;a href="http://tapedeck.org/"&gt;http://tapedeck.org/&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-08-19&lt;/a&gt;: TIL that &lt;code&gt;&amp;lt;C-R&amp;gt;.&lt;/code&gt; (mind the leading dot) allow to paste the last piece of inserted text. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-08-19&lt;/a&gt;: &lt;a href="https://github.blog/2021-08-16-highlights-from-git-2-33/"&gt;Highlights from Git 2.33&lt;/a&gt;. &lt;code&gt;#git&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-08-19&lt;/a&gt;: &lt;a href="https://programming-idioms.org/"&gt;Programming Idioms&lt;/a&gt;. Interesting to quickly compare the syntax of different PLs to perform the same task.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-08-20&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I am one of those people who came to Racket because it is a Lisp. I feel that I should be better at creating/using software and general problem solving than I am, and I guess you could say I am looking for the fabled Lisp enlightenment. Maybe saying Lisp is the language of the gods is overwrought, but nobody ever said that JavaScript made them smarter, or that they learned a lot using anything by Microsoft. &amp;mdash; &lt;a href="https://www.macadie.net/2019/08/11/thoughts-on-lisp-and-racket/"&gt;Thoughts On Lisp And Racket&lt;/a&gt;See comments and interesting side discussions on &lt;a href="https://news.ycombinator.com/item?id=28179463"&gt;Hacker News&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-08-20&lt;/a&gt;: Here&amp;rsquo;s an interesting list of resources in addition to StatLib: &lt;a href="https://www.pibburns.com/statmath.htm"&gt;Statistics, Statistical Computing, and Mathematics&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-08-20&lt;/a&gt;: &lt;a href="https://people.duke.edu/~ccc14/sta-663/"&gt;Computational Statistics in Python&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-08-20&lt;/a&gt;: &lt;a href="https://blog.matthieud.me/2020/exploring-clang-llvm-optimization-on-programming-horror/"&gt;Exploring Clang/LLVM optimization on programming horror&lt;/a&gt;. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-08-20&lt;/a&gt;: &lt;a href="https://yurichev.com/news/20210819_RE1/"&gt;Fun with regular expressions: part I&lt;/a&gt;. Actually, it&amp;rsquo;s quite an interesting read since this post is just a succession of C code, interesting to read by the way, based on DFA representations of regexes.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-08-20&lt;/a&gt;: &lt;a href="https://briancallahan.net/blog/20210814.html"&gt;Let&amp;rsquo;s write a compiler, part 1&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-08-21&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;However, we shouldn’t forget that we are still living in the stone age of computational science. Fortran was the Paleolithic, Python is the Neolithic, but we have to move on. &amp;mdash; &lt;a href="https://khinsen.wordpress.com/2014/05/10/exploring-racket/"&gt;Exploring Racket &lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-08-21&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The &amp;ldquo;true&amp;rdquo; program does nothing; it merely exits with a zero exit status. This can be done with an empty file that&amp;rsquo;s marked executable, and that&amp;rsquo;s what it was in the earliest unix system libraries. Such an empty file will be interpreted as a shell script that does nothing, and since it does this successfully, the shell exits with a zero exit status. &amp;mdash; &lt;a href="http://trillian.mit.edu/~jc/humor/ATT_Copyright_true.html"&gt;The /bin/true Command and Copyright&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-08-21&lt;/a&gt;: &lt;a href="https://www.oilshell.org/blog/2021/08/xargs.html"&gt;An Opinionated Guide to xargs&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-08-21&lt;/a&gt;: &lt;a href="https://alexander-hansen.dev/blog/benefits-of-not-using-an-ide"&gt;Benefits of not using an IDE&lt;/a&gt;. Main point as far as I&amp;rsquo;m concerned is that even light IDEs (e.g., VS Code) are too complex for what I really need to do. Git and debugger integration are a plus, though, but I already get that using Emacs or Vim.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-08-21&lt;/a&gt;: &lt;a href="https://www.radford.edu/~nokie/vim/spr08/beyond.html"&gt;Using Vim - Beyond the Basics&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-08-24&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;For making a viable Google competitor, I believe that ranking is a harder problem than indexing, but even if we just look at indexing, there are individual domains that contain on the order of one trillion pages we might want to index (like Twitter) and I&amp;rsquo;d guess that we can find on the order a trillion domains. If you try to configure any off-the-shelf search index to hold an index of some number of trillions of items to handle a load of, say, 1/100th Google&amp;rsquo;s load, with a latency budget of, say, 100ms (most of the latency should be for ranking, not indexing), I think you&amp;rsquo;ll find that this isn&amp;rsquo;t trivial. &amp;mdash; &lt;a href="https://danluu.com/sounds-easy/"&gt;I could do that in a weekend!&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-08-24&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;To a language designer, Racket is a programming language laboratory. That is, Racket comes with a unique collection of linguistic mechanisms that enable the quick construction of reliable languages, language fragments, and their composition. These tools are so easy to use that plain programmers can design a language after a little bit of instruction. So when a well-trained programmer decides that none of the available dialects is well-suited for a task, he designs a new dialect and writes his program in it. As Paul Hudak said, “the ultimate abstraction is a domain specific language.” &amp;mdash; &lt;a href="https://felleisen.org/matthias/Thoughts/Racket_is____.html"&gt;Racket is&amp;hellip;&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-08-24&lt;/a&gt;: &lt;a href="https://susam.in/cafe/euler-formula.html"&gt;Euler&amp;rsquo;s Formula&lt;/a&gt;. Looks like a nice Lisp-based website, right?&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-08-24&lt;/a&gt;: &lt;a href="https://jamespotter.dev/hacker-news-tech-trends/"&gt;Is Hacker News a Good Predictor of Future Tech Trends?&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-08-24&lt;/a&gt;: &lt;a href="https://andrewjudson.com/emacs/2021/08/23/emacs.html"&gt;Using Emacs in an IDE world&lt;/a&gt;. IDEs all look too complex to me. I am happy with fine-grained text editors like Emacs or (Neo)vim. Every time I try to use a light (VS Code) or not so light (IntelliJ stuff) IDE, I blow up after 10&amp;rsquo;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-08-25&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;BSD is designed. Linux is grown. Perhaps that&amp;rsquo;s the only succinct way to describe it, and possibly the most correct. &amp;mdash; &lt;a href="https://www.over-yonder.net/~fullermd/rants/bsd4linux/01"&gt;BSD vs Linux&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-08-25&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Emacs, for me, is essentially the definition of tooling alcoholism because I can happily spend hours configuring it without actually achieving much at all.&lt;br&gt; Some of this extends to tools like org-agenda too. There’s a temptation to have Emacs do it all and so I end up breaking my existing systems just to make them fit. &amp;mdash; &lt;a href="https://utf9k.net/blog/emacs-probably-isnt-right-for-me/"&gt;Emacs probably isn&amp;rsquo;t right for me&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-08-25&lt;/a&gt;: &amp;gt; o, why is the continuation monad the mother of all monads? The short answer is that, by enabling transparent inversion of control, it eliminates the need to sprinkle hooks for monad-specific code everywhere; normal (as much as anything involving delimited continuations can be “normal”) evaluation rules will be subverted as needed. &amp;mdash; &lt;a href="https://pvk.ca/Blog/2013/09/19/all-you-need-is-call-slash-cc/"&gt;All you need is call/cc&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-08-25&lt;/a&gt;: &lt;a href="https://ag91.github.io/blog/2021/08/22/moldable-emacs-vega-lite-nyxt-and-emacs-towards-sustainable-development/"&gt;Moldable Emacs: Vega-Lite, Nyxt and Emacs towards sustainable development&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-08-25&lt;/a&gt;: &lt;a href="https://matt.might.net/articles/red-black-delete/"&gt;The missing method: Deleting from Okasaki&amp;rsquo;s red-black trees&lt;/a&gt;. &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-08-25&lt;/a&gt;: &lt;a href="https://halestrom.net/darksleep/blog/046_cgi/"&gt;Why I recommend CGI instead of web frameworks&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-08-26&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Ranking is a farce. Apparent performance is actually attributable mostly to the system that the individual works in, not to the individual himself. &amp;mdash; &lt;a href="https://www.2uo.de/deming/"&gt;Statistical process control after W. Edwards Deming&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-08-26&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The web is a continuum. It&amp;rsquo;s like my old analog TV. It’s not exactly like DTV. Nor can it match it in some areas of functionality. It does, however, have other strengths. When digital TV fails, it fails completely. Analog TV, to use parlance of the web, degrades gracefully. The web could be similar, if we choose to make it so. It could be “the analog” web in contrast to “the digital” platforms. Perhaps in our hurry to replicate and mirror native platforms, we&amp;rsquo;re forgetting the killer strength of the web: universal accessibility. &amp;mdash; &lt;a href="https://blog.jim-nielsen.com/2017/the-analog-web/"&gt;The Analog Web&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-08-26&lt;/a&gt;: &lt;a href="https://mayakaczorowski.com/blogs/burnout"&gt;Burning out and quitting&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-08-26&lt;/a&gt;: &lt;a href="https://jdlm.info/articles/2017/05/01/compression-pareto-docker-gnuplot.html"&gt;Evaluating Compression with Pareto, Docker and Gnuplot&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-08-26&lt;/a&gt;: &lt;a href="https://jdlm.info/articles/2018/03/18/markov-decision-process-2048.html"&gt;The Mathematics of 2048: Optimal Play with Markov Decision Processes&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-08-26&lt;/a&gt;: &lt;a href="https://blog.mozilla.org/en/internet-culture/deep-dives/why-are-hyperlinks-blue/"&gt;Why are hyperlinks blue?&lt;/a&gt;. TL;DR Mosaic former project use blue in its release notes.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-08-27&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Mathematics has no side effects.&lt;br&gt; Math cannot modify the value of a variable&amp;ndash;either global or local. It cannot mutate an element in an array. And, a mathematical function always returns the same value for the same input.&lt;br&gt; The literal rendering of mathematics into code cannot contain side effects.&lt;br&gt; Mathematics is a purely functional language. &amp;mdash; &lt;a href="https://matt.might.net/articles/discrete-math-and-code/"&gt;Translating math into code&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;</description></item><item><title>Ubuntu on a MacBook Pro</title><link>https://aliquote.org/post/ubuntu-on-mac/</link><pubDate>Sun, 22 Aug 2021 20:46:17 +0200</pubDate><guid>https://aliquote.org/post/ubuntu-on-mac/</guid><description>&lt;p&gt;My son brought me his laptop which was no longer working. It&amp;rsquo;s this 2014 &lt;a href="https://aliquote.org/post/os-x-mavericks/"&gt;MacBook Pro&lt;/a&gt; which in retrospect was the best machine I had in the past 10 years or so. Now I would consider that my &lt;a href="https://aliquote.org/post/welcome-ubuntu/"&gt;Dell Latitude&lt;/a&gt; is probably the best machine I ever had, at least as far as the keyboard is concerned: The screen is okay, but nothing will ever beat a retina display; the hardware spec are close, except I go 2 additional hyper-threaded cores. Anyway, I don&amp;rsquo;t really know what was wrong but the computer kept restarting and it was impossible to update or reinstall the OS. I could have looked a little longer for the cause of the problem, at least on the internet, or taken it to a Mac repair center, but after all I don&amp;rsquo;t really care about restoring a Mac since I already have my 12&amp;quot; MacBook running Mojave.&lt;/p&gt;
&lt;p&gt;My first idea was to install OpenBSD as I was very happy with my &lt;a href="https://aliquote.org/post/welcome-openbsd/"&gt;previous attempt&lt;/a&gt; on a Windows machine. I grabbed the latest image available on OpenBSD FTP site, made a bootable USB stick, then tried to install the new OS. Then I remember than we need something like &lt;a href="http://refit.sourceforge.net/"&gt;reFit&lt;/a&gt; or something to install additional OSs on a Mac machine. It looks like it may be possible to build a specific bootable USB stick, as described in &lt;a href="https://www.tumfatig.net/20110901/run-openbsd-from-usb-on-macbook-pro/?utm_source=pocket_mylist"&gt;this post&lt;/a&gt;, but in my case I was not interested in keeping macOS on the MacBook, and I did not want to spend the rest of my afternoon with this mess. Hence I decided to look at what&amp;rsquo;s available on Ubuntu website. I&amp;rsquo;ve heard lot of people have been able to install Ubuntu on their MacBook, where generally everything was working fine except the wireless connection. I know that OpenBSD definitely does not support Apple wireless cards (see &lt;a href="https://jcs.org/"&gt;Joshua Stein&lt;/a&gt; technical reviews), but I am okay using good old wired connection at home.&lt;/p&gt;
&lt;p&gt;To my great surprise, the Ubuntu team proposes an automatic installer which takes care of everything, including the management of the boot loader. It&amp;rsquo;s kind of magic in reality. You just need to &lt;a href="https://ubuntu.com/tutorials/create-a-usb-stick-on-ubuntu"&gt;burn their installer on an USB stick&lt;/a&gt;, and plug it into your laptop. It worked right out of the box on my MacBook Pro, and I was able to test and then install Ubuntu in a few clicks. You&amp;rsquo;ll need to enable proprietary drivers to get the wireless connection, which is not available on first boot. Then, everything looks fine. Even fractional display works great (I choose 150% but we can get higher resolution compared to the best resolution available on the Mac).&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1669.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1669.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1670.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1670.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1671.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1671.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;To be fair, I didn&amp;rsquo;t do many tests and I didn&amp;rsquo;t even check if all the devices were working properly. Having wifi is already a big plus. I noticed that the sleep mode seems to work when the machine is on battery, but not on mains, and that the jack connector stays on despite the activation of the sleep mode. So I suspect that power performance can be improved, but I&amp;rsquo;ve optimized the power management on my Dell as well, so I&amp;rsquo;m not worried. The battery condition is at 70% of its maximum capacity (this is a 7 year old computer now) and it would be nice to change the screen glass.&lt;/p&gt;
&lt;p&gt;Now, I just have to install all my stack on this new machine, which I intend to use as a backup machine and a personal server at home.&lt;/p&gt;</description></item><item><title>The unquantified self #17</title><link>https://aliquote.org/post/unquantified-self-017/</link><pubDate>Thu, 19 Aug 2021 20:46:30 +0200</pubDate><guid>https://aliquote.org/post/unquantified-self-017/</guid><description>&lt;p&gt;I spent a few days last week at a friend&amp;rsquo;s house. On the program: swimming pool, ping-pong with my son. It was a bit strange to spend a week of vacation in the region where I was born but in a house other than one of my family&amp;rsquo;s homes. Anyway, it was nice to have a change of scenery, even if of course the health pass complicates everything lately.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1634.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1634.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/65013929193__BE6EAD1F-0627-46E6-92E9-9683D3926144.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/65013929193__BE6EAD1F-0627-46E6-92E9-9683D3926144.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;I upgraded to Mathematica 12, since there was a 40% discount last week. I spent half an hour customizing the UI since they changed the default font size (Source Code Pro 15), and this was also an opportunity to remove the Home bar as well as the status bar. I&amp;rsquo;ve been using Mathematica 11 for the past two years, I still need to review the latest addition to the language and libraries. You can expect a few posts in the future, especially since I decided to replace Stata with Mathematica as my only paid software for statistical computing.&lt;/p&gt;
&lt;p&gt;I wrote a few blog posts about my recent adoption of Neovim and its Lua-based config. I&amp;rsquo;m quite happy with my current settings: It remains minimalistic while allowing me to be even more productive when it comes to writing code or prose. That&amp;rsquo;s a good deal, IMO. I still have a wrap-up post to write, since I want to summarize my experience with other Neovim-only packages, and why I think fewer is better, provided you&amp;rsquo;re comfortable with built-in features.&lt;/p&gt;
&lt;p&gt;I have a few books to read while I&amp;rsquo;m on holidays. I cleaned up my apartment, and I am now very happy with the way it looks. Finally, I got a new home. Before going back to work, I&amp;rsquo;d like to make the most of it, with my son of course.&lt;/p&gt;
&lt;p&gt;I continue watching &lt;a href="https://strager.net/"&gt;Strager&lt;/a&gt;&amp;rsquo;s streams on Twitch, and I added a couple of other channels to my playlist. It takes me hours to watch all of them, but I like it and I learn a lot, more than I ever learned by just reading books in fact.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m almost done with Season 2 of &lt;a href="https://en.wikipedia.org/wiki/Homeland_(TV_series)"&gt;Homeland&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Random links from August</title><link>https://aliquote.org/post/random-links-august/</link><pubDate>Thu, 19 Aug 2021 11:19:30 +0200</pubDate><guid>https://aliquote.org/post/random-links-august/</guid><description>&lt;p&gt;Some not so random links collected while browsing the interweb this month.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://udel.edu/~mcdonald/mythintro.html"&gt;Myths of Human genetics&lt;/a&gt;, in which we learn to use cat coat instead of human genetics to teach basic genetic concepts.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://xpqz.github.io/learnapl/intro.html"&gt;Learning APL&lt;/a&gt;. Never got into APL, although I have deep memories of Jan de Leeuw&amp;rsquo;s implementation in R, but I thought this might interest some readers.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://blog.tecosaur.com/tmio/2021-07-31-citations.html"&gt;Introducing citations!&lt;/a&gt;, in which we learn that Org mode recently got a proper citation format. I tried a lot of backends (&lt;a href="https://aliquote.org/post/org-and-bibtex/"&gt;HTML&lt;/a&gt;, &lt;a href="https://aliquote.org/post/emacs-org-tufte-handout/"&gt;Pandoc&lt;/a&gt;) to get citations done right, but I was really missing such a native support.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://blog.noredink.com/post/658510851000713216/haskell-for-the-elm-enthusiast"&gt;Haskell for the Elm Enthusiast&lt;/a&gt;: &amp;ldquo;One way in which Haskell is different from both Elm and Rails is that it is not particularly opinionated. Often the Haskell ecosystem offers multiple different ways to do one particular thing.&amp;rdquo;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.fpcomplete.com/blog/philosophies-rust-haskell/"&gt;Philosophies of Rust and Haskell&lt;/a&gt;. I really like FPComplete blog posts, they are both instructive and they generally highlight nice features of a language or point to useful references. You may also like the &lt;a href="https://www.fpcomplete.com/haskell/syllabus/"&gt;Applied Haskell Syllabus&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.eff.org/deeplinks/2021/08/apples-plan-think-different-about-encryption-opens-backdoor-your-private-life"&gt;Apple&amp;rsquo;s Plan to &amp;ldquo;Think Different&amp;rdquo; About Encryption Opens a Backdoor to Your Private Life&lt;/a&gt;. A lot of public discussions and personal blog posts have been posted since I first read this article. Needless to say, I don&amp;rsquo;t really care since I no longer use Apple services other than for streaming some music in my living room, but this inevitably leads to questions, isn&amp;rsquo;t it? Apple is way long from the Microsoft &lt;a href="https://en.wikipedia.org/wiki/Embrace,_extend,_and_extinguish"&gt;EEE philosophy&lt;/a&gt; (because they always will have fewer users), still they persist in imposing new standards with the hope users will finally take it for granted &amp;mdash; this does not apply to this particular case, but I remember lot of decisions that were made that went the opposite way of what would have benefited the developers&amp;rsquo; community. See also &lt;a href="https://www.hackerfactor.com/blog/index.php?/archives/930-An-Apple-Affray.html"&gt;An Apple affray&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://kateto.net/network-visualization/"&gt;Static and dynamic network visualization with R&lt;/a&gt;, following a recommendation made by &lt;a href="https://f.briatte.org/"&gt;François&lt;/a&gt; on Twitter.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://philip.greenspun.com/materialism/early-retirement/"&gt;Early Retirement&lt;/a&gt;, in which we learn that retiring before 40 might be a good decision (assuming like the author that you have the financial means).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://expectationmax.github.io/2020/NeoVims-Language-Server-Client/"&gt;NeoVims built-in Language Server Client and why you should use it&lt;/a&gt;. Agree.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://stackoverflow.com/q/3951012/420055"&gt;When is memoization automatic in GHC Haskell?&lt;/a&gt;. TL;DR: GHC does not memoize functions.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I learned that there&amp;rsquo;s something like &lt;a href="https://explainshell.com/"&gt;ExplainShell&lt;/a&gt;, and it does a pretty nice job.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.makeuseof.com/what-is-netbsd/"&gt;NetBSD Explained: The Unix System That Can Run on Anything&lt;/a&gt;: &amp;ldquo;You can even find a port for the Sega Dreamcast game console. Many people looking for new software to run on older hardware find NetBSD attractive. If you can&amp;rsquo;t find a Linux distro to run on your old machines, it&amp;rsquo;s a good place to look.&amp;rdquo;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://ariadne.space/2021/08/13/gnu-nano-is-my-editor-of-choice/"&gt;GNU nano is my editor of choice&lt;/a&gt;. I think I&amp;rsquo;ve used nano twice in the past. Never liked it. Vi is available on every Linux/macOS systems, though.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.calnewport.com/blog/2016/12/18/on-digital-minimalism/"&gt;On Digital Minimalism&lt;/a&gt;. Late to the party &amp;mdash; I think I&amp;rsquo;ve read every single article on digital minimalism, still worth the read.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Less can be more&lt;/em&gt;. A natural consequence of the preceding principle is that you should avoid wasting your limited time and attention on low-value online activities, and instead focus on the much smaller number of activities that return the most value for your life. This is a basic 80/20 analysis: doing less, but focusing on higher quality, can generate more total value.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>ArXiving on August 2021</title><link>https://aliquote.org/post/arxiv-06/</link><pubDate>Sat, 07 Aug 2021 09:09:25 +0100</pubDate><guid>https://aliquote.org/post/arxiv-06/</guid><description>&lt;p&gt;Here are some papers that I read this week, in the CS and Stat category, plus random stuff that were mentioned on IRC or Hacker News.&lt;/p&gt;
&lt;h3 id="distributionsjl-definition-and-modeling-of-probability-distributions-in-the-juliastats-ecosystem-"&gt;Distributions.jl: Definition and Modeling of Probability Distributions in the JuliaStats Ecosystem (&lt;a href="https://arxiv.org/abs/1907.08611"&gt;https://arxiv.org/abs/1907.08611&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;I reinstalled Julia (v1.6.1) a few months ago. Yet I haven&amp;rsquo;t had enough time to learn the language again. I saw there&amp;rsquo;s a native plotting backend, which is really great, and that there&amp;rsquo;s some sort of JIT and on first load compiling capabilities. It is supposed to improve later execution of scripts or programs, but really on first launch it is sometimes a pain. However, the language looks much better now, although I keep thinking of the old Julia 0.4 that I used to use several years ago now. This article describes the &lt;a href="https://juliastats.org/Distributions.jl/stable/"&gt;Distributions.jl&lt;/a&gt; package, which is part of the &lt;a href="https://juliastats.org/"&gt;JuliaStats&lt;/a&gt; ecosystem. Note that this package allow to define and not only to manipulate pre-defined statistical distributions. Specifically, &amp;ldquo;a &lt;code&gt;Distribution&lt;/code&gt; is an abstract type that takes two parameters: a &lt;code&gt;VariateForm&lt;/code&gt; type which describes the dimensionality, and &lt;code&gt;ValueSupport&lt;/code&gt; type which describes the discreteness or continuity of the support.&amp;rdquo; I really need to give Julia another try, especially now that I can pretend to be a stat dilettante. And I would like to compare how Julia&amp;rsquo;s Distribution package compared to &lt;a href="https://www.boost.org/doc/libs/1_65_1/libs/math/doc/html/dist.html"&gt;Boost&lt;/a&gt;&amp;rsquo;s own routines.&lt;/p&gt;
&lt;h3 id="principled-practical-flexible-fast-a-new-approach-to-phylogenetic-factor-analysis-"&gt;Principled, practical, flexible, fast: a new approach to phylogenetic factor analysis (&lt;a href="https://arxiv.org/abs/2107.01246"&gt;https://arxiv.org/abs/2107.01246&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;Yet another attempt at modeling uncertainty using a latent variable approach. This is a dense article about phylogenetic analysis of high-dimensional phenotypes using &lt;a href="https://www.beast2.org/"&gt;BEAST&lt;/a&gt;. Usually, some form of data reduction is used to decrease the space and time complexity of model fitting on such dataset. As in other statistical domains, the two main approaches consist in using either PCA-based or FA-based techniques. In the later case, we talk about phylogenetic factor analysis (PFA), and the authors discuss two alternative approaches to the existing methods which scale quadratically with the number of taxa and remain intractable for large trees. As I said, it is dense, and it&amp;rsquo;s still being read on my side, especially since I&amp;rsquo;m looking into BEAST documentation at the same time. I only used it quickly two years ago before settling on the &lt;a href="https://aliquote.org/post/phylogenetic-python/"&gt;ETE toolkit&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="preserving-diversity-when-partitioning-a-geometric-approach-"&gt;Preserving Diversity when Partitioning: A Geometric Approach (&lt;a href="https://arxiv.org/abs/2107.04674"&gt;https://arxiv.org/abs/2107.04674&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;This article deals with the idea of partitioning a sample of individuals having different characteristics (which define their diversity as a whole) into subgroup exhibiting a similar diversity index. The diversity index considered here was introduced by Simpson, and it corresponds to the inverse probability that two individuals are from the same type when taken uniformly at random, with replacement, from the community of interest. The paper is rather challenging, since it exposes the mathematical aspects of optimal partitioning and algorithm-related approaches. The authors&amp;rsquo; conclusions are that a perfect partition exists only when the number of parts k divides the gcd of b. We also design a polynomial time algorithm for the case of r = 2 types.&lt;/p&gt;
&lt;h3 id="item-response-thresholds-models-"&gt;Item Response Thresholds Models (&lt;a href="https://arxiv.org/abs/2106.12784"&gt;https://arxiv.org/abs/2106.12784&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;I&amp;rsquo;m no longer into psychometrics &amp;ndash; last workshop I organized was in 2016, last blog post around 2013, but this article resonated to me since I&amp;rsquo;ve been working on IRT models for polytomous item for quite a long time. Problem such as item with threshold reversals, response saturation, and the like were common pitfall at that time. Go take a look if you are versed into modern psychometrics.&lt;/p&gt;
&lt;h3 id="comparison-of-canonical-correlation-and-partial-least-squares-analyses-of-simulated-and-empirical-data-"&gt;Comparison of Canonical Correlation and Partial Least Squares analyses of simulated and empirical data (&lt;a href="https://arxiv.org/abs/2107.06867"&gt;https://arxiv.org/abs/2107.06867&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;I haven&amp;rsquo;t heard about multi-block methods for a long time, and this paper discusses the result of extensive simulation using incremental subsampling to assess sensitivity and reliability of those two techniques. From the abstract, the take-away message reads as follows: First, for data reasonable within and between block structure, CCA and PLS give comparable results, with equivalent sensitivity and false positive rate. Second, if there are high correlations within either block, this can compromise the reliability of CCA results. This known issue of CCA can be remedied with PCA before cross-block calculation. However, this assumes that the PCA structure is stable for a given sample. Third, statistical significance by null hypothesis testing does not guarantee that the results are reproducible, even with large sample sizes. This final outcome suggests that researchers should routinely assess both statistical significance and reproducibility for their data. I&amp;rsquo;m not surprised by these conclusions, since the within- and cross-block correlation structures plays an important role in both models, and often help in deciding which method to chose. Further, my own &lt;a href="https://aliquote.org/post/multi-group-sem-pls/"&gt;past investigation&lt;/a&gt; were quite in agreement with the idea of varying stability of the results depending of these correlation structures and the sample size itself.&lt;/p&gt;
&lt;h3 id="calibrating-the-scan-statistic-with-size-dependent-critical-values-heuristics-methodology-and-computation-"&gt;Calibrating the scan statistic with size-dependent critical values: heuristics, methodology and computation (&lt;a href="https://arxiv.org/abs/2107.08296"&gt;https://arxiv.org/abs/2107.08296&lt;/a&gt;)&lt;/h3&gt;
&lt;h3 id="jags-nimble-stan-a-detailed-comparison-among-bayesian-mcmc-software-authors-"&gt;JAGS, NIMBLE, Stan: a detailed comparison among Bayesian MCMC software Authors (&lt;a href="https://arxiv.org/abs/2107.09357"&gt;https://arxiv.org/abs/2107.09357&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;It&amp;rsquo;s been a long time since I last used JAGS, and I didn&amp;rsquo;t install it on my last Macbook. I never heard of &lt;a href="https://r-nimble.org/what-is-nimble"&gt;NIMBLE&lt;/a&gt; before reading this review. Apparently it supports Bayesian models written in BUGS (or it can compile models written using R syntax to C++). The Stan documentation is among the best free textbook available nowadays. Apparently, the compile time for Stan and NIMBLE is of the same magnitude (2-3 minutes), but NIMBLE appears faster at the runtime level compared to the two other candidates. Finally, NIMBLE seems to perform quite good when it comes to estimating parameters for mixture models.&lt;/p&gt;
&lt;h3 id="on-matching-adjusted-indirect-comparison-and-calibration-estimation-"&gt;On matching-adjusted indirect comparison and calibration estimation (&lt;a href="https://arxiv.org/abs/2107.11687"&gt;https://arxiv.org/abs/2107.11687&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;The idea is that matching-adjusted indirect comparison, which is commonly used in RCTs to compare non-directly comparable pool of patients, share some resemblance with calibration estimation as used in survey sampling or epidemiological studies. This technique allows to use weights with minimal variance to balance covariates between the sample and target populations. In the case of RCTs, if a common treatment is available between the different samples, then it can be used as an anchor to analyze within-study differences, although this is not the main approach discussed in this article. The author provides extensive simulation results (R code available), and concludes that among the numerous approaches that can be used to construct appropriate weights, empirical likelihood weights allow to derive likelihood-based confidence intervals for treatment effect that are often more reliable than asymptotic ones.&lt;/p&gt;</description></item><item><title>My Tmux in 2021</title><link>https://aliquote.org/post/tmux-2021/</link><pubDate>Thu, 05 Aug 2021 12:40:43 +0200</pubDate><guid>https://aliquote.org/post/tmux-2021/</guid><description>&lt;p&gt;I&amp;rsquo;ve been using Tmux since 2013, and I wrote a blog post &lt;a href="https://aliquote.org/post/tmux-and-os-x/"&gt;at that time&lt;/a&gt;. I somehow revisited my setup &lt;a href="https://aliquote.org/post/customizing-iterm2/"&gt;last year&lt;/a&gt;, but it was still on macOS (and using iTerm2). In the mean time I switched to &lt;a href="https://sw.kovidgoyal.net/kitty/"&gt;Kitty&lt;/a&gt;, and I enjoyed using it for over a year and a half or so. It worked well in practice, I could use it on my Macbook and even on an OpenBSD machine. Same configuration, multiple OSs &amp;ndash; what else? The only thing that I was really missing was getting notification for new activity in other tabs, session management and keyboard-based copy-pasting.&lt;/p&gt;
&lt;p&gt;A few weeks ago, I decided to go back to the defaults (since default settings are often good, you know) and use Gnome terminal, which looks like a great terminal emulator, but without ligature support or multiplexing capabilities. Yet we can manage to get a comfy setup by adding Tmux on top of that. Hence I revised for the third time my Tmux config. I&amp;rsquo;ve been using Byobu on a remote server last year, but finally it didn&amp;rsquo;t bring me much more and I could do everything I wanted with Tmux alone. In fact, the only thing I really liked in Byobu was its ability to notify about available updates and reboot info so that my &lt;code&gt;status&lt;/code&gt; config file ended up with just those items:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;tmux_left&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;session&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;tmux_right&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;reboot_required updates_available load_average&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Since Byobu can use your screen or tmux config files, most of my settings remained in my &lt;code&gt;.tmux.conf&lt;/code&gt; file, and it acted as yet another backend.&lt;/p&gt;
&lt;p&gt;I am now using Tmux every day, and it goes as smoothly as when I was using Kitty, except that I now have a few additional optins: I can switch my theme easily thanks to Gnome terminal, and I can manage multiple sessions at the same time. I can also detach the current session and close Gnome terminal, I know I will be able to restore everything afterwards unless I rebooted Ubuntu. Here are the core components of my Tmux setup:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Enable terminal features: In roder to get 256 color support, underline and undercurl etc., you&amp;rsquo;ll need to tweak the terminal-related settings. I personally use this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;set&lt;/span&gt; -g default-terminal &lt;span class="s2"&gt;&amp;#34;tmux-256color&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;set&lt;/span&gt; -as terminal-overrides &lt;span class="s1"&gt;&amp;#39;,xterm*:Tc:sitm=\E[3m&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To enable colored underline and undercurl support, please refer to &lt;a href="https://github.com/folke/lsp-colors.nvim"&gt;lsp-colors&lt;/a&gt; README.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You can change the default prefix key, whether you&amp;rsquo;re a past screen user or a current Emacs addict. I am fine with &lt;code&gt;C-b&lt;/code&gt;, but I added a second prefix key since I have an almost dead key next to my Esc keys (&lt;code&gt;Esc&lt;/code&gt; and CAPS Lock):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set-option -g prefix2 œ
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You&amp;rsquo;ll likely need to copy-paste between different Tmux buffers. The combo &lt;code&gt;C-[, &amp;lt;space&amp;gt;, &amp;lt;enter&amp;gt;, C-]&lt;/code&gt; is kind of a mess, really. As a workaround, consider allowing Vim keybindings using the following settings:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;bind&lt;/span&gt; Y copy-mode
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;setw -g mode-keys vi
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -T copy-mode-vi v send -X begin-selection
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -T copy-mode-vi &lt;span class="s1"&gt;&amp;#39;C-v&amp;#39;&lt;/span&gt; send -X rectangle-toggle
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;set&lt;/span&gt; -g set-clipboard off
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel &lt;span class="s2"&gt;&amp;#34;xclip -i -selection clipboard&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Using these settings, you enter &amp;ldquo;copy-mode&amp;rdquo; by hitting &lt;code&gt;&amp;lt;prefix&amp;gt; + Y&lt;/code&gt;, then select text using Vim motion (e.g., &lt;code&gt;v2w&lt;/code&gt; to select the next two words, or &lt;code&gt;C-v v5hj&lt;/code&gt; to select a rectangular block of 5 chars x 2 lines), then copy and paste wherever you want using &lt;code&gt;y&lt;/code&gt; and &lt;code&gt;S-C-v&lt;/code&gt;. It&amp;rsquo;s all that simple, once you know it. I spent years tearing my hairs out before I discovered that it can that easy, really.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Other useful mappings, that you may need to adapt to your own taste: (Some are inspired by Byobu default keybindings.)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;bind&lt;/span&gt; Q command-prompt -I &lt;span class="s2"&gt;&amp;#34;htop&amp;#34;&lt;/span&gt; -p &lt;span class="s2"&gt;&amp;#34;Quick window command: &amp;#34;&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;new-window &amp;#39;%%&amp;#39;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;bind&lt;/span&gt; R source-file ~/.tmux.conf &lt;span class="se"&gt;\;&lt;/span&gt; display-message &lt;span class="s2"&gt;&amp;#34;Reloading config&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;bind&lt;/span&gt; Y copy-mode
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;bind&lt;/span&gt; &amp;gt; swap-pane -D &lt;span class="c1"&gt;# swap current pane with the next one&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;bind&lt;/span&gt; &amp;lt; swap-pane -U &lt;span class="c1"&gt;# swap current pane with the previous one&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;bind&lt;/span&gt; Up resize-pane -U &lt;span class="m"&gt;5&lt;/span&gt; &lt;span class="c1"&gt;# resize panes using arrow keys&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;bind&lt;/span&gt; Down resize-pane -D &lt;span class="m"&gt;5&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;bind&lt;/span&gt; Left resize-pane -L &lt;span class="m"&gt;5&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;bind&lt;/span&gt; Right resize-pane -R &lt;span class="m"&gt;5&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;bind&lt;/span&gt; m &lt;span class="nb"&gt;set&lt;/span&gt; -g mouse on &lt;span class="se"&gt;\;&lt;/span&gt; display &lt;span class="s2"&gt;&amp;#34;Mouse Mode: on&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;bind&lt;/span&gt; M &lt;span class="nb"&gt;set&lt;/span&gt; -g mouse off &lt;span class="se"&gt;\;&lt;/span&gt; display &lt;span class="s2"&gt;&amp;#34;Mouse Mode: off&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n F1 list-keys
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n F2 new-window
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n F3 previous-window
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n F4 next-window
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n F6 detach-client
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n F8 command-prompt &lt;span class="s2"&gt;&amp;#34;rename-window &amp;#39;%%&amp;#39;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-&lt;span class="p"&gt;&amp;amp;&lt;/span&gt; selectp -t :.+
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-$ split-window -h -c &lt;span class="s2"&gt;&amp;#34;#{pane_current_path}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-! split-window -f -l &lt;span class="m"&gt;15&lt;/span&gt; -c &lt;span class="s2"&gt;&amp;#34;#{pane_current_path}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-Left previous-window
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-Right next-window
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-a &lt;span class="k"&gt;select&lt;/span&gt;-layout even-vertical
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind-key -n M-A &lt;span class="k"&gt;select&lt;/span&gt;-layout even-horizontal
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;As for general settings, you may want to disable visual notification for activity in other windows but keep track of them more subtly using &lt;code&gt;set -g visual-activity off&lt;/code&gt; and &lt;code&gt;setw -g monitor-activity on&lt;/code&gt;, reduce &lt;code&gt;&amp;lt;Esc&amp;gt;&lt;/code&gt; timing for char codes using &lt;code&gt;set -sg escape-time 0&lt;/code&gt;, and automagically renumber window by setting &lt;code&gt;set -g renumber-windows on&lt;/code&gt; and, optionally, &lt;code&gt;setw -g allow-rename off&lt;/code&gt; if you don&amp;rsquo;t want your tab/window titles as fullwidth process names.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As for the status bar, it is usually a matter of opinion: I for one do not want to rely on external plugins (I can &lt;code&gt;uptime&lt;/code&gt; or &lt;code&gt;date&lt;/code&gt; myself in the terminal), and I want a minimalist design. Here we go:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2021-08-05-21-10-17.png"&gt;
&lt;/figure&gt;
&lt;p&gt;And here is the code:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;set&lt;/span&gt; -g status-interval &lt;span class="m"&gt;5&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;set&lt;/span&gt; -g status-justify left
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;set&lt;/span&gt; -g status-left &lt;span class="s2"&gt;&amp;#34;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;set&lt;/span&gt; -g status-position top
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;set&lt;/span&gt; -g status-right &lt;span class="s2"&gt;&amp;#34;#[fg=colour3] ♯#S &amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;! [ -z &amp;#34;$SSH_TTY&amp;#34; ]&amp;#39;&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;set -g status-right &amp;#34;#[fg=colour145] #(whoami)@#h #[fg=colour3] ♯#S &amp;#34;&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;set&lt;/span&gt; -g status-style &lt;span class="nv"&gt;fg&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;colour145
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;set&lt;/span&gt; -g window-status-current-format &lt;span class="s2"&gt;&amp;#34;#[fg=colour11,bg=colour3] #I &amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;set&lt;/span&gt; -g window-status-format &lt;span class="s2"&gt;&amp;#34;#[fg=colour145] #I &amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;set&lt;/span&gt; -g window-status-separator &lt;span class="s2"&gt;&amp;#34;#[fg=colour145]&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2021-08-22]&lt;/small&gt;&lt;br&gt;
If you decide to only show window number like in the above settings you may loose some critical information, especially zoomed pane (window activity keep being highlighted when setting &lt;code&gt;setw -g monitor-activity on&lt;/code&gt;). If you don&amp;rsquo;t want to add all flags (&lt;code&gt;#F&lt;/code&gt;), you can still replace &lt;code&gt;set -g window-status-current-format &amp;quot;#[fg=colour11,bg=colour3] #I &amp;quot;&lt;/code&gt; with &lt;code&gt;set -g window-status-current-format &amp;quot;#[fg=colour7,bg=colour4] #I#{?window_zoomed_flag,+,} &amp;quot;&lt;/code&gt;, or even highlight &lt;a href="https://unix.stackexchange.com/a/184255"&gt;other flags&lt;/a&gt; using convenient marks. I updated my config to display zoomed panes since I use this a lot and I sometimes forgot about them.
&lt;/div&gt;
&lt;p&gt;Finally, beside personal keybindings, here are some useful builtin keybindings I keep using regularly:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;prefix&amp;gt; + z&lt;/code&gt; to zoom in a specific pane (much more convenient than tweaking pane layout, IMHO);&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;prefix&amp;gt; + s&lt;/code&gt; or &lt;code&gt;&amp;lt;prefix&amp;gt; + w&lt;/code&gt; to get a quick overview of my current sessions and windows;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;prefix&amp;gt; + o&lt;/code&gt; to cycle between panes in current windows (instead of &lt;code&gt;&amp;lt;prefix&amp;gt; +&lt;/code&gt; arrow keys);&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;prefix&amp;gt; + !&lt;/code&gt; to convert current pane to a proper window (which is almost the equivalent of &lt;code&gt;:tab split&lt;/code&gt; in Vim);&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;prefix&amp;gt; + )&lt;/code&gt; to cycle between existing sessions (technically, this is &amp;ldquo;move to next session&amp;rdquo;, but I don&amp;rsquo;t have that much sessions opened at the same time);&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;prefix&amp;gt; + $&lt;/code&gt; to rename a session but this really is an edge case.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I sometimes want to create a new session and attach the current window to it. Here is how we can do: Create a new session using &lt;code&gt;&amp;lt;prefix&amp;gt; + :new&lt;/code&gt;, then &lt;code&gt;&amp;lt;prefix&amp;gt; + :move-window -s #name:#pane&lt;/code&gt;, where &lt;code&gt;#name&lt;/code&gt; is the name of the current session in which the &lt;code&gt;#pane&lt;/code&gt; number is. A typical command is &lt;code&gt;:move-window -s main:2&lt;/code&gt; to move &amp;ldquo;pane number 2&amp;rdquo; (from session &amp;ldquo;main&amp;rdquo;) to the newly created session.&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s it! I hope you will enjoy Tmux.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2022-04-23]&lt;/small&gt;&lt;br&gt;
Little updates here and there happen in the mean time. Latest config can be found here: &lt;a href="https://aliquote.org/pub/tmux-2022-04-23.conf"&gt;tmux-2022-04-23.conf&lt;/a&gt;. Rename it to &lt;code&gt;$HOME/.tmux.conf&lt;/code&gt;, and enjoy all the customizations!!
&lt;/div&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Hiatus Kaiyote • &lt;em&gt;Red Room&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Recently</title><link>https://aliquote.org/post/recently-august-2021/</link><pubDate>Mon, 02 Aug 2021 13:18:44 +0200</pubDate><guid>https://aliquote.org/post/recently-august-2021/</guid><description>&lt;p&gt;It&amp;rsquo;s been several months that I switched to a Linux distro and left macOS behind me. It may look like I needed to take a break, try a little thing to procrastinate a bit more use a real keyboard (ಠ‿ಠ), and then come back. No, it was really a thing. The OS I have been loving for quite a few years &amp;ndash; 15 years, for what matter, is probably going in the wrong direction. &lt;a href="https://morrick.me/archives/9368"&gt;Riccardo Morri&lt;/a&gt; will have more to say than me:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The utter user-interface butchery happening to Safari on the Mac is once again the work of people who put iOS first. People who by now think in iOS terms. People who view the venerable Mac OS user interface as an older person whose traits must be experimented upon, plastic surgery after plastic surgery, until this person looks younger. Unfortunately the effect is more like this person ends up looking… weird.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I can&amp;rsquo;t tell because I no longer update my Macbook (still on Mojave, FWIW), but how Safari will look like in the upcoming release of Monterey (what a name, really!) is pretty awful. I really don&amp;rsquo;t feel like I would like to use my personal computer as the iPhone I use since 15 years. Really? Is this something like the dream of the tablets of the 2010s that has never came to life?! Seriously, Apple&amp;hellip; Of potential interest too: &lt;a href="https://tidbits.com/2021/07/30/apple-is-now-an-antifragile-company/"&gt;Apple Is Now an Antifragile Company&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Neovim is a terrible thing, seriously. Now that I upgraded my config, I came close to 60 ms of startup time, as before with a plain VimL config. I still miss &lt;a href="https://github.com/sheerun/vim-polyglot"&gt;polyglot&lt;/a&gt; a little bit, but the benefits are so huge: As described in my &lt;a href="https://aliquote.org/post/modern-neovim/"&gt;series&lt;/a&gt; of Neovim-related blog posts, I got a fuzzy finder, LSP stuff and completion at no cost by just switching to the nightly version of Neovim and installing a few plugins. I don&amp;rsquo;t need really more since I prefer to use builtin commands. And since I&amp;rsquo;m not a huge fan of syntax highlight, I don&amp;rsquo;t really mind if some languages (e.g., Lisp) are not as well handled as they were previously. This really is a big deal compared to Emacs. Now I can really write text or code, just text or code, and don&amp;rsquo;t worry about &lt;a href="https://blog.frantic.im/all/todo-apps-are-meant-for-robots/"&gt;anything lees&lt;/a&gt;. I keep finding interesting &lt;a href="https://blog.trk.in.rs/2017/06/05/vim-theory/"&gt;blog posts&lt;/a&gt; along the way, yet my RSS list includes more Emacs-related sources than Vim ones.&lt;/p&gt;
&lt;p&gt;By the way, I stopped using Kitty and switched back to Gnome Terminal. The latter doesn&amp;rsquo;t support splits, nor ligatures, but that&amp;rsquo;s okay I guess, especially given that I can rely on Tmux to solve the first issue. I can switch to fullscreen mode as easily as when using Firefox, using &lt;code&gt;F11&lt;/code&gt;, once the shortcut is properly defined (actually, it was defined as &lt;code&gt;S-Up&lt;/code&gt; for me). This may seem a little bit odd, but the top bar in Gnome shell look really huge, compared to the desktop menu bar, and sometimes I feel like I just want to use the whole screen, disregarding the menu bar with time and notification list. Well, I mean, unlike Riccardo I may just worry about every pixel, whether it concerns the vertical or horizontal axis (but I never end up with more than 6-8 tabs opened in my web browser).&lt;/p&gt;
&lt;p&gt;For the time being, I&amp;rsquo;m on holidays, and before I leave my apartment to get some fresh air for a few days, I&amp;rsquo;ll keep reading rants on Reddit (last one was &lt;a href="https://www.reddit.com/r/neovim/comments/lzswde/rant_neovim_is_less_productive_than_vs_code/"&gt;Rant: Neovim is less productive than VS Code&lt;/a&gt;), new blog posts but also older ones like &lt;a href="https://stevelosh.com/blog/2018/08/a-road-to-common-lisp/"&gt;A Road to Common Lisp&lt;/a&gt;, &lt;a href="https://lisp-journey.gitlab.io/pythonvslisp/"&gt;Python VS Common Lisp, workflow and ecosystem&lt;/a&gt;. I also have a pile of technical and recreational papers and books to read for when I&amp;rsquo;m back.&lt;/p&gt;</description></item><item><title>Vim on steroid (5/n)</title><link>https://aliquote.org/post/vim-fuzzy-finder/</link><pubDate>Fri, 30 Jul 2021 20:15:26 +0200</pubDate><guid>https://aliquote.org/post/vim-fuzzy-finder/</guid><description>&lt;p&gt;« &lt;a href="https://aliquote.org/post/neovim-useful-plugins/"&gt;Previous post&lt;/a&gt; in this series&lt;br&gt;
» &lt;a href="https://aliquote.org/post/neovim-wrapup/"&gt;Next post&lt;/a&gt; in this series&lt;/p&gt;
&lt;p&gt;I have been a happy user of &lt;a href="https://github.com/junegunn/fzf.vim"&gt;fzf.vim&lt;/a&gt; for the past few months. I use &lt;a href="https://github.com/junegunn/fzf"&gt;fzf&lt;/a&gt; in my Terminal as well, so it looked natural to me to use it as a fuzzy finder in Vim too. It is quite straightforward to configure, and it works perfectly well. Zero dependencies, other than &lt;code&gt;fzf&lt;/code&gt; itself, and it provides a bunch of options to manage your buffers, files in project, recent files, git commits, and more. The natural replacement for &lt;code&gt;fzf.vim&lt;/code&gt; appears to be &lt;a href="https://github.com/nvim-telescope/telescope.nvim"&gt;Telescope&lt;/a&gt; in Neovim. It comes as full featured as &lt;code&gt;fzf.vim&lt;/code&gt;, but also supports floating windows and additional extensions, which are installed either as separate plugins or as opt-in packages.&lt;/p&gt;
&lt;p&gt;I don&amp;rsquo;t really like floating windows, but I now find them useful when it comes to previewing results for live grepping in a project or fuzzy finding expressions in the current buffer. I like to think of fuzzy searches using Telescope as &amp;ldquo;natural extensions&amp;rdquo; of Vim&amp;rsquo;s builtin facilities: &lt;code&gt;*&lt;/code&gt;, &lt;code&gt;/&lt;/code&gt;, and &lt;code&gt;:Grep&lt;/code&gt;. I remapped each of these shortcuts to their telescope counterparts, as discussed in my previous post (I use &lt;code&gt;?&lt;/code&gt; for &lt;code&gt;:Grep&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;What&amp;rsquo;s really nice is that you can configure each tool to use a separate layout, for instead you could tell Telescope to use a &amp;ldquo;dropdown&amp;rdquo; menu for &lt;code&gt;find_files&lt;/code&gt; while using a full &amp;ldquo;Preview+Result+Query&amp;rdquo; floating window for &lt;code&gt;live_grep&lt;/code&gt;. After a week of using my new config, I decided that I still prefer a 10% high window at the bottom of Neovim to find files, recent items or buffers, while I use floating window for queries for which viewing results is really informative (e.g., context, exact match and surroundings). Here is how I do:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lua" data-lang="lua"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;telescope&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;setup&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;defaults&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vimgrep_arguments&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;rg&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;--color=never&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;--no-heading&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;--with-filename&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;--line-number&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;--column&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;--smart-case&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;selection_caret&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;» &amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;entry_prefix&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34; &amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;initial_mode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;insert&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;sorting_strategy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;ascending&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;layout_strategy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;vertical&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;file_ignore_patterns&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;color_devicons&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;use_less&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;set_env&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;COLORTERM&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;truecolor&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;pickers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buffers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;sort_lastused&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;-- theme = &amp;#34;dropdown&amp;#34;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;theme&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;ivy&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;layout_config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;height&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;previewer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;mappings&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&amp;lt;c-d&amp;gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;telescope.actions&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;delete_buffer&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&amp;lt;c-d&amp;gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;telescope.actions&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;delete_buffer&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;find_files&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;theme&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;ivy&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;layout_config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;height&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;previewer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;oldfiles&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;sort_lastused&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;theme&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;ivy&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;layout_config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;height&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;previewer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;command_history&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;sort_lastused&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;theme&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;ivy&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;layout_config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;height&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;previewer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;current_buffer_fuzzy_find&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;previewer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The key here is to ask for the &amp;ldquo;ivy&amp;rdquo; layout, which is as close as possible to what I was exposed to when using &lt;code&gt;fzf.vim&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;I also like the option of deleting buffers from the buffer list using &lt;code&gt;C-d&lt;/code&gt;. What I especially like, though, is the fact that you can preview Grep hits in multiple buffers without having them opened and listed in the buffer list. This is pretty cool compared to my previous solution, which relied on a combination of Grep and the Quickfix window. Also, Telescope is able to display the Quickfix list in its own floating window. I use this functionality a lot in combination with &lt;a href="https://github.com/folke/trouble.nvim"&gt;lsp-trouble&lt;/a&gt; or &lt;code&gt;nvim-lsp&lt;/code&gt; for diagnostics.&lt;/p&gt;</description></item><item><title>Neovim useful plugins (4/n)</title><link>https://aliquote.org/post/neovim-useful-plugins/</link><pubDate>Thu, 29 Jul 2021 20:30:45 +0200</pubDate><guid>https://aliquote.org/post/neovim-useful-plugins/</guid><description>&lt;p&gt;« &lt;a href="https://aliquote.org/post/vim-lsp/"&gt;Previous post&lt;/a&gt; in this series&lt;br&gt;
» &lt;a href="https://aliquote.org/post/vim-fuzzy-finder/"&gt;Next post&lt;/a&gt; in this series&lt;/p&gt;
&lt;p&gt;Since I decided to keep my setup as lightweight as possible, and to rely on (Neo)&lt;a href="https://www.moolenaar.net/habits.html"&gt;vim builtins&lt;/a&gt; as much as I can, I have no other packages than those listed in the very first post of this series. However, I keep looking at new Neovim-related plugins, written in Lua since I expect them to be faster and easier to integrate than their Vim-only counterparts. For a full list of awesome (or not) plugins, you can check out this &lt;a href="https://github.com/rockerBOO/awesome-neovim"&gt;list hosted on GitHub&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Here is a list of plugins that I am particularly interested in:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://github.com/windwp/nvim-autopairs"&gt;nvim-autopairs&lt;/a&gt;: I&amp;rsquo;ve been using &lt;a href="https://github.com/Raimondi/delimitMate"&gt;delimitMate&lt;/a&gt; for a long time, then &lt;a href="https://github.com/jiangmiao/auto-pairs"&gt;auto-pairs&lt;/a&gt;. Each time I had to write custom exceptions because I write a lot of text files and sometimes Lisp. I ended up with this poor man version, which has the benefit of not providing systematic but most of the time useless completion for single and double quotes, though:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-vim" data-lang="vim"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;inoremap&lt;/span&gt; ` ``&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;left&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;inoremap&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="p"&gt;()&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;left&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;inoremap&lt;/span&gt; { {}&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;left&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;inoremap&lt;/span&gt; {&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; {&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;}&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ESC&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;O&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This plugin, however, looks like the new kid on the block for Neovim users apparently. At present, I prefer to type parenthesis, brackets and the like myself, but I may change my mind.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://github.com/blackCauldron7/surround.nvim"&gt;surround.nvim&lt;/a&gt;: Again, I used to use a handmade simplified version of Tim Pope&amp;rsquo;s awesome plugin, with the following bindings:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-vim" data-lang="vim"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;vnoremap&lt;/span&gt; &lt;span class="nx"&gt;_&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34; :call chl#text#surround(&amp;#39;&amp;#34;&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;, &amp;#39;&lt;/span&gt;&amp;#34;&amp;#39;&lt;span class="p"&gt;)&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;vnoremap&lt;/span&gt; &lt;span class="nx"&gt;_&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39; :call chl#text#surround(&amp;#34;&amp;#39;&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;, &amp;#34;&lt;/span&gt;&amp;#39;&amp;#34;&lt;span class="p"&gt;)&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;vnoremap&lt;/span&gt; &lt;span class="nx"&gt;_&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; :&lt;span class="nx"&gt;call&lt;/span&gt; &lt;span class="nx"&gt;chl&lt;/span&gt;#&lt;span class="nx"&gt;text&lt;/span&gt;#&lt;span class="nx"&gt;surround&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;(&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;)&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;vnoremap&lt;/span&gt; &lt;span class="nx"&gt;_&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt; :&lt;span class="nx"&gt;call&lt;/span&gt; &lt;span class="nx"&gt;chl&lt;/span&gt;#&lt;span class="nx"&gt;text&lt;/span&gt;#&lt;span class="nx"&gt;surround&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;`&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;`&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;vnoremap&lt;/span&gt; &lt;span class="nx"&gt;_&lt;/span&gt;[ :&lt;span class="nx"&gt;call&lt;/span&gt; &lt;span class="nx"&gt;chl&lt;/span&gt;#&lt;span class="nx"&gt;text&lt;/span&gt;#&lt;span class="nx"&gt;surround&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;[&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;]&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;vnoremap&lt;/span&gt; &lt;span class="nx"&gt;_&lt;/span&gt;{ :&lt;span class="nx"&gt;call&lt;/span&gt; &lt;span class="nx"&gt;chl&lt;/span&gt;#&lt;span class="nx"&gt;text&lt;/span&gt;#&lt;span class="nx"&gt;surround&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;{&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;}&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It does more or less what I generally need to do: surround one or two words using specific delimiters. However, it sucks for s-expressions, and I would like a more reliable way to handle barfing and slurping, or to quickly capture forms or s-exp, without the hassle of the &lt;a href="https://github.com/guns/vim-sexp"&gt;vim-sexp&lt;/a&gt; plugin. This new plugin looks interesting, though, as it provides two modes (sandwich and surround) in normal mode, but also special keybinding in insert mode.&lt;/p&gt;
&lt;p&gt;Here is the function I use by the way:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-vim" data-lang="vim"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;&amp;#34;&amp;#34; https://vim.fandom.com/wiki/Surround_selection_with_text&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="p"&gt;!&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt;#&lt;span class="nx"&gt;surround&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;s2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;range&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;exe&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;normal vgvmboma\&amp;lt;Esc&amp;gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;normal&lt;/span&gt;&lt;span class="p"&gt;!&lt;/span&gt; `&lt;span class="nx"&gt;a&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;lineA&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;line&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;columnA&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;col&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;normal&lt;/span&gt;&lt;span class="p"&gt;!&lt;/span&gt; `&lt;span class="nx"&gt;b&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;lineB&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;line&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;columnB&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;col&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nx"&gt;lineA&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;lineB&lt;/span&gt; &lt;span class="p"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;lineA&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="nx"&gt;lineB&lt;/span&gt; &amp;amp;&amp;amp; &lt;span class="nx"&gt;columnA&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;columnB&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;normal&lt;/span&gt;&lt;span class="p"&gt;!&lt;/span&gt; &lt;span class="nx"&gt;mc&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;normal&lt;/span&gt;&lt;span class="p"&gt;!&lt;/span&gt; `&lt;span class="nx"&gt;amb&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;normal&lt;/span&gt;&lt;span class="p"&gt;!&lt;/span&gt; `&lt;span class="nx"&gt;cma&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;endif&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;exe&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;normal `ba&amp;#34;&lt;/span&gt; . &lt;span class="nx"&gt;a&lt;/span&gt;:&lt;span class="nx"&gt;s2&lt;/span&gt; . &lt;span class="s2"&gt;&amp;#34;\&amp;lt;Esc&amp;gt;`ai&amp;#34;&lt;/span&gt; . &lt;span class="nx"&gt;a&lt;/span&gt;:&lt;span class="nx"&gt;s1&lt;/span&gt; . &lt;span class="s2"&gt;&amp;#34;\&amp;lt;Esc&amp;gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;endfunction&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2021-07-30]&lt;/small&gt;&lt;br&gt;
I finally installed the plugin and gave it a try. The &lt;code&gt;s&amp;lt;char&amp;gt;&lt;/code&gt; for visual selection and &lt;code&gt;ys{motion}{char}&lt;/code&gt; are quite handy, and in the former case the cursor moves to the previous position in the jump list apparently. Also, this only works for all sort of brackets, not special characters like back ticks &amp;mdash; you could probably add it to the &lt;code&gt;pairs&lt;/code&gt; option (a Lua&amp;rsquo;s dictionary for nested and linear pairs of surrounding characters), but it didn&amp;rsquo;t work for me. Finally, the prefix (&amp;ldquo;s&amp;rdquo;) can be changed if necessary, and you can use Tim Pope&amp;rsquo;s mappings as well. For what is worth, I&amp;rsquo;ll keep using my own shortcuts.
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://github.com/vhyrro/neorg"&gt;neorg&lt;/a&gt;: As a long time Org user, I was intrigued by this new plugin, which is not completely a rewrite of Emacs Org mode for (Neo)vim but introduces some new features, like simplified key mapping, improved code blocks with Treesitter integration, and builtin completion. It looks amazing, although I&amp;rsquo;m not sure I will switch to the new &amp;ldquo;.norg&amp;rdquo; filetype for the time being. In fact, I barely write any Org document these days, except those I drafted last year that I hope to complete one day or the other, this year.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://github.com/shaunsingh/nord.nvim"&gt;nord.nvim&lt;/a&gt;: I no longer use the wonderful Nord theme since I switched back to a light theme (every app, not only CLI tools). I have a copy of the original Nord theme in my &lt;code&gt;colors/&lt;/code&gt; directory, but I barely use it (only when my eyes are to tired at night). However, this theme adds support for a lot of plugins I currently use, and it seems to treesitter-aware.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://github.com/rcarriga/vim-ultest"&gt;vim-ultest&lt;/a&gt;: I&amp;rsquo;ve been using &lt;a href="https://github.com/vim-test/vim-test"&gt;vim-test&lt;/a&gt; on occasional basis in the past, but since I&amp;rsquo;m not a TDD guy, nor a heavy test writer for my scripts, I stopped there. This plugin provides several enhancement to vim-test by exploiting the sign column and floating window, like &lt;a href="https://github.com/lewis6991/gitsigns.nvim"&gt;gitsigns&lt;/a&gt; or LSP diagnostics, and by allowing a running process to be attached for debugging (e.g., using Pdb in the case of Python).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Micro posting in July</title><link>https://aliquote.org/post/micro-07-2021/</link><pubDate>Wed, 28 Jul 2021 14:33:21 +0200</pubDate><guid>https://aliquote.org/post/micro-07-2021/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-07-02&lt;/a&gt;: It looks like &lt;a href="https://github.com/neovim/neovim/releases/tag/v0.5.0"&gt;Neovim 0.5&lt;/a&gt; (stable) is finally out. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-07-02&lt;/a&gt;: &lt;a href="https://drossbucket.com/2021/06/30/hacker-news-folk-wisdom-on-visual-programming/"&gt;Hacker News folk wisdom on visual programming&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-07-02&lt;/a&gt;: &lt;a href="https://github.com/reacherhq/check-if-email-exists"&gt;check-if-email-exists&lt;/a&gt;: Check if an email address exists without sending any email, written in Rust.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-07-05&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;For most of us, it&amp;rsquo;s not a switch to Apple, but a return. Hard as this was to believe in the mid 90s, the Mac was in its time the canonical hacker&amp;rsquo;s computer. &amp;mdash; &lt;a href="http://paulgraham.com/mac.html"&gt;Return of the Mac&lt;/a&gt;Things keep changing, right? At least for the last 12 years or so&amp;hellip;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-07-05&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Scenes are shot out of temporal order, multiple times, and different bits are picked from this camera and that camera. Without examining the analogy too closely, this is similar to how different git commits might be viewed. Once you have everything in the “can” (repository) you go back and in post-production, you edit and splice everything together to form individual cuts and scenes, sometimes perhaps even doing some digital editing of the resulting product. &amp;mdash; &lt;a href="https://sethrobertson.github.io/GitBestPractices/"&gt;Commit Often, Perfect Later, Publish Once: Git Best Practices&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-07-05&lt;/a&gt;: Great mix for your favorite MP3 manager: &lt;a href="https://www.musicforprogramming.net/"&gt;https://www.musicforprogramming.net/&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-07-05&lt;/a&gt;: &lt;a href="https://cstack.github.io/db_tutorial/"&gt;How Does a Database Work?&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-07-05&lt;/a&gt;: &lt;a href="https://mazzo.li/posts/haskell-backprop-short.html"&gt;Quick and dirty backpropagation in Haskell&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-07-06&lt;/a&gt;: &lt;a href="https://www.rushiagr.com/blog/2016/06/16/everything-you-need-to-know-about-tmux-copy-pasting-ubuntu/"&gt;Everything you need to know about Tmux copy paste&lt;/a&gt; on Ubuntu.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-07-08&lt;/a&gt;: &lt;a href="https://begriffs.com/posts/2021-07-04-shared-libraries.html"&gt;Dynamic linking best practices&lt;/a&gt;. Lot of useful and interesting stuff in this article.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-07-08&lt;/a&gt;: &lt;a href="https://observablehq.com/@ploeh/fractal-hex-flowers"&gt;Fractal hex flowers&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-07-09&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/64690662794__3D1A59D9-B1AF-4BB0-8CC1-09B4BEC63588.JPG" alt="img"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-07-09&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;(&amp;hellip;) the biggest stylistic change that’s happened in GHC recently, I think, is the move towards this “trees that grow” idea. Now, trees that grow, you can search for that keyword as a paper on my homepage about it, is a way to make sort of extensible data types using Haskell. This is really useful for Haskell’s abstract syntax tree. Haskell has a very large concrete syntax and so, correspondingly, has a large abstract syntax, that is the internal data type that describes Haskell programs after you’ve passed them has dozens of data types and hundreds of constructors and GHC then, during its renaming and type checking phase, decorates this tree with lots of additional stuff: types and scopes, and all sorts of extra stuff get gets added onto the tree. So, at first, we had a tree that was just GHC specific, but then we realized increasingly that other people would like to parse Haskell themselves for other purposes, so what we really wanted was a sort of base library that contained the core abstract syntax tree with its dozens of data types and hundreds of constructors and then some way for GHC to customize that tree, to add all its decorations and that’s the trees that grow idea and that lives off type families. We use both type families and data families quite extensively to power the trees that grow idea. It’s not what type families and data families were originally intended for, you can use them for all sorts of things, but it’s a major application within GHC, and it’s pushed a sort of stylistic change through the compiler. &amp;mdash; &lt;a href="https://serokell.io/blog/past-and-present-of-haskell"&gt;Past and Present of Haskell: Interview with Simon Peyton Jones&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-07-10&lt;/a&gt;: &lt;a href="https://blog.feabhas.com/2021/07/cmake-part-1-the-dark-arts/?utm_source=pocket_mylist"&gt;CMake Part 1 – The Dark Arts&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-07-10&lt;/a&gt;: &lt;a href="https://blog.lojic.com/2020/12/26/comprehensions-in-julia.html"&gt;Comprehensions in Julia&lt;/a&gt;. &lt;code&gt;#julia&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-07-10&lt;/a&gt;: &lt;a href="https://www.cs.usfca.edu/~galles/visualization/Algorithms.html"&gt;Data Structure Visualizations&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-07-11&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;What’s worse is the hardware and high-level language improvement are only improvements to accidental complexity – these things don’t actually help us with the inherent complexity of our jobs. Meaning we still fail at the hard parts. &amp;mdash; &lt;a href="https://two-wrongs.com/software-engineering-what-has-changed-since-1968"&gt;Software Engineering: What Has Changed Since 1968?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-07-11&lt;/a&gt;: &lt;a href="https://corecursive.com/brian-kernighan-unix-bell-labs1/"&gt;The Birth of UNIX &amp;mdash; With Brian Kernighan&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-07-11&lt;/a&gt;: &lt;a href="https://pizzahack.eu/fossil/thunderchez/home"&gt;thunderchez&lt;/a&gt;: Libraries for Chez Scheme productivity (via &lt;a href="https://mdhughes.tech/2021/07/04/script-the-scheme-repl-with-expect/"&gt;Mark Damon Hughes&lt;/a&gt;). &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-07-13&lt;/a&gt;: Vim tip of the day: for the visual block currently selected, &lt;code&gt;g C-g&lt;/code&gt; will provide word counts among other things. And there&amp;rsquo;s &lt;a href="https://vim.fandom.com/wiki/Word_count"&gt;more to see&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-07-19&lt;/a&gt;: &lt;a href="https://looking-glass.io/"&gt;Looking Glass&lt;/a&gt; is an open source application that allows the use of a KVM (Kernel-based Virtual Machine) configured for VGA PCI Pass-through without an attached physical monitor, keyboard or mouse.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-07-19&lt;/a&gt;: &lt;a href="https://github.com/afnanenayet/diffsitter"&gt;diffsitter&lt;/a&gt;: A tree-sitter based AST difftool to get meaningful semantic diffs.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-07-20&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_1602.JPG" alt="img"&gt;&lt;small&gt;Growing on the balcony&amp;hellip;&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-07-20&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;No deadlines, no quarterly goals, no milestones. &amp;mdash; &lt;a href="https://typesense.org/blog/the-unreasonable-effectiveness-of-just-showing-up-everyday/?utm_source=pocket_mylist"&gt;The unreasonable effectiveness of just showing up everyday&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-07-20&lt;/a&gt;: &lt;a href="https://stopa.io/post/222"&gt;Risp (in (Rust) (Lisp))&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-07-22&lt;/a&gt;: TIL about SQL &lt;a href="https://rubenerd.com/sql-limit-versus-fetch-first-rows/"&gt;&lt;code&gt;FETCH FIRST&lt;/code&gt;&lt;/a&gt;. &lt;code&gt;#database&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-07-23&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I don’t have to waste time troubleshooting a package that isn’t integrating with the system properly, or looks like it’s straight out of 1995 because no theming is applied for some unknown reason. &amp;mdash; &lt;a href="https://kevq.uk/a-sombre-goodbye-to-linux/"&gt;A Sombre Goodbye To Linux&lt;/a&gt;I did go pretty much in the reverse direction, from Mac to Linux, last year, but obviously I have much less demanding graphic needs since I spend most of my time in a terminal with command line tools.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-07-23&lt;/a&gt;: &lt;a href="http://www.lispology.com/show?3G0S"&gt;Using different programming styles in Lisp&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-07-23&lt;/a&gt;: &lt;a href="https://zignar.net/2021/07/09/why-haskell-became-my-favorite-scripting-language/"&gt;Why Haskell became my favorite scripting language&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-07-26&lt;/a&gt;: &lt;a href="https://waylonwalker.com/tmux-nav-2021/"&gt;How I navigate tmux in 2021&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-07-26&lt;/a&gt;: &lt;a href="https://rc2e.com/"&gt;R Cookbook, 2nd Edition&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>Neovim and LSP (3/n)</title><link>https://aliquote.org/post/vim-lsp/</link><pubDate>Tue, 27 Jul 2021 20:19:08 +0200</pubDate><guid>https://aliquote.org/post/vim-lsp/</guid><description>&lt;p&gt;« &lt;a href="https://aliquote.org/post/vim-shortcuts/"&gt;Previous post&lt;/a&gt; in this series&lt;br&gt;
» &lt;a href="https://aliquote.org/post/neovim-useful-plugins/"&gt;Next post&lt;/a&gt; in this series&lt;/p&gt;
&lt;p&gt;Next in this series on using a modern Neovim setup, let&amp;rsquo;s talk about the built-in Language Server Protocol (LSP) facilities.&lt;/p&gt;
&lt;p&gt;There was a time where a dedicated package did exist for every new language you wanted to use, whether it be Emacs or Vim. For instance, &lt;a href="https://chrisdone.github.io/intero/"&gt;Intero&lt;/a&gt; has long been the de facto standard for Haskell in Emacs (there was also a port to Vim, IIRC), while &lt;a href="https://common-lisp.net/project/slime/"&gt;Slime&lt;/a&gt; probably still remains the only one true package for dealing with Common Lisp in Emacs. Times are changing since Microsoft invested the scene of code editors with their flagship product, VS Code, and now we get the Language Server Protocol which allows communicating in a standardized manner signals emitted by a running process (e.g., a linter) to an editor. Emacs, (Neo)Vim, Sublime Text, IntelliJ all have plugins for interacting with existing servers in Python, Clang, Clojure, R, or Julia to name a few. Often times there are many implementations available on the language side. For instance, Python has &lt;a href="https://github.com/python-lsp/python-lsp-server"&gt;python-lsp-server&lt;/a&gt; (as a replacement of &lt;a href="https://github.com/palantir/python-language-server"&gt;pyls&lt;/a&gt;), &lt;a href="https://github.com/Microsoft/pyright"&gt;pyright&lt;/a&gt; (which requires Node), &lt;a href="https://github.com/pappasam/jedi-language-server"&gt;jedi-language-server&lt;/a&gt;, and others that I forgot about. Regarding Python, Microsoft developed on its side &lt;a href="https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance"&gt;pylance&lt;/a&gt;, as an enhanced version of pyright (in fact it relies on pyright with additional server capabilities, it&amp;rsquo;s just that it is not released as an easy install for other code editors).&lt;/p&gt;
&lt;p&gt;I have long been happy with &lt;a href="https://github.com/dense-analysis/ale"&gt;ALE&lt;/a&gt;, as discussed in my &lt;a href="https://aliquote.org/post/getting-into-neovim/"&gt;other&lt;/a&gt; &lt;a href="https://aliquote.org/post/vim-and-lsp/"&gt;posts&lt;/a&gt;, since it provides an easy and intuitive way to add one or more linters and fixers to a language (filetype in Vim parlance), but also provides access to LSP settings: Go to definition or references, rename, help on hover, etc. Regarding linters, there is also &lt;a href=""&gt;Neomake&lt;/a&gt; but I always found ALE setup easier. And it gave me go to references and go to definitions, although the go to references results were not displayed in a quickfix window. The advantage of ALE is that you can configure as many linters and fixers as you want, they will be executed one after the other in an async manner. When using Neovim built-in LSP, you are apparently tight to the linters that come with the server itself, and you must rely on another plugin to add additional linters if you need more.&lt;/p&gt;
&lt;p&gt;My new LSP setup is provided below. I use the following packages: &lt;a href="https://github.com/neovim/nvim-lspconfig"&gt;nvim-lspconfig&lt;/a&gt;, &lt;a href="https://github.com/hrsh7th/nvim-compe"&gt;nvim-compe&lt;/a&gt;, &lt;a href="https://github.com/folke/lsp-trouble.nvim"&gt;lsp-trouble.nvim&lt;/a&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lua" data-lang="lua"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;vim.lsp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;handlers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;textDocument/publishDiagnostics&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;vim.lsp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;with&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vim.lsp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;diagnostic.on_publish_diagnostics&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;virtual_text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;underline&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;signs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;update_in_insert&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;signs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;Error&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;▮&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Warning&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;▮&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Hint&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;▯&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Information&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;▯&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;for&lt;/span&gt; &lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;icon&lt;/span&gt; &lt;span class="kr"&gt;in&lt;/span&gt; &lt;span class="n"&gt;pairs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;signs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="kr"&gt;do&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;hl&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;LspDiagnosticsSign&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;..&lt;/span&gt; &lt;span class="n"&gt;type&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;vim.fn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sign_define&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;hl&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;icon&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;texthl&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;hl&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;numhl&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;nvim_lsp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;lspconfig&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;on_attach&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kr"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bufnr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="kr"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(...)&lt;/span&gt; &lt;span class="n"&gt;vim.api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nvim_buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bufnr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...)&lt;/span&gt; &lt;span class="kr"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="kr"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;buf_set_option&lt;/span&gt;&lt;span class="p"&gt;(...)&lt;/span&gt; &lt;span class="n"&gt;vim.api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nvim_buf_set_option&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bufnr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...)&lt;/span&gt; &lt;span class="kr"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_option&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;omnifunc&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;v:lua.vim.lsp.omnifunc&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;noremap&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;silent&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;n&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&amp;lt;localleader&amp;gt;w=&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&amp;lt;cmd&amp;gt;lua vim.lsp.buf.formatting_sync(nil, 100)&amp;lt;CR&amp;gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;localleader&amp;gt;wa&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;lua vim.lsp.buf.code_action()&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;localleader&amp;gt;wd&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;lua vim.lsp.diagnostic.show_line_diagnostics()&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;localleader&amp;gt;wr&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;lua vim.lsp.buf.rename()&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;localleader&amp;gt;ww&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;lua vim.lsp.buf.document_symbol()&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;localleader&amp;gt;wW&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;lua vim.lsp.buf.workspace_symbol()&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;C-h&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;lua vim.lsp.buf.signature_help()&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;K&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;lua vim.lsp.buf.hover()&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;[d&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;lua vim.lsp.diagnostic.goto_prev()&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;]d&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;lua vim.lsp.diagnostic.goto_next()&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;gD&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;lua vim.lsp.buf.declaration()&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;gd&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;lua vim.lsp.buf.definition()&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;gi&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;lua vim.lsp.buf.implementation()&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;buf_set_keymap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;gr&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;lua vim.lsp.buf.references()&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;servers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;pylsp&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;clangd&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;hls&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;r_language_server&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;racket_langserver&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;clojure_lsp&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;tsserver&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;julials&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lsp&lt;/span&gt; &lt;span class="kr"&gt;in&lt;/span&gt; &lt;span class="n"&gt;ipairs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;servers&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="kr"&gt;do&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;nvim_lsp&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;lsp&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;setup&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;on_attach&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;on_attach&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;flags&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;debounce_text_changes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;150&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;-- rust-tools&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;rust-tools&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;setup&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;tools&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;autoSetHints&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;hover_with_actions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;runnables&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;use_telescope&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;inlay_hints&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;parameter_hints_prefix&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;» &amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;other_hints_prefix&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;« &amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;hover_actions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;auto_focus&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;server&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;on_attach&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;on_attach&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;flags&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;debounce_text_changes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;150&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;-- trouble&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;trouble&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;setup&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;height&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;icons&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;mode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;lsp_workspace_diagnostics&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;fold_open&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;v&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;fold_closed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&amp;gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;auto_open&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;auto_close&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;auto_preview&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;auto_fold&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;use_lsp_diagnostic_signs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It works quite well in practice, especially for Rust, Haskell and Python. When I first drafted this blog post, it was not working so great for Python buffers. I needed to read on to understand why it doesn&amp;rsquo;t use &lt;a href="https://github.com/Richardk2n/mypy-ls"&gt;mypy&lt;/a&gt; or &lt;a href="https://github.com/QuantStack/pyls-memestra"&gt;memestra&lt;/a&gt; (and isort, etc.) altogether right out of the box. Upon inspecting LSP log, it happens the bug is probably caused by memestra.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2021-07-22-10-57-32.png"&gt;
&lt;/figure&gt;
&lt;p&gt;For the time being, I use &lt;a href="https://github.com/mhartington/formatter.nvim"&gt;formatter.nvim&lt;/a&gt; as a fixer to format on save. I ended up configuring both black and isort for Python buffers. It&amp;rsquo;s quite easy, since you only to pass two functions for Python filetype, it&amp;rsquo;s just that it looks a bit more verbose than other plugin like ALE or &lt;a href="https://github.com/sbdchd/neoformat"&gt;Neoformat&lt;/a&gt;. Moreover, my &lt;code&gt;,w=&lt;/code&gt; mapping (which calls Lua&amp;rsquo;s &lt;code&gt;vim.lsp.buf.formatting_sync(nil, 100)&lt;/code&gt; under the hood) can be used to format on line. I don&amp;rsquo;t want to use ALE after disabling its LSP functionalities, since it&amp;rsquo;s apparently possible to manage everything from within &lt;code&gt;lspconfig&lt;/code&gt;. I should note, however, that &lt;a href="https://github.com/iamcco/diagnostic-languageserver"&gt;diagnostic-languageserver&lt;/a&gt; may be a &lt;a href="https://github.com/neovim/nvim-lspconfig/issues/903#issuecomment-843820972"&gt;better option&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Note that this is a temporary setup, while I&amp;rsquo;m getting familiar with the LSP ecosystem in Neovim. I keep trying plugins here and there to see how best to enhance the LSP experience while keeping a minimal setup and without impairing Neovim startup time. The very first time, I added &lt;a href="https://github.com/glepnir/lspsaga.nvim"&gt;lspsaga&lt;/a&gt; to my set of plugins, but I didn&amp;rsquo;t like it very much.&lt;/p&gt;
&lt;p&gt;Finally, not all (Neo)Vim theme provide correct highlighting groups for LSP diagnostics. However, it is quite easy to manually update the theme you use or to add the following settings after your &lt;code&gt;colorscheme whatever&lt;/code&gt; statement, see also &lt;a href="https://github.com/folke/lsp-colors.nvim"&gt;lsp-colors&lt;/a&gt; plugin:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lua" data-lang="lua"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;hi&lt;/span&gt; &lt;span class="n"&gt;link&lt;/span&gt; &lt;span class="n"&gt;LspDiagnosticsDefaultError&lt;/span&gt; &lt;span class="n"&gt;ErrorMsg&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;hi&lt;/span&gt; &lt;span class="n"&gt;link&lt;/span&gt; &lt;span class="n"&gt;LspDiagnosticsDefaultWarning&lt;/span&gt; &lt;span class="n"&gt;WarningMsg&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;hi&lt;/span&gt; &lt;span class="n"&gt;link&lt;/span&gt; &lt;span class="n"&gt;LspDiagnosticsDefaultInformation&lt;/span&gt; &lt;span class="n"&gt;InfoMsg&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;hi&lt;/span&gt; &lt;span class="n"&gt;link&lt;/span&gt; &lt;span class="n"&gt;LspDiagnosticsDefaultHint&lt;/span&gt; &lt;span class="n"&gt;InfoMsg&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;hi&lt;/span&gt; &lt;span class="n"&gt;link&lt;/span&gt; &lt;span class="n"&gt;LspDiagnosticsVirtualTextError&lt;/span&gt; &lt;span class="n"&gt;ErrorMsg&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;hi&lt;/span&gt; &lt;span class="n"&gt;link&lt;/span&gt; &lt;span class="n"&gt;LspDiagnosticsVirtualTextWarning&lt;/span&gt; &lt;span class="n"&gt;WarningMsg&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;hi&lt;/span&gt; &lt;span class="n"&gt;link&lt;/span&gt; &lt;span class="n"&gt;LspDiagnosticsVirtualTextInformation&lt;/span&gt; &lt;span class="n"&gt;InfoMsg&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;hi&lt;/span&gt; &lt;span class="n"&gt;link&lt;/span&gt; &lt;span class="n"&gt;LspDiagnosticsVirtualTextHint&lt;/span&gt; &lt;span class="n"&gt;InfoMsg&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2021-08-06]&lt;/small&gt;&lt;br&gt;
I removed &lt;code&gt;lsp-trouble.nvim&lt;/code&gt; since I don&amp;rsquo;t find any added value for my own usage of LSP diagnostics. I am happy with using the Quickfix window, which &lt;code&gt;nvim_lsp&lt;/code&gt; can populate for me, and that use for other purpose (make, grep) anyway. Likewise, I think I don&amp;rsquo;t really need &lt;code&gt;rust-tools.nvim&lt;/code&gt;: Inlay hints are available via &lt;a href="https://github.com/nvim-lua/lsp_extensions.nvim"&gt;lsp_extensions.nvim&lt;/a&gt;, and that&amp;rsquo;s all what I was interested in. I will discuss all of these choices in a wrap-up post later on. Let&amp;rsquo;s keep it simple, with less than 15 plugins (14 plugins at the time of this writing) and &lt;a href="https://www.pubnub.com/blog/how-fast-is-realtime-human-perception-and-technology/"&gt;100 ms&lt;/a&gt; of startup time (70-85 ms at the moment). You know, those magic numbers, like &lt;a href="https://en.wikipedia.org/wiki/The_Magical_Number_Seven,_Plus_or_Minus_Two"&gt;7 ± 2&lt;/a&gt;, and the like&amp;hellip;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Probably something that goes along what &lt;a href="https://utcc.utoronto.ca/~cks/space/blog/python/PythonPylspNotes"&gt;Chris Siebenmann&lt;/a&gt; noticed in his case: Memestra attempts to make a directory under sys.prefix, which is owned by root if you&amp;rsquo;re running the system CPython or PyPy.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Custom Vim shortcuts (2/n)</title><link>https://aliquote.org/post/vim-shortcuts/</link><pubDate>Sun, 25 Jul 2021 21:50:09 +0200</pubDate><guid>https://aliquote.org/post/vim-shortcuts/</guid><description>&lt;p&gt;« &lt;a href="https://aliquote.org/post/modern-neovim/"&gt;Previous post&lt;/a&gt; in this series&lt;br&gt;
» &lt;a href="https://aliquote.org/post/vim-lsp/"&gt;Next post&lt;/a&gt; in this series&lt;/p&gt;
&lt;p&gt;Here is a list of the personal shortcuts I use the most in Vim. Nothing special, but feel free to copy/paste in case you find anything useful for your own workflow. Of note, I&amp;rsquo;ve read so much posts on remapping everything to Vim&amp;rsquo;s hjkl hot keys that I got tired of it, really. I use the hjkl keys when I think I&amp;rsquo;ll need to repeat a command, otherwise we just have plain old arrow keys, right? Likewise, in Tmux, the arrow keys allow to switch to any pane easily. Arrow keys are mapped in many applications as well, whether it be Firefox, iTerm, Gnome terminal, Kitty, etc. Even in Vim you can use arrow keys with &lt;C-w&gt; to navigate along the way. Home row, you said? Come on, the arrows are just below, on your right &amp;ndash; not so far away in fact. But let&amp;rsquo;s go to the point.&lt;/p&gt;
&lt;p&gt;Of course, I realize this is all subjective and it really depends on your needs and what you expect from your text editor. I for one consider my text editor as a helping hand: When I need to perform an action, give me the means to do it quickly or efficiently; I have poor abstract memory but if I repeat the same action a sufficient amount of time it will become muscle memory; I want it to correct my misspellings and fix my code formatting automagically, and sometimes &amp;ndash; sometimes only &amp;ndash; suggest better alternatives to what I wrote (mostly code, not prose). Above all, my text editor must be as fast lightning. I don&amp;rsquo;t need sugar candy app, or fancy editors that look like &lt;a href="https://arxiv.org/abs/2008.06030v2"&gt;Christmas trees&lt;/a&gt; with everything highlighted here and there. I don&amp;rsquo;t really care about the color theme as long as it&amp;rsquo;s not everywhere unnecessarily. My current color scheme in Vim is deliberately refined to just highlight intentional comments (which must be emphasized), keywords and constants &amp;ndash; and that&amp;rsquo;s all good. I talked about those choices &lt;a href="https://aliquote.org/post/monochrome-color-scheme/"&gt;earlier on&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Alabaster highlights comments. Most themes try to dim comments by using low-contrast greys. I think if code was complex enough that it deserved an explanation then it’s that explanation we should see and read first. It would be a crime to hide it. &amp;mdash; Nikita Prokopov (tonsky)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Snippets were fun a while ago, but I don&amp;rsquo;t like them anymore. Most of the snippet-based packages are probably inspired by the great Textmate app, which I &lt;a href="https://aliquote.org/post/emacs-versus-textmate/"&gt;used&lt;/a&gt; &lt;a href="https://aliquote.org/post/textmate2/"&gt;to use&lt;/a&gt; a while back. I&amp;rsquo;m not a robot, I can write, slowly but I like it nevertheless &amp;ndash; I mean, to write, not slowly. Errors are so much instructive and rewarding, and snippets do not cover every user cases, unfortunately. Likewise, autocompletion is great, but only when I need it. Most of the time I know what I want to write and I don&amp;rsquo;t need a popup window to show complete options. This is why I do not use snippets and set a high time value for autocompletion suggestion.&lt;/p&gt;
&lt;p&gt;And here we go with my collection of personal shortcuts. These are Vim mappings, mostly for normal mode, so please adapt to your personal settings:&lt;/p&gt;
&lt;table border="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;Keys&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;&lt;em&gt;Description&lt;/em&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;,x&lt;/code&gt;&lt;/td&gt;&lt;td&gt;close current buffer&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;-&lt;/code&gt;&lt;/td&gt;&lt;td&gt;open Netrw&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;␣x&lt;/code&gt;&lt;/td&gt;&lt;td&gt;close quickfix, loclist or Trouble window&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;␣.&lt;/code&gt;&lt;/td&gt;&lt;td&gt;set current working directory&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;␣e&lt;/code&gt;&lt;/td&gt;&lt;td&gt;edit files from current buffer directory&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;␣E&lt;/code&gt;&lt;/td&gt;&lt;td&gt;edit in new tab files from current buffer directory&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;tab&lt;/code&gt;&lt;/td&gt;&lt;td&gt;switch to next tab (cycle)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;␣tab&lt;/code&gt;&lt;/td&gt;&lt;td&gt;create a new tab&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;␣$&lt;/code&gt;&lt;/td&gt;&lt;td&gt;open a terminal in a new tab&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;C-j&lt;/code&gt;&lt;/td&gt;&lt;td&gt;go to next quickfix item (also &lt;code&gt;]q&lt;/code&gt;)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;C-k&lt;/code&gt;&lt;/td&gt;&lt;td&gt;go to previous quickfix item (also &lt;code&gt;[q&lt;/code&gt;)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;,s&lt;/code&gt;&lt;/td&gt;&lt;td&gt;sort current paragraph in lexicographic order (&lt;code&gt;vip:sort u&lt;CR&gt;&lt;/code&gt;, thanks &lt;a href="https://strager.net/essays.html"&gt;strager&lt;/a&gt;!)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;zs&lt;/code&gt;&lt;/td&gt;&lt;td&gt;fix misspelled word using first suggested entry (&lt;code&gt;1z=&lt;/code&gt;)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;␣d&lt;/code&gt;&lt;/td&gt;&lt;td&gt;switch dictionary (custom autoload function to alternate between FR and EN dicts)&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;That&amp;rsquo;s it, not a big deal. I tend to use built-in shortcuts a lot because I learned the hard way that most often than not, default settings are good.&lt;/p&gt;
&lt;p&gt;In Vim, my leader key is &lt;code&gt;&amp;lt;space&amp;gt;&lt;/code&gt; (&lt;code&gt;␣&lt;/code&gt;) and my localleaderkey key is &lt;code&gt;,&lt;/code&gt;. I tend to use the leader key for installed plugins, while the localleader is used for custom settings or to remap commands I use a lot. Of note, my CAPS lock key is remapped system-wide to &lt;Esc&gt; (so &lt;code&gt;,&amp;lt;esc&amp;gt;&lt;/code&gt; is equivalent to &lt;code&gt;,&amp;lt;caps&amp;gt;&lt;/code&gt; to hide all other buffers in split view). As I said these mappings are mostly for normal mode. I only use &lt;code&gt;&amp;lt;C-e&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;C-a&amp;gt;&lt;/code&gt; in normal and command mode, because these shortcuts are wired in my hands because readline&amp;rsquo;s everywhere. I tend to use the same mapping in lower and upper case for related tasks. I recently replaced all my Fzf setup with &lt;a href="https://github.com/nvim-telescope/telescope.nvim"&gt;Telescope&lt;/a&gt; (see my &lt;a href="https://aliquote.org/posts/modern-neovim/"&gt;previous post&lt;/a&gt;). I prefer to use the quickfix window rather than the loclist or Telescope for specific task, but I can display the quickfix list in Telescope as well. My complete Telescope mappings are shown below:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lua" data-lang="lua"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;utils.map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;leader&amp;gt;&amp;lt;leader&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;Telescope buffers&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;utils.map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;leader&amp;gt;!&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;Telescope commands&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;utils.map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;leader&amp;gt;/&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;Telescope current_buffer_fuzzy_find&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;utils.map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;leader&amp;gt;?&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;Telescope live_grep&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;utils.map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;leader&amp;gt;*&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;Telescope grep_string&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;utils.map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;leader&amp;gt;:&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;Telescope command_history&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;utils.map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;leader&amp;gt;f&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;Telescope find_files&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;utils.map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;leader&amp;gt;G&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;Telescope git_commits&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;utils.map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;leader&amp;gt;g&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;Telescope git_status&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;utils.map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;leader&amp;gt;h&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;Telescope help_tags&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;utils.map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;leader&amp;gt;q&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;Telescope quickfix&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;utils.map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;leader&amp;gt;r&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;Telescope oldfiles&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;utils.map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;leader&amp;gt;w&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;cmd&amp;gt;Telescope treesitter&amp;lt;CR&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note that Telescope respects &lt;code&gt;autochdir&lt;/code&gt;, so it will limit itself to the current working directory if that option is set to true. As we are generally interested in considering the root directory of a project if there is one, you can use the &lt;a href="https://joalon.se/blog/Fuzzy-Finding-with-Telescope-in-Git.html"&gt;following mappings&lt;/a&gt; as a workaround: (this of course assumes that your project lives in a Git repo)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lua" data-lang="lua"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;vim.cmd&lt;/span&gt;&lt;span class="s"&gt;[[nnoremap &amp;lt;leader&amp;gt;f &amp;lt;cmd&amp;gt;lua require(&amp;#39;telescope.builtin&amp;#39;).find_files{ cwd = vim.fn.systemlist(&amp;#34;git rev-parse --show-toplevel&amp;#34;)[1] }&amp;lt;cr&amp;gt;]]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;vim.cmd&lt;/span&gt;&lt;span class="s"&gt;[[nnoremap &amp;lt;leader&amp;gt;. &amp;lt;cmd&amp;gt;lua require(&amp;#39;telescope.builtin&amp;#39;).live_grep{ cwd = vim.fn.systemlist(&amp;#34;git rev-parse --show-toplevel&amp;#34;)[1] }&amp;lt;cr&amp;gt;]]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;However, my own shortcut &lt;code&gt;&amp;lt;space&amp;gt;e&lt;/code&gt; was devised long ago to handle the general CWD issue with Vim. So if you are using the above setup, provided &lt;code&gt;autochdir&lt;/code&gt; is not explicitly set to true, you should be able to use Telescope to browse your project while &lt;code&gt;&amp;lt;space&amp;gt;e&lt;/code&gt;, after eventually setting the root directory using &lt;code&gt;&amp;lt;space&amp;gt;.&lt;/code&gt;, would open or create file in the same directory as the current buffer or in the root directory previously defined.&lt;/p&gt;</description></item><item><title>Let's go modern with Neovim (1/n)</title><link>https://aliquote.org/post/modern-neovim/</link><pubDate>Thu, 22 Jul 2021 10:23:31 +0200</pubDate><guid>https://aliquote.org/post/modern-neovim/</guid><description>&lt;p&gt;» &lt;a href="https://aliquote.org/post/vim-shortcuts/"&gt;Next post&lt;/a&gt; in this series&lt;/p&gt;
&lt;p&gt;This is kind of a follow-up post to &lt;a href="https://aliquote.org/post/neovim-and-lua/"&gt;Neovim and Lua&lt;/a&gt;. Recently, I decided to update my Neovim configuration files to take advantage of the built-in LSP client and the new completion framework offered by &lt;a href="https://github.com/hrsh7th/nvim-compe"&gt;nvim-compe&lt;/a&gt;. My old config files are still fine, and I may eventually use them for classic Vim 8. However, for Neovim I don&amp;rsquo;t think they will stand the test of time given how fast Neovim is evolving these days. The most difficult part for moving in the right direction was to adopt Lua as the core language for setting up the whole configuration. I&amp;rsquo;m still using Vimscript here and there, mostly because I have some nifty commands and functions that I wrote or adopted long ago.&lt;/p&gt;
&lt;p&gt;Here are the core components of my new settings, and yes, it really is just 12 packages in total:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lua" data-lang="lua"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;packer&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;startup&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kr"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;wbthomason/packer.nvim&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;b3nj5m1n/kommentary&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;mhartington/formatter.nvim&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;nvim-telescope/telescope.nvim&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;requires&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;nvim-lua/popup.nvim&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;nvim-lua/plenary.nvim&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;}}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;neovim/nvim-lspconfig&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;hrsh7th/nvim-compe&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;folke/lsp-trouble.nvim&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;simrat39/rust-tools.nvim&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;lewis6991/gitsigns.nvim&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;requires&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;nvim-lua/plenary.nvim&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;nvim-treesitter/nvim-treesitter&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;run&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;:TSUpdate&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;hoob3rt/lualine.nvim&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;end&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I miss &lt;a href="https://github.com/sheerun/vim-polyglot"&gt;polyglot&lt;/a&gt;, but I&amp;rsquo;m happy with &lt;a href="https://github.com/mhartington/formatter.nvim"&gt;formatter&lt;/a&gt; and &lt;a href="https://github.com/folke/trouble.nvim"&gt;lsp-trouble&lt;/a&gt; as a replacement for &lt;a href="https://github.com/dense-analysis/ale"&gt;ALE&lt;/a&gt;. I could install language-specific packages, e.g. for Markdown or Racket, separately, but I decided to keep the core functionalities to the bare minimum. As always, I prefer to add custom settings by hand, without relying on too many extra dependencies. If &lt;a href="https://github.com/nvim-treesitter/nvim-treesitter"&gt;treesitter&lt;/a&gt; is going to take the lead on syntax highlighting and language grammar support, let&amp;rsquo;s see how it goes. Also, I replaced fzf with &lt;a href="https://github.com/nvim-telescope/telescope.nvim"&gt;Telescope&lt;/a&gt; as my fuzzy finder. Overall, it works great after we remove all the preview windows that we don&amp;rsquo;t really need when switching between buffer or finding a file in a project &amp;ndash; I keep a preview window for live grep&amp;rsquo;ing only.&lt;/p&gt;
&lt;p&gt;My startup time remains decent (about 90 ms), despite previous benchmarks which suggested larger startup time for Neovim 0.5+ compared to the stable version available in Ubuntu 20.04. Using &lt;a href="https://github.com/bchretien/vim-profiler"&gt;vim-profiler&lt;/a&gt;, I got the following summary:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;% vim-profiler.py nvim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Running nvim to generate startup logs... &lt;span class="k"&gt;done&lt;/span&gt;.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Loading and processing logs... &lt;span class="k"&gt;done&lt;/span&gt;.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Plugin directory: /home/chl/.local/share/nvim/site/pack/packer/start
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;=====================================&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Top &lt;span class="m"&gt;10&lt;/span&gt; plugins slowing nvim&lt;span class="err"&gt;&amp;#39;&lt;/span&gt;s &lt;span class="nv"&gt;startup&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;=====================================&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;1 2.597 nvim-compe
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2 1.376 kommentary
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;3 0.788 nvim-treesitter
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;4 0.275 telescope.nvim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;5 0.124 lsp-trouble.nvim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;6 0.072 nvim-lspconfig
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;7 0.037 plenary.nvim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;8 0.035 formatter.nvim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;=====================================&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Finally, I switched to yet another statusline manager, &lt;a href="https://github.com/hoob3rt/lualine.nvim"&gt;lualine&lt;/a&gt;, which is lighter and apparently faster than airline. As for the theme, I use a modified version of &lt;a href="https://github.com/andreypopp/vim-colors-plain"&gt;vim-colors-plain&lt;/a&gt;, so that my text editor now looks like this (using gnome-shell instead of Kitty):&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2021-07-22-10-54-08.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2021-07-22-10-54-08.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2021-07-22-10-57-32.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2021-07-22-10-57-32.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2021-07-24]&lt;/small&gt;&lt;br&gt;
It&amp;rsquo;s been a few days since I upgraded my whole Neovim config and I must say it was a good move: Everything&amp;rsquo;s working fine. Telescope work just as well as &lt;a href="https://github.com/junegunn/fzf.vim"&gt;vim-fzf&lt;/a&gt;, and &lt;a href="https://github.com/lewis6991/gitsigns.nvim"&gt;git-signs&lt;/a&gt; can afford to compete with &lt;a href="https://github.com/airblade/vim-gitgutter"&gt;gitgutter&lt;/a&gt;. Setting up LSP servers is just magic thanks to &lt;a href="https://github.com/neovim/nvim-lspconfig"&gt;nvim-lspconfig&lt;/a&gt;, and the completion framework is a piece of art, IMO.
&lt;/div&gt;</description></item><item><title>ArXiving on June 2021</title><link>https://aliquote.org/post/arxiv-05/</link><pubDate>Thu, 08 Jul 2021 08:19:25 +0100</pubDate><guid>https://aliquote.org/post/arxiv-05/</guid><description>&lt;p&gt;Here are some papers that I read this week, in the CS and Stat category, plus random stuff that were mentioned on IRC or Hacker News.&lt;/p&gt;
&lt;h3 id="scalable-econometrics-on-big-data--the-logistic-regression-on-spark-"&gt;Scalable Econometrics on Big Data &amp;ndash; The Logistic Regression on Spark (&lt;a href="https://arxiv.org/abs/2106.10341"&gt;https://arxiv.org/abs/2106.10341&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;I managed to try some Spark and &lt;a href="https://aliquote.org/post/python-h2o/"&gt;H20&lt;/a&gt; examples a long time ago, but this was really for toy projects. I&amp;rsquo;m usually happy with R or Stata for statistical modeling. However, this article brings interesting insights into large scale data processing using Spark, together with an empirical study of Python+Spark ML versus R in the case of logistic regression. Apparently, the new Spark ML library exposes two different versions of the logistic regression, one direct method (&lt;code&gt;ml.classification.LogisticRegression&lt;/code&gt;) and the general linear model approach (&lt;code&gt;ml.regression.GeneralizedLinearRegression&lt;/code&gt;).&lt;/p&gt;
&lt;h3 id="maars-tidy-inference-under-the-models-as-approximations-framework-in-r-"&gt;maars: Tidy Inference under the &amp;lsquo;Models as Approximations&amp;rsquo; Framework in R (&lt;a href="https://arxiv.org/abs/2106.11188"&gt;https://arxiv.org/abs/2106.11188&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;Another article dealing with statistical modeling, this time under the OLS framework. Precisely, this article is about a new R package, &lt;code&gt;maars&lt;/code&gt;, which offer resampling-based variance estimators and pretty printing of summary results, along tidy syntax. I&amp;rsquo;ve never been a great fan of the tidy family of foo&amp;rsquo;s, but your mileage may vary. The visual diagnostic addons (&amp;ldquo;focal slope&amp;rdquo; and &amp;ldquo;nonlinearity detection&amp;rdquo;) are probably the best aspects of this package.&lt;/p&gt;
&lt;h3 id="choosing-the-estimand-when-matching-or-weighting-in-observational-studies-"&gt;Choosing the Estimand When Matching or Weighting in Observational Studies (&lt;a href="https://arxiv.org/abs/2106.10577"&gt;https://arxiv.org/abs/2106.10577&lt;/a&gt;)&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;Commonly used estimands include the average treatment effect in the treated (ATT), the average treatment effect in the untreated (ATU), the average treatment effect in the population (ATE), and the average treatment effect in the overlap (i.e., equipoise population; ATO). Each estimand has its own assumptions, interpretation, and statistical methods that can be used to estimate it. This article provides guidance on selecting and interpreting an estimand to help medical researchers correctly implement statistical methods used to estimate causal effects in observational studies and to help audiences correctly interpret the results and limitations of these studies.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;With a background in experimental design and behavioral measurement, it took me a long time to get familiar with econometric and epidemiological vocabulary when I was working as a biostatistician in the past 15 years. That being said, this article offers an overview of the different types of estimands available, and how to decide which one to use depending on the question at hand. For instance, &amp;ldquo;if the question concerns a policy of withholding treatment from those who would currently receive it, this suggests the ATT is of interest. If the question concerns a policy of expanding treatment to those who would not currently receive it, the ATU may be of interest. If the question concerns a policy that would require all patients to be treated or to be untreated, the ATE may be of interest. If the question concerns a policy of prescribing treatment for patients under uncertainty, the ATO may be of interest.&amp;rdquo;&lt;/p&gt;
&lt;h3 id="a-bibliography-of-combinators-"&gt;A Bibliography of Combinators (&lt;a href="https://arxiv.org/abs/2106.11729"&gt;https://arxiv.org/abs/2106.11729&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;Stephen Wolfram published lengthy posts on his &amp;ldquo;personal blog&amp;rdquo;, and here is a bibliography memento on combinators, lambda calculus &amp;amp; Co. available on arXiv. See also &lt;a href="https://www.wolfram-media.com/products/combinators-a-centennial-view.html"&gt;Combinators: A Centennial View&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="robust-regression-revisited-acceleration-and-improved-estimation-rates-"&gt;Robust Regression Revisited: Acceleration and Improved Estimation Rates (&lt;a href="https://arxiv.org/abs/2106.11938"&gt;https://arxiv.org/abs/2106.11938&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;This article presents the theoretical implications of contaminated data points in computing maximum-likelihood estimates for parameters of a regression model. So-called highly robust regression is then used as it proved to be a &amp;ldquo;flexible model of corruption and can be used to study both truly adversarial data poisoning attacks (where e.g. part of the dataset is sourced from malicious respondents), as well as model misspecification, where the generative $D_{X_y}$ does not exactly satisfy our distributional assumptions, but is close in total variation to a distribution that does.&amp;rdquo; The article is rather technical, but I learned, for instance, that there exists a nearly-linear time algorithm for robust linear regression with residual variance bounded by $\sigma^2$.&lt;/p&gt;
&lt;h3 id="inference-in-high-dimensional-linear-regression-"&gt;Inference in High-dimensional Linear Regression (&lt;a href="https://arxiv.org/abs/2106.12001"&gt;https://arxiv.org/abs/2106.12001&lt;/a&gt;)&lt;/h3&gt;
&lt;p&gt;In the $n\ll p$ settings, parameter estimation in a regression model becomes complicated. There are tons of approaches to perform variable selection or to reduce the dimensionality of the dataset, and in this case the authors discuss a marginalization approach to this problem: each regression parameter is estimated while treating every other parameters as nuisance factors, much like when residualizing predictors of poor interest (e.g., a set of common covariates). The interesting part of this approach is that the regression coefficients remain on their original scale, unlike regression coefficients estimated using Lasso or Ridge penalties.&lt;/p&gt;</description></item><item><title>Micro posting in June</title><link>https://aliquote.org/post/micro-06-2021/</link><pubDate>Thu, 24 Jun 2021 16:04:39 +0200</pubDate><guid>https://aliquote.org/post/micro-06-2021/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-06-01&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Using the REPL&amp;rdquo; actually means typing your code in your favorite editor. However, one sends the code to evaluate in a REPL, which may not even be visible at all. Once the code is evaluated, the results immediately show up in the editor, so you get the feedback right away. Obviously, this requires some upfront setup, but a proper Clojure REPL setup exists in all major editors. Just google it.&lt;br&gt; Note that one normally sends the code to evaluate with a single key stroke. Note also, a very important point that people often miss, is that this &amp;ldquo;sending code to evaluate&amp;rdquo; is uniquely convenient in Lisp because of the parentheses.&lt;br&gt; There&amp;rsquo;s a notion of &amp;ldquo;form&amp;rdquo; in Lisp, that is the code enclosed between a pair of parentheses, which can be independently evaluated. So, when next time someone insists that their favorite non-Lisp language also has a REPL, ask them, does it have a notion of &amp;ldquo;form&amp;rdquo;?&lt;br&gt; The benefit of a form, is that one no longer needs to use a mouse or some awkward key combinations to painstakingly select a region of code first, before sending it out for evaluation. Instead, one can use a single key stroke that means &amp;ldquo;evaluate the form under the cursor&amp;rdquo;, or &amp;ldquo;evaluate the form before the cursor&amp;rdquo;, etc, to precisely define the scope and send the code at the same time. &amp;mdash; &lt;a href="https://yyhh.org/blog/2021/03/how-much-can-a-clojure-developer-do-alone/"&gt;How much can a Clojure developer do alone?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-06-05&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Ironic as this may sound, my first suggestion for how to write programs that are supposed to be random is to make them deterministic. &amp;mdash; &lt;a href="https://alexey.radul.name/ideas/2016/probabilistic-programming-habits/"&gt;Probabilistic Programming Habits&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-06-05&lt;/a&gt;: &lt;a href="https://sigops.org/s/conferences/hotos/2021/papers/hotos21-s06-greenberg.pdf"&gt;Unix Shell Programming: The Next 50 Years&lt;/a&gt; (PDF, 8 pp.). &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-06&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_1537.JPG" alt=""&gt;&lt;small&gt;Ipomea on the loggia&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-06&lt;/a&gt;: The new Firefox UI (v89) is quite nice actually. At least on Ubuntu, with a 16:9 13 inch display. I found it less appealing the first time I saw the new tab on the Developer version on my Macbook last week.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-06&lt;/a&gt;: Turning 47 today. At least a prime number. &lt;code&gt;#self&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-06&lt;/a&gt;: &lt;a href="https://codetalk.io/posts/2020-04-05-common-json-patterns-in-haskell-rust-and-javascript.html"&gt;Common JSON patterns in Haskell, Rust, and TypeScript&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-06&lt;/a&gt;: &lt;a href="https://sabracrolleton.github.io/testing-framework"&gt;Comparison of Common Lisp Testing Frameworks&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-06&lt;/a&gt;: &lt;a href="https://www.hashcollision.org/brainfudge/index.html"&gt;F*dging up a Racket&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-07&lt;/a&gt;: &lt;a href="https://music.apple.com/us/album/war-kids/1451225965" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   The Ghost, &lt;em&gt;War Kids&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-08&lt;/a&gt;: &lt;a href="https://music.apple.com/us/album/give-my-love-to-london/1443162123" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Marianne Faithfull, &lt;em&gt;Give my Love to London&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-08&lt;/a&gt;: &lt;a href="https://phiresky.github.io/blog/2021/python-features/"&gt;10 underused features of modern Python&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-09&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;On IRC, features like embedded images, a nice UX for messages longer than a few lines (e.g. pasted code), threaded messages, etc; are absent. Some sort of “graceful degradation” to support mixed channels with clients which support these features and clients which don’t may be possible, but it still degrades the experience for many people. By instead making everyone work within the limitations of IRC, we establish a shared baseline, and expressing yourself within these limitations is not only possible but makes a better experience for everyone. &amp;mdash; &lt;a href="https://drewdevault.com/2019/07/01/Absence-of-features-in-IRC.html"&gt;Absence of certain features in IRC considered a feature&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-06-09&lt;/a&gt;: &lt;a href="https://web.stanford.edu/class/bios221/book/"&gt;Modern Statistics for Modern Biology&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-09&lt;/a&gt;: &lt;a href="https://statproofbook.github.io/"&gt;The Book of Statistical Proofs&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-09&lt;/a&gt;: &lt;a href="https://www.ii.com/vim-unicode-digraphs/"&gt;Vim, Unicode, and Digraphs&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-10&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;So what does it mean to always be quitting? It means “making yourself replaceable”; “deprecating yourself”; “automating yourself out of your job”. &amp;mdash; &lt;a href="https://jmmv.dev/2021/04/always-be-quitting.html"&gt;Always be quitting&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-06-10&lt;/a&gt;: &lt;a href="https://matheusfacure.github.io/python-causality-handbook/landing-page.html"&gt;Causal Inference for The Brave and True&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-11&lt;/a&gt;: So true.&amp;gt; This blog serves as my way to give back to all of the people who taught me something over my career. It all started in 2007 when I needed a way to keep track of all the information I learned during my daily work as a systems administrator. &amp;mdash; &lt;a href="https://major.io/"&gt;https://major.io/&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-13&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I could say that Twitter, Facebook, Youtube, and Google helped ruin the internet, but really it was that everyone started using it. The internet used to be a haven for nerds, geeks, artists, and bohemian misfits until the cool kids crashed it. Now the internet is dull and stale and overly commercialized. &amp;mdash; &lt;a href="https://www.sffworld.com/forum/threads/i-miss-the-old-internet.57195/"&gt;I miss the old internet&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-06-14&lt;/a&gt;: It&amp;rsquo;s been hot today! Meanwhile, plants keep being happy&amp;hellip;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1545.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1545.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1546.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1546.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-14&lt;/a&gt;: Some enlightening posts on the Freenode thing, as viewed from my RSS reader: &lt;a href="https://ariadne.space/2021/06/14/the-end-of-freenode/"&gt;the end of freenode&lt;/a&gt;, &lt;a href="https://andreyorst.gitlab.io/posts/2021-05-26-goodbye-freenode/"&gt;Goodbye Freenode&lt;/a&gt;, &lt;a href="https://anarc.at/blog/2021-05-24-leaving-freenode/"&gt;Leaving Freenode&lt;/a&gt;, &lt;a href="https://nedbatchelder.com/blog/202106/goodbye_freenode.html"&gt;Goodbye Freenode&lt;/a&gt;, &lt;a href="https://christine.website/blog/final-chapter-2021-05-20"&gt;Final Chapter&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-14&lt;/a&gt;: &lt;a href="https://gist.github.com/mbinna/c61dbb39bca0e4fb7d1f73b0d66a4fd1"&gt;Effective Modern CMake&lt;/a&gt; (via &lt;a href="https://mjmorse.com/blog/cmake-template/"&gt;Matt Morse&lt;/a&gt;).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-14&lt;/a&gt;: &lt;a href="https://shaunlebron.github.io/t3tr0s-slides/#0"&gt;Tetris in ClojureScript&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-15&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Email is not a hard problem. This is a more than fifty-year-old tool.&lt;br&gt; Chat is not hard either. This is a more than forty-year-old tool. &amp;mdash; &lt;a href="https://liam-on-linux.livejournal.com/80194.html"&gt;Some random sketchy thoughts on Unix, web-apps and workflow&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-06-15&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If we think about privacy and the future, I don’t want to be the next KFC Girl[7], so I clean up my drivel. Many of the posts I create on social media have very little thought go into them, so once they’ve served their purpose, they can be deleted. &amp;mdash; &lt;a href="https://kevq.uk/why-i-delete-old-content/"&gt;Why I Delete Old Content&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-06-15&lt;/a&gt;: R packages that make ggplot2 more beautiful: Vol. &lt;a href="https://tuowang.rbind.io/post/2021-03-25-ggplot2-extensions/"&gt;I&lt;/a&gt; and &lt;a href="https://tuowang.rbind.io/post/2021-04-05-ggplot2-extensions-part2/"&gt;II&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-15&lt;/a&gt;: R tip of the day (thanks to &lt;a href="https://stat.ethz.ch/pipermail/r-devel/2021-June/080827.html"&gt;Pr. Brian Ripley&lt;/a&gt;): the equivalent of &lt;code&gt;%paste&lt;/code&gt; (or &lt;code&gt;paste&lt;/code&gt;) in IPython appears to be &lt;code&gt;source(&amp;quot;clipboard&amp;quot;)&lt;/code&gt; (or equivalently, &lt;code&gt;source(pipe(&amp;quot;pbpaste&amp;quot;))&lt;/code&gt; for Mac users). &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-15&lt;/a&gt;: Trying out &lt;a href="https://mpv.io/"&gt;mpv&lt;/a&gt; as an alterntive to cmus for isolated playlists. Looks really good!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-15&lt;/a&gt;: &lt;a href="https://plus.maths.org/content/maths-minute-positive-predictive-value"&gt;Maths in a minute: The positive predictive value&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-15&lt;/a&gt;: &lt;a href="https://github.com/ibraheemdev/modern-unix"&gt;Modern Unix&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-15&lt;/a&gt;: &lt;a href="https://vincent.bernat.ch/en/blog/2021-webp-avif-nginx"&gt;Serving WebP &amp;amp; AVIF images with Nginx&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-16&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The problem with most of these comments is that they convey very little information. Often it is just a repetition of the method name and parameter names in a few more words. These comments may be useful for API:s exposed externally, but in an application where you have access to all the source code, they are mostly useless. If you wonder what the method does, or what the valid input range for a parameter is, you are better off just reading the code to see what it does. These types of comment take up a lot of space without providing much value. &amp;mdash; &lt;a href="https://henrikwarne.com/2021/06/15/on-comments-in-code/"&gt;On Comments in Code&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-06-16&lt;/a&gt;: &lt;a href="https://blog.dnmfarrell.com/post/an-introduction-to-tmux/"&gt;An Introduction To Tmux&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-16&lt;/a&gt;: &lt;a href="https://blog.dnmfarrell.com/post/modulinos-in-bash/"&gt;Modulinos In Bash&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-17&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_1555.JPG" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-17&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Lisp is the result of taking syntax away, Perl is the result of taking syntax all the way. — Doug HoyteCited in &lt;a href="https://danielsz.github.io/blog/deft-20.html"&gt;Lisp&amp;rsquo;s nested syntax&lt;/a&gt;, by Daniel Szmulewicz.&lt;small&gt;And ensure you added &lt;a href="https://stackoverflow.com/feeds/user/69545"&gt;https://stackoverflow.com/feeds/user/69545&lt;/a&gt; to your RSS feeds, if that&amp;rsquo;s not already the case.&lt;/small&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-06-17&lt;/a&gt;: &amp;gt; Not only in a professional context, but also for private purposes it does make sense to actively read your books/articles. Try to apply some analytical reading, a concept I’ve read about for the first time in How to read a book (book). The idea is to interact with the content you’re reading about: Ask questions, try to link ideas in your mind, make notes, lookup complex definitions. The worst thing you can do is to just passively read something, finish it and then you move on to your next reading. &amp;mdash; &lt;a href="https://blog.dornea.nu/2021/06/13/note-taking-in-2021/"&gt;Note taking in 2021&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-17&lt;/a&gt;: Got my nice playlist on the Ubuntu laptop, added a crappy script, and it&amp;rsquo;s working fine!&lt;br&gt;&lt;img src="https://aliquote.org/img/2021-06-17-20-23-26.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-17&lt;/a&gt;: &lt;a href="https://lukemuehlhauser.com/a-beginners-guide-to-modern-art-jazz/"&gt;A beginner’s guide to modern art jazz&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-17&lt;/a&gt;: &lt;a href="https://eagain.net/articles/git-for-computer-scientists/"&gt;Git for Computer Scientists&lt;/a&gt;. &lt;code&gt;#git&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-17&lt;/a&gt;: &lt;a href="https://programming.guide/worlds-most-copied-so-snippet.html"&gt;The most copied StackOverflow snippet of all time is flawed!&lt;/a&gt; Lovely.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-18&lt;/a&gt;: &lt;a href="https://music.apple.com/us/album/i-fall-in-love-too-easily/433634061" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Larry Willis, &lt;em&gt;I Fall in Love Too Easily&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-18&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The only browser that does not use Google’s web engine (blink) is Firefox. So if you really want some kind of privacy I’d recommend you switching to Firefox or something Firefox based. &amp;mdash; &lt;a href="https://ebin.city/~werwolf/posts/brave-is-shit/"&gt;Brave, the false sensation of privacy&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-06-18&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;When you are a kind of old school, modern times means a bit of pain in some way. Your soul is mostly seeking inner peace but on the other hand, as someone that works with technology, you wouldn&amp;rsquo;t stay freeze.&lt;br&gt; And sometimes the thing is the other way around, it feels that the old-school-world you&amp;rsquo;re living with is good but not as great as it should and you need to move a bit forward yourself to - wrongly - have a feeling of progress. &amp;mdash; &lt;a href="https://userlinux.net/mattermost-and-matterbridge.html"&gt;Mattermost and Matterbridge&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-06-18&lt;/a&gt;: &lt;a href="https://www.pixelbeat.org/docs/coreutils-gotchas.html"&gt;Coreutils gotchas&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-18&lt;/a&gt;: &lt;a href="https://github.com/eveningkid/denodb"&gt;DenoDB: MySQL, SQLite, MariaDB, PostgreSQL and MongoDB ORM for Deno&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-19&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/64578749980__65C92CA1-8834-4B36-9CE6-1B7271B18F8A.JPG" alt=""&gt;&lt;small&gt;Newcomer&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-19&lt;/a&gt;: &lt;a href="https://music.apple.com/us/album/abisko-lights/1256899743" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Abisko Lights, &lt;em&gt;Abisko Lights&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-19&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Bunch of years ago, when social networks did not exist (wow) the web prettended to be pretty simple. As simple that some content management systems were designed to do a kind of hard work: build a static site from the dynamic one. Easier to be served, maintained and much much faster&amp;hellip; win-win!. &amp;mdash; &lt;a href="https://www.userlinux.net/stay-static.html"&gt;Stay static&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-06-19&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;“I had an obsessive-compulsive streak that drew me to digital, discrete problems. And I loved poring over large collections of information,” Knuth said. &amp;mdash; &lt;a href="https://www.quantamagazine.org/computer-scientist-donald-knuth-cant-stop-telling-stories-20200416"&gt;The Computer Scientist Who Can’t Stop Telling Stories&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-06-21&lt;/a&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.matecdev.com/posts/numpy-julia-fortran.html"&gt;Julia: faster than Fortran, cleaner than Numpy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/codex/is-julia-really-fast-12cd7caef96b"&gt;Is Julia Really Fast?&lt;/a&gt;&lt;br&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-06-21&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Two things Perl 5 got right was its lexical scoping rules and support for anonymous functions (“lambdas”). Combine those features and you can make closures. And just what are closures good for? Well it turns out they’re pretty damn powerful; powerful enough, in fact to make a better object system than Perl’s built-in offering. &amp;mdash; &lt;a href="https://blog.dnmfarrell.com/post/closures-as-objects/"&gt;Perl Closures As Objects&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-06-21&lt;/a&gt;: &lt;a href="https://mikkel.ca/blog/git-is-my-buddy-effective-solo-developer/"&gt;Git is my buddy: Effective Git as a solo developer&lt;/a&gt;. &lt;code&gt;#git&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-21&lt;/a&gt;: &lt;a href="https://www.pixelbeat.org/docs/unix-parallel-tools.html"&gt;Parallel processing with unix tools&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-21&lt;/a&gt;: &lt;a href="https://francoisbest.com/posts/2021/hashvatars"&gt;Representing SHA-256 Hashes As Avatars&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-21&lt;/a&gt;: &lt;a href="https://www.spinellis.gr/blog/20210618/"&gt;The Evolution of the Unix System Architecture&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-21&lt;/a&gt;: &lt;a href="https://mikkel.ca/blog/three-ways-to-bulk-rename/"&gt;Three ways to bulk rename files&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-21&lt;/a&gt;: &lt;a href="https://andrewpwheeler.com/2021/06/18/wald-tests-via-statsmodels-python/"&gt;Wald tests via statsmodels (python)&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-23&lt;/a&gt;: &lt;a href="https://music.apple.com/us/album/from-baku-to-new-york-city/1468956345" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Shahin Novrasli, &lt;em&gt;From Baku to New York City&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-23&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;For simple expressions, parentheses are a form of static typechecking. If you model a Lisp as a stack language that evaluates from right to left, each parenthesized block must push exactly one value onto the stack, and must not consume any values. &amp;mdash; &lt;a href="https://adam.nels.onl/blog/parentheses-are-just-typechecking/"&gt;Parentheses are Just Typechecking&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-06-24&lt;/a&gt;: &lt;a href="https://docker-curriculum.com/"&gt;Docker for beginners&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-06-24&lt;/a&gt;: &lt;a href="http://tylerneylon.com/a/lsh1/"&gt;Introduction to Locality-Sensitive Hashing&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;</description></item><item><title>Three years micro-blogging</title><link>https://aliquote.org/post/three-years-micro-blogging/</link><pubDate>Sun, 20 Jun 2021 16:00:38 +0200</pubDate><guid>https://aliquote.org/post/three-years-micro-blogging/</guid><description>&lt;p&gt;And so, &lt;a href="https://aliquote.org/post/one-year-micro-blogging/"&gt;two years&lt;/a&gt; later, we are about to exceed 3000 posts on the micro-blog.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;~/Sites/aliquote master* % ls content/micro &lt;span class="p"&gt;|&lt;/span&gt; wc -l
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="m"&gt;2753&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;When I added this section to the site I thought it would make a perfect fit for storing bookmarks and short quotes, much like a backlog. Later it evolved as a micro-journaling system, whereby I could pout both my readings and short life event, like what I was listening to or the TV shows I watched when I was alone or together with my son. This was also a good place to post pictures of flowers and dishes. Well, you get it. This has become a micro-blog of some sort. It&amp;rsquo;s much better than Twitter since I own my data, I&amp;rsquo;m not limited by the number of characters or formatting issues, and there&amp;rsquo;s no ads, trackers or statistics associated with any entry.&lt;/p&gt;
&lt;p&gt;My personal setup has changed a bit: I use Neovim instead of Doom Emacs, I&amp;rsquo;m on Ubuntu and no longer use a MacBook, and so on. But the core idea remains the same: I can write a short note or quickly post a link by typing the following two words at my shell: &lt;code&gt;micro now&lt;/code&gt;. This will create a file in the right directory, pre-populated with the corresponding header, and I&amp;rsquo;m good with writing whatever I like. Using &lt;code&gt;rsync&lt;/code&gt; it can be synchronized almost immediately with my online server.&lt;/p&gt;
&lt;p&gt;The crappy R script I used two years ago did not produce a very satisfactory word cloud this time. There&amp;rsquo;s more content than last time and I really need to filter stop words, numbers and punctuation other than using a series of &lt;code&gt;gsub&lt;/code&gt;s. Here&amp;rsquo;s an &lt;a href="https://aliquote.org/pub/three-years-micro-blogging.r"&gt;enhanced version&lt;/a&gt;, which may be as crappy as the preceding one &amp;mdash; but with native pipes:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/wc-micro-2.png"&gt;
&lt;/figure&gt;
&lt;p&gt;I intentionally left the &amp;ldquo;iTunes&amp;rdquo; keyword, which comes from an HTML tag I use to display the album I&amp;rsquo;m currently listening to on Apple Music, or nowadays from my ripped Music library. I also left the hashtags I use in some of my micro-posts, because I use few different tags like I did on Twitter and they help identify the content quickly. As can be seen, Emacs which was over-represented two years ago has left his place in favor of (mostly functional) programming languages (in addition to R and Python, which I still use for statistics and bioinformatics), and I suspect Emacs will keep fading over time now that I&amp;rsquo;ve found a new home for my main text editor. Let&amp;rsquo;s see how it goes in the next few years.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Branford Marsalis Quartet • &lt;em&gt;The Secret Between the Shadow and the Soul&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Some handy Git aliases</title><link>https://aliquote.org/post/handy-git-aliases/</link><pubDate>Fri, 18 Jun 2021 19:09:36 +0200</pubDate><guid>https://aliquote.org/post/handy-git-aliases/</guid><description>&lt;p&gt;I use few aliases for Git in my terminal (this also works when using Vim &lt;a href="https://github.com/tpope/vim-fugitive"&gt;fugitive&lt;/a&gt;). I thought I would share some of them here, but you will likely find more useful aliases in &lt;a href="https://github.com/mathiasbynens/dotfiles/"&gt;Mathias Bynens&lt;/a&gt; dot files.&lt;/p&gt;
&lt;p&gt;The following should naturally go under the &lt;code&gt;[alias]&lt;/code&gt; section of your Git config fail (mine is located in &lt;code&gt;~/.config/git/config&lt;/code&gt;).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;l = log --pretty=format:'%&amp;lt;|(16)%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short --graph&lt;/code&gt;: This is a customized version of &lt;code&gt;git log&lt;/code&gt; to pretty print the history with minimal information. It can be used to print only the latest 5 commits using &lt;code&gt;git l -n 5&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;d = &amp;quot;!f() { git diff --patch-with-stat HEAD~$1; }; git diff-index --quiet HEAD -- || clear; f&amp;quot;&lt;/code&gt;: This is a specific diffing tool, whereby you indicate the number of past commits you want to diff against HEAD, e.g., &lt;code&gt;git d 3&lt;/code&gt; will shows what has changed during the last 3 commits.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ca = !git add -A &amp;amp;&amp;amp; git commit -av&lt;/code&gt;: &lt;code&gt;git ca&lt;/code&gt; will simply add all modified files and prompt for a commit message using your preferred editor.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;bo = &amp;quot;!f() { git checkout -b \&amp;quot;$1\&amp;quot; 2&amp;gt; /dev/null || git checkout \&amp;quot;$1\&amp;quot;; }; f&amp;quot;&lt;/code&gt;: Useful to switch to a branch or to create one if it doesn&amp;rsquo;t exist yet. Be careful with typo, though.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;amend = commit --amend --reuse-message=HEAD&lt;/code&gt;: &lt;code&gt;git amend&lt;/code&gt; will simply reuse the last commit message for newly staged files. I often use it when I forgot to stage a file or for minor fix on already staged and commited files.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;fixup = &amp;quot;!f() { git rebase -i HEAD~$1; }; f&amp;quot;&lt;/code&gt;: Rebasing made easy, since you just have to say &lt;code&gt;git fixup 3&lt;/code&gt; to interactively rebase using the last 3 commits. I use it mostly for squashing commits together.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;fc = &amp;quot;!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short -S$1; }; f&amp;quot;&lt;/code&gt;: Handy grep utility to look up for specific pattern in past commited core files.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;fm = &amp;quot;!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short --grep=$1; }; f&amp;quot;&lt;/code&gt;: Same but for searching in commit messages instead of files. This is quite useful when you leave FIXME or WIP instructions in your commit messages.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cleanup = &amp;quot;!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d&amp;quot;&lt;/code&gt;: Cleanup branches that ar eno longer needed because they are already merged into the trunk.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;catchup = !git fetch upstream &amp;amp;&amp;amp; git rebase upstream/$(git symbolic-ref --short HEAD)&lt;/code&gt;: Fetch the latest changes from a repository you track in your remote and merge it with yours local copy, assuming it is the same branch as the one you are currently onto (be it a master/main or gh-pages branch).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;unstage = reset HEAD&lt;/code&gt; and &lt;code&gt;unmerge = reset --hard HEAD&lt;/code&gt;: Well, you get it, everybody makes mistakes, especially when using Git.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;here = !git init &amp;amp;&amp;amp; git add . &amp;amp;&amp;amp; git commit -m \&amp;quot;Init repo\&amp;quot;&lt;/code&gt;: Shorthand to initialize a barebone repository in the current working directory.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Hope you&amp;rsquo;ll find it useful! And many thanks to all the cool guys on Github from whom I stole several of these ideas.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Allison Miller &amp;amp; Carmen Staaf • &lt;em&gt;Science Fair&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>June in review</title><link>https://aliquote.org/post/micro-review-018/</link><pubDate>Thu, 17 Jun 2021 20:37:14 +0200</pubDate><guid>https://aliquote.org/post/micro-review-018/</guid><description>&lt;p&gt;Things from the internet that I heard about recently.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://exploringjs.com/deep-js/toc.html"&gt;Deep Javascript&lt;/a&gt;: Another JS ressource; think of &lt;a href="https://eloquentjavascript.net/"&gt;Eloquent Javascript&lt;/a&gt; and the like, but from a more advanced point of view.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://statproofbook.github.io/"&gt;The Book of Statistical Proofs&lt;/a&gt; is an online textbook I bookmarked a while and forgot in the mean time. I found it mentioned by Luke Tiernay himself on Twitter, so I thought I would revisit its content. Note that this book covers a wide range of topics, from elementary statistics (Covariance of independent random variables) to more advanced Bayesian statistics (Conjugate prior distribution for Poisson-distributed data). As I noted &lt;a href="https://aliquote.org/post/recently-june-2021/"&gt;earlier on&lt;/a&gt;, I hope this textbook keeps being updated as it may become the new HyperSpec of stats or something like that.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://docs.racket-lang.org/loess/index.html"&gt;Loess: local polynomial regression&lt;/a&gt;: I see a lot of statistical packages coming out on the Racket side, which is great. This one, combined to the &lt;a href="https://docs.racket-lang.org/data-frame/index.html"&gt;data-frame&lt;/a&gt; package, could well mark the rebirth of LispStat and the advent of a &lt;a href="https://www.stat.auckland.ac.nz/~ihaka/downloads/Compstat-2008.pdf"&gt;Scheme for statistics&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://datactivist.coop/dataculture/#1"&gt;Culture des données, données de la culture&lt;/a&gt;: Very nice slideshow by Joël Gombin, with lot of useful insights.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Technically, then, what we understand as data are actually capta (derived from the Latin capere, meaning ‘to take’); those units of data that have been selected and harvested from the sum of all potential data. &amp;mdash; Kitchin, 2014&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://mostlymaths.net/2021/01/hive.html/"&gt;Down memory lane: the Hive paper&lt;/a&gt;: Of course, I recommend to subscribe to the author&amp;rsquo;s blog, there&amp;rsquo;s always something to learn from the weekly feeds. This post in particular is interesting in that it provides a nice overview of &lt;a href="https://hive.apache.org/"&gt;Hive&lt;/a&gt; (and its cousin or backend Hadoop, but all Apache products are generally good) and its original approach to data munging.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Pattern matching in Python, with some &lt;a href="https://github.com/fluentpython/example-code-2e/blob/2338cb9d9824ec882ff921e9f2f7119f776d9693/18-context-mngr/lispy/py3.10/lis.py"&gt;nice application&lt;/a&gt;): For what is worth, a rewrite of &lt;code&gt;Lis.py&lt;/code&gt; (Peter Norvig) using the latest top-notch feature of Python 3.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;Unfortunately, code reviews also appear to be a difficult problem. Many projects are bottlenecked by code reviews, in that reviewers are hard to find and progress gets slowed down by having to wait a long time for reviews.&lt;br&gt; The &amp;ldquo;solution&amp;rdquo; that I&amp;rsquo;ve often seen applied in practice is to have lower quality code reviews. Reviewers don&amp;rsquo;t attempt to gain a proper understanding of a change, so reviews become shallower and therefore easier. This is convenient on the surface, but more likely to allow bad code to go through: a subtle corner case that isn&amp;rsquo;t covered by tests (yet?) may be missed, there may be a misunderstanding of a relevant underlying spec, a bad design decision slips through, and so on. This is bound to cause pains later on. &amp;mdash; &lt;a href="https://nhaehnle.blogspot.com/2020/06/they-want-to-be-small-they-want-to-be.html"&gt;They want to be small, they want to be big: thoughts on code reviews and the power of patch series&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Which is to say: the very same phenomenon appears to operate in scientific publishing and reviewing.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Gary Burton &amp;amp; Chick Corea • &lt;em&gt;Crystal Silence&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Neomutt</title><link>https://aliquote.org/post/neomutt/</link><pubDate>Sat, 12 Jun 2021 20:23:04 +0200</pubDate><guid>https://aliquote.org/post/neomutt/</guid><description>&lt;p&gt;I heard about &lt;a href="https://www.mutt.org/"&gt;mutt&lt;/a&gt; during my very first years of Linux, 20 years ago, but I never got into it until last year. I tried to use it a few times on my different Macbook, without success. I guess I was not that much interested at the moment, or I didn&amp;rsquo;t know what mutt was capable of, or I simply couldn&amp;rsquo;t resist the macOS Mail app (and I tried many other &lt;a href="https://aliquote.org/post/alternative-mail-reader-for-mac-os-x/"&gt;mail applications&lt;/a&gt; on the Mac). No matter why, I am now using &lt;a href="https://neomutt.org/"&gt;Neomutt&lt;/a&gt; every day, and while I&amp;rsquo;m still learning some of its &lt;a href="https://neomutt.org/guide/advancedusage"&gt;advanced features&lt;/a&gt;, I thought I would share my experience so far.&lt;/p&gt;
&lt;p&gt;Since I moved my whole Emacs-based setup to individual apps I needed to choose a mail reader, preferably a TUI thing since I was used to process my email from within Emacs with &lt;a href="https://www.djcbsoftware.nl/code/mu/mu4e.html"&gt;mu4e&lt;/a&gt;. From my Linux time I knew Evolution, or at least what it was in the 2000s, wouldn&amp;rsquo;t fit the bill, nor Thunderbird or anything with a ton of menus and dialog boxes. I was looking for something as lean and powerful as Vim, you get the idea. &lt;a href="https://jcs.org"&gt;Joshua Stein&lt;/a&gt; uses it, why not me? I searched a little on the net and on Github to see examples of config, read and reread the documentation, to finally arrive at a configuration that satisfies me, and especially that I can use without asking myself too many questions. Processing emails is generally a boring task,&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; it might as well not take forever either.&lt;/p&gt;
&lt;p&gt;Here are a few points that I like most in Neomutt:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;ldquo;You get what you want&amp;rdquo; (my shorthand for WYSIWYG, for CLI junkies): no artifice, you enter directly in the heart of the subject and you can read and compose your messages with the help of some keyboard shortcuts; the navigation in the folders remains as flexible as within Vim, and of course moving/deleting messages or threads is as easy as with mu4e.&lt;/li&gt;
&lt;li&gt;Neomutt support PGP encryption right out of the box, and it offers good support for managing multiple accounts: I started with 4 accounts, now reduced to 2 (work + private, thanks to appropriate automatic forward rules&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;), and it&amp;rsquo;s pretty easy to switch from one account to the other. It means that I cannot really use &lt;a href="https://notmuchmail.org/"&gt;Notmuch&lt;/a&gt; facilities available in Neomutt, but since I use mu as my mail indexer I don&amp;rsquo;t feel I miss anything, especially since we can use mu search from within Neomutt.&lt;/li&gt;
&lt;li&gt;It looks like you are free to use whatever method you like for fetching emails, using either POP3 or IMAP settings. I personally settled upon &lt;a href="https://github.com/gburd/isync"&gt;mbsync&lt;/a&gt; after I encountered a few issues with &lt;a href="https://www.offlineimap.org/"&gt;offlineimap&lt;/a&gt;. And you may use an indexer (mu or notcmuch) or not. The only thing that really matters is whether you email in a Maildir or as &lt;code&gt;mbox&lt;/code&gt; files.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As I said, I&amp;rsquo;m still learning about advanced features, especially those concerned with search and automatic rules. That&amp;rsquo;s pretty basic stuff everywhere else: what you generally need is goto, replace (or whatever action you want to carry on an item matching a target pattern) and full-body search functionalities.&lt;/p&gt;
&lt;p&gt;And here are a few tricks that I learned when configuring Neomutt:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;You can bypass the &lt;code&gt;;&lt;/code&gt; prefix to apply commands on tagged messages by setting the &lt;code&gt;auto_tag&lt;/code&gt; option. I don&amp;rsquo;t but in case you think it is useful, there you know.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Moving messages isn&amp;rsquo;t obvious until you understand the difference between &amp;ldquo;copy&amp;rdquo; and &amp;ldquo;save&amp;rdquo;. As a one-liner, prefer &lt;code&gt;&amp;lt;save-message&amp;gt;&lt;/code&gt; and bind it to a key that makes sense to you. I have this personally:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# in general settings
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;#34;&amp;lt;save-message&amp;gt;+archives&amp;lt;enter&amp;gt;&amp;#34; \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;#34;Archive message (+archives)&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# in account-specific settings
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;macro index,pager a \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;#34;&amp;lt;save-message&amp;gt;+aliquote/Archive&amp;lt;enter&amp;gt;&amp;#34; \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;#34;Archive message&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This way, pressing &lt;code&gt;a&lt;/code&gt; on a message in the index view will move it to the local &amp;ldquo;Archive&amp;rdquo; folder of the corresponding mailbox, while &amp;ldquo;A&amp;rdquo; will move the message to my general &amp;ldquo;archives&amp;rdquo; &amp;mdash; a Maildir managed by mu with &amp;ldquo;.noupdate&amp;rdquo; flag.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Folder hooks are tricky, since they are evaluated in order, so you must think about it carefully before asking to set specific properties for your mailboxes. I&amp;rsquo;m sure there&amp;rsquo;s a better way to do it (especially to iterate over a common pattern like ̀&lt;code&gt;*/Sent&lt;/code&gt;), but here&amp;rsquo;s my config at the time of this writing:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;folder-hook archives/* &amp;#39;set read_inc=1000&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;folder-hook archives/* &amp;#39;set index_format=&amp;#34;%[%Y-%m-%d %H:%M] [%Z %?X?A&amp;amp;-? %?l?%4l&amp;amp;%4c?] %-25.25F %s &amp;#34;&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;folder-hook aliquote/* source ~/.config/neomutt/accounts/aliquote
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;folder-hook aliquote/* &amp;#39;set index_format=&amp;#34;%[!%y-%m-%d] [%Z] %-25.25F %s &amp;#34;&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;folder-hook aliquote/Sent &amp;#34;set sort=reverse-date-sent&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;folder-hook aliquote/Sent set strict_threads=yes
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;folder-hook jussieu/* source ~/.config/neomutt/accounts/jussieu
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;folder-hook jussieu/* &amp;#39;set index_format=&amp;#34;%[!%y-%m-%d] [%Z] %-25.25F %s &amp;#34;&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;folder-hook jussieu/Sent &amp;#34;set sort=reverse-date-sent&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;folder-hook jussieu/Sent set strict_threads=yes
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The 2nd line confirms that you can manage to have different summary views depending on the mailbox you are currently viewing, but see the next point.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Likewise, actions on a mailbox imply that you first &amp;ldquo;enter&amp;rdquo; that mailbox, which means that to fetch all new mails you either add to write a macro which starts with &lt;code&gt;&amp;lt;enter-command&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;lt;shell-escape&amp;gt;&lt;/code&gt; or you need to write account-specific macros, which is what I find easier. For instance, in my &lt;code&gt;.config/neomutt/accounts/aliquote&lt;/code&gt; file, I have the following line:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;macro index o &amp;#34;&amp;lt;shell-escape&amp;gt;mbsync aliquote&amp;lt;enter&amp;gt;&amp;#34; \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;run mbsync to sync mail for this account&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This means that when I press &lt;code&gt;o&lt;/code&gt; while on the &amp;ldquo;aliquote&amp;rdquo; mailbox, I can fetch all related emails. On the other hand, I also have a general macro which applies to all available inboxes:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;macro index O &amp;#34;&amp;lt;shell-escape&amp;gt;inbox&amp;lt;enter&amp;gt;&amp;#34; \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;run mbsync + mu-index to sync all accounts&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you want to keep up to date with your mailbox status, you can use this &lt;a href="https://unix.stackexchange.com/a/240618"&gt;clever trick&lt;/a&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;set status_format = &amp;#34;mutt_status \&amp;#34; %f sort:%s msgs:%?M?%M/?%m %l%?n? new:%n?%?o? old:%o?%?d? del:%d?%?F? flag:%F?%?t? tag:%t?%?p? post:%p?%?b? inc:%b?%?l??\&amp;#34; \&amp;#34;mutt (%b)\&amp;#34;|&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The first argument to &lt;code&gt;mutt_status&lt;/code&gt; reflect my personal settings inside Neomutt, and the second argument simply display the name of the running app (which is what I used in my Zsh configuration&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt;) with the number of inboxes with new mails in brackets.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You explicitly need to &amp;ldquo;subscribe&amp;rdquo; to lists if you want to easily reply to the list rather than the sender.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Let&amp;rsquo;s face it: incoming emails are mostly work-related or junk emails. It means we need extra efforts to process them, no matter how you look at it, compared to private messages we used to send each other in the 2000s. Facebook succeeded in abolishing private emails, Slack didn&amp;rsquo;t for work-related emails apparently.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;I got a lot of timeouts for icloud recently, to the point this became really annoying since it was the first account I was checking on my list. I decided to forward everything to my other private account, and get ride of all my old mails by simply archiving them with the rest of my former Gmail account. On the plus side, fetching new mails is now much faster since I only have two accounts to manage.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:3"&gt;
&lt;p&gt;You can add &lt;code&gt;print -Pn &amp;quot;\e]0;$1\a&amp;quot;&lt;/code&gt; in a &lt;code&gt;preexec()&lt;/code&gt; function for that purpose. See also &lt;a href="https://www.davidpashley.com/articles/xterm-titles-with-bash/"&gt;Xterm Titles With Bash&lt;/a&gt;.&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Recently</title><link>https://aliquote.org/post/recently-june-2021/</link><pubDate>Thu, 10 Jun 2021 21:22:33 +0200</pubDate><guid>https://aliquote.org/post/recently-june-2021/</guid><description>&lt;p&gt;I recently subscribed to a free &lt;a href="https://bnc4free.com/"&gt;Bnc4Free&lt;/a&gt; account in order to keep track of my IRC session. I already save daily log, but since I&amp;rsquo;m not running Irssi 24h/24, I miss part of the day, especially in the US. I know I should be setting up the whole stuff on a dedicated server at home &amp;mdash; and I will do, one day, but I was too lazy the past few weeks. Anyway, it&amp;rsquo;s been working well and I now get a buffer playback saved in my logs as well. I&amp;rsquo;ve been using IRC for 15 years or so now, mostly as a casual user (ghost reader or private chat session), but it &lt;a href="https://aliquote.org/micro/2021-06-09-08-51-48/"&gt;fits well&lt;/a&gt; in my setup.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://statproofbook.github.io/"&gt;The Book of Statistical Proofs&lt;/a&gt; is &amp;ldquo;a centralized, open and collaboratively edited archive of statistical theorems for the computational sciences.&amp;rdquo; It looks like the future Wikipedia for serious stats users. Let&amp;rsquo;s see how it evolves. On a related point, I also like &lt;a href="https://web.stanford.edu/class/bios221/book/"&gt;Modern Statistics for Modern Biology&lt;/a&gt;, by Susan Holmes and Wolfgang Huber. I probably mentioned it a few times on this blog or the micro-blog, but it really is a nice resource for R practitioners (mostly base R and ggplot2, as it should be).&lt;/p&gt;
&lt;p&gt;Sometimes I wish great authors provide RSS feed for us, human beings, who like keeping an archive of their readings. Lately I came across &lt;a href="https://www.ii.com/"&gt;Infinite Ink&lt;/a&gt; which has very interesting articles to review, and a beautiful web UI. Unfortunately, no link to add to my RSS reader, and I&amp;rsquo;m doomed to not forget about this very elegant site. I now have more than 500 feeds in my personal &lt;a href="https://aliquote.org/files/chl.opml"&gt;OPML file&lt;/a&gt;. Feel free to grab what you find interesting there. And yes, Dirk, there&amp;rsquo;re still people reading others&amp;rsquo; blog, especially yours.&lt;/p&gt;
&lt;blockquote class="twitter-tweet"&gt;&lt;p lang="en" dir="ltr"&gt;And as nobody reads blogs anymore, here is the direct video link with &lt;a href="https://twitter.com/VincentAB?ref_src=twsrc%5Etfw"&gt;@VincentAB&lt;/a&gt;, &lt;a href="https://twitter.com/grant_mcdermott?ref_src=twsrc%5Etfw"&gt;@grant_mcdermott&lt;/a&gt; and myself in supporting roles -- and starring &lt;a href="https://twitter.com/hashtag/Emacs?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#Emacs&lt;/a&gt;, &lt;a href="https://twitter.com/hashtag/RStats?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#RStats&lt;/a&gt; and &lt;a href="https://twitter.com/hashtag/byobu?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#byobu&lt;/a&gt; in the lead. A thrilling nail biter about collaboration in them interweb clouds:&lt;a href="https://t.co/qJYmlBZBx8"&gt;https://t.co/qJYmlBZBx8&lt;/a&gt;&lt;/p&gt;&amp;mdash; Dirk Eddelbuettel (@eddelbuettel) &lt;a href="https://twitter.com/eddelbuettel/status/1402791696979660801?ref_src=twsrc%5Etfw"&gt;June 10, 2021&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async src="https://platform.twitter.com/widgets.js" charset="utf-8"&gt;&lt;/script&gt;
&lt;p&gt;Keep up the good work, Dirk, I&amp;rsquo;ll be listening. Also, no idea what happens on Seth Brown&amp;rsquo;s side, but &lt;a href="https://seth-brown.net/"&gt;his site&lt;/a&gt; keeps changing again and again. Sadly, no more blog posts available at the time of this writing.&lt;/p&gt;
&lt;p&gt;My Emacs -&amp;gt; Vim switch is going well. For the coding part, I&amp;rsquo;m left with &lt;a href="https://github.com/sheerun/vim-polyglot"&gt;vim-polyglot&lt;/a&gt; (+1) and the &lt;a href="https://langserver.org/"&gt;LSP stuff&lt;/a&gt;, which works more (Python and Rust) or less (Haskell and R). This reminds me of John D. Cook&amp;rsquo;s &lt;a href="https://channel9.msdn.com/Events/Lang-NEXT/Lang-NEXT-2012/Why-and-How-People-Use-R"&gt;famous talk&lt;/a&gt; about DSL languages. Yes, we need DSLs, and the tools around. What&amp;rsquo;s the issue with the tooling around the language? LSP clients are generally quite limited in this respect (with maybe a few exception, like VS Code). I believe &lt;a href="https://ess.r-project.org/"&gt;ESS&lt;/a&gt; and &lt;a href="https://chrisdone.github.io/intero/"&gt;Intero&lt;/a&gt; are the best ways to interact with R or Haskell, whatever is meant by &amp;ldquo;interact&amp;rdquo;. And yes, I know &lt;a href="https://yyhh.org/blog/2021/03/how-much-can-a-clojure-developer-do-alone/"&gt;what a REPL is&lt;/a&gt;. Unfortunately, there&amp;rsquo;s nothing close to that in the LSP ecosystem yet. I&amp;rsquo;m left with R&amp;rsquo;s &lt;a href="https://github.com/REditorSupport/languageserver"&gt;languageserver&lt;/a&gt;, which sucks at rendering online help via the K key because of &lt;a href="https://github.com/REditorSupport/languageserver/commit/5f1d88e756baeefa93101ae3c713e543e4e6c386"&gt;rmarkdown issues&lt;/a&gt; (I reverted back to v0.3.9 because of that), and &lt;a href="https://aliquote.org/post/vim-neoterm/"&gt;neoterm&lt;/a&gt; to get a &amp;ldquo;live REPL&amp;rdquo; or sort of. Same for Haskell&amp;rsquo;s tools, BTW. All in one, LSP tooling looks like you all get &amp;ldquo;goto&amp;rdquo;, &amp;ldquo;hover&amp;rdquo;, and &amp;ldquo;doc&amp;rdquo; for free, but barely more, especially when code actions are not implemented.&lt;/p&gt;
&lt;p&gt;And yes, plants are growing well in case you were asking.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1530.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1530.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1536.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1536.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</description></item><item><title>May in review</title><link>https://aliquote.org/post/micro-review-017/</link><pubDate>Sun, 30 May 2021 21:47:14 +0200</pubDate><guid>https://aliquote.org/post/micro-review-017/</guid><description>&lt;p&gt;Here is yet another monthly review of what I found of possible interest while browsing the interweb.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://github.com/huytd/haskplex-font"&gt;Haskplex = Hasklig + IBM Plex Mono&lt;/a&gt;. I already use the IBM Plex font family on this site because I no longer wanted to depend on &lt;a href="https://aliquote.org/post/site-redesign/"&gt;Google font API&lt;/a&gt;. After almost three years using Iosevka as my primary font for my text editor and terminal, I switched to &lt;a href="https://aliquote.org/micro/2020-01-24-16-49-36/"&gt;JetBrains Mono&lt;/a&gt; a while ago and I am quite happy with that &amp;ldquo;wider&amp;rdquo; font. However, I should note that IBM Plex fonts are really good, and it is good to know that we can have ligatures and icons for free with this little font pack.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Re-reading &lt;a href="https://begriffs.com/posts/2019-07-19-history-use-vim.html"&gt;History and effective use of Vim&lt;/a&gt;, from one of the &lt;a href="https://aliquote.org/post/tech-review-july-2019/"&gt;latest micro-review&lt;/a&gt;. Like I always learn something cool every time. On a related note, I follow &lt;a href="https://strager.net/essays.html"&gt;strager&lt;/a&gt; (aka Matthew Glazar) on &lt;a href="https://www.twitch.tv/strager"&gt;Twitch&lt;/a&gt; and I recently learnt about &lt;code&gt;:diffthis&lt;/code&gt;, which is a really cool command if you just want to diff two buffers after copying/pasting the content of two compile results, for example. Always learning, but I already learnt a &amp;ldquo;lot of Vim&amp;rdquo; from this guy alone.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Here is an interesting article on &lt;a href="https://catalyst.coop/2021/05/23/automated-data-wrangling/"&gt;Automated Data Wrangling&lt;/a&gt;, with useful links, including &lt;em&gt;Data Cleaning&lt;/em&gt; by Ihab Ilyas and Xu Chu (2019). I would add that a substantial amount of data cleaning, data verification and quality control techniques are covered in &lt;em&gt;Statistical Data Cleaning with Applications in R&lt;/em&gt; by Mark van der Loo and Edwin de Jonge (2018).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Best online TILs made by &lt;a href="https://til.simonwillison.net/"&gt;Simon Willison&lt;/a&gt; and &lt;a href="https://til.codeinthehole.com/"&gt;David Winterbottom&lt;/a&gt;. Add their RSS feeds to your reader, it is worth to check some of their recipes from time to time.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Interesting discussion on git merge strategy: &lt;a href="https://blog.dnsimple.com/2019/01/two-years-of-squash-merge/"&gt;Two years of squash merge&lt;/a&gt;. TL;DR &lt;code&gt;git merge --squash&lt;/code&gt; allows to aggregate all the changes done in a separate branch into a single unified commit.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Commits are essentially immutable. Technically there are ways to rewrite the history, but there are several reasons you generally don&amp;rsquo;t want to do it. For the sake of simplicity, let&amp;rsquo;s say the farther the commit is in the repository history, the more complicated it is to rewrite it.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you&amp;rsquo;re looking for some fancy tinted colors: &lt;a href="https://www.december.com/html/spec/colorshades.html"&gt;https://www.december.com/html/spec/colorshades.html&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://dev.to/iggredible/the-only-vim-insert-mode-cheatsheet-you-ever-needed-nk9"&gt;The Only Vim Insert-Mode Cheatsheet You Ever Needed&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.nature.com/articles/d41586-021-01174-w"&gt;Reactive, reproducible, collaborative: computational notebooks evolve&lt;/a&gt;. Yet another article on reproducibility and notebooks. Still, I don&amp;rsquo;t find like it will ever solve the &lt;a href="https://pythonawesome.com/fearless-interactivity-for-jupyter-notebooks/"&gt;state dependency problem&lt;/a&gt; without extra care (plus version control is harder compared to single scripts).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://runestone.academy/runestone/books/published/thinkcspy/index.html"&gt;How to Think Like a Computer Scientist: Interactive Edition&lt;/a&gt;. Nice project.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In case you miss some good reads for the week-end, check out some of Eli Bendersky&amp;rsquo;s great posts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://eli.thegreenplace.net/2017/right-and-left-folds-primitive-recursion-patterns-in-python-and-haskell/"&gt;Right and left folds, primitive recursion patterns in Python and Haskell&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://eli.thegreenplace.net/2018/type-inference/"&gt;Type inference&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://eli.thegreenplace.net/2011/02/04/where-the-top-of-the-stack-is-on-x86/"&gt;Where the top of the stack is on x86&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Blog rolling&lt;/strong&gt;: &lt;a href="https://www.cedricscherer.com/2019/05/17/the-evolution-of-a-ggplot-ep.-1/"&gt;The Evolution of a ggplot (Ep. 1)&lt;/a&gt; • &lt;a href="https://codeinthehole.com/guides/resolving-conflicts-during-a-git-rebase/"&gt;Resolving conflicts during a Git rebase&lt;/a&gt; • &lt;a href="https://blog.royalsloth.eu/posts/the-compiler-will-optimize-that-away/"&gt;The compiler will optimize that away&lt;/a&gt; • &lt;a href="https://bernsteinbear.com//blog/lisp/00_fundamentals/"&gt;Writing a Lisp, Part 0: Fundamentals&lt;/a&gt; • &lt;a href="https://alex-hhh.github.io/2021/04/box-and-whiskers-plot.html?utm_source=all&amp;amp;utm_medium=RSS"&gt;Box and Whiskers Plot&lt;/a&gt;&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Sadly, Suz Hinton (alias noopkat) will no longer be streaming.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in May</title><link>https://aliquote.org/post/micro-05-2021/</link><pubDate>Thu, 27 May 2021 11:44:56 +0200</pubDate><guid>https://aliquote.org/post/micro-05-2021/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-05-01&lt;/a&gt;: Flowers.&lt;/p&gt;
&lt;p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1474.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1474.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1473.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1473.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1475.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1475.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-02&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/playlist/jazz-chill/pl.63271312c084419891982eab46cc68ac" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;  Some &lt;em&gt;Jazz chill&lt;/em&gt; for today&amp;rsquo;s evening.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-03&lt;/a&gt;: Almost there: 398 RSS feeds in total in my feed reader (Newsboat).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-03&lt;/a&gt;: It&amp;rsquo;s amazing how fragile LSP Python (via PiPy) is. This morning I had to fix yet another issue with conflicting version of &lt;code&gt;jedi&lt;/code&gt; and &lt;code&gt;python-language-server&lt;/code&gt;. Or it may just be that Python package management really sucks for some package. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-03&lt;/a&gt;: This evening I started watching &lt;a href="https://en.wikipedia.org/wiki/Homeland_(TV_series)"&gt;Homeland&lt;/a&gt;. I had been hesitating for a long time to start a new series. For the moment it seems to me quite suitable for my evenings in this new apartment.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-04&lt;/a&gt;: Use on-demand loading with &lt;code&gt;vim-plug&lt;/code&gt; and remove &lt;code&gt;vim-airline&lt;/code&gt;: -50% startup time ;-) &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-06&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;To a lot of people, C is a dead language, and &lt;code&gt;${lang}&lt;/code&gt; is the language of the future, for ever-changing transient values of &lt;code&gt;${lang}&lt;/code&gt;. The reality of the situation is that all other languages today directly or indirectly sit on top of the Posix API and the NUL-terminated string of C. &amp;mdash; &lt;a href="https://queue.acm.org/detail.cfm?id=2010365"&gt;The Most Expensive One-byte Mistake&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-05-06&lt;/a&gt;: &lt;a href="https://eraser.heidi.ie/duckduckgo-tips-tricks/"&gt;DuckDuckGo Tips &amp;amp; Tricks&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-06&lt;/a&gt;: &lt;a href="https://michurin.github.io/xterm256-color-picker/"&gt;Online color picker for 256 colors terminal&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-06&lt;/a&gt;: &lt;a href="https://github.com/susam/tucl"&gt;The UNIX Command Language (1976)&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-10&lt;/a&gt;: Flowers (again).&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_1478.JPG" alt="pivoine"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-10&lt;/a&gt;: Still relevant: &lt;a href="https://getpocket.com/read/978058236"&gt;Things to Know When Making a Web Application in 2015&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-10&lt;/a&gt;: &lt;a href="https://hyperpolyglot.org/lisp"&gt;Lisp: Common Lisp, Racket, Clojure, Emacs Lisp&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-10&lt;/a&gt;: &lt;a href="https://eli.thegreenplace.net/2017/right-and-left-folds-primitive-recursion-patterns-in-python-and-haskell/"&gt;Right and left folds, primitive recursion patterns in Python and Haskell&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt; &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-10&lt;/a&gt;: &lt;a href="https://tectonic-typesetting.github.io/en-US/"&gt;Tectonic&lt;/a&gt; is a modernized, complete, self-contained TeX/LaTeX engine, powered by XeTeX and TeXLive. &lt;code&gt;#tex&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-10&lt;/a&gt;: &lt;a href="https://www.quantamagazine.org/neil-sloane-connoisseur-of-number-sequences-20150806/"&gt;The Connoisseur of Number Sequences&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-10&lt;/a&gt;: &lt;a href="https://devhints.io/vimscript"&gt;Vim scripting cheatsheet&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-10&lt;/a&gt;: &lt;a href="https://justine.lol/ape.html"&gt;αcτµαlly pδrταblε εxεcµταblε&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-11&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The benefit of a form, is that one no longer needs to use a mouse or some awkward key combinations to painstakingly select a region of code first, before sending it out for evaluation. Instead, one can use a single key stroke that means &amp;ldquo;evaluate the form under the cursor&amp;rdquo;, or &amp;ldquo;evaluate the form before the cursor&amp;rdquo;, etc, to precisely define the scope and send the code at the same time. &amp;mdash; &lt;a href="https://yyhh.org/blog/2021/03/how-much-can-a-clojure-developer-do-alone/"&gt;How much can a Clojure developer do alone? &lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-05-11&lt;/a&gt;: In case you&amp;rsquo;re in an urgent need for a working VIM+Lisp toolbox, check out &lt;a href="https://github.com/justin2004/slimv_box"&gt;slimv_box&lt;/a&gt;. I&amp;rsquo;m using &lt;a href="https://github.com/vlime/vlime"&gt;vlime&lt;/a&gt; in my regular setup, but maybe slimv works well too. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-11&lt;/a&gt;: &lt;a href="https://www.data-is-plural.com/"&gt;Data Is Plural&lt;/a&gt;. Didn&amp;rsquo;t know there was such a thing. This would have been very useful when I was teaching R and Stata for data analysis and statistical modeling.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-11&lt;/a&gt;: &lt;a href="https://epirhandbook.com/"&gt;R for applied epidemiology and public health&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-11&lt;/a&gt;: &lt;a href="https://smashedtoatoms.com/dev-life/sbcl-with-vscode-via-clpm-2021/"&gt;Starting New Projects in Common Lisp (SBCL) using CLPM in VsCode in 2021&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-12&lt;/a&gt;: &lt;a href="https://vim.help/"&gt;https://vim.help/&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-12&lt;/a&gt;: &lt;a href="https://storopoli.io/Bayesian-Julia/"&gt;Bayesian Statistics using Julia and Turing&lt;/a&gt;. &lt;code&gt;#julia&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-12&lt;/a&gt;: &lt;a href="https://idie.ru/posts/vim-modern-cpp"&gt;Using (neo)vim for C++ development&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-12&lt;/a&gt;: &lt;a href="https://www.checkmyworking.com/cm-web-fonts/"&gt;Using Computer Modern on the web&lt;/a&gt;. I&amp;rsquo;m happy with my &lt;a href="https://aliquote.org/post/site-redesign/"&gt;current setup&lt;/a&gt;, but I must admit those fonts look so great.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-14&lt;/a&gt;: On &lt;a href="https://matteolandi.net/plan-files.html"&gt;.plan files&lt;/a&gt;. With some nice ideas to manage them with Vim.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-14&lt;/a&gt;: TIL about &lt;a href="https://awesomekling.github.io/pledge-and-unveil-in-SerenityOS/"&gt;pledge() and unveil()&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-14&lt;/a&gt;: &lt;a href="https://bernheisel.com/blog/vim-workflow/"&gt;VIM Testing and Workflow&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-15&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If you’re reading this and you use Sublime Text or VSCode or anything else, and this gives you the feeling that you should or must switch to vim, or that I consider it a lower class of editor and think that the mere existence of vim makes other tools ‘newbie’ tools and you immediately start installing vim and spending the rest of your day learning the modes: please don’t. If the editor you’ve been using is working for you, it’s working. Somehow text editors became status symbols in technology, the kind of topic that some jerk in the office goes ‘harumph’ when he (it’s a he) discovers that the new hire uses Coda. &amp;mdash; &lt;a href="https://macwright.com/2018/06/17/how-and-why-vim.html"&gt;How and why I use (neo)vim&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-05-15&lt;/a&gt;: &lt;a href="https://iainbean.com/posts/2021/5-steps-to-faster-web-fonts/"&gt;5 steps to faster web fonts&lt;/a&gt;. See also Tom Macwright&amp;rsquo;s article, &lt;a href="https://macwright.com/2016/05/03/the-featherweight-website.html"&gt;This page weighs 15kb&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-15&lt;/a&gt;: &lt;a href="https://turriate.com/articles/modern-javascript-everything-you-missed-over-10-years"&gt;Modern Javascript: Everything you missed over the last 10 years&lt;/a&gt;. &lt;code&gt;#js&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-15&lt;/a&gt;: &lt;a href="https://github.com/lana-k/sqliteviz"&gt;Sqliteviz&lt;/a&gt; is a single-page offline-first PWA for fully client-side visualisation of SQLite databases or CSV files.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-18&lt;/a&gt;: &lt;a href="https://music.apple.com/us/album/give-my-love-to-london/1005312879" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Marianne Faithfull, &lt;em&gt;Give My Love To London&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-18&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Research is characterized by allowing yourself to make mistakes: performing experiments; drawing conclusions; later, realizing that your experiment was not sufficient and you got it wrong; and trying again. &amp;mdash; &lt;a href="https://project-oak.github.io/rust-verification-tools/2021/05/15/verifying-vectorized-code2.html"&gt;Verifying vectorized Rust revisited&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-05-18&lt;/a&gt;: I&amp;rsquo;m done with Season 1 of &lt;a href="https://en.wikipedia.org/wiki/Homeland_(TV_series)"&gt;Homeland&lt;/a&gt;. So far this is a pleasant TV show. Back to Black Mirrors for some days, though.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-18&lt;/a&gt;: Last posts I was read on Vim and Neovim:- &lt;a href="https://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/"&gt;Learn Vim Progressively&lt;/a&gt;- &lt;a href="https://rwx.gg/tools/editors/vim/"&gt;Vim&lt;/a&gt; and &lt;a href="https://rwx.gg/tools/editors/neovim/"&gt;To NeoVim, Or Not to NeoVim&lt;/a&gt; on rwx.gg&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-18&lt;/a&gt;: &lt;a href="https://oroques.dev/notes/neovim-init/"&gt;Neovim 0.5 features and the switch to init.lua&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-18&lt;/a&gt;: &lt;a href="https://nickb.dev/blog/replacing-elasticsearch-with-rust-and-sqlite"&gt;Replacing Elasticsearch with Rust and SQLite&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-18&lt;/a&gt;: &lt;a href="https://aca.github.io/neovim_startuptime.html"&gt;Speedup neovim&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-18&lt;/a&gt;: &lt;a href="https://statproofbook.github.io/"&gt;The Book of Statistical Proofs&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-19&lt;/a&gt;: &lt;a href="https://music.apple.com/gb/album/boxer/220311706" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   The National, &lt;em&gt;Boxer&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-19&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Thirty years later, when Cervone created MathJax, I was amazed again—though perhaps not for the right reasons. I had supposed that the major programming challenge would be capturing all the finicky rules and heuristics for building up math expressions—placing and sizing superscripts, adjusting the height and width of parentheses or a radical sign to match the dimensions of the expression enclosed, spacing and aligning the elements of a matrix. Those are indeed nontrivial tasks, but they are just the beginning. My recent adventures have helped me see that another major challenge is making TeX work in an alien environment. &amp;mdash; &lt;a href="http://bit-player.org/2020/mathjax-turns-3-0"&gt;MathJax turns 3.0&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-05-19&lt;/a&gt;: A night in.&lt;/p&gt;
&lt;p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1501.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1501.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1502.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1502.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-19&lt;/a&gt;: More flowers.&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_1497.JPG" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-19&lt;/a&gt;: Nice idea: &lt;a href="https://calmcode.io/"&gt;Video tutorials&lt;/a&gt; for modern ideas and open source tools.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-19&lt;/a&gt;: Welcome to native pipes &amp;amp; Co. I guess. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;&lt;img src="https://aliquote.org/img/2021-05-19-21-23-39.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-19&lt;/a&gt;: Working from a comfy setup.&lt;br&gt;&lt;img src="https://aliquote.org/img/2021-05-19-21-43-13.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-19&lt;/a&gt;: &lt;a href="https://yadm.io/"&gt;yadm&lt;/a&gt;: Yet Another Dotfiles Manager.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-25&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;(&amp;hellip;) Infect the host quickly, before anybody notices; all the while telling people how much the company is investing in the community that it cares about (making lots of money from). &amp;mdash; &lt;a href="https://shape-of-code.coding-guidelines.com/2019/07/08/complexity-is-a-source-of-income-in-open-source-ecosystems/"&gt;Complexity is a source of income in open source ecosystems&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-05-25&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In the 1980s and 1990s, when the GPL was written, the enemy of the free software movement was Microsoft and other companies that sold closed-source (“proprietary”) software. The GPL intended to disrupt this business model for two main reasons (&amp;hellip;) In the 2020s, the enemy of freedom in computing is cloud software (aka software as a service/SaaS, aka web apps) – i.e. software that runs primarily on the vendor’s servers, with all your data also stored on those servers. Examples include Google Docs, Trello, Slack, Figma, Notion, and many others. &amp;mdash; &lt;a href="https://martin.kleppmann.com/2021/04/14/goodbye-gpl.html"&gt;It&amp;rsquo;s time to say goodbye to the GPL&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-05-25&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Instead, I believe the widest gap between the two cultures involves sampling variation. It forms the very core of statistics, while ML mostly ignores it. I’ve observed this over the years in writings and statements by ML people, and in conversation with them. &amp;mdash; &lt;a href="https://matloff.wordpress.com/2020/07/26/efron-updates-breimans-two-cultures-essay/"&gt;Efron Updates breiman’s “two cultures” essay&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-05-25&lt;/a&gt;: Check out these &lt;a href="https://orion.math.iastate.edu/ehjohnst/PoW/PoW.html"&gt;math problems&lt;/a&gt; (with solutions) by the Mathematics Department at Iowa State University.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-25&lt;/a&gt;: &lt;a href="https://kottke.org/21/05/a-map-of-the-internet-2021"&gt;A Map of the Internet 2021&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-25&lt;/a&gt;: &lt;a href="http://bit-player.org/2019/my-god-its-full-of-dots"&gt;My God, It’s Full of Dots!&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-25&lt;/a&gt;: &lt;a href="https://www.openbookpublishers.com/product/979"&gt;The Essence of Mathematics Through Elementary Problems&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-25&lt;/a&gt;: &lt;a href="https://rawgit.com/darcyparker/1886716/raw/eab57dfe784f016085251771d65a75a471ca22d4/vimModeStateDiagram.svg"&gt;VIM Modes Transition Diagram&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-25&lt;/a&gt;: &lt;a href="https://www.cmyr.net/blog/rust-python-learnings.html"&gt;Writing Pythonic Rust&lt;/a&gt;. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-26&lt;/a&gt;: &lt;a href="https://music.apple.com/gb/album/if-you-wait/1216388785" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   London Grammar, &lt;em&gt;If You Wait&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-26&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The success of Julia in the scientific-computing sphere is an important development at the intersection of science, engineering, and free software (in the free speech sense). Until the advent of Julia, the only programming language with comparable influence and ubiquity in the science world was Fortran. &amp;mdash; &lt;a href="https://lwn.net/SubscriberLink/856819/c865652ad4dc06d0/"&gt;Julia 1.6 addresses latency issues&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-05-26&lt;/a&gt;: At last, a &lt;a href="https://github.com/juhp/stack-clean-old"&gt;tool&lt;/a&gt; to cleanup the mess in your &lt;code&gt;$HOME/.stack directory&lt;/code&gt;. Just went down to 3.9 Go instead of 9.1 Go.&lt;br&gt;&lt;img src="https://aliquote.org/img/2021-05-26-11-54-55.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-26&lt;/a&gt;: First contrib for a &lt;a href="https://aliquote.org/post/vim-neoterm/"&gt;very useful&lt;/a&gt; Vim plugin ;-)&lt;br&gt;&lt;img src="https://aliquote.org/img/2021-05-26-11-03-28.png" alt=""&gt;As I write this, I realized that &lt;a href="https://github.com/kassio/neoterm/pull/322"&gt;this PR&lt;/a&gt; has already been merged.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-26&lt;/a&gt;: I updated my Zsh config today, just to make terminal tabs (in &lt;a href="https://sw.kovidgoyal.net/kitty/"&gt;Kitty&lt;/a&gt;) show the current running process, instead of the default &lt;code&gt;$SHELL&lt;/code&gt;. Looks much nicer!TL;DR Add this to your &lt;code&gt;.zshrc&lt;/code&gt; or wherever you put custom settings:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;preexec&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# See, e.g., https://www.davidpashley.com/articles/xterm-titles-with-bash/&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; print -Pn &lt;span class="s2"&gt;&amp;#34;\e]0;&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;\a&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# or, equivalently,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# printf &amp;#34;\x1b]0;%s\x07&amp;#34; &amp;#34;$1&amp;#34;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;precmd&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# Clean up terminal title (in case Neovim doesn&amp;#39;t restore it to its initial state)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# printf &amp;#34;\033]0;\a&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# or print relevant stuff&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# (%~ current working directory; %1~ directory name only)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; print -Pn &lt;span class="s2"&gt;&amp;#34;\e]0;%1~\a&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-05-26&lt;/a&gt;: I&amp;rsquo;m delighted to start using Julia again. The 1.6 milestone, which may eventually becomes the next LTS version, looks much more stabilized than the previous versions I quickly tested in the past (1.0, and 0.3 to 0.5 beforehand). And, they got a true &lt;a href="https://docs.juliaplots.org/latest/"&gt;graphical engine&lt;/a&gt;. &lt;code&gt;#julia&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-05-27&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I mostly don&amp;rsquo;t care how popular Lisp is. I am not using Lisp in order to score better in a popularity contest. I am using Lisp because it is the best programming language I know for the kind of programs I write. I don&amp;rsquo;t think there is anything particularly or seriously wrong with Lisp. It might be that at the moment it does not provide what some people have come to expect from a programming language (free cross-platform implementation with all the libraries you could possibly want). Whether this will ever happen, I don&amp;rsquo;t know, and I don&amp;rsquo;t care (though I respect that others might). I do think I know that some of the people who want this to happen will have to get their hands dirty and just do it. No amount of lamenting is going to magically create any libraries. &amp;mdash; &lt;a href="http://metamodular.com/Essays/wrong.html"&gt;What is wrong with Lisp?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-05-27&lt;/a&gt;: &lt;a href="https://dept-info.labri.fr/~strandh/Teaching/Programmation-Symbolique/Common/David-Lamkins/cover.html"&gt;Successful Lisp: How to Understand and Use Common Lisp&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>Timeshift for system backup</title><link>https://aliquote.org/post/timeshift-backup/</link><pubDate>Fri, 21 May 2021 10:36:25 +0200</pubDate><guid>https://aliquote.org/post/timeshift-backup/</guid><description>&lt;p&gt;I did a brief review on existing solutions for incremental rotating backup in Ubuntu. I came across Dirvish after looking at a &lt;a href="https://sanctum.geek.nz/presentations/incremental-backups-dirvish.pdf"&gt;short presentation&lt;/a&gt; (PDF) made by Tom Ryder, but I don&amp;rsquo;t know if it&amp;rsquo;s still being used (it looks like a pretty old project after all) and I finally stumbled upon &lt;a href="https://github.com/teejee2008/timeshift"&gt;Timeshift&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;As highlighted by Tom Ryder, manual or homemade backups can be handled using a combination of &lt;code&gt;rsync&lt;/code&gt; and &lt;code&gt;cron&lt;/code&gt;, both ensuring the incremental and differential aspect of backup. However, neither do protect from limited space available on various external HD. An alternative solution relies on the ext4 filesystem, which supports hard link: contrary to symlink (&lt;code&gt;ln -s&lt;/code&gt;), the idea would be to hard link all references to a single copy of, say, a file or a kernel image. This is where &lt;a href="https://dirvish.org/"&gt;Dirvish&lt;/a&gt; comes into play, but also Timeshift, since they both allow rotating backups based on hard linking the system files (and not the user directory). Timeshift can also leverage &lt;a href="https://en.wikipedia.org/wiki/Btrfs"&gt;BTRFS&lt;/a&gt; filesystems which allows for snapshots. The TL;DR is &amp;ldquo;backup your whole computer except the user directory&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;Until now I always did my backup on external HD using either Arq (on macOS) or plain &lt;code&gt;rsync&lt;/code&gt; (macOS + Linux/OpenBSD). I usually archive my &lt;code&gt;$HOME&lt;/code&gt; folder only, every week or so. I always thought I would reinstall the whole OS itself if something gets wrong, and I never care about backing up system files themselves. On macOS, this means losing everything sitting under &lt;code&gt;/usr/local&lt;/code&gt;, but that&amp;rsquo;s not a big deal since this is usually something that was managed by Homebrew. Of course, we need to take care of hidden files but also &lt;code&gt;$HOME/Library&lt;/code&gt;, and this soon became a nightmare because the latter depends on installed applications and it consists of a mix of config files, cache informations, and application data (e.g., Messages, Mail, etc.). I wish there was a clear separation between data and config files under OS X, but this never happened. In sum, it was (and it&amp;rsquo;s probably still true) impossible to keep our &lt;code&gt;$HOME&lt;/code&gt; folder a perfect Linux or BSD-like user directory.&lt;/p&gt;
&lt;p&gt;When I started using Ubuntu as a replacement to macOS Mojave, there was no big deal with the OS itself, since I used to use Linux before switching to OS X.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; I started backing up my personal files using rsync, on an external 2 To USB3 HD. In fact I&amp;rsquo;m using &lt;a href="https://launchpad.net/deja-dup"&gt;Déjà Dup&lt;/a&gt; to backup my personal files. Timeshift doesn&amp;rsquo;t backup the &lt;code&gt;$HOME&lt;/code&gt; directory directly, but instead the whole filesystem + &lt;code&gt;$HOME&lt;/code&gt; dot files. According to the documentation:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Unlike similar tools that are scheduled to take backups at a fixed time of the day, Timeshift is designed to run once every hour and take snapshots only when a snapshot is due.&lt;/li&gt;
&lt;li&gt;Creating a hard-linked copy may seem like a good idea but it is still a waste of disk space, since only files can be hard-linked and not directories. Timeshift avoids this wastage by using tags for maintaining backup levels. The snapshot location will have a set of folders for each backup level (&amp;ldquo;Monthly&amp;rdquo;, &amp;ldquo;Daily&amp;rdquo;, etc) with symbolic links pointing to the actual snapshots tagged with the level.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The rationale is that if you ever need to rollback your system, it is likely that your personal files will have changed and the backup files would overwrite them &amp;mdash; which is why I always made a separate backup for the OS and my personal files after all.&lt;/p&gt;
&lt;p&gt;To sum up it looks like Timeshift would be a good addition to my backup strategy and I should probably give it a try for real.&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;And let&amp;rsquo;s face the fact that Linux was far less friendly 15 years ago. I&amp;rsquo;m thus quite happy with Ubuntu 20.04, to be honest.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Neovim and Lua</title><link>https://aliquote.org/post/neovim-and-lua/</link><pubDate>Wed, 19 May 2021 08:10:32 +0200</pubDate><guid>https://aliquote.org/post/neovim-and-lua/</guid><description>&lt;p&gt;Recently I came across several posts that discuss the &lt;a href="https://github.com/nanotee/nvim-lua-guide"&gt;use of Lua&lt;/a&gt; for the Neovim init file, as well as the new trending packages that everyone will be using in a few months for LSP-related stuff. In fact, the very first hit was the &lt;a href="https://github.com/seth-brown/dotfiles/tree/main/nvim"&gt;config&lt;/a&gt; written by Seth Brown, that whetted my curiosity. I decided to try it on my Mac since I have Node installed on it, and it was pretty nice, except for the startup time: my Neovim is up and running within 50 ms or so (with only 16 plugins, managed by Plug) while all those new plugins require more than 200 ms to be fully initialized. This should probably be less on my Linux machine since it is faster than my Macbook. Still, it is a bit higher than I would like. That being said, here are the essential plugins that Seth Brown requires in his setup:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://github.com/wbthomason/packer.nvim"&gt;packer&lt;/a&gt;: a &lt;a href="https://github.com/jwiegley/use-package"&gt;use-package&lt;/a&gt;-like plugin manager, to replace Plug, with better defaults (it uses native packages functionalities and does not manipulate rtp) &amp;mdash; there&amp;rsquo;s also &lt;a href="https://github.com/kristijanhusak/vim-packager"&gt;vim-packager&lt;/a&gt;;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://github.com/nvim-treesitter/nvim-treesitter"&gt;treesitter&lt;/a&gt;: the definitive &amp;ldquo;non-regex&amp;rdquo;-based syntax highlighter, which relies on language parsers &lt;a href="https://github.com/nvim-treesitter/nvim-treesitter#supported-languages"&gt;when available&lt;/a&gt;;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://github.com/nvim-telescope/telescope.nvim"&gt;telescope&lt;/a&gt;: a fuzzy finder to replace &lt;a href="https://github.com/junegunn/fzf.vim"&gt;fzf.vim&lt;/a&gt;, or sort of; I don&amp;rsquo;t know if it is as fast for large codebase, but form what I&amp;rsquo;ve seen it acts as a large pop out window from which you can look for files in project, regex in current files, etc. I find it annoying that a file preview is used together with fuzzy matches &amp;mdash; I disabled it for fzf and I found it more useable. After all, you only want filenames or matches, not a preview of every file in your project, isn&amp;rsquo;t it?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Sure, but the names of things, their functionality, and how it all fits together should be things that exist in one’s mind, not just in a computer. &amp;mdash; &lt;a href="https://macwright.com/2021/03/16/return-of-fancy-tools.html"&gt;The return of fancy tools&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;the LSP family of tools: &lt;code&gt;nvim-lspconfig&lt;/code&gt;, &lt;code&gt;nvim-compe&lt;/code&gt;, &lt;code&gt;lspkind-nvim&lt;/code&gt;, &lt;code&gt;lsp_signature.nvim&lt;/code&gt;, &lt;code&gt;lspsaga.nvim&lt;/code&gt;, &lt;code&gt;lsp-trouble.nvim&lt;/code&gt;, &lt;code&gt;nvim-lspinstall&lt;/code&gt;, to name a few. That&amp;rsquo;s a lot!&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We talked about LSP and Vim in a &lt;a href="https://aliquote.org/post/vim-and-lsp/"&gt;recent post&lt;/a&gt;, but this time this all about Neovim built-in LSP client. I haven&amp;rsquo;t changed my mind since then, and I prefer to write like a zoombie, with good linters at hand (thanks to Ale) and a little help from omnicompletion from time to time. I learned (the hard way?) that it&amp;rsquo;s better to type, erase and write again, rather than copy/paste blindly.&lt;/p&gt;
&lt;p&gt;Finally, a special mention to &lt;a href="https://github.com/lewis6991/gitsigns.nvim"&gt;gitsigns&lt;/a&gt;, which could replace &lt;a href="https://github.com/airblade/vim-gitgutter"&gt;vim-gitgutter&lt;/a&gt; (same functionalities, with additional blaming support), and &lt;a href="https://github.com/hoob3rt/lualine.nvim"&gt;lualine.nvim&lt;/a&gt; as a lightweight replacement for airline.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; All of the above require Neovim 0.5+, of course. If you&amp;rsquo;re curious, there&amp;rsquo;s also this collection of awesome &lt;a href="https://github.com/rockerBOO/awesome-neovim"&gt;Neovim plugins&lt;/a&gt;. I&amp;rsquo;m still on Neovim 0.4.3 because this is the LTS version according to Ubuntu package manager. I don&amp;rsquo;t mind, I used to use the nightly build for several months in the past, but I found it annoying to upgrade to new Git release after every &lt;code&gt;apt update&lt;/code&gt;. I could even use Vim 8 only, but I like how Neovim makes using a terminal alongside opened buffers so smooth. I now stand by well curated packages, with few updates. Even my terminal emulator, &lt;a href="https://aliquote.org/micro/2021-04-07-21-01-11/"&gt;Kitty&lt;/a&gt;, is probably outdated. I&amp;rsquo;ve seen my Emacs broke so many times in the past, due to package upgrades (or simply Doom update), that I prefer to live a few updates behind rather than spend a whole day fixing my day-to-day configuration&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2021-05-26]&lt;/small&gt;&lt;br&gt;
I now use the latest release of Kitty, to maintain compatibility between my macOS and Ubuntu setup, but also because the Ubuntu stable release was mostly oudated. However, regarding Neovim I noticed that when switching to the nightly build the startup time increase from 60 ms to more than 100 ms, WTF? Apparently, it has to do with &lt;code&gt;/usr/share/nvim/runtime/syntax/synload.vim&lt;/code&gt;, but I didn&amp;rsquo;t investigate much, and revert to v0.4.3. As I said in other posts, I don&amp;rsquo;t really need &lt;a href="https://aliquote.org/post/neovim-and-lua/"&gt;Lua config&lt;/a&gt; or &lt;a href="https://aliquote.org/post/vim-and-lsp/"&gt;LSP stuff&lt;/a&gt;.
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;I wish I understand why plugins are sometimes prefixed with &amp;ldquo;vim&amp;rdquo; or &amp;ldquo;nvim&amp;rdquo;, while other plugins use suffixes instead.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Python and single-page application</title><link>https://aliquote.org/post/python-spa/</link><pubDate>Tue, 11 May 2021 12:02:19 +0200</pubDate><guid>https://aliquote.org/post/python-spa/</guid><description>&lt;p&gt;A few weeks ago I had to deploy a single web page to run custom software in the background and bring the user the results back. Without bothering you with the details, the idea was to provide the user with something like the MAFFT online server, but with only the bare essential: the app should only perform multiple alignment of a Fasta file, without reporting statistics or displaying results, and let the user download the aligned sequences as a Fasta file. Why an HTML form? Because the user might not want to use (or does not have access to) a terminal on the server. The same idea would equally applies for performing blast analysis and the like. That is, you have a working software on your server, and you want to serve it in a browser. This probably has been done a lot of time before, but as a lazy man I thought I could write a simple Flask application for that purpose.&lt;/p&gt;
&lt;p&gt;Django would be overkill in this case, of course, yet Flask is a bit heavier than Perl+CGI.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; Anyway, here is how to write a single-page app in Flask+WSGI. Note that I use the term &lt;a href="https://en.wikipedia.org/wiki/Single-page_application"&gt;single-page app&lt;/a&gt; (SPA) loosely here, because (1) it does not really fit in the landmark of SPAs and (2) there are in fact two pages. Flask is really great for building small to moderate sized website, and it comes with everything we need to manage file transfer in both directions (i.e., upload and download).&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s say you have a file, &lt;code&gt;app.py&lt;/code&gt;, which holds most of the code for the landing page. This file will be comprised of:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;the mandatory Python imports and configuration for Flask, e.g.:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;flask&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Flask&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;abort&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;render_template&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;send_file&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;flask_bootstrap&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Bootstrap&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;werkzeug.utils&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;secure_filename&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Flask&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="vm"&gt;__name__&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;MAX_CONTENT_LENGTH&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1024&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1024&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;UPLOAD_EXTENSIONS&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;.fasta&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;UPLOAD_PATH&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/absolute-path-on-server/tmp/&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;bootstrap&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Bootstrap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;-%&amp;lt;--&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="vm"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;__main__&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;localhost&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;the main page:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nd"&gt;@app.route&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;/&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;index&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;render_template&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;upload.html&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;a way to deliver the results (as a file to download):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nd"&gt;@app.route&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;/download&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;download&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;outfile&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dirname&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;abspath&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="vm"&gt;__file__&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/out.fasta&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;send_file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;outfile&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;as_attachment&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I intentionally skip the uploading/downloading stuff since it depends on the web forms used (copy/paste in a &lt;code&gt;&amp;lt;textarea&amp;gt;&lt;/code&gt; or file upload/download via a button). As an illustration, here is what I used to offer both options to the user regarding data input:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-html" data-lang="html"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;&amp;lt;!-- defined in templates/upload.html --&amp;gt;&lt;/span&gt;&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;form-group&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;form&lt;/span&gt; &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;POST&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;action&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;enctype&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;multipart/form-data&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;label&lt;/span&gt; &lt;span class="na"&gt;for&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;formSequence&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Paste sequence or upload a file&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;label&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;textarea&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;formSequence&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;sequence&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;form-control&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;rows&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;20&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;wrap&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;off&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;textarea&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;file&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;file&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;submit&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Submit&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;reset&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Clear&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;form&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Lastly, we can use &lt;code&gt;subprocess.call(cmd, shell=True)&lt;/code&gt; to call our application, using &lt;code&gt;cmd&lt;/code&gt; to store the complete call to the app with its options, which is exactly what we would type in a terminal. This will be handled in a separate function, with the same route as the index page but allowing for &lt;code&gt;POST&lt;/code&gt; queries, i.e. &lt;code&gt;@app.route(&amp;quot;/&amp;quot;, methods=[&amp;quot;POST&amp;quot;])&lt;/code&gt;. Here&amp;rsquo;s the skeleton I use:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nd"&gt;@app.route&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;/&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;methods&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;POST&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;upload_files&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;outfile&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dirname&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;abspath&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="vm"&gt;__file__&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/out.fasta&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;input_sequence&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;sequence&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="c1"&gt;# (1) comes from the web form, templates/upload.html&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;uploaded_file&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;files&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;file&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="c1"&gt;# --- same here&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;filename&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;secure_filename&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;uploaded_file&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# (2) Not really needed if this is for personal use or trusted users&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;filename&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;file_ext&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;splitext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;file_ext&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;UPLOAD_EXTENSIONS&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;abort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;400&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;src&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;UPLOAD_PATH&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;uploaded_file&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;save&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;src&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# (3) The following bizarre syntax is because we want to unwrap Fasta file; note that the&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# shell script unwrap.sh takes care of writing the output file at the right place.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# A simpler call would be cmd = &amp;#34;mafft src &amp;gt; outfile&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cmd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;mafft &amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;src&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;| &amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dirname&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;abspath&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="vm"&gt;__file__&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/bin/unwrap.sh&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cmd&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;render_template&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;result.html&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;outfile&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;render_template&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;upload.html&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;templates/result.html&lt;/code&gt; page is just a read-only version of the &lt;code&gt;templates/upload.html&lt;/code&gt; page, in my case:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-html" data-lang="html"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;&amp;lt;!-- defined in templates/result.html --&amp;gt;&lt;/span&gt;&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;form-group&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;textarea&lt;/span&gt; &lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;form-control rounded-0&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;rows&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;30&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;wrap&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;off&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;{{ text }}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;textarea&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="na"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;{{ url_for(&amp;#39;.download&amp;#39;) }}&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Download&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And that&amp;rsquo;s it!&lt;/p&gt;
&lt;p&gt;For production, it is recommended to use another proxy, like &lt;a href="https://pypi.org/project/waitress/"&gt;waitress&lt;/a&gt;, and replace &lt;code&gt;app.run(host=&amp;quot;localhost&amp;quot;)&lt;/code&gt; with something like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;waitress&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;serve&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;serve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;0.0.0.0&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;5000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;I once built a simple CGI script to launch Stata on a remote (personal) server and collect result in plain old text files. That was quite funny, but deploying this kind of stuff over secured networks is a pain.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Reading list on Lisp &amp; Co.</title><link>https://aliquote.org/post/reading-list-lisp/</link><pubDate>Mon, 10 May 2021 09:11:06 +0200</pubDate><guid>https://aliquote.org/post/reading-list-lisp/</guid><description>&lt;p&gt;Randoms musings on the www from Sunday &amp;ndash; on lisp, mostly. Note that most&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; search queries were performed on DuckDuckGo. There may be better hits via Google, but I rarely use Google these days. Originally, I was interested in Vim+Clojure, Clojure+Racket versus CL, in no particular order (time, reputation, etc.). Some posts may be outdated, some others were already cited on the micro-blog. In any case, this led me to update RSS feeds, and the associated &lt;a href="https://aliquote.org/files/chl.opml"&gt;OPML file&lt;/a&gt; that I keep on this site. Feel free to grab it if you like.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://x0r.fr/blog/72"&gt;Du Lisp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://onstrangertides.blog/2019/08/25/why-clojure-is-not-just-yet-another-lisp/"&gt;Why Clojure is not just Yet Another Lisp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://nullprogram.com/blog/2013/01/20/"&gt;Parameter Lists in Common Lisp and Clojure&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://lisp-journey.gitlab.io/blog/state-of-the-common-lisp-ecosystem-2020/"&gt;State of the Common Lisp ecosystem, 2020&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://lisp-journey.gitlab.io/blog/reddit-abcl-common-lisp-vs-clojure/"&gt;Reddit: ABCL Common Lisp vs Clojure&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pvik.github.io/blog/clojure-to-common-lisp-part-1-getting-started/"&gt;Clojure to Common Lisp - Part 1 - Getting Started&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://rpw3.org/"&gt;Rob Warnock (rpw3)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://groups.google.com/g/comp.lang.lisp/c/0M4ojhzSJlQ/m/VF0J2VPaJ2sJ"&gt;How Lisp&amp;rsquo;s Nested Notation Limits The Language&amp;rsquo;s Utility&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://fare.tunes.org/LispM.html"&gt;A few things I know about LISP Machines&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://danielsz.github.io/blog/blog_on_lisp.html"&gt;In the mood for Lisp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dsf.berkeley.edu/papers/ERL-M90-34.pdf"&gt;The implementation of Postgres&lt;/a&gt; (PDF)&lt;/li&gt;
&lt;li&gt;&lt;a href="http://winestockwebdesign.com/Essays/Lisp_Curse.html"&gt;The Lisp Curse&lt;/a&gt; and its &lt;a href="https://news.ycombinator.com/item?id=14480157"&gt;HN companion thread&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.ultratechnology.com/"&gt;UltraTechnology&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://canonical.org/~kragen/sw/urscheme/"&gt;Ur-Scheme&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://bluz71.github.io/2019/10/16/lsp-in-vim-with-the-lsc-plugin.html"&gt;LSP in Vim with the LSC Plugin&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://juxt.pro/blog/vim-1"&gt;Clojure and Vim: An overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://cybertiggyr.com/15-vim.html"&gt;Lisp with Vim&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.catb.org/~esr/faqs/hacker-howto.html"&gt;How To Become A Hacker&lt;/a&gt; and other &lt;a href="http://www.catb.org/~esr/writings/"&gt;writings&lt;/a&gt; by Eric S. Raymond.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://eli.thegreenplace.net/2017/clojure-the-perfect-language-to-expand-your-brain/"&gt;Clojure - the perfect language to expand your brain?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.falkoriemenschneider.de/a__2021-05-10__Six-years-of-professional-Clojure-development.html"&gt;Six years of professional Clojure development&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.complang.tuwien.ac.at/forth/threaded-code.html"&gt;Threaded Code&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stackoverflow.com/questions/5368090/what-are-the-actual-differences-between-scheme-and-common-lisp-or-any-other-tw"&gt;What are the actual differences between Scheme and Common Lisp? (Or any other two dialects of Lisp)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stackoverflow.com/questions/5352997/programming-schemeracket-with-vim-how-to-get-started"&gt;Programming Scheme(Racket) with VIM - How to get started&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://8thlight.com/blog/sarah-sunday/2017/01/24/common-lisp-clojure-cons-cells.html"&gt;Comparing Common LISP and Clojure: Cons Cells&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://joeygibson.com/2014/07/13/lolclojure-chapter-3-continued/"&gt;LoLClojure – Chapter 3, Continued&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://otavio.dev/2020/09/09/clojure-journey-iii-simplicity-evaluation-and-syntax/"&gt;Clojure Journey V – Simplicity, Evaluation and Syntax&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://elangocheran.com/2020/03/18/why-clojure-lisp-is-good-for-writing-transpilers/"&gt;Why Clojure (Lisp) is good for writing transpilers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.karimarttila.fi/clojure/2021/01/27/clojure-emacs-vs-cursive.html"&gt;Comparing Clojure IDEs - Emacs/Cider vs IDEA/Cursive&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blog.cleancoder.com/uncle-bob/2019/08/22/WhyClojure.html"&gt;Why Clojure?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.cognitect.com/blog/2008/12/17/on-lisp-clojure-chapter-9"&gt;On Lisp -&amp;gt; Clojure, Chapter 9&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.xach.com/naggum/articles/3063714891614719@naggum.no.html"&gt;Re: Which one, Lisp or Scheme?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://groups.google.com/g/comp.lang.lisp/c/ZKJyAbgwcBU/m/jbGevBxZOeIJ"&gt;The Next Generation of Lisp Programmers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://programming-puzzler.blogspot.com/2010/08/racket-vs-clojure.html"&gt;Racket vs. Clojure&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.macadie.net/2016/05/23/note-and-plans-on-lisp-racket-scheme-clojure-and-other-buzzwords/"&gt;Note And Plans On Lisp, Racket, Scheme, Clojure and Other Buzzwords&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.macadie.net/2019/03/14/2019-03-14-update-simply-scheme-simply-clojure-simply-racket/"&gt;2019-03-14 Update: Simply Scheme, Simply Clojure, Simply Racket&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://klibert.pl/posts/clojure_and_racket_history.html"&gt;Clojure and Racket: Origins&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://svetlinmladenov.wordpress.com/2013/01/06/the-complexity-of-the-length-function-in-mit-scheme-racket-scheme-erlang-and-clojure/"&gt;The complexity of the length function in MIT-Scheme, Racket-Scheme, Erlang and Clojure&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://trustica.cz/en/2019/04/04/working-with-clojure-and-racket/"&gt;Working with Clojure and Racket&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://thegreata.pe/articles/2016/11/25/notes-on-writing-clojure-in-vim/"&gt;Notes On Writing Clojure In Vim&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blog.djy.io/conjuring-clojure-in-vim-2020-edition/"&gt;Conjuring Clojure in Vim: 2020 Edition&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://purelyfunctional.tv/guide/clojure-concurrency/"&gt;Clojure Concurrency Tutorial&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Some of the links cited above are also the results of cross-referencing Reddit or HackerNews.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Vim and LSP</title><link>https://aliquote.org/post/vim-and-lsp/</link><pubDate>Sun, 09 May 2021 08:17:37 +0200</pubDate><guid>https://aliquote.org/post/vim-and-lsp/</guid><description>&lt;p&gt;There is a &lt;a href="https://bluz71.github.io/2019/10/16/lsp-in-vim-with-the-lsc-plugin.html"&gt;long list&lt;/a&gt; of Vim or Neovim plugin that implement Microsoft&amp;rsquo;s LSP capabilities. I use &lt;a href="https://github.com/dense-analysis/ale"&gt;Ale&lt;/a&gt;, because it is a lightweight plugin which provides both asynchronous linting and fixing, and expose most of LSP functionalities (e.g., go to definition or references, hover on symbol, rename, code action). It is also well integrated into Vim&amp;rsquo;s ecosystem like omnicompletion, quickfix list, etc. It is also in line with my expectations: It should not rely on Node with its bazillions of packages, as is the case for &lt;a href="https://github.com/neoclide/coc.nvim"&gt;Coc&lt;/a&gt;, and it should run on Neovim 0.4+ and Vim 8. Above all, if you are not that interested in LSP stuff (intellisense and the like), you can just deactivate and still enjoy external linters. This is mostly what I tend to use these days.&lt;/p&gt;
&lt;p&gt;It only happens to me recently that some of the other LSP plugins can interact with ALE, especially to delegate the display of diagnostics to Ale while providing most of LSP under the hood. Indeed, Ale works pretty well for Python, Rust and Haskell, but there&amp;rsquo;s no support for Clojure other than &lt;code&gt;clj-kondo&lt;/code&gt; (or &lt;code&gt;joker&lt;/code&gt;), despite the availability of &lt;a href="https://clojure-lsp.github.io/clojure-lsp/"&gt;clojure-lsp&lt;/a&gt;. I tried to configure Ale to use it, but I failed miserably and I haven&amp;rsquo;t found much support using Google. According to the &lt;a href="https://clojure-lsp.github.io/clojure-lsp/clients/"&gt;docs&lt;/a&gt;, it should be as easy as adding the following setup:&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-vim" data-lang="vim"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;call&lt;/span&gt; &lt;span class="nx"&gt;ale&lt;/span&gt;#&lt;span class="nx"&gt;linter&lt;/span&gt;#&lt;span class="nx"&gt;Define&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;clojure&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \ &lt;span class="s1"&gt;&amp;#39;name&amp;#39;&lt;/span&gt;: &lt;span class="s1"&gt;&amp;#39;clojure-lsp&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \ &lt;span class="s1"&gt;&amp;#39;lsp&amp;#39;&lt;/span&gt;: &lt;span class="s1"&gt;&amp;#39;stdio&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \ &lt;span class="s1"&gt;&amp;#39;executable&amp;#39;&lt;/span&gt;: &lt;span class="s1"&gt;&amp;#39;/home/chl/.local/bin/clojure-lsp&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \ &lt;span class="s1"&gt;&amp;#39;command&amp;#39;&lt;/span&gt;: &lt;span class="s1"&gt;&amp;#39;/bin/zsh -c %e&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \ &lt;span class="s1"&gt;&amp;#39;project_root&amp;#39;&lt;/span&gt;: &lt;span class="s1"&gt;&amp;#39;~/.lsp/config.edn&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \}&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;While Ale succeeded at initializing the server, I was left with zero functionality afterwards.&lt;/p&gt;
&lt;p&gt;It looks like the recommended way of doing things is to install &lt;a href="https://github.com/prabirshrestha/vim-lsp"&gt;vim-lsp&lt;/a&gt; (or &lt;a href="https://github.com/natebosch/vim-lsc"&gt;vim-lsc&lt;/a&gt;), and maybe &lt;a href="https://github.com/rhysd/vim-lsp-ale"&gt;vim-lsp-ale&lt;/a&gt;. I got a working installation in a few minutes, at the price of adding an extra package to my configuration. Since vim-lsp is able to talk to Ale, that means it is able to delegate diagnostics to Ale&amp;rsquo;s own display system &amp;ndash; this not the case of vim-lsc, &lt;a href="https://github.com/natebosch/vim-lsc/issues/337"&gt;as far as I can tell&lt;/a&gt;. This is quite convenient, especially since it allows to run only one instance of the server.&lt;/p&gt;
&lt;p&gt;Of course, there are other fancy alternatives like &lt;a href="https://github.com/Olical/conjure"&gt;Conjure&lt;/a&gt; or &lt;a href="https://github.com/liquidz/vim-iced"&gt;Iced&lt;/a&gt;, although for the later there are additional plugins to install. I gave Conjure a try a few months ago but didn&amp;rsquo;t like the popup window always on. I mean, I like the idea of having a playground or a live REPL (à la LightTable) sometimes, but not when I only want to write or read code Your mileage may vary of course, but see this nice blog post on Conjure: &lt;a href="https://blog.djy.io/conjuring-clojure-in-vim-2020-edition/"&gt;Conjuring Clojure in Vim: 2020 Edition&lt;/a&gt;. I will stick to &lt;a href="https://github.com/tpope/vim-fireplace"&gt;fireplace&lt;/a&gt; for the time being. Tim Pope&amp;rsquo;s plugins are always excellent, and it remains by far the lightest package for Clojure in Vim, and also the closest to Vim&amp;rsquo;s internals (as most of Tim Pope&amp;rsquo;s plugins).&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;See also &lt;a href="https://www.vimfromscratch.com/articles/vim-and-language-server-protocol/"&gt;Vim and Language Server Protocol&lt;/a&gt; in &lt;em&gt;Vim from scratch&lt;/em&gt;.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Random musings with VS Code</title><link>https://aliquote.org/post/vscode-yet-again/</link><pubDate>Fri, 07 May 2021 08:36:56 +0200</pubDate><guid>https://aliquote.org/post/vscode-yet-again/</guid><description>&lt;p&gt;It&amp;rsquo;s been almost a year since I switched to Vim for writing prose and code on my computer. I understand modal editing a lot more than I did last time I discussed &lt;a href="https://aliquote.org/post/editor-war/"&gt;Evil on Emacs&lt;/a&gt;, and I feel comfortable using Neovim everyday, for everything related to text. I use few plugins in order to keep close to builtin stuff and because I don&amp;rsquo;t really need much more. As I am more and more interested in Haskell and Rust, I tested their LSP backends as driven by &lt;a href="https://github.com/dense-analysis/ale"&gt;Ale&lt;/a&gt;. I&amp;rsquo;m pretty okay with that setup because Ale is not intrusive at all, especially given the way I configured it (minimal error/warning signs in the gutter, delayed auto-completion so that I can complete myself before the completion list pop up if I need it, a few handy keybindings). I know Neovim 0.5+ comes up with a builtin LSP backend, but this setup suits me for the moment.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve be playing with VS Code yesterday, mostly for browsing purpose, not really coding. In fact, I believe I am incompetent at GUIs or IDEs nowadays, but for code browsing VS Code is pretty interesting, if only for inlays hints in Rust&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; or &lt;a href="https://gitlens.amod.io/"&gt;Gitlens&lt;/a&gt; to browse Git history. I feel, however, more comfortable with a traditional editor like Emacs or Vim with minimal addons, as I always said. I should note that there&amp;rsquo;s a &lt;a href="https://marketplace.visualstudio.com/items?itemName=vscodevim.vim"&gt;Vim extension&lt;/a&gt; for VS Code. I use it, but it looks like Vim shortcuts don&amp;rsquo;t apply everywhere in the app window. For instance, if you are viewing the keybindings cheatsheet (the one that comes with interactive search), then you&amp;rsquo;re back to non modal keybindings. Also, ex and visual interaction do not feel as fast and natural as they are in Vim or Neovim, or even Doom Emacs. Above all, VS Code is mostly a mouse-oriented text editor. I have nothing against using a mouse, this is just that I don&amp;rsquo;t feel I really need it when I&amp;rsquo;m writing on a computer. I never used anything other than builtin touchpad on my laptop, and the one I have on the Latitude 7310 isn&amp;rsquo;t that great, to be honest. That being said, the point is that if I can do everything I want by using simple shortcuts, why using a mouse? Whether the keyboard is faster than the mouse is yet &lt;a href="https://danluu.com/keyboard-v-mouse/"&gt;another story&lt;/a&gt;.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;About VS Code, I installed only a few extensions, mostly for Haskell, Rust, Python and C. In the case of Rust, I learnt that you must choose between the official &lt;a href="https://marketplace.visualstudio.com/items?itemName=rust-lang.rust"&gt;rust-lang&lt;/a&gt; or &lt;a href="https://marketplace.visualstudio.com/items?itemName=matklad.rust-analyzer"&gt;rust-analyzer&lt;/a&gt; extension, otherwise you get a warning that they may clash at some point. My impression is that rust-analyzer is slower with VS Code compared to Neovim on the same codebase, but that may just be me. There was nothing special about Haskell that I didn&amp;rsquo;t already get in Neovim, and the same applies for Python. I just spent half an hour adding shortcuts for the LSP features I use the most, namely Hover on symbol, Go to Definition, Go to References, and Rename.&lt;/p&gt;
&lt;p&gt;I also needed to set up a decent color scheme. I&amp;rsquo;m quite happy with the minimalism of Tonsky&amp;rsquo;s &lt;a href="https://github.com/tonsky/vscode-theme-alabaster"&gt;Alabaster&lt;/a&gt; theme, but I wanted an even more minimalistic syntax highlighting scheme, comparable to what I use in Vim, and in Emacs beforehand. This is now almost done, but what a mess! While in Vim it is enough to write a single line &lt;code&gt;Hi Comment ctermfg=103&lt;/code&gt;, this becomes&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;&amp;#34;editor.tokenColorCustomizations&amp;#34;&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;[Alabaster]&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;comments&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;#8787af&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="err"&gt;...&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Even more, if you want comments to be italicized, then you have to add:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;&amp;#34;textMateRules&amp;#34;&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;scope&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;comment&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;settings&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;fontStyle&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;italic&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And things go on and go on for every particular aspect of a programming language. For instance, Haskell has many different scopes like &lt;code&gt;constant&lt;/code&gt;, &lt;code&gt;storage.type&lt;/code&gt;, &lt;code&gt;entity.name.namespace&lt;/code&gt;, &lt;code&gt;keyword.other.newtype&lt;/code&gt;, etc. The same applies to Python or Rust, of course, which means that you end up with a long list of custom &amp;ldquo;TextMate rules&amp;rdquo;, in JSON because why not. I wish there was a simpler way to apply custom syntax rules right from the Scope inspector in VS Code.&lt;/p&gt;
&lt;p&gt;As I said above, I use the Vim extension because I don&amp;rsquo;t like standard key mappings in VS Code (or any other GUI application really). Of course, there are some conflicts with built-in shortcuts like &lt;code&gt;Ctrl+B&lt;/code&gt; which is used to open/close the explorer tree in VS Code, while it has a different purpose in Vim. Henceforth, you need remapping. Remapping is different if this is about standard shortcuts or a specific extension. Here is what we have to do with standard keybindings in &lt;code&gt;keybindings.json&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;key&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;ctrl+h&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;command&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;workbench.action.navigateLeft&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="err"&gt;...&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;However, in the case of the Vim extension, this becomes:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;&amp;#34;vim.normalModeKeyBindingsNonRecursive&amp;#34;&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt;...&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;before&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;&amp;lt;ctrl&amp;gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;b&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;after&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;commands&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;workbench.view.explorer&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt;...&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Lovely. And this goes in &lt;code&gt;settings.json&lt;/code&gt;, not &lt;code&gt;keybindings.json&lt;/code&gt; by the way! Lastly, it was time to get rid of the activity bar, the explorer tree, and the tab bar.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/2021-05-07-19-14-17.png"&gt;
&lt;/figure&gt;
&lt;small&gt;Apparently, I still have some work to do for Markdown colors&amp;hellip;&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;Anyway, I believe VS Code is a great asset, midway between a feature-complete mouse+keyboard-driven text editor and a minimalistic IDE. Clearly, it has gained so much attention in the past 5 years or so that it&amp;rsquo;s hard to imagine someone looking for a good text editor for coding who end up using Notepad+, GEdit, or Kate. And it&amp;rsquo;s surely the perfect tool for the big hearing of web devs (business is business). However, I like Vim (or Emacs) better for it allows me to stay focus on the text I write.&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Note that this is also available when using Emacs with &lt;a href="https://emacs-lsp.github.io/lsp-mode/"&gt;LSP mode&lt;/a&gt;.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;See also &lt;a href="http://www.call-with-current-continuation.org/articles/keyboard-vs-mice.html"&gt;Some words about the discussion on keyboard/mouse efficiency&lt;/a&gt;, by the creator of Chicken Scheme.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Hex color dimming</title><link>https://aliquote.org/post/hex-color-dimming/</link><pubDate>Sun, 02 May 2021 21:02:41 +0200</pubDate><guid>https://aliquote.org/post/hex-color-dimming/</guid><description>&lt;p&gt;My color scheme for the terminal is rather unusual, but it is in part inspired by the Belafonte Day color theme. I initially configured Kitty to use my custom theme, and then extend it to other terminal emulators and text editors, although for the later I don&amp;rsquo;t really use colors (except for highlighting strings, number and all sorts of literals). Actually, I&amp;rsquo;m only using 10 colors instead of 16, meaning I use the same low and high contrast color for all colors except black and white &amp;ndash; which are not really black and white, by the way.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2021-05-01-10-55-23.png"&gt;
&lt;/figure&gt;
&lt;p&gt;In case I need it, it would be nice to be able to slightly decrease the luminance of the alternative colors. Since we are working using Hex codes, it involves a bit more work than with HSL. In essence, this has been covered in this &lt;a href="https://www.sitepoint.com/javascript-generate-lighter-darker-color/"&gt;blog post&lt;/a&gt;, or in various StackOverflow threads.&lt;/p&gt;
&lt;p&gt;I originally thought that this would be a perfect task for a &lt;code&gt;foldr&lt;/code&gt;-like recursion in Racket (or Haskell). However, a simpler solution would be to rely on Racket&amp;rsquo;s &lt;code&gt;for/fold&lt;/code&gt; form which facilitates the use of accumulators. Converting an Hex number to its decimal counterpart lends itself well to recursive writing: it is enough to iterate over each digit, from right to left, and add them up once weighted by 16 times their previous weight, where for the base case the weight equals 1. As for the guard of this recursive solution, we just have to check that there are no more digit to proceed with. This approach is known as Horner&amp;rsquo;s rule, which is widely used in the case of polynomials. Indeed, for any base $b$, the decimal representation of a number can be found from the following expansion:&lt;/p&gt;
&lt;p&gt;$$\dots + x_2b^2 + x_1b^1 + x_0b^0 + x_{-1}b^{-1} + x_{-2}b^{-2} + \dots,$$&lt;/p&gt;
&lt;p&gt;As we did &lt;a href="https://aliquote.org/post/hex-to-base64/"&gt;earlier&lt;/a&gt;, to convert a number in Hex notation to its decimal representation we can use &lt;code&gt;number-&amp;gt;string&lt;/code&gt; directly, as in &lt;code&gt;(number-&amp;gt;string #x7e5 10)&lt;/code&gt; (which should return &amp;ldquo;2021&amp;rdquo;). In the above polynomial expansion, negative exponents and indices represent the fractional parts of the number. If you only work with integers, you can safely remove everything after $x_0b^0$. As an example, consider the base 2 number 1101&lt;sub&gt;2&lt;/sub&gt;:&lt;/p&gt;
&lt;p&gt;$$
\begin{align}
1101_2 &amp;amp; = (1 \cdot 2^3 + 1 \cdot 2^2 + 0 \cdot 2^1 + 1 \cdot 2^0)_{10} \cr
&amp;amp; = (((0 \cdot 2 + 1) \cdot 2 + 1) \cdot 2 + 0) \cdot 2 + 1 \cr
&amp;amp; = 13_{10}
\end{align}
$$&lt;/p&gt;
&lt;p&gt;Same idea for the Hex number above (without assuming that #7E5 expands to #77EE55):&lt;/p&gt;
&lt;p&gt;$$
\begin{align}
\text{#7E5} &amp;amp; = (7 \cdot 16^2 + 14 \cdot 16^1 + 5 \cdot 16^0)_{10} \cr
&amp;amp; = 2021_{10}
\end{align}
$$&lt;/p&gt;</description></item><item><title>Reflecting on my RSS habits</title><link>https://aliquote.org/post/reflecting-on-my-rss-habits/</link><pubDate>Thu, 29 Apr 2021 21:59:27 +0200</pubDate><guid>https://aliquote.org/post/reflecting-on-my-rss-habits/</guid><description>&lt;p&gt;While listening to a nice compilation of &lt;a href="https://music.apple.com/us/playlist/jazz-chill/pl.63271312c084419891982eab46cc68ac"&gt;Jazz Chill&lt;/a&gt; (no sponsoring, my Macbook mostly became my private juke box since I switched to Ubuntu), I was thinking of how my web reading habits evolved with time. Back in 2010 I was learning a lot of useful tips almost every day on Twitter, and I collected thousands of bookmarks during 8 or 9 years. Nowadays, there&amp;rsquo;s nothing left on Twitter except personal timelines I like to follow from time to time. I always have had an RSS feed reader since 2008, but it is now my primary source of information and I don&amp;rsquo;t even have to leave my terminal for reading interesting blog posts.&lt;/p&gt;
&lt;p&gt;Looking at the tags I have in &lt;a href="https://newsboat.org/"&gt;Newsboat&lt;/a&gt;, I realize half of the blogs I follow are about Unix, Emacs and Vim, and Lisp. The remaining feeds are all about statistics, mathematics, infosec and web dev. Back in 2010, 80% of my feeds were about R and statistics. I cleaned up most of the R feeds I was following, and many statisticians I was following no longer maintain their website. Hopefully, some blogs are still alive and I keep reading some of these old real gems (e.g., &lt;a href="https://www.johndcook.com/blog/"&gt;John D. Cook&lt;/a&gt;&amp;rsquo;s blog; see also my &lt;a href="https://aliquote.org/articles/how-i-do"&gt;top list&lt;/a&gt;). I renewed my reading list, of course. I have little confidence in the sustainability of some websites hosted on github.io, but right now I&amp;rsquo;m happy with my reading list. I estimate that around 15% of the feeds I have are dead by now, but that&amp;rsquo;s okay. There&amp;rsquo;s the history in plain text on my hard drive in case I want to read old posts of theirs.&lt;/p&gt;
&lt;p&gt;Needless to say, I can understand why some of them quit. With the advent of social networks, blogging platforms (e.g., Medium), Github gists etc., it has become easier and easier to communicate without investing too much time and energy into long time sustainaibility. After all, those platforms should take care of keeping your writings &amp;ldquo;alive&amp;rdquo;, and if you don&amp;rsquo;t have much time or inclination to continue, you can leave it there. It&amp;rsquo;s just as exciting to start writing on a blog as it is easy to forget to update it. This kind of consideration has often happened to me in the past. Also, interests can change from one day to the next, professional activities and family life also change. I&amp;rsquo;m not blaming those folks who wrote wonderful content and stop one day. After all, we must be happy for what happened, and not be sad when the story ends.&lt;/p&gt;
&lt;p&gt;That being said, here&amp;rsquo;s the state of affairs as of 2021. One of the blog I will miss, though, is that of Larry Wasserman. It was an amazing source of inspiration for statisticians. The end of the journey was a thing, too:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Which brings me to the point of this post which, to quote George Costanza, is: Alright! That’s it for me. Goodnight everybody. &lt;br&gt;
I have pretty much covered all the topics I wanted to cover in this blog. So at this point I have three choice: (1) Start reporting on daily trivia such as the antics of my cats Dizzy and Miles. (Did I mention that Dizzy caught a mouse a few days ago?); (2) Start posting every other month. (No good: people stop reading.); (3) Stop. &lt;br&gt;
I think the third option is the best.&lt;br&gt;
To all of you who have been reading the blog: thanks. And a special thanks to those who have commented or written guest posts.&lt;br&gt;
Who knows, perhaps I will start another blog someday. But for now, Hasta la vista, baby. &amp;mdash; &lt;a href="https://normaldeviate.wordpress.com/"&gt;Normal Deviate &amp;ndash; The End&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Hopefully, &lt;a href="https://www.fharrell.com/"&gt;Frank Harrell&lt;/a&gt; is posting some enlightening ideas and recommendations on his own blog. And I keep an eye on &lt;a href="https://www.johnmyleswhite.com/posts/"&gt;John Myles White&lt;/a&gt;&amp;rsquo;s good old blog. The former is quite recent (two years, IIRC) while I follow the later since 2011. Let&amp;rsquo;s just hope people will continue publishing good content and make it available through RSS (as far as I can tell, this is not alaways the case and those posts generally end up as simple bookmarks on the &lt;a href="https://aliquote.org/micro"&gt;Micro&lt;/a&gt; section of this site).&lt;/p&gt;</description></item><item><title>Micro posting in April</title><link>https://aliquote.org/post/micro-04-2021/</link><pubDate>Thu, 29 Apr 2021 09:59:08 +0200</pubDate><guid>https://aliquote.org/post/micro-04-2021/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-04-01&lt;/a&gt;: I wonder who&amp;rsquo;s behind this project: &lt;a href="https://lisp-stat.dev/"&gt;Welcome to Lisp-Stat: An environment for Statistical Computing&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-01&lt;/a&gt;: &lt;a href="https://www.scunning.com/mixtape.html"&gt;Causal Inference: The Mixtape&lt;/a&gt;: An accessible, contemporary introduction to the methods for determining cause and effect in the social sciences.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-01&lt;/a&gt;: &lt;a href="https://statweb.stanford.edu/~tibs/ftp/NCV.pdf"&gt;Cross-validation: what does it estimate and how well does it do it?&lt;/a&gt; (PDF, 36 pp.)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-01&lt;/a&gt;: &lt;a href="https://chris-said.io/2021/03/28/youre-measuring-wrong/"&gt;You’re probably measuring your treatment effect incorrectly&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-06&lt;/a&gt;: &amp;gt; Typography matters because it helps conserve the most valuable resource you have as a writer—reader attention. &amp;mdash; &lt;a href="https://practicaltypography.com/"&gt;Practical Typography&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-06&lt;/a&gt;: &lt;a href="https://cfenollosa.com/blog/fed-up-with-the-mac-i-spent-six-months-with-a-linux-laptop-the-grass-is-not-greener-on-the-other-side.html"&gt;Fed up with the Mac, I spent six months with a Linux laptop. The grass is not greener on the other side&lt;/a&gt;. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-07&lt;/a&gt;: I just realized today that the &lt;a href="https://sw.kovidgoyal.net/kitty/"&gt;kitty&lt;/a&gt; terminal emulator that I installed on Ubuntu 20.04 is kitty v15, which is missing lot of features from most recent releases (at least the one I have on my Macbook).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-07&lt;/a&gt;: &lt;a href="https://morrick.me/archives/9284"&gt;20 years of Mac OS X - Some of my favourite features&lt;/a&gt;. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-08&lt;/a&gt;: Cooking and drinking.
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1441.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1441.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1443.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1443.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-08&lt;/a&gt;: &lt;a href="https://martinheinz.dev/blog/46"&gt;All The Important Features and Changes in Python 3.10&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-08&lt;/a&gt;: &lt;a href="https://dataswamp.org/~solene/2021-03-25-computer-to-phone-text.html"&gt;Easy text transmission from computer to smartphone&lt;/a&gt;. Lovely use of Un*x pipes and QR code.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-08&lt;/a&gt;: &lt;a href="https://tug.org/TUGboat/tb42-1/tb130knuth-tuneup21.pdf"&gt;TEX Version 3.141592653&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-12&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Build systems for small programs or libraries will often spend 10+ seconds running configure and complete the actual compilation and linking in a fraction of that time. In other words, the setup to perform the build takes longer than the build itself! &amp;mdash; &lt;a href="https://gregoryszorc.com/blog/2021/04/06/surprisingly-slow/"&gt;Surprisingly slow&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-04-12&lt;/a&gt;: Great work in Victor&amp;rsquo;s new post: &lt;a href="https://tenthousandmeters.com/blog/python-behind-the-scenes-10-how-python-dictionaries-work/"&gt;Python behind the scenes #10: how Python dictionaries work&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-12&lt;/a&gt;: Just found out lovely pictures from &lt;a href="https://www.oldbookillustrations.com/"&gt;this website&lt;/a&gt;, especially in the &amp;ldquo;plants&amp;rdquo; category.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-12&lt;/a&gt;: &lt;a href="https://antonz.org/python-packaging/"&gt;How to make an awesome Python package in 2021&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-12&lt;/a&gt;: &lt;a href="https://github.com/nalgeon/sqlean"&gt;SQLean: all the missing SQLite functions&lt;/a&gt;. &lt;code&gt;#database&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-12&lt;/a&gt;: &lt;a href="https://tanelp.github.io/posts/a-bug-that-plagues-thousands-of-open-source-ml-projects/"&gt;Using PyTorch + NumPy? You&amp;rsquo;re making a mistake&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-13&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;We are now in the 2020 year, and this is also the year that Lisp would become 62 years old! That is an impressive age for a programming language. With that said that does not mean that the concepts and ideas developed in Lisp are old. &amp;mdash; &lt;a href="https://dnaeon.github.io/starting-with-common-lisp-in-2020/"&gt;Starting with Common Lisp in 2020&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-04-14&lt;/a&gt;: &lt;a href="https://journals.sagepub.com/doi/10.1177/09622802211002867"&gt;Predictive performance of machine and statistical learning methods: Impact of data-generating processes on external validity in the “large N, small p” setting&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-15&lt;/a&gt;: &lt;a href="" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Jeanne Added, &lt;em&gt;Be Sensational&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-15&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In The Hitchhiker&amp;rsquo;s Guide to the Galaxy, Douglas Adams mentions an extremely dull planet, inhabited by a bunch of depressed humans and a certain breed of animals with sharp teeth which communicate with the humans by biting them very hard in the thighs. This is strikingly similar to UNIX, in which the kernel communicates with processes by sending paralyzing or deadly signals to them. Processes may intercept some of the signals, and try to adapt to the situation, but most of them don&amp;rsquo;t. &amp;mdash; &lt;a href="https://www.linusakesson.net/programming/tty/index.php"&gt;The TTY demystified&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-04-15&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In the Linux community I often heard the call that surely now is the year of the Linux desktop, where Linux would be ready to be used by ordinary people. The point where finally Linux would be as good as Windows. For me, it is now nearly 20 years of Linux desktop. The call has stopped, mostly because the desktop is not as important anymore. Desktops are mostly used to display a browser and browsers are available everywhere. Also there are smartphones and most of them run Linux. &amp;mdash; &lt;a href="https://beza1e1.tuxen.de/my_linux_history.html"&gt;My Linux History&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-04-15&lt;/a&gt;: If you are in urgent need of some good music: &lt;a href="https://lofi.cafe/"&gt;https://lofi.cafe/&lt;/a&gt;. (press &lt;kbd&gt;h&lt;/kbd&gt; to get some help)&lt;br&gt;&lt;img src="https://aliquote.org/img/2021-04-15-21-04-56.png" alt="lofi"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-15&lt;/a&gt;: &lt;a href="https://www.maths.ed.ac.uk/~tl/ed/"&gt;Entropy and Diversity: The Axiomatic Approach&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-15&lt;/a&gt;: &lt;a href="http://webdam.inria.fr/Alice/"&gt;Foundations of Databases&lt;/a&gt; (PDF, 678 pp.). &lt;code&gt;#database&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-15&lt;/a&gt;: &lt;a href="https://her.esy.fun/posts/0010-Haskell-Now/index.html"&gt;Learn Haskell Now!&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-15&lt;/a&gt;: &lt;a href="https://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/"&gt;Learn Vim Progressively&lt;/a&gt;: Very nice hand-on material for beginner. I would add that it&amp;rsquo;s still possible to add ̀&lt;code&gt;C-a&lt;/code&gt; and &lt;code&gt;C-e&lt;/code&gt; keybindings for Insert mode if you are used to using the terminal with default Emacs keybindings a lot. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-15&lt;/a&gt;: &lt;a href="https://www.brandons.me/blog/why-rust-strings-seem-hard"&gt;Why Rust strings seem hard&lt;/a&gt;. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-15&lt;/a&gt;: &lt;a href="https://github.com/dnaeon/cl-data-structures"&gt;cl-data-structures&lt;/a&gt;: Data structures (mutable and immutable) + stream algorithms (aggregations, group-by and so one). &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-18&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/the-hungry-saw/278733974" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Tindersticks, &lt;em&gt;Hungry Saw&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-18&lt;/a&gt;: Currently reading:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The resulting outcome may not be in equilibrium and may display patterns and emergent phenomena not visible to equilibrium analysis. The economy becomes something not given and existing but constantly forming from a developing set of actions, strategies and beliefs — something not mechanistic, static, timeless and perfect but organic, always creating itself, alive and full of messy vitality. &amp;mdash; &lt;a href="https://www.nature.com/articles/s42254-020-00273-3"&gt;Foundations of complexity economics&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-04-18&lt;/a&gt;: Google making Recommender Systems at scale? &lt;a href="https://github.com/WICG/floc"&gt;https://github.com/WICG/floc&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-18&lt;/a&gt;: Morning, evening.
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1455.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1455.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1454.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1454.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-19&lt;/a&gt;: Old times, good times. &lt;a href="https://www.adobe.com/content/dam/acom/en/devnet/actionscript/articles/PLRM.pdf"&gt;PostScript® LANGUAGE REFERENCE (3rd ed.)&lt;/a&gt; (PDF, 912 pp.).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-21&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_1461.JPG" alt="img"&gt;&lt;small&gt;Today&amp;rsquo;s lunch&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-21&lt;/a&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.mvanga.com/blog/basic-music-theory-in-200-lines-of-python"&gt;Basic Music Theory in ~200 Lines of Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://fiftysevendegreesofrad.github.io/JupyterNotes/piano.html"&gt;Deriving the piano keyboard from biological principles using clustering&lt;/a&gt;&lt;br&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-04-21&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Mac OS X is Apple&amp;rsquo;s effort to create a best-of-both-breeds operating system which directly leverages the advances and experience Apple has in the user experience arena and the well-established power of BSD. Mac OS X begins with a BSD foundation called Darwin. On Darwin we build the programming toolkits from Mac OS which we call Carbon, which in turn enables us to layer on the new user interface known as Aqua. Carbon also provides a straightforward transition strategy for our existing application base. We also provide a toolkit called Cocoa, which is an object-oriented API derived from NeXT&amp;rsquo;s OpenStep. &amp;mdash; &lt;a href="https://www.usenix.org/legacy/publications/library/proceedings/usenix2000/invitedtalks/sanchez_html/sanchez.html"&gt;The Challenges of Integrating the Unix and Mac OS Environments&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-04-21&lt;/a&gt;: Just found out my way to long-lasting Inbox zero: Using Neomutt, &lt;code&gt;macro index D &amp;quot;&amp;lt;tag-pattern&amp;gt;~d &amp;gt;1m&amp;lt;enter&amp;gt;&amp;lt;tag-prefix-cond&amp;gt;&amp;lt;delete-message&amp;gt;&amp;quot; &amp;quot;trash old mail&amp;quot;&lt;/code&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-21&lt;/a&gt;: &lt;a href="https://jwiegley.github.io/git-from-the-bottom-up/"&gt;Git from the Bottom Up&lt;/a&gt;. &lt;code&gt;#git&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-23&lt;/a&gt;: &lt;a href="https://beej.us/guide/bgc/"&gt;Beej&amp;rsquo;s Guide to C Programming&lt;/a&gt;. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-23&lt;/a&gt;: &lt;a href="https://mhoffman.github.io/2015/05/21/how-to-navigate-directories-with-the-shell.html"&gt;How to navigate directories faster with bash&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-23&lt;/a&gt;: &lt;a href="https://yurichev.com/news/20201021_tar_order/"&gt;Impact of order of files in tar archive on compressed size&lt;/a&gt;. Nice post, which reminds me of an SO post that I referred to &lt;a href="https://aliquote.org/micro/2021-03-22-12-30-41/"&gt;a while ago&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-23&lt;/a&gt;: &lt;a href="https://funcall.blogspot.com/2021/04/and-tail-recursion.html"&gt;η-conversion and tail recursion&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-25&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Go is simple to read, Rust is complicated, C++ is familiar, Zig looks promising but is too young to judge. &amp;mdash; &lt;a href="https://zserge.com/posts/better-c-benchmark/"&gt;A &amp;ldquo;better C&amp;rdquo; benchmark&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-04-25&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If you want a single piece of advice to reduce your bug count, it’s this: Re-read your code frequently. After writing a few lines of code (3 to 6 lines, a short block within a function), re-read them. That habit will save you more time than any other simple change you can make. &amp;mdash; &lt;a href="https://www.teamten.com/lawrence/programming/dont-write-bugs.html"&gt;Don&amp;rsquo;t write bugs&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-04-25&lt;/a&gt;: &lt;a href="https://alexomara.com/blog/distort-image-into-isosceles-trapezoid-with-canvas/"&gt;Distort Image into Isosceles Trapezoid with Canvas&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-25&lt;/a&gt;: &lt;a href="https://www.teamten.com/lawrence/style/"&gt;Elements of C Style&lt;/a&gt;. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-25&lt;/a&gt;: &lt;a href="https://gist.github.com/steven2358/ba153c642fe2bb1e47485962df07c730"&gt;FFmpeg cheat sheet&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-25&lt;/a&gt;: &lt;a href="https://js4ds.org/"&gt;JavaScript for Data Science&lt;/a&gt;. Great work, but still I don&amp;rsquo;t like the omnibus word &amp;ldquo;Data Science&amp;rdquo;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-25&lt;/a&gt;: &lt;a href="https://cheats.rs/"&gt;Rust Language Cheat Sheet&lt;/a&gt;. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-25&lt;/a&gt;: &lt;a href="https://www.metachris.com/2021/04/starting-a-typescript-project-in-2021/"&gt;Starting a TypeScript Project in 2021&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-26&lt;/a&gt;: Currently reading &lt;a href="https://github.com/ashok-khanna/common-lisp-by-example"&gt;Common Lisp by Example&lt;/a&gt;, and I feel like it is quite a good introduction to LISP in just under 60 pages. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-26&lt;/a&gt;: Lovely autocorrection by Git, although 0.1s is a bit too quick for me, especially when I don&amp;rsquo;t look at the screen (I often perform incremental commits using a combination of &lt;code&gt;git add . &amp;amp;&amp;amp; git amend&lt;/code&gt;, where &lt;code&gt;amend&lt;/code&gt; is aliased to &lt;code&gt;amend = commit --amend --reuse-message=HEAD&lt;/code&gt;).&lt;br&gt;&lt;img src="https://aliquote.org/img/2021-04-26-14-15-51.png" alt="git amend"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-27&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;What&amp;rsquo;s even more surprising for Alex is the fact that his peers seem to be different. According to an extensive twitter and blog research he&amp;rsquo;s done in the past, the majority of developers find eternal happiness immediately after the perfect productivity setup is achieved. &amp;mdash; &lt;a href="https://www.theolognion.com/dev-surprised-his-perfect-vim-tmux-bash-xmonad-setup-doesnt-alleviate-existential-crisis/"&gt;Dev surprised his perfect vim/tmux/bash/xmonad setup doesn&amp;rsquo;t alleviate existential crisis&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-04-27&lt;/a&gt;: &lt;a href="https://superuser.com/questions/355325/close-all-locations-list-or-quick-fix-windows-in-vim"&gt;Vim tips&lt;/a&gt;: &lt;code&gt;nnoremap &amp;lt;silent&amp;gt; &amp;lt;leader&amp;gt;X :&amp;lt;C-U&amp;gt;windo lclose &amp;lt;bar&amp;gt; cclose&amp;lt;CR&amp;gt;&lt;/code&gt;. This allows to automagically close the Quickfix or Loclist window, without worrying about which kind of window we deal with. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-28&lt;/a&gt;: A small &lt;a href="https://www.matuzo.at/blog/i-totally-forgot-about-print-style-sheets/"&gt;collection of useful CSS techniques&lt;/a&gt; and a quick reminder that print style sheets are still a thing.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-04-28&lt;/a&gt;: &lt;a href="https://envs.sh/"&gt;envs.sh&lt;/a&gt; | THE NULL POINTER &amp;ndash; file hosting and URL shortening service.&lt;br&gt;&lt;/p&gt;</description></item><item><title>Syracuse numbers</title><link>https://aliquote.org/post/syracuse-numbers/</link><pubDate>Thu, 22 Apr 2021 13:16:45 +0200</pubDate><guid>https://aliquote.org/post/syracuse-numbers/</guid><description>&lt;p&gt;We already covered &lt;a href="https://aliquote.org/post/armstrong-numbers/"&gt;Armstrong numbers&lt;/a&gt;, &lt;a href="https://aliquote.org/post/perfect-or-amicable-numbers/"&gt;perfect and amicable numbers&lt;/a&gt;, and some others remarkable numbers in the past. In this post, we will consider the Syracuse series, which is defined as follows:&lt;/p&gt;
&lt;p&gt;$$ u_{n+1} = \begin{cases} 1 + 3u_n &amp;amp; \text{if $u_n$ is odd} \cr u_n / 2 &amp;amp; \text{if $u_n$ is even}. \end{cases} $$&lt;/p&gt;
&lt;p&gt;This apparent simple recurrence scheme is supposed to yield the number 1 in the end, independent of the starting value $u_n &amp;gt; 0$. This is known as the Syracuse or &lt;a href="https://en.wikipedia.org/wiki/Collatz_conjecture"&gt;Collatz conjecture&lt;/a&gt;. When $u_n = 1$, the series alternate between the values 1 and 4, then 2, and finally 1. Here is a quick implementation in Scheme:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;syracuse?&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;or &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;= &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;even? &lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;syracuse?&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;quotient &lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;syracuse?&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;+ &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;* &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Atabey Kaygun wrote some nice blog posts on the Collatz conjecture, e.g., &lt;a href="https://kaygun.tumblr.com/post/67833833279/collatz-sequences-continued"&gt;Collatz Sequences (Continued)&lt;/a&gt;, &lt;a href="https://kaygun.tumblr.com/post/170044995839/collatz-sequence-yet-again"&gt;Collatz sequence (yet again)&lt;/a&gt;. He also discussed its &lt;a href="https://kaygun.tumblr.com/post/622768677243289600/collatz-sequence-in-binary"&gt;binary representation&lt;/a&gt;, and coincidentally I found &lt;a href="http://lisperator.net/blog/gazing-at-the-numbers-the-collatz-sequence/#tldr"&gt;another blog&lt;/a&gt; that discusses this approach (see Observation #3, which is quite interesting in this respect). Other reference materials include: &lt;a href="http://www.ericr.nl/wondrous/"&gt;On the 3x + 1 problem&lt;/a&gt;, &lt;a href="https://arxiv.org/abs/math/0309224"&gt;The 3x+1 Problem: An Annotated Bibliography (1963-1999)&lt;/a&gt;, and for statistical nerds, &lt;a href="https://www.hindawi.com/journals/jps/2019/6814378/"&gt;On the Probabilistic Proof of the Convergence of the Collatz Conjecture&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Using binary transformations instead of standard arithmetic on decimal numbers is interesting. The idea is to perform integer division (by 2), and store remainders from least (first remainder) to most significant (last). To convert the number 101, we have the following: (with remainder in parenthesis)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; 101 / 2 = 50 (1)
50 / 2 = 25 (0)
25 / 2 = 12 (1)
12 / 2 = 6 (0)
6 / 2 = 3 (0)
3 / 2 = 1 (1)
1 / 2 = 0 (1)
101 -&amp;gt; 1100101
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The binary representation of a positive integer can easily be obtained in Scheme using the following procedure, which is not tail recursive:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;decimal-&amp;gt;binary&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;cond &lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nb"&gt;zero? &lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;else &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cons &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;remainder &lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;decimal-&amp;gt;binary&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;quotient &lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;))))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will return a list of zeros and ones. If you prefer a string, we can use something like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;apply &lt;/span&gt;&lt;span class="nv"&gt;string-append&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;map &lt;/span&gt;&lt;span class="nv"&gt;number-&amp;gt;string&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;decimal-&amp;gt;binary&lt;/span&gt; &lt;span class="mi"&gt;101&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;&amp;#34;1010011&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;However, this is generally a builtin: &lt;code&gt;number-&amp;gt;string&lt;/code&gt;. For instance, using Chez Scheme:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;number-&amp;gt;string &lt;/span&gt;&lt;span class="mi"&gt;101&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;&amp;#34;1100101&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;All that for what? If the final digit is a one, then the number is odd, otherwise it is even. Pretty simple test, especially if we keep the binary representation of $u_n$ as a list (think of extracting the last item in the list, i.e. &lt;code&gt;(define (last lst) (car (reverse lst)))&lt;/code&gt;). Now, the recurrence function can be think of as follows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;if the number is even (final digit = 0), halve the number by shifting all the bits to the right (e.g., following the &lt;a href="https://stackoverflow.com/a/141873/420055"&gt;logical right shift&lt;/a&gt; &lt;code&gt;0101 &amp;gt;&amp;gt;&amp;gt; 1&lt;/code&gt; we get &lt;code&gt;0010&lt;/code&gt;);&lt;/li&gt;
&lt;li&gt;if the number is odd (final digit = 1), use a left shit (this will effectively double the number, e.g., &lt;code&gt;0010 &amp;lt;&amp;lt; 1&lt;/code&gt; yields &lt;code&gt;0100&lt;/code&gt;) and add the original number to the result; then add one in binary.&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Python and string concatenation</title><link>https://aliquote.org/post/python-string-concat/</link><pubDate>Thu, 15 Apr 2021 21:06:54 +0100</pubDate><guid>https://aliquote.org/post/python-string-concat/</guid><description>&lt;p&gt;I regularly use Biopython for everything related to bioinformatics and, in particular, processing sequence data. It is a nice package, with submodules like &lt;code&gt;SeqIO&lt;/code&gt; or &lt;code&gt;Phylo&lt;/code&gt;. The Seq or SeqRecord classes are really useful when it comes to storing and manipulating DNA sequences. Sequence are available as immutable (default) or mutable objects, and it is as easier to work with them as it would be with pure strings. In fact, you can even use their string representation if you like:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;Bio.Seq&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Seq&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MutableSeq&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;s1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Seq&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;ACGT&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;s2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;MutableSeq&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;ACGT&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;s2&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;A&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;s1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;s2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;)[:&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;There&amp;rsquo;s nothing special in &lt;a href="https://github.com/biopython/biopython/blob/master/Bio/Seq.py"&gt;Biopython&lt;/a&gt; on how &amp;ldquo;Seq&amp;rdquo; data are handled, except perhaps the use of bytes in place of raw strings, but this led me to wonder whether the &lt;code&gt;+&lt;/code&gt; operator is really the best method to concatenate strings, or DNA sequences.&lt;/p&gt;
&lt;p&gt;I know at least three ways to concatenate strings in Python: + (or &lt;code&gt;__add__&lt;/code&gt;), &lt;code&gt;.join()&lt;/code&gt; for specific cases, and the &lt;code&gt;io.StringIO module&lt;/code&gt;.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; Note that we discarded F-strings on purpose. The last option is supposed to be &lt;a href="https://bollu.github.io/fast-string-concatenation-in-python3.html"&gt;O(1)&lt;/a&gt;, while string concatenation generally is an O(n&lt;sup&gt;2&lt;/sup&gt;) operation, which makes sense since you need to create a copy of the original string and run to all other letters from the second string to append them. The second string is not necessarily of the same length n, but &lt;a href="https://stackoverflow.com/a/58310567/420055"&gt;it doesn&amp;rsquo;t really matter&lt;/a&gt;. There are many other relevant threads on SO, e.g., &lt;a href="https://stackoverflow.com/questions/10043636/any-reason-not-to-use-to-concatenate-two-strings/10043677#10043677"&gt;1&lt;/a&gt;, &lt;a href="https://stackoverflow.com/questions/12169839/which-is-the-preferred-way-to-concatenate-a-string-in-python#12171382"&gt;2&lt;/a&gt;, &lt;a href="https://stackoverflow.com/questions/3055477/how-slow-is-pythons-string-concatenation-vs-str-join"&gt;3&lt;/a&gt;, &lt;a href="https://stackoverflow.com/questions/58309852/why-is-the-complexity-of-simple-string-concatenation-on2"&gt;4&lt;/a&gt;, or &lt;a href="https://stackoverflow.com/questions/1316887/what-is-the-most-efficient-string-concatenation-method-in-python"&gt;5&lt;/a&gt;. The &lt;code&gt;+&lt;/code&gt; operator is handy since it is used in other languages as well, e.g. Javascript, or &lt;a href="https://doc.rust-lang.org/std/ops/trait.Add.html"&gt;Rust&lt;/a&gt;. Those languages also offer alternative ways to concatenate strings (&lt;code&gt;join&lt;/code&gt;, &lt;code&gt;append&lt;/code&gt;, etc.).&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;On the Python side, various benchmarks regarding which method is best (in terms of time or space complexity) are discussed here and there (including the links provided above). Apparently, F-strings are not so bad in terms of performance, especially since Python 3.6 but it looks to me like using &amp;ldquo;formating&amp;rdquo; stuff (much like &lt;code&gt;println!&lt;/code&gt; in Rust or &lt;code&gt;format&lt;/code&gt; in Lisp) amounts to divert the original purpose of this type of functions, which mostly exist for their side-effects. I may be wrong of course.&lt;/p&gt;
&lt;p&gt;In any case, the recommendation appears to be: &lt;a href="https://waymoot.org/home/python_string/"&gt;Use &lt;code&gt;.join()&lt;/code&gt;&lt;/a&gt;, especially if you like to conform to &lt;a href="https://www.python.org/dev/peps/pep-0008/"&gt;PEP 8&lt;/a&gt; recommendation:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;For example, do not rely on CPython&amp;rsquo;s efficient implementation of in-place string concatenation for statements in the form a += b or a = a + b. This optimization is fragile even in CPython (it only works for some types) and isn&amp;rsquo;t present at all in implementations that don&amp;rsquo;t use refcounting. In performance sensitive parts of the library, the &amp;lsquo;&amp;rsquo;.join() form should be used instead. This will ensure that concatenation occurs in linear time across various implementations.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;For lists, it is even possible to use &lt;code&gt;.extend()&lt;/code&gt;.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;In Haskell, we even have a join-like feature, thanks to ̀&lt;code&gt;Control.Monad.join&lt;/code&gt;.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Fisher-Yates shuffling</title><link>https://aliquote.org/post/fisher-yates-shuffling/</link><pubDate>Tue, 13 Apr 2021 10:14:45 +0200</pubDate><guid>https://aliquote.org/post/fisher-yates-shuffling/</guid><description>&lt;p&gt;Yesterday I came across a &lt;a href="https://danluu.com/sattolo/"&gt;nice post&lt;/a&gt; on the (Durstenfeld-)Fisher-Yates&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; and Sattolo&amp;rsquo;s algorithms. Briefly, the Fisher-Yates shuffling algorithm is a robust and efficient technique to generate a random permutation of elements in a list, with uniform probability. The Sattolo&amp;rsquo;s algorithm relies on a similar approach but produces permutation consisting of a single cycle. Donald Knuth coined the former Algorithm P (TAOCP, vol. 2), and later acknowledged the original work of Fisher and Yates. If you want to get an idea of how this works, trust Mike Bostock for providing so much &lt;a href="https://bost.ocks.org/mike/shuffle/"&gt;enlightening visualisation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;There&amp;rsquo;s a nice implementation available on Programming Praxis:&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;shuffle&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;do &lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;v&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list-&amp;gt;vector &lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;n&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;length &lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;- &lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nb"&gt;zero? &lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;vector-&amp;gt;list &lt;/span&gt;&lt;span class="nv"&gt;v&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let* &lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;r&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;randint&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;t&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;vector-ref &lt;/span&gt;&lt;span class="nv"&gt;v&lt;/span&gt; &lt;span class="nv"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;vector-set! &lt;/span&gt;&lt;span class="nv"&gt;v&lt;/span&gt; &lt;span class="nv"&gt;r&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;vector-ref &lt;/span&gt;&lt;span class="nv"&gt;v&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;- &lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;vector-set! &lt;/span&gt;&lt;span class="nv"&gt;v&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;- &lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;t&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Reservoir sampling&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt; is another efficient technique for generating a random sample of a collection of elements, although in this case the sample is a subset of the whole population, and thus is not a single permutation like before. Usually, the population size is not known in advance and cannot fit in memory, such as when presented with streams of data. It is an elegant algorithm where we store the k elements to sample from a stream of unknown size in a reservoir of size k while we add the i-th element to the reservoir with a probability of k/i by replacing a randomly selected element in the reservoir. See &lt;a href="https://florian.github.io/reservoir-sampling/"&gt;this post&lt;/a&gt; for more details.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2021-04-13]&lt;/small&gt;&lt;br&gt;
This post was originally drafted on 2020-09-17. It has been slightly edited and it will eventually get revised in the future. For now, it will stay unfinished.&lt;br&gt;
See also &lt;a href="https://engineering.atspotify.com/2014/02/how-to-shuffle-songs/"&gt;How to shuffle songs?&lt;/a&gt; and &lt;a href="https://pncnmnp.github.io/blogs/fibonacci-hashing.html"&gt;Scrambling Eggs for Spotify with Knuth&amp;rsquo;s Fibonacci Hashing&lt;/a&gt;.
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Durstenfeld, R., Algorithm 235: Random Permutation, &lt;em&gt;Communications of the ACM&lt;/em&gt;, 7(7), 1964. &lt;a href="https://dl.acm.org/doi/pdf/10.1145/364520.364540"&gt;PDF&lt;/a&gt;&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;Crypto folks also provide some advanced &lt;a href="https://github.com/ethereum/research/tree/master/shuffling"&gt;Python implementations&lt;/a&gt; (see this &lt;a href="https://github.com/ethereum/eth2.0-specs/issues/323"&gt;related discussion&lt;/a&gt;).&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:3"&gt;
&lt;p&gt;Vitter, J.S., Random Sampling with a Reservoir, &lt;em&gt;ACM Transactions on Mathematical Software&lt;/em&gt;, 11(1), 1985. &lt;a href="https://www.cs.umd.edu/~samir/498/vitter.pdf"&gt;PDF&lt;/a&gt;&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Les Sabines</title><link>https://aliquote.org/post/les-sabines/</link><pubDate>Mon, 12 Apr 2021 20:03:53 +0200</pubDate><guid>https://aliquote.org/post/les-sabines/</guid><description>&lt;p&gt;Dans le &lt;em&gt;Passe-muraille&lt;/em&gt;, il y a une nouvelle intitulée &lt;em&gt;Les Sabines&lt;/em&gt; dans laquelle Marcel Aymé raconte l&amp;rsquo;histoire d&amp;rsquo;une femme ayant le don d&amp;rsquo;ubiquité.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Il y avait à Montmartre, dans la rue de l&amp;rsquo;Abreuvoir, une jeune femme prénommée Sabine, qui possédait le don d&amp;rsquo;ubiquité. Elle pouvait à son gré se multiplier et se trouver en même temps, de corps et d&amp;rsquo;esprit, en autant de lieux qu&amp;rsquo;il lui plaisait souhaiter. Comme elle était mariée et qu&amp;rsquo;un don si rare n&amp;rsquo;eût pas manqué d&amp;rsquo;inquiéter son mari, elle s&amp;rsquo;était gardée de lui en faire la révélation et ne l&amp;rsquo;utilisait guère que dans son appartement, aux heures où elle y était seule.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;C&amp;rsquo;est en fait une collègue et amie qui m&amp;rsquo;a parlé de cette nouvelle car l&amp;rsquo;auteur fait une prédiction intéressante : l&amp;rsquo;héroïne ayant le don d&amp;rsquo;ubiquité, il prédit que leur nombre augmente selon une suite géométrique de raison 2.7 : &amp;ldquo;Bientôt, la malheureuse ubiquiste fut saisie d&amp;rsquo;une frénésie de luxure et eut des amants sur tous les points du globe. Le nombre en augmentait au rythme d&amp;rsquo;une progression géométrique dont la raison était 2,7. (&amp;hellip;) En l&amp;rsquo;espace de trois mois, elle se fut répandue sur le globe en neuf cent cinquante exemplaires. Six autres mois plus tard, ce nombre atteignait aux environs de dix-huit mille, ce qui est considérable.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;Les suites géométriques croissantes de ce type (i.e., de raison $r &amp;gt; 1$) représentent la version discrète des lois de croissance exponentielle. On supposera juste que l&amp;rsquo;ensemble des valeurs prises par une telle loi discrète est fini ou infini mais dénombrable. On résume ce type d&amp;rsquo;accroissement par la relation de récurrence $q_{n+1} = rq_n$, ou alors $q_n = r q_{n-1} = r^2q_{n-2} = \dots = q_0r^n$, où $q_0$ désigne le terme initial de la dite suite. Si l&amp;rsquo;on prend trois termes consécutifs au hasard, $x &amp;lt; y &amp;lt; z$, parmi cette suite, on observe que $y = rx$ et $z = ry = r^2x$, d&amp;rsquo;où $y^2 = xz$ : $y$ est bien la moyenne géométrique de $x$ et $z$.&lt;/p&gt;
&lt;p&gt;A partir de la formule de récurrence énoncée ci-dessus, il n&amp;rsquo;est pas difficile d&amp;rsquo;exprimer la raison d&amp;rsquo;une suite dont le premier terme est $q_0$ : on trouve $r = \left(\frac{q_n}{q_0}\right)^\frac{1}{n-1}$. En d&amp;rsquo;autres termes, si l&amp;rsquo;on connaît le premier et le dernier terme d&amp;rsquo;une suite géométrique de $n$ termes, on en déduit facilement sa raison à partir de la racine $n$-ième du rapport entre le dernier et le premier terme (ce qui permet par la même occasion de constituer n&amp;rsquo;importe quelle suite de nombres espacés de manière proportionnelle entre deux nombres donnés).&lt;/p&gt;
&lt;p&gt;Marcel Aymé indique qu&amp;rsquo;en 3 mois il y avait déjà 950 &amp;ldquo;exemplaires&amp;rdquo; ($q_3$), tandis qu&amp;rsquo;au bout de 6 mois, le nombre total de sosies atteignait 18000 ($q_6$). On peut donc vérifier si la conjecture de l&amp;rsquo;auteur concernant la raison de cette suite géométrique est correcte : En supposant qu&amp;rsquo;un mois constitue l&amp;rsquo;unité temporelle de base, on a $\frac{q_6}{q_3} = \frac{r^5q_1}{r^2q_1} = r^3$, c&amp;rsquo;est-à-dire $r = \frac{18000}{950}^{1/3} = 2.6659$, soit 2,7 en arrondissant au dixième.&lt;/p&gt;</description></item><item><title>Vim and neoterm</title><link>https://aliquote.org/post/vim-neoterm/</link><pubDate>Wed, 31 Mar 2021 10:09:49 +0200</pubDate><guid>https://aliquote.org/post/vim-neoterm/</guid><description>&lt;p&gt;When I switched to Neovim last year, I knew the only thing I would really miss from Emacs was the ability to fire an REPL right inside Vim when editing Python, R, Racket code, or whatever. Of course, I can work with a terminal inside Neovim (usually, in a split or an other tab) and use Vim&amp;rsquo;s copy/paste. It works great for R if we let the terminal stay in Normal mode, and Python because of ̀&lt;code&gt;%paste&lt;/code&gt; magic. However, it soon becomes a little cumbersome to have to switch over and over between the REPL and the main script.&lt;/p&gt;
&lt;p&gt;Enters &lt;a href="https://github.com/kassio/neoterm"&gt;Neoterm&lt;/a&gt;. It&amp;rsquo;s kinda like &lt;code&gt;C-c C-c&lt;/code&gt; in Emacs: whether you are editing a Python, R, Clojure, Racket, Javascript, Julia script (and many more), it&amp;rsquo;s usually just a matter of calling &lt;code&gt;:TREPLSendLine&lt;/code&gt; or &lt;code&gt;:TREPLSendSelection&lt;/code&gt; to send the current line or a visual selection to a terminal running the right REPL. If no window is present, the REPL is created on the go, and then all other commands are sent to this REPL. It is even possible to work with multiple REPL at the same time, or to manage all instances of Neovim terminal using neoterm&amp;rsquo;s shortcuts directly. I have this mappings in my Vim config, and it works great.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-vim" data-lang="vim"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;nnoremap&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;silent&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;localleader&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;cc&lt;/span&gt; :&lt;span class="nx"&gt;TREPLSendLine&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;vnoremap&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;silent&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;localleader&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;cc&lt;/span&gt; :&lt;span class="nx"&gt;TREPLSendSelection&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Maybe I should be using ̀&lt;code&gt;&amp;lt;Plug&amp;gt;(neoterm-repl-send)&lt;/code&gt; instead, I don&amp;rsquo;t know.&lt;/p&gt;
&lt;p&gt;Why neoterm when there are so many other options, including very specialized plugins? Just considering Clojure, I know there are at least &lt;a href="https://github.com/Olical/conjure"&gt;conjure&lt;/a&gt;, &lt;a href="https://github.com/clojure-vim/acid.nvim"&gt;acid&lt;/a&gt;, &lt;a href="https://github.com/liquidz/vim-iced"&gt;vim-iced&lt;/a&gt;, or &lt;a href="https://github.com/tpope/vim-fireplace"&gt;vim-fireplace&lt;/a&gt;. Likewise, Lisp hackers can rely on &lt;a href="https://github.com/vlime/vlime"&gt;vlime&lt;/a&gt; or &lt;a href="https://github.com/kovisoft/slimv"&gt;slimv&lt;/a&gt;. Right, you get better tooling stuff (debugger, profiling, dependencies injection, etc.) using those plugins, but what if I told you I just want to send lines of code to a living REPL, check the result or debug right into the terminal? Other than that, I know tend to rely almost exclusively on test suites and Makefile, and I don&amp;rsquo;t spend so much time in a true REPL (read SLIME or CIDER).&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2020-06-15]&lt;/small&gt;&lt;br&gt;
A nice related project that I forgot to talk about is &lt;a href="https://github.com/jpalardy/vim-slime"&gt;vim-slime&lt;/a&gt;. Like neoterm, it supports multiple targets (Vim or Neovim builtin terminal, tmux, etc.). However, it appears to be limited to launching REPLs, not interacting with proper pseudo-terminals in Neovim directly.
&lt;/div&gt;
&lt;p&gt;I guess it&amp;rsquo;s just a matter of &lt;em&gt;simplicity&lt;/em&gt;. Like I don&amp;rsquo;t want to use &lt;a href="https://github.com/neoclide/coc.nvim"&gt;Coc&lt;/a&gt;, and I rather rely on &lt;a href="https://github.com/dense-analysis/ale"&gt;Ale&lt;/a&gt; for all things related to linting and fixing source code, and &lt;a href="https://github.com/sheerun/vim-polyglot"&gt;vim-polyglot&lt;/a&gt; for syntax highlighting. I know LSP is available in nightly builds of Neovim, but Ale is lighter and probably a lot easier to configure. Let&amp;rsquo;s hope the project will stay active for a long time. Having fewer packages to manage is a plus for me, especially when they don&amp;rsquo;t conflict with each other because there&amp;rsquo;s almost zero dependencies between them. It was not true for the packages I used to use under Doom Emacs, and the continuous update of the &amp;ldquo;defaults&amp;rdquo; was driving me crazy at some point. Now, I have a limited set of packages, and there&amp;rsquo;s no friction during weekly updates. My config is almost 100% compatible with Vim 8, i.e. I do not use Neovim-only features that I would miss otherwise. I know many folks are moving to Lua-only plugins and built-in LSP, but that&amp;rsquo;s ok, as long as my current setup let me write code and prose instead of tweaking the editor settings everyday.&lt;/p&gt;</description></item><item><title>Micro posting in March</title><link>https://aliquote.org/post/micro-03-2021/</link><pubDate>Tue, 30 Mar 2021 20:57:39 +0200</pubDate><guid>https://aliquote.org/post/micro-03-2021/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-03-08&lt;/a&gt;: I moved out last week, and moved in right away. I just finished unpacking all the boxes. What a journey! I&amp;rsquo;m exhausted, and I probably need a few weeks to recover. In the meantime, here is the new home office:&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_1410.JPG" alt="office"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-03-08&lt;/a&gt;: &lt;a href="https://www.tjmahr.com/random-effects-penalized-splines-same-thing/"&gt;Random effects and penalized splines are the same thing&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-03-21&lt;/a&gt;: Meanwhile, I&amp;rsquo;ve been playing with OpenBSD a bit more, and guess what: Kitty terminal emulator is available there too. I&amp;rsquo;m impressed by the number of packages that are readily available: Kitty, Neomutt and Neovim work right out of the box. I wish Linux (Ubuntu) was using &lt;code&gt;/usr/local&lt;/code&gt; as the default user directory for local programs, this would simplify config files a lot! &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-03-21&lt;/a&gt;: What a week (or two, in fact)! Just starting to feel better right now, after three days at the hospital. I should be ready for the next 8 years, hopefully.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-03-21&lt;/a&gt;: &lt;blockquote class="twitter-tweet"&gt;&lt;p lang="en" dir="ltr"&gt;New Post: An Ode to Stable Interfaces, and Praise To Base R and R Core&lt;br&gt;&lt;br&gt;In which I run code I posted fourteen years ago: it works unaltered. That should be cherished, celebrated--and encouraged. We need more examples like this.&lt;a href="https://t.co/9khR7TwRk0"&gt;https://t.co/9khR7TwRk0&lt;/a&gt;&lt;a href="https://twitter.com/hashtag/rstats?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#rstats&lt;/a&gt; &lt;a href="https://twitter.com/hashtag/reproducibility?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#reproducibility&lt;/a&gt; &lt;a href="https://t.co/BKS0GXjRGs"&gt;pic.twitter.com/BKS0GXjRGs&lt;/a&gt;&lt;/p&gt;&amp;mdash; Dirk Eddelbuettel (@eddelbuettel) &lt;a href="https://twitter.com/eddelbuettel/status/1373374720863784967?ref_src=twsrc%5Etfw"&gt;March 20, 2021&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async src="https://platform.twitter.com/widgets.js" charset="utf-8"&gt;&lt;/script&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-03-22&lt;/a&gt;: &amp;gt; My overall feeling is that if I could spend infinite time and effort, my C programs would be as fast or faster than Rust, because theoretically there&amp;rsquo;s nothing that C can&amp;rsquo;t do that Rust can. But in practice C has fewer abstractions, primitive standard library, dreadful dependency situation, and I just don&amp;rsquo;t have the time to reinvent the wheel, optimally, every time. &amp;mdash; &lt;a href="https://kornel.ski/rust-c-speed"&gt;Speed of Rust vs. C&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-03-22&lt;/a&gt;: &lt;a href="https://bollu.github.io/a-hackers-guide-to-numerical-analysis.html"&gt;A hacker&amp;rsquo;s guide to numerical analysis&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-03-22&lt;/a&gt;: &lt;a href="https://maizure.org/projects/decoded-gnu-coreutils/"&gt;Decoded: GNU coreutils&lt;/a&gt;. Lot of useful references and very detailed explanations. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-03-22&lt;/a&gt;: &lt;a href="https://superuser.com/questions/1633073/why-are-tar-xz-files-15x-smaller-when-using-pythons-tar-library-compared-to-mac"&gt;Why are tar.xz files 15x smaller when using Python&amp;rsquo;s tar library compared to macOS tar?&lt;/a&gt;. TL;DR &lt;a href="https://stackoverflow.com/a/14885821/420055"&gt;https://stackoverflow.com/a/14885821/420055&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-03-23&lt;/a&gt;: &lt;a href="https://stevelosh.com/blog/2021/03/small-common-lisp-cli-programs/"&gt;Writing Small CLI Programs in Common Lisp&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-03-24&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/63683284720__8379C35D-4327-4D08-B20C-607D2697635B.JPG" alt="books"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-03-24&lt;/a&gt;: &amp;gt; Software engineers have been led to believe that their time is more valuable than CPU time; therefore, wasting CPU cycles in order to reduce development time is always a win. They&amp;rsquo;ve forgotten, however, that the application users&amp;rsquo; time is more valuable than their time. &amp;mdash; &lt;a href="https://ubiquity.acm.org/article.cfm?id=1513451"&gt;The fallacy of premature optimization&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-03-24&lt;/a&gt;: &lt;a href="https://www.more-magic.net/posts/thoughts-on-clojure.html"&gt;Clojure from a Schemer&amp;rsquo;s perspective&lt;/a&gt; (via &lt;a href="https://irreal.org/blog/?p=9530"&gt;Irreal&lt;/a&gt;). ̀&lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-03-24&lt;/a&gt;: &lt;a href="https://cryptobook.nakov.com/"&gt;Practical Cryptography for Developers&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-03-24&lt;/a&gt;: &lt;a href="https://json-schema.org/understanding-json-schema/"&gt;Understanding JSON Schema&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-03-25&lt;/a&gt;: &amp;gt; The friction of having to write, to structure thoughts in plain text, to remember the name of the person I need to reference on this page: that is the point. Frictionless note-taking produces notes, but it doesn’t - for me - produce memory.&lt;br&gt;&amp;gt; The same goes for a lot of things. I use neovim to edit code like a grandpa, and I don’t use a file tree. There’s no “directory listing” in my editor. I hit ctrl-p and fzf helps me find the file by name. This is obviously not the future of coding: shouldn’t I be navigating the source tree in 3D like in Jurassic Park? Sure, but the names of things, their functionality, and how it all fits together should be things that exist in one’s mind, not just in a computer. &amp;mdash; &lt;a href="https://macwright.com/2021/03/16/return-of-fancy-tools.html"&gt;The return of fancy tools&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-03-25&lt;/a&gt;: At first I thought Github allowed for personal blog as a derived GH-like UI. Well, no, it&amp;rsquo;s all CSS (managed with Hugo): &lt;a href="https://neapowers.com/"&gt;https://neapowers.com/&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-03-25&lt;/a&gt;: &lt;a href="https://muttdata.ai/blog/2020/08/21/a-poetic-apology.html"&gt;A Poetic Apology: Or Why Should You Use Poetry to Manage Python Dependencies&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-03-25&lt;/a&gt;: &lt;a href="http://bit-player.org/2021/foldable-words"&gt;Foldable Words&lt;/a&gt;, (via &lt;a href="https://mostlymaths.net/2021/02/202106-readings.html/"&gt;mostlymaths.net&lt;/a&gt;). &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-03-25&lt;/a&gt;: &lt;a href="https://jeremykun.com/2020/09/11/searching-for-rh-counterexamples-setting-up-pytest/"&gt;Searching for RH Counterexamples — Setting up Pytest&lt;/a&gt;. ̀&lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-03-25&lt;/a&gt;: &lt;a href="https://www.brodrigues.co/blog/2021-03-02-no_shiny_dashboard/"&gt;Server(shiny)-less dashboards with R, {htmlwidgets} and {crosstalk}&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-03-29&lt;/a&gt;: &amp;gt; The havoc wrought by the combination of these two changes is considerable. Those Python virtual environments you created over the last year? All of them are now broken. Why? Just because you ran brew upgrade ponysay? Yup. &amp;mdash; &lt;a href="https://justinmayer.com/posts/homebrew-python-is-not-for-you/"&gt;Homebrew Python Is Not For You&lt;/a&gt;This is sad, really sad.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-03-29&lt;/a&gt;: &lt;a href="http://bactra.org/weblog/1178.html"&gt;Regression, Thermostats, Causal Inference: Some Finger Exercises&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-03-30&lt;/a&gt;: Random links from Tuesday:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://learnvimscriptthehardway.stevelosh.com/"&gt;Learn Vimscript the Hard Way&lt;/a&gt; &amp;ndash; actively using Vim&lt;/li&gt;
&lt;li&gt;&lt;a href="https://raphlinus.github.io/rust/2019/08/21/rust-bloat.html"&gt;Thoughts on Rust bloat&lt;/a&gt; &amp;ndash; slowly learning some bits of Rust&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/ar-nelson/schemepunk"&gt;A batteries-included extended standard library for seven R7RS Scheme dialects&lt;/a&gt; &amp;ndash; must go back to Scheme after exploring Python more extensively&lt;/li&gt;
&lt;li&gt;&lt;a href="https://skanthak.homepage.t-online.de/division.html"&gt;Donald Knuth’s &amp;ldquo;Algorithm D&amp;rdquo;, its implementation in &amp;ldquo;Hacker’s Delight&amp;rdquo;, and elsewhere&lt;/a&gt; &amp;ndash; must reread part of Knuth&amp;rsquo;s artwork&lt;/li&gt;
&lt;li&gt;&lt;a href="https://wiki.postgresql.org/wiki/Soundex"&gt;PostgreSQL 8.3 and later include a soundex(text) function in the fuzzystrmatch extension&lt;/a&gt; &amp;ndash; wait, how comes I forgot about that&lt;br&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-03-30&lt;/a&gt;: &lt;a href="https://antonz.org/sqlite-is-not-a-toy-database/"&gt;SQLite is not a toy database&lt;/a&gt;. &lt;code&gt;#database&lt;/code&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>March on the road</title><link>https://aliquote.org/post/march-on-the-road/</link><pubDate>Sun, 21 Mar 2021 21:10:43 +0100</pubDate><guid>https://aliquote.org/post/march-on-the-road/</guid><description>&lt;p&gt;It&amp;rsquo;s been a strange week.&lt;/p&gt;
&lt;p&gt;If I did manage to complete my move (thanks to several friends and family members) and my fitting out in one week, and not one day more, I found myself like an idiot in the hospital a few days later because of a rupture of my defibrillator probe following a bad movement in the morning. Presumably, the sustained efforts during the move must have contributed to weaken the probes, but I really feel that the probe failed upon waking up. I just have to wait 2-3 months for the complete healing, like 4 years ago. Anyway, I&amp;rsquo;m recovering now, and I&amp;rsquo;m home again.&lt;/p&gt;
&lt;p&gt;From a less melodramatic point of view, I put my hi-fi system back on, and this time I&amp;rsquo;m content with vinyl and streaming via the Apple TV. The sound is really good in the new appartment. I also subscribed to the combo Netflix&amp;ndash;Disney+&amp;ndash;Canal+, so I guess I will no longer have to buy or rent movies or series on Apple. I originally subscribed to Netflix last year in order to watch Black Mirror. It ended up quickly as my account got hijacked a week later. Let&amp;rsquo;s hope this won&amp;rsquo;t happen this time.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/IMG_1407.JPG"&gt;
&lt;/figure&gt;
&lt;p&gt;When I got back from the hospital, my computer ran out of battery so I had to fall back to the &lt;a href="https://aliquote.org/post/welcome-openbsd/"&gt;Thinkpad and OpenBSD&lt;/a&gt;. I spent a few hours adding further options to the core system as well as configuring Kitty and Zsh. Of course, all paths needed to be updated again since Ubuntu relies on &lt;code&gt;/usr&lt;/code&gt; and OpenBSD, like macOS, on &lt;code&gt;usr/local&lt;/code&gt;. That&amp;rsquo;s not really an issue, but I wish Ubuntu would follow the same idea.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ New Order • &lt;em&gt;The Peel Sessions&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in February</title><link>https://aliquote.org/post/micro-02-2021/</link><pubDate>Thu, 25 Feb 2021 10:13:10 +0100</pubDate><guid>https://aliquote.org/post/micro-02-2021/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-02-01&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;WhatsApp rose by trapping previously-free beings in their corral and changing their habits to create dependence on masters. Over time, this made it difficult or impossible to return to their previous lifestyle. That process should sound familiar: it’s eerily similar to the domestication of animals. I call this type of vendor lock-in user domestication: the removal of user autonomy to trap users into serving vendors. &amp;mdash; &lt;a href="https://seirdy.one/2021/01/27/whatsapp-and-the-domestication-of-users.html"&gt;WhatsApp and the domestication of users&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-02-01&lt;/a&gt;: &lt;a href="https://seirdy.one/2020/11/23/website-best-practices.html"&gt;An opinionated list of best practices for textual websites&lt;/a&gt;. Lot of good advices there.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-01&lt;/a&gt;: &lt;a href="https://web.eecs.utk.edu/~azh/blog/webappwithoutgoogling.html"&gt;Can you make a basic web app without googling?&lt;/a&gt;. I still can write a complete website using HTML and basic CSS without looking at Google (or DuckDuckGo for what matters). Likewise, I can use Sed, Awk and shell scripts, or write R and Python code without relying on a search engine. However, I must admit that I became so lazy over the years that I found myself googling for everything nearly available in the help, man or info pages that sit on my computer. That&amp;rsquo;s a shame, of course. Laziness and muscle memory are the problem. We should probably refrain ourselves from googling again and again. That&amp;rsquo;s not a way to learn.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-01&lt;/a&gt;: &lt;a href="https://medium.com/better-programming/why-i-still-lisp-and-you-should-too-18a2ae36bd8"&gt;Why I Still Lisp (and You Should Too)&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-02&lt;/a&gt;: &lt;a href="https://nyxt.atlas.engineer/"&gt;Nyxt browser&lt;/a&gt;: the internet on your terms.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-02&lt;/a&gt;: &lt;a href="https://datascienceworkshops.com/blog/plotnine-grammar-of-graphics-for-python/"&gt;Plotnine: Grammar of Graphics for Python&lt;/a&gt;. That&amp;rsquo;s probably the best implementation of the grammar of graphics for Python right now. ̀&lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-02&lt;/a&gt;: &lt;a href="https://www.bell-labs.com/usr/dmr/www/1stEdman.html"&gt;Unix Programmer&amp;rsquo;s Manual&lt;/a&gt; (November 3, 1971). &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-04&lt;/a&gt;: &lt;a href="https://martinheinz.dev/blog/42?utm_source=rss&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog_post_42"&gt;Building Docker Images The Proper Way&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-04&lt;/a&gt;: &lt;a href="https://mostlymaths.net/2021/01/guillotine-floating-camera.html/"&gt;Guillotine&lt;/a&gt;: beheadings for your next online presentation.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-04&lt;/a&gt;: &lt;a href="http://www.lispology.com/show?3FY9"&gt;Haskell-like patterns in Lisp&lt;/a&gt;. ̀&lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-06&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Having only the content I want to see only be shown when I want to see it with the freedom to jump between readers as I please, all with no ads? For me, no other service comes close to the flexibility, robustness, and overall ease-of-use that RSS offers. &amp;mdash; &lt;a href="https://atthis.link/blog/2021/rss.html"&gt;Why I Still Use RSS&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-02-08&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;There are plenty of books on how to become a better programmer out there. Books like this tend to have checklists and other advice that the author deems important enough for you to do in order to become a better programmer. They tend to focus on specific improvements like choosing a better editor, writing better test cases, or drinking lots of water. Those books have lots of useful advice, but they read like a laundry list of things that you must do all at once in order to succeed. This book will try not to saddle you with more work (you likely have enough as it is). Rather, we&amp;rsquo;ll discuss what it feels like to be a programmer. &amp;mdash; &lt;a href="http://themediocreprogrammer.com/what-is-the-mediocre-programmer.html#what-is-the-mediocre-programmer"&gt;What is The Mediocre Programmer?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-02-08&lt;/a&gt;: Note to blog writers: Could you please (1) check your GUIDs and (2) allow RSS readers to download all feeds and not only the last 10 or 20 entries? With many thanks.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-08&lt;/a&gt;: &lt;a href="https://venam.nixers.net/blog/unix/2021/02/07/audio-stack.html"&gt;Making sense of the audio stack on Unix&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-08&lt;/a&gt;: &lt;a href="https://geoff.greer.fm/2015/01/15/why-neovim-is-better-than-vim/"&gt;Why Neovim is Better than Vim&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-08&lt;/a&gt;: &lt;a href="https://www.unixsheikh.com/articles/why-you-should-migrate-everything-from-linux-to-bsd.html"&gt;Why you should migrate everything from Linux to BSD&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-09&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Even though Usenet has changed it&amp;rsquo;s face over the last, say ten years, the simple idea of exchanging ideas and having discussions among a large number of people by posting articles on a global message-board has pertained. &amp;mdash; &lt;a href="https://www.netmeister.org/news/usenet/usenet.html"&gt;Usenet is still a strange place&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-02-09&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;People had created blogs (many with great content), run them for a while, let them lapse, and eventually they were swallowed by time and entropy. &amp;mdash; &lt;a href="https://brandur.org/fragments/graceful-degradation-time"&gt;Blog with Markdown + Git, and degrade gracefully through time&lt;/a&gt;What if Github went down? Better to use your own server and backup your plain text files in a secure place.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-02-09&lt;/a&gt;: &lt;a href="https://hack.org/~mc/computers.html"&gt;Computers I have known and loved&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-09&lt;/a&gt;: &lt;a href="https://zaiste.net/posts/shell-commands-rust/"&gt;Rewritten in Rust: Modern Alternatives of Command-Line Tools&lt;/a&gt;. I bookmarked this a while ago. I&amp;rsquo;ve tried them all, yet I only find added value in exa and ripgrep.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-09&lt;/a&gt;: &lt;a href="https://lisp-journey.gitlab.io/blog/state-of-the-common-lisp-ecosystem-2020/"&gt;State of the Common Lisp ecosystem, 2020 🎉&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-10&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Given what I just said, we Haskellers have a lot of hubris. Each time you say &amp;ldquo;if it compiles it works,&amp;rdquo; a thunk dies and collapses into a blackhole. We&amp;rsquo;ve got plenty of messes in Haskell that don&amp;rsquo;t sufficiently protect us from ourselves. The compiler can only do as good a job as our coding standards and our libraries allow. &amp;mdash; &lt;a href="https://www.snoyman.com/blog/2020/11/haskell-bad-parts-2/"&gt;Haskell: The Bad Parts, part 2&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-02-10&lt;/a&gt;: Python behind the scenes #8: &lt;a href="https://tenthousandmeters.com/blog/python-behind-the-scenes-8-how-python-integers-work/"&gt;how Python integers work&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-10&lt;/a&gt;: &lt;a href="https://hacks.mozilla.org/2021/02/browser-fuzzing-at-mozilla/"&gt;Browser fuzzing at Mozilla&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-10&lt;/a&gt;: &lt;a href="https://computing.llnl.gov/tutorials/pthreads/"&gt;POSIX Threads Programming&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-10&lt;/a&gt;: &lt;a href="https://github.com/ikamensh/flynt"&gt;flynt&lt;/a&gt; &amp;ndash; string formatting converter. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-11&lt;/a&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dhghomon.github.io/easy_rust/"&gt;Easy Rust&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stevedonovan.github.io/rust-gentle-intro/readme.html"&gt;A Gentle Introduction To Rust&lt;/a&gt;&lt;br&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-02-11&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;You might be tempted to use the correlation to reduce the set of predictors, but as Charles Dickens shows us, this requires domain knowledge&amp;raquo; &amp;gt; Annual income twenty pounds, annual expenditure nineteen nineteen and six, result happiness. Annual income twenty pounds, annual expenditure twenty pounds ought and six, result misery. – Mr Micawber, in David Copperfield&amp;raquo; Even though income and expenditure are highly correlated, neither one separately will do anywhere near as well as the pair in predicting who ends up happy and who ends up in debtor’s prison. &amp;mdash; &lt;a href="https://notstatschat.rbind.io/2021/02/11/co-linearity/"&gt;Co-linearity&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-02-11&lt;/a&gt;: &lt;a href="https://themouseless.dev/"&gt;Do You Write Code With Your Mouse?&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-11&lt;/a&gt;: &lt;a href="https://sharksforarms.dev/posts/neovim-rust/"&gt;Neovim and Rust&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt; &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-11&lt;/a&gt;: &lt;a href="https://www.c0ffee.net/blog/openbsd-on-a-laptop/"&gt;OpenBSD on a Laptop&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-14&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_1372.JPG" alt=""&gt;&lt;small&gt;Probably one of the last pie I&amp;rsquo;ll be cooking in this appartment.&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-14&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;My impression now is that they feel like it has too many cool new things; and that a few things didn’t quite make it in even with the extended release cycle. So it’s looking likely to me that 1.7 will actually be the LTS; but that it might also be a feature release – possibly this time a much shorter release period than usual. In practice I think for a lot of package maintainers 1.6 will be a LTS, in that that is the oldest version they will make sure to continue to support. There have been too many cool new things (as this post will detail) to stay back to only 1.0 features. Already a lot of packages have dropped support for Julia versions older than 1.3. &amp;mdash; &lt;a href="https://www.oxinabox.net/2021/02/13/Julia-1.6-what-has-changed-since-1.0.html"&gt;Julia 1.6: what has changed since Julia 1.0?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-02-14&lt;/a&gt;: &lt;a href="https://www.joe0.com/2020/10/07/converting-utzoo-wiseman-netnews-archive-to-postgresql-using-python-3-8/"&gt;Converting UTZOO-Wiseman Usenet Tapes to Website with PostgreSQL backend using Python 3.8&lt;/a&gt;. See also Usenet History on &lt;a href="https://www.giganews.com/usenet-history/spencer.html"&gt;Henry Spencer&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-14&lt;/a&gt;: &lt;a href="https://landley.net/writing/memory-faq.txt"&gt;Linux memory management&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-14&lt;/a&gt;: &lt;a href="https://blog.racket-lang.org/2021/02/racket-v8-0.html"&gt;Racket v8.0&lt;/a&gt; is out. &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-15&lt;/a&gt;: Almost two months spent on Ubuntu and a Dell laptop. I&amp;rsquo;m afraid I&amp;rsquo;m no longer able to use my Macbook keyboard!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-15&lt;/a&gt;: &lt;a href="https://martinheinz.dev/blog/43"&gt;Advanced Git Features You Didn’t Know You Needed &lt;/a&gt;. &lt;code&gt;#git&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-15&lt;/a&gt;: &lt;a href="https://willschenk.com/articles/2021/docker_one_liners/"&gt;Docker One Liners&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-15&lt;/a&gt;: &lt;a href="https://christophm.github.io/interpretable-ml-book/"&gt;Interpretable Machine Learning&lt;/a&gt;: A Guide for Making Black Box Models Explainable.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-15&lt;/a&gt;: &lt;a href="https://mdsr-book.github.io/mdsr2e/"&gt;Modern Data Science with R&lt;/a&gt; (2nd edition). &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-16&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Knowing I have some time until the computer stops, I know I must keep focused because time is passing. &amp;mdash; &lt;a href="https://dataswamp.org/~solene/2020-11-10-offline-laptop-v3.html"&gt;About the offline laptop project&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-02-18&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Once tabs became mainstream, they changed the way people surfed. I still clean my tabs out every day, but some people keep hundreds of the things running, as if this somehow makes them more organized. On average, desktop web browsers have around 10-20 tabs open; mobile browsers, which encourage you to keep them lingering in the background, have more. &amp;mdash; &lt;a href="https://werd.io/2021/the-stagnant-browser"&gt;The stagnant browser&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-02-18&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The baseline minimum is that to qualify as free publishing it must be both free to read and free to publish, both for the reader/author and for their institution. So free publishing may be defined to be the same thing as diamond open access. &amp;mdash; &lt;a href="https://julesh.com/2021/02/16/free-publishing/"&gt;Free publishing&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-02-18&lt;/a&gt;: Syncing my website (generated via Hugo): Transmit on macOS takes so much time (up to 5 min) compared to rsync (less than 20 sec). WTF?! Time to switch I guess.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-18&lt;/a&gt;: &lt;a href="https://tychoish.com/post/programming-in-the-common-lisp-ecosystem/"&gt;Programming in the Common Lisp Ecosystem&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-18&lt;/a&gt;: &lt;a href="http://gonsie.com/blorg/rss-by-email.html"&gt;RSS Feeds by Email&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-18&lt;/a&gt;: &lt;a href="https://github.com/jart/sectorlisp"&gt;sectorlisp&lt;/a&gt; is an effort to bootstrap John McCarthy&amp;rsquo;s meta-circular evaluator on bare metal from a 512-byte boot sector. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-20&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_1377.JPG" alt="openbsd"&gt;&lt;small&gt;Here&amp;rsquo;s the newcomer!&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-20&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;It’s easy to view yourself as “not a real programmer.” There are programs out there that everyone uses, and it’s easy to put their developers on a pedestal. Although developing large software projects isn’t easy, many times the basic idea of that software is quite simple. Implementing it yourself is a fun way to show that you have what it takes to be a real programmer. &amp;mdash; &lt;a href="https://brennan.io/2015/01/16/write-a-shell-in-c/"&gt;Write a Shell in C&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-02-20&lt;/a&gt;: I believe I now need to give it a try: &lt;a href="https://github.com/scicloj/sklearn-clj"&gt;sklearn-clj&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt; &lt;code&gt;#clojure&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-20&lt;/a&gt;: &lt;a href="https://www.cambus.net/modernizing-the-openbsd-console/"&gt;Modernizing the OpenBSD console&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-22&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I’ve come to believe that working through something is the only way to explore the idea maze. Everything else is commentary. I’ve mostly stopped sharing unsolicited “helpful” just-a-thoughts and comments at work. &amp;mdash; &lt;a href="https://chiefofstuff.substack.com/p/commenting-vs-making"&gt;Commenting vs. making&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-02-23&lt;/a&gt;: &lt;a href="https://codeinthehole.com/tips/vim-text-objects/"&gt;Vim text-objects for Python development&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-02-24&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Visualization is a spectrum: from exploratory to explanatory. &amp;mdash; &lt;a href="https://observablehq.com/@mbostock/10-years-of-open-source-visualization"&gt;10 Years of Open-Source Visualization&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-02-24&lt;/a&gt;: &lt;a href="https://mikkel.ca/blog/git-is-my-buddy-effective-solo-developer/"&gt;Git is my buddy: Effective Git as a solo developer&lt;/a&gt;. &lt;code&gt;#git&lt;/code&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>Welcome OpenBSD</title><link>https://aliquote.org/post/welcome-openbsd/</link><pubDate>Sat, 20 Feb 2021 18:30:26 +0100</pubDate><guid>https://aliquote.org/post/welcome-openbsd/</guid><description>&lt;p&gt;I got a refurbished Lenovo Thinkpad T450S yesterday, and I installed OpenBSD 6.8 on it. Overall, this was a very pleasant experience: the installation went so smoothly that I got a working system in less than 20 minutes. Yes, you read me right: less than 20 min to start fetching my config files over the web in an xterm managed by i3wm.&lt;/p&gt;
&lt;p&gt;The machine itself dates from 2015; it&amp;rsquo;s a bit old, single core i7 but with custom RAM settings apparently (20 Go, more than what I currently have on my Dell laptop). It looks like the battery is near the end of its life, but this may well be a measurement issue from the sensors. I&amp;rsquo;ll need to investigate, or buy a new battery. It comes with a 512 Go HD, and of course I install OpenBSD on the whole disk since I don&amp;rsquo;t need Windows 10. No USB-C, nor HDMI, unfortunately. Hopefully, I still have an ethernet plug, an SD card reader, and a mini-display port.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1616.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1616.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1617.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1617.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This is still a rough install as I did not manage to configure everything, meaning that I&amp;rsquo;m still using ksh as the default shell, and I haven&amp;rsquo;t installed anything beside the minimal set of utilities I use to use daily on my Ubuntu machine. I am reading the &lt;a href="https://www.openbsd.org/faq/"&gt;FAQ&lt;/a&gt; and the &lt;a href="https://www.openbsdhandbook.com/"&gt;OpenBSD handbook&lt;/a&gt;, and the wonderful set of built-in docs (i.e., there&amp;rsquo;s not only man pages for the commands, but also for the config files!). By the way, if you want to give it a try, &lt;a href="https://www.c0ffee.net/blog/openbsd-on-a-laptop/"&gt;OpenBSD on a Laptop&lt;/a&gt; is a must read.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Linux people do what they do because they hate Microsoft. We do what we do because we love Unix. &amp;ndash;– Theo de Raadt&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Now, back to the install itself. The installer and package manager are a piece of beauty, really. You are prompted to set up disk partitioning, hostname, ethernet configuration (via DHCP over IPV4, or via IPV6), etc. with sensible defaults each time (e.g., do not allow ssh as root but start sshd on boot). It is possible to start an X session automagically using xenodm, and then you can use cmw or the fmwm (default) window manager. While I quite like cwm, I much prefer i3, for it allows to mimic my custom settings on Ubuntu and macOS using Kitty. Installing additional packages over the internet or from the internal sets is also easy and pretty quick. I found everything I needed using simple queries like, ̀̀&lt;code&gt;doas pkg_add nvim&lt;/code&gt;. Note that &lt;code&gt;exa&lt;/code&gt; and &lt;code&gt;ripgrep&lt;/code&gt; are also available.&lt;/p&gt;
&lt;p&gt;A simple call to &lt;code&gt;top&lt;/code&gt; suggests that the whole system, OpenBSD and i3, relies on less than 30 processes whereas the Gnome Desktop manager that is running on Ubuntu requires many more processes that I am not even using (e.g., evolution). The simple session that I&amp;rsquo;m currently logged on (two xterm, no Firefox) is actually using around 600 Mb. That&amp;rsquo;s pretty nice.&lt;/p&gt;
&lt;p&gt;Unlike ubuntu, default &lt;a href="https://aliquote.org/post/christmas-admin-on-ubuntu/"&gt;permissions&lt;/a&gt; are more sensible, and there&amp;rsquo;s even a sandboxing policy for applications that require extra privileges, like accessing the web or talking to external servers. See also &lt;a href="https://dataswamp.org/~solene/2021-02-14-openbsd-default-security.html"&gt;What security does a default OpenBSD installation offer?&lt;/a&gt; (or the &lt;a href="https://dataswamp.org/~solene/2021-01-04-pourquoi-openbsd.html"&gt;French version&lt;/a&gt;). And there&amp;rsquo;s also: (although I didn&amp;rsquo;t check by myself)&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2023-08-14]&lt;/small&gt;&lt;br&gt;
Unfortunately, the tweet with ID 1358556278985998336 is no longer available.
&lt;/div&gt;
&lt;p&gt;So far, so good. I will probably stop here for a while, since I&amp;rsquo;m in the middle of my move and have other things to complete before leaving, but I hope I&amp;rsquo;ll be posting more on this later in March.&lt;/p&gt;</description></item><item><title>Lurking on the web</title><link>https://aliquote.org/post/lurking-on-internet/</link><pubDate>Tue, 16 Feb 2021 20:27:23 +0100</pubDate><guid>https://aliquote.org/post/lurking-on-internet/</guid><description>&lt;p&gt;Lurking on the web, but why? This is oftentimes for fruitless interaction or a simple waste of time in the face of this mass of nameless information that has become the web today.&lt;/p&gt;
&lt;p&gt;Today I was reading one of Solène Rapenne&amp;rsquo;s posts, and I found that the &lt;a href="https://dataswamp.org/~solene/2020-02-18-offline-laptop-v2.html"&gt;following&lt;/a&gt; nicely summarizes the above point:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Having access to the Internet is a gift, I can access anything or anyone. But this comes with a few drawbacks. I can waste my time on anything, which is not particularly helpful. There are so many content that I only scratch things, knowing it will still be there when I need it, and jump to something else. The amount of data is impressive, one human can’t absorb that much, we have to deal with it.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;There are many other posts like this, and if you like the *BSD world, you&amp;rsquo;re on the right track anyway.&lt;/p&gt;
&lt;p&gt;Over the years I have accumulated thousands of links. I&amp;rsquo;m happy when I read some old posts where links I posted are still alive. I don&amp;rsquo;t want to track all the dead links and replace them with pointers to the Way Back Machine or other archiving system. After all, if they are dead, they are just dead, for whatever reason. At best I can fix redirections to my own material when I find out dangling links, but that&amp;rsquo;s all.&lt;/p&gt;
&lt;p&gt;Anyway, in this post I wanted to reflect on this very specific point, which is that I spend more time looking for information than exploiting it, or even exploiting the information I&amp;rsquo;ve already accumulated. It&amp;rsquo;s really not a good thing in reality, it&amp;rsquo;s even counterproductive: it&amp;rsquo;s very likely that I&amp;rsquo;ll forget what I&amp;rsquo;ve just looked at and find great within 10 days because in the meantime I&amp;rsquo;m bound to have found something else exciting.&lt;/p&gt;
&lt;p&gt;Since I&amp;rsquo;m pretty busy at work, the only time I can give myself to work on what has aroused my curiosity are my evenings, often spent comatose between an exhausting end of the day and the accumulation of medication in my body (drowned in one or two glasses of alcohol, of course), and my weekends, which I also spend recovering from the physically demanding week and enjoying the presence of my son. In short, I don&amp;rsquo;t have enough time for everything I would like to do. But if I limit my internet interactions to the bare essentials, which means fewer external links on the micro-blog, I may be able to accumulate enough time to start reading more seriously the man pages, the PDF books I&amp;rsquo;ve accumulated over the years, and produce more personal and rewarding things.&lt;/p&gt;
&lt;p&gt;This is what I intended to do last year already, when I started writing posts about mathematical programming and statistical computing. Then I stopped, for whatever reason again. I therefore declare that the year 2021 will be the year of posts more oriented on specific projects and much less generalist, like my previous reading reviews. Let&amp;rsquo;s see how it goes.&lt;/p&gt;</description></item><item><title>Usenet</title><link>https://aliquote.org/post/usenet-and-slrn/</link><pubDate>Mon, 15 Feb 2021 20:29:09 +0100</pubDate><guid>https://aliquote.org/post/usenet-and-slrn/</guid><description>&lt;p&gt;I don&amp;rsquo;t know where the Usenet has been in the last few years. I have read that some people still use it, as simple readers, or to post messages. According to my investigations, not very extensive though, many groups are just full of spams (e.g., comp.lang.lisp or comp.lang.awk), others are still doing relatively well (comp.lang.c) and for some people you will find more interesting exchanges on Freenode (e.g., comp.lang.scheme).&lt;/p&gt;
&lt;p&gt;Personally, I stopped using Usenet a long time ago, and favored over this time simple mailing-lists, mostly from the R ecosystem some 10-15 years ago. I unsubscribed to all of them, including all the Google groups I was registered on. I believe the last time I read posts on comp.lang.lisp was on the mirror Google group, by the way. It was ever &lt;a href="https://www.reddit.com/r/lisp/comments/hyf3yu/complanglisp_banned_from_google_groups/"&gt;banned&lt;/a&gt; due to the amount of spams at some point.&lt;/p&gt;
&lt;p&gt;Anyway, these days I feel just as comfortable reading my collection of curated threads, right from my RSS reader (&lt;a href="https://newsboat.org/"&gt;newsboat&lt;/a&gt;). For more interactive session, I still have IRC and Matrix under the bend, and that&amp;rsquo;s alright.&lt;/p&gt;
&lt;p&gt;However, last week I installed and configured &lt;a href="https://www.slrn.org/"&gt;slrn&lt;/a&gt;, just out of curiosity and for the pleasure of finding Usenet listings. I thought it would be a good fit for my TUI-only setup of the moment. This is the case indeed, as it is mostly inbetween &lt;a href="https://neomutt.org/"&gt;mutt&lt;/a&gt; and newsboat. I used &lt;a href="https://www.eternal-september.org/"&gt;news.eternal-september.org&lt;/a&gt; as my NNTP provider. Apparently, it works great when you&amp;rsquo;re in France, except behind some University firewalls.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2021-02-15-20-54-48.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2021-02-15-20-54-48.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2021-02-15-20-55-09.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2021-02-15-20-55-09.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Did I read a lot of posts? Not really. I just skimmed over some groups I was following years ago, and subscribed to a few others. Unfortunately, I haven&amp;rsquo;t been able to get my hands on my Emacs Gnus archives. It&amp;rsquo;s always a bit like the principle of old backups: you never really find what you&amp;rsquo;re looking for!&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2020-06-15]&lt;/small&gt;&lt;br&gt;
TIL that &lt;a href="https://aliquote.org/post/neomutt/"&gt;Neomutt&lt;/a&gt; handles NNTP servers quite well actually. I pressed &lt;code&gt;i&lt;/code&gt; (&lt;code&gt;&amp;lt;change-newsgroup&amp;gt;&lt;/code&gt;) while intending to press a different key, it catched up my settings to connect to NES and asked me which group I wanted to subscribe to. Great!
&lt;/div&gt;
&lt;p&gt;This was a pleasant experience in any case. I will undoubtedly consult the archives from time to time.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Morcheeba • &lt;em&gt;Blood Like Lemonade&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>The unquantified self #16</title><link>https://aliquote.org/post/unquantified-self-016/</link><pubDate>Tue, 02 Feb 2021 16:58:07 +0100</pubDate><guid>https://aliquote.org/post/unquantified-self-016/</guid><description>&lt;p&gt;Time goes by, at least that&amp;rsquo;s what I tell myself. And above all, maybe we&amp;rsquo;ll finally get out of winter, which is definitely less and less successful for me.&lt;/p&gt;
&lt;p&gt;It took me 3 weeks to regain satisfactory productivity after the last self-confinement period in November-December. I have rarely written so much code in such a short time, and especially spent more than 7 hours a day continuously or almost continuously between my text editor and the command line. It&amp;rsquo;s pretty cool because I don&amp;rsquo;t have to switch between a multitude of programs, and I can stay focused on what I&amp;rsquo;m doing.&lt;/p&gt;
&lt;p&gt;My apartment is starting to look like a squat full of boxes. I&amp;rsquo;m supposed to be moving next month, and I wanted to anticipate as much as possible any possible fatigue, so I started packing my thousands of pounds in the second week of January, and I&amp;rsquo;m spacing out the effort as much as possible. This being said, everything should be ready by the end of February.&lt;/p&gt;
&lt;p&gt;With my son we watched every episode of Saw and every 5 Alien released since the 80s. For my part I watched 24 for the fourth time, in reverse order this time. I think after that I will take a TV break for several weeks, except for the evenings with my son.&lt;/p&gt;
&lt;p&gt;Finally, I swapped my Macbook and my last 15 years with OS X and macOS for a Dell with Ubuntu 20.04 LTS. The transition was not complicated, especially since I had been using only command line programs for several months. So I stay on the Zsh + Vim + Fzf triumvirate, as well as the basic Unix toolbox. And it works well, believe me.&lt;/p&gt;</description></item><item><title>Practical and Modern Vim</title><link>https://aliquote.org/post/practical-and-modern-vim/</link><pubDate>Fri, 29 Jan 2021 21:08:07 +0100</pubDate><guid>https://aliquote.org/post/practical-and-modern-vim/</guid><description>&lt;p&gt;Lately I read &lt;a href=""&gt;Modern Vim&lt;/a&gt; and &lt;a href=""&gt;Practical Vim&lt;/a&gt;, by Drew Neil. I bought both books two years ago and I already read &lt;em&gt;Modern Vim&lt;/em&gt; last Summer, but I forgot about &lt;em&gt;Practical Vim&lt;/em&gt; for a long time. In fact, I started writing a review of Modern Vim, then let it go in my Drafts folder, and remove it a few weeks later. At that time, I was still using Emacs all day long, and I was just barely scratching the surface of Vim. Now that I&amp;rsquo;m using Neovim full time, I came to appreciate modal editing, but the most important thing, I believe, is that I discovered how to efficiently use the Insert and Visual mode, and why switching back to Normal mode is so important.&lt;/p&gt;
&lt;p&gt;A few months ago I wrote a quick and dirty guide to Vim keybindings, for Doom Emacs users like me. Then I realized that I should embrace the Vim philosophy of text editing more closely. Hence the move, which also follows from the idea that I needed simpler tools, mostly oriented around the command-line, and which allow me to focus on one thing at a time.&lt;/p&gt;
&lt;h2 id="modern-vim"&gt;Modern Vim&lt;/h2&gt;
&lt;p&gt;Back to the subject&amp;rsquo;s matter. While &lt;em&gt;Modern Vim&lt;/em&gt; focuses on managing Vim 8 and Neovim, with an emphasis on cross-platform and cross-application compatibility (meaning, your very own config is likely to work on macOS and Linux, whether you use Vim 8 or Neovim). The author recommends a few packages to enhance Vim&amp;rsquo;s core functionalities. I still use Vimplug, but Vim 8 and Neovim do have a native plugin manager. Among the recommended plugins are: &lt;a href="https://github.com/junegunn/fzf"&gt;FZF&lt;/a&gt; (I also recommend &lt;code&gt;fzf.vim&lt;/code&gt;), &lt;code&gt;vim-projectionist&lt;/code&gt; (I don&amp;rsquo;t need this), &lt;code&gt;vim-dispatch&lt;/code&gt; (not sure we really need this with the async features of Vim 8 and Neovim and a few custom settings for using &lt;code&gt;make&lt;/code&gt;), &lt;code&gt;ale&lt;/code&gt;, which is on my preferred plugin, together with &lt;code&gt;vim-polyglot&lt;/code&gt; and &lt;code&gt;vim-fugitive&lt;/code&gt;, for coding, &lt;code&gt;vim-grepper&lt;/code&gt; (I don&amp;rsquo;t use it since I rely on a hand-made Grep function, stolen from &lt;a href="https://github.com/strager/dotfiles"&gt;strager&lt;/a&gt;&amp;rsquo;s Github repo), and &lt;code&gt;vim-test&lt;/code&gt; (no need for this).&lt;/p&gt;
&lt;p&gt;Chapter 5 is all about managing Neovim&amp;rsquo;s internal terminal emulator, which is great compared to what used to exist in Vim. I already used vterm in Emacs, so I know it&amp;rsquo;s a reliable choice (&lt;code&gt;shell&lt;/code&gt;, &lt;code&gt;term&lt;/code&gt;, &lt;code&gt;ansi-term&lt;/code&gt; were always failing me at some point), and the author also discusses the use of ̀&lt;code&gt;neovim-remote&lt;/code&gt; (aka &lt;code&gt;nvr&lt;/code&gt;), which is mostly &lt;code&gt;emacsclient&lt;/code&gt; for Neovim. Drew Neil also discussed the management of sessions, which I decided not to use deliberately. I now prefer to start from scratch every time I worked on an existing or a new project, and everything should be reproducible when restarting from scratch. The last chapter is about writing your own custom &amp;ldquo;autocommands&amp;rdquo; and defining specific settings that ought to apply globally, per project, or per buffer.&lt;/p&gt;
&lt;h2 id="practical-vim"&gt;Practical Vim&lt;/h2&gt;
&lt;p&gt;Here is a brief sketch of the first part of the book. I&amp;rsquo;ll come back to it later once I&amp;rsquo;ve digested the rest of the book. As noted by Tim pope in his preface to &lt;em&gt;Practical Vim&lt;/em&gt;, this book is not a simple bag of tips and tricks.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;You can understand my skepticism, then, when I found out Practical Vim was using a tips format. How could a couple of hundred tips accomplish what took me thousands? A few pages in I realized my definition of “tip” was narrow- minded. In contrast to the problem/solution pattern I had expected, Practical Vim tips teach lessons in thinking like a proficient Vim user. In a sense, they are more like parables than recipes. The first few tips are lessons about the wide applicability of the . command. This is a staple of any proficient Vim user’s repertoire, yet without guidance it was years before I came to realize this on my own.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Rather it introduces core concepts for efficient editing in Vim and understanding why it is so. The later point is important because the reader get involved in the process of thinking about Vim in Vim terms, or rather using Vim vocabulary. I learned a lot of useful tips, indeed, but it also led me to rethink what a text editor really is, and how Vim can help me in my day to day tasks of text editing.&lt;/p&gt;
&lt;p&gt;A striking feature of Vim is that you can organize your editing task much like you would do when using Git to manage your work in progress: You create some chunks of text, commit them, and then you can play around (move forward, revert, stash, etc.). Except that in the case of Vim, commiting is mostly switching back to Normal mode after you add some text in Insert mode. Much lower granularity, compared to Git, but this allows to operate on the latest chunk for, e.g., undoing things, copying or repeating, and things like that. The author insists on the idea of building repeatable actions inasmuch as possible, even for such a simple task like adding trailing period in an item list (&lt;code&gt;A;j.&lt;/code&gt;).&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Our work is repetitive by nature. Whether we’re making the same small change in several places or moving around between similar regions of a document, we repeat many actions. Anything that can streamline a repetitive workflow will save our time multifold. Vim is optimized for repetition. Its efficiency stems from the way it tracks our most recent actions. We can always replay the last change with a single keystroke. Powerful as this sounds, it’s useless unless we learn to craft our actions so that they perform a useful unit of work when replayed. Mastering this concept is the key to becoming effective with Vim.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Drew Neil also discusses Ex commands. They may seem arcane, except for heavy Sed users, but they prove very useful in case you don&amp;rsquo;t want to jump to the region or line of interest and just apply a command right from your insertion point. There&amp;rsquo;s a lot going on in this chapter, including calling external programs or interacting with the shell. Since I mostly use the built-in Neovim terminal, I don&amp;rsquo;t rely much on those features (besides &lt;code&gt;:sort&lt;/code&gt;), but it&amp;rsquo;s good to know there are so many possibilities available within a few keystrokes.&lt;/p&gt;</description></item><item><title>Micro posting in January</title><link>https://aliquote.org/post/micro-01-2021/</link><pubDate>Tue, 26 Jan 2021 20:58:29 +0100</pubDate><guid>https://aliquote.org/post/micro-01-2021/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-01-02&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In an industry that is notoriously behind the times, a fundamental change is underway. This change is in response to new business demands, including: (1) The desire to price increasingly complex deals with increasingly large datasets; (2) The desire to integrate with 3rd party data to augment pricing models; (3) The desire for faster models and robust codebases that adhere to software development best practices. Excel fails miserably at these tasks. &amp;mdash; &lt;a href="https://amypeniston.com/ditching-excel-for-python/"&gt;Ditching Excel for Python – Lessons Learned from a Legacy Industry&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-01-02&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;There are definitely disadvantages to use text streams as the universal interface between programs due to its lack of structure. But the timelessness of many of the programs following this pattern and the prosperity that it brings to the CLI ecosystem proved its effectiveness as a design choice. Text can be read by both human and programs. It can be manipulated, printed, stored, trasferred, version controlled with the tools of your choice. For programs that do not inheritantly require structured data, using text streams as interface provides the most flexibility and composibility. &amp;mdash; &lt;a href="http://hongchao.me/hongchao.me/cli-and-emacs/"&gt;Emacs is the 2D Command-line Interface&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-01-02&lt;/a&gt;: Nice series on Python: &lt;a href="https://tenthousandmeters.com/blog/python-behind-the-scenes-1-how-the-cpython-vm-works/"&gt;Python behind the scenes&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-01-02&lt;/a&gt;: &lt;a href="https://initialcommit.com/blog/7-versatile-vim-commands"&gt;7 versatile Vim commands that are easy to memorize&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-01-02&lt;/a&gt;: &lt;a href="https://nibblestew.blogspot.com/2020/12/some-things-potential-git-replacement.html"&gt;Some things a potential Git replacement probably needs to provide&lt;/a&gt;. &lt;code&gt;#git&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-01-04&lt;/a&gt;: &lt;a href="https://csgordon.github.io/books.html"&gt;A loosely-categorized collection of links to CS textbooks in a variety of areas that are freely available online&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-01-04&lt;/a&gt;: &lt;a href="https://samplesize.one/blog/posts/my_year_in_data/"&gt;My year in data&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-01-04&lt;/a&gt;: &lt;a href="https://briansunter.com/blog/why-clojure/"&gt;Why Clojure?&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-01-06&lt;/a&gt;: &lt;a href="https://www.timmons.dev/posts/static-executables-with-sbcl.html"&gt;Static Executables with SBCL&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-01-06&lt;/a&gt;: &lt;a href="https://kiramclean.com/blog/what-i-use-now-instead-of-google/"&gt;What I Use Now Instead Of Google&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-01-07&lt;/a&gt;: Trying out Byobu. Not sure it works best compared to my Kitty + Tmux settings, since it becomes hard to manage a Byobu session on a remote machine from a currently running Byobu terminal. However, when using Kitty as the driving terminal, I get all the Byobu goodies on the remote server.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-01-08&lt;/a&gt;: Some useful tips on &lt;a href="https://malisper.me/category/debugging-common-lisp/"&gt;Lisp debugging&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-01-08&lt;/a&gt;: &lt;a href="https://personal.sron.nl/~pault/"&gt;Colour schemes and templates&lt;/a&gt;, by Paul Tol.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-01-08&lt;/a&gt;: &lt;a href="https://www.murilopereira.com/how-to-open-a-file-in-emacs/"&gt;How to open a file in Emacs&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-01-12&lt;/a&gt;: &lt;a href="https://www.tfeb.org/fragments/2021/01/08/generic-interfaces-in-racket/"&gt;Generic interfaces in Racket&lt;/a&gt;. &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-01-12&lt;/a&gt;: &lt;a href="https://www.tfeb.org/fragments/2016/06/09/python-instead-of-lisp/"&gt;Python instead of Lisp&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-01-12&lt;/a&gt;: &lt;a href="https://www.spinellis.gr/blog/20210102/"&gt;Reviving the 1973 Unix text to voice translator&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-01-12&lt;/a&gt;: &lt;a href="https://www.xach.com/rpw3/articles/index.html"&gt;Rob Warnock Lisp usenet archive&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-01-13&lt;/a&gt;: &lt;a href="https://app.getpocket.com/read/3141134376"&gt;2.1M of the oldest Usenet posts are now online for anyone to read&lt;/a&gt;. Feeling older and older&amp;hellip;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-01-13&lt;/a&gt;: &lt;a href="https://rambo.codes/posts/2021-01-08-distributing-mac-apps-outside-the-app-store"&gt;Distributing Mac apps outside the App Store, a quick start guide&lt;/a&gt;. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-01-13&lt;/a&gt;: &lt;a href="https://rawgit.com/oblitum/typographic-email/master/dist/kitchen_sink.html"&gt;Typographic Email Kitchen Sink&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-01-15&lt;/a&gt;: I gave up with calcurse to manage my TODOs and agenda. I&amp;rsquo;m probably not an agenda&amp;rsquo;s guy. However, I added &lt;a href="https://cmus.github.io/"&gt;cmus&lt;/a&gt; to my TUI toolbelt and it&amp;rsquo;s now my default music player. If only the Latitude 7310 had a better built-in sound system.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-01-15&lt;/a&gt;: &lt;a href="https://thedorkweb.substack.com/p/a-week-with-plan-9"&gt;A Week With Plan 9&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-01-15&lt;/a&gt;: &lt;a href="https://www.murilopereira.com/a-rabbit-hole-full-of-lisp/"&gt;A rabbit hole full of Lisp&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-01-15&lt;/a&gt;: &lt;a href="https://www.soupbowl.io/2020/04/macos-in-virtualbox/"&gt;MacOS in Virtualbox. It just works&lt;/a&gt;. It would sound weird to install macOS on top of Ubuntu, but I appreciate that the author stays at Mojave, which is probably the latest version of macOS in line with OS X&amp;rsquo;s original spirit.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-01-17&lt;/a&gt;: What you need on Sunday evening when you&amp;rsquo;re looking for a specific file in your &amp;ldquo;Papers&amp;rdquo; directory:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;alias&lt;/span&gt; &lt;span class="nv"&gt;bibfind&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;bibtex-ls ~/org/references.bib
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; \| fzf --multi --ansi
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; \| rg -o --color never &amp;#39;[a-z0-9\-]+&lt;/span&gt;$&lt;span class="s2"&gt;&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; \| xargs -I % sh -c &amp;#39;fdfind % ~/Documents/papers&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; \| xargs -I % sh -c &amp;#39;xdg-open %&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note that this requires &lt;a href="https://github.com/msprev/fzf-bibtex"&gt;fzf-bibtex&lt;/a&gt;, &lt;a href="https://github.com/BurntSushi/ripgrep"&gt;rg&lt;/a&gt; and &lt;a href="https://github.com/sharkdp/fd"&gt;fd&lt;/a&gt;, but the later two can easily be replaced with the standard ̀&lt;code&gt;grep&lt;/code&gt; and &lt;code&gt;find&lt;/code&gt; tools.&lt;/p&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-01-18&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;It’s hard to contest that Neovim’s achievement happened because of its approachable development process focused on maintainability and velocity, while in contrast, it could be argued that current progress in Emacs happens despite its development process. (and a bunch of other very good points in this article) &amp;mdash; &lt;a href="https://www.murilopereira.com/the-values-of-emacs-the-neovim-revolution-and-the-vscode-gorilla/"&gt;The values of Emacs, the Neovim revolution, and the VSCode gorilla&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-01-18&lt;/a&gt;: &lt;a href="https://mrzool.cc/writing/typesetting-automation/"&gt;Typesetting automation&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-01-18&lt;/a&gt;: &lt;a href="https://blog.sanctum.geek.nz/series/unix-as-ide/"&gt;Unix as IDE&lt;/a&gt;. See also the &lt;a href="https://github.com/mrzool/unix-as-ide"&gt;ebook&lt;/a&gt; version.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-01-19&lt;/a&gt;: I already have all my emails on my laptop since several years. I am about to transfer more than1500 MP3 files to my Music library. Next step: Get back all my hi-res photos from the cloud.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-01-22&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The thing that comes through in the interview is that Knuth is dedicated to bringing the same joy he finds in the material to others. He structures his prose to keep the reader turning the page. Then, of course, there’s his fanatical commitment to making his printed works look good. &amp;mdash; &lt;a href="https://irreal.org/blog/?p=9424"&gt;Knuth on Writing&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2021-01-25&lt;/a&gt;: Quickly open a terminal in Neovim (much like pop-up term in Doom Emacs)::5sp +te&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-01-25&lt;/a&gt;: The &lt;a href="https://pgm.di.unipi.it/"&gt;Piecewise Geometric Model&lt;/a&gt; index (PGM-index) is a data structure that enables fast lookup, predecessor, range searches and updates in arrays of billions of items using orders of magnitude less space than traditional indexes while providing the same worst-case query time guarantees.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-01-25&lt;/a&gt;: &lt;a href="https://github.com/cytopia/ffscreencast"&gt;ffscreencast&lt;/a&gt; is a shell wrapper for ffmpeg that allows fool-proof screen recording via the command line.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2021-01-26&lt;/a&gt;: &lt;a href="https://itvision.altervista.org/why.linux.is.not.ready.for.the.desktop.current.html"&gt;Major Linux Problems on the Desktop, 2020 edition&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;</description></item><item><title>Little shell scripts are amazing</title><link>https://aliquote.org/post/playing-with-a-terminal/</link><pubDate>Mon, 25 Jan 2021 20:04:05 +0100</pubDate><guid>https://aliquote.org/post/playing-with-a-terminal/</guid><description>&lt;p&gt;Writing handy Zsh aliases, shell scripts and Vim functions has been the main part of my nightly recess this month. It&amp;rsquo;s fascinating to see how the combination of small command-line utilities leads to a tool that quickly becomes indispensable.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s take for example the case of the management of a bibliography in Bibtex format, in which each entry eventually has an associated PDF file. The name of my PDF files simply consists of the Bibtex key, and they are all saved in the same directory (&lt;code&gt;~/Documents/papers&lt;/code&gt;). I already use &lt;a href="https://github.com/msprev/fzf-bibtex"&gt;bibtex-ls&lt;/a&gt; to quickly search my reference list without having to open the Bibtex file. This is my little replacement for &lt;a href="https://github.com/tmalsburg/helm-bibtex"&gt;ivy-bibtex&lt;/a&gt; since I no longer use Emacs. I even added some of the Vim functions proposed by the author to be able to insert citations in Markdown/Pandoc format (citation key or reference itself):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-vim" data-lang="vim"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="p"&gt;!&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;:&lt;span class="nx"&gt;bibtex_markdown_sink&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;lines&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;system&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;bibtex-markdown &amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;:&lt;span class="nx"&gt;lines&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;execute&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;:normal! a&amp;#39;&lt;/span&gt; . &lt;span class="nx"&gt;r&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;endfunction&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="p"&gt;!&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;:&lt;span class="nx"&gt;bibtex_cite_sink&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;lines&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;system&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;bibtex-cite &amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;:&lt;span class="nx"&gt;lines&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;execute&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;:normal! a&amp;#39;&lt;/span&gt; . &lt;span class="nx"&gt;r&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;call&lt;/span&gt; &lt;span class="nx"&gt;feedkeys&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;a&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;endfunction&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;nnoremap&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;silent&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;leader&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;b&lt;/span&gt; :&lt;span class="nx"&gt;call&lt;/span&gt; &lt;span class="nx"&gt;fzf&lt;/span&gt;#&lt;span class="nx"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;{
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \ &lt;span class="s1"&gt;&amp;#39;source&amp;#39;&lt;/span&gt;: &lt;span class="s1"&gt;&amp;#39;bibtex-ls&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \ &lt;span class="s1"&gt;&amp;#39;sink*&amp;#39;&lt;/span&gt;: &lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&amp;lt;sid&amp;gt;bibtex_markdown_sink&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \ &lt;span class="s1"&gt;&amp;#39;down&amp;#39;&lt;/span&gt;: &lt;span class="s1"&gt;&amp;#39;20%&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \ &lt;span class="s1"&gt;&amp;#39;options&amp;#39;&lt;/span&gt;: &lt;span class="s1"&gt;&amp;#39;--ansi --layout=reverse-list --multi --prompt &amp;#34;Bibtex (reference)&amp;gt; &amp;#34;&amp;#39;&lt;/span&gt;}&lt;span class="p"&gt;)&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;inoremap&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;silent&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;C&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;c&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;g&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;u&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;c&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;o&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;:&lt;span class="nx"&gt;call&lt;/span&gt; &lt;span class="nx"&gt;fzf&lt;/span&gt;#&lt;span class="nx"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;{
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \ &lt;span class="s1"&gt;&amp;#39;source&amp;#39;&lt;/span&gt;: &lt;span class="s1"&gt;&amp;#39;bibtex-ls&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \ &lt;span class="s1"&gt;&amp;#39;sink*&amp;#39;&lt;/span&gt;: &lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&amp;lt;sid&amp;gt;bibtex_cite_sink&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \ &lt;span class="s1"&gt;&amp;#39;down&amp;#39;&lt;/span&gt;: &lt;span class="s1"&gt;&amp;#39;20%&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; \ &lt;span class="s1"&gt;&amp;#39;options&amp;#39;&lt;/span&gt;: &lt;span class="s1"&gt;&amp;#39;--ansi --layout=reverse-list --multi --prompt &amp;#34;Bibtex (cite)&amp;gt; &amp;#34;&amp;#39;&lt;/span&gt;}&lt;span class="p"&gt;)&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CR&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is shameless copy-paste, I just changed the shortcuts.&lt;/p&gt;
&lt;p&gt;A few days ago I thought it would be convenient to be able to directly open PDFs, when they exist, by searching for entries directly from a terminal using bibtex-ls. And it works! Here is what I finally came up with:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;alias&lt;/span&gt; &lt;span class="nv"&gt;bibfind&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;bibtex-ls ~/org/references.bib \
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; | fzf --multi --ansi \
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; | rg -o --color never &amp;#39;[a-z0-9\-]+&lt;/span&gt;$&lt;span class="s2"&gt;&amp;#39; \
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; | xargs -I % sh -c &amp;#39;fdfind % ~/Documents/papers&amp;#39; \
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; | xargs -I % sh -c &amp;#39;xdg-open %&amp;#39;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I wished I could simplify the last two instructions, but that&amp;rsquo;s fine.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;p&gt;&lt;small&gt;[2022-08-24]&lt;/small&gt;&lt;br&gt;
I still use the Vim function discussed below to open PDF from my Bibtex file, but since I no longer use &lt;a href="https://github.com/junegunn/fzf.vim"&gt;fzf&lt;/a&gt;, the previous mappings no longer apply. I used to use &lt;a href="https://github.com/nvim-telescope/telescope-bibtex.nvim"&gt;telescope-bibtex.nvim&lt;/a&gt; as a replacement, but eventually I got back to shell scripting and rewrote my aliases as proper Bash scripts. I added a &lt;code&gt;bibcite&lt;/code&gt; command which reads:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
bibtex-ls ~/Documents/notes/references.bib |
fzf --multi --ansi |
rg -o --color never '[a-z0-9\-]+$' |
xargs -I % sh -c 'printf %' |
xclip -sel clip
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Basically it fires a Fzf prompt and copy the selected entry to the primary clipboard. I can then insert the Bibtex key right into a Neovim buffer.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Now, what if I could also open the PDF file associated to a Bibtex entry directly while I&amp;rsquo;m browsing the Bibtex file itself? So, here&amp;rsquo;s the very first Vim function that I wrote from scratch:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-vim" data-lang="vim"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;&amp;#34;&amp;#34; Open bibtex key at point&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="p"&gt;!&lt;/span&gt; &lt;span class="nx"&gt;Open_bibtex_key&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;:&lt;span class="nx"&gt;uri&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;expand&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&amp;lt;cWORD&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;{&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;[&lt;span class="m"&gt;1&lt;/span&gt;]&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;,&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;[&lt;span class="m"&gt;0&lt;/span&gt;]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;:&lt;span class="nx"&gt;uri&lt;/span&gt; &lt;span class="p"&gt;!=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;silent&lt;/span&gt; &lt;span class="nx"&gt;exec&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;!xdg-open ~/Documents/papers/&amp;#39;&amp;#34;&lt;/span&gt;.&lt;span class="nx"&gt;s&lt;/span&gt;:&lt;span class="nx"&gt;uri&lt;/span&gt;.&lt;span class="s2"&gt;&amp;#34;&amp;#39;.pdf&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;No match found.&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;endif&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;endfunction&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;map&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;silent&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;leader&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;o&lt;/span&gt; :&lt;span class="nx"&gt;call&lt;/span&gt; &lt;span class="nx"&gt;Open_bibtex_key&lt;/span&gt;&lt;span class="p"&gt;()&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That&amp;rsquo;s it!&lt;/p&gt;</description></item><item><title>Happy New Year</title><link>https://aliquote.org/post/happy-new-year/</link><pubDate>Fri, 01 Jan 2021 20:48:00 +0100</pubDate><guid>https://aliquote.org/post/happy-new-year/</guid><description>&lt;p&gt;In which we wish our readers a happy new year.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s not lie to ourselves, the year will not have been glorious and does not deserve a real retrospective, so let&amp;rsquo;s continue our adventures in the Ubuntu universe.&lt;/p&gt;
&lt;p&gt;Before that, I wanted to mention two things: First, I no longer use a JS tracker (Matomoto) to record site statistics (visit counts and the like, nothing sensitive) &amp;mdash; I expect between 30 and 70 visits each day, from my review of the past two years, and that&amp;rsquo;s all I wanted to know; second, this site has been up for 13 years now, at least the blog section. It&amp;rsquo;s been a long time, really, especially given the fact that I almost lost control some years ago. In spite of the events I continued to write, on the one hand to maintain the habits and on the other hand not to let this blog die on its own. I am glad that these efforts were not in vain since I will have written some 250 posts in the last three years. And thank you for reading, if you&amp;rsquo;re a regular user of this site.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s go back to Ubuntu. I&amp;rsquo;m still setting up things the way I like and adding packages here and there. Lastly, I was happy to get Stata 13 MP working on my Linux machine. Overall, I would say the UI is quite better than what it is on macOS Mojave (with its default management of popup windows on screen), but you have to perform a bit of additional configuration to get it feel the right way. This is mostly about the icons (and default color scheme, but let&amp;rsquo;s not talk about that since the same applies to default 8-bit colors), which are totally missing upon the basic installation, as can be seen below:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2020-12-30-16-30-52.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Fortunately, there&amp;rsquo;s an easy solution to &lt;a href="https://github.com/kylebarron/stata-png-fix"&gt;fix missing Stata icons on Linux&lt;/a&gt;. Also, if you want to upgrade, you will probably need to downgrade permissions in &lt;code&gt;/usr/local/stata&lt;/code&gt; or ̀̀&lt;code&gt;/usr/local/stata13&lt;/code&gt; (which is where we usually install Stata, here &lt;code&gt;/usr/local/stata&lt;/code&gt; is just a symlink to &lt;code&gt;/usr/local/stata13&lt;/code&gt; on my machine), e.g., 777 instead of 755, since downloaded files are saved in &lt;code&gt;.tmp/&lt;/code&gt; folder under that directory. Finally, your &lt;code&gt;profile.do&lt;/code&gt; file may be stored either as &lt;code&gt;$HOME/profile.do&lt;/code&gt; or &lt;code&gt;$HOME/bin/profile.do&lt;/code&gt;. I prefer the latter since I don&amp;rsquo;t like dangling files in my HOME directory. Further customizations are discussed in the following blog post: &lt;a href="https://acarril.github.io/posts/install-stata-linux"&gt;Installing Stata in Linux&lt;/a&gt;. This is especially relevant if you plan to use the graphical frontend and want a tight OS integration (i.e., MIME type and shortcut in the activity menu bar). And here we go:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2021-01-01-21-15-49.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Funny first ticket for 2021 but let&amp;rsquo;s hope that this year will be as productive as the last years.&lt;/p&gt;</description></item><item><title>On creating Org documents using shell scripts</title><link>https://aliquote.org/post/standalone-org-babel/</link><pubDate>Mon, 28 Dec 2020 20:28:18 +0100</pubDate><guid>https://aliquote.org/post/standalone-org-babel/</guid><description>&lt;p&gt;I switched recently to Neovim as a full-time text editor. This means that I no longer have access to Emacs Org mode natively. Of course, I still have Emacs on my machine &amp;mdash; otherwise, I wouldn&amp;rsquo;t be able to handle Org file without resorting to Pandoc (which doesn&amp;rsquo;t handle Babel code chunks, unfortunately). This is just that I want to avoid opening Emacs just to export an Org file to a PDF or HTML document. Hopefully, it&amp;rsquo;s quite easy to call Emacs from the command line and ask it to compile Org files on the go.&lt;/p&gt;
&lt;p&gt;Over the past few months, I wrote some custom templates for PDF and HTML exports, namely the Tufte $\LaTeX$ handout and a hand crafted HTML template that I discussed in previous posts. I know I could write in Markdown and use Pandoc, but I don&amp;rsquo;t want to forget all those Org files that I wrote in the last two years or so. Moreover, I still believe that the Org specs are better than the Markdown ones, especially because the latter are not really ones.&lt;/p&gt;
&lt;p&gt;Here is a simple shell script that takes care of this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#!/usr/bin/env bash
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;OPT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;FILE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;ELISP&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;/home/chl/Documents/notes/.assets/org-babel.el&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;BIB&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;#+BIBLIOGRAPHY: references ieeetr limit:t option:-nobibsource&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="nv"&gt;$OPT&lt;/span&gt; in
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;-pdf&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; emacs --batch -l &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$ELISP&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; --eval &lt;span class="s2"&gt;&amp;#34;(progn (find-file \&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$FILE&lt;/span&gt;&lt;span class="s2"&gt;\&amp;#34;) (org-latex-export-to-pdf))&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;-html&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; cp &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$FILE&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;_&lt;/span&gt;&lt;span class="nv"&gt;$FILE&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;rc&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;grep &lt;span class="s1"&gt;&amp;#39;#+BIBLIOGRAPHY&amp;#39;&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$FILE&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="k"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;[&lt;/span&gt; -z &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$rc&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$BIB&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; &amp;gt;&amp;gt;&lt;span class="s2"&gt;&amp;#34;_&lt;/span&gt;&lt;span class="nv"&gt;$FILE&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; emacs --batch -l &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$ELISP&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; --eval &lt;span class="s2"&gt;&amp;#34;(progn (find-file \&amp;#34;_&lt;/span&gt;&lt;span class="nv"&gt;$FILE&lt;/span&gt;&lt;span class="s2"&gt;\&amp;#34;) (org-html-export-to-html))&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; mv _&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;FILE&lt;/span&gt;&lt;span class="p"&gt;%.org&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;.html&amp;#34;&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;FILE&lt;/span&gt;&lt;span class="p"&gt;%.org&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;.html&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; rm &lt;span class="s2"&gt;&amp;#34;_&lt;/span&gt;&lt;span class="nv"&gt;$FILE&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;*&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Unknown export format.&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;esac&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2022-04-24]&lt;/small&gt;&lt;br&gt;
I updated the above script to account for the case where we want to produce both a PDF and an HTML file. The latter requires a &lt;code&gt;#+BIBLIOGRAPHY:&lt;/code&gt; directive to generate a proper bibliography with &lt;code&gt;bibtex2html&lt;/code&gt;, but this directive is not well handled when exporting to PDF. Maybe there&amp;rsquo;s an option to detect the exporting backend and discard such a directive in case it is not the HTML format, but I don&amp;rsquo;t really know. For the time being, I will just add the HTML directive manually. Older version of this script can be found in the &lt;a href="https://github.com/even4void/aliquote/blob/master/content/post/standalone-org-babel.md"&gt;Git history&lt;/a&gt;.
&lt;/div&gt;
&lt;p&gt;Basically, it allows to compile an Org file and to produce either a PDF or HTML file, based on the flag passed when invoking the command. Of note, for HTML documents it relies on &lt;code&gt;ox-bibtex&lt;/code&gt;, while PDFs are produced using the standard toolchain (biblatex with bibtex backend and pdflatex, but it is not difficult to use biber and lualatex instead). With that in place, I can now regenerate my previous documents without even opening Emacs, which is great after all. I know that the &lt;a href="https://github.com/jceb/vim-orgmode"&gt;vim-orgmode&lt;/a&gt; plugin can take care of this as well, but as you see it is not very difficult to write your own backend for that purpose. I keep my custom settings in the file &lt;code&gt;org-babel.el&lt;/code&gt;, which remains available on Github in my &amp;ldquo;org&amp;rdquo; repository, in case you&amp;rsquo;re interested.&lt;/p&gt;</description></item><item><title>Random thoughts for the end of the year</title><link>https://aliquote.org/post/christmas-admin-on-ubuntu/</link><pubDate>Sun, 27 Dec 2020 07:27:13 +0100</pubDate><guid>https://aliquote.org/post/christmas-admin-on-ubuntu/</guid><description>&lt;p&gt;I replaced my everything-in-Emacs setup with separate apps, and I don&amp;rsquo;t feel lost at all, on the contrary. The only thing I&amp;rsquo;m really missing is my Org setup, but it&amp;rsquo;s by far the simplest configuration I can setup under vanilla Emacs without too much effort. That being said, I really come to appreciate the power of Vim, or Neovim for what matters, for text editing, and single app for other tasks. I found that this allows me to stay more focused on the current task at hand. If I need to check my emails, then I know I need to use a different app (Neomutt); likewise, checking Git status means I need to get back to Zsh and use Git CLI commands or &lt;a href="https://github.com/jonas/tig"&gt;Tig&lt;/a&gt;; and so on for readings news, chatting on IRC&amp;hellip;&lt;/p&gt;
&lt;p&gt;Something I find annoying in Ubuntu are the default permission settings &amp;mdash; 755, which means that others, or the &amp;ldquo;world&amp;rdquo;, have the same privileges than the groups on your &lt;code&gt;$HOME&lt;/code&gt; directory, i.e., everybody can read your own directory. &lt;a href="https://unix.stackexchange.com/questions/95897/permissions-755-on-home-user"&gt;Other distro&lt;/a&gt; don&amp;rsquo;t use 755 as the defaults, and I believe the right permission flags should 751. Recall that r=4, w=2, x=1, for user, group and other, which means that 751 amounts to &lt;code&gt;-rwx-r-x--x&lt;/code&gt;, i.e., you grant read access to group only.&lt;/p&gt;
&lt;p&gt;There&amp;rsquo;s something strange hapenning with Zsh and colored output for &lt;code&gt;ls&lt;/code&gt; (or &lt;code&gt;LS_COLORS&lt;/code&gt; sometimes), unless you&amp;rsquo;re on a BSD-like system where &lt;code&gt;export CLICOLOR=1&lt;/code&gt; takes care of this setting for you. This means that a basic usage of &lt;code&gt;ls&lt;/code&gt; returns a listing of the current directory without any color at all in Ubuntu. Of course, you can set up a quick alias &lt;code&gt;ls=ls --color&lt;/code&gt;, but with time I came to appreciate this. Rather than overriding the default &lt;code&gt;ls&lt;/code&gt; with an alias, I now use the following shortcuts:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;alias&lt;/span&gt; &lt;span class="nv"&gt;la&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;ls -A&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;alias&lt;/span&gt; &lt;span class="nv"&gt;ll&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;exa --long --git&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;alias&lt;/span&gt; &lt;span class="nv"&gt;lk&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;ls -lhSp&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As can be seen, if I need colored output I use &lt;a href="https://the.exa.website/"&gt;exa&lt;/a&gt;, otherwise I stand by the default settings for Zsh.&lt;/p&gt;
&lt;p&gt;I finally managed to install all the programs and libraries I need (including clang10 and Haskell), and to keep away from Node. Why? When you ask to install the very basic stuff (Node and npm), you ended up with something like 300 packages, including Python 2.7 which noboby uses anymore. Why is it that complicated? Can&amp;rsquo;t we really have binary packages for csslint or eslint?&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Les NOUVEAUX paquets suivants seront installés :
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; gyp libc-ares2 libjs-inherits libjs-is-typedarray libjs-psl libjs-typedarray-to-buffer libnode-dev
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; libnode64 libpython2-stdlib libpython2.7-minimal libpython2.7-stdlib libuv1-dev node-abbrev node-ajv
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; node-ansi node-ansi-align node-ansi-regex node-ansi-styles node-ansistyles node-aproba node-archy
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; node-are-we-there-yet node-asap node-asn1 node-assert-plus node-asynckit node-aws-sign2 node-aws4
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; node-balanced-match node-bcrypt-pbkdf node-bl node-bluebird node-boxen node-brace-expansion
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; node-builtin-modules node-builtins node-cacache node-call-limit node-camelcase node-caseless
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; node-chalk node-chownr node-ci-info node-cli-boxes node-cliui node-clone node-co node-color-convert
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -%&amp;lt;------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; node-yargs node-yargs-parser nodejs nodejs-doc npm python-pkg-resources python2 python2-minimal
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; python2.7 python2.7-minimal
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="m"&gt;0&lt;/span&gt; mis à jour, &lt;span class="m"&gt;296&lt;/span&gt; nouvellement installés, &lt;span class="m"&gt;0&lt;/span&gt; à enlever et &lt;span class="m"&gt;16&lt;/span&gt; non mis à jour.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Il est nécessaire de prendre 14,9 Mo dans les archives.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Après cette opération, 75,9 Mo d&lt;span class="err"&gt;&amp;#39;&lt;/span&gt;espace disque supplémentaires seront utilisés.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Anyway, I get a binary-like package for &lt;a href="http://csslint.net/"&gt;csslint&lt;/a&gt; by using rhino as recommended on Github. I am not sure I will miss prettier for HTML and CSS stuff. In my opinion, linters are more valuable than fixers, and Vim&amp;rsquo;s &lt;a href="https://github.com/dense-analysis/ale"&gt;ALE&lt;/a&gt; doesn&amp;rsquo;t care anyway: If there&amp;rsquo;s one fixer available it will be used, otherwise it&amp;rsquo;s not a big deal.&lt;/p&gt;</description></item><item><title>Micro posting in December</title><link>https://aliquote.org/post/micro-12-2020/</link><pubDate>Sat, 26 Dec 2020 20:20:59 +0100</pubDate><guid>https://aliquote.org/post/micro-12-2020/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-12-01&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Not so long ago, I was using macOS as my daily driver. The main reason why I got a macbook was the underlying BSD Unix and the nice graphics it provides. Also, I have an iPhone. But they were also the same reasons for why I left macOS. &amp;mdash; &lt;a href="https://antranigv.am/weblog_en/posts/macos_to_freebsd/"&gt;macOS to FreeBSD migration a.k.a why I left macOS&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-12-02&lt;/a&gt;: &lt;a href="https://amnesia.openaire.eu/"&gt;High accuracy Data Anonymization&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-12-02&lt;/a&gt;: &lt;a href="https://textbooks.math.gatech.edu/ila/index.html"&gt;Interactive Linear Algebra&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-12-02&lt;/a&gt;: &lt;a href="http://core.ecu.edu/psyc/wuenschk/StatHelp/Power-Retrospective.htm"&gt;Retrospective (Observed) Power Analysis&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-12-02&lt;/a&gt;: &lt;a href="https://online.stat.psu.edu/stat555/"&gt;Statistical Analysis of Genomics Data&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-12-03&lt;/a&gt;: &lt;a href="http://bactra.org/weblog/1177.html"&gt;Conceptual Foundations of Statistical Learning&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-12-03&lt;/a&gt;: &lt;a href="https://wandersoncferreira.github.io/blog/emacs-on-terminal/"&gt;Emacs in the terminal&lt;/a&gt; (via &lt;a href="https://irreal.org/blog/?p=9305"&gt;Irreal&lt;/a&gt;). &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-12-03&lt;/a&gt;: &lt;a href="https://www.reddit.com/r/emacs/comments/k1vl00/putting_all_the_pieces_together/"&gt;Putting all the pieces together&lt;/a&gt;. What a wonderful piece of work, by Nicolas Rougier, again. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-12-04&lt;/a&gt;: The simplest solutions are often those that stand the test of time and a changing environment: &lt;a href="https://hachibu.net/posts/2020/how-i-manage-my-random-daily-notes/"&gt;How I Manage My Random Daily Notes&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-12-04&lt;/a&gt;: &lt;a href="https://wicki.io/posts/2020-11-goodbye-google-fonts/"&gt;Time to Say Goodbye to Google Fonts&lt;/a&gt;. It&amp;rsquo;s now more than one year since I decided to &lt;a href="https://aliquote.org/post/site-redesign/"&gt;host my own font&lt;/a&gt;. Google is evil, anyway.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-12-05&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Most people today don’t know what the command line is, much less why they would want to bother with it. As computing pioneer Alan Kay said in a 2017 interview, “Because people don’t understand what computing is about, they think they have it in the iPhone, and that illusion is as bad as the illusion that ‘Guitar Hero’ is the same as a real guitar.” &amp;mdash; &lt;a href="https://clig.dev/"&gt;Command Line Interface Guidelines&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-12-05&lt;/a&gt;: R now provides a simple &lt;a href="https://developer.r-project.org/blosxom.cgi/R-devel/NEWS/2020/12/04#n2020-12-04"&gt;native pipe syntax&lt;/a&gt; ‘|&amp;gt;’. That was quick! &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-12-05&lt;/a&gt;: &lt;a href="https://arxiv.org/abs/2012.02113"&gt;Entropy and Diversity: The Axiomatic Approach&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-12-05&lt;/a&gt;: &lt;a href="http://jacobzelko.com/workflow/"&gt;My Writing &amp;amp; Coding Workflow&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-12-06&lt;/a&gt;: &lt;a href="https://github.com/wbuchanan/eda"&gt;EDA (Exploratory Data Analysis)&lt;/a&gt;: Stata program that automates the generation of exploratory data analysis reports. &lt;code&gt;#stata&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-12-07&lt;/a&gt;: &lt;a href="https://community.coherentpdf.com/"&gt;Coherent PDF Command Line Tools Community Release&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-12-07&lt;/a&gt;: &lt;a href="https://tectonic-typesetting.github.io/en-US/"&gt;The Tectonic Typesetting System&lt;/a&gt;. &lt;code&gt;#tex&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-12-08&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/aventine/681187053" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Agnes Obel, &lt;em&gt;Aventine&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-12-08&lt;/a&gt;: &lt;a href="https://www.redblobgames.com/grids/hexagons/"&gt;Hexagonal Grids&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-12-11&lt;/a&gt;: I haven&amp;rsquo;t updated my Emacs config since July. Same for my dot files, which appear to be stabilized after several months of tricking zsh, vim, emacs &amp;amp; Co. Finally, I wrote no blog post the last two months. I must be busy with something else, I yet have to know with what.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-12-20&lt;/a&gt;: Back to reading some RSS feeds thanks to &lt;a href="https://newsboat.org/"&gt;newsboat&lt;/a&gt;. This is the third text-based app I use daily for processing incoming news: For mail, I settled on Neomutt, and for IRC that&amp;rsquo;s irssi.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-12-22&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The Macintosh was designed under a number of constraints, including: (1) It needed to sell to &amp;ldquo;naive users,&amp;rdquo; that is, users without any previous computer experience. (2) It was targeted at a narrow range of applications (mostly office work, though entertainment and multimedia applications have been added later in ways that sometimes break slightly with the standard interface). (3) It controlled relatively weak computational resources (originally a non-networked computer with 128KB RAM, a 400KB storage device, and a dot-matrix printer). (4) It was supported by highly impoverished communication channels between the user and the computer (initially a small black-and-white screen with poor audio output, no audio input, and no other sensors than the keyboard and a one-button mouse). (5) It was a standalone machine that at most was connected to a printer. &amp;mdash; &lt;a href="https://www.nngroup.com/articles/anti-mac-interface/"&gt;The Anti-Mac Interface&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-12-22&lt;/a&gt;: &lt;a href="https://www.cs.cornell.edu/courses/cs6120/2020fa/self-guided/"&gt;Advanced Compilers: The Self-Guided Online Course&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-12-22&lt;/a&gt;: &lt;a href="https://observablehq.com/@rreusser/half-precision-floating-point-visualized"&gt;Half-Precision Floating-Point, Visualized&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-12-22&lt;/a&gt;: &lt;a href="http://www.antonfagerberg.com/blog/my-perfect-irssi-setup/"&gt;My perfect Irssi setup&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-12-22&lt;/a&gt;: &lt;a href="https://33mail.com/"&gt;Unlimited free email address&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-12-23&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;So, I stopped using the Gmail web client. Google the data kraken, Google the spearhead of surveilance capitalism. I don’t want to live in front of the camera with algorithms watching my every move, using the data they gather about me to manipulate me into voting for this or for that, or to buy this or that. “And lead us not into temptation, but deliver us from evil.” And remember, “Don’t be evil” was a part of Google’s Code of Conduct from 2000 to 2018. They removed it. &amp;mdash; &lt;a href="https://alexschroeder.ch/wiki/2020-12-17_Rmail"&gt;Rmail&lt;/a&gt;As I now start Emacs from scratch, with a minimal &lt;code&gt;init.el&lt;/code&gt; file (just to load a monochrome theme, really), I come to appreciate the default settings, although I will need to tweak the base config a bit.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-12-23&lt;/a&gt;: &lt;a href="https://nedbatchelder.com//blog/202012/experimenting_with_git_storage.html"&gt;Experimenting with git storage&lt;/a&gt;. &lt;code&gt;#git&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-12-24&lt;/a&gt;: Trying out calcurse to manage my TODO and appointments.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-12-24&lt;/a&gt;: &lt;a href="https://psyteachr.github.io/ug3-stats/"&gt;Learning Statistical Models Through Simulation in R&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-12-29&lt;/a&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ git clone https://github.com/jhbadger/xlispstat.git
$ cd xlispstat
$ ./configure --prefix=/home/chl/.local
$ make &amp;amp;&amp;amp; make install
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Enjoy your 30 years old &lt;a href="https://aliquote.org/post/diving-into-lisp-for-statistical-computing/"&gt;statistical package&lt;/a&gt;!&lt;br&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-12-29&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I install very few things on either my personal or work computer. I don’t have terraform, aws, node, or pip installed, but I use them all the time. I have a Docker image for each, and I run them in containers with minimal privileges. I’m definitely not the only one, but it’s not as popular as it should be. None of these tools actually need full access to my computer to do their work, but that is normally how they’re run. &amp;mdash; &lt;a href="https://jonathan.bergknoff.com/journal/run-more-stuff-in-docker/"&gt;Run More Stuff in Docker&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-12-29&lt;/a&gt;: &lt;a href="https://beta.music.apple.com/"&gt;Apple Music&lt;/a&gt; everywhere! I would love streaming my playlists via &lt;a href="https://cmus.github.io/"&gt;cmus&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-12-29&lt;/a&gt;: &lt;a href="https://yurichev.com/news/20201220_git/"&gt;Some of git internals (updated)&lt;/a&gt;. &lt;code&gt;#git&lt;/code&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>One Week With Ubuntu</title><link>https://aliquote.org/post/one-week-with-ubuntu/</link><pubDate>Sun, 20 Dec 2020 12:22:15 +0100</pubDate><guid>https://aliquote.org/post/one-week-with-ubuntu/</guid><description>&lt;p&gt;It&amp;rsquo;s been one week now that I&amp;rsquo;m back on a Linux laptop. Overall, this was a pleasant experience, and I barely miss anything from my previous Macbook setup. The machine itself is comfortable, and I am happy to see that running a full-featured OS does not require much more than 1 Go, compared to the 3.5 Go already eaten up by macOS after a fresh reboot.&lt;/p&gt;
&lt;p&gt;Besides, I settled up on a few text-based applications that I like for my personal and work-related workflow, namely &lt;a href="https://neovim.io/"&gt;Neovim&lt;/a&gt;,&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; &lt;a href="https://neomutt.org/"&gt;Neomutt&lt;/a&gt;, &lt;a href="https://irssi.org/"&gt;irssi&lt;/a&gt;, &lt;a href="https://newsboat.org/"&gt;newsboat&lt;/a&gt;. They are running on top of a Zsh shell in &lt;a href="https://sw.kovidgoyal.net/kitty/"&gt;Kitty&lt;/a&gt;, using dark on light minimalistic theme, with additional goodies like &lt;code&gt;fzf&lt;/code&gt; or &lt;code&gt;ripgrep&lt;/code&gt;. I feel like this allows me to do almost anything I want without using the mouse, since the default Ubuntu window manager provides me with handy shortcuts to resize and move window all around the virtual desktops. In some sense, I believe I&amp;rsquo;m done with configuring those tools to suit my needs: I spend the last 7 months to make zsh, kitty, nvim, git, rg, fzf and irssi behave the way I like. Now I am happy with using a few key bindings to achieve what I want in either one of those TUIs, and that&amp;rsquo;s it!&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;After years on a constant tinkering diet, my configuration has reached a point where everything I need from it is covered. The key word in the previous statement is everything. What is this everything I use Emacs for? &amp;mdash; &lt;a href="https://www.manueluberti.eu/emacs/2020/09/08/end-of-era/"&gt;The end of an era?&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I feel the same, except that I&amp;rsquo;m not tied to Emacs anymore. As I said, I can use Neomutt or newsboat as a replacement for mu4e and elfeed. Org files are just plain text files that are easily manageable with any text editor (I even used to use TextEdit sometimes under macOS for that purpose), and I will write my own shell scripts to manage my BibTeX records. This should not be a big deal, and probably less overkill than installing Go and binaries all around to use &lt;a href="https://github.com/msprev/fzf-bibtex"&gt;bibtex-ls&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Of course, this doesn&amp;rsquo;t mean I won&amp;rsquo;t be using Emacs anymore. I just need to rewrite my own init file from scratch. I&amp;rsquo;m tired of frameworks and starter kits that mean nothing to me anymore.&lt;/p&gt;
&lt;p&gt;And, for the record, here&amp;rsquo;s the triumvirate for checking news on the internet.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2020-12-20-12-21-50.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2020-12-20-12-21-50.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2020-12-20-12-46-54.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2020-12-20-12-46-54.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2020-12-20-12-47-54.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2020-12-20-12-47-54.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;I should note that my config is almost entirely compatible with Vim 8.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Welcome Ubuntu</title><link>https://aliquote.org/post/welcome-ubuntu/</link><pubDate>Tue, 15 Dec 2020 15:45:06 +0100</pubDate><guid>https://aliquote.org/post/welcome-ubuntu/</guid><description>&lt;p&gt;As I said in my &lt;a href="https://aliquote.org/post/bye-bye-apple"&gt;previous post&lt;/a&gt;, I recently switched to Ubuntu as my primary OS, as well as a new laptop (Latitude 7310, i7 8 cores, 16 Go RAM, 1To HD). It&amp;rsquo;s a pretty sharp turn but was expected anyway.&lt;/p&gt;
&lt;p&gt;Apart from a minor issue with Intel Rapid Storage Technology (which should be disabled if I understand correctly), I had no problem installing Ubuntu 20.04 LTS, and the installation was completed in less than 30 minutes. Of course I deleted the whole Windows partition, since I don&amp;rsquo;t see what I could ever do with Windows. My last experience with Windows was before I started my PhD, and soon after I started using Linux.&lt;/p&gt;
&lt;p&gt;The laptop is pretty good: sturdy and uncluttered shell, wide and comfortable screen, and a nice keyboard (those coming from the latest Macbook series shall understand what I mean here). Moreover, everything worked right out of the box once the installation finished. This means that I can use the mousepad, the front camera, bluetooth, and so on. This was to be expected from this &lt;a href="https://certification.ubuntu.com/hardware/202003-27782"&gt;Dell laptop&lt;/a&gt; after all. I just have to get used to tne non-Mac keyboard.&lt;/p&gt;
&lt;p&gt;The most striking things is that I&amp;rsquo;m now using Neovim for almost everything related to text-editing, rather than Emacs. I even installed and configured Neomutt as a replacement for &lt;code&gt;mu4e&lt;/code&gt;. It&amp;rsquo;s been hard work, though, compared to Emacs + &lt;code&gt;mu4e&lt;/code&gt;. I keep using &lt;code&gt;mu&lt;/code&gt; even if I don&amp;rsquo;t really need it for Neomutt. I still installed Emacs, at least the version I found in the stable repositories (v 26.3). I gave up the idea of reinstalling the Doom framework. It works very well on my Mac after many customizations, but I haven&amp;rsquo;t updated the packages or the framework itself since last summer and I can imagine that many things are now broken. That&amp;rsquo;s what I like in (Neo)vim after all: with only a few packages and less than 100 LOC of custom settings I get a full-featured text editor. I&amp;rsquo;ll keep using Emacs, of course, bbecause of Org, Lisp/Scheme and ESS, but I will certainly have to build my own init file again.&lt;/p&gt;
&lt;p&gt;Beside, I didn&amp;rsquo;t install any fancy window manager, and I am pretty happy with the default Gnome environment for the moment. The Gnome terminal is quite good, but I still prefer &lt;a href="https://sw.kovidgoyal.net/kitty/"&gt;Kitty&lt;/a&gt;. All of my previous config files for Kitty, zsh, Neovim, irssi, htop, git, ncftp are working fine, pending minor updates regarding path settings and the like. I guess I should be happy that at least TUI settings are working well across OSs.&lt;/p&gt;</description></item><item><title>How I stopped worrying about the Mac</title><link>https://aliquote.org/post/bye-bye-apple/</link><pubDate>Mon, 14 Dec 2020 13:16:24 +0100</pubDate><guid>https://aliquote.org/post/bye-bye-apple/</guid><description>&lt;p&gt;Long time no see here. I have been pretty busy with remote work, a few passages of cold spell and new medicine last month, and an inordinate desire to consume excessive TV series and read novels all day long.&lt;/p&gt;
&lt;p&gt;I thought I would share a few news from my recent switch to a Linux workstation, and how I stopped worrying about the inexorable future of Mac laptops for home computing. I know this is macOS now, and soon or later probably a different flavour of iOS for all the glory of Apple products (watch, iPad, iPhone, Macbook, etc.). I remain sympathetic to the idea of having an ubiquitous OS, especially for scheduling budget and releases. However, I don&amp;rsquo;t feel like I would be part of the next game.&lt;/p&gt;
&lt;p&gt;I didn&amp;rsquo;t upgrade from Mojave, which I used to use for more than two years without encountering any issue. I usually upgrade to new release as soon as they are made public, but this time I didn&amp;rsquo;t. Toom much noise about Catalina, too much issues around the new OS. I use a Mac laptop as my primary machine since 2006, and I never considered looking back. Until recently. Using macOS for scientific computing, installing external packages with their dependencies &amp;mdash; and managing those dependencies,while trying to maintain the OS in a good state of health has become more and more painful, and less and less reliable over the years. Homebrew is nice, but it never solved the problem of reverse dependencies, or how to clean up the mess once you decide to uninstall a package. I ended up doing this manually, but it hurts.&lt;/p&gt;
&lt;p&gt;Last but not least, after sandboxing third-party apps, native apps themselves, then comes the shining idea of adding extra tax to freelance developers and gatekeeping almost all external apps. I realized earlier this year that I have stopped using native Mac apps month after month, to focus on TUI software and mostly a text-based workflow. I always did this way for managing my statistical projects, but then I don&amp;rsquo;t see how this could not work for other activities, including leisure ones. These days, I&amp;rsquo;m happy with a few tools that allow me to do 90% of my work in an efficient manner. Moreover, those tools are not tied to macOS, so I won&amp;rsquo;t loose much by using Ubuntu instead of macOS. (And I will probably install a BSD distro to replace Mojave when it will become clear that I could not afford the time to maintain such an old release of macOS anymore.)&lt;/p&gt;
&lt;p&gt;I still have all my music and photo habits on my Mac, so it&amp;rsquo;s not going to stop overnight, but at some point I&amp;rsquo;ll have to get my hands on my digital data again.&lt;/p&gt;</description></item><item><title>Micro posting in November</title><link>https://aliquote.org/post/micro-11-2020/</link><pubDate>Mon, 30 Nov 2020 20:21:59 +0100</pubDate><guid>https://aliquote.org/post/micro-11-2020/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-11-03&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;My distro-hopping days had come to an end. I just wanted a system that would let me code, write, and browse the Web. I chose the easy way. &amp;mdash; &lt;a href="https://www.manueluberti.eu//real-life/2020/10/24/emacs-severino/"&gt;Emacs and Emanuele Severino&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-11-03&lt;/a&gt;: &lt;a href="https://www.bell-labs.com/usr/dmr/www/odd.html"&gt;Odd Comments and Strange Doings in Unix&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-11-04&lt;/a&gt;: Genstat is really one of the only statistical package that I never tried. A few days ago, it came to my attention that there&amp;rsquo;s also the &lt;a href="https://www.vsni.co.uk/software/asreml-r"&gt;ASReml&lt;/a&gt; R package that I never used for mixed-effect models. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-11-04&lt;/a&gt;: I&amp;rsquo;m sick since 4 days now. Kinda like a flu, except that it&amp;rsquo;s not really a flu, but just because I have so many medication alongside, I&amp;rsquo;m just out of order all day long. So I&amp;rsquo;m left with music (since I can&amp;rsquo;t really read any book), and now it&amp;rsquo;s time for &lt;a href="https://www.youtube.com/watch?v=j1wgaFJ0750&amp;amp;feature=youtu.be&amp;amp;list=RDWxHQY_bYxHo"&gt;a lovely live&lt;/a&gt;.&lt;/p&gt;
&lt;iframe allow="autoplay *; encrypted-media *;" frameborder="0" height="250" style="width:100%;max-width:660px;overflow:hidden;background:transparent;" sandbox="allow-forms allow-popups allow-same-origin allow-scripts allow-storage-access-by-user-activation allow-top-navigation-by-user-activation" src="https://embed.music.apple.com/fr/album/aventine/681187053"&gt;&lt;/iframe&gt;&lt;br&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-11-04&lt;/a&gt;: Lovely digital minimalism, and light TUI themes.&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-11-04-12-25-46.png" alt="light"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-11-04&lt;/a&gt;: My preferred color scheme for Stata graphics remains &lt;code&gt;plotplain&lt;/code&gt;, although there are many &lt;a href="https://blog.stata.com/2018/10/02/scheming-your-way-to-your-favorite-graph-style/"&gt;nice alternatives&lt;/a&gt;. TIL about &lt;a href="https://github.com/mdroste/stata-scheme-modern"&gt;stata-scheme-modern&lt;/a&gt;. &lt;code&gt;#stata&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-11-04&lt;/a&gt;: Nice textbook for SPSS and R users: &lt;a href="https://bookdown.org/mwheymans/bookmi/"&gt;Applied Missing Data Analysis&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-11-04&lt;/a&gt;: &lt;a href="https://alexschroeder.ch/wiki/2020-10-27_Shrink_PDF"&gt;Shrink PDF&lt;/a&gt;. Postscript forever.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-11-04&lt;/a&gt;: &lt;a href="http://xyproblem.info/"&gt;The XY Problem&lt;/a&gt;. Together with &lt;a href="http://three.sentenc.es/"&gt;three.sentenc.es&lt;/a&gt;, I&amp;rsquo;m ready for most e-mail solicitations.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-11-04&lt;/a&gt;: &lt;a href="https://www.cs.utexas.edu/users/EWD/"&gt;The manuscripts of Edsger W. Dijkstra, 1930–2002&lt;/a&gt; (via &lt;a href="http://feedproxy.google.com/~r/TheEndeavour/~3/Pu0imHLO3Jw/"&gt;John D Cook&lt;/a&gt;).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-11-06&lt;/a&gt;: Another nice textbook on the &lt;a href="https://scidesign.github.io/designbook/"&gt;Design of Experiments and Observational Studies&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-11-06&lt;/a&gt;: Still a bit sick. That was the week it was.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-11-06&lt;/a&gt;: &lt;a href="https://github.com/mosceo/tetris"&gt;A full-fledged version of Tetris written in Racket&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-11-06&lt;/a&gt;: &lt;a href="https://eclecticlight.co/2020/09/16/boot-volume-layout/"&gt;Boot volume layout&lt;/a&gt;. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-11-06&lt;/a&gt;: &lt;a href="https://lwn.net/SubscriberLink/835962/a849d6bf14a1d8d9/"&gt;Deprecating scp&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-11-13&lt;/a&gt;: I&amp;rsquo;ve been sick for two weeks now: probably a rhinopharyngitis at the beginning, which evolved into sinusitis. It&amp;rsquo;s getting better now, hopefully I&amp;rsquo;ll be able to post stuff here and there. Nothing interesting on HN the past few days, I should probably go back to good old RSS feeds which I haven&amp;rsquo;t check in days.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-11-20&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;It&amp;rsquo;s easy to grow disillusioned with tech, even to the point that it appals you. I&amp;rsquo;ve been using computers since 1988 and the net since 1995 and over time, something&amp;rsquo;s happened. During the last decade or so, my mind has increasingly been preoccupied with the following thoughts: I&amp;rsquo;m no longer in control of my computer and my OS. The modern web is a cesspool of tracking scripts, ads, malware and clickbait designed to suck you in and make you stupid. &amp;mdash; &lt;a href="https://www.datagubbe.se/subversive/"&gt;Subversive Computing&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-11-20&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;For the real amazement, if you wish to be amazed, is this process. You start out as a single cell derived from the coupling of a sperm and an egg; this divides in two, then four, then eight, and so on, and at a certain stage there emerges a single cell which has as all its progeny the human brain. The mere existence of such a cell should be one of the great astonishments of the earth. People ought to be walking around all day, all through their waking hours calling to each other in endless wonderment, talking of nothing except that cell. &amp;mdash; &lt;a href="https://jsomers.net/i-should-have-loved-biology/"&gt;I should have loved biology&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-11-20&lt;/a&gt;: &lt;a href="https://stat.ethz.ch/~meier/teaching/anova/"&gt;ANOVA: A Short Intro Using R&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-11-20&lt;/a&gt;: &lt;a href="https://m-clark.github.io/mixed-models-with-R/"&gt;Mixed Models with R&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-11-20&lt;/a&gt;: &lt;a href="https://tutorial.math.lamar.edu/"&gt;Paul&amp;rsquo;s online math notes&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-11-24&lt;/a&gt;: What a beautiful &lt;a href="https://github.com/rougier/mu4e-dashboard"&gt;dashboard for mu4e&lt;/a&gt;! &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-11-24&lt;/a&gt;: Yet another online R textbook: &lt;a href="https://bcdudek.net/anova/index.html"&gt;One Way ANOVA with R&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-11-24&lt;/a&gt;: &lt;a href="https://www.fharrell.com/post/class-damage/"&gt;Damage Caused by Classification Accuracy and Other Discontinuous Improper Accuracy Scoring Rules&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-11-24&lt;/a&gt;: &lt;a href="https://bradleyboehmke.github.io/HOML/"&gt;Hands-On Machine Learning with R&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-11-26&lt;/a&gt;: &lt;a href="https://www.cdc.gov/csels/dsepd/ss1978/"&gt;Principles of Epidemiology in Public Health Practice&lt;/a&gt; (3rd ed.).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-11-26&lt;/a&gt;: &lt;a href="https://aakinshin.net/posts/p2-quantile-estimator/"&gt;P² quantile estimator: estimating the median without storing values&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-11-26&lt;/a&gt;: &lt;a href="https://www.tmwr.org/"&gt;Tidy Modeling with R&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-11-26&lt;/a&gt;: &lt;a href="https://www.nordier.com/"&gt;V7/x86&lt;/a&gt; is a port of the Seventh Edition of the UNIX operating system to the x86 (i386) based PC. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>The unquantified self #15</title><link>https://aliquote.org/post/unquantified-self-015/</link><pubDate>Thu, 29 Oct 2020 20:05:39 +0100</pubDate><guid>https://aliquote.org/post/unquantified-self-015/</guid><description>&lt;p&gt;Quiet month of activity on this blog. I&amp;rsquo;ve been pretty busy at work at the beginning of the month, and then daily life and medical exams took over. I am now waiting for the stabilization phase of my new treatment dosage, and I am trying to organize myself for the next month (quarantine again). I have several posts waiting in my draft folder taht I hope I will be able to complete next month, bur for the time being I don&amp;rsquo;t really have any energy left and I need to rest, or I believe so.&lt;/p&gt;
&lt;p&gt;I watched old movies that I already watched a few times before, like Taken or Citizen Four, and I finished the first two seasons of Fargo. With my son, we are watching The Leftovers and some older stuff (recently, Terminator). I read a bit of books, did some cooking, and things like that. No special thing. I have to get used to fall again.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/62496939271__D4B40F43-90CE-49D7-A247-A9934FF6BD49.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/62496939271__D4B40F43-90CE-49D7-A247-A9934FF6BD49.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1274.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1274.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1285.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1285.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;And for the big surprise of the month: I started interacting again on Cross Validated. As I&amp;rsquo;m no longer a moderator on the site, I&amp;rsquo;m back to where I started. My return was well received by some of the regular users I&amp;rsquo;ve interacted with in the past, for the rest I don&amp;rsquo;t think anyone noticed anything. I&amp;rsquo;ve been following &amp;ldquo;the stories&amp;rdquo; from a distance and I don&amp;rsquo;t want to talk about them. What I take from these last 3 weeks on the site is that the atmosphere has evolved: before I could read the main part of the questions and answers, now it&amp;rsquo;s a flow that&amp;rsquo;s almost impossible to follow, and I&amp;rsquo;ve never seen the list of posts to close so long. Above all, I miss the interactions with former users, which makes it a much more impersonal site. I don&amp;rsquo;t know if it&amp;rsquo;s good or not, and I don&amp;rsquo;t know if my frequency of visits will remain as high in the future.&lt;/p&gt;
&lt;p&gt;My commit logs for my dot files has started to freeze, which is good. I was tired to update every minor thing in my Zsh, Vim or Emacs config. Now that I&amp;rsquo;m happy with my current setup, I hope I will be able to come back at more interesting stuff, like my Racket stats library. I came to think that implementing the ±40 commands of Stata 1.0 would be a good start, I mean like some sort of retro-computing using a modern language.&lt;/p&gt;</description></item><item><title>Micro posting in October</title><link>https://aliquote.org/post/micro-10-2020/</link><pubDate>Tue, 27 Oct 2020 09:42:26 +0100</pubDate><guid>https://aliquote.org/post/micro-10-2020/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-10-01&lt;/a&gt;: A &lt;a href="https://github.com/mgerdes/minigolf"&gt;minigolf&lt;/a&gt; game written without a game engine in C.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-01&lt;/a&gt;: Ah, it looks there&amp;rsquo;s a new thing for editing text on the Mac: &lt;a href="https://nova.app/"&gt;Nova&lt;/a&gt;. The choice of names for Mac text editors never ceases to amaze me. The last one I heard about from Jan de Leeuw was &lt;a href="https://fraise.en.softonic.com/mac"&gt;Fraise&lt;/a&gt;, but there were many others at that time (around 2008-2010) and I forgot all about their names.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-01&lt;/a&gt;: CleanMyMac is really a great tool when it comes to manage your Macbook!&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-09-29-21-46-51.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-01&lt;/a&gt;: I swear by &lt;a href="https://github.com/torognes/vsearch"&gt;vsearch&lt;/a&gt; since a week. It&amp;rsquo;s so fast and handy for all sort of things involving Fast[aq] files.&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-09-22-13-31-33.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-01&lt;/a&gt;: I&amp;rsquo;m halfway thru Season 2 of &lt;a href="https://en.wikipedia.org/wiki/Fargo_(TV_series)"&gt;Fargo&lt;/a&gt;. Like &lt;a href="https://en.wikipedia.org/wiki/True_Detective"&gt;True Detective&lt;/a&gt;, each season is independent from the preceding one. I didn&amp;rsquo;t like True Detective S2 (probably because I very much liked S1) so I quit after the first episode. Likewise, I find Fargo S2 far less intriguing than S1. I will probably stop after that one.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-01&lt;/a&gt;: &lt;a href="https://joshrollinswrites.com/help-desk-head-desk/2020-07-16/"&gt;Back to basics: org-mode agenda&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-01&lt;/a&gt;: &lt;a href="https://exhibits.stanford.edu/dataviz/"&gt;Data Visualization and the Modern Imagination&lt;/a&gt;. &lt;code&gt;#dataviz&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-01&lt;/a&gt;: &lt;a href="https://notstatschat.rbind.io/2020/09/24/moar-survey-regression-models/"&gt;MOAR survey regression models&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-01&lt;/a&gt;: &lt;a href="https://floating-point-gui.de"&gt;What Every Programmer Should Know About Floating-Point Arithmetic&lt;/a&gt;.~ ❯ nodeWelcome to Node.js v14.11.0.Type &amp;ldquo;.help&amp;rdquo; for more information.&amp;gt; 0.1 + 0.20.30000000000000004&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-02&lt;/a&gt;: &lt;a href="https://github.com/kunalb/panopticon"&gt;Panopticon&lt;/a&gt; is a debugger-powered tracer for Python code to quickly visualize and explore code execution. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-03&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;At least 24 annoyances per day I have to live with. That’s the world WE ALL are living in now. Welcome. &amp;mdash; &lt;a href="https://tonsky.me/blog/tech-sucks/"&gt;People expect technology to suck because it actually sucks&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-10-03&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Unzip and run it in-place anywhere. It’s also entirely offline. It will never automatically update, or even touch the network. In mere seconds any Windows system can become a reliable development machine. &amp;mdash; [w64devkit: (Almost) Everything You Need](&lt;a href="https://nullprogram.com/blog/"&gt;https://nullprogram.com/blog/&lt;/a&gt;
2020/09/25/)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;When dreams come true. Replace Windows by anything like macOS, Linux, *BSD, of course.&lt;br&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-10-03&lt;/a&gt;: It&amp;rsquo;s been more than a month now than the interactions I have with my Macbook can be summarized to using Emacs (or Neovim) and Zsh in a Terminal (with 24 bit color enabled) and, optionally (more often than I would like), Firefox or Skim to read PDFs. It&amp;rsquo;s been relaxing, at least. Digital minimalism, plain text mode; I like it.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-03&lt;/a&gt;: Okay, so I uninstalled Textual app. Circe (Emacs) and irssi should be enough to chat on Freenode in the future. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-03&lt;/a&gt;: There we go. Apple requiring macOS 10.15 to upgrade some apps. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-10-03-17-25-32.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-03&lt;/a&gt;: Trying out &lt;a href="https://irssi.org/"&gt;irssi&lt;/a&gt;. So far I like it better than &lt;a href="https://weechat.org/"&gt;weechat&lt;/a&gt;, because simplicity.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-03&lt;/a&gt;: &lt;a href="https://inconvergent.net/2020/future-alterations/"&gt;Future Alterations&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-05&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;These are what engineers of my generation call “eyewash:” Something of no utility meant to impress the outsiders. &amp;mdash; &lt;a href="https://irreal.org/blog/?p=9185"&gt;Red Meat Friday: Modernizing Emacs&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-10-05&lt;/a&gt;: Another great post by Peter Ellis, with outstanding data viz: &lt;a href="http://freerangestats.info/blog/2020/09/26/nzes-issues"&gt;Free text in surveys&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-05&lt;/a&gt;: &lt;a href="https://eli.thegreenplace.net/2020/github-actions-first-impressions/"&gt;GitHub Actions: first impressions&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-05&lt;/a&gt;: &lt;a href="https://jpmens.net/2020/09/27/it-used-to-be-simpler/"&gt;It used to be simpler to teach&lt;/a&gt;. &lt;code&gt;#unix&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-05&lt;/a&gt;: &lt;a href="https://jcs.org/2020/10/01/system_6_c"&gt;Video: C Programming on System 6 - Intro&lt;/a&gt;. Nice setup, and I learned a lot of interesting stuff about Apple System 6.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-05&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;blockquote class="twitter-tweet"&gt;&lt;p lang="en" dir="ltr"&gt;Your grep one-liner du jour. Count how many words of each length appear in the /usr/share/dict/words dictionary.&lt;br&gt;&lt;br&gt;for n in `jot 25`; do printf &amp;quot;%2d letter words: &amp;quot; &lt;a href="https://twitter.com/search?q=%24n&amp;amp;src=ctag&amp;amp;ref_src=twsrc%5Etfw"&gt;$n&lt;/a&gt;; grep -E &amp;quot;^.{$n}\$&amp;quot; /usr/share/dict/words | wc -l; done&lt;/p&gt;&amp;mdash; Steve Hayman 💉💉💉💉💉 (@shayman) &lt;a href="https://twitter.com/shayman/status/1310975875819679745?ref_src=twsrc%5Etfw"&gt;September 29, 2020&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async src="https://platform.twitter.com/widgets.js" charset="utf-8"&gt;&lt;/script&gt;
&lt;br&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-10-08&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;But if you’re one of those people who loves nothing more than to quote how bad Apple is because of their walled garden, please do some fact checking as, to me at least, it doesn’t exist. &amp;mdash; &lt;a href="https://kevq.uk/the-apple-walled-garden/"&gt;The Apple Walled Garden&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-10-08&lt;/a&gt;: So long, Apple.&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-10-08-10-35-15.png" alt=""&gt;&lt;small&gt;No worry, I&amp;rsquo;m still happy with my Macbook, this is just that I don&amp;rsquo;t need these apps anymore. The online versions on iCloud seem decent, and may come out for rescue in case I need to edit old stuff.&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-08&lt;/a&gt;: &lt;a href="https://www.spinellis.gr/blog/20200929/"&gt;Error handling under Unix and Windows&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-08&lt;/a&gt;: &lt;a href="https://danielmiessler.com/study/vim/"&gt;Learn Vim for the last time&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-08&lt;/a&gt;: &lt;a href="https://markkarpov.com/post/lisp-and-haskell.html"&gt;Lisp and Haskell&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-08&lt;/a&gt;: &lt;a href="https://meyerweb.com/eric/thoughts/2020/09/29/polite-bash-commands/"&gt;Polite Bash Commands&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-08&lt;/a&gt;: &lt;a href="http://danmidwood.com/content/2014/11/21/animated-paredit.html"&gt;The Animated Guide to Paredit&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-09&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Fortran has ruled scientific computing, but Julia emerged for large-scale numerical work. &amp;mdash; &lt;a href="https://arstechnica.com/science/2020/10/the-unreasonable-effectiveness-of-the-julia-programming-language/"&gt;The unreasonable effectiveness of the Julia programming language&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-10-09&lt;/a&gt;: Python LSP under Emacs: up to 700 Mo (three files opened, less than 20 files in the project). WTF? Switching back to Anaconda: 2 process, 20-30 Mo each. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-09&lt;/a&gt;: &lt;a href="https://betweentwoparens.com/what-are-the-clojure-tools"&gt;What are the Clojure Tools?&lt;/a&gt; &lt;code&gt;#clojure&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-11&lt;/a&gt;: OMG. One of the last goodies of the new version of &lt;a href="https://sw.kovidgoyal.net/kitty/"&gt;kitty&lt;/a&gt; (0.19).&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-10-11-19-04-18.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-12&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The new platform is a winner. Everything is clean, quick, and configurable. When I ps uaxww, I’m not hogging ‘gigs’ of RAM just to have things up and running. There’s no black magic that derails me at every turn. In short, my sanity has been long restored. &amp;mdash; &lt;a href="http://blog.cretaria.com/posts/bye-bye-apple.html"&gt;Bye-bye, Apple&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-10-12&lt;/a&gt;: I started updating my &lt;a href="https://aliquote.org/articles/stata-sk/"&gt;stata-sk&lt;/a&gt; notes and I&amp;rsquo;m now using jupyter instead of ESS to process Stata code (because I couldn&amp;rsquo;t compile the project with my old setup). Looks great so far. I will write a full blog post once I get some time.&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-10-11-09-05-06.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-12&lt;/a&gt;: Now I get this annoying message regarding battery status on my Macbook (only 331 cycles out of the 1000 expected for this model).&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-10-11-21-22-13.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-12&lt;/a&gt;: The &amp;ldquo;Widescreen Tall&amp;rdquo; layout in &lt;a href="https://ianyh.com/amethyst/"&gt;Amethyst&lt;/a&gt; is that it works pretty well for everything related to plotting!
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2020-10-06-21-34-58.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2020-10-06-21-34-58.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2020-10-12-19-37-38.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2020-10-12-19-37-38.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-13&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Before I get into the strategy, I want to congratulate the Notes team for making what may be the only Apple app that has been unambiguously improving over the past few years. While it still shows evidence of the limited and ugly app it started out as, Notes is now one of the best note-taking apps on iOS, with features that nicely balance simplicity and power. &amp;mdash; &lt;a href="https://leancrew.com/all-this/2020/10/what-is-notes-good-for/"&gt;What is Notes good for?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-10-13&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In March I bought a 16&amp;quot; MacBook Pro, reasonably well tricked out: 2.3GHz 8-core Intel i9, 32G RAM, Radeon 5500M with 8G, 4T of disk. I hate it. It is slow and buggy enough that I wonder if maybe it’s a lemon? Herewith the gripes, for no particular reason other than it makes me feel like shouting at the world. &amp;mdash; &lt;a href="https://www.tbray.org/ongoing/When/202x/2020/10/02/I-Hate-My-MacBook"&gt;I Hate My MacBook&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-10-13&lt;/a&gt;: &lt;a href="https://200ok.ch/posts/2020-09-29_comprehensive_guide_on_handling_long_lines_in_emacs.html"&gt;Comprehensive guide on handling long lines in Emacs&lt;/a&gt; (via &lt;a href="https://irreal.org/blog/?p=9183"&gt;Irreal&lt;/a&gt;). &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-14&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In many ways memory capacity is more important than clock frequency: a program won’t run unless enough memory is available but people can wait for a slow cpu. &amp;mdash; &lt;a href="http://shape-of-code.coding-guidelines.com/2020/10/04/memory-capacity-growth-a-major-contributor-to-the-success-of-computers/"&gt;Memory capacity growth: a major contributor to the success of computers&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-10-14&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Since I became an Apple user back in 1989, I’ve always felt there was more to it than just being a returning customer of a tech company. There was a sense of belonging to a common set of principles that went against the mainstream. That was extremely appealing for someone like me who always moved countercurrent to everything. There were the Mac user groups, places (whether physical or online) to share a passion with like-minded people. There was the idea of ‘thinking differently’ way before it was formalised in 1997 by Apple itself. Apple products weren’t just computers and peripherals, but specialised tools made for people with a creative, think-out-of-the-box mindset. &amp;mdash; &lt;a href="http://morrick.me/archives/9077"&gt;This nine-year chasm&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-10-14&lt;/a&gt;: &lt;a href="http://xenodium.com/improved-ctrl-p-ctrl-n-macos-movement"&gt;Improved Ctrl-p/Ctrl-n macOS movement&lt;/a&gt;. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-14&lt;/a&gt;: &lt;a href="https://github.com/racket-templates"&gt;Racket Templates&lt;/a&gt;: Unofficial collection of racket app templates. &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-15&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;E-mail takes too long to respond to, resulting in continuous inbox overflow for those who receive a lot of it. &amp;mdash; &lt;a href="http://three.sentenc.es/"&gt;three.sentenc.es&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-10-15&lt;/a&gt;: The &lt;a href="https://softwarefoundations.cis.upenn.edu/"&gt;Software Foundations&lt;/a&gt; series is a broad introduction to the mathematical underpinnings of reliable software.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-15&lt;/a&gt;: &lt;a href="https://gist.github.com/jph00/d5981f649a83a754946964cf22322cb2"&gt;All of the python 3.9 standard library&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-15&lt;/a&gt;: &lt;a href="https://explained.ai/gradient-boosting/"&gt;How to explain gradient boosting&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-15&lt;/a&gt;: &lt;a href="https://juliamono.netlify.app/"&gt;JuliaMono&lt;/a&gt;: a monospaced font for scientific and technical computing.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-15&lt;/a&gt;: &lt;a href="https://liuliu.me/eyes/loading-csv-file-at-the-speed-limit-of-the-nvme-storage/"&gt;Loading CSV File at the Speed Limit of the NVMe Storage&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-15&lt;/a&gt;: &lt;a href="https://www.pcg-random.org/index.html"&gt;PCG, A Family of Better Random Number Generators&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-20&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;As a rule, new users, right after introduction to a few basic commands, start indulging in Vim configuration porn. Such porn has various different flavours. There is the “exhibitionist” variety which includes dressing Vim up in status lines, colorschemes, and font decorations in order to impress others. It often leads to Vim being displayed on videos and, nomen omen, “vim-porn” screenshots. There is an “integrated” category where people plug and stretch their Vim until it resembles an IDE. Git integration, autocompletion, language servers, refactoring, and debugging are the tools of trade in this version. And then there are a few more variants, including “fuzzy”, “packaged”, “conveniently re-mapped”, and I am sure anyone could think up some of their own. &amp;mdash; &lt;a href="http://karolis.koncevicius.lt/posts/porn_zen_and_vimrc/"&gt;Porn, Zen, and .vimrc&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-10-20&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The analogy in my mind is that Stata is to the iPhone as R is to Android, as far as social science data analysis goes. I guess SAS would be BlackBerry, insofar as it’s dated and propped up by a strong lock-in among government employees. And SPSS is a Nokia phone that has a slick interface for dialing your friends but requires you to push dozens of extra buttons in a non-intuitive sequence if you want to call anyone new. &amp;mdash; &lt;a href="https://scatter.wordpress.com/2011/06/28/stata-12/"&gt;stata 12!&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-10-20&lt;/a&gt;: &lt;a href="https://irreal.org/blog/?p=9220"&gt;Emacs Shells&lt;/a&gt; on Irreal. After many attempts at using Eshell, I gave up and I&amp;rsquo;m a happy user of vterm since last year. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-20&lt;/a&gt;: &lt;a href="https://www.freepn.org/"&gt;FreePN&lt;/a&gt; is the first open-source peer-to-peer VPN service.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-20&lt;/a&gt;: &lt;a href="https://t3x.org/lfn/index.html"&gt;Lisp from nothing&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-20&lt;/a&gt;: &lt;a href="https://corte.si/posts/visualisation/binvis/index.html"&gt;Visualizing binaries with space-filling curves&lt;/a&gt;. I may have posted this on Twitter long ago, but it&amp;rsquo;s never to late to revisit this post.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-20&lt;/a&gt;: &lt;a href="https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem"&gt;What is the XY problem?&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-27&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Every lisp hacker I ever met, myself included, thought that all those brackets in Lisp were off-putting and weird. At first, of course. Soon after we all came to the same epiphany: lisp’s power lies in those brackets! In this essay, we’ll go on a journey to that epiphany. &amp;mdash; &lt;a href="https://stopa.io/post/265"&gt;An Intuition for Lisp Syntax&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-10-27&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Multiplicity comes from the chances (over study repetitions and data looks) you give data to be more extreme (if the null hypothesis holds), not from the chances you give an effect to be real. It is only the latter that is of concern to a Bayesian. Bayesians entertain only one dataset at a time, and if one computes posterior probabilities of efficacy multiple times, it is only the last value calculated that matters. &amp;mdash; &lt;a href="https://www.fharrell.com/post/bayes-seq/"&gt;Continuous Learning from Data: No Multiplicities from Computing and Using Bayesian Posterior Probabilities as Often as Desired&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-10-27&lt;/a&gt;: Nice online textbook on the &lt;a href="https://online.stat.psu.edu/stat503/book/"&gt;Design of Experiments&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-10-27&lt;/a&gt;: &lt;a href="https://rgoswami.me/posts/rep-zoom-obs/"&gt;Replacing Zoom with Open Broadcaster Software&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;</description></item><item><title>Back to Table one</title><link>https://aliquote.org/post/table-one-in-r/</link><pubDate>Fri, 02 Oct 2020 20:34:21 +0200</pubDate><guid>https://aliquote.org/post/table-one-in-r/</guid><description>&lt;p&gt;In the past I reviewed several packages useful for making summary or regression tables in R.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; Recently, I stumbled upon the following blog post: &lt;a href="https://dabblingwithdata.wordpress.com/2018/01/02/my-favourite-r-package-for-summarising-data/"&gt;My favourite R package for: summarising data&lt;/a&gt;, which nicely summarizes some of the oldest packages that I mentioned, and more recent ones. Despite being a huge fan of &lt;code&gt;Hmisc&lt;/code&gt;, I find myself using &lt;a href="https://ropensci.org/blog/2017/07/11/skimr/"&gt;skimr&lt;/a&gt; more regularly these days. I even added it to my &lt;code&gt;.Rprofile&lt;/code&gt; file:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.loader &amp;lt;- &lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;p&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; suppressWarnings&lt;span class="o"&gt;(&lt;/span&gt;suppressPackageStartupMessages&lt;span class="o"&gt;(&lt;/span&gt;library&lt;span class="o"&gt;(&lt;/span&gt;p, character.only &lt;span class="o"&gt;=&lt;/span&gt; TRUE&lt;span class="o"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.pkg &amp;lt;- c&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;ggplot2&amp;#34;&lt;/span&gt;, &lt;span class="s2"&gt;&amp;#34;skimr&amp;#34;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;interactive&lt;span class="o"&gt;())&lt;/span&gt; invisible&lt;span class="o"&gt;(&lt;/span&gt;sapply&lt;span class="o"&gt;(&lt;/span&gt;.pkg, .loader&lt;span class="o"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That being said, the object of this post is just to talk about the famous &amp;ldquo;Table 1&amp;rdquo; of epidemiology or medicine articles, which usually stands for a summary table of subjects or patients&amp;rsquo; characteristics, stratified by clinical status, exposure, time points or whatever. I have always used &lt;code&gt;Hmisc::summary.formula&lt;/code&gt; with the &lt;code&gt;&amp;quot;reverse&amp;quot;&lt;/code&gt; option for that matter. Few days ago I needed to build some supplementary tables for a paper under review (yeah, it still happens to me!), and I wanted to try a quick one-liner. I heard about something like a &amp;ldquo;table 1&amp;rdquo; package last year, or maybe this was two years ago. After a quick search and some tests, I can confirm that &lt;a href="https://cran.r-project.org/web/packages/tableone/index.html"&gt;tableone&lt;/a&gt; works great, while &lt;a href="https://cran.r-project.org/web/packages/table1/index.html"&gt;table1&lt;/a&gt; isn&amp;rsquo;t that different from the Hmisc version (except that it is limited to the &amp;ldquo;reverse&amp;rdquo; option, of course).&lt;/p&gt;
&lt;p&gt;There are some weird choices in the design of the &lt;code&gt;tableone&lt;/code&gt; package, like for example the fact that we need to indicate which numeric variables should be treated as categorical ones (e.g., binary variables encoded as integers) in &lt;code&gt;factorVars =&lt;/code&gt; although they must be listed with all other variables in &lt;code&gt;vars =&lt;/code&gt;. However it does the job pretty well, and it correctly identify binary variables such that only one line is printed for the % (n) values. In most cases it is enough, but I like the option in Hmisc to print both values (i.e., when the variable value equals 0 or 1) because in some settings it matters a lot. Above all that, the fact that the table is stored in a simple matrix structure makes it relatively easy to export it right into a CSV file, and then into Excel for hand edit. Yeah, I told you it still happens to me.&lt;/p&gt;
&lt;p&gt;Overall, I would say that no package will ever beats &lt;code&gt;Hmisc&lt;/code&gt;, but for those interested in quick fix, &lt;code&gt;tableone&lt;/code&gt; is probably a good option.&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;I&amp;rsquo;m pretty sure I wrote a blog post about this stuff, but I cannot find it at the time of this writing.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Statistical software evaluation</title><link>https://aliquote.org/post/statistical-software-evaluation/</link><pubDate>Thu, 01 Oct 2020 20:52:29 +0200</pubDate><guid>https://aliquote.org/post/statistical-software-evaluation/</guid><description>&lt;p&gt;Long ago there were some folks who were complaining that R was not &amp;ldquo;certified&amp;rdquo;, as SAS was, for example, in the pharmaceutical industry. There&amp;rsquo;s however some detailed notes about R&amp;rsquo;s &lt;a href="https://www.r-project.org/certification.html"&gt;testing and quality control&lt;/a&gt;. No one talked about Stata, if I remember correctly, but in any case the &lt;a href="https://www.stata-journal.com/article.html?article=pr0001"&gt;certification&lt;/a&gt; is fully documented, including among other things &lt;a href="https://www.stata.com/support/cert/nist/"&gt;detailed results&lt;/a&gt; obtained against the NIST StRD—Standard Reference Data. But what does certification really mean? There are at least two critical points one has to address before releasing a statistical package: the algorithms should be sound and efficient (no one would accept that a statistical procedure deliver an ANOVA table by computing sum of squares as we would do by hand), and numerical accuracy should be ensured.&lt;/p&gt;
&lt;p&gt;Let us focus on the second point, by assuming that we are not talking about things like MS Excel which was using a single-pass formula for computing the SD of a series of values, for instance. I didn&amp;rsquo;t bother to check if this is still the case. Numerical accuracy is addressed in several papers, and it can be verified using online benchmarks (like the aforementioned NIST reference dataset). Moreover, &lt;em&gt;Numerical Issues in Statistical Computing for the Social Scientist&lt;/em&gt;, by Altman, Gill and McDonald (Wiley, 2004) provides an excellent overview of the numerical accuracy and the quality of statistical routines for standard estimation tasks.&lt;/p&gt;
&lt;p&gt;Sources of inaccuracy in statistical computation usually follows from bugs, computer arithmetic, randomized algorithms, approximation and heuristic algorithms, local search algorithms. About &lt;a href="https://floating-point-gui.de"&gt;computer arithmetic&lt;/a&gt;, specifically:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;There&amp;rsquo;s a credibility gap: We don&amp;rsquo;t know how much of the computer&amp;rsquo;s answers to believe. Novice computer users solve this problem by implicitly trusting in the computer as an infallible authority; they tend to believe that all digits of a printed answer are significant. Disillusioned computer users have just the opposite approach; they are constantly afraid that their answers are almost meaningless. &amp;mdash; Don Knuth&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So, what is the take away message from computer arithmetic:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Rounding errors occur in binary computer arithmetic that are not obvious when one considers only ordinary decimal arithmetic.&lt;/li&gt;
&lt;li&gt;Round-off error tends to accumulate when adding large and small numbers &amp;mdash; small numbers tend to &amp;ldquo;drop off the end&amp;rdquo; of the addition operator&amp;rsquo;s precision, and what accumulates in the leftmost decimal positions is inaccurate.&lt;/li&gt;
&lt;li&gt;Subtracting a similar quantity from the result can then &amp;ldquo;cancel&amp;rdquo; the relatively accurate numbers in the rightmost decimal places, leaving only the least accurate portions.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;As an illustration, check the value of &lt;code&gt;i = 1000000000 + 2 - 0.1 - 1000000000&lt;/code&gt; in your preferred software. Here is what we get in Node:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;~ ❯ node
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Welcome to Node.js v14.11.0.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Type &lt;span class="s2"&gt;&amp;#34;.help&amp;#34;&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; more information.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;gt; &lt;span class="m"&gt;1000000000&lt;/span&gt; + &lt;span class="m"&gt;2&lt;/span&gt; - 0.1 - &lt;span class="m"&gt;1000000000&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;1.899999976158142
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;^D
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The same results is obtained using Julia (1.5.1), Python (3.8.5), while R (4.0.2), Stata (14.2) or Mathematica (11.0.1) prints 1.9, which is mathematically the correct result. R produces some idiosyncratic results sometimes (check out some of John Myles White&amp;rsquo;s examples on Twitter, for example&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;), but it does not suffer from canceling errors, nor does Stata in this particular case.&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Unfortunately, I&amp;rsquo;ve lost track of most of it. You know what it means &amp;ldquo;searching&amp;rdquo; on Twitter, right? Anyway, I just found &lt;a href="https://twitter.com/johnmyleswhite/status/1264863830934421504?s=20"&gt;this gem&lt;/a&gt;, which has nothing to do with computer arithmetic per se: &lt;code&gt;x &amp;lt;- 1152921504606846976; r &amp;lt;- x:(x+100; length(r)&lt;/code&gt; equals 1, while &lt;code&gt;r &amp;lt;- x:(x+200); length(r)&lt;/code&gt; returns 257.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in September</title><link>https://aliquote.org/post/micro-09-2020/</link><pubDate>Mon, 28 Sep 2020 09:55:07 +0200</pubDate><guid>https://aliquote.org/post/micro-09-2020/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-09-01&lt;/a&gt;: &lt;a href="http://cslibrary.stanford.edu/109/TreeListRecursion.html"&gt;The Great Tree-List Recursion Problem&lt;/a&gt;. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-02&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;An increasing number of command-line software programs output text with ANSI color escape codes by default. While some developers and users obviously prefer seeing these colors, many users don’t. Unfortunately, every new piece of software seems to have a different way of disabling colored text output and some software has no way at all. &amp;mdash; &lt;a href="https://no-color.org/"&gt;NO_COLOR&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-09-02&lt;/a&gt;: Just playing with &lt;a href="https://ianyh.com/amethyst/"&gt;Amethyst&lt;/a&gt; again. It looks like there&amp;rsquo;s been some improvements since the &lt;a href="https://aliquote.org/post/moom-app/"&gt;last time&lt;/a&gt; I tested it.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-02&lt;/a&gt;: &lt;a href="https://cmus.github.io/"&gt;cmus&lt;/a&gt; is a small, fast and powerful console music player for Unix-like operating systems.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-03&lt;/a&gt;: Having so much fun with Kitty and Amethyst! (But see my &lt;a href="https://aliquote.org/post/amethyst-app/"&gt;recent post&lt;/a&gt;.)&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-09-03-16-51-54.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-03&lt;/a&gt;: &lt;a href="https://www.livinginternet.com/i/iw_unix_war.htm"&gt;Unix Wars&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-04&lt;/a&gt;: &lt;a href="https://render.com/"&gt;Render&lt;/a&gt; is a unified platform to build and run all your apps and websites with free SSL, a global CDN, private networks and auto deploys from Git.Get started. It looks like a nice and free alternative to Webfaction.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-05&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In reply to this criticism one is normally reminded that Unix was invented for a PDP7, which had about as much memory as an earthworm and CPU power to match. That is, the user interface was designed to minimize the time required to decode a command. That meant short, fixed-case, commands, and no minimum matching. But 1969 is a long time ago, and both memory and speed have improved a thousandfold since then. &amp;mdash; &lt;a href="https://user.eng.umd.edu/~blj/funny/requium.html"&gt;A Requiem for a Dying Operating System&lt;/a&gt;Still, I like short command names like &lt;code&gt;rm&lt;/code&gt; or &lt;code&gt;ls&lt;/code&gt;.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-09-05&lt;/a&gt;: On the various C standard drafts: &lt;a href="https://news.ycombinator.com/item?id=24361469"&gt;https://news.ycombinator.com/item?id=24361469&lt;/a&gt;. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-05&lt;/a&gt;: &lt;a href="https://wozniak.ca/blog/2018/06/25/1/index.html"&gt;Massacring C Pointers&lt;/a&gt;. You may also like Geoff Wozniak&amp;rsquo;s Gopher-like &lt;a href="https://wozniak.ca/tblog/"&gt;blog&lt;/a&gt;. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-05&lt;/a&gt;: &lt;a href="http://whattheemacsd.com/"&gt;What&amp;rsquo;s the emacs.d?&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-06&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/2020-09-06-09-36-03.png" alt="desktop"&gt;&lt;small&gt;Mood of the day.&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-06&lt;/a&gt;: How funny that Apple&amp;rsquo;s (now hidden for such a long time) &lt;code&gt;~/Library&lt;/code&gt; folder keep archiving old attachments from the Messages app. It&amp;rsquo;s actually 2.5 Go large while I systematically delete most of the attached media once they&amp;rsquo;re saved on my HD! I know it&amp;rsquo;s good practice to keep a shallow copy of everything for the casual user &amp;mdash; in case things get deleted by mistake, you know, but while isn&amp;rsquo;t there an option to delete old stuff like this in macOS preferences? &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-06&lt;/a&gt;: &lt;a href="https://bernsteinbear.com/blog/compiling-a-lisp-4/"&gt;Compiling a Lisp: Primitive unary functions&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-06&lt;/a&gt;: &lt;a href="https://skn.noip.me/pdp11/pdp11.html"&gt;PDP 11/70 Emulator&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-06&lt;/a&gt;: &lt;a href="https://borodust.org/projects/trivial-gamekit/"&gt;trivial-gamekit&lt;/a&gt;: This framework is intended for users who wish to start with game development in Common Lisp as soon as possible without much configuration hassle. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-07&lt;/a&gt;: I&amp;rsquo;ve been using Element on Firefox for two or three weeks now. No need to launch textual or Circe in Emacs: I get the best of both worlds (Matrix and IRC), with Desktop notifications and the history!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-07&lt;/a&gt;: Two new TV series started this month: The Leftovers (with my son), and Fargo (when I&amp;rsquo;m alone). Still on Apple TV.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-07&lt;/a&gt;: &lt;a href="https://phaazon.net/blog/editors-in-2020"&gt;My thoughts about editors in 2020&lt;/a&gt;. That&amp;rsquo;s an interesting take on text editors in the 21st century. I remain a strong Emacs believer, although I tried and loved (Evil) modal editing. Work in progress.&amp;gt; However, the Vi philosophy is probably too obscure for me at the moment. It has been going on for at least 10 years so I have little hope that it will ever change. While I like some ideas we found in modal editing, I cannot embrace them all. &lt;a href="https://aliquote.org/post/emacs-15-years-later/"&gt;Emacs, 15 years later&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-08&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;(&amp;hellip;) what I am trying to recover most is differentiated time. Some days should be different than others. I’ll replace Twitter with something else for a little while, and hopefully that’ll seem different. &amp;mdash; &lt;a href="https://macwright.com/2020/09/01/recently.html"&gt;Recently&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-09-08&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Take defensive measures. To future-proof your content, rather than reference the general web, its far more reliable to link to an archive. &amp;mdash; &lt;a href="https://hawaiigentech.com/post/commentary/why-i-link-to-waybackmachine-instead/"&gt;Why I Link to WayBackMachine Instead of Original Site&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-09-08&lt;/a&gt;: &lt;a href="https://blog.mozilla.org/nnethercote/2020/09/08/how-to-speed-up-the-rust-compiler-one-last-time/"&gt;How to speed up the Rust compiler one last time&lt;/a&gt;. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-08&lt;/a&gt;: &lt;a href="https://www.nextflow.io/"&gt;Nextflow&lt;/a&gt;, for Data-driven computational pipelines, looks great. Apparently it also works with OpenJDK 14 on macOS.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-08&lt;/a&gt;: &lt;a href="https://martinheinz.dev/blog/32"&gt;Writing More Idiomatic and Pythonic Code&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-10&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/my-foolish-heart-live-at-montreux/263899063" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Gary Peacock, Jack DeJohnette &amp;amp; Keith Jarrett, &lt;em&gt;My Foolish Heart&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-10&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Only write necessary tests — specifically, tests whose estimated value is greater than their estimated cost. This is a hard judgement call, of course, but it does mean that at least some of the time you should be saying “it’s not worth it”. &amp;mdash; &lt;a href="https://lukeplant.me.uk/blog/posts/test-smarter-not-harder/"&gt;Test smarter, not harder&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-09-10&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;We all know it&amp;rsquo;s tricky to have a rational discussion about a religion. Non-Lispers will be able to read this without getting their feathers ruffled. Some Lispers aren&amp;rsquo;t too far gone, so let&amp;rsquo;s assume we&amp;rsquo;re talking to them, and take a look at some of Lisp&amp;rsquo;s problems that make it flat-out unacceptable. At least for LISP, you know, the idealized one. &amp;mdash; &lt;a href="https://steve-yegge.blogspot.com/2006/04/lisp-is-not-acceptable-lisp.html?m=1"&gt;Lisp is Not an Acceptable Lisp&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-09-10&lt;/a&gt;: OMG! My Doom startup time just has just been reduced from 4s to less than 1.5s after I removed the only &lt;code&gt;require&lt;/code&gt; instruction I add in my various Elisp files. &lt;code&gt;#emacs&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Doom loaded 298 packages across 55 modules in 1.492s.&lt;/code&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-09-10&lt;/a&gt;: &lt;a href="https://blog.d46.us/advanced-emacs-startup/"&gt;Advanced Techniques for Reducing Emacs Startup Time&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-10&lt;/a&gt;: &lt;a href="https://nullprogram.com/blog/2020/09/04/"&gt;Asynchronously Opening and Closing Files in Asyncio&lt;/a&gt;. &lt;code&gt;#clang&lt;/code&gt; &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-10&lt;/a&gt;: &lt;a href="https://www.travishinkelman.com/posts/modify-aggregate-dataframes-chez-scheme/"&gt;Modify and aggregate dataframes in Chez Scheme&lt;/a&gt;. &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-12&lt;/a&gt;: TIL that &lt;a href="https://github.com/emacs-helm/helm/issues/2386"&gt;Helm&lt;/a&gt; development is now stalled (via Bastien Guerry). I&amp;rsquo;m using Ivy from a while ago now, but my heart goes out to helm&amp;rsquo;s advanced users, like &lt;a href="https://www.manueluberti.eu/"&gt;Manuel Uberti&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-12&lt;/a&gt;: &lt;a href="https://valand.dev/blog/post/from-rust-to-typescript"&gt;From Rust to TypeScript&lt;/a&gt;. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-12&lt;/a&gt;: &lt;a href="https://github.com/fastai/fastmac/"&gt;fastmac&lt;/a&gt;: Get a MacOS or Linux shell, for free, in around 2 minutes.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-13&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Longer functions contain more code, and the more code developers write the more mistakes they are likely to make.&lt;br&gt; But wait, the evidence shows that most reported faults occur in short functions.&lt;br&gt; This is true, at least in Java. It is also true that most of a Java program’s code appears in short methods (in C 50% of the code is contained in functions containing 114 or fewer lines, while in Java 50% of code is contained in methods containing 4 or fewer lines). It is to be expected that most reported faults appear in short functions. &amp;mdash; &lt;a href="http://shape-of-code.coding-guidelines.com/2020/09/06/impact-of-function-size-on-number-of-reported-faults/"&gt;Impact of function size on number of reported faults&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-09-13&lt;/a&gt;: &lt;a href="https://blog.viktomas.com/posts/facebook-censorship/"&gt;Facebook won&amp;rsquo;t let you talk about this blog&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-14&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;There exists however one common trait for virtually all of text editors: they are written by and for developers. Consequently, design is generally not the primary concern and the final product does not usually enforce best recommendations in terms of appearance, interface design or even user interaction. The most striking example is certainly the syntax colorization that seems to go against every good de- sign principles in a majority of text editors and the motto guiding design could be summarized by “Let’s add more colors” (using regex). &amp;mdash; &lt;a href="https://arxiv.org/abs/2008.06030"&gt;On the design of text editors&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-09-14&lt;/a&gt;: As I was looking for an old blog post by Vincent Zoonekynd, I noticed he&amp;rsquo;s &lt;a href="http://zoonek.free.fr/blosxom/"&gt;back to blogging&lt;/a&gt; after a 7 year hiatus.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-14&lt;/a&gt;: Going back to Stack Overflow after several years off. I only edited/fixed a dozen posts or so and I&amp;rsquo;m already exhausted.&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-09-14-19-55-15.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-14&lt;/a&gt;: Learning about Haskell typing mechanism, talking about Lisp interface to Python. But this is just an excuse to post a screenshot of this lovely Amethyst window manager.&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-09-14-19-47-31.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-14&lt;/a&gt;: &lt;a href="https://blog.jez.io/cli-code-review/"&gt;Code Review from the Command Line&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-14&lt;/a&gt;: &lt;a href="https://github.com/rougier/emacs-gtd"&gt;Get Things Done with Emacs&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-14&lt;/a&gt;: &lt;a href="https://crypto.stanford.edu/~blynn/gitmagic/index.html"&gt;Git Magic&lt;/a&gt; is really great, especially chapters 7 and 8. &lt;code&gt;#git&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-14&lt;/a&gt;: &lt;a href="https://crypto.stanford.edu/~blynn/haskell/"&gt;Haskell Fan Site&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-14&lt;/a&gt;: &lt;a href="https://github.com/ndmitchell/hlint"&gt;Hlint&lt;/a&gt; is such a killer feature for writing Haskell in Vim or Emacs!&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-09-14-11-03-43.png" alt="hlint"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-14&lt;/a&gt;: &lt;em&gt;M-x doom&lt;/em&gt; tip of the day: &lt;code&gt;gs/&lt;/code&gt; (&lt;code&gt;avy-goto-char-timer&lt;/code&gt;) as a quick Vim &lt;code&gt;easy-motion&lt;/code&gt; replacement. See also &lt;code&gt;gs&amp;lt;space&amp;gt;&lt;/code&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-15&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Helping people online is difficult. We expect technical questions and discussions, but everyone involved are just people, so it doesn’t always go smoothly. There’s no way to guarantee a good outcome, but there are things we as helpers can do to improve the interactions. &amp;mdash; &lt;a href="https://nedbatchelder.com/blog/202009/how_to_be_helpful_online.html"&gt;How to be helpful online&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-09-15&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;One of the delightful and surprising things about Emacs, as you get to know it better, is the depth of customisation which is available. Emacs can be a completely different editor for different people and for different purposes. &amp;mdash; &lt;a href="https://www.rousette.org.uk/archives/advising-emacs/"&gt;Advising Emacs&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-09-15&lt;/a&gt;: &lt;a href="https://comby.dev/"&gt;Comby&lt;/a&gt; is a tool for searching and changing code structure.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-15&lt;/a&gt;: &lt;a href="https://www.travishinkelman.com/posts/eda-chez-scheme/"&gt;Exploratory data analysis in Chez Scheme&lt;/a&gt;. &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-15&lt;/a&gt;: &lt;a href="https://pwacker.com/CG.html"&gt;The Conjugate Gradient method: A geometrical explanation&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-16&lt;/a&gt;: &lt;a href="https://emacs-lsp.github.io/lsp-mode/tutorials/how-to-turn-off/"&gt;A guide on disabling/enabling lsp-mode features&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-16&lt;/a&gt;: &lt;a href="http://bald.cat/slimhtml"&gt;slimhtml&lt;/a&gt; is an Emacs org-mode export backend. It is a set of transcoders for common org elements which outputs minimal HTML. &lt;code&gt;#emacs&lt;/code&gt; &lt;code&gt;#org&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-18&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Most of the time, when you hear that a free software project is struggling, it is too late. E.g. both pdf-tools and helm don&amp;rsquo;t have a maintainer since a few days: did you see this coming?&lt;br&gt;Org is doing quite well, but I feel we are at a turning point: either we attract more contributors and we can afford to fix more bugs and deliver new releases, or we might get overwhelmed by user requests and lose both our energy and our motivation to continue. &amp;mdash; &lt;a href="https://bzg.fr/en/org-mode-9.4-is-out-can-you-help.html/"&gt;Org 9.4 is out. Can you help?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-09-18&lt;/a&gt;: I already said in one of my recent posts on the main blog that I rarely use Stata these days. Yet I continue reading the Stata blog, and I was happy to see Chuck Huber taking the lead on the most recent posts. At the time of this writing, this is all about &lt;a href="https://blog.stata.com/2020/09/14/stata-python-integration-part-5-three-dimensional-surface-plots-of-marginal-predictions/"&gt;Python integration&lt;/a&gt;, which I find nice after all. I have a somewhat outdated version of Stata since I&amp;rsquo;m no longer a Stata trainer for public and private companies, but I remain interested in how Stata is evolving. &lt;code&gt;#stata&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-18&lt;/a&gt;: Not sure what data-oriented programming is but I bookmarked two posts the other day and I thought I could share them:- &lt;a href="https://www.moderndescartes.com/essays/data_oriented_python/"&gt;Data-oriented Programming in Python&lt;/a&gt;- &lt;a href="https://jamesmcm.github.io/blog/2020/07/25/intro-dod/"&gt;An introduction to Data Oriented Design with Rust&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-18&lt;/a&gt;: Yesterday I watched Alabama Monroe (&lt;a href="https://en.wikipedia.org/wiki/The_Broken_Circle_Breakdown"&gt;The Broken Circle Breakdown&lt;/a&gt;). What an emotional bombshell!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-18&lt;/a&gt;: &lt;a href="https://occasionallycogent.com/introspective_emacs/index.html"&gt;Introspective Emacs&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-18&lt;/a&gt;: &lt;a href="https://www.njtierney.com/post/2020/09/17/missing-flavour/"&gt;The many Flavours of Missing Values&lt;/a&gt;. The &lt;a href="https://groups.google.com/g/julia-dev/c/WD7-vQeweJE/discussion"&gt;eternal&lt;/a&gt; &lt;a href="https://wizardmac-blog.tumblr.com/post/104019606584/whats-wrong-with-statistics-in-julia-a-reply"&gt;problem&lt;/a&gt; with NA values&amp;hellip; &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-20&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;First, new features just keep being added, because how else would you justify releases? VS Code releases every month with new stuff! They are well past the point of shipping the essentials (and have been for a couple of years now), but releases are still been shipped. Because they have a team, that team has a huge budget to spare, and there’s no power stopping them from shipping anything, no matter important or not. There’s no filter. &amp;mdash; &lt;a href="https://tonsky.me/blog/sublime/"&gt;The most important feature of Sublime Text&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-09-21&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;We all know that a languages like Ruby or Python are designed explicitly to hide this sort of complexity from us and let us get on with the dirty business of munging data blobs or serving web requests or solving sudokus or whatever, and thank goodness for that, but wow that is quite a lot, isn&amp;rsquo;t it? &amp;mdash; &lt;a href="https://blog.jfo.click/hello-hello-world/"&gt;Hello &amp;ldquo;Hello world!&amp;rdquo;&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-09-21&lt;/a&gt;: Evening: &lt;a href="https://music.apple.com/fr/playlist/pj-harvey-les-indispensables/pl.700e6a67c7364f03b6cd0d5d2496d26c"&gt;PJ Harvey&lt;/a&gt;.&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-09-21-20-32-16.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-21&lt;/a&gt;: &lt;a href="https://blog.ssanj.net/posts/2020-06-13-contravariant-functors-are-weird.html"&gt;Contravariant functors are Weird&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-21&lt;/a&gt;: &lt;a href="https://inventwithpython.com"&gt;Invent with Python&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-22&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The underlying issue is the non-collapsibility of ORs and HRs. Non-collapsibility means that the conditional ratio is different from the marginal (unadjusted) ratio even in the complete absence of confounding (as in our example dataset below). By the way, don’t make the mistake of concluding that non-collapsibility is undesirable. Any measure that has the potential for summarizing a treatment effect with one constant for all types of patients will be non-collapsible when the outcome is categorical or represents time to event1. Collapsible measures such as absolute risk reduction and relative risk reduction must vary over risk factors (creating mathematical but not subject-matter-relevant interactions), otherwise probabilities will arise that are outside the allowable range of [0,1]. Log odds and log hazard ratios have an unlimited ranges and can possibly apply to everyone. This makes them good bases for studying heterogeneity of treatment effect. &amp;mdash; &lt;a href="https://www.fharrell.com/post/marg/"&gt;Unadjusted Odds Ratios are Conditional&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-09-22&lt;/a&gt;: TIL about &lt;a href="https://www.jratcliffe.net/copy-of-aoristic-analysis"&gt;aoristic analysis&lt;/a&gt; (via &lt;a href="https://andrewpwheeler.com/2020/09/15/making-aoristic-density-maps-in-r/"&gt;Andrew P. Wheeler&lt;/a&gt;).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-22&lt;/a&gt;: &lt;a href="https://noonker.github.io/posts/2020-04-22-elfeed/"&gt;Elfeed Rules!&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-22&lt;/a&gt;: &lt;a href="https://www.naut.ca/blog/2020/08/26/ubuntu-vm-on-macos-with-libvirt-qemu/"&gt;Ubuntu VM on macOS with libvirt + QEMU&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-23&lt;/a&gt;: Nice review of old and new text editors: &lt;a href="https://blog.robenkleene.com/2020/09/21/the-era-of-visual-studio-code/"&gt;The Era of Visual Studio Code&lt;/a&gt;.&amp;gt; BBEdit, Emacs, and Vim are all great text editors in their own right, but they all have idiosyncrasies that (while beloved by people like me) prevent them from ever being the most popular text editor.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-23&lt;/a&gt;: &lt;a href="https://renkun.me/2020/09/13/debugging-r-in-vscode/"&gt;Debugging R in VSCode&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-23&lt;/a&gt;: &lt;a href="https://tracks.ranea.org/post/629525278016798720/panics-nova-text-editor-a-review"&gt;Panic’s Nova text editor (a review)&lt;/a&gt; (via &lt;a href="https://irreal.org/blog/?p=9158"&gt;Irreal&lt;/a&gt;). &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-23&lt;/a&gt;: &lt;a href="http://www.brodrigues.co/blog/2020-09-20-shiny_raspberry/"&gt;The Raspberry Pi 4B as a shiny server&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-09-24&lt;/a&gt;: &lt;a href="https://edom.github.io/emacs.html"&gt;Using Emacs and Org Mode&lt;/a&gt;. I still happen to find some interesting stuff in there. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>Routed Gothic</title><link>https://aliquote.org/post/routed-gothic/</link><pubDate>Tue, 22 Sep 2020 20:44:01 +0200</pubDate><guid>https://aliquote.org/post/routed-gothic/</guid><description>&lt;p&gt;Today I configured my current main plotting engines (R, Stata and Python) to use the &lt;a href="https://webonastick.com/fonts/routed-gothic/"&gt;Routed Gothic&lt;/a&gt; font. I choose the Narrow variant as it looks prettier for plotting purpose. I discovered this font thanks to &lt;a href="https://twitter.com/stevelosh/status/1231434196213796864?s=20"&gt;Steve Losh&lt;/a&gt;, which he &lt;a href="https://hg.stevelosh.com/.plan/#2020-02-23"&gt;now uses&lt;/a&gt; with Gnuplot. I like this old design stuff a lot, but it&amp;rsquo;s definitively not the best font available for plotting as typography-centric themes (e.g., &lt;a href="https://hrbrmstr.github.io/hrbrthemes/"&gt;hrbrthemes&lt;/a&gt;) usually rely on good kerning and tabular figures. Anyway, I wanted to give it a try for a few weeks and see how it goes. After all it took me a long time to make up my mind to opt for JetBrains Mono after three years of Iosevka.&lt;/p&gt;
&lt;p&gt;Using this font in R is not really a problem if you&amp;rsquo;re using &lt;a href="https://ggplot2.tidyverse.org/"&gt;ggplot2&lt;/a&gt; since it comes as a TTF font. It can be used on the fly, when saving PDF files, or as a theming option. I had this in my &lt;code&gt;.Rprofile&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;.First&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="kr"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;grDevices&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;quartz.options&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;width&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;height&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;6&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;grDevices&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;palette&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Tableau10&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;theme_set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;theme_light&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;base_family&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;Routed Gothic Narrow&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Stata can be configured to use any font you like in your Do-file editor, variable browser/editor, or in the main UI (command + results window). The default font and theme can also be defined for the graphic device. Below is a quick illustration of R and Stata output for the &lt;code&gt;mtcars&lt;/code&gt; and &lt;code&gt;auto&lt;/code&gt; datasets.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/qplot-disp-mpg.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/qplot-disp-mpg.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/scatter-price-mpg.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/scatter-price-mpg.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Adding a default font for &lt;a href="https://matplotlib.org/"&gt;matplotlib&lt;/a&gt; is actually a little bit trickier. I happened to do it as follows:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;First, you need to copy the default &lt;code&gt;matplotlibrc&lt;/code&gt; fiel if you haven&amp;rsquo;t one already under your &lt;code&gt;~/.matplotlib&lt;/code&gt; directory. For me, it was something like : &lt;code&gt;cp /usr/local/lib/python3.8/site-packages/matplotlib/mpl-data/matplotlibrc .matplotlib&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Next, copy the &lt;code&gt;*.ttf&lt;/code&gt; font files in the &lt;code&gt;site-packages/matplotlib/mpl-data/fonts/ttf&lt;/code&gt; directory.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Finally, edit the &lt;code&gt;matplotlibrc&lt;/code&gt; file to add the Routed Gothic Narrow font as the first item under the &lt;code&gt;font.sans&lt;/code&gt; entry. Mine now looks as follows:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;font.sans-serif : Routed Gothic Narrow, DejaVu Sans, Bitstream Vera Sans, Computer Modern Sans Serif, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then, you just have to launch &lt;code&gt;ipython&lt;/code&gt; with the &lt;code&gt;matplolib&lt;/code&gt; backend enabled and enjoy your new font settings.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I&amp;rsquo;m pretty there is a better option, but this works. That&amp;rsquo;s it.&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;I know about various option to have pyplot enabled as an interactive module, but what I use these days is to use a simple startup script located in &lt;code&gt;.ipython/profile_default/startup&lt;/code&gt; where I set &lt;code&gt;matplotlib.interactive(True)&lt;/code&gt;.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>On leaving Mac apps (almost) altogether</title><link>https://aliquote.org/post/on-leaving-mac-apps/</link><pubDate>Sun, 20 Sep 2020 20:22:40 +0200</pubDate><guid>https://aliquote.org/post/on-leaving-mac-apps/</guid><description>&lt;p&gt;It&amp;rsquo;s 2020, I&amp;rsquo;ve spent the last 15 years on various Apple laptops. Occasionally I work on a remote Linux machine, but I only have had personal laptops, and all but two were Macbook. Over the years I came to appreciate the quality of the software I used to rely on in my daily routine. Even if I favor plain text and markup languages, which usually remain portable across all OSs, there has always been some Mac app that I found wonderful with no equivalent on other platform. For instance, Marked or Deckset are well-crafted applications for working with Markdown (I know there are a lot of note taking app, like Bear, that are also quite good). I&amp;rsquo;m writing this because I just saw an interview on the &lt;em&gt;Uses This&lt;/em&gt; series, where the authors says:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;It&amp;rsquo;s software that makes me want to be Apple-only. The apps I rely on tend to be Mac/iOS-only. For email I use Spark, for calendar I use Fantastical, and for notes I just started using Bear which I love because it&amp;rsquo;s so fast and clean compared to things like OneNote or Notion. I also use Day One occasionally to (sort of) journal. I often use MS Word to write, but lately I&amp;rsquo;ve been gravitating toward a Markdown editor called Typora, again because it&amp;rsquo;s so clean and straightforward compared to the feature-stuffed clutter of Word. &amp;mdash; Navneet Alang on &lt;a href="https://usesthis.com/interviews/navneet.alang/"&gt;Uses This&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;On a personal account, the past few months were a call for digital minimalism. I already deleted most of my social accounts two years ago and switched to an anonymous online presence on the www. I also reduced my digital consumption a lot: no more Twitter or RSS reading all day, batch processing of emails and the like, less web browsing, and so on. I don&amp;rsquo;t regret it since I have a lot more time to watch TV shows, movies or read some good books. But this quest for minimalism also means I need to reduce the pool of apps I installed on my Macbook over the years. Some of these apps are no longer in use actually as I don&amp;rsquo;t need much statistical software other than R in my new job (Stat Transfert, Mplus, Wizard, SAS University edition), others have simply faded with time (Fantastical, Reeder, Timing, Forklift; much like many of the &lt;a href="https://aliquote.org/tags/app/"&gt;apps I reviewed&lt;/a&gt; in the past). Also, my job position doesn&amp;rsquo;t require me to make extensive use of Word or Excel, which is great, nor of MS exchange or Windows-specific stuff (which is also great). Hence the natural selection process that gradually took place on my computer.&lt;/p&gt;
&lt;p&gt;These days, I stick to kitty, Emacs or Neovim (for lightweight editing tasks), Arq, Transmit, Marked (occasionally) and Skim. This means that I only make use of 3 native Mac apps in 80% of my time (you know, the &lt;a href="https://www.johndcook.com/blog/2018/08/27/pareto-80-20-rule/"&gt;Pareto law&lt;/a&gt; trick). This does not include &lt;a href="https://aliquote.org/post/amethyst-app/"&gt;Amethyst&lt;/a&gt; which became my window manager of choice. I even uninstalled Moom which has long served me before I discovered Amethyst. I still have other apps installed like Deckset or Adobe Reader. I haven&amp;rsquo;t used &lt;a href="https://aliquote.org/post/deckset-app/"&gt;Deckset&lt;/a&gt; in years, even if I upgraded to the latest version, and I once installed Adobe Reader to navigate Stata help, but apart from checking PDF forms that were hard to read using Preview only, I don&amp;rsquo;t really need it. Skim is all I need for PDF rendering and &lt;a href="https://tex.stackexchange.com/a/118491/2580"&gt;synctex&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Org custom CSS</title><link>https://aliquote.org/post/org-css-design/</link><pubDate>Fri, 18 Sep 2020 10:05:21 +0200</pubDate><guid>https://aliquote.org/post/org-css-design/</guid><description>&lt;p&gt;I redesigned the Org CSS default settings I used to use when I worked on my &lt;a href="https://aliquote.org/articles/stata-sk/"&gt;Stata handouts&lt;/a&gt; two years ago. I&amp;rsquo;ve been looking for a clean and responsive CSS sample for a while now. There exist some nice implementations here and there, but I never found one I really like. This was not really a problem when I was using Pandoc as my main exporter for Org documents, but Pandoc template generally do not support Org specific keyword (e.g., todo items) and this never works with Babel, so this is not a valid option when exporting evaluated code block.&lt;/p&gt;
&lt;p&gt;Since I lifted my Emacs packages and remove &lt;code&gt;ox-pandoc&lt;/code&gt;, I&amp;rsquo;m left with basic HTML and PDF export. I&amp;rsquo;m done with PDF export settings since I now use a customized &lt;a href="https://aliquote.org/post/emacs-org-tufte-handout/"&gt;Tufte handout&lt;/a&gt; template. The Github-inspired CSS I was using for HTML was less polished than the one we have for Pandoc, so I&amp;rsquo;m left with this default template that I hope you will find good enough, but see below (left is on full screen, right is for mobile device). The table of contents is managed using code found on the &lt;a href="https://orgmode.org/worg/"&gt;Worg&lt;/a&gt; site, but only for large displays. In case you&amp;rsquo;re interested, here is the &lt;a href="https://aliquote.org/pub/worg.css"&gt;source file&lt;/a&gt;.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2020-09-18-17-22-23.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2020-09-18-17-22-23.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2020-09-18-17-22-33.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2020-09-18-17-22-33.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;So far so good. There are still things I&amp;rsquo;m working on, but for the moment it&amp;rsquo;s usable. Regarding tables, I devised a simple scheme to make them look close to booktabs-style table in Latex. Here is a comparison of HTML (left) and PDF (right) rendering:&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2020-09-19-16-15-50.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2020-09-19-16-15-50.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2020-09-19-16-27-44.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2020-09-19-16-27-44.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;I was also wondering whether this stylesheet could be used with RMarkdown-like document &amp;mdash; I don&amp;rsquo;t really know how we would call this when we are using Org babel: ROrg? BabelR? Several &lt;a href="https://aliquote.org/post/org-mode-literate/"&gt;years ago&lt;/a&gt; I was already thinking of replacing RMarkdown with Org, and now I am about to replace everything Markdown with Org.&lt;/p&gt;
&lt;p&gt;So I quickly rewrote one of my old Markdown &lt;a href="https://github.com/even4void/rstats-biostats/blob/master/handout/practical01.Rmd"&gt;handout&lt;/a&gt; in Org format. I used Pandoc to convert the original Md file into an Org file, which I edited afterwards. This means replacing &lt;code&gt;BEGIN_EXAMPLE&lt;/code&gt; with &lt;code&gt;BEGIN_SRC&lt;/code&gt; where appropriate and adding a bit of options to process each chunk. In org, we can define a global header that will apply to all SRC block, then refine individual ones with additional options. This is particularly useful to mimic part of &lt;a href="https://yihui.org/knitr/"&gt;knitr&lt;/a&gt; setup.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;#+PROPERTY: header-args:R :session *R* :exports both :results output&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This means that instead of adding &lt;code&gt;:session *R* :exports both :results output&lt;/code&gt; to each SRC header, we can just apply this globally. Images are handled quite nicely when using RMarkdown, but we have some options in org as well. here is the basic ones I use:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;#+BEGIN_SRC R :file 001.png :results graphics file
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;--%&amp;lt;--- (snip) ---&amp;gt;%--
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;#+END_SRC
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;A final note: The HTML &lt;code&gt;pre&lt;/code&gt; block behave strangely in some case (e.g., you&amp;rsquo;ll get a lot of whitespaces before the first instruction in the SRC block), so I added the following piece of code in the CSS template:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-css" data-lang="css"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;pre&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;src&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#f8f5ec&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;white-space&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;pre-line&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The final output is &lt;a href="https://aliquote.org/pub/practical01.html"&gt;here&lt;/a&gt; (&lt;a href="https://aliquote.org/pub/practical01.org"&gt;source&lt;/a&gt; file). Now the only thing left is to implement my custom &lt;a href="https://aliquote.org/post/latex-beamer-21-century/"&gt;Beamer template&lt;/a&gt; in Org.&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;I know &lt;a href="https://www.ctan.org/pkg/booktabs/"&gt;booktabs&lt;/a&gt; use different line heights for the header (i.e., the top line is thicker), but it&amp;rsquo;s quite difficult to replicate this behavior in CSS unless we are sure we have a footer: In this case we don&amp;rsquo;t need to apply a &lt;code&gt;table tr:last-child&lt;/code&gt; rule to manage the bottom line of the Table since it could be handled by etting a &lt;code&gt;border-top&lt;/code&gt; property in the &lt;code&gt;tfoot&lt;/code&gt; rule.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Minimalist Emacs</title><link>https://aliquote.org/post/minimalist-emacs/</link><pubDate>Wed, 16 Sep 2020 19:44:09 +0200</pubDate><guid>https://aliquote.org/post/minimalist-emacs/</guid><description>&lt;p&gt;I&amp;rsquo;ve spent the last two years tweaking my Emacs config, especially the tools I find useful for my daily work and the UI in general. As I already said &lt;a href="https://aliquote.org/post/pretty-emacs/"&gt;in the past&lt;/a&gt;, when you spend several hours in front of your text editor, you&amp;rsquo;d better like the UI.&lt;/p&gt;
&lt;p&gt;During the last weeks, I spent a fair amount of time reducing the unnecessary glitter around the &lt;a href="https://aliquote.org/post/editor-war/"&gt;GUI&lt;/a&gt;, then the &lt;a href="https://aliquote.org/post/emacs-in-terminal/"&gt;TUI&lt;/a&gt;, and finally the number of packages I depend on. I&amp;rsquo;m now well under 300 packages and less than 1.5s of startup. I could surely do a little bit more, but I&amp;rsquo;m overall happy with the job done. I&amp;rsquo;m not the &lt;a href="https://www.manueluberti.eu/emacs/2020/09/08/end-of-era/"&gt;only one&lt;/a&gt; apparently, and I&amp;rsquo;m glad to know that &lt;a href="https://github.com/rougier/elegant-emacs"&gt;others&lt;/a&gt; are also cultivating the idea of minimalist interfaces.&lt;/p&gt;
&lt;p&gt;Here are some of the packages/modules I removed along time, or those I never used anyway. The following mostly refers to Doom Emacs &lt;a href="https://github.com/hlissner/doom-emacs/blob/develop/init.example.el"&gt;naming conventions&lt;/a&gt; (wrt. modules and packages):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;doom-modeline&lt;/code&gt; is too bloated, I very much prefer the light version than Henrik Lissner developed alongside.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;treemacs&lt;/code&gt;, it&amp;rsquo;s fine but how often do you use a project sidebar when the project is very large, and for what purpose? Compared to &lt;code&gt;dired&lt;/code&gt;, it comes with very few options to manipulate the file system. Note that if you&amp;rsquo;re using LSP, there&amp;rsquo;s &lt;code&gt;lsp-treemacs&lt;/code&gt;, which might be interesting for those who need an overview of symbols, class hierarchy or errors, but I usually don&amp;rsquo;t need this for Python, C or Rust (which are the only mode in which &lt;code&gt;lsp-mode&lt;/code&gt; is insinuated).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;vi-tilde-fringe&lt;/code&gt;, not visually appealing and useless once you let Emacs manage whitespace cleaning on save.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;minimap&lt;/code&gt;, why needs this seriously?&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tabs&lt;/code&gt;, no thanks. I&amp;rsquo;ve come to appreciate the idea of windows (workspaces in Doom Emacs) and buffers, and I know how to navigate efficiently in this space.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;window-select&lt;/code&gt;, which is mostly about adding more options to navigate between opened buffers in the same window adds nothing to my current workflow, where I tend to use few splits, and a workspace-based approach to buffer arrangement.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;dashboard&lt;/code&gt;, I never used so it hasn&amp;rsquo;t to be uninstalled, but I wonder what purpose it really serves.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;doom-fancy-priorities&lt;/code&gt; no longer appeared interesting to me, especially since I rarely flag todo items with priority levels.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;fill-column&lt;/code&gt; and &lt;code&gt;indent-guides&lt;/code&gt; were quite good actually, but they don&amp;rsquo;t play nicely when Emacs run in a terminal. In any case, Emacs auto-indent features are the best on Earth, so why do I need to bother.&lt;/li&gt;
&lt;li&gt;ligature support: this has been a well-thought-out idea before complete removal, but now that I use JetBrains Mono and Kitty, with built-in support for ligatures, I no longer have to worry about using ligatures in a GUI &amp;mdash; with the added benefit that I no longer encounter any problem with alignment of block continuation (e.g., in R, if you add a new line to separate a long list of arguments, it gets correctly aligned with the opening parenthesis except that ligatures as implemented using &lt;code&gt;prettify-symbols-mode&lt;/code&gt; and the like usually account for two characters instead of one, which makes things ugly when you&amp;rsquo;re viewing the text in another text editor or on GitHub). I know Emacs 28 offers a better option to manage ligatures, but I&amp;rsquo;m happy with my current settings so I won&amp;rsquo;t upgrade for the moment.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;parinfer&lt;/code&gt; is probably great (especially when you delete the last s-exp into a block of aligned s-exp, which get automagically reformated with the closing parenthesis) but it sometimes interfere with Emacs auto-indent features.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;org-journal&lt;/code&gt;, I should definitively refrain to install this kind of stuff, like I always did for &lt;code&gt;org-roam&lt;/code&gt;. because it is so much specialized and hardly customizable. I recently cleaned up my old files, which I use to record my meeting notes, and converted it to a single Org file, which is much easier to handle. I don&amp;rsquo;t miss the search functionalities since I get them with ivy-mode. The only thing that I missed a lot was the display of individual entries in Emacs calendar. I know there are &lt;a href="https://github.com/lawlist/lorg-calendar"&gt;some&lt;/a&gt; &lt;a href="https://gist.github.com/rougier/e6c53fd9809994515f1327332baea09a"&gt;alternatives&lt;/a&gt;, but I should probably write my own utility at some point.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;multiple-cursors&lt;/code&gt;, I remember when I saw this one on the Sublime Text homepage. At first sight this looked great, but I can manage to get the same result using visual block most of the times (when this is not the case, I simply &lt;code&gt;query-replace&lt;/code&gt; using a regex in a region).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;grammar&lt;/code&gt; (&lt;code&gt;languagetool&lt;/code&gt; and Co.) was annoying; I prefer to use only one tool (Flyspell with aspell) that highlights serious typo and not be reminded that my english is so bad (use of passive tense, stop words, etc.).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pdf&lt;/code&gt;, I no longer use PDFtools since I&amp;rsquo;m using Emacs in a Terminal. This was great to be able to look at pictures (mostly statistical plots generated in PNG from R or Python) from a shell running inside Emacs, but to be honest I always ended up reading PDFs in an external PDF reader.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I finally learnt to manage my Org files in such a way that I can now get an overview of my daily activities in Org agenda, while keeping track of what I&amp;rsquo;ve done in the past using simple todo lists. I&amp;rsquo;m not an GTD guy. I understand the idea, but I only manage a few files: a todo list, a collection of meeting notes, and a daily log book. There are additional files in my Org directory, but these are mostly auxiliary files that I don&amp;rsquo;t need to consult as often as the above working files. I don&amp;rsquo;t have much use of functionalities like archiving, refiling, clocking, or acting on whole subtrees. This may change in the future, as I slowly learn all the benefit of archiving everything in plain text.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m now fully into &lt;a href="https://www.djcbsoftware.nl/code/mu/mu4e.html"&gt;mu4e&lt;/a&gt; for processing my emails. This is not too surprising since I have been using it for almost 8 years now, but I never used it exclusively. I also use Elfeed to manage my RSS feeds. In the past I used to use Gnus, but Elfeed has everything I need, so I don&amp;rsquo;t want to spend another round of time configuring the Gnus beast.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m happy with &lt;a href="https://emacs-lsp.github.io/lsp-mode/"&gt;lsp-mode&lt;/a&gt; actually. I&amp;rsquo;m still on version 7.0 since I didn&amp;rsquo;t upgrade my Doom framework for some months now. I did &lt;code&gt;eglot&lt;/code&gt; a short try (after all, this package and &lt;a href="https://github.com/joaotavora/sly"&gt;sly&lt;/a&gt; were developed by the same author) but I much prefer &lt;code&gt;lsp-mode&lt;/code&gt;, once we &lt;a href="https://emacs-lsp.github.io/lsp-mode/tutorials/how-to-turn-off/"&gt;get rid&lt;/a&gt; of most of the extra features.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m also becoming more proficient for navigating through a text buffer when using Vim modal editing (either using Evil mode or in Neovim). There&amp;rsquo;s no other choice in fact since I cannot really use the mouse in Kitty, except for selecting and mouse-pasting. This probably is the biggest change in my writing workflow for the past 20 years! I like it, though. First, I like changing my mind if I happen to see any benefit in the alternative, and using modal editing helps me reconsider the way I can process test and code using a keyboard and my mind. Now I still use the arrow keys to navigate between nearby characters, but I no longer use the mouse.&lt;/p&gt;</description></item><item><title>Using LSP from Neovim</title><link>https://aliquote.org/post/getting-into-neovim/</link><pubDate>Fri, 11 Sep 2020 18:06:22 +0200</pubDate><guid>https://aliquote.org/post/getting-into-neovim/</guid><description>&lt;p&gt;I already mentioned in several posts related to &lt;a href="https://aliquote.org/tags/emacs/"&gt;Emacs&lt;/a&gt; that I&amp;rsquo;m using Neovim more and more since a few months. Here are a few thoughts about using LSP clients in Neovim, almost for free.&lt;/p&gt;
&lt;p&gt;I like writing in Vim actually. Now that I begin to be more comfortable with modal editing and Vim motions, I think I probably missed a lot of good stuff by not trying Emacs Evil mode earlier. The only things I really added is &lt;code&gt;C-a&lt;/code&gt; and &lt;code&gt;C-e&lt;/code&gt;, because I&amp;rsquo;m so used to using these shortcuts in Emacs and the terminal.&lt;/p&gt;
&lt;p&gt;Of course, it all started with everyone&amp;rsquo;s nice configuration I found on Github, starting with the very lightweight ones written by &lt;a href="https://github.com/noopkat/dotfiles"&gt;Suz Hinton&lt;/a&gt; or &lt;a href="https://macwright.com/2018/06/17/how-and-why-vim.html"&gt;Tom MacWright&lt;/a&gt; (unfortunately, these config are very oriented toward JavaScript development). Lately, I&amp;rsquo;ve tried a bunch of different plugins for coding, especially those relying on the language server protocol, namely &lt;a href="https://github.com/neoclide/coc.nvim"&gt;Coc&lt;/a&gt; and Neovim builtin &lt;a href="https://neovim.io/doc/user/lsp.html"&gt;LSP client&lt;/a&gt; (for version ≥ 0.5). In my opinion, Coc is more complete and everything works smoothly compared to Neovim builtin package, but things may change in the future.&lt;/p&gt;
&lt;p&gt;Lately, I removed almost all the coding stuff I added in my config files to keep only things I consider essential to boosting my productivity when using Vim: &lt;a href="https://github.com/dense-analysis/ale"&gt;ale&lt;/a&gt;, &lt;a href="https://github.com/tpope/vim-commentary"&gt;vim-commentary&lt;/a&gt;, &lt;a href="https://github.com/tpope/vim-surround"&gt;vim-surround&lt;/a&gt;, &lt;a href="https://github.com/sheerun/vim-polyglot"&gt;vim-polyglot&lt;/a&gt;, &lt;a href="https://github.com/tpope/vim-fugitive"&gt;vim-fugitive&lt;/a&gt;, &lt;a href="https://github.com/rhysd/git-messenger.vim"&gt;git-messenger.vim&lt;/a&gt;, &lt;a href="https://github.com/airblade/vim-gitgutter"&gt;vim-gitgutter&lt;/a&gt;, &lt;a href="https://github.com/junegunn/fzf.vim"&gt;fzf&lt;/a&gt;, &lt;a href="https://github.com/vim-airline/vim-airline"&gt;vim-airline&lt;/a&gt; (there are some additional plugins that go along the ones mentioned, like &lt;code&gt;airline-themes&lt;/code&gt; or &lt;code&gt;fzf.vim&lt;/code&gt;). Anyway, 18 packages is enough for most of my editing tasks, while I need 10x more packages in Emacs to get a TUI experience close to this one. I miss Coc when editing R or Python files, however. Anyway, 18 packages is enough for most of my editing tasks, while I need 10x more packages in Emacs to get the TUI experience.&lt;/p&gt;
&lt;p&gt;Then I realized that ale has almost everything I needed, namely &amp;ldquo;go to definition&amp;rdquo;, &amp;ldquo;find references&amp;rdquo;, &amp;ldquo;rename&amp;rdquo;, &amp;ldquo;display information&amp;rdquo;, in addition to its linter and fixer capabilities. Indeed, I learned recently that it can be configured to use any LSP available locally, which means that I can ask ale to use pyls for linting, instead of flake8 or pylint. The following settings are all we need to make Ale behave like Emacs lsp-mode with its default configuration for Python (pyls + black):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-vim" data-lang="vim"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;g&lt;/span&gt;:&lt;span class="nx"&gt;ale_linters&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; {&lt;span class="s1"&gt;&amp;#39;python&amp;#39;&lt;/span&gt;: [&lt;span class="s1"&gt;&amp;#39;pyls&amp;#39;&lt;/span&gt;]}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;g&lt;/span&gt;:&lt;span class="nx"&gt;ale_fixers&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; {&lt;span class="s1"&gt;&amp;#39;python&amp;#39;&lt;/span&gt;: [&lt;span class="s1"&gt;&amp;#39;black&amp;#39;&lt;/span&gt;]}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Of course, more &lt;a href="https://dev.to/drmason13/configure-neovim-for-rust-development-1fjn"&gt;complex&lt;/a&gt; or &lt;a href="https://phaazon.net/blog/editors-in-2020"&gt;fancy&lt;/a&gt; &lt;a href="https://www.vimfromscratch.com/articles/vim-for-python/"&gt;setups&lt;/a&gt; do exist, but I just want something light which relies on as few packages as possible. Ale does the job, even if it seems slower than Coc or Emacs lsp-mode, at least for the actions I use regularly. The fact that Ale comes as a standalone plugin and relies on external tools when available but has no strong dependencies, like Node in the case of Coc, is really a great asset. Not only does this mean that, from a Vim point of view, we only need to update Ale, but aalso that there&amp;rsquo;s less risk of collision between dependencies, like in Emacs or when using Coc or nvim-lsp with other plugins.&lt;/p&gt;
&lt;p&gt;Regarding C/C++, here&amp;rsquo;s what I use: (still work in progress!)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-vim" data-lang="vim"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;g&lt;/span&gt;:&lt;span class="nx"&gt;ale_c_clang_executable&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;/usr/local/opt/llvm/bin/clang&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;g&lt;/span&gt;:&lt;span class="nx"&gt;ale_c_clangd_executable&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;/usr/local/opt/llvm/bin/clangd&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;g&lt;/span&gt;:&lt;span class="nx"&gt;ale_c_clangd_options&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;--background-index -j=4 -log=error&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I still have to find how to configure &lt;code&gt;cmake&lt;/code&gt; and &lt;a href="https://duckduckgo.com/?t=ffab&amp;amp;q=clang-format&amp;amp;atb=v235-7&amp;amp;ia=web"&gt;clang-format&lt;/a&gt; properly, as well as add &lt;a href="https://github.com/rust-analyzer/rust-analyzer"&gt;rust-analyzer&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The documentation is also gorgeous (even if I find navigating into the help pages a bit tricky compared to Info page). Take a look at the screenshot below to see what I mean:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2020-09-12-08-07-46.png"&gt;
&lt;/figure&gt;</description></item><item><title>September in review</title><link>https://aliquote.org/post/micro-review-016/</link><pubDate>Wed, 09 Sep 2020 15:13:33 +0200</pubDate><guid>https://aliquote.org/post/micro-review-016/</guid><description>&lt;p&gt;Here&amp;rsquo;s the monthly review of interesting things I found while browsing Hacker News, Twitter, or RSS feeds.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://weinholt.se/articles/non-posix-filesystems/"&gt;Non-POSIX file systems&lt;/a&gt; is such a great piece of writing about POSIX and other filesystems, by a prolific Scheme coder.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Multics enabled a superior paradigm for storage management and backups. Xerox Alto allowed a disk structure to be restored even if all metadata blocks had been damaged. Hydra used a capability system to provide a powerful protection mechanism for data. All of these enabled interesting types of functionality that we are missing in POSIX.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I subscribed to &lt;a href="https://twitter.com/svetlyak40wt"&gt;svetlyak40wt&lt;/a&gt;&amp;rsquo;s &lt;a href="https://40ants.com/lisp-project-of-the-day/2020/08/0167-cl-flat-tree.html"&gt;Lisp Project of the Day&lt;/a&gt; during the Summer, and I learned a lot of nice tips about Lisp and existing libraries. For instance, &lt;a href="http://40ants.com/lisp-project-of-the-day/2020/08/0167-cl-flat-tree.html"&gt;cl-flat-tree&lt;/a&gt; is a small Lisp library for working with binary trees.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://nedbatchelder.com//blog/202008/do_a_pile_of_work_better.html"&gt;Do a pile of work better&lt;/a&gt;. Another post by Ned Batchelder, where we learn how Python&amp;rsquo;s &lt;a href="https://docs.python.org/3/library/concurrent.futures.html"&gt;concurrent.futures&lt;/a&gt; module works.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The Neovim TUI experience is really slick, and it remains so fast. Even if I don&amp;rsquo;t load a lot of plugins, it remains by far the fastest text editor available on my Macbook. In addition, spell checking is better than Flyspell, and I believe Ale has nothing to envy to Flycheck. Yet, I spent a significant amount of time configuring my Doom Emacs to offer an enhanced user experience when running in a terminal, and it now start in just under 1.5s, which is great (yeah, I know &lt;code&gt;server-start&lt;/code&gt; &amp;amp; Co). My core Emacs keybindings (via &lt;code&gt;which-key&lt;/code&gt;) are similar to what I use in Neovim, so I am not lost when I switch from one to the other.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Emacs is the only serious program I know which manages to be truly user interface independent, in addition to being platform-independent. Emacs works with graphical toolkits on all major platforms, but also offers a almost-feature-complete text interface. &amp;mdash; &lt;a href="https://lists.gnu.org/archive/html/emacs-devel/2020-09/msg00286.html"&gt;Emacs is very special regarding UIs&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="http://planspace.org/20200902-share_a_tmux_session/"&gt;Share a Tmux session&lt;/a&gt;. Interesting use of the &lt;code&gt;-S&lt;/code&gt; flag to specify a socket. I mostly use Tmux on a remote server, but this is just to benefit from a persistent session and of course multipane facilities.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;These days, I don&amp;rsquo;t write a lot of Stata code. Not a single line of code in 3 months, TBH. However, thanks to a link found in one of &lt;a href="https://andrewpwheeler.com/2020/09/04/notes-on-making-scatterplots-in-matplotlib-and-seaborn/"&gt;Andrew Wheeler&lt;/a&gt;&amp;rsquo;s recent posts&amp;rsquo;, I was reminded that the &lt;a href="http://repec.sowi.unibe.ch/stata/grstyle/"&gt;grstyle&lt;/a&gt; is a very nice approach to customizing the look and feel of Stata graphics. By the way, regarding Python graphing facilities, there&amp;rsquo;s a new one from JetBrains: &lt;a href="https://github.com/JetBrains/lets-plot"&gt;lets-plot&lt;/a&gt;. Apparently, it is intended to be use in JetBrains IDEs or in a Jupyter notebook, but it&amp;rsquo;s quite interesting to know that we have yet another Ggplot-inspired graphical backend in the Python ecosystem.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;A few days ago I learned that there&amp;rsquo;s now a Clojure dataframe library that runs on Spark: &lt;a href="https://github.com/zero-one-group/geni"&gt;geni&lt;/a&gt;. It seems to be a pretty serious project, nicely illustrated and with lot of documentation.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you&amp;rsquo;re interested in TUI and cli environments, you&amp;rsquo;re likely to appreciate the following blog post: &lt;a href="https://xn--rpa.cc/irl/term.html"&gt;everything you ever wanted to know about terminals&lt;/a&gt;. It provides a deep review of &lt;a href="https://invisible-island.net/ncurses/announce.html"&gt;ncurses&lt;/a&gt; and ASCII escape codes, with illustrations in C.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.pixelated-noise.com/blog/2020/09/10/what-spec-is/"&gt;What Clojure spec is and what you can do with it&lt;/a&gt;. It&amp;rsquo;s been a long time since I&amp;rsquo;ve written a script in Clojure. Last year I decided to work with Clojurescript, and then I switched to more traditional Javascript. In the meantime I got interested in Racket and Typescript. But as I still find so many interesting articles about Clojure after more than 10 years of technology watch, I think I should really get into it, especially as it seems to me at the moment the only real candidate language for data science.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Some free discrete maths textbooks by &lt;a href="http://www.math.ucsd.edu/~ebender/"&gt;Ed Bender&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;The main reason I use Neovim on my macbook, beyond its native speed for quick editing of text files, is because (1) I wanted to be more familiar with Vim keybindings for using Emacs with Evil mode more efficiently, and (2) I only use Vim on the Ubuntu workstations I manage to administer at work.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>The unquantified self #14</title><link>https://aliquote.org/post/unquantified-self-014/</link><pubDate>Tue, 08 Sep 2020 20:59:41 +0200</pubDate><guid>https://aliquote.org/post/unquantified-self-014/</guid><description>&lt;p&gt;August was pretty cool as I spent most of my time with my son. We even had a little trip to Bordeaux. But TBH we remain most of the time at home, playing (him) and reading (me). I also had a long strike editing my dot files (Emacs, Vim, Zsh, Fzf, Rg), which ended up a few days ago with me installing Amethyst and Firefox, hence leaving macOS native apps altogether. I mist say that I&amp;rsquo;m pretty happy with my new setup: this is mostly TUI, except for Firefox and some occasional interactions with Transmit or CleanMyMac apps. This remind me of my old days with OS X, when I was compiling all my applications as 64 bits exec (no Fink or Homebrew at this time), and even before when I only had Linux available on my laptop. I&amp;rsquo;m staling my Macbook: This will be Mojave, Doom Emacs (from July 2020 &amp;mdash; I&amp;rsquo;m tired of updating and fixing the little glitches here and there after each upgrade), and some occasional updates on things I mostly care about (LLVM, Lisp, Scheme).&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m back to work after a month off. It hurts, really, since I spent the last 5 months at home, with almost no interaction with the outside world, but that&amp;rsquo;s life. No recommendations were given for people with chronic disease this time: the show must go on and I assume we have to support the economy somehow. I doubt the academic world would contribute anything in this regard, but let&amp;rsquo;s see. Hopefully, it won&amp;rsquo;t take several months before I get efficient again, as was the case after my therapeutic leave. The next few months will be full of Python web app, phylogenetics and molecular evolution.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m currently watching a new TV series, &lt;a href="https://en.wikipedia.org/wiki/Fargo_(TV_series)"&gt;Fargo&lt;/a&gt;, after two weeks without any TV. With my son, we are now watching &lt;a href="https://en.wikipedia.org/wiki/The_Leftovers_(TV_series)"&gt;The Leftovers&lt;/a&gt;, since we are done with &lt;a href="https://en.wikipedia.org/wiki/The_Blacklist_%28TV_series%29"&gt;Black List&lt;/a&gt; and &lt;a href="https://en.wikipedia.org/wiki/Battlestar_Galactica_(2004_TV_series)"&gt;Battlestar Galactica&lt;/a&gt;. I&amp;rsquo;ve read a lot of books this Summer, surely as a consequence of the quarantine: even if we were again allowed to leave our homes and go for walks or go out to bars, I preferred to stay safe at home. Now, I do the same when I&amp;rsquo;m not at work, which means from Friday to Sunday since I&amp;rsquo;m doing remote work on Friday now.&lt;/p&gt;
&lt;p&gt;The site is doing fine, with nearly 50 views per day. I don&amp;rsquo;t really care of the statistics, but it helps knowing if everything is okay. I don&amp;rsquo;t plan to change the design, but I do hope to be able to publish more regular stuff on the blog, and maybe longer articles. I started drafting some new tutorials and handouts, which are listed on the &lt;a href="https://aliquote.org/writings"&gt;Archives&lt;/a&gt;. I love writing, and I need to write down what I learn otherwise I forget everything except the details. Since I&amp;rsquo;m no longer teaching, a large part of my writing activities has been rewired to the blog, but that&amp;rsquo;s not the same kind of writings or typesetting. Now, I&amp;rsquo;m enjoying $\TeX$ again, as well as Org mode in Emacs.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Gary Peacock, Jack DeJohnette &amp;amp; Keith Jarrett • &lt;em&gt;My Foolish Heart&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Monochrome color scheme</title><link>https://aliquote.org/post/monochrome-color-scheme/</link><pubDate>Fri, 04 Sep 2020 18:00:22 +0200</pubDate><guid>https://aliquote.org/post/monochrome-color-scheme/</guid><description>&lt;p&gt;In the &lt;a href="https://aliquote.org/post/amethyst-app"&gt;previous post&lt;/a&gt; I described how I moved to a tiling window manager on macOS (Mojave). In passing, I mentioned the opinionated view of Joshua Stein regarding color scheme, or rather &amp;ldquo;no color&amp;rdquo; scheme. While browsing his Github I found some of his config files, especially his color scheme for Vim. I can confirm that it is just black on white, with occasional highlighting using bold or underline. Up to now, I&amp;rsquo;ve been devising my own color scheme using Doom&amp;rsquo;s macro &lt;code&gt;custom-set-faces!&lt;/code&gt;. I talked about my &lt;a href="https://aliquote.org/post/editor-war/"&gt;dark theme&lt;/a&gt; (Nord) settings two months ago. Recently, I became interested in switching to a light theme, both for my text editor and terminal.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m using the &lt;a href="https://aliquote.org/post/kitty-terminal/"&gt;Kitty&lt;/a&gt; terminal emulator and it is quite easy to customize the appearance of font and colors. I like that ligatures are working right away (I&amp;rsquo;m now using JetBrains Mono). As I didn&amp;rsquo;t want a full white background, I choose a tinted color (&lt;code&gt;#f0eee4&lt;/code&gt;), which means that I need to override default background color when using Emacs Doom themes. Not a big deal, but I prefer the way Vim manages its default background in console mode. Anyway, this worked great and I&amp;rsquo;ve been using my new settings for a week or so. In addition to changing the default theme form dark to light, I also simplified my color scheme and came to something close to a duotone-like color scheme: all but constants (strings and numbers) in black, yellow for region or line highlighting, and red for Flycheck and Flyspell errors.&lt;/p&gt;
&lt;p&gt;Below is a screenshot of my current desktop: Emacs and Vim, side by side, using an almost consistent duotone-like color theme for both.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2020-09-03-13-57-08.png"&gt;
&lt;/figure&gt;
&lt;p&gt;While I was quite happy with these settings, this means I had to override a lot of default font-lock and face settings in Doom Opera Light theme. I know &lt;code&gt;custom-theme-set-faces!&lt;/code&gt; is way better than &lt;code&gt;custom-set-faces!&lt;/code&gt; for that purpose, but the problem really is that I don&amp;rsquo;t need all those colorful features. Here comes the Doom plain theme, which landed on Github a &lt;a href="https://github.com/hlissner/emacs-doom-themes/commit/64b033208d3c2eac33d2b284c4a66eb7bee94c37"&gt;few days ago&lt;/a&gt;, and it is just what I needed to finalize my new color scheme. For the moment, I kept most of the default settings, which happen to be a tinted black and various grey schemes, and just updated the way errors and visual line are highlighted, as well as &amp;ldquo;font-lock&amp;rdquo; for core language elements (all in bold). Also, comments are highlighted using a different color than the base grey used elsewhere to make them standout a little (as suggested by Nikita Tonsky). I left constants (strings and numbers) as is, that is in grey, but maybe I will revert to my old settings at some point. I use almost the same settings for Vim, which means that whatever text editor I decide to use I will get the same visual feedback. Here is how it looks for Emacs Lisp and C files (in terminal mode):&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/2020-09-04-18-31-12.png"&gt;
&lt;/figure&gt;
&lt;small&gt;The error in the C code was introduced deliberately to show the error color code, and this &lt;a href="https://mumble.net/~campbell/tmp/random_real.c"&gt;code&lt;/a&gt; is from Taylor R. Campbell.&lt;/small&gt;&lt;/p&gt;</description></item><item><title>Amethyst tiling window manager</title><link>https://aliquote.org/post/amethyst-app/</link><pubDate>Thu, 03 Sep 2020 13:25:48 +0200</pubDate><guid>https://aliquote.org/post/amethyst-app/</guid><description>&lt;p&gt;I&amp;rsquo;ve been trying another tiling window manager for my laptop (Macbook 12 inch). I already talked about tiling WM for Mac &lt;a href="https://aliquote.org/post/moom-app/"&gt;last year&lt;/a&gt;, and &lt;a href="https://aliquote.org/micro/2020-07-03-10-52-31/"&gt;during the Summer&lt;/a&gt;. At work I have a larger monitor, so tiling windows makes sense. It becomes hard to get anything useful if applications are not using 2/3 of the screen or simply in maximized or fullscreen mode when using the native display of the Macbook. Up to now, I&amp;rsquo;ve been either using Emacs or a terminal spanning 2/3 of my screen, and lately maximized on screen using Moom facilities. This allows for quickly jumping between the apps using the app switcher (&lt;alt&gt;-&lt;tab&gt;), Mission Control or whatever. I usually use fullscreen mode only for mail (but I no longer use Mail app) or web browsing.&lt;/p&gt;
&lt;p&gt;What I tried so far is &lt;a href="https://github.com/szymonkaliski/hhtwm"&gt;hhtwm&lt;/a&gt; (too much of a hassle in terms of customization) and &lt;a href="https://github.com/koekeishiya/yabai/"&gt;yabai&lt;/a&gt; (needs to disable SIP, as well as an additional app to manage keybindings). I don&amp;rsquo;t remember exactly why I didn&amp;rsquo;t like Yabai but I think it also amount to the time I spent installing and customizing it. Overall, I always ended up with maximized windows centered on my screen. Column view (i.e., side by side window) is almost unusable on a 12 inch monitor, and I could always get the same effect using &lt;a href="https://aliquote.org/post/moom-app/"&gt;Moom&lt;/a&gt; alone.&lt;/p&gt;
&lt;p&gt;While browsing &lt;a href="https://jcs.org/"&gt;Joshua Stein&lt;/a&gt;&amp;rsquo;s website, I noticed he has some interesting screenshots of &lt;a href="https://jcs.org/2017/07/14/matebook"&gt;his desktop&lt;/a&gt;. He&amp;rsquo;s running OpenBSD and a tiling WM (i3 or his &lt;a href="https://github.com/jcs/sdorfehs"&gt;own WM&lt;/a&gt;, I don&amp;rsquo;t know), and he seems to be very partial to the idea of using monochrome themes, which does not displease me in fact, especially for writing code or prose, but I like to have colored input/output in my terminal. The zsh &lt;a href="https://github.com/zdharma/fast-syntax-highlighting"&gt;fast-syntax-highlighting&lt;/a&gt; and &lt;a href="https://github.com/zsh-users/zsh-autosuggestions"&gt;zsh-autosuggestions&lt;/a&gt; plugins provide such assistance in editing commands that I wish I learned about them much earlier. With syntax highlighting, they help catch up errors quickly, or simply aid in getting a glance at a complex command. But I&amp;rsquo;m digressing.&lt;/p&gt;
&lt;p&gt;While looking for tiling WMs available for macOS, which was quickly solved after all since there aren&amp;rsquo;t so many, I found that only Amethyst was offering a full native app. I did try it a little while ago, but I found it of little help. I reinstalled it yesterday and it completely changed my mind. First, the app is tiny and works right out of the box: no configuration needed, it sits in the menu bar and we can update the settings within a few mouse clicks, it has all sort of built-in layout with predefined shortcuts that are easy to grasp (the main modifier key combination is &lt;alt&gt;-&lt;shift&gt;, while Kitty uses &lt;ctrl&gt;-&lt;shift&gt;: this is quite handy).&lt;/p&gt;
&lt;p&gt;Below is screenshot of the &amp;ldquo;tall layout&amp;rdquo;, with a main window on the left and everything arranged in row on the right:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2020-09-03-14-12-44.png"&gt;
&lt;/figure&gt;
&lt;p&gt;There are other interesting features: You can activate the &amp;ldquo;focus follows mouse&amp;rdquo;, like in Kitty (or iTerm), create list of selected apps that should stay floating (or, conversely, that should always be tiled), you can configure window margins and screen padding to add extra space around each window like I did in the screenshot above.&lt;/p&gt;
&lt;p&gt;After only two days of use I feel like this is the app I was looking for in combination with &lt;a href="https://aliquote.org/post/kitty-terminal/"&gt;Kitty&lt;/a&gt; and my terminal-mode workflow.&lt;/p&gt;</description></item><item><title>Micro posting in August</title><link>https://aliquote.org/post/micro-08-2020/</link><pubDate>Wed, 26 Aug 2020 10:18:10 +0200</pubDate><guid>https://aliquote.org/post/micro-08-2020/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-08-03&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I really wish we had a front-end to software even half as useful as this in the 21st C, but technology has regressed massively since the &amp;rsquo;80s and &amp;rsquo;90s. Some of the old IDEs, before they became bloated &amp;ldquo;enterprise&amp;rdquo; software (because giant mega-corporations paid for them, not individual programmers, so the IDE makers serve their paymasters), started to slouch towards this kind of usefulness but fast and small. &amp;mdash; &lt;a href="https://mdhughes.tech/2020/04/27/lisp-machines/"&gt;LISP Machines&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-08-03&lt;/a&gt;: I got a revived interest for the BSD world this day. Here&amp;rsquo;s an interesting thread about NetBSD versus others: &lt;a href="https://www.unitedbsd.com/d/90-netbsd-users-why-do-you-use-it-over-freebsd-and-openbsd"&gt;NetBSD users, why do you use it over FreeBSD and OpenBSD?&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-03&lt;/a&gt;: Lovely sister.&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_1231.jpg" alt="flowers"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-03&lt;/a&gt;: &lt;a href="https://github.com/veeral-patel/how-to-secure-anything"&gt;How to Secure Anything&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-03&lt;/a&gt;: &lt;a href="https://streamlink.github.io/players.html"&gt;Streamlink&lt;/a&gt;: Command-line utility that extracts streams from various services and pipes them into a video player of choice.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-03&lt;/a&gt;: &lt;a href="https://www.cyberciti.biz/tips/linux-unix-bsd-openssh-server-best-practices.html"&gt;Top 20 OpenSSH Server Best Security Practices&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-04&lt;/a&gt;: I recently switch to &lt;a href="https://streamlink.github.io"&gt;streamlink&lt;/a&gt; and VLC to watch Twitch streams. Much better than the Electron app on Mac (since the web UI is quite bad actually). VLC further has a &amp;ldquo;stay on top&amp;rdquo; option for the current window which is quite handy.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-04&lt;/a&gt;: In case you&amp;rsquo;re interested in learning Common Lisp on Youtube, I can highly recommend the &lt;a href="https://www.youtube.com/playlist?list=PL2VAYZE_4wRJi_vgpjsH75kMhN4KsuzR"&gt;Little Bits of Lisp&lt;/a&gt; channel by &lt;a href="https://github.com/cbaggers/"&gt;Baggers&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-04&lt;/a&gt;: In the other news, I adopted JetBrains Mono as my defualt font for both iTerm and Emacs, and I replaced my default shell prompt with &lt;a href="https://github.com/romkatv/powerlevel10k"&gt;Powerlevel10k&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-04&lt;/a&gt;: &lt;a href="https://zaiste.net/posts/15-git-commands-you-may-not-know/"&gt;15 Git Commands You May Not Know&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-04&lt;/a&gt;: &lt;a href="https://lfn3.net/2020/08/03/a-gentle-intro-to-assembly-with-rust/"&gt;A gentle intro to assembly with Rust&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-05&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I&amp;rsquo;ve been very surprised and delighted over a number of years now by Microsoft&amp;rsquo;s strong efforts in open source. I understand the skeptics, I was on Slashdot when they tried to sue Linux out of existence and I think only time will tell. I figure MS contributing is better than them hunting Linux distributions for sport. So I was mostly onboard for Microsofts efforts and I&amp;rsquo;ve especially found Visual Studio Code useful. (&amp;hellip;) The entire marketplace is proprietary. &amp;mdash; &lt;a href="https://underjord.io/the-best-parts-of-visual-studio-code-are-proprietary.html"&gt;The best parts of Visual Studio Code are proprietary&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-08-05&lt;/a&gt;: I deleted a bunch of dead stuff on my OS (again): &lt;code&gt;clang8&lt;/code&gt; and &lt;code&gt;gfortran&lt;/code&gt;, probably installed for R, but I don&amp;rsquo;t care since I already have the latest LLVM (10.0) and GCC (10.2) from Homebrew; &lt;a href="https://gpgtools.tenderapp.com"&gt;GPGTools&lt;/a&gt;, since I already have &lt;code&gt;gnupg&lt;/code&gt; installed by Homebrew for Emacs among other things &amp;mdash; it took me some time to reconfigure everything the way it used to work beforehand, well, that&amp;rsquo;s until I realized that there was a separate &lt;code&gt;pinentry-mac&lt;/code&gt; package to store passphrase in OS Keychain. Meanwhile, I installed a FreeBSD image for VirtualBox, just to make sure I&amp;rsquo;ll be ready the day I will have to leave the Mac world unless Big Sur doesn&amp;rsquo;t turn out to be the same kind of catastrophic update Catalina did. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-05&lt;/a&gt;: Using fullscreen or maximied apps with this new &amp;ldquo;enlarged&amp;rdquo; font (JetBrain Mono Regular 13) is much welcome for my poor eyes &amp;mdash; not that I have any visual deficiency, but with age I came to appreciate a larger font size on retina displays. Despite &lt;a href="https://aliquote.org/micro/2020-01-24-16-49-36/"&gt;loving Iosevka&lt;/a&gt; so much, especially for writing prose, I think JetBrain Mono is quite a good font actually. &lt;a href="https://rubjo.github.io/victor-mono/"&gt;Victor Mono&lt;/a&gt; is also nice, IMO. Here&amp;rsquo;s the current top five on my apps:&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-08-05-14-01-02.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-05&lt;/a&gt;: &lt;a href="https://artem.krylysov.com/blog/2020/07/28/lets-build-a-full-text-search-engine/"&gt;Let&amp;rsquo;s build a Full-Text Search engine&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-05&lt;/a&gt;: &lt;a href="https://www.johnbcoughlin.com/posts/floating-point-axiom/"&gt;Taming Floating Point Error&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-05&lt;/a&gt;: &lt;a href="https://github.com/romkatv/zsh4humans"&gt;Zsh for Humans&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-06&lt;/a&gt;: I&amp;rsquo;m slowly removing all unnecessary apps on my Macbook. Just so in the end I&amp;rsquo;ll be living in the dark age of terminal mode. Last removal: &lt;a href="https://aliquote.org/post/reeder-app/"&gt;Reeder&lt;/a&gt;. Since I needed Feedly to sync my feeds between my Macbook and my iPhone, I just find it easier to read blog posts on Feedly directly.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-06&lt;/a&gt;: Just started using &lt;a href="https://github.com/defunkt/gist"&gt;gist&lt;/a&gt; from the command-line. This includes almost everything I ever wanted.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-06&lt;/a&gt;: &lt;a href="https://www.alexgallego.org/emacs/productivity/2016/01/16/emacs-no-modeline.html"&gt;Emacs: No modeline&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-06&lt;/a&gt;: &lt;a href="https://www.reddit.com/r/emacs/comments/hzhkk1/what_simple_key_remapping_has_transformed_your/"&gt;What simple key re-mapping has transformed your life?&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-06&lt;/a&gt;: &lt;a href="http://gitready.com"&gt;git ready&lt;/a&gt;: learn git one commit at a time. &lt;code&gt;#git&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-08&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_1232.jpg" alt=""&gt;&lt;small&gt;The missing slice of pizza.&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-08&lt;/a&gt;: 38°C today. Same temperature for tomorrow. These are hot days. Hopefully I&amp;rsquo;m finally done revising all my cli-specific settings: iTerm and zsh, Git, Emacs, Vim. Once the heat wave passes it will be time to do more interesting stuff.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-08&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If I think for 10 minutes and then start typing, I want the typing to take the shortest time possible so I can get back to thinking. Any time I spend typing is an interruption that I want to minimize so I can keep my train of thought. &amp;mdash; &lt;a href="https://stevelosh.com/blog/2010/09/coming-home-to-vim/"&gt;Coming Home to Vim&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-08-08&lt;/a&gt;: &lt;a href="https://rgoswami.me/posts/some-sol-sr2/"&gt;A Short Guide to Statistical Rethinking²&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-08&lt;/a&gt;: &lt;a href="https://news.ycombinator.com/item?id=24091707"&gt;Ask HN: What feature did you find after years of using macOS?&lt;/a&gt;.That I can rely on a terminal with Apple BSD variant and do most of my work. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-08&lt;/a&gt;: &lt;a href="https://john-millikin.com/first-impressions-of-rust"&gt;First Impressions of Rust&lt;/a&gt;. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-08&lt;/a&gt;: &lt;a href="https://rgoswami.me/posts/org-mathematica/"&gt;Using Mathematica with Orgmode&lt;/a&gt;: It works like a charm! There&amp;rsquo;s more to see, e.g., &lt;a href="https://rgoswami.me/posts/jupyter-orgmode/"&gt;Replacing Jupyter with Orgmode&lt;/a&gt; (because who likes Jupyter notebook?). &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-13&lt;/a&gt;: &lt;a href="https://bevyengine.org/news/introducing-bevy/"&gt;Bevy&lt;/a&gt; is a refreshingly simple data-driven game engine and app framework built in Rust. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-13&lt;/a&gt;: &lt;a href="https://blog.janestreet.com/commas-in-big-numbers-everywhere/"&gt;Commas in big numbers everywhere: An OpenType adventure&lt;/a&gt;. See also &lt;a href="https://thume.ca/numderline/"&gt;Numderline&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Unfortunately some apps that support basic ligatures don&amp;rsquo;t support the fancy shaping features I use, including Sublime Text 3 and iTerm2. Other apps like Emacs and most terminals don&amp;rsquo;t support shaping at all.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-08-13&lt;/a&gt;: &lt;a href="http://kripken.github.io/llvm.js/demo.html"&gt;Run LLVM Assembly In Your Browser&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-13&lt;/a&gt;: &lt;a href="https://github.com/bfontaine/clj"&gt;clj&lt;/a&gt; is a collection of functions to work with lazy iterators in Python. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-14&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_1253.jpg" alt="fleurs"&gt;&lt;small&gt;Bouquet de fleurs du jour.&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-14&lt;/a&gt;: Look, I&amp;rsquo;m back to Elfeed (Feedly only allows 100 feeds for a free account). &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-08-14-21-04-59.png" alt="emacs"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-14&lt;/a&gt;: We are done with &lt;a href="https://www.imdb.com/title/tt2741602/"&gt;Black List&lt;/a&gt; (Season 7). This really is a great series, even if the rhythm is rather irregular and the tension and suspense is running out of steam in the last few seasons.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-14&lt;/a&gt;: &lt;a href="https://briancallahan.net/blog/20200812.html"&gt;Can we do better than our C compiler?&lt;/a&gt;. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-14&lt;/a&gt;: &lt;a href="https://github.com/google/differential-privacy"&gt;Differential Privacy&lt;/a&gt; algorithms by Google.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-14&lt;/a&gt;: &lt;a href="https://github.com/Byron/gitoxide"&gt;Gix&lt;/a&gt; is a command-line interface (CLI) to access git repositories. Still wip apparently, but it looks like a great initiative.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-14&lt;/a&gt;: &lt;a href="http://math.ucr.edu/home/baez/permutations/"&gt;Random Permutations&lt;/a&gt;. &lt;code&gt;#maths&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-14&lt;/a&gt;: &lt;a href="https://llazarek.com/2020/04/reference-management-with-org-mode.html"&gt;Reference management with Org mode&lt;/a&gt;.&lt;br&gt;My workflow is apparently simpler, thanks to &lt;code&gt;ivy-bibtex&lt;/code&gt;, but overall I agree that Org is well suited for such kind of tasks. I only use Markdown for light stuff (e.g., Github READMEs) and blogging, but I guess I will switch to using Org mode exclusively soon or later. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-15&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The number of people who have told me that MDN is a wiki, therefore the community will keep it up to date tells me two things. People do not get the value of professional tech writers. Folk are incredibly optimistic about what &amp;ldquo;the community&amp;rdquo; will do for free. &amp;mdash; &lt;a href="https://www.quirksmode.org/blog/archives/2020/08/i_love_mdn_or_t.html"&gt;I Love MDN, or the cult of the free in action&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-08-15&lt;/a&gt;: For unknown reasons &amp;mdash; but maybe I have noticed it earlier, iTerm seems to be draining my battery a lot. Switching again to &lt;a href="https://sw.kovidgoyal.net/kitty/index.html#"&gt;kitty&lt;/a&gt; for some days, to see how it goes. My past impressions were quite good, so hopefully I will have a pretty terminal emulator. Looks very fast so far. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-15&lt;/a&gt;: &lt;a href="http://aungthurhahein.github.io/Another-MacOS-Setup/"&gt;Another macOS setup&lt;/a&gt;. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-16&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Fundamentally, a REPL merges usage and extension of a system in a single interface. This merger has been important in providing easy extensibility to the end programmers in many programming languages. &amp;mdash; &lt;a href="https://lepisma.xyz/2020/01/30/repl-conversations/index.html"&gt;A REPL for Conversations&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-08-16&lt;/a&gt;: Going back reading some Twitter threads after 2 weeks&amp;hellip;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-16&lt;/a&gt;: &lt;a href="https://labuladong.gitbook.io/algo-en/"&gt;Crack LeetCode, not only how, but also why&lt;/a&gt; (via HN).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-16&lt;/a&gt;: &lt;a href="https://ohshitgit.com"&gt;Oh Shit, Git!?!&lt;/a&gt;. &lt;code&gt;#git&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-16&lt;/a&gt;: &lt;a href="https://lepisma.xyz/2017/10/28/ricing-org-mode/index.html"&gt;Ricing up Org Mode&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-18&lt;/a&gt;: &lt;a href="https://cse.buffalo.edu/faculty/atri/courses/coding-theory/book/web-coding-book.pdf"&gt;Essential Coding Theory&lt;/a&gt; (PDF, 391 pp.).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-18&lt;/a&gt;: &lt;a href="https://graphicallinearalgebra.net"&gt;Graphical Linear Algebra&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-18&lt;/a&gt;: &lt;a href="https://alexene.dev/2020/08/17/webassembly-without-the-browser-part-1.html"&gt;Webassembly Without The Browser&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-19&lt;/a&gt;: I feel just so sad reading this kind of news: &lt;a href="https://lowendmac.com/2020/dear-apple-your-services-are-no-longer-required/"&gt;Dear Apple: Your Services Are No Longer Required&lt;/a&gt;. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-19&lt;/a&gt;: Trying out &lt;a href="https://www.borgbackup.org"&gt;Borg&lt;/a&gt; as a quick backup solution for my dot files and maildir. It turns out that compression mode can be optimized a bit by playing with the settings (for my maildir, &lt;code&gt;--compression auto,lzma,6&lt;/code&gt; increased compression rate by about 30%). I&amp;rsquo;m looking forward to see how it goes with incremental updates.&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-08-19-07-50-40.png" alt="emacs"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-19&lt;/a&gt;: &lt;a href="https://kowainik.github.io/posts/haskell-mini-patterns"&gt;Haskell mini-patterns handbook&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-20&lt;/a&gt;: And we are now done with the goal of writing 500 posts!&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-08-20-20-39-59.png" alt="posts"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-20&lt;/a&gt;: &lt;a href="https://rotemtam.com/2020/08/13/python-ast/"&gt;Analyzing Python Code with Python&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-20&lt;/a&gt;: &lt;a href="https://blog.darklang.com/first-thoughts-on-rust-vs-ocaml/"&gt;First thoughts on Rust vs OCaml&lt;/a&gt;. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-20&lt;/a&gt;: &lt;a href="http://ethics.fast.ai"&gt;Practical Data Ethics&lt;/a&gt; is such an amazing online course.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-21&lt;/a&gt;: &lt;a href="https://github.com/vaexio/vaex"&gt;vaex&lt;/a&gt;: Out-of-Core DataFrames for Python. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-22&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I think we are in the middle of a pendulum swing where some creators are moving away from proprietary platforms and taking more control of their relationship with their audiences. And I think a lot of audience is trying to remove themselves from engagement-driven timesink platforms that don&amp;rsquo;t respect their users. The majority will still be on YouTube and all the socials. But the movement seems significant. And I&amp;rsquo;m all about it. &amp;mdash; &lt;a href="https://underjord.io/the-strong-technologies.html"&gt;The Strong Technologies&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-08-22&lt;/a&gt;: &lt;a href="https://algotree.org/algorithms/"&gt;Algotree&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-22&lt;/a&gt;: &lt;a href="https://begriffs.com/posts/2019-07-19-history-use-vim.html"&gt;History and effective use of Vim&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-22&lt;/a&gt;: &lt;a href="http://morrick.me/archives/8945"&gt;Mac OS Big Sur logbook (intro)&lt;/a&gt;. &lt;code&gt;#apple&lt;/code&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I don’t believe in upgrading your devices for the sake of upgrading, but I believe that in this day and age one has to be technologically flexible.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;At this point in time, I don&amp;rsquo;t think I will buy a new Macbook or even upgrade to Big Sur (I skipped Catalina too), even if I like the revived design of most of Apple apps. I work with a terminal emulator and Safari most of the time, I use Preview for reading PDF files, and Marked to render Markdown files; I barely have any use of the Finder these days. Sort of I could live in another BSD machine without noticing it, except for the browser.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-22&lt;/a&gt;: &lt;a href="https://www.well-typed.com/blog/2020/08/memory-fragmentation/"&gt;Understanding Memory Fragmentation&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-22&lt;/a&gt;: &lt;a href="https://github.com/drduh/macOS-Security-and-Privacy-Guide"&gt;macOS-Security-and-Privacy-Guide&lt;/a&gt;: This guide is a collection of techniques for improving the security and privacy of a modern Apple Macintosh computer (&amp;ldquo;MacBook&amp;rdquo;) running a recent version of macOS (formerly known as &amp;ldquo;OS X&amp;rdquo;). &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-23&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Functional programming is a radical and elegant attack on the whole enterprise of writing programs. It&amp;rsquo;s very different from the &amp;ldquo;do this and then do that” programming mentality. You have to rewire your brain in quite a different way. For a long time it was well understood theoretically—there was lots of stuff about semantics and it had these very deep foundations in logic. But in terms of a practical programming medium it seemed like a completely virgin field. &amp;mdash; &lt;a href="https://www.cs.cmu.edu/~popl-interviews/peytonjones.html"&gt;Interview with Simon Peyton-Jones&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-08-23&lt;/a&gt;: TIL that we can use &lt;a href="https://orgmode.org/manual/Literal-Examples.html"&gt;references and labels&lt;/a&gt; in Org babel!&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;You can also add a ‘-r’ switch which removes the labels from the source code. With the ‘-n’ switch, links to these references are labeled by the line numbers from the code listing. Otherwise links use the labels with no parentheses.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-08-23&lt;/a&gt;: &lt;a href="https://people.gnome.org/~federico/blog/rust-stable-abi.html"&gt;Rust does not have a stable ABI&lt;/a&gt;. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-24&lt;/a&gt;: So far, it&amp;rsquo;s been 3 weeks that I ran Emacs in terminal only. No worry, I&amp;rsquo;m fine: I just started diving into plain TeX again!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-24&lt;/a&gt;: &lt;a href="https://www.cs.utexas.edu/ftp/garbage/cs345/schintro-v14/schintro_142.html#SEC271"&gt;A Simple Scheme Compiler&lt;/a&gt;. &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-24&lt;/a&gt;: &lt;a href="https://github.com/BlueFlo0d/xwwp/tree/xwwp-ace-dev"&gt;Emacs xwidget-webkit enhancement suite&lt;/a&gt;. This is a great alternative to EWW, IMO, and &lt;code&gt;xwidget&lt;/code&gt; was my default setting for the past few months. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-24&lt;/a&gt;: &lt;a href="https://www.math3ma.com/blog/topology-book"&gt;Topology: A Categorical Approach&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-24&lt;/a&gt;: &lt;a href="https://optics.byu.edu/clsfile"&gt;Typesetting a Textbook&lt;/a&gt;. Nice Latex class for Tufte-like textbook! &lt;code&gt;#tex&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-08-25&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A freak historical accident. AT&amp;amp;T Labs, where it was developed, was forbidden under its anti-trust settlement from commercializing products unrelated to its core telecom business. Hence, Unix was licensed very cheaply to universities, including UC Berkeley, which subsequently built one of the more influential branches of the Unix family tree—BSD. Apparently, AT&amp;amp;T classified Unix as industrial waste for tax purposes when licensing it! &amp;mdash; &lt;a href="https://blog.vivekhaldar.com/post/617189040564928512/how-unix-won"&gt;How Unix Won&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;</description></item><item><title>Switching to Firefox</title><link>https://aliquote.org/post/switching-to-firefox/</link><pubDate>Wed, 26 Aug 2020 08:57:26 +0200</pubDate><guid>https://aliquote.org/post/switching-to-firefox/</guid><description>&lt;p&gt;I recently installed the Developer Edition of Firefox (80, updated to 81.0b2 after a few hours of use), and this is the first time I use something else than Safari. So far it&amp;rsquo;s been a refreshing experience. Of course, I know that Safari is better, like is the Finder or Mail.app or whatever that ships with your Macbook, because these applications are so tightly integrated into the system and optimized like no other apps. Anyway, as I don&amp;rsquo;t plan to upgrade my OS any time soon (and probably never; when the OS die, I&amp;rsquo;ll switch to a BSD distro), and I deactivate most system updates, Safari will soon or later become out of date, both in terms of security and with regard to web standards and developer tools. I don&amp;rsquo;t write a lot of HTML and CSS but I sometimes need to build some websites for work. Having some good development tools at hand is always a good idea. Safari&amp;rsquo;s development tools were always enough for what I usually have to do, but I feel that I will be involved in more fine-tuned projects in the next few years, so better to have the best tools available &amp;mdash; and no (sorry but not so sorry), using Chrome is not an option.&lt;/p&gt;
&lt;p&gt;What I learned is that continuity works even of Firefox is not installed on my iPhone, which is great actually since we cannot redefine the default browser on iOS &amp;mdash; and Firefox isn&amp;rsquo;t a great pretender on iOS either. I cannot manage my passwords using system Keychain, and I don&amp;rsquo;t want to use other password manager so I had to fill in my passwords for every sites that require authentification, which is quite boring. However, this allows me to save some additional passwords in my GPG-encrypted personal manager so that I won&amp;rsquo;t depend on Keychain if I switch to a different OS. I can now watch webm videos in my browser, which was not possible with Safari (despite Apple&amp;rsquo;s claims that Safari is good at reading web video). The builtin PDF viewer is also great. Adblocking and tracker filters are good actually &amp;mdash; there&amp;rsquo;s even a reporting tool, I just added the DuckDuckGo Essentials and HTTPS Everywhere plugins, but I&amp;rsquo;m sure there are other interesting plugins.&lt;/p&gt;
&lt;p&gt;I also like the &lt;code&gt;ctrl-tab&lt;/code&gt; shortcut to switch between tabs: when used briefly, we navigate between most recent used tabs, while when pressed for a longer time, a preview of all opened tabs (like macOS app switcher, &lt;code&gt;alt-tab&lt;/code&gt;)` is shown. The same shortcut is used by Kitty for navigating tabs, which is quite handy. Finally, when you open Twitch, the sound is automagically deactivated &amp;mdash; this is a nice idea. The download manager and the notification regarding blocked or deactivated resources from untrusted websites is also a great addition.&lt;/p&gt;
&lt;p&gt;In passing I also reinstalled Skim.app to preview PDF documents. Not that Preview isn&amp;rsquo;t a good fit but there&amp;rsquo;s a little annoying feature of Safari that I&amp;rsquo;ll be struggling with for the past few months: You definitely cannot force Preview to open in full-screen mode (i.e., maximized on screen, not in a different space). I even added a shortcut in my Zsh config to open PDF from the command-line using Skim:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;alias&lt;/span&gt; -s &lt;span class="nv"&gt;pdf&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;open -a skim&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now I&amp;rsquo;m happily having only two opened applications on my Macbook (not counting Finder which I don&amp;rsquo;t use but don&amp;rsquo;t want to hide): Kitty terminal and Firefox. And most importantly, there are no more Apple-specific applications that are part of my workflow anymore. I could switch to a Linux or BSD distro and I wouldn&amp;rsquo;t miss anything essential for my daily work. The true BSD era has probably reached an end years ago, I don&amp;rsquo;t know if Big Sur or the ARM arch will provide a &lt;a href="http://morrick.me/archives/8945"&gt;renewed interest&lt;/a&gt; in macOS, or what it will even be called in few years. However, I feel like this all come to an end as far as I&amp;rsquo;m concerned. I really loved the design of OS X, I like the Mojave OS and my current setup, but I&amp;rsquo;m tired of losing little by little old useful features after each new upgrade. That&amp;rsquo;s it: I&amp;rsquo;ll stay on Mojave as long as I can, and then I quit.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;And that’s exactly the downside: your software will be more than happy to install a broken, changed, reduced, functionally no longer equivalent, spyware, malware, data loss inducing or outright dangerous piece of software right over the top of the one that you were using happily until today. More often than not automatic updates are not done with the interest of the user in mind. They are abused to the point where many users - me included - would rather forego all updates (let alone automatic ones) simply because we apparently can not trust the party on the other side of this transaction to have our, the users, interests at heart. &amp;mdash; &lt;a href="https://jacquesmattheij.com/why-johnny-wont-upgrade/"&gt;Why Johnny Won&amp;rsquo;t Upgrade&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;</description></item><item><title>Back in Mac</title><link>https://aliquote.org/post/back-in-mac/</link><pubDate>Thu, 20 Aug 2020 18:09:22 +0200</pubDate><guid>https://aliquote.org/post/back-in-mac/</guid><description>&lt;p&gt;A collection of screenshots of scientific utilities taken long ago (&amp;lt; 2010) on one of my older Macbook.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/pub/screenshots/Emacs_iPython.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/pub/screenshots/Emacs_iPython.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/pub/screenshots/maxima.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/pub/screenshots/maxima.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/pub/screenshots/ggobi.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/pub/screenshots/ggobi.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/pub/screenshots/gnuplot.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/pub/screenshots/gnuplot.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/pub/screenshots/Grace.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/pub/screenshots/Grace.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/pub/screenshots/ggobi.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/pub/screenshots/ggobi.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/pub/screenshots/Haskell.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/pub/screenshots/Haskell.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/pub/screenshots/imaxima.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/pub/screenshots/imaxima.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/pub/screenshots/lush.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/pub/screenshots/lush.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/pub/screenshots/pspp.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/pub/screenshots/pspp.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/pub/screenshots/plotutils.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/pub/screenshots/plotutils.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/pub/screenshots/xgobi.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/pub/screenshots/xgobi.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</description></item><item><title>Kitty terminal emulator</title><link>https://aliquote.org/post/kitty-terminal/</link><pubDate>Sun, 16 Aug 2020 16:33:24 +0200</pubDate><guid>https://aliquote.org/post/kitty-terminal/</guid><description>&lt;p&gt;I switched recently to the &lt;a href="https://sw.kovidgoyal.net/kitty/"&gt;kitty&lt;/a&gt; terminal emulator. I have been using iTerm for so many years that I hardly believe I made the switch, but here we go. The thing that motivated trying an alternate terminal emulator is that I work a lot more remotely nowadays, and I&amp;rsquo;m no longer plugged 24/24 so I use the battery. This Macbook is 4 years old, but the battery is in good state as far as I can tell. However, I noticed that iTerm was draining the battery in a very unpleasant manner: I only had 3 hours left instead of 6 to 8 hours, depending on the average load on my computer.&lt;/p&gt;
&lt;p&gt;I don&amp;rsquo;t see any buggy feature, the application looks very polished and it is responsive. Compared to iTerm, everything is configurable through a single config file (&lt;code&gt;.config/kitty/kitty.conf&lt;/code&gt;), which is great, and the only missing feature is hot reloading of the config. I haven&amp;rsquo;t had any difficulty in running it as my terminal emulator all day long.&lt;/p&gt;
&lt;p&gt;On the Pros side:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Things get more complicated when using the mouse in Emacs, e.g. I cannot simply point and click, but that&amp;rsquo;s not really a problem since I decided to learn efficient keybindings to move into a buffer. However, I can now paste any mouse selection using standard macOS shortcut or Vim &lt;code&gt;p&lt;/code&gt;, which is quite great after all. This was not possible in iTerm although it worked well in a shell.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The application is fast, very fast, especially for scrolling or moving between opened tabs. Memory consumption is okay apparently, even with 3 tabs opened and a running instance of Emacs.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Managing split windows is a joy compared to iTerm as the layout can be changed within a few key press. The hot key for most operations is Ctrl-Shift, which is convenient as they are right under my left hand.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The documentation is good and it is relatively easy to update the default settings thanks to the sample config file. I reviewed every items in something like one hour and I was able to finalize my default config by that time. Fonts support is excellent (including ligatures and special options like Retina settings for Fira Code or ligature variations for Iosevka, even if I&amp;rsquo;m now happy with JetBrains Mono &amp;mdash; much better for my eyes).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Also, kitty works both on Mac and Linux which means I could eventually keep using the same configuration (pending some minor changes specific to the OS), like is the case for Vim or Emacs, if I were to change my primary laptop.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;There are many other features that I have not yet studied in detail, including remote access and interaction with external tools. I noticed that kitty allows to display image and this is a &lt;a href="https://sw.kovidgoyal.net/kitty/kittens/icat.html"&gt;built-in feature&lt;/a&gt;, unlike iTerm where you have to install the shell integration tools. More to the point, it is possible to render Python and Julia plots inline&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Internally, this backend is somewhat based on matplotlib&amp;rsquo;s IPython support: it&amp;rsquo;s a hybrid of image and GUI backend types. It works by using matplotlib&amp;rsquo;s Agg backend to render the plot, and then calls kitty&amp;rsquo;s icat to place the rendered image on your terminal. This means that plotting works as expected, but the image drawn to your terminal isn&amp;rsquo;t interactive and animations aren&amp;rsquo;t supported. &amp;mdash; &lt;a href="https://github.com/jktr/matplotlib-backend-kitty"&gt;matplotlib-backend-kitty&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Emacs Org and Tufte handout</title><link>https://aliquote.org/post/emacs-org-tufte-handout/</link><pubDate>Sat, 08 Aug 2020 17:43:34 +0200</pubDate><guid>https://aliquote.org/post/emacs-org-tufte-handout/</guid><description>&lt;p&gt;I&amp;rsquo;ve been using Pandoc as my &lt;a href="https://aliquote.org/post/org-workflow/"&gt;main backend&lt;/a&gt; for exporting Org documents to PDF, mainly because it was convenient way to manage bibliographic entries using Markdown markup. It is pretty nice and easy to setup. Moreover, it works with HTML output too using a template indicated either in the document header or using &lt;code&gt;org-pandoc-options-for-html5&lt;/code&gt;. Problem is that it does not work with Babel, or at least I couldn&amp;rsquo;t export the block results (mostly R, Lisp and Python code) at some point, and I switched back to the default HTML or PDF exporter. First off, unless you give it a proper CSS file, you won&amp;rsquo;t get much from the HTML exporter. Same for the PDF output: the default Latex class is basically the &amp;ldquo;article&amp;rdquo; format. In both cases, without Pandoc it becomes harder to manage bibliographic entries and I&amp;rsquo;m looking for a lightweight solution whereby we do not have to use header options or inline Latex commands. I want my Org file to look as mauch as possible like an Org file, without extra markup. I don&amp;rsquo;t mind writing &lt;code&gt;\cite&lt;/code&gt; commands, though.&lt;/p&gt;
&lt;p&gt;I have used &lt;code&gt;org-ref&lt;/code&gt; &lt;a href="https://aliquote.org/post/notes-taking-workflow/"&gt;in the past&lt;/a&gt;, but I wanted a simpler solution, which also does not involve &lt;a href="https://aliquote.org/post/org-and-bibtex/"&gt;ox-bibtex&lt;/a&gt; which I found too limited. Furthermore, this time I was interested in using the Tufte handout template. I used it some years ago for my handout before looking for more standard layout with nice typographic rendering. I am aware of the &lt;a href="https://github.com/tsdye/tufte-org-mode"&gt;Tufte Org Mode&lt;/a&gt;, and I should probably be using the &lt;a href="http://joostkremers.github.io/ebib/"&gt;ebib&lt;/a&gt; package as well. But I&amp;rsquo;m happy with my minimal setup which relies on &lt;code&gt;ivy-bibtex&lt;/code&gt;. As I said in previous posts, Ivy really is a booster in my workflow, especially when taking notes, for I can quickly navigate into my file system or project, à la &lt;a href="https://github.com/junegunn/fzf"&gt;fzf&lt;/a&gt;, while having my Bibtex database available at any time. Also I don&amp;rsquo;t mind if I don&amp;rsquo;t get all the features from Tufte handout, like unnumbered margin notes.&lt;/p&gt;
&lt;p&gt;Here is what I finally ended up adding my init file:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-emacs-lisp" data-lang="emacs-lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;eval-after-load&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;ox-latex&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;add-to-list&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;org-latex-classes&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;tufte-handout&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;\\documentclass[nobib]{tufte-handout}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\usepackage[style=authoryear-comp,autocite=footnote]{biblatex}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\addbibresource{/Users/chl/org/references.bib}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; --%&amp;lt;--- snip ---&amp;gt;%--
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\usepackage{nicefrac}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; \\usepackage{units}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; [NO-DEFAULT-PACKAGES]
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; [EXTRA]&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;\\section{%s}&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;\\section*{%s}&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;\\subsection{%s}&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;\\subsection*{%s}&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;\\subsubsection{%s}&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;\\subsubsection*{%s}&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;\\paragraph{%s}&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;\\paragraph*{%s}&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;\\subparagraph{%s}&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;\\subparagraph*{%s}&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This defines a new template where we define the main document class and the packages we want to use. In this case, we do not want the default packages but we allow to define additional settings via a header option like &lt;code&gt;#+LATEX_EXTRA:&lt;/code&gt;. Also, it is worth noting that the &lt;code&gt;nobib&lt;/code&gt; option for the document class is the &lt;a href="https://tex.stackexchange.com/a/45949"&gt;right way&lt;/a&gt; to avoid &lt;code&gt;biblatex&lt;/code&gt; clashes with the &lt;code&gt;natbib&lt;/code&gt; package. (I tried setting &lt;code&gt;natbib=true&lt;/code&gt; in the options for the &lt;code&gt;biblatex&lt;/code&gt; package, but it didn&amp;rsquo;t work.)&lt;/p&gt;
&lt;p&gt;Next, we just have to define this template as our default Latex class and indicate how to compile the file(s). We can use either &lt;code&gt;texi2pdf&lt;/code&gt; or &lt;code&gt;latexmk&lt;/code&gt;. I use either one depending on my mood, and I no longer have to bother with multiple runs of &lt;code&gt;pdflatex&lt;/code&gt; or &lt;code&gt;lualatex&lt;/code&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-emacs-lisp" data-lang="emacs-lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;font-lock-add-keywords&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;org-mode&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;\\\\autocite{.+?}&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="nv"&gt;font-lock-keyword-face&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;setq&lt;/span&gt; &lt;span class="nv"&gt;org-latex-default-class&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;tufte-handout&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;org-latex-pdf-process&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;latexmk -pdf -bibtex-cond -f -outdir=%o %f&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;small&gt;The &lt;code&gt;bibtex-cond&lt;/code&gt; option allows to skip the bib(la)tex step if no &lt;code&gt;bib&lt;/code&gt; file is used.&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;Note that a default config file for &lt;code&gt;latexmk&lt;/code&gt; can be used if it is available in the &lt;code&gt;$HOME&lt;/code&gt; directory. I have these settings in mine (&lt;code&gt;~/.latexmkrc&lt;/code&gt;):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;@default_files &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;main.tex&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$clean_ext&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;bbl nav out snm&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$latex&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;latex -interaction=nonstopmode -shell-escape&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$pdflatex&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;pdflatex -shell-escape -interaction=nonstopmode&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$pdf_previewer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;open -a Preview&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That&amp;rsquo;s it. Here&amp;rsquo;s the output for a simple memo I started writing for myself:&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2020-08-08-18-29-26.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2020-08-08-18-29-26.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2020-08-08-18-30-05.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2020-08-08-18-30-05.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</description></item><item><title>Running Emacs in a terminal</title><link>https://aliquote.org/post/emacs-in-terminal/</link><pubDate>Thu, 06 Aug 2020 14:01:09 +0200</pubDate><guid>https://aliquote.org/post/emacs-in-terminal/</guid><description>&lt;p&gt;I know this has been debated at large on the web, and there are already &lt;a href="comments"&gt;excellent&lt;/a&gt; &lt;a href="https://www.reddit.com/r/emacs/comments/5lh1fg/any_glaringly_large_disadvantages_to_emacs_in_nw/"&gt;threads&lt;/a&gt; on Reddit regarding the use of Emacs in terminal vs. GUI mode. Also, there are compelling arguments about why it is probably better to run Emacs in a GUI: generally this amounts to displaying images, using OS specific or extra keybindings not available in tty (unless you use xterm, rxvt or iTerm, but it&amp;rsquo;s cumbersome to remap everything), but there are probably some other subtleties that I never noticed besides &lt;code&gt;posframe&lt;/code&gt; which is quite great. At &lt;a href="https://aliquote.org/post/emacs-15-years-later/"&gt;one point&lt;/a&gt; I was using Emacs almost exclusively from iTerm, then I got bored or something like that and switched to GUI mode only. I guess my main complaints were the lack of support for 24-bit colors (while iTerm supports them), which means tweaking your default theme or adding a lot of if/switch statements.&lt;/p&gt;
&lt;p&gt;Later I discovered that you can have a 24-bit mode for terminal applications, and you just have to prefix the invocation of your preferred command with &lt;code&gt;env TERM=xterm-24bit&lt;/code&gt;, once you have installed the corresponding &lt;code&gt;terminfo&lt;/code&gt; stuff.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; So far so good. I can have the same rendering of font and color in GUI and terminal mode. That&amp;rsquo;s all good. And this makes a huge difference! What else? Well, I think it depends on the intended usage. For quick editing of text files, including writing micro-posts or Git commit messages, I tend to use Neovim. Startup time, ease of text manipulation, you know. When working on projects, I use Emacs, exclusively. I know I have dired and vterm available withing a few key presses, and that&amp;rsquo;s really all I need in addition to Emacs editing facilities. I should note that as I use Doom emacs, many things are already configured the right way (linter, checker, spelling, project management, etc.).&lt;/p&gt;
&lt;p&gt;Sometimes, I feel lazy or in retro mode and I only want to run a Terminal on my Mac. Surely I cannot browse the web as easily as when using Safari or &lt;code&gt;xwidget&lt;/code&gt; in Emacs, but that&amp;rsquo;s okay, especially when I don&amp;rsquo;t need to browse the internet. So, to answer the original question I think it all depends: If you want a full-fledged Emacs, you should probably run it in GUI mode, so that you will also enjoy reading your PDF files right into a separate buffer when editing your Org file. On the contrary, if you only want to quickcly revise an existing project, or create one from scratch, while staying at your preferred Terminal application, &lt;code&gt;emacs -nw&lt;/code&gt; is quite good actually. As a bonus you get font ligatures for free under iTerm!&lt;/p&gt;
&lt;p&gt;When in GUI mode, I have a lot of keybindings involving the command key on my Macbook. This is handy since I&amp;rsquo;m used to use, e.g., &lt;code&gt;⌘-F&lt;/code&gt; to search for some expression, or &lt;code&gt;⌘-S&lt;/code&gt; or &lt;code&gt;⌘-W&lt;/code&gt; to save or close a buffer (which are not really buffers in other macOS applications, but that&amp;rsquo;s another issue). Finally I made them all available via the leader key (&lt;code&gt;SPC&lt;/code&gt;) in Doom, so that &lt;code&gt;s-&amp;amp;&lt;/code&gt;, which means &amp;ldquo;switch to the next workspace&amp;rdquo; in GUI mode, becomes &lt;code&gt;SPC-&amp;amp;&lt;/code&gt; when I run Emacs in a Terminal. By the way, &lt;code&gt;which-key&lt;/code&gt; is such a nice add-on, I wish it exists long before when I started learning more advanced Emacs shortcuts. Indeed I added a lot of custom shortcuts under my leader key, see below.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2020-08-06-15-08-11.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Overall, I&amp;rsquo;m starting to appreciate Evil mode, especially motion, visual mode, and the &lt;code&gt;z&lt;/code&gt; and &lt;code&gt;g&lt;/code&gt; prefixes. I&amp;rsquo;m still learning, though. at this point, I would say I use 50% of Vim keybindings, in addition to &lt;code&gt;which-key&lt;/code&gt; shortcuts, when I&amp;rsquo;m not simply moving around using the arrow keys with or without the &lt;code&gt;fn&lt;/code&gt; key (yes I know, this is bad, we have &lt;code&gt;hjkl&lt;/code&gt; and &lt;code&gt;C-u&lt;/code&gt;/&lt;code&gt;C-d&lt;/code&gt;). However, I tend to be slowly moving to using Vim keybindings exclusively, especially when running Emacs in a Terminal.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2020-08-16]&lt;/small&gt;&lt;br&gt;
Doom Emacs now includes &lt;a href="https://github.com/hlissner/doom-emacs/tree/develop/modules/os/tty"&gt;specific settings&lt;/a&gt; for running Emacs in a Terminal.
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Unfortunately, I don&amp;rsquo;t remember where exactly I got mine, but this was on Stack Overflow a few years ago.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>August in review</title><link>https://aliquote.org/post/micro-review-015/</link><pubDate>Tue, 04 Aug 2020 07:19:53 +0200</pubDate><guid>https://aliquote.org/post/micro-review-015/</guid><description>&lt;p&gt;A little bit early, but I wanted to record recent bookmarks from my RSS reader as well as various links stored in my Safari reading list.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Loup Vaillant has a nice post on his website: &lt;a href="http://loup-vaillant.fr/articles/crypto-is-not-magic"&gt;Cryptography is not Magic&lt;/a&gt;. Beside references provided therein, I also found this recent handbook on applied cryptography: &lt;a href="http://toc.cryptobook.us"&gt;A Graduate Course in Applied Cryptography&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.stephendiehl.com/posts/crypto.html"&gt;The Haskell Elephant in the Room&lt;/a&gt;: Another nice article by Stephen Diehl on the current state of the Haskell ecosystem in relation especially to cryptocurrency.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Cryptocurrency is not a traditional business in any sense. The basic economic structure of a business is a group of people who exchange their goods or services for money. For example, your traditional software consulting business sells your time and expertise to clients to write software for them. Your ecommerce website provides a marketplace to sell physical goods. Your local coffee shops sells you wifi under the guise of coffee. However cryptocurrency companies do not produce anything, instead they offer synthetic financial products which are marketed to the generic public as investments. These “investments” are not tied directly to economic activity, these are what economists call non-productive assets. The value of these assets is only determined by what other people are willing to pay for them. This has created a giant ecosystem in which products aren’t traded on any investment fundamentals but on the hope to sell them off to a “greater fool”.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://leancrew.com/all-this/2020/07/number-regexes-are-hard/"&gt;Number regexes are hard&lt;/a&gt;, or how to take into account n-dash and the like when parsing numbers.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://irreal.org/blog/?p=9035"&gt;The Right Dictionary and How to Get It&lt;/a&gt;: So now, I also have the Webster&amp;rsquo;s dictionary available on my Mac. Be sure to read the companion blog post, &lt;a href="http://jsomers.net/blog/dictionary"&gt;You’re probably using the wrong dictionary&lt;/a&gt;, and don&amp;rsquo;t worry: it will take some time to build the final dictionary as advertised in the blog post.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;We got a few updates the last few weeks: &lt;a href="https://github.blog/2020-07-27-highlights-from-git-2-28/"&gt;Highlights from Git 2.28&lt;/a&gt; with Bloom filters, &lt;a href="https://blog.racket-lang.org/2020/08/racket-v7-8.html"&gt;Racket v7.8&lt;/a&gt;, and &lt;a href="https://julialang.org/blog/2020/08/julia-1.5-highlights/"&gt;Julia 1.5 Highlights&lt;/a&gt;. It&amp;rsquo;s probably time to switch to Racket on Chez since the next release will default to it, and I definitely need to start hacking on Julia again.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I&amp;rsquo;m lagging behind regarding Kubernetes and Co. This recent article highlight the benefit of using &lt;a href="https://k3s.io"&gt;k3s&lt;/a&gt; to run a &lt;a href="https://notes.eatonphil.com/a-single-node-kubernetes-cluster-without-virtualization-or-a-container-registry.html"&gt;single-node Kubernetes cluster without virtualization or a container registry&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I subscribed to a few RSS feeds that deal almost exclusively with Haskell or related functional PLs (ML, OCaml). Now I learned that there&amp;rsquo;s a &lt;a href="https://haskell.pl-a.net"&gt;Haskell Planetarium&lt;/a&gt;, which I find quite handy for other-than-blog feeds.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Haki Benita provides some useful tips in his recent post &lt;a href="https://hakibenita.com/sql-tricks-application-dba"&gt;Some SQL Tricks of an Application DBA&lt;/a&gt;, especially regarding the use of indexes.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;For Python development, I use almost exclusively use Emacs and its LSP packages, and I have Blake and Flake8 set as the default programs for linting and formatting. Sometimes I think it might be a better idea to delegate those tasks to specific task in a Makefile, but it is also possible to rely on Git hooks, see &lt;a href="https://ljvmiranda921.github.io/notebook/2018/06/21/precommits-using-black-and-flake8/" title="
"&gt;Automate Python workflow using pre-commits: black and flake8&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Even if this is not my day job, I love reading about compiler, debugger and operating systems. This post &lt;a href="https://blog.carlosgaldino.com/writing-a-file-system-from-scratch-in-rust.html"&gt;Writing a file system from scratch in Rust&lt;/a&gt; provides a clear overview of file systems, i.e. how directories and files are represented, and how indirect pointers can be used.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I try to learn more Vim (for Doom Emacs and Neovim). Here are some of my recent reads: &lt;a href="https://www.freecodecamp.org/news/learn-linux-vim-basic-features-19134461ab85/"&gt;Why I love Vim: It’s the lesser-known features that make it so amazing&lt;/a&gt;, &lt;a href="http://robertames.com/files/vim-editing.html"&gt;Efficient Editing With vim&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;We aim to improve our ability to engineer artificial intelligence, reverse-engineer natural intelligence, and deploy applications that increase our collective intelligence and well-being.&lt;br&gt;We do this by integrating probabilistic inference, generative models, and Monte Carlo methods into the building blocks of software, hardware, and other computational systems. &amp;mdash; &lt;a href="http://probcomp.csail.mit.edu"&gt;MIT Probabilistic Computing Project&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;</description></item><item><title>Apple 12-inch is not a good fit</title><link>https://aliquote.org/post/apple-12-inch-planned-obsolescence/</link><pubDate>Mon, 03 Aug 2020 20:28:54 +0200</pubDate><guid>https://aliquote.org/post/apple-12-inch-planned-obsolescence/</guid><description>&lt;p&gt;Incidentally, I came across &lt;a href="https://www.howtogeek.com/682300/why-i-still-use-an-old-powerpc-mac-in-2020/"&gt;this post&lt;/a&gt; on HN. I miss the time I had a 12-inch iBook (and a Blackberry too).&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Because I bought an old 12-inch iBook from 2003 that runs a long-obsolete version of Mac OS X on the steam of an 800 MHz G4 PowerPC processor. While this machine might be somewhat long-in-the-tooth, it’s surprisingly useful as a daily workhorse.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I wish I still had mine. Since I&amp;rsquo;m not so much interested in very old version of OS X, I would simply install a BSD distro (surely NetBSD or FreeBSD if that could be working), and see how things goes. Ironically, this laptop was my first move toward Macintosh stuff, after 5 years using Linux exclusively. It was a wonderful piece of technology at that time, even if it was quite thick by the current standards. I&amp;rsquo;m too lazy to search for old screenshots of my OS Desktop in 2005, but I can remember that I was running &lt;a href="https://aliquote.org/post/jogging-memory/"&gt;Aquamacs&lt;/a&gt; at that time. Intel processors were a great move, and the 32 to 64 bits transition an even bigger one, but the design of this laptop was so nice. How sad it is that we no longer have a keyboard of such quality.&lt;/p&gt;
&lt;p&gt;My current Macbook is &lt;a href="https://aliquote.org/post/setup-2018/"&gt;4 years old&lt;/a&gt; and it served me well after several OS upgrades. It&amp;rsquo;s probably my preferred laptop after all those years. Surely we can argue. It has only one USB-C, and I wouldn&amp;rsquo;t mind having at least another one instead of having to buy additional dongles. However, it&amp;rsquo;s thin enough to pretend to be an iPad pro at the same time, and Apple needs to make money anyway. I don&amp;rsquo;t care. Also, it is not a beast in its category (Windows-based alternative have better specs, IMO) and it is not geared toward heavy computing of any kind. But it works great for casual stuff and lightweight programming. The retina display is gorgeous, and far better than the 1024x768 resolution you get on the iBook (without retina support of course).&lt;/p&gt;
&lt;p&gt;I would have liked the specs to be more inflated but you have to deal with it and above all realize what this machine is made for, and above all how it can be put to good use. So you want a more comfortable desktop: just connect an external 4K monitor (sadly, I believe the 12-inch Macbook doesn&amp;rsquo;t support dual external display). Want a more powerful machine: ssh to an external server. Nowadays, I mostly use my Macbook as a proxy to other machines for heavy computational stuff, and I keep using it as a standalone laptop connected to an external monitor and a Magic Keyboard. When I&amp;rsquo;m at home, it&amp;rsquo;s just a 12-inch laptop that is able to process my emails, update this website, waste my time on the internet and have lazy programming activities using a variety of PLs.&lt;/p&gt;
&lt;p&gt;Sadly, the 12-inch Macbook has been discontinued, like its predecessor.&lt;/p&gt;</description></item><item><title>Micro posting in July</title><link>https://aliquote.org/post/micro-07-2020/</link><pubDate>Mon, 27 Jul 2020 09:03:05 +0200</pubDate><guid>https://aliquote.org/post/micro-07-2020/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-07-01&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Additional resistance towards plugins seems to be some kind of purist animosity against straying away from some core set of Vim functionality. But if you’re using Vim, you’re already in a subset of people who demand that editing text be fast and efficient, so it’s like a group of savants arguing about which is the most eccentric. The set of people that use a movement plugin like EasyMotion or vim-sneak will argue that they’re more efficient than vanilla Vim users, and vanilla Vim users will argue that they’re more efficient than non-Vim users, and so on. The argument will be moot when we can control computers with our brains anyway. &amp;mdash; &lt;a href="https://statico.github.io/vim3.html"&gt;Vim after 15 years&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-07-01&lt;/a&gt;: &lt;a href="https://pragmaticpineapple.com/how-did-vim-become-so-popular/"&gt;How Did Vim Become So Popular&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-01&lt;/a&gt;: &lt;a href="https://nhplace.com/kent/PS/Lambda.html"&gt;More than just words&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-03&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Here’s a common piece of advice from people who create things: to make better things, make more things. Not only does it give you constant practice at making things, but it gives you more chances at lucking into making a good thing. &amp;mdash; &lt;a href="https://nedbatchelder.com/blog/202006/2500.html"&gt;2500&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-07-03&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;It’s kind of a people mapping/profiling system that attempts to connect the dots. Not all the data in the database is accurate, but it’s efficient. &amp;mdash; &lt;a href="https://forklog.media/how-to-defend-yourself-against-scammers-corporations-and-government-hackers-perspective/"&gt;How to Defend Yourself Against Scammers, Corporations, and Government: Hacker’s Perspective&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-07-03&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Now we have established what I believe email is, let’s look at some of the problems with email. To me, the main problems are threefold: (1) Spam, (2) Privacy, (3) Workflow management. &amp;mdash; &lt;a href="https://kevq.uk/email-is-not-broken/"&gt;Email Is Not Broken&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-07-03&lt;/a&gt;: I&amp;rsquo;m trying &lt;a href="https://github.com/neoclide/coc.nvim"&gt;coc&lt;/a&gt; with Neovim. So far it looks great. Now, I learned that there&amp;rsquo;s a &lt;a href="https://github.com/neovim/nvim-lsp"&gt;&amp;ldquo;native&amp;rdquo; plugin&lt;/a&gt; for LSP in neovim. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-03&lt;/a&gt;: Ok, so I just tried out &lt;a href="https://github.com/koekeishiya/yabai/"&gt;yabai&lt;/a&gt;. While this looks like a great WM, unfortunately it does not really support i3 &lt;a href="https://i3wm.org/docs/userguide.html#_changing_the_container_layout"&gt;stacking and tabbing&lt;/a&gt; features &amp;mdash; at least &lt;a href="https://github.com/koekeishiya/yabai/issues/203"&gt;for the moment&lt;/a&gt; (see also this more &lt;a href="https://github.com/koekeishiya/yabai/issues/337"&gt;recent update&lt;/a&gt;), which (I believe) would be the most interesting options for small Retina displays. Update: I reinstalled the HEAD version and tried the &amp;ldquo;stack&amp;rdquo; layout, which looks like a simple fullscreen display, not really stacking à la i3wm.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-03&lt;/a&gt;: This is so f$*ing crazy that I would just love testing it for 5&amp;rsquo; on my Macbook: &lt;a href="https://www.youtube.com/watch?v=AdwhjIg_Xe4"&gt;yabai macOS Tiling Window Manager Demonstration&lt;/a&gt; (Youtube). Still, I strongly believe that tiling WM are great for larger displays than a 12&amp;quot; one. Well, it&amp;rsquo;s still tempting, if only to solve the problems inherent in Spaces and floating windows.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-03&lt;/a&gt;: &lt;a href="https://tails.boum.org/index.en.html"&gt;Tails&lt;/a&gt; is a portable operating system that protects your privacy and helps you avoid censorship. (via Irreal)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-03&lt;/a&gt;: &lt;a href="https://blog.kdheepak.com/three-built-in-neovim-features.html"&gt;Three built-in neovim features&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-03&lt;/a&gt;: &lt;a href="https://www.admiralbumblebee.com/programming/2020/01/04/Six-months-VS-Code.html"&gt;What I learned from 6 months with VS Code&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-03&lt;/a&gt;: &lt;a href="http://eradman.com/entrproject/"&gt;entr&lt;/a&gt;: Run arbitrary commands when files change.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-05&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;But there is one language that seems to inspire a peculiar universal reverence: Lisp. Keyboard crusaders that would otherwise pounce on anyone daring to suggest that some language is better than any other will concede that Lisp is on another level. Lisp transcends the utilitarian criteria used to judge other languages, because the median programmer has never used Lisp to build anything practical and probably never will, yet the reverence for Lisp runs so deep that Lisp is often ascribed mystical properties. &amp;mdash; &lt;a href="https://twobithistory.org/2018/10/14/lisp.html"&gt;How Lisp Became God&amp;rsquo;s Own Programming Language&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-07-05&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Hack: Trial and error is the only way we learn anything. &amp;mdash; &lt;a href="http://stormrider.io/ninety-pct.html"&gt;Unix rules for life&lt;/a&gt;. (via Irreal)&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-07-05&lt;/a&gt;: It looks like &lt;a href="https://support.apple.com/en-us/HT210192"&gt;new fonts&lt;/a&gt; released by Apple are mostly reserved for 10.14+ users; sadly, the &lt;a href="https://developer.apple.com/sf-symbols/"&gt;SF Symbols 2&lt;/a&gt; are Catalina only.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2022-11-08]&lt;/small&gt;&lt;br&gt;
Unfortunately, the tweet with ID 1277515850027798528 has been deleted.
&lt;/div&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-07-05&lt;/a&gt;: &lt;a href="https://imaginary.org/snapshots"&gt;Snapshots of modern mathematics from Oberwolfach&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-06&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Hosting your own email server is not easy and requires your full dedication. And with many upcoming trusted and privacy friendly email services, it may not always be the right tool for the job. &amp;mdash; &lt;a href="https://yarmo.eu/post/selfhost-email-drawbacks"&gt;Selfhost email… But should you?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-07-06&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I believe in the privacy and control of data that comes from community supported services, self-hosting, and a less corporate internet. &amp;mdash; &lt;a href="http://dctrud.sdf.org"&gt;dctrud @ sdf.org&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-07-06&lt;/a&gt;: TIL about the &lt;a href="http://guides.dataverse.org/en/latest/developers/unf/index.html"&gt;Universal Numerical Fingerprint&lt;/a&gt;. R package on &lt;a href="https://cran.r-project.org/web/packages/UNF/index.html"&gt;CRAN&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-06&lt;/a&gt;: &lt;a href="https://proxy.vulpes.one/gopher/thelambdalab.xyz/1/projects/elpher"&gt;A gopher/gemini client for GNU Emacs&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-06&lt;/a&gt;: &lt;a href="https://www.reddit.com/r/emacs/comments/hjj16g/announcement_lspmode_70_released/"&gt;lsp-mode 7.0 released&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-07&lt;/a&gt;: &lt;a href="https://manpages.bsd.lv/history.html"&gt;History of UNIX Manpages&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-09&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In 1994, there were 3,000 websites. In 2019, there were estimated to be 1.7 billion, almost one website for every three people on the planet. Not only has the number of websites exploded, the weight of each page has also skyrocketed. Between 2003 and 2019, the average webpage weight grew from about 100 KB to about 4 MB. &amp;mdash; &lt;a href="https://alistapart.com/article/webwaste/"&gt;Webwaste&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-07-09&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Notebooks shine when performing quick, interactive, ex- ploratory analysis, but these features also encourage sloppy coding practices that make it difficult to transition notebooks to production. &amp;mdash; &lt;a href="https://web.eecs.utk.edu/~azh/pubs/Chattopadhyay2020CHI_NotebookPainpoints.pdf"&gt;What’s Wrong with Computational Notebooks?&lt;/a&gt; (PDF)&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-07-09&lt;/a&gt;: &lt;a href="https://dbeaver.io"&gt;DBeaver&lt;/a&gt;: Free multi-platform database tool for developers, database administrators, analysts and all people who need to work with databases.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-09&lt;/a&gt;: &lt;a href="https://github.com/MilesMcBain/esscss"&gt;Emacs Speaks Statistics Config Share Space&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-09&lt;/a&gt;: &lt;a href="https://mattsegal.dev/how-to-read-django-docs.html?utm_campaign=Django%2BNewsletter&amp;amp;utm_medium=web&amp;amp;utm_source=Django_Newsletter_30"&gt;How to find what you want in the Django documentation&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-09&lt;/a&gt;: &lt;a href="https://calogica.com/r/rstan/2020/07/05/season-pass-hierarchical-modelng-r-stan-brms.html"&gt;Multi-level Modeling in RStan and brms (and the Mysteries of Log-Odds)&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-09&lt;/a&gt;: &lt;a href="https://rethinkdb.com"&gt;RethinkDB&lt;/a&gt;: The open-source database for the realtime web.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-10&lt;/a&gt;: Apparently, &lt;a href="https://uglyduck.ca/blog-anonymously/"&gt;anonymity&lt;/a&gt; is a thing.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-10&lt;/a&gt;: I finally agreed with myself on the color theme that I will use in the coming months.
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2020-07-10-08-10-12.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2020-07-10-08-10-12.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2020-07-10-08-16-25.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2020-07-10-08-16-25.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;small&gt;(It&amp;rsquo;s entirely based on Nord theme, with fuzzy stuff removed.)&lt;/small&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-10&lt;/a&gt;: Magit lets you reword a previous commit message so easily (compared to interactive rebasing solutions that are suggested all over StackOverflow). In a magit status buffer, just &lt;code&gt;r w&lt;/code&gt;, select the commit, fix it, then &lt;code&gt;C-c C-c&lt;/code&gt;. This is even better than the &lt;a href="https://emacs.stackexchange.com/a/22565"&gt;earlier solution&lt;/a&gt; offered by the author. Interactive rebasing is also a joy. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-07-08-21-43-54.png" alt="emacs"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-10&lt;/a&gt;: &lt;a href="https://nyxt.atlas.engineer"&gt;Nyxt browser&lt;/a&gt;: Be productive on the Internet.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-12&lt;/a&gt;: Private networks made easy using &lt;a href="https://tailscale.com"&gt;Tailscale&lt;/a&gt; (see &lt;a href="https://hackernoon.com/private-networks-how-tailscale-works-xxlb3v6i"&gt;how it works&lt;/a&gt;). I already subscribed to NordVPN, which does the job well when it comes to broadcast anonymous connections. Unfortuantely, it looks like the only way to get it is through Google or M$.&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-07-12-20-30-33.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-12&lt;/a&gt;: TIL there&amp;rsquo;s something like Keybase that&amp;rsquo;s not totally Keybase (now part of the Zoom security sphere if I remember correctly): &lt;a href="https://keyoxide.org"&gt;Keyoxide&lt;/a&gt;. The &lt;a href="https://yarmo.eu/about"&gt;author&lt;/a&gt; has a very nice website, btw.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-12&lt;/a&gt;: &lt;a href="https://mightyapp.com"&gt;Mighty&lt;/a&gt;: Is this the future of Chrome?&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-12&lt;/a&gt;: &lt;a href="https://www.garron.blog/posts/webmentiond-working.html"&gt;Webmentiond&lt;/a&gt;. An interesting series of links regarding webmentions and the indie web.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Webmentions allow blogs to send message to each other when there is a link in the pinging one pointing to the linked one, the linked one may display that mention at the end of the page, thus creating some form of conversation.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-07-13&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_1218.jpg" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-13&lt;/a&gt;: &lt;a href="https://www.quantamagazine.org/the-math-of-social-distancing-is-a-lesson-in-geometry-20200713/"&gt;The Math of Social Distancing Is a Lesson in Geometry&lt;/a&gt;. A nice discussion with several illustrations of circular and hexagonal packing.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-14&lt;/a&gt;: &lt;a href="https://devblogs.microsoft.com/python/announcing-pylance-fast-feature-rich-language-support-for-python-in-visual-studio-code/"&gt;Announcing Pylance: Fast, feature-rich language support for Python in Visual Studio Code&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-14&lt;/a&gt;: &lt;a href="https://samtay.github.io/posts/first-foray-into-rust"&gt;My first foray into Rust&lt;/a&gt;. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-16&lt;/a&gt;: &lt;a href="https://willamette.edu/~fruehr/haskell/evolution.html"&gt;The Evolution of a Haskell Programmer&lt;/a&gt;. See also &lt;a href="https://erkin.party/blog/200715/evolution/"&gt;The evolution of a Scheme programmer&lt;/a&gt; (or &lt;a href="https://gist.github.com/lwhjp/ba74b14f6a5eefa9c7fb"&gt;Factorials in Racket&lt;/a&gt;).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-19&lt;/a&gt;: &lt;a href="https://danlark.org/2020/06/14/128-bit-division/"&gt;Optimizing 128-bit Division&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-19&lt;/a&gt;: &lt;a href="https://petevilter.me/post/datalog-typechecking/"&gt;Turning the IDE Inside Out with Datalog&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-20&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Answering the age-old debate: HTML or plaintext emails? Both! &amp;mdash; &lt;a href="https://github.com/begriffs/mimedown"&gt;Markdown to multipart MIME&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-07-20&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In this essay, I explore the virtues of graphs, algebra, types, and show how these concepts can help us reason about programs. I propose a computational primitive based on graph signal processing, linking software engineering, graphs, and linear algebra. &amp;mdash; &lt;a href="http://breandan.net/2020/06/30/graph-computation/"&gt;Computation graphs and graph computation&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-07-22&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;There is commonality shared among all, or at least most, of these programming languages, and the Lisp hackers recognize and appreciate that commonality – the characteristics that make a programming language a Lisp. Homoiconic syntax, powerful metaprogramming facilities, and editor support that, in my opinion, is unparalleled. &amp;mdash; &lt;a href="http://jakob.space/blog/thoughts-on-lisps.html"&gt;The Many Faces of an Undying Programming Language&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-07-22&lt;/a&gt;: &amp;gt; These days I mostly use Emacs on my laptop. Sure, there’s all that stuff in the background. But in terms of applications I actually launch, I’d say I mostly use just Emacs. &amp;mdash; &lt;a href="https://alexschroeder.ch/wiki/2020-07-16_Emacs_everything"&gt;Emacs everything&lt;/a&gt;Same here.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-22&lt;/a&gt;: &lt;a href="https://www.andrewdenty.com/blog/2020/07/01/a-visual-comparison-of-macos-catalina-and-big-sur.html"&gt;A visual comparison of macOS Catalina and Big Sur&lt;/a&gt;. Despite some criticisms I read here and there, I must admit that the look&amp;rsquo;n feel of the latest release of macOS is quite pleasant. But why did Apple designers decided to update the core UI elements (like window layout for the Finder, Notes or Preview, etc.) leaving the left &amp;ldquo;gray&amp;rdquo; navigation panel untouched on most apps (iTunes and the like)? &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-22&lt;/a&gt;: &lt;a href="https://andreyorst.gitlab.io/posts/2020-04-06-c-needs-a-better-syntax/"&gt;C Needs Better Syntax and Macros&lt;/a&gt;. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-22&lt;/a&gt;: &lt;a href="https://github.com/willghatch/racket-rash"&gt;Rash&lt;/a&gt;: The Reckless Racket Shell. &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-23&lt;/a&gt;: Logistic regression is not fundamentally a classification algorithm.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The problem arises from logistic regression often being taught as a “classification” algorithm in the machine learning world. I was personally not taught this way– I learned from econometricians that you can use either probit or “logit” as general linear models in the event you want to estimate on a binary target variable, and that these models calculate probabilities. Thinking about logistic regression as a probability model easily translates to the classification case, but the reverse simply does not seem to be true. &amp;mdash; &lt;a href="https://ryxcommar.com/2020/06/27/why-do-so-many-practicing-data-scientists-not-understand-logistic-regression/"&gt;Why Do So Many Practicing Data Scientists Not Understand Logistic Regression?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-07-23&lt;/a&gt;: Slowly going back to my unread feeds in Reeder.app. Today is &lt;a href="http://morrick.me/archives/8916"&gt;After WWDC 2020: bittersweet Mac&lt;/a&gt;. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-23&lt;/a&gt;: &lt;a href="https://ryxcommar.com/2019/07/14/on-moving-from-statistics-to-machine-learning-the-final-stage-of-grief"&gt;On Moving from Statistics to Machine Learning, the Final Stage of Grief&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-23&lt;/a&gt;: &lt;a href="https://rpsychologist.com/lmm-slope-missingness"&gt;Why linear mixed-effects models are probably not the solution to your missing data problems&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-24&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Nick Cave &amp;amp; The bad Seeds, &lt;em&gt;The Abattoir Blues Tour&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-24&lt;/a&gt;: Draw &lt;a href="https://github.com/FdelMazo/cl-aristid"&gt;Lindenmayer Systems&lt;/a&gt; with Common LISP. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-24&lt;/a&gt;: On Git.- &lt;a href="https://github.com/ck3g/git-best-practices"&gt;Git: Best Practices&lt;/a&gt;- &lt;a href="https://www.toptal.com/git/tips-and-practices"&gt;Git Best Practices and Tips by Toptal Developers&lt;/a&gt;- &lt;a href="https://victoria.dev/blog/git-commit-practices-your-future-self-will-thank-you-for/"&gt;Git commit practices your future self will thank you for&lt;/a&gt;- &lt;a href="http://sethrobertson.github.io/GitBestPractices/"&gt;Commit Often, Perfect Later, Publish Once: Git Best Practices&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-24&lt;/a&gt;: &lt;a href="https://lptk.github.io/programming/2019/10/15/simple-essence-y-combinator.html"&gt;The Y Combinator Explained in Python&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-07-26&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;R packages can be just a way to organise code, nothing more. By following a certain structure and a few rules we get to benefit from a whole bunch of tools designed just for packages. &amp;mdash; &lt;a href="https://mdneuzerling.com/post/data-science-workflows/"&gt;Data Science Workflows&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-07-26&lt;/a&gt;: TIL about &lt;a href="https://bboxtype.com/typefaces/FiraGO/#!layout=specimen"&gt;FiraGO&lt;/a&gt;. Fira is certainly my second preferred Sans (and Code) font after Iosevka.&lt;br&gt;&lt;/p&gt;</description></item><item><title>Recently</title><link>https://aliquote.org/post/recently-july-2020/</link><pubDate>Thu, 23 Jul 2020 21:41:33 +0200</pubDate><guid>https://aliquote.org/post/recently-july-2020/</guid><description>&lt;p&gt;I just finished reading a &lt;a href="https://www.manueluberti.eu//real-life/2020/07/16/digital-minimalism-2/"&gt;recent post&lt;/a&gt; by Manuel Uberti, in my RSS reeder.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The problem is not the tool one uses to collect updates, of course. The problem is how pervasive they had become. I felt irresistibly attracted to the news provided by my collection of RSS entries, pulled into my Elfeed buffer over and over again. But was it worth it? How many times I was just marking an entry as read before reading it fully? This can be very subjective, sure, and the beauty of an update speaks more about my taste in RSS feeds than the actual content. Not to mention the simple fact that one could just learn to set their priorities and schedule feed-checking at precise times.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Incidentally, I happened to expunge the long list of unread posts that were sitting in my Reeder.app. I&amp;rsquo;ve been a slow reader the last two months, mostly because I needed to focus on &amp;ldquo;immediate work to do&amp;rdquo;, and of course cooking and groceries for my son who sayed at home during most of the quarantine days and afterwards. That being said, RSS feeds are now my main digital sources of information, in addition to Hacker News. Last week I uninstalled the Twitter app from my iPhone. I&amp;rsquo;ve been using Twitter exclusively from my phone the last 10 years or so, and it&amp;rsquo;s been a hard decision. But I&amp;rsquo;m okay with that, as well as &lt;a href="https://aliquote.org/post/leaving-social-media/"&gt;other deletions&lt;/a&gt; from my accounts. It&amp;rsquo;s been months and months that I no longer enjoyed getting into Twitter, other than causal checking of French accounts I started following 1 or 2 years ago. Last week, I noticed that one guy I followed from the beginning was about to leave. The other ones I followed all along during the last 10 years are no longer active either. Let&amp;rsquo;s stop that. So, no, I will not stop consulting my RSS reader right now, and I&amp;rsquo;ll be skipping content here and there, depending on my mood.&lt;/p&gt;
&lt;p&gt;Other than that, I discovered &lt;a href="https://andreyorst.gitlab.io"&gt;Andrey Orst&lt;/a&gt;&amp;rsquo;s blog a few days ago. There are many interesting posts on &lt;a href="https://andreyorst.gitlab.io/posts/2020-05-10-making-emacs-tabs-look-like-in-atom/"&gt;Emacs&lt;/a&gt;, &lt;a href="https://andreyorst.gitlab.io/posts/2020-04-29-text-editors/"&gt;text editors&lt;/a&gt; and &lt;a href="https://andreyorst.gitlab.io/posts/2020-01-27-on-schemes-dots/"&gt;Scheme programming&lt;/a&gt;. I must confess that I tried his suggestions for native tab (&lt;code&gt;tab-line&lt;/code&gt; mode in Emacs 27+) and it looks pretty nice. I usually don&amp;rsquo;t care about tabs as long as I have handy keyboard shortcuts for switching between buffers in text editors. Since I use Doom Emacs, this is quite immediate using, e.g., &lt;code&gt;persp-switch-to-buffer&lt;/code&gt;. However, it&amp;rsquo;s nice to have a native solution and not to have to rely on external packages (like &lt;a href="https://github.com/ema2159/centaur-tabs"&gt;centaur-tabs&lt;/a&gt;)! Another post that attracts my attention was &lt;a href="https://www.admiralbumblebee.com/programming/2020/01/04/Six-months-VS-Code.html"&gt;What I learned from 6 months with VS Code&lt;/a&gt;. The author provides a fair overview of VS Code, and I would only disagree with his remark on the Emacs side: &amp;ldquo;Emacs does not have a proper terminal.&amp;rdquo; Now that there&amp;rsquo;s &lt;a href="https://github.com/akermu/emacs-libvterm"&gt;libvterm&lt;/a&gt;, there really is no reason to mess up with term (or even Eshell), and you get a fully functional terminal emulator right into Emacs.&lt;/p&gt;
&lt;p&gt;I started reading some books on Vim, Typescript and Haskell this month. I realize that the Epub format offers a far better experience in full screen mode on my Macbook, and that synchronization via my iCloud account let me switch over to my iPhone when I&amp;rsquo;m away from my computer. I&amp;rsquo;m now in the process of filling my Books.app with electronic books that I bought from O&amp;rsquo;Reilly long ago to replace the PDF versions. The only minor issue is that I need to find a way to tell &lt;a href="https://github.com/tmalsburg/helm-bibtex"&gt;ivy-bibtex&lt;/a&gt; to index those Epub versions as well.&lt;/p&gt;
&lt;p&gt;Finally, I&amp;rsquo;ve been following some coders on Twitch lately &amp;mdash; apparently, after &lt;a href="https://noopkat.com/projects/"&gt;Suz Hinton&lt;/a&gt; who started two years ago, the Science &amp;amp; Technology category exploded this year and we now have a bunch of hackers &lt;a href="post/live-coding/"&gt;live streaming&lt;/a&gt;. I soon became a fan of &lt;a href="https://strager.net/essays.html"&gt;Matthew Glazar&lt;/a&gt;&amp;rsquo;s pedagogical approach, and I already learned lot of useful tips and tricks on Vim, Git and Python.&lt;/p&gt;</description></item><item><title>Fresh MacBook</title><link>https://aliquote.org/post/fresh-macbook/</link><pubDate>Fri, 17 Jul 2020 21:35:59 +0200</pubDate><guid>https://aliquote.org/post/fresh-macbook/</guid><description>&lt;p&gt;I got a fresh Macbook.&lt;/p&gt;
&lt;p&gt;No, just kidding. It&amp;rsquo;s just that I wiped my hard drive clean and recovered 60 GB of free space. It&amp;rsquo;s not that I really need space on my hard drive, but you know what it&amp;rsquo;s all about: digital minimalism and all that stuff. So I spent a few moments every two days during the past two weeks to cleanup old stuff and remove unused or dead dependencies on my Macbook, which still runs macOS Mojave by the way. Although I&amp;rsquo;m only using Emacs and Safari, and sometimes iTerm for ssh stuff, for the time being, I feel like it will be hard to switch entirely to a Linux distro. I love Mac software and hardware, and especially that particular Macbook 12″ (early 2016).&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Time is valuable commodity.&lt;br&gt; I use a Mac primarily because it saves me time.&lt;br&gt; A Mac also provides access OS X&amp;rsquo;s Unix internals to do high-quality research and software development. This is why I recommend to my graduate students that they switch to Apple. &amp;mdash; &lt;a href="http://matt.might.net/articles/switching-to-apple-macintosh-from-linux-or-windows/"&gt;Tips and software for Mac users&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I know close to nothing about the future of Apple products, especially since they are switching to ARM-based processors, and iOS-like look&amp;rsquo;n feel. What I know for sure is that macOS apps are pretty much unified and UIs are consistent (you&amp;rsquo;ll probably know what I mean if you experiment a bit with copy-pasting on a Linux machine). That being said, I can accept working under a different OS, but that means even more restrictions. Even if I&amp;rsquo;m just using Emacs and Safari, I know I can still use other Mac apps if I change my mind. I get my job done using text-based only workflows, that&amp;rsquo;s great after all. It&amp;rsquo;s been more than 15 years that I use to use Emacs to write R code and Latex or Markdown reports. No need for RStudio or TexShop or whatever. And I should feel lucky compared to Vim folks because Emacs GUI can display PDF and image files, process my incoming emails, etc. But I&amp;rsquo;m digressing I guess.&lt;/p&gt;
&lt;p&gt;Back to the &amp;ldquo;refreshing stage:&amp;rdquo; Beside cleaning iTunes cache and literally all cache files I could possibly find in my &lt;code&gt;~/Library&lt;/code&gt; folder, I also deleted the following: Clojure (&lt;code&gt;~/.m2&lt;/code&gt;) and Node (&lt;code&gt;.npm&lt;/code&gt; why did I have such a mess since I also have a folder plenty of packages located at &lt;code&gt;/usr/local/lib/node-modules&lt;/code&gt;) stuff, various masked config files in my &lt;code&gt;$HOME&lt;/code&gt; directory that were no longer in use, cargo packages that can easily be compressed using &lt;code&gt;cargo cache --autoclean&lt;/code&gt;, large attachments and unwanted messages in my maildir, PDF files larger than 10 Mo in my books and papers folder, repositories cloned from Github for later review (sometimes the &lt;code&gt;.git&lt;/code&gt; folder itself was larger than the code database), handouts and code samples I will surely forget in a few months, and so on. I also benefited from CleanMyMac regular cleanup, of course (it tends to forget some cache files, like Homebrew but &lt;code&gt;brew cleanup -s&lt;/code&gt; and &lt;code&gt;rm -rf &amp;quot;$(brew --cache)&amp;quot;&lt;/code&gt; are my best friends when it comes to deleting Homebrew stuff).&lt;/p&gt;
&lt;p&gt;This Macbook is only 4 years old, I&amp;rsquo;ve been off during 2 years, but I already accumulated a lot of stuff, mostly useless I would say. Take for example my inbox: I still have more than 30,000 emails in my Gmail inbox that I never considered screening seriously before because Gmail. Ok, I don&amp;rsquo;t really care since &lt;code&gt;mu&lt;/code&gt; offers similar and fast indexing capabilities. Still, I was only able to remove about 12,000 emails using simple search queries. Nowadays, I am more stringent when processing incoming emails, and I only archive those that I may need later, eventually. The remaining ones (brief short reply, listserve, etc.) most of the time end up unread in the Trash folder. However, I just had to delete all emails with attachments &amp;gt; 1 Mo (some hundreds of them) to compress my Maildir from 7 Go to 1.5 Go. What were those attachments? I have no idea, but they weighed heavy in the balance anyway.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s start freshly then.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Paul Motian Trio • &lt;em&gt;Dance&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>July in review</title><link>https://aliquote.org/post/micro-review-014/</link><pubDate>Tue, 14 Jul 2020 11:38:46 +0200</pubDate><guid>https://aliquote.org/post/micro-review-014/</guid><description>&lt;p&gt;These days, most of my web excursions come from my RSS reader, random browsing and Hacker News. I no longer see any value in Twitter feeds and I&amp;rsquo;ll probably simply stop using the Twitter app on my iPhone at some point. Anyway, here are a few links I found interesting lately.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The LSP package and its satelite packages for Emacs provides an all-in-one solution for everything related to Python, Typescript, web dev and C/C++. This generally include linter, formatter, code completion and navigation, and peak functionalities when available. Regarding Python specifically, I don&amp;rsquo;t think I miss any feature from VS Code. In any case, editing Python script is one thing, writing Python packages or longer programs is another. Hopefully, Claudio Jolowicz wrote a useful &lt;a href="https://cjolowicz.github.io/posts/hypermodern-python-01-setup/"&gt;series of posts&lt;/a&gt; on how to devise a modern setup for writing Python code efficiently, which basically make use of &lt;a href="https://github.com/pyenv/pyenv"&gt;pyenv&lt;/a&gt; and &lt;a href="https://python-poetry.org/"&gt;poetry&lt;/a&gt; to manage Python version and virtual environments. I tried &lt;code&gt;pyenv&lt;/code&gt; a while ago, and more recently &lt;code&gt;poetry&lt;/code&gt;. I think I should give them another try even I prefer using built-in tools like &lt;code&gt;venv&lt;/code&gt; or &lt;code&gt;unittest&lt;/code&gt; (or &lt;code&gt;doctest&lt;/code&gt;), and the Homebrew version of Python 3.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://aliquote.org/img/2020-07-14-20-00-19.png" alt="poetry"&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://alistapart.com/article/webwaste/"&gt;The web is obese&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The causes of webpage bloat? Images and videos are mainly to blame. By 2022, it’s estimated that online videos will make up more than 82% of all consumer Internet traffic—15 times more than in 2017. However, from the code to the content, everything about Web design has become super-bloated and super-polluting.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I already linked to this blog post on the &lt;a href="https://aliquote.org/micro/2020-07-09-17-43-04/"&gt;Micro&lt;/a&gt; section some days ago, but I can&amp;rsquo;t stop thinking about it. However, I&amp;rsquo;m not so much concerned with &amp;ldquo;pollution&amp;rdquo; than I am with identifying good content and finding interesting sites I visited once in a while. Because the web has become such a large industry, it&amp;rsquo;s getting harder and harder to find your way around this pile of broken bonds.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://andregarzia.com/2020/07/a-machine-for-peaceful-computing.html"&gt;A machine for peaceful computing&lt;/a&gt;. The only solution I found is to work on remote machines using my own computer: this way I benefit from a clean environment but I can switch to any Ubuntu servres available in my lab where I can install and run all the heavy stuff I don&amp;rsquo;t necessarily want to cope with on my local laptop.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;Moreover, just as Twitter is the social network of choice within the tech ecosystem, the vast majority of Silicon Valley companies host their email with Google and use Google’s productivity software, or one of the myriad of offerings seeking to usurp documents or spreadsheets or presentations. And even when it comes to the cloud, the choice for startups is usually between AWS and Google Cloud Platform. Microsoft is out-of-sight and out-of-mind. &amp;mdash; &lt;a href="https://stratechery.com/2020/the-slack-social-network/"&gt;The Slack Social Network&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://nibblestew.blogspot.com/2020/07/what-if-revision-control-systems-did.html"&gt;What if? Revision control systems did not have merge&lt;/a&gt;. An interesting discussion of Git merge feature and the typology of commits (logical changes and individual commits that make up the logical change).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="http://fmnt.info/blog/20200706_pmap-racket.html"&gt;Parallel computing with Racket on Chez Scheme&lt;/a&gt;. I&amp;rsquo;m still on Racket 7.5, the &amp;ldquo;classic&amp;rdquo; version (i.e. not based on Chez Scheme). I was puzzled by this post, and I just thought I should give CS Racket a try when I&amp;rsquo;ll be back to Scheme experimentation.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Patti Smith • &lt;em&gt;Easter&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Editor war</title><link>https://aliquote.org/post/editor-war/</link><pubDate>Thu, 09 Jul 2020 08:09:34 +0200</pubDate><guid>https://aliquote.org/post/editor-war/</guid><description>&lt;p&gt;This post deals with Emacs and (Neo)vim, but the title is just a joke, of course: I use both editors, although most of my programming work is done in Emacs. I spent the past couple of weeks using Emacs, Safari and iTerm2 (mostly for ssh stuff) only. I started using Vim to get more familiar with modal editing (despite what I still &lt;a href="https://aliquote.org/post/emacs-15-years-later/"&gt;think of it&lt;/a&gt;) and relevant mappings. As Doom defaults are mostly Evil-centric, I thought this would be a good opportunity to learn more about visual and normal modes. Vim offers a far better experience in a Terminal, compared to Emacs running in non-Gui mode, and it is still faster over ssh, IMO.&lt;/p&gt;
&lt;p&gt;When I&amp;rsquo;m editing text in Emacs, I now came to appreciate a few idioms like &lt;code&gt;%&lt;/code&gt; to move from one delimiter (parenthesis or square bracket) to the other, &lt;code&gt;*&lt;/code&gt; and &lt;code&gt;#&lt;/code&gt; to search forward and backward, &lt;code&gt;g;&lt;/code&gt; (&lt;code&gt;goto-last-change&lt;/code&gt;) to go back to where we were before moving, &lt;code&gt;gg&lt;/code&gt; to go to top of file, or &lt;code&gt;)&lt;/code&gt; and &lt;code&gt;]&lt;/code&gt; to move forward quickly (as opposed to &lt;code&gt;w&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt; for words), notwithstanding some specific Doom settings like &lt;code&gt;gr&lt;/code&gt; (&lt;code&gt;eval-region&lt;/code&gt;) or &lt;code&gt;gd&lt;/code&gt; and &lt;code&gt;gD&lt;/code&gt; (&lt;code&gt;+lookup/definition&lt;/code&gt; and &lt;code&gt;+lookup/references&lt;/code&gt;, which make use of LSP backend capabilities when available). I also learned to use a few combination of verb+motion, like &lt;code&gt;ciw&lt;/code&gt; or &lt;code&gt;diw&lt;/code&gt;, &lt;code&gt;5j&lt;/code&gt;, etc. I&amp;rsquo;m still too much familiar with &lt;code&gt;shift-select&lt;/code&gt; and the use of arrow keys to use proper visual motion in some cases, but that&amp;rsquo;s okay. Likewise, &lt;code&gt;C-a&lt;/code&gt; and &lt;code&gt;C-e&lt;/code&gt; are still too much entranched in my muscle memory to think of Vimesque alternative like &lt;code&gt;0&lt;/code&gt; and &lt;code&gt;$&lt;/code&gt;, especially since I use them in my Terminal and other macOS app.&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s the advantage of Doom Emacs after all: we can use both keymappings at any time. If you wonder, I also use standard macOS keybindings like &lt;code&gt;⌘-R&lt;/code&gt; (search and replace) and &lt;code&gt;⌘-F&lt;/code&gt; (forward search only, using &lt;code&gt;rg&lt;/code&gt; or &lt;code&gt;swiper&lt;/code&gt;). I think this is what I use most of the time, so that&amp;rsquo;s not a big deal for my poor memory. I know we can do a lot more, in either editors, but I usually don&amp;rsquo;t need those extra superpowers. For instance, while replacing the word under cursor with a yanked one &lt;a href="https://unix.stackexchange.com/a/88719"&gt;can be done&lt;/a&gt; nicely in Vim (the same applies for Emacs), I prefer to query and replace, especially if this has to be done multiple times. Maybe I&amp;rsquo;ll change my mind later or when I become more fluent with yanking in Vim. For me, the most useful commands for yanking and pasting in Vim remains &lt;code&gt;yy&lt;/code&gt;, &lt;code&gt;dd&lt;/code&gt; and &lt;code&gt;p&lt;/code&gt;, of course, and I only started to appreciate selection in visual mode using &lt;code&gt;V&lt;/code&gt;, &lt;code&gt;S-V&lt;/code&gt; or &lt;code&gt;C-V&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Now comes the question of the color scheme, since I always advocated the idea that simple and light themes are often better. Some &lt;a href="https://jblevins.org/projects/emacs-color-themes/"&gt;nice themes&lt;/a&gt; are described on Jason Blevins&amp;rsquo;s site, and I tried a lot of colorless or minimalist themes in the past. I don&amp;rsquo;t really like pink or purple, so Atom or VS Code default colorful schemes, and Emacs variations thereof, are not an option. In the end the buffer just looks like a rainbow. I use the wonderful &lt;a href="https://www.nordtheme.com"&gt;Nord (dark) theme&lt;/a&gt; in both Vim and Emacs, as well as iTerm. In my view, it looks better in Vim compared to the corresponding implementation for Emacs in non-GUI mode, but since I generally use Emacs in a GUI I don&amp;rsquo;t really care. I made some modification to the base color scheme, though. The idea was to have a lighter color scheme, after removing extraneous colorization for faces that are not that essential when writing prose or code. You can have a look below:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2020-07-10-08-11-10.png"&gt;
&lt;/figure&gt;
&lt;p&gt;The idea is simply to remove syntax highlighting for everything except keywords and related language-specific forms, which use the same &lt;span style="background:#81a1c1; color:white; padding:1px 3px 1px 3px; border-radius: 5px"&gt;base color&lt;/span&gt;, and to highlight &lt;span style="background:#ebcb8b; color:white; padding:1px 3px 1px 3px; border-radius: 5px"&gt;strings&lt;/span&gt; differently (with a dimmed variant for &lt;span style="background:#bca26f; color:white; padding:1px 3px 1px 3px; border-radius: 5px"&gt;numbers&lt;/span&gt;):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;custom-set-faces!&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;font-lock-doc-face&lt;/span&gt; &lt;span class="ss"&gt;:foreground&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;#9099ab&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;font-lock-string-face&lt;/span&gt; &lt;span class="ss"&gt;:foreground&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;#ebcb8b&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;font-lock-constant-face&lt;/span&gt; &lt;span class="ss"&gt;:foreground&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;#81a1c1&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;font-lock-warning-face&lt;/span&gt; &lt;span class="ss"&gt;:foreground&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;#d08770&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;font-lock-function-name-face&lt;/span&gt; &lt;span class="ss"&gt;:foreground&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt; &lt;span class="ss"&gt;:weight&lt;/span&gt; &lt;span class="nv"&gt;regular&lt;/span&gt; &lt;span class="ss"&gt;:slant&lt;/span&gt; &lt;span class="nv"&gt;italic&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;font-lock-variable-name-face&lt;/span&gt; &lt;span class="ss"&gt;:foreground&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt; &lt;span class="ss"&gt;:weight&lt;/span&gt; &lt;span class="nv"&gt;regular&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;font-lock-builtin-face&lt;/span&gt; &lt;span class="ss"&gt;:foreground&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;#81a1c1&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;font-lock-type-face&lt;/span&gt; &lt;span class="ss"&gt;:foreground&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;#81a1c1&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;font-lock-keyword-face&lt;/span&gt; &lt;span class="ss"&gt;:foreground&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;#81a1c1&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;`&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;highlight-numbers-number&lt;/span&gt; &lt;span class="ss"&gt;:foreground&lt;/span&gt; &lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;doom-darken&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;#ebcb8b&amp;#34;&lt;/span&gt; &lt;span class="mf"&gt;0.2&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;`&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;highlight-quoted-symbol&lt;/span&gt; &lt;span class="ss"&gt;:foreground&lt;/span&gt; &lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;doom-darken&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;#81a1c1&amp;#34;&lt;/span&gt; &lt;span class="mf"&gt;0.2&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;small&gt;The idea of using a slanted variant for functions is actually just a test. It works great for Lisp-like dialects and Python, though.&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;I made further customization for &amp;ldquo;text-mode&amp;rdquo; (Markdown and Org), which amounts to using essentially white headers (level 1 and 2), dimmer highlight for inline code and URLs, etc. After all, when you are writing prose, you don&amp;rsquo;t necessarily want to see color every 3 or 4 words. The fact that my TODO list or Org documents were just full of colors was driving me crazy at some point. &lt;span style="background:#9099ab; color:white; padding:1px 3px 1px 3px; border-radius: 5px"&gt;Metadata&lt;/span&gt; and Org drawers are all using dimmed colors as well. Finally, &lt;span style="background:#c2c282; color:white; padding:1px 3px 1px 3px; border-radius: 5px"&gt;selections&lt;/span&gt; and &lt;span style="background:#81a1c1; color:white; padding:1px 3px 1px 3px; border-radius: 5px"&gt;jumps&lt;/span&gt; are also highlighted using different background colors.&lt;/p&gt;
&lt;p&gt;Well, that&amp;rsquo;s all. I go back experimenting with Vim motions and maybe my next posts will all be about Neovim.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Nick Cave &amp;amp; The Bad Seeds • &lt;em&gt;Ghosteen&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in June</title><link>https://aliquote.org/post/micro-06-2020/</link><pubDate>Tue, 30 Jun 2020 14:07:25 +0200</pubDate><guid>https://aliquote.org/post/micro-06-2020/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-06-02&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;At the end of the day, a text editor is just a preference, just like mechanical keyboards, vim bindings, window managers and what have you. &amp;mdash; &lt;a href="https://notes.neeasade.net/On-Emacs.html"&gt;On Emacs&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-06-02&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If you want to build truly performant software, you need to at least keep performance in mind as you make early design and architectural decisions, lest you paint yourself into awkward corners later on. &amp;mdash; &lt;a href="https://blog.nelhage.com/post/reflections-on-performance/"&gt;Reflections on software performance&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-06-02&lt;/a&gt;: Apparently, &lt;a href="https://anarc.at/blog/2018-05-04-terminal-emulators-2/"&gt;latency&lt;/a&gt; in terminal emulator is &lt;a href="https://danluu.com/term-latency/"&gt;still&lt;/a&gt; a thing in 2020.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-02&lt;/a&gt;: I&amp;rsquo;m all for &lt;a href="https://github.com/be5invis/iosevka"&gt;Iosevka&lt;/a&gt; these days (I do not want to buy Pragmata), but &lt;a href="https://rubjo.github.io/victor-mono/"&gt;Victor Mono&lt;/a&gt; is such amazing piece of artwork.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-02&lt;/a&gt;: Lovely: &lt;a href="https://www.reddit.com/r/orgmode/comments/go5jj3/calendar_busy_colors_according_to_agenda/"&gt;Calendar busy colors according to agenda&lt;/a&gt;. Check out other experiments at tweaking Emacs UI by Nicolas Rougier, e.g. this &lt;a href="https://www.reddit.com/r/emacs/comments/gtb148/some_fun_with_emacs/"&gt;large fringe&lt;/a&gt; or this basic &lt;a href="https://github.com/rougier/elegant-emacs"&gt;config&lt;/a&gt; for an &amp;ldquo;Elegant Emacs&amp;rdquo;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-02&lt;/a&gt;: &lt;a href="https://github.com/aaronjanse/3mux"&gt;3mux&lt;/a&gt;: Terminal multiplexer inspired by i3 (via Brett Terpstra). The ability to switch between different layouts for current panes (e.g., tall or wide, in i3 parlance) is the only thing that I really miss in iTerm2.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-02&lt;/a&gt;: &lt;a href="http://blog.startaylor.net/2016/05/30/howto-console/"&gt;How to Live Well on the Linux Console&lt;/a&gt;. Or start Emacs with an Eshell buffer and you&amp;rsquo;re (almost) done.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-02&lt;/a&gt;: &lt;a href="http://jtra.cz/stuff/lisp/sclr/index.html"&gt;Simplified Common Lisp Reference&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-02&lt;/a&gt;: &lt;em&gt;M-x doom&lt;/em&gt; tip of the day: &lt;code&gt;%&lt;/code&gt; (&lt;code&gt;evil-jump-item&lt;/code&gt;) is a nice replacement for &lt;code&gt;forward-sexp&lt;/code&gt; or &lt;code&gt;backward-sexp&lt;/code&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-03&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I saved a personal, private backup of everything I&amp;rsquo;ve posted &amp;ndash; 3,794 posts, not including this one &amp;ndash; and then deleted it all except the first post.&lt;br&gt;First, the why: the internet never forgets, but that&amp;rsquo;s not how people work. &amp;ldquo;I like to remember things my own way. How I remembered them, not necessarily the way they happened.&amp;rdquo; The person who posted entries here ten years ago is a different person than me, and I see no reason for that older person to stay around*. &amp;mdash; &lt;a href="https://evan.livejournal.com/991055.html"&gt;the end of livejournal&lt;/a&gt;, by &lt;a href="http://neugierig.org"&gt;Evan Martin&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-06-03&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;We’re the Electronic Frontier Foundation, an independent non-profit working to protect online privacy for nearly thirty years. This is Surveillance Self-Defense : our expert guide to protecting you and your friends from online spying. &amp;mdash; &lt;a href="https://ssd.eff.org/en"&gt;https://ssd.eff.org/en&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-06-03&lt;/a&gt;: &lt;a href="https://ketancmaheshwari.github.io/posts/2020/05/24/SMC18-Data-Challenge-4.html"&gt;Running Awk in parallel to process 256M records&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-06&lt;/a&gt;: TIL that you can customize your &lt;a href="https://github.com/gaborcsardi/prompt"&gt;R prompt&lt;/a&gt; much like you do with your preferred shell. See also &lt;a href="https://www.jumpingrivers.com/blog/customising-your-rprofile/"&gt;Customising your Rprofile&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-06&lt;/a&gt;: &lt;a href="https://breadth.substack.com/p/what-the-hell-is-a-deno"&gt;What the hell is a Deno?&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-08&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Most developers are primarily engaged in making systems that acquire, extract, transform, maintain, analyze, transmit and render information—facts about the world. Most often, this information documents some human activity, be that of customers, suppliers, advertisers, travelers, voters, members, students, patients etc and must deal with all the irregularity thereof. This is in stark contrast to artificial systems, e.g., programming language compilers, which make up their own rules, in fully enumerated spaces, can eliminate irregularity and can reject anything which does not conform. &amp;mdash; &lt;a href="https://clojure.org/about/history"&gt;A history of Clojure&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-06-08&lt;/a&gt;: A List of &lt;a href="https://github.com/minimaxir/hacker-news-undocumented/blob/master/README.md"&gt;Hacker News&amp;rsquo;s Undocumented Features&lt;/a&gt; and Behaviors.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-08&lt;/a&gt;: Battlestar Galactica S4 finished. We just started watching &lt;a href="https://en.wikipedia.org/wiki/Westworld_(season_3)"&gt;Westworld 3&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-08&lt;/a&gt;: Two quick links for Shiny users: &lt;a href="https://divadnojnarg.github.io/outstanding-shiny-ui/"&gt;Outstanding User Interfaces with Shiny&lt;/a&gt;, &lt;a href="https://www.databentobox.com/2020/05/31/shinyproxy-with-docker-swarm/"&gt;Effectively Deploying and Scaling Shiny Apps with ShinyProxy, Traefik and Docker Swarm&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-08&lt;/a&gt;: &lt;a href="http://www.righto.com/2020/05/die-analysis-of-8087-math-coprocessors.html?m=1"&gt;Die analysis of the 8087 math coprocessor&amp;rsquo;s fast bit shifter&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-08&lt;/a&gt;: &lt;a href="https://github.com/hriebl/ggnuplot/blob/master/README.md"&gt;ggnuplot&lt;/a&gt; is a ggplot2 theme that makes your ggplots look like gnuplots. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-10&lt;/a&gt;: &lt;a href="https://uxdesign.cc/demystifying-text-editor-keystrokes-594d5d89e9a6"&gt;Demystifying text editor keystrokes&lt;/a&gt;. (via Irreal)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-10&lt;/a&gt;: &lt;a href="http://www.mycpu.org/read-email-in-emacs/"&gt;Emacs as Email Client - Part I&lt;/a&gt;. Note taking as plain text attachments and reduced distraction mode are two of the most valuable features of mu4e, IMHO. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-15&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Everyone is constantly online, and the need for statuses has seemingly disappeared. But has it really? Toggling between online and offline may not be all that useful anymore, but along with that we lost a way to specify whether we want to talk or not. At best you&amp;rsquo;ll get a green dot meaning only “they&amp;rsquo;re looking at the screen right now”, or a note saying “last seen 10 minutes ago” – which could just mean that they woke up, checked the screen and went back to sleep. Combine that with the absurd amount of competing platforms, and your best bet at “hey everyone, I need to talk” is messaging every single person on every single platform and hoping that they respond. &amp;mdash; &lt;a href="https://blog.tadzik.net/i-miss-being-online.html"&gt;I miss being online&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-06-15&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Signal is pushing the envelope when it comes to forgetting information about its users. And as far as my technical knowledge goes I choose to trust Signal that they are doing whatever they can to stay the most private and secure messenger out there. &amp;mdash; &lt;a href="https://blog.viktomas.com/posts/signal/"&gt;Signal - the secure messenger&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-06-15&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Worse, it turns out that nobody else found all this stuff to be fascinating. Even though GPG has been around for almost 20 years, there are only ~50,000 keys in the “strong set,” and less than 4 million keys have ever been published to the SKS keyserver pool ever. By today’s standards, that’s a shockingly small user base for a month of activity, much less 20 years. &amp;mdash; &lt;a href="https://moxie.org/2015/02/24/gpg-and-me.html"&gt;GPG And Me&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-06-15&lt;/a&gt;: How to &lt;a href="http://www.mycpu.org/activity-stats/"&gt;log your activities&lt;/a&gt; on Emacs. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-15&lt;/a&gt;: I&amp;rsquo;ve spent one hour this morning to build this little snippet in R. I&amp;rsquo;m so used to base R that using dplyr/tidyr stuff is painful at time, although chaining operations like this makes the workflow of data management so much more readable for other people. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-06-15-10-58-07.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-15&lt;/a&gt;: &lt;a href="https://www.dbcore.org"&gt;DBCore&lt;/a&gt;: Generate applications powered by your database.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-15&lt;/a&gt;: &lt;a href="https://dl.acm.org/toc/pacmpl/2020/4/HOPL"&gt;HOPL 4&lt;/a&gt; is out. Lot of interesting articles on the hsitory of (many) programming languages, including an article by John Chambers on &lt;a href="https://dl.acm.org/doi/abs/10.1145/3386334"&gt;S, R, and data science&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-15&lt;/a&gt;: &lt;a href="https://dcatteeu.github.io/article/2014/07/31/random-numbers/"&gt;Random Numbers in Common Lisp&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-15&lt;/a&gt;: &lt;a href="http://40ants.com/teddy/"&gt;Teddy&lt;/a&gt;: A data framework for Common Lisp, wanna be like Pandas for Python. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-15&lt;/a&gt;: &lt;a href="https://chasemc.github.io/electricShine/"&gt;electricShine&lt;/a&gt; to boost your Shiny app. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-18&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Conversational software development is a term I’m half heartedly trying to coin to describe a way to develop your program with an incredibly short feedback loop. It aligns closely with hot module reloading for React based frontend applications but with a much tighter focus and an extra dimension that you may not have seen before. &amp;mdash; &lt;a href="https://oli.me.uk/conversational-software-development/"&gt;Conversational software development&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-06-18&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;It’s amazing how great computer products can be when they don’t need to deal with corporate bullshit, don’t have to promote a brand or to sell its users. Frankly, I almost ceased to believe it’s still possible. But it is. &amp;mdash; &lt;a href="https://tonsky.me/blog/syncthing/"&gt;Computers as I used to love them&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-06-18&lt;/a&gt;: The new design for Github is quite good actually.&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-06-18-10-39-50.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-18&lt;/a&gt;: &lt;a href="http://abcl-dev.blogspot.com/2020/06/a-future-history-of-arming-bears.html"&gt;A Future History of Arming Bears&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-19&lt;/a&gt;: Deno is quite interesting. I ran some of the suggested examples and I just realized that the &lt;code&gt;run/install&lt;/code&gt; stuff makes distributing packages very smooth, as noted by &lt;a href="https://willschenk.com/articles/2020/deno/"&gt;Will Schenk&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-19&lt;/a&gt;: TIL about &lt;a href="https://etienne.depar.is/a-ecrit/flycheck-grammalecte-version-1.1.html"&gt;flycheck-grammalecte&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-19&lt;/a&gt;: &lt;a href="https://willschenk.com/articles/2020/book_images_shortcode/"&gt;Book Image Shortcode for Hugo&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-22&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I estimated that I had used my mac for approximately 10 hours a day, 5 days a week, 48 weeks a year, for 7 years straight, for a total for whopping 16800 hours. I have written the first versions of most of the software components of my startup using this computer. And all this time, this machine worked without a hiccup. It was never repaired, and I never opened the back cover. &amp;mdash; &lt;a href="https://quanticdev.com/articles/cleaning-macbook-after-16800-hours-of-use/"&gt;Cleaning My MacBook After 16800 Hours of Use!&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-06-22&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In functional programming, fold is a standard operator that encapsulates a simple pattern of recursion for processing lists. &amp;mdash; &lt;a href="https://www.cs.nott.ac.uk/~pszgmh/fold.pdf"&gt;A tutorial on the universality and expressiveness of fold&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-06-22&lt;/a&gt;: Duh, Github is down, how funny if we were to completely loose access to it&amp;hellip;.&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-06-22-21-11-58.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-22&lt;/a&gt;: I also reinstall VS Code, with VIM keybindings. This is only for Python because Emacs Python LSP sucks, but that&amp;rsquo;s okay! Anaconda sucks too, and that&amp;rsquo;s not okay. Are there any convenient way to install a Python package or environment outside macOS?!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-22&lt;/a&gt;: Recent headlines: My son and I are done with &lt;a href="https://en.wikipedia.org/wiki/Battlestar_Galactica_(2004_TV_series)"&gt;Battlestar Galactica&lt;/a&gt;, and back to &lt;a href="https://en.wikipedia.org/wiki/The_Blacklist_%28TV_series%29"&gt;Black List&lt;/a&gt; S5. I&amp;rsquo;m also done with the &lt;a href="https://en.wikipedia.org/wiki/The_Handmaid%27s_Tale_(TV_series)"&gt;Handmaid&amp;rsquo;s Tale&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-22&lt;/a&gt;: &lt;a href="https://www.cs.utah.edu/plt/publications/pldi20-fd.pdf"&gt;Compiler and Runtime Support for Continuation Marks&lt;/a&gt; (PDF). &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-22&lt;/a&gt;: &lt;a href="https://www.manueluberti.eu/emacs/2020/03/16/modus-themes/"&gt;Light is right, alright?&lt;/a&gt;. I switched back to a light theme too, since my eyes now seem okay with that. There&amp;rsquo;s no &lt;a href="https://github.com/tonsky/vscode-theme-alabaster"&gt;alabaster&lt;/a&gt; theme for Emacs, so I made my own. Lovely.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-22&lt;/a&gt;: &lt;a href="http://motherfuckingwebsite.com"&gt;This is a motherfucking website&lt;/a&gt;. And it&amp;rsquo;s fucking perfect.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-23&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Asynchronous written communication is the tool best suited for remote work. We are so used to talking to each other in the office, expecting immediate responses in work chat, and having meetings all day, that we tried to replicate that at home with zoom and slack. &amp;mdash; &lt;a href="https://snir.dev/blog/remote-async-communication/"&gt;Written communication is remote work super power&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-06-23&lt;/a&gt;: TIL about &lt;a href="https://github.com/dacap/keyfreq"&gt;keyfreq&lt;/a&gt;. This reminded me of the wonderful artwork done by Seth Brown (&amp;ldquo;Vim Croquet&amp;rdquo;, see &lt;a href="http://www.aliquote.org/micro/2019-10-30-10-01-12/"&gt;here&lt;/a&gt;), back in the days where &lt;a href="https://www.drbunsen.org"&gt;https://www.drbunsen.org&lt;/a&gt; was still alive. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-23&lt;/a&gt;: &lt;a href="https://macropy3.readthedocs.io/en/latest/tco.html"&gt;Tail-call Optimization&lt;/a&gt;, using Python. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-26&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_1200.jpg" alt="food"&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-26&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I try to make sure I largely spend the time on things I enjoy, but it gets more complicated once you start selling work. Processing and shipping orders takes quite a bit of time. And it isn&amp;rsquo;t exactly my favorite activity. Obviously I enjoy the fact that people are willing to buy my work. But I can&amp;rsquo;t say I enjoy handling the paperwork, and dealing with packaging and shipping. &amp;mdash; &lt;a href="https://inconvergent.net/2020/making-money/"&gt;Making money&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-06-26&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Maintaining servers falls into two phases: (1) Bang head until server works; (2) Capture effort into some automation tool like Puppet or Chef. &amp;mdash; &lt;a href="http://howardism.org/Technical/Emacs/literate-devops.html"&gt;Literate DevOps&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-06-26&lt;/a&gt;: A new Org mode? &lt;a href="https://foambubble.github.io/foam/"&gt;Foam&lt;/a&gt; is a personal knowledge management and sharing system inspired by Roam Research, built on Visual Studio Code and GitHub.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-26&lt;/a&gt;: Didn&amp;rsquo;t know we could organize Org journal (&lt;code&gt;file+datetree&lt;/code&gt;) using weekly subtrees.&amp;gt; I prefer a weekly format in my journal over a monthly format. In fact, the week is a “productivity unit” which always made sense to me, and this mindset integrates beautifully into Org-mode. &amp;mdash; &lt;a href="https://joshrollinswrites.com/help-desk-head-desk/org-capture-template-2/"&gt;My Org Capture Templates&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-26&lt;/a&gt;: &lt;a href="https://github.com/panicz/pamphlet"&gt;A Pamphlet against R&lt;/a&gt;. &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-26&lt;/a&gt;: &lt;a href="https://quinnj.home.blog/2020/06/07/data-structure-design-in-csv-jl/"&gt;Data Structure Design in CSV.jl&lt;/a&gt;. &lt;code&gt;#julia&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-26&lt;/a&gt;: &lt;a href="https://www.dexplo.org/dexplot/"&gt;Dexplot&lt;/a&gt; is a Python library for delivering beautiful data visualizations with a simple and intuitive user experience. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-26&lt;/a&gt;: &lt;a href="https://itnext.io/five-highlights-on-the-spark-3-0-release-ab8775804e4b"&gt;Five highlights on the Spark 3.0.0 Release&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-26&lt;/a&gt;: &lt;a href="https://bookdown.org/robinlovelace/geocompr/"&gt;Geocomputation with R&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-26&lt;/a&gt;: &lt;a href="https://generativeartistry.com"&gt;generative artistry&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-27&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The UNIX toolset, like the one you&amp;rsquo;ll find in Linux and OSX, is the work environment of choice of a very large number of programmers and research scientists. If you are interested in a career as a programmer, data analyst, or researcher, you&amp;rsquo;ll need to master it. &amp;mdash; &lt;a href="https://github.com/juanre/hacker-ways"&gt;The Hacker Ways&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-06-27&lt;/a&gt;: Latest pinned package from Homebrew: &lt;code&gt;hugo&lt;/code&gt;. Yes, &lt;a href="https://aliquote.org/micro/hugo-update/"&gt;again&lt;/a&gt;&amp;hellip; This time with version 0.73 which messed with the generation of the tagged entries, e.g. &lt;a href="https://aliquote.org/tags/emacs/"&gt;emacs&lt;/a&gt;. I&amp;rsquo;m tired of that backward compatibility issues.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-27&lt;/a&gt;: So many new textbooks by &lt;a href="https://www.gastonsanchez.com"&gt;Gaston Sanchez&lt;/a&gt;! &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-27&lt;/a&gt;: &lt;a href="https://www.borgbackup.org"&gt;Borg&lt;/a&gt;: Deduplicating archiver with compression and encryption. Since I&amp;rsquo;m done with Dropbox and rely on Syncthing now, this looks like a great replacement for Arq eventually.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-28&lt;/a&gt;: &lt;a href="https://wattenberger.com/blog/d3"&gt;How to learn D3.js&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-28&lt;/a&gt;: &lt;a href="https://restic.net"&gt;restic&lt;/a&gt;: Backups done right! Now I guess I just have to figure out how it compares to Borg.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-06-29&lt;/a&gt;: I just realized today that VS Code was using Jedi as the default backend for its LSP server. It&amp;rsquo;s still possible to use the MS Python server: same as under Emacs, once you select that option, all MS stuff get downloaded and VS Code gets pretty unusable for quite a few moments when you open a Python project. That was not &lt;a href="https://aliquote.org/micro/2020-06-22-21-00-20/"&gt;Emacs fault&lt;/a&gt;, right? So I&amp;rsquo;m now back to Emacs full day. What a life! &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>The unquantified self #13</title><link>https://aliquote.org/post/unquantified-self-013/</link><pubDate>Thu, 25 Jun 2020 20:38:25 +0200</pubDate><guid>https://aliquote.org/post/unquantified-self-013/</guid><description>&lt;p&gt;These days look like people just got tired of the COVID thing and try their best at making it a non event. I was supposed to work a bit on Python code this afternoon but I was forced by the ambient heat to take a little more rest than I expected, because of my medicine: it&amp;rsquo;s been 35 °C outside and 26-28 indoors almost all day long. That being said, I&amp;rsquo;ve been pretty productive the past two weeks, so that&amp;rsquo;s probably okay. I&amp;rsquo;ve still got a bunch of drafts lying around in my post box. I hope to be able to get back to it before the end of the month.&lt;/p&gt;
&lt;p&gt;My son and I are back to &lt;a href="https://en.wikipedia.org/wiki/The_Blacklist_%28TV_series%29"&gt;Black List&lt;/a&gt;, Season 5. We took a break after Season 4 to watch &lt;a href="https://en.wikipedia.org/wiki/Westworld_(TV_series)"&gt;Westworld&lt;/a&gt; 3, &lt;a href="https://en.wikipedia.org/wiki/The_100_(TV_series)"&gt;The 100&lt;/a&gt;, and &lt;a href="https://en.wikipedia.org/wiki/Vikings_(2013_TV_series)"&gt;Vikings&lt;/a&gt; (in reverse chronological order). The containment was decisive on the quantity of series consumed in the last 3 months apparently. The Apple TV and iTunes (on Mojave) is apparently the last things I keep from Apple, besides this Macbook (with its frozen OS). I&amp;rsquo;ve been pretty busy at the kitchen too.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1174.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1174.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1184.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1184.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1195.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1195.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The site is going fine. I was able to post nearly 10 entries per month since the beginning of the year. These posts may not always be very interesting, some are just random notes or shopping lists about what I&amp;rsquo;ve read or would like to understand better. But some posts are more elaborated, IMHO, and reflect the evolution I wish to see for this site. Unfortunately, I didn&amp;rsquo;t take the time to go into detail about what I wanted to do in the last few months and I still have a lot of other ideas. Expect a few more unfinished drafts in the upcoming months.&lt;/p&gt;
&lt;p&gt;Regarding my setup, I&amp;rsquo;ve spent a week cleaning up my Macbook. This includes removing old and unused files as well as large files, uninstalling XCode and other unused applications, deleting most of the cache files I could find in &lt;code&gt;~/Library&lt;/code&gt; and &lt;code&gt;/Library&lt;/code&gt;. I got 40 Go of free space which is nice. I also decided to limit the number of applications I rely on, and ideally the environment itself (in the hope that I could use the same tools on a Linux workstation if I had too). This means that I&amp;rsquo;m now just using Emacs (yes, even for my incoming emails or to chat on IRC) and Safari most of the day. I use iTerm for remote ssh connection only. And you know what? That works smoothly and that&amp;rsquo;s perfectly fine!&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Bauhaus • &lt;em&gt;The Sky&amp;rsquo;s Gone Out&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Code &amp; Co.</title><link>https://aliquote.org/post/vscode-for-21st-century/</link><pubDate>Wed, 24 Jun 2020 08:01:50 +0200</pubDate><guid>https://aliquote.org/post/vscode-for-21st-century/</guid><description>&lt;p&gt;VS Code is the new cool editor of the 21st century that everybody knows, likes, and/or uses. I rarely come across negative review of it, even from Vim or Emacs heavy users. As far as I am concerned, I reinstalled it lately, just to edit some Python code because Emacs LSP is too slow to my taste &amp;mdash; the startup phase, I mean, because it keep insisting on indexing and caching over and over again the same codebase.&lt;/p&gt;
&lt;p&gt;I already wrote a short review in the past: &lt;a href="https://aliquote.org/post/vscode-python/"&gt;VS Code and Python&lt;/a&gt;. One of the things that significantly changed since last year is far better support for R, thanks to the new &lt;a href="https://github.com/REditorSupport/languageserver"&gt;language server&lt;/a&gt;. The UI has significantly improved too. Yet I&amp;rsquo;m still on Emacs for a long time apparently, if only because I process plain text editing in Markdown or Org, and Emacs has better support for this kind of writing tasks in my opinion. While I really liked &lt;a href="https://aliquote.org/post/typora/"&gt;Typora&lt;/a&gt;, I couldn&amp;rsquo;t last more than a few days using an application other than Emacs. Go figure. Probably a matter of taste, or &amp;ldquo;culture and habit&amp;rdquo; as one used to say in the following thread:&lt;/p&gt;
&lt;blockquote class="twitter-tweet"&gt;&lt;p lang="en" dir="ltr"&gt;since vscode is taking over most of the world, is there a functional argument for emacs, or is it all down to culture and habit at this point?&lt;/p&gt;&amp;mdash; Chas (Anxiety Goblin) Emerick (@cemerick) &lt;a href="https://twitter.com/cemerick/status/1275106475581505540?ref_src=twsrc%5Etfw"&gt;June 22, 2020&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async src="https://platform.twitter.com/widgets.js" charset="utf-8"&gt;&lt;/script&gt;
&lt;p&gt;Here are a few things that I like in Emacs and that I always missed in any other editors:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Frame (buffer) management: Along with find/replace, copy/paste, motion, inline evaluation and code navigation, being able to switch to a different buffer or workspace is one of the thing that I find difficult in other code editors. Atom or VS Code offers a project sidebar &amp;mdash; note that this is really a project drawer, and it assumes that you&amp;rsquo;re only working on the files indexed in that specific project; see point below &amp;mdash; but that&amp;rsquo;s very little compared to what can be done under Emacs. I&amp;rsquo;m using Doom Emacs, and in addition to the available key bindings, like &lt;code&gt;SPC SPC&lt;/code&gt; or &lt;code&gt;SPC .&lt;/code&gt; which allows to find any file in the current project or elsewhere, I added some handy key bindings: &lt;code&gt;s-&amp;amp;&lt;/code&gt; let me switch between opened buffer for the current project (this is &lt;code&gt;persp-switch-to-buffer&lt;/code&gt;), and &lt;code&gt;s-@&lt;/code&gt; (&lt;code&gt;+workspace:switch-next&lt;/code&gt;); &lt;code&gt;s-←&lt;/code&gt;, &lt;code&gt;s-→&lt;/code&gt;, &lt;code&gt;s-↑&lt;/code&gt; and &lt;code&gt;s-↓&lt;/code&gt; to navigate between frames (like &lt;code&gt;windmove&lt;/code&gt;); &lt;code&gt;s-P&lt;/code&gt;, &lt;code&gt;s-$&lt;/code&gt;, &lt;code&gt;s-B&lt;/code&gt; to toggle &lt;code&gt;M-x&lt;/code&gt;, minor mode &lt;code&gt;M-x&lt;/code&gt; and &lt;code&gt;treemacs&lt;/code&gt;, respectively.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Multiple projects: The very fact that we can work on several projects during the same session is undoubtedly one of the most important aspects of Emacs. It&amp;rsquo;s not much that we can work on a Python project, and an R session, and some Scheme code alongside. I would better think of it as a way to have a permanent log book and a buffer for quick note taking, a shell, and a woring project (be it in Python and/or R). I always found that Atom or VS Code, which are definitely project-centric editors, were quite limiting in this regard, unless you&amp;rsquo;re willing to open another editor and eat up another part of your RAM.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Embedded shell and process: This is definitely what has always been missing in Textmate or Atom &amp;mdash; having a proper shell embedded along the text editor, where you can send commands and process the results. I can spend a whole day without even opening iTerm2 when I&amp;rsquo;m writing some R or Python code in Emacs.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Keyboard centric approach: Last but not least, I&amp;rsquo;m so used to Emacs (and some Vim) keybindings that I always have a hard time rewiring my fingers to deal with another key mapping set.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Of course, VS code looks pretty, comes full of nice feature and integrates all the modern tools for test-driven development and continuous integration. Updating the whole packages and the application itself is less risky than upgrading Doom Emacs or Spacemecs sometimes, because money of course (I mean, there&amp;rsquo;s probably an army of paid developers behind VS Code, while only benevolent folks take care of package development and maintenance on the Emacs side). However, the advance of &lt;code&gt;lsp-mode&lt;/code&gt; and related projects will likely make Emacs even more comfortable in the near future. Note that I do not even talk of functional hackers who might miss a lot of Emacs features for Lisp (Slime or Sly), Scheme (Geiser) or Clojure (CIDER) development after switching to web-centric UIs. Remember this?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Modern text editors have higher latency than 42-year-old Emacs. Text editors! What can be simpler? &amp;mdash; &lt;a href="https://tonsky.me/blog/disenchantment/"&gt;Software disenchantment&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Finally, I would say that Emacs affords some kind of digital minimalism, precisely because of what some folks think of a rough UI. However, once you get a pretty informative modeline, a project drawer, a task runner, a nice Git interface, you&amp;rsquo;re close to being as productive as VC coders, IMO. Here&amp;rsquo;s one example of a recent Emacs session during which I was writing some R code. This is powered by Doom emacs and the R langage server (running on top of ESS), btw. Although VS Code offers split view (horizontal and vertical), I like the fact that Emacs allows to have a shell together with a running process while editing some code, and that you can send any R command or region to the R console (and not the shell) by simply using &lt;code&gt;C-RET&lt;/code&gt;.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2020-06-23-09-25-43.png"&gt;
&lt;/figure&gt;</description></item><item><title>June in review</title><link>https://aliquote.org/post/micro-review-013/</link><pubDate>Mon, 15 Jun 2020 16:36:15 +0200</pubDate><guid>https://aliquote.org/post/micro-review-013/</guid><description>&lt;p&gt;I still have a lot of bookmarks lurking around in Safari, since I overlooked some of them for a while. Anyway, here it goes. Note that quick links have been posted on the &lt;a href="https://aliquote.org/micro"&gt;Micro&lt;/a&gt; section instead.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;I&amp;rsquo;m no longer an active reviewer for scientific journals, but this little tool, &lt;a href="https://github.com/hoffmangroup/pdfcomments/blob/master/README.md"&gt;pdfcomments&lt;/a&gt;, would certainly have been helpful when I was.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Statically &lt;a href="https://github.com/JuliaArrays/StaticArrays.jl"&gt;sized arrays&lt;/a&gt; for Julia looks like an interesting projects. I&amp;rsquo;ve read some Rust code about immutable and sized vectors or matrices, but of course this is all about Julia. According to the benchmark, they got a 65x speedup for QR decomposition, which is very nice for OLS problems. While we&amp;rsquo;re on numerical computing, I recently came across &lt;a href="https://sleef.org"&gt;SLEEF&lt;/a&gt;, a vectorized math library.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://cypher.codes/writing/transforming-python-asts-to-optimize-comprehensions-at-runtime"&gt;Transforming Python ASTs to Optimize Comprehensions&lt;/a&gt;. A very nice discussion of AST in Python, and an in-depth look at list comprehensions and how to optimize them.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;TIL about &lt;a href="https://github.com/cxxxr/sblint"&gt;SBLint&lt;/a&gt;, which is a linter for Common Lisp source code using SBCL.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;This has been a recuring theme in biomedical statistics: should we optimize the sample for statistical power or precision. Here&amp;rsquo;s an &lt;a href="https://malco.io/2020/05/26/estimating-sample-size-for-precision-precisely-0-1-0/"&gt;R package&lt;/a&gt; which is based on the work of &lt;a href="https://pubmed.ncbi.nlm.nih.gov/29912015/"&gt;Rothman and Greenlad&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://torvaney.github.io/projects/human-rng"&gt;How to pick a random number from 1-10&lt;/a&gt;. I like this kind of posts, which I always find very entertaining (both for the math and the R code). This reminds me of David Robinson&amp;rsquo;s &lt;a href="http://varianceexplained.org/r/riddler-prisoner-flip/"&gt;posts on puzzles&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="http://calpaterson.com/mypy-hints.html"&gt;Applying mypy to real world projects&lt;/a&gt;. I rarely use typed Python, if there&amp;rsquo;s such a word for when you supply yourself types to function parameters and return values. I followed some of &lt;a href="https://joelgrus.com"&gt;Joel Grus&lt;/a&gt;&amp;rsquo; coding session last for the Advent of code, and he was using optional static typing along along. Maybe I should give it a try, providing Emacs allows for running &lt;a href="http://mypy-lang.org"&gt;mypy&lt;/a&gt; automagically on save. Unrelated to this, I recently came across another nice post on Python: &lt;a href="https://arpitbhayani.me/blogs/python-caches-integers"&gt;Python Caches Integers&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Last but not least, &lt;a href="https://www.tandfonline.com/doi/full/10.1080/01621459.2020.1762613"&gt;Prediction, Estimation, and Attribution&lt;/a&gt; by Brad Efron was recently published online. If you are looking for a solid account of the performance common ML techniques against traditional statistical models, this is the article to read, together with some of Frank Harrell&amp;rsquo;s blog posts from &lt;a href="https://www.fharrell.com/post/stat-ml/"&gt;2018&lt;/a&gt; and &lt;a href="https://www.fharrell.com/post/addvalue/"&gt;2019&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;The twenty-first century2 has seen the rise of an extraordinary collection of prediction algorithms: random forests, gradient boosting, support vector machines, neural nets (including deep learning), and others. I will refer to these collectively as the “pure prediction algorithms” to differentiate them from the traditional prediction methods illustrated in the previous section. Some spectacular successes—machine translation, iPhone’s Siri, facial recognition, championship chess, and Go programs—have elicited a tsunami of public interest. If media attention is the appropriate metric, then the pure prediction algorithms are our era’s statistical stars.&lt;br&gt;The adjective &amp;ldquo;pure&amp;rdquo; is justified by the algorithms’ focus on prediction, to the neglect of estimation and attribution. Their basic strategy is simple: to go directly for high predictive accuracy and not worry about surface plus noise models. This has some striking advantages and some drawbacks, too.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ PJ Harvey • &lt;em&gt;The Peel Sessions&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Welcome to the Matrix</title><link>https://aliquote.org/post/matrix-riot/</link><pubDate>Sat, 13 Jun 2020 08:36:19 +0200</pubDate><guid>https://aliquote.org/post/matrix-riot/</guid><description>&lt;p&gt;&lt;a href="https://matrix.org"&gt;Matrix&lt;/a&gt; is a decentralized network for secure messaging and a bridge for &lt;a href="https://matrix.org/bridges"&gt;other protocols&lt;/a&gt;, including Slack, Telegram or Discord. At its heart, it basically consists of servers and clients, where messages are replicated over the network and can be processed by different clients, using different messaging protocol. For instance, you could use your favorite IRC client to send a message to a Matrix channel, while the reverse also holds: a Matrix user can connect to Freenode using, e.g., the &lt;a href="https://about.riot.im"&gt;Riot&lt;/a&gt; application. An advantage of decentralization is that there&amp;rsquo;s no interruption in case one server fall down, and your conversation remain alive when you switch from your Desktop client to your mobile phone. No more IRC bouncer needed, you get the same experience as with Discord: your conversations stay archived, available at all time, and they can even be deleted or edited, while offering rich-content support. And there&amp;rsquo;s VoIP! In a sense, this is the &lt;a href="https://blog.jwf.io/2017/08/riot-matrix-irc/"&gt;IRC for the 21st century&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Maintained by the non-profit Matrix.org Foundation, we aim to create an open platform which is as independent, vibrant and evolving as the Web itself&amp;hellip; but for communication. &lt;a href="https://matrix.org"&gt;matrix.org&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I&amp;rsquo;ve been using IRC occasionally several years ago, until it somewhat fades away because of Google talk and groups, Q&amp;amp;As sites like Stack Overflow, Reddit or Hacker News, and lately Gitter. Well, this was probably at the same time I had an ICQ account, really. In a certain sense, Matrix provides to IRC and other messaging protocols what &lt;a href="https://trillian.im/web/6.3/"&gt;Trilian&lt;/a&gt; or &lt;a href="https://adium.im"&gt;Adium&lt;/a&gt; were to ICQ and the rest of the messaging apps at that time. I&amp;rsquo;ve got into Matrix some months ago. I really did heard about the project two years ago, but I was not really interested at that time. Now, with my joigning some IRC folks from time to time, I thought I will either have to setup a self-hosted IRC bouncer like znc (otherwise, it really sucks sometimes) &amp;mdash; since free bouncer are just a joke, apparently &amp;mdash; or I will have to find a way to keep my chat sessions archived. When I&amp;rsquo;m not using Emacs as my IRC client, I am happy with Textual which allows to keep a large history of past conversations. Yet this does not solve the problem that everything is lost when you&amp;rsquo;re away. As for connecting to Discord, I can use &lt;a href="https://aliquote.org/post/discord-bitlbee/"&gt;Bitlbee&lt;/a&gt;, and even get notifications when someone ping me on Discord. Again, this is just plain IRC, so no rich-content, no screen sharing or face-to-face video calls, and no history of past conversations.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2020-06-13-10-48-36.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Here comes Riot, which acts as a glue app to provide an unified and better (as a matter of fact) experience with IRC, Slack, Telegram, Discord, and Matrix of course. Note that the authors really take security issues seriously: you can verify all (present or previously) connected devices using two-way auth, and conversations are well secured if you allow the app to encrypt them. I don&amp;rsquo;t use Slack, I no longer use Telegram, and I didn&amp;rsquo;t test the &lt;a href="https://matrix.org/bridges/#discord"&gt;Discord&lt;/a&gt; bridge, which apparently works &lt;a href="https://github.com/matrix-org/matrix-appservice-irc"&gt;both&lt;/a&gt; &lt;a href="https://github.com/matrix-org/matrix-ircd/blob/master/README.md"&gt;ways&lt;/a&gt;. As the time of this writing, the IRC &amp;lt;-&amp;gt; Riot bridge seems a bit buggy since I can&amp;rsquo;t identify my IRC nickname on Matrix, so I keep joining IRC channels like a ghost. Maybe this is related to &lt;a href="https://github.com/matrix-org/matrix-appservice-irc/issues/944"&gt;this issue&lt;/a&gt;, or not. I look forward to finding an easy solution in a timely manner. For the time being, I&amp;rsquo;m happy visiting some Matrix or Gitter channels and have a complete record of the conversations happening on the IRC channels I usually follow (e.g., #racket, #lisp, #clojure, #scheme, #org-mode).&lt;/p&gt;</description></item><item><title>Mann Whitney test</title><link>https://aliquote.org/post/mann-whitney/</link><pubDate>Fri, 05 Jun 2020 19:29:21 +0200</pubDate><guid>https://aliquote.org/post/mann-whitney/</guid><description>&lt;p&gt;The Wilcoxon-Mann-Whitney test, or simply the Mann-Whitney (MW) test for SPSS, SAS and probably more casual users, is a nonparametric test that is commonly used to compare the location parameters of two distributions having the same shape.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; Note that it is &lt;a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1120984/"&gt;not a test of the medians&lt;/a&gt; of the two distributions (there exist a &lt;a href="https://en.wikipedia.org/wiki/Median_test"&gt;median test&lt;/a&gt; or a test of the median of the differences based on the Hodges–Lehmann estimator for that purpose), but see &lt;a href="https://journals.sagepub.com/doi/pdf/10.1177/1536867X1201200202"&gt;What hypotheses do &amp;ldquo;nonparametric&amp;rdquo; two-group tests actually test?&lt;/a&gt; (PDF). It is often referred to the Wilcoxon &lt;em&gt;rank sum test&lt;/em&gt; as indicated in the R help page for &lt;code&gt;wilcox.test&lt;/code&gt;.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; In the case only one sample is tested, including the case of two paired samples, against a theoretical parameter value, it is best known as the Wilcoxon &lt;em&gt;signed rank test&lt;/em&gt;. There are various way to compute the p-value (with or without continuity correction using a normal approcimation) and to report the test statistic (either as a &lt;em&gt;U&lt;/em&gt; or $\text{N}(0;1)$-based &lt;em&gt;z&lt;/em&gt; statistic). Let&amp;rsquo;s just remember that there are approximate (for large sample) and exact methods for computing the &lt;em&gt;p&lt;/em&gt;-value.&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt; Also, the Mann-Whitney statistic appears to be a monotonic function of a &lt;em&gt;t&lt;/em&gt;-statistic computed on the ranks, hence it can be seen as a test for the difference of expected mean rank for two samples. Also, per the R documentation:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The literature is not unanimous about the definitions of the Wilcoxon rank sum and Mann-Whitney tests. The two most common definitions correspond to the sum of the ranks of the first sample with the minimum value subtracted or not: R subtracts and S-PLUS does not, giving a value which is larger by m(m+1)/2 for a first sample of size m. (It seems Wilcoxon&amp;rsquo;s original paper used the unadjusted sum of the ranks but subsequent tables subtracted the minimum.)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2020-09-23]&lt;/small&gt;&lt;br&gt;
See also &lt;a href="https://www.fharrell.com/post/po/"&gt;Violation of Proportional Odds is Not Fatal&lt;/a&gt; to learn more about the connection between the MW test and the pEroportional odds model.&lt;br&gt;
&lt;small&gt;[2022-04-18]&lt;/small&gt;&lt;br&gt;
A more recent post by Frank Harrell discussed the &lt;a href="https://www.fharrell.com/post/powilcoxon"&gt;equivalence of Wilcoxon Statistic and Proportional Odds Model&lt;/a&gt;.
&lt;/div&gt;
&lt;p&gt;The MW test is also available in Stata as &lt;a href="https://www.stata.com/help.cgi?ranksum"&gt;ranksum&lt;/a&gt;, and in Python scipy as &lt;a href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.mannwhitneyu.html"&gt;stats.mannwhitneyu&lt;/a&gt;. It is recommended to Python users to &amp;ldquo;use (it) only when the number of observation in each sample is &amp;gt; 20 and you have 2 independent samples of ranks,&amp;rdquo; though Mann &amp;amp; Whitney computed tables for the probability of &lt;em&gt;U&lt;/em&gt; for sample size ≤ 8, while Lehmann reported that the actual efficiency of the MW test is close to Pitman&amp;rsquo;s Asymptotic Relative Efficiency (ARE) evne in the case where n = 5 (in both samples).&lt;sup id="fnref:4"&gt;&lt;a href="#fn:4" class="footnote-ref" role="doc-noteref"&gt;4&lt;/a&gt;&lt;/sup&gt; To approximate sample size required for the MW test, one could start with estimating the sample size for an equivalent $t$-test and then adjust the sample size based on the ARE of the MW test.&lt;sup id="fnref:5"&gt;&lt;a href="#fn:5" class="footnote-ref" role="doc-noteref"&gt;5&lt;/a&gt;&lt;/sup&gt; For instance, assuming a normal distribution the ARE of the MW test relative to Student &lt;em&gt;t&lt;/em&gt;-test is 3/π = 0.955,&lt;sup id="fnref:6"&gt;&lt;a href="#fn:6" class="footnote-ref" role="doc-noteref"&gt;6&lt;/a&gt;&lt;/sup&gt; which means you can simply take the optimal n for a &lt;em&gt;t&lt;/em&gt;-test and divide it by this value. More elaborated formula have been proposed, though, including the use of &lt;a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2796701/"&gt;exemplary dataset&lt;/a&gt;. Finally, regarding power, Lehman notes (p. 81) that:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;When nothing is known about the shape of the distribution, and particularly for distributions whose tails are very much heavier than those of the normal distribution (&amp;hellip;), the Wilcoxon test may be considerably more efficient than the &lt;em&gt;t&lt;/em&gt;-test.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Of course, a wide range of statistical software offer the Wilcoxon tests in their base packages. Let us consider some data from Stata:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="n"&gt;webuse&lt;/span&gt; &lt;span class="n"&gt;fuel2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="n"&gt;ranksum&lt;/span&gt; &lt;span class="n"&gt;mpg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;by&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;treat&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Two&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;sample&lt;/span&gt; &lt;span class="n"&gt;Wilcoxon&lt;/span&gt; &lt;span class="n"&gt;rank&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;sum&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Mann&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Whitney&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;test&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;treat&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;obs&lt;/span&gt; &lt;span class="n"&gt;rank&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt; &lt;span class="n"&gt;expected&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;-------------+---------------------------------&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;untreated&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt; &lt;span class="mi"&gt;128&lt;/span&gt; &lt;span class="mi"&gt;150&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;treated&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt; &lt;span class="mi"&gt;172&lt;/span&gt; &lt;span class="mi"&gt;150&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;-------------+---------------------------------&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;combined&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt; &lt;span class="mi"&gt;300&lt;/span&gt; &lt;span class="mi"&gt;300&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;unadjusted&lt;/span&gt; &lt;span class="n"&gt;variance&lt;/span&gt; &lt;span class="mf"&gt;300.00&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;adjustment&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;ties&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;4.04&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;----------&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;adjusted&lt;/span&gt; &lt;span class="n"&gt;variance&lt;/span&gt; &lt;span class="mf"&gt;295.96&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Ho&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;mpg&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;treat&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="n"&gt;untreated&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;mpg&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;treat&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="n"&gt;treated&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;z&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;1.279&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Prob&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.2010&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now, in R:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="n"&gt;haven&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;read_dta&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;http://www.stata-press.com/data/r15/fuel2.dta&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;wilcox.test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mpg&lt;/span&gt; &lt;span class="o"&gt;~&lt;/span&gt; &lt;span class="n"&gt;treat&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;correct&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;FALSE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Wilcoxon&lt;/span&gt; &lt;span class="n"&gt;rank&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt; &lt;span class="n"&gt;test&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;mpg&lt;/span&gt; &lt;span class="n"&gt;by&lt;/span&gt; &lt;span class="n"&gt;treat&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;W&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0.201&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;alternative&lt;/span&gt; &lt;span class="n"&gt;hypothesis&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;true&lt;/span&gt; &lt;span class="n"&gt;location&lt;/span&gt; &lt;span class="n"&gt;shift&lt;/span&gt; &lt;span class="n"&gt;is&lt;/span&gt; &lt;span class="n"&gt;not&lt;/span&gt; &lt;span class="n"&gt;equal&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;small&gt;A more precise p-value is 0.20096117142482586.&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;Finally, the Python version:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;scipy.stats&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;mannwhitneyu&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;pandas&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;pd&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read_stata&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;http://www.stata-press.com/data/r15/fuel2.dta&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;groupby&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;treat&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get_group&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;untreated&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;mpg&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;groupby&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;treat&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get_group&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;treated&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;mpg&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="n"&gt;mannwhitneyu&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;use_continuity&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;False&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;alternative&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;two-sided&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Out&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="n"&gt;MannwhitneyuResult&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;statistic&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;50.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pvalue&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;0.20096117142482584&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;small&gt;There&amp;rsquo;s probably some arcane way to split the Pandas data frame into separate series of values, something simple akin to R&amp;rsquo;s &lt;code&gt;base::split&lt;/code&gt; and not involving melting, but I must admit I was too lazy to Google for it.&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s it! Stata does not offer any continuity correction but can report exact p-value for sample sizes up to 200. I don&amp;rsquo;t know which algorithm they use, though, but it might be interesting to use the approach suggested by Nagarajan &amp;amp; Keich&lt;sup id="fnref1:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt; as a benchmark.&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;H.B. Mann and D.R. Whitney. &lt;a href="https://projecteuclid.org/euclid.aoms/1177730491"&gt;On a Test of Whether one of Two Random Variables is Stochastically Larger than the Other&lt;/a&gt;. &lt;em&gt;Ann. Math. Statist.&lt;/em&gt; 18(1) (1947), 50-60.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;Stata technical note ([R], p. 2074 for Stata 14) is more verbose than R on this point: &amp;ldquo;We follow the great majority of the literature in naming these tests for Wilcoxon, Mann, and Whitney. However, they were independently developed by several other researchers in the late 1940s and early 1950s. In addition to Wilcoxon, Mann, and Whitney, credit is due to Festinger (1946), Whitfield (1947), Haldane and Smith (1947), and Van der Reyden (1952). Leon Festinger (1919–1989), John Burdon Sanderson Haldane (1892–1964), and Cedric Austen Bardell Smith (1917–2002) are well known for other work, but little seems to be known about Whitfield or van der Reyden. For a detailed study, including information on these researchers, see Berry, Mielke, and Johnston (2012).&amp;rdquo;&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:3"&gt;
&lt;p&gt;N. Nagarajan and U. Keich. &lt;a href="http://users.umiacs.umd.edu/~niranjan/papers/NagarajanKeichCS09.pdf"&gt;Reliability and efficiency of algorithms for computing the significance of the Mann–Whitney test&lt;/a&gt;. Comput. Stat. 24(605) (2009).&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&amp;#160;&lt;a href="#fnref1:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:4"&gt;
&lt;p&gt;E.L. Lehman and H.J.M. D&amp;rsquo;Abrera. &lt;em&gt;Nonparametrics: Statistical Methods Based on Ranks&lt;/em&gt;. Holden-Day (1975).&amp;#160;&lt;a href="#fnref:4" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&amp;#160;&lt;a href="#fnref1:4" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:5"&gt;
&lt;p&gt;As a rule of thumb which I have in my notes although I don&amp;rsquo;t remember where I could possibly get it, for a nonparametric test you could also compute the sample size required for a t-test and add 15%, which is close to the lower bound of the ARE for the MW test (0.864), see van der Vaart&lt;sup id="fnref1:6"&gt;&lt;a href="#fn:6" class="footnote-ref" role="doc-noteref"&gt;6&lt;/a&gt;&lt;/sup&gt; or Lehman&lt;sup id="fnref1:4"&gt;&lt;a href="#fn:4" class="footnote-ref" role="doc-noteref"&gt;4&lt;/a&gt;&lt;/sup&gt;.&amp;#160;&lt;a href="#fnref:5" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:6"&gt;
&lt;p&gt;van der Vaart, A.W. &lt;em&gt;Asymptotic Statistics&lt;/em&gt;. Cambridge University Press (1998).&amp;#160;&lt;a href="#fnref:6" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&amp;#160;&lt;a href="#fnref1:6" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Emacs for the 21st Century</title><link>https://aliquote.org/post/emacs-21st-century/</link><pubDate>Thu, 04 Jun 2020 12:11:03 +0200</pubDate><guid>https://aliquote.org/post/emacs-21st-century/</guid><description>&lt;p&gt;Emacs has a long tradition of being a versatlie text editor for code, prose, GTD, and it may even replace your OS if you&amp;rsquo;re into this kind of stuff (don&amp;rsquo;t be kiddy, though, read a more &lt;a href="https://writequit.org/eos/eos.html"&gt;opinionated version&lt;/a&gt;). I discovered Emacs when I was doing my PhD, and never looked back &amp;ndash; except when Textmate came up a while back. Too late to change: I&amp;rsquo;m probably too old now, and I would probably not really know how to use another editor in any case. &lt;a href="https://news.ycombinator.com/item?id=18398324"&gt;Emacs is Emacs&lt;/a&gt;, after all.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;While Emacs proponents largely agree that it is the world’s greatest text editor, it is almost as much a Lisp machine disguised as an editor. Indeed, one of its chief appeals is that it is programmable via its own programming language. Emacs Lisp is a Lisp in the classic tradition. In this article, we present the history of this language over its more than 30 years of evolution. Its core has remained remarkably stable since its inception in 1985, in large part to preserve compatibility with the many third-party packages providing a multitude of extensions. Still, Emacs Lisp has evolved and continues to do so. &amp;mdash; &lt;a href="https://www.iro.umontreal.ca/~monnier/hopl-4-emacs-lisp.pdf"&gt;Evolution of Emacs Lisp&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I&amp;rsquo;m not alone, hopefully, and you&amp;rsquo;ll find many accounts of why Emacs is great, e.g., &lt;a href="https://www.fugue.co/blog/2018-08-09-two-years-with-emacs-as-a-cto.html"&gt;Two Years With Emacs as a CEO (and now CTO)&lt;/a&gt;, the latest random &amp;ldquo;&lt;a href="https://protesilaos.com/codelog/2019-08-11-why-emacs-switch/"&gt;why I switched to&lt;/a&gt;&amp;rdquo; I found on DuckDuckGo &amp;mdash; there are so many, or &lt;a href="https://eamonnsullivan.co.uk/posts-output/2020-04-25-remote-first-emacs/"&gt;Remote First, Pair Programming and Emacs&lt;/a&gt;, for the latest I came across today.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m not that fancy regarding Emacs config, nor do I have to do exceptionally hard things in Emacs. I just want a punctilious text editor, with good support for text spelling (occasionally) and linting(always &amp;mdash; that&amp;rsquo;s where being a bit obsessive bless), that allows me to open as many buffers as I want (regardless of the working directory, okay Vim?), including shell and the like. Emacs does the job, and it does it right, that&amp;rsquo;s all!&lt;/p&gt;
&lt;p&gt;I have countless of personal &lt;code&gt;.emacs.d&lt;/code&gt; config stored in my bookmark list, I keep posting &lt;a href="https://aliquote.org/search/?s=%23emacs"&gt;various links&lt;/a&gt;, and I recently spent a fair amount of time (re)configuring how my Emacs looks. I fear that only those who abound in the sense of ultimate procrastination will be able to understand the joy that a tiny change in the way colors are used to edit Python or Lisp code can bring. Or how you can solve this fucking &lt;a href="https://github.com/hlissner/doom-emacs/issues/2967"&gt;issue&lt;/a&gt; with &lt;a href="https://github.com/seagle0128/doom-modeline"&gt;doom-modeline&lt;/a&gt; right-handed overflow after more than one year. Yes, this is just Emacs after all, you can make it looks the way you want, if you have a good search engine and time to waste of course.&lt;/p&gt;
&lt;p&gt;That being said, it&amp;rsquo;s been three weeks that I processed all incoming emails through &lt;a href="https://www.djcbsoftware.nl/code/mu/mu4e.html"&gt;mu4e&lt;/a&gt;, and that I used &lt;a href="https://github.com/akermu/emacs-libvterm"&gt;vterm&lt;/a&gt; (not that &lt;a href="https://github.com/vterm/vterm,"&gt;vterm&lt;/a&gt;) as a handy replacement for my default terminal (&lt;a href="https://www.iterm2.com"&gt;iTerm2&lt;/a&gt;), not to forget &lt;code&gt;xwidget&lt;/code&gt; support which provides a way better (in some sense of &amp;ldquo;way&amp;rdquo;) experience for web browsing than &lt;a href="https://www.gnu.org/software/emacs/manual/html_mono/eww.html"&gt;eww&lt;/a&gt;. I don&amp;rsquo;t know what Emacs will be in the next decade, but surely I&amp;rsquo;m on the right track and will keep doing fine.&lt;/p&gt;</description></item><item><title>Customizing your shell</title><link>https://aliquote.org/post/customizing-iterm2/</link><pubDate>Wed, 03 Jun 2020 17:35:38 +0200</pubDate><guid>https://aliquote.org/post/customizing-iterm2/</guid><description>&lt;p&gt;I&amp;rsquo;m back to zsh after several months &lt;a href="https://aliquote.org/post/fish-shell"&gt;using Fish&lt;/a&gt;. I took this as an opportunity to update my default configuration, remove any plugin manager and pre-configured prompt or theme (e.g., &lt;a href="https://ohmyz.sh"&gt;oh-my-zsh&lt;/a&gt;). I started with Thorsten Ball&amp;rsquo;s &lt;a href="https://github.com/mrnugget/dotfiles"&gt;configuration&lt;/a&gt;, and updated it to my liking. More importantly, I decided to split the configuration into different pieces (one for the prompt, one for the aliases, etc.), in addition to the core &lt;code&gt;.zshrc&lt;/code&gt;, and to follow XDG guidelines (everything goes into &lt;code&gt;~/.config&lt;/code&gt;). My prompt now only includes the path, a Git indicator and a &lt;code&gt;λ&lt;/code&gt;, whose color is updated depending on the result of the last command (red if the last command returned an error, i.e. &lt;code&gt;$? ≠ 0&lt;/code&gt;) or the existence of pending jobs (yellow if there are suspended or sleeping jobs).&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;local&lt;/span&gt; &lt;span class="nv"&gt;dir_info_color&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;%B&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;local&lt;/span&gt; &lt;span class="nv"&gt;dir_info&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;%{&lt;/span&gt;&lt;span class="nv"&gt;$dir_info_color&lt;/span&gt;&lt;span class="s2"&gt;%}%(5~|%-1~/.../%2~|%4~)%{&lt;/span&gt;&lt;span class="nv"&gt;$reset_color&lt;/span&gt;&lt;span class="s2"&gt;%}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;local&lt;/span&gt; &lt;span class="nv"&gt;promptnormal&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;%(?.%{&lt;/span&gt;&lt;span class="nv"&gt;$fg_bold&lt;/span&gt;&lt;span class="s2"&gt;[green]%}.%{&lt;/span&gt;&lt;span class="nv"&gt;$fg_bold&lt;/span&gt;&lt;span class="s2"&gt;[red]%})λ %{&lt;/span&gt;&lt;span class="nv"&gt;$reset_color&lt;/span&gt;&lt;span class="s2"&gt;%}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;local&lt;/span&gt; &lt;span class="nv"&gt;promptjobs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;%(?.%{&lt;/span&gt;&lt;span class="nv"&gt;$fg_bold&lt;/span&gt;&lt;span class="s2"&gt;[yellow]%}.%{&lt;/span&gt;&lt;span class="nv"&gt;$fg_bold&lt;/span&gt;&lt;span class="s2"&gt;[red]%})λ %{&lt;/span&gt;&lt;span class="nv"&gt;$reset_color&lt;/span&gt;&lt;span class="s2"&gt;%}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;PROMPT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;${dir_info}$(git_prompt_info) %(1j.$promptjobs.$promptnormal)&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;With quarantine and all., I had to strengthen my &amp;ldquo;work from home&amp;rdquo; setup. I have a remote access to the computers at my lab, and I wanted to customize my terminal a bit. In my case, this is iTerm2 but this should apply to any terminal. What I really wanted was to add some useful information to my prompt, without adding too much of a mess on the existing one. It is worth noting the following only makes use of the right prompt. With many (pseudo-)terminals arranged in panes or in separate windows, it often becomes hard to remember which ones are connected via ssh. Here is what I have in my zsh config file for managing the right prompt:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;function&lt;/span&gt; preexec&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;timer&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;timer&lt;/span&gt;&lt;span class="k"&gt;:-&lt;/span&gt;&lt;span class="nv"&gt;$SECONDS&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;_is_ssh&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;[[&lt;/span&gt; -n &lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;SSH_CONNECTION&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="si"&gt;}${&lt;/span&gt;&lt;span class="nv"&gt;SSH_CLIENT&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="si"&gt;}${&lt;/span&gt;&lt;span class="nv"&gt;SSH_TTY&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;function&lt;/span&gt; precmd&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; _is_ssh &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;((&lt;/span&gt; &lt;span class="nv"&gt;EUID&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="o"&gt;))&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;remote&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;@&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="p"&gt;(%)&lt;/span&gt;&lt;span class="k"&gt;:-&lt;/span&gt;&lt;span class="p"&gt;%m&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;else&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;remote&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nv"&gt;$timer&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;toc&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$((&lt;/span&gt;&lt;span class="nv"&gt;$SECONDS&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nv"&gt;$timer&lt;/span&gt;&lt;span class="k"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;toc&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; -ge &lt;span class="m"&gt;5&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;RPROMPT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;%F{cyan}&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;toc&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;s %F{blue}&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;remote&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;% {&lt;/span&gt;&lt;span class="nv"&gt;$reset_color&lt;/span&gt;&lt;span class="s2"&gt;%}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;RPROMPT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;%F{blue}&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;remote&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; %{&lt;/span&gt;&lt;span class="nv"&gt;$reset_color&lt;/span&gt;&lt;span class="s2"&gt;%}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;unset&lt;/span&gt; timer
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The above code ensures that the execution time of long commands (i.e., which took more than 5 seconds) is displayed in the right prompt, together with the short name of the server into which I ssh&amp;rsquo;ed when this is the case. Now, I hope I will never forget (again) that I&amp;rsquo;m on a remote server and not on my local computer when I &lt;code&gt;cp&lt;/code&gt; or &lt;code&gt;rm&lt;/code&gt; stuff in the home directory.&lt;/p&gt;
&lt;p&gt;As a last note, while I am happy with iTerm on my Macbook I use Tmux on remote servers, mostly for portability, to facilitate window navigation, and to ensure that I can restore my shell at any time when I reconnect to the server later. First, in zsh, I added a short function that checks whether there are any existing Tmux sessions. (This is entirely borrowed from &lt;a href="https://jamesoff.net/2017/08/26/tmux-configuration.html"&gt;James Seward&lt;/a&gt;.)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; -z &lt;span class="nv"&gt;$TMUX&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;sessions&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt; tmux ls 2&amp;gt; /dev/null &lt;span class="p"&gt;|&lt;/span&gt; awk &lt;span class="s1"&gt;&amp;#39;! /attached/ { sub(&amp;#34;:&amp;#34;, &amp;#34;&amp;#34;, $1); print $1; }&amp;#39;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; xargs &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="k"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; ! -z &lt;span class="nv"&gt;$sessions&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;⚠ Available tmux session(s): \033[34m&lt;/span&gt;&lt;span class="nv"&gt;$sessions&lt;/span&gt;&lt;span class="s2"&gt;\033[0m&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;unset&lt;/span&gt; sessions
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Second, my Tmux config file itself is quite limited and I do not use any external plugin, again for portability issues. However, I updated the status line a bit:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;set&lt;/span&gt; -g status-style &lt;span class="nv"&gt;fg&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;white,bg&lt;span class="o"&gt;=&lt;/span&gt;black
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;set&lt;/span&gt; -g status-interval &lt;span class="m"&gt;5&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;set&lt;/span&gt; -g window-status-format &lt;span class="s2"&gt;&amp;#34;#[fg=colour8]○ #W &amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;set&lt;/span&gt; -g window-status-current-format &lt;span class="s2"&gt;&amp;#34;#[fg=colour4]● #W &amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;set&lt;/span&gt; -g window-status-current-style &lt;span class="nv"&gt;bg&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;black,fg&lt;span class="o"&gt;=&lt;/span&gt;white
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;set&lt;/span&gt; -g window-status-activity-style &lt;span class="nv"&gt;bg&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;black,fg&lt;span class="o"&gt;=&lt;/span&gt;yellow
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;set&lt;/span&gt; -g window-status-separator &lt;span class="s2"&gt;&amp;#34;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;set&lt;/span&gt; -g status-justify left
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;set&lt;/span&gt; -g status-right &lt;span class="s2"&gt;&amp;#34;#[fg=yellow]♯#S #[fg=white]| #[fg=blue]#(whoami)#[fg=white] on #h&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;set&lt;/span&gt; -g status-left &lt;span class="s2"&gt;&amp;#34;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This way, I have a list of the active and inactive windows (on the left), the name of the session, the user and the server name (on the right).&lt;/p&gt;
&lt;video class="tab" controls&gt;
&lt;source src="https://aliquote.org/img/tmuxing.mp4"/&gt;
&lt;/video&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;There are many custom prompt setup available on the web, and &lt;a href="https://github.com/fniessen/shell-leuven"&gt;Fabrice Niessen&lt;/a&gt; wrote a nice one for zsh or bash.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>May in review (2)</title><link>https://aliquote.org/post/micro-review-06-2020/</link><pubDate>Tue, 02 Jun 2020 19:17:25 +0200</pubDate><guid>https://aliquote.org/post/micro-review-06-2020/</guid><description>&lt;p&gt;May is over, already. Although I kept reading (paper) books and writing blog posts, I found myself leaving lot of RSS stuff behind. One of the reason is that I spent way too much time on Twitter or electronic newspapers in March &amp;mdash; which I consult on my phone most of the time, so I decided to take a break with my iPhone in May. As a consequence, my RSS feeds exceed more than 200 posts on several occasion and it took me some time to consume most of them. Here is my selection as one the first monthly micro review published in June. And &lt;a href="https://danielmiessler.com/blog/its-time-to-get-back-into-rss/"&gt;Long live RSS&lt;/a&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;I follow the Lispology blog (by David Johnson-Davies) since two months. Lot of nice stuff here. The &lt;a href="http://www.lispology.com/show?JHE"&gt;latest post&lt;/a&gt; deals with the &lt;code&gt;reduce&lt;/code&gt; whose result is the combined result of a given function&amp;rsquo;s being applied to successive pairs of elements of sequence per the HyperSpec manual. I use it a lot in Python or R.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the &lt;a href="https://martinheinz.dev/blog/24?utm_source=rss&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog_post_24"&gt;Ultimate Guide to Python Debugging&lt;/a&gt;, Martin Heinz discusses various ways to do some kind of logging, e.g. log files, decorators, stack traces. Debugging is an art, surely, but nobody will beat &lt;code&gt;print&lt;/code&gt; statements, especially during the initial stage of program composition.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://martin-thoma.com/sorting-big-data/"&gt;Sorting Big Data&lt;/a&gt;: An interesting discussion of sorting algorithms (e.g., &lt;a href="https://en.wikipedia.org/wiki/Radix_sort"&gt;radix sort&lt;/a&gt;) and software stack (Python+Dask, SQLite, C++) in light of large datasets (≥ 20 Go). Multi-Core Radix-Sort performs quite good apparently.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://blog.rongarret.info/2020/05/a-review-of-john-sanfords-genetic.html"&gt;A review of John Sanford&amp;rsquo;s &amp;ldquo;Genetic Entropy&amp;rdquo;&lt;/a&gt; is particularly enlightening if you are versed into genetic stuff. I&amp;rsquo;m halfway this post that I discovered yesterday and I already learned (or was reminded of) a lot of stuff.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I&amp;rsquo;m a long time subscriber to the Irreal blog. The author deals mostly with security-related issues and Emacs (with an emphasis on mail and GTD via Org mode) and there&amp;rsquo;s always something new to learn. TIL that &lt;a href="https://irreal.org/blog/?p=8888"&gt;websockets can potentially be harmful&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Each time I read some Julia code, I want to try it right now, again. See &lt;a href="https://philzucker2.nfshost.com/walk-on-spheres-method-in-julia/"&gt;Walk on Spheres Method in Julia&lt;/a&gt; to learn more about the boundary value Laplace equation $\nabla^2\phi =0$. On a related point, John Myles White is actually posting very interesting &lt;a href="https://github.com/johnmyleswhite/julia_tutorials"&gt;articles about Julia&lt;/a&gt; on Github.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://nullprogram.com/blog/2020/05/24/"&gt;Latency in Asynchronous Python&lt;/a&gt;: Another technical discussion by Chris Wellon on software performace, this time using Python and its async framework. Example of async processes are common when building &lt;a href="https://martin-thoma.com/eel/"&gt;Electron-like offline apps&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you are interested in competitive prorgramming, Brent Yorgey is regularly posting his solutions in Haskell. The last one is deals with &lt;a href="https://byorgey.wordpress.com/2020/05/22/competitive-programming-in-haskell-building-unordered-trees/"&gt;unordered trees&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I resubscribed to Andy Wheeler&amp;rsquo;s blog some months ago. I was a regular reader when I was a Cross Validated user, and we had a lot of interesting discussions on factor analysis and multivariate analysis via the QA or comment system there. I am delighted to be able to read some of &lt;a href="https://andrewpwheeler.com/2020/05/22/conjoint-analysis-of-crime-rankings/"&gt;his posts&lt;/a&gt; after 10 years, not forgetting folks like &lt;a href="http://freerangestats.info/about/"&gt;Peter Ellis&lt;/a&gt;, &lt;a href="https://fromthebottomoftheheap.net"&gt;Gavin Simpson&lt;/a&gt;, &lt;a href="http://dirk.eddelbuettel.com"&gt;Dirk Eddelbuettel&lt;/a&gt;, or &lt;a href="https://www.johndcook.com/blog/services-2/,"&gt;John D. Cook&lt;/a&gt; to name a few. Thanks for all those good years!&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Travis Hinkelman is doing an amazing work with Chez Scheme for statistical computing. While I regularly learn &lt;a href="https://www.travishinkelman.com/posts/getting-started-with-akku-package-manager-for-scheme/"&gt;interesting things&lt;/a&gt; about Chez, I&amp;rsquo;ve come to appreciate Racket a lot more.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Natalie Merchant • &lt;em&gt;Ophelia&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>On text linting</title><link>https://aliquote.org/post/text-linting/</link><pubDate>Fri, 29 May 2020 10:33:29 +0200</pubDate><guid>https://aliquote.org/post/text-linting/</guid><description>&lt;p&gt;Doom Emacs comes with a lot of predefined customizations for writing prose using Markdown or Org. This ranges from highlighting or hiding (concealing) elements of the markup language itself, like replacing header marks with custom bullets in Org mode, to handy utilities for syntax and spell checking. The later are now available in a custom layer:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; :checkers
spell
grammar
(syntax +childframe)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;spell&lt;/code&gt; module takes care of activating Flyspell in &lt;code&gt;text-mode&lt;/code&gt;, while &lt;code&gt;grammar&lt;/code&gt; adds &lt;a href="https://languagetool.org/"&gt;languagetool&lt;/a&gt; and &lt;a href="https://github.com/bnbeckwith/writegood-mode"&gt;writegood-mode&lt;/a&gt; to the spell checker. I added the &lt;a href="https://github.com/tmalsburg/guess-language.el"&gt;guess-language&lt;/a&gt; package because I was tired of switching from one dictionary to the other depending on the buffer I was editing. It works pretty well, although this package doesn&amp;rsquo;t honor local variable, e.g. &lt;code&gt;# -*- ispell-dictionary: &amp;quot;french&amp;quot; -*-&lt;/code&gt; on the first line of an Org buffer to switch to a French dictionary. Enough for spell checking, let&amp;rsquo;s see what&amp;rsquo;s going on with syntax checkers.&lt;/p&gt;
&lt;p&gt;Of course, syntax checkers are mostly used in &lt;code&gt;prog-mode&lt;/code&gt;, think of &lt;a href="https://eslint.org"&gt;eslint&lt;/a&gt; or &lt;a href="https://github.com/jimhester/lintr"&gt;lintr&lt;/a&gt;, for instance. They are well integrated into Flycheck nowadays. Note that some of the available linters offer both a checker and a way to automatically fix any error that was encountered during the checking stage. Anyway, syntax checkers are also available for &lt;code&gt;text-mode&lt;/code&gt;, e.g. Markdown and Org (but also ResT or Asciidoc). In Doom Emacs, &lt;a href="https://github.com/amperser/proselint"&gt;proselint&lt;/a&gt; is the default checker for Org mode, while for Markdown you can install &lt;a href="https://github.com/DavidAnson/markdownlint"&gt;markdownlint&lt;/a&gt; &amp;ndash; this is what I use at the moment &amp;ndash; or &lt;a href="https://github.com/markdownlint/markdownlint"&gt;mdl&lt;/a&gt;.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2020-05-29-15-06-16.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Proselint is great,&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; but there&amp;rsquo;s another option for text processing, namely &lt;a href="https://textlint.github.io"&gt;textlint&lt;/a&gt;. It is a Node-based package, and you need to define your own set of rules and to install each component manually, but it is more versatile than Proselint in my view. You can even install plugin for &lt;code&gt;languagetool,&lt;/code&gt; weasel-related stuff (like &lt;code&gt;writegood-mode&lt;/code&gt;), or &lt;a href="https://github.com/textlint-rule/textlint-rule-proselint"&gt;proselint&lt;/a&gt; itself. The config file is where you define rules and plugins to use. If you want to make textlint recognize Org document as text file, you will need to add these lines in you &lt;code&gt;.textlintrc&lt;/code&gt; file:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;quot;plugins&amp;quot;: {
&amp;quot;@textlint/text&amp;quot;: {
&amp;quot;extensions&amp;quot;: [&amp;quot;.org&amp;quot;]
}
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The full &lt;a href="https://github.com/textlint/textlint/wiki/Collection-of-textlint-rule"&gt;list of rules&lt;/a&gt; is available on Github, and you can define your own rules if you like. Of course, specific rules can be defined on a per project basis. Here are the rules that I find particularly useful: abbr-within-parentheses, max-comma, no-todo, unexpanded-acronym, en-max-word-count, diacritics, @textlint-rule/no-invalid-control-character&amp;quot;, terminology, max-doc-width, stop-words, common-mispellins. Here are other suggestions: &lt;a href="https://www.macs.hw.ac.uk/~rs46/posts/2018-12-29-textlint-flycheck.html"&gt;A textlint flycheck checker in Emacs&lt;/a&gt;. Textlint is also able to check invalid URLs for you, see &lt;a href="https://github.com/textlint-rule/textlint-rule-no-dead-link"&gt;textlint-rule-no-dead-link&lt;/a&gt;. As a final note, consider adding the option &lt;code&gt;&amp;quot;severity&amp;quot; : &amp;quot;warning&amp;quot;&lt;/code&gt; to some of the &amp;ldquo;minor&amp;rdquo; rules, otherwise you&amp;rsquo;re likely to end up with a lot of errors which aren&amp;rsquo;t truly errors (at least in my opinion).&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;At the time I write this post, it sucks with &lt;code&gt;org-capture&lt;/code&gt; and throws an error that I was not able to resolve, but it works with standard Org buffers.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Just write</title><link>https://aliquote.org/post/just-write/</link><pubDate>Thu, 28 May 2020 16:20:49 +0200</pubDate><guid>https://aliquote.org/post/just-write/</guid><description>&lt;p&gt;I noticed recently on several blogs I follow (e.g. &lt;a href="https://jlelse.blog/links/2020/05/reddit-hnblogs/"&gt;Jan Lukas Else&lt;/a&gt;) that a recent &lt;a href="https://jlelse.blog/links/2020/05/reddit-hnblogs/"&gt;HN thread&lt;/a&gt; made it to the top with a discussion on the death of blogging.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;All of the above makes newcomers to go directly to social networks and not to independent blogs. We also have to consider that as the author says, it is hard to find blogs, and if you write almost nobody reads your blog, while on Instagram you can get hundreds of followers. &lt;br&gt;That is not going to change, that is what big companies are looking for, that is what they are pushing for. The Internet has changed. &amp;mdash; &lt;a href="https://www.garron.blog/en/blog/blogging.html"&gt;Blogging is not dead&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I don&amp;rsquo;t think blogging ever vanished with time &amp;mdash; on the contrary, there&amp;rsquo;s a plethora of tools for blogging these days, either using a CMS or static blog generators. Blog content has evolved, though, and the lifespan of blogs shows a high variability. I would even say that there&amp;rsquo;s a higher volatility. As one would expect, the more content you can find on a website, the more likely it is here to stay for a while. In the past I subscribed to several interesting blogs that disappeared after their author finished his PhD thesis or switch to another job position. Sometimes the blog remains, but the RSS feed remains empty for years. We can&amp;rsquo;t ask people to continue writing when they don&amp;rsquo;t have time or when they are no longer interested, or simply when they are &lt;a href="https://normaldeviate.wordpress.com/2013/12/16/the-end/"&gt;done with their blog&lt;/a&gt;. That&amp;rsquo;s life after all! More importantly we can&amp;rsquo;t fight with Twitter, Instagram and social aggregators like HN, or even paid blogging platform (e.g., Medium). Here&amp;rsquo;s why RSS probably matters: you can create our own personal list of feeds and stayed informed of what&amp;rsquo;s going on about your preferred blogs without having to worry about finding that very nice URL you bookmarked a while back.&lt;/p&gt;
&lt;p&gt;I too have my ups and downs (for the last 2 years it&amp;rsquo;s been more of an ups) but I never force myself to write, nor to produce necessarily perfect material. I don&amp;rsquo;t have any schedule, and I may happen to write 5 posts in a row while leaving the site derelict for weeks on end. Originally, this blog was mainly used to record what I was installing on my computer, but also to take some notes I took when reading scientific stuff. With time it evolved either as a lab notebook or simply as a list of annotated bookmarks and reading notes. I&amp;rsquo;ve been recently splitting the blog in two parts, a micro blog and the present blog which aims at hosting longer posts. I don&amp;rsquo;t check statistics regularly, but usually this site is visited by around 35-70 persons each day. That&amp;rsquo;s okay. I don&amp;rsquo;t expect much and I am already happy to have some readers.&lt;/p&gt;
&lt;p&gt;As suggested by Guillermo Garron, the solution is probably to &amp;ldquo;&lt;a href="https://100daystooffload.com"&gt;Just. Write.&lt;/a&gt;&amp;rdquo;&lt;/p&gt;</description></item><item><title>Micro posting in May</title><link>https://aliquote.org/post/micro-05-2020/</link><pubDate>Wed, 27 May 2020 08:36:43 +0200</pubDate><guid>https://aliquote.org/post/micro-05-2020/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-05-02&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Always demand a deadline. A deadline weeds out the extraneous and the ordinary. It prevents you from trying to make it perfect, so you have to make it different. Different is better. &amp;mdash; &lt;a href="https://kk.org/thetechnium/68-bits-of-unsolicited-advice/"&gt;68 Bits of Unsolicited Advice&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-05-02&lt;/a&gt;: &lt;a href="https://blog.einval.eu/2020/04/emacs-as-a-shell/"&gt;Emacs as a Shell&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-05-02&lt;/a&gt;: &lt;a href="https://biojulia.net/post/hardware/"&gt;What scientists must know about hardware to write fast code&lt;/a&gt;. &lt;code&gt;#julia&lt;/code&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Programming is used in many fields of science today, where individual scientists often have to write custom code for their own projects. For most scientists, however, computer science is not their field of expertise; They have learned programming by necessity.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-05-08&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Yes, make Emacs appealing and user friendly. But don&amp;rsquo;t forget that a masterful tool in the end requires mastery, which can&amp;rsquo;t come for free. I certainly draw the line at saying Emacs is for everyone. I&amp;rsquo;m not saying it&amp;rsquo;s only for some sort of snooty &amp;ldquo;elite&amp;rdquo; but I am saying that it&amp;rsquo;s for those who are willing to learn, seeing some extra work as the aforementioned long-term investment, and who have the patience reach a worthy goal a little later rather than right this very minute. &amp;mdash; &lt;a href="https://lwn.net/SubscriberLink/819452/1480c3a59d3d9093/"&gt;Making Emacs popular again&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-05-08&lt;/a&gt;: &lt;a href="http://www.iro.umontreal.ca/~monnier/hopl-4-emacs-lisp.pdf"&gt;Evolution of Emacs Lisp&lt;/a&gt; (PDF, 55 pp.). &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-05-11&lt;/a&gt;: Just checking some old emails; the latest version of &lt;a href="https://www.djcbsoftware.nl/code/mu/"&gt;mu&lt;/a&gt; is (still) blazing fast! Already 7 years and counting.&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-05-11-21-09-26.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-05-11&lt;/a&gt;: Trust me, I&amp;rsquo;m pretty happy with that old good Mojave and the full iTunes!&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-04-26-19-48-50.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-05-13&lt;/a&gt;: How did I miss the &lt;a href="https://racket-mode.com"&gt;website&lt;/a&gt; for Emacs Racket mode? &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-05-13&lt;/a&gt;: I took some days off lately. Meanwhile, cooking and gardening went all fine!&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_1113.jpg" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-05-13&lt;/a&gt;: The rise of interest in VSC is pretty interesting, compared to that of Atom few years ago, although I&amp;rsquo;m a bit surprised that Emacs remains such a niche for programmers (and probably writers as well).&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-05-13-12-31-33.png" alt=""&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Oh boy, this is hot! Really hot! I mean why fan in my laptop spins like I’m playing a video game? Oh, it’s because I’ve opened these two editors side by side.&lt;br&gt;Just kidding. It’s fine, but this performance-related pun is still a thing, unfortunately, because each of those editors eats more memory and CPU cycles than Sublime Text, and overall performance is not that good. Why? Because these editors are not exactly editors. These two are web browsers that were turned into text editors. &amp;mdash; Andrey Orst on &lt;a href="https://andreyorst.gitlab.io/posts/2020-04-29-text-editors/"&gt;Text Editors&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-05-13&lt;/a&gt;: &lt;a href="https://microsoft.github.io/react-native-windows/"&gt;Bringing React Native to Windows &amp;amp; Mac devices&lt;/a&gt;. Is this an laternative to the good old Electron way of delivering so-called native apps on your preferred OS?&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-05-13&lt;/a&gt;: &lt;a href="https://twobithistory.org/2018/10/14/lisp.html"&gt;How Lisp Became God&amp;rsquo;s Own Programming Language&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-05-13&lt;/a&gt;: &lt;a href="https://janet-lang.org"&gt;Janet&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&amp;gt; The entire language (core library, interpreter, compiler, assembler, PEG) is less than 1Mb.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-05-14&lt;/a&gt;: &lt;a href="https://so.nwalsh.com/2020/01/05-latex"&gt;Customizing org-mode LaTeX output&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-05-15&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Now it is 25 years later and the bootstrap baby is old enough to be in grad school. I have had some second thoughts about the bootstrap—its strengths and weaknesses, its foundations, what it can and cannot do, what it might do in the future—and these second thoughts are what I will talk about, briefly, here. &amp;mdash; &lt;a href="https://projecteuclid.org/euclid.ss/1063994968"&gt;Second Thoughts on the Bootstrap&lt;/a&gt;, by Bradley Efron&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-05-15&lt;/a&gt;: &lt;a href="http://www.emacslife.com/baby-steps-org.html"&gt;A Baby Steps Guide to Managing Your Tasks with Org&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-05-15&lt;/a&gt;: &lt;a href="https://deno.land"&gt;Deno&lt;/a&gt; is a simple, modern and secure runtime for JavaScript and TypeScript that uses V8 and is built in Rust. It looks like a solid successor to Node.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-05-18&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Another interesting answer assumed that “the test of time” is somehow a cosmic optimization. But as every biologist knows, Darwinian processes “find fits” to an environment, and if the environment is lacking, then the fits will be lacking. Similarly, if most computer people lack understanding and knowledge, then what they will select will also be lacking. There is abundant evidence today that this is just what has happened. &amp;mdash; Alan Kay himself, in response to the Quora thread &lt;a href="https://www.quora.com/What-did-Alan-Kay-mean-by-Lisp-is-the-greatest-single-programming-language-ever-designed"&gt;What did Alan Kay mean by, &amp;ldquo;Lisp is the greatest single programming language ever designed&amp;rdquo;?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-05-18&lt;/a&gt;: I upgraded to Emacs 27 recently, and I found two little annoying things: there&amp;rsquo;s now a warning about the &lt;code&gt;cl&lt;/code&gt; package that has been deprecrated for a long time now (everything is okay in Doom core modules, this is just the packages &lt;code&gt;flyspell-lazy&lt;/code&gt; and &lt;code&gt;persp-mode&lt;/code&gt; which happen to trigger the warning with their &lt;code&gt;(require 'cl)&lt;/code&gt;), and Ivy posframe &lt;a href="https://github.com/tumashu/ivy-posframe/issues/92"&gt;gets sometimes stuck&lt;/a&gt;. I encountered some freezing issues as well, but this &lt;a href="https://github.com/d12frosted/homebrew-emacs-plus/issues/192"&gt;may well be due&lt;/a&gt; to the &lt;code&gt;with-no-titlebar&lt;/code&gt; option in the HEAD version of emacs-plus. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-05-18&lt;/a&gt;: Much better base colors in R 4.0 ;-)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;d &amp;lt;- transform(as.data.frame(replicate(2, rnorm(30))), g = gl(3, 10))
plot(V1 ~ V2, data = d, col = g, pch = 19)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-05-18&lt;/a&gt;: &lt;a href="https://supervised-ml-course.netlify.app"&gt;A Free, Interactive Course Using Tidy Tools&lt;/a&gt;, by Julia Silge. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-05-18&lt;/a&gt;: &lt;a href="http://madrury.github.io/jekyll/update/statistics/2017/10/04/qr-algorithm.html"&gt;How Does A Computer Calculate Eigenvalues?&lt;/a&gt;. It&amp;rsquo;s always a pleasure to read one of Matt Drury&amp;rsquo;s blog posts.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-05-18&lt;/a&gt;: &lt;a href="http://sed.sourceforge.net/sed1line.txt"&gt;Sed one-liners&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-05-18&lt;/a&gt;: &lt;a href="https://sparkfromr.com"&gt;Using Spark from R for performance with arbitrary code&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-05-19&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Checking email in a browser is a huge distraction. I spend most of my day staring at emacs, and when email notifications ding, I feel compelled to check; switching to the completely browser pulls me out of my flow. Once you’re in the browser, you realize that you are on a slippery slope… It starts tempting you to check hacker news or reddit (at least for me), and often times it’s impossible to not succumb to it; we all know how easily time goes missing “just checking if anything new popped up on the front-page”. &amp;mdash; &lt;a href="https://notanumber.io/2016-10-03/better-email-with-mu4e/"&gt;Better Email with mu4e&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-05-21&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;LSP reduces an m×n complexity problem to m+n the latter refers to only needing a language server for each language and a client for each IDE, whereas the former means that for every language each IDE would require, in most cases, standalone support. &amp;mdash; &lt;a href="https://www.mortens.dev/blog/emacs-and-the-language-server-protocol/"&gt;Emacs and the Language Server Protocol&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-05-22&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Great software is defined by more than its objective code quality; I would even go so far as to say that code quality is one of the least important characteristics of software. Especially in open source, the greatness of software lies in its ability to meet the needs of its users, and in its leadership and community to adapt to the changing landscape around it. &amp;mdash; &lt;a href="https://blog.aaronbieber.com/2016/08/06/what-is-good-software.html"&gt;What Is Good Software&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-05-22&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I use emacs, which might be thought of as a thermonuclear word processor. It was created by Richard Stallman; enough said. It is written in Lisp, which is the only computer language that is beautiful. It is colossal, and yet it only edits straight ASCII text files, which is to say, no fonts, no boldface, no underlining. In other words, the engineer-hours that, in the case of Microsoft Word, were devoted to features like mail merge, and the ability to embed feature-length motion pictures in corporate memoranda, were, in the case of emacs, focused with maniacal intensity on the deceptively simple-seeming problem of editing text. If you are a professional writer&amp;ndash;i.e., if someone else is getting paid to worry about how your words are formatted and printed&amp;ndash;emacs outshines all other editing software in approximately the same way that the noonday sun does the stars. It is not just bigger and brighter; it simply makes everything else vanish. &amp;mdash; &lt;a href="http://cristal.inria.fr/~weis/info/commandline.html"&gt;In the beginning was the command line&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-05-22&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I&amp;rsquo;ve got it all terribly automated so I can start a new entry, proof an entry, and publish it to the website with single keystrokes in Emacs; I recognize lots of people wouldn&amp;rsquo;t be OK with that. &amp;mdash; &lt;a href="https://www.tbray.org/ongoing/misc/Colophon"&gt;ongoing&amp;rsquo;s colophon&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-05-22&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;My commitment to accessibility of the WCAG AAA sort comes from the realisation that legibility is the single most important characteristic of any text-heavy interface. Emacs is all about text; and text should not pose a barrier to entry. &amp;mdash; &lt;a href="https://protesilaos.com/codelog/2020-03-17-design-modus-themes-emacs/"&gt;On the design of the Modus themes&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-05-22&lt;/a&gt;: &lt;a href="https://sagegerard.com/racket-review.html"&gt;A Review of the Racket Programming Language&lt;/a&gt;. &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-05-22&lt;/a&gt;: &lt;a href="https://willschenk.com/articles/2020/tramp_tricks/"&gt;Emacs Tramp tricks&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-05-22&lt;/a&gt;: &lt;a href="https://phiresky.github.io/blog/2019/rga--ripgrep-for-zip-targz-docx-odt-epub-jpg/"&gt;rga&lt;/a&gt;: ripgrep, but also search in PDFs, E-Books, Office documents, zip, tar.gz, etc.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-05-26&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I personally use “principled” to refer to choices informed by sincere and careful deliberation, in contrast to choices informed by unquestioned defaults that have ossified into convention. A principled workflow considers whether or not modeling assumptions are appropriate and sufficient for answering relevant questions in your particular applied context. Because everyone asks different questions in different contexts, such a workflow cannot be reduced to a deterministic algorithm. All we can do is assemble a coherent set of techniques to help us evaluate our own assumptions and guide our unique path through model space. &amp;mdash; &lt;a href="https://betanalpha.github.io/assets/case_studies/principled_bayesian_workflow.html"&gt;Towards A Principled Bayesian Workflow&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-05-26&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I&amp;rsquo;ve taken various detours along the way into learning and using various other languages. I like several of them quite a bit. I just don&amp;rsquo;t like them as much as Common Lisp. The pleasure I take in my work is a significant factor in my productivity. Choosing tools that offer me less joy is a cost I prefer not to bear without good reason. That cost often exceeds the advantage I might realize from using some other language. Not always; but often. &amp;mdash; &lt;a href="https://news.ycombinator.com/item?id=23231701"&gt;Production Lisp in 2020?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-05-26&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;John McWade, founder and creative director of Before &amp;amp; After magazine, mentioned that the ideal line length is 45–55 characters without spaces and punctuations. For small mobile devices, the acceptable line length is 25 characters without spaces and punctuations. (If spaces and punctuations are included, the ideal line length will be around 66 characters according to The Elements of Typographic Style by Robert Bringhurst.) &amp;mdash; &lt;a href="http://www.simon-li.com/design-and-code/how-to-set-perfect-line-lengths-for-your-webpages/"&gt;How to Set Perfect Line Lengths for Your Webpages&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-05-26&lt;/a&gt;: &lt;a href="https://jcs.org/2018/07/05/opensource"&gt;Adventures in Open Source&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-05-26&lt;/a&gt;: &lt;a href="https://github.com/magit/magit/issues/2971"&gt;Batch operation in magit-list-repositories&lt;/a&gt;, with interesting Elisp code to fetch several Git repos at once. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-05-26&lt;/a&gt;: &lt;a href="https://yulab-smu.github.io/treedata-book/"&gt;Data Integration, Manipulation and Visualization of Phylogenetic Trees&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-05-26&lt;/a&gt;: &lt;a href="https://shreyas.ragavan.co/post/docker-management-within-emacs/"&gt;Docker container and image management within Emacs&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-05-26&lt;/a&gt;: &lt;a href="https://karl-voit.at/2020/05/03/current-org-files/"&gt;My Current Org Mode Files and Heading Structure&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-05-26&lt;/a&gt;: &lt;a href="https://tex.stackexchange.com/questions/425098/which-opentype-math-fonts-are-available/425099"&gt;OpenType math fonts for TeX&lt;/a&gt;. &lt;code&gt;#tex&lt;/code&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>Discord on Emacs</title><link>https://aliquote.org/post/discord-bitlbee/</link><pubDate>Wed, 27 May 2020 07:21:57 +0200</pubDate><guid>https://aliquote.org/post/discord-bitlbee/</guid><description>&lt;p&gt;I&amp;rsquo;ve been using Discord quite regularly during the quarantine, and I am quite happy with it. I never get used to Slack in the past, and I no longer use Skype. However, Discord is useful for quick appointment or to simply record progress on a project shared with students or colleagues. Moreover, the fact that we can just have quick vocal chat without necessarily using face to face conversation using a camera is more to my liking. This is not that I&amp;rsquo;m a shy guy (okay, just a bit of an introvert) but who needs video call when you just want to chat using a reliable channel?&lt;/p&gt;
&lt;p&gt;Anyway, while I love the Discord UI, it is definitely an Electron app, which means around 350 Mo of RAM consumption as soon as it is launched. Nothing to worry about when it is just to have text messaging, though. The great advantage is that you can just use the very same app on your phone, which is what I do most of the time. But what if we could simply use our good old IRC client to chat on Discord server? I have reviewed a few possibilities on using Emacs to chat on Discord, and I found several standalone projects, mostly based on Node and Javascript. This includes &lt;a href="https://github.com/mk-fg/reliable-discord-client-irc-daemon"&gt;rdircd&lt;/a&gt;, &lt;a href="https://github.com/creesch/discordIRCd"&gt;discordIRCd&lt;/a&gt;, or &lt;a href="https://github.com/reactiflux/discord-irc"&gt;discord-irc&lt;/a&gt;. Some are pretty old, other warrant against Discord TOS violations. This was until I stumble across &lt;a href="https://www.bitlbee.org/main.php/news.r.html"&gt;bitlbee&lt;/a&gt;, which I certainly have used in the past but forgot about at some point. Interestingly, there&amp;rsquo;s a plugin for Discord (actually there are &lt;a href="https://wiki.bitlbee.org"&gt;two plugins&lt;/a&gt; but I only tested the non purple one) that seems to do the job well: &lt;a href="https://github.com/sm00th/bitlbee-discord/"&gt;bitlbee-discord&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The installation instructions are pretty simple. First, you will need to installed bitlbee via Homebrew. By default this will install the dev version, which is what we need since we want to use some plugin. Then, you just have to grab the plugin &lt;a href="https://github.com/sm00th/bitlbee-discord/releases"&gt;released&lt;/a&gt; on Github (version 0.4.3 at the time of this writing) and compile it. I had to reinstall &lt;code&gt;libtool&lt;/code&gt; as I got stuck with the following error message when generating the configure script:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;undefined macro: AC_DISABLE_STATIC
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Other than that everything went fine. Don&amp;rsquo;t forget to launch the Bitblee daemon using, e.g., &lt;code&gt;brew services start bitlbee&lt;/code&gt;. You can check that it is running in the background using the following command:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Name Status User Plist
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ brew services list
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bitlbee started chl /Users/chl/Library/LaunchAgents/homebrew.mxcl.bitlbee.plist
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;emacs-plus stopped
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;emacs-plus stopped
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;isync stopped
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;lighttpd stopped
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mysql stopped
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nginx stopped
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;redis stopped
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;unbound stopped
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I was able to access all my Discord channels in Emacs using &lt;a href="https://github.com/jorgenschaefer/circe"&gt;Circe&lt;/a&gt; client, which is the &lt;a href="https://github.com/hlissner/doom-emacs/tree/develop/modules/app/irc"&gt;default one&lt;/a&gt; in Doom Emacs. Note that you don&amp;rsquo;t necessarily need to start Circe using the dedicated function &lt;code&gt;=irc&lt;/code&gt; in Doom, except if you want to configure IRC servers yourselves. In my case, I just run &lt;code&gt;circe&lt;/code&gt; and get a prompt where I can choose to connect to Freenode or Bitlbee running locally as a daemon. Assuming you configured Discord access correctly (I don&amp;rsquo;t know why but I didn&amp;rsquo;t need to register a Discord token) and saved your configuration, you should be ready to chat immediately. At a glance, here are a few commands that are useful to navigate in your Discord channels: &lt;code&gt;chat list discord&lt;/code&gt; and &lt;code&gt;chat add discord !4 #borabora&lt;/code&gt; are used to list all channels and add one using a dedicated alias given its rank number; &lt;code&gt;/join #borabora&lt;/code&gt; will obviously let you land in, like in IRC. Finally, note that &lt;code&gt;chat list&lt;/code&gt; won&amp;rsquo;t list your private conversations, and you will need to &lt;code&gt;/msg&lt;/code&gt; your buddy directly.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2020-05-26-10-47-39.png"&gt;
&lt;/figure&gt;</description></item><item><title>R 4.0</title><link>https://aliquote.org/post/r4/</link><pubDate>Tue, 19 May 2020 15:36:42 +0200</pubDate><guid>https://aliquote.org/post/r4/</guid><description>&lt;p&gt;R 4.0 was &lt;a href="https://blog.revolutionanalytics.com/2020/04/r-400-is-released.html"&gt;released&lt;/a&gt; a few weeks ago. I installed it yesterday and everything went smoothly as expected. Indeed, Dird Edelbuettel already showed how easy upgrading R was in one of his recent &lt;a href="http://dirk.eddelbuettel.com/blog/2020/04/26/#026_upgrade_to_R400"&gt;R&lt;sup&gt;4&lt;/sup&gt; post&lt;/a&gt;. In my case, I installed R from scracth, meaning I let the installer erase my old library folder and reinstalled a bunch of packages after all. I no longer use a separate &lt;code&gt;lib&lt;/code&gt; directory for a long time now.&lt;/p&gt;
&lt;p&gt;Anyway, it&amp;rsquo;s quite amazing that a statistical package that I once tested back in 2000 when the 1.0 was released still works out of the box. Not only the core language, but also the numerous packages that were developed alongside, which remain archived as tarballs on CRAN in case they are no longer maintained. As far as I am concerned, it has replaced Sed and Awk, grep, but also Gnuplot, more than one time.&lt;/p&gt;
&lt;p&gt;The main changes are detailed in the blog post referenced above. This includes the &lt;code&gt;stringAsFactors&lt;/code&gt; thing that was quite annoying if you were not involved in experimental design-oriented datasets or were too lazy to add an &lt;code&gt;options(stringAsFactors = FALSE)&lt;/code&gt; in your R profile file. It&amp;rsquo;s still available if you were wondering, btw. There has been a lot of enhancement behind the door thanks to Luke Tierney, and not only for this release (think of &lt;a href="https://www.r-project.org/dsc/2017/slides/dsc2017.pdf"&gt;altrep&lt;/a&gt;, for instance). As much as I miss LispStat, I can only rejoice in his contribution to the R ecosystem. The default palette has been revised and it is now possible to use custom color scheme for base R plots. I added the following line in my &lt;code&gt;.Rprofile&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.First &amp;lt;- function() grDevices::palette(&amp;#34;Tableau10&amp;#34;)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;On a related point, I tried the &lt;a href="https://github.com/REditorSupport/languageserver"&gt;language server&lt;/a&gt; for Emacs. For almost 15 years I used to use &lt;a href="https://ess.r-project.org"&gt;ESS&lt;/a&gt; exclusively, but now that I learned that you can use those two packages at the same time via a hook,&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; why not benefit from the best of both worlds? At the time of this writing, the language server protocol is still lacking some functionalities like the reference provider (the definition provider works fine, though) or code action and lens utilities. There&amp;rsquo;s no rename facility, nor execute command but since we have iESS this not a big deal. We get linting and symbol highlighting for free, but the signature and completion helpers are far better than their ESS counterparts, IMO. Here&amp;rsquo;s a quick peak at the language server in action, regarding help display (left, as ESS does via Eldoc; right, via lsp-ui):&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2020-05-19-20-22-56.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2020-05-19-20-22-56.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2020-05-19-20-27-05.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2020-05-19-20-27-05.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Overall, I find this package quite handy and it is obviously lighter than &lt;a href="https://github.com/emacs-lsp/lsp-python-ms"&gt;MS Python&lt;/a&gt; language server.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Leonard Cohen • &lt;em&gt;Live in London&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Unfortunately, this hooking technique cannot be used to complement ESS for Stata with Bill Rising&amp;rsquo;s &lt;a href="https://github.com/louabill/ado-mode"&gt;ado-mode&lt;/a&gt;, which is far better at syntax highlighting but only targets GUI version of Stata.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;I stopped using the &lt;a href="https://github.com/palantir/python-language-server"&gt;standard LSP&lt;/a&gt; package because I was tired of incompatibility with pip versions of jedi, languageserver, and all the dependencies. At some point, I wondered why the language server is not bundled with the Emacs package as is the case for Julia.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Hypparchos and the solar model</title><link>https://aliquote.org/post/byzance/</link><pubDate>Mon, 18 May 2020 20:40:41 +0200</pubDate><guid>https://aliquote.org/post/byzance/</guid><description>&lt;p&gt;As I was re-reading an old book of mathematical statistics by van der Waerden,&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; I found this little gem in the chapter dealing with the method of ordinary least squares. It is interesting because even if the purpose of this textbook is to expose the basis of mathematical statistics, most of the examples remain anchored in real-life or historical example. I rarely encountered such a pragmatic approach combining theoretical development and applied reasoning in more recent textbooks.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s a quick translation from French to English (bear in mind that I&amp;rsquo;m not a native speaker nor an expert in astronomy).&lt;/p&gt;
&lt;p&gt;Here is a screenshot of the data table:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/IMG_1125.jpg"&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;small&gt;These values were derived from a Byzantine calendar where the dates entered in the twelve signs of the zodiac were recorded in the form of hours, the hours of the day being counted from 6 a.m. onwards and the sign of Libra being considered as the origin of the calculation of time. We then subtracted the time that the average sun would need to enter the sign in question, assuming a year strictly equal to 365 days and 6 hours.&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;Let us denote $\lambda$ the width of the sun at the entrance to a zodiac sign, and $\alpha$ the length of the apogee. The difference $\chi = \lambda - \alpha$ is called the true anomaly. The length of the arc of the apogee $A$ of eccentricity to the sun $S$ is called the mean anomaly. It will be denoted by $x + \omega$. The difference $\omega$ between the true anomaly and the mean anomaly is called the mean point equation. If $e$ is the eccentricity, the following equality between $\omega$ and $x$ follows from the sinus rule:&lt;/p&gt;
&lt;p&gt;$$ \sin \omega = e \sin x $$&lt;/p&gt;
&lt;p&gt;or $\omega = \text{arc}\hskip-.15ex\sin (e \sin x)\hskip.15ex$, as illustrated in the picture below.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/byzance.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/byzance.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Since $e$ is small, $\text{arc}\hskip-.15ex\sin$ can be expanded as a power series up to the 2nd term:&lt;/p&gt;
&lt;p&gt;$$
\begin{align*}
\omega &amp;amp;= e \sin x + \frac{1}{6}e^3 \sin^3 x \cr
&amp;amp;= e \sin x + \frac{1}{24}e^3 (3 \sin x - \sin 3x) \cr
&amp;amp;= \left(e + \frac{1}{8}e^3\right) \sin x - \frac{1}{24}e^3 \sin 3x
\end{align*}
$$&lt;/p&gt;
&lt;p&gt;The time needed by the sun to travel the arc $x + \omega$ on the eccentricity is $t = \frac{T}{2\pi}(x + \omega)$, where $T = 365.25$ days is the total traveling time. For an average movement, the time would be $t_0 = \frac{T}{2\pi}x$. The differences $t-t_0 = \frac{T}{2\pi}\omega$ must be equal to the values $l$ in the last column of the table in the above screenshot, upon addition of an unknown constant $d$ and a corrective term, unknown, resulting from calculus and rounding errors. We have:&lt;/p&gt;
&lt;p&gt;$$ \frac{T}{2\pi} \omega + d = l + k. $$&lt;/p&gt;
&lt;p&gt;Substituting the preceding expression for $\omega$, we get:&lt;/p&gt;
&lt;p&gt;$$ a \sin x + b \sin 3x + d = l + k $$&lt;/p&gt;
&lt;p&gt;with&lt;/p&gt;
&lt;p&gt;$$
\left\{\begin{align*}
a &amp;amp;= \frac{T}{2\pi} \left( e + \frac{1}{8}e^3\right)\cr
b &amp;amp;= - \frac{T}{2\pi} \frac{1}{24}e^3 = - ce^3
\end{align*}\right.
$$&lt;/p&gt;
&lt;p&gt;where $c$ is known. Let us denote $x = \lambda - \alpha$, we finally have the following equation:&lt;/p&gt;
&lt;p&gt;$$ a \sin (\lambda - \alpha) + b \sin 3 (\lambda - \alpha) + d = l + k. $$&lt;/p&gt;
&lt;p&gt;Since the 12 lengths $\lambda$ and the values $l$ from the table are known, we have 12 &amp;ldquo;equations of observations&amp;rdquo; with three unknowns, $e$, $\alpha$ and $d$. They will be determined so that $k_1^2 + \dots + k_{12}^2$ be as small as possible.&lt;/p&gt;
&lt;p&gt;First, we can neglect the term $b$. One we get an approximatio for $e$, we obtain $b = -ce^3$, and the term $b$ can be moved in the RHS in order to perform a second approximation for $a$, which happens to be identical to the first one since the terms involving $\sin 3x$ vanish in the normal equations. The term in $b$ can thus be discarded and we will write:&lt;/p&gt;
&lt;p&gt;$$ a \sin \lambda \cos \alpha - a \cos \lambda \sin \alpha + d = l + k. $$&lt;/p&gt;
&lt;p&gt;After we introduce the new unknowns :&lt;/p&gt;
&lt;p&gt;$$
\left\{\begin{align*}
u &amp;amp;= a \cos \alpha \cr
v &amp;amp;= -a \sin \alpha \cr
w &amp;amp;= d
\end{align*}\right.
$$&lt;/p&gt;
&lt;p&gt;we get 12 linear equations of the form $u \sin \lambda + v \cos \lambda + w = l + k$, and the normal equations can be written as follows:&lt;/p&gt;
&lt;p&gt;$$
\left\{\begin{array}{l}
[aa]u + [ab]v + [ac]w = [al] \cr
[ba]u + [bb]v + [bc]w = [bl] \cr
[ca]u + [cb]v + [cc]w = [cl]
\end{array}\right.
$$&lt;/p&gt;
&lt;p&gt;The coefficients are easily obtained: $[aa] = \sum \sin^2 \lambda = 6$, $[bb] = \sum \cos^2 \lambda = 6$, $[cc] = \sum 1 = 12$, $[ab] = \sum \sin \lambda \cos \lambda = 0$, $[ac] = \sum \sin \lambda = 0$, and $[bc] = \sum \cos \lambda = 0$. The normal equations now read:&lt;/p&gt;
&lt;p&gt;$$
\left\{\begin{align*}
6u &amp;amp;= \sum l \sin \lambda \cr
6v &amp;amp;= \sum l \cos \lambda \cr
12w &amp;amp;= \sum l.
\end{align*}\right.
$$&lt;/p&gt;
&lt;p&gt;If $u$ and $v$ are known, then $a$ and $\alpha$ can be determined using&lt;/p&gt;
&lt;p&gt;$$
\left\{\begin{align*}
a \cos \alpha &amp;amp;= u \cr
a \sin \alpha &amp;amp;= -v
\end{align*}\right.
$$&lt;/p&gt;
&lt;p&gt;while $e$ is obtained from the relation $e+\frac{1}{8}e^3 = \frac{2\pi}{T}a$.&lt;/p&gt;
&lt;p&gt;Numerical application yields $e = 0.04157$ and $\alpha = 65°40&amp;rsquo;$. Hypparchos and Ptolemée assumed that $e = 1/24 = 0.04167$ and $\alpha = 65°30&amp;rsquo;$.&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;B.L. van der Waerden, &lt;em&gt;Statistique Mathématique&lt;/em&gt;, Dunod, 1967.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Handy command-line utilities</title><link>https://aliquote.org/post/handy-cli-tools/</link><pubDate>Fri, 15 May 2020 08:55:35 +0200</pubDate><guid>https://aliquote.org/post/handy-cli-tools/</guid><description>&lt;p&gt;I&amp;rsquo;m an old hand at the command line and have a hard time adopting new tools. Most of the time, a shell and Emacs is all what I need in my daily job. This was true when I worked as a medical statistician, and it is still the case for bioinformatics stuff. I believe it follows from a form of respect for digital minimalism, hardware constraints (I always worked on small laptops with less than 16 Mb RAM), and daily tasks that are primarily text-based and that can be chained together, which is at the heart of the &lt;a href="https://en.wikipedia.org/wiki/Unix_philosophy"&gt;Unix philospohy&lt;/a&gt;. I learned Bash (and later Zsh) and Emacs twenty years ago now, and I suppose habit explains the rest. The only thing that really changed along the way in my daily workflow is the use checkers and linters for all &amp;ldquo;prog-mode&amp;rdquo; languages in Emacs.&lt;/p&gt;
&lt;p&gt;Most of the time, I&amp;rsquo;m happy with GNU &lt;a href="https://www.gnu.org/software/coreutils/coreutils.html"&gt;core utilities&lt;/a&gt;, sed and awk, make, and shell scripts. There are many tutorials or lists of handy tools for your preferred terminal, but for the record here is what I&amp;rsquo;ve settled on in the last few years:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/sharkdp/fd"&gt;fd&lt;/a&gt; and &lt;a href="https://github.com/BurntSushi/ripgrep"&gt;rg&lt;/a&gt; (ripgrep) are handy replacement for find and grep, in my view. Of course, I know grep quite a bit and it is hard to switch entirely to rg, but for casual search I found it better than grep with default settings. Before ripgrep I was using ack, but I try to stay on rg now, if not because it is also what I use in Emacs.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/ogham/exa"&gt;exa&lt;/a&gt; and &lt;a href="https://github.com/sharkdp/bat"&gt;bat&lt;/a&gt; are excellent when it comes to list files and directories (with Git info) and short source files.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/arzzen/git-quick-stats"&gt;git-quick-stats&lt;/a&gt; and &lt;a href="https://github.com/dandavison/delta"&gt;delta&lt;/a&gt; are interesting addition when you&amp;rsquo;re involved with Git repositories, notwithstanding Github&amp;rsquo;s own &lt;a href="https://github.com/cli/cli"&gt;gh&lt;/a&gt; utility.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Again, there are probably many other great tools, including those I&amp;rsquo;ve once installed on my Macbook and forgot about afterwards or that I don&amp;rsquo;t use so much. The above utilities are part of the commands I use almost every day in Zsh.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2020-08-15]&lt;/small&gt;&lt;br&gt;
See also &lt;a href="https://zaiste.net/posts/shell-commands-rust/"&gt;Rewritten in Rust: Modern Alternatives of Command-Line Tools&lt;/a&gt; for related recommendations.
&lt;/div&gt;
&lt;p&gt;Regarding Emacs, there are a few packages that I could not live without. They are all bundled with Doom Emacs, of course, but these are the ones that come to my mind when I think of what I used the most in Emacs, apart from Org, &lt;a href="https://ess.r-project.org"&gt;ESS&lt;/a&gt;, &lt;a href="http://jblevins.org/projects/markdown-mode/"&gt;markdown-mode&lt;/a&gt; and &lt;a href="https://www.djcbsoftware.nl/code/mu/mu4e.html"&gt;mu4e&lt;/a&gt;. This includes &lt;a href="https://github.com/tmalsburg/helm-bibtex"&gt;ivy-bibtex&lt;/a&gt; (to manage my bibliographic entries and &lt;a href="https://aliquote.org/post/notes-taking-workflow/"&gt;reading notes&lt;/a&gt; &amp;mdash; and yes, I now prefer Ivy to Helm), &lt;a href="https://github.com/emacsorphanage/git-gutter"&gt;git-gutter&lt;/a&gt; (&lt;a href="https://magit.vc"&gt;magit&lt;/a&gt; does not count, right?), &lt;a href="https://github.com/emacs-lsp/lsp-mode"&gt;lsp-mode&lt;/a&gt; (mainly for Python, C and Rust) and &lt;a href="https://github.com/joaotavora/sly"&gt;sly&lt;/a&gt; as a replacement to Slime for Lisp stuff.&lt;/p&gt;
&lt;p&gt;Happy hacking!&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2020-05-15-20-35-35.png"&gt;
&lt;/figure&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Tom Waits • &lt;em&gt;Asylum Years&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>May in review</title><link>https://aliquote.org/post/micro-review-012/</link><pubDate>Wed, 13 May 2020 15:11:34 +0200</pubDate><guid>https://aliquote.org/post/micro-review-012/</guid><description>&lt;p&gt;Once again, a lot of bookmarks have been piling up all over my computer. Needless to say, the fact that Apple removed the possibility we earlier had to access our iPhone Safari tabs from our Macbook directly does not make it any easier. Anyway, here we go with a short list of interesting links I found while browsing the interweb lately.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Interestingly, while I spent yet another fair amount of time customizing the way my Emacs looks I came across some very nice configurations, including the one proposed by Nicolas Rougier for en &lt;a href="https://github.com/rougier/elegant-emacs"&gt;elegant emacs&lt;/a&gt; (via Reddit), and that of &lt;a href="https://github.com/andreyorst/dotfiles/tree/master/.config/emacs"&gt;Andrey Orst&lt;/a&gt;. There is also &lt;a href="https://emacs.nasy.moe"&gt;this bundle&lt;/a&gt;. For Doom specific settings, see &lt;a href="https://github.com/tecosaur/emacs-config/blob/master/config.org"&gt;this one&lt;/a&gt; too.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I mentioned some &lt;a href="https://aliquote.org/micro/2020-04-24-12-23-04/"&gt;alternatives to dplyr&lt;/a&gt; using base R. Here is one for Python, as an alternative to Pandas, I guess: &lt;a href="https://github.com/machow/siuba/blob/master/README.md"&gt;siuba&lt;/a&gt;, scrappy data analysis, with seamless support for pandas and SQL.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;While browsing random R packages I learned about a new word, &amp;ldquo;pycnophylactic&amp;rdquo;, in relation to areal weighted interpolation (&lt;a href="https://slu-opengis.github.io/areal/"&gt;areal&lt;/a&gt; package). This is what I really love with the web! See also &lt;a href="http://www.geog.ucsb.edu/~kclarke/Geography232/Pycno.pdf"&gt;Smooth Pycnophylactic Interpolation for Geographical Regions&lt;/a&gt; (PDF) for more technical details.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Here is Azlen Elza&amp;rsquo;s &lt;a href="https://notes.azlen.me/g3tibyfv/"&gt;digital garden of notes&lt;/a&gt;, which offers an interesting alternative to &lt;a href="https://roamresearch.com"&gt;roam&lt;/a&gt; and related tools.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://aliquote.org/img/2020-05-13-15-47-45.png" alt="azlen-elza"&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I have long been relying on &lt;a href="http://r.research.att.com"&gt;RSwitch&lt;/a&gt; to change my current R environment (especially when I was using the stable and latest dev version), but it&amp;rsquo;s been a while now and I only use a single version of R. Now, there&amp;rsquo;s &lt;a href="https://github.com/jcrodriguez1989/renv-installer"&gt;renv&lt;/a&gt; to switch between multiple versions of R, globally or on a per project basis.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I wrote a &lt;a href="https://aliquote.org/post/hmisc-and-rms/"&gt;short introduction&lt;/a&gt; to the Hmisc and rms packages some years ago. Recently, I noticed Frank Harrell mentioned a very elegant post on these packages: &lt;a href="https://www.nicholas-ollberding.com/post/an-introduction-to-the-harrell-verse-predictive-modeling-using-the-hmisc-and-rms-packages/"&gt;An Introduction to the Harrell“verse”: Predictive Modeling using the Hmisc and rms Packages&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I make a promise to myself every year that I&amp;rsquo;m going to take Julia seriously. Then, time goes by. I bookmarked many articles relevant to Julia, its ecosystem of packages for computational statistics and its performance overall compared to, say, R or Python. I wonder whether the newly released tutors on Julia by the &lt;a href="https://juliaacademy.com"&gt;Julia Academy&lt;/a&gt; might not be a good excuse for me for a change.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://github.com/dandavison/delta/blob/master/README.md"&gt;Delta&lt;/a&gt; is a syntax-highlighter for git and diff output, perfectly suited for CLI junkies. Think of it as &lt;a href="https://github.com/sharkdp/bat"&gt;bat&lt;/a&gt; for cat.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="http://langnostic.inaimathi.ca/posts/recommendations#why"&gt;Which Lisp Should I Learn?&lt;/a&gt; Interesting take on CL and Clojure, written by &lt;a href="https://github.com/Inaimathi"&gt;Leo Zovic&lt;/a&gt;, a heavy Lisper. This somewhat reminds me of &lt;a href="https://stevelosh.com/blog/2018/08/a-road-to-common-lisp/"&gt;A Road to Common Lisp&lt;/a&gt; by Steve Losh, which also is a great read if you&amp;rsquo;re about to get started with CL. Also, don&amp;rsquo;t miss the &lt;a href="https://github.com/google/lisp-koans/"&gt;Common Lisp Koans&lt;/a&gt;!&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I&amp;rsquo;m still not sold on using VS Code (uninstalled two times already), because you know&amp;hellip; Emacs. However I should note that it is becoming incredibly versatile. See, e.g., &lt;a href="https://github.com/hediet/vscode-drawio"&gt;Draw.io VS Code Integration&lt;/a&gt; or &lt;a href="https://github.com/Eugleo/magic-racket"&gt;Magic Racket&lt;/a&gt;, which now integrates an LSP server.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;If, on the other hand, you&amp;rsquo;re interested in enlightenment, academic research or a start-up, the criterion by which you should choose your next language is not employability, but expressiveness. In academic research and in entrepreneurship, you need to multiply your effectiveness as a programmer, and since you (probably) won&amp;rsquo;t be working with an entrenched code base, you are free to use whatever language best suits the task at hand. &amp;mdash; &lt;a href="http://matt.might.net/articles/best-programming-languages/"&gt;Advanced programming languages&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ John Butler Trio • &lt;em&gt;Flesh &amp;amp; Blood&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>J+55</title><link>https://aliquote.org/post/j55/</link><pubDate>Sun, 10 May 2020 09:45:02 +0200</pubDate><guid>https://aliquote.org/post/j55/</guid><description>&lt;p&gt;Bilan du confinement : 3 tartes aux pommes et poires, une dizaine de pizzas (pour mon fils) et autant de salades (pour moi), et beaucoup de &lt;a href="https://aliquote.org/files/books.txt"&gt;lecture&lt;/a&gt;. J&amp;rsquo;avoue avoir eu vite fait d&amp;rsquo;être las des communiqués ministériels et des allocutions présidentielles dans les premières semaines de confinement. Je regrette même que Twitter ait continué de fonctionner car je me serai bien passé des épisodes mélo-dramatiques de fin du monde et des apprentis épidémiologistes qui ont fleuri au gré des premières semaines. Le ton a été vite donné par certains statisticiens d&amp;rsquo;ailleurs et s&amp;rsquo;il fallait n&amp;rsquo;en retenir qu&amp;rsquo;un seul, en dehors de &lt;a href="https://robjhyndman.com/hyndsight/forecasting-covid19/"&gt;Rob J. Hyndman&lt;/a&gt;, voici celui que je choisirais :&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2020-06-13]&lt;/small&gt;&lt;br&gt;
Le tweet cité a été supprimé malheureusement. Son ID était 1245665871961436160.
&lt;/div&gt;
&lt;p&gt;Heureusement j&amp;rsquo;avais ma petite liste Twitter &lt;code&gt;#fr&lt;/code&gt; qui me permettait d&amp;rsquo;avoir des nouvelles plus cocasses. Que retenir de tout ça ? Pas grand-chose, ma foi, puisque je reste confiné encore quelques semaines, même si rien &amp;ldquo;n&amp;rsquo;oblige&amp;rdquo; les personnes âgées et les malades chroniques à maintenir l&amp;rsquo;état de siège. Voici pour les menus travaux de cuisine :&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1089.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1089.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1081.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1081.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1076.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1076.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Sans oublier :&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1027.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1027.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1025.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1025.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1001.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1001.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Ceci étant, j&amp;rsquo;ai passé l&amp;rsquo;essentiel de ces deux derniers mois avec mon fils et on a passé de bons moments. J&amp;rsquo;ai parfois l&amp;rsquo;impression d&amp;rsquo;avoir passé mon temps à faire la cuisine, les courses (une fois par semaine) et regardé des séries TV le soir, mais en même temps : quel bonheur ! A ce sujet, on a regardé successivement : la dernière saison de &lt;em&gt;The Walking Dead&lt;/em&gt;, celle de &lt;em&gt;The 100&lt;/em&gt;, deux saisons supplémentaires de &lt;em&gt;Black List&lt;/em&gt; (3 et 4), et on est en train de terminer &lt;em&gt;Battlestar Galactica&lt;/em&gt;. Mine de rien, j&amp;rsquo;en suis à une trentaine de séries en 3 ans sur iTunes (et pas Apple TV) !&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2020-05-13-20-24-47.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Je n&amp;rsquo;ai pas travaillé autant que je l&amp;rsquo;aurais souhaité &amp;mdash; et pourtant j&amp;rsquo;ai l&amp;rsquo;habitude de travailler à domicile puisque c&amp;rsquo;est ce que j&amp;rsquo;ai fait durant les 10 dernières années en tant que consultant, mais mes stylos plume ont tourné à bloc, y compris pour remplir ces fameuses attestations de sortie. Là encore, le confinement ne m&amp;rsquo;a jamais vraiment dérangé dans la mesure où j&amp;rsquo;ai passé la majorité de ces dernières années cloîtré dans mon appartement.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0991.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0991.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0986.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0986.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in April</title><link>https://aliquote.org/post/micro-04-2020/</link><pubDate>Thu, 30 Apr 2020 08:27:50 +0200</pubDate><guid>https://aliquote.org/post/micro-04-2020/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-04-02&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I fucked up.&lt;br&gt; Short version: If you’re reading mailing lists with an NNTP news reader via news.gmane.org, you should update your news reader to point to news.gmane.io instead. &amp;mdash; &lt;a href="https://lars.ingebrigtsen.no/2020/01/06/whatever-happened-to-news-gmane-org/"&gt;Whatever Happened To news.gmane.org?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-04-02&lt;/a&gt;: And so we are done with &lt;a href="https://duckduckgo.com/?q=black+list&amp;amp;t=osx&amp;amp;ia=news"&gt;Black List&lt;/a&gt;, Season 4, as of yesterday evening. We need to take a break, my son and I, and we decided to watch Season 10 of &lt;a href="https://en.wikipedia.org/wiki/The_Walking_Dead_%28TV_series%29"&gt;The Walking Dead&lt;/a&gt;. It&amp;rsquo;s a perfect fit, isn&amp;rsquo;t it?&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-02&lt;/a&gt;: &lt;a href="https://catonmat.net/low-level-bit-hacks"&gt;Introduction to Low Level Bit Hacks&lt;/a&gt;. (via John D Cook, but this was an old tweet!)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-02&lt;/a&gt;: &lt;a href="https://gist.github.com/WetHat/9682b8f70f0241c37cd5d732784d1577"&gt;Pretty Printing Tree Data Structures in Common Lisp&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-03&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;When Gmail users send mail from mechanisms other than Google’s web interface (i.e.: their phone or laptop’s email program), Gmail includes the user’s IP address in message headers. &amp;mdash; &lt;a href="https://www.leeholmes.com/blog/2020/04/02/client-ip-address-disclosure-in-smtp-gmail-com/"&gt;Client IP Address Disclosure in smtp.gmail.com&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-04-03&lt;/a&gt;: Amazing. (via &lt;a href="https://jlelse.blog/micro/2020/04/short-qr-code/"&gt;jlelse&lt;/a&gt;&amp;rsquo;s blog)&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-04-03-21-41-09.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-03&lt;/a&gt;: For those interested in Lisp and related family of FP languages, the ACM is actually &lt;a href="https://lispnews.wordpress.com/2020/04/02/acm-open-access-to-lfp/amp/?__twitter_impression=true"&gt;open access to proceedings&lt;/a&gt; from several conferences from the 90s. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-03&lt;/a&gt;: No good news for data workers, right?&amp;gt; So Numbers took 9.4 times as long as Excel, which isn’t great. But it’s an improvement over my test of Numbers ’13 and Excel 2011, where Numbers took 102 times as long as Excel. &amp;mdash; &lt;a href="https://mjtsai.com/blog/2020/04/02/opening-large-csv-files-in-numbers-10-0/"&gt;Opening Large CSV Files in Numbers 10.0&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-03&lt;/a&gt;: &lt;a href="http://josecamachocollados.com/book_embNLP_draft.pdf"&gt;Embeddings in Natural Language Processing: Theory and Advances in Vector Representation of Meaning&lt;/a&gt; (PDF, 163 pp.).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-03&lt;/a&gt;: &lt;a href="https://link.springer.com/book/10.1007/978-3-319-11080-6"&gt;Linear Algebra Done Right&lt;/a&gt;, by Sheldon Axler, is available for free as well. Idem for &lt;a href="https://users.aalto.fi/~ave/BDA3.pdf"&gt;Bayesian Data Analysis&lt;/a&gt; (PDF, 3rd ed.), but see the &lt;a href="https://github.com/avehtari/BDA_course_Aalto"&gt;GH repo&lt;/a&gt;. Happy readings and stay safe!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-03&lt;/a&gt;: &lt;a href="https://kaygun.tumblr.com/post/614218948209197056/using-javaplex-with-clojure"&gt;Using JavaPlex with Clojure&lt;/a&gt;. &lt;code&gt;#clojure&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-03&lt;/a&gt;: &lt;a href="https://notstatschat.rbind.io/2020/04/03/new-in-the-survey-package/"&gt;Version 4.0 of the survey package is on its way to CRAN.&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-05&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/goddess-deluxe-version/865230794" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Banks, &lt;em&gt;Goddess&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-05&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Considering everything we know about China — human rights violations, untrustworthy track record, unaccountable totalitarian leadership, vast resources, and their technical expertise to act, at scale, on access to potentially sensitive poorly-encrypted video calls — China is quite literally and obviously the last country on the face of the earth where you’d want video calls routed. &amp;mdash; &lt;a href="https://daringfireball.net/linked/2020/04/04/zoom-china-mistake"&gt;TechCrunch: &amp;lsquo;Zoom admits some calls were routed through China by mistake&amp;rsquo;&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-04-05&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;One of my produtivity challenges is starting projects. When writing, I struggle with the blank page. When faced with a big project, I struggle to decide where to start. My suspicion is that REPL-driven development facilitates tinkering that gets me over that initial hump. &amp;mdash; &lt;a href="https://www.travishinkelman.com/posts/programming-horizons-revisited/"&gt;Programming horizons revisited&lt;/a&gt;I would add that the REPL-driven approach to data analysis (R or Stata compared to, say, SAS or SPSS) let you &amp;lsquo;feel&amp;rsquo; the data in a particular way. Think of exploratory data analysis, for instance.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-04-05&lt;/a&gt;: Culinary memories of the last days.
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0983.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0983.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0985.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0985.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0987.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0987.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-05&lt;/a&gt;: &lt;a href="https://kaygun.tumblr.com/post/614218948209197056/using-javaplex-with-clojure"&gt;Using JavaPlex with Clojure&lt;/a&gt;. &lt;code&gt;#clojure&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-06&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/how-big-how-blue-how-beautiful-deluxe/964546448" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Florence + the Machine, &lt;em&gt;How Big, How Blue, How Beautiful&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-06&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Brian D. Ripley, Spatial Statistics. On the one hand, this is from 1981, so all the detailed computational advice is laughably obsolete. (At one point, Ripley discusses strategies for not having to keep all of a 128 kb image in main memory at once.) There has also been a lot of advances in some aspects of the theory, notably point processes. On the other hand, Ripley&amp;rsquo;s basic advice &amp;mdash; visualize; do less testing for &amp;ldquo;randomness&amp;rdquo; and more model-building; simulate your models, visualize the simulations, and test modeling assumptions with simulations and visualizations; smooth, and remember that &amp;ldquo;kriging&amp;rdquo; is just the Wiener filter &amp;mdash; remains eminently sound. &amp;mdash; I have been reading bits and pieces of this book, off and on, since around 2000, but I have a rule about not recommending something until I&amp;rsquo;ve finished it completely. Having finally now read it all, including the chapter on tomography (!), I can safely say: anyone seriously interested in spatial statistics probably ought to read this, but you can skip the tomography chapter as obsolete. &amp;mdash; &lt;a href="http://bactra.org/weblog/algae-2020-03.html"&gt;Books to Read While the Algae Grow in Your Fur, March 2020&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-04-06&lt;/a&gt;: Yet another nice post by Travis Hinkelman on statistical data structures in Scheme: &lt;a href="https://www.travishinkelman.com/posts/split-bind-append-dataframes-chez-scheme/"&gt;Split, bind, and append dataframes in Chez Scheme&lt;/a&gt;. &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-07&lt;/a&gt;: Nice post on &lt;a href="https://martin-thoma.com/backtracking/"&gt;Backtracking&lt;/a&gt;, by Martin Thoma.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-07&lt;/a&gt;: &lt;a href="http://blog.josephwilk.net/clojure/functions-explained-through-patterns.html"&gt;Functions Explained Through Patterns&lt;/a&gt;. &lt;code&gt;#clojure&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-07&lt;/a&gt;: &lt;a href="https://github.com/cljfx/cljfx"&gt;cljfx&lt;/a&gt;: Declarative, functional and extensible wrapper of JavaFX inspired by better parts of react and re-frame.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-07&lt;/a&gt;: &lt;a href="https://github.com/appliedsciencestudio/emacs-vega-view/blob/master/README.md"&gt;emacs-vega-view&lt;/a&gt;: a small library meant to facilitate exploratory data visualization using Vega. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-08&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;But Emacs and Vim have been shaped, balanced, sharpened and smoothed over by decades of usage by hundreds of thousands of programmers, each trying to get through their day as efficiently and fuss-free as possible. In the right hands, they move lines, shift paragraphs and fling code better and faster than anything out there. &amp;mdash; &lt;a href="https://eamonnsullivan.co.uk/posts-output/2020-04-05-well-honed-tool/"&gt;A well-honed tool&lt;/a&gt; (via &lt;a href="https://irreal.org/blog/?p=8784"&gt;Irreal&lt;/a&gt;)&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-04-08&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Google, the world’s largest ad-tech company, has direct access to user data and browsing information from a large part of the web traffic. Their data collection can track an individual from multiple angles to create the best possible behavioral profile. Google has nine different products with more than one billion users each. &amp;mdash; &lt;a href="https://plausible.io/blog/remove-google-analytics"&gt;Why you should stop using Google Analytics on your website&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-04-08&lt;/a&gt;: I was cleaning an old 500 Go HD that I used to use for backup some years ago. That feeling when you finf some good old R code&amp;hellip;&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-04-08-13-53-30.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-08&lt;/a&gt;: This also is ten years old!&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-04-04-12-22-52.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-08&lt;/a&gt;: We are done with season 10 of &lt;a href="https://en.wikipedia.org/wiki/The_Walking_Dead_%28TV_series%29"&gt;The Walking Dead&lt;/a&gt;. Something&amp;rsquo;s obviously missing, and it was way too short.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-08&lt;/a&gt;: &lt;a href="http://mbork.pl/2020-04-06_Printing_from_the_command_line"&gt;Printing from the command line&lt;/a&gt;. Because why not?&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-09&lt;/a&gt;: Still reading, and cooking&amp;hellip;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0992.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0992.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0998.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0998.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_1001.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_1001.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-09&lt;/a&gt;: &lt;a href="https://bost.ocks.org/mike/example/"&gt;For Example&lt;/a&gt;, by Mike Bostock. &lt;code&gt;#dataviz&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-10&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/bring-it-on/723508569" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Gomez, &lt;em&gt;Bring It On&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-10&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The two libraries [Scalaz and Cats] have different styles, and both remain heavily used by portions of the community today. The evangelism has died down, to some extent, but usage remains strong and everyone recognizes functional programming as one possible style in which to write your Scala applications. &amp;mdash; &lt;a href="http://www.lihaoyi.com/post/TheDeathofHypeWhatsNextforScala.html"&gt;The Death of Hype: What&amp;rsquo;s Next for Scala&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-04-10&lt;/a&gt;: Happy to take another fresh look at Kristoffer Magnusson&amp;rsquo;s nice &lt;a href="https://rpsychologist.com/viz"&gt;visualization projects&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt; &lt;code&gt;#dataviz&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-10&lt;/a&gt;: I happened to finish to transfer 200 Go of data over home wifi to an 8 year old Time Machine. It tooks a night, and part of a day, btw.&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-04-09-04-02-50.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-10&lt;/a&gt;: Lot of interesting &lt;a href="https://sites.google.com/view/giovannicerulli/software"&gt;Stata programs&lt;/a&gt; for epidemiology and econometrics. &lt;code&gt;#stata&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-10&lt;/a&gt;: Time for &lt;a href="https://github.com/tonsky/FiraCode"&gt;Fira Code&lt;/a&gt; &lt;a href="https://github.com/tonsky/FiraCode/releases/tag/3"&gt;v3&lt;/a&gt;!&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-04-10-19-04-29.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-10&lt;/a&gt;: &lt;a href="https://ro-che.info/articles/2020-01-11-gdb-break-on-nan"&gt;Break on NaN in gdb&lt;/a&gt;, or how to detect &amp;ldquo;not a number&amp;rdquo; edge cases in C. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-10&lt;/a&gt;: &lt;a href="https://zenodo.org/record/3736363#.XpCmky3pNQL"&gt;Bringing GNU Emacs to Native Code&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-10&lt;/a&gt;: &lt;a href="https://jiamingmao.github.io/data-analysis/"&gt;Modern Data Analysis for Economics&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-11&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Joan As Police Woman, &lt;em&gt;To Survive&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-11&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   John Cale, &lt;em&gt;Fragments of a Rainy Season&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-11&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Paul Graham describes LISP as the convergence point for all programming languages. His observation is that as languages mature, the average language continues to slide towards LISP. Therefore understanding LISP is to understand the fundamental model of modern programming. &amp;mdash; &lt;a href="https://joshbradley.me/understanding-the-power-of-lisp/"&gt;Understanding the Power of LISP&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-04-11&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;September 1993. Before then, the internet was primarily a university thing, and in university settings, fall semester starts in September, so you had a whole freshman class getting their first networked computer access and often doing rude things with it, especially in the eyes of the Sys Admins who had to deal with it. The problem was, in 1993, you started having the WorldWideWeb, and thus there would always be an influx of new users who continue to behave in ways Sys Admins consider rude. And that influx never stopped. &amp;mdash; &lt;a href="http://meatballwiki.org/wiki/TheSeptemberThatNeverEnded"&gt;TheSeptemberThatNeverEnded&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-04-11&lt;/a&gt;: How nice! Frank Harrell is about to release &lt;a href="http://hbiostat.org/R/rms/blrm.html"&gt;blrm&lt;/a&gt;, an extension of the &lt;a href="https://cran.r-project.org/web/packages/rms/index.html"&gt;rms&lt;/a&gt; package for Bayesian binary and ordinal proportional odds logistic regression. Together with &lt;a href="https://cran.r-project.org/web/packages/brms/index.html"&gt;brms&lt;/a&gt;, the bayesian toolbox has grown fast on CRAN the last few years.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-11&lt;/a&gt;: Interesting study: Looking back at findings from a series of eyetracking studies over 13 years, we see that fundamental scanning behaviors remain constant, even as designs change.&amp;gt; The more things change, the more they stay the same.&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-04-11-20-22-42.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-11&lt;/a&gt;: It looks like &lt;a href="https://rogueamoeba.com"&gt;Rogue Amoeba&lt;/a&gt; is the definitive way to go for controlling audio IO on a Mac these days. See also &lt;a href="https://marco.org/podcasting-microphones"&gt;Podcasting Microphones Mega-Review&lt;/a&gt;. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-11&lt;/a&gt;: It&amp;rsquo;s always interesting, if not enlightening, to re-read Terence Tao&amp;rsquo;s review on &lt;a href="https://terrytao.wordpress.com/2010/01/01/254a-notes-0-a-review-of-probability-theory/"&gt;probability theory&lt;/a&gt; ten years later.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-11&lt;/a&gt;: Let&amp;rsquo;s be happy, and here&amp;rsquo;s what you probably need for tonight:&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-04-11-20-44-18.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-11&lt;/a&gt;: This was the day it was.&lt;br&gt;&lt;small&gt;(puff pastry with spinach, feta, prunes, onions and spices)&lt;/small&gt;&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_1009.jpg" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-11&lt;/a&gt;: &lt;a href="https://ptls.dev"&gt;Pointless: a scripting language for learning and fun&lt;/a&gt;.&amp;gt; Expressions in Pointless are normally evaluated eagerly. There are exceptions to this rule, like the branches of conditional statements, as described previously. There are two other important instances where the language introduces laziness: lists and definitions.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-14&lt;/a&gt;: A nice discussion about &lt;a href="http://utf8everywhere.org"&gt;UTF-8 encoding&lt;/a&gt;.&amp;gt; We see no particular reason to favor Unicode code points over Unicode grapheme clusters, code units or perhaps even words in a language for that. On the other hand, seeing UTF-8 code units (bytes) as a basic unit of text seems particularly useful for many tasks, such as parsing commonly used textual data formats. This is due to a particular feature of this encoding. Graphemes, code units, code points and other relevant Unicode terms.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-14&lt;/a&gt;: Lovely: &lt;a href="https://news.russellsaw.io"&gt;The Webpage&lt;/a&gt;, an online RSS reader and news aggregator, styled like a newspaper. (via HN)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-14&lt;/a&gt;: Some handy shortcuts to &lt;a href="https://gist.github.com/premek/6e70446cfc913d3c929d7cdbfe896fef"&gt;rename files&lt;/a&gt; on Un*x systems.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-15&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Emacs (like Smalltalk) has no barriers except at its low-level foundations. Emacs users can change, and break, anything they like. Emacs packages made available for download can potentially contain very malicious code. The Emacs philosophy, going back to the 1970s when there were neither cybercriminals nor completely tech-naive users, is that Emacs users are fully responsible for managing their Emacs environment. This actually works very well in practice, even today, because Emacs is neither attractive for completely tech-naive users, nor sufficiently popular to be an interesting target for cybercriminals. &amp;mdash; &lt;a href="https://malleable.systems/blog/2020/04/01/the-most-successful-malleable-system-in-history/"&gt;The most successful malleable system in history&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-04-15&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;We’re happy to announce we’re making private repositories with unlimited collaborators available to all GitHub accounts. All of the core GitHub features are now free for everyone. &amp;mdash; &lt;a href="https://github.blog/2020-04-14-github-is-now-free-for-teams/"&gt;GitHub is now free for teams&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-04-15&lt;/a&gt;: Interesting discussion regarding &lt;a href="https://dave.autonoma.ca/blog/2019/05/22/typesetting-markdown-part-1/"&gt;Markdown for serious typesetting&lt;/a&gt; (using shell scripting).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-15&lt;/a&gt;: This was also the day it was.&lt;br&gt;&lt;small&gt;(roast chicken, fried potatoes and carrots, and celery root.)&lt;/small&gt;&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_1018.jpg" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-16&lt;/a&gt;: &lt;a href="https://github.com/plotly/falcon"&gt;Falcon&lt;/a&gt;: Free, open-source SQL client for Windows and Mac. Looks like a nice successor to Induction app (now &lt;a href="https://alternativeto.net/software/induction/"&gt;defunct&lt;/a&gt;).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-16&lt;/a&gt;: &lt;a href="http://harpjs.com"&gt;Harp&lt;/a&gt;: The static web server with built-in preprocessing.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-17&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Given that many of Common Lisp’s defining features and advantages are also available in other languages, who would choose Lisp over any of the more mainstream options? Someone who needs to write code that is portable across operating systems and competing implementations in a high-level, compiled language that generates standalone executable binaries with execution speed comparable to C. &amp;mdash; &lt;a href="https://www.darkchestnut.com/2017/pragmatic-reasons-for-choosing-common-lisp/"&gt;Pragmatic reasons for choosing Common Lisp&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-17&lt;/a&gt;: &amp;gt; People who have never really lived in a world without mobile phones […] might think that daily life at that time was unnecessarily complicated and ‘harder’. Organising meetings, finding people, finding places around you, having to use paper maps instead of having a portable device with GPS functionalities built in, not being able to look things up in Google or Wikipedia at any time. The truth is, people knew how to organise themselves with the tools they had available. Daily life had a completely different pace and style, built around the tools available at that time. It really isn’t a matter of ‘worse’ or ‘better’ — life was just different. &amp;mdash; &lt;a href="http://morrick.me/archives/8849"&gt;How I’d live this quarantine if it was 1990&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-04-17&lt;/a&gt;: The book &lt;a href="https://leanpub.com/progalgs"&gt;Programming Algorithms (A comprehensive guide to writing efficient programs with examples in Lisp)&lt;/a&gt; is now completed, and it is available (eventually for free) on Leanpub. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-17&lt;/a&gt;: &lt;a href="https://danielmiessler.com/blog/a-list-of-ways-to-confirm-the-earth-is-round/"&gt;A List of Ways to Confirm the Earth is Round&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-17&lt;/a&gt;: &lt;a href="http://shape-of-code.coding-guidelines.com/2020/04/12/motzkin-paths-and-source-code-silhouettes/"&gt;Motzkin paths and source code silhouettes&lt;/a&gt;. See also &lt;a href="https://aliquote.org/post/motzkin-numbers/"&gt;Motzkin numbers&lt;/a&gt; on the main blog.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-17&lt;/a&gt;: &lt;a href="https://www.darkchestnut.com/2020/web-development-starter-pack/"&gt;Web development starter pack&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-17&lt;/a&gt;: &lt;a href="https://github.com/weirdNox/org-noter"&gt;org-noter&lt;/a&gt;: Emacs document annotator, using Org-mode, with &lt;a href="https://github.com/weirdNox/org-noter#diff"&gt;some differences&lt;/a&gt; from Interleave. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-18&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Ranking is a farce. Apparent performance is actually attributable mostly to the system that the individual works in, not to the individual himself. &amp;mdash; &lt;a href="https://www.2uo.de/deming/"&gt;Statistical process control after W. Edwards Deming&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-04-18&lt;/a&gt;: Here it is.&lt;br&gt;&lt;small&gt;(ground beef, eggplant, peppers, tomatoes, moussaka style)&lt;/small&gt;&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_1034.jpg" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-18&lt;/a&gt;: &lt;a href="https://github.com/jbranchaud/til/blob/master/README.md"&gt;TIL&lt;/a&gt;: A collection of concise write-ups on small things.&amp;gt; 909 TILs and counting&amp;hellip;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-04-18&lt;/a&gt;: &lt;a href="https://ljvmiranda921.github.io/notebook/2019/11/08/flask-redis-celery-mcdo/"&gt;Why do we need Flask, Celery, and Redis?&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-21&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Refinement types give us the ability to define validation rules, or more commonly called predicates, at the type level. This means we get compile-time validation whenever the values are known at compile-time. &amp;mdash; &lt;a href="https://gvolpe.github.io/blog/parallel-typeclass-for-haskell/"&gt;Parallel typeclass for Haskell&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Aside from the compilation aspect, I think that &lt;code&gt;assert&lt;/code&gt; like statements (in Stata or Python) are very close to the above statement in statistical programming.&lt;br&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-04-21&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Whenever I hear someone emphasize the speed of their just-released scientific software, my strong Bayesian prior is that they are really telling me their code is not only full of bugs (all software is!) but that it&amp;rsquo;ll be really hard to find and fix them&amp;hellip; &amp;mdash; &lt;a href="http://ivory.idyll.org/blog/2020-software-and-workflow-dev-practices.html"&gt;Software and workflow development practices&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-04-21&lt;/a&gt;: After a few days of use, I found that &lt;a href="https://github.com/dzop/emacs-jupyter"&gt;emacs-jupyter&lt;/a&gt; really is an amazing package. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-04-21-20-04-12.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-21&lt;/a&gt;: I have nothing to delete (I &lt;a href="https://aliquote.org/post/leaving-social-media/"&gt;already&lt;/a&gt; &lt;a href="https://aliquote.org/post/goodbye-google/"&gt;did&lt;/a&gt; this a lot ), and I missed the deadline. See you next year for the &lt;a href="https://deletionday.com"&gt;deletion day&lt;/a&gt;!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-21&lt;/a&gt;: I&amp;rsquo;ve been lately retrying Atom: Atom IDE and the rest of Facebook&amp;rsquo;s stuff is really in a sad mood apparently (Rust is ok but Haskell is a 2nd class citizen all along; Nuclide terminal&amp;rsquo;s not working), Hydrogen still works great but you need to update kernel specs for Python 3. I guess I will just return to my usual stuff in Emacs. BTW, this is a great read if you&amp;rsquo;re looking for an alternative to Hydrogen and/or Nteract: &lt;a href="https://lepisma.xyz/2016/11/02/org-babel/"&gt;Cheap polyglot notebooks&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-21&lt;/a&gt;: &lt;a href="http://www.cs.man.ac.uk/~david/categories/book/book.pdf"&gt;Computational Category Theory&lt;/a&gt; (PDF, 263 pp.).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-21&lt;/a&gt;: &lt;a href="https://github.com/betatim/notebook-as-pdf/blob/master/README.md"&gt;Jupyter Notebooks as PDF&lt;/a&gt;. Surely an interesting option for those using Jupyter notebooks extensively. Of note, it will install Chromium since the NB -&amp;gt; HTML conversion is performed without Latex.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-21&lt;/a&gt;: &lt;a href="https://lepisma.xyz/2017/10/28/ricing-org-mode/index.html"&gt;Ricing up Org Mode&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-21&lt;/a&gt;: &lt;a href="https://www.ethanaa.com/blog/switching-to-doom-emacs/#why-the-switch"&gt;Switching to Doom Emacs&lt;/a&gt;. Nothing really fancy about Doom capabilities and philosophy, but in case you&amp;rsquo;re interested in switching too, here are the instructions to install it! &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-24&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_1047.jpg" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-24&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;There are an untold number of analyses of panel data affected by an issue that is almost impossible to identify because R and Stata obscure the problem. Thanks to multi-collinearity checks that automatically drop predictors in regression models, a two-way fixed effects model can produce sensible-looking results that are not just irrelevant to the question at hand, but practically nonsense. &amp;mdash; &lt;a href="http://www.robertkubinec.com/post/fixed_effects/"&gt;What Panel Data Is Really All About&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-04-24&lt;/a&gt;: And so it happened: We now have &lt;code&gt;dplyr&lt;/code&gt; clones &lt;a href="https://github.com/yonicd/bplyr"&gt;here&lt;/a&gt; and &lt;a href="https://github.com/nathaneastwood/poorman"&gt;there&lt;/a&gt;, with base R only. I will call it the #rstats clone war from now on. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-24&lt;/a&gt;: Create &lt;a href="https://github.com/robertgrant/stata2d3"&gt;interactive D3 JavaScript graphics&lt;/a&gt; from standard Stata commands. &lt;code&gt;#stata&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-24&lt;/a&gt;: So many changes to expect in existing code base! &lt;a href="https://stat.ethz.ch/pipermail/r-announce/2020/000653.html"&gt;R 4.0.0 is released&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-24&lt;/a&gt;: TIL about &lt;a href="https://grf-labs.github.io/grf/"&gt;Generalized Random Forests&lt;/a&gt;, which currently provides non-parametric methods for least-squares regression, quantile regression, and treatment effect estimation (optionally using instrumental variables). &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-24&lt;/a&gt;: Welcome to the &lt;a href="https://open.kattis.com"&gt;Kattis Problem Archive&lt;/a&gt;. Yes, I need more ways to waste time these days.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-24&lt;/a&gt;: &lt;a href="https://gist.github.com/raysan5/909dc6cf33ed40223eb0dfe625c0de74"&gt;CUSTOM GAME ENGINES: A Small Study&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-24&lt;/a&gt;: &lt;a href="http://jkff.info/articles/ire/"&gt;Incremental Regular Expressions&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-24&lt;/a&gt;: &lt;a href="https://github.com/ColinIanKing/christmas-obfuscated-C"&gt;Obuscated C Christmas programs&lt;/a&gt;, with some &lt;a href="https://github.com/ColinIanKing/christmas-obfuscated-C/blob/master/tricks/obfuscation-tricks.txt"&gt;tricks&lt;/a&gt;. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-28&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/the-story-and-the-ass-saw-the-angel-reading-with-music-ep/1380319097" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Nick Cave, &lt;em&gt;The Story &amp;ndash; And the Ass the Angel&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-28&lt;/a&gt;: I didn&amp;rsquo;t upgrade my R stuff yet. I should note that beside reference counting, the new &lt;a href="https://blog.revolutionanalytics.com/2020/04/r-400-is-released.html"&gt;color palette&lt;/a&gt; looks really great! &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-28&lt;/a&gt;: If you&amp;rsquo;re missing some good books while retired at home, don&amp;rsquo;t forget Springer offers free PDF + EPUB version of &lt;a href="https://link.springer.com/search/page/1?facet-content-type=%22Book%22&amp;amp;package=mat-covid19_textbooks&amp;amp;facet-language=%22En%22&amp;amp;sortOrder=newestFirst&amp;amp;showAll=true"&gt;many textbooks&lt;/a&gt; in computer science and statistics.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-28&lt;/a&gt;: &lt;a href="https://wizardforcel.gitbooks.io/sicp-in-python/content/"&gt;SICP in Python&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-28&lt;/a&gt;: &lt;em&gt;Zawinski&amp;rsquo;s Law&lt;/em&gt; &amp;ldquo;Every program attempts to expand until it can read mail. Those programs which cannot so expand are replaced by ones which can.&amp;rdquo; Law of Software Envelopment, Jamie Zawinski.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-04-29&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Iterated random functions are used to draw pictures or simulate large Ising models, among other applications. They offer a method for studying the steady state distribution of a Markov chain, and give useful bounds on rates of convergence in a variety of examples. The present paper surveys the field and presents some new examples. There is a simple unifying idea: the iterates of random Lipschitz functions converge if the functions are contracting on the average. &amp;mdash; Iterated Random Functions, by Diaconis and Freedman&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/2020-04-29-12-16-04.png"&gt;
&lt;/figure&gt;
Sounds already good to me.&lt;br&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-04-29&lt;/a&gt;: Re-reading my old TODO lists, I noticed I bookmarked &lt;a href="https://agate.readthedocs.io/en/1.6.1/"&gt;agate&lt;/a&gt; long ago. The &lt;a href="https://github.com/wireservice/agate/blob/1.6.1/tutorial.ipynb"&gt;showcase&lt;/a&gt; is awesome, especially regarding quick drawing facilities (including facetting &amp;amp; co.). &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>Wolfram Engine and Jupyter</title><link>https://aliquote.org/post/wolfram-engine/</link><pubDate>Fri, 24 Apr 2020 12:04:01 +0200</pubDate><guid>https://aliquote.org/post/wolfram-engine/</guid><description>&lt;p&gt;I hold a license for Mathematica 9 (pro) and 11 (home edition), and whenever I need to run some Mathematica code, I just launch the Desktop app because I prefer Desktop app anyway. There are two other options to run Mathematica code these days. First, you can use Wolfram cloud, even from your phone if you like, or you can install the Jupyter &lt;a href="https://github.com/WolframResearch/WolframLanguageForJupyter"&gt;kernel extension&lt;/a&gt;. The later is interesting because you can use Emacs &lt;a href="https://github.com/dzop/emacs-jupyter"&gt;jupyter&lt;/a&gt; mode to interact with your running kernel without worrying about launching a notebook or a console in a separate terminal. While I was very enthusiastic at the beginning, I soon realized that I will stand by Mathematica for the time being.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/2020-04-21-20-04-12.png"&gt;
&lt;/figure&gt;
&lt;small&gt;The above screenshot was taken while using an older version of the kernel. I&amp;rsquo;m now running version 12.1.&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;In a &lt;a href="https://aliquote.org/post/stata-jupyter/"&gt;previous post&lt;/a&gt; of mine I discussed some alternatives to &lt;a href="https://ess.r-project.org"&gt;ESS&lt;/a&gt; to run Stata code. Upon reflection, and a bit of tests and experiments, I have to admit that &lt;code&gt;emacs-jupyter&lt;/code&gt; comes in handy to work with Stata code interactively: Just edit your &lt;code&gt;do&lt;/code&gt;-file in a standard Emacs buffer, and &lt;code&gt;C-c C-c&lt;/code&gt; to evaluate it right away in Jupyter. Also, don&amp;rsquo;t forget to &lt;code&gt;(setq jupyter-repl-echo-eval-p t)&lt;/code&gt; in order to have the results printed in the Jupyter buffer instead of a blank buffer. Minor caveat: you still need to &lt;code&gt;graph export&lt;/code&gt; your plot as there&amp;rsquo;s no support for embedded plots (like in, e.g., Racket mode), notwithstanding the fact that &lt;code&gt;graph2png&lt;/code&gt; is not available in console mode.&lt;/p&gt;
&lt;p&gt;Regarding Wolfram, you will need to install the Wolfram kernel, which also means that you will have to install the &lt;a href="https://www.wolfram.com/engine/"&gt;Wolfram engine&lt;/a&gt; as well as the &lt;code&gt;wolframscript&lt;/code&gt; command-line program. The Wolfram engine is free for educational or personal purpose. I somehow forgot about an &lt;a href="https://writings.stephenwolfram.com/2019/05/launching-today-free-wolfram-engine-for-developers/"&gt;older post&lt;/a&gt; by Stephen Wolfram who introduced the SDK. It is around 1 Go (much less than the full Mathematica package) and it comes without any GUI, but it includes &lt;code&gt;wolframscript&lt;/code&gt; as a separate package. When you&amp;rsquo;re done with the installation procedure, you should be able to launch either one from the Applications folder, and they will run in your Terminal application. You will need to register your account by launching &lt;code&gt;wolframscript&lt;/code&gt; once before activating the Wolfram kernel.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2020-04-27-08-08-16.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Unfortunately, at this point I do not find the Jupyter UI very interesting compared to, say, Stata or Python. While Stata or Python runs fine in an interactive Qt console, results are also correctly rendered under Emacs, pending a minor issue with graphical output. However, nothing like this is available at the time of this writing for Wolfram code. Moreover, here is what I get when using wolframscript, compared to the output of Mathematica:&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2020-04-27-11-07-51.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2020-04-27-11-07-51.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2020-04-27-11-08-01.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2020-04-27-11-08-01.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;In fact, this is nothing but Math kernel in action (I use to use Mathematica in a Terminal from time to time). In Emacs, the results are not even displayed, although the connection to the running kernel appears to be working fine. I don&amp;rsquo;t know why. Actually, everything works as expected if you&amp;rsquo;re willing to use a Jupyter notebook (and you&amp;rsquo;re not too fussy about the typographical rendering). So, I suspect the kernel was developed with Jupyter notebook in mind, and not really CLI connections, at least for this initial release.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2020-04-27-18-48-14.png"&gt;
&lt;/figure&gt;</description></item><item><title>April in review</title><link>https://aliquote.org/post/micro-review-011/</link><pubDate>Sun, 19 Apr 2020 08:06:24 +0200</pubDate><guid>https://aliquote.org/post/micro-review-011/</guid><description>&lt;p&gt;I&amp;rsquo;ve been keeping so much bookmarks in Safari on my iPhone that I definitely need to expunge some of them. So here are some things to read while we live in our wild home sweet home.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;There&amp;rsquo;s an updated &lt;a href="https://observablehq.com/@d3/learn-d3"&gt;tutorial on D3&lt;/a&gt; here on Observable now. This is series of 9 notebooks which are probably worth the look even if you are alreayd familiar with D3.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;How did I miss this abandoned book on Lisp? Here&amp;rsquo;s &lt;a href="https://www.nicklevine.org/lisp-book/talks/eclm-2011-10-23/plan.txt"&gt;Nick Levine&lt;/a&gt;&amp;rsquo;s take on the idea of publishing for O&amp;rsquo;Reilly back in 2011. See also this &lt;a href="https://www.nicklevine.org/declarative/lectures/#lectures"&gt;course on Common Lisp&lt;/a&gt;. Finally, ACM is offering many articles for free, so let&amp;rsquo;s for some old papers like &lt;a href="https://dl.acm.org/doi/abs/10.1145/1411829.1411837"&gt;LISP history&lt;/a&gt; or &lt;a href="https://dl.acm.org/doi/abs/10.1145/800068.802140"&gt;An overview of COMMON LISP&lt;/a&gt;, by Guy Steele.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;COMMON LISP is a new dialect of the LISP language, related specifically to MACLISP and Lisp Machine LISP, designed by a group of committed implementors and others. A language definition document is being prepared and should be substantially complete before August 1982. COMMON LISP is specifically designed to be portable, and yet also sufficiently powerful that a broad range of &amp;ldquo;systems software&amp;rdquo; (such as text editors, graphics programs, and 1/O drivers) can be efficiently expressed in it.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Reader macros for concise expression of function partial application and composition, in Lisp, available on &lt;a href="https://github.com/eschulte/curry-compose-reader-macros"&gt;Github&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Thanks to Jeroen Janssens, I recently learnt that there&amp;rsquo;s something like a grammar of graphics for Python which is not &lt;a href="http://ggplot.yhathq.com"&gt;ggplot&lt;/a&gt;, but &lt;a href="https://www.datascienceworkshops.com/blog/plotnine-grammar-of-graphics-for-python/"&gt;plotnine&lt;/a&gt;. There are some exmaples of use on &lt;a href="https://github.com/has2k1/plotnine-examples/tree/master/plotnine_examples/examples"&gt;Github&lt;/a&gt;, although at this point I wonder if this goes beyond basic graphics.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Random links: &lt;a href="https://wiki.c2.com/?ThreeStarProgrammer"&gt;Three Star Programmer&lt;/a&gt;, &lt;a href="https://www.williamyaoh.com/posts/2020-04-12-software-engineer-hangups.html"&gt;Things software engineers trip up on when learning Haskell&lt;/a&gt;, &lt;a href="https://szymonkaliski.com/writing/2020-04-19-memex-dreams/"&gt;Memex&lt;/a&gt; by Szymon Kaliski.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;While I use mostly Emacs, I sometimes fire up Nvim for quick edits, and I keep reading about others&amp;rsquo; config files, just so I know what&amp;rsquo;s the current state of affair in Vim land. For instance, recently I learned about &lt;a href="https://liquidz.github.io/vim-iced/"&gt;vim-iced&lt;/a&gt;, which is a Vim8 / Neovim plugin to provide a Clojure interactive development environment, of a nice setup for &lt;a href="https://keleshev.com/my-book-writing-setup/"&gt;Writing a Book with Pandoc, Make, and Vim&lt;/a&gt;, and of this &lt;a href="https://www.reddit.com/r/lispadvocates/comments/g2zi4s/a_case_for_vim/"&gt;lengthy thread&lt;/a&gt; on Reddit, by the LispAdvocates.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.ellessenne.xyz/2020/03/rmst-and-survival-forests/"&gt;RMST and survival forests&lt;/a&gt;. The growing number of applications of Random Forests in the past 10 years will always surprise me. Now I&amp;rsquo;m reading about &lt;a href="https://kogalur.github.io/randomForestSRC/theory.html."&gt;random survival forest&lt;/a&gt; and the &lt;a href="https://cran.r-project.org/web/packages/randomForestSRC/index.html"&gt;randomForestSRC&lt;/a&gt; package.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://aliquote.org/img/2020-04-20-10-22-17.png" alt="randomForestSRC"&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Pattern-defeating quicksort (&lt;a href="https://github.com/orlp/pdqsort"&gt;pdqsort&lt;/a&gt;) is a novel sorting algorithm that combines the fast average case of randomized quicksort with the fast worst case of heapsort, while achieving linear time on inputs with certain patterns.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://ericmjl.github.io/essays-on-data-science/machine-learning/markov-models/"&gt;Markov Models From The Bottom Up&lt;/a&gt;: A nice overview of Markov models using Python.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Random #rstats news here and there: &lt;a href="https://github.com/IndrajeetPatil/ggstatsplot"&gt;ggstatsplot&lt;/a&gt; (Enhancing &lt;code&gt;ggplot2&lt;/code&gt; plots with statistical analysis), &lt;a href="https://medium.com/pew-research-center-decoded/analyzing-international-survey-data-with-the-pewmethods-r-package-3b0b21cba607"&gt;Analyzing international survey data with the pewmethods R package&lt;/a&gt;, Frank Harrell&amp;rsquo;s scripts for &lt;a href="https://github.com/harrelfe/rscripts"&gt;reproducible reporting&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://elmord.org/blog/?entry=20191114-sbcl-chez"&gt;Chez Scheme vs. SBCL: a comparison&lt;/a&gt;: I wish the author included a comparison of Chez and Racket for the Scheme part.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://hal.inria.fr/PGE/"&gt;Phylogenetics in the Genomic Era&lt;/a&gt;. Lovely!&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;This journey in the collaborative publishing has started with the unreasonable request from a well-known publisher to make us pay 20,000 euros for an open access book that we (the editors), would have had to handle from A to Z (choose the chapters, find the authors, get the contracts signed, format the manuscript etc &amp;hellip;). It did not seem right, so we asked the colleagues that already had shown interest in writing a chapter for our book, to trust us.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Expect a few more pointers in a next post.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;You are a software developer? And sometimes you need to use cryptography in your daily job, like hashes, encryption or digital signatures? And you think cryptography is complex and full of math and it is for nerds only? No, this is not true, every developer can learn how to use cryptographic algorithms. This book will show you how: with code examples and hands-on coding experience, with less math and more practice. &amp;mdash; &lt;a href="https://cryptobook.nakov.com"&gt;Practical cryptography for developers&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Meltemi • &lt;em&gt;Alboran Trio&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Galton-Watson process</title><link>https://aliquote.org/post/galton-watson/</link><pubDate>Sat, 04 Apr 2020 20:31:40 +0200</pubDate><guid>https://aliquote.org/post/galton-watson/</guid><description>&lt;p&gt;We already talked about &lt;a href="https://aliquote.org/post/markov-random-process-using-mathematica/"&gt;Markov models&lt;/a&gt; and &lt;a href="https://aliquote.org/post/virus-and-bacteria/"&gt;branching process&lt;/a&gt;. Formally, branching processes allow to model a random genealogical or phylogenetic tree with a common ancestor &amp;mdash; we also say this is a rooted tree. Let&amp;rsquo;s assume it is unique. This tree can be defined in a recursive manner:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;At generation $n=0$, the only ancestor die after a fixed period of time (or life), with a probability $p_k$ ($k\ge 0$) of having $k$ children.&lt;/li&gt;
&lt;li&gt;At the the $n$ th generation, all individuals die after the same amount of time as their ancestors, and each of them has, i.i.d., a probability $p_k$ ($k\ge 0$) of having $k$ children.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The &lt;a href="https://en.wikipedia.org/wiki/Galton%E2%80%93Watson_process"&gt;Galton-Watson process&lt;/a&gt; is the random sequence of counts for each generation, $Z_n$ ($n\ge 0$). Its probability law is clearly deduced from the discrete probability $p_k$. Let&amp;rsquo;s further assume that $\sum_{k\ge O} k^2p_k &amp;lt; \infty$. This process can also be expressed as a Markov Chain: Let&amp;rsquo;s denote $p_j^{*i}$ the probability law resulting from the convolution of the probability law of reproduction of the process:&lt;/p&gt;
&lt;p&gt;$$ p_j^{*i} = \sum_{k_1+\dots+k_i=j} p_{k_1}\dots p_{k_i}. $$&lt;/p&gt;
&lt;p&gt;A Galton-Watson process is a Markov chain on positive integers with transition probability:&lt;/p&gt;
&lt;p&gt;$$ Q(i,j) = \mathbb{P}\left( Z_{n+1} = j \mid Z_n = i\right) = \begin{cases} p_j^{*i}\quad \text{if}\: i\neq 0,\cr \delta_{0j}\quad \text{otherwise}\end{cases}. $$&lt;/p&gt;
&lt;p&gt;Little calculus show that the first two moments of $Z_n$ using recurrence are:&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;$$
\begin{align}
\mathbb{E}(Z_n) &amp;amp;= m^n,\cr
\mathbb{V}(Z_n) &amp;amp;= \begin{cases} \sigma^2m^{n-1}\frac{m^n-1}{m-1}\quad \text{if}\: m\ne 1,\cr n\sigma^2\quad\text{otherwise}\end{cases}
\end{align}
$$&lt;/p&gt;
&lt;p&gt;It can further be shown that population extinction (i.e., $Z_n=0$) occurs with probability 1 if $\mathbb{E}(Z_n)\le 1$. If, on the other hand, $\mathbb{E}(Z_n) &amp;gt; 1$, then the probability of extinction $q&amp;lt;1$ is the unique solution of $\phi(s)=s$, $s\in [0;1[$, where $\phi(s) = \sum_{k=0}^{+\infty} p_ks^k$, $\forall s\in [0;1]$, is the moment generating function of $Z_n$.&lt;/p&gt;
&lt;p&gt;Here is a little application of this process in biology. Polymerase Chain Reaction (PCR) is a technique of in vitro enzymatic amplification which can be used to increase the number of available DNA strands. Denaturation, cooling and extension of DNA strands are the three main steps in each cycle of amplification. When this cycle is correctly achieved, the number of DNA strands is doubled. However, a certain number of failures can be observed.&lt;/p&gt;
&lt;p&gt;Suppose there are $N_0$ DNA strands at the start of this process. Each of those $N_0$ strands serves as an ancestor of a Galton-Watson process, where the probability law is given by $p_1=1-p$, $p_2=p$ and $p_k=0$ for $k\ne 1, 2$. Here, $p$ denotes the probability of success of an amplification cycle. The mathematical expectation of reproduction equals $m=1+p$, and the variance is $\sigma^2 = p(1-p)=(m-1)(2-m)$, with $q=0$ (probability of extinction). The expected number of DNA strands after $n$ cycles is thus $N_0m^n$.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Jacques Istas, &lt;em&gt;Introduction aux modélisations mathématiques pour les sciences du vivant&lt;/em&gt;, Springer, 2000.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;From a practical point of view, it is often desired to know $N_0$ in advance, although $N_0$ cannot be identified uniquely. Note, however, that it is possible to consistently estimate the mathematical expectation of the reproduction $m$ with th estimator $\hat m_n = \sum_{k=0}^{\infty} k\hat p_{k_n} = \frac{Y_{(n+1)}-1}{Y_n}$, that is $m$ can be estimated from the observed size of each generation. Hence, the following estimator has been proposed: $\hat N_{0n} = \frac{Z_n}{\hat m_n}$. As an illustration, if the success rate of the PCR is 80% (i.e., $p = 0.8$), its variance equals $\frac{1-p}{1+p}=0.11$.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Before Catalina</title><link>https://aliquote.org/post/before-catalina/</link><pubDate>Thu, 02 Apr 2020 16:38:20 +0200</pubDate><guid>https://aliquote.org/post/before-catalina/</guid><description>&lt;p&gt;Yesterday or the day before (I tend to forget which day we are after those 15 days of confinment), I learned that &lt;a href="https://tyler.io/so-uh-i-think-catalina-10154-broke-ssh/"&gt;ssh got broken&lt;/a&gt; after the last update to macOS Catalina (10.15.4). That&amp;rsquo;s quite unfortunate for those working at home and who need remote access to their own servers or the ones from their paid job. This is not the first time Apple breaks something or simply removes a feature that was otherwise perfectly working. I can think of telnet or ftp for the most recent ones.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;This was a good read. Meanwhile, things have changed a bit on OS X: the ftp command no longer exists in High Sierra, the X11 server has been replaced by XQuartz, and much more. But I guess the next iteration of OS X will come with new UI and core planning policies. &amp;mdash; &lt;a href="https://aliquote.org/post/learning-unix-for-os-x/"&gt;Learning Unix for OS X&lt;/a&gt;, February 2018&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;As many other users I decided to stay on &lt;a href="https://aliquote.org/post/osx-mojave/"&gt;Mojave&lt;/a&gt; &amp;mdash; which I like anyway (despite the fact that it doesn&amp;rsquo;t bring many visual enhancements compared to the preceding version of macOS), when I saw that everybody was complaining about the deluge of &lt;a href="https://tyler.io/macos-10-15-vista/"&gt;notifications&lt;/a&gt; and &lt;a href="https://aliquote.org/micro/2019-10-28-13-15-02/"&gt;apps or permissions&lt;/a&gt; issues (plus additional issues regarding the installation of scientific packages that I need for my work). I deactivated the automatic updates when I got my current Macbook, and the gentle reminder to upgrade to Catalina disappeared some time ago (maybe I deactivated it too, I don&amp;rsquo;t remember). At this point, I think this is my definitive setup for the next years to come. I just hope that nothing will break until Apple next release. If they do persist in delivering OSs that just suck, I will have to go back to a Linux of some kind. But I remain optimistic. After all, we got some good surprises along the years.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2022-01-19]&lt;/small&gt;&lt;br&gt;
So be it. &lt;a href="https://aliquote.org/post/welcome-ubuntu/"&gt;Welcome Ubuntu&lt;/a&gt;.
&lt;/div&gt;
&lt;p&gt;Anyway, I keep updating every package I installed via Homebrew, but I find it a bit boring at time. Why do we need to get a minor update every week, literally? Is this the result of agile development? I do not even speak of software available through Github. Or maybe this is just me, who just happened to spend a fair amount of my time compiling and linking esoteric programs for bioinformatics stuff. Believe it or not, I had to reconfigure my CPAN local folder to use a &lt;a href="http://mitf.cbrc.jp/MitoFates/cgi-bin/top.cgi"&gt;tiny program&lt;/a&gt; a few months ago.&lt;/p&gt;
&lt;p&gt;I like that it is still possible to &lt;a href="https://twitter.com/revodavid/status/1243621843023450112?s=20"&gt;run R 1.0&lt;/a&gt; after 20 years, like the fact that &lt;a href="https://twitter.com/RainerJoswig/status/1220457695414771714?s=20"&gt;Common Lisp programs&lt;/a&gt; written more than 20 years ago are still working fine on modern hardware. This is what bothers me with new languages (e.g., Julia; the &amp;ldquo;new&amp;rdquo; or &amp;ldquo;modern&amp;rdquo; or &amp;ldquo;tidy&amp;rdquo; R): we are forced to live somehow on the bleeding edge, to update frequently, and to experience backward compatibility issues soon or later. The solution appears quite simple, for me at least, since I could also freeze the set of tools I used to use (R, Python, C, Lisp/Scheme, Mathematica, Stata, Emacs, Zsh and all the Unix goodies). This reminds me of a recent interview with &lt;a href="https://usesthis.com/interviews/nils.m.holm/"&gt;Nils M Holm&lt;/a&gt;, who uses quite of an arcane set of tools (and I don&amp;rsquo;t even speak of the look&amp;rsquo;n feel of his &lt;a href="http://t3x.org"&gt;website&lt;/a&gt;!):&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Most probably got it cheap from a used parts dealer. It is underclocked to 750MHz, because that is all I need. Honestly, I could do 99% of my work on a 16MHz 286 box without any significant loss of productivity.&lt;br&gt; Just to prove the point, I sometimes write texts and programs on my Amstrad NC100 notepad computer. That is a 4MHz Z80-based CP/M machine with 64KB of RAM, and it really feels quite snappy.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Anyway, I&amp;rsquo;ll probably continue with my current configuration for a few more years; and who know: by then we&amp;rsquo;ll have a new improved version of the modern R and the successor to VS Code. Long live the Unix shell!&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-10-28-16-27-34.png"&gt;
&lt;/figure&gt;</description></item><item><title>Stata, Emacs and Jupyter</title><link>https://aliquote.org/post/stata-jupyter/</link><pubDate>Tue, 31 Mar 2020 16:59:18 +0200</pubDate><guid>https://aliquote.org/post/stata-jupyter/</guid><description>&lt;p&gt;Emacs is such a piece of artwork when it comes to interacting with live buffers that it is hard to beat. I&amp;rsquo;ve stopped using RStudio a while back now, and to be honest I only used it for teaching purpose. I have been relying on &lt;a href="https://ess.r-project.org"&gt;ESS&lt;/a&gt; for the last 15 years now, and I even learned that it is possible to &lt;a href="https://www.dcalacci.net/2018/remote-ess/"&gt;connect to a remote server&lt;/a&gt; running, e.g., R. You can also &lt;a href="https://vxlabs.com/2017/11/30/run-code-on-remote-ipython-kernels-with-emacs-and-orgmode/"&gt;run code on remote ipython kernels&lt;/a&gt; with Emacs and orgmode. My only regret here is that they dropped support for &lt;a href="http://homepage.divms.uiowa.edu/~luke/xls/xlsinfo/xlsinfo.html"&gt;LispStat&lt;/a&gt; at some point. That being said, I will rather be talking about Emacs and Stata in this post.&lt;/p&gt;
&lt;p&gt;Usually I edit my do files in Emacs because the Stata built-in editor is just so weird and useless that only the auto-correction mode of TextEdit makes the latter even worse for editing do/ado files. The best thing I&amp;rsquo;ve seen in a while is &lt;a href="https://aliquote.org/post/atom-stata/"&gt;Atom and the Hydrogen package&lt;/a&gt;, that allows to use Jupyter kernels in the background. Here is what is possible using Emacs instead of Atom.&lt;/p&gt;
&lt;p&gt;Of course, Emacs works very well with Stata files. You have two options there for Stata files: &lt;a href="https://ess.r-project.org"&gt;ESS&lt;/a&gt; or the &lt;a href="https://github.com/louabill/ado-mode"&gt;ado-mode&lt;/a&gt; package, written by Bill Rising. With ESS, all you have to do is to specify the program you want to use, in case you have different versions of Stata installed on your OS, or simply to be sure that everything is working when weaving Stata block in Org Babel. The variable to customize is &lt;code&gt;inferior-STA-program-name&lt;/code&gt; (formerly &lt;code&gt;inferior-STA-program&lt;/code&gt;), and you can pass additional parameters to the main program with &lt;code&gt;inferior-STA-start-args&lt;/code&gt;. A typical example would be to add the flag &lt;code&gt;-q&lt;/code&gt; to suppress the initialization messages. (The same flag is available for R, and I use this alias in Fish: &lt;code&gt;alias R 'R -q --no-save --no-restore&lt;/code&gt;.)&lt;/p&gt;
&lt;p&gt;In my experience, the Stata module in ESS is not as advanced as its R counterpart. It lacks syntax highlighting (&amp;ldquo;font-locking&amp;rdquo;) for a lot of built-in commands, for instance. This is easily fixed using Bill Rising&amp;rsquo;s &lt;code&gt;ado-mode&lt;/code&gt;, which is greater for highlighting Stata, whether command are written in full or abbreviated. The &lt;a href="https://github.com/louabill/ado-mode/blob/master/lisp/ado-font-lock.el"&gt;ado-font-lock.el&lt;/a&gt; is just under 10,000 LOC but it is worth a look if you want to know how many commands &amp;mdash; and their 1 to 5 abbreviations &amp;mdash; are available in Stata. However, this package is intended to be used as a frontend to a running GUI version of Stata in the background. So, you are not sending commands to an Emacs buffer with a live REPL, rather you&amp;rsquo;re automagically executing do files in your Stata program. That may be convenient or not, depending on how you like to interact with Stata. Personally, I don&amp;rsquo;t really need the GUI version of Stata (except when I was showcasing to students or when I need to display data into a spreadsheet-like browser that others understand), and this is why I prefer ESS in general. The same applies for R or Python.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://jupyter.org"&gt;Jupyter&lt;/a&gt; is another piece of artwork, IMHO. However, I only use it in a Terminal as I don&amp;rsquo;t really like the HTML notebook experience. There are a lot of kernels available to download or install from Python directly. Here is what I have on my machine: (Some kernels are probably outdated as this was for testing purpose only.)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ jupyter kernelspec list
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Available kernels:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; clojure /Users/chl/Library/Jupyter/kernels/clojure
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; coffeescript /Users/chl/Library/Jupyter/kernels/coffeescript
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ir /Users/chl/Library/Jupyter/kernels/ir
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; racket /Users/chl/Library/Jupyter/kernels/racket
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; stata /Users/chl/Library/Jupyter/kernels/stata
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; jupyter-swift-kernel-master /usr/local/share/jupyter/kernels/jupyter-swift-kernel-master
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; python2 /usr/local/share/jupyter/kernels/python2
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; python3 /usr/local/share/jupyter/kernels/python3
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That being said, the usual thing to do is to run Jupyter in your preferred terminal, like we did for years with IPython (which still works fine by the way), using, e.g., &lt;code&gt;jupyter console&lt;/code&gt; (which is equivalent to &lt;code&gt;jupyter-console)&lt;/code&gt; or &lt;code&gt;jupyter qtconsole&lt;/code&gt; if you want a more capable console, which allows among other things to display graphics inside the terminal. You can specify a different kernel using &lt;code&gt;jupyter console --kernel stata&lt;/code&gt; (or &lt;code&gt;--kernel ir&lt;/code&gt; for &lt;a href="https://irkernel.github.io/running/"&gt;R&lt;/a&gt;), provided you installed the &lt;a href="https://kylebarron.dev/stata_kernel/"&gt;Stata kernel&lt;/a&gt;. Here is a little illustration when a Qt console is launched as &lt;code&gt;jupyter qtconsole --kernel stata --no-banner&lt;/code&gt;:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2020-04-01-10-06-49.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Autocompletion is available for some optional command arguments, which is pretty nice, as shown on the left in the above screenshots. There are also some &lt;a href="https://kylebarron.dev/stata_kernel/using_stata_kernel/magics/"&gt;&amp;ldquo;magic&amp;rdquo; commands&lt;/a&gt; (e.g., &lt;code&gt;%help&lt;/code&gt; or &lt;code&gt;%locals&lt;/code&gt;), but not everything is actually working in the QT console. Of note, you will need Stata 14+ to display graphics in the QT console as there&amp;rsquo;s no PNG or SVG backend in earlier versions of Stata.&lt;/p&gt;
&lt;p&gt;Regarding Jupyter in standard console mode, you don&amp;rsquo;t really need a colorized prompt, so let&amp;rsquo;s go for a &lt;a href="https://github.com/jupyter/jupyter_console/issues/156"&gt;simple prompt&lt;/a&gt;.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; In the end, our incanting command should look like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ jupyter console --simple-prompt --kernel stata
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To use Jupyter as a backend in ESS, you just need to customize the variables mentioned above, either in your init file or directly in an iELM buffer:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-emacs-lisp" data-lang="emacs-lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;ELISP&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;setq&lt;/span&gt; &lt;span class="nv"&gt;inferior-STA-start-args&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;--simple-prompt --kernel=stata&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;&amp;#34;--simple-prompt --kernel=stata&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;ELISP&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;setq&lt;/span&gt; &lt;span class="nv"&gt;inferior-STA-program-name&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;/usr/local/bin/jupyter-console&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;&amp;#34;/usr/local/bin/jupyter-console&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And that&amp;rsquo;s almost all you have to do! Now, when you &lt;code&gt;C-c C-c&lt;/code&gt; on a line or block of lines, this will be sent as usual to the REPL attached to your session, except that it will be a Jupyter kernel:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2020-03-31-19-49-22.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Finally, I should note that there&amp;rsquo;s also a &lt;a href="https://github.com/dzop/emacs-jupyter"&gt;Jupyter mode&lt;/a&gt; for Emacs (and &lt;a href="https://github.com/tmurph/jupyter-mode"&gt;another one&lt;/a&gt;) that can be used as a replacement for the above two approaches. The idea is just to connect to a Jupyter server using a specific kernel, and then send whatever command you want to this running instance of Jupyter. Again, in my experience, it works (more or less) but I found it easier to rely on ESS alone.&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;For IPython, it is easy to customize the whole stuff; in particular, in &lt;code&gt;~/.ipython/profile_default/ipython_config.py&lt;/code&gt;, you can change the default values for &lt;code&gt;Token.Prompt&lt;/code&gt;, &lt;code&gt;Token.PromptNum&lt;/code&gt;, &lt;code&gt;Token.OutPrompt&lt;/code&gt; and &lt;code&gt;Token.OutPromptNum&lt;/code&gt;, as well as some other settings.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in March</title><link>https://aliquote.org/post/micro-03-2020/</link><pubDate>Sun, 29 Mar 2020 09:20:24 +0200</pubDate><guid>https://aliquote.org/post/micro-03-2020/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-03-02&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Clojure is (slowly) eating the world. Honestly, we should be thankful that the language continues to grow despite being fairly unorthodox, compared with the current norm of typed functional languages and the massive sea of object-oriented code that’s out there. It’s also the odd child in the Lisp family with its functional, data-driven, and interop-heavy approach to programming. &amp;mdash; &lt;a href="https://simongray.github.io/essays/spread.html"&gt;Clojure: the Lisp that wants to spread&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-03-02&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Complexity often does introduce qualitative differences. Although it sounds implausible, it might turn out that above a certain level of complexity, a machine ceased to be predictable, even in principle, and started doing things on its own account, or, to use a very revealing phrase, it might begin to have a mind of its own. &amp;mdash; &lt;a href="http://users.ox.ac.uk/~jrlucas/Godel/mmg.html"&gt;Minds, Machines and Gödel&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-03-02&lt;/a&gt;: A &lt;a href="https://peterwang512.github.io/CNNDetection/"&gt;recent study&lt;/a&gt; suggest that &amp;ldquo;today&amp;rsquo;s CNN-generated images retain detectable fingerprints that distinguish them from real photos.&amp;rdquo; This is good news if you are concerned with deep fakes, but how will it last?&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-02&lt;/a&gt;: Still useful to check whether your email credentials have been compromised: &lt;a href="https://haveibeenpwned.com"&gt;&amp;rsquo;;&amp;ndash;have i been pwned?&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-02&lt;/a&gt;: &lt;a href="https://banga.github.io/blog/2020/03/02/little-known-features-of-iterm2.html"&gt;Little known features of iTerm2&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-02&lt;/a&gt;: &lt;a href="http://freerangestats.info/blog/2020/03/01/bmi-2"&gt;Log transform or log link?&lt;/a&gt;, or how to move from modeling $\mathbb{E}(\log(y)) = \boldsymbol{X}b$ in favor of $\log(\mathbb{E}(y)) = \boldsymbol{X}b$ using a GLM. A refreshing take on a topic that often gets the non-statistician reader confused.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-02&lt;/a&gt;: &lt;a href="https://github.com/ctgk/PRML"&gt;PRML algorithms implemented in Python&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-02&lt;/a&gt;: &lt;a href="https://github.com/fastai/fastbook"&gt;The fastai book&lt;/a&gt;. Free on-line edition of the upcoming book by Jeremy Howard and Sylvain Gugger.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-02&lt;/a&gt;: &lt;a href="https://www.monicaalexander.com/posts/2020-28-02-bayes_viz/"&gt;Visualizing the Bayesian workflow in R&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-03&lt;/a&gt;: &amp;gt; Effective visual systems can help eliminate that guesswork and uncertainty by creating layered sets of cues in the design and interface. &amp;mdash; &lt;a href="https://alistapart.com/article/cross-cultural-design/"&gt;Cross-Cultural Design&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-03&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The best time to make a breaking change that involves updating existing code is now, because the bad designs that result from maintaining backwards compat unnecessarily can have repercussions for decades, and the amount of code to update is only going to get larger. &amp;mdash; &lt;a href="https://ericlippert.com/2020/02/27/hundred-year-mistakes/"&gt;Hundred year mistakes&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-03-03&lt;/a&gt;: Nice post on &lt;a href="https://inconvergent.net/2020/asemic-writing/"&gt;Asemic Writing&lt;/a&gt;, by Anders Hoff.&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-03-03-10-24-27.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-03&lt;/a&gt;: The upgrade process for Doom Emacs got improved recently and boosted performance are much appreciated. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-03&lt;/a&gt;: What beautiful pictures! (via &lt;a href="https://kottke.org/20/02/simply-stunning-aerial-photos-of-oceans-and-beaches"&gt;kottke.org&lt;/a&gt;)&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-03-03-12-32-14.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-03&lt;/a&gt;: &lt;a href="https://martinheinz.dev/blog/17"&gt;Automating Every Aspect of Your Python Project&lt;/a&gt;, using Docker. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-03&lt;/a&gt;: &lt;a href="https://jeffhuang.com/best_paper_awards/"&gt;Best Paper Awards in Computer Science&lt;/a&gt; (since 1996).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-03&lt;/a&gt;: &lt;a href="https://www.travishinkelman.com/posts/reading-and-writing-json-files-in-r-and-chez-scheme/"&gt;Reading and writing JSON files in R and Chez Scheme&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-03&lt;/a&gt;: &lt;a href="https://www.reconlearn.org"&gt;Recon Learn&lt;/a&gt;: Free and open training resources to respond to outbreaks, health emergencies and humanitarian crises. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-03&lt;/a&gt;: &lt;a href="https://danluu.com/cli-complexity/"&gt;The growth of command line options&lt;/a&gt;. Well, that&amp;rsquo;s just 139 options for &lt;code&gt;tar&lt;/code&gt;!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-04&lt;/a&gt;: Nice &lt;a href="https://cultivating-algos.stitchfix.com/"&gt;post&lt;/a&gt; and beautiful interactive design at Stitch Fix!&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-03-04-13-27-20.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-04&lt;/a&gt;: &lt;a href="http://mbork.pl/2020-03-02_PostgreSQL_on_Docker"&gt;Postgresql on Docker&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-05&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Conjugate models have the structure of a fold in functional programming, also known as a reduce or accumulate operation. We’ll show below how to compute the posterior distribution in a beta-binomial and normal-normal model using folds in Haskell. &amp;mdash; &lt;a href="https://www.johndcook.com/blog/2016/06/01/functional-folds-and-conjugate-models/"&gt;Functional folds and conjugate models&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-03-05&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Randomized clinical trials do not require representative patients; they require representative treatment effects. Generalizability of randomized trial findings for relative efficacy comes from one of three things: (1) true absence of interactions, (2) interacting factors have a similar distribution in the RCT as in the target population, or (3) the RCT sample has enough representation of the distribution of interacting factors to allow them to be modeled and used to estimate treatment effects in target patients, and the researcher knows to include these interactions in her model. &amp;mdash; &lt;a href="https://www.fharrell.com/post/ia/"&gt;Implications of Interactions in Treatment Comparisons&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-03-05&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;So get yourself some Ethernet cable (and adapter, if needed) and connect your computer directly to your home or office router. This is the single most effective thing you can do to improve your remote experience, especially if you’re in an apartment complex or office. &amp;mdash; &lt;a href="https://stuartsierra.com/2020/03/03/remote-101-cables"&gt;Remote 101: Cables&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And if you&amp;rsquo;re a Mac user with a post 2012 Macbook (any model), go buy yet another dongle to plug your ethernet cable!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-05&lt;/a&gt;: Nice series of posts by geekAbyte on &lt;a href="http://feedproxy.google.com/~r/Geekabyte/~3/NWDkGMaWBSg/learning-rust-day-10-smart-pointers.html"&gt;learning Rust&lt;/a&gt;. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-05&lt;/a&gt;: &lt;a href="http://www.stat.cmu.edu/~cshalizi/ADAfaEPoV/"&gt;Advanced Data Analysis from an Elementary Point of View&lt;/a&gt;, by Cosma Rohilla Shalizi.&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-03-05-15-37-29.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-05&lt;/a&gt;: &lt;a href="https://fraidyc.at/"&gt;Fraidycat&lt;/a&gt;: Follow from afar. (via &lt;a href="https://www.robinsloan.com/notes/master-tapes/"&gt;Robin&amp;rsquo;s blog&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-05&lt;/a&gt;: &lt;a href="https://tech.tonyballantyne.com/pedagogy/be-a-better-coder/recursion-explained-using-sandwiches/"&gt;Recursion Explained Using Sandwiches&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-06&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/solo/1011585685" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Fred Hersch, &lt;em&gt;Solo&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-06&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Everything I’ve done with computers in my life has been along pretty much a single vector. And NeXT is just one more point on that same vector. In this case what we observed was that the computing power we could give to an individual was an order of magnitude more than the PCs were giving. In the sense that people want to do many things at once and you really need true multitasking. &amp;mdash; &lt;a href="http://morrick.me/archives/8816"&gt;The Machine That Changed The World&lt;/a&gt;, transcription by Riccardo Mori&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-03-09&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Emacs is amazing. It’s a very different sort of thing than a code text editor like Vim or an IDE like VSCode. It’s a different way of thinking of how to interact with a computer, where you build up techniques on top of simple tricks that let you get amazing things done. &amp;mdash; &lt;a href="https://willschenk.com/articles/2020/tramp_tricks/"&gt;Emacs Tramp tricks&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-03-09&lt;/a&gt;: &lt;a href="https://alex-hhh.github.io/2020/03/a-game-of-tetris.html"&gt;A Game of Tetris&lt;/a&gt;. &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-09&lt;/a&gt;: &lt;a href="http://blog.binchen.org/posts/how-to-speed-up-lsp-mode.html"&gt;How to speed up lsp-mode&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-09&lt;/a&gt;: &lt;a href="https://www.omnisci.com/blog/plotly-dash-and-omniscidb-for-real-time-data-visualization"&gt;Plotly Dash and OmniSciDB for Real-Time Data Visualization&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-09&lt;/a&gt;: &lt;a href="https://vincebuffalo.com/blog/2020/03/04/understanding-snakemake.html"&gt;Snakemake&lt;/a&gt;&amp;rsquo;s explicit intention is to automate command line data processing tasks, such as those common in bioinformatics.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-09&lt;/a&gt;: &lt;a href="https://jcarroll.com.au/2020/03/09/iseven-without-modulo/"&gt;isEven without modulo&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-10&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   John Cale, &lt;em&gt;Fragments of a Rainy Season&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-10&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/in-movement/109640753" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Jack DeJohnette Ravi Coltrane &amp;amp; Matt Garrison, &lt;em&gt;In Movement&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-10&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I have two high-quality CL implementations on my machine and one Scheme-derived system, also of very high quality, which created this blog: I have long ago stopped counting the number of good-quality free implementations. (&amp;hellip;) Performance is a solved problem: yes, highly-optimised code is, perhaps, slower than optimised C or Fortran but since almost all performance problems are design problems no-one older than about 19 cares any more. (&amp;hellip;) The library problem has been solved by Quicklisp and a large number of good-quality standard libraries. I am still using code I wrote over twenty-five years ago with essentially no modification: meanwhile the Python code I wrote ten years ago is long rendered obsolete by gratuitous changes in the language (the Perl code I wrote at the same time is doing fine, however). &amp;mdash; &lt;a href="https://www.tfeb.org/fragments/2015/02/01/rumours-of-my-death/"&gt;Rumours of my death&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-03-10&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The heart and soul of mathematics consists of the fact that the “same” objects can be presented to us in different ways. &amp;mdash; &lt;a href="https://www.craigstuntz.com/posts/2020-03-09-equality-is-hard.html"&gt;Equality Is Hard&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-03-10&lt;/a&gt;: Never heard of the &lt;a href="https://www.tfeb.org/fragments/2020/03/09/the-u-combinator"&gt;U combinator&lt;/a&gt;, which &amp;ldquo;allows you to define recursive functions and I think it is simpler to understand than the Y combinator.&amp;rdquo; &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-10&lt;/a&gt;: &lt;a href="https://lemire.me/blog/2020/03/10/fast-float-parsing-in-practice/"&gt;Fast float parsing in practice&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-10&lt;/a&gt;: &lt;a href="https://www.greghendershott.com/fear-of-macros/all.html"&gt;Fear of Macros&lt;/a&gt;, by Greg Hendershott. &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-10&lt;/a&gt;: &lt;a href="https://dataorigami.net/blogs/napkin-folding/l1-penalty-in-cox-regression"&gt;L1 Penalty in Cox Regression&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-10&lt;/a&gt;: &lt;a href="https://www.xkcd.com/936/"&gt;xkcd 936&lt;/a&gt;, with Python &lt;a href="https://github.com/tfeb/xkcd-936"&gt;implementation&lt;/a&gt; (by Tim Bradshaw).&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Through 20 years of effort, we&amp;rsquo;ve successfully trained everyone to use passwords that are hard for humans to remember, but easy for computers to guess.&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-03-10-12-35-33.png" alt=""&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-03-11&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/at-the-deer-head-inn/155981436" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Gary Peacock, Keith Jarrett &amp;amp; Paul Motian, &lt;em&gt;At the Deer Head Inn&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-11&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Storage has changed a lot over time, from paper tape, to metal tape, magnetic tape, rope memory, spinning disks, optical disks, flash, and others. Progress has led to faster, smaller, and more performant devices for storing data. &amp;mdash; &lt;a href="https://blog.jessfraz.com/post/the-life-of-a-data-byte/"&gt;The life of a data byte&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-03-11&lt;/a&gt;: Happy to see there&amp;rsquo;s still some nice Stata use cases: &lt;a href="https://github.com/worldbank/stata/tree/master/docs"&gt;World Bank Stata GitHub&lt;/a&gt;. &lt;code&gt;#stata&lt;/code&gt;&lt;br&gt;&lt;img src="https://aliquote.org/img/687474703a2f2f7777772e62656e6a616d696e6264616e69656c732e636f6d2f696d672f6265747465726261722e706e67.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-11&lt;/a&gt;: In case you wonder, COVID-19 data are already available in Mathematica (so no need to rush to &lt;a href="https://github.com/CSSEGISandData/COVID-19"&gt;Github&lt;/a&gt;).&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-03-11-14-23-24.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-11&lt;/a&gt;: Self-hosted, super simple &lt;a href="https://github.com/maxvoltar/photo-stream"&gt;photo stream&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-11&lt;/a&gt;: The more I read and see it &lt;a href="https://simonwillison.net/2020/Mar/11/covid-19/"&gt;in action&lt;/a&gt;, the more I like &lt;a href="https://github.com/simonw/datasette"&gt;Datasette&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-11&lt;/a&gt;: Why You Cannot (Yet) Write an &amp;ldquo;Interval Arithmetic&amp;rdquo; Library in Common Lisp, on &lt;a href="https://arxiv.org/abs/2003.03831"&gt;arXiv&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-11&lt;/a&gt;: &lt;a href="http://notes.eatonphil.com/database-basics.html"&gt;Database basics: writing a SQL database from scratch in Go&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-12&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;So that brings us to three potential criteria for choosing inputs and pursuits in life. (1) High in quality. (2) Takes time to create and/or consume. (3) The benefits are spread over time rather than all at once. &amp;mdash; &lt;a href="https://danielmiessler.com/blog/the-problem-with-extracted-versions-of-things/"&gt;The Problem With Extracted Versions of Things&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-03-12&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The answer is to not even try: instead of trying to put everything inside of a castle, put everything in the castle outside the moat, and assume that everyone is a threat. Thus the name: zero-trust networking. &amp;mdash; &lt;a href="https://stratechery.com/2020/zero-trust-information/"&gt;Zero Trust Information&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-03-12&lt;/a&gt;: &lt;a href="https://mjtsai.com/blog/2020/03/11/awesome-macos-command-line/"&gt;Awesome macOS Command Line&lt;/a&gt;, via Michael Tsai. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-12&lt;/a&gt;: &lt;a href="https://worldbank.github.io/Stata-IE-Visual-Library/"&gt;Stata Visual Library&lt;/a&gt;. &lt;code&gt;#stata&lt;/code&gt;&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-03-12-14-32-12.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-13&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Cyberpunk is both a genre and a culture. As a genre, cyberpunk was born out of early 20th century noir and fuelled through the drugs, sex and tech of 60s and 70s counterculture movements. As a culture, Cyberpunk represents a tech-savvy identity associated with anti-authoritarianism and anti-consumerism. &amp;mdash; &lt;a href="https://thedorkweb.substack.com/p/tales-from-the-dork-web-4"&gt;Tales From The Dork Web #4&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-03-13&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Zettelkasten is German for “slip box” and is a method to manage knowledge. Basically, you take ideas from books, articles or conversations and write those ideas on note cards, collect them in a central database, and link them together so that you can start to find larger relationships between concepts you’re learning. &amp;mdash; &lt;a href="https://superorganizers.substack.com/p/how-to-build-a-learning-machine"&gt;How to Make Yourself Into a Learning Machine&lt;/a&gt;, via &lt;a href="https://irreal.org/blog/?p=8722"&gt;Irreal&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;His (Vim-based) system for taking notes remind me of &lt;a href="https://blog.jethro.dev/posts/introducing_org_roam/"&gt;Roam&lt;/a&gt;, which I haven&amp;rsquo;t tested yet.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-13&lt;/a&gt;: &lt;a href="https://defn.io/2020/03/12/ann-rackcheck/"&gt;Announcing rackcheck&lt;/a&gt;. &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-13&lt;/a&gt;: &lt;a href="https://jlelse.blog/dev/muffet/"&gt;Find broken links on your website with muffet&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-17&lt;/a&gt;: So, first day of confinment here in France. Listening to Satie while reading from time to time, otherwise just working on a Django web project. Let&amp;rsquo;s hope the internet connection will stay up and working for the next few weeks.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-17&lt;/a&gt;: &lt;a href="https://github.com/hugolgst/digart"&gt;Circle visualization of a number&amp;rsquo;s digits in Go&lt;/a&gt;.&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-03-17-11-35-31.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-17&lt;/a&gt;: &lt;a href="https://www.cs.cornell.edu/home/kleinber/networks-book/"&gt;Networks, Crowds, and Markets: Reasoning About a Highly Connected World&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-17&lt;/a&gt;: &lt;a href="https://devops.novalagung.com/en/cicd-serverless-ebook-gitbook-github-pages-actions-calibre.html"&gt;Serverless Ebook using Gitbook CLI, Github Pages, Github Actions, and Calibre&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-19&lt;/a&gt;: #rstats users, remember this? &lt;a href="https://stackoverflow.com/q/1189759"&gt;What&amp;rsquo;s in your .Rprofile?&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-19&lt;/a&gt;: A set of over &lt;a href="https://github.com/tabler/tabler-icons"&gt;300 free MIT-licensed high-quality SVG icons&lt;/a&gt; for you to use in your web projects.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-19&lt;/a&gt;: Didn&amp;rsquo;t know that WolframScript could be run with a &lt;a href="https://www.wolfram.com/wolframscript/"&gt;remote Math kernel&lt;/a&gt;. Nice!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-19&lt;/a&gt;: From &lt;a href="https://www.bbc.com/news/technology-51968302"&gt;HN&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Netflix will reduce the video quality on its service in Europe for the next 30 days, to reduce the strain on internet service providers.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I have a hard time believing this could happen &amp;mdash; I&amp;rsquo;m no Netflix consumer, btw, since all other French provider are actually offering their channel package for free. But I can understand the consequences of everyone connecting to internet all day along.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-19&lt;/a&gt;: Hardly working @home, for the moment. Just reading and checking emails, occasionally. I have lot of ideas for the blog, I know I need to do some biostats again &amp;ndash; it looks to me like it&amp;rsquo;s just a matter of time until I launch a Twitch channel about &lt;em&gt;applied biostats from the command-line&lt;/em&gt; if confinment persists. Yet, I could also keep reading litterature artwork as usual.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-19&lt;/a&gt;: If you keep browsing your Twitter feeds these days, life should be like more or less depressing, right? Stay home and cook; sometimes, you may even enjoy the sun!
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0933.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0933.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0927.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0927.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0937.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0937.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-19&lt;/a&gt;: &lt;a href="https://mosermichael.github.io/jq-illustrated/dir/content.html"&gt;Illustrated jq tutorial&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-20&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Cory Doctorow has an interesting article that argues that far from being the new oil, data is actually the new toxic waste. He begins by noting that any data you collect will, sooner or later, leak and that when it does criminals will combine it with other leaked data to undo any anonymization that you’ve applied. That data is, he says, &amp;ldquo;pluripotent, immortal – and impossible to contain.&amp;rdquo; &amp;mdash; &lt;a href="https://irreal.org/blog/?p=8741"&gt;Data is toxic waste&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-03-20&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I use fancy tools, and I certainly do use tools that are called debuggers (like gdb), but I almost never step through my programs line-by-line watching variable values. I almost never set breakpoints. &amp;mdash; &lt;a href="https://lemire.me/blog/2016/06/21/i-do-not-use-a-debugger/"&gt;I do not use a debugger&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-03-20&lt;/a&gt;: Nice read: &lt;a href="https://betanalpha.github.io/assets/case_studies/probability_on_product_spaces.html"&gt;Product Placement&lt;/a&gt;, by Michael Betancourt.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-20&lt;/a&gt;: TIL about &lt;a href="https://www.simuldocs.com/"&gt;simul&lt;/a&gt;, for those of you who need to collaborate using Word.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I&amp;rsquo;ve tried LaTex, because that&amp;rsquo;s what all the cool science kids are doing, but I don&amp;rsquo;t think the hassle is worth it. Show me a LaTex evangelist and I&amp;rsquo;ll show you someone who doesn&amp;rsquo;t collaborate with Word users. There&amp;rsquo;s too much software hipster-ism out there. I think you should use the software that best gets the job done for you. &amp;mdash; Daniel Quintena on &lt;a href="https://usesthis.com/interviews/daniel.quintana/"&gt;Uses This&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-03-20&lt;/a&gt;: With social distanciation and confinment, getting in touch on social networks is likely to increase, despite all the useless comments one can found on, e.g., Twitter these days. Likewise, everybody is looking for remote meeting apps, and they probably found out that remote OSS workers or gamers have been doing this for a while.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-20&lt;/a&gt;: &lt;a href="https://kieranhealy.org/blog/archives/2020/03/14/animating-us-population-distributions/"&gt;Animating US population distributions&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-20&lt;/a&gt;: &lt;a href="https://ms.mcmaster.ca/~bolker/misc/peak_I_simple.html"&gt;Flattening vs shrinking: the math of #FlattenTheCurve&lt;/a&gt;, by Ben Bolker and Jonathan Dushoff.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-20&lt;/a&gt;: &lt;a href="https://kottke.org/20/03/visualizing-the-history-of-pandemics"&gt;This makes it clear&lt;/a&gt; that plague was progressively replaced with HIV/AIDS and flu-like syndromes.&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-03-20-17-26-48.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-21&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/bach-goldberg-variations-bwv-988-the-1955-1981-recordings/594521223" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Glenn Gould, &lt;em&gt;Bach: Goldberg Variations, BWV 988&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-21&lt;/a&gt;: And now we are halfway thru &lt;a href="https://en.wikipedia.org/wiki/The_100_(TV_series)"&gt;The 100&lt;/a&gt;, Season 6. Mostly delayed because, you know, Apple TV, but it&amp;rsquo;s right on the point and far less depressing than the news we are served every day after all. Next in the radar: The rest of &lt;a href="https://en.wikipedia.org/wiki/The_Blacklist_(TV_series)"&gt;Black List&lt;/a&gt; (starting from Season 5), and &lt;a href="https://en.wikipedia.org/wiki/The_Expanse_(TV_series)"&gt;The Expanse&lt;/a&gt;, Season 3 probably.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-21&lt;/a&gt;: &lt;a href="https://anssi-fr.github.io/rust-guide/"&gt;Secure Rust guidelines&lt;/a&gt;. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-21&lt;/a&gt;: &lt;a href="https://www.edgeimpulse.com/blog/dsp-key-embedded-ml"&gt;Signal processing is key to embedded Machine Learning&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-22&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/creep-on-creepin-on/424617483" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Timber Timbre, Creep On Creepin&amp;rsquo; On.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-22&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;By combining a couple of Unix command line into a pipeline you can quickly obtain answers to questions that crop up in software development, production engineering (or site reliability engineering or IT operations depending on where you work), and business analytics. In most cases such answers aren&amp;rsquo;t directly available from existing applications and other methods for obtaining them would require you to write a dedicated program or script. &amp;mdash; &lt;a href="https://www.spinellis.gr/blog/20200316/"&gt;Seven reasons to add Unix command line expertise to your tool chest&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-03-22&lt;/a&gt;: A &lt;a href="https://beepb00p.xyz/hpi.html"&gt;Human Programming Interface&lt;/a&gt;, in Python, to help track your data.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-22&lt;/a&gt;: An interesting series of new blog posts by Arthur Charpentier on &lt;a href="https://freakonometrics.hypotheses.org/60482"&gt;modeling pandemics&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-22&lt;/a&gt;: Github, you&amp;rsquo;re safe with that number of snapshots!&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-03-22-20-41-34.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-22&lt;/a&gt;: Why &lt;a href="https://discordapp.com"&gt;Discord&lt;/a&gt;? Because Slack sucks at some point, you know, and there we go:&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2022-11-08]&lt;/small&gt;&lt;br&gt;
Unfortunately, the tweet with ID 1241398181205889024 is no longer available.
&lt;/div&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-03-22&lt;/a&gt;: &lt;a href="http://www.lispology.com/show?314T"&gt;An erratic two-dimensional recursive function Q2&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-22&lt;/a&gt;: &lt;a href="https://leancrew.com/all-this/2020/03/exponential-growth-and-log-scales/"&gt;Exponential growth and log scales&lt;/a&gt;, or why it sometimes makes more sense to use a log(2) scale instead of log(10). See also Kieran Healy &lt;a href="https://kieranhealy.org/blog/archives/2020/03/21/covid-19-tracking/"&gt;recent post&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-22&lt;/a&gt;: &lt;a href="https://www.johndcook.com/blog/2020/03/18/gnu-mpfrr-wrapper/"&gt;Extended floating point precision in R and C&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt; &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-22&lt;/a&gt;: &lt;a href="https://robjhyndman.com/hyndsight/forecasting-covid19/"&gt;What makes forecasting hard?&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Fitting simple models to the available [COVID-19] data is pointless, misleading and dangerous.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-03-23&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Rust has also mostly replaced Go as my go-to language for writing small performance-sensitive programs, like the numerical simulators I use a lot. Go replaced C in that role for me, and joined R and Python as my day-to-day go-to tools. I&amp;rsquo;ve found that I still spend more time writing a Rust program than I do Go, and more than C (except where C is held back by a lack of sane data structures and string handling). I&amp;rsquo;ve also found that programs seem more likely to work on their first run, but haven&amp;rsquo;t made any effort to quantify that. &amp;mdash; &lt;a href="http://brooker.co.za/blog/2020/03/22/rust.html"&gt;Two Years With Rust&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-03-23&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The thing about blogging is, you can just write about the things you love. A &amp;ldquo;professional&amp;rdquo; &amp;ldquo;critic&amp;rdquo; (scare quotes because who even knows what words mean anymore) has to do something else, something more difficult: manage a kind of unfolding&amp;hellip; aesthetic&amp;hellip; worldview? Balance one thing against the other? A blogger suffers no such burden. &amp;mdash; &lt;a href="https://www.robinsloan.com/notes/things-you-love/"&gt;The thing about blogging is&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-03-23&lt;/a&gt;: About to finish the 6th of &lt;em&gt;The 100&lt;/em&gt;&amp;hellip; Given the obvious lack of motivation for routine work, I think the best option for the next few days is to write some Stata and Lisp code.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-23&lt;/a&gt;: &lt;a href="http://math.sfsu.edu/federico/Articles/methods.pdf"&gt;Algebraic and geometric methods in enumerative combinatorics&lt;/a&gt; (PDF, 144 pp.), by Federico Ardila.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-23&lt;/a&gt;: &lt;a href="https://system76.com/laptops"&gt;Nice specs&lt;/a&gt; for System76 laptops.&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-03-23-20-51-12.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-23&lt;/a&gt;: &lt;a href="https://www.spinellis.gr/blog/20200323/"&gt;Shell scripting for personal productivity&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-23&lt;/a&gt;: &lt;a href="http://ultrasparky.org/school/pdf/DanielRhatigan_Dissertation.pdf"&gt;Three typefaces for mathematics&lt;/a&gt; (PDF, 78 pp.). &lt;code&gt;#tex&lt;/code&gt;&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-03-23-16-58-02.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-24&lt;/a&gt;: &lt;a href="https://begriffs.com/posts/2020-03-23-concurrent-programming.html"&gt;Concurrent programming, with examples&lt;/a&gt;. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-24&lt;/a&gt;: &lt;a href="http://web.stanford.edu/class/bios221/book/"&gt;Modern Statistics for Modern Biology&lt;/a&gt;, by Susan Holmes &amp;amp; Wolfgang Huber. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-25&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Another big benefit of RSS is that you curate your own feeds. You get to choose what you subscribe to in your feed reader, and the order in which the posts show up. You might prefer to read the oldest posts first, or the newest. You might group your feeds by topic or another priority. You are not subjected to the “algorithmic feed” of Facebook, Twitter, Instagram, YouTube, where they choose the order for you. You won’t miss your friends’ posts because the algorithm decided to suppress them, and you are not forced to endure ads disguised as content (unless a feed you subscribe to includes ads inside their posts). &amp;mdash; &lt;a href="https://laurakalbag.com/how-to-read-rss-in-2020/"&gt;How to read RSS in 2020&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-03-25&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;De même, j’entends des histoires interminables pour la visioconférence surchargée, alors qu’en gros en général on a juste besoin d’une audioconférence (c’est sympa de voir les binettes des collègues, mais non nécessaire), plus des envois de documents. &amp;mdash; &lt;a href="http://david.monniaux.free.fr/dotclear/index.php/post/2020/03/21/Du-mauvais-usage-des-outils-num%C3%A9riques-et-des-fonctionnalit%C3%A9s-inutiles"&gt;Du mauvais usage des outils numériques et des fonctionnalités inutiles&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-03-25&lt;/a&gt;: The GNU Emacs Lisp Reference Manual in &lt;a href="https://gitlab.com/emacs-manuals/refer-el"&gt;ePub format&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-25&lt;/a&gt;: &lt;a href="https://www.slideas.app/"&gt;Slideas&lt;/a&gt; is the easiest way to create a beautiful Markdown Presentation, with all the features you need. (via &lt;a href="https://tracking.feedpress.it/link/535/13385711"&gt;Brett Terpstra&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-25&lt;/a&gt;: &lt;a href="http://morrick.me/archives/8840"&gt;Yes to everything&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;People think focus means saying yes to the thing you’ve got to focus on. But that’s not what it means at all. It means saying no to the hundred other good ideas that there are. You have to pick carefully. I’m actually as proud of the things we haven’t done as the things I have done. Innovation is saying ‘no’ to 1,000 things. &amp;mdash; Steve Jobs&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-03-26&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If dollar signs are good enough for Don Knuth, they are good enough for me! &amp;mdash; &lt;a href="https://github.com/higham/latex-tips"&gt;Nick Higham&lt;/a&gt;I too mostly uses &lt;code&gt;$$&lt;/code&gt; for display style, instead of the recommend &lt;code&gt;\[&lt;/code&gt; opening brackets. This may well be because I used to write plain $\TeX$ at some point, or Context for what matters, but it is also mostly a personal taste. &lt;code&gt;#tex&lt;/code&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-03-26&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Programming is essentially about certain &amp;lsquo;data structures&amp;rsquo; and functions between them. Algebra is essentially about certain &amp;lsquo;algebraic structures&amp;rsquo; and functions between them. Starting with such familiar algebraic structures as groups and rings algebraists have developed a wider notion of algebraic structure (or &amp;lsquo;algebra&amp;rsquo;) which includes these as examples and also includes many of the entities which in the computer context are thought of as data structures. &amp;mdash; &lt;a href="http://www.rutherfordjournal.org/article030107.html"&gt;The Structures of Computation and the Mathematical Structure of Nature&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-03-26&lt;/a&gt;: A &lt;a href="https://github.com/c2d7fa/untask"&gt;task manager&lt;/a&gt; for the command line. &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-26&lt;/a&gt;: &lt;a href="https://begriffs.com/posts/2020-03-23-concurrent-programming.html"&gt;Concurrent programming, with examples&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-26&lt;/a&gt;: &lt;a href="http://shape-of-code.coding-guidelines.com/2020/03/15/exercises-in-programming-style-the-python-way/"&gt;Exercises in Programming Style: the python way&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-26&lt;/a&gt;: &lt;a href="https://jwiegley.github.io/git-from-the-bottom-up/"&gt;Git from the bottom up&lt;/a&gt;, by John Wiegley.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-26&lt;/a&gt;: &lt;a href="https://arpitbhayani.me/blogs/function-overloading"&gt;Overload Functions in Python&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-26&lt;/a&gt;: &lt;a href="https://www.hillelwayne.com/post/influential-dead-languages/"&gt;&lt;code&gt;life←{↑1 ⍵∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵}&lt;/code&gt;&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-27&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Log only impure actions. (&amp;hellip;) You may still have some code that occasionally executes impure actions, but largely, most of the code is pure. If you know the inputs to all the pure code, you can reproduce that part of the code. This means that you only need to log the non-deterministic parts: the impure actions. Particularly, you need to log the outputs from the impure actions, because these impure output values become the inputs to the next pure block of code. &amp;mdash; &lt;a href="https://blog.ploeh.dk/2020/03/23/repeatable-execution/"&gt;Repeatable execution&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-03-27&lt;/a&gt;: A beautiful &lt;a href="https://music.apple.com/fr/album/avec-le-temps/1449153684?i=1449153691"&gt;piano cover&lt;/a&gt;.&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-03-27-20-27-50.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-27&lt;/a&gt;: Nice overview of GTD using Org-mode: &lt;a href="http://cachestocaches.com/2020/3/my-organized-life/"&gt;A guide to my organizational workflow&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-27&lt;/a&gt;: &lt;a href="http://eprints.maths.manchester.ac.uk/2754/"&gt;A Catalogue of Software for Matrix Functions&lt;/a&gt;, updated for Julia, Rust and many other third-party libraries. (via &lt;a href="https://nhigham.com/2020/03/27/update-of-catalogue-of-software-for-matrix-functions/"&gt;Nick Higham&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-27&lt;/a&gt;: &lt;a href="https://arxiv.org/abs/2003.11755"&gt;A Survey of Deep Learning for Scientific Discovery&lt;/a&gt;. &lt;code&gt;#arxiv&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-27&lt;/a&gt;: &lt;a href="https://github.com/xuchunyang/emacs-manuals"&gt;Emacs manuals with versions&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-27&lt;/a&gt;: &lt;a href="https://512pixels.net/projects/default-mac-wallpapers-in-5k/"&gt;Every Default macOS Wallpaper – in Glorious 5K Resolution&lt;/a&gt;, via Daring Fireball. This reminds me of the &lt;a href="https://aliquote.org/micro/2020-01-21-10-14-05/"&gt;combined wallpaper&lt;/a&gt; I referred to early this year. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-27&lt;/a&gt;: &lt;a href="https://toroid.org/unix-pipe-implementation"&gt;How are Unix pipes implemented?&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-27&lt;/a&gt;: &lt;a href="https://martinheinz.dev/blog/18"&gt;Recursive SQL Queries with PostgreSQL&lt;/a&gt;. &lt;code&gt;#database&lt;/code&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In general recursive queries come in handy when working with self-referential data or graph/tree-like data structures.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-03-27&lt;/a&gt;: &lt;a href="https://metaredux.com/posts/2020/03/27/the-books-that-every-programmer-should-read.html"&gt;The Books That Every Programmer Should Read&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I have to admit there are some (many) books on the list that I didn’t finish myself. If I had to narrow down the list to the 3 most important (impactful) books there those would be: Structure and Interpretation of Computer Programs, The Elements of Style, Code Complete, Thinking, Fast and Slow. &lt;br&gt;
Seems, I’ve made an off-by-one error, but you’ll forgive me.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-03-29&lt;/a&gt;: I now have plenty of time, why not reading &lt;a href="https://noamross.github.io/gams-in-r-course/"&gt;GAM in R&lt;/a&gt;, which I bookmarked so long ago? &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-29&lt;/a&gt;: Since many people have discovered a passion for epidemiology these days, and are in the process of becoming apprentice statisticians, this should keep them busy for the weekend: &lt;a href="https://www.bmj.com/about-bmj/resources-readers/publications/epidemiology-uninitiated/1-what-epidemiology"&gt;Epidemiology for the uninitiated.&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-03-29&lt;/a&gt;: &lt;a href="https://github.com/interpretml/interpret"&gt;Fit interpretable machine learning models. Explain blackbox machine learning.&lt;/a&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>ArXiving on March 2020</title><link>https://aliquote.org/post/arxiv-04/</link><pubDate>Sun, 29 Mar 2020 08:19:25 +0100</pubDate><guid>https://aliquote.org/post/arxiv-04/</guid><description>&lt;p&gt;Here are some papers that I read this week.&lt;/p&gt;
&lt;h3 id="the-book-of-why-the-new-science-of-cause-and-effect-arxiv200311635v1"&gt;The Book of Why: The New Science of Cause and Effect &lt;a href="https://arxiv.org/abs/2003.11635v1"&gt;arXiv:2003.11635v1&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;This is a fair review of the &lt;em&gt;Book of Why&lt;/em&gt; that I started reading a while back before forgetting about it because I&amp;rsquo;m no longer involved in causal analysis, and not curious enough to keep up with everything that&amp;rsquo;s going on around here. Anyway, graphical causal representation under the umbrella of direct acyclic graphs (DAGs) are supposed to be the new starting point for causal analysis. The reviewers remain, however, critical of the Judea Pearl&amp;rsquo;s optimism since his approach mostly relies on the assumption that the underlying causal structure is known.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;We believe this optimism is unfounded. The central problem that scientists face, especially in the social sciences, is not how to express or analyze causal models but how to pick one that is valid or at least reasonable. The book does not claim to solve this problem.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I would say that the same criticism applies to all regression models insofar as the (frequentist) interpretation value is valid (and meaningful) conditional on the fact that the model is correctly specified. Another criticism, this time, aimed at denigrating the usefulness of the experimental approach, like randomized clinical trials or experimental design at large. Finally, DAGs are not the only appraoch to causal modeling, according to this review, for several alternative causal models, like nonparametric structural equation models or design-based approaches, exist and may be able to answer the specifics of causal discovery.&lt;/p&gt;
&lt;h3 id="an-introduction-to-probabilistic-programming-arxiv180910756"&gt;An Introduction to Probabilistic Programming &lt;a href="https://arxiv.org/abs/1809.10756"&gt;arXiv:1809.10756&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;I&amp;rsquo;ve read several papers or arXiv reviews on probabilistic programming (PP) lately. I mentioned &lt;a href="https://aliquote.org/post/tech-review-october-2018/"&gt;this one&lt;/a&gt; already. Briefly, it provides an extensive review of the core ideas of PP, namely the importance of conditioning in probabilistic machine learing and the use of dynamic computation graphs. Interestingly, this uses the Clojure dialect as the main implementation. This should come as no surprise since some of the authors are actively involved in the &lt;a href="https://probprog.github.io/anglican/index.html"&gt;Anglican toolbox&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Related threads:&lt;/strong&gt; &lt;a href="https://colcarroll.github.io/ppl-api/"&gt;A tour of probabilistic programming language APIs&lt;/a&gt;, &lt;a href="https://aliquote.org/micro/2019-09-23-10-41-10/"&gt;Probabilistic programming with Monad-Bayes&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="a-survey-of-deep-learning-for-scientific-discovery-arxiv200311755v1"&gt;A Survey of Deep Learning for Scientific Discovery &lt;a href="https://arxiv.org/abs/2003.11755v1"&gt;arXiv:2003.11755v1&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;This review is structured along two ideas: to provide an overview of many widely used deep learning models, spanning visual (CNNs), sequential (RNNs) and graph structured data, associated tasks (image segmentation, super-resolution, sequence to sequence mappings and many others) and different training methods, and to highlight techniques that use deep learning (DL) with less data (e.g., self-supervision or semi-supervised learning) and better interpret these complex models. In my own view, DL is a useful technique when some kind of regularities can be exploited in the data &amp;mdash; including bias if any, and when the training size is large. This generally holds in the case of pattern recognition tasks like NLP or image processing, but I remain sceptical about the application of this type of model in tasks for which more traditional supervised methods (e.g., logistic regression) would be just as suitable. There are also lot of links regarding tutorials and software, that are not necessarily limited to DL.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2020-03-29-09-00-19.png"&gt;
&lt;/figure&gt;
&lt;h3 id="reinforcement-learning-in-economics-and-finance-arxiv200310014v1"&gt;Reinforcement Learning in Economics and Finance &lt;a href="https://arxiv.org/abs/2003.10014"&gt;arXiv:2003.10014v1&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;I have no competency in finance, and I barely have notions in economics, but I always enjoy reading one of Arthur Charpentier&amp;rsquo;s review, for they are always very picky and highly anchored in historical considerations. The last one I read was about &lt;a href="https://arxiv.org/abs/1708.06992"&gt;Machine Learning&lt;/a&gt;, and it was really englightening. I am in the middle of the present review, and I already learned a lot on the parallel between traditional ML and RL with respect to loss (regret) minimizaetion, bandits, dynamic programming, or even &lt;a href="https://en.wikipedia.org/wiki/Thompson_sampling"&gt;Thompson sampling&lt;/a&gt; strategy.&lt;/p&gt;</description></item><item><title>Computing √2 by additions alone</title><link>https://aliquote.org/post/square-root-two/</link><pubDate>Sat, 28 Mar 2020 08:32:49 +0100</pubDate><guid>https://aliquote.org/post/square-root-two/</guid><description>&lt;p&gt;We&amp;rsquo;ve already seen a well-known algorithm to compute $\sqrt{2}$ to an arbitrary precision using &lt;a href="https://aliquote.org/post/newton-raphson-racket/"&gt;Newton&amp;rsquo;s method&lt;/a&gt; in a previous post (see esp. footnote 1). Here is another approach discussed by Melzak.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; Let&amp;rsquo;s start with two positive integers $p_0$ and $q_0$, and the following recurrence relations, for $n = 0, 1, 2, \dots$:&lt;/p&gt;
&lt;p&gt;$$
\begin{cases}
p_{n+1} = p_n + 2q_n,\cr
q_{n+1} = p_n + q_n
\end{cases}
$$&lt;/p&gt;
&lt;p&gt;so that $p_n/q_n \to 2^{1/2}$. This can be demonstrated by noting that:&lt;/p&gt;
&lt;p&gt;$$ p_{n+1}^2 - 2q_{n+1}^2 = -(p_n^2 - 2q_n^2) = \dots = (-1)^{n+1}(p_0^2 - 2q_0^2), $$&lt;/p&gt;
&lt;p&gt;which implies that:&lt;/p&gt;
&lt;p&gt;$$ \frac{p_{n+1}}{q_{n+1}} - 2^{1/2} = \frac{(-1)^{n+1}(p_0^2 - 2q_0^2)}{q_{n+1}(p_{n+1}+2^{1/2}q_{n+1})}. $$&lt;/p&gt;
&lt;p&gt;Therefore, the sequence $p_0/q_0, p_1/q_1, \dots$ converges to $2^{1/2}$, as illustrated using the following Mathematica code:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;RecurrenceTable&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;}];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Apply&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Divide&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;}];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ListPlot&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;PlotRange&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;All&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/square-root-two.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/square-root-two.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Compare the above to what would be obtained using the Newton derivative-based approach:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2020-03-28-11-33-36.png"&gt;
&lt;/figure&gt;
&lt;p&gt;The convergence is quick.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; Note that the serie is alternating around $\sqrt{2}$, and we have:&lt;/p&gt;
&lt;p&gt;$$ \left| \frac{p_n}{q_n} - 2^{1/2} \right| &amp;lt; \frac{1}{2} \left| \frac{p_n}{q_n} - \frac{p_{n-1}}{q_{n-1}} \right|, $$&lt;/p&gt;
&lt;p&gt;suggesting a convenient stopping rule for any desired degree of accuracy.&lt;/p&gt;
&lt;p&gt;Upon observing that the successive approximations $p_n/q_n$ are generated iteratively by means of two additions of integers only, Melzak then asks what other numbers can be similarly computed. To put in other words, let&amp;rsquo;s start with a series of integers $p_{10}, p_{20}, \dots, p_{k0}$, we require $p_{1n+1}, p_{2n+1},\dots, p_{kn+1}$ to be generable from $p_{1n}, p_{2n}, \dots, p_{kn}$ with a fixed number of additions only, i.e.:&lt;/p&gt;
&lt;p&gt;$$ p_{in+1} = \sum_{j=1}^k c_{ij}p_{jn}, \qquad i = 1, 2, \dots, k;\quad n = 0, 1, 2, \dots $$&lt;/p&gt;
&lt;p&gt;where the $c_{ij}$ are fixed integers. If a real irrational $x$ exists such that $x = \lim_{n\to\infty}p_{1n}/p_{2n}$, we call $x$ &amp;ldquo;computable by addition alone.&amp;rdquo; It turns out that $x$ is computable by additions alone if and only if it is &lt;a href="https://en.wikipedia.org/wiki/Algebraic_number"&gt;algebric&lt;/a&gt;.&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Z.A. Melzak, &lt;em&gt;Companion to Concrete Mathematics&lt;/em&gt;, John Wiley &amp;amp; Sons, 1973.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;Newton-based mathods are known to have quadratic convergence. This is nicely illustrated in &lt;em&gt;Numerical Methods That Usually Work&lt;/em&gt;, by Forman S. Acton (The Mathematical Association of America, 1990), pp. 54–55. The only requirement is that the derivative is not zero, or in other words that the root is isolated. The general algorithm for Newton&amp;rsquo;s method, for which the square-root algorithm is a special case, can be formulated as $x_{i+1} = x_i - \frac{f(x_i)}{f&amp;rsquo;(x_i)}$. This may be rewritten as $\varepsilon_{i+1} = \varepsilon_i - \frac{f_i}{f&amp;rsquo;_i}$;&lt;/p&gt;
&lt;p&gt;When expanded as a Taylor series around the root $b$, we have $f(x_i) = f(b) + \varepsilon_i f&amp;rsquo;(b) + \varepsilon_i^2 \frac{f&amp;rsquo;&amp;rsquo;(b)}{2} + \dots$, and $f&amp;rsquo;(x_i) = f&amp;rsquo;(b) + \varepsilon f&amp;rsquo;&amp;rsquo;(b) + \dots$. Hence, $\varepsilon_{i+1}$ can be rewritten as follows: $$ \varepsilon_{i+1} = \varepsilon_i - \frac{\varepsilon_i f&amp;rsquo; + \varepsilon_i^2\frac{f&amp;rsquo;&amp;rsquo;}{2} + \dots}{f&amp;rsquo; + \varepsilon_i f&amp;rsquo;&amp;rsquo; + \dots} = \frac{\varepsilon_i f&amp;rsquo; + \varepsilon_i^2 f&amp;rsquo;&amp;rsquo; + \dots - \varepsilon_i f&amp;rsquo; - \varepsilon_i^2\frac{f&amp;rsquo;&amp;rsquo;}{2} - \dots}{f&amp;rsquo; + \varepsilon_i f&amp;rsquo;&amp;rsquo; + \dots}. $$ Finally, we have $\varepsilon_{i+1} \approx \varepsilon_i^2 \frac{f&amp;rsquo;&amp;rsquo;}{2f&amp;rsquo;}$.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>On condition number</title><link>https://aliquote.org/post/condition-number/</link><pubDate>Thu, 26 Mar 2020 09:46:55 +0100</pubDate><guid>https://aliquote.org/post/condition-number/</guid><description>&lt;p&gt;In statistical computing, we describe a &lt;em&gt;condition number&lt;/em&gt; as a quantity that describes the stability of a data set with respect to a function &lt;em&gt;S&lt;/em&gt;, say a certain moment like the mean or the variance. Nick Higham&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; discusses condition numbers in two of his &lt;a href="https://nhigham.com/2019/01/23/who-invented-the-matrix-condition-number/"&gt;recent&lt;/a&gt; &lt;a href="https://nhigham.com/2020/03/19/what-is-a-condition-number/"&gt;posts&lt;/a&gt;, mostly in the case of matrix algebra. In this respect, the condition number (with respect to inversion) of a nonsingular square matrix is $\kappa(A)=\lVert A\rVert \lVert A^{-1}\rVert$. Note that this is also the condition number for a linear system $Ax=b$ (exactly if $A$ is the data).&lt;/p&gt;
&lt;p&gt;We already discussed a two-pass algorithm for &lt;a href="https://aliquote.org/post/computing-variance/"&gt;computing variance&lt;/a&gt; without suffering from cancellation errors. As is the case in many numerical algorithms, cancellation of significant digits occurs only arises in substraction (i.e., addition of 2 floating-point numbers with opposite signs), a problem that can hopefully be solved with centering most of the times. This is why it is advised to center the calculation in order to get maximum accuracy when computing statistical moments.&lt;/p&gt;
&lt;p&gt;Since condition number applies to any statistic (i.e., a quantity that depends on data), here is what happens with variance. Let $s$ be the sum of squared deviations defined as $s = \sum_{i=1}^n x_i^2 - n\bar x^2$, or equivalently:&lt;/p&gt;
&lt;p&gt;$$ \sum_{i=1}^n x_i^2 = s + n\bar x^2. $$&lt;/p&gt;
&lt;p&gt;Note that we omitted the sampling correction factor ($\frac{1}{n-1}$) commonly used for the sample variance. When the left-hand side and the second term on the RHS are of equal magnitude, that is when the relative size of $n\bar x^2$ is too large compared to the relative size of $s$, then cancellation of significant digits occurs.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; To see why, it is useful to reexpress the above formula in relative terms, by dividing both sides by $s$. This gives:&lt;/p&gt;
&lt;p&gt;$$ 1 + \frac{n\bar x^2}{s} = 1 + \text{CV}^{-2}, $$&lt;/p&gt;
&lt;p&gt;where $\text{CV}$ is the &lt;a href="https://en.wikipedia.org/wiki/Coefficient_of_variation"&gt;coefficient of variation&lt;/a&gt;. When $\text{CV}^2 &amp;lt; \beta^{-t}$ ($\beta$ is the radix and $t$ the floating-point precision&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt;) all significant digits will be lost. A very small CV is a good way to pinpoint possible numerical issue when computing the variance. In our &lt;a href="https://aliquote.org/post/computing-variance/"&gt;example from last year&lt;/a&gt;, we used $x={1, 2, 3, 4, 5} + 10^{10}$, and CV = 1.581139e-10 in this case.&lt;/p&gt;
&lt;p&gt;The coefficient of variation is related to the condition number discussed above, specifically the condition number of the data with respect to the computation of variance. In this case, $\kappa$ bounds the amount by which realtive errors introduced into the data set under consideration are magnified in the variance estimate. If relative errors of size $u$ are introduced into the $x_i$&amp;rsquo;s, the relative change in $s$ cannot exceed $\kappa u$. If $\kappa$ is large, we say that the corresponding data set is ill-conditioned. In statistical application, $u$ is often larger than $\beta^{-t}$, and it has been shown that:&lt;/p&gt;
&lt;p&gt;$$ \kappa = \sqrt{1 + \frac{n\bar x^2}{s}} = \sqrt{1 + \text{CV}^{-2}}. $$&lt;/p&gt;
&lt;p&gt;In practice, $\kappa\approx \text{CV}^{-1}$ constitutes a good approximation. If relative errors in the data are on the order of $u = \beta^{-t}$, then relative errors in $s$ using the two-pass algorithm are bounded by $nu+n^2\kappa^2u^2$. Still, an error bound of $\kappa u \log_2 n$ can be obtained using the &amp;ldquo;pairwise updating&amp;rdquo; algorithm proposed by Chan, Golub &amp;amp; LeVeque.&lt;sup id="fnref:4"&gt;&lt;a href="#fn:4" class="footnote-ref" role="doc-noteref"&gt;4&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Nicholas J. Higham, &lt;em&gt;Accuracy and Stability of Numerical Algorithms&lt;/em&gt; (2nd ed.), Society for Industrial and Applied Mathematics, 2002.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;Ronald A. Thisted, &lt;em&gt;Elements of Statistical Computing&lt;/em&gt;, Chapman and Hall, 1988.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:3"&gt;
&lt;p&gt;In the &lt;a href="https://en.wikipedia.org/wiki/Machine_epsilon"&gt;IEEE 754 standard&lt;/a&gt;, a double precision variable (&lt;code&gt;double&lt;/code&gt; in C/C++), $\beta=2$ and $t=53$, so that machine precision is 2&lt;sup&gt;-52&lt;/sup&gt; ≈ 2.22e-16.&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:4"&gt;
&lt;p&gt;Chan, T.F., Golub, G.H. and LeVeque, R.J., Algorithms for computing the sample variance: Analysis and recommendations, &lt;em&gt;The American Statistician&lt;/em&gt; 37: 242-247. Described on &lt;a href="https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance"&gt;Wikipedia&lt;/a&gt; under the heading &amp;ldquo;Parallel algorithm&amp;rdquo;.&amp;#160;&lt;a href="#fnref:4" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Stuck at home</title><link>https://aliquote.org/post/stuck-at-home/</link><pubDate>Wed, 25 Mar 2020 14:27:54 +0100</pubDate><guid>https://aliquote.org/post/stuck-at-home/</guid><description>&lt;p&gt;I&amp;rsquo;m stuck at home because of the thing you all know. I would not normally regard this as something very cumbersome since I spend most of my time at home anyway, and I used to work at home a lot. However, I got a new position last year, and I had to get used to working in a lab all day. Now I find it hard to motivate myself to work alone at home. No worry, this is just me and once I&amp;rsquo;ll find a side project that keep me busy, I will soon get back to professional work.&lt;/p&gt;
&lt;p&gt;Second case in point is that I now have to schedule groceries in a very digilent way: I need to buy enough for 10 or 15 days, and I must avoid the crowd, because I don&amp;rsquo;t give a lot of my skin if I catch something right now, considering the state of hospital emergencies in this country (and given that my current condition could become quite a big deal, at anytime).&lt;/p&gt;
&lt;p&gt;That being said, I&amp;rsquo;m fine. I&amp;rsquo;m with my son for the quarantine, he&amp;rsquo;s doing good and I happily spend most of time helping him with his homeworks, cooking and reading (lot of) books. Luckily we have plenty of TV shows to watch. We already finished Season 6 of &lt;a href="https://en.wikipedia.org/wiki/The_100_(TV_series)"&gt;The 100&lt;/a&gt;, and we will probably get back to the &lt;a href="https://en.wikipedia.org/wiki/The_Blacklist_(TV_series)"&gt;Black List&lt;/a&gt; this evening (3 seasons left, plus some remaining episodes from Season 4).&lt;/p&gt;
&lt;p&gt;I thought I would have lot of time to purge part of reading list, or to enjoy some Lisp/Scheme coding late at night, and so on. Now I realize that I&amp;rsquo;m a long way from realizing all those expectations until I find a way to motivate myself, again. But maybe at some point &lt;a href="https://brettterpstra.com/2020/03/25/working-from-home-can-be-magical/"&gt;working from home can be magical&lt;/a&gt;, and I hope that this still works for me:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I’ve learned to reframe &amp;ldquo;procrastination&amp;rdquo; as &amp;ldquo;marination.&amp;rdquo; I used to feel guilty about putting off large tasks, but the fact is that I’m constantly thinking about and examining those tasks while I avoid working on them. Deadline pressure helps me focus, and by the time I’m ready to start working on it, I find I’ve already planned it out, mostly subconsciously, during my marination time. Again, that might not work for anyone but me, but seeing it that way has saved me a lot of guilt. I actually feel good about the time I spend planning and brainstorming in the back of my mind while I do something I enjoy.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/60598252059__52DA73C5-DFCB-4235-BB26-993553C4C418.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/60598252059__52DA73C5-DFCB-4235-BB26-993553C4C418.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0943.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0943.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0940.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0940.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Fred Hersch • &lt;em&gt;Solo&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Gaussian elimination</title><link>https://aliquote.org/post/gaussian-elimination/</link><pubDate>Tue, 24 Mar 2020 18:41:28 +0000</pubDate><guid>https://aliquote.org/post/gaussian-elimination/</guid><description>&lt;p&gt;Gaussian elimination is probably one of the algorithm we hear about when taking a basic class in linear algebra. In essence, Gaussian elimination is a procedure that can solve $n$ linear equations in $n$ unknowns using on the order of $n^3$ arithmetic operations.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;How does it works? The idea is to transform a linear system, $Ax=b$, where $A$ is an $n\times n$ matrix and $x$ and $b$ are column vectors of size $n$, into an upper triangular system by applying simple linear transformation on the left, much like &lt;a href="https://en.wikipedia.org/wiki/Householder_transformation"&gt;Householder triangularization&lt;/a&gt; in the case of QR factorization. Regarding operations that are permitted these are: swapping rows, adding one row onto another, and multiply every factor of one row with a constant. Consider the &lt;a href="https://people.richland.edu/james/lecture/m116/matrices/pivot.html"&gt;following example&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;$$
\begin{align}
3x + 2y - 4z &amp;amp; = \phantom{1}3\cr
2x + 3y + 3z &amp;amp; = 15\cr
5x - 3y + \phantom{3}z &amp;amp; = 14
\end{align}
$$&lt;/p&gt;
&lt;p&gt;You could do this by hand, by following the &lt;a href="https://people.richland.edu/james/lecture/m116/matrices/pivot.html"&gt;helpful tips&lt;/a&gt; from the site where this example originates from, but Mathematica has built-in procedures to solve linear systems like this, e.g. &lt;code&gt;Solve&lt;/code&gt; or &lt;code&gt;LinearSolve&lt;/code&gt;, and there&amp;rsquo;s also a &lt;code&gt;RowReduce&lt;/code&gt; function which acts like Gaussian elimination. Here&amp;rsquo;s what we get:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2020-03-25-19-29-57.png"&gt;
&lt;/figure&gt;
&lt;p&gt;This is not the only algorithm used in matrix factorizations, of course. Indeed, modern statistical computing rely on &lt;a href="https://en.wikipedia.org/wiki/LU_decomposition"&gt;LU decomposition&lt;/a&gt; or &lt;a href="https://en.wikipedia.org/wiki/QR_decomposition"&gt;QR factorization&lt;/a&gt;. The latter is what used in R for linear regression models, for instance. The QR decomposition of a real square matrix $A$ is a decomposition of $A$ as $A=QR$, where $Q$ is an orthogonal matrix (i.e., $Q^TQ=I$) and $R$ in an upper triangular matrix. Furthermore, if $A$ is &lt;a href="https://mathworld.wolfram.com/NonsingularMatrix.html"&gt;nonsingular&lt;/a&gt;, this decomposition is unique. Such a factorization can be found using the &lt;a href="https://en.wikipedia.org/wiki/Gram%E2%80%93Schmidt_process"&gt;Gram-Schmidt&lt;/a&gt; procedure.&lt;/p&gt;
&lt;p&gt;Solving linear systems is quite easy in Racket thanks to the &lt;code&gt;math&lt;/code&gt; module. Here is one way to find the solution of the above system (which is mostly what we did in &lt;a href="https://aliquote.org/post/newton-raphson-racket/"&gt;another post&lt;/a&gt;):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;#lang &lt;/span&gt;&lt;span class="nn"&gt;racket&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;require&lt;/span&gt; &lt;span class="n"&gt;math/matrix&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;A&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;matrix&lt;/span&gt; &lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="mf"&gt;3.0&lt;/span&gt; &lt;span class="mf"&gt;2.0&lt;/span&gt; &lt;span class="mf"&gt;-4.0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;2.0&lt;/span&gt; &lt;span class="mf"&gt;3.0&lt;/span&gt; &lt;span class="mf"&gt;3.0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;5.0&lt;/span&gt; &lt;span class="mf"&gt;-3.0&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt;&lt;span class="p"&gt;]]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;col-matrix&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;3.0&lt;/span&gt; &lt;span class="mf"&gt;15.0&lt;/span&gt; &lt;span class="mf"&gt;14.0&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;matrix-solve&lt;/span&gt; &lt;span class="n"&gt;A&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Luckily, Racket also provides some &lt;a href="https://docs.racket-lang.org/math/matrix_row-alg.html"&gt;row-based algorithms&lt;/a&gt;, including Gauss elimination. So here is what we get using &lt;code&gt;matrix-gauss-elim&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;Ab&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;matrix-augment&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list&lt;/span&gt; &lt;span class="n"&gt;A&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;matrix-gauss-elim&lt;/span&gt; &lt;span class="n"&gt;Ab&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Lloyd N. Trefethen. &lt;a href="http://people.maths.ox.ac.uk/trefethen/NAessay.pdf"&gt;Numerical Analysis&lt;/a&gt;. See also Pr. L. N. Trefethen&amp;rsquo;s &lt;a href="http://people.maths.ox.ac.uk/trefethen/"&gt;website&lt;/a&gt;, which is full of free resources.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>March in review</title><link>https://aliquote.org/post/micro-review-010/</link><pubDate>Mon, 16 Mar 2020 10:10:48 +0100</pubDate><guid>https://aliquote.org/post/micro-review-010/</guid><description>&lt;p&gt;Here is the monthly review on aliquote. Times are changing fast these days, let&amp;rsquo;s keep busy and focused inasmuch as we can.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Last week I came across a nice blog, available in French and English: &lt;a href="https://blog.merigoux.ovh/en/table-of-contents.html"&gt;Literal translations&lt;/a&gt;. There are interesting discussion on Rust or &lt;a href="https://blog.merigoux.ovh/en/2017/07/19/static-or-dynamic.html"&gt;dynamic vs. static languages&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://opensource.com/article/20/3/blog-emacs"&gt;How to blog with Emacs Org mode&lt;/a&gt;: Hugo has become a reliable medium for building static blog during the past few years. I tried to use an &lt;a href="https://aliquote.org/post/blogging-with-ox-hugo/"&gt;Org backend&lt;/a&gt; at some point, but finally I keep editing plain Markdown files, in Emacs of course. &lt;a href="https://aliquote.org/post/typora/"&gt;Typora&lt;/a&gt; was really nice, but not as powerful as Emacs in the long run. Anyway, this blog post explains everything you need to setup a blog using &lt;a href="https://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.html"&gt;org-publish&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you are a Python user interested in functional programming, go check the &lt;a href="https://github.com/dgilland/fnc"&gt;fnc&lt;/a&gt; project (not to be confised with this &lt;a href="https://github.com/tobydriscoll/fnc-extras/tree/master/python"&gt;FNC&lt;/a&gt;) and see if it is worth a try. I&amp;rsquo;m still into Python&amp;rsquo;s own &lt;a href="https://docs.python.org/3.7/library/functools.html"&gt;functools&lt;/a&gt; but maybe it is an interesting option.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Not really much about haskell itself, but Taylor Fausak&amp;rsquo;s take on how to design a library that checks whether two &lt;a href="http://taylor.fausak.me/2020/03/13/relate-intervals-with-rampart/"&gt;intervals overlap&lt;/a&gt; or not was a nice read. There are indeed &lt;a href="https://stackoverflow.com/a/5601502"&gt;13 different ways&lt;/a&gt; that two intervals can relate to each other.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Did you notice that &lt;a href="https://julialang.org"&gt;Julia&lt;/a&gt;&amp;rsquo;s website has been redesigned. I just learned that it is now driven by &lt;a href="https://franklinjl.org"&gt;Franklin&lt;/a&gt;, a new static website generator. Interestingly, it integrates the &lt;a href="https://github.com/fredrikekre/Literate.jl"&gt;Literate&lt;/a&gt; package, which is a simplistic package for Literate Programming where lines starting with # are treated as markdown, while all other lines are treated as julia code (much like good old &lt;a href="https://ashkenas.com/docco/"&gt;Docco&lt;/a&gt;, Rocco &amp;amp; Co.).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Robert Smith just released a new Lisp package, &lt;a href="https://github.com/stylewarning/hypergeometrica"&gt;Hypergeometrica&lt;/a&gt;, to compute Pi digits.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Hypergeometrica aims to democratize the calculation of pi to trillions of digits. As of March 2020, the software used to break world-record computations has remained closed source. This has been a 20+ year trend, and includes famous software such as y-cruncher, TachusPI, PiFast, and SuperPi.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;John Baez has some nice pages on &lt;a href="http://math.ucr.edu/home/baez/permutations/"&gt;Random Permutations&lt;/a&gt;. As $n\to\infty$, the probability that a random permutation of an $n$-element set has $k$ fixed points approaches $\frac{1}{ek!}$. In the same limiting case, the average length of the longest cycle in a random permutation is $\lambda n$, where $\lambda\approx 0.624$.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Tom MacWright wrote a small Elm interactive &lt;a href="https://oldfashioned.tech"&gt;dashboard for cocktail&lt;/a&gt; lovers. Lovely.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Don&amp;rsquo;t expect any news from COVID-19 here.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Murmurhash</title><link>https://aliquote.org/post/murmurhash/</link><pubDate>Thu, 12 Mar 2020 12:07:48 +0100</pubDate><guid>https://aliquote.org/post/murmurhash/</guid><description>&lt;p&gt;The &lt;a href="https://en.wikipedia.org/wiki/MurmurHash"&gt;MurmurHash&lt;/a&gt; algorithm belongs to non-cryptographic hash function and it is used for hash-based lookup, e.g. to convert a word $w$ to an integer $s \in [0, H)$, where $H$ is the table size. I came across this hash function by reading a recent publication on a new read mapper.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; It has been shown to have &lt;a href="https://softwareengineering.stackexchange.com/a/145633"&gt;good properties&lt;/a&gt; in terms of speed and number of collisions compared to other hashing algoritms; see also &lt;a href="https://www.strchr.com/hash_functions"&gt;Hash functions: An empirical comparison&lt;/a&gt;.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;Although different implementations of Murmurhash3 are cited on the Wikipedia page (see also the &lt;code&gt;mmh3&lt;/code&gt;/&lt;code&gt;digest&lt;/code&gt; packages for Python/R), I couldn&amp;rsquo;t find one in Scheme. So here is a quick and dirty one in Chicken scheme, using its solid FFI facilities and some C code grabbed from the Wikipedia page. There&amp;rsquo;s also the &lt;a href="http://dirk.eddelbuettel.com/code/digest.html"&gt;digest&lt;/a&gt; R package (here&amp;rsquo;s the &lt;a href="https://github.com/cran/digest/blob/master/src/pmurhash.c"&gt;C code&lt;/a&gt; in question for the interested reader) and some &lt;a href="https://github.com/rurban/smhasher/blob/master/MurmurHash3.cpp"&gt;C++ code&lt;/a&gt; available on &lt;a href="https://github.com/aappleby/smhasher"&gt;smhasher&lt;/a&gt; on Github, but I haven&amp;rsquo;t tried it yet.&lt;/p&gt;
&lt;p&gt;Please note that things have a little bit changed with Chicken 5, compared to this excellent blog post: &lt;a href="https://www.more-magic.net/posts/scheme-c-integration.html"&gt;A (mostly) comprehensive guide to calling C from Scheme and vice versa&lt;/a&gt;. In particular, to import the &lt;code&gt;foreign&lt;/code&gt; module, you now have to write &lt;code&gt;(import (chichen foreign))&lt;/code&gt; instead of &lt;code&gt;(import foreign)&lt;/code&gt;. Say you have this little snippet:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;import&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;chicken&lt;/span&gt; &lt;span class="nv"&gt;foreign&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;foreign-declare&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;#include &amp;lt;math.h&amp;gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="nv"&gt;sin-pi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;foreign-lambda*&lt;/span&gt; &lt;span class="nv"&gt;double&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;double&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;double val = x * M_PI;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;C_return(sin(val));&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;display &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;sin-pi&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then you can generate a binary for your platform using the Chicken compiler, &lt;code&gt;csc&lt;/code&gt;. The interactive Chicken REPL (&lt;code&gt;csi&lt;/code&gt;) won&amp;rsquo;t work with the &lt;code&gt;foreign&lt;/code&gt; import. First, I wanted to test the C code so I added a little header and print statement (&lt;a href="https://aliquote.org/pub/murmur32.c"&gt;murmur32.c&lt;/a&gt;). Let us check that it works:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ cc murmu32.c -o murmur32
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ ./murmur32
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="m"&gt;1498610893&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here is what I got using R, which also implements MurmurHash3 for 32/128 bit (x86/x64):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;digest&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;digest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;murmur&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;murmur32&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;seed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;101&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;serialize&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;FALSE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;[1]&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;5952fccd&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This also happens to be 1,498,610,893 in decimal notation.&lt;/p&gt;
&lt;p&gt;Now, let&amp;rsquo;s write some Scheme wrapper to use this little C procedure, while trying to handle &lt;a href="http://wiki.call-cc.org/man/4/Foreign%20type%20specifiers"&gt;C types&lt;/a&gt; correctly: an &lt;code&gt;uint_8&lt;/code&gt; is an unsigned char, or a foreign &lt;code&gt;blob&lt;/code&gt; in case it is just a pointer, while an &lt;code&gt;uint32_t&lt;/code&gt; corresponds to an unsigned int (4 bytes). And so, we get the following piece of code:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;import&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;chicken&lt;/span&gt; &lt;span class="nv"&gt;foreign&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;chicken&lt;/span&gt; &lt;span class="nv"&gt;format&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;#&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;extern&lt;/span&gt; &lt;span class="nv"&gt;uint32_t&lt;/span&gt; &lt;span class="nv"&gt;murmur3_32&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;const&lt;/span&gt; &lt;span class="nv"&gt;uint8_t*&lt;/span&gt; &lt;span class="nv"&gt;key,&lt;/span&gt; &lt;span class="nv"&gt;size_t&lt;/span&gt; &lt;span class="nv"&gt;len,&lt;/span&gt; &lt;span class="nv"&gt;uint32_t&lt;/span&gt; &lt;span class="nv"&gt;seed&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;&amp;lt;&lt;/span&gt;&lt;span class="o"&gt;#&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="nv"&gt;m32&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;foreign-lambda&lt;/span&gt; &lt;span class="nv"&gt;unsigned-int32&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;murmur3_32&amp;#34;&lt;/span&gt; &lt;span class="nv"&gt;blob&lt;/span&gt; &lt;span class="nv"&gt;size_t&lt;/span&gt; &lt;span class="nv"&gt;unsigned-int32&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;printf&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;~A &amp;#34;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;m32&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;murmur&amp;#34;&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt; &lt;span class="mi"&gt;101&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;But first, we need to compile the core &lt;a href="https://aliquote.org/pub/lib-m32.c"&gt;C functions&lt;/a&gt; (no need for a shared library, though):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ cc -c lib-m32.c
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ csc -o m32 lib-m32.o m32.scm
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And finally:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ ./m32
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="m"&gt;1498610893&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Edgar, R. C. (2020). &lt;a href="https://www.biorxiv.org/content/10.1101/2020.01.12.903351v1"&gt;URMAP, an ultra-fast read mapper&lt;/a&gt;. bioRxiv&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;See this &lt;a href="https://aliquote.org/post/hash-collision/"&gt;related post&lt;/a&gt; for how we define and quantify hash collisions.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Phylogenetic analysis using Python</title><link>https://aliquote.org/post/phylogenetic-python/</link><pubDate>Wed, 11 Mar 2020 20:29:05 +0100</pubDate><guid>https://aliquote.org/post/phylogenetic-python/</guid><description>&lt;p&gt;Lately I have been playing with Python and the &lt;a href="http://etetoolkit.org"&gt;ETE toolkit&lt;/a&gt; to build and compare phylogenetic trees. As discussed in a &lt;a href="https://aliquote.org/post/comparing-trees"&gt;recent post&lt;/a&gt;, phylogenetic trees are used to unravel the evolutionary relationships or lineage between a set of genetic sequences. The ETE toolkit has a long history now,&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; and it is definitely the way to go if you are diving into phylogenetic analysis in Python. It is both a module that you can import the usual way in a Python console, and a set of executable workflows that you run from your preferred shell.&lt;/p&gt;
&lt;p&gt;We will start by building a database of orthologous genes for 4 species of Mycoplasma. This is easily carried out using &lt;a href="https://github.com/davidemms/OrthoFinder"&gt;Orthofinder&lt;/a&gt;, and the example dataset bundled with this package. A &lt;a href="https://davidemms.github.io/orthofinder_tutorials/running-an-example-orthofinder-analysis.html"&gt;detailed tutorial&lt;/a&gt; on how to do your own analysis from Ensembl is also available. Assuming you are in the root directory where you installed Orthofinder, just run &lt;code&gt;orthofinder.py&lt;/code&gt; and inspect the results directory:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ python3 orthofinder.py -f ExampleDataset
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ &lt;span class="nb"&gt;cd&lt;/span&gt; ExampleDataset/OrthoFinder/Results_Mar12
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ ls
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Citation.txt Log.txt Phylogenetically_Misplaced_Genes WorkingDirectory
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Comparative_Genomics_Statistics Orthogroup_Sequences Resolved_Gene_Trees
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Gene_Duplication_Events Orthogroups Single_Copy_Orthologue_Sequences
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Gene_Trees Orthologues Species_Tree
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note that a little quality check should have been printed near the end of the output. In this case, I got:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Writing orthogroups to file
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;---------------------------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;OrthoFinder assigned &lt;span class="m"&gt;2207&lt;/span&gt; genes &lt;span class="o"&gt;(&lt;/span&gt;80.8% of total&lt;span class="o"&gt;)&lt;/span&gt; to &lt;span class="m"&gt;603&lt;/span&gt; orthogroups. Fifty percent of all genes
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;were in orthogroups with &lt;span class="m"&gt;4&lt;/span&gt; or more genes &lt;span class="o"&gt;(&lt;/span&gt;G50 was 4&lt;span class="o"&gt;)&lt;/span&gt; and were contained in the largest &lt;span class="m"&gt;280&lt;/span&gt; orthogroups
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;(&lt;/span&gt;O50 was 280&lt;span class="o"&gt;)&lt;/span&gt;. There were &lt;span class="m"&gt;269&lt;/span&gt; orthogroups with all species present and &lt;span class="m"&gt;246&lt;/span&gt; of these consisted entirely
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;of single-copy genes.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;A tree in Newick format should also be available in the &lt;code&gt;Species_Tree/&lt;/code&gt; subdirectory. Using Python, we can visualize it using the command line utility (&lt;code&gt;ete3&lt;/code&gt;), e.g.:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ ete3 view -t Species_Tree/SpeciesTree_rooted.txt
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/2020-03-12-10-08-17.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Note, however, that is the &amp;ldquo;final&amp;rdquo; species tree, and not gene trees that could potentially be produced on aligned sequences (but see the &lt;code&gt;Gene_Trees&lt;/code&gt; subdirectory). Fortunately, all orthologous sequences are available in Fasta format in the &lt;code&gt;Single_Copy_Orthologue_Sequences&lt;/code&gt; subdirectory. Two examples of such a gene tree are shown below (click to enlarge).&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2020-03-12-10-14-38.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2020-03-12-10-14-38.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2020-03-12-10-14-59.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2020-03-12-10-14-59.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;In principle it is possible to rebuild these trees manually but we need to align the protein sequences first. In the figure above, I considered the orthogroup 7 and 9. In the subdirectory &lt;code&gt;Orthogroup_Sequences/&lt;/code&gt;, we can find the corresponding multi-fasta files. Here is a preview of the first aa for the 7th orthogroup:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;Bio&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;SeqIO&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nb"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;OG0000007.fa&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;...&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;seqs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;SeqIO&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;fasta&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;...&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;seqs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;...&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{}&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="si"&gt;{}&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;seq&lt;/span&gt;&lt;span class="p"&gt;[:&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;gi&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;290753066&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;emb&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;CBH41042&lt;/span&gt;&lt;span class="mf"&gt;.1&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;MANKDYYKILGVDKKASDKE&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;gi&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;31541124&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;gb&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;AAP56426&lt;/span&gt;&lt;span class="mf"&gt;.1&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;MRWLVKEQNYYEILGVSTNA&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;gi&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;284811924&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;gb&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;AAP56500&lt;/span&gt;&lt;span class="mf"&gt;.2&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;MSSKRDYYEILEVSRSATQQ&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;gi&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;284811927&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;gb&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;ADB96855&lt;/span&gt;&lt;span class="mf"&gt;.1&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;MFQTKKTCPSCKGEGQTIKN&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;gi&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;284811928&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;gb&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;ADB96856&lt;/span&gt;&lt;span class="mf"&gt;.1&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;MSSKRDYYEILGVSRSATQQ&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;gi&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;31541331&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;gb&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;AAP56632&lt;/span&gt;&lt;span class="mf"&gt;.1&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;MRPFLESNYYELLGVSETAS&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;gi&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;31541333&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;gb&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;AAP56634&lt;/span&gt;&lt;span class="mf"&gt;.1&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;MADKQQPTQLNLIAYFDDYQ&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;gi&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;31541383&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;gb&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;AAP56684&lt;/span&gt;&lt;span class="mf"&gt;.1&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;MIKSEDFMAEKRDYYEVLQI&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;gi&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;3844628&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;gb&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;AAC71235&lt;/span&gt;&lt;span class="mf"&gt;.1&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;MAAGKRDYYEVLGISKNASS&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;gi&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;3844797&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;gb&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;AAC71418&lt;/span&gt;&lt;span class="mf"&gt;.1&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;MAEQKRDYYEVLGITPDADQ&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;gi&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;71851550&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;gb&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;AAZ44158&lt;/span&gt;&lt;span class="mf"&gt;.1&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;MAKQDFYKILGVEKSASLTE&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We can perform a multiple alignment of those sequences using MAFFT, and build a tree directly using ETE3 and the Fasttree or RaxML workflow:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ mafft OG0000007.fa &amp;gt; OG0000007_a.fa
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ gsed -i -e &lt;span class="s1"&gt;&amp;#39;s/|/-/&amp;#39;&lt;/span&gt; OG0000007_a.fa
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ ete3 build -a OG0000007_a.fa -w none-none-none-raxml_default -C &lt;span class="m"&gt;12&lt;/span&gt; -o OG0000007 --clearall
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ ete3 view -t OG0000007/OG0000007_a.fa.final_tree.nw
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;small&gt;&lt;code&gt;gsed&lt;/code&gt; is macOS equivalent of GNU sed from Homebrew.&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;In the above statement, &lt;code&gt;none-none-none-raxml_default&lt;/code&gt; means that we use no aligner, no trimmer, no (model) tester, and the RaxML utility with default settings. Here&amp;rsquo;s the output of our manual tree reconstruction:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/OG0000007_a.fa.final_tree.png"&gt;
&lt;/figure&gt;
&lt;p&gt;As can be seen, there&amp;rsquo;s some room for improvement since the alignment appears quite bad. That being said, we can still compare this tree with the one built by Orthofinder using &lt;code&gt;ete3 compare&lt;/code&gt;. We will first need to match the labels in both trees:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ &lt;span class="nb"&gt;cd&lt;/span&gt; OG0000007
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ cp ../../Gene_Trees/OG0000007_tree.txt .
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ gsed -i &lt;span class="s1"&gt;&amp;#39;s/|/-/g&amp;#39;&lt;/span&gt; OG0000007_tree.txt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ gsed -i -E &lt;span class="s1"&gt;&amp;#39;s/Mycoplasma_[a-z]+_//g&amp;#39;&lt;/span&gt; OG0000007_tree.txt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ ete3 compare -t none-none-none-raxml_default/OG0000007_a.fa.final_tree.nw -r OG0000007_tree.txt
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Jaime Huerta-Cepas, Joaquín Dopazo and Toni Gabaldón. &lt;a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2820433/"&gt;ETE: a Python Environment for Tree Exploration&lt;/a&gt;. &lt;em&gt;BMC Bioinformatics&lt;/em&gt; 2010, 11:24.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>On comparing trees</title><link>https://aliquote.org/post/comparing-trees/</link><pubDate>Tue, 03 Mar 2020 11:41:20 +0100</pubDate><guid>https://aliquote.org/post/comparing-trees/</guid><description>&lt;p&gt;Phylogenetic trees are used to visually depict the evolutionary relationships between a set of taxa. The branching pattern of such trees is called the topology of the tree, and an interesting question is: What statistcal measure can be used to compare the layout of different evolutionary trees, or in other words, to assess whether their topologies could be considered different? It turns out that the &lt;a href="https://en.wikipedia.org/wiki/Robinson%E2%80%93Foulds_metric"&gt;Robinson-Foulds&lt;/a&gt; (R-F) distance is exactly what we need, and it is available in the &lt;a href="https://cran.r-project.org/web/packages/phangorn/index.html"&gt;phangorn&lt;/a&gt; R package. Besides, this package allows to build trees using different methods, several models of molecular evolution, and to compute their likelihood.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s see it in action. We will use a multi-fasta file containing aligned sequence of different species, from &lt;a href="https://treebase.org/treebase-web/home.html"&gt;TreeBase&lt;/a&gt;. In this case, the dataset consists in 40 sequences of fungi analyzed in the following study: Untereiner W., &amp;amp; Naveaeu F. 1999. Molecular systematics of the Herpotrichiellaceae with an assessment of the phylogenetic positions of Exophiala dermatitidis and Phialophora americana. &lt;em&gt;Mycologia&lt;/em&gt;, 91(1): 67-83. Since the data file is already in Nexus format, it is straightforward to import it in R:&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;library&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;phangorn&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;read.phyDat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;~/tmp/M2043.nex&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;format&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;nexus&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;dm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;dist.ml&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;upgma&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dm&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;cex&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;.5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here are the results of building a tree using unweighted pair group method with arithmetic mean (&lt;a href="https://en.wikipedia.org/wiki/UPGMA"&gt;UPGMA&lt;/a&gt;, left) and neighbor joining (&lt;a href="https://en.wikipedia.org/wiki/Neighbor_joining"&gt;NJ&lt;/a&gt;, right):&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2020-02-28-15-54-00.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2020-02-28-15-54-00.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2020-02-28-16-00-00.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2020-02-28-16-00-00.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Unrooted trees can be produces as easily by adding the &lt;code&gt;&amp;quot;unrooted&amp;quot;&lt;/code&gt; option to the &lt;code&gt;plot&lt;/code&gt; function. We could also plot a subset of the whole set of taxa by (approximately) sampling randomly among the common prefix of the taxa, as shown below:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;prefix&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;unlist&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;lapply&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;strsplit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;names&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;_&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="kr"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;x[1]&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;idx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;seq&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;length&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prefix&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;by&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;table&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prefix[idx]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;d1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;d[idx]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;d2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;d[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;idx]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;dm1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;dist.ml&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;dm2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;dist.ml&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;op&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;par&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mfrow&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;c&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;cex&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;.7&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;upgma&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dm1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;upgma&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dm2&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;par&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;op&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;How about using the R-F distance to compare two trees?&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;tree1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;upgma&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dm&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;tree2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;NJ&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dm&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;treedist&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tree1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tree2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Yet, a simpler approach would be to use the &lt;a href="https://www.reconlearn.org/post/practical-phylogenetics.html"&gt;cophenetic distance&lt;/a&gt; to compare the original distance with the distance of the species on the tree, whether it is based on NJ or UPGMA. This is basically what we did &lt;a href="https://aliquote.org/post/using-bootstrap-in-cluster-analysis/"&gt;a long time ago&lt;/a&gt; when discussing the quality of clustering methods. Here is an example of use:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;dd0&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;as.vector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dm&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;dd1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;as.vector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;as.dist&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;cophenetic&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;upgma&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dm&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;dd2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;as.vector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;as.dist&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;cophenetic&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;NJ&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dm&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dd0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dd1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;col&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;darkorange&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;xlab&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;Original distance&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ylab&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;Tree-based distance&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;points&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dd0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dd2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;col&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;cornflowerblue&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;abline&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/2020-03-03-11-47-00.png"&gt;
&lt;/figure&gt;
&lt;p&gt;We can conclude that the NJ method offers the best reconstruction of the original pairwise distance matrix, which is to be expected since UPGMA imposes an ultrametric property whereby all tips should be equidistant from the root, which is another way to say that all species have undergone the same amount of evolution.&lt;/p&gt;
&lt;p&gt;Finally, to compute the likelihood of those trees, we can re-use the omnibus &lt;code&gt;anova&lt;/code&gt; function, as we would do for comparing two statistical models:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;m1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;pml&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;upgma&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dm&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;m2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;pml&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;NJ&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dm&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;anova&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;logLik&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In the case of the NJ tree I got a log likelihood of -6526.059, with 77 degrees of freedom. Instead of this base model, we could consider the Jukes-Cantor model we discussed &lt;a href="https://aliquote.org/post/markov-random-process-using-mathematica/"&gt;earlier&lt;/a&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;m.jc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;optim.pml&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;optNni&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;TRUE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;logLik&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m.jc&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# &amp;#39;log Lik.&amp;#39; -6451.672 (df=77)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Where do these degrees of freedom come from and how do we define the likelihood of a tree after all? Of course, the likelihood here stands for the probability that such a tree would have generated the data presented in the sequence under the chosen model. If we make the assumption that each site evolves independently, we can compute separately the likelihood at each site and add them up. For each site, its likelihood is defined as the sum of the probabilities of every possible ancestral states, which conform to the Jukes-Cantor substitution model (equiprobable substitutions and equiprobable base frequencies). Basically, this amounts to compute conditional likelihood (starting from the tip of the tree down to the common ancestral root). It &lt;a href="https://scholarship.claremont.edu/cgi/viewcontent.cgi?article=1047&amp;amp;context=scripps_theses"&gt;can be shown&lt;/a&gt; that for any node $x$, whose immediate descendants are tips $y$ and $z$, the conditional likelihood at node $k$ amounts to:&lt;/p&gt;
&lt;p&gt;$$ L_S^{(x)} = \sum_s \left[ \left(\sum_{S_y} P_{S_xS_y}(v_y)L_{S_y}^{(y)} \right) \left(\sum_{S_z} P_{S_xS_z}(v_z)L_{S_z}^{(z)} \right) \right]. $$&lt;/p&gt;
&lt;p&gt;These conditional likelihoods are computed iteratively from the tips to the root of the tree. Once we get the conditional likelihood $L_{S_0}^0$ for the root (0), the overall likelihood is just the sum of all those conditional likelihoods:&lt;/p&gt;
&lt;p&gt;$$ \mathcal{L} = \sum_{S_{0}} \pi_{S_0}L_{S_0}^{(0)}, $$&lt;/p&gt;
&lt;p&gt;where $\pi_{S_0}$ denotes the base frequencies for the root of the tree, that is the probability that the root is in state $S_{0}$. Of course, every model comes with its own set of hyperparameters (e.g., the GTR adds 4 four parameters), hence the varying amount of degrees of freedom that we can find from one model to the other. There&amp;rsquo;s also a nice discussion of on the following blog post: &lt;a href="https://www.cs.rice.edu/~ogilvie/comp571/2019/11/27/likelihood-of-a-tree.html"&gt;Likelihood of a tree&lt;/a&gt;.&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;When only aligned sequences are available, we need to use &lt;code&gt;format = &amp;quot;fasta&amp;quot;&lt;/code&gt; and convert the data to binary DNA format using, e.g., &lt;code&gt;ape::as.DNAbin()&lt;/code&gt;, or directly &lt;code&gt;fasta2DNAbin()&lt;/code&gt;.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Hex and Base64</title><link>https://aliquote.org/post/hex-to-base64/</link><pubDate>Thu, 27 Feb 2020 15:21:54 +0100</pubDate><guid>https://aliquote.org/post/hex-to-base64/</guid><description>&lt;p&gt;In one of the &lt;a href="https://cryptopals.com"&gt;cryptopals crypto challenges&lt;/a&gt; ask, we are tasked with writing a simple converter from Hex-encoded string to their base64 representation.&lt;/p&gt;
&lt;p&gt;Recall that to convert Hex ASCII code, also known as Base16, to text, you&amp;rsquo;ll need to convert each hex byte to its decimal counterpart and get the corresponding character from any &lt;a href="https://www.ascii-code.com"&gt;ASCII table&lt;/a&gt;. For instance, the hex code &amp;ldquo;61&amp;rdquo; yields the value 97 (61&lt;sub&gt;16&lt;/sub&gt; = 6•16&lt;sup&gt;1&lt;/sup&gt; + 1•16&lt;sup&gt;0&lt;/sup&gt; = 96 + 1) which corresponds to letter &amp;ldquo;a&amp;rdquo;, while &amp;ldquo;6C&amp;rdquo; (6•16&lt;sup&gt;1&lt;/sup&gt; + 12•16&lt;sup&gt;0&lt;/sup&gt; = 96 + 12) yields the value 108 (&amp;ldquo;l&amp;rdquo;). For instance, &amp;ldquo;alice&amp;rdquo; is &lt;code&gt;61 6c 69 63 65&lt;/code&gt;. Here is a toy example on how to go the other way around, from &lt;a href="https://www.reddit.com/r/Racket/comments/s7prm/formatting_hexadecimal_numbers/c4cm9qv/"&gt;byte to text&lt;/a&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;byte-&amp;gt;string&lt;/span&gt; &lt;span class="n"&gt;byte&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;string-upcase&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;string-append&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;number-&amp;gt;string&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;quotient&lt;/span&gt; &lt;span class="n"&gt;byte&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;number-&amp;gt;string&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;remainder&lt;/span&gt; &lt;span class="n"&gt;byte&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;byte-&amp;gt;string&lt;/span&gt; &lt;span class="mi"&gt;97&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;; =&amp;gt; 61&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;byte-&amp;gt;string&lt;/span&gt; &lt;span class="mi"&gt;108&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;; =&amp;gt; 6C&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note that this is also available in &lt;a href="https://docs.racket-lang.org/file/sha1b.html"&gt;file/sha1&lt;/a&gt; module (see &lt;code&gt;bytes-&amp;gt;hex-string&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;Once we get a raw string, we can use bytes to base64 converter from Python (&lt;code&gt;binascii.b2a_base64&lt;/code&gt;, see also this &lt;a href="https://out-of-cheese-error.netlify.com/cryptopals-set-1"&gt;blog post&lt;/a&gt;) or Racket (&lt;code&gt;base64-encode&lt;/code&gt; from &lt;a href="https://docs.racket-lang.org/net/base64.html"&gt;net/base64&lt;/a&gt;). How do conversion to base64 works in practice? Compared to Hex encoding, &lt;a href="https://en.wikipedia.org/wiki/Base64"&gt;Base64&lt;/a&gt; considers the following character set:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Based on the binary representation of the raw string, we will group all bits in block of 6 bits (because 2&lt;sup&gt;6&lt;/sup&gt; = 64, so that all characters above can be represented using only 6 bits), with 0-padding for the last block in case there are less than 6 bits left. Then, for each block we find the corresponding decimal value. Here is a more detailed &lt;a href="https://www.lifewire.com/base64-encoding-overview-1166412"&gt;overview&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The test (hex) string, grouped by byte, reads:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;49 27 6d 20 6b 69 6c 6c 69 6e 67
20 79 6f 75 72 20 62 72 61 69 6e
20 6c 69 6b 65 20 61 20 70 6f 69
73 6f 6e 6f 75 73 20 6d 75 73 68
72 6f 6f 6d
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;When translated to a raw string, we get &amp;ldquo;I&amp;rsquo;m killing your brain like a poisonous mushroom&amp;rdquo;. Now, to go from Hex to Base64, we just need an intermediate binary representation and apply the corresponding back transformation. Of course, if you have a Linux or Mac terminal, you can easily check the above result:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ echo &amp;quot;I'm killing your brain like a poisonous mushroom&amp;quot; | base64
SSdtIGtpbGxpbmcgeW91ciBicmFpbiBsaWtlIGEgcG9pc29ub3VzIG11c2hyb29tCg==
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here is a solution in Racket:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;require&lt;/span&gt; &lt;span class="n"&gt;file/sha1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;require&lt;/span&gt; &lt;span class="n"&gt;net/base64&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;base64-encode&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;hex-string-&amp;gt;bytes&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Micro posting in February</title><link>https://aliquote.org/post/micro-02-2020/</link><pubDate>Thu, 27 Feb 2020 10:23:15 +0100</pubDate><guid>https://aliquote.org/post/micro-02-2020/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-02-03&lt;/a&gt;: Just started watching The Handmaid&amp;rsquo;s Tale yesterday evening. Looks good so far.&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-02-03-21-09-40.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-03&lt;/a&gt;: &lt;a href="https://rakhim.org/2020/01/summary-of-transducers-a-talk-by-rich-hickey/"&gt;What are transducers?&lt;/a&gt; The basic idea is to extract the essence of map, filter and other functions that transform sequences and collections, and reuse this essence so that it can be applied elsewhere; to recast them as process transformations.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-04&lt;/a&gt;: &lt;a href="https://github.com/fullandfaithful/cardiogram"&gt;Cardiogram&lt;/a&gt;: A framework for impromptu testing in Common Lisp. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-06&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Understanding more about the structure of connections between biological neurons and regions of the brain is key for future understanding about ourselves, and consequently language and more intelligent artificial systems. &amp;mdash; &lt;a href="https://0x0f0f0f.github.io/posts/2020/02/on-mind-language-and-machines/"&gt;On Mind, Language and Machines&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-02-06&lt;/a&gt;: &lt;a href="https://alexpareto.com/scalability/systems/2020/02/03/scaling-100k.html"&gt;Scaling to 100k Users&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-07&lt;/a&gt;: A three-part series on A/B testing starting here: &lt;a href="https://chris-said.io/2020/01/10/optimizing-sample-sizes-in-ab-testing-part-I/"&gt;Optimizing sample sizes in A/B testing&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-07&lt;/a&gt;: TIL about &lt;code&gt;duti&lt;/code&gt; to &lt;a href="https://rud.is/b/2020/02/06/prying-r-script-files-away-from-xcode-et-al-on-macos/"&gt;manage default application&lt;/a&gt; for opening specific files.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-07&lt;/a&gt;: &lt;a href="http://www.ics.uci.edu/~epstein/PADS"&gt;A library of Python Algorithms&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-07&lt;/a&gt;: &lt;a href="https://eclecticlight.co/2020/02/07/how-long-does-your-mac-keep-its-log-for/"&gt;How long does your Mac keep its log for?&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-07&lt;/a&gt;: &lt;a href="https://www.evanmiller.org/slower-log-log.html"&gt;SlowerLogLog&lt;/a&gt;: It&amp;rsquo;s been a long time since I&amp;rsquo;ve read a new post from Evan Miller. Always a pleasure!&amp;gt; The name is intended to deter implementers from using SlowerLogLog in production, but ease of implementation (less than 100 lines of code in most languages) may make it a compelling time sink for bored programmers.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-10&lt;/a&gt;: If you are doing some financial math that does not need to be accurate to the penny, just use floating point numbers. If it is good enough for Excel, it will be good enough for most applications. &amp;mdash; &lt;a href="https://www.evanjones.ca/floating-point-money.html"&gt;You can use floating-point numbers for money&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-10&lt;/a&gt;: Trackers are everywhere! &lt;a href="https://blog.acolyer.org/2020/02/10/watching-you-watch/"&gt;Watching you watch: the tracking ecosystem of over-the-top TV streaming devices&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-10&lt;/a&gt;: &lt;a href="http://funcall.blogspot.com/2020/02/four-ways-to-use-macros.html"&gt;Four basic ways to use macros in Common Lisp&lt;/a&gt;: to circumvent the regular call-by-value semantics, to introduce new syntax to the language, to implement tiny languages within CL, and to run code in a special context. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-10&lt;/a&gt;: &lt;a href="https://nedbatchelder.com//blog/202002/sysgetsizeof_is_not_what_you_want.html"&gt;sys.getsizeof is not what you want&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-12&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Literate programming is all well and good for code written to appear in a book that the author hopes will be read for many years, but this is a tiny sliver of the source code ecosystem. The majority of code is never modified, once written, and does not hang around for very long; an investment is source code futures will make a loss unless the returns are spectacular. &amp;mdash; &lt;a href="http://shape-of-code.coding-guidelines.com/2020/02/07/source-code-has-a-brief-and-lonely-existence/"&gt;Source code has a brief and lonely existence&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-02-12&lt;/a&gt;: Emacs &lt;a href="https://github.com/hlissner/emacs-doom-themes/tree/screenshots"&gt;doom-themes&lt;/a&gt; with updated screenshots. Also: &lt;a href="https://zolmok.org/posts/emacs-org-mode-developers/"&gt;Emacs org-mode for DevelopersFeb. 8, 2020&lt;/a&gt; (via &lt;a href="https://sachachua.com/blog/2020/02/2020-02-10-emacs-news/"&gt;Sacha Chua&lt;/a&gt;) &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-12&lt;/a&gt;: &lt;a href="http://www.skeeve.com/awk-sys-prog.html"&gt;AWK As A Major Systems Programming Language&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-12&lt;/a&gt;: &lt;a href="https://danilafe.com/blog/09_compiler_garbage_collection/"&gt;Compiling a Functional Language Using C++, Part 9 - Garbage Collection&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-12&lt;/a&gt;: &lt;a href="https://distill.pub/2020/growing-ca/?/"&gt;Growing Neural Cellular Automata&lt;/a&gt;: Differentiable Model of Morphogenesis.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-13&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Reliable computer systems must handle malfunctioningcomponents that give conflicting information to different parts of the system. This situation can be expressed abstractly in terms of a group of generals of the Byzantine army camped with their troops around an enemy city. Communicatingonly by messenger, the generals must agree upon a common battle plan. However, one or more of them may be traitors who will try to confuse the others. The problem is to find an algorithm to ensure that the loyal generals will reach agreement. It is shown that, using only oral messages, this problem is solvable if and only if more than two-thirds of the generals are loyal; so a single traitor can confound two loyal generals. With unforgeable written messages, the problem is solvable for any number of generals and possible traitors. Applications of the solutions to reliable computer systems are then discussed. &amp;mdash; &lt;a href="http://lamport.azurewebsites.net/pubs/byz.pdf"&gt;The Byzantine Generals Problem&lt;/a&gt; (PDF)&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-02-13&lt;/a&gt;: I&amp;rsquo;ve been perusing Kristoffer Magnusson artwork when I was teaching inferential statistics, and here is a nice post on &lt;a href="https://rpsychologist.com/d3/likelihood/"&gt;understanding Maximum Likelihood&lt;/a&gt;.&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-02-13-15-05-54.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-13&lt;/a&gt;: &lt;a href="https://github.com/marcpaq/b1fipl"&gt;A Bestiary of Single-File Implementations of Programming Languages&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-13&lt;/a&gt;: &lt;a href="https://github.blog/2020-02-12-supercharge-your-command-line-experience-github-cli-is-now-in-beta/"&gt;GitHub CLI is now in beta&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-20&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I happily and enthusiastically paid for all that music. But now? Every time I see the $14.99 charge for our Apple Music family plan hit my checking account, I wince. I pay it begrudgingly because I feel like I have no other choice. &amp;mdash; &lt;a href="https://tyler.io/begrudgingly/"&gt;Begrudgingly&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Same for me. I prefer to use native app (Safari, Apple Mail, etc.) FWIW. However, I should note that the revamped iTunes app looks just weird.&lt;br&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-02-20&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;What’s under the hood is rarely what you expect. Our current tech stack is heavily optimized and a lot of optimizations are really just dirty tricks. &amp;mdash; &lt;a href="https://macwright.org/2020/02/14/math-keeps-changing.html"&gt;Math keeps changing&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-02-20&lt;/a&gt;: Fish-like &lt;a href="https://github.com/zsh-users/zsh-autosuggestions"&gt;autosuggestions for zsh&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-20&lt;/a&gt;: Must read: &lt;a href="https://martinheinz.dev/blog/16"&gt;Tour of Python Itertools&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-20&lt;/a&gt;: &lt;a href="https://www.cs.princeton.edu/courses/archive/spr09/cos333/beautiful.html"&gt;A Regular Expression Matcher&lt;/a&gt;.&amp;gt; Recursion is a win. This fundamental programming technique almost always leads to smaller, cleaner and more elegant code than the equivalent written with explicit loops, and that is the case here. The idea of peeling off one matching character from the front of the regular expression and from the text, then recursing for the rest, echoes the recursive structure of the traditional factorial or string length examples, but in a much more interesting and useful setting.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-20&lt;/a&gt;: &lt;a href="https://blurha.sh"&gt;BlurHash&lt;/a&gt; is a compact representation of a placeholder for an image.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-20&lt;/a&gt;: &lt;a href="https://brettterpstra.com/2020/02/18/enhanced-music-listening-on-macos/"&gt;Enhanced music listening on macOS&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-21&lt;/a&gt;: Evil motion (click to enlarge).&lt;a href="https://i.redd.it/l159bgcgw9h41.png"&gt;&lt;img src="https://i.redd.it/l159bgcgw9h41.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-21&lt;/a&gt;: The Racket engine has finally been &lt;a href="https://blog.racket-lang.org/2020/02/racket-on-chez-status.html"&gt;ported&lt;/a&gt; to Chez Scheme. Note that bytecode vs. machine code may impact memory use. &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-21&lt;/a&gt;: &lt;a href="https://seeing-theory.brown.edu"&gt;Seeing Theory&lt;/a&gt;.&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-02-21-11-23-04.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-21&lt;/a&gt;: &lt;a href="https://clojure.org/news/2020/02/20/state-of-clojure-2020"&gt;State of Clojure 2020&lt;/a&gt;. Emacs, Leiningen and MacOS are first class citizens there. &lt;code&gt;#clojure&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-21&lt;/a&gt;: &lt;a href="https://github.com/ericchiang/pup"&gt;pup&lt;/a&gt;: Parsing HTML at the command line.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-24&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Honestly, I only today learned that library has arguments (exclude and include.only) for managing the objects that are attached. &amp;mdash; &lt;a href="https://www.travishinkelman.com/post/avoiding-namespace-pollution-in-r-and-chez-scheme/"&gt;Avoiding namespace pollution in R and Chez Scheme&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So do I apparently.&lt;br&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-02-24&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;That may sound insane, but one of the things that made the Mac initially puzzling to people who were heavy users of PCs and mainframes back in the mid-80s was that it flipped verb/object around. I remember having to explain to several people that the main thing to remember on a Mac was that you never go to the menu bar for a command until you’ve selected the thing that the command would act on. &amp;mdash; &lt;a href="https://leancrew.com/all-this/2020/02/larry-tesler/"&gt;Larry Tesler&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-02-24&lt;/a&gt;: A &lt;a href="https://github.com/tonsky/grumpy"&gt;Minimalistic blog engine&lt;/a&gt;. Associated &lt;a href="https://tonsky.me/blog/utils/"&gt;blog post&lt;/a&gt; by Nikita Tonsky.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-24&lt;/a&gt;: &lt;a href="https://blog.stata.com/2020/02/24/bayesian-inference-using-multiple-markov-chains/"&gt;Bayesian inference using multiple Markov chains&lt;/a&gt;. &lt;code&gt;#stata&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-24&lt;/a&gt;: &lt;a href="https://nedbatchelder.com//blog/202002/getting_started_testing_with_pytest.html"&gt;Getting Started Testing: pytest edition&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-24&lt;/a&gt;: &lt;a href="http://glench.com/LegibleMathematics/"&gt;Legible Mathematics&lt;/a&gt;: Sketches of an interactive arithmetic for programming.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-24&lt;/a&gt;: &lt;a href="https://www.neilwithdata.com/mathematics-self-learner"&gt;Mathematics for the adventurous self-learner&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-24&lt;/a&gt;: &lt;a href="https://www.johndcook.com/blog/2020/02/21/popcount/"&gt;Popcount: counting 1’s in a bit stream&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-25&lt;/a&gt;: &lt;a href="http://thinkingwithtype.com/letter/"&gt;A visual overview of typography&lt;/a&gt; (via HN).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-25&lt;/a&gt;: &lt;a href="https://github.com/jostmey/dkm"&gt;Dynamic Kernel Matching&lt;/a&gt; is analogous to a convolutional network, but for sequences.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;DKM is analogous to a convolutional network, but for sequences. Consider the problem of classifying a sequence. Because some sequences are longer than others, the number of features is irregular. Given a specific sequence, the challenge is to determine the appropriate permutation of features with weights, allowing us to run the features through the statistical classifier to generate a prediction.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-02-25&lt;/a&gt;: &lt;a href="https://www.cs.cornell.edu/courses/cs3110/2020sp/textbook/"&gt;Functional Programming in OCaml&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-25&lt;/a&gt;: &lt;a href="http://davis.vilums.me/all-the-streets/"&gt;Lovely&lt;/a&gt;.&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-02-25-13-57-08.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-25&lt;/a&gt;: &lt;a href="https://arxiv.org/abs/2002.04803"&gt;Machine Learning in Python: Main developments and technology trends in data science, machine learning, and artificial intelligence&lt;/a&gt;. &lt;code&gt;#arxiv&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-25&lt;/a&gt;: &lt;a href="https://mjtsai.com/blog/2020/02/24/restoring-the-mac-startup-chime/"&gt;Restoring the Mac Startup Chime&lt;/a&gt;. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-25&lt;/a&gt;: &lt;blockquote class="twitter-tweet"&gt;&lt;p lang="en" dir="ltr"&gt;One related tip for &lt;a href="https://twitter.com/hashtag/Emacs?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#Emacs&lt;/a&gt; folks: Tons of refcards are already on your machine. Locate them with:&lt;br&gt;M-x locate &amp;lt;RET&amp;gt; refcard &amp;lt;RET&amp;gt;&lt;br&gt;&lt;br&gt;I use the Dired refcard very often. &lt;a href="https://t.co/9q8LVAN1cu"&gt;https://t.co/9q8LVAN1cu&lt;/a&gt; &lt;a href="https://t.co/0YX1oXw74h"&gt;pic.twitter.com/0YX1oXw74h&lt;/a&gt;&lt;/p&gt;&amp;mdash; Vedang (fosstodon.org/@vedang) (@vedang) &lt;a href="https://twitter.com/vedang/status/1230780349870792705?ref_src=twsrc%5Etfw"&gt;February 21, 2020&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async src="https://platform.twitter.com/widgets.js" charset="utf-8"&gt;&lt;/script&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-26&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Emacs being a Lisp interpreter, however, ensures that you have access to everything. In a way, it&amp;rsquo;s the realization of the promise of Unix itself: it endows normal users with ultimate control over their environment. &amp;mdash; &lt;a href="https://opensource.com/article/20/2/who-cares-about-emacs"&gt;Who cares about Emacs?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-02-26&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In its almost 22 years of existence, kottke.org has never gotten big, but it’s also never gone away, predating &amp;amp; outlasting many excellent and dearly missed sites like Grantland, Rookie, The Toast, The Awl, Gawker, and hundreds of others. &amp;mdash; &lt;a href="https://kottke.org/20/02/the-15th-anniversary-of-doing-kottkeorg-as-a-full-time-job"&gt;The 15th Anniversary of Doing Kottke.org as a Full-Time Job&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-02-26&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;This is terribly wrong. Everything the Finder displays should be correct all the time. If, for some technical reason, it doesn’t know the size of something and needs to wait, it should show a spinner or some other indicator that you, the user, need to wait to get the information. The actual file size of a folder is what you want to see, and ideally you should see it as soon as you ask for it. &amp;mdash; &lt;a href="https://daringfireball.net/2020/02/what_you_see_in_the_finder_should_be_correct"&gt;What You See in the Finder Should Always Be Correct&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-02-26&lt;/a&gt;: Apprently, &lt;a href="https://macromates.com"&gt;Textmate&lt;/a&gt; has finally been updated to v2 (without RC suffix)!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-26&lt;/a&gt;: &lt;a href="https://jakemccrary.com/blog/2020/02/25/auto-syncing-a-git-repository/"&gt;Auto-syncing a git repository&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-26&lt;/a&gt;: &lt;a href="http://mbork.pl/2020-02-24_Some_psql_tips"&gt;Some psql tips&lt;/a&gt;. See also Thorsten Ball&amp;rsquo;s own &lt;a href="https://github.com/mrnugget/dotfiles"&gt;config&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-26&lt;/a&gt;: &lt;a href="https://github.com/liamg/shox"&gt;shox&lt;/a&gt;: A customisable, universally compatible terminal status bar. Looks nice although I&amp;rsquo;m quite happy with iTerm2 own status bar at the moment.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-27&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;One of my favorite hobby horses is the need to keep control of your data. Broadly that means keeping it in open formats and on computers that you manage. If you’re committing your only copy of valuable data to some cloud service, you’re acting recklessly and are likely to suffer the consequences. &amp;mdash; &lt;a href="https://irreal.org/blog/?p=8685"&gt;Even Google Employees Are Trying to Escape&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-02-27&lt;/a&gt;: Nice &lt;a href="https://kieranhealy.org/blog/archives/2020/02/26/a-new-baby-boom-poster/"&gt;artwork&lt;/a&gt; using ggplot by Kieran Healy. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-27&lt;/a&gt;: &lt;a href="https://lemire.me/blog/2020/02/26/fast-divisionless-computation-of-binomial-coefficients/"&gt;Fast divisionless computation of binomial coefficients&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-02-27&lt;/a&gt;: &lt;a href="http://theorangeduck.com/page/machine-learning-kolmogorov-complexity-squishy-bunnies"&gt;Machine Learning, Kolmogorov Complexity, and Squishy Bunnies&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;</description></item><item><title>Org exports</title><link>https://aliquote.org/post/org-workflow/</link><pubDate>Sun, 23 Feb 2020 19:48:32 +0100</pubDate><guid>https://aliquote.org/post/org-workflow/</guid><description>&lt;p&gt;Each time I check my RSS feeds, I come across some nice posts about how folks are using Emacs together with Org mode. I have a dozen of channels that are mostly around Emacs (e.g., Irreal or Sacha Chua), so this comes to no surprise after all. I&amp;rsquo;m not an heavy user of Org agenda, but this is just because I&amp;rsquo;m no strong planner. And I have almost no deadline nowadays. However, I&amp;rsquo;ve come to appreciate writing using Org mode, better than Markdown for text documents larger than, say, blog posts.&lt;/p&gt;
&lt;p&gt;Some of my previous posts were about &lt;a href="https://aliquote.org/post/org-blogging/"&gt;blogging&lt;/a&gt;, managing &lt;a href="https://aliquote.org/post/org-and-bibtex/"&gt;Bibtex records&lt;/a&gt;, but this one is more like &lt;a href="https://aliquote.org/post/notes-taking-workflow/"&gt;A text-based workflow for taking note&lt;/a&gt;. After two years of using Org mode, here is what&amp;rsquo;s left: I use Org mode to manage a simple TODO list, a log book, a multi-language notebook for running quick stuff with Babel, an annotated list of Bibtex records, and to write small tutorials or reports.&lt;/p&gt;
&lt;p&gt;Regarding the Org markup itself, I find it more coherent and definitely more robust &amp;mdash; think of nested item lists, line breaks or image insertion in a list.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; Once rendered into Emacs, it&amp;rsquo;s no longer apparent that we are dealing with a markup language. Look and see how beautiful Org document are with little customization (basically, the ones that come with &lt;a href="https://github.com/hlissner/doom-emacs"&gt;Doom Emacs&lt;/a&gt;):&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2020-02-22-20-06-31.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Of course, Markdown mode for Emacs also comes with kind of a &amp;ldquo;concealing&amp;rdquo; featuring (which works better than in Vim sometimes), but there&amp;rsquo;s no comparison when it comes to managing links and images, or even to navigate between headers, IMHO. Furthermore, now that Github renders Org documents like it did for years with Markdown files, we also have a nice way to display our raw files online. But there&amp;rsquo;s more. Indeed, one of the nicest feature of Emacs + Org is the possibility of using Pandoc as a front-end for exporting Org documents. I first started using default HTML export, but I soon came to realize that using Pandoc provides far better rendering options. Below is the same document exported as an HTML page using a custom &lt;a href="https://github.com/tajmone/pandoc-goodies/tree/master/templates/html5/github"&gt;Github-like&lt;/a&gt; CSS:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2020-02-24-10-46-16.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Here is what I have in my Emacs init file:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-emacs-lisp" data-lang="emacs-lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;setq&lt;/span&gt; &lt;span class="nv"&gt;org-export-with-author&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;org-export-with-creator&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;org-html-postamble&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;org-html-head&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;&amp;lt;link rel=\&amp;#34;stylesheet\&amp;#34; type=\&amp;#34;text/css\&amp;#34; href=\&amp;#34;_assets/github.css\&amp;#34; /&amp;gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;org-latex-pdf-process&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;latexmk -pdf -f -outdir=%o %f&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;org-pandoc-options-for-html5&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nv"&gt;section-divs&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="no"&gt;t&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;bibliography&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;/Users/chl/org/references.bib&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;;; https://is.gd/lt21EQ&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;template&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;/Users/chl/.pandoc/templates/GitHub.html5&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Nothing really fancy, but this is useful to keep Org header simple enough. I could probably use some kind of template since I always use the same options, but I have a little (ya)snippet that insert everything for me:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-
# name: Header block for HTML tutor
# key: tutor
# condition: t
# --
# -*- ispell-dictionary: &amp;quot;french&amp;quot; -*-
#+TITLE: ${1:The title}
#+LANG: fr
#+STARTUP: align fold noindent hideblocks fnlocal
#+OPTIONS: H:3 num:nil toc:2 ':t *:t ::t f:t |:t -:t
$0
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It is also possible to specify Pandoc options directly in the header, e.g.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#+TITLE: ${1:The title}
#+DATE: `(insert (format-time-string &amp;quot;%d %B, %Y&amp;quot;))`
#+OPTIONS: num:nil H:2 ^:t |:t
#+PANDOC_OPTIONS: template:nil
#+PANDOC_OPTIONS: number-sections:t
#+PANDOC_OPTIONS: csl:~/.pandoc/csl/pnas.csl
#+ABSTRACT: $2
$0
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The Github template that I use works pretty well for HTML, while for PDF output I rely on the &lt;a href="https://github.com/Wandmalfarbe/pandoc-latex-template"&gt;Eisvogel&lt;/a&gt; template. But most importantly, using Pandoc means that I can insert Bibtex reference the Markdown way, e.g. &lt;code&gt;@blah2011&lt;/code&gt; or &lt;code&gt;[@blah2011]&lt;/code&gt;, and I no longer have to rely on &lt;a href="https://aliquote.org/post/org-and-bibtex/"&gt;ox-bibtex&lt;/a&gt;, which is what I was using when writing my &lt;a href="https://aliquote.org/articles/stata-sk/"&gt;Stata Starter Kit&lt;/a&gt; (unfinished for a long time). In sum, whether I use Markdown or Org, I can manage my Bibtex entries in the same way. And since this is Org, we can also add a &amp;ldquo;TODO list&amp;rdquo; at the top of the document and add a &lt;code&gt;:noexport:&lt;/code&gt; tag so it won&amp;rsquo;t be printed in the final output.&lt;/p&gt;
&lt;p&gt;In recent version of Doom Emacs, the centralization of Org exports has been &lt;a href="https://github.com/hlissner/doom-emacs/commit/92e8521e9050847ccdc1c2194072a88ca7dfa05f"&gt;removed&lt;/a&gt;. I found it nice that everything is stored under a masked directory (&lt;code&gt;.export/&lt;/code&gt;) in the Org root directory, but I can understand that this became quite difficult to maintain this feature with the growing number of exporters.&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;I know the lack of standardization of Markdown (or its many flavors like GFM or Multimarkdown) makes it pretty hard to parse and validate by a machine.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>February in review (2)</title><link>https://aliquote.org/post/micro-review-009/</link><pubDate>Fri, 21 Feb 2020 07:58:37 +0100</pubDate><guid>https://aliquote.org/post/micro-review-009/</guid><description>&lt;p&gt;Here is a second review for &lt;a href="https://aliquote.org/post/micro-review-008/"&gt;February&lt;/a&gt;. I have accumulated quite a bit of bookmarks in Safari, so let&amp;rsquo;s get them sorted out.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;It&amp;rsquo;s not just the compilers. Clojure is nice in its way, but it lacks some essentials of Lisp programming. For a while now I&amp;rsquo;ve been wishing for a Clojure implementation that is a proper Lisp&amp;ndash;one that restores what Clojure has lost. One that has, as I wrote elsewhere, Lisp&amp;rsquo;s flesh and bones. &lt;a href="https://news.ycombinator.com/item?id=22326853"&gt;Clojure in Common Lisp&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://compstat-lmu.github.io/lecture_i2ml/index.html"&gt;Introduction to Machine Learning (I2ML)&lt;/a&gt; is a self-contained textbook on basic principles of supervised methods in large scale statistical inference. There are many such textbooks around the internet. This one comes with Youtube videos, PDF slides and RMarkdown notebooks. It covers regression and classification problems, as well as nested cross-validation or bagging approaches, so it should provide the reader with a compelling overview of advanced techniques in Machine Learning. Shai Carmi recently released a lot of &lt;a href="https://scarmilab.org/talks-teaching-materials/"&gt;teaching materials&lt;/a&gt; (lot of Powerpoint slides unfortunately), mostly related to statistical genetics. Feel free to take a look if you are interested in genomics, population genetics or ML techniques.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In &lt;a href="https://blog.jethro.dev/posts/org_mode_workflow_preview/"&gt;Org-mode Workflow: A Preview&lt;/a&gt;, Jethro Kuan explains how he is using Org-mode (especially org-agenda) and deft to manage his daily activities. Note that this is a multipart series.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;At the time of writing, I have completed 3478 todo items, and written over 29000 lines in my personal knowledge base.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://statsthinking21.org"&gt;Statistical Thinking for the 21st Century&lt;/a&gt;, by Russell A. Poldrack is a really nice textbook on statistical inference and the R statistical package. In a recent article, Cox and Efron, two of the most eminent statisticians of the last decades, also discuss what could possibly be &lt;a href="https://advances.sciencemag.org/content/3/6/e1700768.full"&gt;statistical thinking for 21st century scientists&lt;/a&gt;. The take home message is that it is important to acknowledge the importance of uncertainity and variability of statistical estimates and of &lt;em&gt;direct&lt;/em&gt; vs. &lt;em&gt;indirect&lt;/em&gt; evidence in statistical research.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;It is the job of theoretical statisticians both to be alive to the challenges of specific applications and, at the same time, to develop methods and concepts that, with good fortune, will be broadly applicable.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;After 15 years of using R, I may finally forget about this infamous &lt;a href="https://developer.r-project.org/Blog/public/2020/02/16/stringsasfactors/"&gt;&lt;code&gt;stringAsFactors&lt;/code&gt; option&lt;/a&gt; that causes more trouble than anything else when you&amp;rsquo;re not working with data from designed experiments.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;Statistical Rethinking&lt;/em&gt; has been ported to &lt;a href="https://github.com/ksachdeva/rethinking-tensorflow-probability"&gt;TensorFlow&lt;/a&gt; recently. There&amp;rsquo;s also &lt;a href="https://bookdown.org/connect/#/apps/3686/access"&gt;Doing Bayesian Data Analysis in brms and the tidyverse&lt;/a&gt; which just reached version 0.1 (&lt;a href="https://github.com/ASKurz/Doing-Bayesian-Data-Analysis-in-brms-and-the-tidyverse"&gt;Github&lt;/a&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I&amp;rsquo;ve been quite happy withw writing text or code in Emacs for the past few months. Doom Emacs comes with good customizations for LSP mode now, and Flycheck has a lot of checkers for plain text, including &lt;a href="http://proselint.com"&gt;proselint&lt;/a&gt; and &lt;a href="https://textlint.github.io"&gt;textlint&lt;/a&gt; (I tried the later for a few days, but it definitely has too many third-party plugins to configure). Now, I learned that there&amp;rsquo;s also &lt;a href="https://github.com/zzkt/smog"&gt;smog&lt;/a&gt;, if you want to get a summary of writing style, word use and readability.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://aliquote.org/img/2020-02-21-10-47-49.png" alt="emacs"&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;When these are not full-featured &lt;a href="https://lexi-lambda.github.io"&gt;blog posts&lt;/a&gt;, you get full-featured Gist instead. If you are interested in Alexis King&amp;rsquo;s work, go check &lt;a href="https://gist.github.com/lexi-lambda/d97b8187a9b63619af29689e9fa1b880"&gt;Continuations and reduction semantics&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I&amp;rsquo;ve been using circular statistics during my PhD, but I would not have bet on porting them to regression trees. Achim Zeileis and coll. did it first : &lt;a href="https://eeecon.uibk.ac.at/~zeileis/news/circtree/"&gt;Circular regression trees and forests&lt;/a&gt;. This is now available as part (or an addon) of their &lt;a href="https://cran.r-project.org/web/packages/partykit/index.html"&gt;Toolkit for Recursive Partytioning&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Finally, here is another good article on &lt;a href="http://lisp-univ-etc.blogspot.com/2020/02/programming-algorithms-compression.html?m=1"&gt;compression&lt;/a&gt;, in Lisp, by Vsevolod Dyomkin.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>The unquantified self #12</title><link>https://aliquote.org/post/unquantified-self-012/</link><pubDate>Thu, 20 Feb 2020 18:00:01 +0100</pubDate><guid>https://aliquote.org/post/unquantified-self-012/</guid><description>&lt;p&gt;The previous entry in this series of posts dates back to &lt;a href="https://aliquote.org/post/unquantified-self-011"&gt;October&lt;/a&gt; 2019. Long time no see, then. Or probably that I didn&amp;rsquo;t have much to say and that I preferred to stay focused on current work and free time. Compared to the very first posts, I must admit that I&amp;rsquo;m in better mood or shape, depending on the point of view. I&amp;rsquo;m keeping my eyes open, though, who knows?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Cela ira&lt;br&gt;
Je n&amp;rsquo;ai pas peur du noir&lt;br&gt;
Et puis il n&amp;rsquo;y a pas de vautours&lt;br&gt;
Dans les étoiles&lt;br&gt;
&amp;mdash; Alicia Gallienne, L&amp;rsquo;autre moitié du songe m&amp;rsquo;appartient&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I have not much to say about work days: They are just work days. Nothing too boring nothing too exciting. I&amp;rsquo;m okay with that. I try to spend a little time on this blog with new stuff, mostly unrelated to my current professional duties. It&amp;rsquo;s important to keep active when you change your research topic completely, but it&amp;rsquo;s still hard to find good common ground. I decided to focus on mathematics and scientific computing. Let&amp;rsquo;s see how this works for the next few months. Regarding technical computing, I&amp;rsquo;m a bit afraid of Apple&amp;rsquo;s OSs for the future. I&amp;rsquo;m still on my Macbook 12″, which I really like, but I may switch to Linux soon or later as the next release of macOS doesn&amp;rsquo;t look like the right move to me (and &lt;a href="http://morrick.me/archives/8599"&gt;others&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;I often find myself spending my evenings looking back in the past, but that&amp;rsquo;s easy to sort out, finally. I keep watching movies and TV shows almost every day. Recently, I watched &lt;a href="https://www.imdb.com/title/tt8772296/"&gt;Euphoria&lt;/a&gt; (Season 1), &lt;a href="https://www.imdb.com/title/tt1898069/"&gt;American Gods&lt;/a&gt; (Season 1), &lt;a href="https://www.imdb.com/title/tt7016936/"&gt;Killing Eve&lt;/a&gt; (Seasons 1 and 2), &lt;a href="https://www.imdb.com/title/tt2741602/"&gt;The Rook&lt;/a&gt; (Season 1). With my son, we are into Season 4 of &lt;a href="https://www.imdb.com/title/tt2741602/"&gt;Black List&lt;/a&gt;, and still enjoying it a lot.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2020-02-21-09-39-11.png"&gt;
&lt;/figure&gt;
&lt;p&gt;I&amp;rsquo;ve read a lot more &lt;a href="https://aliquote.org/files/books.txt"&gt;books&lt;/a&gt; recently too, mostly novels and short stories, and a bit of poetry. It&amp;rsquo;s restful, to say the least. I wish I could read a lot more, but I am often too tired at night. And it&amp;rsquo;s not like I don&amp;rsquo;t have the time: if not today, it will be tomorrow as I&amp;rsquo;ve been telling myself for the past two years. Also I finally took the time to sort through most of my books in my libraries.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/60271421423__06F42BCE-7E97-4951-85F8-B408E85B1877.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/60271421423__06F42BCE-7E97-4951-85F8-B408E85B1877.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Finally, an old friend of mine keep sending nice pics of trees. Thank you so much!&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_4240.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_4240.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_4247.JPG" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_4247.JPG"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0701.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0701.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</description></item><item><title>Latexing in the 21st century</title><link>https://aliquote.org/post/latex-beamer-21-century/</link><pubDate>Thu, 13 Feb 2020 10:07:42 +0100</pubDate><guid>https://aliquote.org/post/latex-beamer-21-century/</guid><description>&lt;p&gt;What about $\LaTeX$ nowadays? I haven&amp;rsquo;t written a single TeX document since 4 years or so, and even when I was delivering statistical reports every month or so, I relied mostly on RMarkdown whenever possible. When I needed to switch to Latex-based solution (knitr or Sweave), this was mainly because of a high load of tabular outputs or because I needed some fine tuning regarding figure placement. Along the years, I started replacing the standard &amp;ldquo;tex $\rightarrow$ dvi $\rightarrow$ ps $\rightarrow$ pdf&amp;rdquo; workflow with &lt;code&gt;pdflatex&lt;/code&gt;, then &lt;code&gt;xelatex&lt;/code&gt; to get unicode support and nice fonts, and finally &lt;code&gt;lualatex&lt;/code&gt;. I had my moments where I was using exclusively &lt;a href="http://www.pragma-ade.com"&gt;Context&lt;/a&gt;, but it was tricky to do litterate programming with R or Stata in this environment. In the mean time, I also happened to write small documents using plain TeX, because you know: $\LaTeX$ is just for kids, we could just be fine using Context or TeX.&lt;/p&gt;
&lt;p&gt;Now that we have luatex, I realize that we could perfectly write a plain TeX document using our preferred font at zero cost. Consider the following snippet of teX:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-latex" data-lang="latex"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\ifdefined\directlua&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;\input&lt;/span&gt; luaotfload.sty
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\font\tenrm&lt;/span&gt;=&amp;#34;Alegreya&amp;#34; at 10pt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\tenrm&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\parindent&lt;/span&gt; 0pt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;The foundations of the rigorous study of &lt;span class="nb"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\it&lt;/span&gt; analysis&lt;span class="nb"&gt;}&lt;/span&gt; were laid in the nineteenth century, notably by the mathematicians Cauchy and Weierstrass. Central to the study of this subject are the formal definitions of &lt;span class="nb"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\it&lt;/span&gt; limits&lt;span class="nb"&gt;}&lt;/span&gt; and &lt;span class="nb"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\it&lt;/span&gt; continuity&lt;span class="nb"&gt;}&lt;/span&gt;.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Let &lt;span class="s"&gt;$&lt;/span&gt;&lt;span class="nb"&gt;D&lt;/span&gt;&lt;span class="s"&gt;$&lt;/span&gt; be a subset of &lt;span class="s"&gt;$&lt;/span&gt;&lt;span class="nv"&gt;\bf&lt;/span&gt;&lt;span class="nb"&gt; R&lt;/span&gt;&lt;span class="s"&gt;$&lt;/span&gt; and let &lt;span class="s"&gt;$&lt;/span&gt;&lt;span class="nb"&gt;f &lt;/span&gt;&lt;span class="nv"&gt;\colon&lt;/span&gt;&lt;span class="nb"&gt; D &lt;/span&gt;&lt;span class="nv"&gt;\to&lt;/span&gt;&lt;span class="nb"&gt; {&lt;/span&gt;&lt;span class="nv"&gt;\bf&lt;/span&gt;&lt;span class="nb"&gt; R}&lt;/span&gt;&lt;span class="s"&gt;$&lt;/span&gt; be a real-valued function on &lt;span class="s"&gt;$&lt;/span&gt;&lt;span class="nb"&gt;D&lt;/span&gt;&lt;span class="s"&gt;$&lt;/span&gt;. The function &lt;span class="s"&gt;$&lt;/span&gt;&lt;span class="nb"&gt;f&lt;/span&gt;&lt;span class="s"&gt;$&lt;/span&gt; is said to be &lt;span class="nb"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\it&lt;/span&gt; continuous&lt;span class="nb"&gt;}&lt;/span&gt; on &lt;span class="s"&gt;$&lt;/span&gt;&lt;span class="nb"&gt;D&lt;/span&gt;&lt;span class="s"&gt;$&lt;/span&gt; if, for all &lt;span class="s"&gt;$&lt;/span&gt;&lt;span class="nv"&gt;\epsilon&lt;/span&gt;&lt;span class="nb"&gt; &amp;gt; &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="s"&gt;$&lt;/span&gt; and for all &lt;span class="s"&gt;$&lt;/span&gt;&lt;span class="nb"&gt;x &lt;/span&gt;&lt;span class="nv"&gt;\in&lt;/span&gt;&lt;span class="nb"&gt; D&lt;/span&gt;&lt;span class="s"&gt;$&lt;/span&gt;, there exists some &lt;span class="s"&gt;$&lt;/span&gt;&lt;span class="nv"&gt;\delta&lt;/span&gt;&lt;span class="nb"&gt; &amp;gt; &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="s"&gt;$&lt;/span&gt; (which may depend on &lt;span class="s"&gt;$&lt;/span&gt;&lt;span class="nb"&gt;x&lt;/span&gt;&lt;span class="s"&gt;$&lt;/span&gt;) such that if &lt;span class="s"&gt;$&lt;/span&gt;&lt;span class="nb"&gt;y &lt;/span&gt;&lt;span class="nv"&gt;\in&lt;/span&gt;&lt;span class="nb"&gt; D&lt;/span&gt;&lt;span class="s"&gt;$&lt;/span&gt; satisfies &lt;span class="sb"&gt;$$&lt;/span&gt;&lt;span class="nb"&gt;|y &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nb"&gt; x| &amp;lt; &lt;/span&gt;&lt;span class="nv"&gt;\delta&lt;/span&gt;&lt;span class="s"&gt;$$&lt;/span&gt; then &lt;span class="sb"&gt;$$&lt;/span&gt;&lt;span class="nb"&gt;|f&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;y&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="nb"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nb"&gt; f&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;x&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="nb"&gt;| &amp;lt; &lt;/span&gt;&lt;span class="nv"&gt;\epsilon&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;&lt;span class="s"&gt;$$&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;One may readily verify that if &lt;span class="s"&gt;$&lt;/span&gt;&lt;span class="nb"&gt;f&lt;/span&gt;&lt;span class="s"&gt;$&lt;/span&gt; and &lt;span class="s"&gt;$&lt;/span&gt;&lt;span class="nb"&gt;g&lt;/span&gt;&lt;span class="s"&gt;$&lt;/span&gt; are continuous functions on &lt;span class="s"&gt;$&lt;/span&gt;&lt;span class="nb"&gt;D&lt;/span&gt;&lt;span class="s"&gt;$&lt;/span&gt; then the functions &lt;span class="s"&gt;$&lt;/span&gt;&lt;span class="nb"&gt;f&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nb"&gt;g&lt;/span&gt;&lt;span class="s"&gt;$&lt;/span&gt;, &lt;span class="s"&gt;$&lt;/span&gt;&lt;span class="nb"&gt;f&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nb"&gt;g&lt;/span&gt;&lt;span class="s"&gt;$&lt;/span&gt; and &lt;span class="s"&gt;$&lt;/span&gt;&lt;span class="nb"&gt;f&lt;/span&gt;&lt;span class="nv"&gt;\cdot&lt;/span&gt;&lt;span class="nb"&gt; g&lt;/span&gt;&lt;span class="s"&gt;$&lt;/span&gt; are continuous. If in addition &lt;span class="s"&gt;$&lt;/span&gt;&lt;span class="nb"&gt;g&lt;/span&gt;&lt;span class="s"&gt;$&lt;/span&gt; is everywhere non-zero then &lt;span class="s"&gt;$&lt;/span&gt;&lt;span class="nb"&gt;f&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nb"&gt;g&lt;/span&gt;&lt;span class="s"&gt;$&lt;/span&gt; is continuous.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Below is the result when compiled with &lt;code&gt;luatex&lt;/code&gt;:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2020-02-13-10-24-48.png"&gt;
&lt;/figure&gt;
&lt;p&gt;This is not just to use nice looking fonts. Unicode support also enables the use of accented letters (which are quite useful in French or German) and instead of &lt;code&gt;\'e&lt;/code&gt; we can now simply write &lt;code&gt;é&lt;/code&gt; as we would do in a Latex document. Yet, we are missing lot of goodies in plain TeX, like verbatim, Figure or Table environments, but it is not too hard to find useful macros that do the job well. If you haven&amp;rsquo;t read &lt;a href="https://www.gnu.org/software/teximpatient/"&gt;TeX for the Impatient&lt;/a&gt; (available in English and in French), go check the code in your TeX distribution.&lt;/p&gt;
&lt;p&gt;Next, what about Latex presentations? For as long as I remember, I never liked the default Beamer theme &amp;mdash; you know this one with header and footer banners all in royal blue, which everyone was bringing to each conference back in the 2010s. Yet, customizing Beamer could be tricky at that time. Hopefully, we got new themes, until the last one which came to replace the default blueish one: Metropolis (originally &lt;a href="https://github.com/matze/mtheme"&gt;mtheme&lt;/a&gt;). Then, Beamers&amp;rsquo; start using it, and this was the new de facto standard in the slideshow industry. I ended up using either Context when writing slides for conferences or courses, or custom Beamer templates, but it sucked at some point. I stopped giving lectures some years ago, but during my last year of teaching, I decided to start from scratch with Beamer. You know &lt;a href="https://hartwork.org/beamer-theme-matrix/"&gt;which theme&lt;/a&gt; is best? The minimal one: no header or footer, no sidebar or navigation buttons whatsoever, no fancy title/subtitle or bullet points. Here is what I ended with:&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2020-02-13-14-31-36.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2020-02-13-14-31-36.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2020-02-13-14-31-46.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2020-02-13-14-31-46.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2020-02-13-14-32-06.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2020-02-13-14-32-06.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Nothing fancy, but a nice looking sans serif font (Fira), with a condensed variant for quotation, neutral color, and figures displayed on full slide. The full set of slides is available on &lt;a href="https://github.com/even4void/rstats-ssample"&gt;Github&lt;/a&gt; in case you are interested, but here is the gist of the Beamer configuration. First, I wrote the slides using Markdown, and let Pandoc process the text file using &lt;code&gt;xelatex&lt;/code&gt; and a custom YAML header. I am always using a Makefile because I tend to forget how I compile my documents, so here it is:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;TARGET := $(patsubst %.md,%.pdf,$(wildcard *.md))
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.PHONY: all clean
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;all: $(TARGET)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;%.pdf : %.md
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; pandoc -s --pdf-engine=xelatex --filter pandoc-citeproc --listings -t beamer $^ header.yaml -o $@
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;clean:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; rm -f $(TARGET)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The YAML header itself provides very basic customization, like fonts, colors and bibliography, and the remaining of the custom theme happens in a TeX file, where I removed everything I found too visually heavy in the default themes. Again, see the Github repository to see how I did. Anyway, this was a really great exercise at that time, since I got a working slideshow with minimal friction during the writing stage: writing in Markdown is still a lot faster. The harder part was to write the custom template. But this has always been the case. The only advantage, now, is that it is much easier to use any font available on our OS.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2020-02-13-14-54-15.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2020-02-13-14-54-15.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2020-02-13-14-54-35.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2020-02-13-14-54-35.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2020-02-13-14-54-45.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2020-02-13-14-54-45.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</description></item><item><title>February in review</title><link>https://aliquote.org/post/micro-review-008/</link><pubDate>Wed, 12 Feb 2020 14:46:04 +0100</pubDate><guid>https://aliquote.org/post/micro-review-008/</guid><description>&lt;p&gt;Here are some of the interesting links I found while browsing the interweb lately.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="http://cazencott.info"&gt;Chloé-Agathe Azencott&lt;/a&gt; released the second edition of her textbook on Machine Learning (in French): &lt;a href="http://cazencott.info/dotclear/public/lectures/IntroML_Azencott.pdf"&gt;Introduction au Machine Learning&lt;/a&gt; (PDF, 180 pp.). I went through the book quickly, but I plan to come back to it later. With &lt;a href="https://www.math.univ-toulouse.fr/~besse/"&gt;Philippe Besse&lt;/a&gt;&amp;rsquo;s books, I think they are the only books I have read in French on machine learning &amp;mdash; and it&amp;rsquo;s quite relaxing actually.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.vidarholen.net/contents/blog/?p=859"&gt;Lessons learned from writing ShellCheck, GitHub’s now most starred Haskell project&lt;/a&gt;. Interesting blog post on ShellCheck, &amp;ldquo;a shell script linter, (that) actually started life in 2012 as an IRC bot (of all things!) on #bash@Freenode.&amp;rdquo; This is what I use in Emacs for shell script since &lt;a href="https://www.flycheck.org/en/latest/languages.html"&gt;Flycheck&lt;/a&gt; fully supports it. I didn&amp;rsquo;t know ShellCheck was written in Haskell, though. The author notices that Haskell has an undeniably high barrier to entry for the uninitiated, and ShellCheck’s target audience is not Haskell developers; and that the Haskell ecosystem moves and breaks very quickly. New changes would frequently break on older platform versions.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://white.ucc.asn.au/2020/02/09/whycompositionaljulia.html"&gt;JuliaLang: The Ingredients for a Composable Programming Language&lt;/a&gt;. I reinstalled Julia 1.x recently and I hope to find some time to experiment with it a little at some point. I&amp;rsquo;ve played with versions 0.4 and 0.6 some years ago, but the growing list of changes from one version to the next, notwithstanding the incompatibility issues encountered here and there between v 0.6 and 0.7, had caused me to abandon the idea of working with it at a professional level. This blog post discusses why developing a package is better and easier or safer than writing local modules, and how Julia’s combination of duck-typing with multiple dispatch happens to be very powerful.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Whenever I have to write a quick Haskell script, I use a shebang like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#! /usr/bin/env stack
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;-- stack --resolver lts-13.26 script
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now I learn that there is &lt;a href="https://www.wespiser.com/posts/2020-02-02-Command-Line-Haskell.html"&gt;stack script&lt;/a&gt;. Great!&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://arxiv.org/abs/1812.11118"&gt;Reconciling modern machine learning practice and the bias-variance trade-off&lt;/a&gt;, or how increasing model capacity beyond the point of interpolation results in improved performance. Nice read!&lt;/p&gt;
&lt;p&gt;&lt;img src="https://aliquote.org/img/2020-02-12-15-13-23.png" alt=""&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Recently, I heard about &lt;a href="https://loky.readthedocs.io/en/stable/"&gt;loky&lt;/a&gt; for Python asynchronous processing. In the meantime, I&amp;rsquo;m still learning how to use the &lt;a href="https://docs.python.org/3/library/multiprocessing.html"&gt;multiprocessing&lt;/a&gt; package correctly, but TBH I found &lt;a href="http://numba.pydata.org"&gt;numba&lt;/a&gt; @jit decorator so much powerful for simple tasks (e.g., parallelizing simple &amp;ldquo;for&amp;rdquo; loops and the like) that I&amp;rsquo;m quite happy with what I have for now.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I&amp;rsquo;m not familiar with state-space models, but I came across the following review thanks to &lt;a href="https://twitter.com/ucfagls/status/1225821518476611584?s=20"&gt;Gavin Simpson&lt;/a&gt;: &lt;a href="https://arxiv.org/abs/2002.02001"&gt;An introduction to state-space modeling of ecological time series&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Heap sort</title><link>https://aliquote.org/post/heap-sort/</link><pubDate>Tue, 11 Feb 2020 13:53:37 +0100</pubDate><guid>https://aliquote.org/post/heap-sort/</guid><description>&lt;p&gt;We already discussed insertion and quick sorting in &lt;a href="https://aliquote.org/post/racket-ffi/"&gt;previous&lt;/a&gt; &lt;a href="https://aliquote.org/post/insertion-sort-python-ffi/"&gt;posts&lt;/a&gt;. Today, we are going to implement a quick function to perform heap sort in Python in order to answer one of &lt;a href="http://rosalind.info/problems/hs/"&gt;Rosalind problems&lt;/a&gt;. Like merge sort, the worst case running time of heap sort is $\mathcal{O}(n\log n)$ The idea behind this approach is to convert an array of values into a heap, which is a (perfectly balanced) binary tree where each node is greater than each of its children and all leaves are in the leftmost position available. In the case of a heap, the children of an element &lt;em&gt;n&lt;/em&gt; are at index 2&lt;em&gt;n&lt;/em&gt;+1 for the left child and 2&lt;em&gt;n&lt;/em&gt;+2 for the right child. Note that the &lt;a href="https://docs.python.org/3.7/library/heapq.html"&gt;Heap queue&lt;/a&gt; algorithm is readily available in Python 3, and according to the documentation, &amp;ldquo;a heapsort can be implemented by pushing all values onto a heap and then popping off the smallest values one at a time.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;Here is a recursive formulation, following the steps suggested in Cormen, Leiserson, Rivest &amp;amp; Stein&amp;rsquo;s &lt;em&gt;Introduction to Algorithms&lt;/em&gt; (§6.2) in order to maintain the &lt;a href="https://en.wikipedia.org/wiki/Heap_(data_structure)"&gt;max-heap&lt;/a&gt; property (&amp;ldquo;max-heapify&amp;rdquo;):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;heapify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;curr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;left&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;right&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;left&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;left&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;curr&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;curr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;left&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;right&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;right&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;curr&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;curr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;right&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;curr&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;curr&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;curr&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;heapify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;curr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;heapsort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;heapify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;heapify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;lst&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And here is the &amp;ldquo;built-in&amp;rdquo; procedure:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;heapq&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;heappush&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;heappop&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;heapsort2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;iterable&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;h&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;iterable&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;heappush&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;heappop&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;))]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;How do the two implementations compare?&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;random&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="n"&gt;xs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt; &lt;span class="n"&gt;heapsort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;CPU&lt;/span&gt; &lt;span class="n"&gt;times&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="mf"&gt;14.3&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;39.7&lt;/span&gt; &lt;span class="n"&gt;ms&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;total&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;14.3&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Wall&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;14.4&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt; &lt;span class="n"&gt;heapsort2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;CPU&lt;/span&gt; &lt;span class="n"&gt;times&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="mf"&gt;1.4&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;21.3&lt;/span&gt; &lt;span class="n"&gt;ms&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;total&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;1.42&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Wall&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;1.43&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So, this is clearly a big win for the later, and it suggest that we would be better using &lt;code&gt;heapq&lt;/code&gt; for solving Rosalind problems involving heap sort. As confirmed by a bit of profiling, most of the time is spent calling &lt;code&gt;heapify&lt;/code&gt; multiple times in our own implementation,&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; while Python&amp;rsquo;s &lt;code&gt;heapq&lt;/code&gt; allows a constant access time. For an array of size 1000, there will be 1000 &amp;ldquo;pop&amp;rdquo; and 1000 &amp;ldquo;push&amp;rdquo;, at almost a zero cost.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;17&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;cProfile&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;18&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="n"&gt;cProfile&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;heapsort2(xs[:1000])&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;2006&lt;/span&gt; &lt;span class="n"&gt;function&lt;/span&gt; &lt;span class="n"&gt;calls&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="mf"&gt;0.001&lt;/span&gt; &lt;span class="n"&gt;seconds&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Ordered&lt;/span&gt; &lt;span class="n"&gt;by&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;standard&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ncalls&lt;/span&gt; &lt;span class="n"&gt;tottime&lt;/span&gt; &lt;span class="n"&gt;percall&lt;/span&gt; &lt;span class="n"&gt;cumtime&lt;/span&gt; &lt;span class="n"&gt;percall&lt;/span&gt; &lt;span class="n"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;lineno&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;function&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mf"&gt;0.000&lt;/span&gt; &lt;span class="mf"&gt;0.000&lt;/span&gt; &lt;span class="mf"&gt;0.001&lt;/span&gt; &lt;span class="mf"&gt;0.001&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;ipython&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nb"&gt;input&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="n"&gt;d33d18db4ca&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;heapsort2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mf"&gt;0.000&lt;/span&gt; &lt;span class="mf"&gt;0.000&lt;/span&gt; &lt;span class="mf"&gt;0.001&lt;/span&gt; &lt;span class="mf"&gt;0.001&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;ipython&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nb"&gt;input&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="n"&gt;d33d18db4ca&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;listcomp&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mf"&gt;0.000&lt;/span&gt; &lt;span class="mf"&gt;0.000&lt;/span&gt; &lt;span class="mf"&gt;0.001&lt;/span&gt; &lt;span class="mf"&gt;0.001&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;module&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;1000&lt;/span&gt; &lt;span class="mf"&gt;0.000&lt;/span&gt; &lt;span class="mf"&gt;0.000&lt;/span&gt; &lt;span class="mf"&gt;0.000&lt;/span&gt; &lt;span class="mf"&gt;0.000&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;built&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;method&lt;/span&gt; &lt;span class="n"&gt;_heapq&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;heappop&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;1000&lt;/span&gt; &lt;span class="mf"&gt;0.000&lt;/span&gt; &lt;span class="mf"&gt;0.000&lt;/span&gt; &lt;span class="mf"&gt;0.000&lt;/span&gt; &lt;span class="mf"&gt;0.000&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;built&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;method&lt;/span&gt; &lt;span class="n"&gt;_heapq&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;heappush&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mf"&gt;0.000&lt;/span&gt; &lt;span class="mf"&gt;0.000&lt;/span&gt; &lt;span class="mf"&gt;0.001&lt;/span&gt; &lt;span class="mf"&gt;0.001&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;built&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;method&lt;/span&gt; &lt;span class="n"&gt;builtins&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;exec&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mf"&gt;0.000&lt;/span&gt; &lt;span class="mf"&gt;0.000&lt;/span&gt; &lt;span class="mf"&gt;0.000&lt;/span&gt; &lt;span class="mf"&gt;0.000&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;built&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;method&lt;/span&gt; &lt;span class="n"&gt;builtins&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mf"&gt;0.000&lt;/span&gt; &lt;span class="mf"&gt;0.000&lt;/span&gt; &lt;span class="mf"&gt;0.000&lt;/span&gt; &lt;span class="mf"&gt;0.000&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;method&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;disable&amp;#39;&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;_lsprof.Profiler&amp;#39;&lt;/span&gt; &lt;span class="n"&gt;objects&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;The implementation proposed on &lt;a href="https://rosettacode.org/wiki/Sorting_algorithms/Heapsort#Python"&gt;Rosetta&lt;/a&gt; is lightly better, but it does not improve much overall performance:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;CPU times: user 10.3 s, sys: 21.4 ms, total: 10.3 s
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Wall time: 10.4 s
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Poisson approximation in practice</title><link>https://aliquote.org/post/poisson-approximations/</link><pubDate>Mon, 03 Feb 2020 19:56:12 +0100</pubDate><guid>https://aliquote.org/post/poisson-approximations/</guid><description>&lt;p&gt;We know from basic statistics textbook that the distribution of a Binomial random variate (with probbaility of success $p$) can be approximated using a Poisson distribution (of parameter $\lambda = np$), provided certain conditions are met (usually, small $p$ and large $n$).&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; An easy to remember application is that the sequence of $\text{Bin}(n,\frac{1}{n})$ distributions converges in law to the Poisson distribution with mean 1. We can see $\text{Bin}(n,\frac{1}{n})$ either as the sum of $n$ independent Bernoulli trials with small probability of success, dependent on $n$, or as the count of the total number of occurrences among $n$ independent rare events. It turns out that the later has many useful applications.&lt;/p&gt;
&lt;p&gt;Here are two illustrations, taken from DasGupta.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; In the &lt;em&gt;matching problem&lt;/em&gt;, cards are drawn one at a time from a well-shuffled deck containing $N$ cards, and a match occurs if the card bearing the number $j$ is drawn at precisely the $j$-th draw from the deck. Let $S_N$ be the total number of matches. We will need a little theorem, which happens to be useful when we want to prove that a Poisson limit is still applicable for the sum of dependent Bernoulli trials&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Theorem:&lt;/strong&gt; For $N\ge 1$, let $X_i=1,2,\dots,n$, $n=n(N)$ be a triangular array of Bernoulli random variables, and let $A_i$ denotes the event for which $X_i=1$. For a given $k$, let $M_k$ be the $k$-th binomial moment of $S_n$; i.e., $M_k=\sum_{j=k}^n{j\choose k}P(S_n=j)$. If there exists $0&amp;lt;\lambda&amp;lt;\infty$ such that, for every fixed $k$, $M_k\rightarrow \frac{\lambda^k}{k!}$ as $N\rightarrow\infty$, then $S_n \rightarrow_{\mathcal{L}}\text{Poi}(\lambda)$.&lt;/p&gt;
&lt;p&gt;In the matching problem, the binomial moment $M_k$ can be shown to be $M_k = {N\choose k}\frac{1}{N(N-1)\dots (N-k+1)}$. Using &lt;a href="https://en.wikipedia.org/wiki/Stirling's_approximation"&gt;Stirling&amp;rsquo;s approximation&lt;/a&gt;, for every fixed $k$, $M_k\rightarrow\frac{1}{k!}$; in other words, the total number of matches converges to a Poisson distribution with mean 1 as the deck size $N\rightarrow\infty$. Convergence is very fast. See also &lt;a href="https://probabilityandstats.wordpress.com/2010/05/02/more-about-the-matching-problem/"&gt;More about the matching problem&lt;/a&gt;.&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;In the &lt;em&gt;birthday problem&lt;/em&gt;, we are interested in the probability that two randomly chosen persons were born the same day. More formally, suppose each person in a group of $n$ people
has, mutually independently, a probability $\frac{1}{N}$ of being born on any given day of a year with $N$ calendar days. Let $S_n$ be the total number of pairs of people $(i, j)$ such that they have the same birthday. Then $P(S_n &amp;gt; 0)$ is the probability that there is at least one pair of people in the group who share the same birthday. It turns out that if $n$ and $N$ can be expressed as $n^2=N\lambda+\mathcal{o}(N)$, for some $0&amp;lt;\lambda &amp;lt;\infty$, then $S_n\rightarrow_\mathcal{L}\text{Poi}(\lambda)$. If $N=365$, $n=30$, then $S_n\approx\text{Poi}(1.233)$.&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;LeCam&amp;rsquo;s theorem on total variation is also useful. It states, in part, that $d_\text{TV}\left(\text{Bin}(n,\lambda/n),\text{Poi}(\lambda)\right)\le 8\lambda/n$. Further discussion can be found on &lt;a href="https://math.stackexchange.com/a/803352"&gt;maths.SE&lt;/a&gt;.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;DasGupta, A. &lt;em&gt;Asymptotic theory of statistics and probability&lt;/em&gt;. Springer, 2008.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:3"&gt;
&lt;p&gt;Interestingly, it is possible to derive a recurrence relation for the PDF of $S_n$: (proof &lt;a href="http://www.randomservices.org/random/urn/Matching.html"&gt;here&lt;/a&gt;)
$$
\begin{array}{rcl}
\Pr(S_1 = 1) &amp;amp;=&amp;amp; 1\cr
\Pr(S_n = k) &amp;amp;=&amp;amp; (k+1)\Pr(S_{n+1} = k+1)\quad \text{for}\: k \in \{0,1,\dots,n\}
\end{array}
$$
This allows to obtain the probability density function of $S_n$ recursively for any $n$.&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Variance-stabilizing transformations</title><link>https://aliquote.org/post/variance-stabilizing-transformations/</link><pubDate>Sat, 01 Feb 2020 12:46:01 +0100</pubDate><guid>https://aliquote.org/post/variance-stabilizing-transformations/</guid><description>&lt;p&gt;We often make use of variable transformation to bring back the distribution of an explanatory variable to a more symmetric, gaussian-shaped, one. For instance, a log-transformation of a heavily skewed distribution (e.g., counts or doses with detect limit &amp;mdash; which could otherwise be modeled as truncated or left-censored data) often helps in making the distribution less skewed, hence stabilizing the variance. As far as variance stabilization is concerned, there are other useful tricks one may not be necessarily aware.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s consider the sample (Pearson or product-moment) correlation coefficient, $r$, which is computed as the ratio between the covariance and the product of the standard deviation of a bivariate sample $(X_1, Y_1), \dots, (X_n, Y_n)$. Using the delta method,&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; it can be shown that $\sqrt{n}(r - \rho)$ is asymptotically zero-mean normal, with variance depending on a mix of the 3rd and 4th moment of $(X,Y)$, assumed to be bivariate normal. If the 4th moment exists, this is true for any underlying distribution. It can further be shown that:&lt;/p&gt;
&lt;p&gt;$$ \sqrt{n}(r - \rho) \rightarrow N\left(0, (1-\rho^2)^2\right). $$&lt;/p&gt;
&lt;p&gt;This expression is not very handy in practice. But, first, how did we get there? Recall that the asymptotic confidence intervals (CI) for a parameter $\theta$ (here, the population correlation $\rho$) are asymptotically of level $1-2\alpha$ for every $\theta$ iff the asymptotic variance $\sigma^2(\theta)$ are independent of $\theta$. When it is not the case, we can apply the same idea to $\eta = \Phi(\theta)$, where the natural estimator of $\eta$ is $\Phi(T_n)$. If $\Phi$ is differentiable, then $\sqrt(n)\left(\Phi(T_n)-\Phi(\theta)\right) \rightarrow_\theta N\left( 0, \Phi&amp;rsquo;(\theta)^2\sigma^2(\theta)\right)$.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; If we choose $\Phi$ such that $\Phi&amp;rsquo;(\theta)\sigma(\theta)\equiv 1$, then the asymptotic variance is constant and finding an asymptotic CI for $\eta=\Phi(\theta)$ becomes easier. Indeed, $\Phi(\theta) = \int\frac{1}{\sigma(\theta)}d\theta$ is a variance-stabilizing (monotone) transformation, so that once we get a CI for $\eta$ we can easily build a CI for $\theta$.&lt;/p&gt;
&lt;p&gt;In the case of the product-moment correlation, the variance-stabilizing transformation is:&lt;/p&gt;
&lt;p&gt;$$ \Phi(\rho) = \int \frac{1}{1-\rho^2}d\rho = \frac{1}{2}\log\frac{1+\rho}{1-\rho} = \text{arctanh}\:\rho. $$&lt;/p&gt;
&lt;p&gt;In other words, $\sqrt{n}(\text{arctanh}\:r - \text{arctanh}\:\rho)$ converges to a standard Normal distribution for every $\rho$. Whence the following asymptotic CI for $\rho$:&lt;/p&gt;
&lt;p&gt;$$ \left( \text{tanh}\big(\text{arctanh}\:r-z_\alpha/\sqrt(n)\big), \text{tanh}\big(\text{arctanh}\:r+z_\alpha/\sqrt(n)\big)\right). $$&lt;/p&gt;
&lt;p&gt;Here is a little simulation using 1000 replicates and theoretical correlation $\rho = 0.5$, with data displayed in the figure below (raw and transformed Pearson correlation in the left and right panel, respectively):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;48&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Table&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Correlation&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;RandomVariate&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;BinormalDistribution&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]][[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;}];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;49&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;GraphicsGrid&lt;/span&gt;&lt;span class="p"&gt;[{{&lt;/span&gt;&lt;span class="n"&gt;Histogram&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Automatic&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Probability&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Histogram&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Map&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ArcTanh&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Automatic&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Probability&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]}}]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/2020-02-03-13-39-37.png"&gt;
&lt;/figure&gt;
&lt;small&gt;Figure 3.1 in van der Vaart&lt;sup id="fnref1:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; is probably wrong since values for $\text{arctanh}\:r$ are all negative (right panel).&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;Unlike Box-Cox power transformation, where the idea is to look for a scale on which effects are additive,&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt; in this approach we directly work at the level of the test statistic. As an alternative, when the distribution of the test statistic is unknown or not close to normal, one can resort on computing bias-corrected bootstrap CIs.&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Based on a Taylor expansion to approximate a random vector $\Phi(T_n)$ by the polynomial $\Phi(\theta) + \Phi&amp;rsquo;(\theta)(T_n-\theta)+\dots$ in $T_n-\theta$, the delta method is generally used to find the limit law of $\Phi(T_n)-\Phi(\theta)$ from that of $T_n - \theta$.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;van der Vaart, A.W. &lt;em&gt;Asymptotic Statistics&lt;/em&gt;. Cambridge University Press, 1998.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&amp;#160;&lt;a href="#fnref1:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:3"&gt;
&lt;p&gt;Box, G. E. P. and Cox, D. R. An analysis of transformations. &lt;em&gt;Journal of the Royal Statistical Society B&lt;/em&gt;, 1964 (26): 211-252.&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Finding a DNA sequence in a genome</title><link>https://aliquote.org/post/dna-sequence-probability/</link><pubDate>Fri, 31 Jan 2020 13:29:06 +0100</pubDate><guid>https://aliquote.org/post/dna-sequence-probability/</guid><description>&lt;p&gt;What is the probability of finding a given DNA sequence in a window of a given size? As a first approximation, we could consider that all nucleotides are independent one from the other, so that for a four-letter alphabet, each nucleotide appears with a probability 1/4. This is not true because GC content varies from one genome to the other, but let&amp;rsquo;s continue with this simple scheme. Now, consider a sequence of size &lt;em&gt;k&lt;/em&gt; and a window of size &lt;em&gt;n&lt;/em&gt; (&lt;em&gt;n&lt;/em&gt; much smaller than the genome length). If all nucleotides are assumed independant, then the probability of not finding this particular sequence is $(1 - 1/4^k)$ (using the complementary is useful to avoid dealing with the number of times this sequence can appear) times the total number of positions available in the window (&lt;em&gt;n&lt;/em&gt; or &lt;em&gt;n&lt;/em&gt; - &lt;em&gt;k&lt;/em&gt; + 1, but if $k \ll n$ this correction factor can be omitted). Hence the answer: $1 - (1 - 1/4^k)^n$.&lt;/p&gt;
&lt;p&gt;The following pictures shows the results of a little &lt;a href="https://aliquote.org/pub/prob-motif.r"&gt;simulation in R&lt;/a&gt; (points are empirical estimates while blue and orange lines are theoretical expectations with or without the correction factor for sequence length, 1 - &lt;em&gt;k&lt;/em&gt; &amp;mdash; which confirms that accounting for the sequence length only matters for small window size):&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/dna_subsequence_1.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/dna_subsequence_1.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/dna_subsequence_2.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/dna_subsequence_2.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Now, we know that nucleotides are not independant at all. We would eventually need to compute the joint probability of all nucleotides in a sequence, e.g., $\Pr(AGCAAT) = \Pr(A)\Pr(G|A)\Pr(C|AG)\ldots$, which might work when &lt;em&gt;k&lt;/em&gt; is small, but in the long run it becomes quite cumbersome to compute all conditional probabilities. Markov to the rescue: Let us consider that the probability of given nucleotide is only dependent on the preceding one, that is:&lt;/p&gt;
&lt;p&gt;$$\Pr(x) = \Pr(x_1)\prod_{i=2}^k\Pr(x_i|x_{i-1}).$$&lt;/p&gt;
&lt;p&gt;Then the idea is to specify transition probabilities like we did in an &lt;a href="https://aliquote.org/post/markov-random-process-using-mathematica/"&gt;other post&lt;/a&gt;, to describe the probability of having, say, a &lt;em&gt;G&lt;/em&gt; after a &lt;em&gt;A&lt;/em&gt;, and so on. A working example using R code is provided on &lt;a href="https://stats.stackexchange.com/a/362638"&gt;Cross Validated&lt;/a&gt;. Moreover, if such a Markov chain is allowed to have an end state, it can account for specific ending nucleotides, e.g. STOP codons. You end up with a distribution over all possible next states, and those parameters can be estimated using maximum likelihood. As an example, let&amp;rsquo;s consider our sample sequence {A, G, C, A, A, T}. We have the following ML estimates: $\Pr(A) = 3/6$, $\Pr(G) = \Pr(C) = \Pr(T) = 1/6$. Having larger sequences, or simply more sample sequences, would help refine those estimates, of course. But we could also rely on a Bayesian approach and &lt;a href="https://math.stackexchange.com/questions/184181/calculating-laplaces-law-for-bigrams"&gt;Laplace estimation&lt;/a&gt; (the same technique is used in M-gram models or any stochastic process that assumes a sequence of random variable $X_i$ where $\{x_1, \dots, x_2\}$ is observed).&lt;/p&gt;
&lt;p&gt;Higher-order Markov models are available, though. For instance we could allow the Markov model to have some &amp;ldquo;memory&amp;rdquo;, i.e. instead of considering $\Pr(x_i|x_{i-1})$, we can work with $\Pr(x_i|x_{i-1}, x_{i-2}, \dots, x_{i-k})$, with $k$ small enough in order to avoid the trap of a too large number of joint probabilities (we need $\mathcal{O}(4^{k+1})$ parameters for a $k$-th order Markov model). &lt;em&gt;Bioinformatics: The Machine Learning Approach&lt;/em&gt;, by Baldi &amp;amp; Brunak, has some other interesting discussion on modeling biological sequences (e.g., section 3.1 and chapter 11). Finally, for a more detailed discussion of the above review, see Burr Settles&amp;rsquo; great lecture on &lt;a href="http://pages.cs.wisc.edu/~bsettles/ibs08/lectures/03-sequencemodels.pdf"&gt;Probabilistic Sequence Models&lt;/a&gt; (PDF, 59 pp.).&lt;/p&gt;</description></item><item><title>Micro posting in January</title><link>https://aliquote.org/post/micro-01-2020/</link><pubDate>Fri, 31 Jan 2020 12:13:32 +0100</pubDate><guid>https://aliquote.org/post/micro-01-2020/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2020-01-01&lt;/a&gt;: Can someone explain to me why on earth macOS devs thought it would be good to fetch again and again software updates instead of storing them in a hash list? I start to be really annoyed by those perpetual reminders to update my Mac, notwithstanding the fact that I need to wait for the pref pane to be up and ready. Each time. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-01-01-20-29-38.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-01&lt;/a&gt;: Happy new year &lt;code&gt;111 11100100&lt;/code&gt;!&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-01-05-16-51-00.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-02&lt;/a&gt;: &amp;gt; Deadlines are bad and if you have those in your company you should probably go ahead and remove the &amp;ldquo;customer obsession&amp;rdquo; bullet from your leadership principles. Because believe it or not, your users don&amp;rsquo;t care about a missed sprint. &amp;mdash; &lt;a href="http://jatins.gitlab.io/me/why-deadline/"&gt;who are you trying to impress with your deadlines?&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-02&lt;/a&gt;: &lt;a href="https://floooh.github.io/2019/09/27/modern-c-for-cpp-peeps.html"&gt;Modern C for C++ Peeps&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-04&lt;/a&gt;: &lt;a href="https://mkaz.blog/misc/notes-on-technical-writing/"&gt;Notes on Technical Writing&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-06&lt;/a&gt;: Github has become a large repository of PDF books. Here&amp;rsquo;s a &lt;a href="https://github.com/fogus/papers-i-love"&gt;new one&lt;/a&gt;, by &lt;a href="http://www.fogus.me"&gt;fogus&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-06&lt;/a&gt;: Yet another intro to the tidyverse, FWIW: &lt;a href="https://moderndive.com/index.html"&gt;Statistical Inference via Data Science: A ModernDive into R and the tidyverse&lt;/a&gt;. I don&amp;rsquo;t really understand why there need to be a &lt;code&gt;rep_sample_n()&lt;/code&gt; function in chapter 7 (which is just imported from the &lt;code&gt;infer&lt;/code&gt; package by &lt;code&gt;moderndive&lt;/code&gt;, see the signature of the function) which does nothing more than what could possibly be done easily with &lt;code&gt;base::sample&lt;/code&gt;. This drives me crazy sometimes. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-06&lt;/a&gt;: &lt;a href="https://news.ycombinator.com/item?id=21955258"&gt;Ask HN: Are books worth it?&lt;/a&gt;&amp;gt; A well-written story, be it fiction or non-fiction can have a long lastig impact and even an emotional connection that I have personally never experienced with anything &amp;lsquo;online&amp;rsquo;.Many related threads, e.g., &lt;a href="https://news.ycombinator.com/item?id=10202055"&gt;Is RSS still worth the time?&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-06&lt;/a&gt;: &lt;a href="http://winestockwebdesign.com/Essays/Lisp_Curse.html"&gt;The Lisp curse&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-07&lt;/a&gt;: &lt;a href="https://flowmap.blue"&gt;https://flowmap.blue&lt;/a&gt;: Lovely.&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-01-07-14-28-58.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-07&lt;/a&gt;: &amp;gt; Most languages do a whole lot of other crap other than printing out “hello world”, even if that’s all you asked for. &amp;mdash; &lt;a href="https://drewdevault.com/2020/01/04/Slow.html"&gt;Hello world&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-07&lt;/a&gt;: A nice discussion of &lt;a href="https://personal.sron.nl/~pault/"&gt;colour schemes and templates&lt;/a&gt; by Paul Tol.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-07&lt;/a&gt;: &lt;a href="http://www.netlib.org/utk/people/JackDongarra/la-sw.html"&gt;Freely Available Software for Linear Algebra (September 2018)&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-07&lt;/a&gt;: &lt;a href="https://her.esy.fun/posts/0010-Haskell-Now/index.html"&gt;Learn Haskell Now!&lt;/a&gt;. And for French readers, &lt;a href="https://her.esy.fun/slides/Intro-to-FP-with-Haskell.html"&gt;Introduction à la Programmation Fonctionnelle avec Haskell&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-07&lt;/a&gt;: &lt;a href="https://krisrs1128.github.io/OpioidAtlas/charts.html"&gt;Opioid Atlas&lt;/a&gt;: Explore country-level consumption trends by hovering over different geographic location in the Opioid Map. &lt;code&gt;#dataviz&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-07&lt;/a&gt;: &lt;a href="https://arxiv.org/abs/1912.11144v1"&gt;Parallel computing with R: A brief review&lt;/a&gt;, by Dirk Eddelbuettel. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-07&lt;/a&gt;: &lt;a href="http://www.stat.rice.edu/~dobelman/textfiles/DistributionsHandbook.pdf"&gt;handbook on statistical distribution for experimentalists&lt;/a&gt; (PDF, 202 pp.).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-08&lt;/a&gt;: &lt;a href="https://douglasorr.github.io/2019-09-hash-vs-sort/article.html"&gt;Finding unique items - hash vs sort?&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-08&lt;/a&gt;: &lt;a href="https://francisbach.com/the-sum-of-a-geometric-series-is-all-you-need/"&gt;The sum of a geometric series is all you need!&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-09&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/oceana/80729547" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Ben Monder, &lt;em&gt;Oceana&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-09&lt;/a&gt;: &amp;gt; A modern day pull request is so much more than a version control tool operation or even a simple request to pull or merge a branch: it is a nexus to track the integration of a proposed change before during and after that change is integrated. &amp;mdash; &lt;a href="https://gregoryszorc.com/blog/2020/01/07/problems-with-pull-requests-and-how-to-fix-them/"&gt;Problems with Pull Requests and How to Fix Them&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-09&lt;/a&gt;: &amp;gt; All the cool kids are doing micro-services these days. (&amp;hellip;) It is a time-honored tradition in computer programming to take any idea that offers some advantage, give it a name, elevate it to a “principle” and use it to the exclusion of any prior good idea. &amp;mdash; &lt;a href="http://funcall.blogspot.com/2020/01/micro-services.html"&gt;Micro-services&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-09&lt;/a&gt;: &amp;gt; If you remember good old days, it was a pretty easy thing to make a website. You edit an index.html page till it looks fine, then you copy it to a cheap hosting with any tool you like and you’re done. &amp;mdash; &lt;a href="https://can3p.github.io//blog_draft/2020/01/03/complexity-tower/"&gt;Complexity tower and a holy grail of web development&lt;/a&gt;I clearly remember those days where I was maintaining my website using handmade templates and single HTML pages edited under Emacs. How come I became so lazy over years?&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-09&lt;/a&gt;: A few days ago, I watched &lt;a href="https://www.imdb.com/title/tt7456310/"&gt;Anna&lt;/a&gt; (in two stages since I&amp;rsquo;m so exhausted these days because of the strike!). I found it so bad that I thought I would be better watching &lt;a href="https://www.imdb.com/title/tt0100263/"&gt;Nikita&lt;/a&gt; again. Much better indeed, and this confirmed my original idea that Anna is just a pale copy. Until I realized they were produced by the same guy&amp;hellip;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-09&lt;/a&gt;: &lt;a href="https://www.travishinkelman.com/post/adding-string-matching-to-chez-docs/"&gt;Adding string matching to chez-docs&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-09&lt;/a&gt;: &lt;a href="https://d2l.ai/index.html"&gt;Dive into Deep Learning&lt;/a&gt; (numpy edition). &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-09&lt;/a&gt;: &lt;a href="https://github.com/hakluke/how-to-exit-vim/blob/master/README.md"&gt;How to exit vim&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-09&lt;/a&gt;: &lt;a href="https://serokell.io/blog/introduction-to-functional-programming"&gt;Introduction to Functional Programming&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-09&lt;/a&gt;: &lt;a href="https://cestlaz.github.io/post/using-emacs-63-clojurescript/"&gt;Using Emacs 63 ClojureScript&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-10&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/2020-01-10-12-18-47.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-10&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/you-must-believe-in-spring/1449244783" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Bill Evans, &lt;em&gt;You must believe in Spring&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-10&lt;/a&gt;: &lt;a href="https://github.com/DoctorWkt/acwj"&gt;A Compiler Writing Journey&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-10&lt;/a&gt;: &lt;a href="https://pythonspeed.com/articles/minimizing-copying/"&gt;Copying data is wasteful, mutating data is dangerous&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-10&lt;/a&gt;: &lt;a href="https://github.com/emeryberger/scalene"&gt;scalene&lt;/a&gt;: a high-performance CPU and memory profiler for Python. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-13&lt;/a&gt;: &lt;a href="https://news.ycombinator.com/item?id=18832155"&gt;9999999999999999.0 - 9999999999999998.0&lt;/a&gt;. See also &lt;a href="https://news.ycombinator.com/item?id=12896731&amp;amp;goto=news"&gt;Subtracting large floating point numbers in different languages&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-13&lt;/a&gt;: &lt;a href="https://colcarroll.github.io/ppl-api/"&gt;A tour of probabilistic programming language APIs&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-13&lt;/a&gt;: &lt;a href="https://github.com/saurabhkukade/Haskell_Study"&gt;Collections of papers and books about Haskell, Type Theory and Category Theory&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-13&lt;/a&gt;: &lt;a href="https://towardsdatascience.com/elasticsearch-meets-bert-building-search-engine-with-elasticsearch-and-bert-9e74bf5b4cf2"&gt;Elasticsearch meets BERT: Building Search Engine with Elasticsearch and BERT&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-14&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/2020-01-14-10-35-04.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-14&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Cigarettes After Sex, &lt;em&gt;Cigarettes After Sex&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-14&lt;/a&gt;: &lt;a href="https://github.com/alan-turing-institute/CleverCSV"&gt;CleverCSV&lt;/a&gt; is a Python package for handling messy CSV files. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-14&lt;/a&gt;: &lt;a href="https://martinheinz.dev/blog/13"&gt;Making Python Programs Blazingly Fast&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-14&lt;/a&gt;: &lt;a href="https://gregoryszorc.com/blog/2020/01/13/mercurial's-journey-to-and-reflections-on-python-3/"&gt;Mercurial&amp;rsquo;s Journey to and Reflections on Python 3&lt;/a&gt;. String literals are so fucking awesome in Python.&amp;gt; In Python 2, a &amp;rsquo;&amp;rsquo; string literal is a sequence of bytes. In Python 3, a &amp;rsquo;&amp;rsquo; string literal is a sequence of Unicode code points. These are fundamentally different types. And in Mercurial&amp;rsquo;s code base, most of our string types are binary by design: use of a Unicode based str for representing data is flat out wrong for our use case.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-14&lt;/a&gt;: &lt;a href="https://kottke.org/21/01/paris-museums-put-100000-images-online-for-unrestricted-public-use"&gt;Paris Museums Put 100,000 Images Online for Unrestricted Public Use&lt;/a&gt;. So nice&amp;hellip;&lt;br&gt;&lt;img src="https://aliquote.org/img/eugene-atget-02.jpg" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-15&lt;/a&gt;: &amp;gt; I haven’t personally found any use for Dark Mode on my Mac. &amp;mdash; &lt;a href="https://mjtsai.com/blog/2020/01/14/the-dark-side-of-dark-mode-and-night-shift/"&gt;The Dark Side of Dark Mode and Night Shift&lt;/a&gt;Nor did I, which is why I long deactivated it on my Macbook. Yet I like dark themes for Emacs and iTerm, despite all they say about dark theme mode for text editing.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-15&lt;/a&gt;: &amp;gt; If Lisp’s great insight was that code is data that programmers can take advantage of that with metaprogramming, then git’s great insight is that code changes are data and programmers can take advantage of that with metachanges. &amp;mdash; &lt;a href="https://jeremykun.com/2020/01/14/the-communicative-value-of-using-git-well/"&gt;The Communicative Value of Using Git Well&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-15&lt;/a&gt;: OMG, &lt;a href="https://kottke.org/20/01/steven-soderberghs-media-diet-for-2019"&gt;2,3,4 movies in a day&lt;/a&gt;&amp;hellip; I remember the time when I was able to read 2 to 3 books a day, but I never watched 3 or 4 movies a day. Our best strike with my son was 4-5 episodes of GoT or Walking Dead last Summer.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-15&lt;/a&gt;: &lt;a href="http://funcall.blogspot.com/2020/01/palindromes-redux-and-sufficiently.html"&gt;Palindromes, redux, and the Sufficiently Smart Compiler&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-16&lt;/a&gt;: &amp;gt; In the LATEX world, we must acknowledge the fact that endosymbiosis is not as widespread as it should be. What we usually observe is the opposite phenomenon: the proliferation of a multitude of dif- ferent packages that are meant to work together, or do more or less the same thing, instead of becoming one single and bigger animal. &amp;mdash; &lt;a href="https://www.tug.org/TUGboat/tb31-2/tb98verna.pdf"&gt;Classes, styles, conflicts: The biological realm of LATEX&lt;/a&gt; (PDF)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-17&lt;/a&gt;: &amp;gt; I will give mathematician&amp;rsquo;s credit for thinking about edge cases perhaps more than a computer scientist would. It can be easy to be a bit complacent with edge cases because the computer will likely do something even if you don&amp;rsquo;t think too hard about what it ought to do. But a good computer scientist tries to reduce the number of edge cases or at least make them coherent with the non-edge cases. &amp;mdash; &lt;a href="http://funcall.blogspot.com/2020/01/math-is-hard-lets-go-shopping.html"&gt;Math is hard, let&amp;rsquo;s go shopping&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-17&lt;/a&gt;: &lt;a href="https://ismailelazizi.com/blog/a-guide-to-minimalist-web-design"&gt;A guide to Minimalist Web Design&lt;/a&gt;: I really like the vertical progress bar. Also,&amp;gt; you don’t need more space. you need less stuff.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-17&lt;/a&gt;: &lt;a href="https://andrearichiardi.com/blog/posts/productivity-with-org-mode.html"&gt;Build your productivity tools with org-mode&lt;/a&gt;. (via &lt;a href="https://irreal.org/blog/?p=8588"&gt;Irreal&lt;/a&gt;) &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-17&lt;/a&gt;: &lt;a href="https://6004.mit.edu/web/fall19/resources/lectures"&gt;Computation structures&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-17&lt;/a&gt;: &lt;a href="http://funcall.blogspot.com/2020/01/groups-semigroups-monoids-and-computers.html"&gt;Groups, semigroups, monoids, and computers&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-17&lt;/a&gt;: &lt;a href="https://www.applearchive.org"&gt;The (Unofficial) Apple Archive&lt;/a&gt;.&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-01-17-09-47-25.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-20&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/in-movement/1096407530" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Jack DeJohnette, Ravi Coltrane &amp;amp; Matt Garrison, &lt;em&gt;In Movement&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-20&lt;/a&gt;: &amp;gt; Emotions cut both ways. For anyone who has released and maintained some moderately popular piece of software, you will have invariably made contact with other humans. The impact that another person can have on your emotional state can be staggering. A positive gesture or comment can really brighten your day. It&amp;rsquo;s that feeling: yes, sharing my code was so worth it just to help that one person. But as anyone who has been a FOSS maintainer can attest, positive comments are almost always dwarfed by negative comments. &amp;mdash; &lt;a href="https://blog.burntsushi.net/foss/"&gt;My FOSS Story&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-20&lt;/a&gt;: &amp;gt; On lui donne 8000 euros en tout, et avec interdiction de l&amp;rsquo;utiliser pour payer des salaires, et obligation d&amp;rsquo;utiliser la totalité avant la fin de l&amp;rsquo;année fiscale, parce que sinon les gestionnaires du ministère n&amp;rsquo;arriveront pas à reporter les sommes sur l&amp;rsquo;année suivante&amp;hellip; (&amp;hellip;) D&amp;rsquo;ailleurs il paraît que les lauréats américain et japonais n&amp;rsquo;ont pas encore compris que les 8 000 € qu&amp;rsquo;on leur avait envoyés constituaient la totalité de leur financement, et ils les ont utilisés pour acheter leurs billets d&amp;rsquo;avion et réserver leur hôtel à Paris. &amp;mdash; Make our galaxy great again, &lt;a href="http://dessous-de-paillasse.salle-s.org/index.html"&gt;Les dessous de paillasse&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-20&lt;/a&gt;: Interesting &lt;a href="http://funcall.blogspot.com/2020/01/afraid-of-recursion.html"&gt;use of recursion&lt;/a&gt; to split a time-series dataset for immediate consumption, which could certainly be applied when dealing with genetic data.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-20&lt;/a&gt;: Yet another &lt;a href="https://lexi-lambda.github.io/blog/2020/01/19/no-dynamic-type-systems-are-not-inherently-more-open"&gt;enlightening post&lt;/a&gt; by Alexis King, that I will have a hard time to digest.&amp;gt; The flaw is in the premise: static types are not about “classifying the world” or pinning down the structure of every value in a system. The reality is that static type systems allow specifying exactly how much a component needs to know about the structure of its inputs, and conversely, how much it doesn’t.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-20&lt;/a&gt;: &lt;a href="https://github.com/mitmproxy/pdoc"&gt;pdoc&lt;/a&gt; is a library and a command line program to discover the public interface of a Python module or package. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-20&lt;/a&gt;: &lt;a href="https://github.com/BurntSushi/xsv"&gt;xsv&lt;/a&gt; is a command line program for indexing, slicing, analyzing, splitting and joining CSV files. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-21&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/as-it-was/1119775494" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Peter Erskine, Palle Danielsson &amp;amp; John Taylor &lt;em&gt;As It Was&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-21&lt;/a&gt;: &amp;gt; Another reason for the bias toward over-engineering is asymmetric risk. If an over-engineered approach fails, you’ll face less criticism than if a simpler approach fails. As the old saying goes, nobody got fired for choosing IBM. &amp;mdash; &lt;a href="https://www.johndcook.com/blog/2020/01/20/scaling-up-and-down"&gt;Scaling up and down&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-21&lt;/a&gt;: &amp;gt; Your souvenirs are the return value. (&amp;hellip;) Tail recursion aficionados realize that the journey itself is the important part of the function call, and that a vacation includes two journeys. &amp;mdash; &lt;a href="http://funcall.blogspot.com/2020/01/afraid-of-tail-recursion_21.html"&gt;Afraid of tail recursion&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-21&lt;/a&gt;: Some &lt;a href="https://www.linusakesson.net/programming/vim/index.php"&gt;obfusctaed Vim code&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-21&lt;/a&gt;: &lt;a href="http://morrick.me/archives/8693"&gt;A brief summary of why I’m less enthusiastic about Apple than I used to be&lt;/a&gt;. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-21&lt;/a&gt;: &lt;a href="https://mjtsai.com/blog/2020/01/16/composite-mac-desktop-picture/"&gt;Every macOS wallpaper&lt;/a&gt; from Mac OS X 10.0 Cheetah to macOS 10.15 Catalina combined.&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-01-21-10-14-00.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-21&lt;/a&gt;: &lt;a href="http://libcello.org"&gt;High level C&lt;/a&gt;, by the author of &lt;em&gt;Build your own Lisp&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-21&lt;/a&gt;: &lt;a href="https://arxiv.org/abs/2001.06296"&gt;Overly Optimistic Prediction Results on Imbalanced Data: Flaws and Benefits of Applying Over-sampling&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-22&lt;/a&gt;: &lt;a href="https://stackoverflow.com/a/55010745"&gt;This is it&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-23&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Wolfert Brederode Quartet, &lt;em&gt;Post Scriptum&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-23&lt;/a&gt;: As I&amp;rsquo;m no longer good for anything at night, all I have to do is go see the latest episode of American gods. Let&amp;rsquo;s make it so.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-23&lt;/a&gt;: I would love more concrete Git tips when using &lt;a href="https://github.com/tldr-pages/tldr"&gt;tldr&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-23&lt;/a&gt;: On my way to reduce my Bibtex file a bit. Around 300 entries removed so far &amp;mdash; WIP.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-23&lt;/a&gt;: &lt;a href="https://aliquote.org/post/reeder-app/"&gt;Reeder 3&lt;/a&gt; is no longer upgrade on iOS, sadly. It looks like it is now v.4 or nothing. Time to switch back to Elfeed I guess.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-24&lt;/a&gt;: &amp;gt; By 2030 we can hope that about half of the top 100 packages will have some measure of documentation. &amp;mdash; &lt;a href="http://www.stephendiehl.com/posts/decade.html"&gt;Haskell Problems For a New Decade&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-24&lt;/a&gt;: &amp;gt; I love that the whitespace reveals more of a city than just roads. &amp;mdash; &lt;a href="https://kottke.org/20/01/maps-of-every-single-street-in-any-city"&gt;Maps of Every Single Street in Any City&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-24&lt;/a&gt;: &lt;a href="https://www.jetbrains.com/lp/mono/"&gt;JetBrains Mono&lt;/a&gt; looks like a nice new monospace font, with support for ligature (like Fira Code). Yet, it is far less condensed than Inziu Iosevka, and after more than one year of using Iosevka in Emacs and iTerm I became quite used to it. Here it is, from left to right: Menlo, Iosevka, and JB Mono. (Click to enlarge)
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-1"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/jetbrainsmono.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/jetbrainsmono.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-24&lt;/a&gt;: &lt;blockquote class="twitter-tweet"&gt;&lt;p lang="en" dir="ltr"&gt;I&amp;#39;ve learned that Apple engineers have internal tools which allow them to delete macl xattr as well as to bypass other Catalina privacy and sandbox protections without rebooting and disabling SIP.&lt;br&gt;&lt;br&gt;Inside Apple they don&amp;#39;t suffer the same problems as external users and developers. &lt;a href="https://t.co/UGcwVZ9XF4"&gt;https://t.co/UGcwVZ9XF4&lt;/a&gt;&lt;/p&gt;&amp;mdash; Jeff Johnson (@lapcatsoftware) &lt;a href="https://twitter.com/lapcatsoftware/status/1219292758910828544?ref_src=twsrc%5Etfw"&gt;January 20, 2020&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async src="https://platform.twitter.com/widgets.js" charset="utf-8"&gt;&lt;/script&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-27&lt;/a&gt;: Although I&amp;rsquo;m quite happy with Biopython for processing (D|R)NA files, I&amp;rsquo;m interested to see if there&amp;rsquo;s something really interesting in the Julia ecosystem, e.g. &lt;a href="https://biojulia.net/BioSequences.jl/"&gt;BioSequences.jl&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-27&lt;/a&gt;: TIL there&amp;rsquo;s something like a plain text database called &lt;a href="https://labs.tomasino.org/gnu-recutils/"&gt;GNU Recutils&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-28&lt;/a&gt;: &amp;gt; When you think power-law, think skew: the vast majority of customers contribute negligible revenue, a small proportion of customers contribute almost all the revenue. &amp;mdash; &lt;a href="https://stephen.sh/posts/beware-the-mean"&gt;Beware the mean&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-28&lt;/a&gt;: A great (re)read: &lt;a href="https://www.fugue.co/blog/2015-11-11-guide-to-emacs.html"&gt;A CEO&amp;rsquo;s Guide to Emacs&lt;/a&gt;.&amp;gt; For those who haven&amp;rsquo;t used Emacs, it&amp;rsquo;s something you&amp;rsquo;ll likely hate, but may love. It&amp;rsquo;s sort of a Rube Goldberg machine the size of a house that, at first glance, performs all the functions of a toaster. That hardly sounds like an endorsement, but the key phrase is &amp;ldquo;at first glance.&amp;rdquo; Once you grok Emacs, you realize that it&amp;rsquo;s a thermonuclear toaster that can also serve as the engine for&amp;hellip; well, just about anything you want to do with text. When you think about how much your computing life revolves around text, this is a rather bold statement. Bold, but true.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-28&lt;/a&gt;: If you are in a nostalgic mood, go read &lt;a href="http://stuffjasondoes.com/2018/07/25/installing-nextstep-os-openstep-on-virtualbox-in-2018/"&gt;Installing NextStep OS (OpenStep) in VirtualBox&lt;/a&gt;, at least to enjoy the screenshots.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-28&lt;/a&gt;: &lt;a href="https://anvaka.github.io/city-roads/"&gt;Lovely&lt;/a&gt;.&lt;br&gt;&lt;img src="https://aliquote.org/img/2020-01-28-10-14-22.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-28&lt;/a&gt;: &lt;a href="https://bzg.fr/en/some-emacs-org-mode-features-you-may-not-know.html/"&gt;Org-mode features you may not know&lt;/a&gt;, by Bastien himself. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-28&lt;/a&gt;: &lt;a href="https://drewdevault.com/2020/01/21/Stress-and-happiness.html"&gt;The happinesses and stresses of full-time FOSS work&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-30&lt;/a&gt;: &amp;gt; To learn a new language or system you must choose a suitable problem and use the environment to implement, test, and debug the problem. &amp;mdash; &lt;a href="https://www.software-artist.com/joy-of-coding-observable/"&gt;The Joy of Coding: Observable&lt;/a&gt;On average, with a standard deck of cards, how many cards do we have to draw to get four of a kind? I believe this is basically the &lt;a href="https://math.stackexchange.com/q/998572"&gt;pigeonhole principle&lt;/a&gt;, right?&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-30&lt;/a&gt;: &lt;a href="https://enpiar.com/talks/rstudio-conf-2020"&gt;Accelerating Analytics with Apache Arrow&lt;/a&gt;.See also: &lt;a href="https://wesmckinney.com/blog/apache-arrow-pandas-internals/"&gt;Apache Arrow and the &amp;ldquo;10 Things I Hate About pandas&amp;rdquo;&lt;/a&gt;.&amp;gt; Pandas rule of thumb: have 5 to 10 times as much RAM as the size of your dataset.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-30&lt;/a&gt;: &lt;a href="https://adamdrake.com/an-unreasonably-deep-dive-into-project-euler-problem-4.html"&gt;An Unreasonably Deep Dive Into Project Euler Problem 4&lt;/a&gt;. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2020-01-30&lt;/a&gt;: &lt;a href="https://asciinema.org/a/296507"&gt;Fancy Clojure REPL&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;</description></item><item><title>Josephus Problem</title><link>https://aliquote.org/post/josephus-problem/</link><pubDate>Thu, 30 Jan 2020 20:27:54 +0100</pubDate><guid>https://aliquote.org/post/josephus-problem/</guid><description>&lt;p&gt;I started rereading &lt;em&gt;Concrete Mathematics&lt;/em&gt; recently. Chapter 1 is about recurrence relations and a specific section deals with &lt;a href="https://en.wikipedia.org/wiki/Josephus_problem"&gt;Josephus problem&lt;/a&gt;. Quoting Wikipedia, the idea amounts to the following:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;People (n) are standing in a circle waiting to be executed. Counting begins at a specified point in the circle and proceeds around the circle in a specified direction. After a specified number of people are skipped (m), the next person is executed. The procedure is repeated with the remaining people, starting with the next person, going in the same direction and skipping the same number of people, until only one person remains, and is freed.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The authors decided to eliminate every &lt;em&gt;second&lt;/em&gt; remaining person until only one survives, while in the original formulation of the &amp;ldquo;game&amp;rdquo; &lt;em&gt;n&lt;/em&gt; = 41 and &lt;em&gt;m&lt;/em&gt; = 3. This is followed by a very pedagogical approach to build the recurrence that is of interest, namely:&lt;/p&gt;
&lt;p&gt;$$
\begin{array}{rcl}
J(1) &amp;amp; = &amp;amp; 1\cr
J(2n) &amp;amp; = &amp;amp; 2J(n)-1,\quad \text{for}\, n \ge 1\cr
J(2n + 1) &amp;amp; = &amp;amp; 2J(n) + 1,\quad \text{for}\, n\ge 1
\end{array}
$$&lt;/p&gt;
&lt;p&gt;Note that $J(n)$ is not defined in term of $J(n-1)$, but there&amp;rsquo;s more to see. It can be seen that $J(n)$ is an increasing odd sequence that restarts with $J(n) = 1$ as soon as &lt;em&gt;n&lt;/em&gt; is a power of 2. This yields the following theorem:&lt;/p&gt;
&lt;p&gt;$$\text{If}\, n=2^m+l\,\text{and}\, 0\le l \le 2^m,\, \text{then}\, J(n) = 2l+1.$$&lt;/p&gt;
&lt;p&gt;This yields an explicit expression for $J(n)$, by the way: $J(n) = 2(n-2^{\lfloor\log_2(n)\rfloor})+1$. Using Mathematica, indeed we can confirm that $J(40)=17$ (p. 9, 2nd ed.):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;With&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="n"&gt;Floor&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Log2&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;]])&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Out&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;17&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;There is also a nice discussion of radix 2 representations of &lt;em&gt;n&lt;/em&gt; and $J(n)$, where it is shown that $J(n)$ is obtained by performing a one-bit cyclic shift left, which happens to be a &lt;a href="https://mathematica.stackexchange.com/a/33598"&gt;RotateLeft&lt;/a&gt; in Mathematica. There used to be a &lt;code&gt;Josephus&lt;/code&gt; function in Mathematica, in the &lt;em&gt;Combinatorica&lt;/em&gt; package, but it&amp;rsquo;s now part of the Wolfram language itself. Given the natural recursion involved, it is, however, not difficult to write a proper function in Scheme:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;josephus&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="nv"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;= &lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;+ &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;modulo &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;+ &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;josephus&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;- &lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;m&lt;/span&gt; &lt;span class="mi"&gt;-1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;josephus&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Python and H2O</title><link>https://aliquote.org/post/python-h2o/</link><pubDate>Tue, 28 Jan 2020 09:40:17 +0100</pubDate><guid>https://aliquote.org/post/python-h2o/</guid><description>&lt;p&gt;Back in &lt;a href="https://aliquote.org/post/python-scientific-packages/"&gt;2008&lt;/a&gt; I started looking at what&amp;rsquo;s available in Python for statistical analysis on OS X. &lt;a href="https://aliquote.org/post/python-for-statistical-computing/"&gt;Few years after&lt;/a&gt;, there already was a growing stack of packages. However, I never felt comfortable using Python for data processing other than basic web scraping or bioinformatics stuff. I always found R much more suitable for structured data. In the mean time, I&amp;rsquo;ve been following the advance of the &lt;a href="https://www.h2o.ai"&gt;h2o&lt;/a&gt; machine learning library for a long time now, and I used to rely on it a little as a replacement for the &lt;a href="https://cran.r-project.org/web/packages/caret/index.html"&gt;caret&lt;/a&gt; package, now part of (or replaced with) &lt;a href="https://github.com/tidymodels/tidymodels"&gt;tidymodels&lt;/a&gt;. Everything&amp;rsquo;s must be tidy, right?&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; The documentation is &lt;a href="http://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science/glm.html"&gt;quite good&lt;/a&gt; actually (&lt;a href="http://docs.h2o.ai/h2o/latest-stable/h2o-docs/booklets/GLMBooklet.pdf"&gt;PDF&lt;/a&gt; version), and there are &lt;a href="https://github.com/h2oai/h2o-tutorials"&gt;many tutorials&lt;/a&gt; available on Github. I know there are bindings for Scala and Java as well, but I&amp;rsquo;m not really interest in those languages. Let&amp;rsquo;s see how it goes when using Python for the next few months, and I shall write another blog post of the kind.&lt;/p&gt;
&lt;p&gt;What&amp;rsquo;s the deal after all? Basically, I don&amp;rsquo;t really like using the &lt;a href="https://scikit-learn.org/stable/index.html"&gt;scikit-learn&lt;/a&gt; package &amp;mdash; this has nothing to do with the authors or the package itself, this is just me not so versed into using a mix of functions and methods all in an interpreted OO language. &lt;a href="http://docs.h2o.ai/h2o/latest-stable/h2o-py/docs/intro.html"&gt;H2o&lt;/a&gt; or &lt;a href="https://pypi.org/project/python-weka-wrapper3/"&gt;weka&lt;/a&gt; are great alternatives in my view, and they are available for R too. Being able to work with such great libraries from both R or Python is a huge win, IMHO. Likewise, I don&amp;rsquo;t really like &lt;a href="https://pandas.pydata.org"&gt;Pandas&lt;/a&gt;, but there&amp;rsquo;s Spark which also handles data frame-like object.&lt;/p&gt;
&lt;p&gt;Basically, Spark is the successor of Hadoop, with built-in modules for processing streaming or SQL-like data, machine learning or even &lt;a href="https://spark.apache.org/docs/latest/graphx-programming-guide.html"&gt;graph processing&lt;/a&gt;. It runs in the console using a Scala or Python backend. In case you use Python, don&amp;rsquo;t forget to set the relevant version of Python you want to use in your shell config, e.g., &lt;code&gt;export PYSPARK_PYTHON=python3&lt;/code&gt; if you&amp;rsquo;re using Bash or Zsh. If you are an R and/or RStudio user, you probably alredy know the &lt;a href="https://spark.rstudio.com"&gt;sparklyr&lt;/a&gt; package. If you&amp;rsquo;re into Python, the corresponding standalone package is &lt;a href="https://pypi.org/project/pyspark/"&gt;pyspark&lt;/a&gt; (beware that it&amp;rsquo;s a large download). While data frame objects are available on Spark, the core data structure is a Resident Distributed Dataset (RDD), which stands for an immutable (i.e., read-only) partitioned collection of records. Thanks to in-memory processing computation, it alleviates the large time spent in disk IO read/write that is commonly encoutered with Hadoop. The corresponding file format for data import/export is usually &lt;a href="https://spark.apache.org/docs/latest/sql-data-sources-parquet.html"&gt;Parquet&lt;/a&gt;, while &lt;a href="https://spark.apache.org/sql/"&gt;Spark SQL&lt;/a&gt; acts as the main query language to access those columnar data structures. However, you can still rely on &lt;a href="https://docs.databricks.com/spark/latest/dataframes-datasets/introduction-to-dataframes-python.html"&gt;data frames&lt;/a&gt;. So far, so good.&lt;/p&gt;
&lt;p&gt;Finally, &lt;a href="https://plot.ly/python/"&gt;plotly&lt;/a&gt; is a handy replacement for &lt;a href="https://matplotlib.org"&gt;matplotlib&lt;/a&gt; or &lt;a href="https://seaborn.pydata.org"&gt;seaborn&lt;/a&gt;, while I can imagine that &lt;a href="https://plot.ly/dash/"&gt;dash&lt;/a&gt; could easily replace most of Shiny functionalities at some point. Althat to say that I am looking for strong and reliable libraries available cross-platform, in R or Python. Plotly is more a matter of convenience than a real taste, to be honest. While I greatly appreciate the quality of D3 and Vega rendering, I don&amp;rsquo;t like the syntax at all, let alone the verbose way of inputing and preprocessing data. Having some convenient wrappers to use the plotly backend from R or Python is, however, fine with me. The fact that you can build a custom ggplot graphical object and just use &lt;code&gt;ggplotly()&lt;/code&gt; to get a plotly graph displayed in your browser or a Shiny app is clearly a win.&lt;/p&gt;
&lt;p&gt;Since I&amp;rsquo;m doing quite a lot of stuff in Python these days, why not take a closer look at the data mining stack available there? I will probably write separate posts to highlight what features I find particularly useful (or not) and some of the workflows built upon these tools.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2020-02-25]&lt;/small&gt;&lt;br&gt;
A more classical review of the Python data stack has been published recently by Sebastian Raschka and coll. on ArXiv, see &lt;a href="https://arxiv.org/abs/2002.04803"&gt;Machine Learning in Python: Main developments and technology trends in data science, machine learning, and artificial intelligence&lt;/a&gt;.
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;&lt;img src="https://aliquote.org/img/2020-01-28-20-54-54.png" alt="everything&amp;rsquo;s tidy"&gt;&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Digit sum and factorial</title><link>https://aliquote.org/post/digit-sum-factorial/</link><pubDate>Fri, 10 Jan 2020 12:22:22 +0100</pubDate><guid>https://aliquote.org/post/digit-sum-factorial/</guid><description>&lt;p&gt;I already talked about &lt;a href="https://aliquote.org/post/digit-sum/"&gt;digit sum&lt;/a&gt; earlier but I wanted to extend this to the case where we would like to apply a specific transformation to each digit of a given number. For example, as stated in Euler problem 34, we could consider factorial digit sum, where we compute the sum of the factorial of each digit and test whether it equals the numbr itself. A generalization of this problem is what was coined &lt;a href="https://en.wikipedia.org/wiki/Factorion"&gt;factorions&lt;/a&gt;. In the case of Euler problem, these are factorions of base 10. We know that those numbers are seven digits or less since 9! × &lt;em&gt;k&lt;/em&gt; &amp;lt; 10&lt;sup&gt;&lt;em&gt;k&lt;/em&gt;&lt;/sup&gt;. A related problem is to find &lt;a href="https://en.wikipedia.org/wiki/Narcissistic_number"&gt;narcissistic&lt;/a&gt; numbers (as in, e.g. problem 30). The solution highlighted below could be used as well.&lt;/p&gt;
&lt;p&gt;Here is how to compute such numbers in Racket. First, we need to convert a number to a list of digit; the order of the digits in the list does not matter for our purpose:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;require&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;digits&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;zero?&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;null&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cons&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;remainder&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;digits&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;quotient&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)))))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then, of course, we need the more specific stuff, namely a function that computes the digit sum:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;map&lt;/span&gt; &lt;span class="n"&gt;factorial&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;range&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;digit-sum&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;apply&lt;/span&gt; &lt;span class="nb"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;map&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list-ref&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;digits&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The rest is just using a &lt;code&gt;for/list&lt;/code&gt; form with a guard, e.g., &lt;code&gt;#:when (= i (digit-sum i))&lt;/code&gt;. A more &amp;ldquo;&lt;a href="https://math.stackexchange.com/a/533677"&gt;compact solution&lt;/a&gt;&amp;rdquo; using Mathematica has been proposed.&lt;/p&gt;
&lt;p&gt;Of note, there are several ways to optimize these computations, but the most critical aspect in the above code is the repeated use of the same factorials: Some caching of intermediate results (especially, combinations of digits, not digit factorial) would probably be in order. Another idea is to use &lt;a href="https://math.stackexchange.com/a/35726"&gt;lower and upper bounds&lt;/a&gt; to restrict the brute force search to a relevant interval. And, finally, why wrote a program when Wikipedia or the &lt;a href="http://oeis.org/A014080"&gt;OEIS&lt;/a&gt; tell us there are only two integer, 145 (1!+4!+5!) and 40585 (4!+0!+5!+8!+5!), that verify this property (1 and 2 are excluded since they are not proper sums)? Just to learn a bit more of Racket, I guess, since I didn&amp;rsquo;t find any real &lt;a href="https://aliquote.org/post/armstrong-numbers/"&gt;application&lt;/a&gt; of factorion in real life.&lt;/p&gt;</description></item><item><title>Finding the majority element in a list</title><link>https://aliquote.org/post/majority-element/</link><pubDate>Thu, 09 Jan 2020 10:28:02 +0100</pubDate><guid>https://aliquote.org/post/majority-element/</guid><description>&lt;p&gt;One of &lt;a href="http://rosalind.info/problems/maj/"&gt;Rosalind&lt;/a&gt; problems deals with finding the &amp;ldquo;majority element&amp;rdquo; of a vector, which is defined as the value that appears in more than half of the entries. Note that this is a little different from what we usually call the mode in statistics. This is a pretty simple task to run using, e.g., Python or R.&lt;/p&gt;
&lt;p&gt;Here is a solution in Python:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;collections&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Counter&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;maj&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;&amp;#34;&amp;#34;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; &amp;gt;&amp;gt;&amp;gt; items = [8, 7, 7, 7, 1, 7, 3, 7]
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; &amp;gt;&amp;gt;&amp;gt; print(maj(items))
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; 7
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; &amp;#34;&amp;#34;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Counter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cnt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;most_common&lt;/span&gt;&lt;span class="p"&gt;()[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;cnt&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We could probably use numpy and/or scipy as well, but let&amp;rsquo;s keep it simple. I really like the &lt;code&gt;Counter&lt;/code&gt; idiom in Python, which allows to keep a record of the item index that is being processed much like &lt;code&gt;enumerate&lt;/code&gt; does. I missed this in Racket. It is quite easy to tabulate a list of values using a &lt;code&gt;for/list&lt;/code&gt; pattern, as the following code illustrates:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;counter&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;null?&lt;/span&gt; &lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;=&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;car&lt;/span&gt; &lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;counter&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cdr&lt;/span&gt; &lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;counter&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cdr&lt;/span&gt; &lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;)))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;items&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;apply&lt;/span&gt; &lt;span class="nb"&gt;max&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;for/list&lt;/span&gt; &lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;remove-duplicates&lt;/span&gt; &lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;)])&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;counter&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If we want to return both the item value and the associated counts, there are two options (and probably more): either we rely on a hash table, or we return a list (or a pair) of values and counts, like Python&amp;rsquo;s &lt;code&gt;enumerate&lt;/code&gt;; this could be something like replacing &lt;code&gt;(counter i items)&lt;/code&gt; with &lt;code&gt;(list i (counter i items))&lt;/code&gt;, but we will need to update the function used when calling &lt;code&gt;apply&lt;/code&gt; because &lt;code&gt;max&lt;/code&gt; will not accept a tuple of values.&lt;/p&gt;
&lt;p&gt;Here is a little example of using a hash instead of plain lists:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; Credit: https://stackoverflow.com/a/5741004&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; See also math/statistics::samples-&amp;gt;hash&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bagify&lt;/span&gt; &lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;for/fold&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;ht&lt;/span&gt; &lt;span class="o"&gt;#hash&lt;/span&gt;&lt;span class="p"&gt;()))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;in-list&lt;/span&gt; &lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;hash-update&lt;/span&gt; &lt;span class="n"&gt;ht&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="nb"&gt;add1&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;which-max&lt;/span&gt; &lt;span class="n"&gt;ht&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;car&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;argmax&lt;/span&gt; &lt;span class="nb"&gt;cdr&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;hash-&amp;gt;list&lt;/span&gt; &lt;span class="n"&gt;ht&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;table&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bagify&lt;/span&gt; &lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;which-max&lt;/span&gt; &lt;span class="n"&gt;table&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This also (sort of) solves the problem of the joint use of &lt;code&gt;apply&lt;/code&gt; and &lt;code&gt;max&lt;/code&gt; described above:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;argmax&lt;/span&gt; &lt;span class="nb"&gt;cadr&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;for/list&lt;/span&gt; &lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;remove-duplicates&lt;/span&gt; &lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;)])&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;counter&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The same approach could obviously serve the purpose of finding the mode in a list of values, e.g.:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mode&lt;/span&gt; &lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;cond&lt;/span&gt; &lt;span class="p"&gt;[(&lt;/span&gt;&lt;span class="nb"&gt;empty?&lt;/span&gt; &lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;()]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;car&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;argmax&lt;/span&gt; &lt;span class="nb"&gt;cdr&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;hash-&amp;gt;list&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bagify&lt;/span&gt; &lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;))))]))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note that the above procedure will not handle the case of multiple modes.&lt;/p&gt;
&lt;p&gt;Finally, what about &lt;code&gt;enumerate&lt;/code&gt; like idiom in Racket? Here&amp;rsquo;s one solution:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;zip&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;map&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;enumerate&lt;/span&gt; &lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;zip&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;range&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;length&lt;/span&gt; &lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2023-09-04]&lt;/small&gt;&lt;br&gt;
See &lt;a href="https://www.rangakrish.com/index.php/2023/09/04/simulating-python-zip-in-lisp/"&gt;Simulating Python Zip in Lisp&lt;/a&gt; for a more convoluted way of implementing &lt;code&gt;zip&lt;/code&gt; in CL.
&lt;/div&gt;</description></item><item><title>Capture-recapture sampling</title><link>https://aliquote.org/post/capture-recapture/</link><pubDate>Sun, 05 Jan 2020 20:06:52 +0100</pubDate><guid>https://aliquote.org/post/capture-recapture/</guid><description>&lt;p&gt;Capture-recapture (CR) sampling is widely used in ecological research, epidemiology and population biology. I saw a &lt;a href="https://twitter.com/AndrewM_Webb/status/1212673397106388992"&gt;tweet&lt;/a&gt; a few days ago that nicely illustrates the CR method using animated graphics, which has been followed by a &lt;a href="http://www.awebb.info/blog/iterated_mark"&gt;blog post&lt;/a&gt; since then.&lt;/p&gt;
&lt;p&gt;The basic idea underlying CR sampling is that you use simple random sampling to capture a set of &lt;em&gt;n&lt;/em&gt; individuals out of a population of size &lt;em&gt;N&lt;/em&gt;, release this sample once all items have been marked, and then iterate. Sample sizes do not necessarily have to be identical among each capture stage, but you must assume that marking does not affect survival, and that the population is fixed (no death, no new individual). Suppose you take a first sample of size 10 and a second sample of size 15, of which 5 were already marked during the first stage, then the estimated population size would be (10 x 15) / 5 = 30. Obviously, the smaller the number of recaptures, the larger the estimate of population size will be, which makes sense if we think in term of measuring abundance of some quantity. How do we found this number? Assume that &lt;em&gt;x&lt;/em&gt; denotes the number of marked individuals in the observed sample, and &lt;em&gt;X&lt;/em&gt; the corresponding marked individuals in the population of size &lt;em&gt;N&lt;/em&gt;. Then, assuming that the population and sample proportions are equal, i.e., &lt;em&gt;x/n = X/N&lt;/em&gt;, we have &lt;em&gt;N = Xn/x&lt;/em&gt;. This is known as the Lincoln-Peterson Index.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;Another way to show this is to consider the following cross-classification table, where captured individuals are in columns and recaptured indivudals in rows:&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Yes&lt;/th&gt;
&lt;th&gt;No&lt;/th&gt;
&lt;th&gt;Total&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;a&lt;/td&gt;
&lt;td&gt;b&lt;/td&gt;
&lt;td&gt;a+b&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;c&lt;/td&gt;
&lt;td&gt;x&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Total&lt;/td&gt;
&lt;td&gt;a+c&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;N = a+b+c+d&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Assuming the capture and recapture stage are independent, the estimated probability of being captured on both occasions is equal to the product of the probabilities of being captured on each occasion. The missed individuals, &lt;em&gt;x&lt;/em&gt;, is then computed as follows: $\frac{a}{N} = \left( \frac{a+c}{N}\right)\times \left( \frac{a+b}{N}\right)$, whence $a(a+b+\hat x) = (a+c)(a+b)$ and $\hat x = \frac{bc}{a}$.&lt;/p&gt;
&lt;p&gt;This of course is the &lt;em&gt;hypergeometric distribution&lt;/em&gt; in disguise. The hypergeometric distribution plays a central role in random sampling with finite populations. Let&amp;rsquo;s consider an urn with red and black balls. Each time you draw a ball, without replacement: what&amp;rsquo;s the probability of drawing &lt;em&gt;n&lt;/em&gt; red balls? Unlike the case of the binomial distribution, each drawing stage influence the outcome of the next draw since the ratios of red to black balls changes after each draw. Now let&amp;rsquo;s replace red balls with marked individuals from the preceding paragraph, and let&amp;rsquo;s call it &lt;em&gt;Y&lt;/em&gt; the number of individuals that were marked. The probability function of &lt;em&gt;Y&lt;/em&gt; reads:&lt;/p&gt;
&lt;p&gt;$$ \Pr(Y = y) = \frac{{X \choose N}{N-X \choose n-x}}{{N \choose n}}, $$&lt;/p&gt;
&lt;p&gt;such that the value &lt;em&gt;Xn/x&lt;/em&gt; shown above corresponds to the maximum likelihood estimate of &lt;em&gt;N&lt;/em&gt; (write up &lt;em&gt;P(N)/P(N-1)&lt;/em&gt; and find &lt;em&gt;N&lt;/em&gt; such that &lt;em&gt;P(N-1) &amp;lt; P(N)&lt;/em&gt;).&lt;/p&gt;
&lt;p&gt;Here are some highlights from a small &lt;a href="https://aliquote.org/pub/random_walk.r"&gt;simulation&lt;/a&gt; in R. I used a 2D random walk to animate a population of 50 individuals, which were sampled once every 20 frames (sampling rate, 10/50). This baiscally looks like this in R:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-R" data-lang="R"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;walker&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="kr"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;step&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0.1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;coord&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;replicate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;sample&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;c&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;-1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rep&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;TRUE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;step&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nf"&gt;rnorm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kr"&gt;return&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;apply&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;coord&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cumsum&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The remaining of the script is a simple loop to draw the main frame and select randomly 10 individuals every 20 frames. The size and position of the rectangle of sampling ensures that we see enough individuals, but it can be changed. Selected individuals are marked in black, and those who were marked at the preceding stage are highlighted in red. Ideally, we should observe 2 recaptures to recover the exact population size, (10 x 10) /2:&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/rw0020.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/rw0020.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/rw0040.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/rw0040.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/rw0060.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/rw0060.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;And the full story:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/random_walk.gif"&gt;
&lt;/figure&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Since this index is sensitive to the number of recapture, another index has been proposed, the Schnabel index (note that it also depends on the number of CR stages).&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;Tlling, Kate. &lt;a href="https://academic.oup.com/ije/article/30/1/12/619016"&gt;Capture-recapture methods&amp;mdash;useful or misleading?&lt;/a&gt; &lt;em&gt;International Journal of Epidemiology&lt;/em&gt; 2001, 30: 12–14.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>January in review</title><link>https://aliquote.org/post/micro-review-007/</link><pubDate>Thu, 02 Jan 2020 17:13:19 +0100</pubDate><guid>https://aliquote.org/post/micro-review-007/</guid><description>&lt;p&gt;First post of the year, with a little review of recent readings or yet to read items:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://arxiv.org/abs/1912.10642"&gt;Notes on Category Theory with examples from basic mathematics&lt;/a&gt;, by Paolo Perrone. I keep an eye on &lt;a href="https://aliquote.org/post/category-theory/"&gt;Category Theory&lt;/a&gt; as well as &lt;a href="https://arxiv.org/abs/math/0010143"&gt;Number Theory&lt;/a&gt; so this recent review published on arXiv caught my attention. This is a 180-page long monograph with several applications and exercises. It is also nicely typesetted (using &lt;a href="https://tug.org/FontCatalogue/texgyrepagella/"&gt;TeX Gyre Pagella&lt;/a&gt; font, apparently). I just went through the document, but it&amp;rsquo;s clearly something to read this year. Likewise, there&amp;rsquo;s a nice review on (some) &lt;a href="https://arxiv.org/abs/1807.08416"&gt;Fundamental Theorems in Mathematics&lt;/a&gt; which I&amp;rsquo;m keeping on hand for later, probably with &lt;a href="https://arxiv.org/abs/1912.13213"&gt;A Modern Introduction to Online Learning&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;I heard recently about &lt;a href="https://www.duckdb.org"&gt;DuckDB&lt;/a&gt;. No idea if this is worth investigating any further, but the fact that it can be used to execute analytical SQL queries fast while embedded in another process makes it quite interesting if you want to build a strong statistical system using SQL backend and in-database analytics.&lt;/li&gt;
&lt;li&gt;There was nothing like an equalizer on macOS until &lt;a href="https://bitgapp.com/eqmac/"&gt;eqMac2&lt;/a&gt;. The last version add support for Bluetooth and Airplay device, which means we could possibly stream movies or Twitch from the Mac directly to our TV monitor via an Apple TV (not tested).&lt;/li&gt;
&lt;li&gt;I recently came across &lt;a href="https://tailrecursion.com/jlt/"&gt;Just Lisp Things&lt;/a&gt;, with nice blog posts on Common Lisp and, at the time of this writing, macros. On a related note, I found Dimitri Kowanikov&amp;rsquo;s article on &lt;a href="https://kowainik.github.io/posts/2018-06-21-haskell-build-tools.html"&gt;Haskell build tools&lt;/a&gt; very interesting as it provides the most up to date review of the state of Haskell project management. The last thing I read on this topic was Alexis King&amp;rsquo;s &lt;a href="https://lexi-lambda.github.io/blog/2018/02/10/an-opinionated-guide-to-haskell-in-2018/"&gt;opinionated guide to Haskell in 2018&lt;/a&gt;, so it looks like there hasn&amp;rsquo;t been much progress in this direction the last two years. Hoping the best for 2020.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://bbc.github.io/rcookbook/"&gt;BBC Visual and Data Journalism cookbook for R graphics&lt;/a&gt;. Yet another R cookbook, this time with a focus on journalism and data visualization. Note that it relies on the &lt;a href="https://github.com/bbc/bbplot"&gt;bbplot&lt;/a&gt; package, which provides custom themes and layers for ggplot.&lt;/li&gt;
&lt;li&gt;Somehow I missed the release of Michael Betancourt&amp;rsquo;s new article on &lt;a href="https://betanalpha.github.io/assets/case_studies/probabilistic_computation.html"&gt;Probabilistic Computation&lt;/a&gt;. This is pure joy to read his &lt;a href="https://betanalpha.github.io/writing/"&gt;articles&lt;/a&gt;, and and once again he has not failed to live up to his reputation for clear writing and nice illustrations.&lt;/li&gt;
&lt;li&gt;I believe Vega and Vega lite are really top notch libraries for interactive displays, provided you are willing to live with you web browser along your text editor. Here are two recent tutorials, written by Jan Aerts: &lt;a href="http://vda-lab.github.io/2019/12/vegalite"&gt;Vega-Lite tutorial&lt;/a&gt; and &lt;a href="http://vda-lab.github.io/2019/12/vega"&gt;Vega tutorial&lt;/a&gt;. With time I expect to find wrappers for several languages, other than Julia or R. I heard that it may even become &lt;a href="http://metasoarous.com/blog/oz-clojurists-together"&gt;available for clojurists&lt;/a&gt; at some point.&lt;/li&gt;
&lt;li&gt;Is Apple really transitioning to a &lt;a href="https://chromeunboxed.com/apple-safari-google-chrome-chromium-browser-open-source/"&gt;Chromium-based web browser&lt;/a&gt;? This would be surprising, or maybe I &lt;a href="https://mjtsai.com/blog/2019/12/26/apple-news-no-longer-supports-rss/"&gt;should not&lt;/a&gt; be that surprised after all.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Blog rolling:&lt;/strong&gt; &lt;a href="https://kottke.org/19/12/the-eyeless-girls"&gt;The Eyeless Girls&lt;/a&gt; • &lt;a href="http://blog.thegrandlocus.com/2019/12/a-tutorial-on-t-sne-2"&gt;A tutorial on t-SNE (2)&lt;/a&gt; • &lt;a href="https://nibblestew.blogspot.com/2019/12/what-can-clang-format-teach-us-about.html"&gt;What can clang-format teach us about the human condition?&lt;/a&gt; • &lt;a href="https://www.johndcook.com/blog/2019/12/28/expected-number-of-hash-values"&gt;A new take on the birthday problem&lt;/a&gt; • &lt;a href="https://stuartsierra.com/2019/12/29/org-mode-for-blogging"&gt;Org Mode for Blogging&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Micro posting in December</title><link>https://aliquote.org/post/micro-12-2019/</link><pubDate>Sat, 28 Dec 2019 08:50:24 +0100</pubDate><guid>https://aliquote.org/post/micro-12-2019/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-12-02&lt;/a&gt;: TIL about &lt;a href="https://github.com/achillesrasquinha/pipupgrade"&gt;pipupgrade&lt;/a&gt;. So much more convenient than manually checking the results of &lt;code&gt;pip3 freeze | cut -d = -f 1 | xargs -n 1 pip3 search | grep -B2 'LATEST:'&lt;/code&gt;, or blindly apply &lt;code&gt;pip3 freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs pip3 install -U&lt;/code&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-02&lt;/a&gt;: &lt;a href="http://adventures.michaelfbryan.com/posts/how-to-riir/index.html"&gt;How to RiiR&lt;/a&gt;. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-02&lt;/a&gt;: &lt;a href="https://www.lpalmieri.com/posts/2019-12-01-taking-ml-to-production-with-rust-a-25x-speedup/"&gt;Taking ML to production with Rust: a 25x speedup&lt;/a&gt;. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-02&lt;/a&gt;: &lt;a href="https://crates.io/crates/mdbook"&gt;mdBook&lt;/a&gt; is a utility to create modern online books from Markdown files. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-03&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/the-rocket/1459402502" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Martin Tingvall, &lt;em&gt;The Rocket&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-03&lt;/a&gt;: &lt;br&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The generation of random numbers is too important to be left to chance. &amp;mdash; &lt;a href="https://www.ams.org/publicoutreach/feature-column/fcarc-random"&gt;Robert Coveyou&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-12-03&lt;/a&gt;: Fourth website on the go&amp;hellip; Now playing with Django, and it&amp;rsquo;s just whaou! &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-03&lt;/a&gt;: TIL about &lt;a href="https://rentry.co"&gt;https://rentry.co&lt;/a&gt;, a simple Markdown pastebin that allows you to post some words on the internet.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-03&lt;/a&gt;: &lt;a href="https://www.pvk.ca/Blog/2019/11/30/a-multiset-of-observations-with-constant-time-sample-mean-and-variance/"&gt;A Multiset of Observations With Constant-time Sample Mean and Variance&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-03&lt;/a&gt;: &lt;a href="http://www.perladvent.org/2019/"&gt;Perl Advent Calendar 2019&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-04&lt;/a&gt;: &lt;br&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The choice of a first language is what sociologists call a wicked problem. The notion appeared in the context of social policy and identifies problems that cannot be definitely described. Solutions to wicked problems &amp;ldquo;cannot be meaningfully correct or false; and it makes no sense to talk about &amp;lsquo;optimal solutions&amp;rsquo; to [wicked] problems unless severe qualifications are imposed first&amp;rdquo;. &amp;mdash; &lt;a href="http://tomasp.net/blog/2019/first-language/"&gt;What to teach as the first programming language and why&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-12-04&lt;/a&gt;: &lt;br&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;We’re in danger, I think, of treating everything as if it’s some measure of our productivity. Number of steps taken, emails replied-to, articles read, podcasts listened-to. &amp;mdash; &lt;a href="https://inessential.com/2019/12/03/why_i_listen_to_podcasts_at_1x_speed"&gt;Why I Listen to Podcasts at 1x Speed&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-12-04&lt;/a&gt;: Interestingly, &lt;a href="https://cran.r-project.org/web/packages/rio/vignettes/rio.html"&gt;rio&lt;/a&gt; relies on the &lt;code&gt;data.table&lt;/code&gt; package to read/write plain text files, and always return a simple data frame (even when using Haven to import Stata files). &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-04&lt;/a&gt;: &lt;a href="https://www.williamyaoh.com/posts/2019-11-24-design-and-testing-articles.html"&gt;A list of of Haskell articles on good design, good testing&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-04&lt;/a&gt;: &lt;a href="https://github.com/mbutterick/aoc-racket/"&gt;Racket solutions &amp;amp; explanations for the Advent of Code puzzles&lt;/a&gt;, by Matthew Butterick. &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-04&lt;/a&gt;: &lt;a href="https://programming.guide/worlds-most-copied-so-snippet.html"&gt;The most copied StackOverflow snippet of all time is flawed!&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-04&lt;/a&gt;: &lt;a href="https://github.com/Bogdanp/racket-review"&gt;racket-review&lt;/a&gt;, a surface level linter for Racket modules. &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-05&lt;/a&gt;: &lt;br&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Here’s the thing that’s always rubbed me the wrong way about Google. They’re insulting. Steve Jobs, Jeff Bezos, Bill Gates — I completely believe they’re all geniuses. But they never seem(ed) condescending. &amp;mdash; &lt;a href="https://daringfireball.net/linked/2019/12/04/page-brin-google"&gt;A letter from Larry and Sergey&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-12-05&lt;/a&gt;: &lt;br&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Nulls are the most talked about example when it comes to the benefits of strongly-typed functional programming, and indeed being able to use your function parameters immediately without having to do any null checking at all is very nice. &amp;mdash; &lt;a href="https://www.williamyaoh.com/posts/2019-11-30-how-does-haskell-make-life-easier.html"&gt;How does Haskell make your life easier&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-12-05&lt;/a&gt;: Really nice work, by Anamaria Crisan: &lt;a href="https://amcrisan.github.io/adjutant"&gt;Adjutant: an R-based tool to support topic discovery for systematic and literature reviews&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-05&lt;/a&gt;: While I&amp;rsquo;m tinkering to understand the internals of Django, I stumbled across this nice gem on &lt;a href="https://news.ycombinator.com/item?id=12704094"&gt;HN&lt;/a&gt;: (via &lt;a href="https://twitter.com/thorstenball/status/1202517825522479104?s=20"&gt;@thorstenball&lt;/a&gt;)&amp;gt; Hopefully, the next guy to join the company will clean up your shit. The other guys code may not look like shit, but it doesn&amp;rsquo;t solve any useful problems&amp;hellip; so they never got the chance to hire that next guy.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-05&lt;/a&gt;: Working from home today (because the strike). It&amp;rsquo;s been a while&amp;hellip;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-05&lt;/a&gt;: &lt;a href="https://learnk8s.io/troubleshooting-deployments"&gt;A visual guide on troubleshooting Kubernetes deployments&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-05&lt;/a&gt;: &lt;a href="https://inconvergent.net/2019/colour-shift/"&gt;Depth of Field with Colour Shift&lt;/a&gt;. Lovely.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-05&lt;/a&gt;: &lt;a href="https://serokell.io/blog/comparison-of-github-and-gitlab"&gt;GitLab vs. GitHub: Comparison of Features&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-05&lt;/a&gt;: &lt;a href="https://journals.plos.org/plosbiology/article?id=10.1371%2Fjournal.pbio.3000494"&gt;Inferring the mammal tree: Species-level sets of phylogenies for questions in ecology, evolution, and conservation&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-06&lt;/a&gt;: &lt;br&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The TL;DR is that experience, domain knowledge, and discipline are actually the best predictors of startup success and that most successful startup founders are middle aged (mean of 45 years old for the 1 in 1,000 highest growth new ventures) rather than the 20 year old who drops out of school to follow his dreams. &amp;mdash; &lt;a href="https://irreal.org/blog/?p=8494"&gt;The Myth of the Young Entrepreneur&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-12-06&lt;/a&gt;: &lt;br&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;What Medium isn&amp;rsquo;t is a generic blogging or publishing platform. It&amp;rsquo;s narrowed its focus into being more like a magazine that everyone can contribute to (and I&amp;rsquo;m told that more changes are coming in the New Year). In doing so, it inevitably loses some of its early users - and it adds features like a paywall that may drive some casual readers away. &amp;mdash; &lt;a href="https://werd.io/2019/a-medium-dilemma"&gt;A Medium dilemna&lt;/a&gt;Sure, but can they just stop the noise with their banner that popup from nowhere?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-12-06&lt;/a&gt;: Alexa, Say &lt;a href="https://notochrome.org"&gt;No to Chrome&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-06&lt;/a&gt;: Almost done with the first 50 &lt;a href="http://rosalind.info/"&gt;Rosalind&lt;/a&gt; problems on the Bioinformatics Stronghold. &lt;code&gt;#python&lt;/code&gt; &lt;code&gt;#bioinformatics&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-07&lt;/a&gt;: TIL about a very nice &lt;a href="http://jeapostrophe.github.io/archive.html"&gt;archive of posts&lt;/a&gt; on Racket, by Jay McCarthy. &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-07&lt;/a&gt;: &lt;a href="https://aporlebeke.wordpress.com/2019/12/04/suppressing-the-macos-software-update-alert-icon/"&gt;Suppressing the macOS Software Update Alert Icon&lt;/a&gt;: In case you want to stay on Mojave a bit more but are tired of daily notifications.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-09&lt;/a&gt;: &lt;a href="http://metaredux.com/posts/2019/12/08/recording-screencasts-with-emacs.html"&gt;Recording screencasts with Emacs&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-09&lt;/a&gt;: &lt;a href="https://vks.ai/2019-12-05-shrynk-using-machine-learning-to-learn-how-to-compress"&gt;shrynk - Using Machine Learning to learn how to Compress&lt;/a&gt;. Interesting discussion on how to combine flat structured files (e.g. data frames) using fastparquet, pyarrow or CSV + compression (TL;DR &lt;code&gt;csv+bz2&lt;/code&gt; is the definitive winner). &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-09&lt;/a&gt;: &lt;blockquote class="twitter-tweet"&gt;&lt;p lang="en" dir="ltr"&gt;(a) More mnemonic names tend to be over-specific (not all cdrs are tails), and (b) after a week of using Lisp, car and cdr mean the two halves of a cons cell, and languages should be designed for people who&amp;#39;ve used them for more than a week.&lt;/p&gt;&amp;mdash; Paul Graham (@paulg) &lt;a href="https://twitter.com/paulg/status/1184030273345871872?ref_src=twsrc%5Etfw"&gt;October 15, 2019&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async src="https://platform.twitter.com/widgets.js" charset="utf-8"&gt;&lt;/script&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-10&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/candy-o/1088527319" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   The Cars, &lt;em&gt;Candy-O&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-10&lt;/a&gt;: &lt;br&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A cons is really just a 2-tuple, and the halves don’t have any particular meaning on their own, even as “head” and “tail.” However, maybe this is really important to you so you want to do it anyway. What’s the best way to go about it? &amp;mdash; &lt;a href="https://nullprogram.com/blog/2019/12/10/"&gt;Efficient Alias of a Built-In Emacs Lisp Function&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-12-10&lt;/a&gt;: &lt;br&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Most weblogs are unfunded, spare-time ventures, yet most webloggers update their sites five days a week, and some even work on weekends! &amp;mdash; Rebecca Blood, &lt;a href="http://www.rebeccablood.net/handbook/"&gt;The Weblog Handbook&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-12-10&lt;/a&gt;: &lt;a href="https://blog.letsenhance.io/all/2019/07/09/computational-photographyfrom-selfies-to-black-holes/"&gt;Computational Photography From Selfies to Black Holes&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-10&lt;/a&gt;: &lt;a href="https://jsantell.com/l-systems"&gt;L-systems&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-10&lt;/a&gt;: &lt;a href="http://www.iwriteiam.nl/HaCAR_CDR.html"&gt;The origin of CAR and CDR in LISP&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-10&lt;/a&gt;: &lt;a href="https://www.evanjones.ca/ordered-vs-unordered-indexes.html"&gt;Why databases use ordered indexes but programming uses hash tables&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-11&lt;/a&gt;: &lt;br&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Having a website and/or blog is not about being a web developer, nor about being a celebrity of sorts, but is about being a citizen of the Web. &amp;mdash; &lt;a href="https://www.jvt.me/posts/2019/07/22/why-website/"&gt;Why I Have a Website and You Should Too&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-12-11&lt;/a&gt;: &lt;br&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;It&amp;rsquo;s not about hoarding the riches for Twitter: it&amp;rsquo;s about baking an ever-increasing pie that everyone can have a slice of. &amp;mdash; &lt;a href="https://werd.io/2019/twitters-project-bluesky"&gt;Twitter&amp;rsquo;s Project Bluesky&lt;/a&gt;On a related note (re. Twitter, not decentralized social networks), I recently reduced the number of people I was tracking (1200+) to less than 390 and my timeline has become much more readable. I believe the noise was mostly coming from too much RTs from folks I followed once for some interesting threads but whose own tweets flow did not last over time. My own centers interest have surely evolved as well. Apologies for those I&amp;rsquo;ve unfollowed and still follow me on Twitter. I can&amp;rsquo;t promise I&amp;rsquo;ll come back someday, but you have this micro-blog in the meantime.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-12-11&lt;/a&gt;: &lt;br&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The terms “blockchain” and “distributed ledger technology (DLT)” are very often used as synonyms. Guess what: they are not! &amp;mdash; &lt;a href="https://serokell.io/blog/blockchain-vs-dlt"&gt;Blockchain vs. DLT: What&amp;rsquo;s The Difference?&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-12-11&lt;/a&gt;: I just plugged this good old &lt;code&gt;fci-mode&lt;/code&gt; into my Emacs config. Indent guides were already a really nice add-on, but the 80-char ruler is really useful if you&amp;rsquo;re versed into PEP8 and the like. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-12-11-20-45-22.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-11&lt;/a&gt;: &lt;a href="https://dockersl.im"&gt;DockerSlim&lt;/a&gt;: Minify and Secure Your Docker Containers.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-11&lt;/a&gt;: &lt;a href="https://blog.mozilla.org/nnethercote/2019/12/11/how-to-speed-up-the-rust-compiler-one-last-time-in-2019/"&gt;How to speed up the Rust compiler one last time in 2019&lt;/a&gt;. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-11&lt;/a&gt;: &lt;a href="https://btholt.github.io/intro-to-web-dev-v2/"&gt;Intro to web dev&lt;/a&gt; (v2).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-12&lt;/a&gt;: &lt;br&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I know a lot of people dislike semantic versioning. They hate how requires incrementing the major version number every time a breaking change is made.&lt;br&gt;&amp;gt; I consider it to be a good thing.&lt;br&gt;&amp;gt; You should pause and carefully consider making a change that will break people’s current code.&lt;br&gt;&amp;gt; You should be ashamed if your project is at version 43.0.0 because you’ve made 42 breaking changes. That’s 43 times you’ve disregarded your users’ time! That’s a bad thing! &amp;mdash; &lt;a href="http://stevelosh.com/blog/2012/04/volatile-software/"&gt;Volatile Software&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-12-12&lt;/a&gt;: &lt;br&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Writing Isn’t Magic; It’s Hard Work&lt;br&gt;&amp;gt; I used to struggle to get my thoughts onto the page because the first time I put them down, they were complete crap. The second time I put them down, they were also crap. And the third time. And the fourth time. And the fifth time. But each time, what I was writing got a little bit better, and eventually I realized that by approximately the fiftieth time I revised something, I’d have something really good; therefore, if I wanted to write something worth reading, all I had to do was put in the time and effort to revise it enough times. &amp;mdash; &lt;a href="https://www.susanjfowler.com/blog/2019/12/10/my-year-in-review-2019"&gt;My Year In Review: 2019&lt;/a&gt;So nothing unusual about what I write sometimes looks like shit: I never reread more than one and a half times.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-12-12&lt;/a&gt;: TIL there&amp;rsquo;s something like a new TeX compiler available on the market of typesetting: &lt;a href="https://tectonic-typesetting.github.io/en-US/"&gt;The Tectonic Typesetting System&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-12&lt;/a&gt;: &lt;a href="https://lisp-journey.gitlab.io/pythonvslisp/"&gt;Python VS Common Lisp, workflow and ecosystem&lt;/a&gt;. Really nice review, and I was happy to find a reference to one of Steve Losh&amp;rsquo;s very nice post: &lt;a href="http://stevelosh.com/blog/2018/08/a-road-to-common-lisp/"&gt;A Road to Common Lisp&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt; &lt;br&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;As you learn Common Lisp and look for libraries, try to suppress the voice in the back of your head that says “This project was last updated six years ago? That’s probably abandoned and broken.” The stability of Common Lisp means that sometimes libraries can just be done, not abandoned, so don’t dismiss them out of hand.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-12-12&lt;/a&gt;: &lt;a href="https://aliquote.org/post/scheme-and-emacs/"&gt;Racket and Geiser&lt;/a&gt; &amp;mdash; still working after all those years! This is mostly like R REPL, but with inline graphics like in iPython using Qt console. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-12-12-20-11-56.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-13&lt;/a&gt;: This new thing, &lt;a href="https://plot.ly/dash/"&gt;Dash&lt;/a&gt;, by the Plotly team looks &lt;a href="https://dash-gallery.plotly.host/Portal/"&gt;so nice&lt;/a&gt;! First time I see a serious contender to Shiny for visual analytics dashboards.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-13&lt;/a&gt;: &lt;a href="http://martin.zinkevich.org/rules_of_ml/rules_of_ml.pdf"&gt;Best Practices for ML Engineering&lt;/a&gt; (PDF, 24 pp.).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-16&lt;/a&gt;: &lt;br&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;There has been a increasing trend in healthcare and criminal justice to leverage machine learning (ML) for high-stakes prediction applications that deeply impact human lives… The lack of transparency and accountability of predictive models can have (and has already had) severe consequences&amp;hellip; &amp;mdash; &lt;a href="https://blog.acolyer.org/2019/10/28/interpretable-models/"&gt;Stop explaining black box machine learning models for high stakes decisions and use interpretable models instead&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-12-16&lt;/a&gt;: Before getting an iPhone 3, I was a happy owner of a Blackberry. This &lt;a href="http://morrick.me/archives/8668"&gt;little review&lt;/a&gt; brought back a lot of memories from that time.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-16&lt;/a&gt;: &lt;a href="https://ericmjl.github.io/blog/2019/12/15/a-review-of-the-python-data-science-dashboarding-landscape-in-2019/"&gt;A Review of the Python Data Science Dashboarding Landscape in 2019&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-16&lt;/a&gt;: &lt;a href="https://bowero.nl/blog/2019/12/15/c-what-the-fuck/"&gt;C, what the fuck??!&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-16&lt;/a&gt;: &lt;a href="https://psyc-bayes-notes.netlify.com"&gt;Handouts for Bayesian Data Analysis &lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-16&lt;/a&gt;: &lt;a href="https://www.mdsec.co.uk/2019/12/macos-filename-homoglyphs-revisited/"&gt;MacOS Filename Homoglyphs Revisited&lt;/a&gt;: Didn&amp;rsquo;t know there was such a thing in Mojave.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-16&lt;/a&gt;: &lt;a href="https://github.com/liuxinyu95/unplugged"&gt;Mathematics of Programming&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-17&lt;/a&gt;: &lt;a href="https://functional.christmas/2019/13"&gt;Functional Generative Art Using ClojureScript&lt;/a&gt;. &lt;code&gt;#dataviz&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-17&lt;/a&gt;: &lt;a href="https://github.com/dwarvesf/hidden"&gt;Hidden Bar&lt;/a&gt; lets you hide menu bar items to give your Mac a cleaner look. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-17&lt;/a&gt;: &lt;a href="https://m.stopa.io/macros-by-example-6ddbc8f3d93b"&gt;Macros by Example&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Macros let you change your language to suit your problem. This is extremely powerful: You can build up your language so you can express your problem as clearly as possible. This makes your code more concise and simple, which in turn makes your system more malleable.&lt;a href="http://lists.warhead.org.uk/pipermail/iwe/2005-July/000130.html"&gt;Why Lisp macros are cool, a Perl perspective&lt;/a&gt;.&amp;gt; But a bigger advantage is that it makes it possible to write Lisp programs that reliably generate and transform Lisp source code. If you&amp;rsquo;re not used to Lisp, it&amp;rsquo;s hard to imagine how tremendously useful this is. People who come from the Perl and C world have a deep suspicion of source code transformation, because it&amp;rsquo;s invariably unreliable.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-12-17&lt;/a&gt;: &lt;a href="https://functional.christmas/2019/17"&gt;Visualize bike rental data in Clojure&lt;/a&gt;, using &lt;a href="https://github.com/quil/quil"&gt;Quil&lt;/a&gt;. &lt;code&gt;#dataviz&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-18&lt;/a&gt;: &lt;br&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A fair look back at Tim Cook’s first decade in charge of Apple. The biggest knock? Taking their eyes off the Mac ball in the middle of the decade — with a Mac Pro that wound up not being very pro and a MacBook Air that stagnated with a non-retina display. &amp;mdash; &lt;a href="https://daringfireball.net/linked/2019/12/17/mossberg-apple-decade"&gt;Walt Mossberg on Apple&amp;rsquo;s Decade&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-12-18&lt;/a&gt;: &lt;br&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If you want to tell something, just do it. Even if that&amp;rsquo;s just one thing. Another thing may come to your mind, but it&amp;rsquo;s no problem when that&amp;rsquo;s years later. Just start a blog. &amp;mdash; &lt;a href="https://jlelse.blog/links/2019/12/blog-commitment/"&gt;A blog is not a commitment&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-12-18&lt;/a&gt;: &lt;br&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In short, R is a functional programming language masquerading as an imperative language. (&amp;hellip;) Nonstandard evaluation is the Wild Wild West of metaprogramming. &amp;mdash; &lt;a href="https://www.epatters.org/post/r-lang/"&gt;The R programming language: The good, the bad, and the ugly&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-12-18&lt;/a&gt;: TIL DuckDuckGo has as HTML Beautifier builtin (via &lt;a href="https://www.jvt.me/posts/2019/12/17/xml-pretty-print/"&gt;Jamie Tanna&lt;/a&gt;).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-18&lt;/a&gt;: &lt;a href="https://functional.christmas/2019/18"&gt;That one time I thought I understood recursion&lt;/a&gt; (via HN).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-19&lt;/a&gt;: Soon to be on holiday for the rest of the decade! With 160 posts and 1569 micro-posts written since I rebooted this site from scratch.&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_0691.jpg" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-19&lt;/a&gt;: TIL about &lt;a href="https://mailfence.com/"&gt;Mailfence&lt;/a&gt;, which looks like a great alternative to Fastmail, with similar prices but hosted in Belgium. (via &lt;a href="https://irreal.org/blog/?p=8524"&gt;Irreal&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-19&lt;/a&gt;: Two interesting posts on the generation of random mazes: &lt;a href="http://weblog.jamisbuck.org/2010/12/29/maze-generation-eller-s-algorithm"&gt;Maze Generation: Eller&amp;rsquo;s Algorithm&lt;/a&gt;, &lt;a href="http://www.neocomputer.org/projects/eller.html"&gt;Eller&amp;rsquo;s Algorithm&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-19&lt;/a&gt;: &lt;a href="https://github.com/yeun/open-color"&gt;Color scheme for UI design&lt;/a&gt;. (via &lt;a href="https://twitter.com/phnk"&gt;@phnk&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-19&lt;/a&gt;: &lt;a href="https://homotopytypetheory.org/book/"&gt;Homotopy Type Theory&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-19&lt;/a&gt;: &lt;a href="https://github.com/josdejong/mathjs"&gt;Math.js&lt;/a&gt; is an extensive math library for JavaScript and Node.js. &lt;code&gt;#javascript&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-19&lt;/a&gt;: &lt;a href="https://github.com/tssm/up-to-date-real-world-haskell"&gt;Real World Haskell&lt;/a&gt; book. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-20&lt;/a&gt;: &lt;br&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Every minute of every day, everywhere on the planet, dozens of companies — largely unregulated, little scrutinized — are logging the movements of tens of millions of people with mobile phones and storing the information in gigantic data files. &amp;mdash; &lt;a href="https://www.nytimes.com/interactive/2019/12/19/opinion/location-tracking-cell-phone.html"&gt;Twelve Million Phones, One Dataset, Zero Privacy&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-12-20&lt;/a&gt;: &lt;br&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Humans seem to be wired to believe that we can and should try to improve ourselves and our surroundings, but in a mechanistic world (random or otherwise), it doesn’t actually matter what you do. This question is Absurd because of the conflict between self-improvement—and a desire to do good in the world—being some of the most important reasons that humans have to exist, and the issue that if free will is an illusion then we’re all just taking credit for the universe unfolding as it was going to anyway. &amp;mdash; &lt;a href="https://danielmiessler.com/blog/how-absurdism-applies-in-everyday-life/"&gt;How Absurdism Applies in Everyday Life&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-12-20&lt;/a&gt;: GGplot &lt;a href="https://metacpan.org/pod/Chart::GGPlot"&gt;available for Perl&lt;/a&gt; users.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-20&lt;/a&gt;: &lt;a href="https://support.apple.com/fr-fr/guide/security/welcome/web"&gt;Apple Platform Security&lt;/a&gt; (via &lt;a href="https://daringfireball.net/linked/2019/12/19/apple-platform-security"&gt;Daring Fireball&lt;/a&gt;) (&lt;a href="https://manuals.info.apple.com/MANUALS/1000/MA1902/en_US/apple-platform-security-guide.pdf"&gt;PDF&lt;/a&gt;). &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-20&lt;/a&gt;: &lt;a href="http://calculist.org/blog/2012/04/17/homoiconicity-isnt-the-point/"&gt;Homoiconicity isn’t the point&lt;/a&gt; (but &lt;code&gt;read&lt;/code&gt; is).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-20&lt;/a&gt;: &lt;a href="https://nicolas-hoizey.com/2017/07/so-long-disqus-hello-webmentions.html"&gt;So long Disqus, hello Webmention&lt;/a&gt;. (via &lt;a href="https://www.jvt.me/mf2/2019/12/hczvr/"&gt;Jamie Tanna&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-12-20&lt;/a&gt;: &lt;a href="https://jeffhuang.com/designed_to_last/"&gt;This Page is Designed to Last&lt;/a&gt;, with seven unconventional guidelines in how we handle websites designed to be informative, to make them easy to maintain and preserve.&lt;br&gt;&lt;/p&gt;</description></item><item><title>Palindrome number</title><link>https://aliquote.org/post/numeric-palindrome/</link><pubDate>Fri, 27 Dec 2019 18:24:15 +0100</pubDate><guid>https://aliquote.org/post/numeric-palindrome/</guid><description>&lt;p&gt;Today, as I was checking my RSS feeds, I came across the latest &lt;a href="https://irreal.org/blog/?p=8543"&gt;post&lt;/a&gt; on Irreal blog, which pointed to a &lt;a href="http://funcall.blogspot.com/2019/12/in.html"&gt;post&lt;/a&gt; by Joe Marshall that I read few days ago. The post in question was about implementing a palindrome checker, and I liked the way Joe Marshall exposed the algorithm as a set of three equations, including the base case that is commonly used to terminate a recursive function.&lt;/p&gt;
&lt;p&gt;Several problems on the Euler project involve palindromes. For instance, for &lt;a href="https://projecteuler.net/problem=36"&gt;problem 36&lt;/a&gt;, I wrote the following function in Python:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;is_palindrome&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;[::&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;True&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;False&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note that this relies on an integer to string explicit conversion, but it allows array slicing (which is still better than &lt;code&gt;reversed()&lt;/code&gt;, in the case of strings at least). &lt;a href="https://projecteuler.net/problem=4"&gt;Problem 4&lt;/a&gt; also deals with palindromic number, and this time I used the folllowing Racket code, again with an integer to string conversion:&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rev-string&lt;/span&gt; &lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list-&amp;gt;string&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;reverse&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;string-&amp;gt;list&lt;/span&gt; &lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;palindrome?&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;equal?&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;number-&amp;gt;string&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rev-string&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;number-&amp;gt;string&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It is, however, not necessary to use such string representation to work with palindromic number, much like we don&amp;rsquo;t necessarily needs to convert a number to a string in order to get a &lt;a href="https://aliquote.org/post/digit-sum/"&gt;list of its digits&lt;/a&gt;. Here&amp;rsquo;s now some C code to detect if a given integer is a palindrome number or not:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-c" data-lang="c"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;stdbool.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="nf"&gt;is_palindrome&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;reverse&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;reverse&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;reverse&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;reverse&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;/=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;reverse&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;reverse&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The clause &lt;code&gt;x == reverse/10&lt;/code&gt; in the return statement is here to ensure that edge cases like 222 are detected as well.&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;In the meantime I learned that it is possible to use &lt;code&gt;foldl&lt;/code&gt; pattern to reverse a list: &lt;code&gt;(define (rev lst) (foldl cons '() lst))&lt;/code&gt;.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Moom App</title><link>https://aliquote.org/post/moom-app/</link><pubDate>Thu, 26 Dec 2019 18:53:06 +0100</pubDate><guid>https://aliquote.org/post/moom-app/</guid><description>&lt;p&gt;I am a long time user of &lt;a href="https://manytricks.com/moom/"&gt;Moom&lt;/a&gt;, a tiny application that helps you manage the windows on your desktop. I know there are many such applications dedicated to window management on macOS, but this one is quite handy for several reasons. First, it comes with keyboard shortcuts, which you enable using a hot key (mine is &lt;kbd&gt;^-⇧-M&lt;/kbd&gt;) followed by the action you want to perform. Here&amp;rsquo;s an example of the default actions that are configured:&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2019-12-26-18-56-46.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2019-12-26-18-56-46.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This is handy if you like to stay away from the mouse or the touchpad as much as you can. However, the second reason why I like Moom is that is non obtrusive: You can hide the icon in the menu bar and let the application starts at login, so you never realize that is running in the background. It adds a tiny menu (aka Moom&amp;rsquo;s palette) to the top-left &amp;ldquo;green&amp;rdquo; button of each window, which allows to resize the running application half-screen (left/right or top/bottom) or full-screen. Compared to the split view in fullscreen mode, I always found it much more powerful. It is not a tiling window manager, but it&amp;rsquo;s close.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-12-26-19-02-12.png"&gt;
&lt;/figure&gt;
&lt;p&gt;A final feature of Moom is that you can drap app to border or corner of your desktop in order to automagically resize your windows. I don&amp;rsquo;t use this feature as much as the keyboard shortcuts and Moom&amp;rsquo;s palette, but it is an interesting option anyway. Usually, I have the following settings: Mail fullscreen on a dedicated space, when I use it of course; iTerm half screen or maximized/fullscreen if I use several panes; Emacs, two third screen or maximized when I need to work on several buffers; Safari, maximized. Then I usually rely on &lt;kbd&gt;⌥-⇥&lt;/kbd&gt; to switch between opened apps. All those window arrangements can be performed using Moom shortcuts, as a matter of fact.&lt;/p&gt;
&lt;p&gt;There are many other features described on the website, like saved window layout and grid resizing, but to be honest I don&amp;rsquo;t really use them. I have always been looking for a very simple way to maximize my windows or make them fit on half the screen. If this is what you&amp;rsquo;re after too, then Moom is definitely a good option to try. It is a paid app, but it&amp;rsquo;s worth its $10.&lt;/p&gt;
&lt;h3 id="sidenote"&gt;Sidenote&lt;/h3&gt;
&lt;p&gt;As I said, Moom is not a tiling window manager (WM). There have been various attempts at providing a full tiling WM for the Mac over the past few years, but I don&amp;rsquo;t know of any native app which cound competete with Linux &lt;a href="https://i3wm.org"&gt;i3&lt;/a&gt; or &lt;a href="https://www.tecmint.com/best-tiling-window-managers-for-linux/"&gt;other alternatives&lt;/a&gt;. The last one to date for the Mac was &lt;a href="https://github.com/koekeishiya/chunkwm"&gt;chunkwm&lt;/a&gt;, but it has been archived. I haven&amp;rsquo;t tried &lt;a href="https://github.com/ianyh/Amethyst"&gt;Amethyst&lt;/a&gt;, and I don&amp;rsquo;t even know if &lt;a href="https://xmonad.org"&gt;xmonad&lt;/a&gt; works as expected on macOS nowadays. Lately, I&amp;rsquo;ve been playing with &lt;a href="http://www.hammerspoon.org"&gt;Hammerspoon&lt;/a&gt; and Szymon Kaliski&amp;rsquo;s tiling WM, &lt;a href="https://github.com/szymonkaliski/hhtwm"&gt;hhtwm&lt;/a&gt;, but I found it too complicated for what I need, despite being able to configure it quite easily thanks to Simon&amp;rsquo;s own config. Anyway, it is there if I need it: I just have to launch Hammerspoon; at least, all newly opened applications will start in full size centered on screen.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
As of January 2020, I have tried Amethyst, and I found it much better than Hammerspoon hhtwm, at least if we consider it works right out of the box, without further configuration. Unfortunately, the tiling option (&lt;code&gt;--no-title-bar&lt;/code&gt;) available in recent &lt;code&gt;emacs-plus&lt;/code&gt; version (actually, GNU Emacs 28.0.50 from the &lt;code&gt;HEAD&lt;/code&gt; version) is quite buggy, while the iTerm2 option works perfectly well, which means I would not really benefit from tiling layouts &amp;mdash; notwithstanding the fact that the size of the Macbook 12 screen isn&amp;rsquo;t well suited for such window arrangements.
&lt;/div&gt;</description></item><item><title>Decimal expansion and coprimes</title><link>https://aliquote.org/post/decimal-expansion/</link><pubDate>Wed, 25 Dec 2019 08:42:43 +0200</pubDate><guid>https://aliquote.org/post/decimal-expansion/</guid><description>&lt;p&gt;One of Euler problems deals with &lt;a href="https://projecteuler.net/problem=26"&gt;reciprocal cycles&lt;/a&gt;. When you write unit fractions using their decimal representation, you soon find that 1/3 which reads 0.33333 can be written as 0.(3) to indicate that it has a 1-digit recurring cycle. Likewise, 1/6 is simply 0.1(6), and so on. Eric Hanchrow provided a very &lt;a href="https://github.com/offby1/project-euler"&gt;elegant solution&lt;/a&gt; to solve this problem in Racket, by using coprime and a &lt;code&gt;for/fold&lt;/code&gt; form. That&amp;rsquo;s what I ended up using (with little rewrite) because I was struggling with this problem for days until I came across this solution. I made up for that cheating by doing some research, especially &lt;a href="https://artofmemory.com/wiki/Decimal_Representation_of_Fractions"&gt;digging&lt;/a&gt; &lt;a href="https://stackoverflow.com/questions/1315595/algorithm-for-detecting-repeating-decimals"&gt;a bit&lt;/a&gt; &lt;a href="https://math.stackexchange.com/questions/3362329/elementary-way-to-prove-that-if-n-and-10-are-coprime-then-1-n-has-no-tran"&gt;to better&lt;/a&gt; &lt;a href="https://en.wikipedia.org/wiki/Multiplicative_group_of_integers_modulo_n"&gt;understand&lt;/a&gt; the role of &lt;a href="https://en.m.wikipedia.org/wiki/Coprime_integers"&gt;coprimes&lt;/a&gt; in this specific case.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;#lang &lt;/span&gt;&lt;span class="nn"&gt;racket&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;require&lt;/span&gt; &lt;span class="n"&gt;math/number-theory&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lrcdf&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;coprime?&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;unit-group-order&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;for/fold&lt;/span&gt; &lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;in-range&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;)])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lrcdf&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;&amp;lt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cdr&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cons&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As mentioned on the &lt;a href="https://docs.racket-lang.org/math/number-theory.html#%28def._%28%28lib._math%2Fnumber-theory..rkt%29._coprime~3f%29%29"&gt;Racket docs&lt;/a&gt;, a set of integers is considered coprime if their greatest common divisor is 1. To put it in other words, any prime number that divides one does not divide the other.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; Since we are interested in &lt;a href="http://mathworld.wolfram.com/DecimalExpansion.html"&gt;decimal expansion&lt;/a&gt; with a &lt;em&gt;viniculum&lt;/em&gt;, this means that we need to work with integers coprime to 10.&lt;/p&gt;
&lt;p&gt;The key point resolves around &lt;a href="https://en.wikipedia.org/wiki/Full_reptend_prime"&gt;full reptend prime&lt;/a&gt;. According to &lt;a href="https://en.wikipedia.org/wiki/Repeating_decimal"&gt;Wikipedia&lt;/a&gt;, a &lt;em&gt;proper prime&lt;/em&gt; is a prime &lt;em&gt;p&lt;/em&gt; which ends in the digit 1 in base 10 and whose reciprocal in base 10 has a repetend (i.e., repeating decimal segment) with length &lt;em&gt;p&lt;/em&gt; − 1. Each digit appears in the repetend the same number of times, (&lt;em&gt;p&lt;/em&gt;-1)/10. A prime is a proper prime if and only if it is a full reptend prime and congruent to 1 mod 10, i.e. $10^k \equiv 1\ (\text{mod}\ p)$ for $k=p-1, k\nless p-1$. As a side note, we could remark that if this prime number is also &lt;em&gt;safe&lt;/em&gt;, that is a prime of the form 2&lt;em&gt;p&lt;/em&gt; + 1 where &lt;em&gt;p&lt;/em&gt; is also a prime, then 1/&lt;em&gt;p&lt;/em&gt; will produce a &lt;a href="https://oeis.org/A000353"&gt;stream&lt;/a&gt; of &lt;em&gt;p&lt;/em&gt; − 1 pseudo-random digits. Anyway, the idea is to find the first full reptend prime number below a limit, here $d &amp;lt; 1000$.&lt;/p&gt;
&lt;p&gt;I also happened to find a very nice solution in Mathematica, by &lt;a href="https://www.nayuki.io/page/project-euler-solutions"&gt;Nayuki&lt;/a&gt;:&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-12-24-17-03-16.png"&gt;
&lt;/figure&gt;
&lt;p&gt;There&amp;rsquo;s more to see: The following fraction has 2997 recurring decimals!&lt;/p&gt;
&lt;p&gt;$$ \frac{1}{998001} = 0.000001002003004005&amp;hellip; $$&lt;/p&gt;
&lt;p&gt;Indeed, you will successively find all 3-decimal numbers from 000 to 999, until it starts over again at 000. Check out James Grime&amp;rsquo;s explanations on &lt;a href="http://www.numberphile.com/"&gt;Numberphile&lt;/a&gt;.&lt;/p&gt;
&lt;div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"&gt;
&lt;iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/daro6K6mym8?autoplay=0&amp;amp;controls=1&amp;amp;end=0&amp;amp;loop=0&amp;amp;mute=0&amp;amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"&gt;&lt;/iframe&gt;
&lt;/div&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Another interesting discussion on the use of &lt;a href="https://codereview.stackexchange.com/a/52510"&gt;modular arithmetic&lt;/a&gt; in testing the divisibility of a given number is available on Code Review.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;There&amp;rsquo;s also a GMP-based C version available on &lt;a href="https://github.com/eagletmt/project-euler-c/blob/master/20-29/problem26.c"&gt;Github&lt;/a&gt;.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>lost+found 2019</title><link>https://aliquote.org/post/lost-found-2019/</link><pubDate>Tue, 24 Dec 2019 15:36:12 +0200</pubDate><guid>https://aliquote.org/post/lost-found-2019/</guid><description>&lt;p&gt;Cleaning some old Org notes from nowhere.&lt;/p&gt;
&lt;h2 id="agile-data-science"&gt;Agile Data Science&lt;/h2&gt;
&lt;p&gt;After reading a lot of papers and books on Agile methodology, and in particular Agile principles applied to data science, I came to the conclusion that I was not that far from the principled ways when I was working as a medical statistician. As far as I am concerned, I always felt like the guys with whom I was working on a project must be kept informed of the progress of my report in real time, even if it was only a rough draft or when little has changed since the previsous version. &amp;ldquo;Researchers and data scientists, who work on longer timelines than agile sprints typically allow, generate data daily—albeit not in a “publishable” state. In Agile Big Data, there is no unpublishable state. The rest of the team must see weekly, if not daily (or more often), updates in the state of the data. This kind of engagement with researchers is essential to unifying the team and enabling product management. That means publishing intermediate results—incomplete data, the scraps of analysis&amp;rdquo;. (cite:jurney-2014-agile-data-scien)&lt;/p&gt;
&lt;p&gt;As a matter of fact, data scientists and decision makers or business men do not work on the same time frame. As someone used to say for programmers, data scientists will generally need to three to four hours on a project, without being interrupted by short or longer last minute meetings.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;FIXME: check for the reference about programmers&lt;/li&gt;
&lt;li&gt;TODO: Jurney exposes similar concerns in § &amp;ldquo;Agile Environments: Engineering Productivity&amp;rdquo;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;References:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.datascience.com/blog/agile-data-science"&gt;Taking an Agile Approach to Data Science&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.quora.com/Is-the-agile-approach-applicable-in-data-science-projects"&gt;Is the agile approach applicable in data science projects?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://2016.agileturas.lt/vilnius/wp-content/uploads/2016/10/5.3-2-Waclaw-Kusnierszyk-Agile-Data-Science.pdf"&gt;Agile Data Science&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="ocaml"&gt;OCaml&lt;/h2&gt;
&lt;p&gt;I played with OCaml during the last two weeks or so. I used the following online courses which I must admit are really well organized: &lt;a href="https://cs.uwaterloo.ca/~plragde/flaneries/FDS/"&gt;Functional Data Structures&lt;/a&gt; (FDS) and &lt;a href="https://www.cs.cornell.edu/courses/cs3110/2017fa/"&gt;Data Structures and Functional Programming&lt;/a&gt; (DSFP).&lt;/p&gt;
&lt;p&gt;In DSFP, the author suggests that to learn a new programming language (PL), there are a couple of aspects that we need to focus on, including: syntax, semantics, idioms, libraries, and tools. Concentrating on sema ntics and idioms is the most important aspect to learning a new PL since it amounts to understand what the program really does and what are good design patterns for using that particular language. OCaml is a statically-typed and type-safe programming language, featuring algebric datatypes, type inference, parametric polymorphism, garbage collection, and modules. It is one of the successor of ML, which was d evised after Lisp itself in the 60&amp;rsquo;s. It is interesting to study the design of this language especially for those that are into Scala these days, and more generally to get a deep understanding of what we might call a principled approach to functional programming.&lt;/p&gt;
&lt;p&gt;Note that the following expression does not evaluate to 2 as it simply doesn&amp;rsquo;t type check: (However, the compiler is able to perform type inference.)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-ocaml" data-lang="ocaml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;22&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;0&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;bear&amp;#34;&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="n"&gt;2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Importantly, a function is a value which is clearly apparent when using anonymous functions, also called lambda expressions: (mostly like in Clojure but with a simpler syntax)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-ocaml" data-lang="ocaml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;inc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;fun&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;inc&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Ironically, while I hate the piping approach that is being popularized in R, OCaml also has a pipeline operator. Instead of &lt;code&gt;f e&lt;/code&gt;, we can write &lt;code&gt;e |&amp;gt; f&lt;/code&gt;, so that &lt;code&gt;5 |&amp;gt; inc |&amp;gt; square&lt;/code&gt; computes the square of 5+1 (36, as in &lt;code&gt;square(inc 5)&lt;/code&gt;, provided &lt;code&gt;inc&lt;/code&gt; and &lt;code&gt;square&lt;/code&gt; are implemented beforehand.&lt;/p&gt;
&lt;p&gt;Type inference is performed automagically by the compiler. So, instead of specifying the type of each variable, it would be possible to omit all type annotations in the following example:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-ocaml" data-lang="ocaml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;(* requires: y&amp;gt;=0 *)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;(* returns: x to the power of y *)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="k"&gt;rec&lt;/span&gt; &lt;span class="n"&gt;pow&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;0&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt; &lt;span class="n"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;pow&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;1&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;OCaml also allows to define mutually recursive functions, e.g.:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-ocaml" data-lang="ocaml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="k"&gt;rec&lt;/span&gt; &lt;span class="n"&gt;even&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;0&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;odd&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;1&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;odd&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;0&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;even&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;1&lt;/span&gt;&lt;span class="o"&gt;);;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It is worth noting that it is safer to always exit the &amp;ldquo;toplevel&amp;rdquo; (&lt;code&gt;utop&lt;/code&gt;) when testing or debugging.&lt;/p&gt;</description></item><item><title>A Programmer's Introduction to Mathematics</title><link>https://aliquote.org/post/pim-book/</link><pubDate>Tue, 24 Dec 2019 13:12:09 +0100</pubDate><guid>https://aliquote.org/post/pim-book/</guid><description>&lt;p&gt;Here is a short review of &lt;a href="https://pimbook.org"&gt;&lt;em&gt;A Programmer&amp;rsquo;s Introduction to Mathematics&lt;/em&gt;&lt;/a&gt;, by Jeremy Kun. Source code is available on &lt;a href="https://github.com/pim-book/programmers-introduction-to-mathematics"&gt;Github&lt;/a&gt;, and the author has a nice &lt;a href="https://jeremykun.com"&gt;blog&lt;/a&gt;, which I subscribed to long ago. I&amp;rsquo;ve been reading this book erratically since this summer, and finally got to the last few chapters. I&amp;rsquo;ve heard there&amp;rsquo;s another book in preparation, this time about a mathematical introduction to programming. This should come as no surprise since the author refers to Knuth&amp;rsquo;s artwork on mathematics and programming here and there (&amp;ldquo;Mathematics provides an abstraction that helps one be sloppy in a precisely controlled way&amp;rdquo;; &lt;em&gt;Concrete Mathematics&lt;/em&gt;). A related publication is &lt;em&gt;Programming and Mathematical Thinking: A Gentle Introduction to Discrete Math Featuring Python&lt;/em&gt;, by Allan M. Stavely (The New Mexico Tech Press, 2014).&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Like Programming, Mathematics has a Culture.&amp;rdquo; So you need to embrace the whole field of mathematics, and its historical development.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;(T)he best mathematicians study concepts that connect decades of material, while simultaneously inventing new concepts which have no existing words to describe them. Without flexible expression, such work would be impossible. It reduces cognitive load, a theme that will follow us throughout the book. Unfortunately, it only does so for the readers who have already absorbed the basic concepts of discussion. By contrast, good software practice encourages code that is simple enough for anyone to understand. As such, the uninitiated programmer often has a much larger cognitive load when reading math than when reading a program.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The book reviews a number of concepts ranging from basic and abstract algebra, discrete structures (sets and graphs), and uni- and multivariable calculus. All those domains are closely related to programming, as matter of fact. Each chapter is followed by some exercises, that can be discussed on &lt;a href="https://github.com/pim-book/exercises"&gt;Github&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Much like in the &lt;a href="https://aliquote.org/post/bioinformatics-algorithms/"&gt;preceding book&lt;/a&gt; I discussed, the author keeps an approach aimed at a wide audience without sacrificing technical precision:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;For now, think of a real number as a floating point number without the emotional baggage that comes from trying to fit all decimals into a finite number of bits.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;For instance, a well-known theorem states that there is a unique degree &lt;em&gt;n&lt;/em&gt; polynomial passing through a choice of &lt;em&gt;n&lt;/em&gt; + 1 points. As a statistician I immediately think of the classical overfitting issue in parametric modeling, or Taylor expansion. The author emphasizes the role of polynomials as building blocks, for they can be seen as families of increasingly expressive objects (p. 9). He then spend a couple of pages demonstrating the uniqueness of the above polynomial passing through &lt;em&gt;n&lt;/em&gt; points, starting from a single point (&lt;em&gt;x&lt;/em&gt;&lt;sub&gt;1&lt;/sub&gt;, &lt;em&gt;y&lt;/em&gt;&lt;sub&gt;1&lt;/sub&gt;) and the relation $f(x) = \sum_{i=0}^ny_i\left(\prod_{j\ne i}\frac{x - x_j}{x_i - x_j}\right)$. All becomes crystal clear as we progress in the logic of the demonstration. This is the guiding theme of this book: to get the reader to think about key concepts based on simple cases as well as practical illustrations using Python snippets (in the case of polynomials, a complete example of interpolation via polynomial fitting followed by an application of code deciphering). I slightly disagree with the idea that &amp;ldquo;in mathematics, we place a special emphasis on the communication of ideas from human to human&amp;rdquo;, since I often came across some obscure answer on Mathoverflow or elsewhere, where folks wrote a post full of mathematical symbols with no connection to human language &amp;mdash; at least if we agree that a human language usually means an articulated succession of words in English (or French in my case) that can be associated to relevant meaning. Anyway, that&amp;rsquo;s a minor issue since this is clearly not the case of this book, which contains a much larger portion of text than mathematical equation.&lt;/p&gt;
&lt;p&gt;Even if the author mainly uses Python to illustrate the core ideas of each chapter, there are some reference to Haskell and I found it nice given the expressiveness of Haskell with regard to mathematical equation. For example, in the chapter dealing with sets, the set of all nonnegative numbers divisible by seven can be written as $S = \{ x: x \in \mathbb{N}, x, \text{is divisible by}, 7\}$. This readily translates to the following infinite list comprehensions in Haskell: &lt;code&gt;[x | x &amp;lt;- [1..], mod x 7 == 0]&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Figure 4.4 (p. 50) is also a beauty: it shows how the equality ${n \choose 2}=1+2+\dots+n-1$ (i.e., the number of ways to choose two objects from a set of &lt;em&gt;n&lt;/em&gt; objects) could be demonstrated using a bijection. Here&amp;rsquo;s the idea with seven objects, $X=\{A, B, \dots, G\}$: A bijection $g: Y\rightarrow {X \choose 2}$ can be constructed by drawing two arrows at an angle from any ball to the corresponding pair of squares, $g(y)$. Each choice of balls give two different diagonals, hence it is an injection; given a pair $(x_1,x_2) \in X$, the inner diagonals meet a unique ball at $y$, so $g$ is a surjection.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/balls.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/balls.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The chapter on graphs was also delightful, for it highlights important properties of graphs &amp;ldquo;in picture&amp;rdquo;. For instance, the &lt;em&gt;k&lt;/em&gt;-coloring of a &lt;a href="https://en.wikipedia.org/wiki/Petersen_graph"&gt;Petersen graph&lt;/a&gt; is used to discuss how to partition the set of vertices into color classes, with edges going from one color class to another. The characteristic property of a planar graph, which can be drawn on a plane in such a way that no edges cross, whereby the Euler characteristic &lt;em&gt;V&lt;/em&gt; − &lt;em&gt;E&lt;/em&gt; + &lt;em&gt;F&lt;/em&gt; = 2 is also demonstrated using plain language. The author also uses the &lt;a href="https://igraph.org"&gt;igraph&lt;/a&gt; package to demonstrate how to perform 5-coloring of a planar graph.&lt;/p&gt;
&lt;p&gt;Note that in addition to exercises at the end of each chapter, between each of the main chapters there is a reflection chapter on the cultures or subcultures of Mathematics (e.g., chapters 5 and 7). There&amp;rsquo;s more to see in the next chapters which deal more specifically with linear algebra and calculus. If you&amp;rsquo;re interested in applied mathematics, or how it relates to everyday programming, read the very &lt;a href="https://pimbook.org/pdf/pim_first_pages.pdf"&gt;first pages&lt;/a&gt; and go checkout the rest of the book.&lt;/p&gt;</description></item><item><title>Armstrong numbers</title><link>https://aliquote.org/post/armstrong-numbers/</link><pubDate>Tue, 24 Dec 2019 08:13:48 +0100</pubDate><guid>https://aliquote.org/post/armstrong-numbers/</guid><description>&lt;p&gt;Armstrong numbers, named after Michael F. Armstrong, are numbers that are the sum of their own digits each raised to the power of the number of digits. For instance, 153 is an Armstrong number since 153 = 1&lt;sup&gt;3&lt;/sup&gt; + 5&lt;sup&gt;3&lt;/sup&gt; + 3&lt;sup&gt;3&lt;/sup&gt; = 1 + 125 + 27 = 153. They are also known as &lt;em&gt;narcissistic numbers&lt;/em&gt; in number theory. What a funny name, isn&amp;rsquo;t it?&lt;/p&gt;
&lt;p&gt;The following Racket program allows to test whether a given number, &lt;em&gt;n&lt;/em&gt;, is an Armstrong number in base 10 or not:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;#lang &lt;/span&gt;&lt;span class="nn"&gt;racket&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;digits&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;zero?&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;null&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cons&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;remainder&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;digits&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;quotient&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;armstrong-number?&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let*&lt;/span&gt; &lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;digits&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;length&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;)])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;for/sum&lt;/span&gt; &lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;expt&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;)))))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;There are only 89 such numbers in base 10, and this is OEIS sequence &lt;a href="https://oeis.org/A005188"&gt;A005188&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The above program works well for querying some numbers, but what if we want to generate the full sequence? The largest of these 89 numbers is: 115,132,219,018,763,992,565,095,597,973,971,522,401.&lt;/p&gt;
&lt;p&gt;This is well above the limit of unsigned long long in C. So we will probably need the GMP library, and a more efficient screening algorithm. Here is one, from &lt;a href="https://rosettacode.org/wiki/Narcissistic_decimal_number/C"&gt;Rosetta&lt;/a&gt;. It runs in less than 15 s on my Macbook (1,3 GHz Intel Core m7), if we suppress the output: (&lt;a href="https://aliquote.org/pub/armstrong-gmp.c"&gt;source code&lt;/a&gt;)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;~/tmp  cc armstrong-gmp.c -lgmp
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;~/tmp  &lt;span class="nb"&gt;time&lt;/span&gt; ./a.out &amp;gt; out
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 14.44 real 13.97 user 0.12 sys
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;~/tmp  cat out &lt;span class="p"&gt;|&lt;/span&gt; cut -d: -f &lt;span class="m"&gt;2&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; gnuplot -p -e &lt;span class="s2"&gt;&amp;#34;set logscale y; plot &amp;#39;&amp;lt;cat&amp;#39;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/armstrong.png"&gt;
&lt;/figure&gt;
&lt;blockquote&gt;
&lt;p&gt;Thank God that number theory is unsullied by any application. &amp;mdash; Leonard Dickson&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I don&amp;rsquo;t know of any direct application of Armstrong numbers, even for recreational mathematics, but surely there are many other funny terms coined for interesting patterns, like &lt;a href="https://en.wikipedia.org/wiki/Amicable_numbers"&gt;amicable numbers&lt;/a&gt;, &lt;a href="https://en.wikipedia.org/wiki/Untouchable_number"&gt;untouchable numbers&lt;/a&gt;, &lt;a href="https://en.wikipedia.org/wiki/Sociable_number"&gt;sociable numbers&lt;/a&gt;, &lt;a href="https://en.wikipedia.org/wiki/Abundant_number"&gt;abundant numbers&lt;/a&gt;, &lt;a href="https://en.wikipedia.org/wiki/Amenable_number"&gt;amenable numbers&lt;/a&gt;, or &lt;a href="https://en.wikipedia.org/wiki/Practical_number"&gt;practical numbers&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Micro review from December</title><link>https://aliquote.org/post/micro-review-006/</link><pubDate>Mon, 23 Dec 2019 16:51:24 +0100</pubDate><guid>https://aliquote.org/post/micro-review-006/</guid><description>&lt;p&gt;Here is the monthly micro review of (not so) random links I found while browsing the interweb lately. Winter is here, I&amp;rsquo;m off for two weeks, so I shall be brief. Here are the tabs that are still opened on my iPhone, in reverse chronological order (most recent first).&lt;/p&gt;
&lt;p&gt;&lt;a href="http://macos-design-review.com"&gt;MacOS Design Review&lt;/a&gt; has some tips and opinionated notices on macOS design in its most recent incantations. I came across this site thanks to &lt;a href="https://twitter.com/nikitonsky/status/1209124927980355586?s=20"&gt;@nikitonsky&lt;/a&gt;. I do not use Dark Mode, even if my Terminal app and my Emacs current config are all white on dark. I tried it for a week or two, and then gave up, as I thought it was not a very polished thing &amp;mdash; and wtf, how can you read you mail in Mail app uisng Dark mode? Oh, simply use the mixed mode, so that you get a semi dark app?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;It’s not a disaster. But it falls short of the standard Apple used to hold themselves to.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Handling missing data is always a fuzz in statistical software. John Myles White wrote a nice &lt;a href="https://www.johnmyleswhite.com/notebook/2014/11/29/whats-wrong-with-statistics-in-julia/"&gt;post&lt;/a&gt; on this topic with regard to &lt;a href="https://julialang.org/blog/2018/06/missing"&gt;Julia&lt;/a&gt; a while back. Now, it looks like similar concerns were raised in the Python ecosystem, especially the Pandas package: &lt;a href="https://jorisvandenbossche.github.io/blog/2019/11/30/pandas-consistent-missing-values/"&gt;Towards consistent missing value handling in Pandas&lt;/a&gt;. According to this post, &lt;code&gt;pd.NA&lt;/code&gt; is a new NA value for representing scalar missing value; this includes integers, bools and strings for &lt;a href="https://pandas.pydata.org/pandas-docs/stable/development/extending.html"&gt;ExtensionArray-based&lt;/a&gt; data types. Evan Miller once suggested to rely on weighted statistics everywhere (on his Tumblr for Wizard, which is no longer available at the time of this writing, but remains available in the &lt;a href="https://web.archive.org/web/20160527011008/http://wizardmac.tumblr.com/post/104019606584/whats-wrong-with-statistics-in-julia-a-reply"&gt;archives&lt;/a&gt; for the moment &amp;mdash; this has been &lt;a href="https://github.com/JuliaLang/julia/pull/9363"&gt;discussed&lt;/a&gt; on Github, though), in order to avoid extra loop to check for possible missing value. That&amp;rsquo;s a clever idea, IMO, that I will implement in my tiny stats package for Racket.&lt;/p&gt;
&lt;p&gt;I keep hearing of webmentions from many of my RSS feeds. People get tired of Disqus, of course, and the indieweb is is becoming more and more fashionable these days. Comments are disabled on this site, despite some raging ideas &lt;a href="https://blog.codinghorror.com/a-blog-without-comments-is-not-a-blog/"&gt;here&lt;/a&gt; and &lt;a href="https://fizzle.co/sparkline/debate-should-you-allow-comments-on-your-blog-find-out-what-two-remarkably-popular-bloggers-think"&gt;there&lt;/a&gt;. Those who want to get in touch still have access to my mail and my Twitter, as &lt;a href="https://eli.thegreenplace.net/2018/turning-off-blog-comments/"&gt;someone&lt;/a&gt; used to say. Thanks to those who have contacted me by mail about my posts, btw! Anyway, back to webmentions: if you are on micro.blog, you may be interested in reading this &lt;a href="https://shindakun.dev/posts/adding-webmentions-to-microblog/"&gt;post&lt;/a&gt;, while for Hugo Jan Lukas Else has a nice series of &lt;a href="https://jlelse.blog/micro/2019/12/2019-12-12-znats/"&gt;posts&lt;/a&gt; on his website.&lt;/p&gt;
&lt;p&gt;Today I was remembered of the &amp;ldquo;&lt;a href="https://en.wikipedia.org/wiki/Numerical_tower"&gt;numerical tower&lt;/a&gt;&amp;rdquo;: (via &lt;a href="https://irreal.org/blog/?p=8535"&gt;Irreal&lt;/a&gt;)&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In Scheme and in Lisp dialects inspired by it, a numerical tower is the set of data types that represent numbers in a given programming language.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Lately I came across Kristopher Micinski slides on &lt;a href="https://github.com/kmicinski/program-analysis"&gt;program analysis&lt;/a&gt; (see the &lt;code&gt;assets/slides&lt;/code&gt; directory for PDF keynotes). If you are interested in functional programming, there are many interesting things on Lambda calculus, continuations and Racket.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://ajpierce.com/reflecting-on-reflection/"&gt;Reflecting on Reflection&lt;/a&gt;, or how to speed up Clojure by a factor of 17 by avoiding &lt;a href="https://www.geeksforgeeks.org/reflection-in-java/"&gt;reflection&lt;/a&gt; and using &lt;a href="https://clojure.org/reference/java_interop#typehints"&gt;type hinting&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m slowly trying out Rust, and I discovered that there&amp;rsquo;s something like Clojure kata for Rust, namely &lt;a href="https://github.com/rust-lang/rustlings"&gt;rustlings&lt;/a&gt;, i.e., small exercises to get you used to reading and writing Rust code!&lt;/p&gt;
&lt;p&gt;Finally, here we go with the &lt;a href="https://robservatory.com/a-full-history-of-macos-os-x-release-dates-and-rates/"&gt;history of macOS/OS X releases&lt;/a&gt; over the years. I&amp;rsquo;m still on Mojave and don&amp;rsquo;t really expect to upgrade anytime soon. This reminds me of all the &lt;a href="https://aliquote.org/tags/apple/"&gt;reviews&lt;/a&gt; I did about the successive versions of OS X, then macOS. Time goes by. To date, my preferred setup is clearly running Mojave on the macbook 12&amp;quot;.&lt;/p&gt;</description></item><item><title>On memoization</title><link>https://aliquote.org/post/on-memoization/</link><pubDate>Sat, 21 Dec 2019 17:41:01 +0100</pubDate><guid>https://aliquote.org/post/on-memoization/</guid><description>&lt;p&gt;Memoization is a technique that keeps intermediate results in memory in order to speed up execution of a computer program. In other words, we store results from succesive call to a given function so that whenever it is called with the same arguments we don&amp;rsquo;t need to evaluate this function again and again and just pick the value computed from a previous call. This is somewhat akin to using a cache to manage the state of a function or a stack of its returned values, or more generally to dynamic programming (we talked a bit of DP in the case of &lt;a href="post/motzkin-numbers"&gt;Motzkin numbers&lt;/a&gt;). This assumes that the function is pure, which is often the case in functional PLs, and it is related to &lt;a href="http://hisham.hm/2011/04/04/understanding-at-last-the-y-combinator-a-programmer-friendly-perspective"&gt;Y-Combinator&lt;/a&gt;, Y = λf · (λx · f (x x)) (λx · f (x x)), which allows to devise a non-recursive version of a function, apply Y to it, and get a recursive function in turn.&lt;/p&gt;
&lt;p&gt;Even with pure function (no side effect) and referential transparency (replacing an expression with its value does not modify the behavior of the program), there are cases where memoization is not possible without resorting to higher-order function, in particular when a recursive function has to perform memoized calls to itself. Indeed, using lambda calculus alone does not allow to devise recursive function since there&amp;rsquo;s no way to call anonymous function (the f in λx · f(x x)) unless we give it a name. Hence the need for a &lt;em&gt;combinator&lt;/em&gt;, i.e. another function without free variables, which allows a function to call itself, without giving it a name in the scope in which it is declared. In Racket, this is expressed as follows:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;#lang &lt;/span&gt;&lt;span class="nn"&gt;lazy&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;Y&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;λ&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;)((&lt;/span&gt;&lt;span class="k"&gt;λ&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)))(&lt;/span&gt;&lt;span class="k"&gt;λ&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;fib&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Y&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;λ&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;λ&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;equal?&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;*&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;-&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))))))))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You will find similar patterns for Python, Haskell, and even C on this &lt;a href="https://levelup.gitconnected.com/implementing-recursion-with-the-y-combinator-in-any-language-9e83fa369ca"&gt;Medium post&lt;/a&gt;. Do we need to write all this by ourselves? No, not really, since Racket already comes with a memoization procedure for typed or untyped programs. Here is an example for the Fibonacci sequence using typed Racket:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;require&lt;/span&gt; &lt;span class="n"&gt;tmemoize&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;:&lt;/span&gt; &lt;span class="n"&gt;fib&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Integer&lt;/span&gt; &lt;span class="n"&gt;Integer&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;fib&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;memoize&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="n"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Integer&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fib&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;-&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fib&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;-&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)))))))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Unfortunately, the &lt;code&gt;tmemoize&lt;/code&gt; package seems no longer available, so here is a modified version using untyped Racket:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;#lang &lt;/span&gt;&lt;span class="nn"&gt;racket&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;require&lt;/span&gt; &lt;span class="n"&gt;memoize&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;require&lt;/span&gt; &lt;span class="n"&gt;racket/trace&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;define/memo&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fib&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fib&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;-&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fib&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;-&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;trace&lt;/span&gt; &lt;span class="n"&gt;fib&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fib&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The number of function calls should be 2&lt;em&gt;F&lt;/em&gt;(&lt;em&gt;n&lt;/em&gt;) − 1, where &lt;em&gt;F&lt;/em&gt;(&lt;em&gt;n&lt;/em&gt;) is the Fibonacci number corresponding to &lt;em&gt;n&lt;/em&gt;. You can &amp;ldquo;trace&amp;rdquo; function calls when memoization is enabled or not using the &lt;code&gt;racket/trace&lt;/code&gt; module, as illustrated in the above script. By running this script in a terminal (&lt;code&gt;racket fib.rkt | grep fib | wc -l&lt;/code&gt;), you can easily check that there are just 19 calls to &lt;code&gt;fib&lt;/code&gt; when memoization is enable whereas there&amp;rsquo;s a total of 177 function calls, as expected, when it is not (you just have to remove the &lt;code&gt;define/memo&lt;/code&gt; form).&lt;/p&gt;
&lt;p&gt;A more interesting discussion is provided on &lt;a href="https://blog.jverkamp.com/2012/10/20/memoization-in-racket"&gt;JP&amp;rsquo;s blog&lt;/a&gt;. Another implementation is available on Henry Brooks&amp;rsquo; &lt;a href="https://hebr3.github.io/2017/04/memoization-in-racket.html"&gt;website&lt;/a&gt;. There&amp;rsquo;s also a crazy version on &lt;a href="https://www.coursera.org/lecture/programming-languages-part-b/memoization-SqEc5"&gt;Coursera&lt;/a&gt; (starting at 3'50). Finally, there is a nice discussion of memoization, from which most the code above borrows from, on the Racket blog: &lt;a href="https://blog.racket-lang.org/2012/08/dynamic-programming-versus-memoization.html"&gt;Dynamic Programming versus Memoization&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Regarding Python, I didn&amp;rsquo;t invest much in the &lt;a href="https://pypi.org/project/joblib/"&gt;joblib&lt;/a&gt; module &amp;mdash; which is able to cache intermediate results, AFAIK &amp;mdash; but I relied on the &lt;a href="https://stackoverflow.com/a/49883466"&gt;&lt;code&gt;lru_cache&lt;/code&gt; decorator&lt;/a&gt; from the &lt;code&gt;functools&lt;/code&gt; module, instead:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;functools&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nd"&gt;@functools.lru_cache&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;None&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;fib&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;fib&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;fib&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Similar tracing functionalities are available in Python, e.g. using the following &lt;a href="https://stackoverflow.com/a/8315566"&gt;snippet&lt;/a&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;sys&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;tracefunc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;frame&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;arg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;indent&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;call&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;indent&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;-&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;indent&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&amp;gt; call function&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;frame&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;f_code&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;co_name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;return&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&amp;lt;&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;-&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;indent&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;exit function&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;frame&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;f_code&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;co_name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;indent&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;tracefunc&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then you&amp;rsquo;ll just need to add &lt;code&gt;sys.settrace(tracefunc)&lt;/code&gt; before your function call.&lt;/p&gt;
&lt;p&gt;Haskell is quite good actually when it comes to keeping intermediate results in memory: You just have to &lt;a href="https://stackoverflow.com/a/11466959"&gt;name it&lt;/a&gt;; in the case of Fibonacci numbers, this means keeping a list of intermediate results, which remains in memory despite garbage collection. The &lt;a href="https://wiki.haskell.org/Memoization"&gt;Haskell wiki&lt;/a&gt; has a nice application of memoization, although there are &lt;a href="https://stackoverflow.com/q/3208258"&gt;other examples&lt;/a&gt; available on SO:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-haskell" data-lang="haskell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;fib&lt;/span&gt; &lt;span class="ow"&gt;::&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;Int&lt;/span&gt; &lt;span class="ow"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;Integer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;Int&lt;/span&gt; &lt;span class="ow"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;Integer&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;fib&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="ow"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;fib&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="ow"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;fib&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="ow"&gt;=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;-- this function takes care of memoization per se&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;memoize&lt;/span&gt; &lt;span class="ow"&gt;::&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;Int&lt;/span&gt; &lt;span class="ow"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;Int&lt;/span&gt; &lt;span class="ow"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;memoize&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="ow"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;map&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!!&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;-- and here is the memoized fib function&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;fibMemo&lt;/span&gt; &lt;span class="ow"&gt;::&lt;/span&gt; &lt;span class="kt"&gt;Int&lt;/span&gt; &lt;span class="ow"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;Integer&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;fibMemo&lt;/span&gt; &lt;span class="ow"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fix&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;memoize&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="n"&gt;fib&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;small&gt;&lt;code&gt;Integer&lt;/code&gt; is an arbitrary precision type in Haskell, while &lt;code&gt;Int&lt;/code&gt; corresponds to traditional 32- or 64-bit integer.&lt;/small&gt;&lt;/p&gt;</description></item><item><title>Insertion sort and Python FFI</title><link>https://aliquote.org/post/insertion-sort-python-ffi/</link><pubDate>Wed, 18 Dec 2019 16:14:27 +0100</pubDate><guid>https://aliquote.org/post/insertion-sort-python-ffi/</guid><description>&lt;p&gt;One of Rosalind problems asks us to implement a function to perform an insertion sort. In the best case, its complexity is $\mathcal{O}(n)$, and $\mathcal{O}(n^2)$ on average (i.e., worse than the &lt;em&gt;quick sort&lt;/em&gt; we talked &lt;a href="https://aliquote.org/post/racket-ffi/"&gt;earlier&lt;/a&gt;, which is $\mathcal{O}(n\log n)$). Note that this type of sorting algorithm works best with vectors, since elements can be swapped in place without extra memory allocation. It is also quite good for &lt;a href="https://www.toptal.com/developers/sorting-algorithms/nearly-sorted-initial-order"&gt;nearly sorted data&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;According to &lt;a href="https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/racket-python3.html"&gt;this page&lt;/a&gt;, Racket should be a fair competitor to Python, but I would be surprised if it could beat C, even on simple task, so I tried to figure out myself. Suppose you want to compare Python and C &amp;mdash; or even Racket &amp;mdash; on such a basic sorting task. This really is a toy example since (1) &lt;a href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.sort.html"&gt;built-in&lt;/a&gt; sorting procedure are certainly better than that, and (2) there are far better benchmarks available to compare the performance of each two languages.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If you get into algorithmic analysis, you&amp;rsquo;ll study many different sorting algorithms, and be able to characterize their performance under different conditions. But again, for most real world sorting purposes, just use the built-in &amp;ldquo;sort&amp;rdquo; procedure. &amp;mdash; Neil Van Dyke, on the &lt;a href="https://lists.racket-lang.org/users/archive/2013-November/060369.html"&gt;Racket list&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Anyway, here are quick implementations of &lt;em&gt;insertion sort&lt;/em&gt; in these languages. For the sequence of 100 numbers shown below, the number of swaps required is 2532. Timing is performed at the command line using &lt;code&gt;time&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Python (0.06 real / 0.04 user / 0.01 sys):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;ins&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;verbose&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;False&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;op&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;)):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;cur&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;cur&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;op&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cur&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;verbose&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s2"&gt; swaps&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;op&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;lst&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# 0..100 shuffled (10 numbers per row)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;lst&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;44&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;65&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;79&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;82&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;46&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;33&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;57&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;23&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;98&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;28&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;35&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;63&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;88&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;18&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;81&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;83&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;38&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;67&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;17&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;56&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;74&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;39&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;61&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;76&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;53&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;66&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;73&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;19&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;70&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;93&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;92&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;14&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;37&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;27&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;55&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;64&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;71&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;75&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;77&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;49&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;43&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;91&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;85&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;72&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;26&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;97&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;99&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;34&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;86&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;96&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;78&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;90&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;59&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;31&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;94&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;45&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;95&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;84&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;62&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;68&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;87&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;58&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;29&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;51&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;52&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;69&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;48&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;21&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;22&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;54&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;47&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;36&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;41&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;89&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ins&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Compared to built-in methods, without using NumPy or Cython, we are slower compared to what &lt;code&gt;sorted&lt;/code&gt; achieves on the same list:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="n"&gt;timeit&lt;/span&gt; &lt;span class="nb"&gt;sorted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;1.15&lt;/span&gt; &lt;span class="n"&gt;µs&lt;/span&gt; &lt;span class="err"&gt;±&lt;/span&gt; &lt;span class="mf"&gt;47.9&lt;/span&gt; &lt;span class="n"&gt;ns&lt;/span&gt; &lt;span class="n"&gt;per&lt;/span&gt; &lt;span class="n"&gt;loop&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mean&lt;/span&gt; &lt;span class="err"&gt;±&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="n"&gt;dev&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt; &lt;span class="n"&gt;runs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1000000&lt;/span&gt; &lt;span class="n"&gt;loops&lt;/span&gt; &lt;span class="n"&gt;each&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="n"&gt;timeit&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ins&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;False&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;18.9&lt;/span&gt; &lt;span class="n"&gt;µs&lt;/span&gt; &lt;span class="err"&gt;±&lt;/span&gt; &lt;span class="mi"&gt;658&lt;/span&gt; &lt;span class="n"&gt;ns&lt;/span&gt; &lt;span class="n"&gt;per&lt;/span&gt; &lt;span class="n"&gt;loop&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mean&lt;/span&gt; &lt;span class="err"&gt;±&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="n"&gt;dev&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt; &lt;span class="n"&gt;runs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10000&lt;/span&gt; &lt;span class="n"&gt;loops&lt;/span&gt; &lt;span class="n"&gt;each&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now, what about C? It is pretty fast, of course: 0.00 real / 0.00 user / 0.00 sys. Here is the code I used (&lt;a href="https://aliquote.org/pub/ins.c"&gt;full code&lt;/a&gt;):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-c" data-lang="c"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define SWAP(x, y) do { typeof(x) SWAP = x; x = y; y = SWAP; } while (0)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;isort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;=&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;SWAP&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;However, it&amp;rsquo;s not difficult to call the above C code in Python, thanks to the &lt;a href="https://cffi.readthedocs.io/en/latest/"&gt;cffi&lt;/a&gt; library. Eli Bendersky has a &lt;a href="https://eli.thegreenplace.net/2013/03/09/python-ffi-with-ctypes-and-cffi"&gt;nice post&lt;/a&gt; about &lt;code&gt;cffi&lt;/code&gt; and &lt;code&gt;ctypes&lt;/code&gt;. Compared to Racket FFI, C types inference is performed automagically, and you just have to copy/paste existing C implementations using &lt;code&gt;ffi.cdef&lt;/code&gt;. Here is an example of &amp;ldquo;in-line mode&amp;rdquo; usage, where everything is set up every time you import your Python code, per the documentation:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;cffi&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;FFI&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ffi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;FFI&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;lib&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ffi&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dlopen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;ins.dylib&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ffi&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cdef&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&amp;#34;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;int isort(int *lst, int len);
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;&amp;#34;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;lib&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;isort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;No need to bother declaring the return type, you&amp;rsquo;ll get the value returned by &lt;code&gt;isort&lt;/code&gt; (an integer indicating the number of swap operations required for the given list). If you want to get the updated value of &lt;code&gt;lst&lt;/code&gt;, you likely want to map the returned value to a Python variable, e.g.:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ffi&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;int[100]&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;lst&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;lib&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;isort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Of note, the &lt;a href="https://rosettacode.org/wiki/Sorting_algorithms/Insertion_sort"&gt;Racket code&lt;/a&gt; available on Rosetta appears like an outsider among the two other competitors (at least when it is not compiled), with the following timing: 0.60 real / 0.49 user / 0.10 sys.&lt;/p&gt;</description></item><item><title>Racket FFI and C</title><link>https://aliquote.org/post/racket-ffi/</link><pubDate>Tue, 17 Dec 2019 19:27:13 +0100</pubDate><guid>https://aliquote.org/post/racket-ffi/</guid><description>&lt;p&gt;I am slowly updating a small Racket package for statistical analysis, which is a mix of R, LispStat and Stata actually. Don&amp;rsquo;t expect too much from this package because it is mainly a proof of concept, and a way to learn Racket more seriously. Anyway, I didn&amp;rsquo;t realize the (typed) &lt;a href="https://docs.racket-lang.org/math/"&gt;math&lt;/a&gt; package was so complete. Beside matrices and common statistical distributions, it comes with Gram-Schmidt, QR and LU decomposition, a solver, etc. These utilities already allow to fit a simple (weighted) linear model in a few lines:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;require&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;T&lt;/span&gt; &lt;span class="n"&gt;matrix-transpose&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;regress&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="no"&gt;#f&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;matrix-solve&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;matrix*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;diagonal-matrix&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;matrix*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;diagonal-matrix&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Of course, you may well prefer to rely on solid libraries for linear algebra, like LAPACK or BLAS, especially if you are going to work with large datasets or irregular design matrix ($n\ll p$ case). However, suppose you already have some C code available to estimate the parameters of such models, say the GLM routine in the &lt;a href="https://www.bioconductor.org/packages/2.8/bioc/html/snpMatrix.html"&gt;snpMatrix&lt;/a&gt; package. Surely there are many more standalone C packages for that specific purpose, but I already used this routine in the past in a C program, so I came to appreciate it (besides its use in GWAS analysis). Being able to call the C code from Racket would alleviate the need to rewrite everything from scratch, and in the long run you could even use well-tested libraries like &lt;a href="https://www.csie.ntu.edu.tw/~cjlin/liblinear/"&gt;liblinear&lt;/a&gt; or &lt;a href="https://github.com/VowpalWabbit/vowpal_wabbit/wiki"&gt;wowpal&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Calling &amp;ldquo;simple C&amp;rdquo; routine code in Racket is quite easy actually, once you figured out how to map C types to Racket data structures, plus a couple of other issues discussed in the &lt;a href="https://docs.racket-lang.org/foreign/index.html"&gt;documentation&lt;/a&gt;. In the simplest cases, you just need to create a &lt;a href="https://aliquote.org/post/embedding-c-code-in-java/"&gt;shared library&lt;/a&gt; (&lt;code&gt;--shared&lt;/code&gt; under Linux, &lt;code&gt;--dynamiclib&lt;/code&gt; under macOS), write a wrapper to define the C function signature in Racket, and define a Racket function that calls the C function using Racket data structures. Note that by &amp;ldquo;simple C&amp;rdquo; I refer to C procedures that do not involve pass-by-reference return values, but only parameter of the type pass-by-value or pointers to 1D array. There&amp;rsquo;s a gentle tutorial that covers such &lt;a href="http://www.cs.grinnell.edu/~rebelsky/Glimmer/Summer2012/RacketFFI/tutorial.html"&gt;simple cases&lt;/a&gt;. There&amp;rsquo;s also a very nice &lt;a href="https://prl.ccs.neu.edu/blog/2016/06/27/tutorial-using-racket-s-ffi/"&gt;tutorial&lt;/a&gt; available in 3 parts if you want to learn more.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s see a more complete example in action. Suppose your C function, &lt;code&gt;qs.c&lt;/code&gt;, reads like this simple quick sort:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-c" data-lang="c"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#define SWAP(x, y) do { typeof(x) SWAP = x; x = y; y = SWAP; } while (0)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;qs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;SWAP&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;SWAP&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;qs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;qs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now, we just have to compile this using &lt;code&gt;gcc&lt;/code&gt; or &lt;code&gt;clang&lt;/code&gt;, depending on what&amp;rsquo;s available on your OS. In my case:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;~/tmp  cc -dynamiclib -o qs.dylib qs.c
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You should end up with a shared (dynamic) library, ready to be used by C programs, or Racket itself. On the Racket side, let&amp;rsquo;s write the corresponding functions:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;require&lt;/span&gt; &lt;span class="n"&gt;ffi/unsafe&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ffi/cvector&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ffi/unsafe/define&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;define-ffi-definer&lt;/span&gt; &lt;span class="n"&gt;define-libs&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ffi-lib&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;qs&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;define-libs&lt;/span&gt; &lt;span class="n"&gt;qs&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_fun&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;:&lt;/span&gt; &lt;span class="n"&gt;_cvector&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;_int&lt;/span&gt; &lt;span class="n"&gt;_int&lt;/span&gt; &lt;span class="k"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;_void&lt;/span&gt; &lt;span class="k"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;values&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That&amp;rsquo;s it! Note that sorting is done in place, hence the pass-by-reference return value (&lt;code&gt;*lst&lt;/code&gt;) that we need to tag in order to be able to refer to the captured value from Racket. You&amp;rsquo;ll now just need to define a C-type vector in Racket and pass it to your function as shown below:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define-values&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;qs&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;list-&amp;gt;cvector&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;_int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And here we are finally:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;#&amp;lt;cvector&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cvector-&amp;gt;list&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;small&gt;Note that Racket is using 0-base indexing, like Python. You could replace the last expression with &lt;code&gt;(map add1 (cvector-&amp;gt;list a))&lt;/code&gt;.&lt;/small&gt;&lt;/p&gt;</description></item><item><title>Computing Student t-test</title><link>https://aliquote.org/post/computing-student-t/</link><pubDate>Sat, 14 Dec 2019 18:02:18 +0100</pubDate><guid>https://aliquote.org/post/computing-student-t/</guid><description>&lt;p&gt;The Student &lt;em&gt;t&lt;/em&gt;-test is a well-known statistical test when it comes to comparing the mean of two groups, or of one group to a reference value. It is an interesting case in the statistical armory since it requires two estimates (the mean and the standard deviation) from the same sample as well as &lt;a href="https://en.wikipedia.org/wiki/Behrens%E2%80%93Fisher_problem"&gt;strong assumptions&lt;/a&gt;, but if we leave that aside it is also an interesting challenge from an algorithmic perspective.&lt;/p&gt;
&lt;p&gt;Indeed, you may recall that the test statistic is computed as $(\bar x - \mu_0) / (s_x / \sqrt{n})$ in the case of a single sample of size $n$, for which $\bar x$ and $s_x$ denote the sample mean and standard deviation which are estimates for the corresponding population mean ($\mu$) and variance ($\sigma^2$), while $\mu_0$ is the parameter we are interested in under the null hypothesis $H_0:, \mu = \mu_0$. In this case, $s^2$ follows a chi-square distribution with $\eta=n-1$ degrees of freedom, while $\bar x$ follows a gaussian distribution with parameter $\mu$ and $\sigma^2/n$.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; The Student $t$ distribution has a probability density function that can be expressed either as a combination of Gamma distributions, or using the following Beta distribution:&lt;/p&gt;
&lt;p&gt;$$ f(t) = \frac{1}{\sqrt{\eta}B(\frac{1}{2},\frac{\eta}{2})}\left( 1+\frac{t^2}{\eta}\right)^{-\frac{\eta+1}{2}}. $$&lt;/p&gt;
&lt;p&gt;Depending on whether $\eta$ is odd or even, specific &lt;a href="https://en.wikipedia.org/wiki/Student%27s_t-distribution"&gt;asymptotic expansions&lt;/a&gt; can be used but only in the case where $\eta$ is an integer value, which is not always the case, e.g., when using Welch or Satterthwaite approximations.&lt;/p&gt;
&lt;p&gt;If you look into the R source code, you will find a standard helper function, &lt;code&gt;src/library/stats/R/t.test.R&lt;/code&gt;, which computes the test statistic, its p-value and associated confidence interval. Nothing really surprising here, you could write a function that does the same job, providing you take care of computing the variance correctly (cf. possible catastrophic cancellation discussed in a &lt;a href="https://aliquote.org/post/computing-variance"&gt;previous post&lt;/a&gt;). What&amp;rsquo;s more difficult is to get the p-value, and the confidence interval &lt;em&gt;de facto&lt;/em&gt;, since it involved a continuous distribution that is quite complicated.&lt;/p&gt;
&lt;p&gt;If you look more carefully, you will notice that the probability distribution function &lt;code&gt;pt&lt;/code&gt; is implemented in C in &lt;code&gt;src/nmath/pt.c&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-R" data-lang="R"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;pt&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ncp&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lower.tail&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;TRUE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;log.p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;FALSE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kr"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;missing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ncp&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nf"&gt;.Call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;C_pt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lower.tail&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;log.p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kr"&gt;else&lt;/span&gt; &lt;span class="nf"&gt;.Call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;C_pnt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ncp&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lower.tail&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;log.p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;bytecode&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;0x7fc000643fe0&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;environment&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;namespace&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;stats&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;small&gt;The &lt;code&gt;pnt.c&lt;/code&gt; file is used in the case of a non-central distribution.&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;Now, what&amp;rsquo;s inside the C code?&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First, a normal approximation (&lt;code&gt;pnorm&lt;/code&gt;) is used when &lt;em&gt;n&lt;/em&gt; is large (&lt;code&gt;n &amp;gt; 4e5&lt;/code&gt; for R version ≤ 2.6), and in more recent versions of R a modified Beta approximation in the case $x^2&amp;gt;10^{100}n$;&lt;/li&gt;
&lt;li&gt;in the other case, the p-value is estimated from a Beta distribution, specifically a $\text{Beta}(x^2/(n+x^2), 0.5, n/2)$ when $n&amp;gt;x^2$, or a $\text{Beta}(1/(1 + x^2/n), n/2, 0.5)$ if $n \le x^2$.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The last two conditions aim at limiting possible underflow and come from Abramowitz &amp;amp; Stegun&amp;rsquo;s textbook, &lt;a href="http://people.math.sfu.ca/~cbm/aands/"&gt;&lt;em&gt;Handbook of Mathematical Functions&lt;/em&gt;&lt;/a&gt;, specifically the following formula for the incomplete Beta function:&lt;/p&gt;
&lt;p&gt;$$ I_x(a, b) = \frac{x^a(1-x)^b}{aB(a, b)} \left[ 1 + \sum_{n=0}^\infty \frac{B(a+1,n+1)}{B(a+b,n+1)} x^{n+1} \right], $$&lt;/p&gt;
&lt;p&gt;where $B(a, b)$ denotes a Beta distribution with shape parameters $a$ and $b$, which are called $\alpha$ and $\beta$ on &lt;a href="https://en.wikipedia.org/wiki/Beta_distribution"&gt;Wikipedia&lt;/a&gt;. In this case, $a = n/2$ and $b= 1/2$.&lt;/p&gt;
&lt;p&gt;Beside R, there&amp;rsquo;s &lt;a href="http://lib.stat.cmu.edu/apstat/3"&gt;algorithm AS 3&lt;/a&gt; that&amp;rsquo;s lurking on StatLib, but you will find a more detailed discussion the CACM, specifically &lt;a href="https://dl.acm.org/citation.cfm?id=362775"&gt;Algorithm AS 395&lt;/a&gt;. In fact, LispStat relies on the latter, and again, a distinction is made depending on whether the degrees of freedom ($\eta=n-2$) and the test statistic, $t$, are considered small ($\eta&amp;lt;20$ and $t &amp;lt; 4$) or large enough, in which case a Beta distribution $B(1/2, n/2)$ is used.&lt;sup id="fnref1:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; In fact, there are other corner cases that are treated, like the cases where:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;$\eta &amp;lt; 2$ and $\eta \ne 1$ (the degrees of freedom are not necessarily integers) &amp;mdash; despite the values, this is treated as what is considered large in the above statement and relies on a $B(1/2, n/2)$; otherwise, LispStat relies on asymptotic series, as described p. 619 of Algorithm 395;&lt;/li&gt;
&lt;li&gt;nested summation of cosine series are used in all cases where none of the following conditions are verified: $\eta &amp;gt; \lfloor n\rfloor$, or $n \ge 20$ and $t &amp;lt; n$, or $n &amp;gt; 20$ &amp;mdash; this is what is considered &amp;ldquo;small&amp;rdquo; in the above description.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Apparently, Stata relies on a Gamma distribution and, per the documentation, the function &lt;code&gt;ttail&lt;/code&gt; computes the reverse cumulative (survivor) Student’s t distribution (i.e., $\Pr(T&amp;gt;t)$) as $\int_t^\infty \frac{\Gamma\big((\eta+1)/2\big)}{\sqrt{\pi\eta}\phantom{:}\Gamma(\eta/2)}(1+x^2/\eta)^{-(\eta+1)/2}dx$, with $2^{-10}\le\eta\le 2^{17}$, $\eta\in\mathbb{R}^+$. Finally, Python uses an incomplete Beta in the &lt;a href="https://scipy.org/scipylib"&gt;scipy&lt;/a&gt; package for the &lt;code&gt;stats/ttest_*&lt;/code&gt; functions. It is defined in the &lt;code&gt;special&lt;/code&gt; submodule, as C code (&lt;code&gt;cephes/stdtr.c&lt;/code&gt;).&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;The parameterization of the Gaussian or Beta distribution may vary depending on the software you use.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&amp;#160;&lt;a href="#fnref1:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>On computing variance</title><link>https://aliquote.org/post/computing-variance/</link><pubDate>Fri, 13 Dec 2019 18:02:06 +0100</pubDate><guid>https://aliquote.org/post/computing-variance/</guid><description>&lt;p&gt;I recently started following Travis Hinkelman&amp;rsquo;s blog, originally because of several of his very interesting posts on Racket for statistical computing. Lately, he began to take a more serious interest in Chez Scheme and he even wrote a &lt;a href="https://www.travishinkelman.com/post/writing-chez-scheme-library/"&gt;short package&lt;/a&gt; for basic statistical data processing:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I had no idea that accurately calculating sample variance is challenging or that there are nine algorithms to choose from when using &lt;code&gt;quantile&lt;/code&gt; in R (and now also in &lt;code&gt;chez-stats&lt;/code&gt;).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Computing variance is such a big deal for applied statistics that it has been covered in several papers dating back to the 80s. Not only is variance, or sum of squares, involved in analysis of variance, but also in computing almost any estimate of some estimator precision. Like is the case for quantiles, several algorithms (&lt;em&gt;seven&lt;/em&gt;, as a matter of fact) have been proposed.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;As is always the case, John D. Cook already had this covered on &lt;a href="https://www.johndcook.com/blog/standard_deviation/"&gt;his blog&lt;/a&gt;.&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt; Be sure to check the related posts on standard deviation and accuracy of Welford&amp;rsquo;s approach to computing an estimate for the sample variance. A single pass algorithm is required when you deal with streaming data or when reading data twice would seriously impact the performance of your application (e.g., when frequent updates of the sample estimates are required). As discussed in the above link or on &lt;a href="https://jonisalonen.com/2013/deriving-welfords-method-for-computing-variance/"&gt;The Mindful Programmer&lt;/a&gt;, the following formula for the sample variance,&lt;/p&gt;
&lt;p&gt;$$ s^2 = \frac{1}{n-1}\sum_{i=1}^n(x_i-\bar x)^2 = \frac{1}{n-1}\left(\sum_{i=1}^n x_i^2 - n\bar x^2\right), $$&lt;/p&gt;
&lt;p&gt;is quite handy for manual computation with &amp;ldquo;usual&amp;rdquo; numbers but it is quite unstable numerically. Indeed, it may lead to serious &lt;a href="https://en.wikipedia.org/wiki/Loss_of_significance"&gt;cancellation error&lt;/a&gt; when the variance is small compared to the square of the mean.&lt;/p&gt;
&lt;p&gt;Consider the following sample of size 5, $x={1, 2, 3, 4, 5}$, for which $s_x^2=2.5$. Since the variance is invariant to changes in location parameter, adding 10&lt;sup&gt;10&lt;/sup&gt; to all five values should yield the same estimate. Let&amp;rsquo;s check what happen in R: (you&amp;rsquo;ll need &lt;code&gt;sprintf(&amp;quot;%.1f&amp;quot;, x)&lt;/code&gt; to display the values stored in variable &lt;code&gt;x&lt;/code&gt;)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-R" data-lang="R"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="m"&gt;5&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="m"&gt;1e10&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;[1]&lt;/span&gt; &lt;span class="m"&gt;2.5&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;4&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x^2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="m"&gt;-5&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nf"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="n"&gt;^2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;[1]&lt;/span&gt; &lt;span class="m"&gt;16384&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Using Welford algorithm, which is a good choice in the case &lt;em&gt;n&lt;/em&gt; is small,&lt;sup id="fnref1:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; we would however get the correct result. Here&amp;rsquo;s a quick implementation in R:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-R" data-lang="R"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;wvar&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="kr"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="n"&gt;s2&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;length&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kr"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="kr"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;seq&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;xs&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="n"&gt;x[k]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;tmp&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;xs&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;s2&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="n"&gt;s2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;xs&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;xs&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;tmp&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kr"&gt;return&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s2&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="m"&gt;-1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You know what? XLispStat got it almost right, even if it is using the more standard two-pass formula:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;def&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;iseq&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mf"&gt;1e10&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;def&lt;/span&gt; &lt;span class="nv"&gt;s&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;standard-deviation&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;*&lt;/span&gt; &lt;span class="nv"&gt;s&lt;/span&gt; &lt;span class="nv"&gt;s&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;2.5000000000000004&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Next time, we will revisit the Student &lt;em&gt;t&lt;/em&gt;-test using Beta integral aproximation for small degrees of freedom (DF) or asymptotic series for large or non-integer DF.&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Chan, T.F., Golub, G.H., and LeVeque, R.J. Algorithms for Computing the Sample Variance: Analysis and Recommendations. The American Statistician, 37(3): 242–247, 1983.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&amp;#160;&lt;a href="#fnref1:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;Ling, R.F. Comparison of Several Algorithms for Computing Sample Means and Variances. Journal of the American Statistical Association, 69(348): 859–866, 1974.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:3"&gt;
&lt;p&gt;See also &lt;a href="https://pvk.ca/Blog/2019/11/30/a-multiset-of-observations-with-constant-time-sample-mean-and-variance/"&gt;A Multiset of Observations With Constant-time Sample Mean and Variance&lt;/a&gt;.&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Sagan ici et là</title><link>https://aliquote.org/post/sagan-ici-et-la/</link><pubDate>Wed, 11 Dec 2019 07:56:27 +0100</pubDate><guid>https://aliquote.org/post/sagan-ici-et-la/</guid><description>&lt;p&gt;C&amp;rsquo;est Gainsbourg, il me semble, qui déclarait qu&amp;rsquo;à son âge on ne lisait plus, on relisait. Je n&amp;rsquo;ai pas encore l&amp;rsquo;âge qu&amp;rsquo;il avait lorsqu&amp;rsquo;il disait cela, mais je me souviens que, plus jeune, je trouvais ça étrange que l&amp;rsquo;on puisse renoncer à découvrir de nouveaux auteurs et se refermer dans le passé de nos lectures. Maintenant, je suis sans doute en âge de mieux comprendre le sens de ces mots, ou du moins j&amp;rsquo;en viens à suivre la même trajectoire, et par là à relire des livres que j&amp;rsquo;ai lus il y a fort longtemps, ou parfois quelques années seulement.&lt;/p&gt;
&lt;p&gt;En ce moment, je relis Françoise Sagan. J&amp;rsquo;ai même terminé de relire tous les ouvrages dont je dispose dans ma bibliothèque &amp;mdash; en partie héritée de ma mère et de mes grands-parents &amp;mdash; en réalité. Rien à voir avec le dernier roman posthume publié récemment d&amp;rsquo;ailleurs. Je l&amp;rsquo;ai lu, lui aussi, ainsi que celui de son fils, Denis Westhoff, mais je préfère me concentrer sur les romans et pièces de théâtre que j&amp;rsquo;ai lus il y a plus d&amp;rsquo;une vingtaine d&amp;rsquo;années, car au fond, tout y est, pêle-mêle, depuis &lt;em&gt;Bonjour Tristesse&lt;/em&gt;, ou &lt;em&gt;Toxique&lt;/em&gt;, jusqu&amp;rsquo;au &lt;em&gt;Miroir égaré&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;D&amp;rsquo;abord, il y a Éluard, préfigurant le titre du huitième roman de Sagan, mais dont on retrouve des traces, ici et là, au hasard des pages, voire même du premier ouvrage qui fit scandale à l&amp;rsquo;époque (&lt;em&gt;Bonjour tristesse&lt;/em&gt;&amp;hellip; à relire entre les lignes du plafond) :&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Inconnue, elle était ma forme préférée,&lt;br&gt;Celle qui m’enlevait le souci d’être un homme,&lt;br&gt;Et je la vois et je la perds et je subis&lt;br&gt;Ma douleur, comme un peu de soleil dans l’eau froide.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Mais, il y a tous ces autres auteurs, que Françoise Sagan appréciait par-dessus tout, et notamment Rimbaud, dont on retrouve quelques vers des &lt;em&gt;Illuminations&lt;/em&gt; dans un des chapitres de &lt;em&gt;Avec mon meilleur souvenir&lt;/em&gt; :&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;J’ai embrassé l’aube d’été.&lt;br&gt;Rien ne bougeait encore au front des palais. L’eau était morte. Les camps d’ombres ne quittaient pas la route du bois. J’ai marché, réveillant les haleines vives et tièdes, et les pierreries regardèrent, et les ailes se levèrent sans bruit.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Et puis, il y a ces petits trésors, que j&amp;rsquo;ai notés à plusieurs reprises dans des carnets lignés que je traîne depuis tant d&amp;rsquo;années, mémorisés dans un coin de ma tête sans jamais me rappeler d&amp;rsquo;où était tirés ces mots, et puis en relisant, au hasard &lt;em&gt;Le garde du coeur&lt;/em&gt;, tout redevient visible :&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Le ciel a des plages où éluder la vie présente et il est des corps qui ne doivent reparaître à l&amp;rsquo;aurore. &amp;mdash; García Lorca&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;J&amp;rsquo;ai finalement retrouvé le texte &lt;a href="https://www.poetryfoundation.org/poetrymagazine/browse?contentId=26580"&gt;traduit en anglais&lt;/a&gt; (p. 190), et c&amp;rsquo;est tout aussi poignant :&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Heaven has shores for our flights out of life and the corpse need need not make itself over at dawn.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Et puis, il y a Cocteau, dans &lt;em&gt;Avec mon meilleur souvenir&lt;/em&gt; :&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;la folle mer qui brise au bord ses coupes.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Je partage un grand nombre de ces références, que j&amp;rsquo;ai augmenté d&amp;rsquo;auteurs plus contemporains et divergents. Mais j&amp;rsquo;aime l&amp;rsquo;écriture de Sagan, ce style non pas inimitable mais qui accompagne si bien les scènes de vie de tous les jours où baignent des personnages effrayants de solitude et à la recherche d&amp;rsquo;amours sans limite. Ceci étant, lire Sagan c&amp;rsquo;est me replonger dans tout un univers parallèle d&amp;rsquo;autres lectures, que j&amp;rsquo;associe de près ou de loin, directement ou indirectement, à ces romans et pièces de théâtre que je lisais au sortir de l&amp;rsquo;adolescence. C&amp;rsquo;est revoir l&amp;rsquo;armoire à livres de mon enfance et les bibliothèques qui se sont succédées dans les différents appartements que j&amp;rsquo;ai occupés.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/IMG_0839.jpg"&gt;
&lt;/figure&gt;</description></item><item><title>Bioinformatics Algorithms</title><link>https://aliquote.org/post/bioinformatics-algorithms/</link><pubDate>Mon, 09 Dec 2019 08:09:27 +0100</pubDate><guid>https://aliquote.org/post/bioinformatics-algorithms/</guid><description>&lt;p&gt;Here is a short review of &lt;em&gt;Introduction to Bioinformatics Algorithms&lt;/em&gt;, written by Jones &amp;amp; Pevzner (The MIT Press, 2004), that I mentioned in a &lt;a href="https://aliquote.org/post/virus-and-bacteria/"&gt;previous post&lt;/a&gt;. Pavel Pevzner now offers an updated version on this textbook, &lt;a href="http://bioinformaticsalgorithms.com"&gt;Bioinformatics Algorithms: An Active Learning Approach&lt;/a&gt;, with full set of &lt;a href="http://compeau.cbd.cmu.edu/teaching/jones-pevzner-slides/"&gt;slides available&lt;/a&gt; on Philip Compeau&amp;rsquo;s homepage. See also &lt;a href="http://www.cs.hunter.cuny.edu/~saad/courses/bioinf/"&gt;this website&lt;/a&gt;, where Saad Mneimneh offers solutions to selected exercises from each chapter.&lt;/p&gt;
&lt;p&gt;Briefly, I started reading this book as a way to remind myself of some of the most important algorithms in bioinformatics. I did read &lt;em&gt;Bioinformatics&lt;/em&gt; (Polanski &amp;amp; Kimmel, Springer, 2007 &amp;mdash; best book I&amp;rsquo;ve read so far) and part of &lt;em&gt;Bioinformatics Algorithms&lt;/em&gt; (Măndoiu &amp;amp; Zelikovsky, eds., Wiley, 2008 &amp;mdash; a bit outdated since the advance in next-generation sequencing) a while ago, while I was working as a biostatistician. However, this textbook attracted me because it is aimed at two very distinct audiences: on the one hand, biologists, who can familiarize themselves with the basic concepts of informatics for bioinformatics applications, and on the other hand, computer scientists, who are made aware of the context of genetics and molecular biology and the underlying theoretical issues.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I have indeed been able to apply my skills in this new area, but only after coming to understand that solving biological problems requires far more than clever algorithms: it involves a creative partnership between biologists and mathematical scientists to arrive at an appropriate mathematical model, the acquisition and use of diverse sources of data, and statistical methods to show that the biological patterns and regularities that we discover could not be due to chance. &amp;mdash; Richard Karp&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The authors make use of simplified pseudo-code for all the algorithms discussed in this book &amp;mdash; on the basis that part of the target audience are biologists. I found it nice, as it is heavily inspired from Python syntax (significant indentation is fine for reading purpose, IMHO). The introductory chapter on computer science (CS) is pretty basic stuff that can be found in any introductory textbook (chapter 2): algorithmic complexity, recursive versus iterative approach, type of algorithms (brute force, branch-and-bound, greedy approach, dynamic programming, divide-and-conquer, machine learning, randomized algorithms), and NP-completeness. It is intended for biologists. For CS folks, the third chapter provides a gentle primer to biology.&lt;/p&gt;
&lt;p&gt;A striking feature of this book is the way in which the authors introduce the reader to relatively complex algorithmic subjects of dynamic programming via game theory accessible to everyone. For instance, in the case of the well-known &lt;a href="https://en.wikipedia.org/wiki/BLAST_(biotechnology)"&gt;Blast algorithm&lt;/a&gt;, the authors offers this &amp;ldquo;winning recipe&amp;rdquo; for the rock game:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If Alice takes one rock from each pile, I will take the remaining rocks and win. If Alice takes one rock, I will take one rock from the same pile. As a result, there will be only one pile and it will have two rocks in it, so Alice’s only choice will be to take one of them. I will take the remaining rock to win the game.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It may seem that this is yet another introductory textbook to programming for biologists, but bear in mind that the authors rather emphasize the design of efficient algorithms (and no real code is used), and this is not limited to basic string alignment or sorting algorithms. More elaborated topics are covered in large, including graphs algorithms (in the context of alignement and protein sequencing, after introducing basic principle using a chessboard), suffix trees and combinatorial algorithms, evolutionary trees, Hidden Markov models (again, using analogy with betting in a casino), and finally randomized algorithms. This is by far one of the most interesting books I&amp;rsquo;ve read in a long time &amp;mdash; the other one being &lt;a href="https://pimbook.org"&gt;A Programmer&amp;rsquo;s Introduction to Mathematics&lt;/a&gt;, by Jeremy Kun.&lt;/p&gt;</description></item><item><title>Prime permutations</title><link>https://aliquote.org/post/prime-permutations/</link><pubDate>Sun, 08 Dec 2019 10:47:19 +0100</pubDate><guid>https://aliquote.org/post/prime-permutations/</guid><description>&lt;p&gt;I recently subscribed to the &lt;a href="https://golem.ph.utexas.edu/category/"&gt;n-Category Café&lt;/a&gt; RSS feed, and I really enjoyed the last posts on random permutations. For instance, I learned that the distribution of the number of cycles of length &lt;em&gt;k&lt;/em&gt; in a a random permutation of an &lt;em&gt;n&lt;/em&gt;-element set, thought of as a random variable, follow a Poisson distribution with mean 1/&lt;em&gt;k&lt;/em&gt; as $n\to \infty$. Go read the rest of the &lt;a href="https://golem.ph.utexas.edu/category/2019/12/random_permutations_part_7.html"&gt;post&lt;/a&gt; if you want to learn more interesting facts on random permutations.&lt;/p&gt;
&lt;p&gt;That being said, there&amp;rsquo;s a lot more to see regarding permutations in Knuth&amp;rsquo;s artwork, of course, especially in the TAOCP, vol. 4 (ex &lt;a href="http://www.kcats.org/csci/464/doc/knuth/fascicles/fasc2b.pdf"&gt;pre-fascicle 2B&lt;/a&gt;), for which there exist some efficient &lt;a href="https://stackoverflow.com/a/30428753"&gt;Python solutions&lt;/a&gt; (or even the &lt;a href="https://rosettacode.org/wiki/Permutations_by_swapping"&gt;Steinhaus-Johnson-Trotter&lt;/a&gt; algorithm). However, I recently stumbled upon the following problem on the Euler project. The arithmetic sequence, 1487, 4817, 8147, in which each of the terms increases by 3330, is unusual in two ways: (i) each of the three terms are prime, and, (ii) each of the 4-digit numbers are permutations of one another. There exists a 4-digit increasing sequence, and the question is: What 12-digit number do you form by concatenating the three terms in this sequence?&lt;/p&gt;
&lt;p&gt;Here is my solution, which is heavily inspired by some of the solutions I found online in Haskell, Python or Lisp dialects:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;sympy&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;isprime&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;isperm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;sorted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="nb"&gt;sorted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1487&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3330&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;elt&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="kc"&gt;True&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;elt&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;isprime&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;isperm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;isperm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;break&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I had a great time at writing the above &lt;code&gt;if&lt;/code&gt; statement, because of the way Python can be used to write concise iterators while allowing &lt;a href="https://aliquote.org/post/python-getting-functional"&gt;functional geekery&lt;/a&gt; using &lt;code&gt;map&lt;/code&gt;. I didn&amp;rsquo;t implement a Sieve for finding prime numbers since I believe the &lt;code&gt;sympy&lt;/code&gt; package provides a very efficient ones. There are very clever implementations on Stack Overflow, though. Note that the last expression could be rewritten as &lt;code&gt;''.join(map(str, [a, b, c]))&lt;/code&gt;. The logic behind the above code is quite simple: we generate prime candidates, &lt;code&gt;a&lt;/code&gt;, &lt;code&gt;b&lt;/code&gt;, and &lt;code&gt;c&lt;/code&gt;, starting with &lt;code&gt;a=1487&lt;/code&gt;, and using the same increment, 3330. Put it simply, this is brute force method, but it happens to work in a reasonable amount of time.&lt;/p&gt;</description></item><item><title>Motzkin numbers</title><link>https://aliquote.org/post/motzkin-numbers/</link><pubDate>Sat, 07 Dec 2019 16:23:40 +0100</pubDate><guid>https://aliquote.org/post/motzkin-numbers/</guid><description>&lt;p&gt;In one of my last post, I discussed &lt;a href="https://aliquote.org/post/de-bruijn-graph/"&gt;de Bruijn graph&lt;/a&gt; based on one of &lt;a href="http://rosalind.info"&gt;Rosalind&lt;/a&gt; problems in the Bioinformatics track. This post is again about graphs, and Rosalind problems. The Motzkin number &lt;em&gt;M&lt;sub&gt;n&lt;/sub&gt;&lt;/em&gt; represents the number of ways to form a noncrossing matching (i.e., non-intersecting chords) in the complete graph &lt;em&gt;K&lt;sub&gt;n&lt;/sub&gt;&lt;/em&gt; with &lt;em&gt;n&lt;/em&gt; nodes. A related quantity is the Catalan number &lt;em&gt;C&lt;sub&gt;n&lt;/sub&gt;&lt;/em&gt; which counts the number of ways to form a &lt;em&gt;perfect&lt;/em&gt; noncrossing matching; in this case the matching includes every node in the graph, which must necessarily contain an even total number of nodes. A picture is better than thousand of words, so I wrote a bit of Metapost (long time no see!) to reproduce part of the figure for &lt;em&gt;M&lt;sub&gt;5&lt;/sub&gt;&lt;/em&gt; available on &lt;a href="https://en.wikipedia.org/wiki/Motzkin_number"&gt;Wikipedia&lt;/a&gt;:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/motzkin.png"&gt;
&lt;/figure&gt;
&lt;p&gt;The following recurrence relation can be used to find the value of &lt;em&gt;M&lt;sub&gt;n&lt;/sub&gt;&lt;/em&gt;, for any &lt;em&gt;n&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;$$ M_n = M_{n-1} + \sum_{k=2}^n M_{k-2}\cdot M_{n-k}, $$&lt;/p&gt;
&lt;p&gt;with $M_0=M_1=1$.&lt;/p&gt;
&lt;p&gt;Given an RNA sequence &lt;em&gt;s&lt;/em&gt;, the number of noncrossing matchings of basepair edges in the bonding graph of &lt;em&gt;s&lt;/em&gt; corresponds to the number of possible secondary structures for that RNA string. It means that the recurrence relation shown above must accomodate the following base pairing rule: A $\leftrightarrow$ U and C $\leftrightarrow$ G.&lt;/p&gt;
&lt;p&gt;Here is my solution, which only exploits Biopython facilities to read the input file, which is in Fasta format:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;motz&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;seq&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;seq&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;seq&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;matches&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;matches&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;seq&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;matches&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;seq&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;motz&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;seq&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;seq&lt;/span&gt;&lt;span class="p"&gt;)):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;seq&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;codons&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;seq&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]]:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;matches&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;seq&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;motz&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;seq&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;motz&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;seq&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;matches&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;seq&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;rna&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;SeqIO&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;motz.txt&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;fasta&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;codons&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;A&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;U&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;U&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;A&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;C&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;G&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;G&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;C&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;matches&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;motz&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rna&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;seq&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;1000000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;small&gt;Note that the task is to give the results modulo 1000000, hence the modulo operator in the &lt;code&gt;print&lt;/code&gt; instruction.&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;So basically, this is sort of &amp;ldquo;dynamic programming&amp;rdquo;, which amounts to break the problem into smaller problems and use the solutions of the subproblems to construct the solution of the larger one. Since this may yield to a very large number of similar subproblems that we need to solve again and again &amp;mdash; hence increasing the overall running time &amp;mdash; dynamic programming can be thought of as a way to avoid recomputing values that were already computed in a previous step.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; A well-known approach to this approach is &lt;a href="https://en.wikipedia.org/wiki/Memoization"&gt;memoization&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In this particular case, we use a global dictionary to store the succesive matches we found when reading the string, after taking into account base pairing. If the value was already computed, just return it (this is the second &lt;code&gt;if&lt;/code&gt; statement); otherwise, compute the current value, add it to the dictionary, and return it. Then, we just have to reduce the problem to noncrossing matchings, and to select the next starting character in the string.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s see it in action for a toy example: (I just added a &lt;code&gt;print&lt;/code&gt; statement at the top of the &lt;code&gt;motz&lt;/code&gt; function to display intermediate results.)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;AUAU&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="n"&gt;motz&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;AU&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;UAU&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;AUAU&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;UA&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Out&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Jones, Neil C. &amp;amp; Pevzner, Pavel A. &lt;em&gt;An Introduction to Bioinformatics Algorithms&lt;/em&gt;. The MIT Press, 2004.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Micro posting in November</title><link>https://aliquote.org/post/micro-11-2019/</link><pubDate>Fri, 29 Nov 2019 13:58:15 +0100</pubDate><guid>https://aliquote.org/post/micro-11-2019/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-11-04&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/brad-mehldau-trio-live/275971252" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Brad Mehldau Trio, &lt;em&gt;Brad Mehldau Trio&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-04&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I don&amp;rsquo;t know coding at all anymore. Most of the code I write is in my e-mails. So somebody sends me a patch &amp;hellip; I [reply with] pseudo code. I&amp;rsquo;m so used to editing patches now I sometimes edit patches and send out the patch without having ever tested it. I literally wrote it in the mail and say, &amp;lsquo;I think this is how it should be done,&amp;rsquo; but this is what I do, I am not a programmer. &amp;mdash; Linus Torvalds, on &lt;a href="https://linux.slashdot.org/story/19/11/03/2230223/linus-torvalds-im-not-a-programmer-anymore"&gt;Slashdot&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-11-04&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The TV app is not an app. It’s a store. And Apple knows a thing or two about running stores. They know the more you walk in and hang out, the more likely you will spend some money while you are in there. &amp;mdash; &lt;a href="https://joecieplinski.com/blog/2019/11/01/its-not-an-app-its-a-store/"&gt;Joe Cieplinski&lt;/a&gt; (via &lt;a href="https://mjtsai.com/blog/2019/11/01/the-tv-app-strategy-tax/"&gt;Michael Tsai&lt;/a&gt;)See also: &lt;a href="https://dcurt.is/apple-tv-all-the-way-down"&gt;Apple TV, Apple TV, Apple TV, and Apple TV+&lt;/a&gt;. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-11-04&lt;/a&gt;: It&amp;rsquo;s quite unfortunate that my recent attempts at trying to compile the Haskell IDE engine, to use Fork or Caret have all ended in failure. At least, I may be working on what I&amp;rsquo;m supposed to be paid for.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-04&lt;/a&gt;: &lt;a href="http://jxv.io/blog/2017-12-19-Marry-the-Problem-Not-the-Solution.html"&gt;Marry the Problem &amp;ndash; Not the Solution&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-04&lt;/a&gt;: &lt;a href="https://github.com/chrisdone/intero"&gt;Sunsetting intero&lt;/a&gt;. It looks like Emacs folks may have to switch to Dante or &lt;a href="https://github.com/haskell/haskell-ide-engine"&gt;Haskell IDE&lt;/a&gt; soon or later.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-05&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Bio[logy] today is where information technology was 50 years ago: on the precipice of touching all of our lives. &amp;mdash; &lt;a href="https://a16z.com/2019/10/28/biology-eating-world-a16z-manifesto/"&gt;Biology is Eating the World: A Manifesto&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-11-05&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Every once in a while, try installing your software from scratch, along with all the dependencies. Ideally, you want your installation process to be as simple and frictionless as possible. &amp;mdash; &lt;a href="https://pointersgonewild.com/2019/11/02/they-might-never-tell-you-its-broken/"&gt;They Might Never Tell You It’s Broken&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-11-05&lt;/a&gt;: Yesterday evening was the second to last episode of &lt;a href="https://en.wikipedia.org/wiki/Below_the_Surface_(Danish_TV_series)"&gt;Below the surface&lt;/a&gt;. It can be watched but it&amp;rsquo;s certainly not worth &lt;a href="https://en.wikipedia.org/wiki/Westworld_(TV_series)"&gt;Westworld&lt;/a&gt;, IMO.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-05&lt;/a&gt;: &lt;a href="https://gyrosco.pe/"&gt;Gyroscope&lt;/a&gt; is probably yet another app to lose anonymity without gaining much, but it definitely looks like a gorgeous app.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-05&lt;/a&gt;: &lt;a href="https://herbie.uwplse.org/"&gt;Herbie&lt;/a&gt;: Find and fix floating-point problems.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-05&lt;/a&gt;: &lt;a href="https://codeburst.io/should-i-rust-or-should-i-go-59a298e00ea9"&gt;Should I Rust, or Should I Go&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-05&lt;/a&gt;: &lt;a href="https://www.nayuki.io/page/summary-of-c-cpp-integer-rules"&gt;Summary of C/C++ integer rules&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-06&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/sunny-border-blue/266446723" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Kristin Hersh, &lt;em&gt;Sunny Border Blue&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-06&lt;/a&gt;: Caret looks great but is definitely broken, IMO (how come the welcome screen is saved as a screenshot and we can&amp;rsquo;t close any folder currently opened?). &lt;a href="https://typora.io"&gt;Typora&lt;/a&gt; appears like a great alternative to existing apps for Markdown editing.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-06&lt;/a&gt;: How to submit an Electron App to App Store using Electron-Packager, or How to Submit an Electron 7 App to the Apple App Store, and finally &lt;a href="https://david.dev/you-cannot-submit-an-electron-6-or-7-app-to-the-apple-store"&gt;You Cannot Submit an Electron 6 (or 7) App to the Apple Store&lt;/a&gt;. BTW, &lt;a href="http://photonkit.com"&gt;Photon&lt;/a&gt; looks great for Electron app on macOS. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-06&lt;/a&gt;: &lt;a href="https://pair-code.github.io/understanding-umap/supplement.html"&gt;A deeper dive into UMAP theory&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In its simplest sense, the UMAP algorithm consists of two steps: construction of a graph in high dimensions followed by an optimization step to find the most similar graph in lower dimensions. In order to achieve this goal, the algorithm relies on a number of insights from algebraic topology and Riemannian geometry. Despite the intimidating mathematics, the intuitions behind the core principles are actually quite simple: UMAP essentially constructs a weighted graph from the high dimensional data, with edge strength representing how “close” a given point is to another, then projects this graph down to a lower dimensionality. The advanced mathematics gives UMAP a solid footing with which to handle the challenges of doing this in high dimensions with real data.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-11-06&lt;/a&gt;: &lt;a href="http://d2l.ai/d2l-en.pdf"&gt;Dive into Deep Learning&lt;/a&gt;, by Alex Smola and coll. Blog post &lt;a href="https://blog.smola.org/post/180838682891/dive-into-deep-learning"&gt;here&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-06&lt;/a&gt;: &lt;a href="https://professeurb.github.io/articles/carmack/"&gt;L&amp;rsquo;astuce (qui n&amp;rsquo;était pas) de John Carmack&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-06&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/live-at-noe-valley-ministry/18766497"&gt;Live At Noe Valley Ministry&lt;/a&gt;.&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-11-06-12-55-43.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-06&lt;/a&gt;: &lt;a href="http://lomont.org/posts/2019/lines-of-code/"&gt;Nice work!&lt;/a&gt;&amp;gt; Over decades I’ve written a lot of personal code. I made a bar chart race showing how many lines I’ve written in different languages over time.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-07&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/playlist/piano-keith-jarrett/pl.u-jV89oxNCja62e2" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Some random musings around Keith Jarrett.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-07&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The option to “Download Originals to this Mac” doesn’t apply to shared photos. So you can’t back them up youself, and there’s no backup in the cloud. Not only does it no longer download the photos, but it also deleted the ones that had been downloaded by macOS 10.14. &amp;mdash; &lt;a href="https://mjtsai.com/blog/2019/11/06/catalina-no-longer-caches-shared-photos-locally/"&gt;Catalina No Longer Caches Shared Photos Locally&lt;/a&gt;See also &lt;a href="https://tracking.feedpress.it/link/21521/12953365"&gt;Gone&lt;/a&gt;, by Tyler Hall. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-11-07&lt;/a&gt;: TIL about a new X11/tmux compliant text editor: &lt;a href="http://kakoune.org"&gt;kakoune&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-07&lt;/a&gt;: &lt;a href="https://yulab-smu.github.io/treedata-book/"&gt;Data Integration, Manipulation and Visualization of Phylogenetic Trees&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-07&lt;/a&gt;: &lt;a href="https://eli.thegreenplace.net/2019/how-to-send-good-pull-requests-on-github/"&gt;How to send good pull requests on GitHub&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-07&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/playlist/piano-chill/pl.cb4d1c09a2df4230a78d0395fe1f8fde"&gt;Piano Chill&lt;/a&gt; (since yesterday).&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-11-07-11-02-33.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-07&lt;/a&gt;: &lt;a href="http://compeau.cbd.cmu.edu/programming-for-lovers/"&gt;Programming for Lovers&lt;/a&gt;. &lt;code&gt;#bioinformatics&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-08&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;It also fails to mention that the Safe Browsing feature sends, from your IP address, information about the sites you visit to Google or Tencent. &amp;mdash; &lt;a href="https://mjtsai.com/blog/2019/11/07/apples-new-privacy-page/"&gt;Apple’s New Privacy Page&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-11-08&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;To riff on an idea from Alan Jacobs, a blog can be a kind of garden—perhaps one that is well-tended, or perhaps one that is gone a bit wild and overgrown, but either way a place where the structure is organic and emergent as much as it is planned. Even the most carefully-kept gardens have surprises in them, courtesy of the infinite variety that is life. &amp;mdash; &lt;a href="http://v4.chriskrycho.com/2019/tending-my-word-garden.html"&gt;Tending My Word-Garden&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-11-08&lt;/a&gt;: I just updated my Doom Emacs, which was 10 weeks old. Of course, I had to start from scratch since the upgrade process failed miserably. Great news: they switched to &lt;a href="https://github.com/emacs-lsp/lsp-python-ms"&gt;MS Python LSP&lt;/a&gt;, which is supposed to be better than the default LSP. BTW, the material icon fonts may fail to install properly, so be sure to check it is right into &lt;code&gt;~/Library/Fonts&lt;/code&gt; in case you see strange icons in your modeline. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-11&lt;/a&gt;: Interesting idea: &lt;a href="https://github.com/bennorth/literate-git/"&gt;Literate Git&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-11&lt;/a&gt;: Just started watching &lt;a href="https://en.wikipedia.org/wiki/The_Rook_(miniseries)"&gt;The Rook&lt;/a&gt;. Looks good so far.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-11&lt;/a&gt;: Little memory from the family weekend.&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_0825.jpg" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-11&lt;/a&gt;: TIL there&amp;rsquo;s a very interesting series of posts on &lt;em&gt;Compiling a Functional Language Using C++&lt;/em&gt; on &lt;a href="http://danilafe.com"&gt;Daniel&amp;rsquo;s Blog&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-11&lt;/a&gt;: &lt;a href="https://www.anotherbookondatascience.com"&gt;Another Book on Data Science: Learn R and Python in Parallel&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-11&lt;/a&gt;: &lt;a href="https://bookdown.org/ajkurz/DBDA_recoded/"&gt;Doing Bayesian Data Analysis in brms and the tidyverse&lt;/a&gt;. Just in case you&amp;rsquo;re interested in performing Bayesian analysis the tidyverse way. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-12&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/within-a-song/519124481" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   John Abercrombie Quartet, &lt;em&gt;Within A Song&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-12&lt;/a&gt;: &lt;a href="https://tracking.feedpress.it/link/535/12964281"&gt;Fish: Further exploration&lt;/a&gt;, by Brett Terpstra.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-12&lt;/a&gt;: &lt;a href="https://github.com/vydd/sketch"&gt;Sketch&lt;/a&gt;: A Common Lisp framework for the creation of electronic art, visual design, game prototyping, game making, computer graphics, exploration of human-computer interaction, and more. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-12&lt;/a&gt;: &lt;a href="https://github.com/xo/usql"&gt;usql&lt;/a&gt;: A universal command-line interface for PostgreSQL, MySQL, Oracle Database, SQLite3, Microsoft SQL Server, and many other databases including NoSQL and non-relational databases! &lt;code&gt;#database&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-13&lt;/a&gt;: It turns out the new Apple &lt;a href="https://www.apple.com/macbook-pro-16/"&gt;Macbook Pro&lt;/a&gt; will be just under $4500 when maxed out (except for the HD which I choose to stay at 2TB SSD). You can save $800 by giving up the 64 GB of RAM. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-14&lt;/a&gt;: &amp;gt; ICANN made this deal much more valuable by removing all price controls on .org. &amp;mdash; &lt;a href="https://domainnamewire.com/2019/11/13/breaking-private-equity-company-acquires-org-registry/"&gt;Breaking: Private Equity company acquires .Org registry&lt;/a&gt;If you have a &lt;code&gt;.org&lt;/code&gt; domain, like me, it&amp;rsquo;s probably time to renew it for 10 or 15 years as &lt;a href="https://www.manton.org/2019/11/13/after-reading-this.html"&gt;Manton Reece&lt;/a&gt; suggests.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-14&lt;/a&gt;: TIL about &lt;a href="https://sketchviz.com/new"&gt;Sketchviz&lt;/a&gt;, which allows to pimp your Graphviz diagram a bit. (h/t &lt;a href="http://feedproxy.google.com/~r/TheEndeavour/~3/oEgQVh2gRyI/"&gt;John D. Cook&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-14&lt;/a&gt;: &lt;a href="https://github.com/thinkhuman/writingwithemacs/"&gt;Emacs resources for writers&lt;/a&gt;. (via &lt;a href="http://feedproxy.google.com/~r/TheEndeavour/~3/oEgQVh2gRyI/"&gt;Irreal&lt;/a&gt;) &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-14&lt;/a&gt;: &lt;a href="https://marco.org/2019/11/13/mbp16"&gt;The 16-inch MacBook Pro&lt;/a&gt;. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-14&lt;/a&gt;: &lt;a href="https://uglyduck.ca/basic-form-styling/"&gt;Very Basic Form Styling&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-15&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/a-different-age/1325238336" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Current Joys, &lt;em&gt;A Different Age&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-15&lt;/a&gt;: Development of &lt;code&gt;nvim&lt;/code&gt; is amazing. Now it features &lt;a href="https://github.com/neovim/neovim/pull/11336"&gt;LSP integration&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-15&lt;/a&gt;: TIL about &lt;a href="https://withknown.com/"&gt;Known&lt;/a&gt;, a collaborative social publishing engine, by reading Ben Werdmüller&amp;rsquo;s great advice of &lt;a href="https://werd.io/2019/the-best-way-to-blog-in-2020"&gt;how to blog in 2020&lt;/a&gt;. So, what&amp;rsquo;s blogging?&amp;gt; Here&amp;rsquo;s what it&amp;rsquo;s not: professional article writing. If you want to go through multiple rounds of editing, please do. If you want to write two thousand word epics about your topic of choice, please do. But it&amp;rsquo;s also okay to write up a hundred quick words and post them without thinking twice about it.&amp;raquo; When you blog, you&amp;rsquo;re building up a body of work that represents you online. It&amp;rsquo;s a gateway into your thought process more than anything else. So do what moves you - whether that&amp;rsquo;s short thoughts, bookmarks you like, essays, fiction, poetry, photo albums, and so on. You do you. The only thing that&amp;rsquo;s really important is that you keep doing it.Thanks to &lt;a href="https://jlelse.blog/links/2019/11/best-way-to-blog/"&gt;Jan-Lukas Else&lt;/a&gt; for the pointer!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-15&lt;/a&gt;: TIL about &lt;a href="https://github.com/plexus/chemacs"&gt;chemacs&lt;/a&gt;, an Emacs profile switcher. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-15&lt;/a&gt;: &lt;a href="https://blog.ploeh.dk/2019/11/04/the-80-24-rule/"&gt;The 80/24 rule&lt;/a&gt;, by Mark Seemann.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-18&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Anne Queffélec, &lt;em&gt;Satie: Piano Works&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-18&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;So the main selling point of this new, $2,399 computer is that it fixes some of the unforced errors that Apple made in 2016. You’re paying to get the same sort of keyboard, the same escape key, the same arrow keys that you could buy in 2015. Apple fans would pay even more to get the MagSafe charger they had back then, too, or to not have the TouchBar at all. &amp;mdash; &lt;a href="https://macwright.org/2019/11/15/something-is-wrong-with-computers.html"&gt;Something is wrong with computers&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-11-18&lt;/a&gt;: &lt;a href="https://medium.com/better-programming/keeping-my-heroku-app-alive-b19f3a8c3a82"&gt;How To Keep Your Free Heroku App Alive and Prevent It From Going to Sleep&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-18&lt;/a&gt;: &lt;a href="https://slate.com/technology/2019/02/norbert-wiener-cybernetics-human-use-artificial-intelligence.html"&gt;What Would the Father of Cybernetics Think About A.I. Today?&lt;/a&gt;&amp;gt; Wiener’s central insight was that the world should be understood in terms of information. Complex systems, such as organisms, brains, and human societies, consist of interlocking feedback loops in which signals exchanged between subsystems result in complex but stable behavior. When feedback loops break down, the system goes unstable. He constructed a compelling picture of how complex biological systems function, a picture that is by and large universally accepted today.&amp;raquo; (&amp;hellip;)&amp;raquo; A major fear of the singulariteers is that as computers become more involved in designing their own software, they’ll rapidly bootstrap themselves into achieving superhuman computational ability. But the evidence of machine learning points in the opposite direction. As machines become more powerful and capable of learning, they learn more and more as human beings do—from multiple examples, often under the supervision of human and machine teachers. Education is as hard and slow for computers as it is for teenagers.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-19&lt;/a&gt;: &amp;gt; Don&amp;rsquo;t use Windows 10 - It&amp;rsquo;s a privacy nightmare. &amp;mdash; &lt;a href="https://www.privacytools.io"&gt;https://www.privacytools.io&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-19&lt;/a&gt;: Lovely pictures: &lt;a href="https://kottke.org/19/11/dreamy-cave-like-photos-taken-inside-musical-instruments"&gt;Dreamy Cave-Like Photos Taken Inside Musical Instruments&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-19&lt;/a&gt;: &lt;a href="https://mjtsai.com/blog/2019/11/18/how-google-interferes-with-its-search-algorithms-and-changes-your-results/"&gt;How Google Interferes With Its Search Algorithms and Changes Your Results&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-19&lt;/a&gt;: &lt;a href="https://github.com/sindresorhus/pure"&gt;Pretty, minimal and fast ZSH prompt&lt;/a&gt;. I still use zsh in Emacs, so let&amp;rsquo;s give it a go. And there&amp;rsquo;s a &lt;a href="https://github.com/rafaelrinaldi/pure"&gt;port for Fish&lt;/a&gt;, btw.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-19&lt;/a&gt;: &lt;a href="https://blog.mindlessness.life/makefile/2019/11/17/the-language-agnostic-all-purpose-incredible-makefile.html"&gt;The Language Agnostic, All-Purpose, Incredible, Makefile&lt;/a&gt; (via HN).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-20&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/blood-like-lemonade/375123562" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Morcheeba, &lt;em&gt;Blood Like Lemonade&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-20&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;It doesn’t matter who is guarding the walled garden’s gate if increasingly no one wants to go inside. So there’s a better word than “gatekeeper” to describe what we’re really after in building a great community-focused platform. It’s “curator”. Someone who is responsible for maintaining the best experience for users. &amp;mdash; &lt;a href="https://www.manton.org/2019/06/02/open-gardens.html"&gt;Open gardens&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-11-20&lt;/a&gt;: Here we go finally. Another LSP server running fine with Doom Emacs!&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-11-20-10-14-53.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-20&lt;/a&gt;: I spent a couple of hours building the full Haskell stack (aka &lt;a href="https://github.com/haskell/haskell-ide-engine"&gt;haskell-ide-engine&lt;/a&gt;), with &lt;code&gt;stack&lt;/code&gt;. (This was possible after I realized an old &lt;code&gt;cctools&lt;/code&gt; from Homebrew was causing trouble all along.) I ended up with a 8+ Gb &lt;code&gt;.stack&lt;/code&gt; directory, for a few command-line executables that now sit in my &lt;code&gt;.local&lt;/code&gt; directory. Now, &lt;a href="https://github.com/commercialhaskell/stack/issues/133"&gt;how&lt;/a&gt; do I clean up things? Enjoy! &lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-20&lt;/a&gt;: TIL about &lt;a href="https://manytricks.com/witch/"&gt;Witch&lt;/a&gt;, by the designers of Moom:&amp;gt; Switch Everything&amp;raquo; The built-in macOS app switcher is great if all you use are one-window applications. But you probably have many windows open in many apps, possibly with many tabs, and navigating them all is a pain. Enter Witch, with which you can switch everything.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-20&lt;/a&gt;: TIL about &lt;a href="https://bitwarden.com"&gt;bitwarden&lt;/a&gt; as a possible replacement to 1Password, thanks to &lt;a href="https://www.baty.net/2019/bitwarden/"&gt;Jack Baty&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-20&lt;/a&gt;: &lt;a href="https://matt.sh/howto-c"&gt;How to C in 2016&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-20&lt;/a&gt;: &lt;a href="https://kottke.org/19/11/the-hippie-aesthetic-of-the-60s-is-art-nouveau-on-acid"&gt;The Hippie Aesthetic of the 60s Is &amp;ldquo;Art Nouveau on Acid&amp;rdquo;&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-21&lt;/a&gt;: Diving again into Shiny today. Happy to see nothing has changed (so much), so that I can reuse my boilerplate template from 4 years. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-21&lt;/a&gt;: I had to cheat a bit for a few dozens of math-heavy problems, but overall I am quite happy with how much has been done in the past few months.&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-11-21-09-51-51.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-21&lt;/a&gt;: Last episode of &lt;a href="https://en.wikipedia.org/wiki/The_Rook_(miniseries)"&gt;The Rook&lt;/a&gt; tonight. Interesting, although TBH the scenario could have been a little more developed.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-21&lt;/a&gt;: The LSP &lt;code&gt;rename&lt;/code&gt; things is so useful (no more &lt;code&gt;query-replace&lt;/code&gt; in single file)! &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-21&lt;/a&gt;: &lt;a href="https://github.com/chuvanan/rdatatable-cookbook"&gt;Recipes for using R&amp;rsquo;s data.table package&lt;/a&gt;, via &lt;a href="https://twitter.com/eddelbuettel/status/1197220691449397249"&gt;@eddelbuettel&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-21&lt;/a&gt;: &lt;a href="https://arxiv.org/abs/1911.08628"&gt;Symbolic Formulae for Linear Mixed Models&lt;/a&gt;, via &lt;a href="https://twitter.com/ucfagls/status/1197566428758413312"&gt;@ucfagls&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-22&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Nick Cave &amp;amp; The bad Seeds, &lt;em&gt;The Abattoir Blues Tour&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-22&lt;/a&gt;: How lovely&amp;hellip; &lt;a href="https://kottke.org/19/11/the-art-of-the-travelling-salesman-problem"&gt;The Art of the Travelling Salesman Problem&lt;/a&gt;. See also &lt;a href="http://www.cgl.uwaterloo.ca/csk/projects/tsp/"&gt;TSP Art&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-22&lt;/a&gt;: Nice trick by Brett Terpstra: &lt;a href="https://brettterpstra.com/2019/11/22/iterm-and-the-find-pasteboard/"&gt;iTerm and the Find pasteboard&lt;/a&gt;. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-22&lt;/a&gt;: TIL about &lt;a href="https://github.com/susam/texme"&gt;texme&lt;/a&gt;, a self-rendering Markdown + LaTeX documents written in JS.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-22&lt;/a&gt;: &lt;a href="https://hakibenita.com/sql-dos-and-donts"&gt;12 Common Mistakes and Missed Optimization Opportunities in SQL&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-22&lt;/a&gt;: &lt;a href="http://www.lispology.com/show?2VBS"&gt;Rational approximations&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-25&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I had felt since the 2016 US election that Twitter had spiraled into a worse and worse condition; the site felt engineered to drive more and more &amp;ldquo;engagement&amp;rdquo; at the expense of human misery. So making a clean break dramatically improved my mental well-being. &amp;mdash; &lt;a href="https://technomancy.us/191"&gt;in which we get socially rendered&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-11-25&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Privacy is a group inoculation. Even if you self-host, there&amp;rsquo;s nothing to prevent your information from being inadvertently gathered by your friend who hasn&amp;rsquo;t taken the same steps. Not to mention that self-hosting is really hard! At its simplest, you need to know how to use command line tools (or, if you&amp;rsquo;re using shared hosting, be comfortable with FTP). At its hardest, you need to have some server administration skills. For those reasons, I don&amp;rsquo;t think self-hosting is a real solution to the problem in itself. There are lots of other great reasons to self-host: having full control of your web presence and data, if you have the means and the skills, allows you to better represent yourself online. &amp;mdash; &lt;a href="https://werd.io/2019/escape-from-google"&gt;Escape from Google&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-11-25&lt;/a&gt;: Guess who forgot to bring that dish (butternut squash with spices) to the table last Saturday?&lt;br&gt;&lt;img src="https://aliquote.org/img/59620452770__8AD9C6F5-F87C-4F44-9486-96599CFBE41C.jpg" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-25&lt;/a&gt;: Just found out &lt;a href="https://blog.acolyer.org/about/"&gt;&lt;em&gt;the morning paper&lt;/em&gt;&lt;/a&gt;:&amp;gt; The Morning Paper: a short summary every weekday of an important, influential, topical or otherwise interesting paper in the field of computer science.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-25&lt;/a&gt;: Pretty old school R plots and HTML pages: &lt;a href="https://aliquote.org/pub/DAAG/"&gt;https://aliquote.org/pub/DAAG/&lt;/a&gt;, &lt;a href="https://aliquote.org/pub/MABMUSPlus/gallery/"&gt;https://aliquote.org/pub/MABMUSPlus/gallery/&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-25&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/ash-ice/1087044599"&gt;Ash &amp;amp; Ice&lt;/a&gt;.&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-11-25-11-16-03.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-25&lt;/a&gt;: &lt;a href="https://kiwec.net/blog/posts/beating-c-with-brainfuck/"&gt;Beating C with 1 line of Brainfuck&lt;/a&gt;. Enjoy!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-25&lt;/a&gt;: &lt;a href="https://www.travishinkelman.com/post/deploy-shiny-electron/"&gt;Deploying a Shiny app as a desktop application with Electron&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-25&lt;/a&gt;: &lt;a href="https://designing-ggplots.netlify.com/"&gt;Designing ggplots: making clear figures that communicate&lt;/a&gt;. &lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-25&lt;/a&gt;: &lt;a href="https://serialmentor.com/dataviz/"&gt;Fundamentals of Data Visualization&lt;/a&gt;. &lt;code&gt;#dataviz&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-25&lt;/a&gt;: &lt;a href="https://textbooks.math.gatech.edu/ila/"&gt;Interactive Linear Algebra&lt;/a&gt;. (via HN)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-25&lt;/a&gt;: &lt;a href="https://github.com/liwenyip/hugo-easy-gallery/"&gt;hugo-easy-gallery&lt;/a&gt;: Interesting template to display a directory full of images.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-26&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/the-flying-club-cup/1309355762" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Beirut, &lt;em&gt;The Flying Club Cup&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-26&lt;/a&gt;: &amp;gt; It is ridiculously hard to go from models to applications. &amp;mdash; &lt;a href="https://lemire.me/blog/2019/11/26/better-computational-complexity-does-not-imply-better-speed/"&gt;Better computational complexity does not imply better speed&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-26&lt;/a&gt;: &amp;gt; It seems that by default formal technical documentation is targeted towards someone who’s deeply immersed in the ecosystem. But many developers have to juggle a lot of “worlds” in their heads daily. &amp;mdash; &lt;a href="https://rakhim.org/2019/11/examples-are-the-best-documentation/"&gt;Examples are the best documentation&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-26&lt;/a&gt;: If you&amp;rsquo;re interested in switching to or are already using the Fish shell, Brett Terpstra has made &lt;a href="https://tracking.feedpress.it/link/535/13001704"&gt;all his scripts&lt;/a&gt; available for free.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-26&lt;/a&gt;: &lt;a href="https://colcarroll.github.io/ppl-api/"&gt;A tour of probabilistic programming language APIs&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-26&lt;/a&gt;: &lt;a href="https://www.calazan.com/docker-cleanup-commands/"&gt;Docker Cleanup Commands&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-26&lt;/a&gt;: &lt;a href="https://media.emacsconf.org/2019/26.html"&gt;Emacs: The Editor for the Next Forty Years&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&amp;gt; I learned Emacs in September, 1983&lt;br&gt;&amp;gt; It is now November, 2019&lt;br&gt;&amp;gt; &amp;hellip;that’s over thirty six years!&lt;br&gt;&amp;gt; An amazingly long time.&lt;br&gt;&amp;gt; &amp;mdash; Perry E. Metzger&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-26&lt;/a&gt;: &lt;blockquote class="twitter-tweet"&gt;&lt;p lang="en" dir="ltr"&gt;TIL that you can &lt;a href="https://twitter.com/hashtag/include?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#include&lt;/a&gt; &amp;quot;/dev/stdin&amp;quot;&lt;br&gt;&lt;br&gt;$ cat in&lt;br&gt;&amp;quot;Hello, world!&amp;quot;&lt;br&gt;$ cat a.cpp&lt;a href="https://twitter.com/hashtag/include?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#include&lt;/a&gt; &amp;lt;stdio.h&amp;gt;&lt;br&gt;int main() {&lt;br&gt; printf(&amp;quot;%s\n&amp;quot;,&lt;br&gt; &lt;a href="https://twitter.com/hashtag/include?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#include&lt;/a&gt; &amp;quot;/dev/stdin&amp;quot;&lt;br&gt; );&lt;br&gt; return 0;&lt;br&gt;}&lt;br&gt;$ g++ a.cpp &amp;lt; in &amp;amp;&amp;amp; ./a.out&lt;br&gt;Hello, world!&lt;/p&gt;&amp;mdash; Peter Alexander (@Poita_) &lt;a href="https://twitter.com/Poita_/status/1198413809670598662?ref_src=twsrc%5Etfw"&gt;November 24, 2019&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async src="https://platform.twitter.com/widgets.js" charset="utf-8"&gt;&lt;/script&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-27&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/after-bach/1338962658" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Brad Mehldau, &lt;em&gt;After Bach&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-27&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Darwin itself was originally released by Apple in November 2000. It is a fork of Rhapsody, which was the codename used for Apple&amp;rsquo;s next-generation operating system after the purchase of NeXT in 1998. Darwin utilises the XNU kernel, and currently runs on modern x86-64 processors, as well as 32-bit ARM processors in the case of older iOS devices (e.g. the iPhone 5C).&lt;br&gt;&amp;gt; Many well-known elements of macOS such as the Cocoa framework and the famous Aqua graphical user interface are not included in Darwin, and unfortunately remain closed source. &amp;mdash; &lt;a href="https://www.jamieweb.net/blog/a-look-at-puredarwin/"&gt;A Look at PureDarwin&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-11-27&lt;/a&gt;: Started watching &lt;a href="https://en.wikipedia.org/wiki/Killing_Eve"&gt;Killing Eve&lt;/a&gt; recently.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-27&lt;/a&gt;: TIL you can export your &lt;a href="https://github.com/tomfaulkenberry/orgFoils"&gt;Org slides&lt;/a&gt; to FoilTeX instead of Beamer. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-27&lt;/a&gt;: &lt;a href="https://kulfon.org"&gt;Kulfon&lt;/a&gt;: Generate Websites from Data, Instantly. &lt;code&gt;#org&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-27&lt;/a&gt;: &lt;a href="https://bost.ocks.org/mike/algorithms/"&gt;Visualizing Algorithms&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-28&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Anyway, our point is if you’re going to read a Haskell manual for 10 minutes a day, you aren’t going to become a programmer even in a hundred years. But if you combine reading a manual with watching at least 10 minutes of video courses daily and doing 10 minutes of real coding each day for a couple of months, at the end you will be able to program something valuable in Haskell. &amp;mdash; [How to Learn Haskell in 10 Minutes a Day](How to Learn Haskell in 10 Minutes a Day)Sure. Hopefully, I could benefit from the rest of my working days to learn ReasonML, Purescript &amp;amp; Co.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-11-28&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Il est du devoir et de la responsabilité de chacun de prendre en charge sa destinée numérique. En acceptant, sans ne jamais les lire, les conditions d’utilisation des plateformes connectées, les individus donnent volontairement et intentionnellement leur accord pour le traitement et l’analyse de leurs données personnelles par des tiers. Ils devraient, à mon sens, se questionner sur le caractère gratuit des services offerts, sur l’essence de la rentabilité financière des GAFAM et être plus vigilants dans l’espace virtuel au lieu de se laisser distraire et se complaire dans un système qui viole leur vie privée. &amp;mdash; &lt;a href="https://standblog.org/blog/post/2019/11/26/Place-aux-jeunes-dans-la-lutte-contre-la-surveillance"&gt;Place aux jeunes dans la lutte contre la surveillance&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-11-28&lt;/a&gt;: I&amp;rsquo;ve built 3 dynamic websites in 6 months, using 3 different technologies (Flask/Heroku, Jekyll/Github &amp;amp; Shiny). You know what? It&amp;rsquo;s always harder when a database is involved in the process.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-28&lt;/a&gt;: Rebuilding my lightweight inbox&amp;hellip; Always a joy nowadays!&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-11-28-20-45-22.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-28&lt;/a&gt;: Still not convinced that &lt;a href="https://styler.r-lib.org"&gt;styler&lt;/a&gt; is worth as a &lt;a href="https://github.com/lassik/emacs-format-all-the-code"&gt;formatter&lt;/a&gt; in Emacs, at least using the default settings. I will try to fix some of the ugly &amp;ldquo;spaces, indention, line breaks and tokens&amp;rdquo; invasiveness. &lt;code&gt;#rstats&lt;/code&gt; &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-11-28-20-34-46.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-28&lt;/a&gt;: TIL about &lt;a href="https://www.resilio.com/"&gt;Resilio&lt;/a&gt;, for Connecting Massive Data Flows. (via &lt;a href="https://usesthis.com/interviews/ziba.scott/"&gt;Uses This&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-28&lt;/a&gt;: &lt;a href="https://rakhim.org/2019/11/coding-vs-dot-programming-vs-dot-software-engineering/"&gt;Coding vs. Programming vs. Software Engineering&lt;/a&gt;.&lt;br&gt;Oh my. I thought I was just &lt;em&gt;coding&lt;/em&gt; to solve problems in a minimum amount of time.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-28&lt;/a&gt;: &lt;a href="https://beepb00p.xyz/annotating.html"&gt;How to annotate literally everything&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-28&lt;/a&gt;: &lt;a href="http://www.defmacro.org/2019/11/26/radical-markets.html"&gt;Radical markets&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-28&lt;/a&gt;: &lt;a href="https://waitbutwhy.com/2014/05/life-weeks.html"&gt;Your Life in Weeks&lt;/a&gt;. (via &lt;a href="http://www.defmacro.org/2019/11/26/radical-quantification.html"&gt;defmacro&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-29&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/how-big-how-blue-how-beautiful-deluxe/964546448" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Florence + the Machine, &lt;em&gt;How Big, How Blue, How Beautiful&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-29&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The first puzzles will unlock on December 1st at midnight Eastern Time. See you then! &amp;mdash; &lt;a href="https://adventofcode.com"&gt;https://adventofcode.com&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-11-29&lt;/a&gt;: &lt;a href="https://www.garykessler.net/library/crypto.html"&gt;An Overview of Cryptography&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-11-29&lt;/a&gt;: &lt;a href="https://explained.ai/matrix-calculus/index.html"&gt;The Matrix Calculus You Need For Deep Learning&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;</description></item><item><title>On computing Pi</title><link>https://aliquote.org/post/computing-pi/</link><pubDate>Sun, 10 Nov 2019 09:48:11 +0100</pubDate><guid>https://aliquote.org/post/computing-pi/</guid><description>&lt;p&gt;I am re-reading Melzak&amp;rsquo;s &lt;em&gt;Companion to Concrete Mathematics&lt;/em&gt;, and there&amp;rsquo;s a section dedicated to $\pi$ (pp. 164–169). There are various formulas to approximate $\pi$ to a given precision, the first being probably the fraction 22/7, from Archimedes. This is only correct to three decimal places, so a better fractional approximation is 355/113 = 3.1415929, which is easy to memorize and probably the one we are first taught in (French) college (in addition to the mnemonic trick &amp;mdash; &amp;ldquo;que j&amp;rsquo;aime a faire apprendre ce nombre utile aux sages&amp;rdquo;).&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re familiar with the &lt;code&gt;bc&lt;/code&gt; program, you will recall that it relies on the arc tangent. This follows from Leibniz&amp;rsquo;s approximation, which starts with $\arctan x = x - x^3/3 + x^5/5 + \dots$, which yields $\pi/4 = 1 - 1/3 + 1/5 + \dots$ for $x = 1$. From this, there exists a variety of arctan-type formulas for $\pi$, e.g. $\pi/4 = \arctan\tfrac{1}{2} + \arctan\tfrac{1}{3}$ or $\pi/4 = 5\arctan\tfrac{1}{7} + 2\arctan\tfrac{3}{79}$.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s try it in a Fish shell:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; echo &amp;#34;scale=11; 4*a(1)&amp;#34; | bc -l
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;3.14159265356
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Of note, the &lt;code&gt;scale&lt;/code&gt; parameter is quite important when a &lt;a href="https://www.johndcook.com/blog/2019/10/29/computing-pi-with-bc/"&gt;high precision&lt;/a&gt; is required.&lt;/p&gt;
&lt;p&gt;Another well-known formula, at least for $\LaTeX$ aficionado, is the following continued fraction, due to Brouncker:&lt;/p&gt;
&lt;p&gt;$$ \frac{4}{\pi} = 1 + \frac{1^2}{2 + \frac{3^2}{2 + \frac{5^2}{2 + \dots}}} $$&lt;/p&gt;
&lt;p&gt;Of course, many &lt;a href="http://mathworld.wolfram.com/PiFormulas.html"&gt;more&lt;/a&gt; &lt;a href="http://mathworld.wolfram.com/PiApproximations.html"&gt;approximations&lt;/a&gt; are available. Although Melzak notes that no hyperexponentially fast procedure&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; appears to be known for computing $\pi$, there does exist &lt;a href="https://www.johndcook.com/blog/2011/03/14/algorithm-record-pi-calculation/"&gt;efficient algorithms&lt;/a&gt; to compute $\pi$ to &lt;em&gt;n&lt;/em&gt; exact figures. A short snippet of Python code is available in the case of the &lt;a href="https://en.wikipedia.org/wiki/Chudnovsky_algorithm"&gt;Chudnovsky algorithm&lt;/a&gt;, which remains the most efficient algorithm at the time of this writing. Scheme code is available on &lt;a href="https://programmingpraxis.com/2013/06/14/the-digits-of-pi-again/"&gt;Programming Praxis&lt;/a&gt;. Other iterative algorithms, like &lt;a href="https://en.wikipedia.org/wiki/Borwein%27s_algorithm"&gt;Borwein&amp;rsquo;s algorithm&lt;/a&gt;, are also simple to implement in languages that offer support for large integers.&lt;/p&gt;
&lt;p&gt;Note that this is only if you are interested in computing $\pi$ to a large number of decimal places since most PLs will provide you with built-in constants for $\pi$ or $\pi/2$. E.g., in C (using &lt;code&gt;clang&lt;/code&gt; on macOS) $\pi$ is stored as a constant in &lt;code&gt;math.h&lt;/code&gt;: &lt;code&gt;#define M_PI 3.14159265358979323846264338327950288&lt;/code&gt;. This file is actually located under the command-line tools directory, that can be located using, e.g., &lt;code&gt;echo &amp;quot;#include &amp;lt;math.h&amp;gt;&amp;quot; | gcc -v -x c -&lt;/code&gt;. Racket provides a double-precision flonum for $\pi$, but fractional approximations are used in various place the &lt;a href="https://github.com/racket/math/"&gt;math&lt;/a&gt; library (e.g., 14488038916154245685/4611686018427387904 = 3.141592653589793).&lt;/p&gt;
&lt;p&gt;Melzak provides two additional formulas to compute $\pi$ and $e^{-\pi}$, based on the theory of elliptic functions which is far beyond the scope of this short post. Those formulas are:&lt;/p&gt;
&lt;p&gt;$$
\begin{align}
e^{-\pi} &amp;amp;= b + 2b^5 + 15b^9 +150b^{13} + 1707b^{17} + \dots \newline
\pi &amp;amp;= \log\frac{1}{b} - 2b^4 - 13b^8 - \frac{368}{3}b^{12} - \frac{2701}{2}b^{16} + \dots,
\end{align}
$$&lt;/p&gt;
&lt;p&gt;with $b = \tfrac{1}{2}\frac{\sqrt[\leftroot{-1}\uproot{2}\scriptstyle 4]{2}-1}{\sqrt[\leftroot{-1}\uproot{2}\scriptstyle 4]{2}+1} = 0.0432136168629448960219378\dots$ It should be noted that the very first term, $\log\tfrac{1}{b}$, already gives $\pi$ correctly to five decimal places. Using Mathematica, I got the following result:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;In[1]:= b = 1/2*(Power[2, (4)^-1] - 1)/(Power[2, (4)^-1] + 1)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;In[2]:= N[b, 24]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Out[2]= 0.0432136168629448960219378
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;In[3]:= N[Log[1/b], 24]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Out[3]= 3.14159962823802109942254
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;In[4]:= N[Pi, 24]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Out[4]= 3.14159265358979323846264
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As a side note, Mathematica also allows us to compute any terms of the continued fraction of $\pi$:&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;In[35]:= ContinuedFraction[Pi, 20]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Out[35]= {3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, 1, 14, 2, 1, 1, 2, 2, 2, 2}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;In[36]:= FromContinuedFraction[%]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Out[36]= 14885392687/4738167652
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Such formulas rely on the following identity, attributed to Dogson: if $qr = 1+p^2$, then $\arctan\tfrac{1}{p} = \arctan\tfrac{1}{p+q} + \arctan\tfrac{1}{p+r}$. This identity was also proposed by Euler, who further demonstrated that $\arctan\tfrac{m}{n} = \frac{mn}{m^2+n^2}\left[ 1 + \frac{2}{3}\frac{m^2}{m^2+n^2} + \frac{2\cdot 4}{3\cdot 5}\left(\frac{m^2}{m^2+n^2}\right)^2 + \dots \right]$.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;A numerical procedure is said to be exponentially fast if for large $n$, $E^n\sim c^n$ for some $c$, $0 &amp;lt; c &amp;lt; 1$. An &lt;em&gt;hyperexponentially fast procedure&lt;/em&gt; is one for which $E_n\sim c^{n^{\alpha}}$ for some $c$, $0 &amp;lt; c &amp;lt; 1$ and $\alpha &amp;gt; 1$.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:3"&gt;
&lt;p&gt;To compute the continued fraction of a number $x$, use the recurrence $a_0 = x$ and $a_n = (a_{n-1} - \lfloor a_{n_1} \rfloor)^{-1}$; the $n$th term will be $\lfloor a_n \rfloor$. Consider the precision of 20 digits illustrated above, we have: $n=0$, $a_n = 3.1415926535897932385$ and $d_n = 3$; $n=1$, $a_n = 0.1415926535897932385^{-1}=7.06251330593104577$ and $d_n = 7$; $n=2$, $a_n = 06251330593104577^{-1} = 15.9966$ and $d_n=15$; etc.&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>RSS is trending</title><link>https://aliquote.org/post/the-new-rss-web/</link><pubDate>Sat, 09 Nov 2019 09:21:41 +0100</pubDate><guid>https://aliquote.org/post/the-new-rss-web/</guid><description>&lt;blockquote&gt;
&lt;p&gt;Twitter is not fun anymore. Politics all the time, surveillance capitalism fanboys and memes. And: nobody is reacting to my tweets, because Twitter doesn’t like tweets with links, because then people would leave the Twitter app or site… &amp;mdash; &lt;a href="https://jlelse.blog/thoughts/2019/11/delete-twitter/"&gt;Jan-Lukas Else&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Same for me. I managed to create some lists with selected persons I&amp;rsquo;ve been following for a long time, but I must admit I&amp;rsquo;ve done my time on Twitter. I no longer find any interest in 80% of what I read, so it has become a singular waste of time.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;You choose the web you want.&lt;/em&gt; But you have to do the work.&lt;/p&gt;
&lt;p&gt;A lot of people &lt;em&gt;are&lt;/em&gt; doing the work. You could keep telling them, discouragingly, that what they’re doing is dead. Or you could join in the fun. &amp;mdash; &lt;a href="https://inessential.com/2019/10/29/you_choose"&gt;Brent Simmons&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Some good insights from a twenty-year blogger. The list of RSS feeds that I keep reading on my laptop or my phone is constantly growing and paradoxically I feel much more pleasure spending time here than I ever felt on Twitter. That&amp;rsquo;s because there&amp;rsquo;s no such constraints on a blog (think of number of characters that are allowed, or simply post formatting), and above all people really have something interesting to share, something that led them to plan some time writing it down.&lt;/p&gt;
&lt;p&gt;Micro-blogging is also a great alternative to Twitter or Facebook. Now, you decide where to (micro-)blog. I for one decided to host everything on this website: static blog are way better than Wordpress and the like, if you care about updating the structure of your site at some point, mass retagging, efficiently searching for old posts using powerful command-line tools; a micro-blog is nothing but a standard blog where you limit yourself to short posts and adopt sort of a temporal flow to display the micro-posts.&lt;/p&gt;
&lt;p&gt;Overall, I am quite happy that RSS is trending again.&lt;/p&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Timber Timbre • &lt;em&gt;Hot Dreams&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>De Bruijn graph and genome assembly</title><link>https://aliquote.org/post/de-bruijn-graph/</link><pubDate>Fri, 08 Nov 2019 09:56:56 +0100</pubDate><guid>https://aliquote.org/post/de-bruijn-graph/</guid><description>&lt;p&gt;De Bruijn graph are common data structures in bioinformatics, especially when it comes to perform genome assembly. John D. Cook discussed application of De Buijn sequences in two of his &lt;a href="https://www.johndcook.com/blog/2019/11/05/combination-locks/"&gt;latest&lt;/a&gt; &lt;a href="https://www.johndcook.com/blog/2019/10/22/hacking-with-de-bruijn/"&gt;posts&lt;/a&gt;. Briefly, a De Bruijn sequence represents the shortest sequence of symbols from an alphabet of size &lt;em&gt;k&lt;/em&gt; that contains every possible subsequence of length &lt;em&gt;n&lt;/em&gt;. Things get confusing if we think of &lt;em&gt;k&lt;/em&gt;-mer, since in this case &lt;em&gt;k&lt;/em&gt; refers to the length of the substring, and not the 4-character alphabet for DNA or the total length of the DNA sequence. Anyway, assuming &lt;em&gt;k&lt;/em&gt; = 4 and &lt;em&gt;n&lt;/em&gt; = 3, John Cook shows that &lt;code&gt;AAACAAGAATACCACGACTAGCAGGAGTATCATGATTCCCGCCTCGGCGTCTGCTTGGGTGTTT&lt;/code&gt; is a De Bruijn sequence for all 4&lt;sup&gt;3&lt;/sup&gt; triples of DNA base pairs, provided you allow wrapping around (e.g., TAA would start in position 64).&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.cs.jhu.edu/~langmea/resources/lecture_notes/assembly_dbg.pdf"&gt;De Bruijn Graph assembly&lt;/a&gt; (PDF), by Ben Langmead, provides a very detailed account of how De Bruijn graphs work in practice in the case of genome assembly. Assuming perfect sequencing where each length-&lt;em&gt;k&lt;/em&gt; substring is sequenced exactly once with no errors, let&amp;rsquo;s pick a substring length, say &lt;em&gt;k&lt;/em&gt; = 30 to 50 (i.e., ≤ shortest read length), take each &lt;em&gt;k&lt;/em&gt;-mer and split them into left and right &lt;em&gt;k&lt;/em&gt;-1 mers. Then, add those &lt;em&gt;k&lt;/em&gt;-1 mers as nodes to De Bruijn graph (if not already there), with edge from left &lt;em&gt;k&lt;/em&gt;-1 mer to right &lt;em&gt;k&lt;/em&gt;-1 mer.&lt;/p&gt;
&lt;p&gt;Here is a short Python snippet to construct a De Bruijn graph, directly inspired from one of &lt;a href="http://rosalind.info/problems/dbru/"&gt;Rosalind problems&lt;/a&gt;, assuming &lt;code&gt;seq&lt;/code&gt; is a list of reads:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;dbg&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;seq&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;&amp;#34;&amp;#34;De Bruijn graph&amp;#34;&amp;#34;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;seq&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[:&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;set&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;set&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As you can see, the idea is simply to store the graph as a &lt;code&gt;dict&lt;/code&gt;, which is a pretty standard way to represent a graph in Python, and to use &lt;code&gt;set&lt;/code&gt;s to extract left (all but the last) and right (all but the first) &lt;em&gt;k&lt;/em&gt; mer. In Scheme, we would write &lt;code&gt;(cdr s)&lt;/code&gt; and &lt;code&gt;(cdr (reverse s))&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Consider the following example data, and recall that we need both the original reads (&lt;em&gt;S&lt;/em&gt;) and their reverse complements, since we are interested in the De Bruijn graph of &lt;em&gt;S&lt;/em&gt; ⋃ &lt;em&gt;S&lt;sup&gt;r&lt;/sup&gt;&lt;/em&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;rev_c&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;&amp;#34;&amp;#34;Reverse complement&amp;#34;&amp;#34;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;sub&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;maketrans&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;ATGC&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;TACG&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[::&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;translate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sub&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;reads&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;TGAT&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;CATG&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;TCAT&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;ATGC&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;CATC&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;CATC&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;grph&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;dbg&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;reads&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rev_c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;reads&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Let&amp;rsquo;s see it in action:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;In&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;49&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s2"&gt; =&amp;gt; &lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34; &amp;#34;&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;grph&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;TGA&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;GAT&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;GAT&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;ATG&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;CAT&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;ATC&lt;/span&gt; &lt;span class="n"&gt;ATG&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ATG&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;TGA&lt;/span&gt; &lt;span class="n"&gt;TGC&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;TCA&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;CAT&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ATC&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;TCA&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;GCA&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;CAT&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In the case of genome assembly, if sequencing was performed without any error this procedure yields an &lt;a href="https://en.wikipedia.org/wiki/Eulerian_path"&gt;Eulerian graph&lt;/a&gt;, and an Eulerian walk can be found in $O(|E|)$ time, where $|E|$ is the number of edges (which equals the number of &lt;em&gt;k&lt;/em&gt;-mers). The number of nodes is at most $2 \cdot |E|$, but it will typically be much smaller due to repeated &lt;em&gt;k&lt;/em&gt;-1-mers. However, there can be more than one Eulerian walk, and uneven coverage, sequencing errors, or even sequence repeats may lead to disconnected graphs, which implies that only connected components will be Eulerian, not the overall graph.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; Ben Langmead has some additional benchmark data, especially regarding how the size of the De Bruijn graph grows sublinearly when average coverage is high (i.e., genome length ≪ total number of reads).&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Kingsford, Carl, Michael C. Schatz, and Mihai Pop. &amp;ldquo;Assembly complexity of prokaryotic genomes using short reads.&amp;rdquo; &lt;em&gt;BMC bioinformatics&lt;/em&gt; 11.1 (2010): 21.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Typora</title><link>https://aliquote.org/post/typora/</link><pubDate>Thu, 07 Nov 2019 14:56:45 +0100</pubDate><guid>https://aliquote.org/post/typora/</guid><description>&lt;p&gt;It&amp;rsquo;s been a long time since I have tested new applications for basic Markdown editing. Last time was probably Texts, one or two years ago, and more recently &lt;a href="https://caret.io"&gt;Caret Beta&lt;/a&gt;, which I &lt;a href="https://aliquote.org/micro/2019-11-06-11-31-34/"&gt;didn&amp;rsquo;t like&lt;/a&gt; at all. Likewise, I am not a big fan of &lt;a href="https://ia.net/writer"&gt;iA Writer&lt;/a&gt;, despite all the good things I&amp;rsquo;ve heard over time, nor of &lt;a href="https://bywordapp.com"&gt;Byword&lt;/a&gt;. I really love the design and UI of &lt;a href="https://bear.app"&gt;Bear&lt;/a&gt;, but I&amp;rsquo;m not looking for a complete note taking application, just a slick Markdown editor.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s take a closer look at &lt;a href="https://typora.io"&gt;Typora&lt;/a&gt; instead.&lt;/p&gt;
&lt;p&gt;I think I first heard of this app on one of Jack Baty&amp;rsquo;s weblogs, but to be honest I just see a list of &lt;a href="https://www.bettertechtips.com/mac/markdown-editor-mac/"&gt;several Markdown Apps&lt;/a&gt; a few days ago and tried the only one I didn&amp;rsquo;t know for sure. I should note that my needs are very limited: I just need to be able to write plain text in a minimalist application, for the rare case where I am not writing in Emacs &amp;mdash; this happens very rarely, for Emacs has a very nice &lt;a href="https://jblevins.org/projects/markdown-mode/"&gt;Markdown mode&lt;/a&gt;, which far surpasses all the features I have encountered in various applications over time.&lt;/p&gt;
&lt;p&gt;My first impression was that the UI is very clean, minimalist, and so much well thought: you get all the space for writing, with no status or menu bar, or even side bar full of icons for sharing, exporting, and the like. Take a look by yourselves:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-11-07-15-10-04.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Other features I found very handy in Typora:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Typora does not require an external previewer, since you get a live preview as you type. It&amp;rsquo;s sort of a WYSIWYG, but way better than well-known commercial products.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The conceal mode is really great, and far better that what I used to have when writing in Vim. Any hyperlinks remains editable as a plain Markdown link when your cursor is on it, but there&amp;rsquo;s also a shortcut to insert inline links (&lt;kbd&gt;⌘K&lt;/kbd&gt;) or named links (&lt;kbd&gt;⌥⌘L&lt;/kbd&gt;). Moreover, you can select any word and enclose it using square bracket, parenthesis or whatever, and, of course, HTML tags are completed as soon as you start typing the closing tag &lt;code&gt;&amp;lt;/&lt;/code&gt;. The inline code is really pleasantly displayed as well.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Although this is a distraction free UI, it does not mean you haven&amp;rsquo;t access to extra functionalities. Outside the forty or so commands available in the menu bar, there&amp;rsquo;s a small area that you can fly over in the top right corner of the application that gives you access to basic statistics (number of words or characters, estimated reading time), a table of contents and a project sidebar. The later provides a list or tree view of all the files in the current working directory, and again if your mouse hover the bottom of the sidebar, you get an additional actions menu.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://aliquote.org/img/2019-11-07-15-32-46.png" alt=""&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;What used to be annoying in a plain text editor (TextEdit in my case) or even Emacs is when you are in a middle of a list of items and you want to insert an image or a short quote: you&amp;rsquo;ll have to add extra whitespace to get them at the right level of indentation. There is no need for that in Typora since it will keep the right level of indentation after a carriage return provided you delete the newly created bullet point.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Note that images are displayed as is (i.e., sort of a conceal mode, but for images) if they can be found by Typora. Broken images &amp;mdash; or is my case, images with relative links that cannot be resolved before the site is published &amp;mdash; remain displayed using Markdown syntax.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Overall, this is the best application for Markdown editing I have been using so far. This is just a beta version, and while in beta it&amp;rsquo;s free, so go take a look if feel so inclined.&lt;/p&gt;</description></item><item><title>Micro review from November</title><link>https://aliquote.org/post/micro-review-005/</link><pubDate>Mon, 04 Nov 2019 15:52:37 +0100</pubDate><guid>https://aliquote.org/post/micro-review-005/</guid><description>&lt;p&gt;I have tried to put some order into all the links I gathered over the last weeks (including about ten days on vacation with near to zero activity alongside).&lt;/p&gt;
&lt;p&gt;I came across &lt;a href="https://mml-book.github.io"&gt;Mathematics for Machine Learning&lt;/a&gt; again. I already has an older version in my library of PDFs, but now I just downloaded the latest version available for free, and I decided to take a closer look over the next few weeks. Another interesting book is &lt;a href="https://www.math.uci.edu/~rvershyn/papers/HDP-book/HDP-book.html"&gt;High-Dimensional Probability: An Introduction with Applications in Data Science&lt;/a&gt;, but I&amp;rsquo;m afraid I might be a little short on the time I can devote to all these readings.&lt;/p&gt;
&lt;p&gt;While I note that many soft &lt;a href="https://www.wezm.net/technical/2019/10/useful-command-line-tools/"&gt;utilities for the command line&lt;/a&gt; are written in rust, Go is definitely a serious candidate for web programming, as demonstrated by Hugo or Syncthing, for instance. Lately, I heard about &lt;a href="https://goaccess.io"&gt;GoAccess&lt;/a&gt; for site analytics and it looks really great, even if I already have a small utility (Matomo) to monitor the activity on this site that is good enough for my purpose (I just check the overall traffic once in a while to verify that everything works as expected, i.e. my website is not broken).&lt;/p&gt;
&lt;p&gt;How many one-liners cheat sheets are there on Github? Here are two that I find very handy for bioinformatics tasks: &lt;a href="https://github.com/stephenturner/oneliners"&gt;Bioinformatics one-liners&lt;/a&gt;, by Stephen Turner, and &lt;a href="https://github.com/crazyhottommy/bioinformatics-one-liners"&gt;another one&lt;/a&gt;, by Ming Tang.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.evolvedmicrobe.com/Literature/GeometricTDistribution.pdf"&gt;A new angle on the t-test&lt;/a&gt; (Wood and Saville, The Statistician, 2002) is a nice paper that I came across, thanks to Giuseppe on &lt;a href="https://twitter.com/gappy3000"&gt;Twitter&lt;/a&gt;. It illustrates a geometric approach to computing the t statistic (in this case, $t = \sqrt{2}\text{cot}(\theta)$, where $\theta$ denotes the angle between the data vector and a unit vector, and is used to quantify the degree of extremality of the data under the null) and its associated p-value (in this case, the probability under the null that a data vector of a fixed length lies in the double cone) using a paired t-test for 3 samples. This is a short paper, but it provides a very interesting take on the classical t-test.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-11-04-16-30-23.png"&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;a href="https://philipwalton.com/articles/cascading-cache-invalidation/"&gt;Cascading cache invalidation&lt;/a&gt;, by Philip Walton, deals with caching and, specifically, how to get the benefits of immutable assets and long term caching without cascading cache invalidations. I&amp;rsquo;m not involved in that sort of business, and I know it is an hard one, but if you&amp;rsquo;re interested in caching best practice, this article is probably the most recent one that I&amp;rsquo;ve heard about.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://floating-point-gui.de"&gt;What Every Programmer Should Know About Floating-Point Arithmetic&lt;/a&gt; is probably the best way to start with FP arithmetic, if you do not want to dig into the larger PDF version by David Goldberg (HTMLized &lt;a href="https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html"&gt;here&lt;/a&gt;). Regarding error propagation, the take away message is probably that multiplication and division are &amp;ldquo;safe&amp;rdquo; operations, while addition and subtraction are dangerous, because when numbers of different magnitudes are involved, digits of the smaller-magnitude number are lost. You&amp;rsquo;ll probably learn more by following John D Cook &lt;a href="https://www.johndcook.com/blog/2009/04/06/numbers-are-a-leaky-abstraction/"&gt;blog posts&lt;/a&gt;, though.&lt;/p&gt;
&lt;p&gt;During the last months, I have played with the &lt;a href="http://rosalind.info/problems/locations/"&gt;Rosalind&lt;/a&gt; project, both to practice a bit of Python and to better understand some specific aspects of bioinformatics. Now I learned that Philip Compeau has a nice (free) course on &lt;a href="https://stepik.org/course/2/promo"&gt;bioinformatics algorithms&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;There has been some alarming movement on Stack Overflow: moderators resigning, policy updates and a vibrant series of exchange on various meta sites. I am no longer active on any SE sites, but I keep reading some threads on SO meta and several posts on Cross Validated. Here is one of the latest blog posts I have been reading lately: &lt;a href="https://dev.to/codemouse92/has-stackoverflow-become-an-antipattern-3icb"&gt;Has StackOverflow Become An Antipattern?&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The gamification of StackOverflow is out of control. Votes are no longer related to accuracy and usefulness. Reputation has become the object in-and-of-itself! And when it comes to rep, the rich get richer, the poor get poorer, and it becomes quickly apparent to newcomers that StackOverflow is a losing game for them.&lt;/p&gt;
&lt;/blockquote&gt;</description></item><item><title>Micro posting in October</title><link>https://aliquote.org/post/micro-10-2019/</link><pubDate>Wed, 30 Oct 2019 09:58:15 +0100</pubDate><guid>https://aliquote.org/post/micro-10-2019/</guid><description>&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-10-01&lt;/a&gt;: Well, we need to balance the tutorials, so let&amp;rsquo;s dive into &lt;a href="https://tech.tonyballantyne.com/emacs-workout/just-enough-emacs-lisp/"&gt;Just Enough Emacs Lisp&lt;/a&gt; now. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-01&lt;/a&gt;: &lt;a href="https://danielmiessler.com/study/vim/"&gt;Learn vim For the Last Time: A Tutorial and Primer&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-02&lt;/a&gt;: &amp;gt; Il écrit de la main droite. Dans le toorent, il a laissé pendre la gauche, massée et alanguie d&amp;rsquo;eau froide. Il est vigilant comme un pêcheur qui surveille son bouchon. Il veut tenter de rendre, de la pointe de la plume, les baisers de l&amp;rsquo;eau renouvelée qui lave elle-même son baiser. &amp;mdash; Régine Detambel, Petit éloge de la peau&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-02&lt;/a&gt;: I believe this the canonical way to filter in a Pandas data frame, say &lt;code&gt;d&lt;/code&gt;, rows that contain or better, match exactly, the word &amp;ldquo;gene&amp;rdquo;:&lt;code&gt;pythond[d[&amp;quot;type&amp;quot;].str.match(&amp;quot;gene&amp;quot;, na=False)]&lt;/code&gt;&lt;small&gt;(The &lt;code&gt;na=False&lt;/code&gt; option is just because there are some NaN values.)&lt;/small&gt;Now I understand why I prefer functional languages, and more specifically why I prefer to write and chain together simple functions in Python rather than implementing complex class with shadowed methods, setters and getters. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-02&lt;/a&gt;: I&amp;rsquo;m using &lt;code&gt;ox-pandoc&lt;/code&gt; as my main engine to export Org documents to HTML or PDF. This is mostly because I know Pandoc better than the basic (Lua)Latex + Minted/&lt;code&gt;lstlistings&lt;/code&gt; that I haven&amp;rsquo;t used in years. Funny enough, the &lt;code&gt;#+ATTR_LATEX&lt;/code&gt; is not recognized by Pandoc, but part of &lt;code&gt;#+ATTR_HTML&lt;/code&gt; settings (e.g., &lt;code&gt;:width 75%&lt;/code&gt; to resize image) are honored during the export. However, neither of the HTML or PDF output include the &lt;code&gt;#+CAPTION:&lt;/code&gt; legend! &lt;code&gt;#emacs&lt;/code&gt; &lt;code&gt;#org&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-03&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/goddess-deluxe-version/865230794" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Banks, &lt;em&gt;Goddess&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-03&lt;/a&gt;: Oh I guess &lt;a href="https://github.com/jimhester/lintr/issues/410"&gt;my remark&lt;/a&gt; became totally useless since &lt;code&gt;lintr&lt;/code&gt; 2.0.0 came out on CRAN recently. I should note that old options are still valid, though, so I can keep the following in my &lt;code&gt;init.el&lt;/code&gt; file:&lt;code&gt;emacs-lisp(flycheck-lintr-linters&amp;quot;with_defaults(assignment_linter=NULL, camel_case_linter=NULL, commented_code_linter=NULL,absolute_paths_linter=NULL, line_length_linter(120))&amp;quot;)&lt;/code&gt;Not that I am a big fan of camel case, but Bioconductor folks are apparently. &lt;code&gt;#rstats&lt;/code&gt; &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-03&lt;/a&gt;: &lt;a href="https://weinholt.se/articles/new-r6rs-compiler/"&gt;A New R6RS Scheme Compiler&lt;/a&gt;. &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-03&lt;/a&gt;: &lt;a href="https://akkuscm.org"&gt;Akku.scm&lt;/a&gt;: Package management made easy. &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-03&lt;/a&gt;: &lt;a href="https://streamlit.io"&gt;Streamlit&lt;/a&gt;: The fastest way to build custom ML tools. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-03&lt;/a&gt;: &lt;a href="https://doisinkidney.com/posts/2019-10-02-what-is-good-about-haskell.html"&gt;What is Good About Haskell?&lt;/a&gt; &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-04&lt;/a&gt;: &lt;a href="https://music.apple.com/us/album/tales-of-us/828261957" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Goldfrapp, &lt;em&gt;Tales of us&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-04&lt;/a&gt;: &amp;gt; Your subconscious holds onto things it thinks you might be forgetting, and regularly interrupts you about them. (&amp;hellip;) Never let tasks or ideas sit in your mind without being captured. &amp;mdash; Daniel Miessler, &lt;a href="https://danielmiessler.com/blog/the-most-important-productivity-lesson-i-ever-learned/"&gt;The Most Important Productivity Lesson I Ever Learned&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-04&lt;/a&gt;: A bit of Clojure in Python thanks to the &lt;a href="https://docs.python.org/2/library/itertools.html"&gt;itertools&lt;/a&gt; (&lt;code&gt;islice&lt;/code&gt;) module:&lt;code&gt;pythondef take(n, iterable):&amp;quot;Return first n items of the iterable as a list&amp;quot;return list(islice(iterable, n))def nth(iterable, n, default=None):&amp;quot;Returns the nth item or a default value&amp;quot;return next(islice(iterable, n, None), default)&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-04&lt;/a&gt;: TIL (or better, releearned) about &lt;a href="https://mpv.io"&gt;mpv&lt;/a&gt;, a free, open source, and cross-platform media player.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-04&lt;/a&gt;: &lt;a href="https://cran.r-project.org/web/packages/codingMatrices/vignettes/codingMatrices.pdf"&gt;Coding Matrices, Contrast Matrices and Linear Models&lt;/a&gt; (PDF). &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-04&lt;/a&gt;: &lt;a href="https://www.darkpatterns.org"&gt;How do dark patterns work?&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-04&lt;/a&gt;: &lt;a href="https://start-concurrent.github.io/full/index.html"&gt;Start Concurrent: A Gentle Introduction to Concurrent Programming&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-07&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/after-bach/1338962658" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Brad Mehldau, &lt;em&gt;After Bach&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-07&lt;/a&gt;: I believe this is what happened when you forget to add Matomo tracking code in your new partial templates.&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-10-07-15-00-23.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-07&lt;/a&gt;: I can&amp;rsquo;t believe I have that many Homebrew packages on my HD. It&amp;rsquo;s probably time to do some cleanup in my &lt;code&gt;/usr/local&lt;/code&gt;.&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-10-07-11-46-59.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-07&lt;/a&gt;: I love when brilliant persons can also ask &lt;a href="https://unix.stackexchange.com/q/545244"&gt;thoughful question&lt;/a&gt; on Stack Exchange.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-07&lt;/a&gt;: If you like reading about others&amp;rsquo; setup, &lt;em&gt;Uses This&lt;/em&gt; has a nice interview with &lt;a href="https://usesthis.com/interviews/chris.wellons/"&gt;Chris Wellons&lt;/a&gt;. Apparently, there&amp;rsquo;s also a &lt;a href="https://irreal.org/blog/?p=8354"&gt;quick review&lt;/a&gt; on Irreal. And so I learned that he now mostly uses &lt;a href="https://github.com/skeeto/dotfiles"&gt;Vim&lt;/a&gt; and he also has a &lt;a href="https://github.com/skeeto/live-dev-env"&gt;live CD&lt;/a&gt; in case he find himself away from his home computer.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-07&lt;/a&gt;: Kind of magic.&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-09-16-11-54-25.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-07&lt;/a&gt;: Ouch, it hurts! &lt;a href="https://dearstackexchange.com"&gt;Dear Stack Exchange, Inc.&lt;/a&gt;&amp;gt; We’d like to make sure it’s clear that none of us support interacting with people with anything short of complete respect. As moderators, we are responsible for upholding, promoting, and respecting the high standards that Stack Exchange has set over the years, and we stand behind Stack Exchange in its move to ensure everyone feels welcome and safe.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-07&lt;/a&gt;: &lt;a href="https://introtcs.org/public/index.html"&gt;Introduction to Theoretical Computer Science&lt;/a&gt;, by Boaz Barak.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-07&lt;/a&gt;: &lt;a href="http://hongchao.me/living-and-working-in-sweden-as-engineers/"&gt;Worth Moving to Sweden as Engineers?&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-08&lt;/a&gt;: &amp;gt; The reality is half of data science is just cleaning data, and the other half is complaining about how much of data science is just cleaning data. You can add another half&amp;rsquo;s worth of time for debugging your neural net, if you were coaxed into using one that isn&amp;rsquo;t off-the-shelf. &amp;mdash; &lt;a href="http://dwrodri.blog/posts/oct-7-Rscript-snippets.html"&gt;R is a joy if you treat it like awk&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-08&lt;/a&gt;: Another great app by Jens Axel Søgaard: &lt;a href="https://racket-stories.com"&gt;Racket Stories&lt;/a&gt;. &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-08&lt;/a&gt;: I finally got my Bitbucket account back. Just so I could delete the dozens of repositories I maintained over the years there. This is a very bad user experience since I cannot delete my account and don&amp;rsquo;t have any clue, even after reading the docs and the commnunity wiki. I guess I now have to contact the support center.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-08&lt;/a&gt;: I started watching &lt;a href="https://en.wikipedia.org/wiki/Euphoria_(American_TV_series)"&gt;Euphoria&lt;/a&gt; yesterday evening. It&amp;rsquo;s been a long since I haven&amp;rsquo;t watched a TV show alone. And the pilot was quite good actually.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-08&lt;/a&gt;: MacOS Catalina is out, apparently. What&amp;rsquo;s up now? Should I stay or should I come and see what they made to iTunes? And wasn&amp;rsquo;t Twitter removed together with all other social media stuff, or?&amp;gt; The Twitter for Mac app takes full advantage of the native Mac features like multiple windows, drag and drop, keyboard shortcuts, and more.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-08&lt;/a&gt;: Starting early so I&amp;rsquo;ll be sure I can listen to all of this while learning about computational biology.&lt;a href="https://aliquote.org/img/2019-10-08-10-50-01.png"&gt;&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-10-08-10-50-01.png" alt=""&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-08&lt;/a&gt;: TIL about &lt;a href="https://github.com/vishesh/racketscript"&gt;RacketScript&lt;/a&gt;, an experimental lightweight Racket to JavaScript compiler. &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-08&lt;/a&gt;: TIL there&amp;rsquo;s something like the &lt;a href="http://socialmarketing.org/archives/generations-xy-z-and-the-others/"&gt;X, Y and Z&lt;/a&gt; generations.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-08&lt;/a&gt;: Well, I find it weird that Apple products are &lt;a href="https://lemire.me/blog/2019/10/07/the-price-of-a-macbook-air-worldwide/"&gt;more expensive in France&lt;/a&gt;. Conversely, I experienced a lot of trouble with taxes when buying Stata books from the US. Anyway, I no longer can afford any Apple product by myself, so I guess I&amp;rsquo;ll have to keep my finger crossed in hoping that my current Macbook will last a few more years. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-08&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/this-is-for-when-live-at-hammersmith-palais-9th-november/491401791"&gt;Let&amp;rsquo;s go&lt;/a&gt;!&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-10-08-12-29-52.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-14&lt;/a&gt;: After upgrading Ubuntu and R on the server at work, I&amp;rsquo;m now looking for an optimal Mac-&amp;gt;Linux iTerm+Tmux+ssh thing. I&amp;rsquo;m close. In the meantime, I found this: &lt;a href="https://blog.filippo.io/my-remote-shell-session-setup/"&gt;My remote shell session setup&lt;/a&gt;, but I believe &lt;code&gt;mosh&lt;/code&gt; is not the &lt;a href="https://gitlab.com/gnachman/iterm2/wikis/tmux-Integration-Best-Practices"&gt;recommended way&lt;/a&gt; anymore. And I know I definitely need to re-read &lt;a href="https://github.com/samoshkin/tmux-config"&gt;this&lt;/a&gt; again.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-14&lt;/a&gt;: &lt;a href="https://nibblestew.blogspot.com/2019/10/apple-of-2019-is-linux-of-2000.html"&gt;Apple of 2019 is the Linux of 2000&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-15&lt;/a&gt;: From &lt;a href="http://programmingpraxis.com/2019/10/15/prime-anagrams/"&gt;Programming Praxis&lt;/a&gt;: There are many algorithms for recognizing anagrams. Here is an unusual one:&amp;gt; Assign each character to a prime number, then map a string to the corresponding primes, and compute their product. Two strings are anagrams only if they share a product.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-15&lt;/a&gt;: Today on HN: &lt;a href="https://docs.python.org/3/whatsnew/3.8.html"&gt;What’s New In Python 3.8&lt;/a&gt; and &lt;a href="https://www.unixgame.io/unix50"&gt;The Unix game&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-16&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/post-scriptum/1443787314" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Wolfert Brederode Quartet, &lt;em&gt;Post Scriptum&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-16&lt;/a&gt;: &amp;gt; A functional language is a programming language made up of functions. &amp;mdash; Doug Hoyte, &lt;a href="https://letoverlambda.com/textmode.cl/guest/chap5.html#sec_1"&gt;Let Over Lambda&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-16&lt;/a&gt;: &amp;gt; Plain text can certainly have a reputation for looking lazy or cheap, but I feel this is mostly perpetuated in the design and marketing communities. I can assure you that your average day-to-day users are much less opinionated about your email campaign design than you are. Look to satisfy your customers’ needs before your own. &amp;mdash; &lt;a href="https://uglyduck.ca/plain-text-emails/"&gt;Plain Text Emails, Please&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-16&lt;/a&gt;: Browsing Apple &lt;a href="https://opensource.apple.com/source/text_cmds/text_cmds-68/"&gt;source code&lt;/a&gt; reminds me so much of plain old iWeb design. (I came revisiting this site after reading &lt;a href="https://chrispenner.ca/posts/wc"&gt;Beating Decades Of Optimized C With 80 Lines Of Haskell&lt;/a&gt;.) &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-16&lt;/a&gt;: From &lt;a href="https://danielmiessler.com/blog/job-losses-automation-active-passive/"&gt;Job Losses from Automation Are Being Actively Engineered and Funded&lt;/a&gt;, by Daniel Miessler:&amp;gt; Because humans are so static, and the types of things we need on a customer service call are so similar, the AI Customer Service Agent problem is similar to attacks against cryptography. Once you get a foothold, the attacks predictably get better, and they never get worse.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-16&lt;/a&gt;: Nicely done: Visualize the execution of different algorithms for solving the &lt;a href="https://tspvis.com"&gt;traveling salesman problem&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-16&lt;/a&gt;: One-to-one Tmux session reinvented: please &lt;a href="https://assist.app/"&gt;assist&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-16&lt;/a&gt;: What a beautiful &lt;a href="https://github.com/mauforonda/emacs"&gt;Emacs for writers&lt;/a&gt;! &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;&lt;img src="https://aliquote.org/img/emacs-mauforonda.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-16&lt;/a&gt;: &lt;a href="http://blog.thezerobit.com/2012/09/01/beautiful-quicksort-in-common-lisp.html"&gt;Beautiful Quicksort in Common Lisp&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt; &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-16&lt;/a&gt;: &lt;a href="https://scriptingosx.com/2019/06/moving-to-zsh/"&gt;Moving to zsh&lt;/a&gt;. I&amp;rsquo;ve been diving with Zsh long before it became the &lt;em&gt;de facto&lt;/em&gt; shell on macOS, and I just moved again, this time for &lt;a href="https://aliquote.org/post/fish-shell"&gt;Fish&lt;/a&gt;. However, there&amp;rsquo;s always something nice to learn from Scripting OS X, so I&amp;rsquo;ll keep this in my bookmarks, especially since I still use zsh occasionally (because of Emacs multi-term which doesn&amp;rsquo;t seem to like Fish very much). Thorsten Ball has a nice &lt;a href="https://github.com/mrnugget/dotfiles"&gt;init file&lt;/a&gt;, btw.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-17&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/the-botanic-verses/956032773" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   The March Violets, &lt;em&gt;The Botanic Verses&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-17&lt;/a&gt;: So it appears that ZghOT0eRm4U9s:p/q2-q4! is a &lt;a href="https://leahneukirchen.org/blog/archive/2019/10/ken-thompson-s-unix-password.html"&gt;chess move&lt;/a&gt; (and also the password of Ken Thompson from the good old Unix days). I&amp;rsquo;d be foolish to remember that kind of thing, but it&amp;rsquo;s definitely a strong password!&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-10-17-11-20-30.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-18&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/live-at-xx-merge/1342205795" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Lambchop, &lt;em&gt;Live At XX Merge&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-18&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/tindersticks/1368841915" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Tindersticks, &lt;em&gt;Tindersticks&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-18&lt;/a&gt;: &amp;gt; There is a secret that needs to be understood in order to write good software documentation: there isn’t one thing called documentation, there are four. &amp;mdash; &lt;a href="https://www.divio.com/blog/documentation/"&gt;What nobody tells you about documentation&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-18&lt;/a&gt;: I don&amp;rsquo;t remember the last time I used &lt;code&gt;fold&lt;/code&gt; in a Terminal &amp;mdash; this is not the &lt;code&gt;fold&lt;/code&gt; you may find in various functional PL, but one that can be very useful for &lt;a href="http://feedproxy.google.com/~r/TheEndeavour/~3/5yaQqOFC0Mc/"&gt;counting characters&lt;/a&gt; in a file.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-18&lt;/a&gt;: That&amp;rsquo;s how it looks after you trashed thousand of professional emails that are no longer relevant in your mailbox:&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-10-18-15-04-11.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-18&lt;/a&gt;: &lt;a href="https://liorpachter.wordpress.com/2019/10/09/is-python-really-faster-than-c/"&gt;Is Python really faster than C++?&lt;/a&gt; &lt;code&gt;#python&lt;/code&gt; &lt;code&gt;#bioinformatics&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-28&lt;/a&gt;: &amp;gt; Now Google wants to back out of its end of the deal. Since they are by far the dominant email provider, they apparently started thinking that they could squeeze a few more dollars out of those poor souls still using it. Of course, they’ll still be scanning your emails and collecting your data but now you’ll have to pay them to do it. &amp;mdash; &lt;a href="https://irreal.org/blog/?p=8405"&gt;When Gmail Isn’t Free&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-28&lt;/a&gt;: &amp;gt; The most compelling reason for most people to buy a computer for the home will be to link it into a nationwide communications network. &lt;a href="http://reprints.longform.org/playboy-interview-steve-jobs"&gt;Steve Jobs&lt;/a&gt;Or what we call now social networks.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-28&lt;/a&gt;: I&amp;rsquo;m not a big fan of serif everywhere on a webpage, but there are definitely interesting other features in this &lt;a href="https://jessekelly881-imagine.surge.sh"&gt;org-specific CSS design&lt;/a&gt;. &lt;code&gt;#org&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-28&lt;/a&gt;: &lt;a href="https://blog.floydhub.com/introduction-to-adversarial-machine-learning/"&gt;Introduction to Adversarial Machine Learning&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-28&lt;/a&gt;: &lt;a href="http://morrick.me/archives/8599"&gt;Mac OS Catalina: more trouble than it’s worth&lt;/a&gt;. &lt;code&gt;#apple&lt;/code&gt;&amp;gt; What I want from a new version of an operating system, especially one as mature as Mac OS, is that it fixes or improves what was not working well in previous versions, and that it leaves tried-and-true features and functionalities as untouched as technically possible. I don’t need and I don’t want disruption for disruption’s sake on a yearly basis. While I understand that today’s tech motto is The show must go on, that also doesn’t have to mean that the show should get painful to watch.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-28&lt;/a&gt;: &lt;a href="https://mml-book.github.io"&gt;Mathematics for Machine Learning&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-28&lt;/a&gt;: &lt;code&gt;10 PRINT CHR$(205.5+RND(1)); : GOTO 10&lt;/code&gt; &amp;mdash; &lt;a href="https://10print.org"&gt;https://10print.org&lt;/a&gt; (via HN)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-29&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/post-scriptum/1443787314" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Wolfert Brederode Quartet, &lt;em&gt;Post Scriptum&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-29&lt;/a&gt;: &amp;gt; We’re easier to please. Good is good enough. So only those who are the most upset, and know how to improve things, do the hard work necessary to make things great. The dissatisfied ones go make things better for all of us. &amp;mdash; &lt;a href="https://sivers.org/exan"&gt;Why experts are annoying&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-29&lt;/a&gt;: Nice utility to inspect a Git repo: &lt;a href="https://github.com/o2sh/onefetch"&gt;onefetch&lt;/a&gt;. This is built with Rust, but the building stage didn&amp;rsquo;t work for me, and there&amp;rsquo;s currently no binary release for Mac.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-29&lt;/a&gt;: &lt;a href="https://blog.robertelder.org/diff-algorithm/"&gt;Myers Diff Algorithm - Code &amp;amp; Interactive Visualization&lt;/a&gt;. See also &lt;a href="https://blog.robertelder.org/data-science-linux-command-line/"&gt;An Introduction To Data Science On The Linux Command Line&lt;/a&gt; by the same author.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-10-29&lt;/a&gt;: &lt;a href="https://lord.io/blog/2019/text-editing-hates-you-too/"&gt;Text Editing Hates You Too&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;</description></item><item><title>Virus and bacteria are growing fast</title><link>https://aliquote.org/post/virus-and-bacteria/</link><pubDate>Thu, 17 Oct 2019 10:13:06 +0200</pubDate><guid>https://aliquote.org/post/virus-and-bacteria/</guid><description>&lt;p&gt;I am currently reading &lt;em&gt;Introduction to bioinformatics algorithms&lt;/em&gt;, by Jones and Pevzner. It&amp;rsquo;s a nice textbook for biologists and computer scientists since it provides gentle primers for both domains. Each chapter ends up with a series of exercises, generally of moderate difficulty, that you can solve analytically or using a computer program. Here is one example of such problem, from Chapter 2:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;There are $n$ bacteria and 1 virus in a Petri dish. Within the first minute, the virus kills one bacterium and produces another copy of itself, and all of the remaining bacteria reproduce, making 2 viruses and $2 \cdot (n − 1)$ bacteria. In the second minute, each of the viruses kills a bacterium and produces a new copy of itself (resulting in 4 viruses and $2(2(n − 1) − 2) = 4n − 8$ bacteria; again, the remaining bacteria reproduce. This process continues every minute. Will the viruses eventually kill all the bacteria? If so, design an algorithm that computes how many steps it will take. How does the running time of your algorithm depend on $n$?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Let us write the recurrence relations describing how bacteria ($b$) and virus ($v$) populations evolve over time. At each epoch, each virus kill a bacterium and both samples double in number, which means $b(t) = 2 \cdot \big[ b(t-1) - v(t-1)\big]$ and $v(t) = 2 \cdot v(t-1)$. Henceforth, $b(t) = 2^t(n-t)$ and $v(t)=2^t$. Now, how many generations will it take for the viruses to kill all bacteria? Solving $b(t)=0$ yields $t=n$, suggesting that it will take exactly $n$ generations.&lt;/p&gt;
&lt;p&gt;Now, what about writing this down in Python? This is just a simple loop ($\mathcal{O}(n)$), without regard to the inner numerical operations:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;evo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;pop&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;evo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;pop&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pop&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As you can see, it will stop at $t=50$ and the numbers are growing very fast. The second to last step corresponds to the case where the number of virus is half that of bacteria:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/virus-and-bacteria.png"&gt;
&lt;/figure&gt;</description></item><item><title>Micro review from October</title><link>https://aliquote.org/post/micro-review-004/</link><pubDate>Sun, 13 Oct 2019 20:25:30 +0200</pubDate><guid>https://aliquote.org/post/micro-review-004/</guid><description>&lt;p&gt;Here is the monthly micro review of (not so) random links I found while browsing the interweb lately.&lt;/p&gt;
&lt;p&gt;Here we are, finally:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-10-08-11-03-40.png"&gt;
&lt;/figure&gt;
&lt;p&gt;I&amp;rsquo;ve heard a bit of Catalina during the beta, but not so much. It&amp;rsquo;s probably because I mostly turn away from Twitter lately. Now that I reviewed the new features and checked what&amp;rsquo;s working (yeah, apparently &lt;a href="https://tyler.io/macos-10-15-vista/"&gt;notifications work great&lt;/a&gt;!) and what&amp;rsquo;s not, I will put on hold the upgrade. My current config looks ok to me and I clearly don&amp;rsquo;t see any added value to the upcoming macOS version: I already have an iPhone, and I don&amp;rsquo;t need an iPad. This just led me to think that I could probably turn back to Linux, using some kind of a minimalist desktop (e.g., &lt;a href="https://i3wm.org"&gt;i3&lt;/a&gt;) running on a &lt;a href="https://consumer.huawei.com/us/tablets/matebook-x-pro/"&gt;Matebook&lt;/a&gt;. So now you know what my dream setup would be if things get too &lt;a href="https://tyler.io/broken/"&gt;broken&lt;/a&gt; on macOS or my Macbook were suddenly to crash.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;We haven&amp;rsquo;t seen a ton of machine improvement in the past decade so I aim for reliable workhorses a ways down the cost-depreciation curve.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Unlike &lt;a href="https://usesthis.com/interviews/graydon.hoare/"&gt;Graydon Hoare&lt;/a&gt;, I think there still is a place for nice laptops on the market. Problem is that Macbook are getting too expensive (at least for me, now that I have to buy then again myself), so if the software get broken there&amp;rsquo;s no point in keeping fighting again and again.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m done with the &lt;a href="https://hacktoberfest.digitalocean.com"&gt;Hacktoberfest&lt;/a&gt;, which I completed quickly Wednesday morning. If I have read the rules before, I would have chosen otehr repository, surely, or I would have worked on my GH solely. Anyway, if I get a T-shirt, it will go to my preferred Fortnite and Minecraft player (you already guessed who&amp;rsquo;s the guy, right?).&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-10-09-11-39-47.png"&gt;
&lt;/figure&gt;
&lt;p&gt;If you like math and CS, here are a bunch of textbooks available online or in PDF format that I came across recently:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.cis.upenn.edu/~jean/math-deep.pdf"&gt;Algebra, Topology, Differential Calculus, and Optimization Theory For Computer Science and Machine Learning&lt;/a&gt;, by Jean Gallier and Jocelyn Quaintance;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://scholarworks.gvsu.edu/cgi/viewcontent.cgi?article=1021&amp;amp;context=books"&gt;Linear Algebra and Applications: An Inquiry-Based Approach&lt;/a&gt;, by Feryal Alayont and Steven Schlicker;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://becarioprecario.bitbucket.io/inla-gitbook/"&gt;Bayesina inference with INLA&lt;/a&gt;, by Virgilio Gómez-Rubio. Note that Aki Vehtari also made his &lt;a href="https://github.com/avehtari/BDA_course_Aalto"&gt;BDA course&lt;/a&gt; available for free on Github.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="https://safiire.github.io/blog/2017/08/19/solving-danish-defense-intelligence-puzzle/"&gt;Solving a Danish Defense Intelligence Puzzle&lt;/a&gt;: I like discovering new content or long standing blogs that I just learned about via some other blog posts. In this case, this post is far beyond my technical knowledge but I found it interesting anyway and I learned a bit of reverse engineering.&lt;/p&gt;
&lt;p&gt;I am quite happy with my Micro blog since I don not use any extra package and just use basic Hugo facilities to run the two blog simultaneously. It could be better, of course, but that&amp;rsquo;s okay as far as I am concerned. I am aware of other micro-blogging platforms or APIs, but I just learned about &lt;a href="https://microblog.pub"&gt;Microblog&lt;/a&gt; (h/t &lt;a href="https://jlelse.blog/thoughts/2019/10/microblogpub/"&gt;Jan-Lukas Else&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Brett Terpstra has a nice post regarding the Fish shell on his blog: &lt;a href="https://brettterpstra.com/2019/10/11/branching-out-from-bash-fishing-expedition/"&gt;Branching out from Bash: Fishing expedition&lt;/a&gt;. This was especially useful since I &lt;a href="https://aliquote.org/post/fish-shell/"&gt;switched to Fish&lt;/a&gt; recently myself. I learned quite a bit from reading his blog post and looking at &lt;a href="https://gist.github.com/ttscoff/bcbba84438257e1d182480d3d929047a"&gt;his code&lt;/a&gt; available on Github.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Blog rolling&lt;/em&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="http://feedproxy.google.com/~r/TheEndeavour/~3/FlB6bwZIEcA/"&gt;Computational survivalist&lt;/a&gt;. The last point is very well put:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I’m more sympathetic to minimalism than survivalism. You can be more productive by learning to use a small set of tools well than by hacking away with a large set of tools you hardly know how to use.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://freakonometrics.hypotheses.org/58446"&gt;Combining automatically factor levels with trees&lt;/a&gt;. It&amp;rsquo;s getting rarer that I read posts on R, the language. However, from time to time I came across some posts I used to like, you know, those posts where you get both the code and some pretty figures around.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="http://brendandawes.com/blog/handy-ffmpeg-automator-scripts"&gt;Handy FFMpeg Automator Scripts&lt;/a&gt;. It&amp;rsquo;s been a while since I haven&amp;rsquo;t used &lt;code&gt;ffmpeg&lt;/code&gt;. last time was probably for a talk where I needed to assemble some pieces of ggplot into a movie.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://leancrew.com/all-this/2019/10/old-bugs-never-die-or-fade-away/"&gt;Old bugs never die or fade away&lt;/a&gt;. The take away message is probably to be careful with what you put in your init files.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>The unquantified self #11</title><link>https://aliquote.org/post/unquantified-self-011/</link><pubDate>Fri, 11 Oct 2019 20:43:40 +0200</pubDate><guid>https://aliquote.org/post/unquantified-self-011/</guid><description>&lt;p&gt;Here are the latest personal news from the one who no longer has any name.&lt;/p&gt;
&lt;p&gt;The stock of TV shows is growing, slowly but it has the merit of being there, next to my Apple TV:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-10-08-17-06-07.png"&gt;
&lt;/figure&gt;
&lt;p&gt;I&amp;rsquo;m afraid the next macOS release will probably break everything, so I will wait and see how far I can go with Mojave. After quite a lengthy break &amp;mdash; not counting movies and series that I watched with my son, of course &amp;mdash; I started watching some TV shows in the evening again: &lt;a href="https://m.imdb.com/title/tt8772296/"&gt;Euphoria&lt;/a&gt;. This is pretty good, actually, especially given the fact that I was looking for some kind of a divertissement, and that Twitch streams are less engaging at the moment. Holycube is over, by the way, so thank you &lt;em&gt;Roi Louis&lt;/em&gt; (and &lt;em&gt;Alpz&lt;/em&gt;) for all the great job, and the sharing of joy and humour (I am not a big fan of Twitch chat and I can&amp;rsquo;t afford being a sponsor, so here are a few words in recognition):&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/IMG_0805.jpg"&gt;
&lt;/figure&gt;
&lt;p&gt;My son and I did watch &lt;a href="https://en.wikipedia.org/wiki/12_Monkeys_(TV_series)"&gt;12 Monkeys&lt;/a&gt; during the last few weeks, and it was really great. And we are onto &lt;a href="https://en.wikipedia.org/wiki/Westworld_(TV_series)"&gt;Westworld&lt;/a&gt; right now.&lt;/p&gt;
&lt;p&gt;I spent a lot of time lately programming in various languages, mainly Racket, Python and Haskell. I must confess I am highly biased toward functional PLs, but well I&amp;rsquo;ve been using Python daily since I got a new work, so it is often easier to scratch some stuff in Python then think about it, and rewrite a proper recursive version. Anyway, I have some free time to experiment with those languages and I am more than happy spending my day job with a computer rather than wasting my time in endless meetings with physicians as I was doing in the past.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-08-23-14-12-02.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Besides, I now spend most of my day using a Terminal and Emacs, just a Terminal and Emacs. This is great, and many of you can probably imagine what amount of work we can achieve using those simple tools. The third app I use on a regular basis is of course Safari, but if I were to do real work (i.e., programming or writing) I might as well do without this last application. And this is the point: there is no need to bother with unnecessary applications when your job can be done with text-based workflows.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I like my editor. It fits my needs perfectly, and I can customize everything how I need it. &amp;mdash; &lt;a href="https://leahneukirchen.org/blog/archive/2007/03/the-day-editors-became-handaxes.html"&gt;Leah Neukirchen&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Other than that, while I happened to read a &lt;a href="https://aliquote.org/files/books.txt"&gt;lot of books&lt;/a&gt; during the Summer holidays, I have less time now unfortunately. However, I managed to re-read Anaïs Nin, a lot of small novels and short stories that I often find in a public book case near my work. I also listened to a lot of music, almost daily. No need for &lt;a href="https://roonlabs.com"&gt;Roon&lt;/a&gt;, iTunes has been getting better the last few months:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-09-09-12-08-45.png"&gt;
&lt;/figure&gt;</description></item><item><title>Getting functional using Python</title><link>https://aliquote.org/post/python-getting-functional/</link><pubDate>Sun, 06 Oct 2019 20:10:12 +0200</pubDate><guid>https://aliquote.org/post/python-getting-functional/</guid><description>&lt;p&gt;Python comes bundled with lot of useful modules, and this is not limited to modules that we use daily, like &lt;code&gt;os&lt;/code&gt;, &lt;code&gt;Path&lt;/code&gt;, &lt;code&gt;math&lt;/code&gt; or &lt;code&gt;re&lt;/code&gt; to name a few of them. Julie Danjou offers a nice review in his book, &lt;em&gt;Serious Python&lt;/em&gt;, if you are interested in digging further. In this post I shall focus on the &lt;a href="https://docs.python.org/2/library/itertools.html"&gt;itertools&lt;/a&gt; module, but also &lt;a href="https://docs.python.org/2/library/functools.html"&gt;functools&lt;/a&gt; in part, since they provide a gentle way to get into higher-order data structures and functions.&lt;/p&gt;
&lt;p&gt;This is also the occasion to partly review &lt;a href="https://serious-python.com"&gt;Julien Danjou&amp;rsquo;s book&lt;/a&gt;, which is really a nice piece of work if you want to understand the underside of Python, especially regarding package import and path management. Note that this will not teach you Python programming, but it will certainly be helpful to better understand Python, think about design patterns, and how to develop your own projects. Each chapter provides a discussion of important topics in project development, and a brief interview by core developers is provided at the end. Note that some chapters are very specific of some aspects of Python programming, or PL more generally.&lt;/p&gt;
&lt;p&gt;A function I really like in Clojure is &lt;a href="https://clojuredocs.org/clojure.core/take"&gt;take&lt;/a&gt;: basically you feed it with a sequence and ask to get the first &lt;code&gt;n&lt;/code&gt; items. See, much like a &lt;code&gt;car&lt;/code&gt;, but with varying length. Racket &lt;a href="https://docs.racket-lang.org/reference/pairs.html#%28def._%28%28lib._racket%2Flist..rkt%29._take%29%29"&gt;has it&lt;/a&gt; too. And here it is in Python:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;itertools&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;islice&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;take&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;iterable&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;islice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;iterable&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In the above example, our &lt;code&gt;take&lt;/code&gt; procedure is just &lt;code&gt;itertools.islice&lt;/code&gt; in disguise. And this makes use of &lt;em&gt;iterators&lt;/em&gt;, which are streams of data. This means they are just lazy lists as we have in Scheme or Clojure. Here is a more intesting example, from Justin Poliey:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;nth&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;iterable&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;default&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;None&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;next&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;islice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;iterable&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;default&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This time, using almost the same construct we just recreated the &lt;code&gt;nth&lt;/code&gt; procedure, available in many Lisp flavors. The &lt;code&gt;None&lt;/code&gt; default value stands for the &lt;code&gt;end=&lt;/code&gt; argument in &lt;code&gt;itertools.islice&lt;/code&gt;, so we are just building an infinite stream of data, starting onward at &lt;code&gt;n&lt;/code&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;With few exceptions, functional programming allows you to write more concise and efficient code.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;What does it means exactly? Julien Danjou argues that a functional approach to Python programming is helpful in tems of modularity, brevity, concurrency and testability, the latter two deriving from the very first principle of FP: the input to output flow occurs without the function keeping state or modifying anything not reflected in the return value. In Python, &lt;a href="https://stackoverflow.com/q/9884132"&gt;iterators&lt;/a&gt; and generators &amp;mdash; in which the state of the function is saved as a stack reference, while &lt;a href="https://stackoverflow.com/q/231767"&gt;yield&lt;/a&gt; acts as a simple &lt;code&gt;return&lt;/code&gt; statement &amp;mdash; are two of the most interesting features of the languages, in my view. Instead of building a whole list of items, consider using generator whenever possible since they act as lazy lists.&lt;/p&gt;
&lt;p&gt;Justin Poliey has some &lt;a href="https://github.com/jdp/euler"&gt;nice code&lt;/a&gt; relying on the &lt;code&gt;itertools&lt;/code&gt; module, like the above, to solve Euler projects. For instance, here is his solution to &lt;a href="https://projecteuler.net/problem=3"&gt;Problem 3&lt;/a&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;euler_3&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;&amp;#34;&amp;#34;Find the largest prime factor of a composite number.&amp;#34;&amp;#34;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;math&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;sqrt&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;itertools&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;takewhile&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;eutil&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;primes&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;600851475143&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ps&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;takewhile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;sqrt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;primes&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;max&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;ps&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And this is my code (in Racket):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;require&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;largest-prime-factor&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;apply&lt;/span&gt; &lt;span class="nb"&gt;max&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;map&lt;/span&gt; &lt;span class="nb"&gt;car&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;factorize&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sol-003&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;600851475143&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;largest-prime-factor&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sol-003&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;See, there&amp;rsquo;s no loop, nor any complex control structure (except maybe list comprehension in the case of Python). Above all, you may recall that most operations in FP are just a combination of &lt;code&gt;map&lt;/code&gt;, &lt;code&gt;apply&lt;/code&gt; and/or &lt;code&gt;filter&lt;/code&gt; (or &lt;code&gt;reduce&lt;/code&gt;), you&amp;rsquo;re almost done since Python has you covered. Some examples of use, especially regarding &lt;code&gt;map&lt;/code&gt; and &lt;code&gt;filter&lt;/code&gt;, are discussed by Julien Danjou.&lt;/p&gt;
&lt;p&gt;In passing, I learned about &lt;code&gt;first.first&lt;/code&gt; which might prove very handy when working with stack- or heap-like data structures. Other interesting &lt;code&gt;itertools&lt;/code&gt; functions (chapter 8): &lt;code&gt;acumulate(iterable[,func])&lt;/code&gt; returns a series of accumulated sums of items from iterables; &lt;code&gt;chain(*iterables)&lt;/code&gt; iterates over multiple iterables, one after another, without building an intermediate list of all items; &lt;code&gt;combinations(iterable,r)&lt;/code&gt; generates all combinations of length &lt;code&gt;r&lt;/code&gt; from the given iterable; &lt;code&gt;compress(data,selectors)&lt;/code&gt; applies a Boolean mask from selectors to data and returns only the values from data where the corresponding element of selectors is &lt;code&gt;True&lt;/code&gt;; &lt;code&gt;count(start,step)&lt;/code&gt; generates an endless sequence of values, starting with start and incrementing step at a time with each call; &lt;code&gt;cycle(iterable)&lt;/code&gt; loops repeatedly over the values in iterable; &lt;code&gt;repeat(elem[,n])&lt;/code&gt; repeats an element ntimes; &lt;code&gt;dropwhile(predicate,iterable)&lt;/code&gt; filters elements of an iterable starting from the beginning until predicateis False; groupby(iterable,keyfunc) creates an iterator that groups items by the result returned by the &lt;code&gt;keyfunc()&lt;/code&gt; function; &lt;code&gt;permutations(iterable[,r])&lt;/code&gt; returns successive &lt;code&gt;r&lt;/code&gt;­length permutations of the items in iterable; &lt;code&gt;product(*iterables)&lt;/code&gt; returns an iterable of the Cartesian product of iterables without using a nested for loop; &lt;code&gt;takewhile(predicate,iterable)&lt;/code&gt; returns elements of an iterable starting from the beginning until predicate is &lt;code&gt;False&lt;/code&gt;. And of course, there&amp;rsquo;s the &lt;code&gt;functools&lt;/code&gt; &lt;a href="https://stackoverflow.com/q/15331726"&gt;partial&lt;/a&gt; function.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2020-06-19]&lt;/small&gt;&lt;br&gt;
I originally cited a tweet by Joel Grus, which has been deleted. Its ID was 1198253069160472576.
&lt;/div&gt;</description></item><item><title>NGS from the bottom up</title><link>https://aliquote.org/post/ngs-basics/</link><pubDate>Fri, 04 Oct 2019 16:26:58 +0200</pubDate><guid>https://aliquote.org/post/ngs-basics/</guid><description>&lt;p&gt;Lately, I started taking some notes on Next Generation Sequence analysis, more specifically RNA-Seq data. Most of my textbooks are currently outdated, especially the one on Bioconductor: &lt;em&gt;Bioinformatics and Computational Biology Solutions Using R and Bioconductor&lt;/em&gt;, by Gentleman and coll. The last time I was doing genomic statistics was in 2009-2010 and NGS was just becoming the new way of analysis big data in biology.&lt;/p&gt;
&lt;p&gt;All in one, RNA-Seq consists in a series of extraction, preprocessing and statistical analysis, namely: DNA extraction from a sample, DNA sequencing, Alignment of sequencing reads to a reference genome, Basic exploratory data analysis, Identification of genomic variants (SNPs, small insertions and deletions), Gene quantification (i.e., statistics on count data). But see the following picture which highlights a typical workflow using R :&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/fig-count-rna.png"&gt;
&lt;/figure&gt;
&lt;p&gt;In what follows, I will review two tools that are quite handy if you want things done in a resonnable amount of time. This is does not mean that this the perfect solution &amp;mdash; there are far better accurate workflow for data preprocessing &amp;mdash; but this may help perform batch analysis in case you have large amount of data and seek an efficient way for screening of candidate gene sets, for instance. I will be using data available on the &lt;a href="https://jgi.doe.gov"&gt;JGI&lt;/a&gt; website, and other data that I cannot share here so that I won&amp;rsquo;t reproduce R outputs. I hope, however, that the following R code is enough to help you get started with your own dataset.&lt;/p&gt;
&lt;h2 id="data-preprocessing"&gt;Data preprocessing&lt;/h2&gt;
&lt;p&gt;It is beyond the scope of this short note to review all the different software that can be used to perform alignment of reads on a reference genome. Let us say that &lt;a href="https://ccb.jhu.edu/software/tophat/index.shtml"&gt;TopHat2&lt;/a&gt; is probably the best when it comes to findind splice junctions. However, it is also possible to use pseudo-alignment with &lt;a href="https://pachterlab.github.io/kallisto/about.html"&gt;kallisto&lt;/a&gt;, and it is much (much) faster. If reads are in SRA format, they will need to be converted to Fastq files using the &lt;a href="https://www.ncbi.nlm.nih.gov/sra/docs/toolkitsoft/"&gt;sratoolkit&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;A sample shell script is provided below:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#!/usr/bin/env bash
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;PREPROCESS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nv"&gt;$PREPROCESS&lt;/span&gt; -eq &lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;## SRA -&amp;gt; Fasta (parallel runs)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; file in *.sra
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;do&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; fastq-dump &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;file&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;&amp;amp;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;## Build index of genome&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; kallisto index -i Podans1_GeneCatalog_transcripts_20171002.nt.idx &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Podans1_GeneCatalog_transcripts_20171002.nt.fasta
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## Quantification&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; file in *.fastq
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;do&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; kallisto quant -i Podans1_GeneCatalog_transcripts_20171002.nt.idx &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -o out.&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;file&lt;/span&gt;&lt;span class="p"&gt;%.*&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --single -l &lt;span class="m"&gt;100&lt;/span&gt; -s &lt;span class="m"&gt;5&lt;/span&gt; -b &lt;span class="m"&gt;20&lt;/span&gt; --seed &lt;span class="m"&gt;101&lt;/span&gt; --threads&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;4&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;file&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# --pseudobam&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Once the data files have been processed, we should have a series of abundance data, counts and TPM values.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;h2 id="differential-analysis"&gt;Differential analysis&lt;/h2&gt;
&lt;p&gt;Basically, NGS analyses (RNA, CHIP, etc.) need to account for within-group variance estimates when analysing lot of genes, hence the need to pool information across genes. The DESeq approach detects and corrects dispersion estimates that are too low through modeling of the dependence of the dispersion on the average expression strength over all samples. In addition, it provides a novel method for gene ranking and the visualization of stable estimates of effect sizes.&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt; The &lt;a href="https://bioconductor.org/packages/release/bioc/html/DESeq2.html"&gt;deseq2&lt;/a&gt; package further includes shrunken fold changes (with SE).&lt;/p&gt;
&lt;p&gt;We need two data frames before running the statistical analysis: a table of counts (or TPM values from &lt;code&gt;kallisto&lt;/code&gt; or &lt;code&gt;salmon&lt;/code&gt;), and a table describing the experimental condition. Note that each run must come with at least two replicates (ideally, three). Here are the basic steps to import counts data and setup the design matrix:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;library&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;DESeq2&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;library&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;tximport&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;datadir&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;dir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;.&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pattern&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;out.\\.*&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;files&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;file.path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;datadir&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;abundance.h5&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;names&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;files&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;gsub&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;out.&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;datadir&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;samples&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;data.frame&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;run&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;names&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;files&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;condition&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;c&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;4h&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;48h&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;24h&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;txi&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;tximport&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;files&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;kallisto&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;txOut&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;TRUE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;dds&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;DESeqDataSetFromTximport&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;txi&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;colData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;samples&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;design&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;~&lt;/span&gt; &lt;span class="n"&gt;condition&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Two preprocessing stages are worth considering before dwelling into gene quantification &lt;em&gt;per se&lt;/em&gt;: quality control and normalization. Quality control amounts to controlling the number of genes having non-zero counts in all samples. If this number is very low, it is likely that something went wrong, at least with some of the samples. Based on the DESeq table of counts, we can proceed as follows in R:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;gene_counts&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;counts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dds&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;counts_per_sample&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;apply&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;gene_counts&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kr"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;cat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;counts_per_sample&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;out of&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;nrow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dds&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;\n&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Normalization refers to the comparison of size factors defined as the median of ratios of each sample to a virtual reference sample (median of each gene’s values across samples). Those ratios are expected to match the ratios of the library sizes and be roughly equal to one. Dividing each column of the count table by the corresponding size factor yields normalized count values, which can be scaled to give a counts per million interpretation. Note that this is different from the approach taken by &lt;a href="https://bioconductor.org/packages/release/bioc/html/edgeR.html"&gt;edgeR&lt;/a&gt;, which considers the trimmed mean of M values. An MA plot can be used to show the average vs. mean–difference of log fold change, centered around 0, and it is expected to observe higher variability of log ratios at lower counts.&lt;/p&gt;
&lt;p&gt;A PCA or simple heatmap of the results of hierarchical clustering of the sample data can be used to assess overall similarity between samples. We expect triplicate to cluster together while samples from very different experimental conditions are expected to be far away one from the other. Of note, it is useful to apply a regularized log–transformation on the raw counts to avoid the impact of few highly variale genes, hence considering a roughly equal contribution from all genes. For genes with high counts, this mostly resembles a log2 transformation, whereas for genes with low counts, this shrunkens values toward gene&amp;rsquo;s average across amples. It is important to note that this is only for exploratory analysis; for statistical modeling, raw counts should be preferred since DESeq will handle appropriate correction automagically:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;rld&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;rlogTransformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dds&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;blind&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;TRUE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;dd&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;as.matrix&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;dist&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;t&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;assay&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rld&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;library&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pheatmap&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;pheatmap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dd&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;plotPCA&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rld&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;intgroup&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;c&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;condition&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The statistical model underlying differential analysis of count data is a Negative Binomial, which contrary to the standard Poisson model allows to account for overdispersion (i.e., variance greater than mean). Variance is modeled as $\mathbb{V}[NB(\mu, \alpha)]=\mu+\alpha\mu^2$, and the very first step in differential analysis is to get an estimate of the dispersion parameter for each gene (independent of the condition, which is sensible since there is usually a low number of replicates). Notice that for genes with very low read counts, the large amount of Poisson noise prevent those genes from exhibiting any DE at all, and DESeq performs independent filtering automatically to discard such low signals and to increase statistical power for the remaining gene candidates. The asymptotic dispersion for highly expressed genes can be seen as a measurement of biological variability in the sense of a squared coefficient of variation: a dispersion value of 0.01 means that the gene’s expression tends to differ by typically $\sqrt{0.01}=10%$ between samples of the same treatment group. The R procedure &lt;code&gt;estimateDispersions&lt;/code&gt; allows to compute (and visualize) dispersion estimates as a function of mean normalized counts.&lt;/p&gt;
&lt;p&gt;The statistical test used to assess whether genes are differentially expressed between samples is a Wald test (&lt;code&gt;nbinomWaldTest&lt;/code&gt;), with FDR correction for multiple testing. Benjamini–Hochberg&amp;rsquo;s adjusted p-values can then be ranked to highlight the top genes. Usually, the statistical threshold is set at 0.1, and not 0.05 as in standard null hypothesis statistical testing.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ddstab&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;estimateDispersions&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;estimateSizeFactors&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dds&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;results&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;nbinomWaldTest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ddstab&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;pAdjustMethod&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;BH&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;table&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="o"&gt;$&lt;/span&gt;&lt;span class="n"&gt;padj&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="m"&gt;0.1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## r@metadata$filterThreshold&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The inspection of the distribution of (unadjusted) p-values is helpful to verify that the null distribution for the test statistic is viable. If the histogram does not exhibit an uniform pattern (e.g., U or hill shape), then it is likely that the $\mathcal{N}(0,1)$ null distribution is not appropriate. See the &lt;a href="http://cran.fhcrc.org/web/packages/fdrtool/index.html"&gt;fdrtool&lt;/a&gt; and &lt;a href="http://cran.fhcrc.org/web/packages/locfdr/index.html"&gt;locfdr&lt;/a&gt; packages for further strategies about controlling global or local FDR, and empirical null modeling allowing to estimate the variance of the null model (expected to be 1, per the $\mathcal{N}(0,1)$ hypothesis).&lt;/p&gt;
&lt;p&gt;Once the model is fitted, it is possible to extract the top genes using, e.g.:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;plotMA&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;names&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dds&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nf"&gt;[which&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="o"&gt;$&lt;/span&gt;&lt;span class="n"&gt;padj&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="m"&gt;0.1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="n"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then, it is harder time where you will have to make sense of all oh those results using Gene Ontology and the like.&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Anders, S., McCarthy, D. J., Chen, Y., Okoniewski, M., Smyth, G. K., Huber, W., &amp;amp; Robinson, M. D. (2013). Count-based differential expression analysis of RNA sequencing data using R and Bioconductor. Nature Protocols, 8(9), 1765–1786.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;&lt;a href="https://www.rna-seqblog.com/rpkm-fpkm-and-tpm-clearly-explained/"&gt;RPKM, FPKM and TPM, clearly explained&lt;/a&gt;&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:3"&gt;
&lt;p&gt;Love, M. I., Huber, W., &amp;amp; Anders, S. (2014). Moderated estimation of fold change and dispersion for rna-seq data with deseq2. Genome Biology, 15(550), 1–21.&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Micro-posting in September</title><link>https://aliquote.org/post/micro-09-2019/</link><pubDate>Sat, 28 Sep 2019 19:47:28 +0200</pubDate><guid>https://aliquote.org/post/micro-09-2019/</guid><description>&lt;p&gt;Here is the monthly newsletter from the Micro blog.&lt;/p&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-09-02&lt;/a&gt;: Lovely. &lt;a href="https://leon-kim.com/"&gt;https://leon-kim.com/&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-02&lt;/a&gt;: Old times good times: &lt;a href="https://blog.hubspot.com/marketing/history-of-blogging"&gt;A Brief Timeline of the History of Blogging&lt;/a&gt;. Although I came late to the party (around 2006), I remember all those emerging blogs from the 2000s, I mean, before the advent of social networks. Then came Twitter, Blogger and Tumblr.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-02&lt;/a&gt;: Want some training or refresh your TeX memory? &lt;a href="https://texnique.xyz"&gt;https://texnique.xyz&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-02&lt;/a&gt;: &lt;a href="https://ezhil-hugo.netlify.com"&gt;Ezhil&lt;/a&gt;: Clean and minimal personal blog theme for Hugo.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-02&lt;/a&gt;: &lt;a href="https://github.com/cooplab/popgen-notes"&gt;Population genetics notes&lt;/a&gt;, from the the Coop Lab. &lt;code&gt;#bioinformatics&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-02&lt;/a&gt;: &lt;a href="http://www.jmlr.org/papers/volume19/16-474/16-474.pdf"&gt;Random Forests, Decision Trees, and Categorical Predictors: The “Absent Levels” Problem&lt;/a&gt; (PDF).&amp;gt; This problem occurs whenever there is an indeterminacy over how to handle an observation that has reached a categorical split which was determined when the observation in question’s level was absent during training.TL;DR No feature engineering heuristics seem to really help mitigate this kind problem.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-02&lt;/a&gt;: eBay&amp;rsquo;s &lt;a href="https://github.com/eBay/tsv-utils"&gt;TSV Utilities&lt;/a&gt;: Command line tools for large, tabular data files. Filtering, statistics, sampling, joins and more.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-03&lt;/a&gt;: &amp;gt; The good things in a community site come from people more than technology; it&amp;rsquo;s mainly in the prevention of bad things that technology comes into play. Technology certainly can enhance discussion. Nested comments do, for example. But I&amp;rsquo;d rather use a site with primitive features and smart, nice users than a more advanced one whose users were idiots or trolls. &amp;mdash; Paul Graham, &lt;a href="http://www.paulgraham.com/hackernews.html"&gt;What I&amp;rsquo;ve learned from Hacker News&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-03&lt;/a&gt;: TIL about &lt;a href="https://dotfiles.github.io"&gt;https://dotfiles.github.io&lt;/a&gt;, the unofficial guide to dotfiles on GitHub.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-03&lt;/a&gt;: &lt;a href="https://papl.cs.brown.edu/2019/"&gt;Programming and Programming Languages&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-03&lt;/a&gt;: &lt;a href="http://plasmasturm.org/log/453/"&gt;Tree traversal without recursion: the tree as a state machine&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-04&lt;/a&gt;: Handouts with exercises on &lt;a href="http://disi.unitn.it/~teso/courses/sciprog/index.html"&gt;scientific computing&lt;/a&gt; using Python, feat. some introduction to BioPython. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-04&lt;/a&gt;: Tutorial on &lt;a href="https://hackage.haskell.org/package/hvega-0.4.0.0/docs/Graphics-Vega-Tutorials-VegaLite.html"&gt;vega-lite and Haskell&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-04&lt;/a&gt;: &lt;a href="https://www.reddit.com/r/emacs/comments/csvje9/lisp_people_whats_your_goto_language_for_when_you/"&gt;Lisp people: What&amp;rsquo;s your go-to language for when you want to write a quick script&lt;/a&gt;. I for one do most of my scripting stuff using Bash, sed/awk, and Python. However, it looks like some folks tend to rely on Clojure, various flavours of Scheme, CL, or even Perl 6 (but why?).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-04&lt;/a&gt;: &lt;a href="https://observablehq.com/@mourner/non-robust-arithmetic-as-art"&gt;Robust Arithmetic in Computational Geometry&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-04&lt;/a&gt;: &lt;a href="https://www.paulmcgrath.me/posts/2018/static-sites-with-hugo-tachyons-netlify/"&gt;Static Sites with Hugo, Tachyons, and Netlify&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-05&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/cigarettes-after-sex/1215408950" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Cigarettes After Sex, &lt;em&gt;Cigarettes After Sex&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-05&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/you-want-it-darker/1154144036" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Leonard Cohen, &lt;em&gt;You Want It Darker&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-05&lt;/a&gt;: Early in the morning, I decided to reformat my old notes from various formats (RST, MD, TXT) to Org. It took me more than two hours to make things look like they weren&amp;rsquo;t writtent in 2005 on Linux!&lt;img src="https://aliquote.org/img/2019-09-05-15-37-38.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-05&lt;/a&gt;: I have been using my bluetooth &lt;a href="https://www.apple.com/fr/shop/product/MLA22F/A/magic-keyboard-fran%C3%A7ais"&gt;Magick Keyboard&lt;/a&gt; at my office since 3 weeks now, and it&amp;rsquo;s kinda difficult to write on the Macbook built-in keyboard right now. Or I may just be tired. Anyway, to reiterate what I was saying &lt;a href="https://aliquote.org/post/mb-keyboard/"&gt;last year&lt;/a&gt;, this is definitely a very good keyboard.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-05&lt;/a&gt;: So now I know why I lost several Go of free space on my HD:&lt;img src="https://aliquote.org/img/2019-08-30-09-02-43.png" alt=""&gt;&lt;img src="https://aliquote.org/img/2019-08-30-09-03-21.png" alt=""&gt;&lt;img src="https://aliquote.org/img/2019-08-30-09-03-31.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-05&lt;/a&gt;: Very happy to see than Tony Rossini is going to have a &lt;a href="https://blindglobe.github.io"&gt;new homepage&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt; &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-05&lt;/a&gt;: &lt;a href="https://course.spacy.io"&gt;Advanced NLP with Spacy&lt;/a&gt;. If only there were more than 24 hours a day&amp;hellip; &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-05&lt;/a&gt;: &lt;a href="http://sulami.github.io/posts/why-i-like-clojure/"&gt;Why I like Clojure&lt;/a&gt;. Note that the site was built using Hakyll ;-)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-06&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/how-big-how-blue-how-beautiful-deluxe/964546448" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Florence + The Machine, &lt;em&gt;How Big, How Blue, How Beautiful&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-06&lt;/a&gt;: &amp;gt; You’ll be fighting the compiler to the end as long as you have writes to uint8&lt;em&gt;t arrays in your core loops. &amp;mdash; &lt;a href="https://travisdowns.github.io/blog/2019/08/26/vector-inc.html"&gt;Incrementing vectors&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-06&lt;/a&gt;: Apprently, the TAB key of my built-in keyboard started to screw up seriously. Not a bid deal since I&amp;rsquo;m using an external keyword at my offcie, but in order to anticipate any definitive failure, I remapped my right option key to TAB. Not a bad deal after all, since I never use this modification key. Now, for switching between app, I can simply use my two hands: left for ⌘ and right for ⌥ .&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-06&lt;/a&gt;: Not sure I deserve a medal this morning, but at least I reached the point where Emacs told me my code looks like a &lt;a href="https://en.wikipedia.org/wiki/Cyclomatic_complexity"&gt;giant mess&lt;/a&gt; in a Git repo.&lt;img src="https://aliquote.org/img/2019-09-06-10-48-39.png" alt=""&gt;So, after a bit of googling, I&amp;rsquo;m now reading &lt;a href="https://dmerej.info/blog/post/how-i-lint/"&gt;How I Lint My Python&lt;/a&gt;, although Emacs does it all for free.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-06&lt;/a&gt;: &lt;a href="http://notes.eatonphil.com/unit-testing-c-code-with-gtest.html"&gt;Unit testing C code with gtest&lt;/a&gt;. Lot of other &lt;a href="http://notes.eatonphil.com"&gt;nice posts&lt;/a&gt;, unfortunately like &lt;a href="https://chrisdone.com"&gt;Chris Done&lt;/a&gt; website I cannot find any RSS feed to subscribe to.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-06&lt;/a&gt;: &lt;a href="https://www.tweag.io/posts/2019-09-06-why-haskell-is-important.html"&gt;Why Haskell is important&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-06&lt;/a&gt;: &lt;a href="https://github.com/zyrolasting/polyglot"&gt;polyglot&lt;/a&gt;: Generate static websites using Markdown and any Racket #lang. &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-07&lt;/a&gt;: &lt;a href="http://zerolib.com/journaling-procedure.html"&gt;A Daily Journal in Org Mode&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-07&lt;/a&gt;: &lt;a href="https://github.com/kimwalisch/primesieve"&gt;Fast prime number generator&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-07&lt;/a&gt;: &lt;a href="https://lwn.net/Articles/795385/"&gt;Racket: Lisp for learning&lt;/a&gt;. See also &lt;a href="https://blog.racket-lang.org/2019/01/racket-on-chez-status.html"&gt;Racket-on-Chez Status: January 2019&lt;/a&gt;. &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-09&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/meddle/699632611" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Pink Floyd, _Meddle&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-09&lt;/a&gt;: Trying out the nice &lt;a href="https://github.com/DarthFennec/highlight-indent-guides"&gt;indent-guides&lt;/a&gt; features in Doom Emacs. This is quite an enhancement for Python coding! &lt;code&gt;#emacs&lt;/code&gt;&lt;img src="https://aliquote.org/img/2019-09-09-10-58-21.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-09&lt;/a&gt;: &lt;a href="https://www.more-magic.net/posts/scheme-c-integration.html"&gt;A (mostly) comprehensive guide to calling C from Scheme and vice versa&lt;/a&gt;. &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-10&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/in-the-flat-field/1025316248" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Bauhaus, &lt;em&gt;In the Flat Field&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-10&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/still-live/155953277" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Keith Jarrett Trio, &lt;em&gt;Still Live&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-10&lt;/a&gt;: &amp;gt; Your program is a data transformation pipeline, based on functions and expressions that can be composed unambiguously. &amp;mdash; &lt;a href="http://www.datahaskell.org"&gt;data haskell&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-10&lt;/a&gt;: Fira code is now &lt;a href="https://github.com/tonsky/FiraCode/releases/tag/2"&gt;v2&lt;/a&gt;. I&amp;rsquo;m still loving Iosevka, so I won&amp;rsquo;t fall back to Fira Code for my editor and terminal, but this surely remains my preferred monospace font for technical writings.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-10&lt;/a&gt;: Some &lt;a href="https://gist.github.com/ralt/a36288cd748ce185b26237e6b85b27bb"&gt;nice tricks&lt;/a&gt; to get eshell working over tramp. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-10&lt;/a&gt;: &lt;a href="http://library.open.oregonstate.edu/computationalbiology/"&gt;A Primer for Computational Biology&lt;/a&gt;. &lt;code&gt;#bioinformatics&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-10&lt;/a&gt;: &lt;a href="http://lamb-the-lambda.com/haskell/2019/09/07/five-cartesian.html"&gt;Five Ways to Compute the Cartesian Product with Haskell&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-10&lt;/a&gt;: &lt;a href="https://rust-bio.github.io"&gt;Rust-Bio&lt;/a&gt;: a bioinformatics library for the Rust language. &lt;code&gt;#rust&lt;/code&gt; &lt;code&gt;#bioinformatics&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-10&lt;/a&gt;: &lt;a href="https://github.com/mklarqvist/libflagstats"&gt;libflagstats&lt;/a&gt;: Efficient C functions to compute the summary statistics (flagstats) for sequencing read sets. &lt;code&gt;#bioinformatics&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-11&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/no-no-no/997318492" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Beirut, &lt;em&gt;No No No&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-11&lt;/a&gt;: Usenet &lt;a href="http://www.informatimago.com/articles/usenet.html"&gt;posts of interest&lt;/a&gt;, and a lot of Lisp ressources by Pascal Bourguignon. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-11&lt;/a&gt;: &lt;a href="https://www.macs.hw.ac.uk/~rs46/posts/2018-12-29-textlint-flycheck.html"&gt;A textlint flycheck checker in Emacs&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-11&lt;/a&gt;: &lt;a href="https://gaultier.github.io/blog/advent_of_code_2018_5"&gt;Getting started with Scheme by solving an Advent of Code 2018 challenge&lt;/a&gt;. See also &lt;a href="https://programmingpraxis.com/2019/09/10/alchemical-reduction/2/"&gt;these comments&lt;/a&gt; on Programming Praxis. &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-11&lt;/a&gt;: &lt;a href="https://blog.jft.rocks/emacs/orgmode-publishing.html"&gt;Publishing org-mode notes as a website&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-11&lt;/a&gt;: &lt;a href="https://web.ist.utl.pt/antonio.menezes.leitao/ADA/documents/publications_docs/2014_ReachingPythonFromRacket.pdf"&gt;Reaching Python from Racket&lt;/a&gt; (PDF), or the best of both worlds. &lt;code&gt;#racket&lt;/code&gt; &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-12&lt;/a&gt;: TIL how one could use &lt;a href="https://help.apple.com/instruments/mac/10.0/#/dev7b09c84f5"&gt;Instruments&lt;/a&gt; with R: &lt;a href="https://const-ae.name/post/performance-debugging-in-r-and-cpp/"&gt;Performance Debugging in R and C++&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-12&lt;/a&gt;: &lt;a href="https://duncan.codes/posts/2019-09-03-migrating-from-jekyll-to-org/"&gt;Migrating from Jekyll to org-mode and Github Actions&lt;/a&gt;. &lt;code&gt;#org&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-12&lt;/a&gt;: &lt;a href="http://www.therandymon.com/index.php?/197-Woodnotes-Guide-to-Emacs-for-Writers.html"&gt;Woodnotes Guide to Emacs for Writers&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-13&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/human-incognito/1171932077" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Arno, &lt;em&gt;Human incognito&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-13&lt;/a&gt;: More on the GH actions corner: &lt;a href="https://calibreapp.com/blog/compress-images-in-prs/"&gt;Automatically compress images on Pull Requests&lt;/a&gt;. Nicely done! Why not removing Geo/IP data at the same time?&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-13&lt;/a&gt;: Well, guess what? I&amp;rsquo;m just retagging all my posts&amp;hellip; ;-)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-13&lt;/a&gt;: &lt;a href="https://getkerf.wordpress.com/2016/03/30/the-best-algorithm-no-one-knows-about/"&gt;The Best Algorithm No One Knows About&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-14&lt;/a&gt;: Howdy &lt;a href="https://sicp.comp.nus.edu.sg"&gt;SICP in JS&lt;/a&gt;!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-14&lt;/a&gt;: Quite a big update&amp;hellip; (Just so we can now filter posts by year of publication.)&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-09-14-09-56-44.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-14&lt;/a&gt;: TIL about &lt;a href="https://github.com/jacktasia/dumb-jump"&gt;dumb-jump&lt;/a&gt; (via &lt;a href="https://irreal.org/blog/?p=8307"&gt;Irreal&lt;/a&gt;), an Emacs &amp;ldquo;jump to definition&amp;rdquo; package for 40+ languages. I became quite used to LSP jump-to- definitions and references, until I realized today that &lt;code&gt;dumb-jump&lt;/code&gt; is included in &lt;a href="https://github.com/hlissner/doom-emacs/tree/develop/modules/tools/lookup"&gt;Doom Emacs&lt;/a&gt; toolbet! &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-14&lt;/a&gt;: &lt;a href="https://blog.poisson.chat/posts/2019-09-13-reverse.html"&gt;Making Haskell run fast: the many faces of reverse&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-14&lt;/a&gt;: &lt;a href="https://osca.bioconductor.org"&gt;Orchestrating Single-Cell Analysis with Bioconductor&lt;/a&gt;, with a gorgeous Bookdown theme. &lt;code&gt;#bioinformatics&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-14&lt;/a&gt;: &lt;a href="https://www.welcometothejungle.co/fr/articles/btc-deep-learning-clojure-haskell"&gt;The Beauty of Functional Languages in Deep Learning — Clojure and Haskell&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-15&lt;/a&gt;: Remember the Summer&amp;hellip;&lt;img src="https://aliquote.org/img/IMG_0806.jpg" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-15&lt;/a&gt;: &lt;a href="https://bmcbiol.biomedcentral.com/articles/10.1186/1741-7007-12-29"&gt;Models in biology: ‘accurate descriptions of our pathetic thinking’&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-16&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/playlist/jazz-chill/pl.63271312c084419891982eab46cc68ac" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Some &lt;em&gt;Jazz Chill&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-16&lt;/a&gt;: &lt;a href="https://github.com/ThinkR-open/building-shiny-apps-workflow"&gt;Building Big Shiny Apps — A Workflow&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-16&lt;/a&gt;: &lt;a href="https://chimeracoder.github.io/docker-without-docker/#1"&gt;Docker Without Docker&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-16&lt;/a&gt;: &lt;a href="http://timvieira.github.io/blog/post/2016/11/21/heaps-for-incremental-computation/"&gt;Heaps for incremental computation&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-16&lt;/a&gt;: &lt;a href="https://sigpipe.macromates.com/2014/run-command-every-other-week/"&gt;Run Command Every Other Week&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-16&lt;/a&gt;: &lt;a href="https://github.com/jonas/tig"&gt;Tig&lt;/a&gt; is such an amazing and handy utility to check the last commits in a Git repo!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-16&lt;/a&gt;: &lt;a href="https://www.wolfram.com/wolfram-alpha-notebook-edition/"&gt;Wolfram|Alpha Notebook Edition&lt;/a&gt;. Yet another Wolfram product in the series of Mathematica and &lt;a href="https://www.wolfram.com/wolframscript/"&gt;Wolfram script&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-17&lt;/a&gt;: An original summary of some of Emacs features: &lt;a href="https://edom.github.io/emacs.html"&gt;Using Emacs and Org Mode&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-17&lt;/a&gt;: I am somehow late on this: &lt;a href="https://emacsredux.com/blog/2019/01/10/the-emacs-year-in-review/i"&gt;The Emacs Year in Review&lt;/a&gt;, by Божидар. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-17&lt;/a&gt;: It&amp;rsquo;s always nice to discover &lt;a href="http://jtmoulia.pocketknife.io/about/"&gt;new blogs&lt;/a&gt; with interesting content. The problem is often to find the infamous RSS feed file when it is not offered as a default.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-17&lt;/a&gt;: On &lt;a href="http://simonkjohnston.life/code/2019/07/30/More-on-Rust-and-Travis.html"&gt;configuring Rust and Travis&lt;/a&gt;. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-17&lt;/a&gt;: &lt;a href="https://github.com/arzzen/git-quick-stats"&gt;Git quick statistics&lt;/a&gt; is a simple and efficient way to access various statistics in git repository.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-17&lt;/a&gt;: &lt;a href="https://www.zachleat.com/web/own-my-tweets/"&gt;I&amp;rsquo;m taking ownership of my tweets&lt;/a&gt; (via &lt;a href="https://jlelse.blog/links/2019/09/twitter-archive/"&gt;Jan_lucas Else&lt;/a&gt;). That&amp;rsquo;s also probably why I&amp;rsquo;m posting on this micro-blog rather than Twitter these days.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-17&lt;/a&gt;: &lt;a href="https://morgenthum.dev/articles/why-prefer-fp"&gt;Why I prefer functional programming&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-18&lt;/a&gt;: &amp;gt; As of today, I’m moving forward with learning Chez Scheme. If Racket moves toward non-Scheme syntax, there could be considerable opportunities for Chez to grow its community. &amp;mdash; &lt;a href="https://www.travishinkelman.com/post/exploring-scheme-implementations/"&gt;Exploring Scheme implementations&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-18&lt;/a&gt;: Apparently, the Python version of &lt;em&gt;Lectures in Quantitative Economics with Python&lt;/em&gt; got a &amp;ldquo;little upgrade&amp;rdquo; (&lt;a href="https://lectures.quantecon.org/_downloads/pdf/py/quantitative_economics_with_python.pdf"&gt;1558 pp.&lt;/a&gt; compared to 638 pp. in 2015). &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-18&lt;/a&gt;: While I&amp;rsquo;m really impressed with the &lt;a href="https://github.com/Wandmalfarbe/pandoc-latex-template"&gt;Eisvogel&lt;/a&gt; template for my &lt;code&gt;Org-&amp;gt;PDF&lt;/code&gt; toolchain&amp;mdash;the rendered listings remember me of the Nord theme that I use in my terminal and under Emacs or Vim), I&amp;rsquo;m also investigating other alternatives. Here are is a nice candidate: &lt;a href="https://github.com/periodicpoint/arabica"&gt;arabica&lt;/a&gt;, but that may well be too much for what I need. And I learned that there already was &lt;a href="http://blog.martinfenner.org/2013/12/05/opening-science---the-book/"&gt;some attempt&lt;/a&gt; at generating pretty HTML book via Pandoc/Jekyll before Hadley Wickham &lt;em&gt;Advanced R&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-18&lt;/a&gt;: &lt;a href="https://learnbyexample.github.io/tutorial/ebook-generation/customizing-pandoc/"&gt;Customizing pandoc to generate beautiful pdfs from markdown&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-18&lt;/a&gt;: &lt;a href="https://morgenthum.dev/articles/write-haskell-game"&gt;How to write a game in Haskell from scratch&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-18&lt;/a&gt;: &lt;a href="https://github.com/soegaard/web-tutorial"&gt;How to write web applications with Racket&lt;/a&gt;. &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-18&lt;/a&gt;: &lt;a href="http://www.aosabook.org/en/posa/warp.html"&gt;Warp&lt;/a&gt; is a high-performance HTTP server library written in Haskell, a purely functional programming language. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-19&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/playlist/jazz-chill/pl.63271312c084419891982eab46cc68ac" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Chill Jazz, again and again.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-19&lt;/a&gt;: &amp;gt; Once you’ve got the hang of Emacs you’ll never use anything else. &amp;mdash; &lt;a href="https://tech.tonyballantyne.com/emacs-workout/emacs-workout/"&gt;Emacs Workout&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-19&lt;/a&gt;: I almost done redesigning the site using a simpler theme, hopefully as responsive as the previsous one (&lt;a href="https://github.com/olOwOlo/hugo-theme-even"&gt;Even&lt;/a&gt;). This time, I started with &lt;a href="https://github.com/vividvilla/ezhil"&gt;Ezhil&lt;/a&gt; and I&amp;rsquo;ve modified it extensively to meet my needs. It only remains to manage old posts with TOML header (to be converted to YAML header) and fix &lt;code&gt;pre&lt;/code&gt; block.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-19&lt;/a&gt;: The second edition of &lt;a href="https://gustedt.wordpress.com/2019/09/18/modern-c-second-edition"&gt;Modern C&lt;/a&gt;, by Jens Gustedt, is finally out. Together with with Ben Klemens&amp;rsquo;s &lt;a href="https://github.com/b-k/21st-Century-Examples"&gt;21st Century C&lt;/a&gt;, this is a must have if you&amp;rsquo;re interested in a modern take on C.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-19&lt;/a&gt;: &lt;a href="http://mbork.pl/2019-09-16_sponge_and_other_moreutils"&gt;sponge and other moreutils&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-20&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/playlist/pj-harvey-les-m%C3%A9connus/pl.940d4028628448efb709a117bcd8e6c6" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   A really nice selection of PJ Harvey greatest songs, feat. Nick Cave.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-20&lt;/a&gt;: TIL about Numpy &lt;code&gt;where&lt;/code&gt;. (via &lt;a href="https://www.johndcook.com/blog/2019/09/18/kstest-shapiro/"&gt;John Cook&lt;/a&gt;) &lt;code&gt;#python&lt;/code&gt;from numpy import wherefrom scipy import statsx = stats.norm.rvs(loc=0, scale=1, size=10)where(x &amp;lt; 0, 0, 1)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-20&lt;/a&gt;: This site now has a client-side search engine at no cost, and it is just working right out of the box: &lt;a href="https://gist.github.com/eddiewebb/735feb48f50f0ddd65ae5606a1cb41ae"&gt;Client side searching for Hugo.io with Fuse.js&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-20&lt;/a&gt;: &lt;a href="https://docdock.netlify.com"&gt;Hugo-theme-docdock&lt;/a&gt; looks like a very nice theme for project documentation.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-21&lt;/a&gt;: I&amp;rsquo;m currently processing all my blog posts &amp;mdash; cleaning things here and there. And so I was thinking that a lot of code snippets I post on this blog could be rendered as Gist, as Hugo offers a nice shortcode for that specific purpose. So here we go:&lt;script src="https://gist.github.com/even4void/b839d4b99d53a7fd9d6b84681efb7e0f.js"&gt;&lt;/script&gt;
Compare to the &lt;a href="https://aliquote.org/post/polya-meets-euler/"&gt;original version&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-21&lt;/a&gt;: Quite a big work of revision (reformatting and proofreading, essentially):&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-09-21-19-14-01.png" alt=""&gt;I&amp;rsquo;m only halfway thu, though. And for the glory details:&lt;code&gt;~/S/aliquote (master↑2|✔)  git pushÉnumération des objets: 168, fait.Décompte des objets: 100% (168/168), fait.Compression par delta en utilisant jusqu'à 4 fils d'exécutionCompression des objets: 100% (88/88), fait.Écriture des objets: 100% (88/88), 19.67 Kio | 205.00 Kio/s, fait.Total 88 (delta 78), réutilisés 0 (delta 0)remote: Resolving deltas: 100% (78/78), completed with 76 local objects.To https://github.com/even4void/aliquote.git2fee5ca..be815a4 master -&amp;gt; master~/S/aliquote (master|✔)  hugo| EN+------------------+------+Pages | 1758Paginator pages | 124Non-page files | 1Static files | 711Processed images | 0Aliases | 1Sitemaps | 1Cleaned | 0&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-22&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/in-the-flat-field/1025316248" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Bauhaus, &lt;em&gt;In the Flat Field&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-22&lt;/a&gt;: DeepL which I use as a handy replacement for Google Translate just delivered a &lt;a href="https://www.deepl.com/app"&gt;native (beta) app&lt;/a&gt;, FYI.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-23&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/live-at-noe-valley-ministry/18766497" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Kristin Hersh, &lt;em&gt;Live At Noe Valley Ministry&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-23&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/still-collectors-edition/275968300" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Joy Division, &lt;em&gt;Still&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-23&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/wyatt-at-the-coyote-palace/1185160567" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Kristin Hersh, &lt;em&gt;Wyatt at the Coyotte Palace&lt;/em&gt;. Actually the fourth or fifth record set from Kristin Hersh that I listen to today.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-23&lt;/a&gt;: Lot of interesting goodies and Emacs tips on &lt;a href="https://diego.codes"&gt;Diego Vicente&lt;/a&gt;&amp;rsquo;s blog. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-23&lt;/a&gt;: Some annoying &amp;ldquo;features&amp;rdquo; of the newly released Safari 13: I can no longer access tabs opened in Safari on my iPhone; DuckDuckGo extension gone; new icons design for tabs preview looks too much like iOS. Have a good day! &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-23&lt;/a&gt;: &lt;a href="https://serokell.io/blog/learning-haskell"&gt;Learning Haskell: A Resource Guide&lt;/a&gt;. Be sure to check Stephen Diehl&amp;rsquo;s excellent &lt;a href="http://dev.stephendiehl.com/hask/"&gt;tutorial&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-23&lt;/a&gt;: &lt;a href="https://www.tweag.io/posts/2019-09-20-monad-bayes-1.html"&gt;Probabilistic programming with Monad-Bayes&lt;/a&gt;. See also &lt;a href="http://delivery.acm.org/10.1145/3240000/3236778/icfp18main-p53-p.pdf"&gt;Functional Programming for Modular Bayesian Inference&lt;/a&gt; (PDF). &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-23&lt;/a&gt;: &lt;a href="https://higherlogics.blogspot.com/2019/09/asynch-asynchronous-stackless.html"&gt;async.h - asynchronous, stackless subroutines in C&lt;/a&gt;. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-24&lt;/a&gt;: TIL about &lt;a href="https://github.com/buckket/twtxt"&gt;twtxt&lt;/a&gt; (via Jack Baty). I&amp;rsquo;m quite happy with the micro-section as it is, but it should be too diffcult to convert all micro-posts to &lt;code&gt;twtxt&lt;/code&gt; format and run the feed along the existing one.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-25&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Nick Cave &amp;amp; The Bad Seeds, &lt;em&gt;The Abattoir Blues&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-25&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/blaze-away/1374960295" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Morcheeba, &lt;em&gt;Blaze Away&lt;/em&gt;. So, today was essentially &lt;a href="https://music.apple.com/fr/album/glass-solo-piano/267427339"&gt;music&lt;/a&gt;, &lt;a href="https://music.apple.com/fr/album/dead-can-dance-remastered/277713765"&gt;music&lt;/a&gt;, and &lt;a href="https://music.apple.com/fr/playlist/pj-harvey-les-indispensables/pl.700e6a67c7364f03b6cd0d5d2496d26c"&gt;music&lt;/a&gt; again and again.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-27&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Keith jarrett Trio, &lt;em&gt;Still Live&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-27&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/the-k%C3%B6ln-concert-live/986641429" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Keith Jarrett, &lt;em&gt;Koln Concert&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-27&lt;/a&gt;: &amp;gt; Concepts are hard. Names don’t make them any easier or harder to understand. Names are only useful in their value as pointers, and to establish relationships between concepts. &amp;mdash; &lt;a href="https://www.parsonsmatt.org/2019/08/30/why_functor_doesnt_matter.html"&gt;Why &amp;ldquo;Functor&amp;rdquo; Doesn&amp;rsquo;t Matter&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-27&lt;/a&gt;: It finally took me 8 evenings (and 8 iterations) to cleanup old stuff.&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-09-27-15-44-11.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-27&lt;/a&gt;: Little sweet salad from yesterday&amp;rsquo;s evening:&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_0811.jpg" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-27&lt;/a&gt;: &lt;a href="https://defn.io/2019/09/20/ann-chief/"&gt;Announcing chief&lt;/a&gt;. &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-27&lt;/a&gt;: &lt;a href="https://cryptopals.com"&gt;Cryptopals crypto challenges&lt;/a&gt; (via &lt;a href="https://cestlaz.github.io/post/are-they-learning-or-jus-using/"&gt;Mike Zamansky&lt;/a&gt;). I will probably take a closer look when I&amp;rsquo;ll be done with Rosalind problems.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-27&lt;/a&gt;: &lt;a href="http://tomasp.net/histogram/"&gt;Histogram: You have to know the past to understand the present&lt;/a&gt;. Although you may encounter some difficulties navigating the page on Safari, it is worth a read. &lt;code&gt;#dataviz&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-28&lt;/a&gt;: Hot off the kitchen:&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_0812.jpg" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-28&lt;/a&gt;: Knuth, on &lt;a href="http://www.math.lsa.umich.edu/~millerpd/docs/501_Winter13/Knuth79.pdf"&gt;Mathematical typography&lt;/a&gt; (PDF):&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-09-28-10-21-18.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-28&lt;/a&gt;: TIL about &lt;a href="https://jellyfin.org"&gt;Jellyfin&lt;/a&gt;, a free software media system. It looks like a nice alternative to &lt;a href="https://roonlabs.com"&gt;Roon&lt;/a&gt;, especially since it does not require any subscription.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-28&lt;/a&gt;: &lt;a href="https://github.com/dwmkerr/hacker-laws"&gt;Hacker Laws&lt;/a&gt;: Laws, Theories, Principles and Patterns that developers will find useful.&amp;gt; Companies tend to systematically promote incompetent employees to management to get them out of the workflow. &amp;mdash; Scott Adams&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-28&lt;/a&gt;: &lt;a href="https://gregoryszorc.com/blog/2017/12/11/high-level-problems-with-git-and-how-to-fix-them/"&gt;High-level Problems with Git and How to Fix Them&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-09-28&lt;/a&gt;: &lt;a href="https://floooh.github.io/2019/09/27/modern-c-for-cpp-peeps.html"&gt;Modern C for C++ Peeps&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;</description></item><item><title>Site redesign</title><link>https://aliquote.org/post/site-redesign/</link><pubDate>Sun, 22 Sep 2019 11:38:07 +0200</pubDate><guid>https://aliquote.org/post/site-redesign/</guid><description>&lt;p&gt;It tooks a while but I finally made it: I redesigned the website few days ago. I am more than happy with the new design: it remains minimalistic but easier to manage, and a lot of old stuff has been cleaned up along the way.&lt;/p&gt;
&lt;p&gt;The previous design was derived from the &lt;a href="https://themes.gohugo.io/hugo-theme-even/"&gt;even theme&lt;/a&gt;. It has served me well during the past two years, but over time I found it hard to maintain in a decent state. Hugo changed a lot in later releases, leading to &lt;a href="https://aliquote.org/micro/hugo-update.md"&gt;pesky errors&lt;/a&gt; with old Go statements. I ended up freazing my Hugo program to the latest version that was actually working with my current settings, but I knew this would not last forever. Three days ago, I decided to upgrade Hugo to the last version available in Homebrew tap, and update the Even theme with the newly released one. I fixed things here and there, and just gave up as soon as I realized that I wanted to build my own package. Most importantlty, I wanted to fix annoying things like image displays, preformatted code blocks and syntax highlighting, Hugo pagination (which was actually too large).&lt;/p&gt;
&lt;p&gt;While browsing existing Hugo themes and frameworks, I came across the &lt;a href="https://github.com/vividvilla/ezhil"&gt;Ezhil&lt;/a&gt; theme. This was just what I was looking for to get started: A sober theme, with minimal CSS and div layout. I worked on it a bit, and finally ended up with the slightly altered version you are currently browsing. Overall, this is mostly Ezhil, but with different structured views, and above all new fonts.&lt;/p&gt;
&lt;p&gt;Here is what is under the hood:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Ezhil comes with &lt;a href="https://necolas.github.io/normalize.css/"&gt;normalize.css&lt;/a&gt;, a responsive stylesheet and &lt;a href="https://feathericons.com"&gt;feather&lt;/a&gt; icons. That&amp;rsquo;s really great because these are lightweight settings that still provide very acceptable rendering across browsers, OSs and media.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I added &lt;a href="https://purecss.io"&gt;purecss&lt;/a&gt; to manage the positioning and resizing of images on blog posts. The idea comes from the &lt;a href="https://github.com/yoshiharuyamashita/blackburn"&gt;blackburn&lt;/a&gt; theme. This allowed me to replace my old &amp;ldquo;gallery&amp;rdquo; shortcode (probably inherited from the Academic theme, that I tried first when I set up the new blog) by a much simpler construct. To put two images side by side (assuming the media screen is large enough), I now use: (Note that I omitted the enclosing brackets, &lt;code&gt;{{&lt;/code&gt; and &lt;code&gt;}}&lt;/code&gt;, in order to avoid proper rendering of the shortcode.)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-html" data-lang="html"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nt"&gt;fluid_imgs&lt;/span&gt; &lt;span class="err"&gt;&amp;#34;&lt;/span&gt;&lt;span class="na"&gt;pure-u-1-2&lt;/span&gt;&lt;span class="err"&gt;|/&lt;/span&gt;&lt;span class="na"&gt;img&lt;/span&gt;&lt;span class="err"&gt;/&lt;/span&gt;&lt;span class="na"&gt;xxx&lt;/span&gt;&lt;span class="err"&gt;.&lt;/span&gt;&lt;span class="na"&gt;png&lt;/span&gt;&lt;span class="err"&gt;&amp;#34;&lt;/span&gt; &lt;span class="err"&gt;&amp;#34;&lt;/span&gt;&lt;span class="na"&gt;pure-u-1-2&lt;/span&gt;&lt;span class="err"&gt;|/&lt;/span&gt;&lt;span class="na"&gt;img&lt;/span&gt;&lt;span class="err"&gt;/&lt;/span&gt;&lt;span class="na"&gt;xxx&lt;/span&gt;&lt;span class="err"&gt;.&lt;/span&gt;&lt;span class="na"&gt;png&lt;/span&gt;&lt;span class="err"&gt;&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If I want to display three images, then &lt;code&gt;pure-u-1-3&lt;/code&gt; will do it. I just altered the original code to add an enclosing &lt;code&gt;&amp;lt;a href&lt;/code&gt; so that we can still access the original image without lossing too much quality (and get the correct sizing). In some cases, images become quite tiny, especially on mobile device. There are certainly a lot of other nifty CSS tricks in this library, but I haven&amp;rsquo;t explore it in depth.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I changed the default fonts. As there is no way to use a Google API to import fonts, I have uploaded a subset of the IBM Plex fonts in WOFF format on my server. I keep control as much as I can, you know. The original idea came from &lt;a href="https://www.rousette.org.uk/about/"&gt;BSAG&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;An internal search engine is now available. Previously, I was relying on DuckDuckGo, but of course it was a patch of some kind, for Hugo has no such functionalities at present. Now, I found a very &lt;a href="https://gist.github.com/eddiewebb/735feb48f50f0ddd65ae5606a1cb41ae"&gt;easy setup&lt;/a&gt; that cost nothing but a few hacks and a small JS file. That&amp;rsquo;s really a big plus for the site, since it provides the reader with a quick way to check for existing content without leaving the site. And this is all good for me: We don&amp;rsquo;t use Google, nor any other hard-coded solution which consists in building a database first, using lot of JS packages, and then update it on a regular basis.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Typesetting mathematical expressions using MathJax is always fun, except when you have to escape underscores followed by bracket. Yes, it sucks, but the version of MathJax I am presently using (2.7.2) just works, while most recent ones would require more hacks than I&amp;rsquo;m willing to accept. In case you wonder, I just added the following requests in my footer partial:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-html" data-lang="html"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;script&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;text/javascript&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;MathJax&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;tex2jax&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;inlineMath&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;$&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;$&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;\\(&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;\\)&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;showProcessingMessages&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;messageStyle&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;none&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;script&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;script&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;text/javascript&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="na"&gt;async&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="na"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;script&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Hopefully, nothing will change for the reader. This is juts that the homepage is now set to point to the flux of my micro-posts, instead of the summary view I used to use beforehand. All posts are listed in reverse chronological order, without any preview of any kind. I just report the publication date and word count. The RSS feed remains the same, but I may eventually remove micro-posts from it since RSS readers may suffer from such noisy activity.&lt;/p&gt;</description></item><item><title>Prettify your Emacs (bis)</title><link>https://aliquote.org/post/pretty-emacs/</link><pubDate>Wed, 18 Sep 2019 21:59:15 +0200</pubDate><guid>https://aliquote.org/post/pretty-emacs/</guid><description>&lt;p&gt;Lately I have spent a fair amount of time tweaking my (Doom) Emacs config to make it look the way I want it to.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I care about how my editor looks because I stare at it all day. How could I not care deeply about how it looks? &amp;mdash; &lt;a href="https://www.baty.net/2019/how-my-editor-looks-is-important-to-me/"&gt;Jack Baty&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I do care as well, especially since I spend nearly 70% of my &amp;ldquo;computing time&amp;rdquo; in front of this editor.&lt;/p&gt;
&lt;p&gt;Now, when I see the number of new commits since the last time I fetched the develop branch of Doom Emacs on my HD, I just want to cry. It is just scary as it might break a lot of things that are currently working (mainly Python and Lisp/Scheme stuff), and I wonder if there is a point in updating as frequently as I did in the past. Last update went with a complete rework of the package management (&lt;a href="https://github.com/raxod502/straight.el"&gt;straight&lt;/a&gt;) system, for example. Even with a complete backup of my &lt;code&gt;.emacs.d&lt;/code&gt;, it took me more time than expected to get my Emacs up again. And, of course, I forgot to save the &lt;code&gt;.local/cache&lt;/code&gt; directory where a lot of useful stuff is stored&amp;hellip;&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-09-18-21-58-09.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Anyway, let&amp;rsquo;s see how it goes. For the time being, I will definitely stay with my current config, as I find it definitely satisfactory after months of fighting with LSP servers and Org mode. I know I will probably change my mind in the next few weeks, but anyway, here are the good parts of my hacking time, which closely follows my &lt;a href="https://aliquote.org/post/enliven-your-emacs/"&gt;earlier post&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;First, I removed &lt;code&gt;org-ref&lt;/code&gt; &amp;mdash; I wasn&amp;rsquo;t really using it, in fact I just need to be able to manage a BibTeX file (read search/edit/annotate), and I am now using Pandoc syntax to include references in Org document. For example, &lt;code&gt;@johndoe2011&lt;/code&gt; should read &amp;ldquo;John Doe (2011). The infamous article that nobody reads. The fucking Journal, vol (#): pp&amp;rdquo; when exported as HTML or PDF. Otherwise, I don&amp;rsquo;t really care since I can use &lt;code&gt;ivy-bibtex&lt;/code&gt; and look for the reference. The same function (&lt;code&gt;ivy-bibtex&lt;/code&gt;) allows me to find and open any BibTeX entry, to annotate it as well, or to insert a plain text reference or the bibtex key in my current buffer, be it an Org or a Markdown file. This is generally all I need to do, after all. Back to our subject, as I removed the &lt;code&gt;org-ref&lt;/code&gt; package, I needed a way to highlight Pandoc-like citation in any Org file I am currently editing. Easy peasy, here is one way to do it: (and here is &lt;a href="https://emacs.stackexchange.com/a/52390"&gt;another way&lt;/a&gt;)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-emacs-lisp" data-lang="emacs-lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;font-lock-add-keywords&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;org-mode&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;@[a-z]+.+?[^;,.]+&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="nv"&gt;font-lock-keyword-face&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is basically how it looks:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-09-18-23-00-40.png"&gt;
&lt;/figure&gt;
&lt;p&gt;I should note that I follow strict rules when generating BibTeX keys, which simplifies the construction of the above regex (which should stop whenever we encouter a semi-colon, a comma or a period):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-emacs-lisp" data-lang="emacs-lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;setq&lt;/span&gt; &lt;span class="nv"&gt;bibtex-field-delimiters&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;double-quotes&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;bibtex-autokey-year-length&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;bibtex-autokey-name-year-separator&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;-&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;bibtex-autokey-year-title-separator&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;-&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;bibtex-autokey-titleword-separator&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;-&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;bibtex-autokey-titlewords&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;bibtex-autokey-titlewords-stretch&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;bibtex-autokey-titleword-length&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Second, I don&amp;rsquo;t really like the way &lt;code&gt;≤&lt;/code&gt; and &lt;code&gt;≥&lt;/code&gt; are rendered when using the patched Iosevka font. The symbols look too streched (horizontally), and I much prefer slanted version. As I said in my &lt;a href="https://aliquote.org/post/enliven-your-emacs/"&gt;earlier post&lt;/a&gt;, I updated the default list of symbols (&lt;code&gt;+pretty-code-iosevka-font-ligatures&lt;/code&gt;) using basic &lt;code&gt;setq&lt;/code&gt;. However, new settings will not override default settings, so I decided to manage the &lt;code&gt;+iosevka.el&lt;/code&gt; file myself, and commented out the default values I didn&amp;rsquo;t like. I know this is sort of a ugly hack, but this way I can keep things in control at the very least.&lt;/p&gt;
&lt;p&gt;The same happens for Magit nice &lt;code&gt;list-repository&lt;/code&gt; utility. Why not adding some fancy Unicode character in place of plain text column headers? A little &lt;code&gt;(setq magit-repolist-columns ...)&lt;/code&gt;, and we are done.&lt;/p&gt;
&lt;p&gt;Also, I added some (ya)snippets for the git commit popup, namely &lt;code&gt;wip&lt;/code&gt; (work in progress), &lt;code&gt;cos&lt;/code&gt; (cosmit changes), &lt;code&gt;fix&lt;/code&gt; (minor fix) and &lt;code&gt;doc&lt;/code&gt; (add doc). Do we need any other headline when we wok-rk alone? This basically mimics what I already have as Git aliases in my Git config files. Very handy in any case.&lt;/p&gt;
&lt;p&gt;Last, I managed to reafctor all my Org files so that I now have a set of public files that I can push to Github, as well as private files (daily log book and work-related todos files), and a set of public notes that I may probably publish on Github at some point:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;~/org (master|✚2)  tree
├── drafts
│   ├── _assets
│   │   ├── github.css
│   │   └── worg.css
│   ├── _img
│   │   ├── ch1-Z-G-13.gif
│   │   ├── fig-emacs-markdown-mode.png
│   │   ├── fig-emacs-screenshot.png
│   │   └── fig-sam-format.png
│   ├── drafts.org
│   ├── emacs-lisp.org
│   ├── fp-notes.org
│   ├── impatient-emacs.org
│   ├── ngs.org
│   ├── number-theory.org
│   ├── phylo.org
│   ├── src
│   │   ├── ackerman.pas
│   │   ├── echange.pas
│   │   ├── fibonacci.pas
│   │   ├── gauss.c
│ --%&amp;lt;--------------
│   │   ├── test.db
│   │   ├── test_perms.pas
│   │   ├── testfloat.c
│   │   ├── trinome.pas
│   │   └── trinome2.c
│   └── unix-one-liner.org
├── local
│   ├── diary.org
│   ├── log.org
│   └── todos.org
├── micro.org
├── notebook.org
├── old-notes.org
├── papers.org
├── quickies.org
├── references.bib
├── refile.org
└── urls.org
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;small&gt;(Yes, I know, Turbo Pascal files are very, very old school.)&lt;/small&gt;&lt;/p&gt;</description></item><item><title>Micro review from September (2)</title><link>https://aliquote.org/post/micro-review-003/</link><pubDate>Sat, 14 Sep 2019 08:51:17 +0200</pubDate><guid>https://aliquote.org/post/micro-review-003/</guid><description>&lt;p&gt;Here is the monthly micro review of (not so) random links I found while browsing the interweb lately.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="http://kroah.com/log/blog/2019/08/14/patch-workflow-with-mutt-2019/"&gt;Patch Workflow With Mutt - 2019&lt;/a&gt;. Even if I am not using Mutt for reading/writing emails (and I no longer have that many emails to read/write these days), I always find interesting to read others&amp;rsquo; approach to email processing. This is a good read, full of interesting ideas (and not only re. GTD). In the same spirit, I like reading posts about Emacs and Org. Soon or later, they will end up on &lt;a href="https://irreal.org/blog/"&gt;Irreal blog&lt;/a&gt;, so I just have to check my RSS feeds from time to time. Or I may happen to find ones myself, e.g., &lt;a href="http://zerolib.com/journaling-procedure.html"&gt;A Daily Journal in Org Mode&lt;/a&gt;. John Jacobsen&amp;rsquo;s website and Github repository is full of good ideas and tips that I like to read when I have some free time. And guess what? This site was done using Org mode (and &lt;a href="https://github.com/eigenhombre/organa"&gt;a bit of Clojure&lt;/a&gt;). This site is not just about programming (e.g., &lt;a href="https://github.com/eigenhombre/rosalind/blob/master/src/rosalind/core.clj"&gt;l.26-97&lt;/a&gt; if you ever try to solve &lt;a href="http://rosalind.info/"&gt;Rosalind&lt;/a&gt; problems), though; see, e.g.: &lt;a href="http://zerolib.com/daily-composition-lessons-learned.html"&gt;Reflections on a Year of Daily Memory Drawings&lt;/a&gt;&amp;mdash;lovely, isn&amp;rsquo;t it?&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://beautifulracket.com/appendix/thoughts-on-racket2.html"&gt;Thoughts on Racket2&lt;/a&gt;. A few weeks ago I mentioned some hot news from the latest Racket conf, namely the fact that the next-gen Racket (aka Racket2?) will probably be parenthesis-free. Matthew Butterick has a much more detailed overview of the points raised by Matthew Flatt, and he has some very on the point thoughts on the future of Lisp languages.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;gt; In the case of Lisp languages like Racket, Matthew Flatt is right: among a certain audience of potential users, parentheses are a deterrent. Who knows why? But in the last 60 years, simply grabbing these dissenters by the lapels and fumigating them with the stinky garlic breath of parenthesized S-expressions has not been a winning strategy. If Lisp partisans want different results in the next 60 years, we need to try something new.
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://dvc.org"&gt;DVC&lt;/a&gt; is the new Git for Machine Learning projects. This sounds cool, and I will try it as soon as the opportunity arises. In the past, I have used various strategies for dealing with large files (mostly ending up in the &lt;code&gt;.gitgnore&lt;/code&gt;), getting rid of IPython notebooks output (removed from Git versioning using &lt;a href="https://github.com/kynan/nbstripout"&gt;nbstripout&lt;/a&gt;), or managing dependencies (&lt;a href="https://rstudio.github.io/packrat/"&gt;packrat&lt;/a&gt; in R, virtual environments using &lt;a href="https://docs.python.org/3/library/venv.html"&gt;pyvenv&lt;/a&gt; in Python). This project apparently brings an extra dose of control while putting the emphasis on sharing and reproducibility.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Back when I was teaching applied biostatistics, I used to use some falied attempts by geneticians and/or bioinformaticians at using Excel to store their results (remember the DEC1 story or that paper where authors mistakenly deduplicated their data?). Now, I just found this: &lt;a href="https://www.sciencemag.org/news/2016/08/one-five-genetics-papers-contains-errors-thanks-microsoft-excel"&gt;One in five genetics papers contains errors thanks to Microsoft Excel&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Today I learned about &lt;a href="https://codeberg.org"&gt;Codeberg&lt;/a&gt;, thanks to &lt;a href="https://jlelse.blog/links/2019/09/codeberg/"&gt;Jan-Lukas Else&lt;/a&gt;. This apparently is a serious alternative to Github or Gitlab, or even self-hosted Gitea instances. I do not want to switch to another Git platform&amp;mdash;I&amp;rsquo;ve heard a lot about &lt;a href="https://sourcehut.org"&gt;sourcehut&lt;/a&gt; recently, but it looks like people always complains about Github, and finally end up being there anyway. Next to this, Jan-Lukas had have several other interesting posts in the recent weeks, including one on &lt;a href="https://github.com/schollz/rwtxt"&gt;rwtxt&lt;/a&gt;, a CMS for absolute minimalists, or &lt;a href="https://indieweb.org/Webmention"&gt;webmentions&lt;/a&gt;, which I wish I used when I began this blog.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Alexis King posted a new blog entry, and it is a beautiful piece of work on &lt;a href="http://lexi-lambda.github.io/blog/2019/09/07/demystifying-monadbasecontrol/?utm_source=all&amp;amp;utm_medium=RSS"&gt;Monad transformers&lt;/a&gt; and Haskell. Even if I have some hard time to follow or understand everything, I would highly recommend this post to people interested in FP, and Haskell specifically. My experience with reading ALexis&amp;rsquo;s posts, especially those that relate to Racket, is that you will always learn something, or discover new facets to questions you thought you had solved. &lt;a href="http://www.pragma-ade.com/general/manuals/details.pdf"&gt;It&amp;rsquo;s in the details&lt;/a&gt; (PDF), as &lt;a href="http://www.pragma-ade.com"&gt;they&lt;/a&gt; used to say.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://defn.io/2019/09/05/racket-generators/"&gt;Generators from Scratch&lt;/a&gt; is all about Python and Racket generators, one of the powerful machinery of Python, together with list comprehensions and &lt;a href="https://docs.python.org/3/library/itertools.html"&gt;itertools&lt;/a&gt; module. As you may have already guessed, Racket also comes equipped with generators, but also the &lt;a href="https://stackoverflow.com/q/22888722"&gt;&lt;code&gt;call/cc&lt;/code&gt;&lt;/a&gt;, which stands for &lt;a href="http://www.madore.org/~david/programs/unlambda/#callcc"&gt;call with current continuation&lt;/a&gt;.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; There is a little video at the end of the post, where Bogdan Popa uses the Racket debugger under Emacs to illustrate all this. It is quite short, so don&amp;rsquo;t be afraid to sit down and learn a bit more about Racket internals.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://bradleytaunt.com/plain-text-emails/"&gt;Plain Text Emails, Please&lt;/a&gt;. I have always thought about plain text emails as a way to avoid malicious code lurking into HTML divs, or simply to avoid all the fuzz about mail readers&amp;mdash;notwithsanding the fact that it was way harder to process HTML emails under Emacs or Mutt several years ago. Apparently, there are other reasons why HTML emails became so popular, as Bradley Taunt explained.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;gt; Plain text can certainly have a reputation for looking lazy or cheap, but I feel this is mostly perpetuated in the design and marketing communities. I can assure you that your average day-to-day users are much less opinionated about your email campaign design than you are. Look to satisfy your customers’ needs before your own.
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;Blog rolling&lt;/em&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://feedproxy.google.com/~r/TheEndeavour/~3/zpg4Q-hjzDo/"&gt;How UTF-8 works&lt;/a&gt;, on John Cook&amp;rsquo;s blog: Nice exposition of UTF-8 internals; see also the related post: &lt;a href="http://feedproxy.google.com/~r/TheEndeavour/~3/RrngOUWdZoU/"&gt;Excel, R and Unicode&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Some useful tips and tricks on &lt;a href="https://leancrew.com/all-this/2019/09/brace-yourself-im-in-an-expansive-mood/"&gt;brace expansion in Bash/Zsh&lt;/a&gt;, by Dr. Drang.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dataorigami.net/blogs/napkin-folding/non-parametric-survival-function-prediction"&gt;Non-parametric survival function prediction&lt;/a&gt;, by Cameron Davidson-Pilon, or how to improve the use of neural networks to predict survival functions.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://alex-hhh.github.io/2019/09/map-snip.html?utm_source=all&amp;amp;utm_medium=RSS"&gt;Interactive Maps in the DrRacket REPL&lt;/a&gt;. Another nice post by Alex Harsányi, again on Racket and how to foster the graphical capabilities of its IDE, &lt;a href="https://docs.racket-lang.org/drracket/"&gt;DrRacket&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;I realize that I have been following David Madore&amp;rsquo;s weblog for years, but I never found a good occasion to cite one of his post or webpage on this site. Accomplishment unlocked!&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Coin tossing experiment: Score and Wald tests</title><link>https://aliquote.org/post/coin-tossing-experiment/</link><pubDate>Fri, 13 Sep 2019 17:33:21 +0200</pubDate><guid>https://aliquote.org/post/coin-tossing-experiment/</guid><description>&lt;p&gt;I was recently re-reading Polanski &amp;amp; Kimmel&amp;rsquo;s nice book, &lt;em&gt;Bioinformatics&lt;/em&gt;, where the very first chapters are dedicated to mathematical statistics.&lt;/p&gt;
&lt;p&gt;I have a French translation lying in one of the &lt;a href="https://aliquote.org/cours/stats_bioinfo/stats.pdf"&gt;obscure folder&lt;/a&gt; of this website. Coin tossing experiments are a fun way to introduce some concepts related to mathematical statistics or hypothesis testing. Here is how the three common test statistics (Wald, Score and Likelihood Ratio) relate one to the other.&lt;/p&gt;
&lt;p&gt;Let us first focus on estimating a parameter of interest, in this case the probability of observing a tail in a serie of independant draws. First, some notation. We will consider a random experiment composed of $n$ independant trials, where $\theta = \Pr(\text{&amp;lsquo;&amp;rsquo;the result is tail&amp;rsquo;&amp;rsquo;})$ is the parameter of interest. In other word, we would like to find a good estimator for the probability of observing such a result. We observe&lt;/p&gt;
&lt;p&gt;$$
\begin{cases}
Y_i = 1 &amp;amp; \text{if the }i\text{th trial is tail}, \newline
Y_i = 0 &amp;amp; \text{otherwise},
\end{cases}
$$&lt;/p&gt;
&lt;p&gt;such that $Y_i\sim\mathcal{B}(1,\theta)$, where $\mathcal{B}$ is a Bernoulli distribution with parameter 1 and $\theta$. We want an estimator $\hat\theta$. Beforehand, we could compute the Fisher information and the MLE $\hat\theta$ of $\theta$. We just need the likelihood function for a single observation, which reads:&lt;/p&gt;
&lt;p&gt;$$ \tilde f(y_i;\theta) = \theta^{y_i}(1-\theta)^{1-y_i}. $$&lt;/p&gt;
&lt;p&gt;Whence we have&lt;/p&gt;
&lt;p&gt;$$ \log \tilde f(y_i;\theta) = y_i\log\theta + (1-y_i)\log(1-\theta), $$&lt;/p&gt;
&lt;p&gt;and&lt;/p&gt;
&lt;p&gt;$$
\begin{align}
\frac{\partial \log \tilde f(y_i;\theta)}{\partial \theta} &amp;amp; = \frac{y_i}{\theta} - \frac{1-y_i}{1-\theta} \newline
&amp;amp; = \frac{y_i-\theta}{\theta(1-\theta)}
\end{align}
$$&lt;/p&gt;
&lt;p&gt;This last expression should sound familiar as it is just the difference between the observed value and the parameter, normalized by its variance (think of usual test statistic like Student&amp;rsquo;s t, except that in this case we are only considering a single observation). Meanwhile, notice that the score vector is centered since $\mathbb{E}(Y_i) = 1\times\theta + 0\times(1-\theta) = \theta$. Hence, the Fisher information is just the variance of the score vector:&lt;/p&gt;
&lt;p&gt;$$
\begin{align}
\tilde I(\theta) &amp;amp; = \mathbb{V}\left( \frac{\partial \log \tilde f(y_i;\theta)}{\partial \theta} \right) \newline
&amp;amp; = \mathbb{V}\left( \frac{Y_i-\theta}{\theta(1-\theta)} \right) \newline
&amp;amp; = \frac{1}{\big( \theta(1-\theta) \big)^2}\mathbb{V}(Y_i-\theta) \newline
&amp;amp; = \frac{1}{\theta(1-\theta)},, \text{since }\mathbb{V}(Y_i) = \theta(1-\theta).
\end{align}
$$&lt;/p&gt;
&lt;p&gt;Now let&amp;rsquo;s focus on $\hat\theta$. We need the log likelihood for all observations:&lt;/p&gt;
&lt;p&gt;$$ L_n(\theta) = \sum_{i=1}^n \log \tilde f(y_i;\theta) = \sum_{i=1}^n y_i\log\theta + (1-y_i)\log(1-\theta). $$&lt;/p&gt;
&lt;p&gt;Its first derivative is easily computed as follows:&lt;/p&gt;
&lt;p&gt;$$
\begin{align}
\frac{\partial L_n(\theta)}{\partial \theta} &amp;amp; = \sum_{i=1}^n \frac{\partial}{\partial \theta}\log \tilde f(y_i;\theta) \newline
&amp;amp; = \sum_{i=1}^n \frac{y_i-\theta}{\theta(1-\theta)} \newline
&amp;amp; = \frac{\left( \sum_{i=1}^n y_i \right) - n\theta}{\theta(1-\theta)},
\end{align}
$$&lt;/p&gt;
&lt;p&gt;and it can be checked that $\frac{\partial L_n(\theta)}{\partial \theta}\big|_{\hat\theta} = 0$, where $\hat\theta = \sum_{i=1}^n y_i/n$ &amp;mdash; the empirical frequency of tails. Now, let $H_0$ be the null hypothesis according to which $\theta = \frac{1}{2}$. It is then possible to compute three different test statistics. Notice that this hypothesis can be rewritten as $H_0:, \theta-\frac{1}{2}=0$, and let&amp;rsquo;s consider the real-valued function $g(\theta) = \theta-\frac{1}{2}$.&lt;/p&gt;
&lt;p&gt;A &lt;em&gt;Wald test&lt;/em&gt; can be constructed as $\xi^W = n(\hat\theta - \frac{1}{2})\tilde I^{-1}(\hat\theta - \frac{1}{2})$, whence upon simplication we have&lt;/p&gt;
&lt;p&gt;$$ \xi^W = \left( \frac{\hat\theta - \frac{1}{2}}{\sqrt{\frac{\hat\theta(1-\hat\theta)}{n}}} \right). \qquad (\star)$$&lt;/p&gt;
&lt;p&gt;Under $H_0$, $\xi^W \to_l \chi^2(1)$ and the 5% critical region is approximately $W = \{\xi^W \geq 4\} = \{\star \geq 2\}$.&lt;/p&gt;
&lt;p&gt;In the case of the score test, the test statistic reads&lt;/p&gt;
&lt;p&gt;$$ \xi^S = \frac{1}{n}\frac{\partial}{\partial \theta&amp;rsquo;}L_n(\hat\theta^0)\hat I^{-1}(\hat\theta^0)\frac{\partial}{\partial \theta}L_n(\hat\theta^0). $$&lt;/p&gt;
&lt;p&gt;In this case, $\theta&amp;rsquo;$ means that we took the transposed vector. We are also considering $\hat\theta^0=\frac{1}{2}$, as in $H_0$. Whence we have&lt;/p&gt;
&lt;p&gt;$$ \frac{\partial}{\partial\theta}L_n = \sum_{i=1}^n\frac{y_i-\hat\theta^0}{\hat\theta^0(1-\hat\theta^0)}. $$&lt;/p&gt;
&lt;p&gt;Our test statistic becomes:&lt;/p&gt;
&lt;p&gt;$$
\begin{align}
\xi^S &amp;amp; = \frac{1}{n}\left( \frac{\left( \sum_i y_i \right) - n\hat\theta^0}{\hat\theta^0(1-\hat\theta^0)}\right)^2 \hat\theta^0(1-\hat\theta^0) \newline
&amp;amp; = n\frac{\left( \sum_i - \hat\theta^0 \right)^2}{\hat\theta^0(1-\hat\theta^0)} \newline
&amp;amp; = \left( \frac{\hat\theta - \frac{1}{2}}{\sqrt{\frac{\frac{1}{2}\left(1-\frac{1}{2}\right)}{n}}} \right)^2
\end{align}
$$&lt;/p&gt;
&lt;p&gt;Under $H_0$, we also have $\xi^S \to_l \chi^2(1)$. However, while in the case of the Wald test we evaluated the test statistic under the general model, in the case of the score test we work directly under the null model for estimating $\hat\theta$.&lt;/p&gt;
&lt;p&gt;Finally, the likelihood ratio test is probably simpler to formulate since we only need the log likelihood at $\hat\theta$ and $\hat\theta^0$, and we have $\xi^R = 2\left(L_n(\hat\theta)-L_n(\hat\theta^0)\right)$. Thus we have:&lt;/p&gt;
&lt;p&gt;$$
\begin{align}
\xi^R &amp;amp; = 2\left[ \sum_i (y_i)\log\hat\theta + \left(n-\sum_i y_i \right)\log(1-\hat\theta) \right.\newline
&amp;amp; \phantom{\qquad} \left. - \left( \sum_i y_i \right)\log\frac{1}{2} + \left( n-\sum_i y_i \right)\log\left(1-\frac{1}{2}\right) \right] \newline
&amp;amp; = 2 \left[ \left( \sum_i y_i \right)\log\left( \frac{\hat\theta}{\frac{1}{2}} \right) + \left( n-\sum_i y_i \right)\log\left( \frac{1-\hat\theta}{1-\frac{1}{2}} \right) \right]
\end{align}
$$&lt;/p&gt;
&lt;p&gt;Again, we have the same asymptotic chi-squared convergence property.&lt;/p&gt;</description></item><item><title>Perfect and amicable numbers</title><link>https://aliquote.org/post/perfect-or-amicable-numbers/</link><pubDate>Thu, 12 Sep 2019 08:55:52 +0200</pubDate><guid>https://aliquote.org/post/perfect-or-amicable-numbers/</guid><description>&lt;p&gt;In which we talk about perfect numbers and amicable pairs. This is somewhat related to problems raised on the Euler project and the Exercism coding track. This also once motivated the name of this site.&lt;/p&gt;
&lt;p&gt;A &lt;em&gt;perfect number&lt;/em&gt; is a positive integer that is equal to the sum of its positive divisors, excluding the number itself, which also means such a number is equal to its &lt;a href="https://en.wikipedia.org/wiki/Aliquot_sum"&gt;aliquot sum&lt;/a&gt;. Perfect numbers can further be classified as deficient or abundant, and in &lt;a href="https://en.wikipedia.org/wiki/Perfect_number"&gt;many other ways&lt;/a&gt;. What really matters, though, is that all even perfect numbers can be expressed as $N=2^{p-1}(2^p-1)$, where $p$ is a prime number for which $2^p-1$ is a &lt;a href="http://mathworld.wolfram.com/MersennePrime.html"&gt;Mersenne prime&lt;/a&gt;. Finally, &lt;a href="https://en.wikipedia.org/wiki/Amicable_numbers"&gt;amicable numbers&lt;/a&gt; are also interesting since they involved &lt;a href="http://djm.cc/amicable.html"&gt;proper divisors&lt;/a&gt;: indeed, they are defined so that the sum of the proper divisors of each is equal to the other number. They also form an aliquot sequence of period 2.&lt;/p&gt;
&lt;p&gt;It is quite easy to compute the sum of divisors using recursion or list comprehension in Python or Racket. Here is one way in Racket:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;divisor-sum&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;for/sum&lt;/span&gt; &lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;in-range&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;add1&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;quotient&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)))]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;#:when&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;zero?&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;remainder&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="https://stackoverflow.com/a/23711209"&gt;Another solution&lt;/a&gt; involving a &lt;code&gt;for/fold&lt;/code&gt; form has been proposed on SO. Now, deciding on whether a given number is perfect or not is just a matter of a &lt;code&gt;cond&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;perfect?&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;divs&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;divisor-sum&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;cond&lt;/span&gt; &lt;span class="p"&gt;[(&lt;/span&gt;&lt;span class="nb"&gt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="n"&gt;divs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="ss"&gt;perfect&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;[(&lt;/span&gt;&lt;span class="nb"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="n"&gt;divs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="ss"&gt;deficient&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="ss"&gt;abundant&lt;/span&gt;&lt;span class="p"&gt;])))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;What about amicable numbers, then? Since we already have &lt;code&gt;divisor-sum&lt;/code&gt;, we can just use a simple test:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;amicable?&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;divisor-sum&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;and&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;not&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;divisor-sum&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Whence an amicable pair $(m,n)$ satisfies &lt;code&gt;(= m (divisor-sum n))&lt;/code&gt; and &lt;code&gt;(= n (divisor-sum m))&lt;/code&gt;, provided $m\neq n$. If you substitute the preceding boolean return value with a sum, like suggested by &lt;a href="https://stackoverflow.com/a/23711209"&gt;Chris Jester-Young&lt;/a&gt; over at SO, then you get &amp;ldquo;amicable peers&amp;rdquo; which allows to screen for amicable pairs in between predefined bounds:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;amicable-peer&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;divisor-sum&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;and&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;not&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;divisor-sum&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;amicable-pairs-between&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;for*/list&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;in-range&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;add1&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;peer&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;in-value&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;amicable-peer&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;#:when&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;and&lt;/span&gt; &lt;span class="n"&gt;peer&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="n"&gt;peer&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="n"&gt;peer&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cons&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="n"&gt;peer&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;List comprehensions in Racket are really great, aren&amp;rsquo;t they? Finally, a little &lt;code&gt;apply&lt;/code&gt; can be used to find the sum of all amicable numbers under 10000:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pair-sum&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;car&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cdr&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;apply&lt;/span&gt; &lt;span class="nb"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;for/list&lt;/span&gt; &lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;elt&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;in-list&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;amicable-pairs-between&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;10000&lt;/span&gt;&lt;span class="p"&gt;))])&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pair-sum&lt;/span&gt; &lt;span class="n"&gt;elt&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Prettify your Emacs</title><link>https://aliquote.org/post/enliven-your-emacs/</link><pubDate>Wed, 11 Sep 2019 14:48:31 +0200</pubDate><guid>https://aliquote.org/post/enliven-your-emacs/</guid><description>&lt;p&gt;Here are a few tips to brighten up your symbols in Emacs.&lt;/p&gt;
&lt;p&gt;As I am using Doom Emacs, there is now a nice option to use Iosevka with full support for ligatures. Note, however, that you will need to install a &lt;a href="https://github.com/hlissner/doom-emacs/issues/695"&gt;patched version of Iosevka&lt;/a&gt;, which may not harm your system or other configuration: I use the standard Inziu Iosevka CL in a terminal, and the patched Iosevka in GUI Emacs. Once the font is installed, it is just a matter of adding &lt;code&gt;(pretty + iosevka)&lt;/code&gt; to your &lt;code&gt;init.el&lt;/code&gt; to get &lt;code&gt;pretiffy-mode&lt;/code&gt; in all programming modes, with correct ligatures. The same option is available for Fira Code but I haven&amp;rsquo;t tested it, though.&lt;/p&gt;
&lt;p&gt;Now, if you want to add some custom symbols in the &lt;code&gt;prettify-symbols-alist&lt;/code&gt; variable like, e.g., Eric Kaschalk did (&lt;a href="http://www.modernemacs.com/post/prettify-mode/"&gt;Mathematical notation in Emacs&lt;/a&gt;), you could simply use his approach or the one below (which is what I used to use in Spacemacs a few months ago):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-emacs-Lisp" data-lang="emacs-Lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defun&lt;/span&gt; &lt;span class="nv"&gt;my/pretty-symbols&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;setq&lt;/span&gt; &lt;span class="nv"&gt;prettify-symbols-alist&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;lambda&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="mi"&gt;955&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;-&amp;gt;&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="mi"&gt;8594&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;=&amp;gt;&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="mi"&gt;8658&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;map&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="mi"&gt;8614&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&amp;lt;=&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="mi"&gt;8804&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&amp;gt;=&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="mi"&gt;8805&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&amp;lt;-&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="mi"&gt;8592&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;!=&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="mi"&gt;8800&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;add-hook&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;clojure-mode-hook&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;my/pretty-symbols&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;add-hook&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;racket-mode-hook&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;my/pretty-symbols&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;add-hook&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;ess-mode-hook&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;my/pretty-symbols&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Most of the above has become useless since &lt;code&gt;modules/ui/pretty-code/+iosevka.el&lt;/code&gt; in your &lt;code&gt;.emacs.d&lt;/code&gt; directory handles this for you. However, &lt;code&gt;+pretty-code-iosevka-font-ligatures&lt;/code&gt; is a&lt;code&gt;defvar&lt;/code&gt;, which means you cannot update its default values unless you append to it using a &lt;code&gt;setq&lt;/code&gt;. This is what I finally did, and it went quite smoothly. I also use a &lt;a href="https://blog.jft.rocks/emacs/unicode-for-orgmode-checkboxes.html"&gt;nice trick&lt;/a&gt; found on one of Huy Tran&amp;rsquo;s websites,&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; namely replacing Org checkboxes with Unicode characters. By the way, you may also like his other posts on Emacs, for example &lt;a href="https://blog.jft.rocks/emacs/emacs-from-scratch.html"&gt;Emacs from scratch&lt;/a&gt;. Other types of customization are discussed on &lt;a href="https://emacs.stackexchange.com/a/45304"&gt;SO&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Here is finally what I added to my &lt;code&gt;config.el&lt;/code&gt; file:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-emacs-lisp" data-lang="emacs-lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; Best with custom Iosevka font. See, e.g., https://is.gd/L67AoR&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;setq&lt;/span&gt; &lt;span class="nv"&gt;+pretty-code-enabled-modes&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;emacs-lisp-mode&lt;/span&gt; &lt;span class="nv"&gt;org-mode&lt;/span&gt; &lt;span class="nv"&gt;clojure-mode&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;latex-mode&lt;/span&gt; &lt;span class="nv"&gt;scheme-mode&lt;/span&gt; &lt;span class="nv"&gt;racket-mode&lt;/span&gt; &lt;span class="nv"&gt;ess-r-mode&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;setq&lt;/span&gt; &lt;span class="nv"&gt;highlight-indent-guides-responsive&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;top&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;highlight-indent-guides-delay&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; Org and R additional symbols&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; hex code ▷ (9655), ◇ (9671), ▶ (9654), ƒ (402)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;setq&lt;/span&gt; &lt;span class="nv"&gt;+pretty-code-iosevka-font-ligatures&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt; &lt;span class="nv"&gt;+pretty-code-iosevka-font-ligatures&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;[ ]&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;☐&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;[X]&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;☑&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;[-]&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;❍&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%&amp;gt;%&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="sc"&gt;?▷&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%$%&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="sc"&gt;?◇&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;%T&amp;gt;%&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="sc"&gt;?▶&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;function&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="sc"&gt;?ƒ&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; https://is.gd/3VuSXj&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defface&lt;/span&gt; &lt;span class="nv"&gt;org-checkbox-done-text&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="no"&gt;t&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;:foreground&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;#5a637b&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;Face for the text part of a checked org-mode checkbox.&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;font-lock-add-keywords&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;org-mode&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;^[ \t]*\\(?:[-+*]\\|[0-9]+[).]\\)[ \t]+\\(\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\[\\(?:X\\|\\([0-9]+\\)/\\2\\)\\][^\n]*\n\\)&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;org-checkbox-done-text&lt;/span&gt; &lt;span class="nv"&gt;prepend&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="ss"&gt;&amp;#39;append&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; (custom-set-faces &amp;#39;(org-checkbox ((t (:foreground nil :inherit org-todo)))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you want to highlight checkboxes using the same color as your TODO header, uncomment the last line.&lt;/p&gt;
&lt;p&gt;Overall, I found that my daily log book looks much prettier now.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-09-11-15-36-04.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Likewise, here is some R code stolen from the &lt;a href="https://magrittr.tidyverse.org"&gt;magrittr&lt;/a&gt; website and the pipe chapter of &lt;a href="https://r4ds.had.co.nz/pipes.html"&gt;R for data science&lt;/a&gt; &amp;ndash; which doesn&amp;rsquo;t mean I became a fan of using pipes in R, but let&amp;rsquo;s pretend we have a decent unicode replacement for &lt;code&gt;%&amp;gt;%&lt;/code&gt;, &lt;code&gt;%T&amp;gt;%&lt;/code&gt;, and the like:&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-09-11-15-40-16.png"&gt;
&lt;/figure&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;I also found a similar suggestion on &lt;a href="https://emacs.stackexchange.com/a/33402"&gt;SO&lt;/a&gt;.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;I&amp;rsquo;m reluctant to use arrow-like operators from Haskell.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Micro review from September</title><link>https://aliquote.org/post/micro-review-002/</link><pubDate>Fri, 06 Sep 2019 09:47:59 +0200</pubDate><guid>https://aliquote.org/post/micro-review-002/</guid><description>&lt;p&gt;Here is the monthly micro review of (not so) random links I found while browsing the interweb lately.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.well-typed.com/blog/2019/09/announcing-the-optics-library/"&gt;Announcing the optics library&lt;/a&gt;. I must say I&amp;rsquo;m no expert at Haskell or category theory, yet I keep reading &lt;a href="https://aliquote.org/post/category-theory/"&gt;articles and books&lt;/a&gt; on those topics. This Haskell package is all about defining and using &lt;a href="https://en.wikibooks.org/wiki/Haskell/Lenses_and_functional_references"&gt;lenses&lt;/a&gt; (also known as &lt;a href="https://www.schoolofhaskell.com/school/to-infinity-and-beyond/pick-of-the-week/a-little-lens-starter-tutorial"&gt;functional references&lt;/a&gt;), traversals, prisms and other &lt;a href="https://medium.com/@gcanti/introduction-to-optics-lenses-and-prisms-3230e73bfcfe"&gt;optic kinds&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://github.com/bbatsov/emacs-lisp-style-guide/blob/master/README.md"&gt;The Emacs Lisp Style Guide&lt;/a&gt;. At least, there&amp;rsquo;s now a short and concise cheatsheet for Elisp!&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://alhassy.github.io/TypedLisp/"&gt;Typed Lisp, A Primer&lt;/a&gt; provides an interesting discussion of the pros and cons of Haskell and Common Lisp with respect to static typing. Give it a read if you&amp;rsquo;re interested in both languages; the post is quite dense, so plan accordingly.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="http://blog.fogus.me/2019/04/03/notes-on-interactive-computing-environments/"&gt;Notes on Interactive Computing Environments&lt;/a&gt;, by Fogus, is a short review of the book written by Barstow, Shrobe, and Sandewall in 1984. You will learn (or be reminded) about quite old software and PLs, and Fogus personal experience with them.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;gt; Your programming environments should be an active partner in the act of creating systems.
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://simon.lc/the-history-of-tetris-randomizers"&gt;The history of Tetris randomizers&lt;/a&gt;. Oh my, I was just remembered that tetris is more than 30 years old now. This post exposes a curated list of Tetris randomizers that were reverse engineered and documented over the years, emphasizing how they improved in terms of puzzle factor, flood prevention, and drought prevention. Apparently, most efforts have focused on the latter two points lately.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://pingouin-stats.org"&gt;pingouin&lt;/a&gt; looks like a nice library to perform common statistical tests in Python. I didn&amp;rsquo;t try it, TBH. But I will! It is a bit different from from scikit-stats, where the focus is more on building statistical models, apparently, but there are interesting features like reliability and circular statistics that are not so common in other Python statistical packages. Quoting the authors:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;gt; Pingouin is designed for users who want simple yet exhaustive stats functions.
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://dev.to/apotheon/openbsd-is-c-documentation-3gd1"&gt;OpenBSD Is C Documentation&lt;/a&gt;: As I&amp;rsquo;m working as a bioinformatician now, I am sometimes tired of checking all related publications to understand the meaning of default parameters here and there in the tools I am supposed to use. Good documentation is the &lt;em&gt;clé du succès&lt;/em&gt; of a good software. You can learn a lot by studying the code available for free in your preferred *nix system (think of &lt;code&gt;cat&lt;/code&gt;, &lt;code&gt;shuffle&lt;/code&gt;, &lt;code&gt;jot&lt;/code&gt;, etc.). And if you&amp;rsquo;re still versed into C, this post will explain why you should take a close look into the OpenBSD documntation.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="http://lisp-univ-etc.blogspot.com/2019/08/programming-algorithms-key-values.html?m=1"&gt;Programming Algorithms: Key-Values&lt;/a&gt;: I have been following this blog for the last few months and it&amp;rsquo;s always nice to see new posts showing up. This post is on data structures, like the preceding ones, and this time the author disusses the broad application of key-values, also called map or dictionnaries in other dynamic PLs. Hash tables, but also trees&amp;ndash;which don&amp;rsquo;t require hashing&amp;ndash;should sound familiar to functional programmers. This post also features a nice overview of memoization and cache invalidation.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://github.com/bambinos/bambi/blob/master/README.md"&gt;bambi&lt;/a&gt;: Yet another Python package for those interested in Bayesian modeling. I haven&amp;rsquo;t tested nor installed the beast&amp;ndash;I tend to be very minimalist these days&amp;ndash;but I would love to see a benchmark of bambi against popular packages available in the Python ecosystem, like PyMC3 or PyStan.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://observablehq.com/@mourner/non-robust-arithmetic-as-art"&gt;Robust Arithmetic in Computational Geometry&lt;/a&gt; is a playground about numeric robustness issues in computational geometry, dealing almost exclusively with orientation tests (how to decide whether a point lie lies to the left or to the right of a line). This is based on an older project in JS which is available on Github: &lt;a href="https://github.com/mikolalysenko/robust-arithmetic-notes"&gt;Robust arithmetic in JavaScript&lt;/a&gt;, but I really enjoy browsing Observable notebooks from time to time.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;Interesting posts&lt;/em&gt; that I&amp;rsquo;ve read lately:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://macwright.org/2019/09/02/recently.html"&gt;Recently&lt;/a&gt; by Tom MacWright, especially his thoughts on the &lt;a href="https://observablehq.com/@tmcw/enigma-machine"&gt;Enigma machine&lt;/a&gt; that he published on Observable.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://brendandawes.com/blog/vim-templates"&gt;The path of least resilience: Using Vim templates&lt;/a&gt;, I use Vim occasionally, which means for quick editing tasks (i.e., when I know I will only have to type some text, like my micro posts or some shell scripts, or even some Python code), but I&amp;rsquo;m definitely an Emacs user; that being said, I always like to see how folks manage to get things done with their preferred text editor.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://increment.com/testing/i-test-in-production/"&gt;I test in prod&lt;/a&gt;: Yeah, what else? More seriously I agree with the author that results gathered from tests when a software is running in real conditions are more interesting, and certainly more trustful, than anything else.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://ferd.ca/clever-functional-design.html"&gt;Clever functional design&lt;/a&gt;: It&amp;rsquo;s always a joy to read one of Fred Hébert&amp;rsquo;s post.&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>RCS 15 years later</title><link>https://aliquote.org/post/rcs-from-15-years/</link><pubDate>Thu, 05 Sep 2019 19:09:07 +0200</pubDate><guid>https://aliquote.org/post/rcs-from-15-years/</guid><description>&lt;p&gt;Remember SVN, or even RCS? Before Git I have been a long-time user of the simplest version control that was available on my Mac, namely &lt;a href="https://en.m.wikipedia.org/wiki/Revision_Control_System"&gt;RCS&lt;/a&gt;. Nowadays, I use mostly Git, but there were times where things were much simpler, yet robust, although we didn&amp;rsquo;t have things such as Github and the like.&lt;/p&gt;
&lt;p&gt;This morning, while I was putting some of my old notes into my Org directory (&lt;a href="https://aliquote.org/micro/2019-09-05-15-37-38"&gt;quite painful&lt;/a&gt; upon reflection), I came across a short tutorial (in French) I wrote on RCS. I could not resits putting a little extract below. Note that it is also available on Github, but in case I change my mind and remove it from there in the future, here it is. (And yes, I converted it again, this time from Org to Markdown!)&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;On se propose d&amp;rsquo;illustrer les différentes commandes vues à propos de RCS dans le cadre de l&amp;rsquo;édition d&amp;rsquo;un petit document en $\LaTeX$. On édite le fichier avec son éditeur préféré, on le compile pour vérifier qu&amp;rsquo;il n&amp;rsquo;y a pas d&amp;rsquo;erreur, puis on le visionne avec &lt;code&gt;xdvi&lt;/code&gt;. Généralement, on répète cette procédure à chaque fois que l&amp;rsquo;on fait des modifications sur le docuemnt, et à mesure que celui-ci grandit on est parfois amené à conserver une partie du document telle quelle et à développer une autre partie, puis à revenir sur l&amp;rsquo;ancienne partie, et cela nécessite de conserver une trace visible des modifications (à moins d&amp;rsquo;avoir une mémoire exceptionnelle). Plusieurs options permettent de gérer ce genre d&amp;rsquo;aléas de l&amp;rsquo;édition de document : on peut passer en commentaire une partie du texte tapé la veille, afin d&amp;rsquo;en conserver une trace, renommer le fichier &lt;code&gt;exemple.tex&lt;/code&gt; en &lt;code&gt;exemple2.tex&lt;/code&gt;, etc. Mais en utilisant RCS, on se passera de ces méthodes manuelles contraignantes, et on bénéficiera d&amp;rsquo;un contrôle des différentes versions du document, i.e. de son &amp;ldquo;évolution temporelle&amp;rdquo;. Tout d&amp;rsquo;abord, on insérera dans un commentaire en tête ou en fin du document l&amp;rsquo;instruction &lt;code&gt;$Header: /home/chl/Documents/work4site/rcs.tut/rcs.txt,v 1.1 2005/08/10 14:19:25 chl Exp chl $&lt;/code&gt;, ce qui donne à peu près ceci dans le source &lt;code&gt;exemple.tex&lt;/code&gt; :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;% $Header: /home/chl/Documents/work4site/rcs.tut/rcs.txt,v 1.1 2005/08/10 14:19:25 chl Exp chl $
\documentclass[a4paper,12pt]{article} \usepackage[latin1]{inputenc}
\usepackage[francais]{babel}
\begin{document}
...
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Ensuite, on dépose la première version du fichier dans l&amp;rsquo;archive RCS à l&amp;rsquo;aide de la commande :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ ci exemple.tex
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Normalement, RCS affiche la suite de messages ci-dessous :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;exemple.tex,v &amp;lt;-- exemple.tex
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;enter description, terminated with single &lt;span class="s1"&gt;&amp;#39;.&amp;#39;&lt;/span&gt; or end of file:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;NOTE: This is NOT the log message!
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;gt;&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Il suffit alors de suivre les instructions indiquées et de donner une plus ou moins brève description du projet à la suite de l&amp;rsquo;invite &lt;code&gt;&amp;gt;&amp;gt;&lt;/code&gt;, puis de valider et de saisir un point &lt;code&gt;.&lt;/code&gt; pour retourner sous le shell. RCS aura crée un fichier &lt;code&gt;exemple.tex,v&lt;/code&gt; (vérifier avec la commande &lt;code&gt;ls&lt;/code&gt;), qui contient les informations de version et le texte du fichier original. Par défaut, la version attribué est la &lt;code&gt;1.1&lt;/code&gt; puisque cela correspond à la &lt;em&gt;racine&lt;/em&gt; du projet.&lt;/p&gt;
&lt;p&gt;Afin de reprendre l&amp;rsquo;édition de notre document, il faut récupérer notre fichier en tapant :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ co exemple.tex
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;(attention, on ne tape pas le nom du fichier tel qu&amp;rsquo;il apparaît dans le répertoire, i.e. &lt;code&gt;exemple.tex,v&lt;/code&gt;)&lt;/p&gt;
&lt;p&gt;On notera que cette fois, l&amp;rsquo;instruction &lt;code&gt;$Header: /home/chl/Documents/work4site/rcs.tut/rcs.txt,v 1.1 2005/08/10 14:19:25 chl Exp chl $&lt;/code&gt; insérée en début de document a été remplacée à présent par &lt;code&gt;$Header: /home/chl/Documents/work4site/rcs.tut/exemple.tex,v 1.1 2005/08/10 11:20:11 chl Exp $&lt;/code&gt; : elle indique le lieu où se trouve le fichier dans l&amp;rsquo;arborescence de votre système, le numéro de version, la date de dernière modification (i.e. en l&amp;rsquo;occurence d&amp;rsquo;archivage), l&amp;rsquo;auteur de la dernière modification et le statut du document (ici &lt;code&gt;Exp&lt;/code&gt;, pour expérimental). Néanmois, si vous essayez d&amp;rsquo;effectuer des modifications sur le document, votre éditeur vous renverra un message d&amp;rsquo;erreur lors de l&amp;rsquo;enregistrement des modifications car le document est verouillé : on peut le lire, le compiler, mais pas modifier son contenu. Pour avoir un accès en écriture au fichier, il faut en fait taper la commande :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ co -l exemple.tex
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Cette fois-ci, RCS indique :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ exemple.tex,v --&amp;gt; exemple.tex
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;revision 1.1 &lt;span class="o"&gt;(&lt;/span&gt;locked&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Le fichier est verrouillé car vous l&amp;rsquo;avez extrait pour modifications. Toute personne qui tenterait de faire la même chose en même temps que vous se verrait ainsi prié d&amp;rsquo;attendre que vous ayez déverouillé l&amp;rsquo;archive. Bien évidemment, lorsque vous travaillez seul, il n&amp;rsquo;est pas très utile d&amp;rsquo;avoir un tel système de contrôle de l&amp;rsquo;édition par l&amp;rsquo;application d&amp;rsquo;un verrou à l&amp;rsquo;enreistrement : vous pouvez dans ce cas taper :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ ci -l exemple.tex
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;lors du dépôt, ce qui vous évitera de taper &lt;code&gt;co -l&lt;/code&gt; à chaque fois que vous souhaiterez rééditer le document. RCS se charge d&amp;rsquo;actualiser le fichier &lt;code&gt;exemple.tex,v&lt;/code&gt; sans détruire le fichier sur lequel vous travaillez. La commande &lt;code&gt;rcs -U&lt;/code&gt; permet également de libérer l&amp;rsquo;accès au fichier, de sorte que l&amp;rsquo;on peut travailler dessus sans le déverouiller au préalable.&lt;/p&gt;
&lt;p&gt;Maintenant, on peut s&amp;rsquo;amuser à rajouter un paragraphe en fin de document, et à effectuer de nouveau l&amp;rsquo;archivage du document pour mettre à jour la version (après modifications, on devrait passer en version 1.2). Après avoir enregistré les modifications, il suffit de taper de nouveau &lt;code&gt;ci exemple.tex&lt;/code&gt;, et on doit voir s&amp;rsquo;afficher :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ exemple.tex,v &amp;lt;-- exemple.tex
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;new revision: 1.2&lt;span class="p"&gt;;&lt;/span&gt; previous revision: 1.1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;enter log message, terminated with single &lt;span class="s1"&gt;&amp;#39;.&amp;#39;&lt;/span&gt; or end of file:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;gt;&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;On indique les modifications apportées à la suite de l&amp;rsquo;invite &lt;code&gt;&amp;gt;&amp;gt;&lt;/code&gt;, on valide et on termine par un point &lt;code&gt;.&lt;/code&gt; ; par exemple :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;gt;&amp;gt; ajout de la section &lt;span class="m"&gt;3&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;gt;&amp;gt; .
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Le fichier original &lt;code&gt;exemple.tex&lt;/code&gt; a été de nouveau convertit en un fichier &lt;code&gt;exemple.tex,v&lt;/code&gt; par RCS, et il est à présent verrouillé dans l&amp;rsquo;archive. Le numéro de version correspondant est bien &lt;code&gt;1.2&lt;/code&gt; : c&amp;rsquo;est la version numéro 2 du tronc, directement dérivée de la racine (version 1.1). On vérifiera également en déverouillant l&amp;rsquo;archive pour édition (&lt;code&gt;co -l exemple.tex&lt;/code&gt;) que le numéro de version a bien été mis à jour dans le source du document.&lt;/p&gt;
&lt;p&gt;Pour visualiser l&amp;rsquo;ensemble des modifications qui ont été réalisées sur le document depuis sa création, il suffit de taper :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ rlog exemple.tex
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Tranches de vie : des frigos</title><link>https://aliquote.org/post/tranches-de-vie/</link><pubDate>Sun, 01 Sep 2019 22:37:45 +0200</pubDate><guid>https://aliquote.org/post/tranches-de-vie/</guid><description>&lt;p&gt;Je prends sans cesse des photos de mon environnement devenu aussi proche que familier, mon appartement, et j&amp;rsquo;ai longtemps pensé tenir un carnet illustré dans lequel je commenterais ce que j&amp;rsquo;aimerais appeler des &amp;ldquo;tranches de vie&amp;rdquo;. Évidemment je n&amp;rsquo;en ai jamais rien fait, alors voici au moins quelques-unes des dites photos.&lt;/p&gt;
&lt;p&gt;Je pose ça là, c&amp;rsquo;est-à-dire ce qui traîne depuis près de deux ans dans mon album iPhotos (l&amp;rsquo;application ne s&amp;rsquo;appelle plus comme ça depuis bien plus longtemps, mais quà cela ne tienne, je préfère l&amp;rsquo;ancien nom de toute façon).&lt;/p&gt;
&lt;p&gt;Alors voilà un frigo rempli de légumes, datant de janvier 2017. Plein hiver, donc nécessairement des légumes pour réaliser des soupes, des tourtes aux légumes et des potées. J&amp;rsquo;achetais encore à l&amp;rsquo;époque beaucoup d&amp;rsquo;accompagnement déjà prêts (p.ex., purée et salade), pour les jours où j&amp;rsquo;avais la flemme de me préparer à manger. Je sortais de l&amp;rsquo;hôpital, une fois de plus, donc j&amp;rsquo;avais re-rempli mon frigo. De cette époque, je retiendrai surtout le boeuf bourguignon et les tourtes aux poireaux et épinards.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0373.jpeg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0373.jpeg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0374.jpeg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0374.jpeg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Toujours l&amp;rsquo;hiver, mais plutôt finissant. Je continue mes expérimentations de soupes mixées et j&amp;rsquo;expérimente de nouvelles formules de pizza pour mon fils.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/IMG_0393.jpeg"&gt;
&lt;/figure&gt;
&lt;p&gt;Là, à gauche, j&amp;rsquo;ai sans doute nettoyé mon frigo, comme je le fais assez régulièrement tous les deux ou trois mois (sans compter les nettoyages ponctuels, bien entendu). C&amp;rsquo;est le mois de juillet ; salades à volonté !&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0600.jpeg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0600.jpeg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0460.jpeg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0460.jpeg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;L&amp;rsquo;hiver est revenu. Des légumes, encore des légumes. Je me rappelle avoir essayé plusieurs moutardes pour en trouver une qui ne soit pas trop salée pour accompagner sauces et tartes aux légumes. Le mieux que j&amp;rsquo;ai trouvé tire quand même dans les 2-3 g de sel pour 100 g. Il existe des moutardes sans sel, mais ce sont essentiellement des graines ayant goût de vinaigre.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/IMG_0070.jpg"&gt;
&lt;/figure&gt;
&lt;p&gt;De nouveau le frigo bien vidé et nettoyé, en janvier 2018. C&amp;rsquo;est à cette même époque que j&amp;rsquo;ai commencé à me préparer des salades concombres ou des macédoines de légumes aux épices. J&amp;rsquo;en prépare toujours autant d&amp;rsquo;ailleurs : la seconde photo date d&amp;rsquo;octobre de la même année.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0121.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0121.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/56241845324__2F386226-99A1-481D-92A0-4564F3B17BDA.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/56241845324__2F386226-99A1-481D-92A0-4564F3B17BDA.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Tomates et cerises pour accompagner l&amp;rsquo;été. Cette année, j&amp;rsquo;aurais comme l&amp;rsquo;année dernière préparé de nombreuses ratatouilles, mais je me suis également mis à réaliser des sauces bolognaises variées (tantôt avec des morceaux de carottes, tantôt avec de l&amp;rsquo;aubergine), plus ou moins pimentées.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/IMG_0768.jpg"&gt;
&lt;/figure&gt;
&lt;p&gt;Photo la plus récente : c&amp;rsquo;est la fin de la saison des tomates, mais j&amp;rsquo;en ai encore quelques-unes pour réaliser des salades : tomate ananas, zébra et noires de Crimée.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/IMG_0794.jpg"&gt;
&lt;/figure&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ The National • &lt;em&gt;Trouble Will Find Me&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Micro-posting in August</title><link>https://aliquote.org/post/micro-08-2019/</link><pubDate>Sat, 31 Aug 2019 10:37:55 +0200</pubDate><guid>https://aliquote.org/post/micro-08-2019/</guid><description>&lt;p&gt;Here is the monthly newsletter from the Micro blog.&lt;/p&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-08-01&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/iii/1467547466" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Banks, &lt;em&gt;III&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-01&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/the-hungry-saw/278733974" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Tindersticks, &lt;em&gt;The Hungry Saw&lt;/em&gt;.&amp;gt; Ah, those nights, those nights they tiptoed by,&amp;gt; they crackle under our pillows&amp;gt; and they&amp;rsquo;re here.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-01&lt;/a&gt;: About to finish Season 3 of &lt;a href="https://nl.wikipedia.org/wiki/Morden_i_Sandhamn"&gt;Morden i Sandhamn&lt;/a&gt;. Looking forward to watching the next Seasons, of course.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-01&lt;/a&gt;: Be sure to check &lt;a href="https://www.dailyminimal.com"&gt;https://www.dailyminimal.com&lt;/a&gt; if you like minimalist digital art, mostly black and white, lines and stripes and the like. Reminds me of the great &lt;a href="http://www.veramolnar.com"&gt;Vera Molnar&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-01&lt;/a&gt;: Give me some more color, please.&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_0762.jpg" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-01&lt;/a&gt;: Want to approximate a factorial using Stirling formula? Here is a nice trick: &lt;a href="https://math.stackexchange.com/questions/2205128/how-is-gospers-approximation-to-factorial-derived"&gt;How is Gosper&amp;rsquo;s approximation to factorial derived?&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-01&lt;/a&gt;: &lt;a href="https://chrisdone.com/posts/haskell-lisp-philosophy-difference/"&gt;A philosophical difference between Haskell and Lisp&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt; &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-01&lt;/a&gt;: &lt;a href="https://github.com/rigetti/cl-grnm"&gt;Common Lisp implementation of (grid restrained) Nelder-Mead&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-01&lt;/a&gt;: &lt;a href="http://lisp-univ-etc.blogspot.com/2019/07/crash-course-in-lisp.html"&gt;Programming Algorithms: A Crash Course in Lisp&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-02&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/the-red-shoes-2018-remaster/1441652335" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Kate Bush, &lt;em&gt;The Red Shoes&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-02&lt;/a&gt;: This guy&amp;hellip; and the beauty of T&lt;span style="vertical-align: -0.5ex;margin-left: -0.1667em;margin-right: -0.125em;"&gt;E&lt;/span&gt;X: &lt;a href="https://www.cs.stanford.edu/~knuth/papers/huang.pdf"&gt;A computational proof of Huang&amp;rsquo;s degree theorem&lt;/a&gt; (PDF, 1 p.). See also this &lt;a href="https://www.scottaaronson.com/blog/?p=4229#comment-1815290"&gt;related post&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-02&lt;/a&gt;: &lt;a href="https://norvig.com/lispy.html"&gt;(How to Write a (Lisp) Interpreter (in Python))&lt;/a&gt;, by Peter Norvig. &lt;code&gt;#lisp&lt;/code&gt; &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-02&lt;/a&gt;: &lt;a href="https://www.interviewcake.com/article/python/big-o-notation-time-and-space-complexity"&gt;Big O Notation: Using not-boring math to measure code&amp;rsquo;s efficiency&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-02&lt;/a&gt;: &lt;a href="https://jobtalle.com/evolving_lindenmayer_systems.html"&gt;Evolving Lindenmayer systems&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-04&lt;/a&gt;: Beautiful street drawing: &lt;a href="https://mapgen.glitch.me"&gt;https://mapgen.glitch.me&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-04&lt;/a&gt;: Hopefully, I have a lot to read in my RSS queue for today!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-04&lt;/a&gt;: &lt;a href="https://viewsourcecode.org/snaptoken/kilo/index.html"&gt;Build Your Own Text Editor&lt;/a&gt;, in C. And if you&amp;rsquo;re more versed into &lt;a href="https://github.com/remacs/remacs"&gt;Rust&lt;/a&gt; or &lt;a href="https://github.com/soegaard/remacs"&gt;Racket&lt;/a&gt;, you are welcome too: In both cases, it is called &lt;em&gt;remacs&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-04&lt;/a&gt;: &lt;a href="https://cons.io"&gt;Gerbil Scheme&lt;/a&gt;, a meta-dialect of Scheme with post-modern features. No idea what to do with another Scheme implementation, but the website looks gorgeous. &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-04&lt;/a&gt;: &lt;a href="http://morningcoffee.io/killing-a-process-and-all-of-its-descendants.html"&gt;Killing a process and all of its descendants&lt;/a&gt;. There&amp;rsquo;re some subtleties to learn regarding &lt;code&gt;nohup&lt;/code&gt; and &lt;code&gt;exec&lt;/code&gt; and how UNIX systems handle sessions and processes.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-04&lt;/a&gt;: &lt;a href="http://www.rntz.net/post/2016-06-06-not-everything-is-an-expression.html"&gt;Not everything is an expression&lt;/a&gt;, and a way to implement pattern matching in CL. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-04&lt;/a&gt;: &lt;a href="https://github.com/mrnugget/scheme_x86"&gt;Writing a Scheme to x86 compiler&lt;/a&gt;. The original paper written by Abdulaziz Ghuloum is &lt;a href="http://scheme2006.cs.uchicago.edu/11-ghuloum.pdf"&gt;available as a PDF&lt;/a&gt;. &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-05&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/playlist/joy-division-aller-plus-loin/pl.fb2ab6852a984e76a09a78ecbb9f6d7a" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Little playlist feat. Joy Division.&amp;gt; Joy Division raised desolation to the level of high art, and they covered plenty of stylistic ground while doing so. They could be severe: &amp;ldquo;Warsaw&amp;rdquo; is punishing, three-chord punk, bitter and mean. They could be chilly: &amp;ldquo;Heart and Soul&amp;rdquo; dwells in an ice cavern of echo. And they could be desperate, as on &amp;ldquo;Something Must Break&amp;rdquo;&amp;ndash;a harrowing glimpse into the darkness that would be the band&amp;rsquo;s undoing.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-05&lt;/a&gt;: A Stratification Approach to Partial Dependence for Codependent Variables: &lt;a href="https://github.com/parrt/stratx"&gt;code&lt;/a&gt; and &lt;a href="https://arxiv.org/abs/1907.06698"&gt;paper&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-05&lt;/a&gt;: TIL how to get proper ligatures with Iosevka font in Emacs when running in GUI mode (which we get for free in iTerm for basic ligatures, like &lt;code&gt;&amp;lt;-&lt;/code&gt;). See the instructions at the end of &lt;a href="https://github.com/hlissner/doom-emacs/issues/695"&gt;this issue&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-05&lt;/a&gt;: Want quick tips and tricks for using Git efficiently? Try &lt;a href="http://gitready.com"&gt;http://gitready.com&lt;/a&gt;!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-05&lt;/a&gt;: &lt;a href="https://terpconnect.umd.edu/~toh/spectrum/TOC.html"&gt;A Pragmatic Introduction to Signal Processing&lt;/a&gt;. (via HN)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-05&lt;/a&gt;: &lt;a href="https://ermeel86.github.io/case_studies/loo_pec_psis_ncog.html"&gt;Efficient Leave-One-Out Brier Score for time-dependent evaluation of Bayesian Survival Models&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-05&lt;/a&gt;: &lt;a href="https://www.datasciencecentral.com/profiles/blogs/new-book-foundations-of-data-science-from-microsoft-research-lab"&gt;Free Book: Foundations of Data Science (from Microsoft Research Lab)&lt;/a&gt;. We&amp;rsquo;re definitely going from surprise to surprise with Microsoft in the last few months. At least they are moving in the right direction with Github, VS Code and their open-source projects.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-05&lt;/a&gt;: &lt;a href="http://tuvalu.santafe.edu/~simon/it.pdf"&gt;Information Theory for Intelligent People&lt;/a&gt; (PDF, 15 pp.). (via HN)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-05&lt;/a&gt;: &lt;a href="https://bodil.lol/parser-combinators/"&gt;Learning Parser Combinators With Rust&lt;/a&gt;. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-05&lt;/a&gt;: &lt;a href="https://rushter.com/blog/python-memory-managment/"&gt;Memory management in Python&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-05&lt;/a&gt;: &lt;a href="http://jsomers.net/blog/speed-matters"&gt;Speed matters: Why working quickly is more important than it seems&lt;/a&gt;.&amp;gt; Eventually you’ll be both fast and good.That&amp;rsquo;s where the bat hurts, sometimes.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-05&lt;/a&gt;: &lt;a href="https://github.com/saschagrunert/indextree"&gt;indextree&lt;/a&gt;: Arena based tree structure with multithreading support. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-06&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/potsdamer-platz-with-jukka-perko-dan-berglund-morten-lund/1182454482" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Jan Lundgreen, &lt;em&gt;Postdamer Platz&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-06&lt;/a&gt;: Another nice R&lt;sup&gt;4&lt;/sup&gt; article by Dirk Eddelbuettel on &lt;a href="http://dirk.eddelbuettel.com/blog/2019/08/05/#023_rocker_debug_example"&gt;Debugging with Docker and Rocker&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-06&lt;/a&gt;: I didn&amp;rsquo;t read &lt;em&gt;The Book of Why&lt;/em&gt;, but I heard of it a lot on Twitter lately. As you may know, I&amp;rsquo;m a big fan of Stephen Senn&amp;rsquo;s work, and I keep following his posts here and there even if I&amp;rsquo;m no longer being involved in medical statistics. Here is another nice dicussion of &lt;a href="https://errorstatistics.com/2019/08/02/s-senn-red-herrings-and-the-art-of-cause-fishing-lords-paradox-revisited-guest-post/amp/?__twitter_impression=true"&gt;Lord&amp;rsquo;s paradox&lt;/a&gt;, where the author explains why neglecting random effects may affect the conclusions drawn from a study. If you&amp;rsquo;re interested in causal modeling of pre-post study, take a further look at this recent paper: &lt;a href="https://psyarxiv.com/cxd2n/"&gt;Causal Graphical Views of Fixed Effects and Random Effects Models&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-06&lt;/a&gt;: TIL about &lt;a href="https://lisp-lang.org/style-guide/#variables"&gt;&amp;ldquo;earmuffs&amp;rdquo;&lt;/a&gt; (I follow this convention but didn&amp;rsquo;t know it has a proper name!). &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-06&lt;/a&gt;: &lt;a href="http://stevenrosenberg.net/blog/programming/lisp/2018_0226_if_not_sicp_then_what"&gt;If not SICP, then what? Maybe HTDP?&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-06&lt;/a&gt;: &lt;a href="https://ode.io"&gt;Ode.io&lt;/a&gt;: A simple personal publishing engine for the open web.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-06&lt;/a&gt;: &lt;a href="https://www.phacility.com"&gt;Phabricator&lt;/a&gt; is a set of tools that help companies build better software, faster. May be a good alternative to self hosting a Git like platform?&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-06&lt;/a&gt;: &lt;a href="https://pretextbook.org"&gt;Pretext&lt;/a&gt; (formerly, &lt;a href="https://github.com/rbeezer/mathbook"&gt;Mathbook XML&lt;/a&gt;): An uncomplicated XML vocabulary for authors of research articles, textbooks, and monographs.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-06&lt;/a&gt;: &lt;a href="http://lisp-univ-etc.blogspot.com/2019/08/programming-algorithms-data-structures.html?m=1"&gt;Programming Algorithms: Data Structures&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-10&lt;/a&gt;: &amp;gt; Functional and scripting languages are more concise than procedural and object- oriented languages; C is hard to beat when it comes to raw speed on large inputs, but performance differences over inputs of moderate size are less pronounced and allow even interpreted languages to be competitive; compiled strongly-typed languages, where more defects can be caught at compile time, are less prone to runtime failures than interpreted or weakly-typed languages. &amp;mdash; &lt;a href="https://arxiv.org/abs/1409.0252"&gt;A Comparative Study of Programming Languages in Rosetta Code&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-10&lt;/a&gt;: Already watched the first five Seasons of &lt;a href="https://nl.wikipedia.org/wiki/Morden_i_Sandhamn"&gt;Morden i Sandhamn&lt;/a&gt;. I like this series a lot, and the format is definitely a plus (3x45&amp;rsquo;) for me.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-10&lt;/a&gt;: I love the design of &lt;a href="https://thomashoneyman.com"&gt;Thomas Honeyman&lt;/a&gt;&amp;rsquo;s website. I yet have to find some more time to read (and grasp) his blog posts.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-10&lt;/a&gt;: Nice resource: &lt;a href="https://iloveponies.github.io/120-hour-epic-sax-marathon/index.html"&gt;Functional programming in Clojure&lt;/a&gt;. &lt;code&gt;#clojure&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-10&lt;/a&gt;: Should read: &lt;a href="https://www.pnas.org/content/early/2019/08/05/1905060116"&gt;Inference of complex population histories using whole-genome sequences from multiple populations&lt;/a&gt;. &lt;code&gt;#bioinformatics&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-10&lt;/a&gt;: &lt;a href="https://freecontent.manning.com/basic-text-processing-in-functional-style/"&gt;Basic Text Processing in Functional Style&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-10&lt;/a&gt;: &lt;a href="http://lfe.io"&gt;Lisp Flavoured Erlang&lt;/a&gt;, or the best of both worlds for s-expr-based distributed systems?&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-11&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/parachute/1080662336" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Magnus Öström, &lt;em&gt;Parachute&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-11&lt;/a&gt;: Happy meal, from some days ago.&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_0775.jpg" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-11&lt;/a&gt;: Since &lt;a href="https://github.com/blindglobe/common-lisp-stat"&gt;common-lisp-stat&lt;/a&gt; has been very quite the last years or so, I was very happy to find Gary Hollis&amp;rsquo;s &lt;a href="https://github.com/ghollisjr/cl-ana"&gt;CL data analysis library&lt;/a&gt;. Lisp still has a bright future ahead. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-11&lt;/a&gt;: Some interesting &lt;a href="https://sites.google.com/site/schemephil/"&gt;resources on Scheme&lt;/a&gt; by Philip Bewig, who you may know if you happen to spend some time on Programming Praxis. There are also nice Awk scripts lurking around on his site. &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-11&lt;/a&gt;: Tonight I&amp;rsquo;ll probably end up watching the last episode of &lt;a href="https://nl.wikipedia.org/wiki/Morden_i_Sandhamn"&gt;Morden i Sandhamn&lt;/a&gt; (Season 7). I&amp;rsquo;m not sure what I&amp;rsquo;m going to put on the list of things to look at next, but I&amp;rsquo;ll try to find something as entertaining as Swedish or Danish TV shows.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-11&lt;/a&gt;: &lt;a href="https://www.johndcook.com/blog/2019/08/10/learning-vs-relearning/"&gt;Ease of learning vs relearning&lt;/a&gt;, by John Cook. Nice points, as always. I have just some minor concerns with the last paragraphs where the author says that the tidyverse is great beacuse of its consistency. First, pending some minor annoyances with the naming convention of formal arguments in base R functions&amp;ndash;and recommended packages&amp;ndash;, which I always called R&amp;rsquo;s language idiosyncrasies, I do not find base R that much inconsistent. Second, I disagree with the idea that the tidyverse comes with that much conceptual integrity, for what I used to see. Most importantly, there are so many dedicated functions in, e.g., &lt;code&gt;dplyr&lt;/code&gt;, that it goes against the principle of compositionality that we use to like in functional and scripting languages. Finally, what used to be available in a short number of packages, but especially &lt;code&gt;base&lt;/code&gt;, is now scattered throughout several packages (&lt;code&gt;forcats&lt;/code&gt;, &lt;code&gt;glue&lt;/code&gt;, etc.), so that I have a hard time believing that newcomers could find their way as easily as they would with base R only. Anyway, that&amp;rsquo;s my 2¢, and it is nowhere a critic of Hadley Wickham&amp;rsquo;s account to the R ecosystem. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-12&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/janes-addiction-live/413572166" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Jane&amp;rsquo;s Addiction, &lt;em&gt;Jane&amp;rsquo;s Addiction (Live)&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-12&lt;/a&gt;: Compared to when I first &lt;a href="https://aliquote.org/post/migrating-to-hugo/"&gt;restarted this site&lt;/a&gt; using Hugo, the number of static files has quite significantly increased:| EN+&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;+&amp;mdash;&amp;mdash;+Pages | 1548Paginator pages | 190Non-page files | 0Static files | 689Processed images | 0Aliases | 38Sitemaps | 1Cleaned | 0&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-12&lt;/a&gt;: Hot off the kitchen (yesterady&amp;rsquo;s evening and today&amp;rsquo;s lunch):&lt;br&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0782.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0782.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0783.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0783.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
I don&amp;rsquo;t know any borders, and in each case two or three products from different continents were mixed.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-12&lt;/a&gt;: If you&amp;rsquo;re interested in design of experiments and analysis of variance, this &lt;a href="http://users.stat.umn.edu/~gary/Book.html"&gt;textbook&lt;/a&gt; is the latest available online I am aware of.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-12&lt;/a&gt;: Reading another of the excellent blog post by Alex Harsányi, &lt;a href="https://alex-hhh.github.io/2019/08/timezone-lookup-2.html"&gt;More Timezone Lookup (loading and saving data)&lt;/a&gt;, I thought it would be good if there were something like a &amp;ldquo;data.table&amp;rdquo; module available in Racket. &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-12&lt;/a&gt;: &lt;a href="http://www.philipzucker.com/doing-basic-ass-stuff-in-haskell/"&gt;Doing Basic Ass Shit in Haskell&lt;/a&gt;: Nice resources on Haskell and functional programming. Each time I promise I will learn more Haskell than one-liner at the &lt;code&gt;ghci&lt;/code&gt; prompt, but each time I find myself too lazy, as always. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-12&lt;/a&gt;: &lt;a href="https://www.rousette.org.uk/archives/doom-emacs-tweaks-org-journal-and-org-super-agenda/"&gt;Doom Emacs tweaks: Org Journal and Super Agenda&lt;/a&gt;. Nice post on BSAG website, as always. I personally don&amp;rsquo;t use Org agenda, although I keep a list of TODO items and web links in separate org files. I once started to keep a daily workbook, but I stopped after a few months. Maybe I should try again. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-14&lt;/a&gt;: How many of you are still using or even knowing the &lt;a href="https://www.jsoftware.com/papers/APL.htm"&gt;APL language&lt;/a&gt;? I remember that Jan de Leeuw played a bit with R to resurrect it at the REPL several years ago, and that Nick Cox used to use J in addition to Stata. Never used any of those two languages, but the APL book contains a lot of useful information on designing PL.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-14&lt;/a&gt;: TIL about a lot if useful Lisp stuff on Paul Khuong&amp;rsquo;s old website: contents &lt;a href="https://www.pvk.ca/Blog/2012/01/18/migration-and-synopsis/"&gt;listed here&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-14&lt;/a&gt;: &lt;a href="https://blog.racket-lang.org/2019/08/racket-v7-4.html"&gt;Racket 7.4&lt;/a&gt; is out! &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-15&lt;/a&gt;: Season 1 of &lt;a href="https://en.wikipedia.org/wiki/12_Monkeys_(TV_series)"&gt;12 Monkeys&lt;/a&gt;, done.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-15&lt;/a&gt;: TIL about &lt;a href="https://yack.io/#"&gt;Yack!&lt;/a&gt;: The Unified Community Browser.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-15&lt;/a&gt;: There is now a &lt;a href="https://github.com/vega/vega-lite-api"&gt;JS api&lt;/a&gt; for Vega-Lite, and it looks quite awesome (i.e., compared to writing raw JSON specs). &lt;code&gt;#javascript&lt;/code&gt; &lt;code&gt;#dataviz&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-15&lt;/a&gt;: Trying the &lt;a href="https://fishshell.com"&gt;Fish shell&lt;/a&gt; right now. Looks good so far.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-15&lt;/a&gt;: &lt;a href="https://danielsz.github.io/blog/2019-08-05T21_14.html"&gt;The talk that wasn&amp;rsquo;t&lt;/a&gt;: Lisp is not based on the Lambda Calculus. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-16&lt;/a&gt;: &lt;iframe style="border: 0; width: 100%; height: 42px;" src="https://bandcamp.com/EmbeddedPlayer/album=469929703/size=small/bgcol=ffffff/linkcol=e99708/track=3821113879/transparent=true/" seamless&gt;&lt;a href="http://stephenbarton.bandcamp.com/album/12-monkeys-original-series-soundtrack"&gt;12 Monkeys (original Series Soundtrack) by Stephen Barton&lt;/a&gt;&lt;/iframe&gt;See also &lt;em&gt;Children of my Hometown&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-16&lt;/a&gt;: And now you can have config files for VS Code as well, thanks to Bodil Stokke: &lt;a href="https://github.com/bodil/vscode-use-package"&gt;vscode-use-package&lt;/a&gt; and &lt;a href="https://github.com/bodil/vscode-init-script"&gt;vscode-init-script&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-16&lt;/a&gt;: Ok, Fish shell is great: fewer config files&amp;ndash;all in a centralized location, btw&amp;ndash;, clean syntax. And it works right out of the box without any plugin! Once I figured out how to setup the &lt;code&gt;$PATH&lt;/code&gt; variable, I knew I will probably not look back.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-16&lt;/a&gt;: &lt;a href="http://dev.stephendiehl.com/numpile/"&gt;Let&amp;rsquo;s Write an LLVM Specializer for Python!&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-17&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/blunderbuss/510424743" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Jack White, &lt;em&gt;Blunderbuss&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-17&lt;/a&gt;: Cosma Shalizi is about to teach a new (or &lt;a href="http://bactra.org/weblog/617.html"&gt;revised&lt;/a&gt;) &lt;a href="http://www.stat.cmu.edu/~cshalizi/dm/19/"&gt;course on Data Mining&lt;/a&gt; (Fall 2019). Looking forward to reading the online material.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-17&lt;/a&gt;: If you are looking for nice color scheme, e.g., for your presentation or online demo, take a look at the following article: &lt;a href="https://www.canva.com/learn/100-color-combinations/"&gt;100 brilliant color combinations and how to apply them to your designs&lt;/a&gt;. My preference goes to the &amp;ldquo;Subdued &amp;amp; Professional&amp;rdquo; palette (&lt;span style="background: #90AFC5; color: white; padding: 4px 2px;"&gt;#90AFC5&lt;/span&gt;, &lt;span style="background: #336B87; color: white; padding: 4px 2px;"&gt;#336B87&lt;/span&gt;, &lt;span style="background: #2A3132; color: white; padding: 4px 2px;"&gt;#2A3132&lt;/span&gt;, and &lt;span style="background: #763626; color: white; padding: 4px 2px;"&gt;#763626&lt;/span&gt;).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-17&lt;/a&gt;: Six useful &lt;a href="https://increment.com/open-source/more-productive-git/"&gt;Git tips&lt;/a&gt; (via Irreal) and 5 &lt;a href="https://www.codeproject.com/Articles/29637/Five-Tips-for-Floating-Point-Programming"&gt;tips for numerical computing&lt;/a&gt; (by John Cook).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-17&lt;/a&gt;: &lt;a href="https://github.blog/2019-08-16-highlights-from-git-2-23/"&gt;Highlights from Git 2.23&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-17&lt;/a&gt;: &lt;a href="https://github.com/valeriansaliou/sonic"&gt;sonic&lt;/a&gt;: Fast, lightweight &amp;amp; schema-less search backend. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-18&lt;/a&gt;: &lt;a href="http://www.defmacro.org/ramblings/lisp.html"&gt;The Nature of Lisp&lt;/a&gt; (via &lt;a href="https://irreal.org/blog/?p=8249"&gt;Irreal&lt;/a&gt;). &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-18&lt;/a&gt;: &lt;a href="https://www.freecodecamp.org/news/tmux-in-practice-iterm2-and-tmux-integration-7fb0991c6c01/"&gt;tmux in practice: iTerm2 and tmux&lt;/a&gt;. I&amp;rsquo;m quite happy with iTerm only, since I don&amp;rsquo;t need to share my session across different computer for the moment. But if this were the case, sure I would come back to this nice post and the associated &lt;a href="https://github.com/samoshkin/tmux-config#iterm2-and-tmux-integration"&gt;Github repo&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-19&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/an-american-prayer-bonus-track-edition/511578072" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Jim Morrisson, &lt;em&gt;An American Prayer&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-19&lt;/a&gt;: A very good discussion of &lt;a href="https://stackoverflow.com/a/1169169"&gt;CL vs. Scheme&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt; &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-19&lt;/a&gt;: I keep reading &lt;a href="https://stackoverflow.com/a/8780880"&gt;some&lt;/a&gt; &lt;a href="https://stackoverflow.com/a/19670813"&gt;nice&lt;/a&gt; &lt;a href="https://stackoverflow.com/a/2018220"&gt;posts&lt;/a&gt; written by Eli Barzilay on SO; that&amp;rsquo;s where I miss the SE network: You get so much information, cross-references, from passionate people who like to share their knowledge and experience. &lt;code&gt;#scheme&lt;/code&gt; &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-19&lt;/a&gt;: Yesterday and the day before: Not bad actually.
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0788.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0788.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0789.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0789.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-19&lt;/a&gt;: &lt;a href="https://gist.github.com/jaseemabid/1321592"&gt;A bunch of good git tutorials&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-19&lt;/a&gt;: &lt;a href="http://jeffe.cs.illinois.edu/teaching/algorithms/"&gt;Algorithms&lt;/a&gt;, by Jeff Erickson.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-19&lt;/a&gt;: &lt;a href="http://www.morgenthum.tech/articles/write-haskell-game"&gt;How to write a game in Haskell from scratch&lt;/a&gt;: Game programming is always lots of fun and it is often a nice first take with new PLs. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-19&lt;/a&gt;: &lt;a href="https://ngoldbaum.github.io/posts/python-vs-rust-nn/"&gt;Python vs Rust for Neural Networks&lt;/a&gt;. Such comparisons between general PLs (or worse, between a DSL and a mainstream PL) are often unfair, but it helps to appreciate the pros and cons of each language for a given domain (not a specific task).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-19&lt;/a&gt;: &lt;a href="https://www.neilvandyke.org/racket/sicp/"&gt;SICP Support for DrRacket&lt;/a&gt;. No need for &lt;code&gt;planet&lt;/code&gt; anymore, just use &lt;code&gt;#lang sicp&lt;/code&gt;. &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-19&lt;/a&gt;: &lt;a href="http://www.phyast.pitt.edu/~micheles/scheme/index.html"&gt;The Adventures of a Pythonista in Schemeland&lt;/a&gt;. &lt;code&gt;#scheme&lt;/code&gt; &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-20&lt;/a&gt;: &amp;gt; Annotate the web, with anyone, anywhere. &amp;ndash; &lt;a href="https://web.hypothes.is"&gt;hypothes.is&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-20&lt;/a&gt;: Here is an Haskell library containing common &lt;a href="https://github.com/devonhollowood/search-algorithms"&gt;graph search&lt;/a&gt; algorithms. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-20&lt;/a&gt;: Looks like Rust finally got &lt;a href="https://tmandry.gitlab.io/blog/posts/optimizing-await-1/"&gt;&lt;code&gt;async/await&lt;/code&gt;&lt;/a&gt; as well. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-20&lt;/a&gt;: TIL about &lt;a href="https://github.com/keycastr/keycastr/blob/master/README.md"&gt;KeyCastr&lt;/a&gt;, an open-source keystroke visualizer for the Mac.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-20&lt;/a&gt;: Time to watch the last episode of &lt;a href="https://en.wikipedia.org/wiki/Chernobyl_(miniseries)"&gt;Chernobyl&lt;/a&gt; (my son didn&amp;rsquo;t like it!).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-20&lt;/a&gt;: &lt;a href="https://github.com/uwdata/falcon"&gt;Brushing and linking for big data&lt;/a&gt; by @uwdata. &lt;code&gt;#dataviz&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-20&lt;/a&gt;: &lt;a href="https://people.eecs.berkeley.edu/~bh/ss-toc2.html"&gt;Simply Scheme: Introducing Computer Science&lt;/a&gt;. &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-20&lt;/a&gt;: &lt;a href="https://tiefenauer.github.io/blog/smith-waterman/"&gt;Smith-Waterman algorithm in Python&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt; &lt;code&gt;#bioinformatics&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-20&lt;/a&gt;: &lt;a href="https://github.com/tpope/vim-fugitive"&gt;Vim fugitive&lt;/a&gt; has been seriously updated: v2.5 -&amp;gt; v3.0. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-21&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/micah-p-hinson-and-the-gospel-of-progress/913893232" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Micah P. Hinson, &lt;em&gt;Micah P. Hinson and the Gospel of Progress&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-21&lt;/a&gt;: &amp;gt; Make each program do one thing well. To do a new job, build afresh rather than complicate old programs by adding new features; Expect the output of every program to become the input to another, as yet unknown, program. Don&amp;rsquo;t clutter output with extraneous information. Avoid stringently columnar or binary input formats. Don&amp;rsquo;t insist on interactive input. &amp;ndash; &lt;a href="http://www.catb.org/~esr/writings/taoup/html/ch01s06.html"&gt;Basics of the Unix Philosophy&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-21&lt;/a&gt;: &amp;gt; The other option is to just live with Emacs. &amp;mdash; &lt;a href="https://sites.google.com/site/steveyegge2/the-emacs-problem"&gt;The Emacs Problem&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-21&lt;/a&gt;: I haven&amp;rsquo;t update Doom Emacs during the week, except for env variables because I &lt;a href="https://aliquote.org/post/fish-shell/"&gt;switched to Fish&lt;/a&gt; recently. I know there are probably plenty of updates on (M)ELPA, but the Python LSP layer works quite nicely, and the same applies to functional languages I use to use these days. So why uopdating again and again? I probably reached the point where you no longer want to live in a &amp;lsquo;beta&amp;rsquo; world, and just start to be more productive with the tools you have right in your hands. BTW, I uninstalled VS Code yesterday: I still think this is the best multi-OS editor I&amp;rsquo;ve seen so far, but too much noise for me, and so few plugins for functional languages that it makes me feel like I could just use TextEdit instead, or maybe Vim. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-21&lt;/a&gt;: &lt;a href="https://github.com/vis4/co2-history"&gt;Carbon dioxide concentration in atmosphere over last 800,000 years&lt;/a&gt;. &lt;code&gt;#dataviz&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-21&lt;/a&gt;: &lt;a href="https://metabase.com"&gt;Metabase&lt;/a&gt; is the easy, open source way for everyone in your company to ask questions and learn from data.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-21&lt;/a&gt;: &lt;a href="http://px16.matt.is"&gt;When I Sit Down At My Editor, I Feel Relaxed&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-22&lt;/a&gt;: &lt;a href="https://github.com/chrisdone/elisp-guide"&gt;A quick guide to Emacs Lisp programming&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-23&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/horehound/320973989" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   The Dead Weather, &lt;em&gt;Horehound&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-23&lt;/a&gt;: Such a nice treatment of &lt;a href="https://wiki.haskell.org/Prime_numbers"&gt;Prime numbers&lt;/a&gt; on the Haskell community wiki. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-23&lt;/a&gt;: &lt;a href="https://multun.net/obscure-c-features.html"&gt;Some obscure C features&lt;/a&gt;. (via HN)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-23&lt;/a&gt;: &lt;a href="https://github.com/crazyhottommy/getting-started-with-genomics-tools-and-resources"&gt;Unix, R and python tools for genomics and data science&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-23&lt;/a&gt;: &lt;a href="https://github.com/Y2Z/monolith"&gt;monolith&lt;/a&gt;: Save HTML pages with ease.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-24&lt;/a&gt;: &lt;a href="https://alhassy.github.io/TypedLisp/"&gt;Typed Lisp, A Primer&lt;/a&gt;. (Note that &amp;ldquo;Lisp refers to Common Lisp as supported by Emacs Lisp.&amp;rdquo;) &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-25&lt;/a&gt;: Nice song cover of &lt;a href="https://www.youtube.com/watch?v=ebOvxJcBkNM"&gt;&lt;em&gt;Une Sorcière comme les autres&lt;/em&gt;&lt;/a&gt;, by Anne Sylvestre.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-25&lt;/a&gt;: Sadly, a large number of blogs I used to follow some years ago are definitely down, e.g., &lt;a href="https://github.com/wrathematics"&gt;wrathematics&lt;/a&gt; &lt;a href="http://librestats.com/archive/"&gt;hasn&amp;rsquo;t posted&lt;/a&gt; for years.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-25&lt;/a&gt;: &lt;a href="https://amontalenti.com/2019/08/10/javascript-the-modern-parts"&gt;JavaScript: The Modern Parts&lt;/a&gt;: Nice historical take! &lt;code&gt;#javascript&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-25&lt;/a&gt;: &lt;a href="https://medium.com/@MartinCracauer/static-type-checking-in-the-programmable-programming-language-lisp-79bb79eb068a"&gt;Static type checking in the programmable programming language (Lisp)&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-25&lt;/a&gt;: &lt;a href="https://1x.engineer"&gt;What is a 1x Engineer?&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-27&lt;/a&gt;: A clean and minimalist theme for Jekyll: &lt;a href="https://github.com/huangyz0918/moving"&gt;moving&lt;/a&gt;. It might provide a very nice template for GH pages.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-27&lt;/a&gt;: Streaming JSON parser for Unix: &lt;a href="https://github.com/shellbound/jwalk/"&gt;jwalk&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-27&lt;/a&gt;: &lt;a href="http://r6.ca/blog/20110808T035622Z.html"&gt;A Very General Method of Computing Shortest Paths&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-27&lt;/a&gt;: &lt;a href="https://datascience.blog.wzb.eu/2018/02/02/vectorization-and-parallelization-in-python-with-numpy-and-pandas/"&gt;Vectorization and parallelization in Python&lt;/a&gt;: Nice wrap-up of available solutions. The &lt;code&gt;joblib&lt;/code&gt; module is really a must-have. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-28&lt;/a&gt;: Yesterday, I noticed a nice tweet by John Cook through one of his many accounts:&lt;blockquote class="twitter-tweet"&gt;&lt;p lang="en" dir="ltr"&gt;Objects are data with functions. Closures are functions with data.&lt;/p&gt;&amp;mdash; Computer Science (@CompSciFact) &lt;a href="https://twitter.com/CompSciFact/status/1166376160885915648?ref_src=twsrc%5Etfw"&gt;August 27, 2019&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async src="https://platform.twitter.com/widgets.js" charset="utf-8"&gt;&lt;/script&gt;
Here is a more detailed version of the above: &lt;a href="https://stereobooster.com/posts/function-vs-object/"&gt;Function vs Object&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-28&lt;/a&gt;: &lt;a href="https://www.newfrenzy.org/best-practices-for-using-functional-programming-in-python/"&gt;Best Practices for Using Functional Programming in Python&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-28&lt;/a&gt;: &lt;a href="http://homepages.inf.ed.ac.uk/wadler/papers/marktoberdorf/baastad.pdf"&gt;Monads for functional programming&lt;/a&gt; (PDF, 31 pp.).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-28&lt;/a&gt;: &lt;a href="https://matsen.fredhutch.org/general/2019/08/24/vbpi.html"&gt;Variational Bayesian phylogenetic inference&lt;/a&gt;. &lt;code&gt;#bioinformatics&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-29&lt;/a&gt;: Live in your terminal, they said. Let&amp;rsquo;s start with &lt;a href="https://github.com/dariober/ASCIIGenome"&gt;ASCIIGenome&lt;/a&gt; and &lt;a href="https://jsvine.github.io/intro-to-visidata/"&gt;VisiData&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-29&lt;/a&gt;: Well, I &lt;a href="https://aliquote.org/micro/2019-08-21-21-01-39/"&gt;finally updated&lt;/a&gt; my config for Doom Emacs, which now relies on &lt;a href="https://github.com/raxod502/straight.el"&gt;straight&lt;/a&gt; to manage all packages. The first upgrade was quite buggy, but once I figured out I could just delete my current &lt;code&gt;.emacs.d&lt;/code&gt; and start from scratch again, I got a working install in a few minutes. Beware that the process of downloading and configuring all packages is quite long. You will also likely need to update your autoloads, e.g., &lt;code&gt;doom refresh -f&lt;/code&gt;. Also, if you have a problem rebuilding the pdf-tools viewer, eval this before running &lt;code&gt;pdf-tools-install&lt;/code&gt;: &lt;code&gt;(setenv &amp;quot;PKG_CONFIG_PATH&amp;quot; &amp;quot;/usr/local/lib/pkgconfig:/usr/local/Cellar/libffi/3.2.1/lib/pkgconfig&amp;quot;)&lt;/code&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-08-29&lt;/a&gt;: &lt;a href="https://github.com/sharkdp/pastel"&gt;pastel&lt;/a&gt;: A command-line tool to generate, analyze, convert and manipulate colors. (Not yet merged into Homebrew core.)&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-08-29-15-57-02.png" alt=""&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>Micro review from August</title><link>https://aliquote.org/post/micro-review-001/</link><pubDate>Sun, 25 Aug 2019 16:22:26 +0200</pubDate><guid>https://aliquote.org/post/micro-review-001/</guid><description>&lt;p&gt;Here is another micro review of random or not so random links I found while browsing the interweb lately.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://serokell.io/blog/haskell-history"&gt;Haskell. History of a Community-Powered Language&lt;/a&gt;: This is broad review of the inception of Haskell, statically typed and purely functional programming language that many FP programmer love for its purity. The first Haskell report dates back to the 90&amp;rsquo;s, so it&amp;rsquo;s been a while, and Haskell Prime will the new standard by 2020. There is a PDF reveiw available on &lt;a href="https://www.microsoft.com/en-us/research/wp-content/uploads/2016/07/history.pdf"&gt;Microsoft website&lt;/a&gt; as well. It is also worth checking, or even subscribing to, the whole blog if you are inclined to use FPs and especially Haskell.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;This new shell clearly looks very hand for data munging: &lt;a href="http://www.jonathanturner.org/2019/08/introducing-nushell.html"&gt;Introducing nushell&lt;/a&gt;. Indeed, if you look at the demo on the blog post, many oprations are usually what we found in data processing at the command-line, using pipes, redirection, and the like. The fact that &lt;code&gt;ls&lt;/code&gt;, for instance, returns a structured table of results makes me think of JSON or YAML common data format, together with &lt;a href="https://stedolan.github.io/jq/"&gt;jq&lt;/a&gt; or &lt;a href="https://csvkit.readthedocs.io"&gt;csvkit&lt;/a&gt; utilities, as discussed by Jearoen Janssens in his wonderful textbook, &lt;a href="https://www.datascienceatthecommandline.com"&gt;&lt;em&gt;Data Science at the Command Line&lt;/em&gt;&lt;/a&gt;. After &lt;a href="https://github.com/tantivy-search/tantivy"&gt;search&lt;/a&gt; &lt;a href="https://github.com/toshi-search/Toshi"&gt;engines&lt;/a&gt;, &lt;a href="https://github.com/remacs/remacs"&gt;Emacs&lt;/a&gt; clone, this is the first instance of a shell emulation in Rust that I am aware of. I am not going to switch, though, and I am quite happy with my recent &lt;a href="https://aliquote.org/post/fish-shell/"&gt;move to Fish&lt;/a&gt;. However, I am now eager to try the &lt;a href="http://www.nongnu.org/gsl-shell/"&gt;GSL shell&lt;/a&gt; &lt;a href="https://aliquote.org/post/gsl-shell/"&gt;again&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;There are so many applied math textbook available for free on the internet that it is hard to make a definitive choice. My BibTeX file is full of preprint, published or archived textbooks, and I barely have time to read a dozen of them each year. Today, I found &lt;a href="https://web.stanford.edu/~boyd/vmls/"&gt;&lt;em&gt;Introduction to Applied Linear Algebra – Vectors, Matrices, and Least Squares&lt;/em&gt;&lt;/a&gt;, from Cambridge University Press, available as a PDF. And guess what: It was already in my electronic bookshelf! You will have to schedule some time to review it since it is 473 pages long, and covers both mathematical theory and applications to statistics (e.g., distance-based clustering, dynamical systems, or OLS and logistic regression).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I just noticed this &lt;a href="https://news.ycombinator.com/item?id=20766443"&gt;thread on HN&lt;/a&gt;, in which &lt;a href="https://news.ycombinator.com/user?id=UglyToad"&gt;UglyToad&lt;/a&gt; complains that only 2-3 hours are really productive in a day. I can relate, since I observed the same pattern when working as an applied statistician: 3 hours (one burst) for writing code, that&amp;rsquo;s only what I was able to do in a day; hopefully, I could benefit from the rest of the day to write statistical reports and process emails! It also reminds me of Chris Done&amp;rsquo;s report on his weekly activity on Github for a particular project: there was a clear pattern of high intensity the first three days, then a progressive decrease in the number of commits starting on Thursday up to Sunday. (Unfortunately I can&amp;rsquo;t get my hands on this post.)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.wesfed.com/blog/ideal-blog-post-length-seo/"&gt;What is the ideal blog post length for SEO?&lt;/a&gt;. I will have a hard time publishing only 1500 word long blog posts, but I&amp;rsquo;m no SEO and I believe it all depends on the target audience. For instance, I like reading short to medium length posts on John Cook or Irreal blogs, but I also enjoy more lengthy discussions on Caches to Caches or Evan Miller&amp;rsquo;s weblog. Sometimes it just depends on my mood, or the available time. However, it may happen that at some point I only want to ready a bunch of short posts, which is still more refreshing than browsing my Twitter TL some day.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;This day on Hacker News: &lt;a href="http://www.math.bas.bg/bantchev/misc/az.pdf"&gt;The A-Z of Programming Languages&lt;/a&gt; (PDF, 127 pp.), with interviews from Rich Hickey, Joe Armstrong, Simon Peyton-Jones, Guido van Rossum, among others. Be careful, the hyperlinks in the table of contents point elsewhere on the internet. I learned that the Haskell &amp;lsquo;98 version was frozen to allow people to write books and teaching material on Haskell. Parallel computation and concurrency are frequent inquiries along the interviews. Functional PLs are naturally good candidates, whether lazy (Haskell) or not (Scheme).&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;gt; Why did you choose to create another Lisp dialect instead of extending an existing one? While Lisps are traditionally extremely extensible, I had made some design decisions, like immutability for the core data structures, that would have broken backward compatibility with existing Scheme and Common Lisp programs. Starting with a clean slate let me do many other things differently, which is important, since I didn’t want Clojure to appeal only to existing Lispers. In the end Clojure is very different and more approachable to those having no Lisp background --- Rich Hickey
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>The unquantified self #10</title><link>https://aliquote.org/post/unquantified-self-010/</link><pubDate>Thu, 22 Aug 2019 18:44:07 +0200</pubDate><guid>https://aliquote.org/post/unquantified-self-010/</guid><description>&lt;p&gt;Latest news from the Summer here.&lt;/p&gt;
&lt;p&gt;Days have been pretty quite because I was on holidays during the last five weeks, half time ill but that&amp;rsquo;s ok, I&amp;rsquo;m used to being in a second state now. The hot weather didn&amp;rsquo;t help&amp;mdash;we reached 42°C one day!&amp;mdash;and, anyway, I didn&amp;rsquo;t really want to program on my computer anymore so I took some rest. I&amp;rsquo;m back pushing to Github and reading a lot of articles on genetics and functional programming. I could almost enjoy it if I weren&amp;rsquo;t so tired when I get back at home after day job. But let&amp;rsquo;s not dwell on these bad thoughts, I&amp;rsquo;m not often optimistic lately. I have a new office, BTW.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/IMG_0792.jpg"&gt;
&lt;/figure&gt;
&lt;p&gt;I found myself using the &lt;a href="https://aliquote.org/micro"&gt;micro blog&lt;/a&gt; a lot more recently. I will probably slow down the pace and focus on a more &lt;a href="https://aliquote.org/tags/review/"&gt;detailed review&lt;/a&gt; of questions. I&amp;rsquo;ve stopped my monthly &amp;ldquo;bag of tweets&amp;rdquo;: I no longer bookmark any post on Twitter, and I only keep my account alive in order to follow users that I have been following for a long time and many new on the French side. Anyway, here is a quick summary of my posts on the Micro section:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/cal-heatmap.png"&gt;
&lt;/figure&gt;
&lt;p&gt;I took advantage of these few days to read as much as I could, very irregularly, but always with great pleasure anyway. Here are the titles: Denis Michelis, &lt;em&gt;Etat d&amp;rsquo;ivresse&lt;/em&gt; (Notabila); Ségolène Daignies, &lt;em&gt;Piano destinato&lt;/em&gt; (Mercure de France); Haruki Murakami, &lt;em&gt;Sommeil&lt;/em&gt; (10/18); Clélie Avit, &lt;em&gt;L&amp;rsquo;expérience de la pluie&lt;/em&gt; (Plon); Christian Grindicelli, &lt;em&gt;Station balnéaire&lt;/em&gt; (Gallimard); Joël Bastard, &lt;em&gt;Des lézards, des liqueurs&lt;/em&gt; (Gallimard); Orhan Pamuk, &lt;em&gt;La femme aux cheveux roux&lt;/em&gt; (Gallimard); Yannick Haenel, &lt;em&gt;Tiens ferme ta couronne&lt;/em&gt; (Gallimard); Erri De Luca, &lt;em&gt;La tour de l&amp;rsquo;Oie&lt;/em&gt; (Gallimard); Ricarda Huch, &lt;em&gt;Le dernier été&lt;/em&gt; (Viviane Hamy); Thierry Laget, &lt;em&gt;Proust, prix Goncourt&lt;/em&gt; (Gallimard); Laetitia Colombani, &lt;em&gt;Les victorieuses&lt;/em&gt; (Grasset); Antonio Moresco, &lt;em&gt;La petite lumière&lt;/em&gt; (Verdier); Anaïs Nin, &lt;em&gt;Une espionne dans la maison de l&amp;rsquo;amour&lt;/em&gt; (Stock). There are plenty more waiting for me in the living room but now I have to find time to read them.&lt;/p&gt;
&lt;p&gt;Strangely enough I didn&amp;rsquo;t listen to a lot of new music and I stayed focused mainly on playlists that I like. I keep my subscription to Apple Music for the moment, even if I am aware of some good alternatives like &lt;a href="https://www.rousette.org.uk/archives/roon-music-player/"&gt;Roon&lt;/a&gt;. I learned that Apple will launch &lt;a href="https://www.apple.com/apple-tv-plus/"&gt;Apple TV+&lt;/a&gt;, and I will probably have to upgrade my Apple TV and try this new VOD offer. I wonder whether they will introduce other important changes to iTunes, because I would prefer they just stop downgrading its features for the only benefit of Apple Music&amp;ndash;even if I know that in the long run there will be an app dedicated to each service (TV, Music, News, Podcasts, etc.), like on iOS, and that&amp;rsquo;s all. Recommendations on Apple Music are generally good (read, not so many false positives, but a higher number of true negatives), even if I often dismiss the whole recommendation panel and instead start browsing from album to album when I find interesting cross-links.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-08-22-15-42-04.png"&gt;
&lt;/figure&gt;
&lt;p&gt;My son and I started watching &lt;a href="https://en.wikipedia.org/wiki/Chernobyl_(miniseries)"&gt;Chernobyl&lt;/a&gt;, then stopped because he didn&amp;rsquo;t like it. I finished it alone, a few days ago. The last episode is brilliant. We move on to &lt;a href="https://en.wikipedia.org/wiki/12_Monkeys_(TV_series)"&gt;12 Monkeys&lt;/a&gt;, which is really well tied up after all. There are four seasons (we already finished the first), so it should keep us busy for a few more weeks as school starts soon. And I was about to forget: I also spent a lot of time loosing at various game during the Summer&amp;hellip;&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/IMG_0757.jpg"&gt;
&lt;/figure&gt;</description></item><item><title>Independent Alleles and Mendel's second law</title><link>https://aliquote.org/post/rosalind-independent-alleles/</link><pubDate>Tue, 20 Aug 2019 07:11:17 +0200</pubDate><guid>https://aliquote.org/post/rosalind-independent-alleles/</guid><description>&lt;p&gt;One of the &lt;a href="http://rosalind.info/"&gt;Rosalind&lt;/a&gt; problems deals with Mendel&amp;rsquo;s second law according to which traits are inherited independently one of each other.&lt;/p&gt;
&lt;p&gt;Let us assume we have two heterozygous organisms with genotypes Aa and Bb. Such independant assortment implies that the probability of an aa BB offspring is equal to $\Pr(\text{aa})\times\Pr(\text{BB})=\frac{1}{4}\times\frac{1}{4}=\frac{1}{16}$. The value $\frac{1}{4}$ comes from the fact that the probability of any offspring of this subtype is evenly the same for each crossing:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th style="text-align: center"&gt;AB&lt;/th&gt;
&lt;th style="text-align: center"&gt;Ab&lt;/th&gt;
&lt;th style="text-align: center"&gt;aB&lt;/th&gt;
&lt;th style="text-align: center"&gt;ab&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;AB&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align: center"&gt;AA BB&lt;/td&gt;
&lt;td style="text-align: center"&gt;AA Bb&lt;/td&gt;
&lt;td style="text-align: center"&gt;Aa Bb&lt;/td&gt;
&lt;td style="text-align: center"&gt;Aa Bb&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Ab&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align: center"&gt;AA bB&lt;/td&gt;
&lt;td style="text-align: center"&gt;AA bb&lt;/td&gt;
&lt;td style="text-align: center"&gt;Aa bB&lt;/td&gt;
&lt;td style="text-align: center"&gt;Aa bb&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;aB&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align: center"&gt;aA BB&lt;/td&gt;
&lt;td style="text-align: center"&gt;aA Bb&lt;/td&gt;
&lt;td style="text-align: center"&gt;aa BB&lt;/td&gt;
&lt;td style="text-align: center"&gt;aa Bb&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;ab&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align: center"&gt;aA bB&lt;/td&gt;
&lt;td style="text-align: center"&gt;aA bb&lt;/td&gt;
&lt;td style="text-align: center"&gt;aa bB&lt;/td&gt;
&lt;td style="text-align: center"&gt;aa bb&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;No need to enumerate the cases manually, since Python can handle this &lt;a href="https://en.wikipedia.org/wiki/Punnett_square"&gt;Punnett square&lt;/a&gt; quite easily, provided we take care of bypassing the ASCII-based lexicographic order that &lt;code&gt;sorted()&lt;/code&gt; returns:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;itertools&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;crossing&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Aa&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;Bb&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;repeat&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;sorted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;())))&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;crossing&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Surprisingly, the correct ratio is less than 65% for this particular problem. Here are my computations using Python:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;scipy.special&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;binom&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;foo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;p&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;binom&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;0.25&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;0.75&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;foo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;35&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We first need to compute the probability to observe $n$ Aa Bb offspring after $k$ generations. This involves a succession of Bernoulli trials until we reach the $k$-th generation, hence $\Pr(n, k) = {2^k \choose n} \left(\frac{1}{4}\right)^n \left(1-\frac{1}{4}\right)^{2^k-n}$, which we recognize as the pmf of a random variable that follows a Binomial distribution $\mathcal{B}(n,p)$, with $n=2k$ (there are two children at each step) and $p=\frac{1}{4}$ (see above). Now, we need to find the probability that &lt;em&gt;at least&lt;/em&gt; $N$ such organisms will belong to the $k$-th generation, which is $1-\sum_{x=0}^{N-1}\Pr(X=x)$, where $X$ is a random variable denoting the number of offspring, that is one minus all the cases $\Pr(X\neq N)$.&lt;/p&gt;</description></item><item><title>Prime numbers in Scheme</title><link>https://aliquote.org/post/prime-factorization/</link><pubDate>Mon, 19 Aug 2019 20:51:41 +0200</pubDate><guid>https://aliquote.org/post/prime-factorization/</guid><description>&lt;p&gt;As I said in a &lt;a href="https://aliquote.org/post/decimal-numbers/"&gt;previous post&lt;/a&gt;, a good number of Euler problems rely on number theory, henceforth prime numbers &amp;amp; Co.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Integer_factorization"&gt;Prime factorization&lt;/a&gt; consists in finding the prime factors of a given positive integer. Other than Euler problems, prime factors have interesting applications, and they are, for instance, largely used in cryptographic applications since there is only one set of prime factors for any number. The other interesting aspects of prime numbers in cryptography and encryption techniques is that factoring very large numbers is hard, and it requires a lot of computing power and time. John Cook discusses a lot of ideas and applications related to cryptography on &lt;a href="https://www.johndcook.com/blog/"&gt;his blog&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;As noted on &lt;a href="https://programmingpraxis.com/2011/09/20/project-euler-problem-3/"&gt;Programming Praxis&lt;/a&gt;, most of the problems offered on the Euler project will exceed 32-bits arithmetic for integers, so you have to rely on external libraries (e.g., &lt;a href="https://gmplib.org"&gt;gmp&lt;/a&gt;) or don&amp;rsquo;t bother at all and use PLs supporting large integers, such as Python, Lisp or Scheme. On the same blog post, you will find a nice algorithm to find the factors of a given input number $n$. In fact, &lt;a href="https://projecteuler.net/problem=3"&gt;Problem 3&lt;/a&gt; from the Euler project asks us to find the largest prime factor of the number 600851475143. That&amp;rsquo;s quite an easy task in Racket since there is a submodule related to number theory in the &lt;a href="https://docs.racket-lang.org/math/index.html?q=math"&gt;math&lt;/a&gt; module:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;require&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;largest-prime-factor&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;apply&lt;/span&gt; &lt;span class="nb"&gt;max&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;map&lt;/span&gt; &lt;span class="nb"&gt;car&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;factorize&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;largest-prime-factor&lt;/span&gt; &lt;span class="mi"&gt;600851475143&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Easy peasy, nothing but exploiting built-in functions. I should, however, note that the &lt;a href="https://docs.racket-lang.org/math/number-theory.html?q=number%20theory#%28def._%28%28lib._math%2Fnumber-theory..rkt%29._factorize%29%29"&gt;&lt;code&gt;factorize&lt;/code&gt;&lt;/a&gt; function first checks whether $n$ is large or not. In the latter case ($n&amp;gt;1000$), the &lt;a href="https://en.wikipedia.org/wiki/Pollard%27s_p_%E2%88%92_1_algorithm"&gt;Pollard method&lt;/a&gt; is used.&lt;/p&gt;
&lt;p&gt;Another common task that appears a lot (at least in the very first Euler problems) is to determine if a given number is prime or not, or what&amp;rsquo;s the largest prime number below a given integer. Primality testing can be carried out exactly, using a sieve, or approximate (or better, probabilisitic) testing can be done using, e.g., &lt;a href="https://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test"&gt;Miller-Rabin&lt;/a&gt; or Fermat test. Approximate here means that we are going to use an iterative approach to determine if a number if prime or not, but this can be refined at will (at the expense of time complexity) so we can keep accuracy under control to some extent. It can be shown that if $n$ is composite then the Miller–Rabin test declares $n$ &lt;em&gt;probably prime&lt;/em&gt; with a probability at most $4^{−k}$.&lt;/p&gt;
&lt;p&gt;Common Lisp code is available on &lt;a href="https://rosettacode.org/wiki/Miller%E2%80%93Rabin_primality_test#Common_Lisp"&gt;Rosetta&lt;/a&gt;, but you may well spend some time inspecting Steve Losh&amp;rsquo;s &lt;a href="https://github.com/sjl/euler/blob/master/src/primes.lisp"&gt;code on Github&lt;/a&gt;, it is quite instructive. The author also provides his own implementation of fast modular exponentiation, which otherwise is discussed in the SICP textbook. Indeed, Fermat&amp;rsquo;s Little Theorem says that if $n$ is a prime number and $a$ is any positive integer less than $n$, then $a$ raised to the $n$-th power is congruent to $a$ modulo $n$. The idea of the Fermat probabilistic test is thus to pick a random number $a &amp;lt; n$ and to compute the remainder of $a^n\ \text{mod}\ n$. If the result is not equal to $a$, then $n$ is certainly not prime. Otherwise, chances are good that $n$ is prime. As for Miller-Rabin test, trying more values of $a$ will increase our confidence in the result.&lt;/p&gt;
&lt;p&gt;Here is a simple version of fast modular exponentiation in Scheme available on the &lt;a href="http://community.schemewiki.org/?sicp-ex-1.27"&gt;Community Scheme Wiki&lt;/a&gt;: (Note that this is also available in the &lt;a href="https://mitpress.mit.edu/sites/default/files/sicp/full-text/book/book-Z-H-11.html#%25_sec_1.2.6"&gt;online version&lt;/a&gt; of the SICP.)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;square&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;* &lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;expmod&lt;/span&gt; &lt;span class="nv"&gt;base&lt;/span&gt; &lt;span class="nv"&gt;exp&lt;/span&gt; &lt;span class="nv"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;cond &lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nb"&gt;= &lt;/span&gt;&lt;span class="nv"&gt;exp&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nb"&gt;even? &lt;/span&gt;&lt;span class="nv"&gt;exp&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;remainder &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;square&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;expmod&lt;/span&gt; &lt;span class="nv"&gt;base&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;/ &lt;/span&gt;&lt;span class="nv"&gt;exp&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;m&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;m&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;else&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;remainder &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;* &lt;/span&gt;&lt;span class="nv"&gt;base&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;expmod&lt;/span&gt; &lt;span class="nv"&gt;base&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;- &lt;/span&gt;&lt;span class="nv"&gt;exp&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;m&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;m&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Therefrom, it is quite easy to implement Fermat primality test:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;fermat-test&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;test&lt;/span&gt; &lt;span class="nv"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;= &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;expmod&lt;/span&gt; &lt;span class="nv"&gt;a&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;a&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;iter&lt;/span&gt; &lt;span class="nv"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;&amp;lt; &lt;/span&gt;&lt;span class="nv"&gt;a&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;test&lt;/span&gt; &lt;span class="nv"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;iter&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;+ &lt;/span&gt;&lt;span class="nv"&gt;a&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="no"&gt;#f&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="no"&gt;#t&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;iter&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note that other implementations, closer to Steve Losh&amp;rsquo;s version, are available on &lt;a href="https://stackoverflow.com/q/56178778"&gt;Stack Overflow&lt;/a&gt; or &lt;a href="https://codereview.stackexchange.com/q/139221"&gt;Code Review&lt;/a&gt; (or &lt;a href="https://gist.github.com/cky/ac11c20816b41f82c13bb59bb173cbad"&gt;this gist&lt;/a&gt;). Want more on prime numbers and Scheme? You will find a lot of useful stuff packed up in this &lt;a href="https://programmingpraxis.com/contents/themes/#Prime%20Numbers"&gt;archive on Programming Praxis&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Enter the Fish shell</title><link>https://aliquote.org/post/fish-shell/</link><pubDate>Fri, 16 Aug 2019 20:30:49 +0200</pubDate><guid>https://aliquote.org/post/fish-shell/</guid><description>&lt;p&gt;Recently I decided to switch to the Fish shell, after several years of zsh&amp;rsquo;ing everythings in a terminal on my Mac, mostly iTerm by the way. Here are some thoughts after some days of use.&lt;/p&gt;
&lt;p&gt;I have been an happy Zsh user for several years, and zsh has been my main shell on my last three laptops. I used the nice &lt;a href="https://ohmyz.sh"&gt;Oh-my-zsh&lt;/a&gt; framework to add plugins and themes, although I ended up building my own PS1 prompt since none of those provided by the existing themes was to my liking. My &lt;code&gt;.zshrc&lt;/code&gt; config file evolved over time, but I never took the time required to update it to the latest updates of Zsh or Oh-my-zsh. All I did was to remove several plugins that I was barely using, notwithstanding the fact that sometimes there were some conflicts between aliases or functions defined in there and shell builtins or other config files (e.g., &lt;code&gt;.gitconfig&lt;/code&gt;).&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-08-16-20-03-46.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Yesterday, I decided to try &lt;a href="https://fishshell.com"&gt;Fish&lt;/a&gt; and I must say this was quite an happy move, especially when I found my way with setting the &lt;code&gt;$PATH&lt;/code&gt; variable correctly. Beware not to put tilde to indicate your home directory, but use an aboslute path or a predefined &lt;code&gt;$HOME&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Some of my Bash/Zsh functions needed some updates, e.g., to accomodate the fact that variable substitution (&lt;code&gt;$(var)&lt;/code&gt; becomes &lt;code&gt;(var)&lt;/code&gt;) and function arguments works differently in Fish. For instance, instead of &lt;code&gt;$1&lt;/code&gt; to capture the first argument that was passed to a function, you have to use &lt;code&gt;$argv&lt;/code&gt;, and so on. That being said, you can attach sort of docstring to your function and they will be printed in the terminal when you ask for completion using &lt;code&gt;TAB&lt;/code&gt;. Aliases are simply displayed as is in the completion menu. Here is an example with a custom function (&lt;code&gt;stata_help&lt;/code&gt;) and alias (&lt;code&gt;statadocs&lt;/code&gt;):&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-08-16-20-47-12.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Other nice features of Fish: syntax highlighting and automatic indentation is enabled when writing inline functions at the prompt; command arguments are colorized which makes it easier to identify the name of the command from its arguments when looking at the terminal at a glance; Fish is aware of your man pages (just run &lt;code&gt;fish_update_completion&lt;/code&gt; and let Fish index all of them); correct paths are highlighted (underlined) as you type, incorrect paths or commands are highlighted using a different color. Other features worth mentioning: the history is easier to use compared to the one you get with zsh (up/down arrow with a combination of &lt;code&gt;ALT&lt;/code&gt;); default themes (prompt and color scheme) are quite good&amp;ndash;actually I stopped on the &amp;ldquo;VCS informative&amp;rdquo; shell prompt and the &amp;ldquo;Just a Touch&amp;rdquo; color scheme, with &lt;a href="https://www.nordtheme.com"&gt;Nord theme&lt;/a&gt; on iTerm (as the default theme for NVim and Emacs, and VS Code, because this is the only dark theme I seem to support for syntax highlighting of code). I know there&amp;rsquo;s a &lt;a href="https://github.com/arcticicestudio/nord/issues/102"&gt;Nord theme&lt;/a&gt; in progress, but I am quite happy with the current color scheme actually. And of course, frameworks (&lt;a href="https://github.com/oh-my-fish/oh-my-fish"&gt;Oh-my-fish&lt;/a&gt;) and package manager (&lt;a href="https://github.com/jorgebucaran/fisher"&gt;Fisher&lt;/a&gt;) are available as well.&lt;/p&gt;
&lt;p&gt;All those features make working in a terminal a really pleasant experience. The little &lt;a href="https://www.iterm2.com/3.3/documentation-status-bar.html"&gt;status bar&lt;/a&gt; that you see in the above screenshots is from iTerm. Together with &lt;a href="https://iterm2.com/documentation-shell-integration.html"&gt;shell integration&lt;/a&gt;, it adds extra power to this wonderful terminal app, which already provided close to Tmux experience, but natively. I am trying to add some useful items in the status bar, e.g., displaying number of running and stopped jobs, whether we are on ssh or not, if a Python virtual env can be detected in the current working directory.&lt;/p&gt;
&lt;p&gt;My Fish config files are &lt;a href="https://github.com/even4void/dotfiles"&gt;available on Github&lt;/a&gt; if you are interested. For the time being, this is just basic stuff, with pieces stolen here and there on the web&lt;/p&gt;</description></item><item><title>Building an histogram in Lisp</title><link>https://aliquote.org/post/building-histogram-scheme/</link><pubDate>Sat, 10 Aug 2019 08:21:06 +0200</pubDate><guid>https://aliquote.org/post/building-histogram-scheme/</guid><description>&lt;p&gt;This post is a rough attempt at constructing a proper histogram for a sequence of real values, usually stored as a list or vector in Common Lisp. With minor adaptation, it should work with Scheme dialects too.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Histogram"&gt;Histograms&lt;/a&gt; allow to visually depict the distribution of a continuous variable, and they should not be confused with other graphical displays that use bar-like representation, like bar charts. This kind of statistical plot expect a discretized variable as input, and in this post we are going to focus on this very specific aspect of binning for a continuous variable. From a purely statistical and technical viewpoint, the probability that a random variable (r.v.) $X$ lies in a specific interval can be represented using the cumulative distribution function, defined as $F(x)=\Pr(X\le x)$; its inverse corresponds to the quantile function. Another well-known estimator of the probability law of an r.v. is, of course, the density function, defined as $\Pr(a&amp;lt; X\le b)=\int_a^bf(t)dt$, and an histogram is nothing else than yet another estimator of the density of a continuous r.v.. More discussion is available on &lt;a href="https://freakonometrics.hypotheses.org/57221"&gt;Arthur Charpentier&lt;/a&gt;&amp;rsquo;s excellent blog.&lt;/p&gt;
&lt;p&gt;Gnuplot has no histogram facilities, so you have to run your own implementation, as I did in one of my &lt;a href="https://aliquote.org/post/ten-years/"&gt;previous posts&lt;/a&gt;, but see also these &lt;a href="https://stackoverflow.com/a/5948573"&gt;SO&lt;/a&gt; &lt;a href="https://stackoverflow.com/a/9279630"&gt;answers&lt;/a&gt; of mine. However, R or Stata provide ready-to-use implementations of this statistical estimator as &lt;code&gt;hist&lt;/code&gt; (or better, &lt;code&gt;MASS:truehist&lt;/code&gt;) and &lt;code&gt;histogram&lt;/code&gt;. In this post, I am going to explore Common Lisp utilities to work on sequences of integer or real numbers. Indeed, Lisp comes with a class of objects, called &lt;em&gt;sequences&lt;/em&gt;, which can be lists, vectors or strings.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2022-01-17]&lt;/small&gt;&lt;br&gt;
Three years ago, I received a gentle notice by email that this post received some &lt;a href="https://www.reddit.com/r/Common_Lisp/comments/dl8uqr/building_an_histogram_in_lisp_aliquoteorg/"&gt;comments on reddit&lt;/a&gt;. I forgot to update this post, but I would like to thank the poster as well as the commenters. Thanks to lispm (and all his work for the Lisp community, btw). I use the term &lt;em&gt;sequence&lt;/em&gt; inappropriately when I mostly deal with lists therefrom.
&lt;/div&gt;
&lt;p&gt;The &lt;a href="https://www.common-lisp.net/project/iterate/"&gt;iterate&lt;/a&gt; or &lt;a href="https://github.com/keithj/alexandria"&gt;Alexandria&lt;/a&gt; packages are two among many of the packages that provide utilities to manipulate such objects. For instance, using Alexandria it is quite easy to get a permuted series of values stored in a list:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;ql:quickload&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;alexandria&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defparameter&lt;/span&gt; &lt;span class="nv"&gt;s&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;alexandria:shuffle&lt;/span&gt; &lt;span class="nv"&gt;s&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note that it also works with strings (try replacing the previous list of integers with &lt;code&gt;&amp;quot;random string&amp;quot;&lt;/code&gt;). Now, we need to design a little helper function that will discretize a continuous variable in $k$ buckets of data, if the list is non-empty of course. Here it is&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defun&lt;/span&gt; &lt;span class="nv"&gt;emptyp&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;eq&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt; &lt;span class="nv"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defun&lt;/span&gt; &lt;span class="nv"&gt;slice&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;a&lt;/span&gt; &lt;span class="nv"&gt;b&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt; &lt;span class="k"&gt;&amp;amp;optional&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;ys&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;()))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;Take a subsequence out of a sequence `xs&amp;#39;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cond&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;a&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;slice&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;1-&lt;/span&gt; &lt;span class="nv"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;b&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;cdr&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;ys&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;b&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;slice&lt;/span&gt; &lt;span class="nv"&gt;a&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;1-&lt;/span&gt; &lt;span class="nv"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;cdr&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;cons&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;car&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;ys&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;reverse&lt;/span&gt; &lt;span class="nv"&gt;ys&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defun&lt;/span&gt; &lt;span class="nv"&gt;split&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;predicate&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;Split a sequence `xs&amp;#39; into two sublists according to a predicate [https://stackoverflow.com/a/18117017].&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;loop&lt;/span&gt; &lt;span class="nv"&gt;for&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="nv"&gt;in&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;funcall&lt;/span&gt; &lt;span class="nv"&gt;predicate&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;collect&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="nv"&gt;into&lt;/span&gt; &lt;span class="nv"&gt;in&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;else&lt;/span&gt; &lt;span class="nv"&gt;collect&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="nv"&gt;into&lt;/span&gt; &lt;span class="nv"&gt;out&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;finally&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;values&lt;/span&gt; &lt;span class="nv"&gt;in&lt;/span&gt; &lt;span class="nv"&gt;out&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defun&lt;/span&gt; &lt;span class="nv"&gt;binning&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;xs&lt;/span&gt; &lt;span class="k"&gt;&amp;amp;key&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;len&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;Convert a sequence of numbers `xs&amp;#39; into packets of size `len&amp;#39; or `bins&amp;#39; packets.&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;unless&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="nv"&gt;len&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let*&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nv"&gt;lower&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;apply&lt;/span&gt; &lt;span class="nf"&gt;#&amp;#39;min&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;upper&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;apply&lt;/span&gt; &lt;span class="nf"&gt;#&amp;#39;max&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;step&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;+&lt;/span&gt; &lt;span class="nv"&gt;lower&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;-&lt;/span&gt; &lt;span class="nv"&gt;upper&lt;/span&gt; &lt;span class="nv"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;len&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;multiple-value-bind&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;bin&lt;/span&gt; &lt;span class="nf"&gt;rest&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;split&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;lambda&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="nb"&gt;step&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;cons&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;length&lt;/span&gt; &lt;span class="nv"&gt;bin&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;binning&lt;/span&gt; &lt;span class="nf"&gt;rest&lt;/span&gt; &lt;span class="ss"&gt;:len&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;1-&lt;/span&gt; &lt;span class="nv"&gt;len&lt;/span&gt;&lt;span class="p"&gt;)))))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;There may be better alternatives to split the data into buckets, e.g. &lt;a href="https://common-lisp.net/project/bese/arnesi.html"&gt;&lt;code&gt;arnesi&lt;/code&gt;&lt;/a&gt;&lt;code&gt;:partition&lt;/code&gt; or &lt;a href="https://github.com/cl21/cl21/blob/c36644f3b6ea4975174c8ce72de43a4524dd0696/src/core/sequence.lisp#L1243"&gt;&lt;code&gt;cl21&lt;/code&gt;&lt;/a&gt;&lt;code&gt;:partition-if&lt;/code&gt;, as well as solutions to &lt;a href="https://stackoverflow.com/q/47875185"&gt;split list into sublists&lt;/a&gt; discussed on SO. Note also that Alexandria provides an &lt;code&gt;emptyp&lt;/code&gt; function. Finally, the &lt;code&gt;slice&lt;/code&gt; function (adapted from &lt;a href="https://stackoverflow.com/a/35534477"&gt;code available&lt;/a&gt; in Scheme) could be used to restrict the values to a specific range in the list, as when computing a trimmed mean, for instance. Even if it stands minimalistic the above code works, at least the function returns the correct counts. Here is an example of use:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;binning&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ss"&gt;:binsize&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;binning&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ss"&gt;:binsize&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Please note that we are lacking some critical information, namely the labels for each bucket counts, i.e. the range of values of &lt;code&gt;xs&lt;/code&gt; corresponding to each count. It would also be nice to compute an optimal number of bins automagically, e.g., using &lt;a href="https://en.wikipedia.org/wiki/Histogram#Sturges'_formula"&gt;Sturge&amp;rsquo;s formula&lt;/a&gt; or Scott&amp;rsquo;s normal reference rule.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; Here is one way to apply the latter (outside the function body, though), using a more realistic sample of size $n=100$ of random uniform or gaussian draws from the &lt;a href="https://common-lisp.net/project/gsll/"&gt;GSLL package&lt;/a&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;ql:quickload&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;gsll&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defvar&lt;/span&gt; &lt;span class="vg"&gt;*rng*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;gsl:make-random-number-generator&lt;/span&gt; &lt;span class="nv"&gt;gsl:+mt19937+&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defparameter&lt;/span&gt; &lt;span class="nv"&gt;σ&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;coerce&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;double-float&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defparameter&lt;/span&gt; &lt;span class="nv"&gt;xu&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;loop&lt;/span&gt; &lt;span class="nv"&gt;repeat&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="nv"&gt;collect&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;gsl:sample&lt;/span&gt; &lt;span class="vg"&gt;*rng*&lt;/span&gt; &lt;span class="ss"&gt;:uniform&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defparameter&lt;/span&gt; &lt;span class="nv"&gt;xn&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;loop&lt;/span&gt; &lt;span class="nv"&gt;repeat&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="nv"&gt;collect&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;gsl:sample&lt;/span&gt; &lt;span class="vg"&gt;*rng*&lt;/span&gt; &lt;span class="ss"&gt;:gaussian&lt;/span&gt; &lt;span class="ss"&gt;:sigma&lt;/span&gt; &lt;span class="nv"&gt;σ&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defparameter&lt;/span&gt; &lt;span class="nv"&gt;bins&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;1+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;ceiling&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;length&lt;/span&gt; &lt;span class="nv"&gt;xu&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;binning&lt;/span&gt; &lt;span class="nv"&gt;xu&lt;/span&gt; &lt;span class="ss"&gt;:len&lt;/span&gt; &lt;span class="nv"&gt;bins&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;binning&lt;/span&gt; &lt;span class="nv"&gt;xn&lt;/span&gt; &lt;span class="ss"&gt;:len&lt;/span&gt; &lt;span class="nv"&gt;bins&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And here are the results I got when running this code in CCL REPL:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;11&lt;/span&gt; &lt;span class="mi"&gt;14&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt; &lt;span class="mi"&gt;13&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt; &lt;span class="mi"&gt;11&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="mi"&gt;14&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt; &lt;span class="mi"&gt;28&lt;/span&gt; &lt;span class="mi"&gt;21&lt;/span&gt; &lt;span class="mi"&gt;17&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;The R statistical package uses Sturge&amp;rsquo;s formula, meaning the default number of bins is computed as $\lceil \log_2(n)\rceil + 1$. Stata considers $\text{min}\left\{\sqrt{N},10\ln(N)/\ln(10)\right\}$, which is close. The &lt;a href="https://en.wikipedia.org/wiki/Freedman%E2%80%93Diaconis_rule"&gt;Freedman-Diaconis&lt;/a&gt; rule is also quite robust, where the bin width is chosen as $h=2\times\text{IQR}\times n^{-\frac{1}{3}}$ (IQR, interquartile range), so that the number of bins is $(\text{max}-\text{min})/h$.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Not so random links from August</title><link>https://aliquote.org/post/not-so-random-links-002/</link><pubDate>Thu, 08 Aug 2019 19:45:23 +0200</pubDate><guid>https://aliquote.org/post/not-so-random-links-002/</guid><description>&lt;p&gt;Some not so random links found on Twitter or elsewhere that I haven&amp;rsquo;t had time to put on the Micro section.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.keithbradnam.com/blog/2013/10/14/migrating-from-gmail-to-fastmail-part-2.html"&gt;Migrating from Gmail to FastMail&lt;/a&gt; (part 2): My Gmail became my very own garbage account, where almost every incoming mail is guaranteed to end up in the trash can, and I am aware many others switched over Fastmail or Proton, or are running their own mail server. I was surprised to learn that such move did occur as soon as 2013, as exemplified in this interesting blog post.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Unfortunately, I lost the reference on Twitter, but I happened to see this link a few days ago: &lt;a href="http://fisher.utstat.toronto.edu/dfraser/documents/5.pdf"&gt;Normal samples ith linear constraints and given variances&lt;/a&gt; (PDF, 4 pp.). The author describes an algorithm to generate normal variates $x_1, x_2,\dots, x_n$ satisfying $k$ linear and independant relations $\sum_{j=1}^n a_{pj}x_j=0$ ($p=n-k+1,\dots,n$) with a given variance structure $\text{var}(x_i)=v_i$, $i=1,2,\dots,n$.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Perhaps you have seen the controversy about the precedence of mathematical operators to calculate, for example, &lt;code&gt;6/2(2+1)&lt;/code&gt;. In this case, do you think the result should be 9 or 1? Julia returns 1 while I would have said 9. Here is why: &lt;a href="https://github.com/JuliaLang/julia/pull/21800"&gt;Clarify precedence of numeric literal coefs over parenthesis&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Tries are interesting sorted-sequence data structure in that they are designed specifically for string keys. Indeed, tries are trees whose edges are labeled by characters or strings, and the characters along a root-leaf path represent a key. Using appropriate data structures for the inner nodes, a trie can be searched in time $\mathcal{O}(s)$ for a string of size $s$.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; There is a tight connection to &lt;a href="https://en.wikipedia.org/wiki/Radix_sort"&gt;radix sort&lt;/a&gt;. The &lt;a href="https://github.com/mafintosh/hypertrie"&gt;hypertrie&lt;/a&gt; project provides a distributed single writer key/value store in javascript, that depends on &lt;a href="https://github.com/mafintosh/hypercore"&gt;hypercore&lt;/a&gt;. The latter is one of the core pilar of the &lt;a href="https://dat.foundation"&gt;dat project&lt;/a&gt; (see Tom MacWright&amp;rsquo;s review of the &lt;a href="https://tmcw.github.io/2017/07/20/decentralize-your-website.html"&gt;decentralized web&lt;/a&gt;), which I heard again recently because a guy processed several Gig of Wikipedia offline using a local dat dataset over personal wifi. Sidenote: If you are interested in trees and Racket, be sure to check Matt Might&amp;rsquo;s post on &lt;a href="http://matt.might.net/articles/red-black-delete/"&gt;red-black trees&lt;/a&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; &lt;blockquote class="twitter-tweet"&gt;&lt;p lang="en" dir="ltr"&gt;&lt;a href="https://twitter.com/pfrazee?ref_src=twsrc%5Etfw"&gt;@pfrazee&lt;/a&gt;: &amp;#39;New Dat 2.0 bench: Wikipedia served over the Wifi! No cached data, 11 million files across 2 directories. Pages rendered in 1-3s! (More details in this thread) &amp;#39; &lt;a href="https://t.co/3TqzVZMN3G"&gt;pic.twitter.com/3TqzVZMN3G&lt;/a&gt;&lt;/p&gt;&amp;mdash; Alexander Boldakov (@boldakov) &lt;a href="https://twitter.com/boldakov/status/1159013757915475970?ref_src=twsrc%5Etfw"&gt;August 7, 2019&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async src="https://platform.twitter.com/widgets.js" charset="utf-8"&gt;&lt;/script&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://cedricscherer.netlify.com/2019/05/17/the-evolution-of-a-ggplot-ep.-1/"&gt;The Evolution of a ggplot&lt;/a&gt;: Nice wrap-up of how to customize a ggplot graphic. I personally liked the way the authors started with a basic boxplot and improve it in several directions, going so far as to include a tile map legend.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Still some papers to read before I go back to work: &lt;a href="https://www.frontiersin.org/articles/10.3389/frma.2018.00018/full"&gt;25 Years of Molecular Biology Databases: A Study of Proliferation, Impact, and Maintenance&lt;/a&gt;, &lt;a href="https://academic.oup.com/bib/advance-article/doi/10.1093/bib/bbz063/5519426"&gt;Machine Learning and Statistical Methods for Clustering Single Cell RNA-sequencing Data&lt;/a&gt; (with &lt;a href="https://github.com/kuanglab/single-cell-review"&gt;code on Github&lt;/a&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You know how happy I am with Emacs. Still I cannot resist looking at what others are actually using as their main text editors. Just recently I heard about &lt;a href="https://gtoolkit.com"&gt;Glamorous Toolkit&lt;/a&gt;, which looks like lot of fun to navigate a codebase, and even provides live and debuggable notebooks.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In my last &lt;a href="https://aliquote.org/post/newton-raphson-racket/"&gt;post on Newton&amp;rsquo;s method&lt;/a&gt;, I mentioned a simple algorithm to find the approximate square root of a number: Let&amp;rsquo;s say you are interested in finding the square root $x=\sqrt{a}$, $a&amp;gt;0$. One way to do this is to start with a reasonable first guess, $x_1&amp;gt;0$, and iterate with the following approximation: $x_{n+1}=\frac{1}{2}\left(x_n+\frac{a}{x_n}\right)$. This approach was first proposed by Babylonians, who also happened to invent multiplications. A nice alternative to standard multiplication is the so-called Karatsuba method, which offers a nice compromise between additions and multiplications so that overall there are less than $n^2$ steps to perform. Karatsuba approach is discussed in Don Knuth&amp;rsquo;s TAOCP, as well as in &lt;a href="https://www.cambridge.org/core/books/modern-computer-algebra/DB3563D4013401734851CF683D2F03F0"&gt;&lt;em&gt;Modern Computer Algebra&lt;/em&gt;&lt;/a&gt;, by Joachim von zur Gathen &amp;amp; Jürgen Gerhard. Later, Schönhage and Strassen provided an even better algorithm, partly based on FFT. Finally, Harvey and van der Hoeven proposed an algorithm that allows to perform &lt;a href="https://www.quantamagazine.org/mathematicians-discover-the-perfect-way-to-multiply-20190411/"&gt;multiplication of very large numbers in $n\log(n)$ steps&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/KaratsubaMethod_560-1065x1720.jpg"&gt;
&lt;/figure&gt;
&lt;ul&gt;
&lt;li&gt;TIL the &lt;a href="https://www.linuxjournal.com"&gt;Linux Journal&lt;/a&gt; has reached the end of its existence. Sad news for the FOSS community.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Mehlhorn, K. and Sanders, P., &lt;em&gt;Algorithms and Data Structures&lt;/em&gt;. Springer, 2010.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Newton-Raphson algorithm in Racket</title><link>https://aliquote.org/post/newton-raphson-racket/</link><pubDate>Thu, 08 Aug 2019 10:31:22 +0200</pubDate><guid>https://aliquote.org/post/newton-raphson-racket/</guid><description>&lt;p&gt;Here is an implementation of the Newton-Raphson algorithm in Racket Scheme.&lt;/p&gt;
&lt;p&gt;Our goal is to implement a toy example of logistic regression, where the parameters of the statistical model are estimated using Newton-Raphson iterative algorithm. This approach basically looks &lt;a href="https://gist.github.com/dirkschumacher/7acfb6f9a72bb940634d8f9e9c867dd0"&gt;like this&lt;/a&gt; in R: (For more details, please refer to the following blog post: &lt;a href="https://www.puzzlr.org/write-your-own-logistic-regression-function-in-r/"&gt;Write your own logistic regression function in R&lt;/a&gt;.)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;log_reg&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="kr"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;X&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;beta&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;rep.int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;ncol&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;X&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kr"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="kr"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;seq_len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;100&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;b_old&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="n"&gt;beta&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;alpha&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="n"&gt;X&lt;/span&gt; &lt;span class="o"&gt;%*%&lt;/span&gt; &lt;span class="n"&gt;beta&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;exp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;alpha&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;W&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;as.numeric&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;XtX&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;crossprod&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;X&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;diag&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;W&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%*%&lt;/span&gt; &lt;span class="n"&gt;X&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;score&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;t&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;X&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%*%&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;delta&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nf"&gt;solve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;XtX&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;score&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;beta&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="n"&gt;beta&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;delta&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kr"&gt;return&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;beta&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The Newton algorithm belongs to root finding methods, and it is usually employed with a univariate function, $f$, for which we want to find, say, its zeros or its maximum. In the above case, we seek the maximum of a given function&amp;ndash;this is maximum likelihood theory after all. Recall that when we want to find an approximate root of $f(x)=0$, we usually start with a guess, say $x_n$, and we approximate $f(x)$ by its tangent line $f(x_n)+f&amp;rsquo;(x_n)(x-x_n)$. This is basically how Newton&amp;rsquo;s method looks like, and this yields an improved guess, $x_{n+1}=x_n-\frac{f(x_n)}{f&amp;rsquo;(x_n)}$, based on the root found for the tangent.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; It is pretty straightforward to write a little recursive solution to this problem, e.g. in Racket:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; f(x) = x^2 - 9&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;sqr&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; f&amp;#39;(x) = 2x&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fp&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; increase tolerance (1e-6) if you want more accurate answer&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;newton&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="n"&gt;fp&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;-&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fp&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;abs&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;-&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="n"&gt;guess&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="mf"&gt;1e-6&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;newton&lt;/span&gt; &lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="n"&gt;fp&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;guess&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;display&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;newton&lt;/span&gt; &lt;span class="mf"&gt;0.1&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="n"&gt;fp&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now, suppose we are interested in finding the maximum of a given function, $f(x)$. Let us assume that $f&amp;rsquo;$ is continuously differentiable, and that $f&amp;rsquo;&amp;rsquo;(x^{\star})\neq 0$, with $x^{\star}$ the root we are looking for. Maximizing $f$ amounts to find the root of $f&amp;rsquo;(x)$, which is depicted in the next picture, and at each step we will approximate $f&amp;rsquo;(x^{\star})$ with the linear Taylor expansion $f&amp;rsquo;(x^{\star})\approx f&amp;rsquo;(x^{(t)}) + \left(x^{\star}-x^{(t)}\right)f&amp;rsquo;&amp;rsquo;(x^{(t)})$ ($=0$).&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-08-08-07-34-04.png"&gt;
&lt;/figure&gt;
&lt;p&gt;As can be seen, the derivative $f&amp;rsquo;$ is approximated by its tangent at $x^{(t)}$, so that we will approximate its root by the root of the tangent line (highlighted as a black dot in the above picture). Hence, we have:&lt;/p&gt;
&lt;p&gt;$$ x^{\star} = x^{(t)} - \frac{f&amp;rsquo;(x^{(t)})}{f&amp;rsquo;&amp;rsquo;(x^{(t)})} = x^{(t)} + h^{(t)}, $$&lt;/p&gt;
&lt;p&gt;where $h^{(t)}$ is a refinement to the current guess at step $t$, $x^{(t)}$. The updating equation for Newton-Raphson is then simply $x^{(t+1)}=x^{(t)}+h^{(t)}$, which is the very last line in the for loop in the R function above. (I don&amp;rsquo;t know why the authors used the temporary variable &lt;code&gt;b_old&lt;/code&gt;, BTW.) Note that $h^{(t)} = -\frac{f&amp;rsquo;(x^{(t)}}{f&amp;rsquo;&amp;rsquo;(x^{(t)}}$. In this particular case, this optimization problem amounts to find the MLE $\hat\theta$, where $\theta$ is the parameter of interest in the statistical model, and $f$ is the likelihood function.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; It can be shown that the Newton&amp;rsquo;s method has quadratic convergence, which means that the precision of the solution will usually double with each iteration.&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;The logistic model can be written as $\log\left(\frac{p}{1-p}\right) = \beta_0 + \beta_1X_1+\beta_2X_2$, for two fixed predictors $X_1$ and $X_2$. Individual probabilities $p_i$ ($i=1,\dots,n$) are a function of both the vectors $x_i$ and $\beta$, and as formulated above, the model implies that $p_i=\frac{\exp(x_i^T\beta)}{1+\exp(x_i^T\beta)}$. It can be shown that the likelihood reads:&lt;/p&gt;
&lt;p&gt;$$ \ell(\beta) = \sum_{i=1}^n\left\{ y_i(x_i^T\beta) - \log\left(1+\exp(x_i^T\beta)\right) \right\}, $$&lt;/p&gt;
&lt;p&gt;and to maximize this likelihood function we need to compute the score function&amp;mdash;this is the variable &lt;code&gt;score&lt;/code&gt; in the R code&amp;mdash;which is the derivative of $\ell$ with respect to $\beta$ parameters (in this example, we only considered two predictors):&lt;/p&gt;
&lt;p&gt;$$ \frac{\partial\ell}{\partial\beta} = \begin{bmatrix}\frac{\partial\ell}{\partial\beta_0} \cr \frac{\partial\ell}{\partial\beta_1} \cr \frac{\partial\ell}{\partial\beta_2} \end{bmatrix} = \underbrace{\boldsymbol{X}^T(y-\boldsymbol{p})}_{\texttt{t(X) %*% (y - p)}}. $$&lt;/p&gt;
&lt;p&gt;We also need the second derivative, $\frac{\partial^2\ell}{\partial\beta_j\partial\beta_k}$, which can be written:&lt;/p&gt;
&lt;p&gt;$$ \frac{\partial}{\partial\beta_k}\frac{\partial\ell(\beta)}{\partial\beta_j} = \sum_{i=1}^n\left\{x_{ij}\left(y_i-\frac{\partial p_i(x_i,\beta)}{\partial\beta_k}\right) \right\}. $$&lt;/p&gt;
&lt;p&gt;In matrix notation, we would write $\frac{\partial^2\ell}{\partial\beta^2} = -\boldsymbol{X}^T\boldsymbol{W}\boldsymbol{X}$ (see also the &lt;a href="https://www.puzzlr.org/write-your-own-logistic-regression-function-in-r/"&gt;blog cited&lt;/a&gt; at the beginning of the post), where $\boldsymbol{W}$ is an $n$-by-$n$ diagnoal matrix where the $i$-th diagonal element equals $p_i(1-p_i)$, whence the code &lt;code&gt;XtX &amp;lt;- crossprod(X, diag(W) %*% X)&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;In the end, we would like to estimate the parameters of the logistic model fitted to the dataset shown below (observed and fitted values; see handout 3 in the &lt;a href="https://github.com/even4void/rstats-biostats"&gt;rstats-biostats&lt;/a&gt; project for R code and a brief description of the data):&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-08-06-10-02-00.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Other than basic mathematical operators and functions, the most important piece of code we need is an equivalent of &lt;code&gt;crossprod&lt;/code&gt;, the matrix &lt;a href="https://en.wikipedia.org/wiki/Cross_product"&gt;cross-product&lt;/a&gt;, and &lt;code&gt;solve&lt;/code&gt;, which is used to solve a system of equations. Luckily, both procedures are available in &lt;a href="https://docs.racket-lang.org/math/matrices.html"&gt;racket/math&lt;/a&gt;. The instructions inside the R loop could thus be translated literally using untyped Racket as follows:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;#lang &lt;/span&gt;&lt;span class="nn"&gt;racket&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;require&lt;/span&gt; &lt;span class="n"&gt;math/matrix&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; data definition&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;beta&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;col-matrix&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;col-matrix&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;0.01923077&lt;/span&gt; &lt;span class="mf"&gt;0.06746032&lt;/span&gt; &lt;span class="mf"&gt;0.04225352&lt;/span&gt; &lt;span class="mf"&gt;0.05904059&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="mf"&gt;0.08633094&lt;/span&gt; &lt;span class="mf"&gt;0.09411765&lt;/span&gt; &lt;span class="mf"&gt;0.16161616&lt;/span&gt; &lt;span class="mf"&gt;0.18604651&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;X&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;matrix&lt;/span&gt; &lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;111.5&lt;/span&gt; &lt;span class="mf"&gt;121.5&lt;/span&gt; &lt;span class="mf"&gt;131.5&lt;/span&gt; &lt;span class="mf"&gt;141.5&lt;/span&gt; &lt;span class="mf"&gt;151.5&lt;/span&gt; &lt;span class="mf"&gt;161.5&lt;/span&gt; &lt;span class="mf"&gt;176.5&lt;/span&gt; &lt;span class="mf"&gt;191.5&lt;/span&gt;&lt;span class="p"&gt;]]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;alpha&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;matrix*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;matrix-transpose&lt;/span&gt; &lt;span class="n"&gt;X&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;beta&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; helper functions&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;logit&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;exp&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;-&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;complement&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; scoring matrix&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;matrix-map&lt;/span&gt; &lt;span class="n"&gt;logit&lt;/span&gt; &lt;span class="n"&gt;alpha&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;W&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;matrix-map&lt;/span&gt; &lt;span class="nb"&gt;*&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;matrix-map&lt;/span&gt; &lt;span class="n"&gt;complement&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;XtX&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;matrix*&lt;/span&gt; &lt;span class="n"&gt;X&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;matrix*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;diagonal-matrix&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;matrix-&amp;gt;list&lt;/span&gt; &lt;span class="n"&gt;W&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;matrix-transpose&lt;/span&gt; &lt;span class="n"&gt;X&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;score&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;matrix*&lt;/span&gt; &lt;span class="n"&gt;X&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;matrix-map&lt;/span&gt; &lt;span class="nb"&gt;-&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;delta&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;matrix-solve&lt;/span&gt; &lt;span class="n"&gt;XtX&lt;/span&gt; &lt;span class="n"&gt;score&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This code yields exactly the same results as a first pass in the R loop of &lt;code&gt;log_reg&lt;/code&gt;. Given how easy it is to go from a for loop to recursive function calls, these five steps can easily be wrapped into a proper function using local &lt;code&gt;let*&lt;/code&gt; bindings. Note that there exist &lt;a href="https://docs.racket-lang.org/math/matrix_conversion.html"&gt;various converters&lt;/a&gt; that help to go from list or vector to matrix that we could use instead, and more importantly, there is even a &lt;a href="https://alex-hhh.github.io/2018/08/racket-data-frame.html"&gt;data frame package&lt;/a&gt; (developped by Alex Harsányi) which could further simplifies all the data mockup.&lt;/p&gt;
&lt;p&gt;And that&amp;rsquo;s it! An interesting alternative would be to implement the &lt;a href="https://arxiv.org/pdf/1306.0040.pdf"&gt;EM algorithm&lt;/a&gt; for logistic regression, proposed by Scott and Sun.&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;This method can be used to solve, e.g., $x^2=a$ (which is to say $f(x) = x^2-a$), that is to find the square root $x=\sqrt{a}$, $a&amp;gt;0$. An even older method would consider a first guess, $x_1&amp;gt;0$, and iterate with the following approximation: $x_{n+1}=\frac{1}{2}\left(x_n+\frac{a}{x_n}\right)$.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;Still in the case of an MLE problem, replacing $-f&amp;rsquo;&amp;rsquo;(\theta^{(t)})$ in the denominator with the expected Fisher information evaluated at $\theta^{(t)}$, $I(\theta^{(t)})$, yields the Fisher scoring method, which has the same asymptotic properties as Newton&amp;rsquo;s method, although the latter works generally better to refine the last estimates. For a more specific case, see this old post of mine on &lt;a href="https://aliquote.org/post/penalized-likelihood-regression"&gt;penalized regression&lt;/a&gt;.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:3"&gt;
&lt;p&gt;Givens, G.H. and Hoeting, J.A. &lt;em&gt;Computational Statistics&lt;/em&gt; (2nd ed.), Wiley, 2013.&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Decimal numbers</title><link>https://aliquote.org/post/decimal-numbers/</link><pubDate>Tue, 06 Aug 2019 20:19:29 +0200</pubDate><guid>https://aliquote.org/post/decimal-numbers/</guid><description>&lt;p&gt;A lot of &lt;a href="https://aliquote.org/tags/euler/"&gt;Euler problems&lt;/a&gt; can be solved or best understood using number theory or algebra. Decimal numbers also play a particular role in several of these challenges. Here are a few properties that may prove useful in thinking about some of Euler problems.&lt;/p&gt;
&lt;p&gt;As for a simple definition, we will say that a decimal number is a rational number which can be written in fractional form as $\tfrac{a}{10^n}$, $a \in \mathbb{Z}$ and $n \in \mathbb{N}$. Note that this set, $\mathbb{D}$, is a &lt;a href="https://en.wikipedia.org/wiki/Ring_(mathematics)#Subring"&gt;subring&lt;/a&gt; of $\mathbb{Q}$, the set of rationals, which means that addition, difference and product of two decimal numbers yield a decimal number. The main interest in decimal numbers lies in the fact that they can be written and manipulated using base-10 notation. Let $x=\frac{a}{10^n}$ be a decimal number, with $a &amp;gt; 0$ and $n \ge 0$. Since we can express $a$ using base-10 notation as:&lt;/p&gt;
&lt;p&gt;$$ a = \sum_{i=0}^m = a_m \times 10^m + a_{m-1} \times 10^{m-1} + \dots + a_1 \times 10 + a_0, $$&lt;/p&gt;
&lt;p&gt;with $m \ge 0$ and $0\le a_i\le 9$ ($a_m \neq 0$). A common shorthand is to write $a = \overline{a_m \dots a_0}$, following the notation used by Daniel Perrin.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; Hence, we can re-express $x$ as&lt;/p&gt;
&lt;p&gt;$$ x = \sum_{i=0}^m = a_m \times 10^{m-n} + \dots + a_{n+1} \times 10 + a_n + \frac{a_{n-1}}{10} + \dots + \frac{a_0}{10^n}, $$&lt;/p&gt;
&lt;p&gt;with the following shorthand notation: $\overline{a_ma_{m-1}\dots a_{n+1}a_n,a_{n-1}\dots a_0}$, where $0\le\overline{0,a_{n-1}\dots a_0}&amp;lt;1$ is called the decimal part of $x$.&lt;/p&gt;
&lt;p&gt;It is worth remembering that $\tfrac{1}{3}$ is not a decimal number, and more generally that a rational number is decimal if and only if its denominator only admits 2 and 5 as prime factors.&lt;/p&gt;
&lt;p&gt;Note that a decimal number have a limited number of decimals (exactly $n$ if $a$ is not a multiple of 10), unlike the case where we approximate a rational number using decimal development. Consider $x=\frac{a}{b}\in\mathbb{Q}$ and $x_n=\frac{q_n}{10^n}$, the decimal value approximated to within $10^{-n}$ of $x$. For $n\ge 0$, $10^na=bq_n+r_n$, $0\le r_n &amp;lt; b$, and there exists an integer $0\le a_{n+1}\le 9$ such that $q_{n+1} = 10q_n + a_{n+1}$. This integer, $a_{n+1}$ is simply the quotient of the euclidean division of $10r_n$ by $b$: $10r_n = ba_{n+1}+r_{n+1}$, with $0\le r_{n+1} &amp;lt; b$. This means that the $n$ first figures of the decimal part of a number approximated to within $10^{-(n+1)}$ are the same as those of the same number approximated to within $10^{-n}$.&lt;/p&gt;
&lt;p&gt;Some interesting properties of decimal numbers follow. Let $\frac{a}{10^m}$ and $\frac{b}{10^n}$ be two decimal numbers, with $m\le n$. Then,&lt;/p&gt;
&lt;p&gt;$$ \frac{a}{10^m} + \frac{b}{10^n} = \frac{10^{n-m}a+b}{10^n}, \text{and}, \frac{a}{10^m}\frac{b}{10^n} = \frac{ab}{10^{m+n}}. $$&lt;/p&gt;
&lt;p&gt;Quick application: Suppose you want to multiply 2.13 by 0.7; it is enough to compute $213\times 7=1491$ (in $\mathbb{N}$), and to add a comma to the right place which is determined by the value of the denominator $10^{(2+1)}$, whence the result 1.491.&lt;/p&gt;
&lt;p&gt;The other interesting property of decimal numbers is that we can quickly tell which one of two numbers is the highest. Let us assume that we have two such numbers, $x$ and $y$, both positive or null. If $\lfloor x\rfloor &amp;lt; \lfloor y\rfloor$, then $x &amp;lt; y$. Moreover, if $0\le x &amp;lt; 1$ and $0\le y &amp;lt; 1$, $x$ and $y$ can be rewritten as $x=\overline{0.a_1\dots a_r}$ and $y=\overline{0.b_1\dots b_s}$. Let $m$ be the lowest integer $\ge 1$ such that $a_m\neq b_m$&amp;mdash;which means that $a_i=b_i,,\forall i&amp;lt;m$&amp;mdash;then if $a_m&amp;lt;b_m$ we have $x&amp;lt;y$. To sum up: when comparing two decimal numbers, first compare their integer part, and if they are not equal then proceed with the decimal parts, $x-\lfloor x\rfloor$ and $y-\lfloor y\rfloor$, which are decimal numbers comprised between 0 and 1. What we just wrote in plain English can readily be translated into a recursive algorithm, obviously.&lt;/p&gt;
&lt;p&gt;A common pattern is to extract the fractional part of a number and to store each digit in a list. Basically, there are two ways to do this: either we convert the decimal number to a string, extract each digit as a character, and convert it back to a number; or we use a simple decomposition of the decimal number using base-10 quotient and remainder. Here is one way to do this using proper arithmetic in Racket:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;digits&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;zero?&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;null&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cons&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;remainder&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;digits&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;quotient&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)))))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;small&gt;(The &lt;code&gt;quotient&lt;/code&gt; and &lt;code&gt;remainder&lt;/code&gt; procedures are bundled in the &lt;code&gt;base&lt;/code&gt; module.)&lt;/small&gt;&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2023-05-03]&lt;/small&gt;&lt;br&gt;
See also &lt;a href="https://cookbook.scheme.org/convert-integer-to-list-of-digits/"&gt;Convert integer to list of digits&lt;/a&gt; on the Scheme Cookbook for some other alternatives.
&lt;/div&gt;
&lt;p&gt;It turns out that the above procedure is easier to read and quite more efficient than converting character to number, although digits are given in reverse order. However, it is not difficult to &lt;code&gt;reverse&lt;/code&gt; the list afterwards, or to adapt the code if timing is a critical element. You can then &lt;code&gt;apply&lt;/code&gt;, &lt;code&gt;map&lt;/code&gt; or &lt;code&gt;filter&lt;/code&gt; the resulting list of digits at will. Here is a working example using a few decimals of $\pi$:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;inexact-&amp;gt;exact&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;floor&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;1e9&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;-&lt;/span&gt; &lt;span class="nb"&gt;pi&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;floor&lt;/span&gt; &lt;span class="nb"&gt;pi&lt;/span&gt;&lt;span class="p"&gt;))))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;digits&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note that &lt;code&gt;pi&lt;/code&gt; is a built-in constant in Racket; other Scheme implementations may differ, e.g. using Chez Scheme you will have to &lt;code&gt;(define pi (* (asin 1) 2))&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;A related task consists in applying &lt;a href="https://stackoverflow.com/q/3602827"&gt;signed integer (truncating) division&lt;/a&gt;, which can be defined as follows:&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;$$ n \div d = \begin{cases}\lfloor \frac{n}{d}\rfloor, &amp;amp; \mbox{if } d \neq 0, nd\ge 0\cr \lceil \frac{n}{d} \rceil, &amp;amp; \mbox{if } d\neq 0, nd &amp;lt; 0 \end{cases} $$&lt;/p&gt;
&lt;p&gt;This is known as the &lt;code&gt;div&lt;/code&gt; operator in many languages. Unfortunately, there is nothing like this in Scheme, so you will have to use a combination of &lt;code&gt;/&lt;/code&gt; and &lt;code&gt;floor&lt;/code&gt;.&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Perrin, Daniel, &lt;em&gt;Mathématiques d&amp;rsquo;école : nombres, mesures et géométrie&lt;/em&gt;, Cassini, 2005.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;Warren, Henri S. Jr., &lt;em&gt;Hacker&amp;rsquo;s Delight&lt;/em&gt;, Pearson Education, 2003.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Power series and Fibonacci sequence</title><link>https://aliquote.org/post/power-series/</link><pubDate>Wed, 31 Jul 2019 09:07:29 +0200</pubDate><guid>https://aliquote.org/post/power-series/</guid><description>&lt;p&gt;Here is a little fact about Fibonacci numbers and their relation to some power series.&lt;/p&gt;
&lt;p&gt;Let us assume a fair coin is tossed independently until two consecutive heads are observed.&lt;sup&gt;&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/sup&gt; The number of trials required to observe two heads follows a negative binomial distribution. We have to wait longer to observe the two heads in immediate succession. Consider the sequence $HTTHTHH$ and let $X+2$ be the number of trials required. Then in this case $X=5$. If we note $p_n=\Pr(X=n)$, enumerating the possible outcomes in the first two or three cases yields $p_0=\tfrac{1}{4}$ and $p_1=\tfrac{1}{8}$. A recursion relation can be constructed for larger values of $n$:&lt;/p&gt;
&lt;p&gt;$$ p_n = \frac{1}{2}p_{n-1} + \frac{1}{4}p_{n-2}. $$&lt;/p&gt;
&lt;p&gt;Using Mathematica, it is easy to verify the first terms of this recurrence:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;RecurrenceTable&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.25&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.25&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.125&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/x34e7A2rz.png"&gt;
&lt;/figure&gt;
&lt;p&gt;The corresponding probability generating function can also be obtained via &lt;code&gt;GeneratingFunction&lt;/code&gt;. Note that it is also possible to use &lt;code&gt;RSolve&lt;/code&gt; instead of &lt;code&gt;RecurrenceTable&lt;/code&gt;, as shown in the following example where we generate the first terms of the Fibonacci sequence:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;RecurrenceTable&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;RSolve&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Table&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/.&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;First&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="err"&gt;%&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Or, equivalently:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-mathematica" data-lang="mathematica"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;GeneratingFunction&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;RSolve&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;FullSimplify&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The generating function is $\frac{1}{1-x (x+1)}$ in this case.&lt;/p&gt;
&lt;p&gt;Back to our initial power series. for which the PGF reads:&lt;/p&gt;
&lt;p&gt;$$ \frac{1}{4} + \frac{1}{8}\theta + \frac{1}{8}\theta^2 + \frac{3}{32}\theta^3 + \frac{5}{64}\theta^4 + \mathcal{O}(\theta^5). $$&lt;/p&gt;
&lt;p&gt;Upon inspection of the above expression, we have $p_n = 2^{-(n+2)}F_{n+1}$, where $F_k$ is the $k$-th Fibonacci number. Note that the PGF of the reciprocal of this serie is $4-2\theta-\theta^2+\mathcal{O}(\theta^5)$, hence the PGF of $X$ can be written as:&lt;/p&gt;
&lt;p&gt;$$ A(\theta) = \mathbb{E}(\theta^X) = \frac{1}{4-2\theta-\theta^2}. $$&lt;/p&gt;
&lt;p&gt;The more I read on discrete math and Euler problems, the more I find Fibonacci numbers hanging around all over the place&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Small, C. &lt;em&gt;Expansions and Asymptotics for Statistics&lt;/em&gt;. Chapman &amp;amp; Hall/CRC, 2010.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Micro-posting in July</title><link>https://aliquote.org/post/micro-07-2019/</link><pubDate>Tue, 30 Jul 2019 08:04:05 +0200</pubDate><guid>https://aliquote.org/post/micro-07-2019/</guid><description>&lt;p&gt;Here is the monthly newsletter from the Micro blog.&lt;/p&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-07-01&lt;/a&gt;: Yesterday I started watching &lt;a href="https://www.imdb.com/title/tt1846197/reference"&gt;Morden i Sandhamn&lt;/a&gt;. Looks good so far.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-01&lt;/a&gt;: &lt;a href="https://dmitripavlutin.com/6-ways-to-declare-javascript-functions/#5-generator-function"&gt;6 ways to declare JavaScript functions&lt;/a&gt;. &lt;code&gt;#javascript&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-01&lt;/a&gt;: &lt;a href="https://courses.csail.mit.edu/6.851/"&gt;Advanced Data Structures&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-02&lt;/a&gt;: (N)vim annoys me too. WTF with the working directory and the way we twist ourselves to close a single buffer?! Time to go back to &lt;a href="https://www.imdb.com/title/tt1846197/reference"&gt;Morden i Sandhamn&lt;/a&gt;, or I guess so.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-02&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/to-survive/282053058" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Joan As Police Woman, &lt;em&gt;To Survive&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-02&lt;/a&gt;: I stopped posting a while ago but Twitter starts to annoy me beyond the limit. It&amp;rsquo;s probably time to take a break.&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-07-02-21-12-08.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-02&lt;/a&gt;: Last week I discovered an interesting side-effect, or bug to put it simply, in Emacs/LSP (I&amp;rsquo;m using Doom Emacs but I don&amp;rsquo;t think it is relevant here). The LSP package has a nice utility to show code outline in a sidebar (much like the goold old &lt;code&gt;imenu-sidebar&lt;/code&gt; that was once available in Doom Emacs). Together with NerdTree (or Treemacs if it suits you better), you get the same look&amp;rsquo;n feel as what&amp;rsquo;s available in VS Code or Atom. Now, what if I tell you that once I activate the LSP package, you get code outline for free in all other modes, including Lisp or Racket? &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-02&lt;/a&gt;: &lt;a href="https://homepage.divms.uiowa.edu/~luke/classes/STAT7400/"&gt;Computer Intensive Statistics&lt;/a&gt;, by Luke Tierney. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-02&lt;/a&gt;: &lt;a href="https://www.maizure.org/projects/decoded-gnu-coreutils/index.html"&gt;Decoded: GNU coreutils&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-02&lt;/a&gt;: &lt;a href="http://christophe.rhodes.io/notes/blog/posts/2017/karatsuba_multiplication_in_sbcl/"&gt;Karatsuba multiplication in SBCL&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-03&lt;/a&gt;: Text-only version of &lt;a href="http://barzilay.org/misc/r5rs.txt"&gt;R&lt;sup&gt;5&lt;/sup&gt;RS&lt;/a&gt;. Very handy for browsing right into your preferred text editor. &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-04&lt;/a&gt;: Yet another &lt;a href="https://www.nayuki.io"&gt;blog&lt;/a&gt; full of nice code and great explanations. Check the associated Gihub repo as well.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-04&lt;/a&gt;: &lt;a href="https://www.travishinkelman.com"&gt;First blog&lt;/a&gt; I found where the author is interested both in R and Racket. &lt;code&gt;#rstats&lt;/code&gt; &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-04&lt;/a&gt;: &lt;a href="http://www.ams.org/journals/bull/2009-46-02/S0273-0979-09-01249-X/S0273-0979-09-01249-X.pdf"&gt;Topology and data&lt;/a&gt;. (via &lt;a href="https://twitter.com/DataSciFact/status/1146432210364444673"&gt;John D Cook&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-05&lt;/a&gt;: &lt;a href="https://arxiv.org/abs/1303.1856"&gt;Euler&amp;rsquo;s constant: Euler&amp;rsquo;s work and modern developments&lt;/a&gt;. &lt;code&gt;#arxiv&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-06&lt;/a&gt;: I&amp;rsquo;m too busy focusing on Racket at the moment, but today I learned that next to &lt;a href="https://www.ale-lang.org"&gt;Hy&lt;/a&gt; there&amp;rsquo;s &lt;a href="https://www.ale-lang.org"&gt;Ale&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-06&lt;/a&gt;: Thanks to John Cook, I ended up re-reading &lt;a href="https://prog21.dadgum.com"&gt;programming in the twenty-first century&lt;/a&gt;, and a few other articles written by James Hague.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-06&lt;/a&gt;: &lt;a href="https://wordsandbuttons.online/so_you_think_you_know_c.html"&gt;So you think you know C?&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-07&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/the-peel-sessions-1991-2004-us-release/1444160683" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   P.J. Harvey, &lt;em&gt;The Peel Sessions 1991–2004&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-07&lt;/a&gt;: About to start watching &lt;a href="https://en.wikipedia.org/wiki/John_Wick:_Chapter_2"&gt;John Wick 2&lt;/a&gt; with my son.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-07&lt;/a&gt;: Nice account of &lt;a href="https://www.annualreviews.org/doi/10.1146/annurev.genet.30.1.1"&gt;Kimura&amp;rsquo;s contribution&lt;/a&gt; to molecular population genetics (via Vince Buffalo).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-07&lt;/a&gt;: &lt;a href="https://www.gnu.org/gnu/rms-lisp.en.html"&gt;My Lisp Experiences and the Development of GNU Emacs&lt;/a&gt;. Whether you like the guy (or what his public interventions have become) or not, this is an interesting read for those interested in the road to Lisp. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-08&lt;/a&gt;: Best way I found to mimic R&amp;rsquo;s &lt;code&gt;rle&lt;/code&gt; function is this nice little piece of code (in Racket; credit to &lt;a href="https://stackoverflow.com/a/5741004"&gt;Chris Jester-Young&lt;/a&gt;):&lt;code&gt;scheme(define (bagify lst)(foldl (lambda (key ht)(hash-update ht key add1 0))#hash() lst))&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-08&lt;/a&gt;: Now, it&amp;rsquo;s probably time to go watch &lt;a href="https://en.wikipedia.org/wiki/Taken_(film)"&gt;Taken&lt;/a&gt; (once again).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-08&lt;/a&gt;: TIL about the &lt;a href="https://github.com/brewsci/homebrew-bio"&gt;brewsci/bio&lt;/a&gt; tap for Homebrew. &lt;code&gt;#bioinformatics&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-08&lt;/a&gt;: &lt;a href="https://github.com/ukari/cl-generator"&gt;Generator in common lisp&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-08&lt;/a&gt;: &lt;a href="http://vito.sdf.org/lispweb3.html"&gt;Lisp for The Modern Web&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-08&lt;/a&gt;: &lt;a href="https://odone.me/posts/2019-07-08-scripting-in-haskell-and-purescript/"&gt;Scripting in Haskell and PureScript&lt;/a&gt;. Because why not?! The joy of FPs at the command-line&amp;hellip;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-09&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/horses-legacy-edition/266367955" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Patti Smith, &lt;em&gt;Horses&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-09&lt;/a&gt;: Euler problem 14 is all about Collatz numbers. I am aware of Atabey Kaygun&amp;rsquo;s &lt;a href="https://kaygun.tumblr.com/post/170044995839/collatz-sequence-yet-again"&gt;post&lt;/a&gt;&lt;a href="https://kaygun.tumblr.com/post/110103741384/collatz-type-conjectures-continued"&gt;s&lt;/a&gt;, but I found a &lt;a href="https://stackoverflow.com/a/41080733"&gt;nice implementation&lt;/a&gt; in Scheme on SO today.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-09&lt;/a&gt;: I&amp;rsquo;m all in LSP stuff at the moment, but maybe I should give it a try: &lt;a href="https://github.com/dzop/emacs-jupyter"&gt;An interface to communicate with Jupyter kernels&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-09&lt;/a&gt;: The temperatures are milder this week and yet I have 10/6 BP. Thanks for the medication! However, I should note that I am no longer stressed in the evening because of&amp;ndash;you know&amp;ndash;things to do urgently at the last minute. Because I no longer care, above all.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-09&lt;/a&gt;: &lt;a href="https://news.ycombinator.com/item?id=20388029"&gt;Better Than Floating Point?&lt;/a&gt; on HN today. The comments are also full of extra links on FP computation.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-09&lt;/a&gt;: &lt;a href="https://github.com/rswier/c4"&gt;C in four functions&lt;/a&gt;. See also &lt;a href="https://compilers.iecc.com/crenshaw/"&gt;Let&amp;rsquo;s Build a Compiler&lt;/a&gt;. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-09&lt;/a&gt;: &lt;a href="https://www.microsoft.com/en-us/research/publication/the-implementation-of-functional-programming-languages"&gt;The Implementation of Functional Programming Languages&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-09&lt;/a&gt;: &lt;a href="https://golem.ph.utexas.edu/category/2019/07/the_riemann_hypothesis_says_50.html"&gt;The Riemann Hypothesis Says 5040 is the Last&lt;/a&gt;. &lt;code&gt;#math&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-10&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/in-movement/1443868471" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Jack DeJohnette, Ravi Coltrane &amp;amp; Matt Garisson, &lt;em&gt;In Movement&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-10&lt;/a&gt;: &amp;gt; It’s about impossible to avoid using a modern browser, but the experience can be made more bearable.&amp;gt; &lt;a href="https://an3223.github.io/Living-without-the-modern-browser/"&gt;Living without the modern browser&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-10&lt;/a&gt;: &lt;a href="https://github.com/generateme/fastmath"&gt;Fast primitive based math library&lt;/a&gt;. &lt;code&gt;#clojure&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-10&lt;/a&gt;: &lt;a href="https://arxiv.org/abs/1807.10451"&gt;How to capitalize on a priori contrasts in linear (mixed) models: A tutorial&lt;/a&gt;. &lt;code&gt;#arxiv&lt;/code&gt; &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-11&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/the-astounding-eyes-of-rita/1443766830" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Anouar Brahem, &lt;em&gt;The Astounding Eyes of Rita&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-11&lt;/a&gt;: &lt;a href="https://d2l.ai"&gt;Dive into Deep Learning&lt;/a&gt;: An interactive deep learning book with code, math, and discussions. (&lt;a href="https://github.com/d2l-ai/d2l-en"&gt;Github&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-11&lt;/a&gt;: &lt;a href="http://cseweb.ucsd.edu/~gill/BWLectSite/"&gt;Lectures in Discrete Mathematics&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-11&lt;/a&gt;: &lt;a href="https://rubjo.github.io/victor-mono/"&gt;Victor Mono&lt;/a&gt; is a free programming font with semi-connected cursive italics and symbol ligatures. It looks like a solid alternative to Iosevska (which I use in my terminal) or Fira (which I no longer use except for slidedeck).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-12&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/wave-remastered/209945031" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Patti Smith, &lt;em&gt;Wave&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-12&lt;/a&gt;: &lt;a href="https://stackoverflow.com/q/7533837"&gt;Explanation of combinators for the working man&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-12&lt;/a&gt;: &lt;a href="https://fare.livejournal.com/188429.html"&gt;Why I haven&amp;rsquo;t jumped ship from Common Lisp to Racket (just yet)&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-12&lt;/a&gt;: &lt;a href="https://github.com/saketkc/pysradb"&gt;pysradb&lt;/a&gt;: A package for fetching metadata and downloading data from SRA. &lt;code&gt;#python&lt;/code&gt; &lt;code&gt;#bioinformatics&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-14&lt;/a&gt;: I bookmarked &lt;a href="https://www.huber.embl.de/msmb/"&gt;Modern Statistics for Modern Biology&lt;/a&gt; (Susan Holmes, Wolfgang Huber) a while ago, and upon skimming at it again I believe it&amp;rsquo;s a really good introduction for biologists, full of nice illustrations and examples.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-14&lt;/a&gt;: I no longer attend conference, and it&amp;rsquo;s a shame since &lt;a href="https://con.racket-lang.org/index.html"&gt;(ninth RacketCon)&lt;/a&gt; looks so promising. &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-14&lt;/a&gt;: Okay, I just had to downgrade my current Python config since &lt;code&gt;python-language-server&lt;/code&gt; does not play well with &lt;code&gt;jedi&amp;gt;0.14&lt;/code&gt;. &lt;code&gt;#python&lt;/code&gt; &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-15&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Tindersticks, &lt;em&gt;Waiting for the Moon&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-15&lt;/a&gt;: And we are done with John Wick (1 and 2) and Taken (1, 2, and 3). What&amp;rsquo;s next?&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-15&lt;/a&gt;: OMG. &lt;a href="https://www.btbytes.com/pl.html"&gt;How many new languages&lt;/a&gt; are yet to expect in the next few years?!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-15&lt;/a&gt;: &lt;a href="https://observablehq.com/@fil/d3-documentation-on-observable"&gt;D3 Documentation on Observable&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-15&lt;/a&gt;: &lt;a href="http://elementsofprogramming.com"&gt;Elements of Programming&lt;/a&gt;, by Alexander Stepanov and Paul McJones. (via HN)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-16&lt;/a&gt;: A collection of &lt;a href="https://macopenweb.com"&gt;open and indie Mac, iOS, and web apps&lt;/a&gt; that help promote the open web. Nice to see so many free apps for the Mac. I learned that there even exists a &lt;a href="https://skeletron.app"&gt;dedicated editor&lt;/a&gt; for Hugo websites.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-16&lt;/a&gt;: Keeping away from Twitter was quite a nice idea. Instead of spending one hour browsing my TL everyday, I settled for a few minutes here and there, without any bookmarks. As a result, I read three books in three days, listen to some good vinyles in the morning, and I immersed myself in old books on algorithms and data structures. BTW we just started watching Chernobyl.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-16&lt;/a&gt;: &lt;a href="http://www.lihaoyi.com/post/EasyParsingwithParserCombinators.html"&gt;Easy Parsing with Parser Combinators&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-16&lt;/a&gt;: &lt;a href="https://github.com/alan-turing-institute/MLJ.jl"&gt;MLJ.jl&lt;/a&gt;: A Julia machine learning framework. I still haven&amp;rsquo;t decided whether I should look into Julia more seriously after 5 years&amp;hellip;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-16&lt;/a&gt;: &lt;a href="https://www.cs.utah.edu/plt/publications/icfp19-rddkmstz.pdf"&gt;Rebuilding Racket on Chez Scheme (Experience Report)&lt;/a&gt; (PDF, 14 pp.). &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-16&lt;/a&gt;: &lt;a href="http://www.philipzucker.com/why-i-as-of-june-22-2019-think-haskell-is-the-best-general-purpose-language-as-of-june-22-2019/"&gt;Why I (as of June 22 2019) think Haskell is the best general purpose language&lt;/a&gt;. For me, Haskell remains hard, even if switching to &lt;a href="https://lexi-lambda.github.io/blog/2018/02/10/an-opinionated-guide-to-haskell-in-2018/"&gt;stack&lt;/a&gt; saved me form all those Go I used once in a while. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-16&lt;/a&gt;: &lt;a href="https://github.com/dangom/org-thesis"&gt;Writing a Ph.D. thesis with Org Mode&lt;/a&gt;. See also the associated &lt;a href="https://write.as/dani/writing-a-phd-thesis-with-org-mode"&gt;blog post&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-16&lt;/a&gt;: &lt;a href="http://joostkremers.github.io/ebib/"&gt;ebib&lt;/a&gt;: A BibTeX database manager for Emacs. It bears some resemblance with what &lt;code&gt;org-ref&lt;/code&gt; and &lt;code&gt;ivy-bibyex&lt;/code&gt; offer actually, but it may something to try in the future, if only to simply remove unnecessary dependencies with Helm. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-17&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/the-flying-club-cup/1309355762" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Beirut, &lt;em&gt;The Flying Club Cup&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-17&lt;/a&gt;: &amp;gt; Racket is a great Lisp, but it&amp;rsquo;s also an acceptable Python. Sometimes you really can have it all.&amp;raquo; &amp;ndash; &lt;a href="https://dustycloud.org/blog/racket-is-an-acceptable-python/"&gt;Racket is an acceptable Python&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-17&lt;/a&gt;: My life has just become a poem where I unroll rhymes of side effects, one after the other. Today it is hyperkalemia that won the day.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-17&lt;/a&gt;: The Rust compiler is just some kind of magic!&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-07-17-18-37-47.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-17&lt;/a&gt;: &lt;a href="https://peerj.com/articles/6876/"&gt;Hierarchical generalized additive models in ecology: an introduction with mgcv&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-17&lt;/a&gt;: &lt;a href="https://www.biorxiv.org/content/10.1101/705616v1"&gt;Human Genome Assembly in 100 Minutes&lt;/a&gt;. &lt;code&gt;#bioinformatics&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-17&lt;/a&gt;: &lt;a href="http://drops.dagstuhl.de/opus/volltexte/2019/10816/pdf/LIPIcs-ECOOP-2019-24.pdf"&gt;Julia’s Efficient Algorithm for Subtyping Unions and Covariant Tuples&lt;/a&gt; (PDF, 15 pp.).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-17&lt;/a&gt;: &lt;a href="https://markkarpov.com/post/lisp-and-haskell.html"&gt;Lisp and Haskell&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-17&lt;/a&gt;: &lt;a href="http://ocaml.xyz"&gt;OCaml Scientific Computing&lt;/a&gt;. &lt;code&gt;#ocaml&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-18&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/who-is-the-sender/935832840" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Bill Fay, &lt;em&gt;Who is the Sender?&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-18&lt;/a&gt;: If Racket shares the beauty of Lisp and Python, it may even &lt;a href="https://github.com/racket/racket/wiki/Racket2"&gt;get ride of parenthesis&lt;/a&gt; in the near future. &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-18&lt;/a&gt;: What a wonderful &lt;a href="https://eli.thegreenplace.net/tag/sicp"&gt;work on SICP&lt;/a&gt; on Eli Bendersky&amp;rsquo;s website. &lt;code&gt;#lisp&lt;/code&gt; &lt;code&gt;#clojure&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-18&lt;/a&gt;: &lt;a href="https://www.biorxiv.org/content/10.1101/704528v1"&gt;Identification of hidden population structure in time-scaled phylogenies&lt;/a&gt;. &lt;code&gt;#bioinformatics&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-18&lt;/a&gt;: &lt;a href="https://lwn.net/SubscriberLink/793818/0c6f9dd271021cd4/"&gt;What&amp;rsquo;s coming in Python 3.8&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-19&lt;/a&gt;: &lt;a href="" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Arno, &lt;em&gt;Human Incognito&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-19&lt;/a&gt;: Finally, maybe &lt;a href="https://github.com/features/actions"&gt;GitHub Actions&lt;/a&gt; is a &lt;a href="https://defn.io/2019/05/01/github-actions-for-racket/"&gt;viable alternative&lt;/a&gt; to Travis CI.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-19&lt;/a&gt;: Here&amp;rsquo;s a funny problem that you may probably know if you read Douglas Hofstadter&amp;rsquo;s wonderful book, &lt;em&gt;Gödel, Escher, Bach&lt;/em&gt;. You are given a small alphabet, which consists in the letters M, U and I, and a set of four rules, where x and y denote any string:- xI to xIU: append U at the end of a string that ends with I;- Mx to Mxx: append the string after M a second time;- xIIIy to xUy: replace III with U;- xUUy to xy: remove UU.Let&amp;rsquo;s start with the string MI. The goal is to convert this string to MU using those rules, that you can reuse at will. I can&amp;rsquo;t remember where I saw this problem mentioned on the internet. There is &lt;a href="https://en.wikipedia.org/wiki/MU_puzzle#Solution"&gt;no solution to this problem&lt;/a&gt;, but I keep thinking of this gorgeous book each time I see some mention of Hofstadter&amp;rsquo;s puzzles.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-19&lt;/a&gt;: Hot off the kitchen:&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_0738.jpg" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-19&lt;/a&gt;: I know dark mode isn&amp;rsquo;t for coders or writers, but let that not stop looking at the following Emacs instance when they run in GUI or Terminal:&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-07-18-20-16-18.png" alt=""&gt;&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-07-18-20-16-43.png" alt=""&gt;Brighter UI, better contrast for comments, and less buggy major mode (LSP, Racket, SLY, especially&amp;ndash;but don&amp;rsquo;t what could potentially be the issue when running in Terminal). &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-19&lt;/a&gt;: I&amp;rsquo;m tired, unable to complete anything, and and always looking the other way. It&amp;rsquo;s probably time to put this computer on standby. Let&amp;rsquo;s go watch &lt;a href="https://nl.wikipedia.org/wiki/Morden_i_Sandhamn"&gt;&lt;em&gt;Morden i Sandhamn&lt;/em&gt;&lt;/a&gt;, Season 2.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-19&lt;/a&gt;: If you like &lt;code&gt;pv&lt;/code&gt; and wants a tool that can be launched afterwards, then try &lt;a href="https://github.com/xfennec/progress"&gt;progress&lt;/a&gt;, the Coreutils Progress Viewer. BTW, it&amp;rsquo;s available via Homebrew.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-19&lt;/a&gt;: &lt;a href="https://arxiv.org/abs/1907.07587"&gt;A Differentiable Programming System to Bridge Machine Learning and Scientific Computing&lt;/a&gt;. &lt;code&gt;#arxiv&lt;/code&gt; &lt;code&gt;#julia&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-19&lt;/a&gt;: &lt;a href="https://arstechnica.com/gadgets/2019/07/dropbox-silently-installs-new-file-manager-app-on-users-systems/"&gt;Dropbox silently installs new file manager app on users’ systems&lt;/a&gt;. That&amp;rsquo;s a shame as I always thought of Dropbox as a reliable and solid alternative to iCloud or other backup/sync toolchains. I removed all my folder long ago, and I no longer make any use of my 15+ Go free space, but the recent issues with Dropbox are appalling. Let&amp;rsquo;s hope they will find a good compromise like when decided to update their TOS and then bring a step backward.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-19&lt;/a&gt;: &lt;a href="https://herbie.uwplse.org"&gt;Herbie&lt;/a&gt;: Find and fix floating-point problems. &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-19&lt;/a&gt;: &lt;a href="http://www.cfm.brown.edu/people/dobrush/am33/Mathematica/index.html"&gt;Mathematica&lt;/a&gt;/Mathics tutorial for the &lt;em&gt;First Course in Applied Differential Equations&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-19&lt;/a&gt;: &lt;a href="https://github.com/Bogdanp/deta"&gt;deta: Functional Database Mapping&lt;/a&gt;. &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-20&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/and-the-pioneer-saboteurs/374009708" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Micah P. Hinson, &lt;em&gt;And the Pioneer Saboteurs&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-20&lt;/a&gt;: After some Euler problems in Lisp, Rosalind exercises in Python, and several tracks on Exercism, I should probably give a try to: H-99: &lt;a href="https://wiki.haskell.org/H-99:_Ninety-Nine_Haskell_Problems"&gt;Ninety-Nine Haskell Problems&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-20&lt;/a&gt;: Personally, I stand by &lt;a href="http://www.labri.fr/perso/nrougier/from-python-to-numpy/"&gt;From Python to Numpy&lt;/a&gt;, but go check &lt;a href="https://brohrer.github.io/numpy_resources.html"&gt;NumPy resources&lt;/a&gt; if you&amp;rsquo;re looking for additional resources. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-20&lt;/a&gt;: TIL about &lt;a href="https://en.m.wikipedia.org/wiki/M-expression"&gt;m-expr&lt;/a&gt;, which were supplanted by s-expr in Lisp languages. Still, they are a core part of Mathematica noawadays.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-20&lt;/a&gt;: While I believe I&amp;rsquo;m still recoevring from the last episode of hyperkaliemia, my blood pressure seems ok, even if I feel a lot tired, at least more than usual. But as we have to be positive, let&amp;rsquo;s face it: it&amp;rsquo;s not too hot yet, I&amp;rsquo;m having a glass of white wine and enjoying a pleasant breeze, as I did yesterday.&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_0739.jpg" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-20&lt;/a&gt;: &lt;a href="http://jr0cket.co.uk/2019/07/a-deeper-understanding-of-Clojure-CLI-tools.html"&gt;A Deeper Understanding of Clojure CLI Tools&lt;/a&gt;. I often fire up &lt;code&gt;clj&lt;/code&gt; to play with small Clojure snippets, so this definitely is something to keep in my bookmarks even if it is still project-based. &lt;code&gt;#clojure&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-20&lt;/a&gt;: &lt;a href="https://begriffs.com/posts/2019-07-19-history-use-vim.html?hn=3"&gt;History and effective use of Vim&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-20&lt;/a&gt;: &lt;a href="http://www-formal.stanford.edu/jmc/history/lisp/lisp.html"&gt;History of Lisp&lt;/a&gt;, by John McCarthy (1979). &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-20&lt;/a&gt;: &lt;a href="https://pgexercises.com"&gt;PostgreSQL Exercises&lt;/a&gt;: Clean and instructive web site to test your knowledge of Postgres. &lt;code&gt;#database&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-21&lt;/a&gt;: Here is a nice &lt;a href="https://www.cs.grinnell.edu/~rebelsky/Courses/CSC151/2019S/readings/"&gt;introduction&lt;/a&gt; to computer science and (X)HTML processing using Racket. &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-21&lt;/a&gt;: Yesterday wa watched &lt;a href="https://en.wikipedia.org/wiki/The_Transporter"&gt;The Transporter&lt;/a&gt;. Two more to go.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-21&lt;/a&gt;: &lt;a href="http://www.norvig.com/Lisp-retro.html"&gt;A Retrospective on Paradigms of AI Programming&lt;/a&gt;, by Peter Norvig. See the &lt;a href="https://eli.thegreenplace.net/2005/06/12/lessons-from-paip"&gt;review&lt;/a&gt; on Eli Bendersky&amp;rsquo;s website. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-21&lt;/a&gt;: &lt;a href="https://github.com/jdormit/sicp-logic/"&gt;SICP Logic Programming&lt;/a&gt;: A Clojure implementation of the logic programming language described in &lt;em&gt;Structure and Interpretation of Computer Programs&lt;/em&gt;. &lt;code&gt;#clojure&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-21&lt;/a&gt;: &lt;a href="https://arxiv.org/pdf/1609.08227.pdf"&gt;Topological Data Analysis&lt;/a&gt; (PDF, 42 pp.), by Larry Wasserman.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-21&lt;/a&gt;: &lt;a href="https://github.com/bendudson/py4cl"&gt;py4cl&lt;/a&gt;: Call python from Common Lisp. &lt;code&gt;#python&lt;/code&gt; &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-22&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/playlist/ecm-keith-jarrett/pl.2be32369b46d4c7ea419141a34295e6b" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   &lt;em&gt;ECM: Keith Jarrett&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-22&lt;/a&gt;: Here are two interesting static site generator that look like good alternatives to Hugo: &lt;a href="https://getnikola.com"&gt;Nikola&lt;/a&gt; and &lt;a href="https://middlemanapp.com"&gt;Middleman&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-22&lt;/a&gt;: Interesting read. &lt;a href="https://www.fugue.co/blog/2018-08-09-two-years-with-emacs-as-a-cto.html"&gt;Two Years With Emacs as a CEO (and now CTO)&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-22&lt;/a&gt;: Last episode of the triptych tonight: &lt;a href="https://en.wikipedia.org/wiki/The_Transporter"&gt;The Transporter&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-22&lt;/a&gt;: OMG I just opened Twitter in Safari (I&amp;rsquo;m mostly reading tweets from an iPhone), and&amp;hellip; It&amp;rsquo;s just unusable. Ok, bye for now!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-22&lt;/a&gt;: TIL about &lt;em&gt;develop&lt;/em&gt;, the Apple tech journal from the 90&amp;rsquo;s. Feat. article: &lt;a href="https://vintageapple.org/develop/pdf/develop-05_9101_Winter_1991.pdf"&gt;The Power of Macintosh Common Lisp&lt;/a&gt;, by Ruben Kleiman. (via &lt;a href="https://twitter.com/RainerJoswig/status/1153274519286669312"&gt;Rainer Joswig&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-22&lt;/a&gt;: The new &lt;a href="https://www.iterm2.com/3.3/documentation-status-bar.html"&gt;status bar&lt;/a&gt; in iTerm is astonishing!&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-07-22-20-10-36.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-22&lt;/a&gt;: &lt;a href="https://quinnj.home.blog/2019/07/21/a-tour-of-the-data-ecosystem-in-julia/amp/?__twitter_impression=true"&gt;A Tour of the Data Ecosystem in Julia&lt;/a&gt;. &lt;code&gt;#julia&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-22&lt;/a&gt;: &lt;a href="https://github.com/justinmeiners/lisp-interpreter"&gt;Embeddable lisp interpreter&lt;/a&gt; written in C. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-22&lt;/a&gt;: &lt;a href="https://rust-sci.github.io"&gt;Scientific computing with Rust&lt;/a&gt;. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-22&lt;/a&gt;: &lt;a href="https://www.lpalmieri.com/posts/2019-02-23-scientific-computing-a-rust-adventure-part-0-vectors/"&gt;Scientific computing: a Rust adventure&lt;/a&gt;. &lt;code&gt;#rust&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-23&lt;/a&gt;: Switching to Idle for a few days&amp;ndash;weather&amp;rsquo;s too hot, sorry! In the meantime, go check &lt;a href="https://lisp-univ-etc.blogspot.com/2019/07/programming-algorithms-book.html?m=1"&gt;Lisp, the Universe and Everything&lt;/a&gt;, and wish me luck with the next Euler problems. Cheers&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-27&lt;/a&gt;: Got a little update to the Macbook yesterday! Three years already, and still as valiant as ever:&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-07-27-09-35-49.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-27&lt;/a&gt;: Great resources: &lt;a href="https://bookdown.org/ajkurz/Statistical_Rethinking_recoded/"&gt;Statistical Rethinking with brms, ggplot2, and the tidyverse&lt;/a&gt;. And I think we have to resign ourselves to seeing all the new R tutorials using almost only the tidyverse! &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-27&lt;/a&gt;: The last few days were very, very hot! I don&amp;rsquo;t remember breathing such hot air in my life. It&amp;rsquo;s all in the past now, but I&amp;rsquo;m not about to forget it. A little memory of my last lunch:&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_0746.jpg" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-27&lt;/a&gt;: We are back with some fresh news from Github: &lt;a href="https://github.com/Bodigrim/poly"&gt;Fast polynomial arithmetic in Haskell&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-27&lt;/a&gt;: &lt;a href="https://dotink.co/posts/visualizing-sorting-algorithms/"&gt;Visualizing and exploring sorting algorithms in two dimensions with Ink&lt;/a&gt;. (via HN)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-27&lt;/a&gt;: &lt;a href="https://scikit-allel.readthedocs.io/en/stable/index.html"&gt;scikit-allel&lt;/a&gt;: Explore and analyse genetic variation. Back in 2010, we were using R and the &lt;code&gt;snpMatrix&lt;/code&gt; package but it looks like Python now comes with good utilities too. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-28&lt;/a&gt;: &lt;a href="https://ask.clojure.org"&gt;https://ask.clojure.org&lt;/a&gt; is a dedicated Stack Overflow for &lt;code&gt;#clojure&lt;/code&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-28&lt;/a&gt;: &amp;gt; The longer you spend in these ecosystems, the more machine learning systems can optimize themselves against user preferences. &amp;ndash; &lt;a href="https://gizmodo.com/this-is-how-youre-being-manipulated-1835853810"&gt;This Is How You&amp;rsquo;re Being Manipulated&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-28&lt;/a&gt;: Starting soon&amp;hellip;&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-07-28-20-32-12.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-28&lt;/a&gt;: &lt;a href="https://chrisdone.com/posts/clientside-programming-haskell/"&gt;Client-side web programming in Haskell: A retrospective&lt;/a&gt;. &lt;code&gt;#haskell&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-28&lt;/a&gt;: &lt;a href="https://blog.usejournal.com/monoids-to-groupoids-492c35105113"&gt;Did Functional Programming get it wrong?&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-28&lt;/a&gt;: &lt;a href="https://www.cs.cmu.edu/~kmcrane/Projects/DGPDEC/paper.pdf"&gt;Discrete Differential Geometry: An Applied Introduction&lt;/a&gt; (PDF, 169 pp.). (via HN)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-28&lt;/a&gt;: &lt;a href="http://rs.io/why-category-theory-matters/"&gt;Why Category Theory Matters&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-29&lt;/a&gt;: I should have added this one to my &lt;a href="https://aliquote.org/post/arxiv-03/"&gt;previous arXiv review&lt;/a&gt;: &lt;a href="https://arxiv.org/abs/1907.11493"&gt;On the variability of regression shrinkage methods for clinical prediction models: simulation study on predictive performance&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-07-29&lt;/a&gt;: To my son, of course&amp;hellip; &lt;a href="http://www.timphilipwilliams.com/posts/2019-07-25-minecraft.html"&gt;Generating castles for Minecraft™ using Haskell&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;</description></item><item><title>List processing and consing</title><link>https://aliquote.org/post/lisp-consing/</link><pubDate>Mon, 29 Jul 2019 08:39:56 +0200</pubDate><guid>https://aliquote.org/post/lisp-consing/</guid><description>&lt;p&gt;I just finished reading &lt;em&gt;The Little Schemer&lt;/em&gt;, by Friedman and Felleisen. Here are some basic facts about very simple yet useful data structures: lists.&lt;/p&gt;
&lt;p&gt;First of all, this is a very nice book for people interested in Lisp, Scheme, or functional programming to a larger extent. It is very different from SICP in that it focus on basic building blocks (&lt;code&gt;car&lt;/code&gt;, &lt;code&gt;cdr&lt;/code&gt;, &lt;code&gt;cons&lt;/code&gt;, &lt;code&gt;eq&lt;/code&gt;, etc.) and use a very pragmatic approach to understanding the structure and interpretation of forms and s-expr. The penultimate goal of this book (4th ed., after the original &lt;em&gt;Little Lisper&lt;/em&gt;) is to learn to think in a functional way. The ten commandments are worth keeping in mind for that very specific purpose:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;When recurring on a list of atoms, &lt;code&gt;lat&lt;/code&gt;, ask two questions about it: &lt;code&gt;(null? lat)&lt;/code&gt; and &lt;code&gt;else&lt;/code&gt;. When recurring on a number, &lt;code&gt;n&lt;/code&gt;, ask two questions about it: &lt;code&gt;(zero? n)&lt;/code&gt; and &lt;code&gt;else&lt;/code&gt;. When recurring on a list of s-expr, &lt;code&gt;l&lt;/code&gt;, ask three questions about it: &lt;code&gt;(null? l)&lt;/code&gt;, &lt;code&gt;(atom? (car l))&lt;/code&gt;, and &lt;code&gt;else&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;cons&lt;/code&gt; to build lists.&lt;/li&gt;
&lt;li&gt;When building a list, describe the first typical element, and then &lt;code&gt;cons&lt;/code&gt; it into the natural recursion.&lt;/li&gt;
&lt;li&gt;Always change at least one argument while recurring. When recurring on a list of atoms, &lt;code&gt;lat&lt;/code&gt;, use &lt;code&gt;(cdr lat)&lt;/code&gt;. When recurring on a number, &lt;code&gt;n&lt;/code&gt;, use &lt;code&gt;(sub1 n)&lt;/code&gt;. And when recurring on a list of s-expr, &lt;code&gt;l&lt;/code&gt;, use &lt;code&gt;(car l)&lt;/code&gt; and &lt;code&gt;(cdr l)&lt;/code&gt; if neither &lt;code&gt;(null? l)&lt;/code&gt; nor &lt;code&gt;(atom? (car l))&lt;/code&gt; are true.
It must be changed to be closer to termination. The changing argument must be tested in the termination condition: when using &lt;code&gt;cdr&lt;/code&gt;, test termination with &lt;code&gt;null?&lt;/code&gt;, and when using &lt;code&gt;sub1&lt;/code&gt;, test termination with &lt;code&gt;zero?&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;When building a value with &lt;code&gt;÷&lt;/code&gt;, always use 0 for the value of the terminating line, for adding 0 does not change the value of an addition. When building a value with &lt;code&gt;x&lt;/code&gt;, always use 1 for the value of the terminating line, for multiplying by 1 does not change the value of a multiplication. When building a value with &lt;code&gt;cons&lt;/code&gt;, always consider &lt;code&gt;()&lt;/code&gt; for the value of the terminating line.&lt;/li&gt;
&lt;li&gt;Simplify only after the function is correct.&lt;/li&gt;
&lt;li&gt;Recur on the subparts that are of the same nature: on the sublists of a list; on the subexpressions of an arithmetic expression.&lt;/li&gt;
&lt;li&gt;Use help functions to abstract from representations.&lt;/li&gt;
&lt;li&gt;Abstract common patterns with a new function.&lt;/li&gt;
&lt;li&gt;Build functions to collect more than one value at a time.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Rules 1 and 4 mostly resemble safe guards we would use in any programming language, and the other rules also apply even in imperative languages. However, in this post I am only interested in rule 2: using &lt;code&gt;cons&lt;/code&gt; to build list. LISP stands for LISt Processing, right? And indeed, lists and sequences are the most useful data structures in Lisp or Scheme dialects, inasmuch as we don&amp;rsquo;t need vectors. A cons cell is just a record holding two values, much like a pair as in &lt;code&gt;(1 . 2)&lt;/code&gt;. Note that it is different from &lt;code&gt;(list 1 2)&lt;/code&gt;, which in fact is composed of two cons cells, where the first cons cell contains 1 and a pointer to the second cons cell (same for the second cons, except that it includes &lt;code&gt;nil&lt;/code&gt; to signal the end of the list). So, to add an element in front of a list, you will just be consing it as in the following example:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;cons&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;list&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;car&lt;/code&gt; of the above expression is just 1, and its &lt;code&gt;cdr&lt;/code&gt; is &lt;code&gt;(2 3 4)&lt;/code&gt;. And most operations on lists will rely on these ideas: add an element upfront, or inspect the very first item and keep the remaining elements for further processing. Clojure also comes with a &lt;code&gt;cons&lt;/code&gt; function (and a &lt;code&gt;conj&lt;/code&gt;, which acts differently whether items are grouped in a list, vector, set or map&amp;ndash;the so-called &lt;a href="https://clojuredocs.org/clojure.core/conj"&gt;concrete type&lt;/a&gt;). Racket provides &lt;a href="https://docs.racket-lang.org/reference/pairs.html"&gt;custom accessors&lt;/a&gt;, like &lt;code&gt;first&lt;/code&gt; and &lt;code&gt;rest&lt;/code&gt;, and even &lt;code&gt;last&lt;/code&gt; or &lt;code&gt;append&lt;/code&gt;, in addition to all the above Lisp operators. And go read a &lt;a href="https://aliquote.org/post/category-theory/"&gt;previous post of mine&lt;/a&gt; to see an implementation of cons in Haskell.&lt;/p&gt;
&lt;p&gt;Finally, I should note that Rainer Joswig provides a good overview of &lt;a href="https://stackoverflow.com/a/2256613"&gt;cons and memory allocation&lt;/a&gt; in Lisp, and why consing may add a bit of overhead to a program. And Paul Graham discusses extensively the use of cons vs. macros in his book &lt;a href="http://www.paulgraham.com/onlisptext.html"&gt;&lt;em&gt;On Lisp&lt;/em&gt;&lt;/a&gt; (I still have to manage to find some time to read it more seriously one day!).&lt;/p&gt;
&lt;p&gt;In Python, lists are implemented as vectors, not as single linked lists (in this case, you would probably want to try a &lt;a href="https://docs.python.org/3/library/collections.html#collections.deque"&gt;deque&lt;/a&gt;). However, it is quite easy to adapt the definition of &lt;code&gt;cons&lt;/code&gt;, &lt;code&gt;car&lt;/code&gt; and &lt;code&gt;cdr&lt;/code&gt; discussed in the &lt;a href="https://mitpress.mit.edu/sites/default/files/sicp/full-text/book/book-Z-H-14.html#%25_sec_2.1.3"&gt;SICP&lt;/a&gt; (nicely typesetted &lt;a href="http://web.mit.edu/alexmv/6.037/sicp.pdf"&gt;PDF here&lt;/a&gt;) as closures:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;cons&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="nv"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;lambda&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;m&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="nv"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;car&lt;/span&gt; &lt;span class="nv"&gt;z&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;z&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;lambda&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;p&lt;/span&gt; &lt;span class="nv"&gt;q&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;cdr&lt;/span&gt; &lt;span class="nv"&gt;z&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;z&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;lambda&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;p&lt;/span&gt; &lt;span class="nv"&gt;q&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;q&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;See what&amp;rsquo;s going on? In this case, the definition of &lt;code&gt;cons&lt;/code&gt; implies a closure holding two values (&lt;code&gt;x&lt;/code&gt; and &lt;code&gt;y&lt;/code&gt;). Whenever you call &lt;code&gt;car&lt;/code&gt; or &lt;code&gt;cdr&lt;/code&gt; with a &amp;ldquo;cons&amp;rdquo;, you are actually calling a function that selects either the first or the second member of the pair &lt;code&gt;(p q)&lt;/code&gt;. Translation to Python is straightforward, even if this does not please some &lt;a href="https://www.python.org/dev/peps/pep-0008/#programming-recommendations"&gt;PEP conventions&lt;/a&gt; (flake8 will report an E731 on the following piece of code):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;cons&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;car&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;cdr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>ArXiving on July 2019</title><link>https://aliquote.org/post/arxiv-03/</link><pubDate>Sun, 28 Jul 2019 17:42:46 +0200</pubDate><guid>https://aliquote.org/post/arxiv-03/</guid><description>&lt;p&gt;Here is a quick wrap up of my latest readings on arXiv. In no particular order, as usual.&lt;/p&gt;
&lt;h3 id="scipy-10fundamental-algorithms-for-scientific-computing-in-python-virtanen-et-al-2019-arxiv190710121v1"&gt;SciPy 1.0—Fundamental Algorithms for Scientific Computing in Python (Virtanen et al., 2019) &lt;a href="https://arxiv.org/abs/1907.10121"&gt;arXiv:1907.10121v1&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Everyone doing scientific computing in Python knows &lt;a href="https://scipy.org"&gt;ScipPy&lt;/a&gt;, which reaches its v1 a few months ago, after years of development. Of course, &lt;a href="https://docs.scipy.org/doc/scipy/reference/release.1.0.0.html"&gt;this milestone&lt;/a&gt; was more of new stage in the continuous work that drives the Scipy package since its inception. In this paper, the authors explains the motivation behind SciPy, its relation with the numerical and graphical ecosystem already available in Python or under development (Numpy, IPython), what its 16 submodules containand why open-source developement for scientific computing using a general-purpose language really matters. Like R, a significant part of the Scipy package features Fortran and C code. Note that this paper does not discuss the scikit-* packages, which surely contributed over the years to enhance the data science stack available in Python.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;This remains a distinguishing feature of Python for science, and one of the reasons why it has been so successful in the realm of data science: instead of adding general features to a language designed for numerical and scientific computing, here scientific features are added to a general purpose language.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-07-28-18-21-30.png"&gt;
&lt;/figure&gt;
&lt;h3 id="techniques-for-automated-machine-learning-chen-et-al-2019-arxiv190708908v1"&gt;Techniques for Automated Machine Learning (Chen et al., 2019) &lt;a href="https://arxiv.org/abs/1907.08908"&gt;arXiv:1907.08908v1&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;While I first learned about automated ML and related techniques &lt;a href="http://docs.h2o.ai/h2o/latest-stable/h2o-docs/automl.html"&gt;via H2O.ai&lt;/a&gt; and a &lt;a href="https://aliquote.org/post/automated-ml/"&gt;few other packages&lt;/a&gt;, it looks like the rise of AI-related research (e.g., deep learning), the need to combine several classifiers (like in ensemble methods) or to apply complex preprocessing or feature enginering steps before building up a reliable model, and probably a bit of black-boxing all call for new method of managing ML models. In short, automated ML allows to build flexible pipeline that can perform automatic tuning of feature engineering, model hyperparameters, or even the deep learning machinery itself. Reinforcement learning and evolutionary algorithms (the same techniques we were hearing from back in the late era of AI in the 90&amp;rsquo;s) are popular techniques for automated ML, especially in the case of feature engineering. This review remains quite technical, and assumes you are already a good ML practitioner, IMHO.&lt;/p&gt;
&lt;h3 id="p--a-differentiable-programming-system-to-bridge-machine-learning-and-scientific-computing-innes-et-al-2019-arxiv190707587v2"&gt;∂P : A Differentiable Programming System to Bridge Machine Learning and Scientific Computing (Innes et al., 2019) &lt;a href="https://arxiv.org/abs/1907.07587"&gt;arXiv:1907.07587v2&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://julialang.org"&gt;Julia&lt;/a&gt; is a nice language, but I have never really been able to get involved in it. I mean, there are so many things that changed between version 0.4, 0.5, then 0.6, and now 0.7/1.0 that I didn&amp;rsquo;t really have time to follow or relearn what I was doing at the beginning (i.e., when everything had to be installed manually from Github). Anyway, it is a good thing that there are some good contenders to R or Python on the Market. In this paper, the authors describes ∂P, which is a system built on top of Julia to perform automatic differentiation&amp;ndash;you know, that &lt;a href="http://www.robots.ox.ac.uk/~tvg/publications/talks/autodiff.pdf"&gt;little thing&lt;/a&gt; that is used to transform code for one function into code for the derivative of that function. I am not particularly involved in AD, but I always find interesting to read about the potential of a PL in a particular field of applications, even if it is not my business&amp;ndash;call this curiosity, or procrastination, or whatever. Some parts are very technical, either on the math side or on the Julia-related data structures, but the examples cover neural networks, computer vision, financial derivatives, and even quantum ML (never heard of it before reading that paper), and they are quite illustrative of how the ∂P system actually works.&lt;/p&gt;
&lt;h3 id="generalised-linear-models-for-prognosis-and-intervention-theory-practice-and-implications-for-machine-learning-arnold-et-al-2019-arxiv190601461"&gt;Generalised linear models for prognosis and intervention: Theory, practice, and implications for machine learning (Arnold et al., 2019) &lt;a href="https://arxiv.org/abs/1906.01461"&gt;arXiv:1906.01461&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;As I said in my &lt;a href="https://aliquote.org/post/tech-review-july-2019/"&gt;previous post&lt;/a&gt;, the all-in-one blind approach to ML has been challenged by Frank Harrell and &amp;rsquo;traditional&amp;rsquo; statisticians at numerous occasions. Maybe, as some used to say, that Breiman&amp;rsquo;s &amp;ldquo;two cultures&amp;rdquo; paper hasn&amp;rsquo;t aged so well after all. This article deals with the application of GLMs in prognosis research, where statisticians are more concerned with prediction than explanation.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In health research, ML is often hailed as the new frontier of data analytics which, combined with big data, will purportedly revolutionise delivery of healthcare (e.g. through ‘personalised medicine’), provide new and important insights into disease processes, and ultimately lead to more informed public health policy and clinical decision-making.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is indeed making a strong case of ML in health research, and I haven&amp;rsquo;t heard of any significant result in this direction so far. But gain, go check Frank Harrell discussion on this hot topic. The authors, however, chose to discuss the subtle issue of conflating prediction with causation, which even in the case of regression models is often overlooked: GLMs remain blind to the causal structure of the data, so do ML models. The authors then provide a thorough exposition of how to select and parameterize covariates in a predictive or causal model, and how each model may be assessed and interpreted in turn. It turns out that ML reasearch should also take into account this fine distinction, for &amp;ldquo;much of the promise of ML is predicated on prediction which prioritises the strength of (undirected) associations over the causal structures that give rise to them, and subsequently prioritises data-driven over theory-driven model selection.&amp;rdquo;&lt;/p&gt;
&lt;h3 id="please-stop-permuting-features-an-explanation-and-alternatives-hooker-et-al-2019-arxiv190503151v1"&gt;Please Stop Permuting Features An Explanation and Alternatives (Hooker et al., 2019) &lt;a href="https://arxiv.org/abs/1905.03151"&gt;arXiv:1905.03151v1&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;TLDR; When features in the training set exhibit statistical dependence, permutation methods can be highly misleading when applied to the original model.&lt;/p&gt;
&lt;p&gt;Permutation-based measures of variable importance, partial dependence plots, and individual conditional expectation plots are cheap and parameter-free techniques to assess the predictive support of variables, or features, in a given ML algorithm. However, they are known to exhibit serious flaws when there exist intercorrelations between features. I used to illustrate some of the problem of partial dependence in a &lt;a href="https://aliquote.org/pub/mva_clinres.pdf"&gt;previous talk&lt;/a&gt;. Alternatives do exist, though, e.g. permutation measures of variable importance based on conditional distribution, leave-one-covariate-out technique, but they stick to the permute-and-repredict framework, while retraining a model after permuting feature of interest might provide an interesting way to reduce the importance of correlated features, albeit at a larger computational cost.&lt;/p&gt;</description></item><item><title>Tech Review / July 2019</title><link>https://aliquote.org/post/tech-review-july-2019/</link><pubDate>Fri, 26 Jul 2019 20:50:32 +0200</pubDate><guid>https://aliquote.org/post/tech-review-july-2019/</guid><description>&lt;p&gt;A little review of my current Safari session since it is probably time to close all those tabs bookmarked on my iPhone.&lt;/p&gt;
&lt;p&gt;I have long been aspiring to some kind of digital minimalism, and I think I am almost there, with my using only essential applications&amp;ndash;to write, code, and read&amp;ndash;and almost very reliable ones&amp;ndash;Vim or Emacs, a Terminal, and macOS builtin and optimized apps. I would have a harder time to live without my bookshelf or my 25-year old collection of records. However, &lt;a href="https://markmanson.net/minimalism"&gt;it seems that we can&lt;/a&gt;, provided you live like a real bohemian. (I came across this by reading one of Irreal &lt;a href="https://irreal.org/blog/?p=8197"&gt;blog post&lt;/a&gt; recently.)&lt;/p&gt;
&lt;p&gt;I don&amp;rsquo;t use Chrome, and I don&amp;rsquo;t think it is a good idea to use any Google products by now. Facebook is just a little toy compared to the power that Google has accumulated over years. I am using a Mac and I subscribed to Apple Music, though, and you could retort that it&amp;rsquo;s all the same. I don&amp;rsquo;t think so, since it&amp;rsquo;s not the same offer of services, unless you think of Chromebook (or Android) users. Anyway, here is a little joy for Lisp saavy users: &lt;a href="http://vito.sdf.org/dino.html"&gt;Dinosaur and Lisp&lt;/a&gt;. Note, however, that you will need to have a working Chrome(ium).&lt;/p&gt;
&lt;p&gt;I didn&amp;rsquo;t knwo there was such a thing, but here it is: &lt;a href="https://www.cs.umd.edu/~nau/cmsc421/norvig-lisp-style.pdf"&gt;Tutorial on Good Lisp Programming Style&lt;/a&gt;, by Peter Norvig (PDF, 116 pp.). &lt;a href="https://docs.quantifiedcode.com/python-anti-patterns/index.html"&gt;The Little Book of Python Anti-Patterns&lt;/a&gt; also provides good tips regarding Python this time.&lt;/p&gt;
&lt;p&gt;Some CS ressources here and there: &lt;a href="http://cslibrary.stanford.edu"&gt;Stanford CS Education Library&lt;/a&gt; (via HN), &lt;a href="https://purelyfunctional.tv/mini-guide/the-ultimate-guide-to-learning-clojure-for-free/"&gt;The Ultimate Guide to Learning Clojure for Free&lt;/a&gt;; and a particular HT to Greg Wilson for his &lt;a href="https://gvwilson.github.io/tidynomicon/"&gt;Tidynomicon&lt;/a&gt; (I don&amp;rsquo;t like the tidyverse but this could people in a hurry, plus there are some interesting tips on interacting with Python or developing web app through Shiny) and, of course, the &lt;a href="http://js4ds.org"&gt;JavaScript for Data Science&lt;/a&gt; website.&lt;/p&gt;
&lt;p&gt;Some fresh articles for the interested scientific reader:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://arxiv.org/abs/1905.03151"&gt;Please Stop Permuting Features: An Explanation and Alternatives&lt;/a&gt;: An interesting take on why permutation-based statistics may lead to erroneous assessment of model accuracy, especially in the case of strongly correlated predictors;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.nature.com/articles/s41586-019-1411-0"&gt;Advances in epigenetics link genetics to the environment and disease&lt;/a&gt;: A great review of epigenetics and its role/implication in biology and health-related research;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://arxiv.org/abs/1907.10121"&gt;SciPy 1.0—Fundamental Algorithms for Scientific Computing in Python&lt;/a&gt;: Surely a great read for people interested in scientific computing, at least for the historical side and the resulting popularity of Python in data science and computational statistics;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://tompepinsky.files.wordpress.com/2017/06/jop2017.pdf"&gt;Lagged Explanatory Variables and the Estimation of Causal Effect&lt;/a&gt; (PDF, 15 pp.): In which the uthors used DAGs and Monte Carlo simulations to demonstrate that lag identification often leads to incorrect inferences;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://arxiv.org/abs/1906.01461"&gt;Generalised linear models for prognosis and intervention: Theory, practice, and implications for machine learning&lt;/a&gt;: All you need to known about GLM vs. ML for prediction and causal inference, as a complement to Frank Harrell&amp;rsquo;s excellent &lt;a href="https://www.fharrell.com/post/stat-ml"&gt;past discussion&lt;/a&gt; of this hot topic.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Do you like quines? How about &lt;a href="https://blog.matthewbarber.io/2019/07/22/how-to-make-compressed-file-quines"&gt;making compressed file quines, step by step&lt;/a&gt;? This blog post provides a nice description of how GZIP files are encoded and how they can be manipulated using Python.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://linuxhint.com/vim_vs_emacs/"&gt;Vim vs Emacs: Detailed Comparison&lt;/a&gt;, or the Holy war again. Interesting post, albeit a little too generalist for my taste (thx to Irreal!). On a related side, I happened to read a nice post on the &lt;a href="https://begriffs.com/posts/2019-07-19-history-use-vim.html"&gt;history of Vim&lt;/a&gt; recently.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www4.di.uminho.pt/~jno/ps/pdbc.pdf"&gt;Program Design by Calculation&lt;/a&gt; is a (draft) textbook all about functional programming, functors and monads, and Haskell:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Functional programming has a tradition of absorbing fresh results from theoretical computer science, algebra and category theory. Languages such as Haskell have been competing to integrate the most re- cent developments and therefore are excellent prototyping vehicles in courses on program calculation, as happens with this book.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;You may also like the related blog post: &lt;a href="http://www.philipzucker.com/a-short-skinny-on-relations-towards-the-algebra-of-programming/"&gt;A Short Skinny on Relations &amp;amp; the Algebra of Programming&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Well, that&amp;rsquo;s all for this month!&lt;/p&gt;</description></item><item><title>The unquantified self #9</title><link>https://aliquote.org/post/unquantified-self-009/</link><pubDate>Thu, 18 Jul 2019 20:17:29 +0200</pubDate><guid>https://aliquote.org/post/unquantified-self-009/</guid><description>&lt;p&gt;Long time no see. Here are some news from the past already.&lt;/p&gt;
&lt;p&gt;I have been pretty busy with daily work, except the last few weeks where I was almost done with ongoing projects. Although my main programming activities were in Python, I took some time to use Common Lisp again, and to learn more seriously Racket and OCaml. Next on the radar is Clojure, of course. However, this does not mean I had so much time to rest since I also started a new anti-hypertensive treatment after my annual hospitalization day, which resulted in a drop in blood pressure to 9/5 and severe hyperkalemia that needed to be urgently corrected. Nothing but happiness the last three days!&lt;/p&gt;
&lt;p&gt;We didn&amp;rsquo;t waste any time with the TV series, my son and I, and we are now on the &lt;em&gt;Chernobyl&lt;/em&gt; series after a few detours on trilogies dating back about ten years (&lt;em&gt;John Wick&lt;/em&gt;, &lt;em&gt;Taken&lt;/em&gt;, &lt;em&gt;Jason Bourne&lt;/em&gt;), &lt;a href="https://aliquote.org/post/unquantified-self-006/"&gt;as planned&lt;/a&gt;. A picture is worth thousand words:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-07-02-20-54-00.png"&gt;
&lt;/figure&gt;
&lt;p&gt;These days I tend to keep away from Twitter. To be honest, except for a few French people that I started following later&amp;ndash;and who are more fun or politically engaged than scientifically enraged&amp;ndash;I am getting tired of Twitter. My TL is just a mess but it may well be that I am just no longer interested in reading random clash about R vs. Python, or base R vs. the tidyverse (which, of course, is far from being my cup of tea), nor in biomedical studies. Anyway, I am back to good old RSS feeds, and I am happy with &lt;a href="https://aliquote.org/post/reeder-app/"&gt;Reeder&lt;/a&gt; for that purpose.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve been saying for a long time that I have to take a picture of it, so here is a drawing made by my son and printed on a cloth:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/IMG_0731.jpeg"&gt;
&lt;/figure&gt;
&lt;p&gt;This is him, as seen by himself, when he was in primary school. I love it/him.&lt;/p&gt;
&lt;p&gt;I don&amp;rsquo;t have much to say today. I am on vacation, by the way. I may post more regularly, or nothing at all. Let&amp;rsquo;s see how it goes. After a few weeks of cooking asparagus, it&amp;rsquo;s time for the tomato. It&amp;rsquo;s summer time after all.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/IMG_0732.jpg"&gt;
&lt;/figure&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0725.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0725.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0715.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0715.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-3"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0697.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0697.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;Enlovés dans les draps défaits de la nuit&lt;br&gt;
Nous passions notre temps à démêler le crin des étoiles.&lt;br&gt;
Sans un bruit le jour reprise les pelotes après avoir scellé nos voix&lt;br&gt;
Nous qui désormais partageons la même ombre.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="music" align="right"&gt;
&lt;p&gt;♪ Bill Fay • &lt;em&gt;Who is the Sender?&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>From Polya to Euler problem</title><link>https://aliquote.org/post/polya-meets-euler/</link><pubDate>Fri, 12 Jul 2019 10:20:08 +0200</pubDate><guid>https://aliquote.org/post/polya-meets-euler/</guid><description>&lt;p&gt;One of Euler problem asks to find the number of ways we can traverse a square lattice using only horizontal and vertical moves (think of the Manhattan distance).&lt;/p&gt;
&lt;p&gt;Interestingly, while a brute-force approach might help to find a working solution in &lt;a href="http://code.jasonbhill.com/python/project-euler-problem-15/"&gt;more or less&lt;/a&gt; decent time, this problem amounts to a problem of combinatorics. Pólya proposed a similar problem, where the task is to spell out &amp;ldquo;abracadabra&amp;rdquo; by traversing the following pattern, assuming the starting position is at the top most A:&lt;sup&gt;&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; A
B B
R R R
A A A A
C C C C C
A A A A A A
D D D D D
A A A A
B B B
R R
A
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As you can see, we can only move in two directions, and the problem is identical to Euler problem 15. Here is a valid solution:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; A
• B
• • R
• • A •
• • • C •
• • • A • •
• • D • •
• A • •
• B •
R •
A
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;There are of course many other valid solutions. How many exactly? In fact, it can be shown that this path finding problem amounts to compute how many different paths there are from the nrothern corner to various other corners, travelling only in one two directions. If we label each node with the number of ways they can be reached, we get the well-known &lt;a href="https://en.wikipedia.org/wiki/Pascal%27s_triangle"&gt;Pascal triangle&lt;/a&gt;, and of course these numbers are the &lt;a href="https://en.wikipedia.org/wiki/Binomial_coefficient"&gt;binomial coefficients&lt;/a&gt;, which Euler noted as $n \choose r$ to indicate the number of ways of choosing a subset of size $r$ from a set of fixed size $n$. The boundary conditions are ${n \choose 0} = {n \choose n} = 1$, and there exists a nice recursive relationship, which can also be inferred upon inspecting Pascal triangle:&lt;/p&gt;
&lt;p&gt;$$ {n+1 \choose r} = {n \choose r-1} + {n \choose r}. $$&lt;/p&gt;
&lt;p&gt;In the case of Euler problem 15, the question can be reframed as choosing $k$ out of $2k$ possible paths, assuming the order doesn&amp;rsquo;t matter, or ${2k \choose k} = \frac{(2k)!}{k!\cdot k!}$. Factorials are easy to compute, and for moderate $k$ like in this case, using standard multiplication should perform correctly.&lt;/p&gt;
&lt;p&gt;Here is my solution to Euler problem 15 in Racket. Note that Racket does not provide a &lt;code&gt;reduce&lt;/code&gt; procedure, unless you are willing to use the &lt;a href="https://docs.racket-lang.org/srfi/srfi-1.html?q=reduce"&gt;srfi/1&lt;/a&gt; module. The following code makes use of a custom &lt;code&gt;reduce&lt;/code&gt; function which expects two parameters, a function and a list: the function is applied to the head of the list and the reduction follows with the rest of the list.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;reduce&lt;/span&gt; &lt;span class="nv"&gt;f&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;and &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;not &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;empty?&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;foldl&lt;/span&gt; &lt;span class="nv"&gt;f&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;first&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;rest&lt;/span&gt; &lt;span class="nv"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;f&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;reduce&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;x&lt;/span&gt; &lt;span class="nv"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;* &lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="nv"&gt;y&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;range&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;add1&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;sol-015&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;ceiling &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;/ &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;f&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;* &lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;f&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;f&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;sol-015&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Pólya, George, Tarjan, Robert E. and Woods, Donald R. &lt;em&gt;Notes on Inroductory Combinatorics&lt;/em&gt;. Springer, 1983.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Digit Sum</title><link>https://aliquote.org/post/digit-sum/</link><pubDate>Mon, 08 Jul 2019 10:14:05 +0200</pubDate><guid>https://aliquote.org/post/digit-sum/</guid><description>&lt;p&gt;A lot of Euler problems amount to find the sum of digits in a given numbers. The digit sum is easy to compute using Lisp or Scheme, provided you convert the number at hand into a list or as a string, then as ascii-decoded character: &lt;code&gt;(char-&amp;gt;integer #\1)&lt;/code&gt; returns 49 in Racket so it is quite easy to write a little helper function to convert any character into its corresponding integer value.&lt;/p&gt;
&lt;p&gt;However, if you prefer to keep working with numbers, here is a little function that will convert any number into a list of digits. It is then a matter of applying &lt;code&gt;foldr&lt;/code&gt; or &lt;code&gt;apply&lt;/code&gt; to this list to compute any quantity of interest, e.g., the sum of all digits:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;digits&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;zero? &lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;null&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cons &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;remainder &lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;digits&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;quotient &lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;A more general formula to compute the digit sum of $x$ in base $b=10$ is:&lt;/p&gt;
&lt;p&gt;$$
\sum_{n=0}^{\lfloor\log_{10}x\rfloor}\frac{1}{10^n}(x, \textrm{mod}, 10^{n+1}-x, \textrm{mod}, 10^n).
$$&lt;/p&gt;
&lt;p&gt;This is widely used in checksum algorithms, for instance the Luhn number checksum, also called the mod-10 algorithm. Here it is in Scheme:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scheme" data-lang="scheme"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;mod-10&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;- &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;modulo &lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;expt &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;add1&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;modulo &lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;expt &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;digit-sum&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;for/list&lt;/span&gt; &lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;in-range&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;ceiling &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;log &lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)))])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;* &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;/ &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;mod-10&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;A related idea can be found in the &lt;a href="https://dvsoft.developpez.com/Articles/CRC/"&gt;CRC error checking&lt;/a&gt; algorithm. There are various Lisp implementation of the CRC algorithm, &lt;a href="http://www.thoughtstuff.com/rme/crc.lisp"&gt;here&lt;/a&gt; and &lt;a href="https://github.com/robblackwell/cl-crc64"&gt;there&lt;/a&gt;.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2024-01-19]&lt;/small&gt;&lt;br&gt;
Mathematica 14 now has its own &lt;code&gt;DigitSum&lt;/code&gt; function.
&lt;/div&gt;</description></item><item><title>Euler Problems 1-10</title><link>https://aliquote.org/post/euler-problem-1-10/</link><pubDate>Thu, 04 Jul 2019 15:53:39 +0200</pubDate><guid>https://aliquote.org/post/euler-problem-1-10/</guid><description>&lt;p&gt;I have been having fun recently solving the first Euler problems using Racket. Here are some notes I took when trying to solve the problem. Note that I do not reveal the solutions in this post nor some of the tips recommended on the site to improve naive algorithms. Oftentimes, brute force methods are enough to solve the problem. Regarding Racket code, mistakes are mine.&lt;/p&gt;
&lt;h2 id="problem-1"&gt;Problem 1&lt;/h2&gt;
&lt;p&gt;Brute-force is eligible in this case, computer are fast enough for such small numbers. If you are looking for an elegant answer, probably Haskell will be your friend for this particular problem, as it amounts to:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-haskell" data-lang="haskell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;sum&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="ow"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="mi"&gt;999&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;A more elegant solution exploits the fact that we count numbers divisible by 15 twice, when enumerating numbers that are divisible by either 3 or 5.&lt;/p&gt;
&lt;p&gt;A little helper function, defined as follows, provides a more efficient way to solve the problem:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sum-divisible-by&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let*&lt;/span&gt; &lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;limit&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;floor&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;/&lt;/span&gt; &lt;span class="n"&gt;limit&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;))])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;*&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;*&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;add1&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="problem-2"&gt;Problem 2&lt;/h2&gt;
&lt;p&gt;The conscious reader will &lt;a href="https://mathematica.stackexchange.com/q/37266"&gt;check&lt;/a&gt; and &lt;a href="https://math.stackexchange.com/q/2386804"&gt;prove&lt;/a&gt; that it is possible to exploit the fact that even numbers occur every three steps, so that we save money on the even-number filter. For the record, the Racket &lt;a href="https://docs.racket-lang.org/reference/pairs.html?q=range#%28def._%28%28lib._racket%2Flist..rkt%29._range%29%29"&gt;range&lt;/a&gt; function has everything we need to iterate over a list of numbers using a predefined step.&lt;/p&gt;
&lt;h2 id="problem-3"&gt;Problem 3&lt;/h2&gt;
&lt;p&gt;The Haskell wiki has some working code for &lt;a href="https://wiki.haskell.org/Testing_primality#Primality_Test_and_Integer_Factorization"&gt;primality testing&lt;/a&gt; and the like. Using Racket, Lisp or Python, we don&amp;rsquo;t have to worry working with very large integers. Moreover, Racket has a nice submodule related to number theory in &lt;code&gt;math&lt;/code&gt;, which simplifies the task to a great extent. Otherwise, we would have to implement prime factorization ourselves (see, e.g., &lt;a href="https://gist.github.com/dstnbrkr/855700"&gt;this gist&lt;/a&gt;).&lt;/p&gt;
&lt;h2 id="problem-4"&gt;Problem 4&lt;/h2&gt;
&lt;p&gt;There are probably many ways to tackle this problem. If we want to treat this like a classical palindrome problem, we need to deal with number-to-string conversion, and then rely on brute-force searching using Racket &lt;code&gt;for&lt;/code&gt;-loop facilities. The trick is to limit the iteration to numbers ranging from 100 to 999 (and not 0 to 1000 since we want 3-digit number), and to start with larger values as it will increase our chance to find a large palindrome early on. Another nice solution appears at &lt;a href="https://blog.jverkamp.com/2012/11/07/project-euler-4/"&gt;JP&amp;rsquo;s blog&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="problem-5"&gt;Problem 5&lt;/h2&gt;
&lt;p&gt;This is just a brute-force approach, exploiting &lt;code&gt;for&lt;/code&gt;-loop in Racket and existing algorithm for &lt;a href="https://docs.racket-lang.org/reference/generic-numbers.html"&gt;generic numerics&lt;/a&gt;. We could roll our own routines to compute &lt;code&gt;gcd&lt;/code&gt; and &lt;code&gt;lcm&lt;/code&gt;, e.g.:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;gcd&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;a&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;gcd&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;remainder&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;lcm&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;abs&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;*&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;gcd&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="problem-6"&gt;Problem 6&lt;/h2&gt;
&lt;p&gt;Again, the Racket doesn&amp;rsquo;t use any optimization trick. However, a clever implementation would use the fact that $1+2+\dots+n = \tfrac{1}{2}n(n+1)$, and $1^2+2^2+\dots+n^2 = \tfrac{1}{6}n(2n+1)(n+1)$. In the latter case, we can even prove that the sum of square of the $n$ first odd numbers is $\frac{n(4n^2-1)}{3}$, while the sum of squares of the $n$ first even numbers is $\frac{2n(n+1)(2n+1)}{3}$.&lt;/p&gt;
&lt;p&gt;Not sure if we really need to care with infinite precision integers. Using Mathematica, this boils down to &lt;code&gt;Total[Range[10]]^2 - Total[Range[10]^2]&lt;/code&gt;. In any case, those two quantities are well known in applied statistical textbooks, although &lt;a href="https://www.johndcook.com/blog/2008/09/26/comparing-three-methods-of-computing-standard-deviation/"&gt;Welford&amp;rsquo;s method&lt;/a&gt; is also a good approach when it comes to computing an empirical variance.&lt;/p&gt;
&lt;h2 id="problem-7"&gt;Problem 7&lt;/h2&gt;
&lt;p&gt;Mathematica probably provides the shortest answer using &lt;code&gt;Prime[10001]&lt;/code&gt; (and I guess Pari/GP would do as well). And, of course, Racket get you covered with the &lt;code&gt;nth-prime&lt;/code&gt; &lt;a href="https://docs.racket-lang.org/math/number-theory.html#%28def._%28%28lib._math%2Fnumber-theory..rkt%29._nth-prime%29%29"&gt;procedure&lt;/a&gt;. Beware that you will need to ask for &lt;code&gt;(nth-prime 10000)&lt;/code&gt;, and not 10001 since Racket uses 0-base index, i.e. &lt;code&gt;(nth-prime 0)&lt;/code&gt; returns 2.&lt;/p&gt;
&lt;p&gt;In any case, enumerating Prime numbers suggest to use an efficient way to assess whether a given integer is a prime, such as the &lt;a href="https://www.cs.hmc.edu/~oneill/papers/Sieve-JFP.pdf"&gt;Sieve of Erasthothenes&lt;/a&gt; (a sieve algorithm for Prime numbers is discussed in the SICP textbook, but it turns out it is a different algorithm; likewise, the &amp;ldquo;trial division&amp;rdquo;, which checks if a number $x$ is a prime by testing its divisibility against each of the primes $ &amp;lt; x$, is a suboptimal approach). There are interesting implementations in Scheme available on Programming Praxis, e.g., &lt;a href="https://programmingpraxis.com/2009/02/19/sieve-of-eratosthenes/"&gt;Sieve of Eratosthenes&lt;/a&gt;, &lt;a href="https://programmingpraxis.com/2015/07/31/incremental-sieve-of-eratosthenes/"&gt;Incremental Sieve Of Eratosthenes&lt;/a&gt;, or &lt;a href="https://programmingpraxis.com/2010/02/05/segmented-sieve-of-eratosthenes/"&gt;Segmented Sieve Of Eratosthenes&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;A concise and elegant solution can be written in Python using a generator function:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;sieve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;False&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;match&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;enumerate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="k"&gt;match&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;yield&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The problem when using a sieve is that you need to list all values up to a certain number of items, i.e., it won&amp;rsquo;t tell you what&amp;rsquo;s the $k$-th prime number. Anyway, to get the last value computed by the above generator and not print all items using list comprehension, you can use a &amp;ldquo;deque&amp;rdquo;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;collections&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;deque&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;deque&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sieve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;maxlen&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pop&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="problem-8"&gt;Problem 8&lt;/h2&gt;
&lt;p&gt;This is a common pattern in time series analysis or exploratory data analysis and it boils down to using a rolling window and to apply a custom function on observations falling in each consecutive window. A specific use case is computing the moving average of temporal data. Nice solutions in Python can be found with little googling, but here is reusable generic function in Racket (credit to &lt;a href="https://stackoverflow.com/a/40520792"&gt;Jens Axel Søgaard&lt;/a&gt;):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rolling-window&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let*&lt;/span&gt; &lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list-&amp;gt;vector&lt;/span&gt; &lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;vector-length&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;)])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;for/list&lt;/span&gt; &lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;max&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;-&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;-1&lt;/span&gt;&lt;span class="p"&gt;))])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;vector-&amp;gt;list&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;vector-copy&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;))))))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="problem-9"&gt;Problem 9&lt;/h2&gt;
&lt;p&gt;Note that a solution appears on Racket documentation center, specifically in the &lt;a href="https://docs.racket-lang.org/infix-manual/"&gt;Infix Expressions for Racket&lt;/a&gt; manual. Here, we will be using a little helper function to check whether a given tuple &lt;code&gt;(a,b,c)&lt;/code&gt; form a valid Pythagorean triplet, and then iterate over the list of possible candidates. The brute-force solution should work, yet it is possible to avoid iterating over a grid of 1000 by 1000 for &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt; by remarking that since $a &amp;lt; b &amp;lt; c$ we must have $a&amp;lt;\tfrac{a+b+c}{3}$ and $a &amp;lt; b &amp;lt; \tfrac{a+b+c}{3}$. Lastly, there&amp;rsquo;s no need to iterate over &lt;code&gt;c&lt;/code&gt; as it is readily computed as &lt;code&gt;1000-a-b&lt;/code&gt;, and of course it is way better to start the iteration with the largest values available.&lt;/p&gt;
&lt;h2 id="problem-10"&gt;Problem 10&lt;/h2&gt;
&lt;p&gt;This requires basically the same tool than Problem 7. Since it amounts to testing all integers up to two million, we do not need to implement an approximate primality testing algorithm.&lt;/p&gt;</description></item><item><title>Micro-posting in June</title><link>https://aliquote.org/post/micro-06-2019/</link><pubDate>Sat, 29 Jun 2019 19:04:05 +0200</pubDate><guid>https://aliquote.org/post/micro-06-2019/</guid><description>&lt;p&gt;Quick recap&amp;rsquo; of June on the Micro blog.&lt;/p&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-06-03&lt;/a&gt;: Is it worth trying &lt;a href="https://sourcehut.org"&gt;another VCS&lt;/a&gt;? Even if free and open-source?&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-03&lt;/a&gt;: So I&amp;rsquo;ve heard that Apple iTunes will be discontinued soon. We will get seperate apps, like their iOS counterparts. I can understand that, although I will miss iTunes a lot. Sadly, this is when it reached a steady state of usability that it get dropped. RIP anyway.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-03&lt;/a&gt;: Yesterday&amp;rsquo;s evening brunch:&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_0699.jpg" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-03&lt;/a&gt;: &lt;a href="https://dev.to/unseenwizzard/learn-git-concepts-not-commands-4gjc"&gt;Learn git concepts, not commands&lt;/a&gt;. Very nice tutorial about Git!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-03&lt;/a&gt;: &lt;a href="https://twitter.com/WeAreRLadies/status/1134516110546604033"&gt;Lovely&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-03&lt;/a&gt;: &lt;a href="http://www.stat.cmu.edu/~larry/=sml/"&gt;Statistical Methods for Machine Learning&lt;/a&gt;, by Larry Wasserman.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-03&lt;/a&gt;: &lt;a href="http://www.sumsar.net/blog/2015/04/the-non-parametric-bootstrap-as-a-bayesian-model/"&gt;The Non-parametric Bootstrap as a Bayesian Model&lt;/a&gt;. (via &lt;a href="https://twitter.com/kaz_yos/status/1134920952851128322"&gt;@kaz_yos&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-04&lt;/a&gt;: Having fun these days with the #WWDC19 mentions on Twitter. On the one hand, it&amp;rsquo;s much like reading plain spoilers during GoT; on the other hand, it&amp;rsquo;s a nice reminder that we&amp;rsquo;ll probably have to switch back to Linux earlier than expected. Sad but true.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-04&lt;/a&gt;: The Common Lisp Cookbook: &lt;a href="https://lispcookbook.github.io/cl-cookbook/emacs-ide.html"&gt;Using Emacs as an IDE&lt;/a&gt;. When I switched to Doom a few weeks ago, I realized that it now has full support for &lt;a href="https://joaotavora.github.io/sly/"&gt;SLY&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-04&lt;/a&gt;: Tired of mutt or mu4e? &lt;a href="https://aerc-mail.org"&gt;aerc&lt;/a&gt; is an email client that runs in your terminal. (via HN)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-04&lt;/a&gt;: &lt;a href="http://metasoarous.com/blog/oz-static-site-generation"&gt;Oz static site generation&lt;/a&gt;. Note that &lt;a href="https://github.com/metasoarous/oz"&gt;Oz&lt;/a&gt; is a &amp;ldquo;data visualization and scientific document processing library for Clojure built around Vega-Lite &amp;amp; Vega&amp;rdquo; (as found in Gorilla-REPL). &lt;code&gt;#clojure&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-05&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/playlist/ecm/pl.5a9326f0f5da47059b21850add4d145b" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Listening to some &lt;em&gt;ECM&lt;/em&gt; records while it&amp;rsquo;s raining.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-05&lt;/a&gt;: Late readings on &lt;code&gt;#database&lt;/code&gt;:- &lt;a href="https://flink.apache.org/2019/05/14/temporal-tables.html"&gt;Temporal Tables and Joins in Streaming SQL&lt;/a&gt;- &lt;a href="https://www.categoricaldata.net"&gt;Categorical Query Language&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-05&lt;/a&gt;: Never heard of the &lt;a href="https://eugenkiss.github.io/7guis/"&gt;7GUIs&lt;/a&gt; challenge. Here is a &lt;a href="https://github.com/mfelleisen/7GUI"&gt;proposal&lt;/a&gt; in Racket, by Matthias Felleisen himself. &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-05&lt;/a&gt;: &lt;a href="https://github.com/kellyi/clj-lisp-sandbox"&gt;Exercises from functional programming books in Clojure, Common Lisp, and Scheme&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-06&lt;/a&gt;: &lt;a href="https://livefreeordichotomize.com/2019/06/04/using_awk_and_r_to_parse_25tb/"&gt;Using AWK and R to parse 25TB&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-07&lt;/a&gt;: &amp;gt; At heart, a programming language embodies a bet, the bet that a given set of abstractions will increase developers’ ability to deliver software that meets its requirements.&amp;gt; &amp;ndash; &lt;a href="https://arxiv.org/pdf/1901.10220.pdf"&gt;On the Impact of Programming Languages on Code Quality&lt;/a&gt; (arXiv).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-07&lt;/a&gt;: So I can&amp;rsquo;t connect to Bitbucket anymore, which heppened to many other users since the BitBucket/Atlassian fusion. That&amp;rsquo;s the beauty of Git. Let&amp;rsquo;s go relocate those old repos to GitHub!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-07&lt;/a&gt;: So we are definitely done with GoT. Sad news (warning, little spoil here): they killed all the pretty little girls all along but Tyrion stayed alive. Enjoy!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-07&lt;/a&gt;: Time to go watch the next Season of &lt;a href="https://en.wikipedia.org/wiki/The_100_(TV_series)"&gt;The 100&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-07&lt;/a&gt;: VS Code is really great for Python. I didn&amp;rsquo;t have a chance to try the MS C/C++ functionalities, but &lt;a href="https://clojureverse.org/t/the-calva-journey-continues-please-jack-in/4335"&gt;Calva&lt;/a&gt; is on my todo list anyway.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-07&lt;/a&gt;: &lt;a href="https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-042j-mathematics-for-computer-science-fall-2010/"&gt;Mathematics for Computer Science&lt;/a&gt;, by Eric Lehman and Tom Leighton. A more recent version of the textbook than the one referenced by &lt;a href="https://twitter.com/CompSciFact/status/1136375927515078658"&gt;John D. Cook&lt;/a&gt; is &lt;a href="https://courses.csail.mit.edu/6.042/spring17/mcs.pdf"&gt;available here&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-07&lt;/a&gt;: &lt;a href="https://github.com/Mathieu-Desrochers/Schemings"&gt;You dig Scheme. The world is coded in C. You get both.&lt;/a&gt; &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-10&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/curtains/1368881946" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Tindersticks, &lt;em&gt;Curtain&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-11&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/meltemi/308980638" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Alboran Trio, &lt;em&gt;Meltemi&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-11&lt;/a&gt;: I just discovered the &lt;a href="https://github.com/bhilburn/powerlevel9k"&gt;Powerlevel9k&lt;/a&gt; zsh theme, which looks really great. This is a bit too much to my taste but I&amp;rsquo;ll keep this on my totry list.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-11&lt;/a&gt;: Latest action movies watched: &lt;a href="https://www.imdb.com/title/tt6494418/"&gt;Siberia&lt;/a&gt; a few days ago (since everyone likes to talk about Keanu Reeves right now) &amp;ndash; didn&amp;rsquo;t like it much; &lt;a href="https://www.imdb.com/title/tt2679042/"&gt;Agent 47&lt;/a&gt;, yesterday. Latest book read: &lt;em&gt;&lt;a href="https://www.worldcat.org/title/pactum-salis/oclc/1019638996"&gt;Pactum Salis&lt;/a&gt;&lt;/em&gt; (Olivier Bourdeaut) &amp;ndash; really great reading!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-11&lt;/a&gt;: Yet another &lt;a href="https://www.bigeekfan.com/post/20180610_zsh_prompt_hacking/"&gt;zsh prompt minimalistic theme&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-11&lt;/a&gt;: &lt;a href="https://tylerrhodes.net/posts/first-clojure-program/"&gt;First Clojure Program&lt;/a&gt;, and it&amp;rsquo;s Tetris! &lt;code&gt;#clojure&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-11&lt;/a&gt;: &lt;a href="https://blog.ploeh.dk/2017/10/04/from-design-patterns-to-category-theory/"&gt;From design patterns to category theory&lt;/a&gt; (via HN).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-11&lt;/a&gt;: &lt;a href="https://github.com/manubot/rootstock/pull/233"&gt;Harden shell scripts with improved robustness &amp;amp; verbosity&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-12&lt;/a&gt;: It&amp;rsquo;s raining again, and I&amp;rsquo;m done with the 800th micro-post by now.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-12&lt;/a&gt;: The &lt;a href="https://desktopneo.com"&gt;Desktop Neo&lt;/a&gt; project looks super exciting. This is second time (see &lt;a href="https://uxdesign.cc/introducing-mercury-os-f4de45a04289"&gt;Introducing Mercury OS&lt;/a&gt;) I noticed some fresh new ideas re. OS core UIs.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-13&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/near-gale/276204588" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Alboran Trio, &lt;em&gt;Near Gale&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-13&lt;/a&gt;: Always interesting to find some gems at QA websites:&amp;gt; Four years, 1400 views, and two dozen upvotes before a review on a site dedicated to code reviews points toward unreviewability as a prominent feature of the code. What hinders reviewability is, I think, the high level of cognitive load the code places on anyone reading it. &amp;ndash; &lt;a href="https://codereview.stackexchange.com/a/147918"&gt;https://codereview.stackexchange.com/a/147918&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-13&lt;/a&gt;: Currently reading a review on &lt;a href="https://www.genetics.org/content/205/3/1003"&gt;Molecular Population Genetics&lt;/a&gt;. I have no idea what movie I can watch to occupy the rest of my evening and I&amp;rsquo;ll probably end up drinking on my couch, which is also my bed. Bad news from the stars&amp;hellip;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-13&lt;/a&gt;: &lt;a href="http://lostritto.com/book"&gt;Computational Drawing Book&lt;/a&gt;. I find myself more and more interested in generative art, so this is a nice find. (via &lt;a href="https://twitter.com/mattdesl/status/1138470055715450882"&gt;@mattesl&lt;/a&gt;) &lt;code&gt;#dataviz&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-13&lt;/a&gt;: &lt;a href="http://tomasp.net/academic/drafts/cultures/cultures.pdf"&gt;Cultures of programming&lt;/a&gt;: Understanding the history of programming through controversies and technical artifacts (PDF, 75 pp.). (via &lt;a href="https://twitter.com/Jose_A_Alonso/status/1139100013529882625"&gt;@Jose_A_Alonso&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-13&lt;/a&gt;: &lt;a href="http://www.cs.cornell.edu/courses/cs3110/2019sp/textbook/"&gt;Functional Programming in OCaml&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-13&lt;/a&gt;: &lt;a href="https://wattenberger.netlify.com"&gt;Interactive Charts with D3.js&lt;/a&gt;. (via HN) &lt;code&gt;#dataviz&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-13&lt;/a&gt;: &lt;a href="http://staff.ustc.edu.cn/~csli/graduate/algorithms/book6/toc.htm"&gt;Introduction to Algorithms&lt;/a&gt;, by Thomas H. Cormen, Charles E. Leiserson, and Ronald L. Rivest.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-13&lt;/a&gt;: &lt;a href="http://heather.cs.ucdavis.edu/matloff.html"&gt;One&lt;/a&gt; of the last person, with Dirk and Matt, I find interesting to follow given the recent evolution of the R language. I started with the R Inferno, by Patrick Burns, then discovered Norman&amp;rsquo;s books, in addition to the MASS book. That was all what I needed to get started. Now, &lt;a href="https://github.com/matloff/R-vs.-Python-for-Data-Science/"&gt;this is illuminating&lt;/a&gt;:&amp;gt; R is rapidly devolving into two mutually unintelligible dialects, ordinary R and the Tidyverse. (&amp;hellip;) It might be more acceptable if the Tidyverse were superior to ordinary R, but in my opinion it is not. It makes things more difficult for beginners. E.g. the Tidyverse has so many functions, some complex, that must be learned to do what are very simple operations in base R. Pipes, apparently meant to help beginners learn R, actually make it more difficult, I believe. And the Tidyverse is of questionable value for advanced users.If you&amp;rsquo;re more versed into Julia these days, see also &lt;a href="https://matloff.wordpress.com/2016/07/06/latest-on-the-julia-language-vs-r/"&gt;R vs. Julia&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt; &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-13&lt;/a&gt;: &lt;a href="https://christian.bock.ml/posts/significant_shapelets/"&gt;Significant Pattern Mining for Time Series&lt;/a&gt;. I really like such dynamic illustrations.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-14&lt;/a&gt;: &lt;a href="http://www.zverovich.net/2019/02/11/formatting-floating-point-numbers.html"&gt;Formatting floating point numbers&lt;/a&gt;. (via HN)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-14&lt;/a&gt;: [Quickdocs](Library Documentation Hosting for Common Lisp). Like Quicklisp, but for docs. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-17&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/album/cigarettes-after-sex/121540895" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Cigarettes After Sex, &lt;em&gt;Cigarettes After Sex&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-17&lt;/a&gt;: &amp;gt; If you are a professional writer – i.e., if someone else is getting paid to worry about how your words are formatted and printed – Emacs outshines all other editing software in approximately the same way that the noonday sun does the stars. It is not just bigger and brighter; it simply makes everything else vanish. &amp;ndash; &lt;a href="https://batsov.com/articles/2011/11/19/why-emacs/"&gt;https://batsov.com/articles/2011/11/19/why-emacs/&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-17&lt;/a&gt;: &amp;gt; P-values are a practical success but a critical failure. Scientists the world over use them, but scarcely a statistician can be found to defend them. Bayesians in particular find them ridiculous, but even the modern frequentist has little time for them. &amp;ndash; Stephen Senn, &lt;a href="https://www.stat.washington.edu/peter/342/Senn.pdf"&gt;Two Cheers for P-values?&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-17&lt;/a&gt;: &amp;gt; Python is not built with math and statistics in mind, and this doesn’t work without using a package.If you&amp;rsquo;re looking to move from R to Python, here are two interesting posts: &lt;a href="http://www.ericrscott.com/2018/05/03/python-is-weird/"&gt;Python is Weird (an unabashedly biased intro to Python for R users)&lt;/a&gt;; &lt;a href="https://github.com/dgerlanc/programming-with-data"&gt;Programming with Data: Python and Pandas&lt;/a&gt;. The first one, from which the above quotation is extracted, provides a side-by-side comparison of some of the features of each language. You might like or not, since R is a DSL and &lt;a href="http://f.briatte.org/r/r-as-a-data-science-language"&gt;Python is not a good PL to compare&lt;/a&gt;. The second one is a complete tutorial on Pandas (including linear regression) in IPython notebooks. Besides, Chris Albon&amp;rsquo;s &lt;a href="https://chrisalbon.com/machine_learning/vectors_matrices_and_arrays/transpose_a_vector_or_matrix/"&gt;Technical Notes On Using Data Science &amp;amp; Artificial Intelligence To Fight For Something That Matters&lt;/a&gt; are also worth a look. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-17&lt;/a&gt;: LOL. &lt;a href="https://www.shortcutfoo.com"&gt;Learn Shortcuts. Work Smarter&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-17&lt;/a&gt;: TIL about &lt;a href="https://github.com/plexus/chemacs"&gt;chemacs&lt;/a&gt;, an Emacs profile manager/switcher (à la IPython/jupyter). &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-17&lt;/a&gt;: TIL about the &lt;code&gt;ash&lt;/code&gt; function. So, &lt;code&gt;(defun square (n) (ash 1 (1- n)))&lt;/code&gt; is way simpler compared to:&lt;code&gt;(defun power (n m)(reduce #'* (loop for x below n collect m)))(defun square (n)(power (- n 1) 2))&lt;/code&gt;(Me playing with the CL track at &lt;a href="https://exercism.io"&gt;https://exercism.io&lt;/a&gt;). &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-17&lt;/a&gt;: &lt;a href="https://github.com/apg/slideshow-simple"&gt;Easier slideshows&lt;/a&gt; using Racket&amp;rsquo;s slideshow tool. &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-17&lt;/a&gt;: &lt;a href="http://www.howardism.org/Technical/Emacs/eshell-present.html"&gt;Presenting the Eshell&lt;/a&gt;. (via HN) &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-17&lt;/a&gt;: &lt;a href="https://phiresky.github.io/blog/2019/rga--ripgrep-for-zip-targz-docx-odt-epub-jpg/"&gt;rga&lt;/a&gt;: Meet ripgrep with PDF full-search. (via HN)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-18&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/the-complete-bbc-sessions-live/1133358700" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Led Zeppelin, &lt;em&gt;The Complete BBC Sessions (Live)&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-18&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/playlist/ecm-keith-jarrett/pl.2be32369b46d4c7ea419141a34295e6b" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Let&amp;rsquo;s get started with Keith Jarrett and Co.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-18&lt;/a&gt;: A really good read on &lt;a href="https://martinfowler.com/articles/micro-frontends.html#TheExampleInDetail"&gt;Micro Frontends&lt;/a&gt; with a detailed application, available on &lt;a href="https://github.com/micro-frontends-demo"&gt;Github&lt;/a&gt;. &lt;code&gt;#js&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-18&lt;/a&gt;: Hot off the kitchen:&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_0715.jpg" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-18&lt;/a&gt;: Interesting thread on Reddit: &lt;a href="https://www.reddit.com/comments/c1nfsv"&gt;Optimising Common Lisp&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-18&lt;/a&gt;: Ouch! An operating system &lt;a href="https://github.com/froggey/Mezzano/"&gt;written in Common Lisp&lt;/a&gt;. (via HN) &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-18&lt;/a&gt;: So, Amazon now offers two (free) versions of legacy Java: &lt;a href="https://aws.amazon.com/fr/corretto/"&gt;Amazon Corretto&lt;/a&gt;. (via &lt;a href="https://lemire.me/blog/2019/06/17/what-should-we-do-with-legacy-java-8-applications/"&gt;Daniel Lemire&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-19&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/a-different-age/1325238336" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Current Joys, &lt;em&gt;A Different Age&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-19&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/playlist/ecm/pl.5a9326f0f5da47059b21850add4d145b" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   If you like piano and the ECM records.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-19&lt;/a&gt;: Here is a summary of my tweets over the past few months. Obviously, using custom scripts to automate the creation/commit/publish steps for the micro section has helped a lot.&lt;figure&gt;&lt;img src="https://aliquote.org/img/cal-heatmap.png"&gt;&lt;figcaption&gt;
&lt;h4&gt;My own musings on the Micro blog over the years&lt;/h4&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-19&lt;/a&gt;: If you are a CLI junkie, this is a worthy addition to your toolbet: &lt;a href="https://www.fromthebottomoftheheap.net/2019/06/18/radian-console-for-r/"&gt;radian: a modern console for R&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-19&lt;/a&gt;: &lt;a href="http://www-igm.univ-mlv.fr/~mac/CHL/CHL.html"&gt;Algorithmique du texte&lt;/a&gt; (&lt;a href="http://monge.univ-mlv.fr/~mac/REC/B1.html"&gt;English version&lt;/a&gt;). See also &lt;a href="http://www-igm.univ-mlv.fr/~lecroq/seqcomp/index.html"&gt;Sequence comparison&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-19&lt;/a&gt;: &lt;a href="http://tomasp.net/coeffects/"&gt;Coeffects: Context-aware programming languages&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-19&lt;/a&gt;: &lt;a href="http://www.eli.sdsu.edu/courses/fall15/cs696/index.html"&gt;Functional Design and Programming &lt;/a&gt;. &lt;code&gt;#clojure&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-19&lt;/a&gt;: &lt;a href="https://www.learn-c.org"&gt;Learn-*.org&lt;/a&gt;, where &lt;code&gt;*&lt;/code&gt; is Python, C, Perl, SQL, etc.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-19&lt;/a&gt;: &lt;a href="https://www.reddit.com/r/Clojure/comments/a69wse/setup_dynamic_clojurescript_and_quil_environment/"&gt;Setup dynamic ClojureScript and Quil environment with emacs and figwheel&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-19&lt;/a&gt;: &lt;a href="http://dept-info.labri.u-bordeaux.fr/~strandh/Teaching/PFS/Common/Book/HTML/"&gt;Traité de Programmation en Common Lisp&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-20&lt;/a&gt;: In case you are looking for some nice apps for your menu bar, go check Brett&amp;rsquo;s latest post: &lt;a href="https://brettterpstra.com/2019/06/19/the-top-20-apps-not-in-my-dock/"&gt;The Top 20 Apps not in my Dock&lt;/a&gt;. &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-20&lt;/a&gt;: Just came across &lt;a href="https://vxlabs.com/2018/11/19/configuring-emacs-lsp-mode-and-microsofts-visual-studio-code-python-language-server/"&gt;this post&lt;/a&gt; again, and I dig a bit about MS own LSP. Although it would be cool to have an LSP as powerful as that of VS Code, the &lt;a href="https://github.com/emacs-lsp/lsp-python-ms"&gt;installation steps&lt;/a&gt; are a little discouraging. And since the default LSP that I used in Doom Emacs has been enhanced a lot (it no longer hang on with Python code, for example), I think I will deal with factory settings. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-20&lt;/a&gt;: Ok, so for now I&amp;rsquo;m done with Bitbucket since I can no longer connect to my BitBucket or Atlassian account, and I&amp;rsquo;ve been migrating part of my Git repos over Github.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-20&lt;/a&gt;: TIL Ross Ihaka (one of the two fathers of R) is retired. I guess I will never see the &lt;a href="https://www.stat.auckland.ac.nz/%7Eihaka/downloads/Compstat-2008.pdf"&gt;reincantation of R as a Scheme dialect&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-20&lt;/a&gt;: &lt;a href="http://graphics.stanford.edu/~seander/bithacks.html"&gt;Bit Twiddling Hacks&lt;/a&gt;. &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-20&lt;/a&gt;: &lt;a href="https://levelup.gitconnected.com/implementing-recursion-with-the-y-combinator-in-any-language-9e83fa369ca"&gt;Implementing Recursion with the Y Combinator in any Language&lt;/a&gt;. Arguably, the C implementation looks weird compared to, say, Racket or Python.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-20&lt;/a&gt;: &lt;a href="https://github.com/pedropramos/PyonR"&gt;PyonR&lt;/a&gt; (pronounced &amp;ldquo;Pioneer&amp;rdquo;) is an implementation of the Python programming language for the Racket platform. &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-21&lt;/a&gt;: &lt;a href="https://seankross.com/the-unix-workbench/"&gt;The Unix Workbench&lt;/a&gt;, by Sean Kross.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-21&lt;/a&gt;: &lt;a href="https://kam.mff.cuni.cz/~matousek/stml-53-matousek-1.pdf"&gt;Thirty-three Miniatures: Mathematical and Algorithmic Applications of Linear Algebra&lt;/a&gt; (PDF, 188 pp.).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-21&lt;/a&gt;: &lt;a href="https://github.com/mattdowle/expss"&gt;expss&lt;/a&gt; package provides tabulation functions with support for &amp;lsquo;SPSS&amp;rsquo;-style labels, multiple / nested banners, weights, multiple-response variables and significance testing. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-21&lt;/a&gt;: &lt;code&gt;#rstats&lt;/code&gt; tip of the day:&lt;code&gt;rtable(installed.packages()[,&amp;quot;License&amp;quot;])&lt;/code&gt;&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-06-21-15-04-53.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-24&lt;/a&gt;: &lt;a href="https://github.com/norvig/pytudes"&gt;Python programs to practice or demonstrate skills&lt;/a&gt;, by Peter Norvig. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-25&lt;/a&gt;: &lt;a href="https://jozef.io/r917-fread-comparisons/"&gt;How data.table&amp;rsquo;s fread can save you a lot of time and memory, and take input from shell commands&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-25&lt;/a&gt;: &lt;a href="https://observablehq.com/@mbostock/the-delaunays-dual"&gt;The Delaunay’s Dual&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-25&lt;/a&gt;: &lt;a href="https://felleisen.org/matthias/manifesto/"&gt;The Racket Manifesto&lt;/a&gt;. &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-25&lt;/a&gt;: &lt;a href="http://vim-bootstrap.com"&gt;Vim Bootstrap&lt;/a&gt;: A generator which provides a simple method of generating a .vimrc configuration for vim.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-25&lt;/a&gt;: &lt;a href="https://github.com/mbal/swank-racket"&gt;swank-racket&lt;/a&gt; works like a charm! &lt;code&gt;#racket&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-28&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/meltemi/308980638" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Alboran Trio, &lt;em&gt;Metlemi&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-28&lt;/a&gt;: First &amp;ldquo;ratatouille de l&amp;rsquo;été&amp;rdquo;. Sounds good too.&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_0725.jpg" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-28&lt;/a&gt;: I learned a lot by just reading the following thread: &lt;a href="https://groups.google.com/forum/#!topic/clojure/V6EvGg2rXhs"&gt;challenge: best fibo implementation under the new laziness?&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-28&lt;/a&gt;: Licensing matters surely. However, I feel like it&amp;rsquo;s quite a &lt;a href="https://common-lisp.net/project/ecl/"&gt;good approach&lt;/a&gt; to allow using a given software for free but to ask to give it back.&amp;gt; The meaning of our current license is, in short, the following: you can use ECL for any purpose in any setting (including commercial applications), but if you commit changes to ECL itself you are obliged to share these changes (and only them).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-28&lt;/a&gt;: Second day without anti-HT treatment. Feeling good, 11/6, starting Entresto in the evening. In the meantime I&amp;rsquo;m pushing Racket commits because it also feels so good.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-28&lt;/a&gt;: &lt;a href="https://www.categoricaldata.net"&gt;Categorical Query Language&lt;/a&gt;: A principled way to transform data. See also John Cook&amp;rsquo;s post on &lt;a href="https://www.johndcook.com/blog/2019/06/26/cql/"&gt;Category theory for data science&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-28&lt;/a&gt;: &lt;a href="https://git-fork.com"&gt;Fork&lt;/a&gt;: A fast and friendly git client for Mac and Windows. Note that GH notifications are embedded in the menu bar.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-29&lt;/a&gt;: Even if it focus on JS, this blog post has a lot of useful advices for configuring Vim quickly: &lt;a href="https://freshman.tech/vim-javascript/"&gt;A guide to setting up Vim for JavaScript development&lt;/a&gt;. See also &lt;a href="https://www.davidosomething.com/blog/vim-for-javascript/"&gt;Setting up Vim for JavaScript development&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-06-29&lt;/a&gt;: &lt;a href="https://stackoverflow.com/q/30178852"&gt;Is there a style convention for Common Lisp recursive helper functions?&lt;/a&gt;. Interesting SO thread of GP in writing CL. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>On premature optimization</title><link>https://aliquote.org/post/fibonacci-optimization/</link><pubDate>Sat, 29 Jun 2019 17:42:31 +0200</pubDate><guid>https://aliquote.org/post/fibonacci-optimization/</guid><description>&lt;p&gt;In which I describe my journey in the land of Fibonacci numbers.&lt;/p&gt;
&lt;p&gt;I spent more than an hour implementing different algorithms in Racket that compute the $n$-th term of the Fibonacci sequence. Why? Because I&amp;rsquo;m solving Euler problems in my spare time, and I misread Problem 2 statement such that I tried to sum up the even values of the first 4,000,000 Fibonacci terms, instead of restricting the sum to values not exceeding 4,000,000. Huh!&lt;/p&gt;
&lt;p&gt;The first algorithm I used was not optimized, and of course it will have a hard time to compute thousands of numbers in a decent time:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fibo&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fib-iter&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;=&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;a&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fib-iter&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;sub1&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fib-iter&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Next, I look up some other (more efficient) algorithms, and I ended up with two possible candidates: Fibonacci matrix multiplication and the fast doubling algorithm which is often used to compute the $n$-th term and its successor. (I know about Lucas numbers and the golden ratio too, but I wanted to try those specific algorithms.)&lt;/p&gt;
&lt;p&gt;Here is my implementation of the later:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-racket" data-lang="racket"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fib&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;cond&lt;/span&gt; &lt;span class="p"&gt;[(&lt;/span&gt;&lt;span class="nb"&gt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;[(&lt;/span&gt;&lt;span class="k"&gt;or&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let*&lt;/span&gt; &lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;floor&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;/&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;))])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;even?&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fib&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fib&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;add1&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fib&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;expt&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fib&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;add1&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;expt&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fib&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;))))]))&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The idea behind this algorithm relies on the following two relations, with further implications explained in &lt;a href="https://chunminchang.github.io/blog/post/calculating-fibonacci-numbers-by-fast-doubling"&gt;this post&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;$$
\begin{array}{rcl}
F(2n) &amp;amp;=&amp;amp; F(n)\cdot\left( 2F(n+1)-F(n)\right) \cr
F(2n+1) &amp;amp;=&amp;amp; F(n)^2 + F(n+1)^2
\end{array}
$$&lt;/p&gt;
&lt;p&gt;Here are some rough timing of the two algorithms, which clearly suggest that the simple approach is an order of magnitude faster compared to the more elaborated one when $n$ is small:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;gt; (time (apply + (filter even? (map fib (range 0 1000)))))
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cpu time: 251 real time: 253 gc time: 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;gt; (time (apply + (filter even? (map fibo (range 0 1000)))))
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cpu time: 33 real time: 34 gc time: 1
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;However, the second approach remains much faster when it comes to computing a given term when, say, $n&amp;gt;10000$.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2023-12-14]&lt;/small&gt;&lt;br&gt;
For additional approaches, see &lt;a href="https://orlp.net/blog/magical-fibonacci-formulae/"&gt;Magical Fibonacci Formulae&lt;/a&gt; and &lt;a href="https://chunminchang.github.io/blog/post/calculating-fibonacci-numbers-by-fast-doubling"&gt;Calculating Fibonacci Numbers by Fast Doubling&lt;/a&gt;, or links in &lt;a href="post/the-competitive-programmer-s-handbook.md"&gt;The Competitive Programmer&amp;rsquo;s Handbook&lt;/a&gt;.
&lt;/div&gt;
&lt;p&gt;If you are interested in computing Fibonacci numbers using optimized algorithms, don&amp;rsquo;t miss this thread on the Clojure Google group: &lt;a href="https://groups.google.com/forum/#!topic/clojure/V6EvGg2rXhs"&gt;best fibo implementation under the new laziness?&lt;/a&gt;. It refers to an algorithm (posted on &lt;code&gt;comp.lang.lisp&lt;/code&gt;) which relies on Lucas numbers. The &lt;a href="https://stackoverflow.com/a/628014"&gt;most elegant solution&lt;/a&gt; that I read so far was written by Rainer Joswig, who knowns quite a bit of CL, to say the least.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2026-02-12]&lt;/small&gt;&lt;br&gt;
See also &lt;a href="https://www.johndcook.com/blog/2026/02/08/computing-large-fibonacci-numbers/"&gt;Computing large Fibonacci numbers&lt;/a&gt;, by John D. Cook, which compares extended integer arithmetic vs. Binet&amp;rsquo;s formula for large nth Fibonacci number.
&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Premature optimization is evil&lt;/em&gt;: It doesn&amp;rsquo;t cost much to reread the statement several times.&lt;/p&gt;</description></item><item><title>A bag of tweets / June 2019</title><link>https://aliquote.org/post/bag-of-tweets-111/</link><pubDate>Tue, 25 Jun 2019 09:02:35 +0200</pubDate><guid>https://aliquote.org/post/bag-of-tweets-111/</guid><description>&lt;p&gt;Here is the latest bag of tweets&lt;sup&gt;*&lt;/sup&gt;, which covers June 2019.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;2019-06-01 @realpython: Stylin’ with Pandas &lt;a href="https://t.co/NG42QfQuCC"&gt;https://t.co/NG42QfQuCC&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-01 @bit_loom: LOOM FOUR, SEED 1304863000, FOUR ITERATIONS OF PENROSE, MUTAGEN 787757174 &lt;a href="https://t.co/N4h4dxdvwx"&gt;https://t.co/N4h4dxdvwx&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-01 @RobCalver5: Some great #statistics handbooks coming out in paperback from @CRC_MathStats. &lt;a href="https://t.co/tDQJpGUEmj"&gt;https://t.co/tDQJpGUEmj&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-01 @hrbrmstr: Follow up: at least one person read the post :-) and requested rendered versions so I setup a weekly process to render all translations The Art of the Command Line to standalone HTML. Available at &lt;a href="https://t.co/O6cCOxMtKe"&gt;https://t.co/O6cCOxMtKe&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-01 @bradleyboehmke: Working on the model-based clustering chapter in Hands-on #MachineLearning with #rstats . Very premature but its starting to take some form. &lt;a href="https://t.co/JPV4xHBeu3"&gt;https://t.co/JPV4xHBeu3&lt;/a&gt; &lt;a href="https://t.co/Xmi9OGzyeW"&gt;https://t.co/Xmi9OGzyeW&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-01 @robert_trirop: @gabrielpeyre @sigfpe I tried it with a 100x100 matrix. Using the nearest points between each interpolation step for indexing works well, but is not reliable. &lt;a href="https://t.co/izGKmaR4Cz"&gt;https://t.co/izGKmaR4Cz&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-01 @k_llyi: Returned to Purely Functional Data Structures after learning how to write Common Lisp: &lt;a href="https://t.co/6HFdECmEB1"&gt;https://t.co/6HFdECmEB1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-01 @newsycombinator: Discrete Mathematics and Functional Programming &lt;a href="https://t.co/Xa689joG72"&gt;https://t.co/Xa689joG72&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-01 @kaz_yos: “[another characterization of bootstrap] is very similar to a Dirichlet process which means that the connection between the Bayesian bootstrap and other Bayesian non-parametric methods is made clearer.” &lt;a href="https://t.co/vuBTsXroGg"&gt;https://t.co/vuBTsXroGg&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-01 @kaz_yos: 36-708 Statistical Machine Learning, Spring 2018 &lt;a href="https://t.co/X716XyBotO"&gt;https://t.co/X716XyBotO&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-02 @freakonometrics: &amp;ldquo;3h37 par jour d’espérance de vie de plus par jour&amp;rdquo;, ça veut dire +15% d&amp;rsquo;espérance de vie à la naissance, et avec &lt;a href="https://t.co/uPedDcWd89"&gt;https://t.co/uPedDcWd89&lt;/a&gt; c&amp;rsquo;est passer de 71 à 82 ans (aujourd&amp;rsquo;hui)&amp;hellip; les ancêtres, c&amp;rsquo;était il y a 60 ans me semble-t-il #JusteParCuriosité &lt;a href="https://t.co/3EbRV0X21b"&gt;https://t.co/3EbRV0X21b&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-02 @_ColinFay: #RStats &amp;amp; databases nerds / users. I&amp;rsquo;m working on putting together a Dockerfile with the whole stack of 📦 from the Database CRAN Task View &amp;amp; with RStudio in it. So far, the packages &amp;amp; the system requirements are installed💪 &lt;a href="https://t.co/zj2qDJnjYg"&gt;https://t.co/zj2qDJnjYg&lt;/a&gt; #Docker #DataBases&lt;/li&gt;
&lt;li&gt;2019-06-02 @bendhalpern: Probably one of the most auto-bookmarkable post I&amp;rsquo;ve seen in a while, regardless of skill level with git: &lt;a href="https://t.co/AHiFrH9bqY"&gt;https://t.co/AHiFrH9bqY&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-03 @newsycombinator: Major mode for editing S-Expression Markup Language files &lt;a href="https://t.co/eorHYPoU4i"&gt;https://t.co/eorHYPoU4i&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-03 @newsycombinator: Foundations of Mathematics (2015) [pdf] &lt;a href="https://t.co/1GU6xYZUmc"&gt;https://t.co/1GU6xYZUmc&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-03 @phil_eaton: A reimplementation of the ulisp compiler in Rust. That&amp;rsquo;s awesome!! The only way I learn is 1) copy-strip-simplify -ing someone&amp;rsquo;s work or 2) by copy-port -ing someone&amp;rsquo;s work to a new language. &lt;a href="https://t.co/oaFal3Cknb"&gt;https://t.co/oaFal3Cknb&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-03 @StatGarrett: Thank you @rmagn0 for a #gwasrapidd #rstats cheatsheet! Access genomic GWAS data through R. Available at &lt;a href="https://t.co/OZVUTm5lDl"&gt;https://t.co/OZVUTm5lDl&lt;/a&gt; @rstudio &lt;a href="https://t.co/e3HZbnuXJt"&gt;https://t.co/e3HZbnuXJt&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-03 @UnixToolTip: OS X command line utilities &lt;a href="https://t.co/zLJ2TIqdPf"&gt;https://t.co/zLJ2TIqdPf&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-03 @fonnesbeck: A nice Python library for spatial data processing: Verde &lt;a href="https://t.co/thWibaGSUG"&gt;https://t.co/thWibaGSUG&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-03 @twostraws: UIImage has a new initializer, UIImage(systemName:) that takes a string and returns one of over 1500 different system icons. Download the SF Symbols app and see them all here: &lt;a href="https://t.co/isRgJ5K5nE"&gt;https://t.co/isRgJ5K5nE&lt;/a&gt; &lt;a href="https://t.co/Zl4Dq1iDLf"&gt;https://t.co/Zl4Dq1iDLf&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-03 @pocmatos: Racket News issue 9 is here. Enjoy! &lt;a href="https://t.co/NiZKBG7lUl"&gt;https://t.co/NiZKBG7lUl&lt;/a&gt; @racketlang #racketnews&lt;/li&gt;
&lt;li&gt;2019-06-03 @aschinchon: New post available: Kites and Darts: the Penrose tiling &lt;a href="https://t.co/vnNeHRtSvS"&gt;https://t.co/vnNeHRtSvS&lt;/a&gt; #rstats #generative #maths #tidyverse &lt;a href="https://t.co/gkm9qIUuBQ"&gt;https://t.co/gkm9qIUuBQ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-04 @hrbrmstr: So: WARNING to ANYONE thinking of sinking a minimum of ~$7K USD into the new Mac Pro: IMO Apple SERIOUSLY signaled the end of macOS in 3-5 years from now. Unless you NEED this new system, buy a Linux box if your apps support it. They&amp;rsquo;re going to screw you over in ≤ 5 years.&lt;/li&gt;
&lt;li&gt;2019-06-04 @newsycombinator: Aerc – An email client that runs in the terminal &lt;a href="https://t.co/Zmnu7wm5aJ"&gt;https://t.co/Zmnu7wm5aJ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-04 @xah_lee: this is also why, the emacs that ships with Mac is gnu emacs 22, from year 2007. and Richard Stallman also forced emacs repo MELPA by hegemony to not support any packages using GPL v2. FSF has become a scum and irrelevant. &lt;a href="https://t.co/KUmv2tgr68"&gt;https://t.co/KUmv2tgr68&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-04 @strnr: Now published in @GenomeBiology &lt;a href="https://t.co/NGIktBMIDZ"&gt;https://t.co/NGIktBMIDZ&lt;/a&gt; &lt;a href="https://t.co/S0jLOFzYYB"&gt;https://t.co/S0jLOFzYYB&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-04 @mxsage: sparse navigation &lt;a href="https://t.co/YvHAy4m9ma"&gt;https://t.co/YvHAy4m9ma&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-04 @_wilfredh: Ridiculous, brilliant and absurd: dynamically generating a keyboard layout based on the most common letters that you&amp;rsquo;re typing right now! &lt;a href="https://t.co/L3r0y4qMql"&gt;https://t.co/L3r0y4qMql&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-05 @stuarthalloway: &amp;ldquo;#Clojure and #Erlang rocked it so hard that we introduced a new category for their awesomeness&amp;rdquo; #notarealquote &lt;a href="https://t.co/kPMmdN0SkM"&gt;https://t.co/kPMmdN0SkM&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-05 @yogthos: The Calva Journey Continues - Please Jack In &lt;a href="https://t.co/gwgFxpWnIz"&gt;https://t.co/gwgFxpWnIz&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-05 @scicloj: A new library for #Clojure - #Python #Interoperability by Chris Nuernberger, opening so many possibilities! &lt;a href="https://t.co/1tAxoHZYdt"&gt;https://t.co/1tAxoHZYdt&lt;/a&gt; &lt;a href="https://t.co/02CbTNi7uY"&gt;https://t.co/02CbTNi7uY&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-05 @NicholasStrayer: How to (&amp;amp; how not to) parse 25TB of data using awk and #rstats. New long blog post on my recent journey setting up a query system for some #BigData generated for my lab. I sped up queries by 4,800 times using old-school simple techniques. &lt;a href="https://t.co/vTt67ALiPu"&gt;https://t.co/vTt67ALiPu&lt;/a&gt; #DataScience &lt;a href="https://t.co/SyGENmQF0p"&gt;https://t.co/SyGENmQF0p&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-05 @CompSciFact: Mathematics for Computer Science &lt;a href="https://t.co/ouOaiypAAT"&gt;https://t.co/ouOaiypAAT&lt;/a&gt; [339 page pdf]&lt;/li&gt;
&lt;li&gt;2019-06-05 @CompSciFact: How does Apple (privately) find your offline devices? &lt;a href="https://t.co/aKfWNc8CgA"&gt;https://t.co/aKfWNc8CgA&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-06 @bradleyboehmke: Illustrating decision boundaries almost always helps users grasp how different #MachineLearning algorithms behave. See more at &lt;a href="https://t.co/JPV4xHBeu3"&gt;https://t.co/JPV4xHBeu3&lt;/a&gt; . #rstats &lt;a href="https://t.co/WQad6OxtxP"&gt;https://t.co/WQad6OxtxP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-07 @danielszmu: &amp;ldquo;You dig Scheme. The world is coded in C. You get both.&amp;rdquo; &amp;ldquo;And we will write simple interfaces to the best C libraries, making them feel all Schemy.&amp;rdquo; &amp;ldquo;The language we love, every library we could ever need.&amp;rdquo; &lt;a href="https://t.co/LPiaOIo60E"&gt;https://t.co/LPiaOIo60E&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-07 @strnr: Improved Standalone BLAST Databases and Programs: Now with Taxonomic Information (2018) &lt;a href="https://t.co/DL6VwLmfuc"&gt;https://t.co/DL6VwLmfuc&lt;/a&gt; &lt;a href="https://t.co/W34hpK5mtg"&gt;https://t.co/W34hpK5mtg&lt;/a&gt; &lt;a href="https://t.co/U91Qd1JskX"&gt;https://t.co/U91Qd1JskX&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-08 @inductivestep: VERY EXCITING DELIVERY &lt;a href="https://t.co/93XQgl4Ikn"&gt;https://t.co/93XQgl4Ikn&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-08 @juli_tkotz: A while ago, I came across this awesome paper by Fagerland (2012) that showed how the Wilcoxon test stops answering the question of equal medians when SDs differ - especially when data is skewed. &lt;a href="https://t.co/x3gCzI3063"&gt;https://t.co/x3gCzI3063&lt;/a&gt; 4/9&lt;/li&gt;
&lt;li&gt;2019-06-09 @seandavis12: hub is an extension to command-line git that helps you do everyday @github tasks without ever leaving the terminal. Create repos, manipulate issues, perform releases, process pull requests, etc. &lt;a href="https://t.co/1vrCNwZ6U7"&gt;https://t.co/1vrCNwZ6U7&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-09 @itcheeze: I wrote my first #clojure program! &lt;a href="https://t.co/Cvt0jccWqZ"&gt;https://t.co/Cvt0jccWqZ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-10 @Jose_A_Alonso: Functional programming for Web and mobile (A review of the current state of the art). ~ J. Wälter. &lt;a href="https://t.co/lrr1sI2rZS"&gt;https://t.co/lrr1sI2rZS&lt;/a&gt; #FunctionalProgramming&lt;/li&gt;
&lt;li&gt;2019-06-10 @John_B_Howard: Every Single Cognitive Bias in One Infographic Lovely visualisation of biases that &amp;ldquo;can lead to us extrapolating information from the wrong sources, seeking to confirm existing beliefs, or failing to remember events the way they actually happened!&amp;rdquo; &lt;a href="https://t.co/0ruXdVLv3V"&gt;https://t.co/0ruXdVLv3V&lt;/a&gt; &lt;a href="https://t.co/I0UtKFpYzs"&gt;https://t.co/I0UtKFpYzs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-10 @saidone: A little simulation of the &amp;ldquo;Airplane Probability Problem&amp;rdquo; - without loops or recursions - loving more and more every day the conciseness combined with simplicity of #Clojure &lt;a href="https://t.co/AUD3esz3gL"&gt;https://t.co/AUD3esz3gL&lt;/a&gt; #Programming &lt;a href="https://t.co/w9lEnVfip5"&gt;https://t.co/w9lEnVfip5&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-10 @newsycombinator: Screenshots from developers and Unix people (2002) &lt;a href="https://t.co/USk74Xlddd"&gt;https://t.co/USk74Xlddd&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-10 @BrodieGaslam: New post: can we compute group statistics faster with base #rstats than with #rdatatable? Believe it or not, the answer is yes*! &lt;a href="https://t.co/kixrx4Z5VZ"&gt;https://t.co/kixrx4Z5VZ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-10 @Quotes_PS: « On s’habitue facilement à la solitude. Il y a une jouissance à savoir qu’on est pauvre, qu’on est seul et que personne ne songe à nous. Cela simplifie la vie. » Marguerite Yourcenar&lt;/li&gt;
&lt;li&gt;2019-06-10 @strnr: Awk to remove duplicates while preserving order (not sort|uniq): awk &amp;lsquo;!visited[$0]++&amp;rsquo; your_file &lt;a href="https://t.co/DFpGSheltk"&gt;https://t.co/DFpGSheltk&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-10 @jeroenhjanssens: @jeremystan I spent way too long thinking about this for my PhD thesis. And I spent even more time creating this figure in LaTeX/TikZ. &lt;a href="https://t.co/WzDFeM2D4x"&gt;https://t.co/WzDFeM2D4x&lt;/a&gt; &lt;a href="https://t.co/WbPMGsz6r1"&gt;https://t.co/WbPMGsz6r1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-11 @jreuben1: An Algorithm for Comparing Similarity Between Two Trees &lt;a href="https://t.co/zAhbRfrGAX"&gt;https://t.co/zAhbRfrGAX&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-11 @reddit_lisp: #lisp A Common Lisp library for interfacing with the &lt;a href="https://t.co/WaFAeo0cPz"&gt;https://t.co/WaFAeo0cPz&lt;/a&gt; API and extra goodies | &lt;a href="https://t.co/SmuMgfN0JF"&gt;https://t.co/SmuMgfN0JF&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-11 @mattdesl: This book &amp;ldquo;Computational Drawing&amp;rdquo; by Carl Lostritto (@lostritto) looks great. 👀 → &lt;a href="https://t.co/PxLXKOHLgP"&gt;https://t.co/PxLXKOHLgP&lt;/a&gt; &lt;a href="https://t.co/Y5LIsXc83e"&gt;https://t.co/Y5LIsXc83e&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-11 @newsycombinator: Desktop Neo – rethinking the desktop interface for productivity &lt;a href="https://t.co/OE953Y2YFE"&gt;https://t.co/OE953Y2YFE&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-11 @fermatslibrary: A Short History of Markov Chain Monte Carlo 👉 &lt;a href="https://t.co/XHpyZcpBJE"&gt;https://t.co/XHpyZcpBJE&lt;/a&gt; &lt;a href="https://t.co/ZfTt8xlqBQ"&gt;https://t.co/ZfTt8xlqBQ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-11 @cutearguments: My newest post: &lt;a href="https://t.co/1cgOxnUVtM"&gt;https://t.co/1cgOxnUVtM&lt;/a&gt; Inspired by line in @f2harrell presentation, I went back and looked at @matloff paper saying neural nets are essentially polynomial regression. I have a few concerns/questions about methods, while other critiques were mostly about theory&lt;/li&gt;
&lt;li&gt;2019-06-11 @drikerf: Loving Clojure(Script) more and more every day 😍 &lt;a href="https://t.co/g6nUdX8rC7"&gt;https://t.co/g6nUdX8rC7&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-11 @lemire: Performance speed limits &lt;a href="https://t.co/6Et5iy91n8"&gt;https://t.co/6Et5iy91n8&lt;/a&gt; by @trav_downs Highly recommended.&lt;/li&gt;
&lt;li&gt;2019-06-12 @newsycombinator: Voilà turns Jupyter notebooks to standalone web applications &lt;a href="https://t.co/Y1dSgZLvZN"&gt;https://t.co/Y1dSgZLvZN&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-12 @Jose_A_Alonso: Functional programming in OCaml. ~ Michael R. Clarkson. &lt;a href="https://t.co/P9pIZKrlaL"&gt;https://t.co/P9pIZKrlaL&lt;/a&gt; #eBook #FunctionalProgramming #OCaml&lt;/li&gt;
&lt;li&gt;2019-06-12 @nicolaskb: 💉📊 J&amp;rsquo;ai écrit pour @AlgorithmWatch un article sur l&amp;rsquo;état du système national des données de santé (SNDS). Comme ils ne l&amp;rsquo;ont traduit qu&amp;rsquo;en allemand, j&amp;rsquo;en fais un thread en français. 1/n &lt;a href="https://t.co/AwSdBvPSas"&gt;https://t.co/AwSdBvPSas&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-12 @justmarkham: 🐼🤹‍♂️ pandas trick: Reverse column order in a DataFrame: df.loc[:, ::-1] Reverse row order: df.loc[::-1] Reverse row order and reset the index: df.loc[::-1].reset_index(drop=True) Want more #pandastricks? Working on a video right now, stay tuned&amp;hellip; 🎥 #Python #DataScience&lt;/li&gt;
&lt;li&gt;2019-06-12 @planetclojure: Billions of Random Numbers in a Blink of an Eye (by @draganrocks) &lt;a href="https://t.co/z6ADa0zhBh"&gt;https://t.co/z6ADa0zhBh&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-12 @matloff: #rstats I&amp;rsquo;ve been meaning for a while to write a point-by-point analysis of the R vs. Python debate. Here it is: &lt;a href="https://t.co/LdQsbzlaYm"&gt;https://t.co/LdQsbzlaYm&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-13 @Jose_A_Alonso: Permutations and permutation groups in Common Lisp. ~ Robert Smith (@stylewarning). &lt;a href="https://t.co/bkOpYKy3TQ"&gt;https://t.co/bkOpYKy3TQ&lt;/a&gt; #CommonLisp #Math&lt;/li&gt;
&lt;li&gt;2019-06-13 @thorstenball: I wrote React in TypeScript yesterday — in VSCode, which comes fully-loaded with &amp;ldquo;recommended plugins&amp;rdquo; when used in our repo. It made me think: how much do the tools we use influence the code we write?&lt;/li&gt;
&lt;li&gt;2019-06-13 @GaelVaroquaux: Functional-Connectome Biomarkers with Machine Learning: slides for the #ohbm19 symposium on how do predictive connectivity models meet clinician’s needs? This talk is a bit provocative and first sets visions, before bringing a few technical suggestions &lt;a href="https://t.co/e9KBgKclSK"&gt;https://t.co/e9KBgKclSK&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-13 @Jose_A_Alonso: Cultures of programming (Understanding the history of programming through controversies and technical artifacts). ~ T. Petricek, &lt;a href="https://t.co/EYDSPCM3TW"&gt;https://t.co/EYDSPCM3TW&lt;/a&gt; #Programming&lt;/li&gt;
&lt;li&gt;2019-06-13 @matloff: #rstats Nice to see so many people respond! Rather than reply individually to all, I&amp;rsquo;ll make a few points in this thread. 1/n&lt;/li&gt;
&lt;li&gt;2019-06-14 @StephenPiment: Illustrating Group Theory: A Coloring Book &lt;a href="https://t.co/b3y1BViwg5"&gt;https://t.co/b3y1BViwg5&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-14 @Dhabolt: New @PragProg Book: &amp;ldquo;Web Development with Clojure, Third Edition: Build Large, Maintainable Web Applications Interactively&amp;rdquo; by Dmitri Sotnikov @yogthos and Scot Brown @SVMBrown #clojure #java #FunctionalProgramming #WebDev &lt;a href="https://t.co/R3IZsMds3e"&gt;https://t.co/R3IZsMds3e&lt;/a&gt; &lt;a href="https://t.co/ZSK3Ex3GKI"&gt;https://t.co/ZSK3Ex3GKI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-14 @swetechevents: ClojureScript &amp;amp; React: The unreasonable effectiveness of re-frame - sthlm.clj &lt;a href="https://t.co/0SIvi3b3D8"&gt;https://t.co/0SIvi3b3D8&lt;/a&gt; #stockholm #techevents #sthlmtech&lt;/li&gt;
&lt;li&gt;2019-06-15 @newsycombinator: Lessons learned from rewriting code in my 10 years as a developer &lt;a href="https://t.co/42lorshe33"&gt;https://t.co/42lorshe33&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-15 @draganrocks: Soon. Numerical #LinearAlgebra for Programmers #CUDA #MKL #OpenCL #programming #GPU #Clojure #Java &lt;a href="https://t.co/g4Y5pblMv5"&gt;https://t.co/g4Y5pblMv5&lt;/a&gt; &lt;a href="https://t.co/CsqlfGw2d5"&gt;https://t.co/CsqlfGw2d5&lt;/a&gt; &lt;a href="https://t.co/Dn65UqQUGW"&gt;https://t.co/Dn65UqQUGW&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-15 @newsycombinator: Comparing the Same Project in Rust, Haskell, C++, Python, Scala and OCaml &lt;a href="https://t.co/DTazQqf5ea"&gt;https://t.co/DTazQqf5ea&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-16 @newsycombinator: Relearn CSS Layout: Every Layout &lt;a href="https://t.co/63Zp5JjhHk"&gt;https://t.co/63Zp5JjhHk&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-16 @newsycombinator: Show HN: Rga: ripgrep, but also search in PDFs, Office documents, zip, tar.gz &lt;a href="https://t.co/tb2WMICZTf"&gt;https://t.co/tb2WMICZTf&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-17 @zevross: I&amp;rsquo;ve been very impressed with the concaveman algorithm for creating a hull around points. Super-fast and easy to implement. Convex hull and concave hull compared below (#rstats package by @joelgombin, original JS script by @mourner) &lt;a href="https://t.co/HS2XmKYqoO"&gt;https://t.co/HS2XmKYqoO&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-17 @UnixToolTip: Drill keyboard shortcuts &lt;a href="https://t.co/pYbQY0f12Q"&gt;https://t.co/pYbQY0f12Q&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-17 @JavaScriptDaily: 43 JavaScript Questions, With Their Answers Explained: &lt;a href="https://t.co/ELp6WU7r8s"&gt;https://t.co/ELp6WU7r8s&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-18 @richiardiandrea: Experience report on Functional Programming in Clojure: &lt;a href="https://t.co/VdrUygjjJO"&gt;https://t.co/VdrUygjjJO&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-18 @CMastication: I’ve been playing this game for 23 days straight&amp;hellip; how do you make it quit?!?! &lt;a href="https://t.co/Ei7q6wsS14"&gt;https://t.co/Ei7q6wsS14&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-18 @santinellival: There we go, I&amp;rsquo;m releasing my C #gamedev engine in the wild: &lt;a href="https://t.co/JimeZRlBHJ"&gt;https://t.co/JimeZRlBHJ&lt;/a&gt; #binocle #indiedev&lt;/li&gt;
&lt;li&gt;2019-06-18 @strnr: Dendrograms in R &lt;a href="https://t.co/bWGP0lAyCM"&gt;https://t.co/bWGP0lAyCM&lt;/a&gt; #rstats &lt;a href="https://t.co/B6yIdoyCgL"&gt;https://t.co/B6yIdoyCgL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-18 @strnr: A technology-agnostic long-read analysis pipeline for transcriptome discovery and quantification &lt;a href="https://t.co/rgOVy3cbKE"&gt;https://t.co/rgOVy3cbKE&lt;/a&gt; &lt;a href="https://t.co/AyqAA7kTt7"&gt;https://t.co/AyqAA7kTt7&lt;/a&gt; &lt;a href="https://t.co/wju5krqdC2"&gt;https://t.co/wju5krqdC2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-18 @ucfagls: Recently I came across radian, a modern console for #rstats Having used it for a few weeks, here are some thoughts &lt;a href="https://t.co/FOr7sFyM0e"&gt;https://t.co/FOr7sFyM0e&lt;/a&gt; &lt;a href="https://t.co/iARzIoj5Lw"&gt;https://t.co/iARzIoj5Lw&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-19 @bbatsov: CIDER&amp;rsquo;s new documentation portal &lt;a href="https://t.co/6dYWQZfCxl"&gt;https://t.co/6dYWQZfCxl&lt;/a&gt; now features a powerful search powered by @algolia. Finding what you&amp;rsquo;re looking for has never been easier!&lt;/li&gt;
&lt;li&gt;2019-06-19 @johnmyleswhite: I really respect this paper&amp;rsquo;s attempt to categorize types of uncertainty and discuss whether a probabilistic approach is the most sensible: &lt;a href="https://t.co/2RzPmp9W1i"&gt;https://t.co/2RzPmp9W1i&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-19 @inconvergent: @RainerJoswig re. previous discussion on reading files. i&amp;rsquo;ve been looking around, but i was wondering if you had a tip on a good way to find positions of all spaces in a string. just so i don&amp;rsquo;t start doing it in some bad way&lt;/li&gt;
&lt;li&gt;2019-06-19 @adamcchang: The new answer to a 77-year-old problem in data analysis, published today in @naturemethods. Instead of significance tests, use estimation graphics. Our software suite DABEST makes it easy for everyone to visualize effect sizes. &lt;a href="https://t.co/UzwXJ7EUC5"&gt;https://t.co/UzwXJ7EUC5&lt;/a&gt; &lt;a href="https://t.co/VtxyY0xaRM"&gt;https://t.co/VtxyY0xaRM&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-19 @nmancuso_: Figure 3 in &lt;a href="https://t.co/GZ3lqAMnqh"&gt;https://t.co/GZ3lqAMnqh&lt;/a&gt; looks like a slam dunk on why we should be genotyping individuals across diverse populations. Such a great paper. &lt;a href="https://t.co/Le35IGmMbj"&gt;https://t.co/Le35IGmMbj&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-19 @seandavis12: Just completed (hopefully) final version of the #bioc2019 workshop materials; 26 workshop packages with 607 dependent packages. All available via #docker image (and volume) and Amazon Machine Image. &lt;a href="https://t.co/59hjl9F36i"&gt;https://t.co/59hjl9F36i&lt;/a&gt; Team of folks involved, not to mention workshop authors.&lt;/li&gt;
&lt;li&gt;2019-06-20 @tslumley: In which I draw a picture of the Wald, score, and likelihood ratio tests. &lt;a href="https://t.co/WaI9QVWsMg"&gt;https://t.co/WaI9QVWsMg&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-20 @matloff: #rstats In light of today&amp;rsquo;s exchange betw. advocates of dplyr and data.table, I thought I&amp;rsquo;d take a look at my e-mail records. You may find this illuminating, esp. re my concern abt. an open source project being dominated by a commercial entity (however well-intentioned). 1/n&lt;/li&gt;
&lt;li&gt;2019-06-20 @Jose_A_Alonso: Implementing recursion with the Y combinator in any language. ~ Michele Riva. &lt;a href="https://t.co/FPPGINzKca"&gt;https://t.co/FPPGINzKca&lt;/a&gt; #LambdaCalculus #JavaScript #Haskell #Java #Racket #Python #C&lt;/li&gt;
&lt;li&gt;2019-06-20 @mxsage: all the way down &lt;a href="https://t.co/XoqQH3xyip"&gt;https://t.co/XoqQH3xyip&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-20 @dask_dev: Blogpost on loading large stacks of image data using Dask Array. &lt;a href="https://t.co/K2BgGOSfeZ"&gt;https://t.co/K2BgGOSfeZ&lt;/a&gt; &lt;a href="https://t.co/ZydjQMKDqF"&gt;https://t.co/ZydjQMKDqF&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-21 @newsycombinator: 33 Miniatures: Mathematical and Algorithmic Applications of Linear Algebra [pdf] &lt;a href="https://t.co/BwYtrFY9An"&gt;https://t.co/BwYtrFY9An&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-06-21 @c_valenzuelab: Check out the new @ml5js website with some very cool new demos! 😍 &lt;a href="https://t.co/KOkPdq5zUk"&gt;https://t.co/KOkPdq5zUk&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>lost+found 2018</title><link>https://aliquote.org/post/lost-found-2018/</link><pubDate>Fri, 31 May 2019 20:39:13 +0200</pubDate><guid>https://aliquote.org/post/lost-found-2018/</guid><description>&lt;p&gt;After excavating unifinished or rough draft posts from last year (a quick &lt;code&gt;ack &amp;quot;draft\s?[:=] true&amp;quot; content/post/*.md&lt;/code&gt; in the Hugo directory), we should now be ready for June.&lt;/p&gt;
&lt;h2 id="2018-04-21"&gt;2018-04-21&lt;/h2&gt;
&lt;p&gt;This post could have been headed &amp;ldquo;In which we learn how to embrace functional programing for statistical computing&amp;rdquo;, or &amp;ldquo;how I stoped worrying about R and look for more lispy paradigm for data science.&amp;rdquo; but let keep it simple for a while. Lately, I was looking for a nice way to perform numerical simulation in Clojure, I mean other than using lazy sequences with &lt;code&gt;(take 10 (repeatedly #(rand-int 10)))&lt;/code&gt; where you can hardly fix any seed that will help reproduce your random numbers. I am aware of Clojure &lt;a href="https://clojure.github.io/data.generators/"&gt;data.generators&lt;/a&gt; but I wanted a more integrated framework. Here are some extra libraries for numerical or statistical computing with Clojure that I found while crawling the web.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;I heard about &lt;a href="https://github.com/thinktopic/cortex"&gt;Cortex&lt;/a&gt; by reading &lt;a href="http://gigasquidsoftware.com/blog/2017/11/07/cats-and-dogs-with-cortex-redux/"&gt;Carin Meier&amp;rsquo;s blog post&lt;/a&gt; some time ago.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://github.com/uncomplicate"&gt;https://github.com/uncomplicate&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Regarding Probabilistic Programming, you will find interesting discussion of Bayesian inference in this recent PhD thesis: &lt;a href="https://t.co/xRc8mDUVw7"&gt;Probabilistic Programming: Automation of Inferences, Learning and Design&lt;/a&gt; (PDF)&lt;/p&gt;
&lt;p&gt;It is quite easy to find good (non-cryptographic) PRNGs written in Clojure. You will likely came across one from L&amp;rsquo;Ecuyer and coll. or the Mersenne Twister algorithm, for instance. However, following &lt;a href="https://www.codeproject.com/Articles/25172/Simple-Random-Number-Generation"&gt;John D Cook suggestion&lt;/a&gt;, you can also easily write your own code, based on existing algorithm.&lt;/p&gt;
&lt;h2 id="2018-04-23"&gt;2018-04-23&lt;/h2&gt;
&lt;p&gt;This time, I am (quickly) reviewing &lt;em&gt;Think Bayes&lt;/em&gt;, one of Allen Downey&amp;rsquo;s book from the &amp;ldquo;Think X&amp;rdquo; series. A &lt;a href="http://greenteapress.com/wp/think-bayes/"&gt;PDF version&lt;/a&gt; is available on Green Tea Press. The accompanying code can be downloaded from Github (&lt;a href="https://github.com/AllenDowney/ThinkBayes"&gt;ThinkBayes&lt;/a&gt; is for Python 2, &lt;a href="https://github.com/AllenDowney/ThinkBayes2"&gt;ThinkBayes2&lt;/a&gt; targets Python 3 but the book has not yet been updated to reflect the changes).&lt;/p&gt;
&lt;p&gt;I first read &lt;em&gt;How to think like a computer scientist&lt;/em&gt; (probably the Python version) back in the 2000s. I really liked Allen&amp;rsquo;s approach to exposing soft and hard concepts related to computer science. This time, the author choose to use Python and discrete mathematics to expose the reader to Bayesian statistics:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Most books on Bayesian statistics use mathematical notation and present ideas in terms of mathematical concepts like calculus. This book uses Python code instead of math, and discrete approximations instead of continuous mathematics. As a result, what would be an integral in a math book becomes a summation, and most operations on probability distributions are simple loops.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;But note that even if the author offers to tackle such problems from the perspective of computer science, statistical considerations remain an important part of the process, even if this yields &amp;ldquo;an approximate solution to a good model&amp;rdquo;:&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I think it is important to include modeling as an explicit part of problem solving because it reminds us to think about modeling errors (that is, errors due to simplifications and assumptions of the model).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Chapter 1 provides a quick exposition to Bayes theorem, described as a way to get from P(B|A) to P(A|B), especially in cases where P(A|B) is not easy to compute. I find that the M&amp;amp;M problem (§1.6) is a very nice way to introduce bayesian inference, in the spirit of Philip Good&amp;rsquo;s introduction to permutation testing (&lt;em&gt;Permutation, Parametric, and Bootstrap Tests of Hypotheses&lt;/em&gt;, Springer, 2005): define the problem, set up the hypotheses and a test statistic, and finally assess the likelihood of the observed result; or, as the author suggests in Chapter 3: (1) choose a representation for the hypotheses, (2) choose a representation for the data, and (3) write the likelihood function. The next one is about the Monty Hall dilemma and it is really trickier.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; It is, however, easy to run a little simulation of the expected proportion of wins in case we choose to switch or stick to our initial choice. Here are the results I get using Mathematica:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/monty-hall.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Of note, a collection of related problems (with solutions) can be found on the author&amp;rsquo;s blog: &lt;a href="http://allendowney.blogspot.fr/2011/10/all-your-bayes-are-belong-to-us.html"&gt;All your Bayes are belong to us!&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In Chapter 2, the author provides reminders about the basics of probability distributions in Python (using a custom Python module, &lt;code&gt;thinkbayes.py&lt;/code&gt;, that can be found on the Github repository), followed by two numerical applications on the aforementioned problems. It is mostly Python code drawing from the so-called &lt;a href="https://en.wikipedia.org/wiki/Template_method_pattern"&gt;template method pattern&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Chapters 3 and 4 are all about estimating (&amp;hellip;)&lt;/p&gt;
&lt;h2 id="2018-10-27"&gt;2018-10-27&lt;/h2&gt;
&lt;p&gt;Here is a little excursion into algorithms for cycle detection, with a particular emphasis on palindrome.&lt;/p&gt;
&lt;p&gt;The following comes from &lt;a href="https://programmingpraxis.com/2018/10/02/palindrome-list/"&gt;Programming Praxis&lt;/a&gt;, which I happen to read from time to time:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Write a program that determines if a linked list of integers is palindromic — i.e., reads the same in both directions. Your solution must operate in O(1) space.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In the suggested solution, the author uses Floyd’s tortoise-and-hare algorithm, also known as &lt;a href="https://en.wikipedia.org/wiki/Cycle_detection"&gt;Floyd&amp;rsquo;s cycle-finding algorithm&lt;/a&gt;, whose name is mentioned in Don Knuth&amp;rsquo;s TAOCP (&lt;em&gt;Seminumerical Algorithms&lt;/em&gt;) although it is not .&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;h2 id="2018-10-29"&gt;2018-10-29&lt;/h2&gt;
&lt;p&gt;The rectangles algorithm is used to generate random variates based on the &lt;a href="https://en.wikipedia.org/wiki/Rejection_sampling"&gt;acceptance–rejection&lt;/a&gt; method. Here is a small implementation using Clojure.&lt;/p&gt;
&lt;p&gt;The article is available online, but in a few words the idea of this algorithm&lt;/p&gt;
&lt;p&gt;Recall that the PDF for a gaussian random variable (r.v.) is&lt;/p&gt;
&lt;p&gt;$$ f(x) = \frac{1}{\sqrt{2\pi\sigma^2}}\exp\left(\frac{-(x-\mu)^2}{2\sigma^2}\right), $$&lt;/p&gt;
&lt;p&gt;for $-\infty &amp;lt; x &amp;lt; \infty$, where $\mu$ and $\sigma^2$ denote the mean and variance of the distribution. In general, it is easier to consider a standard normal deviate $Z$, with $\mu=0$ and $\sigma=1$, since we can always use the transformation $X = \mu + \sigma Z$.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Reference:&lt;/strong&gt; Zhang, R., &amp;amp; Leemis, L. M. (2012). &lt;a href="http://bit.ly/2DbKZr0"&gt;Rectangles algorithm for generating normal variates&lt;/a&gt;. Naval Research Logistics, 59(1), 1–6.&lt;/p&gt;
&lt;h2 id="2018-11-22"&gt;2018-11-22&lt;/h2&gt;
&lt;p&gt;Most of what is available in terms of tutorial or solution to problems from programming contests, also called competitive programming, relies on C or C++&amp;ndash;see, e.g., this &lt;a href="https://aliquote.org/post/the-competitive-programmer-s-handbook"&gt;earlier post&lt;/a&gt; of mine on the &lt;a href="https://cses.fi/book.html"&gt;Competitive Programmer&amp;rsquo;s Handbook&lt;/a&gt;. I recently came across this &lt;a href="https://upcommons.upc.edu/bitstream/handle/2117/113325/memoria.pdf"&gt;Bachelor&amp;rsquo;s thesis&lt;/a&gt; (PDF, 44 pp.) where the author offers solutions to various problems in C++. Here I will try to offer some Scheme or Lisp solutions (one at a time). Today, we shall start with the well-known &lt;a href="https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm"&gt;Knuth-Morris-Pratt&lt;/a&gt; (KMP for short) algorithm which is widely used for pattern matching, usually on strings. This algorithm is linear in time and has asymptotic complexity $\mathcal{O}(n)$. To understand what the difference between the KMP and the Boyer-Moore&amp;rsquo;s algorithm are, see this related &lt;a href="https://stackoverflow.com/q/12656160"&gt;Stack Overflow thread&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The proposed task reads as follows:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Given an integer N, make a palidrome (word that reads the same when you reverse it) of length at least N.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;First, we need a working version of the KMP algorithm and I will use &lt;a href="https://racket-lang.org"&gt;Racket Scheme&lt;/a&gt;. Note that the documentation on string libraries (SRFI 13, R5RS) &lt;a href="https://docs.racket-lang.org/srfi/srfi-std/srfi-13.html#KMP"&gt;discusses the KMP algorithm&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www-igm.univ-mlv.fr/~lecroq/string/node8.html"&gt;http://www-igm.univ-mlv.fr/~lecroq/string/node8.html&lt;/a&gt;
&lt;a href="http://www.inf.fh-flensburg.de/lang/algorithmen/pattern/kmpen.htm"&gt;http://www.inf.fh-flensburg.de/lang/algorithmen/pattern/kmpen.htm&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here is one solution in Scheme from &lt;a href="http://www.codecodex.com/wiki/Knuth-Morris-Pratt_Algorithm_Examples#Scheme"&gt;codecodex&lt;/a&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;init-next&lt;/span&gt; &lt;span class="nv"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let*&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nv"&gt;m&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;string-length&lt;/span&gt; &lt;span class="nv"&gt;p&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;next&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;make-vector&lt;/span&gt; &lt;span class="nv"&gt;m&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nb"&gt;loop&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;j&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cond&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;-&lt;/span&gt; &lt;span class="nv"&gt;m&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;next&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nv"&gt;char=?&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;string-ref&lt;/span&gt; &lt;span class="nv"&gt;p&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;string-ref&lt;/span&gt; &lt;span class="nv"&gt;p&lt;/span&gt; &lt;span class="nv"&gt;j&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;+&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;j&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;+&lt;/span&gt; &lt;span class="nv"&gt;j&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;vector-set!&lt;/span&gt; &lt;span class="nv"&gt;next&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="nv"&gt;j&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;loop&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="nv"&gt;j&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;j&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;+&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;vector-set!&lt;/span&gt; &lt;span class="nv"&gt;next&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;loop&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="nv"&gt;j&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;else&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;loop&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;vector-ref&lt;/span&gt; &lt;span class="nv"&gt;next&lt;/span&gt; &lt;span class="nv"&gt;j&lt;/span&gt;&lt;span class="p"&gt;)))))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;define&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;kmp&lt;/span&gt; &lt;span class="nv"&gt;p&lt;/span&gt; &lt;span class="nv"&gt;s&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nv"&gt;next&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;init-next&lt;/span&gt; &lt;span class="nv"&gt;p&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;m&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;string-length&lt;/span&gt; &lt;span class="nv"&gt;p&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;string-length&lt;/span&gt; &lt;span class="nv"&gt;s&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nb"&gt;loop&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;j&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cond&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nb"&gt;or&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="nv"&gt;j&lt;/span&gt; &lt;span class="nv"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;-&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="nv"&gt;m&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nv"&gt;char=?&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;string-ref&lt;/span&gt; &lt;span class="nv"&gt;s&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;string-ref&lt;/span&gt; &lt;span class="nv"&gt;p&lt;/span&gt; &lt;span class="nv"&gt;j&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;loop&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;+&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;+&lt;/span&gt; &lt;span class="nv"&gt;j&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;j&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;loop&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;+&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;j&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;else&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;loop&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;vector-ref&lt;/span&gt; &lt;span class="nv"&gt;next&lt;/span&gt; &lt;span class="nv"&gt;j&lt;/span&gt;&lt;span class="p"&gt;)))))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="2019-01-10"&gt;2019-01-10&lt;/h2&gt;
&lt;p&gt;Here is a little programming entertainment in Racket to console me for wasting two hours fighting with Excel.&lt;/p&gt;
&lt;p&gt;Briefly, I spent nearly two hours figuring out how to perform a simple regression analysis and some trivial parametric statistics using Excel for a colleague of mine. I don&amp;rsquo;t even talk about computing Spearman rank correlation when there are ties and you must manually apply a correction because there is no automated function in vanilla Excel for that. After I transmitted the result of my morning work, I thought it would finally go as fast to implement a gradient descent algorithm in Scheme and use Gnuplot or anything else for data visualization. Atabey Kaygun already did this &lt;a href="https://kaygun.tumblr.com/post/55714055393/a-gradient-descent-implementation-in-lisp"&gt;using Common Lisp&lt;/a&gt;, but Racket should do the job as well, notwithstanding the fact that we can benefit from a lot of built-in packages.&lt;/p&gt;
&lt;p&gt;First, we need a &lt;a href="https://www.neilvandyke.org/racket/csv-reading/"&gt;CSV reader&lt;/a&gt; because the dataset is available as a comma-delimited text file. We will also need basic &lt;a href="https://docs.racket-lang.org/math/stats.html"&gt;helper functions&lt;/a&gt; to summarize the data, and also a &lt;a href="https://docs.racket-lang.org/plot/index.html"&gt;plotting framework&lt;/a&gt; to visualize the data. Finally, the &lt;a href="http://wiki.fast.ai/index.php/Gradient_Descent"&gt;gradient descent&lt;/a&gt; algorithm itself, which consists in starting with an initial set of parameter values for a given function and iteratively moving toward the set of parameter values that minimize the function. Iteration translates easily in Lisp recursion. In our case, the parameters correspond to the intercept and the slope of the regression line. Obviously, we need an objective or cost function to evaluate and it is based on the squared distance measure of observed and fitted points, much like how residuals are defined in the standard OLS approach. The term &amp;ldquo;gradient&amp;rdquo; comes from the fact that we will be working with partial derivatives of the estimated parameters.&lt;/p&gt;
&lt;p&gt;Gradient descent is probably best known in Machine Learning applications since &lt;a href="https://stats.stackexchange.com/a/164164"&gt;more classical and closed-formed algorithms&lt;/a&gt; are used to solve OLS problems. Depending on the data structure, however, the GD algorithm might provide an interesting alternative, especially in the case &lt;a href="http://leon.bottou.org/publications/pdf/mloptbook-2011.pdf"&gt;where $n$ is large&lt;/a&gt;, and it works in the case the response variable is binary (aka logistic regression). Note also that there are also other well known variants of this algorithm, like batch or stochastic gradient descent.&lt;/p&gt;
&lt;p&gt;Here is the final code: (also &lt;a href="https://aliquote.org/pub/gd-bwt.rkt"&gt;available to download&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;Note that you must install &lt;code&gt;csv-reading&lt;/code&gt; first, e.g., using &lt;code&gt;raco pkg install csv-reading&lt;/code&gt; at the prompt of your preferred shell.&lt;/p&gt;
&lt;h2 id="2019-01-16"&gt;2019-01-16&lt;/h2&gt;
&lt;p&gt;Today we are going to build a correlation heatmap using a few Stata commands.&lt;/p&gt;
&lt;p&gt;Note that there already are some solutions available on the &lt;a href="https://stats.idre.ucla.edu/stata/faq/how-can-i-make-a-correlation-matrix-heat-map/"&gt;Stata FAQ&lt;/a&gt; from the UCLA website. However, it relies on contour or scatter plot while we want to display something more akin to a heatmap with filled cells rather than symbols or contour lines. See, e.g., &lt;a href="https://flowingdata.com/2010/01/21/how-to-make-a-heatmap-a-quick-and-easy-solution/"&gt;Nathan Yau&amp;rsquo;s description&lt;/a&gt; of a heatmap.&lt;/p&gt;
&lt;p&gt;A quick search on the internet suggest that it is possible to use &lt;a href="https://ideas.repec.org/c/boc/bocode/s457256.html"&gt;hmap&lt;/a&gt; or &lt;a href="http://teaching.sociology.ul.ie/bhalpin/heatmaps.html"&gt;plotmatrix&lt;/a&gt;, and I even learnt about &lt;a href="http://medim.ceps.lu/stata/transcolorplot03.pdf"&gt;transition probability color plots&lt;/a&gt; (PDF) even it is barely related to our subject. Other interesting ideas were once discussed on &lt;a href="https://www.statalist.org/forums/forum/general-stata-discussion/general/1325012-heatmap-in-a-20-by-20-table"&gt;Stata List&lt;/a&gt;.&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;This reminds me of John Tukey&amp;rsquo;s famous quote: &amp;ldquo;Far better an approximate answer to the right question, which is often vague, than an exact answer to the wrong question, which can always be made precise.&amp;rdquo; (&lt;a href="https://projecteuclid.org/euclid.aoms/1177704711"&gt;The future of data analysis&lt;/a&gt;, &lt;em&gt;Ann Math Statist&lt;/em&gt; 1962, 33(1): 1–67)&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;It seems that unlike humans birds might be able to adapt their behavior in order to maximise their expected winnings (&lt;a href="https://www.ncbi.nlm.nih.gov/pubmed/20175592"&gt;Are birds smarter than mathematicians? Pigeons (Columba livia) perform optimally on a version of the Monty Hall Dilemma&lt;/a&gt;, &lt;em&gt;J Comp Psychol&lt;/em&gt; 2010, 124(1): 1-13)&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:3"&gt;
&lt;p&gt;Exercice 6 from DEK reads as follows (with minor edits): Suppose that we want to generate a sequence of integers $X_0, X_1, X_2, \dots$, in the range $0 \leq X_n &amp;lt; m$. Let $f(x)$ be any function such that $0 \leq x &amp;lt; m$ implies $0 \leq f(x) &amp;lt; m$. Consider a sequence formed by the rule $X_{n+1} = f(X_n)$. Show that there exists an $n &amp;gt; 0$ such that $X_n = X_{2n}$; and the smallest such value of $n$ lies in the range $\mu \leq n \leq \mu + \lambda$. Furthermore the value of $X_n$ is unique in the sense that if $X_n = X_{2n}$ and $X_r = X_{2r}$, then $X_r = X_n$.&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Micro-posting in May</title><link>https://aliquote.org/post/micro-05-2019/</link><pubDate>Fri, 31 May 2019 14:39:12 +0200</pubDate><guid>https://aliquote.org/post/micro-05-2019/</guid><description>&lt;p&gt;Quick recap&amp;rsquo; of May on the Micro blog.&lt;/p&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-05-01&lt;/a&gt;: A small snack for my son before the TV night&amp;hellip;&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_0657.jpg" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-01&lt;/a&gt;: Guess what? The &lt;a href="https://en.wikipedia.org/wiki/The_Walking_Dead_(TV_series)"&gt;Walking Dead&lt;/a&gt;, season 9, just arrived in iTunes store. While waiting for GOT (that everyone have fun spoiling apparently), it will do well for the coming days.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-01&lt;/a&gt;: Okay, why not after all!&amp;gt; writing a script to send plain text + HTML emails from Pandoc markdown source files.&amp;gt; &amp;ndash; &lt;a href="https://twitter.com/lexi_lambda/status/1123620029466062848"&gt;Alexis King&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-01&lt;/a&gt;: &lt;a href="https://twitter.com/vsbuffalo/status/1122903991216508934"&gt;What&amp;rsquo;s a good B when doing a bootstrap?&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-03&lt;/a&gt;: A useful meta search engine for &lt;a href="https://r-pkg.org"&gt;CRAN packages&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-03&lt;/a&gt;: The best of both worlds: when &lt;a href="https://towardsdatascience.com/5-advanced-features-of-python-and-how-to-use-them"&gt;Python meets FP&lt;/a&gt; at some point. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-03&lt;/a&gt;: Trying out &lt;a href="https://pdfgrep.org"&gt;pdfgrep&lt;/a&gt; on some records on my HD. Works great so far&amp;hellip;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-03&lt;/a&gt;: &lt;a href="https://github.com/matthewfeickert/R-in-Jupyter-with-Binder"&gt;How to use R in Jupyter notebooks and Binder&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-03&lt;/a&gt;: &lt;a href="https://simplystatistics.org/2019/04/17/tukey-design-thinking-and-better-questions"&gt;You&amp;rsquo;re probably asking the wrong question anyway&lt;/a&gt; (so don’t take yourself too seriously).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-04&lt;/a&gt;: 🎥 &lt;a href="https://www.imdb.com/title/tt6499752/"&gt;Upgrade&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-04&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/album/the-ground/214352386" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Tord Gustavsen Trio, &lt;em&gt;The Ground&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-04&lt;/a&gt;: Wednesday was Bologna, today is risotto.
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0656.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0656.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0661.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0661.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-04&lt;/a&gt;: &lt;a href="https://www.manning.com/books/clojure-the-essential-reference"&gt;Clojure &amp;ndash; The Essential Reference&lt;/a&gt;. Really nice book on the standard library, the why and the how. Sample code &lt;a href="https://github.com/reborg/csl-book-examples"&gt;available on Github&lt;/a&gt; as well. &lt;code&gt;#clojure&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-04&lt;/a&gt;: &lt;a href="https://blog.jez.io/cli-code-review/"&gt;Code Review from the Command Line&lt;/a&gt;: Nice CLI workflow for managing changes in a Git repo. (via &lt;a href="https://twitter.com/_wilfredh/status/1124667248021524480"&gt;@_wilfredh&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-05&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/album/european-standards/308186782" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Jan Lundgren Trio, &lt;em&gt;European Standards&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-05&lt;/a&gt;: Hot off the kitchen!&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_0663.jpg" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-05&lt;/a&gt;: This is not the first time that I come across some king of ASCII- or OpenGL-based generative art using SBCL*, but &lt;a href="https://twitter.com/inconvergent/status/1124713400427327488"&gt;@inconvergent&lt;/a&gt;&amp;rsquo;s work is amazing. Check out the &lt;a href="https://github.com/inconvergent/snek"&gt;Github repo&lt;/a&gt; as well if you like this kind of stuff. &lt;code&gt;#lisp&lt;/code&gt;* E.g., &lt;a href="https://github.com/sjl/flax/"&gt;flax&lt;/a&gt; by &lt;a href="http://stevelosh.com/blog/2018/08/a-road-to-common-lisp/#pick-an-editor"&gt;Steve Losh&lt;/a&gt;, who happened to be on a Twitch coding session today, btw.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-05&lt;/a&gt;: Today is going to be a great day anyhow.&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_0662.jpg" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-05&lt;/a&gt;: &lt;a href="http://stevelosh.com/blog/2013/09/teach-dont-tell/"&gt;Teach, Don&amp;rsquo;t Tell&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-05&lt;/a&gt;: &lt;a href="https://devarea.com/understanding-awk-practical-guide"&gt;Understanding Awk&lt;/a&gt;. (via &lt;a href="https://irreal.org/blog/?p=8021"&gt;Irreal&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-05&lt;/a&gt;: &lt;a href="https://github.com/l04m33/vlime"&gt;vlime&lt;/a&gt; &amp;ndash; A Common Lisp dev environment for Vim (and Neovim). &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-06&lt;/a&gt;: &lt;a href="http://pages.tacc.utexas.edu/~eijkhout/istc/html/index.html"&gt;Introduction to High-Performance Scientific Computing&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-07&lt;/a&gt;: &amp;lt;a href=&amp;ldquo;&lt;a href="https://itunes.apple.com/fr/playlist/jazz-chill/pl.63271312c084419891982eab46cc68ac%22type=%22application/rss+xml%22"&gt;https://itunes.apple.com/fr/playlist/jazz-chill/pl.63271312c084419891982eab46cc68ac&amp;quot;type=&amp;quot;application/rss+xml&amp;quot;&lt;/a&gt; class=&amp;ldquo;iconfont icon-music&amp;rdquo; title=&amp;ldquo;rss&amp;rdquo;&amp;gt;&lt;/a&gt;  Some &lt;em&gt;Jazz chill&lt;/em&gt; for today&amp;rsquo;s evening.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-07&lt;/a&gt;: &lt;a href="https://science.sciencemag.org/content/363/6433/1287"&gt;Adversarial attacks on medical machine learning&lt;/a&gt;. (via &lt;a href="https://twitter.com/freakonometrics/status/1125809649817616385"&gt;@freakonometrics&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-07&lt;/a&gt;: &lt;a href="https://julien.danjou.info/python-and-functional-programming/"&gt;An Introduction to Functional Programming with Python&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-12&lt;/a&gt;: &amp;lt;a href=&amp;ldquo;hhttps://itunes.apple.com/fr/album/begin-again/1451698947&amp;quot;type=&amp;ldquo;application/rss+xml&amp;rdquo; class=&amp;ldquo;iconfont icon-music&amp;rdquo; title=&amp;ldquo;rss&amp;rdquo;&amp;gt;&lt;/a&gt;   Norah Jones, &lt;em&gt;Begin Again&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-12&lt;/a&gt;: I&amp;rsquo;ve been pretty quite these past few days. It might even be a little longer if I don&amp;rsquo;t get back to writing online. Part of this distance comes from the fact that, first, I had to deal with side-effects of my medications; second, I&amp;rsquo;ve spent too much time fighting useless things; and, third, I have no obligation to publish anything anyway, which in a way suits me a lot (I keep writing on my paper notebooks, though).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-12&lt;/a&gt;: In the meantime, here is what I&amp;rsquo;ve been cooking a few minutes ago&amp;hellip;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0670.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0670.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0671.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0671.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-13&lt;/a&gt;: Here is a handy script to automagically create and edit a new Hugo post from a Terminal:#!/usr/bin/env bashset -ecd ~/Sites/aliquotePOST=&amp;quot;$1&amp;quot;DATE=$(date &amp;lsquo;+%Y-%m-%d-%H-%M-%S&amp;rsquo;)if [ -z &amp;ldquo;$POST&amp;rdquo; ]; thenread &amp;ldquo;Filename: &amp;quot; POSTfiif [ &amp;ldquo;$POST&amp;rdquo; = &amp;ldquo;now&amp;rdquo; ]; thenPOST=$DATEfihugo new &amp;ldquo;micro/$POST.md&amp;rdquo;(sleep 0.2 &amp;amp;&amp;amp; vim &amp;ldquo;$HOME/Sites/aliquote/content/micro/$POST.md&amp;rdquo;)I&amp;rsquo;ve put this in my &lt;code&gt;~/local/bin&lt;/code&gt; directory, which is in my &lt;code&gt;$PATH&lt;/code&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-13&lt;/a&gt;: Here is a little screenshot of Emacs running in a Terminal (&lt;a href="https://www.nordtheme.com"&gt;Nord&lt;/a&gt; theme if you ask). &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-05-13-19-10-31.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-13&lt;/a&gt;: I have no regret now that I took some time to reread this chapter on &lt;a href="https://www.masteringemacs.org/article/complete-guide-mastering-eshell"&gt;Mastering Eshell&lt;/a&gt;. A few days back, I decided to switch back to &lt;a href="https://github.com/hlissner/doom-emacs"&gt;Doom Emacs&lt;/a&gt; and to use a very minimal configuration, which means no fancy zsh or bash terms, just plain Eshell. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-13&lt;/a&gt;: TIL &lt;a href="https://github.com/Rich-Harris/degit"&gt;degit&lt;/a&gt; appears to be a good alternative to &lt;code&gt;git clone&lt;/code&gt; for project scaffolding (via &lt;a href="https://macwright.org/2019/05/12/big.html"&gt;Tom MacWright&lt;/a&gt;); Heroku won&amp;rsquo;t let you store flat files on their &amp;rsquo;ephemeral&amp;rsquo; servers so easily&amp;ndash;see the &lt;a href="https://12factor.net"&gt;12-factor&lt;/a&gt; app principles.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-13&lt;/a&gt;: &lt;a href="http://compgenomr.github.io/book/"&gt;Computational Genomics With R&lt;/a&gt;, by Altuna Akalin. &lt;code&gt;#rstats&lt;/code&gt; &lt;code&gt;#bioinfo&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-13&lt;/a&gt;: &lt;a href="https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/"&gt;Things You Should Never Do&lt;/a&gt; (TL;DR: &lt;em&gt;rewrite code from scratch&lt;/em&gt;).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-13&lt;/a&gt;: &lt;a href="https://github.com/rgburke/grv/"&gt;grv&lt;/a&gt; &amp;ndash; Git Repository Viewer&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-14&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/album/live-in-dublin/1449854294" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Lisa Hannigan &amp;amp; stargaze, &lt;em&gt;Live in Dublin&lt;/em&gt;. (Not all titles are available at the moment on the #fr iTunes store.)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-14&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/album/micah-p-hinson-and-the-gospel-of-progress/913893232" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Micah P. Hinson, &lt;em&gt;Micah P. Hinson and the Gospel of Progress&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-14&lt;/a&gt;: Always impressed when visiting Michael Betancourt&amp;rsquo;s &lt;a href="https://betanalpha.github.io/writing/"&gt;website&lt;/a&gt; by the quality of his notebooks on bayesian statistics.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-14&lt;/a&gt;: Lovely. &lt;a href="https://ohshitgit.com"&gt;Oh shit, git!&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-14&lt;/a&gt;: Peonies&amp;hellip;&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_0674.jpg" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-14&lt;/a&gt;: &lt;a href="https://nisheethvishnoi.wordpress.com/convex-optimization/"&gt;Algorithms for Convex Optimization&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-14&lt;/a&gt;: &lt;a href="http://willwolf.io/2018/11/11/em-for-lda/"&gt;Deriving Expectation-Maximization&lt;/a&gt;. Be sure to check the &lt;a href="http://willwolf.io"&gt;other articles&lt;/a&gt; as well.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-14&lt;/a&gt;: &lt;a href="https://www.sandeepnambiar.com/setting-up-emacs-for-c++/"&gt;Emacs setup for C++&lt;/a&gt;. I second this post since &lt;code&gt;ccls&lt;/code&gt; and &lt;code&gt;lsp-ui&lt;/code&gt; are much more convenient than &lt;code&gt;rtags&lt;/code&gt;, notwithstanding the fact that they are easier to configure. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-14&lt;/a&gt;: &lt;a href="https://github.com/numcl/numcl"&gt;Numpy clone in Common Lisp&lt;/a&gt; (via &lt;a href="https://twitter.com/FunctorFact/status/1128259252529844225"&gt;@FunctorFact&lt;/a&gt;). &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-15&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/album/movement-definitive-2019-remaster/1458124979" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   New Order, &lt;em&gt;Movement&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-15&lt;/a&gt;: Another nice post on diffusion models: &lt;a href="https://meltingasphalt.com/interactive/going-critical/"&gt;Going Critical&lt;/a&gt;. See also this &lt;a href="https://aliquote.org/micro/scott-world"&gt;older post of mine&lt;/a&gt;. &lt;code&gt;#dataviz&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-15&lt;/a&gt;: It&amp;rsquo;s been 10 years that I subscribed to GitHub (and a little less to Bitbucket), and I&amp;rsquo;m slowly rewriting (yet another time) and uploading my past lecture notes to public or private external repositories (&lt;code&gt;--theirs&lt;/code&gt; in git parlance). That&amp;rsquo;s quite an exhausting fucking life, isn&amp;rsquo;t it? I hope I will done for good with my past (life) after all that&amp;hellip;&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-05-15-20-44-37.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-15&lt;/a&gt;: Still the same routine after 3 months, I&amp;rsquo;m afraid it doesn&amp;rsquo;t get any better: when I get home, I&amp;rsquo;m useless and all I have to do is rest for at least 1h30.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-15&lt;/a&gt;: &lt;a href="https://datawhatnow.com/things-you-are-probably-not-using-in-python-3-but-should/"&gt;Things you’re probably not using in Python 3 – but should&lt;/a&gt; (via &lt;a href="https://twitter.com/newsycombinator/status/1128510681626624000"&gt;@newycombinator&lt;/a&gt;). &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-16&lt;/a&gt;: Another nice post by John D. Cook on differential privacy: &lt;a href="https://www.johndcook.com/blog/2019/05/15/comparing-truncation-to-differential-privacy/"&gt;Comparing Truncation to Differential Privacy&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-16&lt;/a&gt;: Coursera à la Google: &lt;a href="http://link.oreilly.com/E0r0F0nQMRb0Q0OS0J07W0h"&gt;Best practices for ML engineering&lt;/a&gt;, found via &lt;em&gt;O&amp;rsquo;Reilly Data Newletter&lt;/em&gt; (see the associated matrerial on ML).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-16&lt;/a&gt;: Whaouh, I didn&amp;rsquo;t remember there being so many papers out about it:- Wasserstein, R.L. and Lazar, N.A., 2016. The ASA’s statement on p-values: context, process, and purpose. The American Statistician, 70(2), pp.129-133.- Baker, M., 2016. Statisticians issue warning over misuse of p-values. Nature News, 531(7593), p.151.- Altman, N. and Krzywinski, M., 2016. Points of significance: p-values and the search for significance.- Benjamin, D.J., Berger, J.O., Johannesson, M., Nosek, B.A., Wagenmakers, E.J., Berk, R., Bollen, K.A., Brembs, B., Brown, L., Camerer, C. and Cesarini, D., 2018. Redefine statistical significance. Nature Human Behaviour, 2(1), p.6.- McShane, B.B., Gal, D., Gelman, A., Robert, C. and Tackett, J.L., 2019. Abandon statistical significance. The American Statistician, 73(sup1), pp.235-245.&lt;a href="https://mateuszbuda.github.io/2019/04/30/stat.html"&gt;Full links&lt;/a&gt; available here, found via &lt;em&gt;O&amp;rsquo;Reilly Data Newsletter&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-16&lt;/a&gt;: &lt;a href="https://alexwlchan.net/2019/05/falsehoods-programmers-believe-about-unix-time/"&gt;Falsehoods programmers believe about Unix time&lt;/a&gt;. Or why you need to worry about leap seconds.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-16&lt;/a&gt;: &lt;a href="https://rakhim.org/2019/05/rethinking-twitter/"&gt;Rethinking Twitter&lt;/a&gt;. Fair points, although I don&amp;rsquo;t share his views on the &amp;ldquo;Like&amp;rdquo; feature. I&amp;rsquo;ve used it a lot in the past (and still today) to bookmark links, instead of storing them on yet another social sharing website.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-17&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/album/the-ground/214352386" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Tord Gustavsen Trio, &lt;em&gt;The Ground&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-17&lt;/a&gt;: The &lt;a href="https://en.wikipedia.org/wiki/The_Walking_Dead_(TV_series)"&gt;Walking Dead&lt;/a&gt; S09E05 starting right now.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-17&lt;/a&gt;: &lt;a href="https://gist.github.com/andy-thomason/f304850bdf20d2cd2ecbb042d81b5e54"&gt;Genomics - A programmer&amp;rsquo;s guide&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-17&lt;/a&gt;: &lt;a href="https://ocw.mit.edu/courses/mathematics/18-065-matrix-methods-in-data-analysis-signal-processing-and-machine-learning-spring-2018/"&gt;Matrix Methods in Data Analysis, Signal Processing, and Machine Learning&lt;/a&gt;, by Gilbert Strang (via HN).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-20&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/playlist/nick-cave-the-bad-seeds-autres-projets/pl.a665af12e2d94fce88bb66eb685211e3" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Yet another playlist feat. Nick Cave.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-20&lt;/a&gt;: A new version of Clozure CL has been released on the App Store. It essentially fixes a nasty bug on Mojave. I guess I no longer have to use my &lt;a href="https://github.com/Clozure/ccl/issues/150"&gt;patched version&lt;/a&gt; from now on. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-20&lt;/a&gt;: Hanging out on &lt;a href="https://programmingpraxis.com/contents/about/"&gt;Programming Praxis&lt;/a&gt; (also on SO as &lt;a href="https://stackoverflow.com/users/448810/user448810"&gt;user448810&lt;/a&gt;), and I just realized that &lt;a href="https://www.scheme.com"&gt;Chez Scheme&lt;/a&gt; is open source. &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-20&lt;/a&gt;: Little upgrade this afternoon. I also updated my TeX machinery with TeX Live 2019.&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-05-20-19-19-49.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-20&lt;/a&gt;: Nice to see some fresh new &lt;a href="https://www.brodrigues.co/blog/2019-05-19-spacemacs/"&gt;post on Spacemacs&lt;/a&gt; from a statistician R and Vim user. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-20&lt;/a&gt;: TIL there even is some boilerplate template for Hugo and Netlify. Guess the &lt;a href="https://github.com/netlify-templates/victor-hugo/"&gt;name&lt;/a&gt;!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-20&lt;/a&gt;: You may happen to find the PDF or EPUB version, but in case you didn&amp;rsquo;t know, &lt;a href="https://www.scheme.com/tspl4/"&gt;The Scheme Programming Language&lt;/a&gt; is available online for free. &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-20&lt;/a&gt;: &lt;a href="https://www.theatlantic.com/science/archive/2019/05/waste-1000-studies/589684/"&gt;A Waste of 1,000 Research Papers&lt;/a&gt; ;-)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-20&lt;/a&gt;: &lt;a href="http://picturingprograms.com"&gt;Picturing Programs: an Introduction to Computer Programming&lt;/a&gt;. &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-21&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/album/les-bains-douches-18-december-1979/1449324448" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Joy Division, &lt;em&gt;Les Bains Douches 18 December 1979&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-21&lt;/a&gt;: I just spent 2 hours debugging a minor issue (a Flask form not updating two recently added fields correctly), then I realized I forgot to add the usual suspects into the &lt;code&gt;update&lt;/code&gt; function. Hopefully, Heroku was on maintenance so I had to delay the upload and we are all done now.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-21&lt;/a&gt;: &lt;a href="https://www.youtube.com/watch?v=NDP91RNgT4A"&gt;Using Magit from within Spacemacs&lt;/a&gt; (via &lt;a href="https://irreal.org/blog/?p=8052"&gt;Irreal&lt;/a&gt;): I really like this kind of videos, which are usually short (i.e., under 10 min.) and focused on a few key concepts. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-21&lt;/a&gt;: &lt;code&gt;#stupidme&lt;/code&gt; fixed his errors on the Fungi website, done. Wrote a little blog post, done. Drinking some beers to be in good company this night, in progress. Shall we take some time to watch &lt;a href="https://en.wikipedia.org/wiki/The_Keeper_of_Lost_Causes"&gt;The Keeper of Lost Causes&lt;/a&gt;, please?&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-22&lt;/a&gt;: &lt;a href="" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Anne Queffelec, &lt;em&gt;Satie: Piano Works&lt;/em&gt;. (No link, sorry, as it is no longer available in France.)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-22&lt;/a&gt;: Although I wrote about my &lt;a href="https://aliquote.org/post/org-and-bibtex/"&gt;own setup&lt;/a&gt; a &lt;a href="https://aliquote.org/post/notes-taking-workflow/"&gt;while ago&lt;/a&gt;, it&amp;rsquo;s still interesting to read others&amp;rsquo; setup: &lt;a href="https://rebeja.eu/posts/managing-bibliography-using-emacs-org-mode-and-org-ref/"&gt;Managing bibliography using Emacs Org-Mode and Org-Ref&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-22&lt;/a&gt;: TIL about &lt;a href="https://twitter.com/thinkR_fr/status/1130401549186981888"&gt;static&lt;/a&gt; and &lt;a href="https://twitter.com/freakonometrics/status/1131114254638243840"&gt;dynamic&lt;/a&gt; isochrone maps. Stunning beauty! &lt;code&gt;#dataviz&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-22&lt;/a&gt;: While I&amp;rsquo;m no big fan of convutional or bayesian or even simple NNs, Deep Learning and the like, those techniques certainly outperform standard techniques when it comes to image processing. See, e.g., &lt;a href="https://arxiv.org/abs/1905.08233"&gt;Few-Shot Adversarial Learning of Realistic Neural Talking Head Models&lt;/a&gt; for a recent shot. &lt;code&gt;#arxiv&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-22&lt;/a&gt;: &lt;a href="https://insights.ovid.com/pubmed?pmid=16617274"&gt;Instrumental Variables: Application and Limitations&lt;/a&gt;. (via &lt;a href="https://twitter.com/MaartenvSmeden/status/1131100628355309569"&gt;@MaartenvSmeden&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-23&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/playlist/nick-cave-the-bad-seeds-autres-projets/pl.a665af12e2d94fce88bb66eb685211e3" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Still the same playlist feat. Nick Cave.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-23&lt;/a&gt;: Oh my, I&amp;rsquo;m just too tired to do anything interesting tonight. Gonna publish my monthly newsletter and go waste some time on Twitch or my AppleTV. &lt;code&gt;#self&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-23&lt;/a&gt;: &lt;a href="http://johnstachurski.net/emet.html"&gt;A Primer in Econometric Theory&lt;/a&gt;, via &lt;a href="https://github.com/anhnguyendepocen"&gt;someone&lt;/a&gt; who forked one of my [deprecated] repo. Apparently, he/she likes Forks ;-)&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-05-23-20-51-58.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-24&lt;/a&gt;: After &lt;a href="https://github.com/zeit/hyper"&gt;Hyper&lt;/a&gt;, here&amp;rsquo;s &lt;a href="https://github.com/Eugeny/terminus"&gt;Terminus&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-24&lt;/a&gt;: I found the figure &amp;ldquo;&lt;a href="http://zerolib.com/resources-for-learning-clojure.html"&gt;A Flow Chart for Learning Clojure&lt;/a&gt;&amp;rdquo; particularly interesting as a suggested reading list. &lt;code&gt;#clojure&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-24&lt;/a&gt;: &lt;a href="https://travisdowns.github.io/blog/2019/05/22/sorting.html"&gt;Beating up on qsort&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-24&lt;/a&gt;: &lt;a href="http://rosalind.info/problems/locations/"&gt;Rosalind&lt;/a&gt; is a platform for learning bioinformatics and programming through problem solving. &lt;code&gt;#bioinfo&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-24&lt;/a&gt;: &lt;a href="https://github.com/haghish/github"&gt;github&lt;/a&gt; : a module for building, searching, installing, and managing Stata packages from GitHub. &lt;code&gt;#stata&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-25&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/em-live/391032919" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Wollny, Kruse &amp;amp; Shaefer, &lt;em&gt;[em] Live&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-25&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/rhino-hi-five-keith-jarrett-ep/201235368" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Keith Jarrett, &lt;em&gt;Rhino Hi-Five&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-25&lt;/a&gt;: An ode to DEK and TeX: &lt;a href="https://increment.com/open-source/the-lingua-franca-of-latex/"&gt;The Lingua Franca of LaTeX&lt;/a&gt; (via HN).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-25&lt;/a&gt;: I just finished reading &lt;em&gt;Loving Common Lisp, or the Savvy Programmer&amp;rsquo;s Secret Weapon&lt;/em&gt;, by Mark Watson. There are things I liked, things I didn&amp;rsquo;t. Maybe I should write a review at some point. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-25&lt;/a&gt;: Well, I believe we are done with Season 9 of &lt;em&gt;The Walking Dead&lt;/em&gt;. It&amp;rsquo;s probably time to start the last &amp;lsquo;successful&amp;rsquo; and so well spoiled season of GoT!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-25&lt;/a&gt;: &lt;a href="https://inconvergent.net/2019/a-tangle-of-webs/"&gt;Web-like structures in two dimensions&lt;/a&gt;, by &lt;a href="https://twitter.com/inconvergent/status/1131895750143746048"&gt;@inconvergent&lt;/a&gt;. Be sure to check the rest of the blog if you like &lt;code&gt;#lisp&lt;/code&gt;, &lt;code&gt;#python&lt;/code&gt; and &lt;code&gt;#p5js&lt;/code&gt;!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-27&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/falling-down-a-mountain/347274683" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Tindersticks, &lt;em&gt;Falling Down a Mountain&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-27&lt;/a&gt;: Always good to be remembered how to use &lt;code&gt;jq&lt;/code&gt; effectively: &lt;a href="https://shapeshed.com/jq-json/#how-to-pretty-print-json"&gt;JSON on the command line with jq&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-27&lt;/a&gt;: Does this mean we can now run Mathematica code without Mathematica? &lt;a href="https://www.wolfram.com/wolframscript/"&gt;WolframScript&lt;/a&gt; enables Wolfram Language code to be run from any terminal, whether or not a Wolfram kernel is available on the system.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-27&lt;/a&gt;: I finished &lt;em&gt;The Keeper of Lost Causes&lt;/em&gt; yesterday evening. Tonight, I&amp;rsquo;m going to try &lt;a href="https://en.wikipedia.org/wiki/The_Absent_One_(2014_film)"&gt;The Absent One&lt;/a&gt;, I mean staying awake for at least 45&amp;rsquo; &amp;ndash; beta blockers are a deal, trust me.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-27&lt;/a&gt;: The more I use or read about Common Lisp, the more I see subtle reincarnations into statistical languages like R (&lt;code&gt;eval&lt;/code&gt; and &lt;code&gt;quote&lt;/code&gt;, of course) or Stata (&lt;code&gt;foreach&lt;/code&gt; and &lt;code&gt;forvalues&lt;/code&gt;, close to &lt;code&gt;dolist&lt;/code&gt; and &lt;code&gt;dotimes&lt;/code&gt;). I barely use Stata or R nowadays, but Lisp dialects still have a bright future ahead, and there are so much to learn. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-27&lt;/a&gt;: Yet another series of words I would have a hard time to pronounce anyway.&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-05-27-18-28-26.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-27&lt;/a&gt;: &lt;a href="http://mbork.pl/2019-05-27_Programmatically_checking_for_uncommitted_changes"&gt;Programmatically checking for uncommitted changes&lt;/a&gt;. I believe this is basically what Magit (when calling &lt;code&gt;list-directories&lt;/code&gt;) offers as well.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-28&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/human-incognito/1171932077" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Arno, &lt;em&gt;Human incognito&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-28&lt;/a&gt;: &amp;gt; Ivre et je confonds le jour&amp;gt; Et la nuit je leur appartiens&amp;gt; A ces songes qui détourent&amp;gt; Hier et demain&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-28&lt;/a&gt;: Always good to be remebered of &lt;a href="https://erikbern.com/2019/04/15/why-software-projects-take-longer-than-you-think-a-statistical-model.html"&gt;why software projects take longer than you think&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-28&lt;/a&gt;: I reconfigured my almost defunct Gmail account into &lt;code&gt;mu4e&lt;/code&gt;. The fact is that since I&amp;rsquo;m using &lt;code&gt;mbsync&lt;/code&gt; instead of &lt;code&gt;offlineimap&lt;/code&gt;, I was missing the &lt;code&gt;SubFolders Verbatim&lt;/code&gt; option to allow &lt;code&gt;isync&lt;/code&gt; to recognize those funny &amp;ldquo;[Gmail]/&amp;rdquo; IMAP paths (or what Google invented as folders, which are no real folders, etc.). Now I am ready to do another round of cleaning! &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-05-28-14-38-00.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-28&lt;/a&gt;: Just in case I need someday: &lt;a href="https://blog.softwaremill.com/graalvm-installation-and-setup-on-macos-294dd1d23ca2"&gt;GraalVM installation and setup on macOS&lt;/a&gt; (see also &lt;a href="https://github.com/yogthos/graal-web-app-example"&gt;A minimal GraalVM Clojure web application&lt;/a&gt;).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-28&lt;/a&gt;: Just in case I&amp;rsquo;m up early tomorrow again: &lt;a href="https://scalameta.org/metals/blog/2019/01/22/bloom-filters.html"&gt;Low-memory symbol indexing with bloom filters&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-28&lt;/a&gt;: Now reading &lt;em&gt;Serious Python&lt;/em&gt;, written by &lt;a href="https://julien.danjou.info"&gt;Julien Danjou&lt;/a&gt;, as a sequel of &lt;em&gt;The Hacker&amp;rsquo;s Guide to Python&lt;/em&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-28&lt;/a&gt;: Yet another &lt;a href="https://creativecommons.org/share-your-work/public-domain/cc0"&gt;CC license&lt;/a&gt;, with &amp;ldquo;no rights reserved.&amp;quot;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-28&lt;/a&gt;: &lt;a href="https://psyarxiv.com/h8ft7"&gt;A practical introduction to the bootstrap: a versatile method to make inferences by using data-driven simulations&lt;/a&gt;, with &lt;a href="https://github.com/GRousselet/bootstrap"&gt;code on GH&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-28&lt;/a&gt;: &lt;a href="https://www.bloomberg.com/amp/news/articles/2019-05-24/apple-sued-for-selling-customers-itunes-information"&gt;Apple Accused of Selling ITunes Customers&amp;rsquo; Listening Data&lt;/a&gt;. If true, this is really disappointing, to say the least.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-28&lt;/a&gt;: &lt;a href="https://edition.cnn.com/2019/05/27/health/who-burnout-disease-trnd"&gt;Burnout&lt;/a&gt; got an official ICD-11 code. (via HN)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-28&lt;/a&gt;: &lt;a href="https://habr.com/ru/post/452520/"&gt;Fancy Euclid&amp;rsquo;s &amp;ldquo;Elements&amp;rdquo; in TeX&lt;/a&gt; (via &lt;a href="https://twitter.com/hardmaru/status/1133252870013243392"&gt;@hardmaru&lt;/a&gt;). &lt;code&gt;#tex&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-28&lt;/a&gt;: &lt;a href="http://www.macs.hw.ac.uk/~rs46/posts/2014-11-16-mu4e-signatures.html"&gt;Multiple Email Signatures with mu4e&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-28&lt;/a&gt;: &lt;a href="https://www.cs.cmu.edu/~rwh/theses/okasaki.pdf"&gt;Purely Functional Data Structures&lt;/a&gt; (PDF, 162 pp.), by Chris Okasaki. (via &lt;a href="https://twitter.com/newsycombinator/status/1133433114104094723"&gt;@newsycombinator&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-29&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/the-flying-club-cup/1309355762" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Beirut, &lt;em&gt;The Flying Club Cup&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-29&lt;/a&gt;: DuckDuckGo has been my default search engine since 1.5 years. But there&amp;rsquo;s more on the market apparently, e.g. &lt;a href="https://www.startpage.com/"&gt;startpage.com&lt;/a&gt; (via &lt;a href="https://www.baty.blog/2019/moving-to-startpage-for-search"&gt;Jack Baty&lt;/a&gt;).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-29&lt;/a&gt;: The &lt;a href="https://lispcookbook.github.io/cl-cookbook/"&gt;Common Lisp Cookbook&lt;/a&gt; looks like an essential resource. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-29&lt;/a&gt;: Updating Doom Emacs is so much fun compared to Spacemacs on the develop branch. You even get a pointer to check the diff on GH! &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-05-29-11-05-37.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-29&lt;/a&gt;: &lt;a href="http://fernandoi.cl/blog/posts/altair/"&gt;The reason I am using Altair for most of my visualization in Python&lt;/a&gt;. I can understand the why &amp;ndash; I too find that Matplotlib is not that good when it comes to statistical graphics, and that&amp;rsquo;s why I used to use R, Stata, Gnuplot or even Mathematica for that purpose. That being said, Altair like D3js are great but they require much more work compared to statistical packages. That&amp;rsquo;s why DSLs are important. &lt;code&gt;#python&lt;/code&gt; &lt;code&gt;#dataviz&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-29&lt;/a&gt;: &lt;a href="https://jameshfisher.com/2017/12/02/the-sorry-state-of-openssl-usability/"&gt;The sorry state of OpenSSL usability&lt;/a&gt; (via HN).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-29&lt;/a&gt;: &lt;a href="https://matbesancon.github.io/post/2019-04-14-optimization-function-evaluation/"&gt;Variables are not values&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-29&lt;/a&gt;: &lt;a href="https://jameshfisher.com/2014/05/11/your-syntax-highlighter-is-wrong/"&gt;Your syntax highlighter is wrong&lt;/a&gt;. Interesting take on the importance of comments in code. This reminds me of the arguments advanced by &lt;a href="https://github.com/tonsky/sublime-scheme-alabaster"&gt;Nikita Prokopov&lt;/a&gt; (aka tonsky) for developing his own color theme for various editors:&amp;gt; Alabaster highlights comments. Most schemes try to dim comments by using low-contrast greys. I think if code was complex enough that it deserved an explanation then it’s that explanation we should see and read first. It would be a crime to hide it.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-30&lt;/a&gt;: &lt;br&gt;&lt;img src="https://aliquote.org/img/2019-05-30-20-14-59.png" alt=""&gt;&lt;br&gt;It looks like the right move, indeed. I stopped using Google products a while ago, and will probably end up deleting my Gmail account, which is now my &lt;em&gt;de facto&lt;/em&gt; junk account for mailing, ads and the like. No need to &lt;a href="https://www.cnbc.com/2019/05/28/how-to-set-google-to-delete-everything-after-i-die.html"&gt;wait any longer&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-30&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/album/lie-lover-lie-r%C3%A9%C3%A9dition-digitale/1334205315" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   The Bloody Arm, &lt;em&gt;Lie Lover Lie&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-30&lt;/a&gt;: &lt;a href="https://music.apple.com/fr/playlist/mix-chill/pl.pm-20e9f373919da0809508410f677dee35" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Listening to some &lt;em&gt;Mix Chill&lt;/em&gt; while reviewing my Safari tabs and Twitter likes.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-30&lt;/a&gt;: Didn&amp;rsquo;t know there were such a thing: &lt;a href="http://ghtorrent.org"&gt;The GHTorrent project&lt;/a&gt;. (via &lt;a href="http://third-bit.com/2019/05/30/software-engineering-revisited.html"&gt;Greg Wilson&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-30&lt;/a&gt;: Finally it happened! I managed to hold out until 11:00 last night to finish &lt;a href="https://aliquote.org/micro/2019-05-27-18-32-16/"&gt;my movie&lt;/a&gt;.&lt;br&gt;&lt;img src="https://aliquote.org/img/IMG_0689.jpg" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-30&lt;/a&gt;: I just noticed that next to the deepl translator, we now have &lt;a href="https://www.linguee.com"&gt;Linguee&lt;/a&gt;, a bilingual dictionary&amp;ndash;available for iOS.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-30&lt;/a&gt;: I wish I had read this earlier when I stopped myself using &lt;a href="https://aliquote.org/post/emacs-versus-textmate/"&gt;Textmate&lt;/a&gt;: &lt;a href="http://stevelosh.com/blog/2010/09/coming-home-to-vim/"&gt;Coming Home to Vim&lt;/a&gt;. The discussion around Vim philospohy for modal editing (verb, noun and adjective) is quite on the point. See, I&amp;rsquo;m not against Vim itself&amp;ndash;I use it to edit those posts, btw&amp;ndash;but we need to agree to make some compromise for &lt;a href="https://aliquote.org/post/emacs-15-years-later/"&gt;editing purpose&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-30&lt;/a&gt;: It&amp;rsquo;s like what everyone would like to have: &lt;a href="https://uxdesign.cc/introducing-mercury-os-f4de45a04289"&gt;Introducing Mercury OS&lt;/a&gt;. (via &lt;a href="https://twitter.com/jedisct1/status/1133796393963937793"&gt;@jedisct1&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-30&lt;/a&gt;: Now that I sorted out all the previous items, it&amp;rsquo;s probably time to go watch this (in)famous last season of GoT!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-30&lt;/a&gt;: Since I&amp;rsquo;m tired of the &amp;ldquo;new&amp;rdquo; R (read, all the stuff around tibble, or tribble, or whatever new name data frames got in the mean time), I thought I would just rely on Gnuplot and, why not, &lt;a href="http://www.data-forge-js.com"&gt;Javascript&lt;/a&gt;?&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-30&lt;/a&gt;: &lt;a href="https://atypeofprogramming.com"&gt;A Type of Programming&lt;/a&gt;, by Renzo Carbonara. (via HN)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-30&lt;/a&gt;: &lt;a href="https://courses.csail.mit.edu/6.851/fall17/"&gt;Advanced Data Structures&lt;/a&gt;. See also &lt;a href="http://opendatastructures.org"&gt;Open Data Structures&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-30&lt;/a&gt;: &lt;a href="http://cacr.uwaterloo.ca/hac/"&gt;Handbook of applied cryptography&lt;/a&gt;. (via &lt;a href="https://twitter.com/CompSciFact/status/1133398871827255300"&gt;@CompSciFact&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-30&lt;/a&gt;: &lt;a href="https://jonathanabennett.github.io/blog/2019/05/25/introduction-to-the-year-of-emacs/"&gt;Introduction to the Year of Emacs&lt;/a&gt;. (via &lt;a href="https://irreal.org/blog/?p=8072"&gt;Irreal&lt;/a&gt;) &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-30&lt;/a&gt;: &lt;a href="https://ourway.keybase.pub/mathematics_cheat_sheet.pdf"&gt;Mathematics all-in-one cheat-sheet&lt;/a&gt; (PDF, 212 pp.). (via HN)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-05-31&lt;/a&gt;: If you are interested in functional PL and generative art, go check &lt;a href="https://szymonkaliski.com/log/"&gt;Szymon Kaliski&lt;/a&gt;&amp;rsquo;s website.&amp;gt; &lt;a href="https://szymonkaliski.com/log/2019-03-01-building-dacein/"&gt;Dacein&lt;/a&gt; is an experimental creative coding IDE combining a few different ideas that I’ve been thinking about.&lt;br&gt;&lt;/p&gt;</description></item><item><title>The unquantified self #8</title><link>https://aliquote.org/post/unquantified-self-008/</link><pubDate>Thu, 30 May 2019 21:01:39 +0200</pubDate><guid>https://aliquote.org/post/unquantified-self-008/</guid><description>&lt;p&gt;Some fresh news, probably expired already.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s already the end of May. I didn&amp;rsquo;t see the time pass, or rather yes, but just because of this throbbing fatigue that nails me in my couch as soon as I get home from work. It&amp;rsquo;s okay, I don&amp;rsquo;t have any plans anyway. I spent a good part of my time building a website (Python+Flask+Postresql) for work, at my own pace. I never thought I&amp;rsquo;d find myself being so slow at times. But when I have dizziness or hypotension lurking around, there&amp;rsquo;s no need to look for the slightest bug in a file, I&amp;rsquo;m just going into a freefall (in my head, as well as physically). I can cope with that too. The job is okay, I don&amp;rsquo;t mind not being a statistican anymore. I&amp;rsquo;m definitely done with medical statistics in any case. Also, I mean, I probably have only a few years left so that I can&amp;rsquo;t really get attached&amp;ndash;and I should not. I always loved working as a computer scientist, so in a way this bioinformatics job is almost perfect under the circumstances.&lt;/p&gt;
&lt;p&gt;Other than that, I managed to read a few books anyway, and to watch a few movies&amp;ndash;in several stages, each time, because I&amp;rsquo;m at the end of my life in the evening after two beers! My son and I enjoyed watching the last season of &lt;em&gt;The Walking Dead&lt;/em&gt;, and we are now busy with the latest season of &lt;em&gt;Game of Thrones&lt;/em&gt;. This should not take a long time since the producers decided to shorten it to 6 episodes, if I understand correctly. Next one on the radar is &lt;em&gt;The 100&lt;/em&gt;, season 5.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-05-30-20-09-00.png"&gt;
&lt;/figure&gt;
&lt;p&gt;I wish I had more time to rest and just read a good book. I don&amp;rsquo;t buy new books, or very few every two months or so, and I just keep reading the ones I got from my past life, or those I find at the tram station where people drop off the books they no longer want. I&amp;rsquo;m turning 45 next week, and I have probably reached an age where there is more pleasure in &lt;a href="https://www.humanite.fr/gainsbourg-lhomme-qui-lit"&gt;rereading&lt;/a&gt; than in discovering new things:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Je suis à l&amp;rsquo;âge où on relit. Je ne peux plus marcher qu&amp;rsquo;en flash-back.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I also decided to update my data-related toolset, and to switch back to command-line only tools. I want to use other languages for scientific computing (no more R or Stata, if possible) and I will spend the next few months in learning functional PLs more seriously. Coupled with a Javascript backend, I believe Racket or Clojure are probably the best way to move forward. I spent the last two weeks in CLI mode. No more native apps; everything&amp;rsquo;s running in a Terminal. I quite like it.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-05-25-20-10-07.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Finally, I have a few movies left. And of course, a lot of music under my belt. It should allow me to last the whole month of June.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/IMG_0691.jpg"&gt;
&lt;/figure&gt;</description></item><item><title>Loving Common Lisp</title><link>https://aliquote.org/post/loving-common-lisp/</link><pubDate>Wed, 29 May 2019 19:03:17 +0100</pubDate><guid>https://aliquote.org/post/loving-common-lisp/</guid><description>&lt;p&gt;Here is a quick review of &lt;em&gt;Loving Common Lisp&lt;/em&gt;, by Mark Watson. I initially read an early draft version on Leanpub, but I found some time to (re)read the latest version available.&lt;/p&gt;
&lt;p&gt;If you are new to Common Lisp, I would recommend to first try the excellent blog post written by Steve Losh, &lt;a href="http://stevelosh.com/blog/2018/08/a-road-to-common-lisp/"&gt;A Road to Common Lisp&lt;/a&gt;. Don&amp;rsquo;t miss it, it&amp;rsquo;s very well written, like many other posts by the same author. I would also recommend the &lt;a href="https://lispcookbook.github.io/cl-cookbook/"&gt;Common Lisp Cookbook&lt;/a&gt;. There are plenty of additional resources to learn Lisp, either from a pragmatic viewpoint &amp;ndash; &lt;a href="https://web.itu.edu.tr/kaygun/"&gt;Atabey Kaygun&lt;/a&gt; writes a lot of math/stat-related algorithm using CL on his Tumblr &amp;ndash; or from a more formal perspective: O&amp;rsquo;Reilly has a lot of dedicated textbooks targeting the &amp;ldquo;modern Lisp&amp;rdquo;, aka Clojure, and I particularly love the one written by &lt;a href="http://gigasquidsoftware.com"&gt;Carin Meier&lt;/a&gt;. If you want to stick with CL, strictly, then &lt;a href="http://www.gigamonkeys.com/book/"&gt;Practical Common Lisp&lt;/a&gt; is probably the best way to go.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Lisp is not just a language; it is also a programming environment and runtime environment.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That being said, let&amp;rsquo;s go back to this book, &lt;em&gt;Loving Common Lisp&lt;/em&gt;. I must admit that it did not meet my expectations entirely, especially because I was expecting something more polished and/or developed, but this may well be due to the iterative publishing process that we commonly encounter on Leanpub. I am sure that the author knows what he is talking about, and I have read his &lt;a href="http://blog.markwatson.com"&gt;blog posts&lt;/a&gt; and books for years. It also doesn&amp;rsquo;t mean that the book is not well written. There are still some proof-reading lacking here and there but overall it looks good. It is just that this is neither an introductory textbook, nor a practical cookbook: It&amp;rsquo;s just in-between, which leaves us with the feeling that this book is not completely finished. On the plus side, you get a complete &lt;a href="https://github.com/mark-watson/loving-common-lisp"&gt;set of Lisp programs&lt;/a&gt; to run from GitHub (part of those examples depend on &lt;a href="htps://github.com/mmaul/clml"&gt;clml&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;The author starts by comparing Lisp with Java or even C/C++, especially regarding automatic memory management (allocation and garbage collection), fair enough. This is a well-known fact that GC is of concern, as well as JIT compilation or number representation for modern PLs. Lisp is an old beast, but still actively used in prod system (e.g., Grammarly). I have always been able to compile old Lisp code, and I like the fact that updating my quicklisp packages resume to updating almost nothing on my OS. Because when a package provides the expected functionalities and is not going to evolve anymore, it is done for good. Remember &lt;a href="https://github.com/magnars/multiple-cursors.el"&gt;this guy&lt;/a&gt;?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I use this package every day, and have been doing so for years. It just works. At least, it works for all my use cases. And if it breaks somehow, I fix it.
However, it has become painfully clear to me that I don&amp;rsquo;t have time to fix problems I don&amp;rsquo;t have. It&amp;rsquo;s been years since I could keep pace with the issues and pull requests. Whenever I try, I keep getting feedback that my fix isn&amp;rsquo;t good enough by some standard I don&amp;rsquo;t particularly care about.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Freezing a working package is a feature, not a lack of interest.&lt;/p&gt;
&lt;p&gt;The following is based on the notes I took in an Org-file while reading the first part of the book. The author does not explain the differences between &lt;a href="https://stackoverflow.com/q/8927741"&gt;defvar, defparameter, setf and setq&lt;/a&gt; although they are used a lot interchangeably at the beginning of the book. Treatment of lists is, however, pretty standard and well exposed (&lt;code&gt;car&lt;/code&gt; and &lt;code&gt;cdr&lt;/code&gt;, &lt;code&gt;cons&lt;/code&gt; and &lt;code&gt;append&lt;/code&gt;, &lt;code&gt;last&lt;/code&gt; and &lt;code&gt;nth&lt;/code&gt;, etc.). An interesting example regarding shared structure in list processing is provided, by the way:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-lisp" data-lang="lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;setq&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;setq&lt;/span&gt; &lt;span class="nv"&gt;y&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;list&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;setf&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;nth&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;nth&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="nv"&gt;y&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;x&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;y&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;setq&lt;/span&gt; &lt;span class="nv"&gt;z&lt;/span&gt; &lt;span class="o"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;setf&lt;/span&gt; &lt;span class="nv"&gt;z&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;nth&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;nth&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="nv"&gt;z&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;z&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Beyond lists, vectors and arrays (&lt;code&gt;make-array,&lt;/code&gt; or &lt;code&gt;vector&lt;/code&gt; and &lt;code&gt;make-sequence&lt;/code&gt;) are more efficient data structure when the number of elements is large. Beware that CL for scientific computing cannot be fast, portable, and convenient &lt;a href="https://tpapp.github.io/post/common-lisp-to-julia/"&gt;all at the same time&lt;/a&gt;. Notice that an array can &amp;ldquo;contain&amp;rdquo; any values, and thus mixing integers with float is allowed by the language. Operations on string (&lt;code&gt;concatenate&lt;/code&gt;, &lt;code&gt;search&lt;/code&gt;, &lt;code&gt;subseq&lt;/code&gt; and &lt;code&gt;string-*&lt;/code&gt;) and the &lt;a href="http://doc.norang.ca/lisp.html"&gt;fine distinction&lt;/a&gt; between &lt;code&gt;eq&lt;/code&gt;, &lt;code&gt;eql&lt;/code&gt;, and &lt;code&gt;equal&lt;/code&gt; are also covered. For strings, we should prefer &lt;code&gt;string&lt;/code&gt;. Instead of &lt;code&gt;nth&lt;/code&gt;, we use &lt;code&gt;char&lt;/code&gt; to extract a given character in a string. Hash tables are to be preferred when lists (coupled with &lt;code&gt;assoc&lt;/code&gt;) are long. Main functions are &lt;code&gt;gethash&lt;/code&gt;, &lt;code&gt;make-hash-table&lt;/code&gt;, and &lt;code&gt;maphash&lt;/code&gt;. Updating values in a hash table is done using &lt;code&gt;remhash&lt;/code&gt; or &lt;code&gt;clrhash&lt;/code&gt;. Note that these functions can modify their arguments, much like &lt;code&gt;setf&lt;/code&gt; or &lt;code&gt;setq&lt;/code&gt;, but the latter are macros and not functions. Finally, recall that read-only objects are inherently thread safe.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Functional programming means that we avoid maintaining state inside of functions and treat data as immutable.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Lisp functions get covered as well, with lots of examples relying on &lt;code&gt;defun&lt;/code&gt;, keywords (&lt;code&gt;&amp;amp;aux&lt;/code&gt;, &lt;code&gt;&amp;amp;optional&lt;/code&gt;, &lt;code&gt;&amp;amp;key&lt;/code&gt;), &lt;code&gt;let&lt;/code&gt; special operator for local bindings, &lt;code&gt;lambda&lt;/code&gt; and &lt;code&gt;funcall&lt;/code&gt;. A closure is a function that references an outer lexically scoped variable, which typically happens when functions are defined inside &lt;code&gt;let&lt;/code&gt; forms (see p. 47). The &lt;code&gt;dotimes&lt;/code&gt; and &lt;code&gt;dolist&lt;/code&gt; macros are close to Stata &lt;code&gt;forvalues&lt;/code&gt; and &lt;code&gt;foreach&lt;/code&gt; instructions, while the &lt;code&gt;do&lt;/code&gt; macro is more general (and has nothing to do with its R &lt;code&gt;dplyr&lt;/code&gt; counterpart, of course).&lt;/p&gt;
&lt;p&gt;The rest of the book describes some applications of web and network programming using CLOS classes and various packages (&lt;code&gt;drakma&lt;/code&gt;, &lt;code&gt;hunchentoot&lt;/code&gt;). I also enjoyed reading the chapter on querying database since I am doing a lot of this stuff these days. This is where the book starts to be really interesting because it then becomes a real practical cookbook, while the preceding chapters were more of a discussion of what Lisp has to offer and why the author likes it.&lt;/p&gt;
&lt;div class="alert alert-note"&gt;
&lt;small&gt;[2021-04-26]&lt;/small&gt;&lt;br&gt;
If you are looking for a gentle introduction to Common Lisp, &lt;a href="https://github.com/ashok-khanna/common-lisp-by-example"&gt;Common Lisp by Example&lt;/a&gt; is a good starting point. There&amp;rsquo;s also this recent blog post, by Marin Atanasov Nikolov, &lt;a href="https://dnaeon.github.io/starting-with-common-lisp-in-2020/"&gt;Starting with Common Lisp in 2020&lt;/a&gt;, although Steve Losh already wrote quite a piece of beauty a few years ago: &lt;a href="https://stevelosh.com/blog/2018/08/a-road-to-common-lisp/"&gt;A Road to Common Lisp&lt;/a&gt;.
&lt;/div&gt;</description></item><item><title>A bag of tweets / May 2019</title><link>https://aliquote.org/post/bag-of-tweets-110/</link><pubDate>Thu, 23 May 2019 21:02:35 +0200</pubDate><guid>https://aliquote.org/post/bag-of-tweets-110/</guid><description>&lt;p&gt;Here is the latest bag of tweets&lt;sup&gt;*&lt;/sup&gt;, which covers May 2019.&lt;/p&gt;
&lt;p&gt;(*) These are interesting news that I found on Twitter and that I archive periodically. Note that I have slightly updated reporting and fetching methods so that you will get between 80 and 120 of my most recent favorites from my Twitter account (&lt;code&gt;@even4void&lt;/code&gt;).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;2019-05-01 @CompSciFact: Functional Programming Fundamentals. 13 lectures by @headinthebox &lt;a href="https://t.co/0eG4Uzk6RI"&gt;https://t.co/0eG4Uzk6RI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-01 @DocUrbs: #MachineLearning Workshop 102 (Building an Analysis Pipeline) was a success! Video Recording @ &lt;a href="https://t.co/sFXd2ySBJY"&gt;https://t.co/sFXd2ySBJY&lt;/a&gt; Slides @ &lt;a href="https://t.co/DRM3sRtU0Q"&gt;https://t.co/DRM3sRtU0Q&lt;/a&gt; Easy link to view Jupyter notebook @ &lt;a href="https://t.co/3UOiWnMGwv"&gt;https://t.co/3UOiWnMGwv&lt;/a&gt; and all files @ &lt;a href="https://t.co/veANqdcaMr"&gt;https://t.co/veANqdcaMr&lt;/a&gt; @UPennIBI @PennLDI &lt;a href="https://t.co/54id18UDPN"&gt;https://t.co/54id18UDPN&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-01 @jimhester_: Watch me submit the vroom package📦to CRAN🎉 in my latest #rstats video 📹!! &lt;a href="https://t.co/0BuRrgEL6f"&gt;https://t.co/0BuRrgEL6f&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-02 @nicklockwood: After reading about the Wolfenstein 3D engine on vacation, I was inspired to try to recreate it from scratch in Swift. Here it is the result, running at 60fps on an iPhone X. &lt;a href="https://t.co/xFqbgJN0ld"&gt;https://t.co/xFqbgJN0ld&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-02 @TiffanyTimbers: OK #rstats education folk - what is your favourite and most motivating way to teach MLE? Looking for inspiration here! cc @rdpeng @minebocek @rudeboybert @AllenDowney @askdrstats @jtleek @stephaniehicks @rafalab&lt;/li&gt;
&lt;li&gt;2019-05-02 @newsycombinator: GitHub Learning Lab &lt;a href="https://t.co/3RYa1Sum63"&gt;https://t.co/3RYa1Sum63&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-02 @benmschmidt: Here&amp;rsquo;s a bunch of interactive visualizations you can instantly re-run on any of the 15 million books in the @hathitrust, in an editable @observable notebook. &lt;a href="https://t.co/YlYxvxMlEW"&gt;https://t.co/YlYxvxMlEW&lt;/a&gt;. Change the URL to see any other book in the collection. &lt;a href="https://t.co/r7ZKoL89Dp"&gt;https://t.co/r7ZKoL89Dp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-02 @waneella_: 🎵 &lt;a href="https://t.co/4ho1PCnS5k"&gt;https://t.co/4ho1PCnS5k&lt;/a&gt; &lt;a href="https://t.co/5Au0X2bXxF"&gt;https://t.co/5Au0X2bXxF&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-03 @AllenDowney: &amp;ldquo;Embed Interactive Jupyter Notebooks in Static Websites for Free&amp;rdquo; &lt;a href="https://t.co/pE76oMt5sA"&gt;https://t.co/pE76oMt5sA&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-03 @newsycombinator: A short list of common mistakes in PostgreSQL &lt;a href="https://t.co/jrZUdKo1Rr"&gt;https://t.co/jrZUdKo1Rr&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-03 @IKosmidis_: Neat use of asymptotic arguments and 1step Fisher scoring by @tslumley to use just enough data from databases for efficient estimation of GLMs. Fan of biglm in #rstats and will play with dbglm ASAP! Options for robust standard errors would be great and think can be implemented &lt;a href="https://t.co/RLgKDkTDqU"&gt;https://t.co/RLgKDkTDqU&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-03 @thosjleeper: Whoa! {data.table} just gained the ability to read #csvy files. &lt;a href="https://t.co/X6yNsU2vkk"&gt;https://t.co/X6yNsU2vkk&lt;/a&gt; &lt;a href="https://t.co/ReCcPptxV6"&gt;https://t.co/ReCcPptxV6&lt;/a&gt; #rstats&lt;/li&gt;
&lt;li&gt;2019-05-04 @ManningBooks: Exploring the fold Function, an excerpt from Clojure: The Essential Reference by @reborg. &lt;a href="https://t.co/VHZLlV0AuX"&gt;https://t.co/VHZLlV0AuX&lt;/a&gt; #clojure #functionalprogramming #JVM #Java&lt;/li&gt;
&lt;li&gt;2019-05-04 @nicklockwood: I was blown away by the enthusiasm for my little Wolfenstein demo. It sounds like there&amp;rsquo;s a lot of interest in a step by step tutorial, but that will take me a little while to put together, so for those that just want to dive into the code, here it is: &lt;a href="https://t.co/x1C41623Ea"&gt;https://t.co/x1C41623Ea&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-04 @kaz_yos: hlennon/LCTMtools: Latent Class Trajectory Models: An R Package &lt;a href="https://t.co/9mEfw2UjIg"&gt;https://t.co/9mEfw2UjIg&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-04 @_wilfredh: An excellent overview of the different gradient descent algorithms, and a nice example of content that is available as both a responsive website and a PDF on arXiv: &lt;a href="https://t.co/SoeLkxhd8b"&gt;https://t.co/SoeLkxhd8b&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-04 @_wilfredh: Command line code review of git pull requests: an elegant approach that considers the dependency tree and a heatmap of which files are changed the most often! &lt;a href="https://t.co/nlYBlKZsqz"&gt;https://t.co/nlYBlKZsqz&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-04 @borkdude: Discovering Runtime Function References in #Clojure @bbatsov &lt;a href="https://t.co/ih3ijiZ7OJ"&gt;https://t.co/ih3ijiZ7OJ&lt;/a&gt; Love it. Would be great to see if actually nothing depends on it, so you can safely remove unused functions.&lt;/li&gt;
&lt;li&gt;2019-05-04 @rctatman: Datasette is a handy little project that lets you serve a SQLite read-only dataset as an API &amp;amp; website. Seems like a good tool for small dataset releases you want people to be able to poke around in (it was designed for data journalists). &lt;a href="https://t.co/oK3xuPKrax"&gt;https://t.co/oK3xuPKrax&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-04 @inconvergent: bend. &lt;a href="https://t.co/zI2rs98bBy"&gt;https://t.co/zI2rs98bBy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-04 @BatesDmbates: I wrote about the complexity of linear mixed-effects models and its effect on time to fit the model at &lt;a href="https://t.co/DSZU41QCN2"&gt;https://t.co/DSZU41QCN2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-04 @sigfpe: I wrote some static html about continuations and programming languages. If you&amp;rsquo;re a functional programmer you&amp;rsquo;ll already know all of this but I want to get programmers who don&amp;rsquo;t usually think this way interested &lt;a href="https://t.co/qMDrwx25F8"&gt;https://t.co/qMDrwx25F8&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-05 @mfikes: Replete 2.0-alpha1 for macOS is available! #ClojureScript Help us test it and find bugs: &lt;a href="https://t.co/Hr0iG6KW21"&gt;https://t.co/Hr0iG6KW21&lt;/a&gt; &lt;a href="https://t.co/cunqkgcoC1"&gt;https://t.co/cunqkgcoC1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-05 @jedisct1: gcc and clang have builtins to check for arithmetic overflow. Unless you have to care about old/other compilers, use them! &lt;a href="https://t.co/akYdCRy6fn"&gt;https://t.co/akYdCRy6fn&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-05 @_wilfredh: On the early metaphors that drove the original development of Unix: &lt;a href="https://t.co/KNtgXmba2a"&gt;https://t.co/KNtgXmba2a&lt;/a&gt; (Lots of typewriter influence, and amazingly the first versions did not have a notion of pipes!)&lt;/li&gt;
&lt;li&gt;2019-05-05 @immersivemath: Our free, interactive, online interactive book about linear algebra is done! Finally! &lt;a href="https://t.co/NvVhx5eVUx"&gt;https://t.co/NvVhx5eVUx&lt;/a&gt; Help us celebrate by RT:ing #linearalgebra #maths&lt;/li&gt;
&lt;li&gt;2019-05-05 @phil_eaton: Latest post in the compiler basics series: using LLVM conditionals in compiling a fibonacci program &lt;a href="https://t.co/A72yEDQ8sd"&gt;https://t.co/A72yEDQ8sd&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-05 @josef_heinen: Sixel graphics is not only useful for displaying plots on remote HPC systems - #JuliaLang 1.1.0 + GR on a #RaspberryPi : &lt;a href="https://t.co/TklzCYr2Ro"&gt;https://t.co/TklzCYr2Ro&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-05 @biorxiv_bioinfo: Machine learning-based detection of insertions and deletions in the human genome &lt;a href="https://t.co/cTQfuouG5y"&gt;https://t.co/cTQfuouG5y&lt;/a&gt; #biorxiv_bioinfo&lt;/li&gt;
&lt;li&gt;2019-05-05 @newsycombinator: SirixDB – An Evolutionary, Temporal NoSQL Storage System &lt;a href="https://t.co/cxGMKrhr34"&gt;https://t.co/cxGMKrhr34&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-05 @HNTweets: Introduction to High-Performance Scientific Computing (2014): &lt;a href="https://t.co/bG6dgwGod9"&gt;https://t.co/bG6dgwGod9&lt;/a&gt; Comments: &lt;a href="https://t.co/cbZIoA85es"&gt;https://t.co/cbZIoA85es&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-06 @juldanjou: An Introduction to Functional Programming with Python (where I only wrote the word Lisp once) &lt;a href="https://t.co/GAmnJ8wjCK"&gt;https://t.co/GAmnJ8wjCK&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-06 @kaz_yos: Limitations of the Odds Ratio in Gauging the Performance of a Diagnostic, Prognostic, or Screening Marker &lt;a href="https://t.co/Rxe9OJZu15"&gt;https://t.co/Rxe9OJZu15&lt;/a&gt; &lt;a href="https://t.co/gdoVSbhMaH"&gt;https://t.co/gdoVSbhMaH&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-06 @OrbenAmy: 🚨 STOP THE PRESS: HAs social media destroyed a generation? Probably not. 🚨 Research published today in @PNASNews puts an end to overhyped correlational results by providing concrete longitudinal evidence: &lt;a href="https://t.co/6Fed102JqK"&gt;https://t.co/6Fed102JqK&lt;/a&gt; (1/11) &lt;a href="https://t.co/0RkaMcht1d"&gt;https://t.co/0RkaMcht1d&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-07 @pstuffa: Sometimes there&amp;rsquo;s too much data for a #scatterplot matrix, so why not a #hexbin matrix instead? With brushing, obvy #d3 #observable Set up as a function, so it&amp;rsquo;s easy to reuse wherever. &lt;a href="https://t.co/MjIvEyrJqY"&gt;https://t.co/MjIvEyrJqY&lt;/a&gt; &lt;a href="https://t.co/zJpjdlbklL"&gt;https://t.co/zJpjdlbklL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-07 @tslumley: My picture of the reasons two variables can be correlated &lt;a href="https://t.co/SCPc0CUYDs"&gt;https://t.co/SCPc0CUYDs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-07 @mxsage: (classic) physarum polycephalum sim &lt;a href="https://t.co/sNfYQMaCv7"&gt;https://t.co/sNfYQMaCv7&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-07 @mcmc_stan: The working link is &lt;a href="https://t.co/T6ENricRoc"&gt;https://t.co/T6ENricRoc&lt;/a&gt; (this will redirect to the latest version) &lt;a href="https://t.co/2RaCFvcCcO"&gt;https://t.co/2RaCFvcCcO&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-07 @freakonometrics: &amp;ldquo;Adversarial attacks on medical machine learning&amp;rdquo; &lt;a href="https://t.co/ntIOVQkr5U"&gt;https://t.co/ntIOVQkr5U&lt;/a&gt; &lt;a href="https://t.co/mcdEo892KE"&gt;https://t.co/mcdEo892KE&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-07 @psychemedia: Ok, so what&amp;rsquo;s Microsoft gather/nbgather? &lt;a href="https://t.co/EMewPobwX3"&gt;https://t.co/EMewPobwX3&lt;/a&gt; &amp;ldquo;Tools for cleaning code, recovering lost code, and comparing versions of code in Jupyter Lab. &amp;hellip; saves a history of all code you&amp;rsquo;ve executed and the outputs it produces to the notebook&amp;rsquo;s metadata.&amp;rdquo;&lt;/li&gt;
&lt;li&gt;2019-05-07 @newsycombinator: Mathics – A free, light-weight alternative to Mathematica &lt;a href="https://t.co/dRXZDlXVCR"&gt;https://t.co/dRXZDlXVCR&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-07 @hervelc: Je trouve que tout étudiant(e) en informatique devrait livre le livre de Stéphane Bortzmeyer. Il présente clairement le fonctionnement du réseau&amp;hellip; et il montre les points politiquement sensibles. Quand le code peut influer sur les droits humains. &lt;a href="https://t.co/FQjHeAa9ht"&gt;https://t.co/FQjHeAa9ht&lt;/a&gt; &lt;a href="https://t.co/zCXNi9aton"&gt;https://t.co/zCXNi9aton&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-07 @mathematicsprof: Here is a nice introductory of scientific computing from the engineering dept at the Univ of Illinois. &lt;a href="https://t.co/LwGc9keSlm"&gt;https://t.co/LwGc9keSlm&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-07 @zentree: Installed Joplin &lt;a href="https://t.co/MyUCCsqNtS"&gt;https://t.co/MyUCCsqNtS&lt;/a&gt; Testing as research note-taking tool. The ability to save everything in a place of my choice, sync, cross-platform availability, and everything as markdown files is very tempting.&lt;/li&gt;
&lt;li&gt;2019-05-08 @mfikes: If you look at the perf of Space War in ClojureScript—which is fairly straightforward / idiomatic “map-oriented” Clojure code—the function that it spends most of its time in is array-index-of (doing linear scans for keys in PersistentArrayMap). See &lt;a href="https://t.co/1OKVlIFoxR"&gt;https://t.co/1OKVlIFoxR&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-08 @ThePracticalDev: 1. fx, a command-line JSON processing tool 2. http-prompt, for interacting with APIs 3. fselect, for querying files with an SQL-like syntax 4. ranger, a command-line file manager 5. tokei, to view statistics on you { author: @_darrenburns } #DEVCommunity &lt;a href="https://t.co/yl01dnorl6"&gt;https://t.co/yl01dnorl6&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-08 @zim2918: Any words for this drawing? &lt;a href="https://t.co/euCg6y2s0J"&gt;https://t.co/euCg6y2s0J&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-08 @zevross: I&amp;rsquo;m really impressed with these materials for learning geographic data science with #python. It&amp;rsquo;s clear that @darribas put a ton of care in assembling the course and resources and we&amp;rsquo;re lucky he makes them freely available | &lt;a href="https://t.co/NIEt1c1Lvj"&gt;https://t.co/NIEt1c1Lvj&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-08 @Roi&lt;em&gt;Louis&lt;/em&gt;: La façade est presque finie ! not bad &amp;lt;3 &lt;a href="https://t.co/GFOsQI8c6M"&gt;https://t.co/GFOsQI8c6M&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-08 @_djli: A small #rstats package to help with deriving phylogenies from common synthesis trees or user provided trees. Still in early stage. Tests/suggestions/comments/contributions are welcome. &lt;a href="https://t.co/eag8OXzmv4"&gt;https://t.co/eag8OXzmv4&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-08 @skathire: 👇🏽is really a must read for those interested in the theory and history behind using a genome-wide set of DNA markers for predicting complex traits &lt;a href="https://t.co/TrAvja4wKR"&gt;https://t.co/TrAvja4wKR&lt;/a&gt; &lt;a href="https://t.co/lWQhUyOcAI"&gt;https://t.co/lWQhUyOcAI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-08 @JavaScriptDaily: To celebrate its 10th birthday, Mojang has rewritten Minecraft Classic in JS and put it online to play: &lt;a href="https://t.co/4atCyoGX5k"&gt;https://t.co/4atCyoGX5k&lt;/a&gt; The source appears to be at &lt;a href="https://t.co/Dw805rg4ro"&gt;https://t.co/Dw805rg4ro&lt;/a&gt; and is minified but not obfuscated, so enjoy. Appears to be using Babylon.js! &lt;a href="https://t.co/y6hcGFu05R"&gt;https://t.co/y6hcGFu05R&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-08 @_wilfredh: Extraterm is a terminal emulator with a really interesting model of showing outputs in frames and allowing you to manipulate them: &lt;a href="https://t.co/YaX1jKvHel"&gt;https://t.co/YaX1jKvHel&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-09 @BrodieGaslam: @noamross @henrikbengtsson @groundwalkergmb @kaneplusplus @eddelbuettel &amp;ldquo;What Every Programmer Should Know About Memory&amp;rdquo; has a good generic explanation. If you have a high cache miss rate with hyperthreads (I assume that&amp;rsquo;s virtual cores are here), the CPU can take advantage of the resulting stalls to run the other thread. &lt;a href="https://t.co/zm8fkHHjEB"&gt;https://t.co/zm8fkHHjEB&lt;/a&gt; &lt;a href="https://t.co/BRcWKNiW2R"&gt;https://t.co/BRcWKNiW2R&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-09 @alamajesse: Anyone else get a kick out of reading about shells? I&amp;rsquo;m talking man ksh, browing the zsh docs, bash info pages, and so on.&lt;/li&gt;
&lt;li&gt;2019-05-09 @BobMuenchen: Here&amp;rsquo;s a good post on how much simpler Stata is than R for many tasks &lt;a href="https://t.co/bqAz51PgDZ"&gt;https://t.co/bqAz51PgDZ&lt;/a&gt; #rstats #stata #statistics #analytics #bigdata #DataScience @Stata &lt;a href="https://t.co/7epixsquQA"&gt;https://t.co/7epixsquQA&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-09 @AltunaAkalin: updated book draft &amp;ldquo;computational #genomics with R&amp;rdquo; #Rstats &lt;a href="https://t.co/L4buuGIAXg"&gt;https://t.co/L4buuGIAXg&lt;/a&gt; New supervised and unsupervised #MachineLearning chapters + multi-#omics analysis chapter. There are most likely typos &amp;amp; mistakes, you can help us improve it &lt;a href="https://t.co/x7s4QTlhGn"&gt;https://t.co/x7s4QTlhGn&lt;/a&gt; &lt;a href="https://t.co/Ljj4CQ9Jhg"&gt;https://t.co/Ljj4CQ9Jhg&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-09 @olebegemann: Yay, GitHub now sends notifications for comments on gists (finally!). Looks like you have to manually subscribe to your existing gists if you want notifications for them though. &lt;a href="https://t.co/O50XtE0SGh"&gt;https://t.co/O50XtE0SGh&lt;/a&gt; &lt;a href="https://t.co/Ina3YhnKJZ"&gt;https://t.co/Ina3YhnKJZ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-09 @warmsunlove: a ring that folds out to an astronomical sphere. 16th cent. &lt;a href="https://t.co/HzjHjqnYRw"&gt;https://t.co/HzjHjqnYRw&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-09 @math_rachel: Regex Tuesdays Challenges, with nice format to see passing/failing tests &lt;a href="https://t.co/9VNkw6TGzX"&gt;https://t.co/9VNkw6TGzX&lt;/a&gt; (although I still found it easiest to do some scratch work in &lt;a href="https://t.co/KAwITplbVs"&gt;https://t.co/KAwITplbVs&lt;/a&gt; and then copy answer in) &lt;a href="https://t.co/3BXR8pKnBD"&gt;https://t.co/3BXR8pKnBD&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-10 @jpatrickhall: New to awesome-#MachineLearning-interpretability metalist: - ICLR debugging workshop: &lt;a href="https://t.co/z4meB42BUC"&gt;https://t.co/z4meB42BUC&lt;/a&gt; - @h2oai&amp;rsquo;s monotonic gbm: &lt;a href="https://t.co/CjoH2q8fUs"&gt;https://t.co/CjoH2q8fUs&lt;/a&gt; - @Microsoft&amp;rsquo;s interpret library: &lt;a href="https://t.co/F2N7y3g7ZV"&gt;https://t.co/F2N7y3g7ZV&lt;/a&gt; - Metalist link: &lt;a href="https://t.co/vdT9bBAtUq"&gt;https://t.co/vdT9bBAtUq&lt;/a&gt; #XAI #DataScience &lt;a href="https://t.co/MoStwHmDFa"&gt;https://t.co/MoStwHmDFa&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-10 @statsepi: Regress weight on height and take the residual. That is conceptually the same as a BMI. Then, for a model with weight and height on the RHS, the weight coefficient will be the same as the coefficient from a model where the weight residual is alone on the RHS. &lt;a href="https://t.co/i63c5sLtvJ"&gt;https://t.co/i63c5sLtvJ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-12 @vsbuffalo: This three part series by @betanalpha is an excellent introduction to Gaussian Processes in Stan: &lt;a href="https://t.co/T4cXH6IeWk"&gt;https://t.co/T4cXH6IeWk&lt;/a&gt; The section on moving from weakly informative priors to informative priors on scale length (&lt;a href="https://t.co/M0DzOeOTjV"&gt;https://t.co/M0DzOeOTjV&lt;/a&gt;) is especially nice.&lt;/li&gt;
&lt;li&gt;2019-05-13 @KirkDBorne: Logistic Regression as a #NeuralNetwork, in one picture: &lt;a href="https://t.co/IYy2yzJs7k"&gt;https://t.co/IYy2yzJs7k&lt;/a&gt; by @AjitJaokar ———— #abdsc #DataScience #MachineLearning #Algorithms #BigData #Statistics ——— See more “in one picture” #infographics for #DataScientists at @DataScienceCtrl &lt;a href="https://t.co/FneaZzGjfl"&gt;https://t.co/FneaZzGjfl&lt;/a&gt; &lt;a href="https://t.co/Ns7tbdjnK4"&gt;https://t.co/Ns7tbdjnK4&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-13 @JustGlowing: GRV, a terminal based interface for viewing Git repositories &lt;a href="https://t.co/c6ew7SlAZY"&gt;https://t.co/c6ew7SlAZY&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-13 @beesandbombs: this u @bigblueboo ? &lt;a href="https://t.co/zkBDJ9X4n1"&gt;https://t.co/zkBDJ9X4n1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-13 @joelgrus: Data Science from Scratch, second edition now available! &lt;a href="https://t.co/JSzXZxJCaz"&gt;https://t.co/JSzXZxJCaz&lt;/a&gt; #DataScience #BuyMyBook #ShamelessSelfPromotion&lt;/li&gt;
&lt;li&gt;2019-05-13 @StatGarrett: Thank you @christoph_sax for an #rstats cheat sheet on #tsbox, a tool kit for time series! Available at &lt;a href="https://t.co/OZVUTm5lDl"&gt;https://t.co/OZVUTm5lDl&lt;/a&gt; @rstudio &lt;a href="https://t.co/tOZUJmccXW"&gt;https://t.co/tOZUJmccXW&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-13 @KevinSimler: GOING CRITICAL — a 🆕 interactive essay! How to prevent disease, control nuclear reactions, and encourage the spread of ideas. All with playable simulations. &lt;a href="https://t.co/7LhDOQXVGT"&gt;https://t.co/7LhDOQXVGT&lt;/a&gt; &lt;a href="https://t.co/UBIhO2Aadr"&gt;https://t.co/UBIhO2Aadr&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-14 @newsycombinator: Oh shit, git (2016) &lt;a href="https://t.co/t3XEUjD2jb"&gt;https://t.co/t3XEUjD2jb&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-14 @fdnklg: I made a #dataviz about gender in politics: &lt;a href="https://t.co/lIt4kcx9dY"&gt;https://t.co/lIt4kcx9dY&lt;/a&gt; Find out how countries progressed within the last decades. Based on data from @undata &lt;a href="https://t.co/C1iRYknuQg"&gt;https://t.co/C1iRYknuQg&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-14 @FunctorFact: Numpy clone in Common Lisp &lt;a href="https://t.co/eAr1BAXIvx"&gt;https://t.co/eAr1BAXIvx&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-14 @kaz_yos: &amp;ldquo;Stata unclustered robust variance and cluster-robust variance. How can the standard errors with the vce(cluster clustvar) option be smaller than those without the vce(cluster clustvar) option?&amp;rdquo; &lt;a href="https://t.co/SpS3VFNHR3"&gt;https://t.co/SpS3VFNHR3&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-15 @newsycombinator: Things you’re probably not using in Python 3 – but should &lt;a href="https://t.co/obLN5jyxkn"&gt;https://t.co/obLN5jyxkn&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-15 @newsycombinator: PHP in 2019 &lt;a href="https://t.co/8QxEhuosIi"&gt;https://t.co/8QxEhuosIi&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-15 @_inesmontani: Experimented with packaging my online course framework as an Electron app and it&amp;hellip; just works 🤯 Wrapping web apps isn&amp;rsquo;t always a good idea. But it does open up some new possibilities: easily share it without public hosting &amp;amp; sell premium courses online 100% independently 💸 &lt;a href="https://t.co/QXDUjCA8wW"&gt;https://t.co/QXDUjCA8wW&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-15 @pocmatos: Racket News, Issue 8 is here! Enjoy! @racketlang #racketnews &lt;a href="https://t.co/rXNuRTxSRI"&gt;https://t.co/rXNuRTxSRI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-16 @jtleek: Hey @visnut I seem to remember you had a webpage with a bunch of your experiments in visualization with @heike_hh and others organized. I can&amp;rsquo;t seem to find it though. Am I just making things up? cc @LucyStats&lt;/li&gt;
&lt;li&gt;2019-05-16 @strnr: gpart: human genome partitioning and visualization of high-density SNP data by identifying haplotype blocks &lt;a href="https://t.co/OQ3tqMMw9K"&gt;https://t.co/OQ3tqMMw9K&lt;/a&gt; &lt;a href="https://t.co/pXWxx3jGNR"&gt;https://t.co/pXWxx3jGNR&lt;/a&gt; &lt;a href="https://t.co/xUhtEyt92M"&gt;https://t.co/xUhtEyt92M&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-17 @newsycombinator: Course: Matrix Methods in Data Analysis, Signal Processing, and Machine Learning &lt;a href="https://t.co/mMJiN3lUqy"&gt;https://t.co/mMJiN3lUqy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-17 @greghendershott: I&amp;rsquo;ve been working on using an org file to generate a user gude + reference manual, in both Info and HTML formats. Example of the latter (still WIP): &lt;a href="https://t.co/G5gYPsOW7k"&gt;https://t.co/G5gYPsOW7k&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-17 @iLemming: Good @spacemacs loving people made it really easy to use Emacs with xwidgets support. &lt;code&gt;brew install emacs-plus --with-xwidgets --HEAD&lt;/code&gt;. Fully functional browser in Emacs. Imagine the possibilities? &lt;a href="https://t.co/KVRN86oMeI"&gt;https://t.co/KVRN86oMeI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-17 @fuzzycz: As usual, updated slides for my CREATE STATISTICS talk I&amp;rsquo;m about to give at #pgconfbe are available here &lt;a href="https://t.co/SjLTxfHmoQ"&gt;https://t.co/SjLTxfHmoQ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-17 @beesandbombs: happy friday to #twitter &lt;a href="https://t.co/vVTllSJQa5"&gt;https://t.co/vVTllSJQa5&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-17 @strnr: A rapid and simple method for assessing and representing genome sequences relatedness &lt;a href="https://t.co/mFH0kCcFbh"&gt;https://t.co/mFH0kCcFbh&lt;/a&gt; &lt;a href="https://t.co/oLN2c7wfuv"&gt;https://t.co/oLN2c7wfuv&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-17 @MinionLab: Book delivery. @3rdreviewer @ClausWilke &lt;a href="https://t.co/4oe1VaewvY"&gt;https://t.co/4oe1VaewvY&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-18 @f2harrell: One of my greatest regrets as a statistician is that I didn&amp;rsquo;t scream at the top of my lungs when I first saw bad statistical practice in high-dimensional genomics. Results were statistically predictable. Thinking you can reliably &amp;ldquo;name names&amp;rdquo; when p &amp;gt; n is a joke. &lt;a href="https://t.co/4fP6jhoBv5"&gt;https://t.co/4fP6jhoBv5&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-18 @Atabey_Kaygun: The lectures notes (as jupyter notebooks) of the &amp;ldquo;Data Science for Fundamental Sciences&amp;rdquo; class I taught last semester are available now at &lt;a href="https://t.co/HyZ680fhnu"&gt;https://t.co/HyZ680fhnu&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-19 @brodriguesco: Are you an #rstats user? You&amp;rsquo;re using Rstudio but want to try another text editor out? Why not @spacemacs, Vim and Emacs&amp;rsquo; lovechild? In my latest blog post, I provide a short intro to this magnificient editor, and how useable it is for #rstats &lt;a href="https://t.co/H7qf4gYRtz"&gt;https://t.co/H7qf4gYRtz&lt;/a&gt; &lt;a href="https://t.co/kLhHhct8PX"&gt;https://t.co/kLhHhct8PX&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-19 @ChrisRackauckas: A summary of #julialang for scientific computing in 2019. &lt;a href="https://t.co/VBd1qjgasQ"&gt;https://t.co/VBd1qjgasQ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-20 @JavaScriptDaily: Ola.js: A Library for Smoothly Animating Values - &lt;a href="https://t.co/CTPUkSM9Zu"&gt;https://t.co/CTPUkSM9Zu&lt;/a&gt; (Smooth tweening between values, ideal for live visualizations.)&lt;/li&gt;
&lt;li&gt;2019-05-20 @thinkR_fr: #rstats - &amp;ldquo;{traveltime} package allows to retrieve isochrones for traveltime-maps from the Traveltime Platform API directly from R&amp;rdquo; by @thlorusso &lt;a href="https://t.co/TjSOR2YZOA"&gt;https://t.co/TjSOR2YZOA&lt;/a&gt; &lt;a href="https://t.co/mkrsWFb2Gt"&gt;https://t.co/mkrsWFb2Gt&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-20 @rafalab: @f2harrell @C3gnGuy Here are two examples of useful and constructive work related to power in the high-dimensional feature space situation. &lt;a href="https://t.co/qWHnRA6jAj"&gt;https://t.co/qWHnRA6jAj&lt;/a&gt; &lt;a href="https://t.co/ftjzjO8Ask"&gt;https://t.co/ftjzjO8Ask&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-20 @mfikes: Gotta say: It’s pretty cool you can search for “Clojure” in the Mac App Store and you now get a free implementation of it. My hope is this will be an enabler for kids learning to program and newcomers to the language. :) &lt;a href="https://t.co/Y2E3otfOUe"&gt;https://t.co/Y2E3otfOUe&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-21 @_inesmontani: I&amp;rsquo;ve started putting together flowcharts for solving various NLP problems with &lt;a href="https://t.co/j3J6mQ9xJf"&gt;https://t.co/j3J6mQ9xJf&lt;/a&gt; (and beyond). Obviously none of this is foolproof – it&amp;rsquo;s just a summary of our usual advice. Here&amp;rsquo;s the first one for Named Entity Recognition! 📥 PDF: &lt;a href="https://t.co/OPVLAIR7Fu"&gt;https://t.co/OPVLAIR7Fu&lt;/a&gt; &lt;a href="https://t.co/PNGDDSiFYJ"&gt;https://t.co/PNGDDSiFYJ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-21 @newsycombinator: Set Theory and Foundations of Mathematics &lt;a href="https://t.co/LXuV7K26n0"&gt;https://t.co/LXuV7K26n0&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-21 @Spyder_IDE: Its finally here! After nearly a year of development, the milestone Spyder 4 Beta 2 is out, with an all-new code completion, introspection, help and analysis architecture, a full-UI dark theme, a new plots pane and much, much more! Try it out now &lt;a href="https://t.co/PQ2IYhChlp"&gt;https://t.co/PQ2IYhChlp&lt;/a&gt; &lt;a href="https://t.co/Q7agaS31X8"&gt;https://t.co/Q7agaS31X8&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-22 @MaartenvSmeden: This week in our journal club: a surprisingly accessible introduction to instrumental variable analyses. #epitwitter &lt;a href="https://t.co/cCETVkKLlV"&gt;https://t.co/cCETVkKLlV&lt;/a&gt; &lt;a href="https://t.co/KgSBOadCqA"&gt;https://t.co/KgSBOadCqA&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-22 @freakonometrics: isochrone map &lt;a href="https://t.co/TBfYWypjNT"&gt;https://t.co/TBfYWypjNT&lt;/a&gt; ht @mirbole01 &lt;a href="https://t.co/6By2p4iPud"&gt;https://t.co/6By2p4iPud&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-22 @DmitryUlyanovML: Another great paper from Samsung AI lab! @egorzakharovdl et al. animate heads using only few shots of target person (or even 1 shot). Keypoints, adaptive instance norms and GANs, no 3D face modelling at all. ▶️ &lt;a href="https://t.co/Xk5D4WccpD"&gt;https://t.co/Xk5D4WccpD&lt;/a&gt; 📝 &lt;a href="https://t.co/SxnVfY72TT"&gt;https://t.co/SxnVfY72TT&lt;/a&gt; &lt;a href="https://t.co/GjVrJbejT0"&gt;https://t.co/GjVrJbejT0&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-22 @strnr: SurVIndel: improving CNV calling from high-throughput sequencing data through statistical testing &lt;a href="https://t.co/nX89S80n2r"&gt;https://t.co/nX89S80n2r&lt;/a&gt; &lt;a href="https://t.co/GLeeat52w8"&gt;https://t.co/GLeeat52w8&lt;/a&gt; &lt;a href="https://t.co/R0iqSMy754"&gt;https://t.co/R0iqSMy754&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-22 @mbostock: I built a pachinko machine simulator… for visualizing the distribution of a random number generator. &lt;a href="https://t.co/JHz8ekP8dk"&gt;https://t.co/JHz8ekP8dk&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-23 @vsbuffalo: I&amp;rsquo;ve been enjoying Efron and Hastie&amp;rsquo;s new-ish book &amp;ldquo;Computer Age Statistical Inference&amp;rdquo; (PDF: &lt;a href="https://t.co/oT9XBK9U7B)"&gt;https://t.co/oT9XBK9U7B)&lt;/a&gt;. Liked how this section united a bunch of different topics as &amp;ldquo;ingenious devices to circumvent the defect&amp;rdquo; in frequentist estimation: &lt;a href="https://t.co/65mNIjeAsW"&gt;https://t.co/65mNIjeAsW&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-05-23 @newsycombinator: The Art of Command Line &lt;a href="https://t.co/o6EbYsPfSq"&gt;https://t.co/o6EbYsPfSq&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Postico App</title><link>https://aliquote.org/post/postico-app/</link><pubDate>Tue, 21 May 2019 20:21:14 +0200</pubDate><guid>https://aliquote.org/post/postico-app/</guid><description>&lt;p&gt;A few months ago, I discussed &lt;a href="https://aliquote.org/post/tableplus-app"&gt;TablePlus&lt;/a&gt; which is a powerful application to manage your local databases. Here are a few words about &lt;a href="https://eggerapps.at/postico/"&gt;Postico&lt;/a&gt;, which I use with &lt;a href="https://postgresapp.com"&gt;Postgres App&lt;/a&gt; (both applications are developed by the same guy) when I am not using &lt;code&gt;psql&lt;/code&gt; in a Terminal.&lt;/p&gt;
&lt;p&gt;What I like about Postico is that it provides a minimalistic UI to manage your databases and to query any tables inside. From Postgres App, you get a launcher in the menu bar and a nice manager that allows to view all your local databases and to manage the version of the running server. Actually, I have version 9.5, 9.6, 10 and 11, and I am currently developping a small Python+Falsk app using Postgresql 11.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-05-21-20-27-20.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Then comes Postico, which is the default app to open an existing database (if Postico is not available, a Terminal is launched and you must resort on &lt;code&gt;psql&lt;/code&gt;).&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-05-21-20-33-09.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Again, the design is simple as it was probably designed to be user-friendly à la Excel or Numbers. What I mean is that once you open a given table, you can visualize its contents (up to 1000 rows), or even the table schema. The latter, also called &amp;ldquo;structure view&amp;rdquo;, lets you add custom column by hand: Give it a name, specify its type and properties (e.g., primary or foreign key, unique, etc.) and then commit your changes.&lt;/p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2019-05-21-20-34-15.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2019-05-21-20-34-15.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/2019-05-21-20-46-35.png" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/2019-05-21-20-46-35.png"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;You will soon find at home using this app since most macOS shortcuts are available, e.g. &lt;code&gt;⌘R&lt;/code&gt; to refresh the view. The tables can be edited by hand or using SQL commands (&lt;code&gt;⇧⌘T&lt;/code&gt; will bring an SQL console) directly (&lt;code&gt;⌘R&lt;/code&gt; will execute the selection). Past commands are kept from one session to the other in the SQL console in case you want to reuse them. Otherwise, you can just delete them altogether.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-05-21-20-45-41.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Compared to TablePlus, Postico only works with Postresql databases, but it provides an all-in-one app to manage and query your data. And as the authir states,&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;You&amp;rsquo;ll be delighted by all the thoughtful details.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Go take a look, it&amp;rsquo;s really worth it.&lt;/p&gt;</description></item><item><title>Emacs, 15 years later</title><link>https://aliquote.org/post/emacs-15-years-later/</link><pubDate>Mon, 13 May 2019 20:24:05 +0200</pubDate><guid>https://aliquote.org/post/emacs-15-years-later/</guid><description>&lt;p&gt;I have been using Emacs almost daily for about 15 years. For the days without, I was probably just away from my computer or working full-time on a task for which no text editor was required.&lt;/p&gt;
&lt;p&gt;Well, I started using Emacs on the recommendations of my colleague &lt;a href="http://pallier.org/"&gt;Christophe Pallier&lt;/a&gt;, who also encouraged me to use R more regularly. At that time, I would not have imagined how much important these tools would be in my daily job. Now, I know, even if I barely use R anymore these days. So, let me thank you again, Christophe! Of course, I&amp;rsquo;ve tried many &lt;a href="https://aliquote.org/post/emacs-versus-textmate/"&gt;other text editors&lt;/a&gt;, and well, I&amp;rsquo;m &lt;a href="https://aliquote.org/post/why-i-am-still-using-emacs/"&gt;still using Emacs&lt;/a&gt; after all those years, although I must admit VS Code is a &lt;a href="https://aliquote.org/post/vscode-python/"&gt;great editor&lt;/a&gt; for coding as well.&lt;/p&gt;
&lt;p&gt;During the past few days, I have spent some time rebuilding from scratch my Emacs config. It happened because of some sort of procrastination religion that I discreetly practice every 2 or 3 months, and also because I was looking for a faster and ubiquitous way to use Emacs anytime, anywhere, from a simple terminal. Indeed, following my recent move, I spend more time using a shell and CLI-oriented tools than I was beforehand. I have been using Spacemacs for a few months now, and even if it works quite well when launched as &lt;code&gt;-nw&lt;/code&gt; (i.e., when it is launched in a terminal rather than using the GUI), its startup time is barely acceptable &amp;ndash; unless you launch it once, and make use of Emacs server facilities afterwards. Nope, I wanted something like Vim, or NVim since it is the Vim falvour I am currently being using, and I also spent some time configuring my NVim the way I like it to be. This is it, btw:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-05-13-21-07-26.png"&gt;
&lt;/figure&gt;
&lt;p&gt;However, the Vi philosophy is probably too obscure for me at the moment. It has been going on for at least 10 years so I have little hope that it will ever change. While I like some ideas we found in modal editing, I cannot embrace them all. For instance, let&amp;rsquo;s say I&amp;rsquo;m editing a simple BibTeX file. This basically is a just a plain text file with fields appearing on separate line. Using Emacs, I can jump to the next field using &lt;code&gt;C-j&lt;/code&gt; and just go on. I mean, this is part of the writing task: skip the rest of the blank line and move on. I do the same everyday when I write in my notebook. Likewise, &lt;code&gt;C-e&lt;/code&gt; and &lt;code&gt;C-a&lt;/code&gt; let you go to the end or the start of the visual line, much like your wrist would do if you were to write by hand. (This also works nicely in Bash or zsh for what matters.) I mean, this really is part of the editing process, and you should not have to rewind your mind, switch to the normal or visual mode for that very specific purpose. Sometimes, modal editing makes more sense, though. For example, let&amp;rsquo;s say I copy/paste (read yank/paste), some code into a Markdown file, I can select the region afterward (this is the visual mode) and indent it accordingly using &lt;code&gt;&amp;gt;&amp;gt;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s fine. I am aware we can also comment region using &lt;code&gt;gc&lt;/code&gt; or fold a given block of code using &lt;code&gt;za&lt;/code&gt;. But, it is all about region we select manually, when we are not involved in editing any text &lt;em&gt;per se&lt;/em&gt;. What about the line or paragraph we are actually on, trying to find the next word, and then realizing that we just need to pick a quick action, e.g., exchange character at point or comment the whole line? Do I really need to &lt;code&gt;Esc&lt;/code&gt;ape to perform that action and go back into the editing mode. Maybe I&amp;rsquo;m just one of the many who think that modal editing is just &lt;em&gt;evil&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;I ended up installing &lt;a href="https://aliquote.org/post/doom-emacs/"&gt;Doom Emacs&lt;/a&gt; again. That&amp;rsquo;s also fine with me. Doom Emacs comes pre-configured with the &lt;a href="https://www.emacswiki.org/emacs/Evil"&gt;Evil&lt;/a&gt; mode. I am not particularly careful when it comes to use different modes in Emacs, as long as I know when I can use standard Emacs commands, or even more standard actions like in any text editor (I&amp;rsquo;m a happy user of &lt;code&gt;delete-selection-mode&lt;/code&gt; and &lt;code&gt;shift-select&lt;/code&gt;). This means that I can perform some actions in &lt;em&gt;normal&lt;/em&gt; (saving a file, checking git status, jumping to a definition) or &lt;em&gt;visual&lt;/em&gt; (deleting or commenting a region) mode, while spending most of my time using insert mode to write text, to get help on a symbol or to move between chunck of codes. I try to learn a bit of Vim each time, either when I&amp;rsquo;m using Emacs or when I need to quickly fix something in Vim itself. From within Emacs, I get a shell for free as well. This time I decided to use Eshell full time, and I must admit it&amp;rsquo;s the best of both worlds.&lt;/p&gt;
&lt;p&gt;I don&amp;rsquo;t have expansive requirements in terms of a text editor. I just want to be able to move easily between any part of a text file, and to have a few shortcuts under the hood. In my Spacemacs config, I had a dedicated keybinding section for recurrent actions, all binded to a command (⌘) leader key. Here is an excerpt from my &lt;code&gt;init.el&lt;/code&gt; file:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-emacs-lisp" data-lang="emacs-lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;global-set-key&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;kbd&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;H-b&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nf"&gt;#&amp;#39;&lt;/span&gt;&lt;span class="nv"&gt;neotree-toggle&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;global-set-key&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;kbd&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;H-;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nf"&gt;#&amp;#39;&lt;/span&gt;&lt;span class="nv"&gt;evilnc-comment-operator&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;global-set-key&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;kbd&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;H-:&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nf"&gt;#&amp;#39;&lt;/span&gt;&lt;span class="nv"&gt;evil-toggle-fold&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;global-set-key&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;kbd&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;H-g&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nf"&gt;#&amp;#39;&lt;/span&gt;&lt;span class="nv"&gt;magit-status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;global-set-key&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;kbd&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;H-h&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nf"&gt;#&amp;#39;&lt;/span&gt;&lt;span class="nv"&gt;helpful-at-point&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;global-set-key&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;kbd&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;H-u&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nf"&gt;#&amp;#39;capitalize-region&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;global-set-key&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;kbd&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;H-o&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nf"&gt;#&amp;#39;&lt;/span&gt;&lt;span class="nv"&gt;org-capture&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;global-set-key&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;kbd&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;H-t&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nf"&gt;#&amp;#39;&lt;/span&gt;&lt;span class="nv"&gt;split-window-vertically&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;global-set-key&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;kbd&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;H-f&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nf"&gt;#&amp;#39;&lt;/span&gt;&lt;span class="nv"&gt;helm-find-files&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;global-set-key&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;kbd&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;H-,&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nf"&gt;#&amp;#39;&lt;/span&gt;&lt;span class="nv"&gt;helm-swoop&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;global-set-key&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;kbd&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;H-p&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nf"&gt;#&amp;#39;&lt;/span&gt;&lt;span class="nv"&gt;helm-projectile-ag&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;global-set-key&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;kbd&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;H-r&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nf"&gt;#&amp;#39;&lt;/span&gt;&lt;span class="nv"&gt;query-replace&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;spacemacs/set-leader-keys&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;so&amp;#34;&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;helm-occur&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;spacemacs/set-leader-keys&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;sz&amp;#34;&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;helm-bibtex&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;spacemacs/set-leader-keys&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;s&amp;lt;&amp;#34;&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;xref-find-definitions&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;spacemacs/set-leader-keys&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;s&amp;gt;&amp;#34;&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;xref-find-references&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As you can see, I am not particularly demanding.&lt;/p&gt;
&lt;p&gt;The good news is that Doom Emacs still favors &lt;a href="https://oremacs.com/swiper/"&gt;ivy&lt;/a&gt; in place of &lt;a href="https://emacs-helm.github.io/helm/"&gt;Helm&lt;/a&gt;. It is way more faster, of course, and less intrusive. I would say you get 80% of the functionalities of Helm for free. My unoptimized Spacemacs config actually means a 10s startup time using Emacs 27; I am done with 1.2s using Doom on an Homebrewed Emacs 26.2. That&amp;rsquo;s ok for me. I get &lt;a href="https://github.com/clojure-emacs/cider"&gt;Cider&lt;/a&gt; and SLIME, or its little brother in arms &lt;a href="https://github.com/joaotavora/sly"&gt;sly&lt;/a&gt;, for free as well. I tried &lt;a href="https://github.com/l04m33/vlime"&gt;vlime&lt;/a&gt; but was not very happy with the way we handle REPLs in Vim (much like &lt;code&gt;:terminal&lt;/code&gt;, btw) &amp;ndash; Vim is still like we have to &lt;code&gt;C-z&lt;/code&gt; and switch to a proper terminal at some point.&lt;/p&gt;
&lt;p&gt;As I said, I would like to keep working in a Terminal as much as possible. This means I need a running Emacs and a standard zsh shell, or two for what matters. Initially, I tried a single one-window configuration in iTerm, with Emacs on top and a tiny but resizeable zsh session below:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-05-07-15-31-49.png"&gt;
&lt;/figure&gt;
&lt;p&gt;However, I soon realized that it was not very convenient since I need a larger frame for running some tasks in a shell, especially the ones where we get a lot of output printed on &lt;code&gt;stdout&lt;/code&gt;. So I decided to use two tabs in iTerm: on the first tab, I have Emacs in a single frame, while on the second tab I have two zsh shells &amp;ndash; one occupying 4/5 of the frame, and a tiny one below, to run background jobs or quick actions. I even save this window arrangement using iTerm facilities, so that I won&amp;rsquo;t have to set up everything again. Regarding the color scheme, I use the same in Emacs, Vim and iTerm itself. I learned a few tricks about configuring iTerm as a true 256-color or even 24-bit terminal (which requires to update the &lt;code&gt;.terminfo&lt;/code&gt;) in passing, but I finally do not need it with the official &lt;a href="https://www.nordtheme.com"&gt;Nord theme&lt;/a&gt; for Emacs (the one that comes with &lt;a href="https://github.com/hlissner/emacs-doom-themes"&gt;doom-themes&lt;/a&gt; is a bit buggy, IMHO).&lt;/p&gt;</description></item><item><title>The unquantified self #7</title><link>https://aliquote.org/post/unquantified-self-007/</link><pubDate>Wed, 01 May 2019 20:40:56 +0200</pubDate><guid>https://aliquote.org/post/unquantified-self-007/</guid><description>&lt;p&gt;Long time no see. Little update for the &lt;code&gt;#self&lt;/code&gt; tag.&lt;/p&gt;
&lt;p&gt;Today, I&amp;rsquo;m particularly happy because I&amp;rsquo;ll be spending another evening with my son and we will probably watch &lt;a href="https://en.wikipedia.org/wiki/Game_of_Thrones"&gt;Game of Thrones&lt;/a&gt;. I also bought the latest season of &lt;a href="https://en.wikipedia.org/wiki/The_Walking_Dead_(TV_series)"&gt;The Walking Dead&lt;/a&gt; so we shouldn&amp;rsquo;t be left out of TV shows for the coming weeks. And of course I look forward to &lt;a href="https://en.wikipedia.org/wiki/The_Expanse_(TV_series)"&gt;The Expanse&lt;/a&gt; (Season 3) coming on the iTunes store. Public holidays are ending, but we will hopefully find time to watch them all! In the meantime, we also watched all five &lt;a href="https://en.wikipedia.org/wiki/Jason_Bourne"&gt;Jason Bourne&lt;/a&gt; movies, as well as &lt;a href="https://en.wikipedia.org/wiki/The_Matrix"&gt;The Matrix&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;On my end, I&amp;rsquo;m getting used to a new life in a research lab. I&amp;rsquo;ve spent 15 years outside, so it took a longer time than initially expected. Plus, I have to deal with unexpected effects of my illness, as well as long-lasting side-effects of my medication. Nothing really interesting, just to say. Either way, I&amp;rsquo;m really lucky I ended up there since people are really friendly and welcoming. I hope I will be able to stay for some months or even years in this lab before the disease recovers.&lt;/p&gt;
&lt;p&gt;I have been quite calm regarding music and books later. Partly because of my working hard to get things done at some point, and also because I spent the last two weeks in weightlessness: No idea why, I suddenly became a human wreck, unable to stand up without feeling dizzy, and extremely tired &amp;ndash; e.g., I spent three days in a row in a bed, but this state of despondency lasted 10 days. Nobody cares, even me I believe, but it leaves its mark. Hopefully, things will get better with time (or cannot be worst anyway).&lt;/p&gt;
&lt;p&gt;I don&amp;rsquo;t mind the wether, but if it could get warmer for more than 5 days, I would be happy at some point. I remember my outdoor lunches a few weeks ago, and then a cold snap. Not really funny.&lt;/p&gt;
&lt;p&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0574.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0574.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0571.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0571.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;div class="pure-g"&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0569.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0569.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pure-u-1-2"&gt;
&lt;div style="padding: 0 .2em"&gt;
&lt;a href="https://aliquote.org/img/IMG_0577.jpg" target="_blank"&gt;
&lt;img
class="pure-img-responsive"
src="https://aliquote.org/img/IMG_0577.jpg"
alt=""&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/p&gt;
&lt;p&gt;What else? My desocialization phase has reached its peak: I hardly see anyone anymore. That&amp;rsquo;s ok. I don&amp;rsquo;t have any plan.&lt;/p&gt;</description></item><item><title>Micro-posting in April</title><link>https://aliquote.org/post/micro-04-2019/</link><pubDate>Tue, 30 Apr 2019 14:39:12 +0200</pubDate><guid>https://aliquote.org/post/micro-04-2019/</guid><description>&lt;p&gt;Quick recap&amp;rsquo; of April on the Micro blog.&lt;/p&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-04-01&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/album/human-incognito/1171932077" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Arno, &lt;em&gt;Human Incognito&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-01&lt;/a&gt;: &amp;gt; You are being watched. Private and state-sponsored organizations are monitoring&amp;gt; and recording your online activities. &lt;a href="https://www.privacytools.io/#top"&gt;privacytools.io&lt;/a&gt; provides knowledge and&amp;gt; tools to protect your privacy against global mass surveillance.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-01&lt;/a&gt;: Another screenshot in the dark night&amp;hellip;&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-04-01-22-03-27.png"&gt;
&lt;/figure&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-01&lt;/a&gt;: Beta-blockers are so much fun. I just stayed out of it for almost four hoursafter I got home from work. And it&amp;rsquo;s been going on for weeks. Time for anotherbeer I guess.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-01&lt;/a&gt;: Built on top of Bootstrap, the &lt;a href="https://github.com/creativetimofficial/argon-design-system/blob/master/README.md"&gt;Argon Design System&lt;/a&gt; comes with hundred of fullfeatured components and is compatible with mainstream browsers. And the&lt;a href="https://demos.creative-tim.com/argon-design-system/docs/getting-started/overview.html"&gt;documentation&lt;/a&gt; is gorgeous.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-01&lt;/a&gt;: I don&amp;rsquo;t really like editing code in a browser. This is why I rarely use Jupyternotebooks. Likewise, I found that the Emacs &lt;a href="https://github.com/tkf/emacs-ipython-notebook"&gt;EIN&lt;/a&gt; package was clunky. This wasyears ago, and I don&amp;rsquo;t think the project has evolved so much in the recentyears. TIL there&amp;rsquo;s a new interface to communicate with Jupyter kernels:&lt;a href="https://github.com/dzop/emacs-jupyter"&gt;emacs-jupyter&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-01&lt;/a&gt;: The borage has finally bloomed again!&lt;figure&gt;&lt;img src="https://aliquote.org/img/IMG_0627.jpg"&gt;
&lt;/figure&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-01&lt;/a&gt;: This is the 1000th post! 💪👈&lt;code&gt;textBuilding sites …| EN+------------------|------+Pages | 1000Paginator pages | 160Non-page files | 0Static files | 617Processed images | 0Aliases | 34Sitemaps | 1Cleaned | 0Total in 2825 ms&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-01&lt;/a&gt;: &lt;a href="https://cran.r-project.org/doc/contrib/Shipunov-visual%5Fstatistics.pdf"&gt;Visual Statistics. Use R!&lt;/a&gt; (PDF, 429 pp.) &lt;code&gt;#rstats&lt;/code&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-04-01-21-35-06.png"&gt;
&lt;/figure&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-03&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/album/cigarettes-after-sex/121540895" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Cigarettes After Sex, &lt;em&gt;Cigarettes After Sex&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-03&lt;/a&gt;: Another command-line utility to deal with flat files: &lt;a href="https://github.com/BurntSushi/xsv"&gt;xsv&lt;/a&gt; (available onHomebrew).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-03&lt;/a&gt;: Convert images to LaTeX using &lt;a href="https://mathpix.com"&gt;Mathpix&lt;/a&gt; snipping tool. Maybe one day I will learnthat I was wrong about the way I wrote some equations. A little testdemonstrated that it works right out of the box with simple expressions:&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-04-03-19-49-25.png"&gt;
&lt;/figure&gt;
Mine was, in this particular case:&lt;code&gt;text$$ \hat f(x) = \frac{1}{nb}\sum_{j=1}^n K\left(\frac{x-x_j}{b}\right) $$&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-03&lt;/a&gt;: I somehow forgot about &lt;a href="https://gitup.co"&gt;GitUp&lt;/a&gt;. A simple &lt;code&gt;git log&lt;/code&gt; and more Magit when required, andI&amp;rsquo;m generally done with tracking what I&amp;rsquo;ve done. Of course, this is because Imostly work alone. Anyway, I like it when you have a such a clean and minimal UIwhich helps to visualize at a glance (or even act on) a full Git repo.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-03&lt;/a&gt;: Oldie but goodie: &lt;a href="https://stat.ethz.ch/pipermail/r-devel/2006-May/037527.html"&gt;normal random number generator in R&lt;/a&gt;. (via &lt;a href="https://twitter.com/BrodieGaslam/status/1113204074919419905"&gt;@BrodieGaslam&lt;/a&gt;) &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-03&lt;/a&gt;: Un &lt;a href="http://frougon.net/writings/emacs-tut/index.html"&gt;excellent tutoriel&lt;/a&gt;Emacs en français ! &lt;code&gt;#emacs&lt;/code&gt; &lt;code&gt;#fr&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-03&lt;/a&gt;: &lt;a href="http://christopherroach.com/articles/statistics-for-hackers/"&gt;Statistics for Hackers&lt;/a&gt;. Be sure to also check the GH repo of the author, e.g.&lt;a href="https://github.com/chrisalbon/code%5Fpy"&gt;code_py&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-04&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/album/bleu-p%C3%A9trole/275346103" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Alain Bashung, &lt;em&gt;Bleu pétrole&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-05&lt;/a&gt;: &lt;a href="http://colinm.org/sigbovik/"&gt;93% of Paint Splatters are Valid Perl Programs&lt;/a&gt;. So funny that you probablyhave to read the paper as well.&lt;figure&gt;&lt;img src="https://aliquote.org/img/49fc93c0cffe62b9acc25c2d7cf0e22d.jpg"&gt;
&lt;/figure&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-06&lt;/a&gt;: 🎥 &lt;a href="https://www.imdb.com/title/tt0234215/"&gt;Matrix Reloaded&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-06&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/album/human-incognito/1171932077" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Arno, &lt;em&gt;Human Incognito&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-06&lt;/a&gt;: I saw this &lt;a href="https://github.com/Wandmalfarbe/pandoc-latex-template/blob/master/README.md"&gt;pandoc LaTeX template&lt;/a&gt; popping out on Twitter yesterday. I remembertrying it out at some point when I was looking for some good hand craftedtemplates for R/statistical reports. At that time, many people were also usingthe &lt;a href="https://github.com/matze/mtheme"&gt;Metropolis&lt;/a&gt; theme for building slides. I wrote custom templates for bothsituations, finally.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-06&lt;/a&gt;: TIL about &lt;a href="https://bulma.io"&gt;Bulma&lt;/a&gt;, which is a free, open source CSS framework based on Flexbox.Looks like a solid and lightweight alternative to Bootstrap.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-06&lt;/a&gt;: &lt;a href="https://www.cl.cam.ac.uk/teaching/1819/DataSci/notes0.pdf"&gt;IB Foundations of Data Science&lt;/a&gt; (PDF, 106 pp.). Yet another textbook for learningDS &amp;ldquo;quickly&amp;rdquo;. Beware, it relies on Python and is quite mathy.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-06&lt;/a&gt;: &lt;a href="https://github.com/pzivich/Python-for-Epidemiologists"&gt;Python for Epidemiologists&lt;/a&gt;: Tutorial in Python targeted at Epidemiologists. Overthe last few years, I came across several attempts at bringing the Pythonstatistical ecosystem to the Epi domain. Now trying this one. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-06&lt;/a&gt;: &lt;a href="https://cstack.github.io/db%5Ftutorial/"&gt;Writing a sqlite clone from scratch in C&lt;/a&gt;. I already learned a lot of cool stuffby reading part of this tutorial. I&amp;rsquo;m eager to learn more. &lt;code&gt;#database&lt;/code&gt; &lt;code&gt;#clang&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-07&lt;/a&gt;: 📖 Marina Tsvetaeva, &lt;em&gt;Vivre dans le feu&lt;/em&gt; (Robert Laffont, 2005)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-07&lt;/a&gt;: Friday burger party for my son:&lt;figure&gt;&lt;img src="https://aliquote.org/img/IMG_0633.jpg"&gt;
&lt;/figure&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-07&lt;/a&gt;: Recently, on BSAG&amp;rsquo;s website: &lt;a href="https://www.rousette.org.uk/archives/rethinking-my-dotfiles-setup/"&gt;Rethinking my dotfiles setup&lt;/a&gt;. Every time it seems Ilearn a new thing about the open source world when reading her blog posts.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-08&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/album/the-girl-in-the-other-room/958763833" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Diana Krall, &lt;em&gt;The Girl in the Other Room&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-08&lt;/a&gt;: Nothing fancy on Twitter today. The web UI is just poor shit. Try to go back inyour browser history, and a different series of posts appears on the very samepage you landed on just a few seconds before. Oh, and did you ever manage tofind an old posts of yours?&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-08&lt;/a&gt;: &lt;a href="https://zwischenzugs.com/2019/04/03/eight-obscure-bash-options-you-might-want-to-know-about"&gt;Eight Obscure Bash Options You Might Want to Know About&lt;/a&gt;. (via O&amp;rsquo;ReillyProgramming Newletter)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-12&lt;/a&gt;: Folllowing the recent scandal around DataCamp, I think &lt;a href="https://www.dataquest.io"&gt;DataQuest&lt;/a&gt; and &lt;a href="https://exercism.io"&gt;Exercism&lt;/a&gt;remain good online training centers for anyone eager to learn.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-12&lt;/a&gt;: Great. Just when I was trying to recompile my Hugo website I noticed that the0.54-&amp;gt;0.55 upgrade just broke everything! And we can see &lt;a href="https://github.com/gohugoio/hugo/issues/4117#issuecomment-475810894"&gt;comments like this&lt;/a&gt;. Idon&amp;rsquo;t care about performance issue or variable name changes or even Go itself. Ijust want a tool to build my static pages, using an old theme that I customizedto my liking. Anyway, since I no time to fix the Go code for the modifiedtemplate I use, let&amp;rsquo;s go back to the previous release (0.54 has SHA&lt;code&gt;6c0c7919de42ee5d629d3a9786fb111f4498dab3&lt;/code&gt;) and pin it for good!&lt;code&gt;shellbrew uninstall hugobrew install https://bit.ly/2UxujU1brew pin hugo&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-12&lt;/a&gt;: &lt;a href="http://www.composingprograms.com"&gt;Composing Programs&lt;/a&gt; and &lt;a href="http://www.labri.fr/perso/nrougier/from-python-to-numpy/"&gt;From Python to Numpy&lt;/a&gt; are two of the most invaluableressources I know if you want to learn Python for real. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-13&lt;/a&gt;: 🎥 &lt;a href="https://en.wikipedia.org/wiki/The_Matrix_Revolutions"&gt;Matrix Revolutions&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-14&lt;/a&gt;: 🎥 &lt;a href="https://en.wikipedia.org/wiki/Highlander_(film)"&gt;Highlander&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-14&lt;/a&gt;: Week-end miscellanies&amp;hellip;&lt;figure&gt;&lt;img src="https://aliquote.org/img/IMG_0634.jpg"&gt;
&lt;/figure&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-15&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/album/solo/1011585685" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Fred Hersch, &lt;em&gt;Solo&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-15&lt;/a&gt;: I&amp;rsquo;m slowly, very slowly, updating the &lt;a href="https://aliquote.org/articles/stata-sk/"&gt;stata-sk&lt;/a&gt; project. on the one hand I am not in the best possible state of health, on the other hand my degree of motivation bought dramatically in recent weeks. I&amp;rsquo;m afraid it may have to end up in the garbage one day or the other.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-15&lt;/a&gt;: &lt;a href="https://twitter.com/CMastication/status/1117235956560662528"&gt;At&lt;/a&gt; &lt;a href="http://third-bit.com/2019/04/15/an-exchange-with-datacamp.html"&gt;this&lt;/a&gt; &lt;a href="https://twitter.com/noamross/status/1116667602741485571"&gt;point&lt;/a&gt; (order doesn&amp;rsquo;t matter, or I guess so), I wonder how this whole DC thing is going to end.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-17&lt;/a&gt;: I really like Yann Holtz&amp;rsquo;s teaching material, especially his &lt;a href="https://www.yan-holtz.com/teaching"&gt;Data analytics and visualization&lt;/a&gt; track. &lt;code&gt;#dataviz&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-17&lt;/a&gt;: The &lt;a href="https://docs.carpentries.org"&gt;Carpentries Handbook&lt;/a&gt; is live. Go check it if you&amp;rsquo;ve even been interested in teaching ressources.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-17&lt;/a&gt;: &lt;a href="https://github.com/Gastove/pythonathon"&gt;A whirlwind intro to Python&lt;/a&gt;: A very nice intro to Python, written using Org. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-18&lt;/a&gt;: 🎥 &lt;a href="https://www.imdb.com/title/tt1430132/"&gt;Wolverine&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-18&lt;/a&gt;: Very &lt;a href="https://algorithms-tour.stitchfix.com/#recommendation-systems"&gt;nice showcase&lt;/a&gt; by the Stitch team.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-18&lt;/a&gt;: With all DC teachers who have been out of business, we now have a plethora of nice tutorial comping up here and there. Here is one by Julia Silge on &lt;a href="https://github.com/juliasilge/deming2018"&gt;&amp;ldquo;tidy&amp;rdquo; text mining&lt;/a&gt;, and here is Ines Montani&amp;rsquo;s &lt;a href="https://github.com/ines/spacy-course"&gt;Advanced NLP course with spaCy&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt; &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-19&lt;/a&gt;: Looks like I just spend my full working day using VS code for Python coding again. It&amp;rsquo;s perfectly fine for building website (small codebase) or playing interactive script (&amp;lt; 200 LOC). Now, are there any better ways to integrate Jupyter notebooks than &lt;a href="https://code.visualstudio.com/docs/python/jupyter-support"&gt;this&lt;/a&gt;? &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-20&lt;/a&gt;: 🎥 &lt;a href="https://en.wikipedia.org/wiki/The_Bourne_Identity_(2002_film)"&gt;The Bourne Identity&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-20&lt;/a&gt;: 📖 Iegor Gran, &lt;em&gt;L&amp;rsquo;Écologie en bas de chez moi&lt;/em&gt; (P.O.L., 2011)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-20&lt;/a&gt;: Always nice to read Zachary Tellman&amp;rsquo;s code on &lt;a href="https://github.com/lacuna/bifurcan"&gt;impure functional data structures&lt;/a&gt;, even if Java is not my business.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-20&lt;/a&gt;: If you are looking to convert your Python notebook to a slide deck (and you like JS-based slideshow, of course), &lt;a href="https://damianavila.github.io/RISE/"&gt;RISE&lt;/a&gt; looks like a good option. There&amp;rsquo;s also a PDF backend. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-21&lt;/a&gt;: &amp;gt; Domain-specific languages are the ultimate abstractions. &amp;mdash; &lt;a href="https://felleisen.org/matthias/manifesto/sec_pl-pl.html"&gt;Paul Hudak&lt;/a&gt; (1998)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-21&lt;/a&gt;: I guess when you have some time to spare on a Sunday evening, you can just push a bunch of commits using the wrong &lt;code&gt;user &amp;lt;email&amp;gt;&lt;/code&gt; values (probably updated by SourceTree that I just relaunched for the first time two days ago), right? In this case, &lt;a href="https://help.github.com/en/articles/changing-author-info"&gt;this&lt;/a&gt; was very helpful. For fancier version, see &lt;a href="https://stackoverflow.com/q/3042437"&gt;How to change the commit author for one specific commit?&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-21&lt;/a&gt;: &lt;a href="https://www.cultureofinsight.com/blog/2018/01/25/2018-01-25-visualising-twitter-follower-overlap/"&gt;Visualising intersecting sets of twitter followers&lt;/a&gt;. &lt;code&gt;#dataviz&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-21&lt;/a&gt;: &lt;a href="https://hub.github.com"&gt;hub&lt;/a&gt; is &amp;ldquo;an extension to command-line git that helps you do everyday GitHub tasks without ever leaving the terminal.&amp;rdquo; I have a working copy, of course, but I don&amp;rsquo;t use it often &amp;ndash; StackOverflow to the rescue. Maybe it&amp;rsquo;s time to take a closer look&amp;hellip;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-22&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/album/in-conflict/814784669" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Owen Pallett, &lt;em&gt;In Conflict&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-22&lt;/a&gt;: The joy of deploying on Heroku, when everything works on the first try&amp;hellip;&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-04-22-21-39-36.png" alt=""&gt;&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-04-22-21-42-11.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-22&lt;/a&gt;: &lt;a href="https://www.fast.ai/2019/03/06/fastai-swift/"&gt;Embracing Swift for Deep Learning&lt;/a&gt;. &lt;code&gt;#swift&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-22&lt;/a&gt;: &lt;a href="https://epubs.siam.org/doi/10.1137/18M1183480"&gt;Why Are Big Data Matrices Approximately Low Rank?&lt;/a&gt;. (via &lt;a href="https://twitter.com/GCLinderman/status/1119564896486731778"&gt;@@GCLinderman&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-23&lt;/a&gt;: 🎥 &lt;a href="https://en.wikipedia.org/wiki/The_Bourne_Supremacy_(film)"&gt;The Bourne Supremacy&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-23&lt;/a&gt;: Guess who tried to customize &lt;a href="https://github.com/jimhester/lintr"&gt;lintr&lt;/a&gt; for more than 30 minutes with &lt;a href="https://github.com/vim-syntastic/syntastic"&gt;syntastic&lt;/a&gt; while the plugin was globally disabled and I am using &lt;a href="https://github.com/w0rp/ale"&gt;ale&lt;/a&gt; instead?&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-23&lt;/a&gt;: Just curious so I installed the &lt;a href="https://www.kaggle.com/sudalairajkumar/getting-started-with-python-datatable/notebook"&gt;datatable&lt;/a&gt; Python package. I&amp;rsquo;ve been very happy with R &lt;code&gt;data.table&lt;/code&gt; package so I hope it will not be too difficult to switch over Python. BTW, the &lt;a href="https://www.h2o.ai"&gt;h2o.ai&lt;/a&gt; team is doing great things for data science. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-23&lt;/a&gt;: Long time Emacs user here: I&amp;rsquo;ve been using VS Code and NeoVim for five days. I&amp;rsquo;m perfectly fine.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-23&lt;/a&gt;: &lt;a href="https://github.com/fhamborg/news-please"&gt;news-please&lt;/a&gt; &amp;ndash; an integrated web crawler and information extractor for news that just works. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-24&lt;/a&gt;: 🎥 &lt;a href="https://en.wikipedia.org/wiki/The_Bourne_Ultimatum_(film)"&gt;The Bourne Ultimatum&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-24&lt;/a&gt;: &lt;a href="http://webdam.inria.fr/Alice/"&gt;Foundations of Database&lt;/a&gt;. Didn&amp;rsquo;t know we had this from the INRIA team! (via &lt;a href="https://twitter.com/CompSciFact/status/1120860139093942272"&gt;@CompSciFact&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-25&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/album/the-out-of-towners/256852163" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Keith Jarrett Trio, &lt;em&gt;The Out-of-Towners&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-25&lt;/a&gt;: Since I&amp;rsquo;ve been using VS Code for a few days, this probably is a good read for tonight:- &lt;a href="https://devblogs.microsoft.com/python/python-in-visual-studio-code-april-2019-release/"&gt;Python in Visual Studio Code&lt;/a&gt;- &lt;a href="https://devblogs.microsoft.com/cppblog/clang-llvm-support-in-visual-studio/"&gt;Clang/LLVM Support in Visual Studio&lt;/a&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-25&lt;/a&gt;: &lt;a href="https://github.com/dotnet/mbmlbook"&gt;Sample code for the Model-Based Machine Learning book&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-26&lt;/a&gt;: 🎥 &lt;a href="https://en.wikipedia.org/wiki/What_Happened_to_Monday"&gt;Seven Sisters&lt;/a&gt;. Because I loved her role role as Lisbeth Salander (and because this one of the few films I&amp;rsquo;ve seen alone in the cinema).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-26&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/album/if-youre-feeling-sinister/516530926" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Belle and Sebastian, &lt;em&gt;If You&amp;rsquo;re Feeling Sinister&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-26&lt;/a&gt;: I may have already posted this: &lt;a href="https://www.dhruvonmath.com/2018/12/31/matrices/"&gt;Relearning Matrices as Linear Functions&lt;/a&gt;. If not, my bad, and here you are!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-26&lt;/a&gt;: While I loved using &lt;a href="http://nteract.io"&gt;nteract&lt;/a&gt;, and latter &lt;a href="https://atom.io/packages/hydrogen"&gt;hydrogen&lt;/a&gt; on Atom, I&amp;rsquo;m back to basic Jupyter notebook when I have to. I noticed that the interact team recently released &lt;a href="https://github.com/nteract/papermill"&gt;papermill&lt;/a&gt;, which can help parameterizing, executing, and analyzing Jupyter Notebooks. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-26&lt;/a&gt;: &lt;a href="https://www.textbook.ds100.org/ch/04/eda_intro.html"&gt;Principles and Techniques of Data Science&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-26&lt;/a&gt;: &lt;a href="https://gvwilson.github.io/tidynomicon/"&gt;The Tidynomicon&lt;/a&gt;, by Greg Wilson. Must-have ressource for those interested in switching to R, with a background in Python (or basically any scientific PL). &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-27&lt;/a&gt;: &lt;a href="https://stmorse.github.io/journal/tidyverse-style-pandas.html"&gt;Tidyverse pipes in Pandas&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-29&lt;/a&gt;: 🎥 &lt;a href="https://en.wikipedia.org/wiki/The_Bourne_Legacy_(film)"&gt;The Bourne Legacy&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-30&lt;/a&gt;: 🎥 &lt;a href="https://en.wikipedia.org/wiki/Jason_Bourne_(film)"&gt;Jason Bourne&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-30&lt;/a&gt;: &lt;a href="https://simplystatistics.org/2019/04/29/generative-and-analytical-models-for-data-analysis/"&gt;Generative and Analytical Models for Data Analysis&lt;/a&gt;. Nice read!&amp;gt; For both the generative model and the analytical model of data analysis, the missing ingredient was a clear definition of what made a data analysis successful.Also, be sure to check &lt;a href="https://www.nature.com/polopoly_fs/1.17412!/menu/main/topColumns/topLeftColumn/pdf/520612a.pdf"&gt;P values are just the tip of the iceberg&lt;/a&gt; (PDF).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-30&lt;/a&gt;: &lt;a href="https://arxiv.org/abs/1904.09847v1#"&gt;Spatial Population Genetics: It&amp;rsquo;s About Time&lt;/a&gt;. (via &lt;a href="https://twitter.com/strnr/status/1122855565686988800"&gt;@strnr&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-04-30&lt;/a&gt;: &lt;a href="https://sanctum.geek.nz/arabesque/vim-anti-patterns/"&gt;Vim anti-patterns&lt;/a&gt;, via &lt;a href="https://twitter.com/_wilfredh/status/1122987184389349376"&gt;@_wilfredh&lt;/a&gt;. &lt;code&gt;#vim&lt;/code&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>A bag of tweets / Apr 2019</title><link>https://aliquote.org/post/bag-of-tweets-109/</link><pubDate>Wed, 24 Apr 2019 21:14:37 +0200</pubDate><guid>https://aliquote.org/post/bag-of-tweets-109/</guid><description>&lt;p&gt;Here is the latest bag of tweets&lt;sup&gt;*&lt;/sup&gt;, which covers April 2019.&lt;/p&gt;
&lt;p&gt;(*) These are interesting news that I found on Twitter and that I archive periodically. Note that I have slightly updated reporting and fetching methods so that you will get between 80 and 120 of my most recent favorites from my Twitter account (&lt;code&gt;@even4void&lt;/code&gt;).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;2019-04-01 @newsycombinator: Show HN: Stop googling sed/Awk. BSED: a simple, SQL-like syntax for text editing &lt;a href="https://t.co/sfg0Rd7wLW"&gt;https://t.co/sfg0Rd7wLW&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-01 @newsycombinator: Git implemented in Rust &lt;a href="https://t.co/KEMZGcSitn"&gt;https://t.co/KEMZGcSitn&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-01 @AchimZeileis: @JorisMeys @jonaslindeloev Also note that there are nice unifying frameworks for both parametric and nonparametric tests - without regression. E.g. the #rstats pkg &amp;ldquo;coin&amp;rdquo; combines &lt;em&gt;transformations&lt;/em&gt;, &lt;em&gt;statistics&lt;/em&gt;, and null &lt;em&gt;distributions&lt;/em&gt; yielding a Lego box of tests: &lt;a href="https://t.co/0bdqL9a4Hr"&gt;https://t.co/0bdqL9a4Hr&lt;/a&gt; &lt;a href="https://t.co/qfb5yHcmHx"&gt;https://t.co/qfb5yHcmHx&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-01 @EikoFried: &amp;ldquo;Results suggest that early hypotheses about #depression candidate #genes were incorrect &amp;amp; that the large number of associations reported in the depression candidate gene literature are likely to be false positives&amp;rdquo;. BOOM 🔥🔥🔥 &lt;a href="https://t.co/95PA69Byr8"&gt;https://t.co/95PA69Byr8&lt;/a&gt; &lt;a href="https://t.co/K5kH6dGwZO"&gt;https://t.co/K5kH6dGwZO&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-01 @vsbuffalo: Was looking for a nice interval library in Python — bx-python a little too much for what I need, and pybedtools writes too many tempfiles to ship things off to bedtools, but I found interlaps by @brent_p. Quite a nice small alternative &lt;a href="https://t.co/kjScufkHs3"&gt;https://t.co/kjScufkHs3&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-02 @ProfCompMod: Much enjoyed first lecture this term on behalf of @EuropeanXFEL at University of Hamburg with a great interactive audience. All teaching materials are #OpenAccess &lt;a href="https://t.co/RSsdsyvnAr"&gt;https://t.co/RSsdsyvnAr&lt;/a&gt;, interactive textbook &lt;a href="https://t.co/yf0pJxE0UM"&gt;https://t.co/yf0pJxE0UM&lt;/a&gt; supported by @mybinderteam and @OpenDreamKit &lt;a href="https://t.co/35L7XuZaH6"&gt;https://t.co/35L7XuZaH6&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-02 @olebegemann: Swift AST explorer by @k_katsumi is a fantastic tool for understanding how the Swift compiler parses source code: &lt;a href="https://t.co/W4n1el2I3S"&gt;https://t.co/W4n1el2I3S&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-02 @moorejh: The mother of all USB hubs &lt;a href="https://t.co/wqfw2yS13B"&gt;https://t.co/wqfw2yS13B&lt;/a&gt; #usb #computing #technology &lt;a href="https://t.co/D0vio1bT0F"&gt;https://t.co/D0vio1bT0F&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-02 @_jgoertler: Our interactive article that explains visually how Gaussian processes work just went live at @distillpub. Here is the link: &lt;a href="https://t.co/sqGsNO1HCT"&gt;https://t.co/sqGsNO1HCT&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-02 @BrodieGaslam: Today my faith in my understanding of #rstats was briefly shaken. I was trying to illustrate the relatively well known limitations of double precision arithmetic&amp;hellip; 1/3 &lt;a href="https://t.co/yqUXPHo1np"&gt;https://t.co/yqUXPHo1np&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-03 @dataandme: 👩‍💻 CRAN? BioConductor? GitHub? Local? pak has you covered… 📦 &amp;ldquo;pak: A Fresh Approach to R Package Installation&amp;rdquo; @jimhester_ &amp;amp; @GaborCsardi &lt;a href="https://t.co/EzeMREdWCy"&gt;https://t.co/EzeMREdWCy&lt;/a&gt; #rstats &lt;a href="https://t.co/H2W862rPud"&gt;https://t.co/H2W862rPud&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-03 @hrbrmstr: Wicked Fast, Accurate Quantiles Using ‘t-Digests’ in #rstats with the {tdigest} Package &lt;a href="https://t.co/Gdbja8vZk1"&gt;https://t.co/Gdbja8vZk1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-03 @Heinonmatti: Almost didn&amp;rsquo;t read this thing by @AlxEtz because it had &amp;ldquo;omnibus&amp;rdquo; in the title, but glad I did because turns out it&amp;rsquo;s a word I need to know. Also, the post was kinda fun and (to me) less technical than it sounds :) &lt;a href="https://t.co/CLffyGxoOX"&gt;https://t.co/CLffyGxoOX&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-03 @lapcatsoftware: New blog post &amp;ldquo;Safari link tracking can no longer be disabled&amp;rdquo;: &lt;a href="https://t.co/e6bu7oXgjE"&gt;https://t.co/e6bu7oXgjE&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-04 @dendibakh: I wrote an article showing how one can measure precise timing (in cycles) for basic blocks in the program using Linux Perf. &lt;a href="https://t.co/VmlqcsuKSg"&gt;https://t.co/VmlqcsuKSg&lt;/a&gt; #perf #performance #LBR #CPU &lt;a href="https://t.co/eNmcFkDpeh"&gt;https://t.co/eNmcFkDpeh&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-04 @BrodieGaslam: I&amp;rsquo;ve gotten completely side-tracked by precision issues in #rstats, and in this rabbit hole I realized that the precision improvement algorithm in &lt;code&gt;base::mean&lt;/code&gt; is susceptible to pathological inputs. In particular, inputs ordered by value are bad. &lt;a href="https://t.co/i3YMgtP5xp"&gt;https://t.co/i3YMgtP5xp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-04 @kaz_yos: Random (formerly Virtual Laboratories in Probability and Statistics) is a website devoted to probability, mathematical statistics, and stochastic processes, and is intended for teachers and students of these subjects. Many of the elements are designed so &lt;a href="https://t.co/51Rqros2s0"&gt;https://t.co/51Rqros2s0&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-04 @kaz_yos: Welcome to Simul Version control for Microsoft Word A superior alternative to sending Word documents back and forth via email and trying to track changes. We help you understand your document versions and enable more productive collaboration. &lt;a href="https://t.co/OZ2B6lDfzD"&gt;https://t.co/OZ2B6lDfzD&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-04 @sol_prog: &lt;a href="https://t.co/qJ4tgXrrZZ"&gt;https://t.co/qJ4tgXrrZZ&lt;/a&gt; works really well for C and C++ remote development&lt;/li&gt;
&lt;li&gt;2019-04-04 @kaz_yos: &amp;ldquo;How to estimate the effect of treatment duration on survival outcomes using observational data&amp;rdquo; Clone &amp;amp; Censor approach to compare treatment strategies that can only be determined over time after baseline. &lt;a href="https://t.co/ZSNOu5tduf"&gt;https://t.co/ZSNOu5tduf&lt;/a&gt; &lt;a href="https://t.co/YQaLCplXGd"&gt;https://t.co/YQaLCplXGd&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-04 @cpsievert: 🎉A first draft of my new book, &amp;ldquo;Interactive web-based data visualization with R, plotly, and shiny&amp;rdquo;, is now available! 🎉 &lt;a href="https://t.co/rCsZgwIo2d"&gt;https://t.co/rCsZgwIo2d&lt;/a&gt; For those of you familiar with the plotly book, there is a ton of new content, feedback welcome! &lt;a href="https://t.co/TmS8Tk2Wjn"&gt;https://t.co/TmS8Tk2Wjn&lt;/a&gt; &lt;a href="https://t.co/1e9hWFsAlU"&gt;https://t.co/1e9hWFsAlU&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-04 @jashkenas: 🚨Cells in Observable notebooks are now downloadable🚨(and, as always, dynamic!) Data -&amp;gt; CSV, JSON SVG -&amp;gt; SVG, PNG Canvas -&amp;gt; PNG &lt;a href="https://t.co/axhXgfzn0Q"&gt;https://t.co/axhXgfzn0Q&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-04 @zepidpy: Tutorials for IPTW and some diagnostics &lt;a href="https://t.co/fpU1xKq9sx"&gt;https://t.co/fpU1xKq9sx&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-05 @pa_jachiet: Anonymisation : Histoire des définitions et méthodes, Illustrations sur les données de santé. Voici le support d&amp;rsquo;une présentation donnée hier à Etalab &lt;a href="https://t.co/I6o4bMyDyj"&gt;https://t.co/I6o4bMyDyj&lt;/a&gt; Grand merci à l&amp;rsquo;audience ! CC-by-SA et ouverte en commentaires. N&amp;rsquo;hésitez pas ! &lt;a href="https://t.co/K8nE0m8OKN"&gt;https://t.co/K8nE0m8OKN&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-05 @strnr: 93% of paint splatters are valid Perl programs 🤣 &lt;a href="https://t.co/KmPDskSqvm"&gt;https://t.co/KmPDskSqvm&lt;/a&gt; Paper: &lt;a href="https://t.co/Vw9V34BaqG"&gt;https://t.co/Vw9V34BaqG&lt;/a&gt; &lt;a href="https://t.co/CpOGly84X7"&gt;https://t.co/CpOGly84X7&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-05 @RainerJoswig: #lisp The latest CLISP from the Gitlab repository compiled under Ubuntu 18.04 on my brand new Nvidia Jetson nano 64bit ARM board without problems. CLISP was initially released 32 years ago.&lt;/li&gt;
&lt;li&gt;2019-04-05 @newsycombinator: Let’s Build a Simple Database (2017) &lt;a href="https://t.co/CU5YWxL5bJ"&gt;https://t.co/CU5YWxL5bJ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-05 @AllenDowney: Here&amp;rsquo;s FiveThirtyEight trying one more time to explain probabilistic prediction: &lt;a href="https://t.co/wFG81o4XtG"&gt;https://t.co/wFG81o4XtG&lt;/a&gt; I admire the effort, but Mr Silver has a hard time hiding his impatience with the rest of us.&lt;/li&gt;
&lt;li&gt;2019-04-05 @daforerog: Preparing next-generation scientists for biomedical big data: artificial intelligence approaches &lt;a href="https://t.co/SFTiM3z6hH"&gt;https://t.co/SFTiM3z6hH&lt;/a&gt; @moorejh&lt;/li&gt;
&lt;li&gt;2019-04-05 @strnr: #MachineLearning in Medicine &lt;a href="https://t.co/0XRaAWdTG1"&gt;https://t.co/0XRaAWdTG1&lt;/a&gt; &lt;a href="https://t.co/fb7GCLopop"&gt;https://t.co/fb7GCLopop&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-05 @biorxiv_bioinfo: A generalization of partial least squares regression and correspondence analysis for categorical and mixed data: An application with &amp;hellip; &lt;a href="https://t.co/5HCjhlB2k1"&gt;https://t.co/5HCjhlB2k1&lt;/a&gt; #biorxiv_bioinfo&lt;/li&gt;
&lt;li&gt;2019-04-05 @kara_woo: This story is out in the open now, so I guess I might as well say that the unnamed employee in the DataCamp post was me.&lt;/li&gt;
&lt;li&gt;2019-04-05 @dgkeyes: Friendly reminder that my Getting Started with R course is available for free. #rstats &lt;a href="https://t.co/ZdL5vEoQsR"&gt;https://t.co/ZdL5vEoQsR&lt;/a&gt; &lt;a href="https://t.co/yQjtYuuM2x"&gt;https://t.co/yQjtYuuM2x&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-05 @ledell: After &lt;em&gt;many months&lt;/em&gt; of collective negotiating by the instructor community to demand more transparency &amp;amp; accountability, they still did nothing. Their public announcement is a response to a letter we sent to @DataCamp one day prior, signed by over 100 DataCamp instructors. &lt;a href="https://t.co/9su0XCwuxV"&gt;https://t.co/9su0XCwuxV&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-06 @Jose_A_Alonso: Foundations of Data Science. ~ D. Wischik. &lt;a href="https://t.co/ikkDym5Kni"&gt;https://t.co/ikkDym5Kni&lt;/a&gt; #DataScience&lt;/li&gt;
&lt;li&gt;2019-04-06 @HNTweets: Eisvogel: A clean pandoc LaTeX template with a focus on computer science: &lt;a href="https://t.co/9cfZf0bqQC"&gt;https://t.co/9cfZf0bqQC&lt;/a&gt; Comments: &lt;a href="https://t.co/t8EG16AeqE"&gt;https://t.co/t8EG16AeqE&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-06 @MaartenvSmeden: @f2harrell @jim&lt;em&gt;savage&lt;/em&gt; @statsepi @stephensenn A tangent, also from @stephensenn: There is no reason to think that a drug that shows itself to be marginally effective in a general population is simply in want of an appropriate subpopulation in which it will perform spectacularly. &lt;a href="https://t.co/QInmgldAfL"&gt;https://t.co/QInmgldAfL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-06 @epenser: Youtube a-t-il abandonné ses créateurs de contenus ? Read: &lt;a href="https://t.co/tjB7qsfn2f"&gt;https://t.co/tjB7qsfn2f&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-06 @Atabey_Kaygun: New post: &amp;ldquo;K-Means Implemented in Clojure&amp;rdquo; &lt;a href="https://t.co/9wy9BargZe"&gt;https://t.co/9wy9BargZe&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-07 @hrbrmstr: A Limited-but-Functional Couchbase Free Text Search &amp;amp; Retrieval Un-package; or, “How I Abused Couchbase &amp;amp; R to Perform Bulk IP Whois Full-text Searches” (a Cobbler’s Tale) &lt;a href="https://t.co/DVtR5SZujF"&gt;https://t.co/DVtR5SZujF&lt;/a&gt; #rstats&lt;/li&gt;
&lt;li&gt;2019-04-07 @kaz_yos: Animation based on &amp;ldquo;What is the expectation maximization algorithm?&amp;rdquo; &lt;a href="https://t.co/xrF6H5DZbM"&gt;https://t.co/xrF6H5DZbM&lt;/a&gt; The analytically intractable bimodal incomplete-data likelihood is (locally) maximized by a series of tentative expected complete-data likelihoods. &lt;a href="https://t.co/a5pnfrZtwG"&gt;https://t.co/a5pnfrZtwG&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-07 @_ColinFay: 📓 Just added some content to the &amp;ldquo;Building Big Shiny Apps - A Workflow&amp;rdquo; online book, notably a chapter about using the {golem} package 🎉 &lt;a href="https://t.co/2Z5SZy6jXn"&gt;https://t.co/2Z5SZy6jXn&lt;/a&gt; It&amp;rsquo;s still a WIP but if you want to have a look, feel free :) Any feedback welcome! #RStats #RShiny &lt;a href="https://t.co/r2FV3c5ixh"&gt;https://t.co/r2FV3c5ixh&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-08 @newsycombinator: Please stop advertising VPNs as privacy and anonymity tools &lt;a href="https://t.co/fCz8xu0SbQ"&gt;https://t.co/fCz8xu0SbQ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-08 @TDataScience: Using Regular Expression in Genetics with Python &lt;a href="https://t.co/bUimGj2wOT"&gt;https://t.co/bUimGj2wOT&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-08 @strnr: Moving beyond P values: Everyday data analysis with estimation plots &lt;a href="https://t.co/uZg6VSiDGt"&gt;https://t.co/uZg6VSiDGt&lt;/a&gt; #Rstats package: &lt;a href="https://t.co/KWRu29dKF9"&gt;https://t.co/KWRu29dKF9&lt;/a&gt; Python package: &lt;a href="https://t.co/LwYBKDGjcO"&gt;https://t.co/LwYBKDGjcO&lt;/a&gt; Web: &lt;a href="https://t.co/2uKiHe2S0w"&gt;https://t.co/2uKiHe2S0w&lt;/a&gt; &lt;a href="https://t.co/iRc3o4Ngi3"&gt;https://t.co/iRc3o4Ngi3&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-08 @Harry_Stevens: I&amp;rsquo;m excited to introduce d3-regression, a JavaScript library that makes it easy to calculate statistical regressions! It does linear, quadratic, exponential, logarithmic, power law, and LOESS regressions. Introduction and tutorial: &lt;a href="https://t.co/x8gCwXZrRV"&gt;https://t.co/x8gCwXZrRV&lt;/a&gt; &lt;a href="https://t.co/p3NsAOoqek"&gt;https://t.co/p3NsAOoqek&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-08 @strnr: Reverse GWAS: Using genetics to identify and model phenotypic subtypes &lt;a href="https://t.co/WvseurjdPO"&gt;https://t.co/WvseurjdPO&lt;/a&gt; &lt;a href="https://t.co/SjwSU4QjtI"&gt;https://t.co/SjwSU4QjtI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-08 @f2harrell: The burden of demonstrating heterogeneity of treatment effect is on HTE proponents, and an example where a personalized efficacy estimate is worse than the overall average. New blog article: &lt;a href="https://t.co/CPSdywPbqd"&gt;https://t.co/CPSdywPbqd&lt;/a&gt; #StatThink&lt;/li&gt;
&lt;li&gt;2019-04-08 @vsbuffalo: Nested containment lists are quite a bit faster than interval trees for range overlap operations. Not quite fair as I&amp;rsquo;m comparing a Python implementation to a Cython one, but dropping in NCLS (&lt;a href="https://t.co/PVZDqz2voA"&gt;https://t.co/PVZDqz2voA&lt;/a&gt;) lead to a ~30 fold speed up. Paper: &lt;a href="https://t.co/3Fx9lgBxtT"&gt;https://t.co/3Fx9lgBxtT&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-08 @kaz_yos: How efficient is Stan compared to JAGS? A small test - Publicity - “To satisfy my own curiosity, I’ve been doing some comparisons of Stan and JAGS in terms of sampling efficiency (second per effective draw) for some simple hierarchical models. &lt;a href="https://t.co/m0w6m9f7oR"&gt;https://t.co/m0w6m9f7oR&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-09 @newsycombinator: Mathematics and Computation [pdf] &lt;a href="https://t.co/fKrBmjlKOp"&gt;https://t.co/fKrBmjlKOp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-09 @thorstenball: I wrote a blog post about why I think it&amp;rsquo;s important to learn new programming languages. Yes, even if you don&amp;rsquo;t end up using them in production or at work. 👉 https://t.co/KpyoMhsk2t&lt;/li&gt;
&lt;li&gt;2019-04-09 @AntoineAugusti: How people working for the French government produce, publish and contribute to open source code?👩‍💻 I analysed all commits made on @GitHub since 2015 by people using a @*.gouv.fr email address. Discover the procedure and the results 📊👉 &lt;a href="https://t.co/QlLpMsRLvh"&gt;https://t.co/QlLpMsRLvh&lt;/a&gt; &lt;a href="https://t.co/WNv1V1qjw1"&gt;https://t.co/WNv1V1qjw1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-09 @strnr: Consequences of PCA graphs, SNP codings, and PCA variants for elucidating population structure &lt;a href="https://t.co/lPHoRmn70T"&gt;https://t.co/lPHoRmn70T&lt;/a&gt; &lt;a href="https://t.co/sOKXRyTetH"&gt;https://t.co/sOKXRyTetH&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-09 @joshua_ulrich: @CMastication Tell them to do: git config &amp;ndash;global branch.autosetuprebase always It will save them from making a ton of confusing merge commits on master.&lt;/li&gt;
&lt;li&gt;2019-04-09 @strnr: Rethinking phylogenetic comparative methods &lt;a href="https://t.co/hXLITCVIzC"&gt;https://t.co/hXLITCVIzC&lt;/a&gt; &lt;a href="https://t.co/pqNoknAg3Z"&gt;https://t.co/pqNoknAg3Z&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-09 @kaz_yos: Algorithms for weighted maximum likelihood parameter estimation - Cross Validated &lt;a href="https://t.co/XxsqsuBVNp"&gt;https://t.co/XxsqsuBVNp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-09 @jlopezper: Can anyone suggest a good introductory book of Bayesian Statistics with #rstats?&lt;/li&gt;
&lt;li&gt;2019-04-09 @rafalab: Had Fisher suggested 0.005, instead of 0.05, as the arbitrary p-value cutoff to reject a null hypothesis, back in 1925, how would the world be different today?&lt;/li&gt;
&lt;li&gt;2019-04-10 @UnixToolTip: Org-mode markup deserves to be adopted beyond Emacs &lt;a href="https://t.co/08SgDN7Ldt"&gt;https://t.co/08SgDN7Ldt&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-10 @fermatslibrary: Here&amp;rsquo;s a design in case you want to build an Irrational Numbers Wall Clock &lt;a href="https://t.co/hi7kU0hexK"&gt;https://t.co/hi7kU0hexK&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-10 @dataandme: 🙌 Really nice side-by-side for dplyr &amp;amp; #rdatatable syntax… &amp;ldquo;A data.table and dplyr tour&amp;rdquo; by atrebas &lt;a href="https://t.co/dT3cCBKD4G"&gt;https://t.co/dT3cCBKD4G&lt;/a&gt; #rstats &lt;a href="https://t.co/X1uje6N2rR"&gt;https://t.co/X1uje6N2rR&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-10 @CompSciFact: Summary of some of the math used in computer science &lt;a href="https://t.co/TzPNk5WCdc"&gt;https://t.co/TzPNk5WCdc&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-11 @sauer_sebastian: Learnt about this project yesterday at #RUserNürnberg. Great stuff ahead! &lt;a href="https://t.co/gYp6c1PShh"&gt;https://t.co/gYp6c1PShh&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-11 @janhove: New blog post: &amp;ldquo;Before worrying about model assumptions, think about model relevance&amp;rdquo; &lt;a href="https://t.co/qBvsk2J3Zv"&gt;https://t.co/qBvsk2J3Zv&lt;/a&gt; &lt;a href="https://t.co/kzC4yTUkh0"&gt;https://t.co/kzC4yTUkh0&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-11 @kaz_yos: &amp;quot; Recently Morris, White and Crowther published an excellent paper in Statistics in Medicine, freely available here, on how to plan and run simulation studies. The paper contains a wealth of useful guidance and advice on how to run simulation studies&amp;quot; &lt;a href="https://t.co/EoSKdLT9d9"&gt;https://t.co/EoSKdLT9d9&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-11 @vsbuffalo: Stumbled on this great article, &amp;ldquo;Ten Simple Rules for Better Figures&amp;rdquo; (&lt;a href="https://t.co/tTtZQYqkNg)"&gt;https://t.co/tTtZQYqkNg)&lt;/a&gt;. The first author, Nicolas Rougier, also created what is by far best numpy intro (&lt;a href="https://t.co/DOkz5IUZXU"&gt;https://t.co/DOkz5IUZXU&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;2019-04-11 @freakonometrics: &amp;ldquo;Econometrics and Machine Learning&amp;rdquo; &lt;a href="https://t.co/2eacUcxwCU"&gt;https://t.co/2eacUcxwCU&lt;/a&gt; (is finally out)&lt;/li&gt;
&lt;li&gt;2019-04-12 @ben_j_lindsay: Wow, the performance metrics look really impressive! Definitely need to try this out some time &lt;a href="https://t.co/QS3X4JbwZq"&gt;https://t.co/QS3X4JbwZq&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-12 @captainsafia: Sometimes when switching to a branch to continue working on something, I like to see what files I was last editing so I can pick up from there. This command lists the changed files in the most recent commit. $ git show &amp;ndash;name-only $(git rev-parse HEAD)&lt;/li&gt;
&lt;li&gt;2019-04-12 @ametaireau: Si comme moi vous utilisez le site (plein de pubs) &lt;a href="https://t.co/n8V529UjFV"&gt;https://t.co/n8V529UjFV&lt;/a&gt; pour avoir des infos sur les entreprises, il existe une alternative bien plus sympa : &lt;a href="https://t.co/PkKKii8qoN"&gt;https://t.co/PkKKii8qoN&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-12 @sol_prog: @capnramses I&amp;rsquo;ve used &lt;a href="https://t.co/qJ4tgXrrZZ"&gt;https://t.co/qJ4tgXrrZZ&lt;/a&gt; a few days ago. You basically install a modified version of vscode on your server (no need for X or other GUI support) and you connect to it through your browser. I was able to install the C and C++ extension from MS and debug with gdb.&lt;/li&gt;
&lt;li&gt;2019-04-12 @noamross: Please don&amp;rsquo;t take or pay for my @DataCamp course. The company let its executive off the hook for sexual misconduct. We can&amp;rsquo;t change behavior without incentives, and for companies those incentives are financial. &lt;a href="https://t.co/UlTFXdoI6B"&gt;https://t.co/UlTFXdoI6B&lt;/a&gt; #python #rstats #datascience #MeToo&lt;/li&gt;
&lt;li&gt;2019-04-12 @NadiehBremer: Making a #dataviz for both desktop and mobile doesn&amp;rsquo;t mean that the only two options you have are &amp;ldquo;scaling down&amp;rdquo; and &amp;ldquo;stacking vertically&amp;rdquo; → You can also change layout by positioning the data differently. There&amp;rsquo;s more overlap in code between these two than you might expect. &lt;a href="https://t.co/1BaSVgXrBl"&gt;https://t.co/1BaSVgXrBl&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-12 @hrbrmstr: I thought I&amp;rsquo;d write a quick post to help @noamross so he cld use #rstats vs icky browser tools to look at site meta tags &amp;amp; headers. I def like helping Noam. More links to it will also help it get to the top of Google searches to help others, too. #protip &lt;a href="https://t.co/pvf9va3caD"&gt;https://t.co/pvf9va3caD&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-13 @RainerJoswig: #scheme #lisp The Bibliography of Scheme-related Research &lt;a href="https://t.co/W6WbFM8ML6"&gt;https://t.co/W6WbFM8ML6&lt;/a&gt; as a domain/site is gone. Content is now here: &lt;a href="https://t.co/eZ5y2KR0ph"&gt;https://t.co/eZ5y2KR0ph&lt;/a&gt; Thanks to Reddit user amirouche!&lt;/li&gt;
&lt;li&gt;2019-04-13 @kaz_yos: Bayesian and Modern Statistics Course material for STA 360/601 Instructor: Jeff Miller Spring 2015, Duke University Department of Statistical Science &lt;a href="https://t.co/ALNhLqx2d5"&gt;https://t.co/ALNhLqx2d5&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-13 @zenrhino: VS Code isn&amp;rsquo;t my favorite non-R Studio editor (Vim FTMFW), but this is pretty awesome. &lt;a href="https://t.co/dzxxhDmRJu"&gt;https://t.co/dzxxhDmRJu&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-13 @etiennejcb: #generative &lt;a href="https://t.co/UwtMkvAK6V"&gt;https://t.co/UwtMkvAK6V&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-13 @FarRider: rtemis - A great new package for advanced machine learning and visualization in R. &lt;a href="https://t.co/rYAMo8V91b"&gt;https://t.co/rYAMo8V91b&lt;/a&gt; #DataScience #MachineLearning #rstats&lt;/li&gt;
&lt;li&gt;2019-04-13 @jbowayles: no matter how often i have to reach for python, usually to learn something new, i cannot help but slide right on over to #JuliaLang. This time probabilistic programming&amp;hellip; PyMC3 -&amp;gt; Turing.jl (&lt;a href="https://t.co/MFcQbQkWPE"&gt;https://t.co/MFcQbQkWPE&lt;/a&gt;) and Soss (&lt;a href="https://t.co/Abi5945leU"&gt;https://t.co/Abi5945leU&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;2019-04-13 @etiennejcb: Here is an online random mandala generator (with source code written in p5.js). &lt;a href="https://t.co/7rDLfuGsaW"&gt;https://t.co/7rDLfuGsaW&lt;/a&gt; Inspired by a formula used by @ozachou_g . Click to draw a new one, press key to save. (doesn&amp;rsquo;t always work)&lt;/li&gt;
&lt;li&gt;2019-04-13 @Ladicle: @egrefen @orgmode_bot You can use posframe to display the pop-up candidates. Also, the awesome icons are inserted using all-the-icons. &lt;a href="https://t.co/9R4SwohWXv"&gt;https://t.co/9R4SwohWXv&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-14 @CMastication: Being an asshole has consequences @datacamp &amp;hellip; people just won’t play with you any more once they figure out you’re mean and play dirty and hide your apology. You had a chance to fix this and you doubled down on being a jerk. You’re going to be a @HarvardBiz case study one day. &lt;a href="https://t.co/gYckfDo4If"&gt;https://t.co/gYckfDo4If&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-14 @rstudio: Just something pretty made with R by Antonio Sánchez, @aschinchon. More at &lt;a href="https://t.co/17C0ozBlc1"&gt;https://t.co/17C0ozBlc1&lt;/a&gt; &lt;a href="https://t.co/sZgDfT9BDV"&gt;https://t.co/sZgDfT9BDV&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-14 @Jose_A_Alonso: A primer on scientific programming with Python. ~ Hans Petter Langtangen. &lt;a href="https://t.co/Y6wLevWAMb"&gt;https://t.co/Y6wLevWAMb&lt;/a&gt; #eBook #Python #Programming&lt;/li&gt;
&lt;li&gt;2019-04-14 @newsycombinator: Quantum Algorithm Zoo &lt;a href="https://t.co/eTBmpCbRxx"&gt;https://t.co/eTBmpCbRxx&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-14 @introspection: “I never had a baseline sense of myself.” — The bitter pill 💊 by ⁦the @NewYorker⁩, beautiful article on pharmacology &amp;amp; psychiatric treatments cc ⁦@vaughanbell⁩ ⁦@caimadja⁩ &lt;a href="https://t.co/csVkpHGw7b"&gt;https://t.co/csVkpHGw7b&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-14 @0xAX: A Simple Guide to Containerization and How Docker Works - &lt;a href="https://t.co/bVrJCfLFPJ"&gt;https://t.co/bVrJCfLFPJ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-14 @gappy3000: Is there a text akin to Feynman&amp;rsquo;s Lectures on Physics, but for Mathematics? Submit your entries.&lt;/li&gt;
&lt;li&gt;2019-04-14 @AllenDowney: Think Stats in Clojure. Time for me to learn a new language? &lt;a href="https://t.co/eI8ufQKWuL"&gt;https://t.co/eI8ufQKWuL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-15 @matloff: #rstats for YOU: We oft hear that vectorized ops are faster because they run at C-level, not R. What does this actually mean? Say we have x &amp;lt;- y within a loop. 1/n&lt;/li&gt;
&lt;li&gt;2019-04-15 @R_Graph_Gallery: I just taught a 2 days course on #dataviz with #rstat. I share the course material in case it can help somebody: &lt;a href="https://t.co/eEVe9yGd2Y"&gt;https://t.co/eEVe9yGd2Y&lt;/a&gt; Included: DataViz intro &amp;amp; caveats, ggplot2, R Markdown, and Github intro &lt;a href="https://t.co/WyGKZZhoCP"&gt;https://t.co/WyGKZZhoCP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-15 @thorstenball: Holy crap, I struck gold! Look at this: &lt;a href="https://t.co/b8O895DPiS"&gt;https://t.co/b8O895DPiS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-15 @thorstenball: This is really cool. I wish every language would have this, because it&amp;rsquo;s usually one of the hardest things to find: &lt;a href="https://t.co/htlfSztPBR"&gt;https://t.co/htlfSztPBR&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-15 @gvwilson: An Exchange With DataCamp: &lt;a href="https://t.co/JS2T6OQcKQ"&gt;https://t.co/JS2T6OQcKQ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-15 @jonaslindeloev: The R syntax for mixed models, &amp;ldquo;y ~ 1 + a*b + (1|id)&amp;rdquo;, has two origins. The fixed part is Wilkinson notation from 1973: &lt;a href="https://t.co/GWbYGAStWX"&gt;https://t.co/GWbYGAStWX&lt;/a&gt;. The random part was introduced in the nlme package in the late 90s: &lt;a href="https://t.co/BDiIoW2Khm"&gt;https://t.co/BDiIoW2Khm&lt;/a&gt;. It doesn&amp;rsquo;t have a name. 1/5&lt;/li&gt;
&lt;li&gt;2019-04-15 @amuellerml: In case you want to play around with dabl, I uploaded a notebook that allows you to explore several OpenML datasets, including some classical UCI datasets and some larger more recent datasets: &lt;a href="https://t.co/DhMDihvyXT"&gt;https://t.co/DhMDihvyXT&lt;/a&gt; At least the plotting functionality seems usable now.&lt;/li&gt;
&lt;li&gt;2019-04-15 @UnixToolTip: &amp;lsquo;Don&amp;rsquo;t ever, ever plan a backup strategy. Plan a restore strategy.&amp;rsquo; &amp;ndash; Paul Randal&lt;/li&gt;
&lt;li&gt;2019-04-15 @MarieDeclercq: Je vois beaucoup de photos tragiquement belles, mais celle-ci est particulière dingue. #NotreDame #Paris &lt;a href="https://t.co/zBesZgipBj"&gt;https://t.co/zBesZgipBj&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-15 @burntsushi5: ripgrep 11 is out! Featuring lots of bug fixes, better binary filtering UX and a hybrid regex engine mode! &lt;a href="https://t.co/KL5IIznx9I"&gt;https://t.co/KL5IIznx9I&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-16 @newsycombinator: Why software projects take longer than you think – a statistical model &lt;a href="https://t.co/eZL3h16ZT1"&gt;https://t.co/eZL3h16ZT1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-16 @EikoFried: Patrick Curran &amp;amp; Dan Bauer have made available 170+ pages of #rstats lavaan introductions. &lt;a href="https://t.co/td5jYG4rkh"&gt;https://t.co/td5jYG4rkh&lt;/a&gt; &lt;a href="https://t.co/9bZ2kK9OJ6"&gt;https://t.co/9bZ2kK9OJ6&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-16 @hrbrmstr: @ma_salmon @noamross I believe @rdrrHQ&amp;rsquo;s &lt;a href="https://t.co/gWtoAfiFgp"&gt;https://t.co/gWtoAfiFgp&lt;/a&gt; might be a viable alternative&lt;/li&gt;
&lt;li&gt;2019-04-16 @strnr: &lt;a href="https://t.co/BmcGBUQTY2"&gt;https://t.co/BmcGBUQTY2&lt;/a&gt;: Community curated #bioinformatics pipelines &lt;a href="https://t.co/9RVh0pwiSW"&gt;https://t.co/9RVh0pwiSW&lt;/a&gt; &lt;a href="https://t.co/e3sKxt9qvP"&gt;https://t.co/e3sKxt9qvP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-16 @biorxiv_bioinfo: Benchmarking of alignment-free sequence comparison methods &lt;a href="https://t.co/SlV8Wig1SJ"&gt;https://t.co/SlV8Wig1SJ&lt;/a&gt; #biorxiv_bioinfo&lt;/li&gt;
&lt;li&gt;2019-04-16 @noamross: @cbahlai This paper: &lt;a href="https://t.co/zCU4j77GkP"&gt;https://t.co/zCU4j77GkP&lt;/a&gt; (should be out this week, I think?), with @ericJpedersen, @millerdl, and @ucfagls, all of whom I first met on Twitter, has its origin in this stackexchange Q of mine: &lt;a href="https://t.co/OIh9KJoOJ8"&gt;https://t.co/OIh9KJoOJ8&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-16 @juliasilge: NEW POST: Writing a letter to DataCamp #MeTooSTEM #MeToo #rstats #python &lt;a href="https://t.co/GELn0WrXAF"&gt;https://t.co/GELn0WrXAF&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-17 @Jose_A_Alonso: Basic Cheat Sheet for Python (PDF, Markdown and Jupyter Notebook). ~ Carlos Montecinos Geisse. &lt;a href="https://t.co/PBqYCariFg"&gt;https://t.co/PBqYCariFg&lt;/a&gt; #Python #Programming&lt;/li&gt;
&lt;li&gt;2019-04-17 @johnmyleswhite: It&amp;rsquo;s always striking how many R fans think Ross Ihaka is just totally offbase with his criticisms of R &amp;ndash; and how many seem to not even know who he is: &lt;a href="https://t.co/CWM83oKp8Z"&gt;https://t.co/CWM83oKp8Z&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-17 @_inesmontani: Like many of you, I&amp;rsquo;m incredibly disappointed by DataCamp. I wanted to make a free version of my spaCy course so you don&amp;rsquo;t have to sign up for their service – and ended up building my own interactive app. Powered by the awesome @mybinderteam &amp;amp; @gatsbyjs 💖 &lt;a href="https://t.co/2QOuDPoZEX"&gt;https://t.co/2QOuDPoZEX&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-17 @palewire: ICYMI: The @uscensusbureau is developing open-source standards for its future data visualizations. &lt;a href="https://t.co/vzVsTy94if"&gt;https://t.co/vzVsTy94if&lt;/a&gt; &lt;a href="https://t.co/Zc3X0o59kP"&gt;https://t.co/Zc3X0o59kP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-17 @StatStas: #TIL that #rstats actually have variable labels&amp;hellip; in the good old sense of label variable in Stata. &lt;a href="https://t.co/otu55PY2sj"&gt;https://t.co/otu55PY2sj&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-18 @carlcarrie: WIRED article outlines how mathematicians have discovered the fastest way to multiply large numbers&amp;hellip; &lt;a href="https://t.co/BTGe10tHOY"&gt;https://t.co/BTGe10tHOY&lt;/a&gt; | &amp;hellip;But, there yet may be another, even faster way&amp;hellip; &lt;a href="https://t.co/Efn9QdTt26"&gt;https://t.co/Efn9QdTt26&lt;/a&gt; #math &lt;a href="https://t.co/NwsinL8MWa"&gt;https://t.co/NwsinL8MWa&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-18 @gvanrossum: Cool hack! &lt;a href="https://t.co/EUIIT7DEBs"&gt;https://t.co/EUIIT7DEBs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-18 @carlcarrie: Good morning read: There are many reasons why econometrics fail to work in finance (eg p-hacking, machine-learning-disentanglement) - this short, non-quantitative presentation by AQR&amp;rsquo;s Marcos Lopez de Prado highlights why&amp;hellip; &lt;a href="https://t.co/QDiMjVasde"&gt;https://t.co/QDiMjVasde&lt;/a&gt; &lt;a href="https://t.co/o3MQkmbdP0"&gt;https://t.co/o3MQkmbdP0&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-18 @joshua_ulrich: Great post on the potential issues of manipulating R objects in C! I&amp;rsquo;m sure @eddelbuettel would point out that Rcpp handles most (all?) of this for you (assuming you stick to it&amp;rsquo;s API and don&amp;rsquo;t call the R API directly). #rstats #Rcpp &lt;a href="https://t.co/Pp3T5LLrtH"&gt;https://t.co/Pp3T5LLrtH&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-18 @strnr: Write to stdout using readr&amp;rsquo;s format_csv() &lt;a href="https://t.co/idcWa18OvZ"&gt;https://t.co/idcWa18OvZ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-18 @aphyr: I just can&amp;rsquo;t say enough good things about @ztellman&amp;rsquo;s libraries. Bifurcan turned out to have a fast, stackless implementation of the cycle-detection algorithm @meatcomputer and I have been struggling to write for a month. &lt;a href="https://t.co/tqhAC4YtcX"&gt;https://t.co/tqhAC4YtcX&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-18 @bodil: Well, I wrote a very long article about parser combinators in Rust. &lt;a href="https://t.co/J5EivlyQ22"&gt;https://t.co/J5EivlyQ22&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-19 @tslumley: In which I now have two estimators for linear mixed models in survey data &lt;a href="https://t.co/SvjUq14KmB"&gt;https://t.co/SvjUq14KmB&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-19 @ogrisel: Nice thread that explains how a French law of 2016 allows any publicly funded (50% or more) research to be uploaded on online archives irrespective of limitations set by a contract with the journal editor (not retroactive and after a cool-down period of 6 or 12 months). &lt;a href="https://t.co/SGB5NMOwOZ"&gt;https://t.co/SGB5NMOwOZ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-19 @dumindu_nuwan: &lt;a href="https://t.co/dok6HjHnjz"&gt;https://t.co/dok6HjHnjz&lt;/a&gt; got its 400th⭐ today. Have many things in my mind to improve @rustlang learning process. But, still I have to spend more time on practicing Go with my current job, even on weekends. Quite sad, because I missed RustCon Asia at this moment. #rustlang #rust &lt;a href="https://t.co/310iSBSTQ5"&gt;https://t.co/310iSBSTQ5&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-19 @f2harrell: The fact that only 1/5th of #MachineLearning clinical prediction applications cared enough to attempt to estimate a calibration curve is striking. &lt;a href="https://t.co/oRP98Yzwkg"&gt;https://t.co/oRP98Yzwkg&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-19 @hadleywickham: Have you been trying the exercises in Advanced R? If so, you might like to know about the solutions manual by @malte_grosser and @henningsway: &lt;a href="https://t.co/KwIYm5XVhM"&gt;https://t.co/KwIYm5XVhM&lt;/a&gt;. They&amp;rsquo;re getting ready to publish it, so now is great time to give feedback! #rstats &lt;a href="https://t.co/3y5ubbTgi7"&gt;https://t.co/3y5ubbTgi7&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-19 @SolomonKurz: The update to &amp;ldquo;Statistical Rethinking with brms, ggplot2, and the tidyverse&amp;rdquo; is live &lt;a href="https://t.co/alBJXHKIrf"&gt;https://t.co/alBJXHKIrf&lt;/a&gt;! Some of the major changes include: Refitting all models with #brms 2.8.0 Adopting the seed argument in all brm() models Updated workflow for the WAIC and LOO 1/n&lt;/li&gt;
&lt;li&gt;2019-04-19 @nikitonsky: I’m a programmer, I build an adapter when I need one &lt;a href="https://t.co/EsemmZaio2"&gt;https://t.co/EsemmZaio2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-19 @CRANPolicyWatch: New CRAN Repository Policy rev4040 posted, history at &lt;a href="https://t.co/0wpgNcMUui"&gt;https://t.co/0wpgNcMUui&lt;/a&gt; #rstats&lt;/li&gt;
&lt;li&gt;2019-04-19 @chris__martin: answered a python SO question, my answer was a = chain([1, 2], repeat(3)) and the accepted answer was def inf3(): yield 1 yield 2 while True: yield 3 a = inf3() sigh I&amp;rsquo;ll never understand python people&lt;/li&gt;
&lt;li&gt;2019-04-19 @borkdude: Clojure&amp;rsquo;s new killer &amp;ldquo;app&amp;rdquo;? &lt;a href="https://t.co/pm24uiq8VK"&gt;https://t.co/pm24uiq8VK&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-19 @joelgrus: This solution is extremely clever, and I&amp;rsquo;d totally forgotten about it: &lt;a href="https://t.co/teB0kBgteA"&gt;https://t.co/teB0kBgteA&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-19 @CMastication: I’ve got 3 2011 Mac Minis I want to turn into basically web browsers for less technical family members. Apple has end-of-lifed these things, so no patches &amp;amp; such. I’d like to turn them into “chrome books” &amp;hellip; is cloudready the best option? &lt;a href="https://t.co/8wQnyIvose"&gt;https://t.co/8wQnyIvose&lt;/a&gt; Other ideas?&lt;/li&gt;
&lt;li&gt;2019-04-20 @mxsage: iannis xenakis / natasha barrett / elysia crampton 🎵 &lt;a href="https://t.co/8swCc5mgwg"&gt;https://t.co/8swCc5mgwg&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-20 @HNTweets: Why Joy Division? Henry Rollins examines Jon Savage’s oral history of the band: &lt;a href="https://t.co/XZUnVAQB3K"&gt;https://t.co/XZUnVAQB3K&lt;/a&gt; Comments: &lt;a href="https://t.co/0AcQfC2V5L"&gt;https://t.co/0AcQfC2V5L&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-20 @jedisct1: RT @jpmens: &amp;ldquo;Storing HD photos in a relational database: recipe for an epic fail&amp;rdquo; &lt;a href="https://t.co/QZqIdcOGPJ"&gt;https://t.co/QZqIdcOGPJ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-20 @GCLinderman: For even the most complex datasets derived from highly non-linear processes, PCA/SVD is remarkably effective. This paper attempts to explain this by showing that many matrices can be approximated by a low-rank matrix, even if they are full-rank themselves. &lt;a href="https://t.co/9zyq33pLwI"&gt;https://t.co/9zyq33pLwI&lt;/a&gt; &lt;a href="https://t.co/h5gcQU2hkv"&gt;https://t.co/h5gcQU2hkv&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-20 @FrancescoC: It is with great sadness that I share news of Joe Armstrong&amp;rsquo;s passing away earlier today. Whilst he may no longer be with us, his work has laid the foundation which will be used by generations to come. RIP @joeerl, thank you for inspiring us all.&lt;/li&gt;
&lt;li&gt;2019-04-20 @newsycombinator: Joe Armstrong: The Mess We’re In &lt;a href="https://t.co/5Y2NviU8c3"&gt;https://t.co/5Y2NviU8c3&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-20 @newsycombinator: Canvas-sketch – A framework for making generative artwork &lt;a href="https://t.co/njkGyIfjzt"&gt;https://t.co/njkGyIfjzt&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-20 @bodil: And those are my top Joe moments. Now excuse me, I&amp;rsquo;m going to have an Erlang: the Movie marathon in his memory. Here&amp;rsquo;s the extended director&amp;rsquo;s cut with the Bjarne bit intact (it was cut out of the most popular version because Bjarne isn&amp;rsquo;t really funny): &lt;a href="https://t.co/3k8mA0k7mv"&gt;https://t.co/3k8mA0k7mv&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-20 @strangeloop_stl: Joe Armstrong, @stephen_wolfram - City Museum, Strange Loop 2014 #rememberingjoe &lt;a href="https://t.co/uQ8OXRmwik"&gt;https://t.co/uQ8OXRmwik&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-21 @tslumley: I wrote a thing (and some code) about handling &amp;lsquo;plausible values&amp;rsquo; in surveys &lt;a href="https://t.co/sP4GEbZPWN"&gt;https://t.co/sP4GEbZPWN&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-21 @davywtf: I put a webcam in a favicon you&amp;rsquo;re welcome Demo: &lt;a href="https://t.co/AR0U1Hztu2"&gt;https://t.co/AR0U1Hztu2&lt;/a&gt; &lt;a href="https://t.co/zt1xnfqcfC"&gt;https://t.co/zt1xnfqcfC&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-21 @Jose_A_Alonso: A working mathematician’s guide to parsing. ~ Jeremy Kun (@jeremyjkun) | Math ∩ Programming &lt;a href="https://t.co/ZKaKxx0xAr"&gt;https://t.co/ZKaKxx0xAr&lt;/a&gt; #Programming #LaTeX&lt;/li&gt;
&lt;li&gt;2019-04-21 @JuliaPirdzaska: « Aimer, c&amp;rsquo;est agir. » est le dernier mot écrit à la main par Victor Hugo trois jours avant sa mort. &lt;a href="https://t.co/ArC6M1YnX9"&gt;https://t.co/ArC6M1YnX9&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-21 @sharon000: Useful tips on how to spiff up an R Markdown document. #rstats by @R_Graph_Gallery &lt;a href="https://t.co/CPdAJHA3NH"&gt;https://t.co/CPdAJHA3NH&lt;/a&gt; &lt;a href="https://t.co/yDOBggCxQa"&gt;https://t.co/yDOBggCxQa&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-21 @danilobzdok: @f2harrell @xamat @TheWagRocks @DataSciFact On an alternative account, we argued that it is futile to put each analysis tool into a &amp;lsquo;classical statistics&amp;rsquo; bucket or a &amp;lsquo;machine learning&amp;rsquo; bucket. Instead, we advocate that modeling approaches are more usefully distinguished by the analysis goal! &lt;a href="https://t.co/48Ygb405fJ"&gt;https://t.co/48Ygb405fJ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-21 @CompSciFact: Joe Armstrong on hw to become a good programmer &lt;a href="https://t.co/98MIPcIjpn"&gt;https://t.co/98MIPcIjpn&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-21 @jlouis666: &lt;a href="https://t.co/yFTcTTKZe9"&gt;https://t.co/yFTcTTKZe9&lt;/a&gt; {&amp;lsquo;EXIT&amp;rsquo;, joe, goodbye}.&lt;/li&gt;
&lt;li&gt;2019-04-21 @nedbat: Want italics in iTerm2? It’s more complicated than it should be, but this works: &lt;a href="https://t.co/8me6tk0KyY"&gt;https://t.co/8me6tk0KyY&lt;/a&gt; with Monaco italics: &lt;a href="https://t.co/IV73dQ1rcy"&gt;https://t.co/IV73dQ1rcy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-21 @statsepi: Evaluating a logistic regression based prediction tool in R &lt;a href="https://t.co/IXIXOGVeaW"&gt;https://t.co/IXIXOGVeaW&lt;/a&gt; Going ahead and posting this so I can start finding the errors. Shout out to @MaartenvSmeden for guidance.&lt;/li&gt;
&lt;li&gt;2019-04-21 @newsycombinator: Embracing Swift for Deep Learning &lt;a href="https://t.co/uOjYRYH9ee"&gt;https://t.co/uOjYRYH9ee&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-22 @MuinJKhoury: Again and again, because of new genomic findings, we keep debating population vs high risk approaches to disease prevention. We need both. As Goeffrey Rose once wrote, “the two approaches are not usually in competition.” &lt;a href="https://t.co/Y6YoIqpAde"&gt;https://t.co/Y6YoIqpAde&lt;/a&gt; &lt;a href="https://t.co/qgkAIG4d02"&gt;https://t.co/qgkAIG4d02&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-22 @Atabey_Kaygun: Here is the github link for the code and data: &lt;a href="https://t.co/618fsAGH26"&gt;https://t.co/618fsAGH26&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-22 @moorejh: How Many Genes Do Cells Need? Maybe Almost All of Them &lt;a href="https://t.co/xDAUildCXR"&gt;https://t.co/xDAUildCXR&lt;/a&gt; #genomics #genetics &lt;a href="https://t.co/55n08Zn3zX"&gt;https://t.co/55n08Zn3zX&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-22 @f2harrell: @davecurtis314 @skathire @jflier @matthewherper @cecilejanssens @ATorkamani @cardiobrief @VPrasadMDMPH @DrMJoyner @EricTopol @stephensenn @mandl @ewanbirney @uk_biobank @VUMChealth And if anyone has a copy of that paper I&amp;rsquo;ll critique it unbiasedly. And everyone tempted to use BMI should review this: &lt;a href="https://t.co/dL93f5M1Md"&gt;https://t.co/dL93f5M1Md&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-22 @hadleywickham: The R graphics cookbook is a great way to improve your visualisation skills, and it&amp;rsquo;s now available online on for free! #rstats &lt;a href="https://t.co/4a0oKkzYSy"&gt;https://t.co/4a0oKkzYSy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-23 @Harry_Stevens: d3-regression can now do polynomial regressions! Beware of overfitting with those higher-degree polynomials (they&amp;rsquo;re also liable to kill your browser!). &lt;a href="https://t.co/1mC6llZwRm"&gt;https://t.co/1mC6llZwRm&lt;/a&gt; #d3js #stats #dataviz &lt;a href="https://t.co/8c6xuS8Kby"&gt;https://t.co/8c6xuS8Kby&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-23 @newsycombinator: A book to learn R and Python in parallel for Data Science &lt;a href="https://t.co/V17fqGtPI9"&gt;https://t.co/V17fqGtPI9&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-23 @ledell: Did you know that there&amp;rsquo;s now a #Python version of the infamous #rstats data.table package? 📦 R data.table creator, @MattDowle, teamed with @h2oai colleague @pstetsenko to create Py @datatable. @sudalairajkumar has a @kaggle notebook to get you started: &lt;a href="https://t.co/fXbCCR85af"&gt;https://t.co/fXbCCR85af&lt;/a&gt; &lt;a href="https://t.co/dvmpQlsp1S"&gt;https://t.co/dvmpQlsp1S&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-23 @newsycombinator: OpenShot – Open-Source Video Editor &lt;a href="https://t.co/GKkCfyiW8v"&gt;https://t.co/GKkCfyiW8v&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-23 @twiecki: Bambi (hierarchical GLMs with friendly syntax like bmrs with a #PyMC3 backend) has an updated website: &lt;a href="https://t.co/MRFmr6YtGS"&gt;https://t.co/MRFmr6YtGS&lt;/a&gt; By @talyarkoni&lt;/li&gt;
&lt;li&gt;2019-04-23 @olebegemann: TIL you can use dynamicCallable in Swift as a hacky syntax for creating stringly typed dictionaries without quotes and square brackets. The argument labels become the dictionary’s keys. 🤣 h/t @tony_allevato &lt;a href="https://t.co/8aRemT5spR"&gt;https://t.co/8aRemT5spR&lt;/a&gt; &lt;a href="https://t.co/h49OFqmSUY"&gt;https://t.co/h49OFqmSUY&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-23 @kaz_yos: Don&amp;rsquo;t Calculate Post-hoc Power Using Observed Estimate of Effect Size. - PubMed - NCBI &lt;a href="https://t.co/fhhKuqWVqe"&gt;https://t.co/fhhKuqWVqe&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-23 @JohnDCook: &amp;ldquo;I&amp;rsquo;m a professional, and a software developer, but not a professional software developer.&amp;rdquo; &lt;a href="https://t.co/jihxA9F7IT"&gt;https://t.co/jihxA9F7IT&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-23 @climagic: sudo strace -p 1205 # See syscalls of PID 1205. Processes don&amp;rsquo;t have to be a black box, you can use strace (on Linux) to view the system calls made by a process, which may give some clue as to why it&amp;rsquo;s misbehaving, where it is saving a file, etc.&lt;/li&gt;
&lt;li&gt;2019-04-23 @joelgrus: This is the most terrifying ML application I&amp;rsquo;ve seen in a while: &lt;a href="https://t.co/M047AVDLh9"&gt;https://t.co/M047AVDLh9&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-23 @lapply: explor 0.3.5 (#rstats package for interactive exploration of PCA, CA and MCA results) is now on CRAN, with leader lines and automatic placement for labels, and MCA biplots : &lt;a href="https://t.co/u9goVweE1r"&gt;https://t.co/u9goVweE1r&lt;/a&gt; &lt;a href="https://t.co/uchW0GjCD4"&gt;https://t.co/uchW0GjCD4&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-23 @conjugateprior: Make your python function a command line application by annotation using click: &lt;a href="https://t.co/zOuV0kpDjZ"&gt;https://t.co/zOuV0kpDjZ&lt;/a&gt; There&amp;rsquo;s named arguments, default values, &amp;ndash;help, confirmations, and everything.&lt;/li&gt;
&lt;li&gt;2019-04-24 @CompSciFact: Foundations of Databases &lt;a href="https://t.co/C2745Xf34X"&gt;https://t.co/C2745Xf34X&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-24 @michael_chirico: #rstats Hot off the presses &amp;ndash; compressed fwrite directly to gz 🎉 Much thanks to @phchataignon for the PR to implement one of the most requested {data.table} features!! Please give it a go and do report if you hit any issues 🤖 &lt;a href="https://t.co/BVdzbzcY83"&gt;https://t.co/BVdzbzcY83&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-24 @joshua_ulrich: Another interesting and thoughtful thread from @matloff. Follow him to add pragmatic and balanced content to your daily #rstats consumption &lt;a href="https://t.co/udWFRtMty4"&gt;https://t.co/udWFRtMty4&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-24 @newsycombinator: Python in Visual Studio Code – April 2019 Release &lt;a href="https://t.co/yy56PeOnKf"&gt;https://t.co/yy56PeOnKf&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-04-24 @freakonometrics: &amp;ldquo;Scant Evidence of Power Laws Found in Real-World Networks&amp;rdquo; &lt;a href="https://t.co/gsqaOIVYEj"&gt;https://t.co/gsqaOIVYEj&lt;/a&gt; &lt;a href="https://t.co/kOiD3YY3i4"&gt;https://t.co/kOiD3YY3i4&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Visual Statistics – Use R!</title><link>https://aliquote.org/post/visual-statistics-use-r/</link><pubDate>Fri, 12 Apr 2019 19:30:13 +0200</pubDate><guid>https://aliquote.org/post/visual-statistics-use-r/</guid><description>&lt;p&gt;&amp;ldquo;Let&amp;rsquo;s not kid ourselves, the most widely used piece of software for statistics is Excel&amp;rdquo; (Brian Ripley). Now I believe that even biologists could learn R for good using this neat textbook written by Alexey Shipunov: &lt;a href="http://ashipunov.info/shipunov/software/r/r-en.htm"&gt;Visual Statistics&amp;ndash;User R!&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;This textbook is the kind of &amp;ldquo;statistic without math&amp;rdquo; but with R.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;As the author announces at the beginning of this book, it is not about statistical modeling or advanced concepts like the use of pre-specified contrasts in complex analysis of variance, nor about more specialized techniques like those found in survival analysis, spatial statistics or psychometrics. However, this textbook focus on learning R, where the motto is try things out for yourself, and with some little gems like this one:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-04-01-21-35-06.png"&gt;
&lt;/figure&gt;
&lt;p&gt;Likewise, there is is this nice take away message, early in chapter 1, when trying to decipher what &lt;code&gt;log10(((sqrt(sum(c(2, 2))))^2)*2.5)&lt;/code&gt; could possibly produce as a result: &amp;ldquo;R expressions are in some way similar to Russian doll, or to onion, or to &lt;em&gt;artichoke&lt;/em&gt;, and to analyze them, one should peel it (emphasis is mine).&amp;rdquo;&lt;/p&gt;
&lt;p&gt;I spent a good time reading this book as it reminded me of old school R (at least, the way I learned it). You learn how to load file using plain old &lt;code&gt;read.table&lt;/code&gt; instructions, &lt;code&gt;stack&lt;/code&gt; data frame, and to save your work using &lt;code&gt;sink&lt;/code&gt;. Who use &lt;code&gt;sink&lt;/code&gt; or &lt;code&gt;capture&lt;/code&gt; nowadays? I even learn some new stuff, like the fact that &lt;code&gt;abline(line(x, y))&lt;/code&gt; will plot a Tukey median-median &amp;ldquo;robust&amp;rdquo; line (I struggle to find why since nothing like this is mentioned in the online help for &lt;code&gt;abline&lt;/code&gt; until I realized I read &lt;code&gt;lines&lt;/code&gt; instead of &lt;code&gt;line&lt;/code&gt;), or the &lt;a href="https://cran.r-project.org/web/packages/effsize/index.html"&gt;effsize&lt;/a&gt; package which provides effect size measure for nonparametric tests. The author also makes heavy use of base graphics (as &lt;a href="https://xcelab.net/rm/"&gt;Richard McElreath&lt;/a&gt; does in his book &lt;em&gt;Statistical Rethinking&lt;/em&gt;), with a bit of &lt;code&gt;lattice&lt;/code&gt;, which is nice since it allows to get some fresh air, away from &lt;code&gt;ggplot2&lt;/code&gt;, which still remain one of the most useful package to be added to the recommended ones. While talking about visual statistics, I also learned about &lt;a href="https://rdrr.io/cran/shipunov/man/Pleiad.html"&gt;correlation pleiads&lt;/a&gt;, which are used to summarize a correlation matrix in a circular display. I know a lot of ways to display a correlation matrix, or special case thereof, as in &lt;a href="https://www.rdocumentation.org/packages/psy/versions/1.1/topics/fpca"&gt;focused PCA&lt;/a&gt;, but the following one is really nice:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-04-12-19-14-40.png"&gt;
&lt;/figure&gt;
&lt;p&gt;See also this PDF article if you want to learn more about the &lt;a href="http://dreyfus.ib.usp.br/bio208/static/pdfs/artigos/Berg-1960.pdf"&gt;ecological significance of correlation pleaides&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Part II of the book was the most interesting for me since it deals with multivariate analysis, including PCA and multidimensional scaling, correspondence analysis, and clustering. The last chapter is about supervised learning, and even if it consists in just a short overview of available methods and the rationale for using any of them, it remains quite interesting after all the material discussed in the preceding chapter.&lt;/p&gt;
&lt;p&gt;Not sure I really agree with the recommendation on which model to choose (§9.8)&amp;ndash;try them all!&amp;ndash;since I&amp;rsquo;m highly biased in favor of Frank Harrell&amp;rsquo;s approach to statistical modeling, but let that not stop you reading the whole textbook. I was also a bit surprised to see no mention of RStudio in place of default R applications, especially on Windows. I am not sure that &amp;ldquo;the data are &amp;lsquo;parametric&amp;rsquo;&amp;rdquo; means anything in mathematical statistics since parameterization relates to distribution, not data &lt;em&gt;per se&lt;/em&gt;. But these are minor issues, of course, given the quality of the presentation. I have always been a firm believer of the empirical approach to learning statistics, and I still think that understanding and analyzing data is better than understanding the mathematical properties of the underlying models. In that sense I would have really liked to start learning R with such a book on hand.&lt;/p&gt;</description></item><item><title>Not so random links from April</title><link>https://aliquote.org/post/not-so-random-links/</link><pubDate>Fri, 12 Apr 2019 11:48:33 +0200</pubDate><guid>https://aliquote.org/post/not-so-random-links/</guid><description>&lt;p&gt;Some not so random links &amp;mdash; not posted on Twitter, nor on the Micro section.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Alex Hayes has a nice &lt;a href="https://github.com/alexpghayes/over-it"&gt;GH repository&lt;/a&gt; covering basic cheatsheet for one- and tow-sample hypothesis tests, along with a very brief introduction to the principle of statistical testing.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.math.ias.edu/files/Website03-25-19.pdf"&gt;Mathematics and Computation&lt;/a&gt;, written by Avi Wigderson (PDF, 338 pp.), covers mathematical modeling and computational complexity theory with a special emphasis on randomness, proof and hardness.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.data-to-viz.com"&gt;From Data to Viz&lt;/a&gt; is a great ressource to find relevant statistical graphics, and their implementation in R, Python or D3. I especially like the way the authors designed the homepage. The visual taxonomy of graphical display is just splendid!&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; ![](/img/2019-04-12-11-58-38.png)
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.crcpress.com/go/bayesian_analysis_a_crc_press_freebook"&gt;Bayesian Analysis: A CRC Press FreeBook&lt;/a&gt;. Be sure to grab your copy of you haven&amp;rsquo;t done before. The book is 200-page long and includes six chapters from independent textbooks (from CRC Press of course): prior distributions, Markov Chain Monte Carlo, specifying bayesian models, hierarchical linear models, nonparametric models, and model criticism and selection.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Since my &lt;a href="https://aliquote.org/post/vscode-python/"&gt;last incursion&lt;/a&gt; into VS Code, I&amp;rsquo;ve been looking around and I found this &lt;a href="https://vscodecandothat.com"&gt;website&lt;/a&gt;, where one can learn some tips and tricks about VS Code. I am sure there are better sites for collecting resources on VS Code, especially on Github, but in case you like short live coding videos, here you are.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Sander Greenland has a nice article in the BMJ on &lt;a href="https://www.bmj.com/content/352/bmj.i1981"&gt;Sparse data bias: a problem hiding in plain sight&lt;/a&gt;. Basically, the authors recommend the use of penalized regression models to account for low event per variable situations, which are common in epidemiological studies.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I spent a good time reading the latest entry on Manuel Uberti&amp;rsquo;s weblog: &lt;a href="http://manuel-uberti.github.io//real-life/2019/04/10/digital-minimalism/"&gt;Digital minimalism&lt;/a&gt;. I spent a good part of my time last year cleaning up my digital activities and limiting my involvement in social networks (and even social activities of any kind). Not sure if it helped being more productive, since I am not interested in this kind of metric, but it let me at least free time off for reading books and listening to music.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://software-tools-in-javascript.github.io/js-vs-ds/en/"&gt;JavaScript versus Data Science&lt;/a&gt; is an online preview of the (probably) forthcoming &lt;em&gt;JavaScript for Scientists and Engineers&lt;/em&gt;, by &lt;a href="http://third-bit.com"&gt;Greg Wilson&lt;/a&gt; and Toby Hodges. Don&amp;rsquo;t miss Greg Wilson&amp;rsquo;s last paper, &lt;a href="https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1006915"&gt;Ten quick tips for creating an effective lesson&lt;/a&gt; (see also Martin Fowler&amp;rsquo;s take on &lt;a href="https://martinfowler.com/bliki/VisualChannel.html"&gt;designing slides&lt;/a&gt;).&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;gt; Webfonts were great when most computers only had a handful of good fonts pre-installed. Thanks to font creation and buying by Apple, Microsoft, Google, and other folks, most computers have good — no, great — fonts installed, and they're a great option if you want to not load a separate font. --- [System Font Stack](https://systemfontstack.com)
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The Emacs &lt;a href="https://github.com/larstvei/Focus/"&gt;Focus package&lt;/a&gt; allows to dim the text of surrounding sections when writing prose. I think it would be a good addition to Spacemacs stack of editing tools. Speaking of Emacs, here is a &lt;a href="https://blog.jft.rocks/emacs/emacs-from-scratch.html"&gt;lightweight setup&lt;/a&gt; that provides a nice UI to our preferred text editor.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>VS Code and Python</title><link>https://aliquote.org/post/vscode-python/</link><pubDate>Mon, 08 Apr 2019 18:40:53 +0200</pubDate><guid>https://aliquote.org/post/vscode-python/</guid><description>&lt;p&gt;I tried &lt;a href="https://code.visualstudio.com"&gt;VS Code&lt;/a&gt; during a few days for Python development. It looks like folks at Microsoft did a really great job at integrating so nicely Python into this IDE, which itself has greatly improved over time.&lt;/p&gt;
&lt;p&gt;What&amp;rsquo;s up with Emacs or Spacemacs? I have been using the LSP mode for dealing with projects. It works effectively, but I sometimes find it not as responsive as I would like it. Not that I am working on big projects mot of the day, quite the opposite (a few dozens of files generally), but depending on MELPA updates, I&amp;rsquo;m facing unstable or unresponsive behavior from time to time. So I decided on Thursady to give another try to VS Code, after having stopped using Atom a few months ago. That we need 800 Mo of RAM for a text editor in idle mode is a lot more than I can tolerate for my MacBook; plus there&amp;rsquo;s no way to get a terminal for real, and I think I have gone through all &lt;a href="https://github.com/bodil/ohai-atom"&gt;Bodil Stoke&lt;/a&gt;&amp;rsquo;s proposals before I realized that configuring an editor using JS is just a crazy thing. Still, I love the design and look&amp;rsquo;n feel of Atom, and I miss the &lt;a href="https://atom.io/packages/hydrogen"&gt;Hydrogen&lt;/a&gt; package.&lt;/p&gt;
&lt;p&gt;This is not the first time I try VS Code. Last one was two years ago, after I watched one of &lt;a href="https://swizec.com/blog/vscode-better-editor-emacs/swizec/7921"&gt;Swizec Teller&lt;/a&gt;&amp;rsquo;s live code, but at that time it looks to me that it was still in early infancy, more focused on Node/JS devs and that there was not such attractive support for C or Python. The only component that was really baffling to me was the integration of Git. Those little markers in the left margin were kind of a beauty, especially given the fact they were also interactive. Surely we can have those pretty markers in the Emacs gutter, but it is more appealing visually in VS Code, and you get access to revert/commit of any chunk in a few clicks. There are other packages to deal with Git history or interacting with Github, but if you are only interested in tracking changes as you type, this is the best software add-on I ever found in an editor.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-04-08-18-57-43.png"&gt;
&lt;/figure&gt;
&lt;p&gt;If you are happy with working using plain text Python files, I believe that the MS &lt;a href="https://marketplace.visualstudio.com/itemdetails?itemName=ms-python.python"&gt;python package&lt;/a&gt; is a great choice. You don&amp;rsquo;t even need to install Anaconda&amp;ndash;I&amp;rsquo;m using the latest homebrewed version of Python on my Mac, and it is works right out of the box. There&amp;rsquo;s a beginning of support for working with Jupyter notebook as well, but nothing close to what was available in &lt;a href="https://atom.io/packages/hydrogen"&gt;Hydrogen&lt;/a&gt; under Atom. The autocomplete and intellisense features are gorgeous; You also get refactoring and linting for free. The built-in support for automatic indentation is good, although I managed to get into a situation where VS code was lost following an extra space in front of a &lt;code&gt;def&lt;/code&gt; statement. Anyway, this is a really good package, which comes quite handy to navigate quickly between definitions and references, or access documentation on the fly. Just over a method and you get a nicely formatted popup window with all the details. Here&amp;rsquo;s a little preview to give you an idea:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-04-08-19-03-24.png"&gt;
&lt;/figure&gt;
&lt;p&gt;As of today, I remain certain that it is impossible to switch my daily work entirely to VS Code, and I&amp;rsquo;m quite mitigated about the future of this editor since the integration of external projects remain &lt;a href="https://code.visualstudio.com/api/extension-capabilities/overview#no-dom-access"&gt;subject to the capacities&lt;/a&gt; offered by VS Code itself. It also lacks support for Org mode (the &lt;a href="https://vscode-org-mode.github.io/vscode-org-mode/"&gt;existing package&lt;/a&gt; only provides syntax highlighting plus a few commands related to org-todo items, but nothing close to &lt;a href="https://github.com/jkitchin/org-ref"&gt;org-ref&lt;/a&gt; or &lt;a href="https://orgmode.org/worg/org-contrib/babel/"&gt;babel&lt;/a&gt;), and I don&amp;rsquo;t feel comfortable at all editing Markdown text. I remember I had the same feeling the first time I tried VS Code. The &lt;a href="https://marketplace.visualstudio.com/items?itemName=kylebarron.stata-enhanced"&gt;Stata package&lt;/a&gt; is quite good, but the R package is far less capable than &lt;a href="https://ess.r-project.org"&gt;ESS&lt;/a&gt; under Emacs. Moreover, the lack of consistent keyboard shortcuts for sending line or selection to the integrated Terminal in R or Python (or the Stata GUI when using Stata package) is a real shame. I miss the default keybindings of Emacs, and its flexibility to remap any command to any combination of shortcuts or chords. Note that it seems that it is possible to define custom &lt;a href="https://www.emacswiki.org/emacs/KeyChord"&gt;key chords&lt;/a&gt; in VS Code.&lt;/p&gt;
&lt;p&gt;Another critical aspect of VS Code is the fact that it is project-oriented, meaning that it is hard to work on multiple files if they are not all in the same folder (note that the definition of a project goes beyond a git-based folder). On the one hand, this is good practice since it forces you to work on only one project at a time; on the other hand, it becomes hard to open another file for quick fix or to add a short note, unless you are willing to have many VSC editors opened on your desktop. Anyway, let&amp;rsquo;s see how it goes with my Python projects as a backup solution. What&amp;rsquo;s for sure is that sooner or later I&amp;rsquo;ll come back to Emacs full-time for writing Python code, and I&amp;rsquo;m not about to leave Emacs for good, if only for the org and &lt;a href="https://github.com/greghendershott/racket-mode"&gt;racket&lt;/a&gt; modes, as well as &lt;a href="https://masteringemacs.org/article/complete-guide-mastering-eshell"&gt;Eshell&lt;/a&gt; and &lt;a href="https://magit.vc"&gt;Magit&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Stata plot of the week #3</title><link>https://aliquote.org/post/stata-plot-03/</link><pubDate>Sun, 31 Mar 2019 19:25:28 +0100</pubDate><guid>https://aliquote.org/post/stata-plot-03/</guid><description>&lt;p&gt;Interaction charts are quite useful to assess the direction and magnitude of an interaction effect in the context of an analysis of variance. Here is one way to build an interaction plot in Stata, using built-in commands only.&lt;/p&gt;
&lt;p&gt;The data we will be using come from Montgomery&amp;rsquo;s Design of Experiments: This is basically a $3^2$ factorial design where we study the effect of temperature (°F) and a design parameter with three possible choices. The aim is to design a battery for use in a device subjected to extreme variations of temperature. I struggled to build an interaction plot for these data while writting my &lt;a href="https://aliquote.org/articles/stata-sk/"&gt;Stata tutorials&lt;/a&gt; lately, so I thought it would be a good idea to summarize how I came to a working solution.&lt;/p&gt;
&lt;p&gt;Here are the &lt;a href="https://aliquote.org/pub/battery.txt"&gt;data&lt;/a&gt; that we can load into Stata using the folllowing instruction:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;import&lt;/span&gt; &lt;span class="n"&gt;delimited&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;battery.txt&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;delimiter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;collapse&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;varnames&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;list&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;A two-way ANOVA table can be built using &lt;code&gt;anova&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;. anova life temperature##material
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Number of obs = 36 R-squared = 0.7652
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Root MSE = 25.9849 Adj R-squared = 0.6956
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Source | Partial SS df MS F Prob &amp;gt; F
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ---------------------|----------------------------------------------------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Model | 59416.2222 8 7427.02778 11.00 0.0000
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; |
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; temperature | 39118.7222 2 19559.3611 28.97 0.0000
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; material | 10683.7222 2 5341.86111 7.91 0.0020
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; temperature#material | 9613.77778 4 2403.44444 3.56 0.0186
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; |
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Residual | 18230.75 27 675.212963
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ---------------------|----------------------------------------------------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Total | 77646.9722 35 2218.48492
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Of course, &lt;code&gt;marginsplot&lt;/code&gt; will solve our problem directly, but let&amp;rsquo;s look at a manual solution. I know that there is &lt;code&gt;anovaplot&lt;/code&gt; or even the built-in &lt;a href="https://www.stata.com/manuals13/rserrbar.pdf"&gt;serrbar&lt;/a&gt; command. However, let&amp;rsquo;s first create summary statistics for our dataset:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;preserve
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;collapse (mean) mean=life (sd) sd=life, by(material temperature)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now, we could use &lt;code&gt;twoway line&lt;/code&gt; instructions using an &lt;code&gt;if&lt;/code&gt; qualifier to subset data according to, say, &lt;code&gt;material&lt;/code&gt; levels and draw an overlaid scatter plot of means across &lt;code&gt;temperature&lt;/code&gt; levels. But let us reshape the data first, after we discarded the previously generated &lt;code&gt;sd&lt;/code&gt; variable since we can only reshape one response variable at a time:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;drop sd
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;reshape wide mean, i(temperature) j(material)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;twoway connected mean* temperature, legend(label(1 &amp;#34;#1&amp;#34;) label(2 &amp;#34;#2&amp;#34;) label(3 &amp;#34;#3&amp;#34;)) ytitle(Mean life) scheme(plotplain)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/stata-plot-007.png"&gt;
&lt;/figure&gt;
&lt;p&gt;This misses the error bars, though, but I can imagine that adding &amp;ldquo;low&amp;rdquo; and &amp;ldquo;high&amp;rdquo; values to the current aggregated table and then overlaying the current graph with grouped &lt;code&gt;twoway rcap&lt;/code&gt; could be one solution. Again, this is quite overkill since the marvelous &lt;code&gt;margins&lt;/code&gt; command will handle all that for us:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;restore
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;margins temperature#material
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;marginsplot
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/stata-plot-008.png"&gt;
&lt;/figure&gt;</description></item><item><title>Micro-posting in March</title><link>https://aliquote.org/post/micro-03-2019/</link><pubDate>Sun, 31 Mar 2019 14:39:12 +0200</pubDate><guid>https://aliquote.org/post/micro-03-2019/</guid><description>&lt;p&gt;Quick recap&amp;rsquo; of March on the Micro blog.&lt;/p&gt;
&lt;p&gt;&lt;a href="#" style="text-decoration: none;"&gt;2019-03-04&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/playlist/ecm/pl.5a9326f0f5da47059b21850add4d145b" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   ECM.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-05&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/album/no-no-no/997318492" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Beirut, &lt;em&gt;No No No&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-05&lt;/a&gt;: As I am using Postgresql a lot these days, I thought I would import a large CSVfile (1 Go) to see if I can play with in-database tools from &lt;a href="https://db.rstudio.com/dplyr/"&gt;dplyr &amp;amp; Co&lt;/a&gt;. I willprobably need this for work so it&amp;rsquo;s worth the effort. I started with a Statafile that I read using &lt;a href="https://haven.tidyverse.org"&gt;haven&lt;/a&gt;, and I converted it to a CSV using&lt;code&gt;data.table::fwrite&lt;/code&gt;. This already eated up all my RAM. Now, I&amp;rsquo;m using &lt;a href="https://csvkit.readthedocs.io/"&gt;csvkit&lt;/a&gt; toimport the CSV file into a Postgresql local database. Well, it says a lot aboutthe process:&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-03-05-14-34-55.png"&gt;
&lt;/figure&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-05&lt;/a&gt;: I guess I just found &lt;a href="http://www.johnborwick.com/2019/02/23/org-todo-setup.html"&gt;another org-powered user&lt;/a&gt;! &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-05&lt;/a&gt;: I haven&amp;rsquo;t written a single line of Latex in a long time, but it looks like wenow get &lt;a href="https://fontawesome.com"&gt;Font Awesome&lt;/a&gt; for free in our TeX distribution. (via &lt;a href="https://twitter.com/kaz%5Fyos/status/1102663844722368512"&gt;@kaz_yos&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-05&lt;/a&gt;: It&amp;rsquo;s astonishing how much work has been done regarding working with databaseusing R. We now have &lt;a href="https://db.rstudio.com/dbplot/"&gt;dbplot&lt;/a&gt; and &lt;a href="https://github.com/edgararuiz/modeldb"&gt;modeldb&lt;/a&gt; (not to be confused with &lt;a href="https://github.com/mitdbg/modeldb"&gt;this one&lt;/a&gt;). (via&lt;a href="https://twitter.com/theotheredgar/status/1102574034993274880"&gt;@theotheredgar&lt;/a&gt;) &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-05&lt;/a&gt;: Just added to my Papers list: &lt;a href="https://link.springer.com/article/10.1007%2Fs11222-019-09860-6"&gt;Mean and median bias reduction in generalizedlinear models&lt;/a&gt;. See also the &lt;a href="https://cran.r-project.org/package=brglm2"&gt;brglm2&lt;/a&gt; R package. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-05&lt;/a&gt;: &lt;a href="https://github.com/stephencelis/syn/blob/master/README.markdown"&gt;syn&lt;/a&gt; uses OS X&amp;rsquo;s natural language processing tools to tokenize and highlighttext. Nice utility to add to my writing stack. It is used by Emacs&lt;a href="https://github.com/istib/wordsmith-mode"&gt;wordsmith-mode&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-06&lt;/a&gt;: Better than &lt;code&gt;time&lt;/code&gt;? &lt;a href="https://github.com/paypal/gnomon"&gt;gnomon&lt;/a&gt; is a command line utility to prepend timestampinformation to the standard output of another command.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-06&lt;/a&gt;: &lt;a href="http://www.johnborwick.com/2019/02/21/doing-work-as-it-shows-up.html"&gt;Doing work as it shows up&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-06&lt;/a&gt;: &lt;a href="https://wiseodd.github.io/techblog/2018/03/14/natural-gradient/"&gt;Natural Gradient Descent&lt;/a&gt;. Be sure to check the &lt;a href="https://wiseodd.github.io/techblog/"&gt;rest of the site&lt;/a&gt;. I just added itto my RSS reader.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-06&lt;/a&gt;: &lt;a href="http://cachestocaches.com/2016/12/vim-within-emacs-anecdotal-guide/"&gt;Vim within Emacs&lt;/a&gt;: A very good read even if you&amp;rsquo;re not versed into &lt;a href="http://spacemacs.org"&gt;Spacemacs&lt;/a&gt;.&lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-07&lt;/a&gt;: Clearly, I&amp;rsquo;m not that active in the early afternoon. Either because of the lunchbreak or the half-life of my medication&amp;hellip; Anyway, &lt;a href="https://timingapp.com"&gt;Timing&lt;/a&gt; is the best timetracking app I&amp;rsquo;ve seen in a while.&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-03-07-20-08-50.png"&gt;
&lt;/figure&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-07&lt;/a&gt;: I&amp;rsquo;m in my third year with the &lt;a href="https://en.wikipedia.org/wiki/MacBook%5F(2015%E2%80%93present)"&gt;12-inch Macbook&lt;/a&gt; (generously offered by SB). It iscertainly the best laptop I got in 13 years. Sometimes I feel like I miss thetiny pulsing light (aka sleep indicator) that we used to have on older metallicaluminum body ones. Well, we have backlit keyboard now, even if it is like abutterfly keyboard ;-)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-07&lt;/a&gt;: Nice. I spent some time checking Dimitri Fontaine&amp;rsquo;s Github repo, in particularhis &lt;a href="https://github.com/dimitri/AdventOfCode"&gt;advent of code&lt;/a&gt; in Common Lisp. I am currently reading &lt;a href="https://masteringpostgresql.com"&gt;his book&lt;/a&gt; onPostgreSQL, but I couldn&amp;rsquo;t resist reading some Lisp code after lunch.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-07&lt;/a&gt;: So it seems that we will be done with &lt;a href="https://en.wikipedia.org/wiki/The%5FExpanse%5F(TV%5Fseries)"&gt;The Expanse&lt;/a&gt;, Season 1, tonight.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-07&lt;/a&gt;: &lt;a href="http://neowaylabs.github.io/programming/unix-shell-for-data-scientists/"&gt;7 Unix Commands Every Data Scientist Should Know&lt;/a&gt;. I lost track of the number ofblog posts I read where the title includes &amp;ldquo;un*x commands that (data) scientistsshould know.&amp;rdquo; I expect that soon or later mastering deep learning techniques willbe a mandatory skill as well. Anyway, this gentle tutorial is well tied up, sogo read it if you want to refresh your memory.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-07&lt;/a&gt;: &lt;a href="https://manuel-uberti.github.io/emacs/2018/02/17/magit-bury-buffer/"&gt;Exterminate Magit buffers&lt;/a&gt;: Quite useful tip if like me you happen to kill yourMagit buffers by hand. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-07&lt;/a&gt;: &lt;a href="https://rash-lang.org"&gt;Rash&lt;/a&gt; - The Reckless Racket Shell. (via &lt;a href="https://twitter.com/NlightNFotis/status/1102975169587486720"&gt;@NlightNFotis&lt;/a&gt;) &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-07&lt;/a&gt;: &lt;a href="https://www.math3ma.com/blog/matrices-probability-graphs"&gt;Viewing Matrices &amp;amp; Probability as Graphs&lt;/a&gt;. With great illustrations. For thoseinterested in catgeory theory, the other posts are worth a look too. See, e.g.this &lt;a href="https://arxiv.org/pdf/1809.05923.pdf"&gt;booklet on arXiv&lt;/a&gt; (PDF, 50 pp.). &lt;code&gt;#maths&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-09&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/playlist/factory-records-les-tubes/pl.14df2991f1354af5aafa358f6dc56d8e" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Factory Records.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-10&lt;/a&gt;: 📖 Rezvani, &lt;em&gt;Le magicien&lt;/em&gt; (Actes Sud, 2006)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-10&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/album/indestructible/406414552" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Robyn, &lt;em&gt;Indestructible&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-10&lt;/a&gt;: I forgot about &lt;a href="https://osf.io"&gt;OSF&lt;/a&gt;. Here is a nice read: &lt;a href="https://osf.io/mhqcb/"&gt;A chill intro to causal inference viapropensity scores&lt;/a&gt;. Not only do we have a 16 page-long PDF, but also theaccompagnying source files! (via &lt;a href="https://twitter.com/george%5Fberry/status/1104486971110555649"&gt;@george_berry&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-10&lt;/a&gt;: I wish I had read this &lt;a href="https://juliasilge.com/blog/beginners-guide-to-travis/"&gt;nice post on Travis-CI&lt;/a&gt;, by Julia Silge, before I strugglemyself with Travis and R. Unrelated but also interesting post: &lt;a href="https://juliasilge.com/blog/tensorflow-generation/"&gt;Tensorflow, JaneAusten, and Text Generation&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&amp;gt; Understanding how text generation works with deep learning and TensorFlow has&amp;gt; been very helpful for me as I wrap my brain around these techniques more&amp;gt; broadly. And that’s good, because exactly how practical of a skill is this,&amp;gt; right?! I mean, who needs to generate new text from an existing corpus in their&amp;gt; day job?&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-10&lt;/a&gt;: Lovely work by &lt;a href="https://twitter.com/aschinchon/status/1104426818348765184"&gt;@aschinchon&lt;/a&gt;! There&amp;rsquo;s more to see on his blog, e.g. &lt;a href="https://fronkonstin.com/2019/02/01/mandalaxies/"&gt;Mandalaxies&lt;/a&gt;.&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-03-10-19-12-03.png"&gt;
&lt;/figure&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-10&lt;/a&gt;: Today&amp;rsquo;s lunch:&lt;figure&gt;&lt;img src="https://aliquote.org/img/IMG_0598.jpg"&gt;
&lt;/figure&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-10&lt;/a&gt;: &lt;a href="http://extremelearning.com.au/how-to-generate-uniformly-random-points-on-n-spheres-and-n-balls/"&gt;Generating Uniformly Random points on a d-sphere and d-ball&lt;/a&gt;. (via@Atabey&lt;em&gt;Kaygun)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-11&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/album/tindersticks-second-album/14192268" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Tindersticks, _Tindersticks&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-11&lt;/a&gt;: Sadly, there&amp;rsquo;s not such a steady flow on &lt;a href="http://pragmaticemacs.com"&gt;Pragmatic Emacs&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-11&lt;/a&gt;: TIL. There&amp;rsquo;s a nice option when you edit Python code under Emacs which consists in sorting automagically all &lt;code&gt;import&lt;/code&gt; statement. In most cases, it works great, however there are some edge cases. E.g., it is common in Flask applications to have &lt;code&gt;import&lt;/code&gt; defined after initializing the app itself, because of cicular imports. Hopefully, it is possible to override the default settings and to add a local directory variable, as recommended on Spacemacs website (&lt;code&gt;SPC f v d&lt;/code&gt;). &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-11&lt;/a&gt;: &lt;a href="https://t.co/SKZFqqbNKe"&gt;The value of owning more books than you can read&lt;/a&gt;. I have thousands of books in my home, many of which are more than 20 years old. From time to time it seems to me that&amp;rsquo;s all I have left. I&amp;rsquo;ve read them all except the last ones I bought. However, I can understand what it&amp;rsquo;s like to contemplate all that we still have to learn.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-12&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/album/as-it-was/1119775494" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Peter Erskine, Palle Danielsson &amp;amp; John Taylor, &lt;em&gt;As It Was&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-12&lt;/a&gt;: Here is the best take I found on &lt;a href="http://forum.ulisp.com/t/what-are-the-advantages-disadvantages-of-ulisp-vs-c-c/313/3"&gt;imperative vs. functionnal approach using Lisp&lt;/a&gt;. &lt;code&gt;#lisp&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-12&lt;/a&gt;: TIL Better to use &lt;code&gt;partition&lt;/code&gt; rather than &lt;code&gt;split&lt;/code&gt; when you want to convert a &amp;lsquo;string&amp;rsquo; to a &amp;lsquo;dict&amp;rsquo; based on the first occurence of a specific delimiter (as in &lt;code&gt;.split(..., 1)&lt;/code&gt;). Note that unlike &lt;code&gt;split&lt;/code&gt;, the delimiter is kept and you probably &lt;a href="https://stackoverflow.com/a/21568360"&gt;don&amp;rsquo;t want to keep it&lt;/a&gt;. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-12&lt;/a&gt;: &lt;a href="http://www.gutenberg.org/ebooks/26839"&gt;Mathematical Recreations and Essays&lt;/a&gt;, by W. W. Rouse Ball. (Note that the PDF is nicely hyper-linked!)&amp;gt; Another common trick is to throw twenty cards on to a table in ten couples, and ask someone to select one couple. The cards are then taken up, and dealt out in a certain manner into four rows each containing five cards. If the rows which contain the given cards are indicated, the cards selected are known at once.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-13&lt;/a&gt;: Exactement, comme dans une épicerie. Et il faut voir ce que cela donne avec lebétail dedans&amp;hellip; &lt;code&gt;#fr&lt;/code&gt;&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-03-13-21-37-22.png"&gt;
&lt;/figure&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-13&lt;/a&gt;: HN on the spotlight: &lt;a href="https://twitter.com/newsycombinator/status/1105815934525194242"&gt;Spotify to Apple&lt;/a&gt; and &lt;a href="https://twitter.com/newsycombinator/status/1105861240591736832"&gt;Google and DuckDuckGo&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-13&lt;/a&gt;: &lt;a href="https://danschimpf.com"&gt;MacJournal 7&lt;/a&gt; is now free. I will stay by Org for managing my text files, butit&amp;rsquo;s good to know anyway. (via &lt;a href="https://micro.baty.net/2019/03/12/it-seems-that.html"&gt;Jack Baty&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-14&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/album/creep-on-creepin-on/424617483" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Timber Timbre, &lt;em&gt;Creep On Creepin&amp;rsquo;On&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-14&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/album/sincerely-future-pollution/1276754886" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Timber Timbre, &lt;em&gt;Sincerely, Future Pollution&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-15&lt;/a&gt;: The &lt;code&gt;lsp&lt;/code&gt; backend for the Python layer in Spacemacs has so much improved overtime, and it is much more featured than the default &lt;code&gt;anaconda&lt;/code&gt; one. Pending minorissues with &lt;a href="https://mypy.readthedocs.io/en/latest/"&gt;mypy&lt;/a&gt; which complains about missing imports (this can be resolvedusing a config file, as described &lt;a href="https://mypy.readthedocs.io/en/latest/config%5Ffile.html"&gt;here&lt;/a&gt;), everything works perfectly. Things aregoing too fast for me with the develop branch of Spacemacs. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-15&lt;/a&gt;: Time to watch &lt;a href="https://en.wikipedia.org/wiki/The%5FExpanse%5F(TV%5Fseries)"&gt;The Expanse&lt;/a&gt;, Season 2, now.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-15&lt;/a&gt;: &lt;a href="https://t.co/Da7oedb46b"&gt;A (very) short intro to Constraints&lt;/a&gt;: Nice visual explanation à la idyll. (via&lt;a href="https://twitter.com/JohnSelstad/status/1106452520656736256"&gt;@JohnSelstad&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-15&lt;/a&gt;: &lt;a href="https://learningstatisticswithr.com"&gt;Learning Statistics with R&lt;/a&gt;. Looks like a nice intro to statistics with R. Ipersonally started with Peter Dalgaard&amp;rsquo;s &lt;em&gt;Introductory Statistics with R&lt;/em&gt;, but nodoubt this should be a good start too (beware this tutorial relies on externalpackages). &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-16&lt;/a&gt;: How about generating figure name using MD5 hash? I&amp;rsquo;ve long been wondering how tostore unique file names for all documents that I happen to write from day today. The last few years, I decided to prefix all such file names using either&lt;code&gt;fig-&lt;/code&gt; or &lt;code&gt;img-&lt;/code&gt; depending on the context (i.e., whether it has been generated by acomputer program or in the case it&amp;rsquo;s just an illustration grabed on theinternet), followed by a short but meaningful description, e.g.&lt;code&gt;img-emacs-screenshot.png&lt;/code&gt;. When it is a series of figures, I usually append an index (&amp;ldquo;a&amp;rdquo;, &amp;ldquo;b&amp;rdquo;, &amp;hellip;; or zero-padded numbers). Still I have lot of duplicatesfile names on my HD. One way to circumvent this issue is to generate randomhash, or I believe so since we all have the &lt;code&gt;md5&lt;/code&gt; utility on Un*x systems. &lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-16&lt;/a&gt;: &lt;a href="https://sethrobertson.github.io/GitBestPractices/"&gt;Commit Often, Perfect Later, Publish Once&lt;/a&gt;. This reminds me of Stack Overflow&lt;a href="https://stackoverflow.blog/2010/10/19/vote-early-vote-often/"&gt;motto&lt;/a&gt; circa 2010 (&amp;ldquo;Vote early, vote often&amp;rdquo;). Anyway, this recommended bestpractices with Git are very well done.&amp;gt; Don’t let tomorrow’s beauty stop you from performing continuous commits today.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-16&lt;/a&gt;: &lt;a href="https://www.smallsharpsoftwaretools.com"&gt;Small Sharp Software Tools&lt;/a&gt;. Together with &lt;a href="http://vincebuffalo.org"&gt;Vince Buffalo&lt;/a&gt;&amp;rsquo;s &lt;em&gt;Bioinformatics DataSkills&lt;/em&gt;, I believe this combo should provide the very best technical expositionto practical Unix. You may want to add &lt;a href="https://aliquote.org/post/learning-unix-for-os-x/"&gt;Learning Unix for OS X&lt;/a&gt; if you&amp;rsquo;reinterested in Mac-specific tools. (Disclaimer: I haven&amp;rsquo;t read Hogan&amp;rsquo;s book yet).&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-17&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/playlist/ecm-keith-jarrett/pl.2be32369b46d4c7ea419141a34295e6b" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   ECM: Keith Jarrett.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-17&lt;/a&gt;: According to &lt;a href="https://www.rousette.org.uk/archives/back-to-doom-emacs/"&gt;BSAG&lt;/a&gt;, Doom Emacs has been polished a little in recent months. I&amp;rsquo;mstill on Spacemacs&amp;ndash;probably for a long time to come&amp;ndash;but I remember howpleasant the &lt;a href="https://aliquote.org/post/doom-emacs/"&gt;experience&lt;/a&gt; &lt;a href="https://aliquote.org/post/org-and-bibtex/"&gt;with Doom Emacs&lt;/a&gt; was. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-17&lt;/a&gt;: It looks like &lt;em&gt;Statistical Rethinking&lt;/em&gt; will have a profund impact on bayesianstatistical computing. There&amp;rsquo;s now a &lt;a href="https://github.com/StatisticalRethinkingJulia/StatisticalRethinking.jl"&gt;Julia package&lt;/a&gt; to complement the R one. (via&lt;a href="https://twitter.com/zerology/status/1106978403285192705"&gt;@zerology&lt;/a&gt;) &lt;code&gt;#julia&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-17&lt;/a&gt;: RMS is now &lt;a href="https://stallman.org/apple.html"&gt;taking care of Apple&lt;/a&gt;. Now, I can&amp;rsquo;t help but smile at the idea of thispicture where we see RMS carrying his laptop on his shoulder. Surely he wasn&amp;rsquo;tlistening to music on iTunes. Note too that the list of criticisms made ofMicrosoft is much shorter (fair enough), but the same is true for Google whoonly gets two dozzns of bad marks! &lt;code&gt;#apple&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-17&lt;/a&gt;: &lt;a href="https://explorablemultiverse.github.io"&gt;Explorable multiverse analyses&lt;/a&gt;. What a talent &lt;a href="http://www.mjskay.com"&gt;this guy&lt;/a&gt; has! (via &lt;a href="https://twitter.com/mjskay/status/1106742606686494721"&gt;@mjskay&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-17&lt;/a&gt;: &lt;a href="https://mml-book.github.io"&gt;Mathematics for Machine Learning&lt;/a&gt; is finally out. (via &lt;a href="https://twitter.com/ChengSoonOng/status/1106518054580576256"&gt;@ChengSoonOng&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-18&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/playlist/jazz-chill/pl.63271312c084419891982eab46cc68ac" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Jazz Chill.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-18&lt;/a&gt;: TIL DuckDuckGo, which has been my default search engine since 2018, features abuilt-in URL shortener. So nice! (via &lt;a href="https://brettterpstra.com/2019/03/07/the-ultimate-guide-to-duckduckgo/"&gt;Brett Tersptra&lt;/a&gt;)br&amp;gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-18&lt;/a&gt;: The number of projects hosted under the Apache Software Foundation never ceasesto fascinate me. Today, I discovered &lt;a href="http://jena.apache.org"&gt;Jena&lt;/a&gt; for the semantic web!&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-18&lt;/a&gt;: &lt;a href="https://fluxml.ai"&gt;Flux ML&lt;/a&gt; and &lt;a href="https://fluxml.ai/2019/02/07/what-is-differentiable-programming.html"&gt;differentiable programming&lt;/a&gt;. Nice to see how new packages arecontinuously coming in the Julia ecosystem, after so many years. &lt;code&gt;#julia&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-18&lt;/a&gt;: &lt;a href="http://www.wilfred.me.uk/blog/2014/09/27/the-definitive-guide-to-syntax-highlighting/"&gt;The Definitive Guide To Syntax Highlighting&lt;/a&gt;. Nice to see some good old postsabout Emacs. It makes me want to activate the &lt;a href="https://github.com/tarsius/paren-face"&gt;paren-face&lt;/a&gt; mode to change alittle. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-19&lt;/a&gt;: 📖 Delphine de Vigan, &lt;em&gt;Les gratitudes&lt;/em&gt; (JC Lattès, 2019)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-19&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/album/dog-man-star-remastered-deluxe-edition/437206374" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Suede, &lt;em&gt;Dog Man Star&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-19&lt;/a&gt;: A bit late (3pm), but delightful:&lt;figure&gt;&lt;img src="https://aliquote.org/img/IMG_0607.jpg"&gt;
&lt;/figure&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-19&lt;/a&gt;: I have been seriously thinking of subscribing to &lt;a href="https://nordvpn.com"&gt;NordVPN&lt;/a&gt; during the last fewmonths. On further inspection, there was a good deal for the 3-year subscriptionplan. Now, it&amp;rsquo;s done.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-19&lt;/a&gt;: Little flowers to go with today&amp;rsquo;s sunshine:&lt;figure&gt;&lt;img src="https://aliquote.org/img/IMG_0606.jpg"&gt;
&lt;/figure&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-19&lt;/a&gt;: Lovely.&lt;figure&gt;&lt;img src="https://aliquote.org/img/IMG_0608.jpeg"&gt;
&lt;/figure&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-19&lt;/a&gt;: So I only have three episodes left before I finish my last TV series, &lt;a href="https://itunes.apple.com/fr/tv-season/occupied-lint%C3%A9grale-des-saisons-1-2-vost/id1339687553"&gt;Occupied&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-19&lt;/a&gt;: &lt;a href="https://cloudfront.escholarship.org/dist/prd/content/qt03w0n5g3/qt03w0n5g3.pdf"&gt;Essential Statistics with Python and R&lt;/a&gt;. Although this textbook does not coveradvanced material (and the figures are terrible), it comes with a lot ofexercices that one can solve using either R or Python.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-19&lt;/a&gt;: &lt;a href="https://pdfs.semanticscholar.org/2069/96c188d29db75a3f81a20aa67b76effe631f.pdf"&gt;Performance of Error Estimators for Classification&lt;/a&gt; (PDF). Always good to beremembered of how important error estimation is in statistical modeling,especially with small samples. Remember &lt;a href="http://www.fharrell.com/post/stat-ml/"&gt;Frank Harrell&lt;/a&gt;&amp;rsquo;s post?&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-19&lt;/a&gt;: &lt;a href="https://github.com/lord/slate"&gt;Slate&lt;/a&gt; &amp;ldquo;helps you create beautiful, intelligent, responsive API documentation.&amp;rdquo; Itreminds me of the whole stack of &lt;a href="https://rtomayko.github.io/rocco/rocco.html"&gt;racco&lt;/a&gt; (probably dead), &lt;a href="http://ashkenas.com/docco/"&gt;docco&lt;/a&gt; (sill live) &amp;amp; Co.Slate is used in &lt;a href="https://kimh.github.io/clojure-by-example/#about"&gt;Clojure by Example&lt;/a&gt;, a site that offers an original and veryinstructive approach to learning the basics of the Clojure language.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-20&lt;/a&gt;: 📖 Alberto Moravia, &lt;em&gt;L&amp;rsquo;amour conjugal&lt;/em&gt; (Denoël, 1948)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-21&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/album/pure-heroine/686537022" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Lorde, &lt;em&gt;Pure Heroine&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-21&lt;/a&gt;: I was just reading some of &lt;a href="https://rakhim.org"&gt;Rackhim&lt;/a&gt;&amp;rsquo;s posts. He&amp;rsquo;s the author of the recent &lt;a href="https://emacscast.org/about/"&gt;EmacsCast&lt;/a&gt;.The one on &lt;a href="https://rakhim.org/2016/11/backup/"&gt;backups&lt;/a&gt; is quite interesting. I use &lt;a href="https://www.arqbackup.com/"&gt;Arq&lt;/a&gt; (Thx &lt;a href="https://twitter.com/fonnesbeck"&gt;@fonnesbeck&lt;/a&gt;!) dailysince 5 years or so and I have been happy with that only one solution to backupmy personal and work-related data. I no longer use cloud fronts like Dropbox,except for already anonymised stuff I don&amp;rsquo;t get care enough to bother with privacy.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-21&lt;/a&gt;: On the simplicity of working with a Terminal: processing 44K of mails in lessthan 2 seconds.&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-03-21-21-39-30.png"&gt;
&lt;/figure&gt;
&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-21&lt;/a&gt;: TIL There are several flavours of &lt;code&gt;awk&lt;/code&gt; lurking around on the internet. Here is&lt;a href="https://github.com/lh3/bioawk"&gt;bioawk&lt;/a&gt;, a bioinformatics-aware &lt;code&gt;awk&lt;/code&gt; program.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-21&lt;/a&gt;: Too late to start re-reading Don Knuth&amp;rsquo;s excellent book on&lt;a href="http://jmlr.csail.mit.edu/reviewing-papers/knuth%5Fmathematical%5Fwriting.pdf"&gt;Mathematical Writing&lt;/a&gt; (PDF), but I will definitively do it in a few days.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-21&lt;/a&gt;: What is Data Science after all? I never liked this term, and I consider myselfas a statistician, or better a data craftsman, because I mostly spend my timedealing with data after all. Stephanie C. Hicks &amp;amp; Roger D. Peng wrote a nicearticle, &lt;a href="https://arxiv.org/abs/1903.07639v1"&gt;Elements and Principles of Data Analysis&lt;/a&gt;, which I believe providesquite an honest account of DS-related stuff:&amp;gt; Data science is the science and design of (1) actively creating a question to&amp;gt; inves- tigate a hypothesis with data, (2) connecting that question with the&amp;gt; collection of appro- priate data and the application of appropriate methods,&amp;gt; algorithms, computational tools or languages in a data analysis, and (3)&amp;gt; communicating and making decisions based on new or already established knowledge&amp;gt; derived from the data and data analysis.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-21&lt;/a&gt;: &lt;a href="https://cs.nyu.edu/~mohri/mlbook/"&gt;Foundations of Machine Learning&lt;/a&gt;. Never heard of it before I spotted &lt;a href="https://twitter.com/gappy3000/status/1108350497000435714"&gt;@gappy3000&lt;/a&gt; tweet.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-21&lt;/a&gt;: &lt;a href="https://www.tandfonline.com/doi/full/10.1080/00031305.2019.1583913"&gt;Moving to a World Beyond &amp;ldquo;p &amp;lt; 0.05&amp;rdquo;&lt;/a&gt;. Or maybe the earth isn&amp;rsquo;t just round. (via &lt;a href="https://twitter.com/kaz%5Fyos/status/1108667061448962048"&gt;@kaz_yos&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-21&lt;/a&gt;: &lt;a href="https://codereview.stackexchange.com/questions/151749/sudoku-solver-in-racket"&gt;Sudoku solver&lt;/a&gt; written in more or less 30 lines of Racket code. &lt;code&gt;#scheme&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-22&lt;/a&gt;: Interesting to know: The &lt;a href="https://github.com/trinker/wakefield"&gt;wakefield&lt;/a&gt; R packages allows to quickly generate randomdata sets. I learned about that while reading David Gohel&amp;rsquo;s &lt;a href="https://davidgohel.github.io/budapestbi2017/r4bi/slides.html#1"&gt;Using R as a BItool&lt;/a&gt;. &lt;code&gt;#rstats&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-22&lt;/a&gt;: &lt;a href="http://readiab.org"&gt;An Introduction to Applied Bioinformatics&lt;/a&gt;: An interesting online textbook that Ifound while browsing the &lt;a href="https://github.com/biocore/scikit-bio"&gt;scikit-bio&lt;/a&gt; Python package on Github. &lt;code&gt;#python&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-22&lt;/a&gt;: &lt;a href="https://www.nature.com/articles/d41586-019-00857-9"&gt;Scientists rise up against statistical significance&lt;/a&gt;. Together with&lt;a href="https://www.tandfonline.com/doi/full/10.1080/00031305.2019.1583913"&gt;Moving to a World Beyond &amp;ldquo;p &amp;lt; 0.05&amp;rdquo;&lt;/a&gt;, it is probably time to rethink statisticalsignificance and embrace the world of uncertainty instead. As Stephen Seen &lt;a href="https://aliquote.org/post/dicing-with-death/"&gt;oncesaid&lt;/a&gt;:&amp;gt; We can predict nothing with certainty but we can predict how uncertain our&amp;gt; predictions will be, on average that is. Statistics is the science that tells us&amp;gt; how.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-25&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/album/nocturama/1151572688" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Nick Cave &amp;amp; The Bad Seeds, &lt;em&gt;Nocturama&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-25&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/playlist/jazz-chill/pl.63271312c084419891982eab46cc68ac" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Jazz Chill.&lt;br&gt;&lt;img src="https://aliquote.org/img/2019-03-18-19-27-52.png" alt=""&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-25&lt;/a&gt;: Even if I have only increased the length of my working days by 2 hours in 1month (currently 9am to 3pm), I definitely stay out of work for a good 2 or 3hours once I get home. I guess I just have to live with that for the moment.It&amp;rsquo;s probably time to finish &lt;a href="https://itunes.apple.com/fr/tv-season/occupied-lint%C3%A9grale-des-saisons-1-2-vost/id1339687553"&gt;Occupied&lt;/a&gt; before the beer finishes me off. &lt;code&gt;#self&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-25&lt;/a&gt;: Here is the &lt;a href="https://t.co/U7s1UbkkiF"&gt;fourth edition&lt;/a&gt; of &lt;em&gt;Algorithms&lt;/em&gt;, by Sedgewick &amp;amp; Wayne, a definitive book to have afterKnuth&amp;rsquo;s monumental work and the Cormen et al. (via &lt;a href="https://twitter.com/TechSparx/status/1109530322004307968"&gt;@TechSparx&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-25&lt;/a&gt;: What a &lt;a href="http://janezhang.ca/posts/designto-2019/"&gt;beautiful artistic work&lt;/a&gt; at the crossroads between dataviz andinfographics, by &lt;a href="https://twitter.com/janezhgw/status/1108898417898676224"&gt;@janezhgw&lt;/a&gt;. &lt;code&gt;#dataviz&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-25&lt;/a&gt;: &lt;a href="https://codurance.com/2018/08/09/the-functional-style-part-1/"&gt;Functional programming explained for the pragmatic programmer&lt;/a&gt;. Nice take. Maybeit would have been easier to focus on C versus Common Lisp before addressing thecase of hybrid languages. (via HN)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-26&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/album/in-conflict/814784669" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Owen Pallett, &lt;em&gt;In Conflict&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-26&lt;/a&gt;: Got a &lt;a href="https://support.apple.com/kb/DL1994?locale=fr%5FFR"&gt;little upgrade&lt;/a&gt; under the hood in the morning:&lt;figure&gt;&lt;img src="https://aliquote.org/img/2019-03-26-21-00-42.png"&gt;
&lt;/figure&gt;
Nothing really new, though, except perhaps the &amp;ldquo;more editorial highlights on asingle page in the Browse tab&amp;rdquo; in iTunes.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-26&lt;/a&gt;: I like minimal theme, hence the Hugo them I choose last year. However, I justfound an even more minimalist theme:&lt;a href="https://github.com/oblitum/hugo-theme-slim"&gt;slim&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-26&lt;/a&gt;: Well, I&amp;rsquo;m done for good with &lt;a href="https://itunes.apple.com/fr/tv-season/occupied-lint%C3%A9grale-des-saisons-1-2-vost/id1339687553"&gt;Occupied&lt;/a&gt;, my list of TV series is out of stock, andI have no idea what to look for. I guess I&amp;rsquo;m good at reading books and watchingMinecraft gamers on Twitch.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-26&lt;/a&gt;: &lt;a href="http://www.complexity-explorables.org/explorables/scotts-world/"&gt;Scott&amp;rsquo;s World*&lt;/a&gt;, and more animations to see on &lt;a href="http://www.complexity-explorables.org"&gt;Complexity Explorables&lt;/a&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-27&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/album/you-must-believe-in-spring-remastered/299081512" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Bill Evans, &lt;em&gt;You Must Believe in Spring&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-27&lt;/a&gt;: Les données conduisent au &lt;a href="https://socialcooling.fr"&gt;refroidissement social&lt;/a&gt;. &lt;code&gt;#fr&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-27&lt;/a&gt;: Never heard of &lt;a href="https://www.qwant.com"&gt;Qwant&lt;/a&gt; before, but it looks like a good alternative to Google or Bing.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-27&lt;/a&gt;: Still no idea which TV series to watch, nor what to look for in this evening.So I&amp;rsquo;ll keep posting (not so) random links that have been hanging around on myiPhone for weeks:- &lt;a href="https://www.economodel.com/time-series-analysis"&gt;Time Series Analysis&lt;/a&gt;, by Kevin Kotzé- &lt;a href="https://github.com/vsbuffalo/devnotes/wiki/Feather,-CSV,-or-Rdata"&gt;Feather, CSV, or Rdata&lt;/a&gt;, by Vince Buffalo- &lt;a href="https://pandas-dev.github.io/pandas2/"&gt;pandas 2.0 Design Documents&lt;/a&gt;, by the Pandas team- &lt;a href="https://newonlinecourses.science.psu.edu/stat510/node/76/"&gt;Intervention Analysis&lt;/a&gt;, from the PennState Eberly College of Science- &lt;a href="http://stevenrosenberg.net/blog/programming/lisp/"&gt;If not SICP, then what? Maybe HTDP?&lt;/a&gt;, by Steven Rosenberg- &lt;a href="https://github.com/rigetti/magicl/blob/master/README.md"&gt;Matrix Algebra proGrams In Common Lisp&lt;/a&gt;, by Rigetti Computing- &lt;a href="https://blog.davisvaughan.com/2019/03/02/now-you-c-me/"&gt;Now You C Me&lt;/a&gt;, by Davis Vaughan- &lt;a href="http://www.johnborwick.com/2019/02/26/codex-seraphinianus.html"&gt;Codex Seraphinianus&lt;/a&gt;, by John Borwick- &lt;a href="https://stackoverflow.com/a/38536279"&gt;Reading large CSV files in R&lt;/a&gt;, on SO- &lt;a href="https://github.com/dimitri/AdventOfCode?files=1"&gt;Advent of Code&lt;/a&gt; in Lisp, by Dimitri Fontaine- Marijn Haverbeke&amp;rsquo;s &lt;a href="http://marijnhaverbeke.nl"&gt;homepage&lt;/a&gt;- &lt;a href="http://biostat.mc.vanderbilt.edu/wiki/pub/Main/CourseBios312/covariates.pdf"&gt;Modern Regression Analysis&lt;/a&gt; (PDF), by James C. Slaughter- &lt;a href="https://onlinelibrary.wiley.com/doi/full/10.1002/sim.5991"&gt;Variance reduction in randomised trials by inverse probability weighting usingthe propensity score&lt;/a&gt;, by Williamson et al.- David Gohel&amp;rsquo;s &lt;a href="https://github.com/davidgohel"&gt;Github account&lt;/a&gt;- &lt;a href="https://discourse.datamethods.org/t/should-we-ignore-covariate-imbalance-and-stop-presenting-a-stratified-table-one-for-randomized-trials/547"&gt;Should we ignore covariate imbalance and stop presenting a stratified ‘tableone’ for randomized trials?&lt;/a&gt;, on Frank Harrell&amp;rsquo;s Discourse- A &lt;a href="https://github.com/cggh/scikit-allel"&gt;Python package&lt;/a&gt; for exploring and analysing genetic variation data- &lt;a href="http://donw.io/post/github-comments/"&gt;Replacing Disqus with Github Comments&lt;/a&gt;, by Don Williamson&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-28&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/album/if-youre-feeling-sinister/516530926" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Belle and Sebastian, &lt;em&gt;If You&amp;rsquo;re Feeling Sinister&lt;/em&gt;.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-28&lt;/a&gt;: I remember the time when I was using PLINK to perform genome-wide analysis,before I switched to David Clayton&amp;rsquo;s excellent &lt;code&gt;snpMatrix&lt;/code&gt; R package. Now, itlooks like some folks are interested in &lt;a href="https://github.com/reworkhow/JWAS.jl"&gt;using Julia&lt;/a&gt; for this stuff. &lt;code&gt;#julia&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-28&lt;/a&gt;: &lt;a href="https://nvie.com/posts/a-successful-git-branching-model/"&gt;A successful Git branching model&lt;/a&gt;. See also &lt;a href="https://barro.github.io/2016/02/a-succesful-git-branching-model-considered-harmful/"&gt;What is wrong with this&lt;/a&gt;. Personally,I found that the Atom team has a pretty &lt;a href="https://blog.atom.io/2015/10/21/introducing-the-atom-beta-channel.html"&gt;nice setup&lt;/a&gt; for working with stable andbeta version.relies on&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-29&lt;/a&gt;: I&amp;rsquo;m quite happy actually with how Spacemacs handles LSP for various modes I makeregularly use of (Python, JS, C), thanks to the wonderful &lt;a href="https://github.com/emacs-lsp/lsp-mode"&gt;lsp-mode&lt;/a&gt;. Today, Idiscovered that there&amp;rsquo;s another &amp;ldquo;universal&amp;rdquo; package, &lt;a href="https://github.com/joaotavora/eglot"&gt;eglot&lt;/a&gt;, for dealing with allavailable servers. (via &lt;a href="https://twitter.com/hillelogram/status/1111422101078958080"&gt;@hillelogram&lt;/a&gt;) &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-29&lt;/a&gt;: I&amp;rsquo;m trying to use Eshell more consistently since a few days. &lt;a href="https://masteringemacs.org/article/complete-guide-mastering-eshell"&gt;Mastering Emacs&lt;/a&gt; is(as always) quite useful in this respect. After having tried some customsettings, including those found on &lt;a href="http://www.modernemacs.com/post/custom-eshell/"&gt;Modern Emacs&lt;/a&gt;, I finally choose the full-featured&lt;a href="https://github.com/xuchunyang/eshell-git-prompt"&gt;eshell-git-prompt&lt;/a&gt;. &lt;code&gt;#emacs&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-29&lt;/a&gt;: Nice finding today! Just when I thought I would need to write a full macOSnative app for viewing Fasta files or MAFFT-aligned sequences, I found it&lt;a href="https://github.com/4ment/seqotron"&gt;already exists&lt;/a&gt;, and it&amp;rsquo;s so much faster and prettier than &lt;a href="http://www.jalview.org"&gt;Jalview&lt;/a&gt;. Thank you somuch &lt;a href="https://4ment.github.io/"&gt;Mathieu Fourment&lt;/a&gt;! &lt;code&gt;#bioinfo&lt;/code&gt;&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-29&lt;/a&gt;: &lt;a href="https://getgrav.org"&gt;Grav &amp;ndash; a modern flat-file CMS&lt;/a&gt;. If you&amp;rsquo;re looking for an alternative to Jekyllor Hugo, there&amp;rsquo;s probably some good stuff behind this open-source project. (via&lt;a href="https://brettterpstra.com/2019/03/29/web-excursions-for-march-29-2019/"&gt;Brett Terpstra&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-29&lt;/a&gt;: &lt;a href="http://www.numerical-tours.com"&gt;Numerical Tours of Data Sciences&lt;/a&gt;, feat. Python, Julia and R.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-29&lt;/a&gt;: &lt;a href="https://benchmarksgame-team.pages.debian.net/benchmarksgame/"&gt;The Computer Language Benchmarks Game&lt;/a&gt;. (via &lt;a href="https://lemire.me/blog/2019/03/26/hasty-comparison-skylark-arm-versus-skylake-intel/"&gt;Daniel Lemire&lt;/a&gt;)&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-29&lt;/a&gt;: &lt;a href="https://macwright.org/2015/01/19/typing-is-not-the-problem.html"&gt;Typing is not the problem&lt;/a&gt;. Nice take! This came just after reading Tom&amp;rsquo;s &lt;a href="https://macwright.org/2019/03/28/oss-at-scale.html"&gt;lastpost&lt;/a&gt;, where I also learned about &lt;a href="https://www.conventionalcommits.org/en/v1.0.0-beta.3/"&gt;conventional commits&lt;/a&gt;. The latter reminds methat at some point I was using some ideas from &lt;a href="http://www.modernemacs.com/post/pretty-magit/"&gt;Modern Emacs&lt;/a&gt; to highlight commitleaders.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-30&lt;/a&gt;: 🎥 &lt;a href="https://www.imdb.com/title/tt0133093/"&gt;Matrix&lt;/a&gt;. Long time no see&amp;hellip; wait, it&amp;rsquo;s still as topical as ever. Remember those who spoke about AI 20 years ago? Or wrote Black Mirror more recently? Anyway, my son and I had a good time watching this &amp;ldquo;viral&amp;rdquo; movie.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-30&lt;/a&gt;: &lt;a href="https://brettterpstra.com/2014/02/19/remote-pbcopy-on-os-x-systems/"&gt;Remote pbcopy on OS X systems&lt;/a&gt;. Nice tip, as always.&lt;br&gt;
&lt;a href="#" style="text-decoration: none;"&gt;2019-03-31&lt;/a&gt;: &lt;a href="https://itunes.apple.com/fr/album/amours-grises-col%C3%A8res-rouges/1456228465" type="application/rss+xml" class="iconfont icon-music" title="rss"&gt;&lt;/a&gt;   Les Ogres de Barback, &lt;em&gt;Amours grises &amp;amp; colères rouges&lt;/em&gt;.&lt;br&gt;&lt;/p&gt;</description></item><item><title>Zoo of data formats</title><link>https://aliquote.org/post/zoo-of-data-formats/</link><pubDate>Wed, 27 Mar 2019 20:58:50 +0100</pubDate><guid>https://aliquote.org/post/zoo-of-data-formats/</guid><description>&lt;p&gt;The more I read on data formats, the more I think it is getting difficult to arrive at a common data format. Each data analyst does his or her own thing, with his/her preferred statistical package&lt;/p&gt;
&lt;p&gt;Nobody seems to use the &lt;a href="https://sdmx.org"&gt;SDMX&lt;/a&gt; data format, except people from the EC, the OCDE or other big tenants of official statistics. Likewise, the CDISC and &lt;a href="https://www.cdisc.org/standards/foundational/sdtm"&gt;STDM&lt;/a&gt; standards are limited to clinical trials.&lt;/p&gt;
&lt;p&gt;What&amp;rsquo;s more striking is that some data files come with their own header, like &lt;a href="https://www.samformat.info/sam-format-flag"&gt;&lt;code&gt;sam&lt;/code&gt;&lt;/a&gt; files or Weka &lt;a href="https://www.cs.waikato.ac.nz/ml/weka/arff.html"&gt;&lt;code&gt;arff&lt;/code&gt;&lt;/a&gt; files, while other data files remain divided into several pieces and do not necessarily include much information other than the data itself. This is often the case when there&amp;rsquo;s only one type of measurement (e.g., read sequence or activity level) but we need to convey different kind of information (e.g., subject&amp;rsquo;s level information and target measurement), like in &lt;a href="http://zzz.bwh.harvard.edu/plink/binary.shtml"&gt;&lt;code&gt;bed+bam+fam&lt;/code&gt;&lt;/a&gt; files or &lt;code&gt;hdr+img&lt;/code&gt; (&lt;a href="https://nifti.nimh.nih.gov/nifti-1/"&gt;NIFTI&lt;/a&gt;) files. This is mostly a way to avoid using a database given that dedicated software will handle inner joins for us. Moreover, there may exist plain text version (e.g., &lt;code&gt;sam&lt;/code&gt; or &lt;code&gt;ped&lt;/code&gt; files) and binary version (&lt;code&gt;bam&lt;/code&gt; or &lt;code&gt;bed&lt;/code&gt; fields, respectively) of the same data file, for obvious reasons of disk space saving. I&amp;rsquo;m fine with all that.&lt;/p&gt;
&lt;p&gt;However, I&amp;rsquo;ve always been a bit bothered by the fact that it is quite difficult to handle a dictionary file, also called a codebook, with a raw data file in R or Python. It looks to me that this is a fundamental piece of information when you&amp;rsquo;re working on a new dataset. What I noticed over the years I was working in medical statistics is that data managers tend to record their codebook in Excel, while the raw data are stored in a statistical database (SAS or Stata) &amp;mdash; even if Stata allows to define a &lt;a href="https://www.stata.com/support/faqs/data-management/infile-dictionary-options/"&gt;dictionary&lt;/a&gt; that contains the type and label of each variable. There&amp;rsquo;s nothing close in R, except perhaps the &lt;a href="http://csvy.org"&gt;csvy&lt;/a&gt; package which tries to append metadata as a YAML header in CSV files. There is an R &lt;a href="https://cran.r-project.org/web/packages/csvy/index.html"&gt;package&lt;/a&gt; that handles CSVY file format quite nicely. To the best of my knowledge, such files cannot be used by Python unless you skip the header lines like you would do with comments in a CSV file.&lt;/p&gt;
&lt;p&gt;Note that I am not talking about handling categorical variables. There are many solutions available in R (again, not as nice as in Stata, even if I&amp;rsquo;m quite impressed by the &lt;a href="https://strengejacke.github.io/sjlabelled/"&gt;work&lt;/a&gt; &lt;a href="https://strengejacke.github.io/sjmisc/"&gt;done&lt;/a&gt; by Daniel Lüdecke). Personally, I stand by the &lt;a href="https://aliquote.org/post/hmisc-and-rms/"&gt;Hmisc&lt;/a&gt; package (it also handles variable labels, by the way), since it integrates quote nicely with the &lt;a href="http://biostat.mc.vanderbilt.edu/wiki/Main/RmS"&gt;rms&lt;/a&gt; package which I have been using for years. I keep hoping some day we will see full integration of &lt;code&gt;Hmisc&lt;/code&gt; into RStudio data browser or the &lt;a href="https://tibble.tidyverse.org"&gt;tibble&lt;/a&gt; package. I must confess I don&amp;rsquo;t know enough about the state of the art in Python since I do not use Python for managing statistical data, but I doubt there are that many solutions available in that ecosystem.&lt;/p&gt;
&lt;p&gt;In short, the beauty of data analysis can be summed up in the diversity of data formats. The more we learn about their value and possible limitations, the more we learn new techniques for investigating raw data.&lt;/p&gt;</description></item><item><title>A bag of tweets / Mar 2019</title><link>https://aliquote.org/post/bag-of-tweets-108/</link><pubDate>Mon, 25 Mar 2019 08:08:24 +0100</pubDate><guid>https://aliquote.org/post/bag-of-tweets-108/</guid><description>&lt;p&gt;Here is the latest bag of tweets&lt;sup&gt;*&lt;/sup&gt;, which covers March 2019.&lt;/p&gt;
&lt;p&gt;(*) These are interesting news that I found on Twitter and that I archive periodically. Note that I have slightly updated reporting and fetching methods so that you will get between 80 and 120 of my most recent favorites from my Twitter account (&lt;code&gt;@even4void&lt;/code&gt;).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;2019-03-01 @tallphil: A fun mini-project: SRA-Explorer allows you to collect SRA datasets and get a quick bash download script for either SRA files or now FastQ files! (courtesy of the ENA API) 🚀 &lt;a href="https://t.co/UdohG4nHnN"&gt;https://t.co/UdohG4nHnN&lt;/a&gt; &lt;a href="https://t.co/YIL5WmoSHj"&gt;https://t.co/YIL5WmoSHj&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-01 @rlmcelreath: Done! All 20 Lectures of Statistical Rethinking 2019 — new material includes: Causal inference, instrumental variables, regression splines, better HMC notes, ordered categorical predictors, phylogenetic regression, more &lt;a href="https://t.co/2G9FdWge54"&gt;https://t.co/2G9FdWge54&lt;/a&gt; &lt;a href="https://t.co/kZNz53aAIS"&gt;https://t.co/kZNz53aAIS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-01 @freakonometrics: &amp;ldquo;Fundamentals of Linear Algebra and Optimization&amp;rdquo; &lt;a href="https://t.co/kWwgOpn12m"&gt;https://t.co/kWwgOpn12m&lt;/a&gt; (the one thousand page bible)&lt;/li&gt;
&lt;li&gt;2019-03-01 @stat110: New edition of my probability book with Jessica Hwang is out! Read it FREE online at &lt;a href="https://t.co/2iwKDNe0ag"&gt;https://t.co/2iwKDNe0ag&lt;/a&gt; &lt;a href="https://t.co/5z1zOkJ3Y5"&gt;https://t.co/5z1zOkJ3Y5&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-01 @wrathematics: @vsbuffalo This may interest you &lt;a href="https://t.co/GjEJwvHkPC"&gt;https://t.co/GjEJwvHkPC&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-01 @driven_by_data: And today I forked Adams chart to use Loess regression instead of the linear model, because I thought temperature isn&amp;rsquo;t increasing linearly (but maybe exponentially?) &lt;a href="https://t.co/GukCajAPKe"&gt;https://t.co/GukCajAPKe&lt;/a&gt; &lt;a href="https://t.co/0tKBe8Gtus"&gt;https://t.co/0tKBe8Gtus&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-01 @mattdesl: Testing some unusual ways of displaying a book. (Text from &amp;ldquo;Pride and Prejudice&amp;rdquo; by Jane Austen) &lt;a href="https://t.co/hTf2jMKIYI"&gt;https://t.co/hTf2jMKIYI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-01 @ttscoff: Lately on &lt;a href="https://t.co/K01VXNmbZ0"&gt;https://t.co/K01VXNmbZ0&lt;/a&gt;: Your security and privacy: next steps &lt;a href="https://t.co/NllBNnPvSz"&gt;https://t.co/NllBNnPvSz&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-02 @hmemcpy: A new version of Category Theory for Programmers PDF by @BartoszMilewski is now available! What&amp;rsquo;s new? _ Syntax highlighting! _ Scala edition (huge thanks to @impurepics!) * Many more fixes (see &lt;a href="https://t.co/vlGU6ssEHV"&gt;https://t.co/vlGU6ssEHV&lt;/a&gt; for details) Download here: &lt;a href="https://t.co/HIQ0Vzwt2Q"&gt;https://t.co/HIQ0Vzwt2Q&lt;/a&gt; &lt;a href="https://t.co/5qzzqaPW8p"&gt;https://t.co/5qzzqaPW8p&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-02 @AdamChainz: #python tip: taking the first item of a list comprehension is better done as next() on its generator version, to avoid creating the whole list In [1]: [x for x in range(100) if x &amp;gt; 10][0] # okay Out[1]: 11 In [2]: next(x for x in range(100) if x &amp;gt; 10) # better Out[2]: 11&lt;/li&gt;
&lt;li&gt;2019-03-03 @newsycombinator: Functional Programming in OCaml (2019) &lt;a href="https://t.co/nN9OXXHBWz"&gt;https://t.co/nN9OXXHBWz&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-03 @dvaughan32: Have you ever wanted to create an R package that calls C code, but didn&amp;rsquo;t know where to start? Look no further! &lt;code&gt;Now You C Me&lt;/code&gt; is a post dedicated to teaching you the bare minimum to create an #rstats package with C that passes CRAN&amp;rsquo;s checks. Enjoy! &lt;a href="https://t.co/JuuosiETq0"&gt;https://t.co/JuuosiETq0&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-03 @freakonometrics: &amp;ldquo;A problem in theory&amp;rdquo; &lt;a href="https://t.co/CWTcARfGxC"&gt;https://t.co/CWTcARfGxC&lt;/a&gt; (ht @cathleenogrady&amp;rsquo;s &lt;a href="https://t.co/lFefVLj66I"&gt;https://t.co/lFefVLj66I&lt;/a&gt;) &lt;a href="https://t.co/IvSax3d3SG"&gt;https://t.co/IvSax3d3SG&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-03 @hrbrmstr: #rstats CRAN Mirror “Security” &lt;a href="https://t.co/fiNU5Zsm0Q"&gt;https://t.co/fiNU5Zsm0Q&lt;/a&gt; &lt;a href="https://t.co/UFOB0VWNNI"&gt;https://t.co/UFOB0VWNNI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-03 @newsycombinator: Python Data Science Handbook: Full Text in Jupyter Notebooks &lt;a href="https://t.co/HiNmBLJGrv"&gt;https://t.co/HiNmBLJGrv&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-04 @kaz_yos: Tutorials on Bayesian Nonparametrics This page collects references and tutorials on Bayesian nonparametrics: &lt;a href="https://t.co/nV55l4pusy"&gt;https://t.co/nV55l4pusy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-04 @pascalbugnion: Excited to announce the release of jupyterlab-sql, a SQL GUI for @ProjectJupyter Lab. Installation instructions and documentation on: &lt;a href="https://t.co/wPqyf6u5aY"&gt;https://t.co/wPqyf6u5aY&lt;/a&gt; &lt;a href="https://t.co/wQ6ZN5YpW7"&gt;https://t.co/wQ6ZN5YpW7&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-04 @IKosmidis_: Fresh paper on mean and median bias reduction in GLMs is out (open access)! &lt;a href="https://t.co/oYvT7ajRPq"&gt;https://t.co/oYvT7ajRPq&lt;/a&gt; Alternatives to ML, IWLS, parameterization invariance, mixed bias reduction, improved inference + more! See my {brglm2} #rstats package for implementation &lt;a href="https://t.co/hGsEL229wr"&gt;https://t.co/hGsEL229wr&lt;/a&gt; &lt;a href="https://t.co/IyMCmuFNcz"&gt;https://t.co/IyMCmuFNcz&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-04 @ConcejeroPedro: R for Experimental Design an update of the classical exp. design manual by R. E. Kirk. Fancy names as split-plot, latin square, confounded and fractional factorial designs. Free download! &lt;a href="https://t.co/0q6oy0gs9B"&gt;https://t.co/0q6oy0gs9B&lt;/a&gt; #rstats&lt;/li&gt;
&lt;li&gt;2019-03-04 @andreymokhov: Is there any intermediate abstraction between applicative functors and monads? And if yes, what is it? In a new paper with @geo2A, @simonmar and @dimenix we explore &amp;ldquo;selective functors&amp;rdquo;, which are essentially applicative functors with branching: &lt;a href="https://t.co/LHljA0iiUQ"&gt;https://t.co/LHljA0iiUQ&lt;/a&gt; &lt;a href="https://t.co/tOgdlb1sGG"&gt;https://t.co/tOgdlb1sGG&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-04 @newsycombinator: Google reveals “high severity” flaw in MacOS kernel &lt;a href="https://t.co/SXQAr3vAlm"&gt;https://t.co/SXQAr3vAlm&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-04 @maartenzam: The slides of my talk &amp;ldquo;Pitfalls in data visualisation, and how to overcome them&amp;rdquo; at #openbelgium19 &lt;a href="https://t.co/hnr03C7f27"&gt;https://t.co/hnr03C7f27&lt;/a&gt; (contains 18 of them!) &lt;a href="https://t.co/oIAjSE6M6k"&gt;https://t.co/oIAjSE6M6k&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-04 @theotheredgar: 📦New versions of dbplot &amp;amp; modeldb were published to CRAN this weekend. These versions simplify the #rstudioconf demo significantly. The updated demo can be found in the same link from the original tweet. &lt;a href="https://t.co/gh1uIjTV45"&gt;https://t.co/gh1uIjTV45&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-04 @garyweissman: I&amp;rsquo;ve been fortunate to review a number of papers on clinical prediction models this past year and I&amp;rsquo;ve noticed a number of frequent errors. This thread is mostly for the clinician-investigator considering building and publishing a predictive model of some kind. 3 major points. /1&lt;/li&gt;
&lt;li&gt;2019-03-04 @garyweissman: A key review of performance metrics for prediction models, what they mean, how they compare: &lt;a href="https://t.co/tRNfU0umks"&gt;https://t.co/tRNfU0umks&lt;/a&gt; Personally, I find the scaled Brier Score to be the most immediately informative in a single value for most cases. /13&lt;/li&gt;
&lt;li&gt;2019-03-04 @FunctorFact: &amp;lsquo;Literature about Lisp rarely resists that narcissistic pleasure of describing Lisp in Lisp.&amp;rsquo; &amp;ndash; Christian Queinnec, Lisp in Small Pieces&lt;/li&gt;
&lt;li&gt;2019-03-04 @newsycombinator: What Every Programmer Should Know About Memory (2007) [pdf] &lt;a href="https://t.co/iB5IiBjGVU"&gt;https://t.co/iB5IiBjGVU&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-04 @kaz_yos: LaTeX fontawesome package &lt;a href="ftp://ftp.dante.de/tex-archive/fonts/fontawesome/doc/fontawesome.pdf"&gt;ftp://ftp.dante.de/tex-archive/fonts/fontawesome/doc/fontawesome.pdf&lt;/a&gt; &lt;a href="https://t.co/p3088rOQ4X"&gt;https://t.co/p3088rOQ4X&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-04 @bascule: 20 years of progress: 1999: IRC, ICQ, AIM, YIM Early 2000s: gaim (nee Pidgin, and other libpurple clients like Adium) provide unified UX across IM protocols 2019: We all run 15 chat apps again. Slack has nothing to do with J.R. Bob Dobbs, or Discord with Eris.&lt;/li&gt;
&lt;li&gt;2019-03-05 @kaz_yos: “idea behind the Lebesgue integral is that instead of approximating the total area by dividing it into vertical strips, one approximates the total area by dividing it horizontally. This corresponds to asking &amp;ldquo;for each y, how many x produce this value?&amp;rdquo; &lt;a href="https://t.co/kaXOti5Xlx"&gt;https://t.co/kaXOti5Xlx&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-05 @zevross: Tiny #rstats tip: if text reading functions are guessing column types incorrectly read all as character and use readr::type_convert() | &lt;a href="https://t.co/XgDIpn8lux"&gt;https://t.co/XgDIpn8lux&lt;/a&gt; &lt;a href="https://t.co/ebNP8bBrzA"&gt;https://t.co/ebNP8bBrzA&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-05 @CompSciFact: Base 85 encoding. Used in PDF files and git patches. &lt;a href="https://t.co/BZ3qtjsHeU"&gt;https://t.co/BZ3qtjsHeU&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-05 @skmorgane: Our modern data workflow for regularly updated data paper is now out! We use #rstats, @github, &amp;amp; @travisci to automatically check field data, acquire sensor data, update supplementary tables and archive the data to @ZENODO_ORG &lt;a href="https://t.co/TGcJaV2mz8"&gt;https://t.co/TGcJaV2mz8&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-05 @grrrck: 👉 #rstats and knitr tip! You can apply custom CSS to source and output code using the &lt;code&gt;class.source&lt;/code&gt; and &lt;code&gt;class.output&lt;/code&gt; chunk opts. 🎉 And with knitr 1.22 (on GitHub now), you can apply custom styles to messages, warnings and errors! 🙏 @xieyihui! &lt;a href="https://t.co/p1EzVBOCOE"&gt;https://t.co/p1EzVBOCOE&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-05 @juliabloggers: How to make package and set up Travis for Julia 1.0 &lt;a href="https://t.co/tWHiXv5fQk"&gt;https://t.co/tWHiXv5fQk&lt;/a&gt; &lt;a href="https://t.co/wIRGNmjh0d"&gt;https://t.co/wIRGNmjh0d&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-05 @strategist922: Collection of probabilistic models and inference algorithms - &lt;a href="https://t.co/4peo3HN7iW"&gt;https://t.co/4peo3HN7iW&lt;/a&gt; &lt;a href="https://t.co/PVJftQfOqo"&gt;https://t.co/PVJftQfOqo&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-05 @NlightNFotis: Holy smokes, this is amazing &lt;a href="https://t.co/NnT8U4UVNa"&gt;https://t.co/NnT8U4UVNa&lt;/a&gt; #racket #racketlang A shell that I can import arbitrary racket modules and pass text streams to racket functions. Yes please. Can&amp;rsquo;t wait to play with this.&lt;/li&gt;
&lt;li&gt;2019-03-05 @jesse_vig: New article and updated visualization tool for @OpenAI #GPT2! See how the pre-trained language model is able to finish your sentence. Article: &lt;a href="https://t.co/pQvjfsU7pG"&gt;https://t.co/pQvjfsU7pG&lt;/a&gt; GitHub: &lt;a href="https://t.co/PQIoTjnyhx"&gt;https://t.co/PQIoTjnyhx&lt;/a&gt; Colab: &lt;a href="https://t.co/DhLrrVccLo"&gt;https://t.co/DhLrrVccLo&lt;/a&gt; Play with it and share what you find! &lt;a href="https://t.co/gihmIEkbqn"&gt;https://t.co/gihmIEkbqn&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-06 @nickchk: I&amp;rsquo;m trying to put together a list of packages that make it easy to get standard data sets into R, ideally without even downloading files. Focusing on stuff USA UG econ students might use for projects. Any ideas? So far: tidycensus, gapminder, quantmod/tidyquant, gtrendsR, ipumsr&lt;/li&gt;
&lt;li&gt;2019-03-06 @MarcoWirthlin: @kaz_yos There is also a LaTeX package just for DAGs and Bayesian nets. The experience so far has been better than with yEd, because LaTeX supports math symbols and the graphs adapt better to de report. &lt;a href="https://t.co/ocKy9K01lk"&gt;https://t.co/ocKy9K01lk&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-06 @math3ma: A nice fact I like: Every matrix corresponds to a graph, and so familiar things (e.g. matrix multiplication) have nice pictures! Another nice fact: joint probability distributions &lt;em&gt;also&lt;/em&gt; correspond to graphs. They have telling pictures, too. New blog post! &lt;a href="https://t.co/EP67IhGAr0"&gt;https://t.co/EP67IhGAr0&lt;/a&gt; &lt;a href="https://t.co/tqdqImhX9P"&gt;https://t.co/tqdqImhX9P&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-06 @axiomsofxyz: And so begins the #rstats #RNGpacpocalypse related to &lt;code&gt;sampling()&lt;/code&gt; changes in R 3.6.x brought on by @kellieotto @philipbstark &lt;a href="https://t.co/YlVvh4jjWY"&gt;https://t.co/YlVvh4jjWY&lt;/a&gt; (Shout out to John Mount for naming) &lt;a href="https://t.co/FagHrKd61e"&gt;https://t.co/FagHrKd61e&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-07 @newsycombinator: Seven Unix Commands Every Data Scientist Should Know &lt;a href="https://t.co/aNNvPn89eB"&gt;https://t.co/aNNvPn89eB&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-07 @grrrck: TIL that @rstudio 1.2 uses header comments in your code (# looks like this &amp;mdash;-) to give you feedback on the progress of your script when you &amp;ldquo;Source as Local Job&amp;rdquo;. Very cool! #rstats &lt;a href="https://t.co/cA0N9xlRV4"&gt;https://t.co/cA0N9xlRV4&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-07 @bigdata: You created a machine learning application. Now make sure it’s secure ✍️ it’s been a busy week, l am looking forward to coming to #rsac &lt;a href="https://t.co/xbTbrXoRNT"&gt;https://t.co/xbTbrXoRNT&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-07 @paytonjjones: Here is a short tutorial on the &amp;ldquo;networktree&amp;rdquo; R package for anyone interested in learning more about this new method for network analysis! I will be posting my #icps19paris slides from today&amp;rsquo;s talk on the topic soon. &lt;a href="https://t.co/6FkWsoX1rG"&gt;https://t.co/6FkWsoX1rG&lt;/a&gt; &lt;a href="https://t.co/L0OcYXAmw5"&gt;https://t.co/L0OcYXAmw5&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-07 @NicolasDeux2: Créer une url raccourcie et un qr-code en 1 clic. Je ne le quitte plus depuis que @ErunReimsOuest me l’a montré. Merci @framasoft Et désolé pas de lien direct car tweeter ne semble pas apprécié ce site&amp;hellip; allez savoir pourquoi 😉 donc une capture d’écran &lt;a href="https://t.co/pgBxDN2DGz"&gt;https://t.co/pgBxDN2DGz&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-07 @timgluz: Found a comment from 1995: « static constexpr uint32_t BASEX = 0x80000000; // Internal radix used in calculations, hope to raise // this to 2^32 after solving scaling problems with // overflow detection esp. in mul » #lowhangingfruit #firstcommit #oss&lt;/li&gt;
&lt;li&gt;2019-03-07 @_wilfredh: The thing about memory ownership is that it&amp;rsquo;s intrinsic (not incidental) complexity on a physical computer. If you don&amp;rsquo;t want GC, you need ownership. Not all languages provide ownership tooling though (e.g. C). Following Rust&amp;rsquo;s success I suspect we&amp;rsquo;ll see more ownership tools. &lt;a href="https://t.co/CCmCnX381M"&gt;https://t.co/CCmCnX381M&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-08 @HNTweets: How does Apple keep secrets so well? (2012): &lt;a href="https://t.co/BsTiv9sBLr"&gt;https://t.co/BsTiv9sBLr&lt;/a&gt; Comments: &lt;a href="https://t.co/GaUu73fWZk"&gt;https://t.co/GaUu73fWZk&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-08 @gappy3000: &amp;ldquo;Probability and the Real World&amp;rdquo; by David Aldous (Berkeley). Thoughts about probability and the limits of knowledge. By an excellent probabilist, but non-technical. Love this. &lt;a href="https://t.co/0vytEQA6eG"&gt;https://t.co/0vytEQA6eG&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-08 @TeXtip: Math symbols to copy and paste, e.g. into a tweet &lt;a href="https://t.co/S2YqeqouRz"&gt;https://t.co/S2YqeqouRz&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-08 @kaz_yos: Two-step epigenetic Mendelian randomization: a strategy for establishing the causal role of epigenetic processes in pathways to disease. &lt;a href="https://t.co/qoV01DDoOX"&gt;https://t.co/qoV01DDoOX&lt;/a&gt; &lt;a href="https://t.co/hqAzU1wZeJ"&gt;https://t.co/hqAzU1wZeJ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-08 @cecilejanssens: The area under the ROC curve (AUC) is so frequently criticized and misunderstood that I often wonder whether I am the metric’s only fan. Let me explain why how I see and value the AUC. (thread) &lt;a href="https://t.co/ea69aX2x38"&gt;https://t.co/ea69aX2x38&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-09 @sanityinc: In Purescript you can elegantly traverse a collection once and calculate several different summaries: &lt;a href="https://t.co/CqJyQzsHOJ"&gt;https://t.co/CqJyQzsHOJ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-09 @StatsTommy: And then, after another day of odd issues in code and version control, this article by @juliasilge &lt;a href="https://t.co/a3voYX0Rj3"&gt;https://t.co/a3voYX0Rj3&lt;/a&gt; was an awesome primer for building continuous integration and automated testing in #rstats&lt;/li&gt;
&lt;li&gt;2019-03-09 @randomjohn: @abmathewks Part of it is legacy systems, part is the mystique surrounding &amp;ldquo;validated systems&amp;rdquo;, and part is the fact that SAS instituted certification a long time ago and enabled people to build careers around this one piece of software.&lt;/li&gt;
&lt;li&gt;2019-03-09 @kjhealy: BTW if you&amp;rsquo;re scatterplotting two scaled variables, then you can use ggforce&amp;rsquo;s geom_circle() to e.g. draw circles to show which observations are within 1 and 2 standard deviations of the mean. Use coord_fixed() to make sure the circles stay circular when drawn. &lt;a href="https://t.co/R8mKU2tx7p"&gt;https://t.co/R8mKU2tx7p&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-09 @aschinchon: Marine Sponges #rstats #tidyverse #maths #creative &lt;a href="https://t.co/PPGzyvO4Xd"&gt;https://t.co/PPGzyvO4Xd&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-09 @chasewnelson: This book is a veritable thought party — a back-to-basics, crystal clear refresher on what makes R elegant and powerful, and a delightfully easy read. Highly recommended! #rstats #oreilly #Genomics #BioInformatics #datascience &lt;a href="https://t.co/uhG3bZQOpT"&gt;https://t.co/uhG3bZQOpT&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-09 @dataandme: ICYMI, ⏰ intro to a very cool time-series pkg! &amp;ldquo;Introduction to the tsfeatures package&amp;rdquo; by Yangzhuoran Yang &amp;amp; @robjhyndman &lt;a href="https://t.co/RCzHa2Dpwq"&gt;https://t.co/RCzHa2Dpwq&lt;/a&gt; #rstats /_ 😬 couldn&amp;rsquo;t fit it all on one page _/ &lt;a href="https://t.co/MLIaLE96Tw"&gt;https://t.co/MLIaLE96Tw&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-09 @george_berry: I wrote a short and hopefully understandable intro to causal inference. I hope it&amp;rsquo;ll be useful for infosci folks in particular. PDF: &lt;a href="https://t.co/ulBrhiyw0E"&gt;https://t.co/ulBrhiyw0E&lt;/a&gt; GitHub: &lt;a href="https://t.co/BKS9o4ZiF7"&gt;https://t.co/BKS9o4ZiF7&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-09 @kaz_yos: “The methods that we describe in this tutorial apply equally to settings in which competing risks are independent of one another and to settings in which competing risks are not independent of one another.” &lt;a href="https://t.co/l5W9YdArmw"&gt;https://t.co/l5W9YdArmw&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-09 @stathissideris: Tiny bit of #clojure code to easily avoid reprocessing files that haven&amp;rsquo;t changed. &lt;a href="https://t.co/2iuFBNtIWY"&gt;https://t.co/2iuFBNtIWY&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-09 @stathissideris: Lisp-to-Lisp cross-contamination! Using syntax-quoting in #clojure to template some #Emacs Lisp code that will be evaluated in Emacs batch mode. The important point is that the code template is a data structure, not a string! &lt;a href="https://t.co/YVWZOsJQNZ"&gt;https://t.co/YVWZOsJQNZ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-10 @TechSparx: Common Probability Distributions. Highly recommend this wonderfully easy-to-understand explanation of the most important probability distributions. &lt;a href="https://t.co/ChNFUDyaCY"&gt;https://t.co/ChNFUDyaCY&lt;/a&gt; &lt;a href="https://t.co/Uw03V1HeSQ"&gt;https://t.co/Uw03V1HeSQ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-10 @bodil: I&amp;rsquo;ve been telling you for a while that MIT and BSD are outdated and you should be using Apache 2 instead (or, better yet, a strong copyleft to prevent exploitation, but baby steps etc). Now hear it from a lawyer. &lt;a href="https://t.co/8uSstyilaT"&gt;https://t.co/8uSstyilaT&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-10 @precariobecario: First full draft of my book on INLA &amp;ldquo;Bayesian inference with INLA and R-INLA&amp;rdquo; to be published by @CRC_MathStats is available on-line here: &lt;a href="https://t.co/0IDJrJpIDz"&gt;https://t.co/0IDJrJpIDz&lt;/a&gt; Feedback welcome!!!&lt;/li&gt;
&lt;li&gt;2019-03-10 @gappy3000: &amp;ldquo;Clustering of time series is meaningless&amp;rdquo; &lt;a href="https://t.co/XzkbuluTpM"&gt;https://t.co/XzkbuluTpM&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-10 @johnson_davies: An example showing how #Lisp gives you the choice of an imperative or functional programming style: &lt;a href="https://t.co/aP4jT3b5iT"&gt;https://t.co/aP4jT3b5iT&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-10 @Jose_A_Alonso: Rust for linear algebra and neural networks. ~ J.P. Moresmau. &lt;a href="https://t.co/vPzW6dCqOI"&gt;https://t.co/vPzW6dCqOI&lt;/a&gt; #RustLang #AI #MachineLearnig #Math&lt;/li&gt;
&lt;li&gt;2019-03-10 @TechSparx: Generating Uniformly Random points on a d-sphere and d-ball. My blog post gives a comprehensive list of the 20 most common methods to sample from a d-sphere or d-ball. &lt;a href="https://t.co/2ScnVOyOrd"&gt;https://t.co/2ScnVOyOrd&lt;/a&gt; &lt;a href="https://t.co/buDdCcT0nr"&gt;https://t.co/buDdCcT0nr&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-10 @phil_eaton: Adding an LLVM backend to ulisp (small Lisp compiler in JavaScript) &lt;a href="https://t.co/VIddKW1r3N"&gt;https://t.co/VIddKW1r3N&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-10 @AdrianRaftery1: Bayesian Model Averaging: A Systematic Review and Conceptual Classification. A very comprehensive review by Tiago Fragoso, Wesley Bertoli and Francisco Louzada. &lt;a href="https://t.co/b4dhafCj5L"&gt;https://t.co/b4dhafCj5L&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-10 @fwoaroof: I happened upon a Lisp Metadata Importer on lemonodor, and then I tweaked the source code to work on modern macOS. Now, I get information about definitions in Finder and can use mdfind to search for various kinds of lisp definitions. &lt;a href="https://t.co/EjLGrPxMQv"&gt;https://t.co/EjLGrPxMQv&lt;/a&gt; &lt;a href="https://t.co/gbPGOxL3Kg"&gt;https://t.co/gbPGOxL3Kg&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-11 @kevin_ushey: I wrote up a small post-mortem on an RStudio bug (&lt;a href="https://t.co/aW0tyWoj0i"&gt;https://t.co/aW0tyWoj0i&lt;/a&gt;) that took quite a bit of time to fix: &lt;a href="https://t.co/gQG8wllvHU"&gt;https://t.co/gQG8wllvHU&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-11 @bigthink: The value of owning more books than you can read &lt;a href="https://t.co/SKZFqqbNKe"&gt;https://t.co/SKZFqqbNKe&lt;/a&gt; &lt;a href="https://t.co/3AS66BNI1Y"&gt;https://t.co/3AS66BNI1Y&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-11 @Jose_A_Alonso: Why Jupyter is not my ideal notebook. ~ Clément Walter. &lt;a href="https://t.co/5jadIQ1W3E"&gt;https://t.co/5jadIQ1W3E&lt;/a&gt; #Jupyter&lt;/li&gt;
&lt;li&gt;2019-03-11 @UnixToolTip: Modern CMake resources &lt;a href="https://t.co/yziMP7MGEr"&gt;https://t.co/yziMP7MGEr&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-11 @TechSparx: Quasirandom Sequences. These are less regular than lattices, but more regular than random sampling. In this post, I describe a new quasirandom sequence; explore its remarkable properties; and give some examples of its application in gfx computing . &lt;a href="https://t.co/9xmdbyrbmj"&gt;https://t.co/9xmdbyrbmj&lt;/a&gt; &lt;a href="https://t.co/Zzv86df30f"&gt;https://t.co/Zzv86df30f&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-11 @math_rachel: OpenML AutoML Benchmarking framework @ledell @open_ml &lt;a href="https://t.co/HoBCmcdLiD"&gt;https://t.co/HoBCmcdLiD&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-11 @tkremenek: Making Swift more Mathable, now in review: &lt;a href="https://t.co/NjkUhv4NPo"&gt;https://t.co/NjkUhv4NPo&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-12 @m_deff: Iodide (&lt;a href="https://t.co/QZdDuD0lJN)"&gt;https://t.co/QZdDuD0lJN)&lt;/a&gt;, literate programming in the browser by @mozilla. Like @ProjectJupyter, but without the server. Can turn (scientific) Python into WebAssembly! Combine python and the web stack for great visualizations and easy sharing of analyses. 😍 &lt;a href="https://t.co/pYCDwPZO4s"&gt;https://t.co/pYCDwPZO4s&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-12 @adelaigue: Si judas avait placé ses trente deniers quand il les a obtenus, combien aurait-il d’argent aujourd’hui?&lt;/li&gt;
&lt;li&gt;2019-03-12 @kaz_yos: “Bayesian approach to estimate the average treatment effect on the treated. builds on developments proposed by Saarela et al in the context of MSMs, using importance sampling weights to adjust for confounding and estimate a causal effect” &lt;a href="https://t.co/aLQEd9DNlC"&gt;https://t.co/aLQEd9DNlC&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-12 @askdrstats: Moving beyond P values: Everyday data analysis with estimation plots &lt;a href="https://t.co/8gfgXuCoLZ"&gt;https://t.co/8gfgXuCoLZ&lt;/a&gt; time to fully retire the dynamite plot! @f2harrell @ThisisStats &lt;a href="https://t.co/GKX69VjOea"&gt;https://t.co/GKX69VjOea&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-12 @peterbourgon: You like GitHub, but you wish it had more Lisp and IPFS? Perhaps a CLI-based working UX? And extraordinary, forward-thinking design? Have I got a decentralized treat for you: &lt;a href="https://t.co/paDYd9WCm4"&gt;https://t.co/paDYd9WCm4&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-12 @rauschma: Awesome! Chrome 73 lets you install Progressive Web Apps natively on macOS. &lt;a href="https://t.co/c6Y4jmz72v"&gt;https://t.co/c6Y4jmz72v&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-13 @shravanvasishth: Ever wondered where the 3 standard deviations rule came from for deleting unpleasant data points? &lt;a href="https://t.co/ebf4wtf9J3"&gt;https://t.co/ebf4wtf9J3&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-13 @hmkyale: Really like this @AnnalsofIM article by great team; proposes visualizations of study designs - simple &amp;amp; easy to understand - should help communicate what was done. &amp;lsquo;help readers understand critical temporal aspects of a longitudinal database study.’ &lt;a href="https://t.co/YSLuwzr9JS"&gt;https://t.co/YSLuwzr9JS&lt;/a&gt; &lt;a href="https://t.co/n6qPZkYbDi"&gt;https://t.co/n6qPZkYbDi&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-13 @tomroud: Question : comment les gens paient ils les frais d’open access en France ? &lt;a href="https://t.co/7eyp6yLC57"&gt;https://t.co/7eyp6yLC57&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-13 @newsycombinator: Spotify to Apple: Time to Play Fair &lt;a href="https://t.co/HaF43pR5BJ"&gt;https://t.co/HaF43pR5BJ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-13 @kaz_yos: Meta‐Analysis and Mendelian randomization: A review - Bowden - - Research Synthesis Methods - Wiley Online Library &lt;a href="https://t.co/QwdxIxwIHf"&gt;https://t.co/QwdxIxwIHf&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-13 @newsycombinator: Google has added DuckDuckGo as a search engine option for Chrome users &lt;a href="https://t.co/CG5zrrQJdk"&gt;https://t.co/CG5zrrQJdk&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-13 @StatStas: This is an incredible data set. Raises all sorts of methodological issues, of course: you cannot really fit a survival model based on one NHIS interview and observe the survival time after that&amp;hellip; but for stuff like lifetime conditions, it kinda works. &lt;a href="https://t.co/yCj72Fj4as"&gt;https://t.co/yCj72Fj4as&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-13 @simplystats: 10 things R can do that might surprise you &lt;a href="https://t.co/onxJXz99KK"&gt;https://t.co/onxJXz99KK&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-13 @bayesean: Seemed like there was a lot of interest on twitter at the mention of the Stan compiler rewrite in OCaml, so I wrote up a little more about why it&amp;rsquo;s an exciting project. &lt;a href="https://t.co/jFF4eXZ7v7"&gt;https://t.co/jFF4eXZ7v7&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-13 @Teggy: &amp;ldquo;SQL, Lisp, and Haskell are the only programming languages that I&amp;rsquo;ve seen where one spends more time thinking than typing.&amp;rdquo; —Philip Greenspun&lt;/li&gt;
&lt;li&gt;2019-03-13 @kaz_yos: The power‐integrated discriminant improvement: An accurate measure of the incremental predictive value of additional biomarkers - Hayashi - - Statistics in Medicine - Wiley Online Library &lt;a href="https://t.co/3idf1UMFsx"&gt;https://t.co/3idf1UMFsx&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-14 @p1cost: The Evolution of Language &lt;a href="https://t.co/zNswvdQgN6"&gt;https://t.co/zNswvdQgN6&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-14 @AllenDowney: @Cmrn_DP Really interesting work. And thanks for the link to this tutorial on einsum, which is excellent: &lt;a href="https://t.co/IbVQ4oyc5w"&gt;https://t.co/IbVQ4oyc5w&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-14 @petitroll: A chaque fois que je co-signe un article avec des français, j&amp;rsquo;ai l&amp;rsquo;impression d&amp;rsquo;écrire avec Daenerys Stormborn of the House Targaryen, First of Her Name, the Unburnt, Queen of the Andals and the First Men, Khaleesi of the Great Grass Sea, Breaker of Chains, and Mother of Dragons.&lt;/li&gt;
&lt;li&gt;2019-03-14 @BrodieGaslam: A great example of #FOSS at work: #rdatatable team&amp;rsquo;s contributes their radix sort to #rstats. ~50x faster ordering in this e.g. This type of improvement on such a fundamental operation is invaluable (more on this next week). Thank you @MattDowle @arun_sriniv. &lt;a href="https://t.co/RAIu6VhzZQ"&gt;https://t.co/RAIu6VhzZQ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-14 @sigfpe: Amazing fact: map Brownian motion with an analytic function and you get (possibly time-warped) Brownian motion again. You can use it to find weird proofs of standard theorems in complex analysis as well as computing expected winding numbers etc. &lt;a href="https://t.co/TwZnIqCXhj"&gt;https://t.co/TwZnIqCXhj&lt;/a&gt; &lt;a href="https://t.co/tPwYQuqiPn"&gt;https://t.co/tPwYQuqiPn&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-14 @dsquintana: Google’s dataset search is a truly remarkable tool &lt;a href="https://t.co/UkAkRKjMMp"&gt;https://t.co/UkAkRKjMMp&lt;/a&gt; There’s more open data out there than we think, we just needed a tool like this to aggregate it all &lt;a href="https://t.co/I0weH3hvtH"&gt;https://t.co/I0weH3hvtH&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-15 @eddelbuettel: R^4 #20: Dependencies. Now with badges! Visualize direct and recursive dependencies of your packages and repos With special thanks to @edwindjonge for the badge creation repo! &lt;a href="https://t.co/61x8T3wRWj"&gt;https://t.co/61x8T3wRWj&lt;/a&gt; #rstats &lt;a href="https://t.co/qRqU2MfVff"&gt;https://t.co/qRqU2MfVff&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-15 @meickenberg: Dear Reviewers, our rebuttal didn&amp;rsquo;t fit in 5000 characters. Run this: echo H4sIANqgilwAAx3Muw7CMAxG4T1P8Y90CSuXjYmRtaMBq4kIseQ4rfL2mK7nk84sHcpUyoBShaXcImaPnC2xhgNN+FTZsCUyDAdSxltyXa4Q9+e0l5V1wLQ3c4kId/aYmw8Z9LJO5f+uyyW0JGpdSyQ7fm+P0zn8AAUwpEaEAAAA | base64 &amp;ndash;decode | gunzip&lt;/li&gt;
&lt;li&gt;2019-03-15 @JohnSelstad: A (very) short intro to Constraints, which are fundamental to a variety of algorithms ranging from filtering and inverse kinematics to physical simulation &lt;a href="https://t.co/Da7oedb46b"&gt;https://t.co/Da7oedb46b&lt;/a&gt; &lt;a href="https://t.co/2G4iF2kXIY"&gt;https://t.co/2G4iF2kXIY&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-15 @ChristophMolnar: keras + Interpretable Machine Learning Interpreting neural networks built in R with keras has become a lot easier: The iml package now accepts keras models directly. Try it out by installing the developer version: devtools::install_github(&amp;ldquo;christophM/iml&amp;rdquo;) &lt;a href="https://t.co/feBTW2thqO"&gt;https://t.co/feBTW2thqO&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-15 @Kalytis_: Hé mais en fait, Framadrop c&amp;rsquo;est trop bien ? Y&amp;rsquo;a plus de fonctionnalités que WeTransfer, et y&amp;rsquo;a même aucune limite absolue de taille, si on ne laisse le fichier hébergé que 24h. Utilisez ça si vous voulez envoyer des fichiers/cours facilement. GG @framasoft 💪 &lt;a href="https://t.co/0ycGvyyEyi"&gt;https://t.co/0ycGvyyEyi&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-15 @ChengSoonOng: Mathematics for machine learning, with @mpd37 and @AnalogAldo , to be published by Cambridge University Press. Final draft submitted. &lt;a href="https://t.co/J9HPNTygmd"&gt;https://t.co/J9HPNTygmd&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-15 @hrbrmstr: @carroll_jono @coolbutuseless @groundwalkergmb @BrodieGaslam While I detest browser WASM from a security perspective, this — &lt;a href="https://t.co/kIhQWT0fFj"&gt;https://t.co/kIhQWT0fFj&lt;/a&gt; — is another reason to at least be able to work with it esp given &lt;a href="https://t.co/jXyudF7XK6"&gt;https://t.co/jXyudF7XK6&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-15 @paulbuerkner: #brms 2.8.0 is now on CRAN featuring multinomial and Dirichlet models, data subsetting in multivariate models and parallelization of several post-processing methods. Bayesian multilevel modeling with brms has never been better! @mcmc_stan @rstats&lt;/li&gt;
&lt;li&gt;2019-03-15 @TensorFlow: Text classification using TensorFlow.js: An example of detecting offensive language in browser. Read the post and get started here → &lt;a href="https://t.co/WAdg4dVHrA"&gt;https://t.co/WAdg4dVHrA&lt;/a&gt; &lt;a href="https://t.co/YkHdXKChYW"&gt;https://t.co/YkHdXKChYW&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-15 @etiennejcb: little experiment &lt;a href="https://t.co/0dfb2D7fud"&gt;https://t.co/0dfb2D7fud&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-15 @Md_Harris: The trending of 90’s hacker culture gives my license to relive my days as a warez group founder/courier ca. 1994-97’. The later date is when I rejoined the scene as a budding anthropologist doing my participant observation. Those were the days! #CultoftheDeadCow #warez #2800 &lt;a href="https://t.co/VjJlSZ349H"&gt;https://t.co/VjJlSZ349H&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-16 @mjskay: Really excited to announce our (Pierre Dragicevic, Yvonne Jansen, @abhsarma, me, @zirtech) paper on Explorable Multiverse Analyses. We make multiverse analyses (a la Steegen, @StatModeling, et al) interactive through explorable explanations (a la @worrydream). THREAD &amp;mdash;&amp;gt; 1/7&lt;/li&gt;
&lt;li&gt;2019-03-16 @jabawack: 15 data fallacies and biases &lt;a href="https://t.co/fpcjoYcZq6"&gt;https://t.co/fpcjoYcZq6&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-16 @Atabey_Kaygun: I started listening to the songs I used to listen back in 90&amp;rsquo;s, and four hours later, I regressed further in the 80&amp;rsquo;s and ended up listening to motorhead and slayer. Lucky that nobody sees me headbanging in the office alone :)&lt;/li&gt;
&lt;li&gt;2019-03-16 @newsycombinator: How I Learned to Love Algebraic Geometry &lt;a href="https://t.co/uAwfPzpknp"&gt;https://t.co/uAwfPzpknp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-16 @newsycombinator: Reasons Not to Use Apple &lt;a href="https://t.co/gPdPy1pQGK"&gt;https://t.co/gPdPy1pQGK&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-16 @zerology: Cool. There is a Julia package that starts to reimplement the Rethinking Statistics package by @rlmcelreath (his is in R) &lt;a href="https://t.co/vpyuJp76W1"&gt;https://t.co/vpyuJp76W1&lt;/a&gt; #StochasticModels #JuliaLang&lt;/li&gt;
&lt;li&gt;2019-03-16 @rxwei: New documentation about how differentiable programming works in Swift: • Differentiable Functions and Differentiation APIs: &lt;a href="https://t.co/GFhJjaaqb8"&gt;https://t.co/GFhJjaaqb8&lt;/a&gt; • Differentiable Types: &lt;a href="https://t.co/a8DIjFPK6V"&gt;https://t.co/a8DIjFPK6V&lt;/a&gt; With language integration, autodiff is just a compiler implementation detail.&lt;/li&gt;
&lt;li&gt;2019-03-17 @greghendershott: About a week in. Not missing the MacBook. Have keys, will travel. &lt;a href="https://t.co/YXTNyeV0Pp"&gt;https://t.co/YXTNyeV0Pp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-17 @kumarshantanu: TIL about two awesome #Clojure learning resources, &lt;a href="https://t.co/1Hdm6YBCIw"&gt;https://t.co/1Hdm6YBCIw&lt;/a&gt; and &lt;a href="https://t.co/8JScSZEmDF"&gt;https://t.co/8JScSZEmDF&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-17 @biorxiv_bioinfo: pysradb: A Python package to query next-generation sequencing metadata and data from NCBI Sequence Read Archive &lt;a href="https://t.co/q9ihevFva7"&gt;https://t.co/q9ihevFva7&lt;/a&gt; #biorxiv_bioinfo&lt;/li&gt;
&lt;li&gt;2019-03-17 @jkatz05: This is exciting: the ability to query JSON data using the SQL/JSON path syntax was committed to the @PostgreSQL codebase! Another great feature for @PostgreSQL 12: &lt;a href="https://t.co/1PWaSP2Ryz"&gt;https://t.co/1PWaSP2Ryz&lt;/a&gt; Congrats to everyone who worked on it!&lt;/li&gt;
&lt;li&gt;2019-03-17 @newsycombinator: Thinkpad X210 &lt;a href="https://t.co/Ua72ZcLpun"&gt;https://t.co/Ua72ZcLpun&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-17 @AndyBugGuy: Genomes of 250 skipper butterflies reveal extensive convergence of wing patterns- resulting in a major overhaul of skipper taxonomy- with 6 new tribes and 9 new genera: &lt;a href="https://t.co/53JvzlcmT7"&gt;https://t.co/53JvzlcmT7&lt;/a&gt; &lt;a href="https://t.co/sodU3eayrL"&gt;https://t.co/sodU3eayrL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-17 @newsycombinator: A distributed rate counting system with Lua and Redis &lt;a href="https://t.co/8dz3aZJw1r"&gt;https://t.co/8dz3aZJw1r&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-17 @_wilfredh: Woah, today I learned that Rust has a doubly linked list in its standard library! It&amp;rsquo;s a common example of something you can&amp;rsquo;t do in purely safe Rust. Nonetheless, the core Rust devs have done the hard work already! &lt;a href="https://t.co/T5ieCzr9E1"&gt;https://t.co/T5ieCzr9E1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-17 @bob_kitt: I&amp;rsquo;ve been doing it wrong all my life&amp;hellip;. &lt;a href="https://t.co/gB5J8N76oN"&gt;https://t.co/gB5J8N76oN&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-18 @wviechtb: Of potential interest esp. for people in ecology doing meta-analyses: The metafor package now also allows for spatial correlation structures. An illustrative application: &lt;a href="https://t.co/A1WiXrzcOY"&gt;https://t.co/A1WiXrzcOY&lt;/a&gt; Note that you need the &amp;lsquo;devel&amp;rsquo; version of metafor for this: &lt;a href="https://t.co/FNP1FgdkR4"&gt;https://t.co/FNP1FgdkR4&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-18 @PierreAblin: Illustration of the Lasso and its path in 2D: for t small enough, the solution is sparse! &lt;a href="https://t.co/0JV23e32DF"&gt;https://t.co/0JV23e32DF&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-18 @hrbrmstr: For any non-&amp;ldquo;cyber-entrenched&amp;rdquo; followers who would like some insight into the jargon I use (but likely should not as often as I do) we&amp;rsquo;re doing a game-show take on &amp;ldquo;Demystifying Cybersecurity Jargon&amp;rdquo; tomorrow &lt;a href="https://t.co/0Qg6v4CeOb"&gt;https://t.co/0Qg6v4CeOb&lt;/a&gt; (cc: @kara_woo; finally found the link).&lt;/li&gt;
&lt;li&gt;2019-03-18 @gigasquid: New Post by Arthur Caillau - MXNet Made Simple - Image Manipulation &lt;a href="https://t.co/j5dS29iEA9"&gt;https://t.co/j5dS29iEA9&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-18 @rafalab: A free PDF version of Introduction to Data Science: Data Analysis and Prediction Algorithms with R is now available on &lt;a href="https://t.co/vwMW921269"&gt;https://t.co/vwMW921269&lt;/a&gt; Thanks to all the readers that through GitHub pull requests and issues improved the first gitbook version, specially to @biochemnerd!&lt;/li&gt;
&lt;li&gt;2019-03-18 @fulhack: Crazy but true: Annoy (everyone’s favorite approximate nearest neighbor library) just reached 5k stars on Github: &lt;a href="https://t.co/7sRLG054tT"&gt;https://t.co/7sRLG054tT&lt;/a&gt; ⭐️⭐️⭐️⭐️&lt;/li&gt;
&lt;li&gt;2019-03-18 @NicholasStrayer: Something I embarrassingly never thought about visually until reading @yudapearl &amp;rsquo;s #bookofwhy. People tend to overestimate correlations because people don&amp;rsquo;t think about regressions using least-squares, they think about them as orthogonal regression. #DataScience #dataviz &lt;a href="https://t.co/791MR33CtJ"&gt;https://t.co/791MR33CtJ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-18 @newsycombinator: Simple script to analyse your PostgreSQL database config, give tuning advice &lt;a href="https://t.co/1ONTIpGdMA"&gt;https://t.co/1ONTIpGdMA&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-18 @newsycombinator: Elsevier Left Users’ Passwords Exposed Online &lt;a href="https://t.co/4Lm7J713wa"&gt;https://t.co/4Lm7J713wa&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-18 @carlcarrie: Essential Statistics with Python and R #rstats ebook &lt;a href="https://t.co/JPsi1TFC6f"&gt;https://t.co/JPsi1TFC6f&lt;/a&gt; &lt;a href="https://t.co/Wy5MEHA37Q"&gt;https://t.co/Wy5MEHA37Q&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-19 @pythontrending: dragonfly - An open source python library for scalable Bayesian optimisation. &lt;a href="https://t.co/NKhlQUkk5l"&gt;https://t.co/NKhlQUkk5l&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-19 @hrbrmstr: Assumptions Matter More Than Dependencies &lt;a href="https://t.co/ZqM4hdIuW7"&gt;https://t.co/ZqM4hdIuW7&lt;/a&gt; #rstats&lt;/li&gt;
&lt;li&gt;2019-03-19 @wviechtb: I am sure the world has been waiting for yet another paper comparing different heterogeneity estimators in meta-analysis, so knock yourselves out: &lt;a href="https://t.co/PuM6zg6qaM"&gt;https://t.co/PuM6zg6qaM&lt;/a&gt; TLDR: Use REML and use the Hartung‐Knapp‐Sidik‐Jonkman method.&lt;/li&gt;
&lt;li&gt;2019-03-19 @f2harrell: Wonder how a #machinelearning algorithm can cross-validate (CV) when the sample size can&amp;rsquo;t support the number of candidate predictive features? It only seems to, with changing features selected for each CV-cycle. Reseachers wanting stability of features selected: watch out.&lt;/li&gt;
&lt;li&gt;2019-03-19 @lambda_calculus: Glad to see Elsevier embrace an open-access model. &lt;a href="https://t.co/NHs17QiY10"&gt;https://t.co/NHs17QiY10&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-19 @f2harrell: What may be 2 of the most important predictors of failure to translate animal research to humans? Failure to demonstrate dose-response relationships in animals, and poor #Statistics/experimental design: &lt;a href="https://t.co/aLn36yehkX"&gt;https://t.co/aLn36yehkX&lt;/a&gt; &lt;a href="https://t.co/0Qi2GiFFtS"&gt;https://t.co/0Qi2GiFFtS&lt;/a&gt; @venkmurthy @ProfDFrancis&lt;/li&gt;
&lt;li&gt;2019-03-19 @strnr: CGAT-core: a python framework for building scalable, reproducible computational biology workflows &lt;a href="https://t.co/Z1D98HvWiw"&gt;https://t.co/Z1D98HvWiw&lt;/a&gt; &lt;a href="https://t.co/Fz3pNLcJuf"&gt;https://t.co/Fz3pNLcJuf&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-19 @deaneckles: This book contains some approaches that will be quite unfamiliar to most social scientists, even those who sometimes think with causal DAGs. (Not all are necessarily as suited to the social sciences though.) &lt;a href="https://t.co/rpEMHFc9gO"&gt;https://t.co/rpEMHFc9gO&lt;/a&gt; &lt;a href="https://t.co/LODD1OOprT"&gt;https://t.co/LODD1OOprT&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-19 @strnr: Sequencing-based methods and resources to study antimicrobial resistance &lt;a href="https://t.co/VHOalRIWXc"&gt;https://t.co/VHOalRIWXc&lt;/a&gt; &lt;a href="https://t.co/zbANFfSUhW"&gt;https://t.co/zbANFfSUhW&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-19 @chowthedog: New post cruising around @Minecraft ⛏ using R and the A* algorithm. Notice it quickly gets close to the end, then spends a lot of time optimizing⌛. Inspired by @revodavid&amp;rsquo;s @rstatsnyc talk last year, using miner lib to run a maze! #rstats #minecraft &lt;a href="https://t.co/TZyDvUc5Vb"&gt;https://t.co/TZyDvUc5Vb&lt;/a&gt; &lt;a href="https://t.co/iqbVNeVbId"&gt;https://t.co/iqbVNeVbId&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-19 @JLRohmann: A nice summary of the last @bemcolloquium talk on regression shrinkage by one of our Health Data Sciences PhD students! The slides are linked on the blog, too. Thanks again, @maartenvsmeden &lt;a href="https://t.co/IbxngK407b"&gt;https://t.co/IbxngK407b&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-19 @Richard_D_Riley: Methodology grant submissions are a lottery: Once I submitted a proposal to develop sample size calculations to improve upon the 10 EPV rule &amp;hellip; it didn’t even make the panel meeting because main reviewer said “EPV is never used for sample size calculations in risk prediction” 😲&lt;/li&gt;
&lt;li&gt;2019-03-19 @eddelbuettel: The new &amp;lsquo;options(&amp;ldquo;conflicts.policy&amp;rdquo;=&amp;hellip;.)&amp;rsquo; in the upcoming R 3.6.0 will be very useful &amp;ndash; and this write-up by @LukeTierney4 is something many of us may come back to a number if times (as the section in &lt;code&gt;help(library)&lt;/code&gt; in R-devel is rather brief). Excellent stuff. #rstats &lt;a href="https://t.co/rmgulpP1qC"&gt;https://t.co/rmgulpP1qC&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-20 @StatModeling: Maybe it’s time to let the old ways die; or We broke R-hat so now we have to fix it. &lt;a href="https://t.co/ckgycU0VZD"&gt;https://t.co/ckgycU0VZD&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-20 @kaz_yos: R and labelled data: Using quasiquotation to add variable and value labels #rstats | R-bloggers &lt;a href="https://t.co/3lHAOQUSWL"&gt;https://t.co/3lHAOQUSWL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-20 @GaelVaroquaux: New paper: Population shrinkage of covariance (PoSCE) for better individual brain functional-connectivity estimation &lt;a href="https://t.co/H7Yh1PVXCn"&gt;https://t.co/H7Yh1PVXCn&lt;/a&gt; Better covariance estimation using a reference population, for James-Stein shrinkage on the covariance Riemannian manifold. &lt;a href="https://t.co/6WvR1MaB9E"&gt;https://t.co/6WvR1MaB9E&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-20 @gappy3000: PSA: The second edition of the Machine Learning textbook by Mori et al. is free to download. The 1st ed. was already excellent. &lt;a href="https://t.co/4HPYQ6FQiH"&gt;https://t.co/4HPYQ6FQiH&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-20 @CodeWisdom: “Sometimes, the elegant implementation is just a function. Not a method. Not a class. Not a framework. Just a function.” - John Carmack&lt;/li&gt;
&lt;li&gt;2019-03-20 @paulbuerkner: In our (@avehtari, @StatModeling, @dan_p_simpson, Bob, and my) new paper, we fix the Rhat convergence diagnostic and provide additional diagnostics that we argue should become the new standard to assess convergence of MCMC algorithms. Preprint available at &lt;a href="https://t.co/bhxSjKN3eO"&gt;https://t.co/bhxSjKN3eO&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-20 @rafalab: All materials for the 4 hour workshop Data Science for Statisticians are available on GitHub. We covered tidyverse, dataviz, wrangling and machine learning. Includes 6 lectures in R markdown and html 5 labs solutions in R markdown and markdown &lt;a href="https://t.co/Zz027ZeGLz"&gt;https://t.co/Zz027ZeGLz&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-20 @plotlygraphs: Today we are launching Plotly Express, a new high-level Python visualization library! Check out our announcement at &lt;a href="https://t.co/mb6UNT2NeF"&gt;https://t.co/mb6UNT2NeF&lt;/a&gt; or just watch this show reel of charts each made in a single line of Python: &lt;a href="https://t.co/DXrKwXrrTm"&gt;https://t.co/DXrKwXrrTm&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-20 @magnars: This is long overdue. Sorry to anyone negatively affected. #emacs &lt;a href="https://t.co/z5NXbdiRPl"&gt;https://t.co/z5NXbdiRPl&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-20 @ben_j_lindsay: One of the most underrated #Pandas functions in #Python is &lt;code&gt;.query()&lt;/code&gt;. I use it all the time. data = data.query(&amp;lsquo;age==42&amp;rsquo;) looks so much nicer than: data = data[data[&amp;lsquo;age&amp;rsquo;] == 42] And it allows chaining like: data = data.query(&amp;lsquo;age &amp;gt;18&amp;rsquo;).query(&amp;lsquo;age &amp;lt; 32&amp;rsquo;)&lt;/li&gt;
&lt;li&gt;2019-03-20 @mattdesl: The recent MySpace &amp;amp; Tumblr revelations is a reminder to artists&amp;hellip; - Don&amp;rsquo;t put all your eggs in one basket, instead share on many platforms - Have cloud &amp;amp; physical backups of all your art at raw/source size - Self-host where possible (Below comment is from HN) &lt;a href="https://t.co/9dg5LImIey"&gt;https://t.co/9dg5LImIey&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-20 @strnr: A Systematic Evaluation of Single Cell RNA-Seq Analysis Pipelines &lt;a href="https://t.co/sL4PAUi9wb"&gt;https://t.co/sL4PAUi9wb&lt;/a&gt; &lt;a href="https://t.co/AwAw26W8jR"&gt;https://t.co/AwAw26W8jR&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-20 @Jose_A_Alonso: Map/Reduce operations for scientific computing in Julia. ~ X. Vasseur. &lt;a href="https://t.co/hwVPQz1lVr"&gt;https://t.co/hwVPQz1lVr&lt;/a&gt; #JuliaLang&lt;/li&gt;
&lt;li&gt;2019-03-20 @drizopoulos: In two weeks I&amp;rsquo;ll be teaching again my Repeated Measurements course (&lt;a href="https://t.co/NNw2emPTjE"&gt;https://t.co/NNw2emPTjE&lt;/a&gt;) with improved slides, featuring a new version of the shiny app that contains all code, output &amp;amp; extra material: &lt;a href="https://t.co/8wT06nkWnR"&gt;https://t.co/8wT06nkWnR&lt;/a&gt; - next year it will also be fully available online&lt;/li&gt;
&lt;li&gt;2019-03-20 @rasbt: Another optimization algorithm visualization tool. This is a really great one, though. Coincidentally, I am going to cover optim algos in the next lecture and this will be super neat for the conceptual illustrations &lt;a href="https://t.co/tggJoZPjwd"&gt;https://t.co/tggJoZPjwd&lt;/a&gt; &lt;a href="https://t.co/WstjHKB11B"&gt;https://t.co/WstjHKB11B&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-21 @newsycombinator: How I&amp;rsquo;m able to take notes in mathematics lectures using LaTeX and Vim &lt;a href="https://t.co/gECwQlxKIs"&gt;https://t.co/gECwQlxKIs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-21 @kaz_yos: “Knowing what not to do with p-values is indeed necessary, but it does not suffice. It is as though statisticians were asking users of statistics to tear out the beams and struts holding up the edifice of modern scientific research without offering solid” &lt;a href="https://t.co/JAUkSlxwXn"&gt;https://t.co/JAUkSlxwXn&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-21 @strnr: Elements and Principles of Data Analysis (PDF) &lt;a href="https://t.co/L8oIfIRuCH"&gt;https://t.co/L8oIfIRuCH&lt;/a&gt; from @stephaniehicks @rdpeng &lt;a href="https://t.co/L0SlgiCOeZ"&gt;https://t.co/L0SlgiCOeZ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-21 @MuinJKhoury: Check out the @NEJM highly informative glossary on genetics and genomics. &lt;a href="https://t.co/GS1IfMla2e"&gt;https://t.co/GS1IfMla2e&lt;/a&gt; &lt;a href="https://t.co/zee7BgMvhl"&gt;https://t.co/zee7BgMvhl&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-21 @AllenDowney: &amp;ldquo;We must learn to embrace uncertainty.&amp;rdquo; &lt;a href="https://t.co/jrIIizQDx6"&gt;https://t.co/jrIIizQDx6&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-21 @cocoweixu: I condensed my semester-long CS course &amp;ldquo;Social Media &amp;amp; Text Analysis&amp;rdquo; into a 45-minute tutorial for high school kids. Going to debut it at High School I/O @hackohio this Saturday! 😀 &lt;a href="https://t.co/MqHbZ9bIoj"&gt;https://t.co/MqHbZ9bIoj&lt;/a&gt; #NLProc #Python @OSUOutreach &lt;a href="https://t.co/6jbJp3bRgI"&gt;https://t.co/6jbJp3bRgI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-21 @TeXtip: Mirroring text in LaTeX &lt;a href="https://t.co/Q2dX6qnYAY"&gt;https://t.co/Q2dX6qnYAY&lt;/a&gt; by @thurnherr&lt;/li&gt;
&lt;li&gt;2019-03-21 @CompSciFact: Books for CS grad students &lt;a href="https://t.co/KikhCzWTz5"&gt;https://t.co/KikhCzWTz5&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-21 @Viral_B_Shah: The #julialang debugger is here. The command line UI and Juno integration is perfect. Enough said. &lt;a href="https://t.co/p90vI0pXfO"&gt;https://t.co/p90vI0pXfO&lt;/a&gt; &lt;a href="https://t.co/8Lx2MEdjTA"&gt;https://t.co/8Lx2MEdjTA&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-21 @nitot: 20.000 employés de Facebook ont eu accès à vos mots de passe non chiffrés. Des centaines de millions d’utilisateurs sont concernés. Après la data façon far west, la sécu façon YOLO. Dans le pire, Facebook n’est jamais décevant ! &lt;a href="https://t.co/nrGyK0OODe"&gt;https://t.co/nrGyK0OODe&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-21 @the_repl: Listen to @carinmeier talk about Clojure MXNet and calling Scala from Clojure (!): &lt;a href="https://t.co/8pUcYdSjQL"&gt;https://t.co/8pUcYdSjQL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-21 @tmcw: never, ever use the @disqus embed snippet. it hits google, facebook, and viglink (an ad network) and binds &amp;lsquo;click&amp;rsquo; events on every link on the surrounding page.&lt;/li&gt;
&lt;li&gt;2019-03-21 @dotMudge: Just noticed that O’Reilly has my chapter from Beautiful Security up on their site Infosec examples of: Learned Helplessness Confirmation Traps Analyst’s Dilemma Functional Fixation &lt;a href="https://t.co/3nR4WQnr6z"&gt;https://t.co/3nR4WQnr6z&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-21 @marco_cova: The &amp;ldquo;Hack for hire&amp;rdquo; paper on the underground market of Gmail hacking services is pretty neat: &lt;a href="https://t.co/RtLBTo4dGw"&gt;https://t.co/RtLBTo4dGw&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-22 @janezhgw: I visited #DesignTO in January by @DesignTOFest and really enjoyed the experience. But I had difficulties planning out my itinerary. I saw a #dataviz opportunity here and decided to make one as a project. Check it out here &lt;a href="https://t.co/otLfmXrzSL"&gt;https://t.co/otLfmXrzSL&lt;/a&gt;. Process below👇 (1/9) &lt;a href="https://t.co/IiI7VCVF3h"&gt;https://t.co/IiI7VCVF3h&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-22 @newsycombinator: Functional programming explained for the pragmatic programmer &lt;a href="https://t.co/Ja8Hd7g9NY"&gt;https://t.co/Ja8Hd7g9NY&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-22 @gigasquid: Kicking off a monthly update for the Clojure MXNet project &lt;a href="https://t.co/0zECwNNDgO"&gt;https://t.co/0zECwNNDgO&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-23 @TechSparx: &amp;ldquo;Algorithms&amp;rdquo; by Sedgewick &amp;amp; Wayne. One of the most readable and respected books on this topic! Over 900 pages of amazing content all for free! PDF: &lt;a href="https://t.co/U7s1UbkkiF"&gt;https://t.co/U7s1UbkkiF&lt;/a&gt; Code: &lt;a href="https://t.co/ZTuUPAbDss"&gt;https://t.co/ZTuUPAbDss&lt;/a&gt; Solutions: &lt;a href="https://t.co/4kZsMD7tjz"&gt;https://t.co/4kZsMD7tjz&lt;/a&gt; Course: &lt;a href="https://t.co/QaUk4w2PSW"&gt;https://t.co/QaUk4w2PSW&lt;/a&gt; &lt;a href="https://t.co/MsFxQl91Az"&gt;https://t.co/MsFxQl91Az&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2019-03-24 @ken_bellows: I wrote a thing about semantic HTML on @ThePracticalDev: &amp;ldquo;Stop using so many divs! An intro to semantic HTML&amp;rdquo; &lt;a href="https://t.co/h1sv6ZvZ4L"&gt;https://t.co/h1sv6ZvZ4L&lt;/a&gt; #DEVcommunity #html #webdev&lt;/li&gt;
&lt;li&gt;2019-03-24 @Jose_A_Alonso: Permutations by sorting. ~ Donnacha Oisín Kidney (@oisdk). &lt;a href="https://t.co/kRT32U4SwC"&gt;https://t.co/kRT32U4SwC&lt;/a&gt; #Haskell #FunctionalProgramming&lt;/li&gt;
&lt;li&gt;2019-03-24 @Atabey_Kaygun: loom: a clojure graph library &lt;a href="https://t.co/2p11sKXXQF"&gt;https://t.co/2p11sKXXQF&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Bioinformatics Data Skills</title><link>https://aliquote.org/post/bioinformatics-data-skills/</link><pubDate>Thu, 21 Mar 2019 10:26:19 +0100</pubDate><guid>https://aliquote.org/post/bioinformatics-data-skills/</guid><description>&lt;p&gt;Here are quick notes I took while reading &lt;a href="http://shop.oreilly.com/product/0636920030157.do"&gt;Bioinformatics Data Skills: Reproducible and Robust Research with Open Source Tools&lt;/a&gt;, by Vince Buffalo.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://aliquote.org/img/bioinformatics-data-skills.jpg"&gt;
&lt;/figure&gt;
&lt;p&gt;Note that there is a dedicated &lt;a href="https://github.com/vsbuffalo/bds-files"&gt;Github repository&lt;/a&gt; as well as a companion website on Vince Buffalo&amp;rsquo;s &lt;a href="http://vincebuffalo.org/book/"&gt;website&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;O&amp;rsquo;Reilly books are generally of good quality, this book is excellent. It covers much more useful material than you would expect from basic textbooks on bioinformatics tools. Why? Because the author writes as a scientist rather than an engineer while putting a great emphasis on the data-centric workflow currently involved in the bioinformatics field. I have been following Vince Buffalo &lt;a href="https://twitter.com/vsbuffalo/"&gt;here&lt;/a&gt; and &lt;a href="https://www.biostars.org/u/69/"&gt;there&lt;/a&gt; for years, and I always learned something by reading his posts. He is a very talented guy. Now, I can also say that I spent some very good days reading his book.&lt;/p&gt;
&lt;p&gt;Even if I was initially more motivated by the bioinformatics stuff (chapters 9 and following), I learned some good tricks like using &lt;code&gt;grep -c &amp;quot;[^ \\n\\t]&amp;quot; file&lt;/code&gt; instead of &lt;code&gt;wc -l file&lt;/code&gt; to count the number of lines in a file without having to worry about blank lines. Or that there is a &lt;code&gt;man ascii&lt;/code&gt; available right from my Terminal. Or even that &lt;code&gt;LC_CTYPE=C grep --color='auto' -n -P &amp;quot;[\x80-\xFF]&amp;quot; file&lt;/code&gt; will look for non-ASCII characters in a text file, much like &lt;code&gt;hexdump&lt;/code&gt; does. Note that you will need GNU &lt;code&gt;grep&lt;/code&gt;, since the BSD version of this program doesn&amp;rsquo;t have such an option &lt;code&gt;-P&lt;/code&gt;. However, we can do this in Vim using its powerful searching facilities, e.g. &lt;code&gt;/[^\x00-\xFF]&lt;/code&gt;, to highlight all characters lying outside the (extended) ASCII range. The chapters on Unix tools (7 and 12) are really well written and full of other interesting illustrations. I can understand why Unix pipes are so important in bioinformatics since I used BSD utils (or GNU coreutils) a lot myself when processing raw data from the command line. If you are a beginner you will learn a lot by just reading the chapter &amp;ldquo;Inspecting and Manipulating Text Data with Unix Tools&amp;rdquo;. At this point, I believe the important aspect is not to retain all the options of the commands presented but to know what can be done with them. Next time you will have to a problem to solve, then you will remember that &lt;code&gt;grep&lt;/code&gt; is probably the right tool and that there&amp;rsquo;s a specific option to match full expression (&lt;code&gt;-w&lt;/code&gt;) or exclude specific keyword (&lt;code&gt;-v&lt;/code&gt;). The man or info pages are here to help, provided you spend some time digging into them.&lt;/p&gt;
&lt;p&gt;What I really like with Unix shell tools is that you can easily define function on the go or store them in your config file to reuse them in future sessions. Following the author&amp;rsquo;s own example, we could define the following functions to inspect a text file:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;inspect&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;head -n 2&lt;span class="p"&gt;;&lt;/span&gt; tail -n 2&lt;span class="o"&gt;)&lt;/span&gt; &amp;lt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; column -t &lt;span class="o"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nrow&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; grep -c &lt;span class="s2"&gt;&amp;#34;[^ \\n\\t]&amp;#34;&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ncol&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; awk -F &lt;span class="s2"&gt;&amp;#34;\t&amp;#34;&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;{print NF; exit}&amp;#39;&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This has inspired many command-line tools for &lt;a href="https://github.com/nferraz/st"&gt;statistical&lt;/a&gt; &lt;a href="https://www.gnu.org/software/datamash/"&gt;analysis&lt;/a&gt; or &lt;a href="https://github.com/bitly/data_hacks"&gt;data&lt;/a&gt; &lt;a href="https://github.com/dpmcmlxxvi/clistats"&gt;processing&lt;/a&gt;. Sadly, &lt;a href="http://hcibib.org/perlman/stat/"&gt;http://hcibib.org/perlman/stat/&lt;/a&gt;, which a friend recommended to me years ago, seems to be dead now.&lt;/p&gt;
&lt;p&gt;While CSV is a common data format (after Excel, in some domain), don&amp;rsquo;t forget that most Unix program expect tab-delimited source file. This is the case for &lt;code&gt;cut&lt;/code&gt; or &lt;code&gt;column&lt;/code&gt;, for example. I have long been using tab-delimited file when teaching R several years ago using good old &lt;code&gt;read.table()&lt;/code&gt; instructions to load the data. Windows users did not like that format very much&amp;ndash;hard to parse using MS Word, isn&amp;rsquo;t it? I also happened to use old-fashioned fixed format&lt;sup&gt;&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/sup&gt; when teaching Stata and the use of custom dictionary.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;There’s no reason to make data formats attractive at the expense of readable by programs.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And don&amp;rsquo;t forget that Unix tools can be really faster than anything you could think of using your favorite programming language. A good illustration can be found in the following article: &lt;a href="https://adamdrake.com/command-line-tools-can-be-235x-faster-than-your-hadoop-cluster.html"&gt;Command-line Tools can be 235x Faster than your Hadoop Cluster&lt;/a&gt;. Other examples are available in Jeroen Janssens&amp;rsquo;s excellent book, &lt;a href="https://www.datascienceatthecommandline.com"&gt;Data Science at the Command Line&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The rest of the book is as good as this chapter, of course. I especially liked the very first chapters which provide a nice summary of all the useful tools (Unix shell, Git, access to remote server, etc.) that help to ensure reproducibility and the sustainability of a bioinformatics project. I wish I knew all that stuff well before I entered my PhD program, and I think it would be worth teaching such material to every scientist involved in data analysis at large. I learned a lot from the remaining chapters about biological sequences. Notably, I found funny that the 0 vs. 1-base indexing also applies when working with so-called range data. Although I did not read the chapter on R, I wonder why the author did not include one on Python since it is mentioned in several places in the book, including the case of 0-based coordinate system mentioned above.&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;While we are into writing custom one-liner, I have this little function in my &lt;code&gt;.zshrc&lt;/code&gt;, which I find quite handy to browse online Stata documentation directly from a Terminal: &lt;code&gt;function statahelp() { links https://www.stata.com/help.cgi\?&amp;quot;${1}&amp;quot; }&lt;/code&gt;. If you source it in your shell, then &lt;code&gt;statahelp infix&lt;/code&gt; will give you an idea of what fixed format from the 80&amp;rsquo;s means.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>The unquantified self #6</title><link>https://aliquote.org/post/unquantified-self-006/</link><pubDate>Mon, 18 Mar 2019 20:37:47 +0100</pubDate><guid>https://aliquote.org/post/unquantified-self-006/</guid><description>&lt;p&gt;Spring is not yet here, even if we believed it for a moment. But it will obviously not be long now. In the meantime let me continue my literary peregrinations on this blog.&lt;/p&gt;
&lt;p&gt;Time has passed since I returned to work. Always a little tired in the afternoon, but overall I think it&amp;rsquo;s ok. The work is interesting enough not to make me regret the time I spent reading books at home for two years. I learned that I will surely lost 1/5 of my salary by the end of the year. I&amp;rsquo;m not quite happy with that. This is France, we all have to live with that, and to find other ways to earn our life after a PhD. Social progress is not where we expect it most in general. Since I no longer have any external consulting activities, life will get harder probably, but life is just a(nother) fight 