city | pop | loc.0 |
---|---|---|
boulder | 100,000 | 81.0 |
a |
---|
1 |
city | loc.0 | loc.1 | pop | state |
---|
// With dangling parens: | |
Let('tmp0, | |
read("cities"), | |
Let('tmp1, | |
makeObj( | |
"0" -> | |
Add( | |
Divide( | |
Multiply( |
def ExprPhase: PhaseE[LogicalPlan, PlannerError, Option[BsonField], Option[ExprOp]] = lpBoundPhaseE { | |
type Input = Option[BsonField] | |
type Output = PlannerError \/ Option[ExprOp] | |
toPhaseE(Phase { (attr: Attr[LogicalPlan, Option[BsonField]]) => | |
scanPara0(attr) { (orig: Attr[LogicalPlan, Input], node: LogicalPlan[Attr[LogicalPlan, (Input, Output)]]) => | |
def emit(expr: ExprOp): Output = \/- (Some(expr)) | |
// Promote a bson field annotation to an expr op: | |
def promoteField = \/- (orig.unFix.attr.map(ExprOp.DocField.apply _)) |
// See http://stackoverflow.com/a/11951799 | |
// Just Writer: | |
def calc1a: Writer[List[String], Int] = Writer("doing calc" :: Nil, 11) | |
def calc1b: Writer[List[String], Int] = Writer("other calc" :: Nil, 22) | |
val r1 = for { | |
a <- calc1a | |
b <- calc1b |
/* | |
Say you have a handful of options and need to build a single map containing a key for each non-empty value, with some transformation of each. | |
Here's one way to do it, is there a more elegant way? | |
*/ | |
val o1: Option[Int] | |
val o2: Option[String] | |
val v3: Int |
// run with mongo shell: | |
// | |
// $ mongo cleanupMongo.js | |
// | |
// $ mongo | |
// > r2-ds045089:PRIMARY> load('cleanupMongo.js') | |
function dbSize() { | |
return db.stats().fileSize/(1024*1024) + " MiB"; |
<html> | |
<head> | |
<title>Simple CORS test</title> | |
<script type="text/javascript"> | |
var req = new XMLHttpRequest() | |
// req.open("GET", "http://localhost:8080/metadata/fs/", true) | |
req.open("GET", "http://localhost:8080/query/fs/?q=select+*+from+zips+limit+10", true) | |
req.send() |
ctrl pressed A: select-all | |
ctrl pressed BACK_SLASH: unselect | |
ctrl pressed BACK_SPACE: delete-previous-word | |
ctrl pressed C: copy-to-clipboard | |
ctrl pressed DELETE: delete-next-word | |
ctrl pressed H: delete-previous | |
ctrl pressed INSERT: copy-to-clipboard | |
ctrl pressed KP_LEFT: caret-previous-word | |
ctrl pressed KP_RIGHT: caret-next-word | |
ctrl pressed LEFT: caret-previous-word |
if (scala.util.Properties.isMac) { | |
import java.awt.event.KeyEvent._ | |
import javax.swing.KeyStroke.getKeyStroke | |
val cmd = java.awt.Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() | |
val opt = java.awt.event.InputEvent.ALT_DOWN_MASK | |
val shift = java.awt.event.InputEvent.SHIFT_DOWN_MASK | |
val extraKeys = Map( | |
getKeyStroke(VK_X, cmd) -> "cut-to-clipboard", |
[info] x plan select with wildcard and two fields | |
[error] 'Right($SimpleMap($Read(Collection("zips")),(function (__rez) { | |
[error] for (var __attr in (_)) if (_.hasOwnProperty(__attr)) __rez[__attr] = _[__attr]; | |
[error] __rez.city2 = (_ != null) ? _.city : undefined; | |
[error] __rez.pop2 = (_ != null) ? _.pop : undefined; | |
[error] return __rez | |
[error] })( | |
[error] { })))' is Right but | |
[error] trees are not equal: | |
[error] Chain |
city | pop | loc.0 |
---|---|---|
boulder | 100,000 | 81.0 |
a |
---|
1 |
city | loc.0 | loc.1 | pop | state |
---|