This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import DAQ | |
daq = DAQ("Dev1/ai0:2") | |
volts = daq.voltage() | |
amps = daq.current() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install autogen --use-clang | |
==> Downloading http://ftpmirror.gnu.org/autogen/rel5.14/autogen-5.14.tar.gz | |
File already downloaded in /Users/daniel/Library/Caches/Homebrew | |
==> ./configure --disable-debug --prefix=/usr/local/Cellar/autogen/5.14 | |
==> make | |
make all-recursive | |
Making all in compat | |
: | |
Making all in snprintfv | |
for f in filament.c format.c printf.c mem.c stream.c custom.c ; do echo "#include \"$f\"" ; done > snv.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import * | |
from clint.textui import colored, columns | |
# | |
# Using a module called Clint to take care of printing columns and text colour | |
# | |
# Examples: http://www.nicosphere.net/clint-command-line-library-for-python/ | |
# Github: https://github.com/kennethreitz/clint | |
# Install: pip install clint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
######################################################################################### | |
# | |
# planar 1D DBR modified to export absolute electric field and Poynting vector profiles | |
# | |
######################################################################################## | |
from camfr import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fipy import * | |
# | |
# Solution mesh | |
# | |
nx = 200 | |
dx = 0.01 | |
L = nx * dx | |
mesh = Grid1D(nx = nx, dx = dx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://matforge.org/wd15/blog | |
from __future__ import division | |
from fipy import * | |
# Grid things | |
N = 1000 | |
D = 1 | |
dx = D / N | |
m = Grid1D(nx=N, dx=dx) | |
I_right = CellVariable(mesh=m, value=1., name='I_right') # Intensity along the positive direction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://matforge.org/wd15/blog | |
from __future__ import division | |
from fipy import * | |
# Grid things | |
N = 1000 | |
D = 1 | |
dx = D / N | |
m = Grid1D(nx=N+1, dx=dx) + [[-dx/2.]] | |
I_right = CellVariable(mesh=m, value=1., name='I_right') # Intensity along the positive direction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fipy import * | |
from fipy.tools.numerix import exp | |
# Basic Setup | |
nx = 200; dx = 0.01; L = nx * dx | |
A = 15.0; B = 0.1; phi_0 = 1.; D = 1. | |
mesh = Grid1D(nx = nx, dx = dx) | |
# Cell variable and constrains |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division | |
from openopt import * | |
from FuncDesigner import * | |
# Constants | |
kb = 1.3806503e-23 # Boltzmann's Constant (m2 kg s-2 K-1) | |
elq = 1.60217646e-19 # Elemental charge (C) | |
h = 6.626068e-34 # Planck's constant (m2 kg s-1) | |
c = 299792458.0 # Speed of light (m/s) | |
fs = 6.8e-5 # Solar etendue (fraction of pi) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSPoint ConstrainPointInsideRect(CGPoint freePoint, NSRect boundaryRect) | |
{ | |
//NSPoint constrainedViewPoint = DFConstrainPointToRect(viewPoint, boundaryRect); | |
// Make sure the handle cannot be dragged outside of the plot range | |
if (NSPointInRect(freePoint, boundaryRect)) { | |
return freePoint; | |
} | |
NSPoint cp = freePoint; |
OlderNewer