Skip to content

Instantly share code, notes, and snippets.

View denis-trofimov's full-sized avatar

Denis Trofimov denis-trofimov

View GitHub Profile
# For Colab don't run reload_ext autoreload & autoreload 2
#%reload_ext autoreload
#%autoreload 2
# Safe for Colab
%matplotlib inline
# Not sure are this libs are still count as missing on a clean Colab VM.
!apt-get -qq install -y libsm6 libxext6
@denis-trofimov
denis-trofimov / fast-ai-install-script.ipynb
Last active August 31, 2018 19:34
Fast.ai install script.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
"""
From http://satels.blogspot.ru/2011/04/datetime-timestamp.html
Из datetime в timestamp и обратно
Для python версии 2:
Из datetime в timestamp
"""
import datetime
import time
dt = datetime.datetime.now() # datetime, из которой переводим в timestamp
@denis-trofimov
denis-trofimov / cv2.cpp
Last active April 21, 2017 14:40 — forked from tmattio/cv2.cpp
Cyphon OpenCV
#include <Python.h>
#include <opencv2/core/core.hpp>
#include <numpy/ndarrayobject.h>
#include <cstdio>
using namespace cv;
static PyObject* opencv_error = 0;
#define ERRWRAP2(expr) \
@denis-trofimov
denis-trofimov / setup.py
Created April 13, 2017 19:14 — forked from mattbierbaum/setup.py
Simple SWIG/numpy example
from distutils.core import setup, Extension
import numpy
import os
os.environ['CC'] = 'g++';
setup(name='matt_simple_test', version='1.0', ext_modules =[Extension('_simple',
['simple.cc', 'simple.i'], include_dirs = [numpy.get_include(),'.'])])