Posts

beautifyPlot: A simple matplotlib wrapper to avoid writing ‘plt.’ statements on many lines

I made a wrapper to avoid writing ‘plt.’ statements on many lines. This method also lets me save the arguments passed to matplotlib in a file for later use. GitHub repo: https://github.com/kvgc/beautifyPlot Example: matplotlib code: import numpy as np import matplotlib . pyplot as plt x = np . arange ( 0 , 100 , 1 ) y = x ** 3 plt . plot ( x , y , label = 'y=f(x)' ) plt . title ( "test plot" ) plt . xlim ([ 0 , 10 ]) plt . ylim ([ 0 , 1000 ]) plt . legend ( fontsize = 15 ) plt . tight_layout ()   Using beautifyPlot module: from beautifyPlot . bplt import beautifyPlot import numpy as np x = np . arange ( 0 , 100 , 1 ) y = x ** 3 plt . plot ( x , y , label = 'y=f(x)' ) plotArgs = { 'title' : [ 'test plot' ], ## Use list to pass a set of arguments to the function 'xlim' : [ 0 , 10 ], 'ylim' : [ 0 , 1000 ], 'legend' : { ...

Disabling YouTube shorts

Image
If you are deeply frustrated with YouTube shorts (as I am), you can disable it by turning off your search history.  Activity page after turning off search history:    YouTube shorts page after turning off search history: Related : Code to block YouTube Shorts using uBlock on FireFox

When universities are theme parks

If you live within 15 minutes of a coffee shop, but the barista can’t afford to live within half an hour, then you don’t live in a city—you live in a theme park. - https://www.science.org/content/article/when-universities-are-theme-parks-postdocs-and-grad-students-suffer

svglue: Templating using inkscape and python

svglue is a small library that takes a template in form of a specially prepared SVG document and fills in text and images to create an output SVG file. The pip version did not work of the box and I ran into the same issue as pointed out here . Link to working tutorial  

Zotero to Tiddlywiki5

  Zotero is a great tool but it has been challenging to look up bib and notes taken in Zotero on Tiddlywiki. It is really inconvinient to have to always have to switch between these two apps. Therefore, I wrote this python script which takes the csv that you get from running Zotero's default csv translators and converts it into something that you can import to Tiddlywiki directly. Note that Tiddlywiki does not allow you to import arbitrary JSON files such as   {     'x': 10,     'y': 20 } as new tiddlers. Instead any JSON file that you import must have the following keys to be loaded as a new tiddler {     'text'        : '' ,     'tags'        : '' ,     'modified'    : '' ,     'created'     : '' ,     'title'       : '' } ...

Text Fragments

  This cool feature lets you link to specific sentences on any webpage. Read more here including multiple sentences. See also: Discussion on promnesia

Choose Your Weapon: Survival Strategies for Depressed AI Academics

  https://arxiv.org/abs/2304.06035 There are a lot of suggestions in this paper that I think are helpful In particular, “In-the-wild domains such as games, IoT , and autonomous vehicles could allow AI to be deployed next to their end user and the data the user generates, i.e. at the edge of the network. This is often called edge AI [8], the operation of AI applications in devices of the physical world is possible when memory requirements are low and inference occurs rapidly.” (Togelius and Yannakakis, 2023, p. 4) “Solve Problems Few Care About (For Now!)” (Togelius and Yannakakis, 2023, p. 5) “In academia, failure can be as instructive and valuable as success and the stakes are overall lower. Many important inventions and ideas in AI come from trying the “wrong” thing. In particular, all of deep learning stems from researchers stubbornly working on neural networks even though there were good theoretical reasons why they shouldn’t work.” (Togelius and Yannakakis, 2023, p. ...