View environment.yml
name: helloworld
dependencies:
- python=2.7
- anaconda
View alexa_dev_notes.md
View readme.md

Grr this took hours to figure out. I was trying to install MJPG-streamer and running VLC command lines and all this crap but nothing worked.

First install motion:

~> sudo apt-get install motion

Then create a config file:

~> mkdir ~/.motion
~> nano ~/.motion/motion.conf
View SGBP.md

Use this page to jot down notes regarding small garden birdwatch project.

Intel Joule

View numpy_fancy_2.py
import numpy as np
# sow a fix seed to make trial and error more predictable
np.random.seed(0)
# create a 10 x 3 NumPy array
a = np.random.rand(10,3)
# do the fancy indexing: for each row, extract the element that is closest to 0.5
a2 = a[np.arange(a.shape[0]), np.argsort(np.abs(a - 0.5))[:,0]]
View fourier.html
<html>
<head>
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.2/underscore-min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
<script src="//ajax.cdnjs.com/ajax/libs/json2/20110223/json2.js"></script>
<!--
TODO:
View sample_jupyter_notebook_plot.py
# clean up kernel
%reset -f
# This is a bit of magic to make matplotlib figures appear inline in the notebook
# rather than in a new window.
%matplotlib inline
# Some more magic so that the notebook will reload external python modules;
# see http://stackoverflow.com/questions/1907993/autoreload-of-modules-in-ipython
%load_ext autoreload
View np_tile.md

Exercise: Tiling for array creation

Skim through the documentation for np.tile, and use this function to construct the array:

[[4, 3, 4, 3, 4, 3],
 [2, 1, 2, 1, 2, 1],
 [4, 3, 4, 3, 4, 3],
 [2, 1, 2, 1, 2, 1]]
View python_generator_yield.md

This example illustrate the use of Python generator. (it's like callback function in JavaScript - sort of.)

Example 1

Create a matrix and print result:

M = [[1,2,3],    # this row sum to 6
     [4,5,6],    # this row sum to 15
     [7,8,9]]    # this row sum to 24
View js_vs_py.md

Say we want to concatenate elements within a JavaScript array (or Python list). i.e.

  • Input: an array that looks like this ['hello', 'world', '123', '!!!']
  • Process: concatenate the string elements within the array
  • Output: hello world 123 !!!

This post shows the similarity (and difference) of the JavaScript and Python syntax. (in case you start using JavaScript but from a Python background. Or vice versa, start using Python but from a JavaScript background)

JavaScript Solution