Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| # Mathieu Blondel, October 2010 | |
| # License: BSD 3 clause | |
| import numpy as np | |
| from numpy import linalg | |
| def linear_kernel(x1, x2): | |
| return np.dot(x1, x2) | |
| def polynomial_kernel(x, y, p=3): |
| """ | |
| Context manager or function to send text messages to your phone when a | |
| process is done. | |
| Edit the global variables. You might be able to find your phone e-mail | |
| address here: http://tinywords.com/about-old/mobile/ | |
| Usage: | |
| with SendText("long running process"): | |
| do_something() |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| #The MIT License (MIT) | |
| # | |
| #Copyright (c) 2015 Andre Queiroz | |
| # | |
| #Permission is hereby granted, free of charge, to any person obtaining a copy | |
| #of this software and associated documentation files (the "Software"), to deal | |
| #in the Software without restriction, including without limitation the rights | |
| #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| #copies of the Software, and to permit persons to whom the Software is | |
| #furnished to do so, subject to the following conditions: |
Julia is a new language for technical computing. The language is designed to solve the "two language problem", in which scientists prototype code in a higher-level language like R and then rewrite parts (or all) of their code in a lower-level language like C. Julia strives to expose a set of basic abstractions that allow programmers to transition easily between quick-and-dirty prototype code and production-quality code.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| #!/bin/bash | |
| virtualenv .env && | |
| source .env/bin/activate && | |
| brew install libevent && | |
| brew install libyaml && | |
| pip install cython && | |
| pip install numpy && | |
| pip install scipy && | |
| pip install pandas && | |
| pip install matplotlib && |