xinput --set-prop "12" "libinput Accel Speed" -0.6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Solving Ax = b using Cholesky Decomposition in C using LAPACK | |
* Compile with: gcc test_chol.c -lblas -llapack -llapacke -o test_chol | |
*/ | |
#include <stdio.h> | |
#include <lapacke.h> | |
int main() { | |
// Define matrix A and vector b in A * x = b | |
// clang-format off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Manual Fan Control | |
# Source: https://www.thinkwiki.org/wiki/How_to_control_fan_speed | |
echo level 7 | sudo tee /proc/acpi/ibm/fan | |
echo level auto | sudo tee /proc/acpi/ibm/fan | |
# Sleep | |
# For some reason since Ubuntu 20 closing lid does not sleep laptop | |
# only alternative I have found is to issue the following command | |
# Note: Tried `systemctl sleep` to no avail | |
systemctl hybrid-sleep |
The following code snippet showcases how one would use Eigen's spline module to
fit x^2
and find the first and second derivatives along the spline.
An important note is to remember to scale the derivatives with:
(x - x_min) / (x_max - x_min)
(first derivative)(x - x_min) / (x_max - x_min)^2
(second derivative).
Because when fitting a spline to x^2
, the x
values you feed into the spline
fitter is actually normalized with (x - x_min) / (x_max - x_min)
. So using
Eigen has an unsupported spline module where you can fit a spline given some data. Once a spline is fitted you can use it as a function to obtain points inbetween. The following example fits 1D data but can be modified to fit N-dimensional data.
git clone https://gist.github.com/chutsu/815c7c916c329eec85f34690a012f7cb spline_example
g++ -I/usr/include/eigen3 spline_example.cpp -o spline_example
./spline_example