Skip to content

Instantly share code, notes, and snippets.

@omo
omo / README.md
Last active March 14, 2024 15:56
XPS 17 9730 touchpad problem workaround on Ubuntu 22.04

XPS 17 9730 touchpad problem workaround on Ubuntu 22.04

This is a follow up for my Reddit post. Note that this is relevant for the classic X server (not Xwayland, which doesn't have this problem). If you have an NVIDIA GPU on your laptop, This is probably for you: Ubuntu configures the system with the non-Wayland, classic X server when an NVIDIA GPU is used.

The inspiration is from this article from the DELL site. Although the approach is outdated for recent Ubuntu, the basic premise is the same, that is, to eliminate duplicated touchpad / mouse input from X server configuration.

(function(undefined) {
'use strict';
// Check if dependecies are available.
if (typeof XLSX === 'undefined') {
console.log('xlsx.js is required. Get it from https://github.com/SheetJS/js-xlsx');
return;
}
if (typeof _ === 'undefined') {
console.log('Lodash.js is required. Get it from http://lodash.com/');

Polybrush

Here's a d3 plugin that allows you to create a polygon selection. You instantiate it just like d3.svg.brush.

var brush = d3.svg.polybrush();

It has an extra public method that 'brush' does not, and that's 'isWithinExtent(x, y)'. You can use this method to test if a given point falls within the drawn extent.

if (brush.isWithinExtent(x, y)) {
 console.log("I'm inside!");
@roban
roban / plot2Ddist.py
Created November 6, 2010 18:46
The plot2Ddist function plots the joint distribution of two variables, with estimated density contours and marginal histograms. Designed to plot paramter distributions for MCMC samples.
import pylab
import numpy
import pymc
import matplotlib.patches
from mpl_toolkits.axes_grid1 import make_axes_locatable
import scipy.stats
def frac_inside_poly(x,y,polyxy):
"""Calculate the fraction of points x,y inside polygon polyxy.