- Fix matplotlib QXcb connection error (often happening when connected via ssh)
import matplotlib as mlp
mlp.use('Agg')
import matplotlib.pyplot as plt
- Fix ident errors (when inheriting someones code)
| % Displays a given text in the console and also appends it into a generic | |
| % log file. | |
| % A specific folder is created for all such log files. | |
| % The log file is located in your current MATLAB path, in a new folder | |
| % called "log". | |
| % You can specifiy the log file by giving your log a unique ID. These ids | |
| % are then grouped together and displayed in a single file. | |
| % | |
| % Works best for cases where you can't print to the console (eg. worker | |
| % threads), but still need output to check later. |
| // | |
| // Author: Jonathan Blow | |
| // Version: 1 | |
| // Date: 31 August, 2018 | |
| // | |
| // This code is released under the MIT license, which you can find at | |
| // | |
| // https://opensource.org/licenses/MIT | |
| // | |
| // |
| #!/bin/bash | |
| # Script: osmc-java-jdownloader-installer.sh | |
| # Author: Jozef Pažin | |
| # Description: Wizard to install the current version of java and/or jdownloader on raspberry pi running osmc. | |
| # License: MIT | use arbitrarily, attribution is not required | |
| # How to run: | |
| # - Check if this code is correct first because this script need to be run under root and run gist | |
| # from web is not recommended in terms of security only that you know exactly what it does. Check it: | |
| # curl -Ls https://gist.github.com/atiris/34dc670264274b3a472f2a718e4de83a/raw | nano - |
| <?xml version="1.0" encoding="utf-8"?> | |
| <resources> | |
| <!-- google's material design colours from | |
| http://www.google.com/design/spec/style/color.html#color-ui-color-palette --> | |
| <!--reds--> | |
| <color name="md_red_50">#FFEBEE</color> | |
| <color name="md_red_100">#FFCDD2</color> | |
| <color name="md_red_200">#EF9A9A</color> |
| # Euclidean distance. | |
| def euc_dist(pt1,pt2): | |
| return math.sqrt((pt2[0]-pt1[0])*(pt2[0]-pt1[0])+(pt2[1]-pt1[1])*(pt2[1]-pt1[1])) | |
| def _c(ca,i,j,P,Q): | |
| if ca[i,j] > -1: | |
| return ca[i,j] | |
| elif i == 0 and j == 0: | |
| ca[i,j] = euc_dist(P[0],Q[0]) | |
| elif i > 0 and j == 0: |