AGI STK in Virtualbox on Linux

AGI STK (Systems Tool kit) does not currently run under WINE for version 10 of STK.
However, you can run STK from VirtualBox using Windows guest virtual machine.
Currently (with VirtualBox 4.3.16) you may find that STK crashes upon opening a scenario. Shutdown your virtual machine and try disabling 3D acceleration, enabling 2D acceleration, and setting video memory to at least 64MB. This “worked for me”

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)


#!/bin/bash

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

if [ $# -eq 1 ]; then
srchText=$1
fDir="."
fntmp="*"
elif [ $# -eq 2 ]; then
fDir=$1
srchText=$2
fntmp="*"
elif [ $# -eq 3 ]; then
fDir=$1
srchText=$2
fntmp=$3
else
echo usage: "findtext [DIR] TEXT [FILENAME]"
echo searches for TEXT under DIR and echos back filenames
exit
fi

# 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:

https://github.com/scienceopen/cv-utils/blob/master/lineClipping.py

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
HDF5_DISABLE_VERSION_CHECK=1 octave
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 maxent.py
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 Paypal.com, 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

Restart Matlab, and before doing anything type:

opengl('neverselect')

Then at plotting time:

figure
set(gcf,'renderermode','manual','renderer','painters')
slice(..)

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
Prereqs:
python3-setuptools

In cygwin type
easy_install-3.2 pip

to use pip3 type in Cygwin
pip3.2