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
$ rustc --target mips-unknown-linux-uclibc hello.rs | |
error[E0514]: found crate `std` compiled by an incompatible version of rustc | |
| | |
= help: please recompile that crate using this compiler (rustc 1.16.0-nightly (4ecc85beb 2016-12-28)) | |
= note: crate `std` path #1: /home/vagrant/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/mips-unknown-linux-uclibc/lib/libstd_unicode-ce2437639102870c.rlib compiled by "rustc 1.16.0-dev (4ecc85beb 2016-12-28)" | |
= note: crate `std` path #2: /home/vagrant/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/mips-unknown-linux-uclibc/lib/libstd_shim-ce5875b2d5be2087.rlib compiled by "rustc 1.16.0-dev (4ecc85beb 2016-12-28)" | |
= note: crate `std` path #3: /home/vagrant/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/mips-unknown-linux-uclibc/lib/libstd-5e6fea6a0efe07f7.rlib compiled by "rustc 1.16.0-dev (4ecc85beb 2016-12-28)" | |
= note: crate `std` path #4: /home/vagrant/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustli |
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
/* | |
* Copyright (c) 2016 Couchbase, Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
/* | |
* Copyright (c) 2016 Couchbase, Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
val spark = SparkSession | |
.builder | |
.master("local[*]") | |
.appName("StructuredWordCount") | |
.getOrCreate() | |
import spark.implicits._ | |
val lines = spark.readStream | |
.format("socket") |
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
val schema = StructType( | |
StructField("META_ID", StringType) :: | |
StructField("type", StringType) :: | |
StructField("name", StringType) :: Nil | |
) | |
// The SparkSession is the main entry point into spark | |
val spark = SparkSession | |
.builder() | |
.appName("N1QLExample") |
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
StructType( | |
StructField("META_ID", StringType) :: | |
StructField("value", BinaryType) :: Nil | |
) |
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
// Create the Spark Config and instruct to use the travel-sample bucket | |
// with no password. | |
val conf = new SparkConf() | |
.setMaster("local[*]") | |
.setAppName("StreamingExample") | |
.set("com.couchbase.bucket.travel-sample", "") | |
// Initialize StreamingContext with a Batch interval of 5 seconds | |
val ssc = new StreamingContext(conf, Seconds(5)) |
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
import tensorflow as tf | |
a = tf.placeholder(tf.int32, name = 'a') | |
b = tf.placeholder(tf.int32, name = 'b') | |
add = tf.add(a, b, name = 'add') | |
tf.initialize_variables(tf.all_variables(), name = 'init') | |
definition = tf.Session().graph_def | |
tf.train.write_graph(definition, 'models', 'arithmetic.pb', as_text=False) |
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
-- Finds all "Nodes", prints their hostname and their connection state | |
SELECT n.currentState.name.toString() AS state, n.hostname.holder.hostName.toString() AS hostname | |
FROM com.couchbase.client.core.node.CouchbaseNode n | |
-- Find all KV Endpoints, prints their hostname and their connection state and the bucket name | |
SELECT e.currentState.name.toString() AS state, | |
e.channel.requestedRemoteAddress.holder.addr.holder.hostName.toString() AS hostname, | |
e.bucket.toString() AS bucket | |
FROM com.couchbase.client.core.endpoint.kv.KeyValueEndpoint e |
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
// Create observable for master and all the replicas | |
// The code maps it to a tuple where the boolean represents "found!" | |
// so if its not found the tuple will be <False, null> and if its found <True, JsonDocument> | |
Observable<Tuple2<Boolean, JsonDocument>> primary = bucket.async() | |
.get("doc") | |
.map(doc -> Tuple.create(true, doc)) | |
.defaultIfEmpty(Tuple.create(false, null)); | |
Observable<Tuple2<Boolean, JsonDocument>> first = bucket.async() |