Find Gmail email with any attachment e.g. PDF
Find all PDFs sent to joe@yahoo.com: type in GMail search:
to:joe@yahoo.com filename:pdf
Find any email sent to joe@yahoo.com with any attachment:
to:joe@yahoo.com has:attachment
Find all PDFs sent to joe@yahoo.com: type in GMail search:
to:joe@yahoo.com filename:pdf
Find any email sent to joe@yahoo.com with any attachment:
to:joe@yahoo.com has:attachment
The Lenovo X220 represents the pinnacle of ThinkPad development, having in effect a 7 row keyboard, excellent display and battery life. Now that new old stock (NOS) 42T4967 slice batteries are showing up at reasonable prices, it’s worth thinking about adding one on. The Lenovo X220 can have a second “slice” battery that snaps onto the bottom, adding nearly 60 Watt-hour to the 86 Watt-hour 9-cell battery built-in to most Lenovo X220. By this time, you might not have your full 9-cell 42T4940 battery life anymore, so the slice battery will nearly double your battery working time.
Charging order: Lenovo firmware prioritizes charging first the built-in (non-slice battery) first, and the slice battery last.
When discharging, the slice battery discharges first all the way, then the built-in battery is used.
For those working with real-world inverse problems, P.C. Hansen’s AIRtools and ReguTools are great ways to quickly try out inverse methods.
As in general in Python and Matlab, you need to be sure that your column vector of observations “b” is actually passed into the functions as a column vector. I’ll illustrate the issue by example.
Assume you have ill-conditioned problem Ax = b, with dimensions:
| variable | dimensions |
|---|---|
| A | 256 x 10 |
| x | 10 x 1 |
| b | 256 x 1 |
so to use the ReguTools function maxent.m from Python, implementing the Berg Maximum Entropy method, your myinv.py file would look like:
import oct2py
import numpy as np
def myinv(A,b,maxentLambda):
oc = oct2py.Oct2Py(oned_as='column')
oc.addpath('ReguTools')
xhat = oc.maxent(A,b,maxentLambda)
return xhatPC Hansen AIRtools and Regutools in Python.
Assuming an OCR’d book or other text file that has line numbers embedded in file neat.py:
1 # cool program
2 import sys
3 def howneat():
4 sys.exit('Thanks for visiting')
Remove the line numbers by typing in Terminal:
perl -pe 's/^[ t]+d+//' neat.py > neater.pyRegular expression:
^[ t]+d+
\^[ t]+d+-pneat.py.-eAnd we replace with nothing. This leaves alone the indentation of the code (relevant for Python).
I could have used the -i flag to edit in place, but I instead redirected STDOUT to neater.py in case I made a mistake (inputting the wrong file, for example).
For a
simple test (a horizontal linear shift)
imwarp() was several times faster than imtransform()
bg = imread('myimage.jpg');
[nRow,nCol] = size(bg);
tform = affine2d(T);
RA = imref2d([nCol,nRow],[1 nCol],[1 nRow]);
data(:,:,i) = imwarp(bg, tform, outputView=RA);tform = maketform('affine',T);
data(:,:,i) = imtransform(bg,tform,...
Udata=[1 nCol],...
Vdata=[1 nRow],...
Xdata=[1 nCol],...
Ydata=[1 nRow]);This
Python program extracts the LaTeX
word count and equation count and several other counts such as floating element count from a LaTeX document set, using the Perl script texcount.
git clone https://github.com/scivision/texcounts.git
pip install -e .Plot progress:
python texwcpost.py mydissertation.texUpload to the SFTP server:
python phdwc.py mydissertation.tex serverAddress username serverDirectoryJohn Bahcall 1977 paper advocates for the Hubble Space Telescope in accessible language.
The [Hubble] Space Telescope: Out Where the Stars Do Not Twinkle
A favorite vector symbol is a harpoon.
in document header
\usepackage{harpoon}
\newcommand*{\vect}[1]{\overrightharp{\ensuremath{#1}}}in document body where desired.
$\vect{x}$harpoon package defaults to text mode, which will fail when math characters like ell are used in the math mode.Manually put a USB HDD that doesn’t automatically spin-down after inactivity to sleep with sg_start
apt install sg3-utilsDetermine which device ID by:
lsblkAssuming the HDD to
spin down
was at /dev/sdc:
sg_start 0 --pc=3 /dev/sdcThe HDD wakes up automatically when writing/reading a file on it.
We spin down hard drives because HDDs put out substantial heat when spinning, but don’t spin up/down too frequently to avoid excessive wear.
Phoronix Test Suite is a well regarded benchmarking suite that supports most operating systems. This gives the ability to accurately benchmark operating system performance errors, and has been used to find Linux kernel performance regressions.
Download and install
run tests
phoronix-test-suite benchmark c-ray
phoronix-test-suite benchmark hpcc
phoronix-test-suite benchmark scimark2
phoronix-test-suite benchmark xonoticList results
phoronix-test-suite list-saved-resultsConvert results to PDF
phoronix-test-suite result-file-to-pdf myTest