Vanilla:
sp, ^W s, ^W S, ^W ^S
val xs = List(1, 2, 3) | |
xs.??? => List(4, 5, 6) | |
xs.??? => List(1, -1, 2, -2, 3, -3) |
def f(s: String) = { | |
val xs = s.split("\n").map(_.split(",")) | |
val ys = xs.transpose.map(_.map(_.length).max) | |
val zs = xs.map(_.zip(ys)) | |
val ls = zs.map(_.map { case (x,y) => x.padTo(y, ' ') }.mkString(" ")) | |
ls.mkString("\n") | |
} | |
val s = """aaa,b,cc | |
|a,bbbbb,c""".stripMargin |
var counter = 0 | |
var rdd = sc.parallelize(data) | |
rdd.foreach(x => counter += x) |
scratch=# create table pairs (name varchar(5), value integer); | |
CREATE TABLE | |
scratch=# insert into pairs values ('a', 1); | |
INSERT 0 1 | |
scratch=# insert into pairs values ('a', 1); | |
INSERT 0 1 | |
scratch=# insert into pairs values ('a', 1); | |
INSERT 0 1 | |
scratch=# insert into pairs values ('a', 11); | |
INSERT 0 1 |
for JAR in $(ls *.jar); do echo $JAR; jar -tf $JAR | ack 'org.joda.time.DateTime' ; done; |
require 'restclient' | |
# Create the list from the course page by running the following JavaScript | |
# snippet, and copying and paste the results in here. I _think_ the Content-Type | |
# of the pdfs prevents them from being downloaded directly in JavaScript. | |
# $('.course-lectures-list ul:eq(2) a[href$="pdf"]').map(function () { return $(this).attr('href') }) | |
urls = ["https://d19vezwu8eufl6.cloudfront.net/compdata/slides%2Flecture3.pdf", | |
"https://d19vezwu8eufl6.cloudfront.net/compdata/slides%2Ffunctions.pdf", |
#!/bin/bash | |
# | |
# This script serves as a useful base for generating a list of ignore-dirs | |
# for ack. | |
# It's slow to run (e.g. 30 sec on a 3000 file project on a 2010 MBA) | |
# and emits no output until complete. | |
# | |
# create the list of dirs tracked by git |
data Tree a = Empty | Branch a (Tree a) (Tree a) deriving (Show, Eq) | |
breadthFirst :: (a -> b) -> Tree a -> [b] | |
breadthFirst f Empty = [] | |
breadthFirst f t = breadthFirst' f ([], [t]) | |
breadthFirst' :: (a -> b) -> ([b], [Tree a]) -> [b] | |
breadthFirst' f (bs, []) = bs | |
breadthFirst' f (bs, as) = bs ++ breadthFirst' f (bsForAs, nextAs) | |
where (bsForAs, nextAs) = breadthFirst'' f as |
javascript:(function%20()%20{%20var%20$%20=%20document.createElement('script');%20$.src%20=%20'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js';%20$.type%20=%20'text/javascript';%20document.getElementsByTagName('head')[0].appendChild($);%20var%20_%20=%20document.createElement('script');%20_.src%20=%20'http://documentcloud.github.com/underscore/underscore-min.js';%20_.type%20=%20'text/javascript';%20document.getElementsByTagName('head')[0].appendChild(_);%20})() |