Bad Matrix Reloaded
A bit more random, but rest assured: it's nearly as bad as the previous.
`(emacs lisp bash ,@functional-programming)
A bit more random, but rest assured: it's nearly as bad as the previous.
Really, now: Bash? How am I going to update hash tables and all that — there aren't any! On the other hand, the output is a string. And boy, can Bash do strings.
After finishing my first implementation of The Grid Viz Problem, in Clojure, I went ahead and translated it to Emacs Lisp.
Having now introduced The Grid Viz Problem and outlined my solution, let's see the Clojure code.
How can we represent and modify such rover-populated grid?
Wouldn't you like to see those rovers' tracks instead of just "2 3 W" strings and the like? Well, I would. So I formulated an extension to the problem.
The problem starts with a string and ends with a string. Bash can certainly do strings.
Having solved it in Clojure, I couldn't resist inviting Emacs Lisp to the party.
Having now introduced and analyzed the problem, let's see the Clojure code.
Interpreting the Mars Rovers problem and designing a solution.
When I read "The Problem Statement" in Aditya Athalye's "A Clojure view of 'Mars Rovers'", I had the impulse to drop whatever I was doing and write my own solutions before being exposed to any spoilers from his own answer. Though that grid was not infinite, I was still nerd-sniped.
I have already argued in this general direction, but thought that I might as well put it more clearly and bluntly.
Having solved it in Clojure, I decided to translate that code into a new Emacs Lisp solution. I suspected that I'd like it much more than my Elisp one from years ago — and that turned out to be true.
There's an old programming challenge where the digits in a list of phone numbers are converted to letters according to rules and a given dictionary file. The results of the original challenge suggested that Lisp would be a potentially superior alternative to Java, since Lisper participants were able to produce solutions in, on average, fewer lines of code and less time than Java programmers. Some…
Clojure solutions to Ben Hoyt's word-counting exercise, with comparisons to Emacs Lisp.
Still more Emacs Lisp solutions to Ben Hoyt's word-counting exercise.
Match and convert from and to ISO week dates in Emacs Lisp and Bash.
Slice your year in weeks and quickly see where today is. Customizable with color themes, HyCal has the layout of an ISO week calendar, yet the first day of each Gregorian calendar month is shown with a distinct color. Weekdays can be shown in your own language — just pick a locale.
In which flandrew obsesses over literally hundreds of different ways to produce the exact same result using Emacs Lisp.
Emacs, the longest · Ordinal dates in Elisp and Bash · Colors and effects in the terminal
Tired of typing awkward ANSI escape codes to get eight-ish colors? With some sugared syntax and the whole RGB color space at your disposal, your terminal can look much more pleasantly colorful. Features include: lookup and Bash completion of X11 color names, effects (bold, italic, etc.), and a regex color filter mode to selectively colorize piped text.
Triangles for your terminals.
Emacs Lisp and Bash will be happy to tell you that.
Flexible formats to know how much time exists between now and the event.
Customize how you want to display a time difference: long or short, exact or fuzzy, how many and which units to use, etc.
Customize how you want to display a time difference: long or short, exact or fuzzy, how many and which units to use, etc.
The wonderful Org Show Branches · A dozen ways from vector to list · Send emoji cat to file cat and cat it
Org table of HTTP return codes · Faster, more elegant Bash FizzBuzz · Visualizing all territory flags at once
A closer look at one of Bash's little known features.
It's simple, really.
You can generate combinations of strings by using Bash's brace expansion.
Astonishing conciseness meets high enjoyability.
Point the flow to precisely where you want it.
Short, speedy, safe, simple syntax — seldom seen.
I often use them. I much like them. Yet I rarely see them in the wild.
Watch as all that noise disappears, one step at a time.
With the support of as little as three lines of lookup code, Bash functions can have clean and simple docstrings.
Thanks to orgtbl-mode, we can enhance our code's documentation with Org tables.
A handful of examples of searching, filtering, and mapping Unicode characters using a comprehensive hash table that a native Emacs function provides.
You can certainly do it with key–value lookups. But did you know you can calculate them?
Bash-based little brother of org-capture. Sort of. Emacs not needed: from anywhere, add to the end of an Org file of your choice a subtree with the contents of your clipboard.
Do you have fonts that can display emoji flags? Flaggify can convert from country code to country flag. Likewise for countries' subdivisions.
To get a bar built with Unicode blocks, simply give it numerator, denominator, and bar length.
Bash offers several options to organize your strings for printing or further processing, of which I show lots of examples.
There may be good reasons to stick to POSIX. But if instead you end up using Bash, and you're already sprinkling Bashisms all over your script, then you might as well make good use of it.
It now supports 10 non-native libraries, plus treesit and all the native functions covered by shortdoc.
Mondo can translate into (almost) every language the names of the world's scripts, languages, territories (including countries), and countries' subdivisions. Translations happen locally — in your machine.
Do you have fonts that can display emoji flags? Vexil can convert from country code to country flag, and vice-versa. Likewise for countries' subdivisions.
In which flandrew deploys Peruvian camelids, nested lambdas, and ascii art to answer the question of the meaning of life, the Universe, and everything.
Examples of what you type and what goes on in your mind as you use Pansymbolic.