Skip to content

Instantly share code, notes, and snippets.

@vanne02135
vanne02135 / flickr_view_public.py
Last active December 6, 2018 13:12
Download flickr images and retain metadata in exif
import flickr_api
import os
import random
import sys
from fractions import Fraction
import piexif
import piexif.helper
from iptcinfo import IPTCInfo
import urllib2
import argparse
# Demonstrate data download from Emfit API
# Config
remember_token="XXXXXXXX" # token returned from API login
device_id=666 # Your own device id number
from_date = "2017-01-01"
to_date = "2017-01-14"
# End of config
@vanne02135
vanne02135 / sofaHandling.cpp
Created August 31, 2016 12:07
Reading raw impulse responses and direction from sofa file
#ifdef OLD_HEADER_FILENAME
#include <iostream.h>
#else
#include <iostream>
#endif
#include <string>
#include <vector>
#ifndef H5_NO_NAMESPACE
#ifndef H5_NO_STD
@vanne02135
vanne02135 / OnlinePlotter.py
Last active August 29, 2015 14:23
Online plotter using matplotlib
# Plot line per line, can be used as a serial plotter
import matplotlib.pyplot as plt
import numpy
import time
import math
import random
class OnlinePlotter:
@vanne02135
vanne02135 / HB100_serial.ino
Last active August 29, 2015 14:23
HB100 doppler module data handling and display to lcd and serial.
/*
HB100 Microwave Doppler data analysis and display of max and current speed.
*/
#include <LiquidCrystal.h>
int FoutPin = 13;
int resetPin = 12;
## Determine speed from frequency output of HB100 module
# Input file is logged with NI Datalogger
import sys
import numpy as np
from matplotlib import pyplot
from matplotlib.mlab import find
def speedFromTV(t, v):
# t = time array / list
@vanne02135
vanne02135 / ReverberationNewFormula.m
Created December 25, 2011 22:46
Calculate rectangular room reverberation time according to the Neubauer et al: Prediction of the Reverberation Time in Rectangular Rooms with NonUniformly Distributed Sound Absorption, equation. 20
%% According to the http://sound.eti.pg.gda.pl/papers/prediction_of_reverberation_time.pdf, eq. 20
l = 5; % room length
w = 8; % room width
h = 5.5; % room height
alpha_w1 = 0.01; % absorption coeff for wall 1
alpha_w2 = 0.01; % absorption coeff for wall 2 .. more to follow
alpha_c = 0.3; % absorption coeff for ceiling
@vanne02135
vanne02135 / calFetch.js
Created May 2, 2011 21:52
Get calendar entries to spreadsheet on Google Apps (see Tools -> Script Editor on Google Spreadsheets)
function onOpen() {
// create menu entry for starting calFetch script
var ss = SpreadsheetApp.getActiveSpreadsheet();
var menuEntries = [{name: "Get calendar entries", functionName: "calFetch"}];
ss.addMenu("Calendar", menuEntries);
}
function calFetch() {
// get calendar entries and show them and total times
@vanne02135
vanne02135 / ParaView_ProgSource_CreatePoints.py
Created March 29, 2011 18:40
Create 3D points with associated data in Paraview Programmable source
# run in paraview programmable source
import math
pdo = self.GetOutput()
myPts = vtk.vtkPoints()
myData = vtk.vtkDoubleArray()
myData.SetName("MyData")
myData.SetNumberOfComponents(2)
@vanne02135
vanne02135 / trianglesoup.cpp
Created December 22, 2010 21:06
Will contain visibility functionality for triangle soup some day
/*
* File: main.cpp
* Author: vanne
*
* Created on December 22, 2010, 10:00 PM
*/
#include <cstdlib>
#include <iostream>
#include <vector>