Skip to content

Instantly share code, notes, and snippets.

@rahulbhadani
rahulbhadani / eigen_polyfit.cpp
Last active May 23, 2023 14:32
Least Square Polynomial Fit
#include <Eigen/Dense>
#include <iostream>
#include <cmath>
#include <vector>
#include <Eigen/QR>
void polyfit( const std::vector<double> &t,
const std::vector<double> &v,
std::vector<double> &coeff,
int order
@Te-k
Te-k / pdf_metadata.md
Created November 26, 2020 10:31
How to remove metadata from PDFs

Many tools do not fully remove metadata, but just remove the link with in the metadata table. The data are thus still available in the PDF file itself.

While a lot of people rely on Exiftool to remove metadata, it actually does the same in PDFs. If you remove metadata with exiftool -all= some.pdf, you can always restore the data with exiftool -pdf-update:all= some.pdf.

There are several options to remove PDF metadata safely:

Option 1 : Exiftool with qpdf

  • Remove metadata with exiftool : exiftool -all= some.pdf
  • Then remove ununsed objects with qpdf : qpdf --linearize some.pdf - &gt; some.cleaned.pdf
@jamesnvc
jamesnvc / unicode_input.py
Created January 12, 2018 19:32
Linux Unicode input
#!/usr/bin/env python3
"""
Emulate Gnome's Unicode input method.
Requires `pyxhook` and `xdotool` to be installed
`pip install pyxhook`
`sudo apt-get install xdotool`
"""
@chrisengelsma
chrisengelsma / PolynomialRegression.h
Last active February 28, 2024 14:07
Polynomial Regression (Quadratic Fit) in C++
#ifndef _POLYNOMIAL_REGRESSION_H
#define _POLYNOMIAL_REGRESSION_H __POLYNOMIAL_REGRESSION_H
/**
* PURPOSE:
*
* Polynomial Regression aims to fit a non-linear relationship to a set of
* points. It approximates this by solving a series of linear equations using
* a least-squares approach.
*
* We can model the expected value y as an nth degree polynomial, yielding
#! /bin/bash
# Description: show dependency tree
# Author: damphat
if [ $# -lt 1 ]; then
echo 'Usage: apt-rdepends-tree [-r] <package>'
echo 'Required packages: apt-rdepends'
exit 1
fi
@brcha
brcha / qtyaml.h
Created September 30, 2014 13:09
Qt Yaml support using yaml-cpp library
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* ***** END LICENSE BLOCK ***** */
/*
@mity
mity / hsv.c
Created July 18, 2013 23:38
RGB <--> HSV color conversion functions for Windows, in integer arithmetics.
/*
* RGB <--> HSV conversion in integer arithmetics, to be used on Windows.
* Copyright (c) 2013 Martin Mitas
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions: