Skip to content

Instantly share code, notes, and snippets.

View AxelBohm's full-sized avatar

Axel Böhm AxelBohm

  • University of Vienna
  • Vienna
View GitHub Profile
@Laurence-Cullen
Laurence-Cullen / install.sh
Created December 28, 2020 16:40
Install CUDA for TensorFlow on Ubuntu 20.04
# Add NVIDIA package repositories
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"
sudo apt-get update
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu2004/x86_64/nvidia-machine-learning-repo-ubuntu2004_1.0.0-1_amd64.deb
sudo apt install ./nvidia-machine-learning-repo-ubuntu2004_1.0.0-1_amd64.deb
@flcong
flcong / GlobalVariablesJulia.md
Last active June 16, 2024 01:35
Global Variable in Julia: How to avoid using it?

Global Variable in Julia: How to avoid using it?

Recently, I tried to rewrite a MATLAB program in Julia. The program solves a PDE derived from a continuous-time economic model. I got the same result as the MATLAB program, but it was much slower. Then, I reviewed the Performance Tips of Julia and realized that the problem lied in using global variables. Typically, there are a lot of parameters in an economic model and they are typically directly defined as global variables. Then, for convenience, I wrote several functions to calculate some formulae which use these parameters. Since those functions were frequently called in a long loop, the performance is low.

To guide future programming practice, here I experiment several ways to avoid this problem.

Performance with/without global variables

Before digging into various ways to avoid this problem, let's first check how slow using global variables can be. To compare the computational time of di

@bahamas10
bahamas10 / readme.md
Created July 28, 2020 21:23
ThinkPad TouchPad on Void Linux fix

Synaptics Touchpad

I did an XBPS upgrade on my Void Linux system and my touchpad stopped working (ThinkPad X1 Carbon Gen6). The TrackPoint (little red nub thingy in the keyboard) still worked just fine.

Find the device

@AxelBohm
AxelBohm / tilegap.diff
Created September 20, 2018 11:54
tile gap patch that should apply to withou conflict to dwm-6.1
diff --git config.h config.h
index 8eee66b..5ee7805 100644
--- config.h
+++ config.h
@@ -4,6 +4,7 @@
/* appearance */
static const unsigned int borderpx = 2; /* border pixel of windows */
+static const unsigned int gappx = 10; /* gap pixel between windows */
static const unsigned int snap = 32; /* snap pixel */
@arose13
arose13 / install-conda.sh
Last active February 18, 2024 12:20
Install Miniconda in Ubuntu
# Setup Ubuntu
sudo apt update --yes
sudo apt upgrade --yes
# Get Miniconda and make it the main Python interpreter
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh
bash ~/miniconda.sh -b -p ~/miniconda
rm ~/miniconda.sh
export PATH=~/miniconda/bin:$PATH