what is redefining static variable in c++?

It's said that, Once the definition for static data member is made, user cannot redefine it. what does it exactly mean? As I am able to assign anything to it  #include<iostream.h> class X {     public:        static int i;     X()     {         i = 2;    //no error in initializing it in constructor     }; };  int X::i=1;  int main() {    X obj;    cout << obj.i;   // prints 2, no prob. occur    obj.i = 3;    cout << obj.i;   // prints 3, same runs fine     X::i = 10;    cout<<obj.i;     // prints 10, still no error    return 0; }   if assigning value and redefining are different, then what is redefining a static or a even a normal variable?  Thanks in advance!


Why is gravitational force only a pull force ? And why does any force even exist between two uncharged particles . Shouldn't the positive negative attraction be nullified by the positive - positive and negative - negative repulsion ?


No of ways of making Garland using different kinds of flowers

Question: There are 6n flowers of one type and 3 flowers of another type, total no of garlands possible?  My approach-: I have considered 3 cases Case 1. Garland contains only 6n  flowers No of possible ways $= \frac{(6n-1)!}{2}$  Case 2. Garland contains only type containing 3 flowers No of permutations$= \frac{2!}{2}$  Case 3. Garland has both types of flowers No of permutations $= \frac{(6n+2)!}{2*6n!*3!}$  Total permutations$= (6n+2)!/(2*6n!*3!) + 1 + (6n-1)!/2$  Is this approach correct or have I missed/considered some cases? What approach should be used for such questions?


Placing a removable discontinuity in the graph of a function using TikZ (adding tick marks)

I would like to graph the function $y = \sqrt{x^{2} - 4}/\sqrt{x - 2}$ on the domain from -5 to 30. This function will be Sy = \sqrt{x + 2}$ restricted to the open interval $(2, \infty)$. So, I would like an open circle at (2,0). Now, a horizontal grid line is passing through it, and the graph of the function is passing through it.  I would like a dashed line drawn down to the x-axis from (2,0), and a tick mark there and below it the label "2." I would also like a tick mark below the x-intercept and below it the label "-2."  \documentclass[10pt]{amsart} \usepackage{tikz} \usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations.markings} \usetkzobj{all} \usepackage{pgfplots} \pgfplotsset{compat=1.11}  \begin{document}      \begin{tikzpicture} \begin{axis}[grid=both,           xmax=41,ymax=6,           axis lines=middle,           restrict y to domain=-1.5:6.5,           enlargelimits,           axis line style={shorten >=-0.25cm,shorten <=-0.25cm,latex-latex},           ticklabel style={fill=white}] \addplot[domain=2:36,mark=none,samples=200] {sqrt(x + 2)} node[fill=white, below]{$y=\frac{x^{2} - 4}{\sqrt{x-2}}$}; \addplot[domain=-2:2,dashed,mark=none,samples=200] {sqrt(x + 2)}; \draw (axis cs:2,2) circle [radius=1.5pt]; \end{axis} \end{tikzpicture}  \end{document}


I am using letter R for notation for my relation. I have to use the wRw notation. My problem is that I can't write \not R as I would like to. So I would like to write that, let's say a,b are not in relation with each other and type a\not R b.  It just doesn't look good.  Any tips?


Let G be a finite group, and let S and T be (not necessarily distinct) nonempty subsets. prove that either $G=ST$ or |$G|\geq|S|+|T|$  That's my thougt, I am thinking suppose $G$ does not equal to $ST$, then there exist a $h$ in $G$, but $h$ $\notin ST$. Thus, I suppose T={$x_1,x_2......x_N$}and $S=\{{t_1,t_2,.......,t_m,x_{k+1},......,x_{N}}\}$, where $x_k+1,...x_N$ are the common elements between two sets S and T. So, I want to construct two totally different sets A and B so that $|A|+ |B| > |G|$, firstlt,if $1$ is not in $S$ and $T$, then suppose T=A, and then suppoese B={$h,t_1,...,t_m, hx_{k+1}^{-1},...,hx_N^{-1}$}. I think if we can prove B$\neq$A(orT) and B$\neq$S, then I can know the question will be proved since $|A|+|B|>|G|$, but I only can prove B$\neq$S, I don't know how to prove B$\neq$T. Maybe my thoughts are wrong, can someone tell me how to solve this question? I think my methods are not correct, I hope someone can help me solve this question.


Can there be temperature inside of a massive Black Hole?

Since it cannot radiate light and therefore neither heat, if any reactions which generate heat were to occur inside a Black Hole, that would seem to imply an infinitely high ever increasing temperature,  or perhaps none whatsoever, that the intense radiation from the accretion discs and plasma jets is a necessary transformation of mass into a form which can cross the event horizon... I have never seen any reference to the temperature of a singularity, or if such a thing could have one, is there any theory of what it might be?


At the end of the finale of Game of Thrones,      Jon Snow is exiled to the Night's Watch as punishment for killing Daenerys.   However given that the threat of     the White Walkers appears to be dead for good   and      the Wildlings are no longer in conflict with the Northmen   what is the point of this group? They no longer are needed to defend Westeros, so what do they do now?


In python the new style of class declaration is this:  class A(object):     pass   what I don't understand is what is wrong with the old declaration,  class A:     pass   more specifically, why they needed to add the base object class.Also,I want to know a little bit more about the object class in python,couldn't find any resource available on object class.  However,   There's some answer over here,which talks about the rules but my specific question is what is the advantage of this declaration with object(Base class) on the declaration without the object.


How to align two or more groups of equations across \items in an enumerated environment?

In the snip, we can see that two groups of equations, aligned individually on the within-group = symbols.    \documentclass{article} \usepackage{mathtools}   \begin{document}   \begin{enumerate} \item     $$\begin{aligned}     \int x^2 \cos x \,dx     &= x^2 \sin x - 2 \int x \sin x \,dx     \\ &= x^2 \sin x - 2 (-x \cos x +\int \cos x \,dx)     \\ &= x^2 \sin x - 2 (-x \cos x + \sin x \,dx + C)     \\ &= x^2 \sin x + 2x \cos x - 2\sin x + C     \end{aligned}$$  \item     $$\begin{aligned}     \int \frac{\ln x}{x^3} \,dx     &= -\frac{1}{2} \frac{\ln x}{x^2} +         \frac{1}{2} \int \frac{1}{x^3} \,dx     \\ &= -\frac{\ln x}{2x^2} +         \frac{1}{2} \cdot -\frac{1}{2x^2} + C     \\ &=  -\frac{\ln x}{2x^2} - \frac{1}{4x^2} + C     \\ &= -\frac{1}{4x^2}(2\ln x + 1) + C     \end{aligned}$$  \end{enumerate}   \end{document}   How to align the two groups of equations on the same equal symbol "="?  Like this:    \documentclass{article}   \usepackage{mathtools} \begin{document} \begin{enumerate} \item     $$\begin{aligned}     \int x^2 \cos x \,dx     &= x^2 \sin x - 2 \int x \sin x \,dx     \\ &= x^2 \sin x - 2 (-x \cos x +\int \cos x \,dx)     \\ &= x^2 \sin x - 2 (-x \cos x + \sin x \,dx + C)     \\ &= x^2 \sin x + 2x \cos x - 2\sin x + C     \\     \\     \int \frac{\ln x}{x^3} \,dx     &= -\frac{1}{2} \frac{\ln x}{x^2} +         \frac{1}{2} \int \frac{1}{x^3} \,dx     \\ &= -\frac{\ln x}{2x^2} +         \frac{1}{2} \cdot -\frac{1}{2x^2} + C     \\ &=  -\frac{\ln x}{2x^2} - \frac{1}{4x^2} + C     \\ &= -\frac{1}{4x^2}(2\ln x + 1) + C     \end{aligned}$$ \end{enumerate} \end{document}   In this approach, the numbers generated by enumerate are missing, so I'm wondering are there better ways.


What possessive forms are used for mutual 1st person ownership?

I want to talk to someone about the house that my wife and I own.  Saying, for example, "My wife's and my house is awesome," sounds a bit funny to me.  What's the best way to express this?  Clarification  I'm asking specifically about the grammar of multiple nouns in possessive form.  I'm particularly curious if it's possible to do this with a first-person pronoun (me).  I am capable of rephrasing this in other ways - my question is not how to express the idea, but about this particular grammatical construction, if it is even legal.


