Three things I’ve come to believe about post modern C++

In no particular order: Template metaprogramming is still evil, and C++11/14 hasn’t fixed anything about it. People argue metaprogramming enables “clean, elegant code,” as if a home built on a garbage dump won’t smell like garbage. If anyone else needs to repair or extend the foundation of your home they’ll

Read More »

Displaying a sequence of images in iPython Notebooks

You can rip a sequence of images into an mp4 and display it inline in an ipython notebook using a function like this: import matplotlib.pyplot as plt from matplotlib import animation from IPython.display import display, HTML def plot_movie_mp4(image_array): dpi = 72.0 xpixels, ypixels = image_array[0].shape[0], image_array[0].shape[1] fig = plt.figure(figsize=(ypixels/dpi, xpixels/dpi),

Read More »

Compiling OpenCV 3.1 on Ubuntu 16.04

16.04 uses gcc 5.4 by default. You’ll need to install gcc 4.9 and configure OpenCV to use 4.9 instead: sudo apt-get install g++-4.9 cmake -DCMAKE_C_COMPILER=/usr/bin/gcc-4.9 -DCMAKE_CXX_COMPILER=/usr/bin/g++-4.9 . If you have CUDA installed you may want to disable compiling the CUDA libraries as well, or else suffer another hour+ of compilation

Read More »

On the Art of Debugging Software

Excerpt from Mager, Troubleshooting the Troubleshooting Course, 1982: A 1979 study by Cutler (Problem Solving in Clinical Medicine) made an observation about the importance of probability information by offering three maxims for diagnosticians: Common diseases occur commonly. Uncommon manifestations of common diseases are more common that common manifestations of uncommon

Read More »

Embedding images in HTML email for Outlook

#!/bin/sh echo “Content-Type: multipart/related; boundary=\”boundary-example\”; type=\”text/html\”” echo echo “–boundary-example” echo “Content-Type: text/html” echo echo “<h1>Email</h1>” echo “<img src=\”cid:image.png\” alt=\”image\”>” echo echo “–boundary-example” echo “Content-Location: CID:something” echo “Content-ID: <image.png>” echo “Content-Type: image/png” echo “Content-Transfer-Encoding: BASE64” echo base64 /tmp/image.png echo “–boundary-example–” ./email.sh | sendmail some@emailaddress.com

Read More »

Linux 32bit PAE kernel with more than 8 cores

It’s not entirely obvious how to do this, but it can be done if you compile your own kernel. The trick is enabling BIGSMP before you select the number of CPUs.  If you don’t, you’ll get an error saying more than 8 cores is an invalid option. Kernel compilation instructions

Read More »

Enabling CTRL-ALT-DEL in Windows 7 over Synergy

I have a Linux machine running as my Synergy server and a Windows 7 machine as a client.  With the default Windows settings you can not enter a CTRL-ALT-DEL SAS (Secure Attention Sequence) over Synergy on the Windows lock screen. This can be frustrating if you lock your computer frequently

Read More »

Projects

Categories
Archives