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 parseDetail(line): | |
corrects = 0 | |
wrongs = 0 | |
partials = 0 | |
for i in range(0,len(line)): | |
c = line[i] | |
if c=='+': corrects=corrects+1 | |
if c=='-': wrongs=wrongs+1 |
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
%panthgompkins with heart beat detection | |
% [email protected] | |
clc; | |
clear all | |
close all | |
x1 = load('ecg3.dat'); | |
y=length(x1); | |
fs = 200; | |
N = length (x1); | |
t = [0:N-1]/fs; |
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
#include "pebble_os.h" | |
#include "pebble_app.h" | |
#include "pebble_fonts.h" | |
#define MY_UUID { 0x39, 0x20, 0xBF, 0x15, 0xE4, 0xDA, 0x4E, 0x77, 0x9C, 0xDB, 0x3E, 0xD1, 0xCB, 0x6F, 0x28, 0xFB } | |
PBL_APP_INFO(MY_UUID, | |
"Hello World App", "ElctronicsMadeEasy", | |
1, 0, /* App version */ | |
DEFAULT_MENU_ICON, | |
APP_INFO_STANDARD_APP); |
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 Name: manualCopy | |
* | |
* Description: Manually copies data from memory to memory. This is used by | |
* sysFastMemCopy to copy a few lingering bytes at the beginning and end. | |
* | |
*****************************************************************************/ | |
inline void manualCopy( uint8 *pDest, uint8 *pSrc, uint32 len ) |
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 numpy as np | |
def run(): | |
# create a column vector | |
col_vec = np.array([[1], [2]]) | |
print "column vector" | |
print col_vec | |
# create a row vector | |
row_vec = np.array([[1, 2]]) |
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
Walter Bright's MEM Package | |
--------------------------- | |
PREFACE: | |
-------- | |
The files, MEM.H and MEM.C which constitute the MEM package were originally | |
published in the March-April 1990 edition of Micro Cornucopia magazine, now | |
sadly out of print. The files as they appear in SNIPPETS have been edited |
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
#define POLY 0x8408 /* bits reversed for LSB-first */ | |
unsigned short crc = 0xffff; | |
while (len-- > 0) { | |
unsigned char ch = *bufp++; | |
for (i = 0; i < 8; i++) { | |
crc = (crc >> 1) ˆ ( ((ch ˆ crc) & 0x01) ? POLY : 0 ); | |
ch >>= 1; | |
} | |
} |
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
# Written by Raul Aguaviva as an exercise | |
# beware not optimized for speed :-) | |
from struct import * | |
import math | |
zigzag = [0, 1, 8, 16, 9, 2, 3, 10, | |
17, 24, 32, 25, 18, 11, 4, 5, | |
12, 19, 26, 33, 40, 48, 41, 34, | |
27, 20, 13, 6, 7, 14, 21, 28, |
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 urllib | |
import smtplib | |
import time | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
from random import randint | |
def sendemail(session,me,you,subject,html): | |
# Create message container - the correct MIME type is multipart/alternative. |
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
# Back-Propagation Neural Networks | |
# | |
# Written in Python. See http://www.python.org/ | |
# Placed in the public domain. | |
# Neil Schemenauer <[email protected]> | |
import math | |
import random | |
import string |