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 <Wire.h> | |
#define EEP_ADDR 0x50 | |
void dump(); | |
void setup() | |
{ | |
Wire.begin(); // join i2c bus (address optional for master) | |
Serial.begin(9600); // start serial for output |
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
#!/env/python | |
import sys | |
import os | |
import numpy as np | |
import pandas as pd | |
from pandas.io.parsers import read_csv | |
BASE_PATH='/media/F_DRIVE/FSM 2014' |
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
#!/env/python | |
import os | |
from glob import glob | |
from tifffile import TiffFile | |
BASE_DIR='{whatever}' | |
for tfpath in sorted(glob(os.path.join(BASE_DIR,'*.tif'))): | |
tf = TiffFile(tfpath) | |
tfn = os.path.basename(tfpath) |
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 skimage.feature import peak_local_max | |
from skimage.filter import threshold_otsu | |
import scipy.ndimage as ndi | |
def count_bright(Y): | |
t = threshold_otsu(Y) | |
D = ndi.distance_transform_edt(Y > t) | |
Pl = peak_local_max(D,indices=False) | |
_, count = ndi.label(Pl) | |
return count |
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 <iostream> | |
#include <string> | |
#include <boost/thread.hpp> | |
#include <boost/asio.hpp> | |
#define N_THREADS 4 | |
#define N_JOBS 10 | |
/* compile on Ubuntu using | |
g++ par.cpp -lboost_thread -lboost_system |
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 sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy import Column, String, Integer, Numeric | |
from sqlalchemy.orm import backref, relationship | |
Base = declarative_base() | |
class Thing(Base): | |
__tablename__ = 'things' | |
id = Column(Integer, primary_key=True) |
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 pandas import DataFrame, merge | |
import numpy as np | |
# generate array of random small integers | |
df1 = DataFrame(np.random.random_integers(5,size=(5,2)),columns=['a','b']) | |
# find unique values | |
uq = df1.a.unique() | |
# now generate two associated columns per unique value |
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
# Name: Makefile | |
# Author: <insert your name here> | |
# Copyright: <insert your copyright message here> | |
# License: <insert your license reference here> | |
# This is a prototype Makefile. Modify it according to your needs. | |
# You should at least check the settings for | |
# DEVICE ....... The AVR device you compile for | |
# CLOCK ........ Target AVR clock rate in Hertz | |
# OBJECTS ...... The object files created from your source files. This list is |
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
ECHO OFF | |
cd /d %~dp0 | |
for /f "tokens=2* delims= " %%F IN ('vagrant status ^| find /I "default"') DO (SET "STATE=%%F%%G") | |
ECHO Close this window if it remains open, and http://localhost:8081 is responsive | |
IF "%STATE%" NEQ "saved" ( | |
ECHO Starting Vagrant VM from powered down state... | |
vagrant up | |
) ELSE ( |