Skip to content

Instantly share code, notes, and snippets.

@tonigi
tonigi / 00_parse_nlmcatalog.py
Last active July 2, 2020 22:46
Parse NLM Catalog journal list
import pandas as pd
dl = []
d={}
with open("J_Medline.txt","r") as f:
for l in f:
l = l.strip()
if "----" in l:
dl.append(pd.Series(d))
d={}
@tonigi
tonigi / README-users.md
Last active April 10, 2020 09:27
Draft gpcrmd installation

Toni: I see two ways to distribute the software:

  1. Semi-manual install using Vagrant. Draft instructions are below, based on Ismael's. All the relevant repositories must be made publicly-readable.

  2. Alternatively, distribute a self-contained, pre-ready "Vagrant Box". The latter should be easy and stable (doesn't depend on external downloads disappearing) but I have not tried it yet. There shouldn't be software license problems

Neither of the two works right now, because of some missing initialization.

GPCRmd: Local installation instructions

@tonigi
tonigi / HTMD_on_OSX.md
Last active October 31, 2019 13:33
Unofficial and unsupported way to use HTMD on OSX
@tonigi
tonigi / xxd-i.py
Created December 3, 2018 18:21
Replacement for xxd
#!/usr/bin/env python3
# Replaces xxd -i for systems without it (e.g. conda). Only stdin.
import sys
import textwrap
data=sys.stdin.buffer.read()
#xdata=", ".join([hex(x) for x in data])
xdata=", ".join([f'0x{y:02x}' for y in data])
@tonigi
tonigi / stan_iterative.cpp
Created September 1, 2017 21:29
Test autodifferentiation of a function computed via an iterative algorithm (Newton's method).
/*
* Test autodifferentiation of a function computed via an iterative
* algorithm (Newton's method).
*/
#include <cmath>
#include <stan/math/rev/mat.hpp>
#include <time.h>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tonigi
tonigi / README.txt
Created June 3, 2016 09:43
JModelica build
Using Fedora's ipopt
../configure --prefix=$HOME/Apps/jmodelica --with-ipopt=/usr --with-eclipse=$HOME/Apps/eclipse
make
export SUNDIALS_HOME=/home/toni/compile/JModelica.org/build/sundials_install
export JAVA_HOME=/usr/java/latest/

Note VQR

Summary

In prima approssimazione, si tratta di scegliere articoli usciti su riviste buone ma che abbiano contemporaneamente un buon numero di citazioni, dove la definizione di buon dipende dai parametri di cui sotto. Se il numero di citazioni ("valutazione bibliometrica") è

@tonigi
tonigi / install_vmd_plugin.md
Last active March 8, 2024 08:10
Install a VMD plugin

Installation of VMD plugins

These are common instructions for my VMD plugins.

Before you begin. Download the latest release and extract it in a directory of your choice.

Quick-and-dirty, no-installation method

Using an Android tablet for actual work

Turns out that an Android tablet (actually any phone) can be made into an actually-useful full-fledged Linux workstation, without rooting it.

By actually-useful, I mean something that a power-user will be able to use. By power-user, I mean roughly somebody who does most of his work in the command line and/or editors, but in a graphical environment.

There is no way around the fact that GUI-based tools developed for a desktop system will be unusable on touch interfaces. For one, UI elements are simply too many and too close together.

Command-line tools are quite another story. Lots of scientific and development workflows rely on some form of console or editor, plus an occasional preview - say a plot, or rendered LaTeX output. The key here is the ability to easily switch windows, and that they appear with sensible defaults that don't force us to rearrange them every time.