Get it, thank you!
On Mon, Jul 24, 2017 at 11:50 AM, Reynold Xin wrote:
> This is a standard practice used for chaining, to support
>
> a.setStepSize(..)
> .set setRegParam(...)
>
>
> On Sun, Jul 23, 2017 at 8:47 PM, tao zhan wrote:
>
>> Thank you for replying.
>> But I do not get it complete
This is a standard practice used for chaining, to support
a.setStepSize(..)
.set setRegParam(...)
On Sun, Jul 23, 2017 at 8:47 PM, tao zhan wrote:
> Thank you for replying.
> But I do not get it completely, why does the "this.type“” necessary?
> why could not it be like:
>
> def setStepSize(
Thank you for replying.
But I do not get it completely, why does the "this.type“” necessary?
why could not it be like:
def setStepSize(step: Double): Unit = {
require(step > 0,
s"Initial step size must be positive but got ${step}")
this.stepSize = step
}
On Mon, Jul 24, 2017 at 11:2
Doesn't it mean the return type will be type of "this" class. So, it
doesn't have to be this instance of the class but it has to be type of this
instance of the class. When you have a stack of inheritance and call that
function, it will return the same type with the level that you called it.
On Su
It means the same object ("this") is returned.
On Sun, Jul 23, 2017 at 8:16 PM, tao zhan wrote:
> Hello,
>
> I am new to scala and spark.
> What does the "this.type" in set function for?
>
>
>
> https://github.com/apache/spark/blob/481f0792944d9a77f0fe8b5e2596da
> 1d600b9d0a/mllib/src/main/sca
Hello,
I am new to scala and spark.
What does the "this.type" in set function for?
https://github.com/apache/spark/blob/481f0792944d9a77f0fe8b5e2596da1d600b9d0a/mllib/src/main/scala/org/apache/spark/mllib/optimization/GradientDescent.scala#L48
Thanks!
Zhan
On 25 Jun 2017, at 20:57, kant kodali
mailto:kanth...@gmail.com>> wrote:
impressive! I need to learn more about scala.
What I mean stripping away conditional check in Java is this.
static final boolean isLogInfoEnabled = false;
public void logMessage(String message) {
if(isLogInfoEnabled)
impressive! I need to learn more about scala.
What I mean stripping away conditional check in Java is this.
static final boolean isLogInfoEnabled = false;
public void logMessage(String message) {
if(isLogInfoEnabled) {
log.info(message)
}
}
If you look at the byte code the dead
I think it's more precise to say args like any expression are evaluated
when their value is required. It's just that this special syntax causes
extra code to be generated that makes it effectively a function passed, not
value, and one that's lazily evaluated. Look at the bytecode if you're
curious.
@Sean Got it! I come from Java world so I guess I was wrong in assuming
that arguments are evaluated during the method invocation time. How about
the conditional checks to see if the log is InfoEnabled or DebugEnabled?
For Example,
if (log.isInfoEnabled) log.info(msg)
I hear we should use guard c
Maybe you are looking for declarations like this. "=> String" means the arg
isn't evaluated until it's used, which is just what you want with log
statements. The message isn't constructed unless it will be logged.
protected def logInfo(msg: => String) {
On Sun, Jun 25, 2017 at 10:28 AM kant kodal
I am not getting the question. The logging trait does exactly what is says
on the box, I don't see what string concatenation has to do with it.
On Sun, Jun 25, 2017 at 11:27 AM, kant kodali wrote:
> Hi All,
>
> I came across this file https://github.com/apache/spark/blob/master/core/
> src/main/
Hi All,
I came across this file
https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/internal/Logging.scala
and I am wondering what is the purpose of this? Especially it doesn't
prevent any string concatenation and also the if checks are already done by
the library itse
13 matches
Mail list logo