I am curious about difference between two different data type with same class instance. with that being said. let me show you sample code below. I have an interface interface carInterface {     fun startEngine()     fun stopEngine() }  and I have a class that implements the interface(carInterface) class carClassInterface: carInterface {     override fun startEngine() {         Log.d(TAG, &quot;startEngine: started Engine&quot;)     }      override fun stopEngine() {         Log.d(TAG, &quot;stopEngine: stopped Engine&quot;)     }      companion object {         private const val TAG = &quot;carClassInterface&quot;     } }  In MainActivity.kt, I have two different data type of variables like this private var carInterface: carInterface? = null private var carClassInterface: carClassInterface? = null  and initialize them with same instance of carClassInterface class     carInterface = carClassInterface()     carClassInterface = carClassInterface()  then if I execute these two lines of code below     carInterface!!.startEngine()     carClassInterface!!.startEngine()  I get this logs.     D/carClassInterface: startEngine: started Engine     D/carClassInterface: startEngine: started Engine  As you see here, both carInterface and carClassInterface instances behave pretty similar(or same) so far. data type of carInterface is interface and data type of carClassInterface is class but they can do same behavior? any explanation will be appreciated!
I have seen this mentioned a few times and I am not clear on what it means. When and why would you do this?   I know what interfaces do, but the fact I am not clear on this makes me think I am missing out on using them correctly.   Is it just so if you were to do:  IInterface classRef = new ObjectWhatever()   You could use any class that implements IInterface? When would you need to do that? The only thing I can think of is if you have a method and you are unsure of what object will be passed except for it implementing IInterface. I cannot think how often you would need to do that.   Also, how could you write a method that takes in an object that implements an interface? Is that possible?
Are the rules regarding absolute modifiers too absolute? A common grammar lesson that was taught to me in the US and that I've had to teach abroad in EFL classrooms is that we're not to use adverbs of emphasis with absolute modifiers, just as we're not supposed to use them as comparatives or superlatives.  Classic egregious examples of this mistake include very unique and more perfect, which seem obviously flawed to me. Other instances of further modified absolute modifiers are similarly meaningless or contradictory in nature.  I wonder, though, if the rule that I learned isn't overly broad, and whether it's taught similarly in the UK and elsewhere. I find myself modifying absolute modifiers quite regularly, and in some circumstances I think it's not only logical and correct, but quite meaningful. Phrases like almost exactly or virtually all or practically infinite possess a specific meaning that can't really be replicated using nonabsolutes like very nearly or most or quite long.  In my own speech and writing, I use such phrases exactly as I see fit, so this isn't a request for permission, per se. I'm more curious about whether there's a more appropriate rule regarding absolutes that you rely on (and might be used in a classroom). Need to prove that $(S,\cdot)$ defined by the binary operation $a\cdot b = a+b+ab$ is an abelian group on $S = \Bbb R \setminus \{-1\}$. Interpretation of simple predictions to odds ratios in logistic regression I'm somewhat new to using logistic regression, and a bit confused by a discrepancy between  my interpretations of the following values which I thought would be the same:    exponentiated beta values  predicted probability of the outcome using beta values.    Here is a simplified version of the model I am using, where undernutrition and insurance are both binary, and wealth is continuous:  Under.Nutrition ~ insurance + wealth   My (actual) model returns an exponentiated beta value of .8 for insurance, which I would interpret as:     "The probability of being undernourished for an insured individual is .8 times the probability of being undernourished for an uninsured individual."   However, when I calculate the difference in probabilities for individuals by putting in values of 0 and 1 into the insurance variable and the mean value for wealth, the difference in undernutrition is only .04. That is calculated as follows:   Probability Undernourished = exp(β0 + β1*Insurance + β2*Wealth) /                              (1+exp(β0 + β1*Insurance + β2*wealth))   I would really appreciate it if someone could explain why these values are different, and what a better interpretation (particularly for the second value) might be.     Further Clarification Edits As I understand it, the probability of being under-nourished for an uninsured person (where B1 corresponds to insurance) is:  Prob(Unins) = exp(β0 + β1*0 + β2*Wealth) /               (1+exp(β0 + β1*0+ β2*wealth))   While the Probability of being under-nourished for an insured person is:  Prob(Ins)= exp(β0 + β1*1 + β2*Wealth) /            (1+exp(β0 + β1*1+ β2*wealth))   The odds of being undernourished for an uninsured person compared to an insured person is:  exp(B1)   Is there a way to translate between these values (mathematically)? I'm still a bit confused by this equation (where I should probably be a different value on the RHS):  Prob(Ins) - Prob(Unins) != exp(B)   In layman's terms, the question is why doesn't insuring an individual change their probability of being under-nourished as much as the odds ratio indicates it does?  In my data, Prob(Ins) - Prob(Unins) = .04, where the exponentiated beta value is .8 (so why is the difference not .2?) Existence of a group isomorphism between $(\mathbb K,+)$ and $(\mathbb K^\times,\cdot)$ Let $(\mathbb K,+,\cdot)$ be a field. Is there a group isomorphism between $(\mathbb K,+)$ and $(\mathbb K^\times,\cdot) $ ?  The answer should clearly be negative. I tried to proceed via contradiction, but this has not led me very far. Since it's some kind of &quot;trick problem&quot;, I'm merely looking for hints. Generating data with a given sample covariance matrix Is there any way I can see at what time the commands were executed from the bash history? We can see the order but is there any way I can get the time also?  Bottom-Line: Execution time in the Bash history When I get a notification on android that someone had posted an answer or comment, if I click the notification, it opens the Stack Exchange app but shows the main view with the inbox opened, not the comment or answer that was in the notification.  If there is only one notification pending, when you tap it it should show you the actual contents rather than just the inbox. Is the function Riemann integrable? If yes, obtain the value of $\int_0^1f(x) \ dx$      $f(x) = \begin{cases} \frac {1}{n},  &amp; \frac{1}{n+1}&lt;x\le\frac{1}{n}\\ 0, &amp; x=0 \end{cases}$   My attempt  $f$ is bounded and monotonically increasing on $[0,1]$. Also, $f$ has infinite discontinuities but only one limit point. Therefore $f$ is Riemann integrable. Now, to calculate the integration  $\int_0^1f(x) \ dx=\int_{1/2}^{1}1 \ dx + \int_{1/3}^{1/2}\frac{1}{2} \ dx + \int_{1/4}^{1/3}\frac{1}{3} \ dx+...$  $=\sum_{n=1}^\infty \frac{1}{n^2}-\frac{1}{n}+\frac{1}{n+1}$  How do I proceed from here? How do I calculate these summations? I know $\sum \frac{1}{n}$ is $\log 2$, but not the other two summations. Error handling in C code Always wanting more , of anything, never has enough,never contented with what they have Generate a comma-separated list of cell contents, excluding blanks To concatenate a certain four cells, I'd use:  =CONCATENATE(A2,",",C2",",D2,",",F2)   This would make it so that...   A2 = "Matthew" C2 = "Mark" D2 = "Luke" F2 = "John"   would result in Matthew,Mark,Luke,John.  But we run into problems with something like...   A2 = "Jesus" C2 = "" D2 = "Mary" F2 = "Joseph"   which would result in Jesus,,Mary,Joseph.  Here, the extra comma is undesired. Is there a way to gracefully handle this so that all non-blank cells are included in the comma-separated list, while avoiding the addition of unnecessary commas when some cells are blank?  Certainly, this can be done with a fair number of nested IFs, but I really want to avoid that if possible. Can it be done with native Excel functions, or perhaps an array formula? Or would one have to resort to VB Script for something like this? What is the point of throwing candy on the ground using the "Throw 10 candies on the ground"? All that seems to happen is that the text under it becomes more and more disappointed in me. ಠ_ಠ VB6 IDE cannot load MSCOMCTL.OCX after update KB 2687323 Proving that if $A$ is a $8\times 8$ matrix over $\mathbb{R}$ and $A^3=A$, then $A$ is diagonalizable. How to add \part only to TOC? split file lines based on first field I have file with content like below and want to convert my output like below   Input  1,a,b,c 2,b,c 3,e,f 4,l  Required output  1,a 1,b 1,c 2,b 2,c 3,e 3,f 4,l    Values on first field is unique and no duplicate lines for 1st field in the input.  I am new to scripting and not sure how can we do this. Is there any way to kill a Thread? Is it possible to terminate a running thread without setting/checking any flags/semaphores/etc.? dist$(x,A)=0$ if and only if $x\in \overline{A}$ (closure of $A$) Adjusting font size with TikZ picture Taking from the PGF manual,  \begin{tikzpicture}   \draw [help lines] (0,0) grid (3,3);   \coordinate (a) at (rnd,rnd);   \coordinate (b) at (3-rnd,3-rnd);   \draw (a) -- (b);   \node (c) at (1,2) {x};   \draw let \p1 = ($ (a)!(c)!(b) - (c) $),             \n1 = {veclen(\x1,\y1)}         in circle [at=(c), radius=\n1]; \end{tikzpicture}   I'd like to increase the size of x. The problem is that I have multiple circles in the same diagram. Some of them require a larger sized font, while others are okay at default. How do I do this? Change desktop background to a solid color (e.g. pitch black) in GNOME 3 I just installed Ubuntu 16.04 with GNOME and I would like to set the background color to black. If I right click in the background I can select a wallpaper or a photo or a color. But there are only a few colors available. How can I open a palette and select the #000000 color ?