Skip to content

Instantly share code, notes, and snippets.

Implementing APL rules for broadcasting into Numpy

This is an attempt for extending broadcasting rules in Numpy without losing the benefits of vectorization by converting new rules to preexisting ones.

The broadcasting policy is taken from APL standards according to the following ideas:

  • a subset of nested arrays from APL is implemented here;
  • an axis parameter is implemented here.

Enclosing parts of an array

@baruchel
baruchel / Maxima-Vim.md
Last active October 6, 2021 13:49
Complete integration of Maxima into Vim with Slimv

I previously wrote a plugin called vim-notebook for using Maxima in a Vim buffer. But since Maxima is written in Lisp and intended to be usable from Lisp code, I finally figured out a very nice way to achieve a similar result by using the existing Slimv.

In this post, I explain how to:

  • install a Lisp implementation (Clozure CL);
  • install the Quicklisp library manager;
  • install the Swank server;
  • fetch the latest version of Maxima and compile the interpreter only;
  • integrate Maxima to Vim with Slimv.
@baruchel
baruchel / compile_heirloom_doctools.md
Last active February 14, 2024 13:15
Quickly compiling Heirloom Doctools

Each time I re-install a fresh Linux distribution, one of the first things I need to do is to compile the Heirloom Documentation Tools. However some adjustments have to be performed; I write them here in order to recall them later:

  • download the sources from http://heirloom.sourceforge.net/doctools.html

  • type: sudo apt-get install g++ libc-dev bison flex

  • uncompress the tarball

  • enter the heirloom-doctools directory

  • edit mk.config and change three lines:

    • replace INSTALL=/usr/ucb/install with INSTALL=/usr/bin/install
  • replace PREFIX=/usr with PREFIX=/opt/heirloom