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 sublime | |
import sublime_plugin | |
import os | |
import subprocess | |
import time | |
COMPILE_DIRECTORY = '/tmp/sublime-tikz' | |
TEMPLATE_FILE = os.path.join(os.path.dirname(__file__), 'template.tex') | |
try: |
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
% This is my first package | |
% jamwheel@stanford.edu | |
\NeedsTeXFormat{LaTeX2e} | |
\ProvidesPackage{wheelertikz}[2020-09-24 Package for drawing Tikz Figures for PhD program] | |
\usepackage{helvet} | |
\RequirePackage{helvet} | |
\RequirePackage{sfmath} | |
\usetikzlibrary{positioning, calc, shapes} |
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
/*============================================================================*/ | |
/* National Instruments / Data Acquisition */ | |
/*----------------------------------------------------------------------------*/ | |
/* Copyright (c) National Instruments 2015. All Rights Reserved. */ | |
/*----------------------------------------------------------------------------*/ | |
/* */ | |
/* Title: nidaqmxbase.h */ | |
/* Purpose: Include file for NI-DAQmxBase library support. */ | |
/* */ | |
/*============================================================================*/ |
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 instrumental.drivers.daq.ni import DAQ | |
[ INFO]2019-03-28 06:44:50,028 nicelib.nicelib: Creating class NiceObject... | |
[ INFO]2019-03-28 06:44:50,028 nicelib.nicelib: Creating class NiceObject... | |
[ INFO]2019-03-28 06:44:50,030 nicelib.nicelib: Creating class NiceLib... | |
[ INFO]2019-03-28 06:44:50,030 nicelib.nicelib: Creating class NiceLib... | |
[ INFO]2019-03-28 06:44:50,030 nicelib.nicelib: Processing attr '__module__' (<class 'str'>)... | |
[ INFO]2019-03-28 06:44:50,030 nicelib.nicelib: Processing attr '__module__' (<class 'str'>)... | |
[ INFO]2019-03-28 06:44:50,030 nicelib.nicelib: ...as an ordinary class attribute | |
[ INFO]2019-03-28 06:44:50,030 nicelib.nicelib: ...as an ordinary class attribute | |
[ INFO]2019-03-28 06:44:50,030 nicelib.nicelib: Processing attr '__qualname__' (<class 'str'>)... |
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/python | |
import tkFileDialog | |
from Tkinter import * | |
import sys | |
import re | |
class scrollTxtArea: | |
def __init__(self,root): | |
frame=Frame(root) |
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
# Some regular expression for parsing LTSpice gain files | |
import re | |
regex = r"^([\.0-9e+-]+)\t\(([\.0-9e+-]+)dB,([-0-9\.e+-]+)°\)" | |
path = # Insert your path here | |
with open(path) as file: | |
matches = re.finditer(regex, file.read(), re.MULTILINE) | |
freq, gain, phase = zip(*[(float(m.group(1)), float(m.group(2)), float(m.group(3))) for m in matches]) |
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
%pylab inline | |
from hardware import * | |
import pyfog | |
import time | |
import pandas as pd | |
from scipy.optimize import curve_fit | |
scale_factors = pd.DataFrame(columns=['scale_factor']) | |
for vpp in linspace(1.6, 2.5, 5): |
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 numpy as np | |
def combine(*args): | |
if len(args) == 2: | |
return np.concatenate([(x*y, x+y, abs(x-y), x/y, y/x) for x in args[0] for y in args[1]]) | |
return np.concatenate([combine(combine(*np.roll(args, i)[1:]), np.roll(args,i)[0]) for i in range(len(args))]) | |
vals = (np.arange(10) + 1).astype(np.float64) | |
for x in ("%i %i %i %i, %s" % (a,b,c,d, 24 in combine([a], [b], [c], [d])) for a in vals for b in vals for c in vals for d in vals if a <= b and b <= c and c <= d ): | |
print(x) | |
import numpy as np | |
def combine(*args): |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#include <Servo.h> | |
// Power pin is normally OFF | |
// Walk pin is normall ON | |
int walkPin = 2; | |
int powerPin = 3; | |
int togglePin = 3; | |
int bellPin = 12; |
NewerOlder