unclej's blog

Round Robin Plots using Matplotlib

I saw this question on unix.stackexchange.com and figured it'd be fun to try and do it with matplotlib. After an hour or so I had the following code hacked together:

#!/usr/bin/env python

'''
Module to illustrate a quick and dirty way to make a ticker for
ur machine info using matplotlib and sqlite
'''


# for calling some command lines:
import os
import commands

# for plotting:

Installing Matplotlib-1.4 (master) on OpenBSD-5.3

There's a little hitch if you are trying to install the latest version of matplotlib on your OpenBSD box... The usual

# python2.7 setup.py install

will fail when the compiler tries to find Xlib.h on your system. The location of the includes for X11 are different on OpenBSD. No worries though -- just set the CFLAGS environmental variable using pkg-config like so:

# git clone git://github.com/matplotlib/matplotlib.git
# cd matplotlib

Warp Drives In General Relativity

The concept of a warp drive has been the stuff of science fiction for the longest time.. But all that is changing with the Alcubierre Drive. In 2000 Alcubierre posted the first paper on the matter and it's been an active area of research ever since. The Alcubierre (or "warp drive") metric is usually discussed in the context of an ADM formalism.

Variance And the Linearity Of Expectation

Ch. 1, Problem 8 - Data Reduction and Error Analysis for the Physical Sciences by Philip Bevington:

Justify the second equality in equations (1.8) and (1.14).

Solution:

In both cases this is a straight forward calculation using the distributive property of discrete and continuous (or integral) summation. Observe for equation (1.8),

\[\lim_{N \to \infty} \frac{1}{N} \sum (x_i - \mu)^2\]

\[= \lim_{N \to \infty} \frac{1}{N} \sum ({x_i}^2 - 2 x_i \mu + {\mu}^2)\]

Significant Figures using Python

Ch. 1, Problems 1, 2, and 3 - Data Reduction and Error Analysis for the Physical Sciences by Philip Bevington:

  1. How many significant figures are there in the following numbers?
    1. 976.45
    2. 84,000
    3. 0.0094
    4. 301.07
    5. 4.000
    6. 10
    7. 5280
    8. 400
  2. What is the most significant figure in each of the numbers? What is the least significant?
  3. Rround off each of the numbers above to two significant digits.

Power-Quant Recommendations:

Syndicate content