If I compile the following code I get no error:  \documentclass[a4paper,10pt]{article} \usepackage[utf8]{inputenc} \usepackage{tikz}  \begin{document} \begin{tikzpicture} \draw [help lines] (-2,-2) grid (2,2); \draw plot [mark=*, samples at=    {22.5,67.5,112.5,157.5,202.5,247.5,292.5,337.5,22.5}] (\x:1); \draw[shift={(0 cm, 2*sin(67.5) cm)}] plot [mark=*, samples at={22.5,67.5,112.5,157.5,202.5,247.5,292.5,337.5,22.5}] (\x:1); \end{tikzpicture} \end{document}   Notice that I translate the second octagon using the vector (0,2*sin(67.5)) and the compiler seems to interpreter correctly the second component. On the other side, when I try to compile the following:  \documentclass[a4paper,10pt]{article} \usepackage[utf8]{inputenc} \usepackage{tikz}  \begin{document} \begin{tikzpicture} \draw [help lines] (-2,-2) grid (2,2); \draw plot [mark=*, samples at={22.5,67.5,112.5,157.5,202.5,247.5,292.5,337.5,22.5}] (\x:1); \draw[shift={(2*cos(67.5) cm, 0 cm)}] plot [mark=*, samples at={22.5,67.5,112.5,157.5,202.5,247.5,292.5,337.5,22.5}] (\x:1); \end{tikzpicture} \end{document}   I get an error message:  ! Package pgf Error: No shape named 2*cos(67 is known. See the pgf package documentation for explanation. Type H <return> for immediate help. ... l.11 \draw[shift={(2*cos(67.5) cm, 0 cm)}] plot [mark=*, samples at={22.5,67...   It seems that it doesn't recognize the vector (2*cos(67.5), 0), in particular the 2*cos(67.5) component... Can someone tell me why?   Thanks in advance.


Question about normal force acting on a mass on an inclined plane

Suppose we are given the free-body diagram above, with a mass on an incline at an angle $\theta$. If my coordinate axes are taken to be the regular $x-y$ plane rotated an angle of $\theta$ (i.e. the x axis is parallel to the direction of $mg \sin \theta$ and the $y$ axis is parallel to $mg \cos \theta$), then if there is no vertical motion, $N = mg \cos \theta$. Now suppose I take my coordinate axes to be the $x-y$ plane but NOT rotated by any angle (i.e. the $x$ axis is parallel to the base of the triangle and the $y$ axis is parallel to the adjacent side), then if I want to resolve my weight $mg$ in the direction of $N$, wouldn't I need to make it $\frac{mg}{\cos \theta}$? (since in this case I would have to find the force whose vertical component is $mg$) If this is the case, no vertical motion would imply that $N = \frac{mg}{\cos \theta}$. Does this mean that $N$ depends on my choice of coordinate axes? I might be making a mistake, but I'd appreciate if someone could point out the mistake in my logic.


What is the fastest and shortest way to double (or multiply) a vector

If you have a vector like this one, what is the shortest way to double or multiply it?  vector<pair<int, string>> v = {{1, "a"}, {2, "b"}, {3, "c"}}; vector<pair<int, string>> desired_v = {{1, "a"}, {2, "b"}, {3, "c"}, {1, "a"}, {2, "b"}, {3, "c"}};   Of course these version won't work:  v1.insert(v1.end(), v1.begin(), v1.end()); // {{1, "a"}{2, "b"}{3, "c"}{1, ""}{2, ""}{3, ""}}  for (auto p : v2)     v2.push_back(p); // {{1, "a"}{2, "b"}{3, "c"}{1, "a"}{2, ""}{3, ""}}   Of course I can use this one, but it is pretty lame:  for (size_t curr = 0, size = v3.size(); curr < size; ++curr)     v3.push_back(v3.at(curr));   Is there a shorter way to do this?


Prove or disprove that $X^4+1$ is irreducible in $\frac{\mathbb{Z}}{p\mathbb{Z}}[X]$

As the title says: I want t prove or disprove the irreducibility of $X^4+1$ in $\frac{\mathbb{Z}}{p\mathbb{Z}}[X]$, $ p$ prime.  I have already proven that $X^4+1$ can't have linear factors in $\frac{\mathbb{Z}}{p\mathbb{Z}}[X]$, since it doesn't have roots in $\mathbb{Z}.$ By contradiction, such a root $k$ with $k^4=-1$ would have order $8$ which can't be since $8 \not| p$.   But that still leaves the possibility of a nontrivial decomposition with quadratic factors. So say $X^4+1 = (a_1x^2+q_1)(a_2X^2+q_2) \implies a_1a_2 = 1, a_1q_2+a_2q_1 = 0, q_1q_2 =0$. My hunch is that there is a contradiction somewhere in this equations, but I can't find it. Maybe there is none?


How can I record sound from the windows command line?

Is there an application capable of recording sound that I can run from the command line on XP?  Ideally I'd start it with one command and stop it with another. Or I could specify a duration with the starting command.


Unanswered questions which were answered in the comments

Some questions are being answered quickly in on of the comments; in some cases, the OP even "accepts" (in words, in another comment) the comment-answer.  Here's an .  The problem is that such questions are stuck forever in the "Unanswered" section, as there's really no need to add a formal answer, and the OP is probably never going to look for new answers, and it is already informative as is for google-comers.  In any meaningful sense - this question is answered.  What can we do with such questions?  I've seen here and there ad-hoc requests such as "please phrase this as an answer so I could accept it"; but that's really specific (and quite annoying). Should we allow OPs to "accept" a comment as an answer (I know this was discussed , but that's a very old discussion), or should we allow moderators to flag old questions as answered if it's clear that an answer exists and the OP is ok with it? (this is similar to  offer, but is still different)  I know there have been many discussions touching the subject from various aspects, but this is a very specific offer: let moderators flag a question as answered when it has no answers, it has an "answer" in the comments, and it is clear the OP is "accepting" that answer. I have not seen that specific offer here.


Input image strip without stretching to fit output frame

When you add an image strip to the Video Sequence Editor, it stretches/shrinks your image to fit the full output frame.  How can I add an image at its original resolution?  For example, if I add a 60x60 pixel image, it should appear very small in the final 1080p render.


I have a table, which seems to be too wide for my page and it pops out of the page border. In lyx, it is like  And in PDF, it looks like, it is going out of the page border.   How can I address such issue ?


In my book about Abstract Algebra, it is stated that  A group $\langle G,*\rangle$ is a set $G$, closed under a binary operation $*$, such that these 3 axioms are satisfied:  $g_1$: For  all $a,b,c\in G$, $$(a*b)*c=a*(b*c) $$ $g_2$: There  is an element $e$ in $G$ such that for all $x\in G$, $$e*x=x*e=e$$ $g_3$: Corresponding to $a\in G$, there is an element $a'$ such that $$a*a'=a'*a=e$$   The book stated  that among the 6 orders of $g_1,g_2,g_3$, only $3$ are correct orders of defining a group. But I have no idea about it. Can someone give me some hint?


How does terminal in Linux actually work?

I'm using Linux console for years, but currently started thinking of how it actually works. Typing a command as a string and pressing Enter returns its output in the same terminal window. Opening a new terminal window and executing tty shows the following result: $ tty /dev/pts/10   defines that:  A process that expects to be connected to  a  terminal,  can  open the slave end of a pseudoterminal and then be driven by a program that has opened the master end.  Anything that is written on the master end is provided to the process on the slave end as though it was input typed on a terminal. [...] Conversely, anything that is written to the slave end of the pseudoterminal can be read by the process that is connected to the master end  My understanding: The actual terminal window is connected to a slave /dev/pts/10 and all the input I type into the terminal window is written on the slave end and then read on the master end. A process connected to the master end knows what to do with all the strings user type, executes them and write commands results on the master end which are then read on the slave end and displayed in the terminal window. The question: What is the process connected to the master end which knows how to execute commands which users type as strings?


I have an idea or subject that should have a Q&A, and want to propose a new site. How can I do this?  Related:


How to get from Copenhagen airport to Odense (Denmark)?

I'm flying into CPH (Copenhagen Airport) and then need to get to Odense, Denmark via train. How do I navigate through CPH (Copenhagen Airport)to the central station to get the right train to Odense?


I've just bought a  for my Mac Pro (late 2013) running Yosemite, to replace some older direct-attached storage I'd been using previously. I'm very happy with it so far, but one thing I didn't realise is that network-attached volumes aren't indexed by Spotlight. The NAS will be used to store thousands of PDFs documents, and I need to be able to find specific text within those documents easily. The network share (via AFP) is mounted as Data, so I've tried: $ sudo mdutil -i /Volumes/Data/ Error: unexpected indexing state (/Volumes/Data/)  Then $ sudo mdutil -E /Volumes/Data/ /Volumes/Data: 2015-08-28 17:13:21.637 mdutil[4613:183771] mdutil disabling Spotlight: /Volumes/Data -> kMDConfigSearchLevelFSSearchOnly Indexing disabled.  ... which seems to be to suggest that the QNAP simply won't support this. Can anyone confirm my interpretation of the above? If so, does anyone know of any software that will easily and reliably index the data (including the contents) of the documents on this volume?


Add filtering my questions to show only uncheckmarked questions

I'm an active user of SO, both for questions and answers. I take the time to write plenty of answers, but I also am still quite green, so I ask quite a few questions as well.  Every so often, I will forget to return to checkmark one of my questions, usually because I find most of the responses I receive inadequate. However, after some time I'll usually go back and checkmark at least the best answer of the question.  It would be nice to show me a view of only my unanswered questions, so that I don't have to scroll through 7 pages of questions to check for ones I missed.


I'm having trouble about understanding id in Python3. I always thought holding same value means pointing to same address until i got output like this :  >>> a = 1000 >>> b = 1000 >>> id(a) 140241096743312 >>> id(b) 140241096274640 >>> id(1000) 140241096274800 >>> c = 5 >>> d = 5 >>> id(c)  == id(d) True   Why am i getting different addresses ? What makes 1000 special or different from 5 so that variables point different addresses ?


Can I run Ubuntu on Lenevo 3000 N200 ?  If so what version of Ubuntu should I use ? Can I use Ubuntu with Window 7? Is there any information that I can read before I proceed?


Is it possible to use the present perfect to describe an action that happened earlier today and lasted for some time? As in:  I've slept for 16 hours today and that alone made me happy. I've been on hold for four hours today! You just lost a frequent customer.  Wouldn't the simple past be more appropriate here, since these actions took place some considerable amount of time before the moment of speaking and are not quite linked to the present? During my reaserch I only got more confused, as I've even encountered sentences like:  I've been playing the guitar for two hours today.  Which, I believe, is not correct at all?


Well,if theoretically we say the value of a resistor is zero then will there be any heat dissipation across the resistor(because heat is produced only when there's a resistance to the flow of current.)If there's zero resistance then won't current simply go on flowing?


Prove limit superior of a sequence is greater than or equal to limit superior of the Cesàro mean of that sequence

The problem is that:      Let $(x_n)$ be a bounded sequence, and $x^* =\limsup(x_n)$.   Prove    $$\lim\sum_{i=0}^n \frac{x_n}{n}\le x^*.$$   I want to prove it by contradiction.  I start with assume that $\lim\sum_{i=0}^n (x_n)/n> x^*$, then I know $\exists N \in \mathbb N$ (natural number) such that $x_n < \lim \sum_{i=0}^n (x_n)/n$ for all $n \ge N$. "  Then I do not know how to find a contradiction, could anyone help me?


Using value of the send-DE as value for update contact in Journey Builder

I want to write a value of the Send Data Extension into a further DE to log certain values by using the update contact function in the journey builder. Is there a possibilty?


Deny items to be removed from inventory slots.

Is there a way to disallow players to remove a certain item from a certain inventory slot. What I have tried is to add a curse of binding to the item as following:  /replaceitem entity @p slot.hotbar.8 wool 1 0 {ench:[{id:10,lvl:1}]}   But as you may know, this only works for armor slots, not other inventory slots.


How could I prove that $x^2+1$ and $x^4+1$ are irreductible over $\mathbb{Z}/2 \mathbb{Z}$ and $\mathbb{Z}/3 \mathbb{Z}$?  Theorem : Let $A$ an integral domain and $I$ a proper ideal of $A$. If $f(x) \not \equiv a(x)b(x) (\mod I)$ for any polynomials $a(x)$, $b(x)$ $\in A[x]$ of degree $\in [1, \deg(f))$, then $f(x)$ is irreductible in $A[x]$  I think I have to use this theorem, but I am not certain. Is anyone could help me at this point?


Retrieving Wikipedia's coordinate information?

I'd like to add icons to my map showing locations which have Wikipedia entries.  The  is a great resource for determining Wiki entries near an XY location, but it has limitations (20km radius, 50 points only) which make it unsuitable for my purposes.  Ideally I need the map to show ALL locations with Wiki entries, so I guess I'll need to download the Wikipedia dump file and parse it for geocoded entries.  Where is this information found in the Wikipedia dump files?  The Wiki database may be downloaded from  but I can't see which file(s) I need to search for the coordinates.  For example, the  includes:  Coordinates:    33°51′35.9″S 151°12′40″E   Where is this found in the dump files? Another way to phrase the question is "how can I determine which Wiki entries are geo-coded?"


I’m struggling with the following problem in my textbook     Let $f,g\colon\mathbb R\to\mathbb R$, where $g(x)=1-x+x^2$ and $f(x) = ax+b$. If $(g\circ f)(x) = 9x^2-9x+3$, determine $a$, $b$.   What I’ve tried:  So I know $(g\circ f)(x) = g(f(x))$ and if I substitute the functions I get $1-(ax+b)+(ax+b)^2$ and I also know that that equals to $9x^2-9x+3$.  Now this is where I get stuck  I’m not sure how to isolate a and b to find there values,I’ve tried rearranging $1-(ax+b)+(ax+b)^2 = 9x^2-9x+3$ into multiple different expressions to get something that I might be able to solve but after a few hours I didn’t get anywhere.


Same voltage and current rating but different brand laptop AC adapter?

I'm in India where AC adapter of Y510p(Original) is not available. Ac adapter of Y510p has rating of 19.5v and 6.15a, I found  AC adapter having same rating of Hp, is it secure to use on lenovo laptop?


dependency inversion principle vs factory pattern in C#

Is there any difference between those two? I am trying to learn those topics and both looks same concept. In Factory pattern we will create FactoryClass which will be responsible for creating objects of other class (removing dependency). I believe it is the same concept for DIP. Correct me if I am wrong. Sorry! if it is dumb question!


The highlighted part has the equation centred, which looks rather imbalance with the top equation, is it possible to align the highlighted part to the left? Below is the code I am using.  \begin{equation}~\label{eq:prob1} p_k(s)= \begin{cases}     \displaystyle\frac{c_k-q_k(s)}{c_k- \overline{c_k}} & if\ q_k(s) >  \overline{c_k} \\     1                                                   & if\ q_k(s) \leq  \overline{c_k} \end{cases} \end{equation}


Probability that a sequence of random variables converges to 0 or 1

Fix $\alpha , \beta > 0$ with $\alpha + \beta = 1$ and consider the sequence of random variables defined by $X_0 = \theta \in (0,1)$ and  $$P(X_n = \alpha + \beta X_{n-1} \mid X_{n-1} , ... , X_0) = X_n , \qquad P(X_n =  \beta X_{n-1} \mid X_{n-1} , ... , X_0) =1- X_n.$$  I am trying to prove that $P(\lim_{n\rightarrow \infty} X_n = 1) = \theta$ and $P(\lim_{n\rightarrow \infty} X_n = 0) = 1-\theta$. It seems that there should be a way to do this using the result that $P(E \mid \mathcal F_n) \rightarrow P(E \mid \mathcal F)$, whenever $\mathcal F_n \uparrow \mathcal F$ is an increasing sequence of $\sigma$ algebras. But, I am not seeing a solution. Any suggestions?  By the way, this is an exercise on page 224 of Durrett's Probability: Theory and Examples.


Determining the infinite sum $\sum\limits_{n=0}^{\infty}\frac{(-1)^n}{2n+1}$

I have to determine the following sum:  \begin{equation} \sum\limits_{n=0}^{\infty}\frac{(-1)^n}{2n+1} \end{equation}  And i've tried lot's of ways to determine it, but i couldn't get a result so I figured I would look on WolframAlpha to see what the result has to be  so i could maybe know what to do next by that. But apparently the result is $\frac{\pi}{4}$ and i don't know how I could possibly get to pi. Does anyone have any suggestions about how to tackle this?


Unable to login with Firebase Google Auth in Android

I am trying to integrate google sign in provided by firebase auth in Android.I did everything same as given in firebase documentation.When user select account to sign in app stops and shows an error in log cat window given below.  Caused by: java.lang.NullPointerException: Attempt to invoke virtual  method 'com.google.android.gms.tasks.Task com.google.firebase.auth.FirebaseAuth.signInWithCredential(com.google.firebase.auth.AuthCredential)' on a null object reference     at com.app.bookbudi.Login.firebaseAuthWithGoogle(Login.java:99)     at com.app.bookbudi.Login.onActivityResult(Login.java:86)   Here is my code:  Login.java  public class Login extends AppCompatActivity {  SignInButton signIn; GoogleSignInClient mGoogleSignInClient; private static final int RC_SIGN_IN = 1;  @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login);  signIn = findViewById(R.id.signIn);  GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN).             requestIdToken(getString(R.string.default_web_client_id)).requestEmail().build();  mGoogleSignInClient = GoogleSignIn.getClient(this,gso);  signIn.setOnClickListener(new View.OnClickListener() {          @Override         public void onClick(View v) {              Intent signInIntent = mGoogleSignInClient.getSignInIntent();             startActivityForResult(signInIntent, RC_SIGN_IN);         }     });   }   @Override protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {     super.onActivityResult(requestCode, resultCode, data);      if(requestCode == RC_SIGN_IN){          Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(data);          try{         GoogleSignInAccount account = task.getResult(ApiException.class);         firebaseAuthWithGoogle(account);      }catch(ApiException e){              Toast.makeText(getApplicationContext(),"Login failed",TastyToast.LENGTH_SHORT).show();         }     }   }   private void firebaseAuthWithGoogle(GoogleSignInAccount acct){      AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(),null);      fAuth.signInWithCredential(credential).addOnCompleteListener(this,new OnCompleteListener<AuthResult>() {          @Override         public void onComplete(@NonNull Task<AuthResult> task) {              if(task.isSuccessful()){                  Intent i = new Intent(Login.this,MainActivity.class);                 startActivity(i);                 finish();             }             else{                  Toast.makeText(getApplicationContext(),"Unable to login with google.",TastyToast.LENGTH_SHORT).show();              }         }     });     }  }   Please let me know what I did wrong in above code.  THANKS


I try to write something like:  \[ \bigcup_{\gamma<\omega*2}\mathcal{T}_{\gamma}|_{\aleph _0} \]   But it can not display $\gamma<\omega*2$ underneath \bigcup in TeXstudio. What is the problem?  Here is the whole file in TeXstudio.   \documentclass[preview,border=3pt,3pt]{standalone}  \usepackage{tikz} \usetikzlibrary{shapes,backgrounds} \usetikzlibrary{calc} \usetikzlibrary{decorations.shapes} \usetikzlibrary{arrows.meta} \tikzset{decorate sep/.style 2 args=     {decorate,decoration={shape backgrounds,shape=circle,shape size=#1,shape sep=#2}}} \tikzset{>={Latex[width=1.5mm,length=3mm]}}  \begin{document}     \begin{tikzpicture}     \tikzstyle{line} = [fill=white, line width=.3pt]     \tikzstyle{gray1} = [fill=gray!5,fill opacity=0.5]     \tikzstyle{gray2} = [fill=gray!20,fill opacity=0.5]     \tikzstyle{blue1} = [fill=blue!10,fill opacity=0.5]     \tikzstyle{blue2} = [fill=blue!20,fill opacity=0.5]       \filldraw[gray2](0, 9)--(-1.67,6.5)--(-1.33,4)--(5.33,4)--(7,9);        \filldraw[blue1](-3, 9)--(-1.33,4)--(-2,9);        \filldraw[blue2](-2, 9)--(-1.67,6.5)--(0,9);             \node[above] at (-1.2,8.3) {$\bigcup_{\gamma<\omega*2}\mathcal{T}_{\gamma}|_{\aleph _{0}}$};      \end{tikzpicture} \end{document}


What's the difference between electromotive force and Electrical potential?

I'm a student and our physics teacher asked us a question that no one answered, what's the difference between EMF and electric potential? there will be many answers?


Proof that inverse of a matrix is unique

If B and C are both inverses of the matrix A,then B=C.   Can't i prove it in following way ?  Proof:   AB=BA=I and AC=CA=I,then BA=CA=I  By postmultiplication $\Rightarrow (BA)(A^{-1})=(CA)(A^{-1})=(I)(A^{-1})\Rightarrow B=C=A^{-1}$,   or by premultiplication $AB=AC=I\Rightarrow (A^{-1})(AB)=(A^{-1})(AC)=(A^{-1})(I)\Rightarrow B=C=A^{-1}$.


In my rhythm game, I have a note object which can be of a different color depending on the note chart. I could use a sprite sheet with all the different color variations I use, but I would prefer to parametrize this. (Each note sprite is made of different shades of a hue. For example a red note has only red, light red and dark red.)  How can I colourise a sprite anew?  I'm working with OpenGL, but any algorithm or math explanation will do. :)


Lenses round ..Photographs square shaped why?

If camera lenses are round then why is the photograph taken by the camera is square-shaped?  photography


Reorder a List and Find All Possible Combinations

I have a Python list with a variable number of elements.  [a,b,c,d,e]   I need to rearrange these elements inside the list and find all possible unique combinations.  [a,b,c,d,e] [d,b,a,e,c] [e,d,a,c,b], etc.   I cannot have same elements repeated, or have any elements removed:  [a,a,a,d,e]  <-- bad


Why put a method on an object's prototype?

What are the benefits of putting stuff on an object's prototype? For example, these two implementations of ChessPiece seem very similar. What are the trade-offs?  Without prototype  var ChessPiece = function(x, y) {   var self = this;   this.x = x;   this.y = y;   this.getNotation = function() {     return 'abcdefgh'[self.x] + '12345678'[self.y];   };       }  var pawn1 = new ChessPiece(1, 0); pawn1.getNotation(); // 'b1';   With prototype  var ChessPiece = function(x, y) {   this.x = x;   this.y = y; }  ChessPiece.prototype.getNotation = function() {   return 'abcdefgh'[this.x] + '12345678'[this.y]; }  var pawn2 = new ChessPiece(1, 1); pawn2.getNotation(); // 'b2'   To me, the most significant difference is that when getNotation is on ChessPiece's prototype, that method is shared by all instances. When it's not on the prototype, there are multiple copies of getNotation. Does this matter? Is there more I am missing?  As an aside, the reason I prefer the first method is because it is cleaner to write everything in a single constructor function, rather than having to declare ChessPiece and then assign each method on separate lines. Is there a way to work around that issue, if the latter is preferred?


example for banning functions in $A.createComponent after Spring'19

Could someone share a piece of code that will stop working after the critical update "Prevent Creation of Function Expressions in Dynamically Created Aura Components" will be activated?  I'm not quite sure what is being banned here. Passing inline code has never worked and passing references like this seems to work fine:  $A.createComponent(         "ui:inputText",                 { "change": component.getReference("c.handleChange")},                 function(newCmp, status, errorMessage) {}         );


Unmanaged component in Managed Email template

I'm  having some trouble editing the content of a Managed Email Template, I can quite easily modify the content of the Email Template, but when I wish to refer to an unmanaged component, like this:  <messaging:attachment renderAs="PDF" filename="invoice.pdf">     <c:MyComponent/> </messaging:attachment>   I get the error message:     Error: Unknown component c:mycomponent   Does anyone know if its possible to embed an unmanaged component in a managed Email Template?


How to disable bluetooth on startup Ubuntu 18.10?

How to disable bluetooth automatic turn on in Ubuntu 18.10


WHY !! CountDown not Working inside the IF Condition?

i need a way to make the countdown decreasing inside the if statement i am stacking in  this problem for more than 3 days .. Don't suggest to me Coroutine cause it will not working in my case cause i am using clones (initiated prefabs)  i know that the countdown will work only one frame if it's inside an IF Statement ... Any Ideas to make it working ...Ty  The game is about cars ... and every instantiated car has a random countdown timer  void Update() {     if(carNumber < cars)     {         SpawnCars();     } }   and this is the spawn  function  void SpawnCars() {     randomSpawnPoint = Random.Range(0, spawnPoints.Length);      randomSpawnCars = Random.Range(0, Cars.Length);      GameObject obj = Instantiate(Cars[randomSpawnCars],spawnPoints[randomSpawnPoint].position, Quaternion.Euler(-90, 180, 0)) as GameObject;      carNumber++;                  obj.gameObject.tag = "select";// + k;      rcf = obj.GetComponent<RayCastForward>();     TextMesh txt = FindObjectOfType<TextMesh>();      time = Random.Range(4, 20);       txt.text = (time - Time.deltaTime).ToString("0");     print(time);     print(carNumber); }   EDIT: time is the timer


Does anyone know how to install drivers for Canon MG3200 from web?

Any help greatly appreciated, fairly new to both Ubuntu & linux


Changing title of a page dynamically from within a plugin

Every WordPress page can be described as having two titles:   The page/post title, which is displayed within the page/post via the the_title() function call The html <title></title> tag that displays the title on top of the browser   I am writing a plugin which at one point should change the title of a page dynamically (well, it should change both titles described above).  So, for step 1 above, I found multiple solutions on Stack Overflow (such as  or ). Those are great for only step 1 above.  For step 2, I found  solution; in a nutshell, this is how it works:  add_filter('wp_title', 'change_page_title'); function change_page_title ($title) {      // Do some magic, and eventually modify $title then return it     return $title; }   But the suggested solution is not working for me; and by not working I mean that the filter is not calling the associated function. I am not sure what the problem is; is it because this filter is being called from within the plugin not the theme? (Just FYI, I do not have access to the theme files, so it has to be done from within the plugin).  How can I accomplish this? How can I change the browser title of a page dynamically from within a plugin?   Thanks.


How do you earn free loot?  What's the deal with essences and why are they so important?  What do the different options mean when dealing with Redeeming Rerolling Disenchanting and Upgrading?  How does it all work?


I have the following piece of code as a problem.  list = [ [ ] ] * 5 print list list[0].append(1) print list   The first line prints [[][][][][]] which is what it should print  but the second print gives  [[1][1][1][1][1]]  why does this happen? it is supposed to append only to the first list.


I am new to LaTeX. I am not sure how to frame my question. But I will frame it so that it is understandable.  I would like to make a subfigure, but the caption must be   caption of subfigure a-1                caption of subfigure a-2      caption of subfigure b-1      caption of subfigure b-2                    `caption  of entire figure`   I  tried using subfigure, but I am getting continuously a,b,c,d, but i need to name them as as mentioned above (a-1, a-2, b-1, b-2).  In my situation, there are chances that the sub figures might be in different pages.


New Ubuntu 13.10 Laptop  File Sharing is working fine.  According to one post:   Go to the Printers applet Press the Add printer button Select Network Printer   Select Find Network Printer   Problem, when I select [Add printer] I do not have the [Find Network Printer] option.  What is missing?


Players tend to . Where can I find (or equally what can I use as) alternative Class Features for Wizards and Sorcerers to replace Familiars which will be more interesting and exciting for the players, while maintaining class balance?


I've inherited multiple servers, each containing one database and one instance of SQL Server 2008 R2 SP2. Each server is set to use 12GB min/max memory and has Lock Pages in Memory enabled. The servers have a total of 16GB memory, so 4GB is left for the OS and anything else.  My question is - Is this best practice? Should the servers be set to the same value for min/max memory or will this cause performance issues? I'm investigating a sudden increase in CPU usage across multiple servers and want to rule this out if possible.


Would the effect of gravity on me change if I were to dig a very deep hole and stand in it? If so, how would it change? Am I more likely to be pulled downwards, or pulled towards the edges of the hole? If there would be no change, why not?


I have been trying to find the sum $\sum_{n=1}^{\infty}(-1)^{(n+1)}\frac{2n+1}{3^n} $. After some calculation, I got here: $\frac{-6}{8}+\frac{1}{4}+8\sum\frac{k}{9^k}$. I know the result is $\frac{5}{8}$ , and I verified it with Wolfram Alpha.I saw that $\sum_{k=1}^{\infty}\frac{k}{9^k}=\frac{9}{64}$. But I don't know how to prove the last equation: $\sum_{k=1}^{\infty}\frac{k}{9^k}=\frac{9}{64}$. I hope someone could help me or show me another method to find the sum for my initial series.


What purpose are bank statements for a multiple entry UK standard visitor visa

While I can in part understand why bank statements are asked for when making a visa application, the value of them for a multiple-entry visa is somewhat lost on me, because their validity is meaningless after the first visit.  That being the case why bother to offer multiple-entry visas, when the authorities have NO way of knowing whether the visitor can afford future visits? This surely destroys the argument for their inclusion in the first place.


How to plot logistic regression decision boundary?

I am running logistic regression on a small dataset which looks like this:    After implementing gradient descent and the cost function, I am getting a 100% accuracy in the prediction stage, However I want to be sure that everything is in order so I am trying to plot the decision boundary line which separates the two datasets.  Below I present plots showing the cost function and theta parameters. As can be seen, currently I am printing the decision boundary line incorrectly.    Extracting data  clear all; close all; clc;  alpha = 0.01; num_iters = 1000;  %% Plotting data x1 = linspace(0,3,50); mqtrue = 5; cqtrue = 30; dat1 = mqtrue*x1+5*randn(1,50);  x2 = linspace(7,10,50); dat2 = mqtrue*x2 + (cqtrue + 5*randn(1,50));  x = [x1 x2]'; % X  subplot(2,2,1); dat = [dat1 dat2]'; % Y  scatter(x1, dat1); hold on; scatter(x2, dat2, '*'); hold on; classdata = (dat>40);   Computing Cost, Gradient and plotting  %  Setup the data matrix appropriately, and add ones for the intercept term [m, n] = size(x);  % Add intercept term to x and X_test x = [ones(m, 1) x];  % Initialize fitting parameters theta = zeros(n + 1, 1); %initial_theta = [0.2; 0.2];  J_history = zeros(num_iters, 1);   plot_x = [min(x(:,2))-2,  max(x(:,2))+2]  for iter = 1:num_iters  % Compute and display initial cost and gradient     [cost, grad] = logistic_costFunction(theta, x, classdata);     theta = theta - alpha * grad;     J_history(iter) = cost;      fprintf('Iteration #%d - Cost = %d... \r\n',iter, cost);       subplot(2,2,2);     hold on; grid on;     plot(iter, J_history(iter), '.r');  title(sprintf('Plot of cost against number of iterations. Cost is %g',J_history(iter)));     xlabel('Iterations')     ylabel('MSE')     drawnow      subplot(2,2,3);     grid on;     plot3(theta(1), theta(2), J_history(iter),'o')     title(sprintf('Tita0 = %g, Tita1=%g', theta(1), theta(2)))     xlabel('Tita0')     ylabel('Tita1')     zlabel('Cost')     hold on;     drawnow      subplot(2,2,1);     grid on;         % Calculate the decision boundary line     plot_y = theta(2).*plot_x + theta(1);  % <--- Boundary line      % Plot, and adjust axes for better viewing     plot(plot_x, plot_y)     hold on;     drawnow  end  fprintf('Cost at initial theta (zeros): %f\n', cost); fprintf('Gradient at initial theta (zeros): \n'); fprintf(' %f \n', grad);   The above code is implementing gradient descent correctly (I think) but I am still unable to show the boundary line plot. Any suggestions would be appreciated.    logistic_costFunction.m  function [J, grad] = logistic_costFunction(theta, X, y)      % Initialize some useful values     m = length(y); % number of training examples      grad = zeros(size(theta));      h = sigmoid(X * theta);     J = -(1 / m) * sum( (y .* log(h)) + ((1 - y) .* log(1 - h)) );      for i = 1 : size(theta, 1)         grad(i) = (1 / m) * sum( (h - y) .* X(:, i) );     end  end   EDIT:  As per the below answer by @Esmailian, now I have something like this:  [m, n] = size(x);  x1_class = [ones(m, 1) x1' dat1']; x2_class = [ones(m, 1) x2' dat2'];  x = [x1_class ; x2_class]


Why does using array and for loop breaks line into 2?

Why does the following gives the line I am searching:    grep '<appointment-id internal:ref=1.2.3/>' test.xml   OUTPUT is <appointment-id internal:ref=1.2.3/>     While the following breaks it into 2 lines?    a=($(grep '<appointment-id internal:ref=1.2.3/>' test.xml))   for i in "${a[@]}"; do       echo "checking $i"        grep  -n "$i" delete.xml done       The output is:     checking <appointment-id checking internal:ref=1.2.3/>   The file is:    <note>       <to>Jim</to>       <from>John</from>       <heading>Reminder</heading>       <body>Some text</body>       <appointment-id internal:ref=1.2.3/>  </note>


Dodging the inaccuracy of a floating point number

I totally understand the problems associated with floating points, but I have seen a very interesting behavior that I can't explain.      float x = 1028.25478; long int y = 102825478; float z = y/(float)100000.0; printf("x = %f ", x); printf("z = %f",z);   The output is:     x = 1028.254761 z = 1028.254780   Now if floating numbers failed to represent that specific random value (1028.25478) when I assigned that to variable x. Why isn't it the same in case of variable z?   P.S. I'm using pellesC IDE to test the code (C11 compiler).


Diversity disambiguation Q&A - do we need a new SE for cultural differencies and misunderstandings and their disambiguation?

Diversity is a great fun, sometimes puzzling, sometimes embarrassing, often totally absurdous but anyway you can learn a lot about other (sub)cultures and actually your own too.  Same things familiar and clear to you could have completely different "codes" in other (sub)cultures. Note this does not have to be bound to a specific region.  Just a few examples which could make good questions in this context, not only in terms of language disambiguation:   Is it correct that Russians say na zdorovje for cheers? How comes one colleague's name means in other's language exactly "who beats children?" Is it polite or impolite in culture X to tell guests that they should leave as it gets late? Is there a culture where you say "hello" by spitting on people? / Why did my Masai colleague asked to spit at him at our workplace during his afterwork birthday party last night? Every wondered that color of your teen child's shoe laces could express some specific message? Could it be that a friend a colleague behaves in a strange way because of the cultural superstition you never heard of? Is it okay not to have a separate BBQ device for people who are vegan or doing Ramadan?   I am sorry if you might find #3 and #4 embarassing but this is exactly why I've raised this question.  These are real life examples!   To 3. There have been two families in my friend circle who suffered a long night embarrasment because in guests' cultures it was impolite to leave by themselves, and guests' culture expected guests to leave by themselves.  To 4. Check this link:    I think anybody who has lived/worked in international/expat contexts, either has experiences in binational relationships, either compared youth/gender subcultures will think of many other examples and situations.  Based on the answers and votes, I will see whether an Area 51 request would make sense or not.  This question is not a duplicate because the effort for a new site proposal requires in my eyes getting an impression whether it's worth it or not before stepping in a more formal process.


Why multiple processes for Google Chrome in Task Manager while only one process for firefox?

I am using Windows 7 on my computer.  I use following browsers at a time:  Google Chrome  Mozilla Firefox  Now in my firefox browser, I have webpages running in more than 18 tabs & there is only 1 process for the entire firefox in the Task Manager. And they consume memory around 316004KB. And I have around 4 tabs opened in Google Chrome with 6 processes in the Task Manager? Why is it so?


I was wondering how to prove that an ordinal $\alpha$ is countable if and only if the next holds:  there is an order-preserving injection from $(\alpha,\leq)$ into $(\mathbb Q,\leq)$.


Javascript object property gets updated on assignment

I have created a JavaScript object like below -   var objtvar = {defaultPoints: [[0,0],[0,-10],[2.5, -10], [2.5, -10],[5, -10],[5,0]]}   I need to assign the defaultPoints property to another array and modify this new array. However on updating this new array, the object property too gets updated.  I want the object property to not change.  Code -   var objtvar = {defaultPoints: [[0,0],[0,-10],[2.5, -10], [2.5, -10],[5, -10],[5,0]]}; var flag = objtvar.defaultPoints; flag[5][1] = 9;   This updates the values in both flag array and the defaultPoints property. I do not wish the property to get updated.  Updated Solution - We can use the jquery extend suggested by @Nimrod Shory or use a pure JS implementation like this


terminal ask password but I cannot type nothing

unable to put anything in there. Is the password the same as administrator password?


Word for when two people type the same thing at the same time in chat

I have the distinct feeling there's a word often used when two people type the same thing at the same time in Internet chat contexts. Not necessarily exactly the same words, but closely related.  Maybe I've even come across it myself but forgotten it. All I can think of now is "Snap!", but that sounds a bit lame in this day and age (who plays cards nowadays, with all these video games?).


Wondering the proper grammar for "is" or "are"

I'm hoping to learn the proper grammar for a question I just asked a colleague.        The first of two calipers shipped to us is here.   The first of two calipers shipped to us are here.


"It’s not perfectly clear to me what it is you’re trying to say" vs. "It’s not perfectly clear what it is you’re trying to say"

It’s not perfectly clear to me what it is you’re trying to say.  It’s not perfectly clear what it is you’re trying to say.    What, if any, is the difference between (1) and (2)? Anyway, does to me add a bit of arrogance in (1)?


Merge multiple mp4 files into a single video via the terminal

I am trying to concatenate a directory full of .mp4 files into a single video through the terminal.  I have found plenty of methods that say they can do this but either require FFmpeg (which, to the best of my knowledge, is no longer supported) or they simple do not work.  Is it still possible to do this and if so how might I go about doing it?


I have read today: "Individuals from those states who have proper visas can now board U.S.-bound flights, said the official, who was not authorized to speak publicly."  The sentence uses reversed order of words "said the official". Why? Is it acceptable? Can anybody explain me the grammar rule?


What is the meaning of the phrase "no sooner than"?

1. He was no sooner graduated than he was on his way to California.   2.  No sooner had the plane taken off than I regretted not taking the train.  Above are the examples of using the phrase "no sooner than" which I found in some textbook. Why is not used Past Perfect in the first sentence as it is so in the second one? Would it be a mistake to write: He had not been no sooner graduated then he was on his way to California.


How to factor intricate polynomial $ ab^3 - a^3b + a^3c -ac^3 +bc^3 - b^3c $

I would like to know how to factor the following polynomial.  $$ ab^3 - a^3b + a^3c -ac^3 +bc^3 - b^3c $$ What is the method I should use to factor it? If anyone could help.. Thanks in advance.


Need to customize newdocset.aspx of document set in Sharepoint 2010

We need to customize newdocset.aspx of document set in SharePoint 2010. Currently reference is given to newdocset.aspx of _layouts folders application pages. Did lot of research, but I got no where.


Imagine I have a box, and in it, I have a photon in a superposition of state |1> and |0>. I look into the box and register that the photon is in state |1>.   Now, if I have ALL information in the universe, inside and outside the box, as well as the complete set of all physical laws (whether we've discovered them or not), can I deduce that the photon was previously in a superposition?


Stuck on blue screen while booting the system

I am using Ubuntu 16.04 and I am stuck into blue screen with no message.  Its just showing a cursor nothing else.    Any help is appreciated.


I was given this problem in definite integral and limits chapter $$\lim_{n \to \infty}\left( \frac{n}{n^2 + 1^2}+ \frac{n}{n^2 + 2^2} + \frac{n}{n^2 + 3^2 }+........+\frac{n}{n^2 + n^2}\right)$$ which method is used to evaluate these kind of problems and how do i evaluate this sum of limits ? I have heard some Riemann's sum is used but i do not know it and how to solve by that method if you can explain me how its done


Give an epsilon-delta proof that the limit for x→0 of x³sin(x) exists.  What I can derive from this question is   lim = ?= 0  x=0  so, with an epsilon delta proof, i have to proof that at point x=0 there is a limit. So x³ isn't possible for x<0.   Because of de sin(x) I get that it is not possible to have a negative x, but I don;t know how to use the epsilon delta proof with this.   Please help


I have Ubuntu 12.10 on my laptop, no Windows.  I have my system disks and tried to do a system recovery and it won't allow me.  I've tried creating a boot disk and doing the "try ubuntu" and installing the OS uninstaller.  My laptop freezes up in this process.  Any other suggestions on how to remove ubuntu and reinstall my windows vista again?


Keyword `new` in combination with `auto`

What does   new (&as_string) auto(other.as_string);   do where as_string is an std::string object? I see that auto(other.as_string) constructs a new copy of other.as_string but what does the (&as_string) causes in combination with the new?


Buildroot is generating images for an embedded device where they should run. This is working very well. In those images, the rootfs is included.  Due to some research, I'd like to look into that generated file (e.g. different compression modes set by the Buildroot were applied and now shall be checked if they were correctly done), but I can't find something useful in the Net.  As far as I know, the difference between a uImage and zImage is just a small header, so u-boot is able to read that binary file. But I can open neither uImage nor the zImage.  Can anyone give me a hint of how to decompress those (u/z)Images on the host?


Sharing Open Source Python/ArcPy Code and Models for ArcGIS Desktop?

I will be writing scripts for ArcGIS Desktop in Python with ArcPy.   Is there a community or open source project where code and models can be shared?


Do the yearly (worldcomp) conference recognized by Scientists?

I am planning to submit for a conference that organized by the (World Congress in Computer Science, Computer Engineering, & Applied Computing ) located and held every year in the US. Looking at their invited speakers over the last 10 years, they managed to attract many top scientists from NASA, SAP, Google...etc  The conference that I am planning to submit my work for named The 20th Int'l Conf on Artificial Intelligence (ICAI'18) and ranked-B according to Qualis. After I checked the dblp database, I noticed that they stoped indexing the Congress proceeding on their website. Do that indicate or reflect any bad signs?


Why do I get a NullPointerException on this Infix to Postfix programm code

I need to write the Java code for the Shunting Yard algorithm, I receive a string which I take to a queue and I start the evaluation. I got classes for Node, Stack, Queue which are supposed to work OK. My method balancear is this ...  public boolean balancear (Cola infijo) {      balance=infijo;     int balanceado=0;     char parentesis;      while (!balance.isEmpty()) {          parentesis=balance.pop();         if (parentesis=='(')             balanceado++;         else if (parentesis==')')             balanceado--;     }      return balanceado==0; }    package expresionpolaca; public class Postfijo {      Pila operadores = new Pila();     Cola infijo = new Cola ();     Cola postfijo = new Cola ();     Herramientas evaluador;     StringBuilder salida = new StringBuilder();     int re;      public Postfijo (String expresion) {          for (int i = 0; i < expresion.length() ; i++) {             infijo.push(expresion.charAt(i));          }      }      public String Convertir () {           evaluador.balancear(infijo);         // I get NullPointerException Right HERE          if (evaluador.balancear(infijo)) {   // I get NullPointerException Right HERE              while (!infijo.isEmpty()) {                   char tmp=infijo.pop();             if (Character.isLetterOrDigit(tmp)) {                  postfijo.push(tmp);             }              else  {                 switch (tmp) {                  case '(':                     operadores.push(tmp);                     break;                 case ')':                      do {                         tmp=operadores.pop();                         if (tmp!='(') postfijo.push(tmp);                     } while(tmp!='(');                     operadores.pop();                     break;                  default:                     if (operadores.sneak()=='(') operadores.push(tmp);                     else while (evaluador.prioridad(tmp)>evaluador.prioridad(operadores.sneak())||operadores.sneak()!='('||operadores.isEmpty()==false) {                         postfijo.push(operadores.pop());                     }                     break;                 }              }          }          while (!operadores.isEmpty()) postfijo.push(operadores.pop());      }      else return "No balanceada";      while (!postfijo.isEmpty()) {          salida.append(postfijo.pop());     }      return salida.toString();    }   }


How to prevent browsers from caching HTML in history?

I am running a JavaScript and AJAX based chatroom. When a user leaves the page and then returns by using the Back button, they load the page from the cache. The JavaScript has to hurry and get the page back up to date, as it sees the last refresh was long ago and and requests a huge length of time in chat history to fill the gap.  What I would like instead is for the browser to be explicitly told that that HTML is invalid once they leave the page and they should do a straight refresh instead if they return to it.


Ubuntu 15.04 Installation Problem, HP Envy 15

This is my first system with UEFI.... Laptop name: HP Envy 15 Notebook PC (with Touchscreen).... OS installed: Windows 10, self installed .... Processor: Intel i7-5500U @ 2.40GHz (4 CPUs) .... Ram: 8 GB .... It has Intel HD Graphics 5500 and Nvidia Geforce GTX 850M .... I created a LiveUSB of Ubuntu 15.04. md5 was fine. it worked on a friends PC. But in my laptop, I can boot from it. I select "try Ubuntu without installing" Then this happens:  Then this happens:  After this Ubuntu regular boot image starts (the purple screen with Ubuntu logo) never to move ahead.  Edit: I use the nomodeset option. Boot the LiveCD/LiveUSB .. when you get to the screen where it ask if you want to install or try Ubuntu, leave "Try Ubuntu" highlighted and hit e....... Change quiet splash --  make it end with:-  quiet splash nomodeset


Rolling three dice...am I doing this correctly?

Tree dice are thrown. What is the probability the same number appears on exactly two of the three dice?  Since you need exactly two to be the same, there are three possibilities: 1. First and second, not third 2. First and third, not second 3. Second and third, not first  For 1) The first die, you have $\frac{6}{6}$. The second die needs to be equal to the first, so you have probability of $\frac{1}{6}$. Then the third die can't be equal to the first and second dice, so it's $\frac{5}{6}$.  All together you get $1 \cdot \frac{1}{6} \cdot \frac{5}{6}$. And since the next two cases yield the same results, then the probability that the same number apears on exactly two of the three dice is $$ 3 \cdot \left(1 \cdot\frac{1}{6} \cdot \frac{5}{6}\right)=\frac{5}{12}$$  Did I do this correctly? Thank you.


Drupal navigation always returns a 404 error

I have been given a Drupal site which I have to get it running.  I have Apache / Drupal / MySQL up and running, and created a new .conf file in Active Sites, and set the document location to /var/www/html/  I have edited my hosts file so that I have an entry for   127.0.0.1 samplesite.com   If I browse to samplesite.com/index.php I see the index of the site. So far so good. It is all styled, and as I see genuine content I must be hitting the database  Now no matter what link I click on on that page, I get a 404 error. (Looking in the log files its a 404 523 error if that has any bearing on it.)  I then found out the admin userid (using drush), reset the password, and cleared all caches. Still the 404 errors.  If I go to samplesite.com/user or samplesite.com/admin, I still get the 404 error, not an admin login page.  As this is an existing site, and works online, I am blaming something in my setup / configuration (being as the url on a failed link is similar to samplesite.com/about, I am assuming it is in the navigation configuration, but now I am stuck).  Is there an apache url rewriting module (or drupal one?) that needs some configuration? Or can anyone suggest something else I may have overlooked in apache / drupal configuration?  I now have the line $base-url = 'samplesite.com'; in my settings.php file, and none of the other urls work. However it accepts that I am logged in as admin as I have an additional admin menu at the top of the page. (none of the links work though) Curiously, if I disable wifi, then the page doesn't load at all (I wouldn't have thought that wifi on or off would affect localhost)  Ok, My fix came when I followed this thread   I needed to add in the following.  <Directory /var/www/html>    RewriteEngine on    RewriteBase /    RewriteCond %{REQUEST_FILENAME} !-f    RewriteCond %{REQUEST_FILENAME} !-d    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] </Directory>   However I only got here because of the help I received along the way, I think this was just the missing piece.


Using schema other than public with PostGIS?

I've read (too late) that it's best to use another schema to store data tables in than the public schema when using PostGIS.  e.g. here:   Considering this is all quite old (e.g. the above accepted answer is from 2012), I'm wondering if this is still as valid as it was back then for current versions of PostgreSQL and PostGIS ?


Check if a folder has a certain type of file present

How could I check if a file has a file of extension .java?  So far I have:     for javaFile in *.java ; do     {         echo "The file $javaFile has : " >> ~/Desktop/externalServers.txt         grep -E '^[^/]{2}.*http' $javaFile >> ~/Desktop/externalServers.txt               grep -E '^[^/]{2}.*ftp' $javaFile  >> ~/Desktop/externalServers.txt          echo "----------------------------------------" >> ~/Desktop/externalServers.txt         sed -e "s/[[:space:]]\+/ /g" ~/Desktop/externalServers.txt >> ~/Desktop/externalServersTemp.txt         rm ~/Desktop/externalServers.txt         mv ~/Desktop/externalServersTemp.txt ~/Desktop/externalServers.txt         sed 's/^\n//' ~/Desktop/externalServers.txt >> ~/Desktop/externalServersTemp.txt         rm ~/Desktop/externalServers.txt         mv ~/Desktop/externalServersTemp.txt ~/Desktop/externalServers.txt      } done   But every time I do that, I get the error:      grep: *.java: No such file or directory   Basically I want to first see if the folder has any files of type .java and only continue with the script.


The Time That 2 Masses Will Collide Due To Newtonian Gravity

My friend and I have been wracking our heads with this one for the past 3 hours... We have 2 point masses, $m$ and $M$ in a perfect world separated by radius r.  Starting from rest, they both begin to accelerate towards each other. So we have the gravitational force between them as:  $$F_g ~=~ G\frac{Mm}{r^2}$$  How do we find out at what time they will collide?  What we're having trouble with is this function being a function of $r$, but I have suspected it as actually a function of $t$ due to the units of $G$ being $N(m/kg)^2$.  I've tried taking a number of integrals, which haven't really yielded anything useful.  Any guidance?  No, this is not an actual homework problem, we're just 2 math/physics/computer people who are very bored at work :)


So I think this may be fairly easy but I am not finding the solution. I want to move several USB cables along a curve and have them plug themselves in. Naturally I thought to just model out the cables and then apply a curve modifier, the only flaw is I do not want the head of the cables deformed... So how can I get the cable to follow the path and deform while having the head follow that same path and not deform?  Thank you so much!


How to know before an object is destroyed

Is there a way to know before an java object get destroyed??  For example:  class A{}  I have instantiated it as new A(). Now I would like to know when this object will get destroyed and do some operations before it get destroyed.


While using INDEX and REGEXEXTRACT, how can I return blank cell instead of 0

While using INDEX and REGEXEXTRACT, how can I change this formula to return a blank cell (instead of 0) when all of the cells in that section are blank?


Why didn't Mace Windu consult Yoda before going after Palpatine?

After Anakin told Windu that Palpatine was a Sith, Windu made a plan on the fly to assassinate Palpatine with few Jedi present.   Why didn't he contact Yoda and other Jedi Masters who were in the battlefield before going after Palpatine?   They could have even reached the conclusion that the Clone Wars was a deceit (Dooku was on Separatists' side, so reaching this conclusion shouldn't have been difficult) and they could have returned to Coruscant. Or maybe, Yoda could have said, "Powerful may be, the Dark Lord. Wait for me, you must."


Windows 10 boots for more than 10 minutes even after a reset

My Windows 10 PC (which i hardly used since purchasing a laptop) was full of unused stuff, both SSD and regular hard drive had really low amount of free storage and it took really abnormal long time to boot.  I'm talking about the black boot screen with blue Windows logo and rotating dots circle animation.  I guessed it's because a lot of bloatware and low free space so i just used the built in "Reset this PC" option.  Even after resetting it and deleting all the files and settings it now takes the same time to boot.  Any idea what causes it?  Since resetting it didn't help it must be Hardware right? My guess is something in the SSD drive, which contains the Windows installation, but i'm not sure on how to check it.


The  specifically says not to ask  for career advice but people do it anyway.  Should I consider the Help Center outdated or only loosely enforced?    And what about a career advice site on the network?  There are 70+ sites, and most of them are for relatively narrow interests (which is not a criticism, I enjoy looking through the many sections).  A career section seems like it would be very popular.  Also, a careers section would help keep career questions off the other sites.


Does $c\cdot f(x) = f(cx) \implies f$ is linear?

A linear functions $f$ is a function that has the following two properties:   $c\cdot f(x) = f(cx)$ $f(x+y) = f(x) + f(y)$   But does $c\cdot f(x) = f(cx) \implies f$ is linear? Can we assume property $2$ above, if we have a function $f$ satisfying property $1$?


Why are there no byte or short literals in Java?

I can create a literal long by appending an L to the value; why can't I create a literal short or byte in some similar way? Why do I need to use an int literal with a cast?  And if the answer is "Because there was no short literal in C", then why are there no short literals in C?  This doesn't actually affect my life in any meaningful way; it's easy enough to write (short) 0 instead of 0S or something. But the inconsistency makes me curious; it's one of those things that bother you when you're up late at night. Someone at some point made a design decision to make it possible to enter literals for some of the primitive types, but not for all of them. Why?


Source for how to Interprete Results with Extremely Low p-values and Coefficient of Determinations

I finished doing a bunch of data analysis and my results have very impressive p-values and absolutely horrible coefficients of determinations. The way I want to interpret this is that my methodology is very accurate, but not precise. Considering I am working with ecology data, that makes a lot of sense. The problem I am having is that I can't find any formal source that give supports this interpretation. The closest I have is  blog post and  online textbook for high schoolers. If my interpretation is reasonable, what source I can cite to support it? If my interpretation is unreasonable, what is a better interpretation and what sources support it?


Why isn't accuracy of binary classification model improving?

I have a data set with a binary response variable, about 30,000 observations of 8 features, some are continuous and some are categorical.   This is an imbalanced data set, the ratio of negatives to positives is about 5:1. So the null accuracy (always predicting negatives) is ~84%.   I know that for imbalanced data sets accuracy is usually not a good metric. But in my context a high accuracy is desirable and because the imbalance is not extreme I think it is possible to improve. I would like to shoot for at least 90% accuracy.   I have tried various feature engineering techniques and machine learning models but I am not even able to hit 86%. For example, decision trees, logistic regression and random forests all give about 85.6-8% accuracy. I used cross-validation for finetuning hyperparameters and checked training accuracy to make sure there was no overfitting.   What could be the reasons for getting such a marginal improvement in accuracy over a dumb model?


Pardon me if this question does not fit this site (or SE engine in general) but I do not know where to post it. Suppose that you have unknown data set which you want to explore. What functions/methods/techniques should I use to get birds eye of the data? I guess it depends on the data. I'm particularly interests in the ordered integers (but feel free to post other types also). Few examples that comes to my mind are: histograms, barplots, (moving) mean (aka average) median mode variance standard-deviation. What else? Thank you.


What is $\gcd(0,a)$, where $a$ is a positive integer?

I have tried $\gcd(0,8)$ in a lot of online  gcd (or hcf) calculators, but some say $\gcd(0,8)=0$, some other gives $\gcd(0,8)=8$ and some others give $\gcd(0,8)=1$. So really which one of these is correct and why there are different conventions?


Single and double quotes in form fields will not write to Mysql database. Is there a solution?

I have a registration form on a website. I'm using a pretty standard php form to send the form submission to me via email. I'm using a formhook to also insert those form entries into a mysql database. The only problem I have is when someone tries to include single or double quotes in a field. For instance one field asks for verbiage for the back of a t-shirt. Some people just seem to want to add quotes to their verbiage. This causes the information to not be inserted into the database. I'm somewhat new to sql and have been reading up on escaping quotes but still not grasping the solution. See my form below .. this is the formhook that inserts the information into the database. Is there a statement I can add to the php code that will allow both single and double quotes? Thank you!  $con=mysql_connect($hostname,$username,$password); if(! $con) { die('Connection Failed'.mysql_error()); }  mysql_select_db($database,$con); //if submit is not blanked i.e. it is clicked. {  $sql="insert into sponsors2015(realname, sponsorname, email, phone, shirtnameverbiage, platinum_2500, gold_2000, silver_1500, bronze_1000, beverage_500, longdrive_200, closest_to_pin_200, par3_150, hole_100) values('".$_REQUEST['realname']."', '".$_REQUEST['sponsorname']."', '".$_REQUEST['email']."', '".$_REQUEST['phone']."', '".$_REQUEST['shirtnameverbiage']."', '".$_REQUEST['platinum_2500']."', '".$_REQUEST['gold_2000']."', '".$_REQUEST['silver_1500']."', '".$_REQUEST['bronze_1000']."', '".$_REQUEST['beverage_500']."', '".$_REQUEST['longdrive_200']."', '".$_REQUEST['closest_to_pin_200']."', '".$_REQUEST['par3_150']."', '".$_REQUEST['hole_100']."')";  $res=mysql_query($sql); if($res)  { Echo header('Location: sponsor-registration-success.php'); } Else { Echo header('Location: sponsor-registration-problem.php'); }  }


The deep reason why $\int \frac{1}{x}\operatorname{d}x$ is a transcendental function ($\log$)

In general, the indefinite integral of $x^n$  has power $n+1$.  This is the standard power rule.  Why does it "break" for $n=-1$?  In other words, the derivative rule $$\frac{d}{dx} x^{n} = nx^{n-1}$$ fails to hold for $n=0$. Is there some deep reason for this discontinuity?


How to set or reset password for mysql install to blank

I want a blank mysql password on my new Ubuntu 16.04 development machine the same as I've had on previous machines.  It plays well with my existing local ruby on rails apps configuration files which use root.  I start with  sudo apt-get install mysql   then I can use   service mysql start   and when I use   ps aug | grep mysql   I see the process running  mysql    24618  6.5  1.6 1230276 133536 ?      Ssl  19:03   0:00 /usr/sbin/mysqld   I stop it with  service mysql stop   and then I use   sudo mysqld_safe --skip-grant-tables   and in another window I do  mysql>  mysql> UPDATE mysql.user SET authentication_string = ''     -> WHERE User = 'root' AND Host = 'localhost'; Query OK, 1 row affected (0.00 sec) Rows matched: 1  Changed: 1  Warnings: 0  mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec)   I then use   sudo kill -9 [pid_of_mysqld_safe]   and then  service mysql start   to start it normally but when I try  mysql -u root   I get  ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)   I also tried using an actual string instead of '' for the password but still had the same issue  I've gone through   and  and  and   but they haven't helped, I get the same error.  $ sudo systemctl status mysql   shows  ● mysql.service - MySQL Community Server    Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)    Active: active (running) since Wed 2016-08-24 20:04:49 EDT; 4min 39s ago   Process: 9018 ExecStartPost=/usr/share/mysql/mysql-systemd-start post (code=exited, status=0/SUCCESS)   Process: 9013 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)  Main PID: 9017 (mysqld)    CGroup: /system.slice/mysql.service            └─9017 /usr/sbin/mysqld  Aug 24 20:04:48 Ubuntu2016 systemd[1]: Starting MySQL Community Server... Aug 24 20:04:49 Ubuntu2016 systemd[1]: Started MySQL Community Server.


What is Analog and Digital supply voltage

Currently I have start working on MSP430 Controller and found that there are 4 pins for the supply voltage viz. AVcc, DVcc, AVss, DVss. These are used as analog supply voltage and Digital supply voltage. What are the purpose of providing these twins pins? How can I use these pins during designing of supply section.


What is Ubuntu Base Update ?  What does exactly this patch in the case of security?  Why do I need to install it?


Text must be left.

     Please help me How can I centrally align sub div and paragraph must be left. Please refer ?


How do I fix the tiny font in my Windows 7 system dialog boxes?

Something happened today which caused all system dialog boxes to change the font they use to something that is almost unreadable.  The link below is a snip from the System Properties dialog which shows the small text:     Note that the window title is readable.  The Window Color and Appearance dialog does not allow me to change it.  I can change the theme to "Basic" or any other built-in theme and it still displays incorrectly.  I have another user account on this computer and that user account behaves the same way.  How can I fix this?


Showing that 2 elements of a vectorspace are equal

I don't know how to solve the following problem. Suppose that dim(V) = n and W = $\mathbb{R}$. The vectorspace V* = Hom(V, $\mathbb{R}$) is called the dual space of V. An element $\phi$ $\in$ V* is called a (linear) functional. Now, suppose that v, w $\in$ V such that $\phi$(v) = $\phi$(w) for all $\phi$ $\in$ V*. Can we conclude that v = w?  Thanks for your help.


Why does this List Comprehension work but not the for loop for creating a grid copy?

I am confused why the below works but the following does not? Input: grid = [[0,1,0],[0,0,1],[1,1,1],[0,0,0]]  Working: def foo(grid):     m = len(grid)     n = len(grid[0])     gridCopy = [[grid[row][col] for col in range(n)] for row in range(m)]     return gridCopy == grid  Does not work: def bar(grid):     m = len(grid)     n = len(grid[0])     gridCopy = [[None] * n] * m     for i in range(m):         for j in range(n):             gridCopy[i][j] = grid[i][j]     return gridCopy == grid  I get the following grid returned from bar(): gridCopy = [[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]]


Positive, real, bounded sequence $(X_n)$. Prove that $\liminf \sqrt{X_n} = \sqrt{\liminf X_n}$

Define $(X_n)$ to be a bounded sequence of real numbers such that $∀n∈ℕ, X_n ≥ 0$  Show that $\liminf \sqrt{X_n} = \sqrt{\liminf X_n}$  Side-question: $(X_n) ⊆ ℝ$?  How should I go about on this proof? I don't see a direct way and am wondering if I should first prove $\liminf \sqrt{X_n} \le \sqrt{\liminf X_n}$ and then $\liminf \sqrt{X_n} \ge \sqrt{\liminf X_n}$?  How do I start? If I consider $u ∈ S(\sqrt{X_n})$, a subsequence limit of $\sqrt{X_n}$, how to proceed?


Is there an inductive definition of real numbers with a corresponding "proof by induction"?

I just read about inductively defining a set as follows :         Take a set of objects U.   Take a set of starting objects B ⊆ U.   Let C be the smallest subset of U that contains B and is closed under all operations on some class F.           Any set S that contains B and is closed under all operations in F is called inductive.           For example , consider the set of natural numbers as :          U = R , B = {0} and F = {S} where S(x) = x+1        My Question is can we define positive Real Numbers as follows :      U = R , B = [0 , 1) and F = {S} where S(x) = x+1    If so , can we prove property P(x) of positive real numbers inductively as follows :        P is true in interval [0,1).   If P(x) is true ,P(x+1) is also true.


How to start the start symbol from the right side?

When the automata is made I want the start symbol to start from the right instead of left as start symbol is colliding with the line:  \documentclass[a4paper,8pt]{article} \usepackage{amssymb,amsthm} \usepackage{amsmath} \usepackage{setspace} \usepackage{graphicx} %\usepackage{slashbox} \usepackage{graphicx} \usepackage[margin=1in]{geometry} \usepackage{qtree} \newtheorem{thm}{Theorem}[section] \newtheorem{prop}[thm]{Proposition} \newtheorem{cor}[thm]{Corollary} \newtheorem{lemma}[thm]{Lemma} \newtheorem*{defi}{Definition} \linespread{1.2} \usepackage{qtree} \usepackage{xcolor} \usepackage{tikz} \usetikzlibrary{automata,positioning,decorations.markings,arrows} \usepackage[margin=1in]{geometry} \usepackage{fancyhdr} \pagestyle{fancy}  \begin{document} Reverse:\\ \begin{tikzpicture}[shorten >=2pt,node distance=2cm,on grid,auto] \node[state,accepting](s) {$s$}; \node[state](q_0) [right=of s] {$q_0$}; \node[initial,state](q_1) [right=of q_0] {$q_1$}; \node[state](q_2) [below=of s] {$q_2$}; \node[state ](q_3) [below=of q_2] {$q_3$}; \path[->] (q_0) edge node{a} (s) (q_1) edge node{b} (q_0) edge [loop above ] node {b} () (q_3) edge  node {a} (q_1) edge [loop below ] node {a} () (q_2) edge node{b} (s) (q_3) edge node{a} (q_2) (q_2) edge [loop right ] node {a} () (q_2) edge [bend left =30] node {b} (q_3); \end{tikzpicture} \end{document}


Showing that $ \frac{2a_1^2}{a_1+a_2}+\frac{2a_2^2}{a_2+a_3}+...+\frac{2a_n^2}{a_n+a_1}\geq a_1+a_2+...+a_n$ holds for positive $a_i$s.  I've tried adding $a_1+a_2, a_2+a_3,...,a_n+a_1$ respectively to the terms of the LHS and using AM-GM on them, but it didn't get me to the needed point. Also tried AM GM on the whole LHS, but couldn't get much. How is it done?


I was wondering if definitions in mathematics are "if and only" statements?  I know for sure that theorems are not "iff" statements.  Thank you in advance for your help.


Is it acceptable to write the electronic Travel Authorization in a free page of your passport?

Electronic Travel Authorization (eTA) of Canada is transferred as a separate sheet-of-paper document that contains basically one number and  the valid date. Can I, instead of keeping it with me for the next 5 years, write the eTA number in my passport? Will it be accepted by the border officers/airlines?  Note that this question is different from the one it is marked a duplicate of, as eta number is being asked by airlines as travel authorization, so it makes some sense to have it in your passport (comparing to random private notes).


Earendil and Elwing were given the choice of kindreds after their journey to Valinor, This choice was extended to their sons (specifically sons, not daughters or grandchildren)  Elrond chose the race of the Eldar and his brother Elros chose to be counted amongst the Edain. Thus far Manwë's proclamation has been fulfilled.  There are some inconsistencies here:   Arwen was given the choice, but Elladan and Elrohir remained as Eldar in Imladris Tar-Vardamir was not given the choice The offspring of Imrazor and Mithrelas in Dol Amroth dont seem to have been given a choice   I can think of only one explanation, that the Mannish blood is dominant over the blood of the Eldar, thus, As Vardamir was the offspring of two mortals he did not fall under Manwë's proclamation despite being the son of a half elven.  However this does not seem to explain the other inconsistencies, Is it possible that Elladan and Elrohir and also the princes of Dol Amroth weren't considered important enough by Manwë or Eru to give them the choice.  Also as a side note Tolkien states there were only three unions between man and elf, but this seems to ignore Turin/Finduilas and Imrazor/Mithrelas  My question is, Why was Arwen given the choice and not the sons of Elros?


Do moderators have privileges to accept answer?

Do moderators have the privilege to accept the answer on their own if answer gets much positive points and is helpful for users?


Installing Ubuntu to dual boot with windows 8.1, windows not recognized during install

I am currently trying to install ubuntu 13.10 to dual-boot with windows 8.1 on my laptop. The laptop is a Lenovo Ideapad z400 touch. I am getting stuck at the Install Style screen because the installer is not recognizing windows being already there and I don't know how I should do the partitioning manually. The boot-repair pastebin is   I have about 70 GB of unallocated space on my hdd for ubuntu.  Here is the lbsk output:   ubuntu@ubuntu:~$ lsblk NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT sda      8:0    0 931.5G  0 disk ├─sda1   8:1    0  1000M  0 part ├─sda2   8:2    0   260M  0 part ├─sda3   8:3    0  1000M  0 part ├─sda4   8:4    0   128M  0 part ├─sda5   8:5    0 839.7G  0 part ├─sda6   8:6    0   350M  0 part └─sda7   8:7    0    20G  0 part sdb      8:16   1  29.3G  0 disk └─sdb1   8:17   1  29.3G  0 part /cdrom sr0     11:0    1  1024M  0 rom       loop0    7:0    0 842.7M  1 loop /rofs    Here is the sudo blkid output:  ubuntu@ubuntu:~$ sudo blkid /dev/sda1: LABEL="WINRE_DRV" UUID="CC863F8F863F78D2" TYPE="ntfs" /dev/sda2: LABEL="SYSTEM_DRV" UUID="2241-C2D6" TYPE="vfat" /dev/sda3: LABEL="LRS_ESP" UUID="6C41-FE4B" TYPE="vfat" /dev/sda5: LABEL="Windows8_OS" UUID="284245254244F8D8" TYPE="ntfs" /dev/sda6: UUID="145447175446FACE" TYPE="ntfs" /dev/sda7: LABEL="PBR_DRV" UUID="8C0C487E0C4864F4" TYPE="ntfs" /dev/loop0: TYPE="squashfs" /dev/sdb1: LABEL="UUI" UUID="50B7-103F" TYPE="vfat"    Thanks.


Fourier transform of $\int_{-\infty}^{t}f(t)\, dt$

How to prove   that      $$\mathcal{F}\left\{\int_{-\infty}^{t}f(\tau)\, d\tau\right\}=\frac{1}{i\omega}F(\omega)+\pi F(0)\delta(\omega),$$   where $F(\omega)$ is Fourier transform of $f(t)$.  Could anyone explain to me how to prove this?  thanks.


JVM - Order of execution of sub class methods and the use of @override

This is a newbie question. I read that JVM's execution starts from searching for the methodname from lowest class in the hierarchy and if the method is not available in that class it traverses to the parent class looking for the method.  If this is the case then why do we need to use "@override" for adding custom logic to the inherited class ?  The below example illustrates my question  class superclassA {  method() { }  }  class subclassB extends superclassA {  @Override  //While executing if JVM starts looking for the method name from the lowest hierarchy //then why do we have to use "override" as the methodname will be matched from the lowest level itself? method()  { --custom subclass specific code... }   }


use some apps on ethernet, others on wifi?

Is there any way to tell an application to use a specific network interface?  I'Ve got the problem that iMessage and other apps need to run on the proxy-free wifi network while other apps such as Xcode need to run on ethernet to connect to the repository in the wired network.  Is there any way to do this?


In my code I have GUI constructor which extends JDialog as below.  public OrdersGUI() {   //code for adding SWING components to panels and JDialog.  }   Now how do I overload the constructor  with parameters such as (String referenceNo) which will produce the same JDialog as the default constructor without copy/pasting everything from default constructor?


How to Suppress messages generated by an application being sent to my terminal window?

When I launch an application from terminal related to the window system, for example gnome or kde, then usually these applications send all sorts of junk messages in my terminal. How do I make these applications shut up? For example if I type:  okular somepdf.pdf &   a window which shows the pdf file pops up and I can read the pdf next to my terminal, and when I am done I close. Here is a typical example: :~$ cd Documents :~/Documents$ okular equi.dvi & [1] 5823  and when I close it sends this junk to the terminal: :~/Documents$ okular(5823)/kdeui (kdelibs) KXMLGUIClient::~KXMLGUIClient: 0x2322528 deleted without having been removed from the factory first. This will leak standalone popupmenus and could lead to crashes.  d  d: command not found [1]+  Done                    okular equi.dvi [1]+  Done                    okular equi.dvi :~/Documents$   The only thing I would like to see is: :~$ cd Documents :~/Documents$ okular equi.dvi & :~/Documents$  Perhaps that message was some bug, I do not care and I do not want to know about it. Is it possible to suppress these messages? Some people flagged this question as a duplicate to a question on "how to suppress output", but this is only partially what I want: I want to automatically suppress all output of certain applications. For instance okular is a graphical application, so I will never care about what it has to say in my terminal. So like I said above, I want the behavior to be : :~$ cd Documents :~/Documents$ okular equi.dvi & :~/Documents$  and not something like :~$ cd Documents :~/Documents$ okular equi.dvi > whatever & :~/Documents$


OS X has emoji support inside terminal, and I'm a little jelly.   brings emoji support to Ubuntu, but at the moment the terminal will only render monochrome emojis.  Is there a way to get these color beauties in gnome terminal?


Does the Xbox One automatically download app/game updates?

My console is set to use the Instant-On power mode and I’ve checked the box allowing it to “download updates automatically” when in this mode.  However, when I launch games and apps, I still see the “Oh, shoot. We need to update first” screen quite often. I’ve also noticed that items in my download queue are not completed while in Instant-On mode.  Is this setting really just for system updates? Or does it apply to app/game updates as well? Is it available outside the United States or something silly?  Edit: My console does go to sleep so that is not the issue.


In my drive D I see these strange folders:    I can't delete the file


Using Riemann Integral determine the limit

First of all, I know that Math Stack Exchange contains the answer but as I searched all the answer I can say that nobody used the simple limit rules to evaluate the limit. Either do I. So here's my (minor) solution: Here is $b=2, \quad a=1$, so $\Delta x = \dfrac{1}{n}$ and also there exist a point $x_{i}^{*}=1+\dfrac{i}{n}$. Let $f(x)=\dfrac{1}{x_{i}^{*}}$. Using Riemann Sum: $$\displaystyle\lim_{n \to \infty} \displaystyle\sum_{i=1}^{n}= \dfrac{1}{n+i}$$ And more explicitly, $$\displaystyle\lim_{n \to \infty} (\dfrac{1}{n+1}+\dfrac{1}{n+2}+...+\dfrac{1}{n+n}) $$ Here I can't solve the limit using just limit properties and some identities. Thanks.


What should we call language that intentionally conveys the opposite of the literal meaning?

This seems to me to be a kind of rhetorical figure, but I cannot find a classical term for it in . Examples include the following from Tristram Shandy (Vol. 2 Chap. 24):     I define a nose, as follows,—intreating only beforehand, and beseeching my readers, both male and female, of what age, complexion, and condition soever, for the love of God and their own souls, to guard against the temptations and suggestions of the devil, and suffer him by no art or wile to put any other ideas into their minds, than what I put into my definition.—For by the word Nose, throughout all this long chapter of noses, and in every other part of my work, where the word Nose occurs,—I declare, by that word I mean a Nose, and nothing more, or less.   This of course makes it quite impossible not to read nose in the book as also referring to penis.   Another example is an advertisement for Joyce’s Ulysses in America, citing the 1933 decision of the United States District Court for the Southern District of New York that the book was not obscene—which advertisement boils down to “Hey, Buddy, wanna buy a dirty book?”   Yet another is the line “this is not an offer of prostitution” on Web sites, which is an almost infallible indicator that the exact opposite is the case. (For a g-rated account of the use of this line, see .)   And finally, though it is perhaps not quite exactly the same thing, I would point to the classic device of humorous fiction—dating back all the way back to Cervantes and also seen in Mark Twain and Jerome K. Jerome—of insisting that it is not fiction but rather literal truth, which insistence goes on safely within the fictional compact by which readers agree to be entertainingly lied to.  What can we call this figure? Simply terming such usage facetious or disingenuous seems to fall short of designating such flat opposition between the literal and the intentionally conveyed meaning.


How to manually award bounty on another persons question?

Need to know how to award bounty on another persons question and how it helps?


Throwing errors on a standard page layout using Apex!

Scenario: I have a custom button on a standard layout, which will call an apex class to do some validation on a record. If not validated, it needs to throw out some errors on that page. What are the best UX options to achieve this?  I am not too sure how to achieve this. Within a trigger, you can use the addError method to add the custom errors.  Can my Apex class reference the fields of a standard object? The ideal approach would be to do the following:  Contact.Email.addError('Please enter the right format here');   How can I achieve this via an apex class that the custom button will call?  What I have thought: Having a VF Page popup on the screen so that user can see all the errors, but that's not the best approach as UX is a big deal for this application  Thanks.


Why is the definite article "the" used before some dances and with others not?

I crossed with two sentences:  Tango is a partner dance and social dance that originated in the 1880s along to the Río de la Plata.  How to dance the Tango.   So, I got very confused because the definite article "the" is not used before proper nouns usually, and "Tango" is a proper noun. Thereby, why does one sentence use "the" and the other not? Is there any rule in this case? I think that the same happens with the dance named Waltz. Furthermore, why with some dances, it's not used any article, such as Ballet, gayageum and samulnori? EDIT: It's been recommended this source:. Nevertheless, I think this question is more related to the generic topic.


I would like to have a brace in a tikz picture. However, when I process the file   \documentclass{amsart} \usepackage{tikz} \usetikzlibrary{decorations} \usetikzlibrary{decorations.text} \begin{document} \begin{tikzpicture}[scale=8]   \def\C{(0.688191,0)}   \def\D{(0.688191, 0.1844)}   \def\E{(0.830424, 0.1844)}   \draw[decorate,decoration=brace] \C -- \D; \end{tikzpicture} \end{document}   I get   ! Package pgfkeys Error: I do not know the key '/pgf/decoration/\pgfkeyscurrent name ' and I am going to ignore it. Perhaps you misspelled it.  See the pgfkeys package documentation for explanation. Type  H <return>  for immediate help. ...                                      l.10 \draw[decorate,decoration=brace]                                         \C -- \D;  help. Pretend that you're Hercule Poirot: Examine all clues, and deduce the truth by order and method.   I saw similar questions  and  and , but the answers to them don't seem to help me. I would appreciate your help.


How would I find which of my posts have been edited by someone other than myself?

Can you point me to the api and query syntax so I can determine which of my posts have been edited on one or more Stack Exchange sites by users other than me?  I am looking for a query to retrieve the results which I may wish to add further filtering.   and  are about notifying users when a suggested edit has been posted whereas I am looking for a list of my posts that have been edited by users other than myself.


Redirect traffic based on url to different ip address maintaining port and url information

We have a QA version, a UAT version, and a DEV version of webapp. Users need to access these via http://uat.company.com:41002/webapp, http://qa.company.com:41002/webapp, and http://dev.company.com:41002/webapp. There is also a different webapp on port 41001 and also on port 8080 they will need to access.  These url's are required to be available externally to the company, and we only have one public ip address they can be accessed on. As such DNS records need all 3 address to point to one IP. On that single IP address, a server resides running nginx. in the background I need for each url to point to a different server  http://uat.company.com --> 123.123.123.1 http://qa.company.com  --> 123.123.123.2 http://dev.company.com --> 123.123.123.3   I'm afraid I don't know the correct terminology, however the remainder of the URI and the port must also be carried over to the ip address. I.e. if someone visits   http://uat.company.com:41002/webapp/somepage`   it will appear as though that is the page they have visited, but really they will be looking at   http://123.123.123.1:41002/webapp/somepage   or if they visited  http://qa.company.com:8080/static/home.html   they would really be looking at  http://123.123.123.2:8080/static/home.html   but their browser would still say http://qa.company.com:8080/static/home.html  I have tried   server {      server_name uat.company.com;      listen 41001;     listen 41002;     listen 8080;      location / {             proxy_pass http://123.123.123.1:$server_port$uri;             proxy_set_header Host $host;     }   }  however this gives me a bad gateway 502 page with log: 2015/01/28 16:04:49 [crit] 30571#0: *1 connect() to 123.123.123.1:41002 failed (13: Permission denied) while connecting to upstream, client: 172.23.128.245, server: uat.company.com, request: "GET /webapp/ HTTP/1.1", upstream: "http://123.123.123.1:41002/webapp/", host: "uat.company.com:41002"  I hope this is more clear.    Update From Xaviers suggestion that SELinux might have been hampering, I have disabled it and I do get further. Using the nginx config above now seems to be connecting to the second server: The port however is still not carried through. I am calling   uat.company.com:41002/webapp/   This would, if calling the service directly, redirect to   uat.company.com:41002/webapp/spring/config/main   However what is happening through the proxy is that it is returning or ending up at  uat.company.com/webapp/spring/config/main   and thus failing to load a page...


State-of-the-art algorithms for the training of neural networks with GRU or LSTM units

I recently read a lot about neural networks using GRU or LSTM units. There are many easy to use frameworks like tensorflow that do not even require high knowledge about programming. Unfortunately, I never really found good information on how the training of those networks work. Simple backpropagation might probably not work for gated recurrent networks or is just too inefficient for networks with such a high number of variables to learn.  So my question is:  What are the state-of-the-art algorithms used for the initialization and training of neural networks with GRU or LSTM units? I am not looking for frameworks to use, but for initialization and update equations for the internal parameters.


Prove that $A - (B \cap C) = (A - B) \cup (A - C)$   How do I go about solving this proof? I've tried a few things but I'm stuck. I don't need the exact proof step by step, just a few hints on how to solve it would really help me.  edit: I tried to solve considering $3$ cases.  If $x$ is an element of $A−(B\cap C)$, then $x$ belongs to $A$ and $x$ doesn't belong to $B\cap C$.  Then, there I considered $3$ possibilites:   $x\in A$ and ($x\in B$ or $x\in C$) $x\in A$ and ($x\notin B$ or $x\in C$) $x\in A$ and ($x\in B$ or $x\notin C$)   After that I found that all of these cases satisfied the definition of set difference which states that $A-B$ is equal to the elements of $A$ that are not in $B$. In that case my $B$ is "($B\cap C$)". After that I tried to prove the other side "$(A−B)\cup (A−C)$" but I got lost and didn't know what to do.


How to show that $\langle a \rangle$ is a normal Subgroup of a group $G$

How to show that $\langle a \rangle$ is a normal subgroup of a group $G$, where $a\in Z(G)= \{x \in G ∣  xg = gx ~ \forall g \in G\}, \text{the center of the group $G$}.$  With the help of , it is possible to show that $\langle a \rangle$ is a subgroup of a group $G$.  How to prove for normality?


Proving using induction or strong induction on Fibonacci number proposition

I'm stuck on proving this statement below due to that I can't seem to find a base case that is true:  Prove that $$\sum_{i=0}^{2n}(-1)^if(i) = f(0) - f(1) + f(2) - \cdots - f(2n-1) + f(2n) = f(2n-1)-1,$$ where $f(i)$ is the $i$th Fibonacci number.  I believe simple induction should work but I am unsure if I have to use Strong Induction.


I began writing code assuming that:  person1 = person    will give me a new instance, it doesn't. person1 is actually a reference/pointer to person.  person = {age : 2}  person1 = person;  person.age = 3;  alert(person1.age); //gives us 3.   How do I make a new instance without changing much code around? I have like 300 lines of code inside the object, functions(methods?) and everything. Wouldn't want to rewrite as a constructor.


Is it possible to add customize method in String class?

I am trying to add custom function that operates on string variable like below in java (in my android project actually)  String name="tester"; name.isAlreadyEntered();  public static boolean isAlreadyEntered(String name){     return (checkInMyDb(name)); }   I am going to use this for some more functions. I know its a bit stupid question. I know this does exists in  & in .Net.  As I am new to java I m not aware of its possibility. Forgive if I am asking wrongly. But if possible please help me on how to get this syntax