Skip to content

Instantly share code, notes, and snippets.

@Opiprog
Opiprog / cpu_occupy.py
Created May 3, 2013 22:33
Script to occupy CPU at 100% on the Raspberry Pi
# Occupy CPU python code
i=0
while True:
i=i+1
if i==10:
i=0
@Opiprog
Opiprog / 3Dpara.py
Created May 3, 2013 15:56
3D Parametric Equation Plot in Ipython-Matplotlib-Sympy
from sympy import symbols, cos, sin
from sympy.plotting import plot3d_parametric_surface
x,y = symbols('x y')
plot3d_parametric_surface(x**2, y**2, x-y, (x, -5, 5), (y, -5, 5))
@Opiprog
Opiprog / contact_code1.py
Created May 2, 2013 13:28
Ipython-Matplotlib-Pylab 2D Two-line graph
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import *
from matplotlib import cm
from matplotlib.ticker import LinearLocator, FormatStrFormatter
import matplotlib.pyplot as plt
import numpy as np
import sys
from pylab import *
rcParams['legend.loc'] = 'best'
@Opiprog
Opiprog / gist:5501267
Created May 2, 2013 09:57
Plot legend with Matplotlib
plot(x,g1, label='major axis')
plot(y,g2, label='minor axis')
legend()
Index Axial Load FE AA IE
0 70 25 3 -10
1 195.9902 24.97371961 3.235454367 -9.992665938
2 400.7797 24.89494269 3.470092195 -9.97068168
3 773.9403 24.76386181 3.703099776 -9.934100971
4 1254.5773 24.58079744 3.933669057 -9.88301324
5 1760.8765 24.34619711 4.161000441 -9.81754338
6 2173.2502 24.06063434 4.384305557 -9.737851445
7 2404.0408 23.72480725 4.602809999 -9.644132256
8 2537.4333 23.33953682 4.815756011 -9.536614927
Sub CopyData()
Dim i As Long
Dim j As Long
i = 0
j = 1
Header = Range("A" & (1 + (258 * i)))