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 | |
import scipy, scipy.signal | |
def savitzky_golay( y, window_size, order, deriv = 0 ): | |
r"""Smooth (and optionally differentiate) data with a Savitzky-Golay filter. | |
The Savitzky-Golay filter removes high frequency noise from data. | |
It has the advantage of preserving the original shape and | |
features of the signal better than other types of filtering | |
approaches, such as moving averages techhniques. | |
Parameters |
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
UA_FIREFOX = new RegExp(".*Firefox/([0-9+]*).*") | |
UA_CHROME = new RegExp(".*Chrome/([0-9+]*).*") | |
UA_CHROMEFRAME = new RegExp(".*chromeframe/([0-9]*).*") | |
UA_WEBKIT = new RegExp(".*AppleWebKit/([0-9+\.]*)\w*.*") | |
UA_WEBOS = new RegExp(".*webOS/([0-9+\.]*)\w*.*") | |
var matchRegex = function(s, r) { | |
var m = r.exec(s) | |
if (m) return m[1] | |
return m |
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
/** | |
* Copyright (c) 2012 Ryan M. Hope <rmh3093 at gmail dot com> | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is | |
* furnished to do so, subject to the following conditions: | |
* |
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 panglery import Pangler, PanglerAggregate | |
class Common( object ): | |
pangler = Pangler() | |
class Listener1( Common ): | |
@Common.pangler.subscribe( e = "eventA", needs = ['event'] ) |
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 pygame | |
def _update( callback, fps, reactor, clock ): | |
if not callback(): | |
reactor.stop() | |
else: | |
delay = 1.0 / fps - ( clock.tick() / 1000.0 - ( 20.0 / fps ) / fps ) | |
if delay < 0: | |
reactor.callLater( 0 , _update, callback, fps, reactor, clock ) | |
else: |
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | |
"http://www.w3.org/TR/html4/loose.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<link rel="stylesheet" href="src/css/pre.css" media="only screen and (min-device-width : 320px) and (max-device-width : 480px)"> | |
<link rel="stylesheet" href="src/css/pre3.css" media="only screen and (min-device-width : 480px) and (max-device-width : 800px)"> | |
<link rel="stylesheet" href="src/css/touchpad.css" media="only screen and (min-device-width : 768px) and (max-device-width : 1024px)"> | |
<meta name="viewport" content="width=device-width, height=device-height, user-scalable=no" /> | |
<title>wTerm App</title> | |
<script src="/usr/palm/frameworks/enyo/1.0/framework/enyo.js" launch="nobridge" type="text/javascript"></script> |
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
enyo.kind({ | |
name: 'charKey', | |
kind: "CustomButton", | |
width: '50px', | |
height: '50px', | |
layoutKind: 'HFlexLayout', | |
pack: 'center', | |
align: 'center', | |
style: 'border-width: 1px; border-color: gray;', |
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
enyo.kind({ | |
name: 'Hybrid2', | |
kind: enyo.Hybrid, | |
rendered: function() { | |
this.pluginReady = false; | |
if (this.hasNode()) { | |
if (this.passTouchEvents) { | |
this.node.addEventListener("touchstart", this.nullTouchHandler); |
NewerOlder