Skip to content

Instantly share code, notes, and snippets.

View ivoflipse's full-sized avatar

Ivo Flipse ivoflipse

View GitHub Profile
@linar-jether
linar-jether / dask_celery_scheduler.py
Created March 18, 2018 09:20
A dask distributed scheduler based on on Celery tasks - Allows reusing an existing celery cluster for ad-hoc computation
from __future__ import absolute_import, division, print_function
import multiprocessing
import pickle
from multiprocessing.pool import ThreadPool
from celery import shared_task
from dask.local import get_async # TODO: get better get
from dask.context import _globals
from dask.optimize import fuse, cull

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@mblondel
mblondel / nmf_cd.py
Last active June 12, 2019 20:00
NMF by coordinate descent
"""
NMF by coordinate descent, designed for sparse data (without missing values)
"""
# Author: Mathieu Blondel <mathieu@mblondel.org>
# License: BSD 3 clause
import numpy as np
import scipy.sparse as sp
import numba
@syhw
syhw / dnn.py
Last active June 23, 2024 04:13
A simple deep neural network with or w/o dropout in one file.
"""
A deep neural network with or w/o dropout in one file.
License: Do What The Fuck You Want to Public License http://www.wtfpl.net/
"""
import numpy, theano, sys, math
from theano import tensor as T
from theano import shared
from theano.tensor.shared_randomstreams import RandomStreams
@staltz
staltz / introrx.md
Last active July 15, 2024 15:43
The introduction to Reactive Programming you've been missing
@kracekumar
kracekumar / Writing better python code.md
Last active February 19, 2024 03:06
Talk I gave at June bangpypers meetup.

Writing better python code


Swapping variables

Bad code

@jakevdp
jakevdp / README.md
Last active February 11, 2024 00:16
D3/IPython widget example

D3 IPython Widget Example

A simple example of two-way communication between IPython notebook and javascript, using a D3 widget.

View this notebook on nbviewer, but be aware that it won't work without being connected to an IPython kernel!

It's better to download the notebook itself and open it with IPython notebook.

@bitemyapp
bitemyapp / gist:8739525
Last active May 7, 2021 23:22
Learning Haskell
@draganHR
draganHR / generate_res.py
Created October 23, 2013 18:02
Scripts for generating PyQT/PySide ui and resource python code
import os
def main():
os.chdir(os.path.dirname(os.path.dirname(__file__)))
src_path = "resources"
dest_path = "myproject/res"
for filename in os.listdir(src_path):
if not os.path.isfile(os.path.join(src_path, filename)):
@dan-blanchard
dan-blanchard / .1.miniconda.md
Last active December 11, 2019 22:38
Quicker Travis builds that rely on numpy and scipy using Miniconda

For ETS's SKLL project, we found out the hard way that Travis-CI's support for numpy and scipy is pretty abysmal. There are pre-installed versions of numpy for some versions of Python, but those are seriously out of date, and scipy is not there are at all. The two most popular approaches for working around this are to (1) build everything from scratch, or (2) use apt-get to install more recent (but still out of date) versions of numpy and scipy. Both of these approaches lead to longer build times, and with the second approach, you still don't have the most recent versions of anything. To circumvent these issues, we've switched to using Miniconda (Anaconda's lightweight cousin) to install everything.

A template for installing a simple Python package that relies on numpy and scipy using Miniconda is provided below. Since it's a common s