short url: caseywatts.com/selfpublish
my book is out! an applied psychology / self-help book targeted at developers: Debugging Your Brain
Markdown --> PDF (as a booklet!)
Markdown --> EPUB and MOBI
short url: caseywatts.com/selfpublish
my book is out! an applied psychology / self-help book targeted at developers: Debugging Your Brain
Markdown --> PDF (as a booklet!)
Markdown --> EPUB and MOBI
The steps below can be followed to create a new AMI for use with Amazon EC2 instances that includes the latest versions of R, RStudio, and RStudio Server. The idea is inspired by the work of Louis Aslett, who creates and hosts his own public AMIs for RStudio. My own goal was to create an AMI with RStudio v1.0.0 or higher, such that I could use the recent R Notebooks feature. However, the instructions should generally apply for whenever you might be impatient accessing the latest version of R-related software on AWS (via an interactive browser interface...).
| # Add these two gems | |
| gem 'ice_cube', '0.9.3' | |
| gem 'squeel', '1.0.16' |
| import serial | |
| import csv | |
| import re | |
| import matplotlib.pyplot as plt | |
| import pandas as pd | |
| portPath = "/dev/ttyACM0" # Must match value shown on Arduino IDE | |
| baud = 115200 # Must match Arduino baud rate | |
| timeout = 5 # Seconds | |
| filename = "data.csv" |
| #!/usr/bin/python | |
| # | |
| #simple app to read string from serial port | |
| #and publish via MQTT | |
| # | |
| #uses the Python MQTT client from the Mosquitto project | |
| #http://mosquitto.org | |
| # | |
| #Andy Piper http://andypiper.co.uk | |
| #2011/09/15 |
| def identity(nums): | |
| """Identity: | |
| Given a list of numbers, write a list comprehension that produces a copy of the list. | |
| >>> identity([1, 2, 3, 4, 5]) | |
| [1, 2, 3, 4, 5] | |
| >>> identity([]) | |
| [] |
| # 17 list comprehension problems in python | |
| fruits = ['mango', 'kiwi', 'strawberry', 'guava', 'pineapple', 'mandarin orange'] | |
| numbers = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 17, 19, 23, 256, -8, -4, -2, 5, -9] | |
| # Example for loop solution to add 1 to each number in the list | |
| numbers_plus_one = [] | |
| for number in numbers: | |
| numbers_plus_one.append(number + 1) |
| #!/usr/bin/env python | |
| import sys | |
| import csv | |
| def MeanAveragePrecision(valid_filename, attempt_filename, at=10): | |
| at = int(at) | |
| valid = dict() | |
| for line in csv.DictReader(open(valid_filename,'r')): | |
| valid.setdefault(line['source_node'],set()).update(line['destination_nodes'].split(" ")) |