Skip to content

Instantly share code, notes, and snippets.

View fccoelho's full-sized avatar
🏠
Working from home

Flávio Codeço Coelho fccoelho

🏠
Working from home
View GitHub Profile
@fccoelho
fccoelho / test_virtualenvmagic.py
Created June 5, 2012 11:04 — forked from minrk/shebang.py
Prototype of an extension to provide acess to virtual python environment on an IPython notebook cell
# -*- coding: utf-8 -*-
"""
Tests for the virtualenvmagic extension
Author: Flávio Codeço Coelho - @fccoelho
"""
import os
import nose.tools as nt
@fccoelho
fccoelho / mongodb-upstart.sh
Created March 8, 2012 13:45 — forked from onedesign/mongodb-upstart.sh
Ubuntu upstart script for MongoDB with automatic repair
# Ubuntu upstart file at /etc/init/mongodb.conf
pre-start script
mkdir -p /var/lib/mongodb/
mkdir -p /var/log/mongodb/
end script
start on runlevel [2345]
stop on runlevel [06]
@fccoelho
fccoelho / ode_tut.py
Created November 4, 2011 13:03
Exemplos de integração numérica de sistemas de equações diferenciais ordinárias.
# coding:utf8
"""
Exemplos de integração numérica de sistemas de equações diferenciais ordinárias.
ode : interface para a coleção de solvers VODE http://www.netlib.org/ode
Flávio Codeço Coelho
Licença: GPL
"""
@fccoelho
fccoelho / README
Created September 21, 2011 17:26 — forked from uiltondutra/gist:231960
MongoDB init script for a sharding node.
To install this init script, you should save mongodb to /etc/init.d/ and mongosharding.conf to /etc/
then run the following commands as root or with sudo:
chmod 755 /etc/init.d/mongodb
chown root:root /etc/init.d mongodb
update-rc.d mongodb defaults
This installation procedure was tested on UBUNTU 11.10
@fccoelho
fccoelho / cgibbs.pyx
Created December 28, 2010 09:37
Comparison of MCMC implementations in Python and Cython. This is discussed here: http://pyinsci.blogspot.com/2010/12/efficcient-mcmc-in-python.html
'''
Pure cython version
compile with:
$ cython cgibbs.pyx
$ gcc -shared -pthread -fPIC -fwrapv -O2 -Wall -fno-strict-aliasing -I/usr/include/python2.6 -o cgibbs.so cgibbs.c
then import from python shell and call main()
'''
import random,math, time
"""
MinMax peak detector
Originally from:
https://fedorahosted.org/pydarn/export/dfbf33a36aab3f576ec585f66b6bc99dfd5750d7/peakdetect/MinMax.py
"""
import sys, copy, math
import numpy
@fccoelho
fccoelho / peakdetect.py
Created February 11, 2010 13:46 — forked from endolith/peakdet.m
simple peak detection code
import sys
from numpy import NaN, Inf, arange, isscalar, array
def peakdet(v, delta, x = None):
"""
Converted from MATLAB script at http://billauer.co.il/peakdet.html
Returns two arrays
function [maxtab, mintab]=peakdet(v, delta, x)