I am not able to understand the following assignment  statement:  ImageButton btnsave = (sender) as ImageButton;   what it actually does?
When programming interfaces, I've found I'm doing a lot of casting or object type conversion.  Is there a difference between these two methods of conversion?  If so, is there a cost difference or how does this affect my program?  public interface IMyInterface {     void AMethod(); }  public class MyClass : IMyInterface {     public void AMethod()     {        //Do work     }      // Other helper methods.... }  public class Implementation {     IMyInterface _MyObj;     MyClass _myCls1;     MyClass _myCls2;      public Implementation()     {         _MyObj = new MyClass();          // What is the difference here:         _myCls1 = (MyClass)_MyObj;         _myCls2 = (_MyObj as MyClass);     } }   Also, what is "in general" the preferred method?
I need to check CPU and memory usage for the server in java, anyone know how it could be done? Prove that, $f'(0) \ge -\sqrt{2}$ for a function $f$ satisfying some conditions on $(-1,1)$. Let $f:(-1,1)\to \mathbb{R}$ be a twice differentiable function such that, $f(0)=1$, $f'(x)≤0$, $f(x)≥0$ and $f''(x)≤f(x)$ for all $x≥0$. Prove that, $f'(0)≥-\sqrt2$   Progress: I was able to prove $f'(0)≥-2$. For this I have applied Cauchy MVT for $f'$ and $g$ on $[0,x]$ for any $x\in (0,1)$ where $g: [0,x]\to\mathbb{R}$ is defined by, $g(x)=\sqrt{x+1}$. But, couldn't find another approach to get $-\sqrt{2}$. adding labels to points in ListPlot How to add a directory to the PATH? How do I add a directory to the $PATH in Ubuntu and make the changes permanent? When I press the power button a dialog opens, but I want to shutdown the system without receiving "Do you really really want to shutdown?". How can I choose a direct shutdown action on a pressed power button?   I had the same problem with the 11.04 version, but I don't remember the solution and yesterday I upgraded to Ubuntu 11.10. Should I use exit() or just return statements in main()? Personally I favor the return statements because I feel it's like reading any other function and the flow control when I'm reading the code is smooth (in my opinion). And even if I want to refactor the main() function, having return seems like a better choice than exit().  Does exit() do anything special that return doesn't? Do you have any useful awk and grep scripts for parsing apache logs? I can use log analyzers, but often I need to parse recent web logs to see what's happening at the moment.   I sometimes do things like to figure out top 10 ips that request a certain file  cat foo.log | grep request_to_file_foo | awk '{print $1}' |  sort -n | uniq -c | sort -rn | head   What do you have in your toolbox? When would you use a WeakHashMap or a WeakReference? The use of weak references is something that I've never seen an implementation of so I'm trying to figure out what the use case for them is and how the implementation would work. When have you needed to use a WeakHashMap or WeakReference and how was it used? Find all natural numbers $n$ and $m$ for which $n^m=(n-1)!+1$ Can I live in the UK for a long time through repeat visits? I had recently entered the UK without a visa to be with my partner, from 21 July 2016 until 16 December 2016. I hope to return on the 9th of January. We don't meet the income requirement for a Spouse visa. I recently applied to university, and got in, and was intending to return to the UK on a student visa, but my university did not tell me about maintenance fees and my loan wasn't large enough to cover it all, so my visa would have been denied.  Now, I am hoping to attend university in the next semester, and therefore return to the US to apply for that visa. Do you think that if I try to return to the UK without a visa, I will be turned away?  I won't be working or studying during this time, however, I'm afraid that they'll consider it living in the UK illegally; I don't have a criminal record or anything like that. FFmpeg - Apply blur over face Can the Help action be used to give advantage to a specific ally's attack (rather than just the next ally who attacks the target)? How to troubleshoot unwanted white spaces smartly? Why is there a white space on the left side?  \documentclass{standalone} \usepackage{asymptote} \begin{document} \noindent \begin{asy} size(10cm,10cm); draw((0,0)--(100,100)); draw((0,100)--(100,0)); dot((50,50)); \end{asy} \end{document} SSH failed to start - Missing privilege separation directory: /var/run/sshd iOS: Your passcode is required to enable Touch ID Occasionally, when unlocking my iPhone or iPad, I get the following message:     Your passcode is required to enable Touch ID   Now this is not after a number of failed attempts or turning the device off. The device was used within the last 12 hours. Two of the devices are less than 2 months old, and one is a year old. Everything is up to date. It appears to be happening more-or-less at random.  Does anybody know why this message might appear? If I enter my password correct first time, I login as normal.  If I enter my password wrong, it says invalid password. If I attempt to enter the correct password now then the screen freezes and doesn't go to dock as normal. I must restart using a physical button or shutdown to get out. Login works normally after restart, assuming I get it right first time.  EDIT:  After entering a wrong password, if I click cancel and then go back to my user to login, it works fine. Capitalize fields of study? Do I say "I study computer science," or "I study Computer Science"? Similarly, "I really liked that computer science course," vs. "I really liked that Computer Science course." How can a "proper" function have a vertical slope? Plotting the function $f(x)=x^{1/3}$ defined for any real number $x$ gives us:   Since $f$ is a function, for any given $x$ value it maps to a single y value (and not more than one $y$ value, because that would mean it's not a function as it fails the vertical line test). This function also has a vertical tangent at $x=0$.   My question is: how can we have a function that also has a vertical tangent? To get a vertical tangent we need 2 vertical points, which means that we are not working with a "proper" function as it has multiple y values mapping to a single $x$. How is it possible for a "proper" function to have a vertical tangent?  As I understand, in the graph I pasted we cannot take the derivative of x=0 because the slope is vertical, hence we cannot see the instantaneous rate of change of x to y as the y value is not a value (or many values, which ever way you want to look at it). How is it possible to have a perfectly vertical slope on a function? In this case I can imagine a very steep curve at 0.... but vertical?!? I can't wrap my mind around it. How can we get a vertical slope on a non vertical function? I was supposed to find all possible Jordan canonical forms of a $5\times 5$ complex matrix with minimal polynomial $(x-2)^2(x-1)$ on a qualifying exam last semester.  I took the polynomial to mean that there were at least two 2's and one 1 on the main diagonal, and that the largest Jordan block with eigenvalue 2 is $2\times 2$ while the largest Jordan block with eigenvalue 1 is $1\times 1$.  Did I miss any matrices or interrupt the minimal polynomial incorrectly?  \begin{pmatrix}   2 &amp;1  &amp;0  &amp;0  &amp;0\\   0 &amp;2  &amp;0  &amp;0  &amp;0\\   0 &amp;0  &amp;2  &amp;1  &amp;0\\   0 &amp;0  &amp;0  &amp;2  &amp;0\\   0 &amp;0  &amp;0  &amp;0  &amp;1 \end{pmatrix}  \begin{pmatrix}   2 &amp;1  &amp;0  &amp;0  &amp;0\\   0 &amp;2  &amp;0  &amp;0  &amp;0\\   0 &amp;0  &amp;2  &amp;0  &amp;0\\   0 &amp;0  &amp;0  &amp;2  &amp;0\\   0 &amp;0  &amp;0  &amp;0  &amp;1 \end{pmatrix}  \begin{pmatrix}   2 &amp;1  &amp;0  &amp;0  &amp;0\\   0 &amp;2  &amp;0  &amp;0  &amp;0\\   0 &amp;0  &amp;2  &amp;0  &amp;0\\   0 &amp;0  &amp;0  &amp;1  &amp;0\\   0 &amp;0  &amp;0  &amp;0  &amp;1 \end{pmatrix}  \begin{pmatrix}   2 &amp;1  &amp;0  &amp;0  &amp;0\\   0 &amp;2  &amp;0  &amp;0  &amp;0\\   0 &amp;0  &amp;1  &amp;0  &amp;0\\   0 &amp;0  &amp;0  &amp;1  &amp;0\\   0 &amp;0  &amp;0  &amp;0  &amp;1 \end{pmatrix}  \begin{pmatrix}   2 &amp;0  &amp;0  &amp;0  &amp;0\\   0 &amp;2  &amp;0  &amp;0  &amp;0\\   0 &amp;0  &amp;1  &amp;0  &amp;0\\   0 &amp;0  &amp;0  &amp;1  &amp;0\\   0 &amp;0  &amp;0  &amp;0  &amp;1 \end{pmatrix} How to use resistors? I have a power supply of 5 volts @ 1A. I want to reduce the current from 1A to 250mA. Which resistor should be use?   I tried this equation(Ohm's Law):  R = V / I  = 5/(0.75)  = 6.66 Ohms.  I tried the 6.66 Ohm resistor but it only reduce few mili Amps.