In the middle of the desert you can say anything you want
It all started with the menu bar disappearing on qutebrowser but not firefox:
Broke everything when trying to fix it, leading to not working vim bindings in
lab. Now I have vim bindings back and can live without the menu I guess.
It took 4h of very frustrating trial and error that I don’t want to document anymore, but - the solution to get vim bindings inside jupyterlab was to use the steps for installing through jupyter of the extension for notebooks, not the recommended lab one.
Installation · lambdalisue/jupyter-vim-binding Wiki:
mkdir -p $(jupyter --data-dir)/nbextensions/vim_binding jupyter nbextension install https://raw.githubusercontent.com/lambdalisue/jupyter-vim-binding/master/vim_binding.js --nbextensions=$(jupyter --data-dir)/nbextensions/vim_binding jupyter nbextension enable vim_binding/vim_binding
I GUESS the issue was that previously I didn’t use
--data-dir, and tried to install as-is, which led to permission hell. Me downgrading -lab at some point also helped maybe.
jupyterlab-vim package installed (through pip), was enabled, but didn’t do anything: jwkvam/jupyterlab-vim: Vim notebook cell bindings for JupyterLab.
Also, trying to install it in a clean virtualenv and then doing the same with pyenv was not part of the solution and made everything worse.
Getting paths for both
-lab and classic:
> jupyter-lab paths Application directory: /home/sh/.local/share/jupyter/lab User Settings directory: /home/sh/.jupyter/lab/user-settings Workspaces directory: /home/sh/.jupyter/lab/workspaces > jupyter --paths config: /home/sh/.jupyter /home/sh/.local/etc/jupyter /usr/etc/jupyter /usr/local/etc/jupyter /etc/jupyter data: /home/sh/.local/share/jupyter /usr/local/share/jupyter /usr/share/jupyter runtime: /home/sh/.local/share/jupyter/runtime
Removing ALL packages I had locally:
pip uninstall --yes jupyter-black jupyter-client jupyter-console jupyter-core jupyter-events jupyter-lsp jupyter-server jupyter-server-terminals jupyterlab-pygments jupyterlab-server jupyterlab-vim jupyterlab-widgets pip uninstall --yes jupyterlab nbconvert nbextension ipywidgets ipykernel nbclient nbclassic ipympl notebook
To delete all extensions:
jupyter lab clean --all
> pip freeze | ag "(jup|nb|ipy)" ipykernel==6.23.1 ipython==8.12.2 ipython-genutils==0.2.0 jupyter-client==8.2.0 jupyter-contrib-core==0.4.2 jupyter-contrib-nbextensions==0.7.0 jupyter-core==5.3.0 jupyter-events==0.6.3 jupyter-highlight-selected-word==0.2.0 jupyter-nbextensions-configurator==0.6.3 jupyter-server==2.6.0 jupyter-server-fileid==0.9.0 jupyter-server-terminals==0.4.4 jupyter-server-ydoc==0.8.0 jupyter-ydoc==0.2.4 jupyterlab==3.6.4 jupyterlab-pygments==0.2.2 jupyterlab-server==2.22.1 jupyterlab-vim==0.16.0 nbclassic==1.0.0 nbclient==0.8.0 nbconvert==7.4.0 nbformat==5.9.0 scipy==1.9.3 widgetsnbextension==4.0.7
history | grep jup
“One of the 2.5 hours I’ll never get back”, Serhii H. (2023).
Oil on canvas
scrot screenshotting tool, bash.
Docker image runs a Python script that uses
print() a lot, but
docker logs is silent because python
print() uses buffered output, and it takes minutes to show.
Solution1: tell python not to do that through an environment variable.
docker run --name=myapp -e PYTHONUNBUFFERED=1 -d myappimage
pip install packagename --force-reinstall1
(On a third thought, I realized how good ChatGPT is at suggesting this stuff, making this list basically useless. Good news though.)
I love Dia, and today I discovered that:
Before and after:
Trivial option: Label data points with Seaborn & Matplotlib | EasyTweaks.com
for i, label in enumerate (data_labels): ax.annotate(label, (x_position, y_position))
BUT! Overlapping texts are sad:
SO sent me to the library Home · Phlya/adjustText Wiki and it’s awesome
fig, ax = plt.subplots() plt.plot(x, y, 'bo') texts = [plt.text(x[i], y[i], 'Text%s' %i, ha='center', va='center') for i in range(len(x))] # adjust_text(texts) adjust_text(texts, arrowprops=dict(arrowstyle='->', color='red'))
Not perfect but MUCH cleaner:
More advanced tutorial: adjustText/Examples.ipynb at master · Phlya/adjustText · GitHub
Pypy doesn’t have the latest version, which has:
$A$1is a direct reference to
A1, that won’t move if formula is applied to a range
ISBLANK(..)means cell is empty
Uof the current row is equal to 1” (then you can color the entire row green or whatever)
This contains the entire list of all datasets I care about RE [[[230529-1413 Plants datasets taxonomy]]] for 230507-2308 230507-1623 Plants paper notes
we curated a partly crowd-sourced image dataset, comprising 50,500 images of 101 species.
2494 observations with 3199 images from 588 species, 365 genera and 89 families
REALLY NICE OVERVIEW PAPER with really good overview of the existing datasets! Frontiers | Plant recognition by AI: Deep neural nets, transformers, and kNN in deep embeddings
Datasets | The Leaf Genie has list of leaf datasets! TODO
pip install jupyter-black
It will automatically format all correct python code in the cells!
NB works much, much better with jupyterlab, in the notebook version it first executes the cell, then does black and hides cell output. It does warn about that everywhere though.