Tested with Apache Spark 2.1.0, Python 2.7.13 and Java 1.8.0_112
For older versions of Spark and ipython, please, see also previous version of text.
| const DOC_URL = process.argv[2]; | |
| const puppeteer = require('puppeteer'); | |
| const fs = require('fs'); | |
| const readabilityJsStr = fs.readFileSync('node_modules/readability/Readability.js', {encoding: 'utf-8'}) | |
| function executor() { | |
| return new Readability({}, document).parse(); | |
| } |
| """ | |
| Demo script to compute rank distributions given pairwise preference probabilities. | |
| Data: | |
| - pairwise preference probabilities (not including self) | |
| Output: | |
| - distribution over ranks | |
| Michael Taylor, John Guiver, Stephen Robertson and Tom Minka, "SoftRank: Optimising Non-Smooth Rank Metrics", WSDM 2008. |
| '''This script goes along the blog post | |
| "Building powerful image classification models using very little data" | |
| from blog.keras.io. | |
| It uses data that can be downloaded at: | |
| https://www.kaggle.com/c/dogs-vs-cats/data | |
| In our setup, we: | |
| - created a data/ folder | |
| - created train/ and validation/ subfolders inside data/ |
| '''This script goes along the blog post | |
| "Building powerful image classification models using very little data" | |
| from blog.keras.io. | |
| It uses data that can be downloaded at: | |
| https://www.kaggle.com/c/dogs-vs-cats/data | |
| In our setup, we: | |
| - created a data/ folder | |
| - created train/ and validation/ subfolders inside data/ | |
| - created cats/ and dogs/ subfolders inside train/ and validation/ | |
| - put the cat pictures index 0-999 in data/train/cats |
Tested with Apache Spark 2.1.0, Python 2.7.13 and Java 1.8.0_112
For older versions of Spark and ipython, please, see also previous version of text.
| # You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine | |
| # This is how I upload my new Sol Trader builds (http://soltrader.net) | |
| # Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash | |
| S3KEY="my aws key" | |
| S3SECRET="my aws secret" # pass these in | |
| function putS3 | |
| { | |
| path=$1 |
| pin | I/O | label | description | remark |
|---|---|---|---|---|
| 1 | - | GND | ground | |
| 2 | I/O | I2CSCL | I²C clock | (pulled up by camera) |
| 3 | I/O | I2CSDA | I²C data | (pulled up by camera) |
| 4 | - | GND | ground | |
| 5 | I | BATTIN | battery input | |
| 6 | I | BATTIN | battery input | |
| 7 | O | 3V8OUT | unregulated power out 3.8V | 0V when camera is off. |
| 8 | O | 3V8STBY | unregulated power out 3.8V | always keep 3.8V unless battery is out. |
| // Restify Server CheatSheet. | |
| // More about the API: http://mcavage.me/node-restify/#server-api | |
| // Install restify with npm install restify | |
| // 1.1. Creating a Server. | |
| // http://mcavage.me/node-restify/#Creating-a-Server | |
| var restify = require('restify'); |
| <?php | |
| /** | |
| * Plugin Name: Grunt Sitemap Generator | |
| * Plugin URI: http://www.github.com/lgladdy | |
| * Description: Generate a JSON list of every page on a site so it can be used with grunt and uncss. Create a folder in /wp-content called mu-plugins, and drop this code into that folder, as grunt-sitemap.php | |
| * Author: Liam Gladdy | |
| * Author URI: http://gladdy.co.uk | |
| * Version: 1.0 | |
| */ | |
| /** | |
| * IE 5.5+, Firefox, Opera, Chrome, Safari XHR object | |
| * | |
| * @param string url | |
| * @param object callback | |
| * @param mixed data | |
| * @param null x | |
| */ | |
| function ajax(url, callback, data, x) { | |
| try { |