Skip to content

Instantly share code, notes, and snippets.

View mehransahandi's full-sized avatar

Mehran Turna mehransahandi

View GitHub Profile
@mehransahandi
mehransahandi / SensorService.java
Created March 26, 2019 20:48 — forked from julian-ramos/SensorService.java
Code to have a foreground service recording accelerometer data at a sampling rate that is at least the one specified when the sensor is registered. This service restarts itself and also survives power saving modes. This was only tested on an android watch
public class SensorService extends Service implements SensorEventListener, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener {
// final Handler handler = new Handler();
private PowerManager pm;
private PowerManager.WakeLock wl;
GoogleApiClient googleClient;
String tail=".";
String recordingStrategy="";
int countDM=0;
boolean thread=false;
@mehransahandi
mehransahandi / Hodgkin Huxley.py
Created May 29, 2017 12:04 — forked from slarson/Hodgkin Huxley.py
Hodgkin Huxley Python Implementation
import scipy as sp
import pylab as plt
from scipy.integrate import odeint
from scipy import stats
import scipy.linalg as lin
## Full Hodgkin-Huxley Model (copied from Computational Lab 2)
# Constants
C_m = 1.0 # membrane capacitance, in uF/cm^2