sequence.concatMap(mappingFunction) -> stream
array.concatMap(mappingFunction) -> array
This file contains 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
git log --pretty=format:"%H|%ae|%at|%s" | \ | |
python -c " \ | |
import rethinkdb as r; \ | |
import sys; \ | |
r.connect().repl(); \ | |
r.table_create('commits').run(); \ | |
r.table('commits').insert([dict(map(lambda x, y: [x, y], \ | |
['id', 'email', 'date', 'subject'], \ | |
line.split('|', 3))) \ | |
for line in sys.stdin]) \ |
This file contains 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
"""Compares rethinkdb with mongo. Copied from http://pastebin.com/3PqdFTjc. Example output: | |
mongodb: 0.110867023468 | |
rethink: 2.25043606758 | |
""" | |
import copy | |
import pymongo | |
import rethinkdb as r | |
import time |
This file contains 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
David, sorry you ran into these issues. The crash is a known bug, and will be fixed in the 1.12 release (along with the new cache implementation). See https://github.com/rethinkdb/rethinkdb/issues/1389 for more details. | |
As to the performance you're getting, could you give some additional info so we could track this down? | |
- Which OS/version are you running? | |
- Which RethinkDB version are you running? (you can tell by running `rethinkdb --version`) | |
- Which client driver are you using (and which version)? | |
- What query do you use to get out 100 documents and how are you measuing latency? | |
Would really appreciate your feedback so we could fix these issues. |
This file contains 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
r.table('authors').filter(lambda author: | |
r.table('users')['last_name'].contains(author['last_name'])). | |
run(conn) |
This file contains 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
### Keybase proof | |
I hereby claim: | |
* I am coffeemug on github. | |
* I am coffeemug (https://keybase.io/coffeemug) on keybase. | |
* I have a public key whose fingerprint is 61D8 8768 ADF2 C641 6ED5 2E6A 045D F3C7 4618 7048 | |
To claim this, I am signing this object: |
Every piece of speculation about the future I've ever encountered broadly pattern-matches into one of four genres: forecasting, prophecy, literary works of fiction, and rants. Age of Em doesn't autocomplete into any of these, and I think both my irritation and fascination with it come from the same source -- the audacity of creating an entirely new genre of futurism.
Here are rough properties of the existing four genres:
- Forescasting - narrow subject matter, falsifiable details that
Suppose you have a number of nodes on a network that spin up cron jobs to perform various tasks. However, you need the nodes to cooperate to ensure that multiple nodes don't spin up the same task. You can easily implement this functionality on top of RethinkDB as follows:
// A single node atomically pushes jobs onto an array in the database
r.table('admin').get('jobs').update({ job_list: r.row('job_list').append(JOB_DESCRIPTION)) })
This file contains 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
fn print<T>(x: T) { | |
// backticks inject Golang code directly. This isn't | |
// type-checked or processed by Axler. Any Axler variable | |
// must be marshalled via `<%=` and `%>` | |
`fmt.Printf("%v\n", <%= x %> )` | |
} | |
enum maybe<T> = none | some(T); | |
// `T?` is syntax sugar for `maybe<T>`. Just a convenient way |
This file contains 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
// Got implicit conversion working the compiler! | |
// You implement it like this: | |
enum maybe<T> = none | some(T); | |
// `T?` is just sugar for `maybe<T>` | |
impl<T> T? { | |
// the colon prefix means function is static | |
fn :from(x: T) -> T? { |