This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| WITH RECURSIVE rand(ids, id, done) AS ( | |
| SELECT ARRAY[]::int[], sub.id, 0 FROM (SELECT t.id FROM test t WHERE t.name = 'asdf' AND t.id = ceiling(random() * 8)::integer) AS sub | |
| UNION ALL | |
| SELECT (n.ids || n.id), sub.id, done+1 FROM rand n, (SELECT t.id FROM test t WHERE t.name = 'asdf' AND t.id = ceiling(random() * 8)::integer) AS sub WHERE NOT done = 5 | |
| ) | |
| SELECT n.* FROM rand n; | |
| SELECT t.* FROM test t, rand n WHERE t.id = ANY(n.ids) LIMIT 20; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| unless File.exist?('Gemfile') | |
| File.write('Gemfile', <<-GEMFILE) | |
| source 'https://rubygems.org' | |
| gem 'rails', github: 'rails/rails' | |
| gem 'arel', github: 'rails/arel' | |
| gem 'sqlite3' | |
| GEMFILE | |
| system 'bundle' | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.apache.spark.SparkContext | |
| import org.apache.spark.SparkContext._ | |
| import org.apache.hadoop.conf.Configuration | |
| import org.bson.BSONObject | |
| import org.bson.BasicBSONObject | |
| object ClassificationCount { | |
| def main(args: Array[String]) { | |
| val sc = new SparkContext("local", "ClassificationCount") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <title>Spotty plots</title> | |
| <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> | |
| <script src="http://code.shutterstock.com/rickshaw/vendor/d3.v2.js"></script> | |
| <script src="http://code.shutterstock.com/rickshaw/rickshaw.min.js"></script> | |
| <link type="text/css" rel="stylesheet" href="https://raw.github.com/shutterstock/rickshaw/master/rickshaw.min.css"> | |
| </script> |
NewerOlder