View show.hbs
import Ember from 'ember';
export default Ember.Component.extend({
didReceiveAttrs() {
this._super(...arguments);
const viz = this.get('viz');
Ember.Logger.info(viz.get('type')); // <--here data is undefined?
},
});
View fun.rs
pub fn from_config<S>(config: &BackendConfig) -> Result<impl Backend<S>, BackendError> where S: IntoBuf + 'static {
match config.name() {
"stdout" => Ok(StdoutBackend::stdout()),
"stderr" => Ok(StderrBackend::stderr()),
n => Err(BackendError::UnsupportedBackend(n.into())),
}
}
View main.rs
use futures::sink::Sink;
use bytes::{Buf, Bytes, IntoBuf};
// I want to have SinkItem = IntoBuf so it accepts anything that I can turn into a Buf
trait Backend: Sink<SinkItem = Bytes, SinkError = u8> {}
impl<W: Write> Backend for WriterBackend<W> {}
View lib.rs
let (complete_sender, complete_receiver) = oneshot::channel::<()>();
ctrlc::set_handler(move || {
complete_sender.send(());
}).expect("Error setting Ctrl-C handler");
error[E0507]: cannot move out of captured outer variable in an `Fn` closure
--> src/lib.rs:30:13
|
View legacy.java
@Override
public String hash(final NodeInfo info, final int repetition) {
String hostname = info.hostname().getHostAddress();
if (hostname.startsWith("/")) {
hostname = hostname.substring(1);
}
int port = info.services().get(ServiceType.BINARY);
return hostname + ":" + port + "-" + repetition;
}
View gist:b4f87ae707ecff297a1602135f3f940b
$ 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
View OnSubscribeDeferAndWatch.java
/*
* 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
View ByteJsonDocument.java
/*
* 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
View streamsink.scala
val spark = SparkSession
.builder
.master("local[*]")
.appName("StructuredWordCount")
.getOrCreate()
import spark.implicits._
val lines = spark.readStream
.format("socket")
View structuredstream.scala
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")