This file contains hidden or 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 operator import itemgetter | |
| import win32com.client | |
| import time | |
| run_time=time.ctime() | |
| strComputer = "." | |
| objWMIService = win32com.client.Dispatch("WbemScripting.SWbemLocator") | |
| objSWbemServices = objWMIService.ConnectServer(strComputer,"root\cimv2") | |
| procItems = objSWbemServices.ExecQuery("Select * from Win32_Process") | |
| plist=[]; | |
| pcnt1=0 |
This file contains hidden or 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
| G=imread('garlic_chive_flowers-color.tif','tif'); | |
| %G=imread('Cavolfiore_Di_Sicilia_Violetto.jpg','jpg'); | |
| G=double(G); | |
| MG1 = ones(size(G(:,:,1),1),1)*mean(G(:,:,1)); | |
| MG2 = ones(size(G(:,:,2),1),1)*mean(G(:,:,2)); | |
| MG3 = ones(size(G(:,:,3),1),1)*mean(G(:,:,3)); | |
| G1 = G(:,:,1)-MG1; | |
| G2 = G(:,:,2)-MG2; | |
| G3 = G(:,:,3)-MG3; |
This file contains hidden or 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 pylab import * | |
| import wave | |
| sig = wave.open('ycn9999 _out.wav','r') | |
| xsig = sig.readframes(-1) | |
| xsig = fromstring(xsig, 'Int16') | |
| f = sig.getframerate() | |
| spectrogram = specgram(xsig[0:300000], Fs = f, scale_by_freq=True,sides='default') | |
| axis('tight') | |
| title('Spectrogram of Sound Synthesis Variant 2, with Python'); |
This file contains hidden or 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
| /* | |
| Memsic2125 | |
| Read the Memsic 2125 two-axis accelerometer. Converts the | |
| pulses output by the 2125 into milli-g's (1/1000 of earth's | |
| gravity) and prints them over the serial connection to the | |
| computer. | |
| The circuit: | |
| * X output of accelerometer to digital pin 2 | |
| * Y output of accelerometer to digital pin 3 |
This file contains hidden or 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
| midi_fname='Scarlatti_Sonata_Longo483_K322.mid'; | |
| % MIDI scripts from: http://www.kenschutte.com/midi | |
| midi = readmidi(midi_fname); | |
| Notes = midiInfo(midi,0); | |
| %diff start and stop times | |
| dNo5=diff(Notes(:,5)); | |
| dNo6=diff(Notes(:,6)); | |
| % To Reconstruct Time Data |
This file contains hidden or 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 sys, requests | |
| # requests is a third party module, more robust that urllib... | |
| #http://docs.python-requests.org/en/latest/ | |
| from lxml import html | |
| if len(sys.argv)==1: | |
| #url_name="https://en.wikipedia.org/wiki/Fa%C3%A0_di_Bruno%27s_formula" | |
| #url_name="https://secure.wikimedia.org/wikipedia/en/wiki/Euler%E2%80%93Maclaurin_formula" | |
| #url_name="https://en.wikipedia.org/wiki/Generalized_normal_distribution" | |
| url_name="https://en.wikipedia.org/wiki/Jacobi_elliptic_functions" |
This file contains hidden or 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
| function [imeq,pdfim,cdfim]=hist_eqcv(im, nbins) | |
| %__________________________________________________________________ | |
| % Description: Historgram Equalization | |
| % | |
| % Input Variables: | |
| % Assume | |
| % im = double(imread('image_file_name')); | |
| % im=im(:,:,1); | |
| % Get image format back | |
| % im_retrieve=uint8(round(im)); |
This file contains hidden or 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
| % %loadfile.m @http://www.ece.rutgers.edu/~orfanidi/ece525/subspace.zip | |
| [Y,T] = loadfile('Saccharomyces_cerevisiae_GENES.txt'); | |
| [RT,CT]=size(T); | |
| for n=1:CT | |
| DNA((n-1)*RT +1:n*RT)=T(:,n); | |
| end | |
| % % NAk=size(DNA,2); | |
| NAk=1200; | |
| N=floor(NAk/5); | |
| M=zeros(N,6); |
This file contains hidden or 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 datetime | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| import matplotlib.cm as cm | |
| import time | |
| import pandas as pd | |
| # # import json | |
| # # Keep q_symbol_dict.py in same directory | |
| import q_symbol_dict | |
| try: |
This file contains hidden or 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
| def sym_dict(opt): | |
| if opt==0: | |
| symbol_dict = { | |
| 'XOM': 'Exxon', | |
| 'CVX': 'Chevron', | |
| 'COP': 'ConocoPhillips', | |
| 'VLO': 'Valero Energy', | |
| 'MSFT': 'Microsoft', | |
| 'IBM': 'IBM', | |
| 'T': 'AT&T', |
OlderNewer