Matplotlib TkAgg

Now that Matplotlib 1.4 has been released, BEFORE upgrading matplotlib with
sudo pip3 install --upgrade matplotlib

consider first installing tk-dev
sudo apt-get install tk-dev

Find text string in file

I save a script named “findtext” that will look inside any file smaller than my maximum (avoiding searching huge binary file)


maxFileSize=10M #don't search inside huge binary files

if [ $# -eq 1 ]; then
elif [ $# -eq 2 ]; then
elif [ $# -eq 3 ]; then
echo usage: "findtext [DIR] TEXT [FILENAME]"
echo searches for TEXT under DIR and echos back filenames

# dont use -execdir, or you wont see which directory the found files are in!
find $fDir -type f -name "$fntmp" -size -$maxFileSize -exec grep --ignore-case --files-with-matches "$srchText" {} +

Cohen-Sutherland line clipping in Python

Here is my version of Cohen-Sutherland line clipping for Python:

Cygwin64 HDF5 load() crash fix

Currently, Octave 3.8.1 in Cygwin64 was compiled with headers 1.8.12 but HDF5 library 1.8.13.

This causes Octave to seg fault Warning! ***HDF5 library version mismatched error*** and exit.

To avoid having to recompile, you can type
to startup octave
you can perhaps add to your ~/.bashrc file the line:
alias octave="HDF5_DISABLE_VERSION_CHECK=1 octave -q"

Maximum Entropy Regularization on Python

I have ported to Python the maxent.m function now called
This is for maximum entropy regularization, from PC Hansen’s Regutools.

Matplotlib 3D plotting: how to import

For 3D plotting to work in Matplotlib, near the beginning of the first .py file you use to start your program, you must have imports in this order:

import matplotlib as mpl
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt

If you try importing Axes3D in a later function that actually does the 3D plotting, it may give a runtime error.

If you feel you may use either function as an entry point, you can put the above 3 lines of code in both functions.

Getting a metal enclosure for Ettus USRP B200/B210

Current (Aug. 2014) USRP B200/B210 come with Micro-USB 3.0 connector, and the custom housing is available direct from Takachi Electronics Enclousure Co, Ltd..

Request a quote for the MXA3-11-16SSH
The current price is about $200 in single quantities and Fedex overnight shipping is about $30 currently. It takes a few business days for them to manufacture the case.
Of the $200, about 90% of the cost is for machining and 10% for materials.

There is currently no “buy it now” button on their website, so you will have to use Paypal the old-fashioned way.
Check the bottom of your Takachi quote for payment information, such as the specific email address to send Paypal to (you will login to, click Send Money, and type in that email address). Remember to type your invoice or quote number into the Paypal comments along with your name before submitting the payment so that they know who the payment is from.

The person I worked with was Tadateru Sei, who always responded the next business day (usually I sent email at night Japan time, and got the reply several hours later during Japan daytime).

From forum discussions, in coming months there may be easier ways to order, but for now this worked for me.

Stop 3-D plot crashing on Matlab over VNC

The process below is for Matlab R2014a and earlier. R2014b and newer do not support the




Restart Matlab, and before doing anything type:


Then at plotting time:


and so on

Cygwin Python 3 pip install: Segmentation fault

Note: I get segmentation fault upon pip3.2 command, has anyone solved this?

This was tested on Cygwin 1.7.31 with Python 3.2 and may be out of date when you read this

In cygwin type
easy_install-3.2 pip

to use pip3 type in Cygwin

H5Labview and 1-D arrays

The current version of h5labview can completely crash Labview 2013 SP1 when using 1-D arrays.

What I do to fix this is insert the “Build Array” into my 1-D array just before it hits HDF5 Write Data. On the Read Data, to get a 1-D array again, you can use Index Array with the first row index input as 0.