Vertically centering figures with caption remaining bottom aligned

When I use subfig package to have two images in one figure the marker (a) stays bottom aligned with (b) but the image is not centred vertically (Figure 1). When I use minipage command to have two images in one figure the marker (a) doesn't stays bottom aligned with (b) but the image is centred vertically (Figure 2).  How can I have the image centred vertically and have the marker remain aligned with the other marker?  \documentclass{article} \usepackage{graphicx} \usepackage[export]{adjustbox} \usepackage{subfig} \usepackage{caption} \begin{document}  \begin{figure}     \centering     \begin{tabular}{cc}         \subfloat[]{\includegraphics[trim=0cm 0cm 0cm 0cm, clip=true, width = 0.45\textwidth, frame]{latexlogo}} \hspace*{0.5em}         \subfloat[]{\includegraphics[trim=0cm 0.2cm 0cm 0.2cm, clip=true, width = 0.45\textwidth, frame]{latexlogosmall}}     \end{tabular}     \caption{} \end{figure}  \begin{figure}         \centering         \subfloat[]{%         \begin{minipage}[c]{0.45\textwidth}%         \includegraphics[trim=0cm 0cm 0cm 0cm, clip=true, width = 1\textwidth, frame]{latexlogo}%         \end{minipage}} \hspace*{0.5em}         \subfloat[]{%         \begin{minipage}[c]{0.45\textwidth}%         \includegraphics[trim=0cm 0.2cm 0cm 0.2cm, clip=true, width = 1\textwidth, frame]{latexlogosmall}%         \end{minipage}}         \caption{} \end{figure}  \end{document}    Edit: I am aware that I could alter the code of Figure 2 to:  \begin{figure}         \centering         \subfloat[]{%         \begin{minipage}[c][0.55\width]{0.45\textwidth}%         \includegraphics[trim=0cm 0cm 0cm 0cm, clip=true, width = 1\textwidth, frame]{latexlogo}%         \end{minipage}} \hspace*{0.5em}         \subfloat[]{%         \begin{minipage}[c][0.55\width]{0.45\textwidth}%         \includegraphics[trim=0cm 0.2cm 0cm 0.2cm, clip=true, width = 1\textwidth, frame]{latexlogosmall}%         \end{minipage}}         \caption{} \end{figure}   This doesn't really answer the question as I would need to edit the \width parameter for every figure.


Can we define flat connection on any given smooth manifold?

For example, a sphere $S^2$ in $\mathbf{R}^3$ is apparently not flat with respect to the Euclidean connection, but can we define a flat connection and thus with affine charts on $S^2$?


Raise/lower/move/resize windows with mouse + modifier keys

I'm a longtime FVWM user over on the Linux side and have developed some keyboard + mouse shortcuts that I find very helpful in managing windows. Specifically:   left click + command + shift = send to back if frontmost, otherwise raise to front right click + command + shift = maximize window vertically (horizontal size unchanged) left+right chord + command + shift = grab window and move it left+right chord + command + control + shift = resize (drag pointer to side or corner and move that to resize)   For all of these, "click" means click anywhere in the window.  Is there Mac software that will let me set this up? I'm on 10.6.  Edit  To clarify, the move/resize operations should begin on mouse-down and end on mouse-up.


I have had ubuntu for a while now, but for some reason I am no longer a sudo.  When I open up terminal and type the command   sudo false sudo unknown host HOST   then when I actually look at my hosts file I see DIFFERNTHOST  the problem is I cant change my host because I am not a sudo so I am locked out of my computer and I can't do anything!  Note: I have already tried editing my /etc/hosts file and I cant edit it


how can I add numbering to this equation and make it more elegent??  \[ \begin{bmatrix} [0] & [m] \\  [m] & [c]   \end{bmatrix} \begin{Bmatrix} \vec{\ddot x}  \\  \vec{\dot x}   \end{Bmatrix} + \begin{bmatrix} -[m] & [0] \\  [0] & [k]   \end{bmatrix} \begin{Bmatrix} \vec{\dot x}  \\  \vec{x}   \end{Bmatrix} = \begin{Bmatrix}  \vec{F}\\ 0 \end{Bmatrix} \]


Don't Gödel's completeness and incompleteness theorems contradict each other?

Gödel's completeness theorem: Given a set of axioms, if we cannot derive a contradiction, then  the system of axioms must be consistent.  Gödel's incompleteness theorem:'Given any consistent, computable set of axioms, there's a true statement about the integers that can never be proved from those axioms'.  Since the incompleteness theorem assumes that the given set of axioms is consistent, then, by using the completeness theorem shouldn't all statements derived from this set of axioms be true thereby rendering the claim that 'there exists a true statement that cannot be proved' false?


Order of several adverbs of the same type

Today I started an English course with a new teacher. After being asked to arrange words into a proper sentence, she pointed me out on being wrong on something: I said "tomorrow at six", and she said that i should always say "at six tomorrow". I questioned why, and her answer was that the order of adverbs of a single type should be the specificity. The same rule would apply to "In my living room on the couch", where it would be incorrect and the correct form would be "On the couch in my living room". Another example where I would be wrong would be something along the lines of "Next week on Friday at six", the correct form would be "At six on Friday next week", no other forms would be correct.   I had never heard of this rule before despite using both ways quite often. Our English teaching material also showed this and explicitly said it's a rule, however i could not find a single mention of this outside of our specific material, and after asking around from some British friends, they said that the rule was nonsense. I would like a clear answer on this and if possible, something to cite as well.   I had a previous English teacher who i proved wrong on some conditional stuff that she was teaching wrong before as well, the quality control around here is not the greatest, though if I am wrong then please point me out on it, I want to learn. Is this an actual rule, just preference, or completely nonsense? Any help would be appreciated.  Edit: I appreciate the linking of , which cites the same information as present in our material. However this seems less like a set in stone rule and more like a rule of thumb for when in doubt. Am I correct on this? Again i can't find anything about this in stuff like . Thanks!  Edit2: In the examples given in the aforementioned link using other arrangements sounds unnatural as well, which would be understandable. However there are a lot of cases where both seem just fine, at least to me.


I am solving an ODE using the Runge-Kutta method 4th order and the integration is backward i.e step size (h) is negative. All the references that I have seen consider the positive step size.   Is it ok to change h to -h in Runge-Kutta method or is there any change in sign in K values?


Find all polynomials $p$ such that $p(x^2)=p(x)p(x+1)$

Find all polynomials $p$ with complex coefficients such that                                    $$ p(x^2)=p(x)p(x+1).$$   The goal is to find a general formula for polynomials that satisfy the above equation. I believe the answer is $\left(x^2-x\right)^k$ with $k\in\mathbb{N}$, but I have no idea how to get this solution.


How to mount a filesystem in such a way that a specific user has full read access to it?

I want to perform automatic backups of a specific folder, F, in my home directory. To prevent malicious software from removing backups in the repository, however, I have created another user whose sole purpose it is to regularly perform these backups. It has the authority over the repository and obviously needs full read access to F. However, this turned out to be harder than I thought:  Using setfacl to  for F works for existing and new files, but seems to fail for files that are copied or moved to the folder. This is obviously not a sensible solution for a folder that is subject to frequent changes. Using bindfs with --force-user=backup and -p 0000:u=rD as root to automatically mount F at a location that the backup user has acces to works in principle, but leads to falsified owner and permission information. The backup software will adopt these forced values and fail to restore the actual metadata. This is obviously not an option either.  Is it possible to mount the folder in such a way that the backup user has read-only access to all files contained in F, but that the metadata remain unaltered? Please note that it would be nice to even get access to the files that my main user does not currently have access to. Or more specifically: If I use the -r option that bindfs offers, can I somehow tell Linux to completely ignore ACLs when my backup user tries to access any file within F?


Can you do gamerule keepInvintory true on a PC relm?

I have tried many times on my realm to set keepinvintory to true using a command block and changing the capitalization  but it wont work. Whenever I /kill I still lose my stuff. Is it possible to do on a realm? Or what am I doing wrong?


Proving that $H=\{A\in GL(2,R)\mid AA^T=I\}$ is a subgroup of $GL(2,R)$

I need to show that $H$ is a subgroup of $GL(2,R)$ where $H=\{A\in GL(2,R)\mid AA^T=I\}$. I think I can show that $H$ is non-empty because $I$ is the identity of all $n\times n$ matrices in $GL(2,R)$ but, how do I show that it is closed? I have that $AA^T=I$ and $BB^T=I$ but can I show that $AB=I$. Is that even how I do it?


Short story about children-dominated society

I'm trying to find a short story from the 60's(?) about a future society dominated by mutant(?) children who've killed off all the adults except, for sentimental reasons, one. The adult was a man. They kept him out of some kind of respect or gratefulness. It’s told from the children’s perspective. The punchline is something like “...we killed them [the adults] all”. And that’s the last line, nothing after it. It’s not Children of the Corn.


When I run sudo, what exactly happens to my environment?  When I run sudo command, it doesn't seem to see my or root's environment. For example, my path for both includes /usr/local/bin, but if I try to run one of the program's without the full path, it fails.  I thought sudo ran as root, and hence got root`s environment. Is there a different way that bash executes under sudo than under root or my normal user?  EDIT:  I have been using sudo -i lately, but recently it has been causing problems because my current working directory gets set to /root. This is as expected (sorta), but I still don't understand why sudo isn't recognizing my executables in /usr/local/bin.  EDIT:  I am running Fedora 15.


What happened to Saruman after he was knifed by Grima?

Saruman was one of Maiar, like Gandalf. Meaning that he had a mortal body but presumably, when that body was killed, would simply return back to his ("spirit?") being.  Is there any confirmation from Tolkien that this is indeed what happened after he was knifed by Grima? Or was he somehow completely destroyed since he was de-powered by Gandalf?


Can I Read A Formula Field's Logic With Apex?

I have a test class that iterates through a bunch of "educational programs my company offers" and makes sure that each program is properly embedded in our org's schema.  (I've got a utility class that stores the API names, picklist strings, etc. to expect - the test class makes sure that the "expected" values are actually there.)  I'd like to add a test to ensure that a certain string representing each program appears in the definition of a given formula field.  I always forget to update that formula field when we offer a new program.  Is there a way to use Apex to fetch a textual representation of a formula field's formula?    [Note - this is NOT about recomputing the value.  This is about inspecting the code behind the formula.  Not a duplicate to .recalculateFormulas() questions.]


Is it legal on SE network for a person to have two accounts?

I'm currently blocked from asking any question in Physics SE, due to a few foolish questions which I had asked there (I admit the questions are foolish).  However, now I have quite a few questions, to which I need a proper answer. I have found no other site which can give proper answers like SE. So, I want to create a new account under my name and the same email.  Is this allowed in SE network? I'll never ask for merging of accounts or addition of any reputation gained in this new account. I need one urgently only to solve my questions.  N.B.: If this is not allowed, please don't block me. I'll surely delete the question. I'm asking because I don't want to go against the site rules. I had seen one person on StackOverflow or SuperUser (I can't remember which), who had two accounts, and had written the same in his profile section. That's why I'm asking this question.


What is the best practice for separating the preamble to a dedicated file?  I've seen two variants:   A package: preamble.sty and \usepackage{preamble} A .tex file: preamble.tex and \input{preamble}   Which one is to be preferred?


How to add a child link of log in link to my website in google search result?

Basically I want the my web-app users to be able to find the link for my website log in page, like we have in facebook:    I would really appreciate if you could tell where is it done and/or if you could redirect me to a tutorial where it shows how its being made.


Counting number of perfect matching in bipartite graph.

Graph G is bipartite graph, I want to just count number of perfect matching. Is there any algorithm exist using combinatorial+graph theory, by which i cant count this. I tried by traversing the graph, but as there are so many possibilities and I just want number of perfect matching I asked here.


How do I interpret a loss of significance when adding another term to a model?

I have several regressions in my bachelor's thesis about macro economics. In the first regression one particular coefficient was significant on the 5% level. Let's call the significant coefficient C1, with ic being the intercept.  $$ Y_t = ic_t + βC1_1 + ε_t $$ This significance went away as I added another term with a dummy variable in front of the same variable. $d$ is the dummy variable, and it is only equal to $1$ in $15$% of the observations.  $$ Y_t = ic_t + βC1_t + θd_t*C1_t + ε_t $$  How do I interpret that? I thought it should be interpreted as a type I error, but my supervisor said that it shouldn't be interpreted that way, and also said I shouldn't be talking about type I/II errors, without any further explanations as to why not. I had no opportunity to ask why not either.  So how is this loss of significance supposed to be interpreted?  Edit: I was referred to another topic below, however that topic deals with introducing a completely new variable. In my case I don't see how the interpretation can still be that "holding this constant..." etc, as I am introducing a term that is essentially the same variable just in different circumstances, when d is equal to 1.  Edit2: Again, the second topic I have been referred to and had this topic marked as identical to, does not answer this question.


Suppose that: $E_1 \begin{bmatrix}12\\35\end{bmatrix} = \begin{bmatrix}48\\35\end{bmatrix}$ Find $E_1$ and $E_1^{-1}$   I know how to find the inverse of a matrix, that's easy. It's just $E_1^{-1} = E_1 * I$  What I don't understand is how I can find $E_1$?  I know the equation in my book says $A\vec{x} = b$  Am I essentially finding $A$? If that is so, would I need to find the inverse of $x$?  So would I need to manipulate $Ax = b$ to $x^{-1}[Ax = b] = AI = x^{-1}b \implies A = x^{-1}b$?


Is it possible to run Drush without root?

I run a Linux server that is administered by a friend of mine, and at the moment I work with Filezilla.  I've heard that Drush is a trivial installation: it seems to require no configuration and work out of the box.   However, it looks for configuration in several places:     Drush installation directory,  the home directory (as .drushrc.php),    root directory of a Drupal installation, and  site directory of a   Drupal installation.  Since the configuration files are just PHP   scripts, they can  contain any PHP code that you would like to have   executed on startup of Drush.  one could for instance call ini_set()   to set the value of a PHP configuration option.   and the configuration file /opt/drush/drushrc.php with following content:    # Allow Drush to use 128 MB of memory. Use -1 for no limit. ini_set('memory_limit', '128M');   I see this is necessary because PHP's default is too low, but I'm not sure if I need higher-level privileges because of it.  Do I have to have root-level permissions on the server, or am I able to work with Drush without them?   Update:  As far as i understand this, i only have to ask my admin to get some more privileges (permissions)Note according to BetaRides answer i need to have more than only the access-data that the FileZilla needs - that are provided for the filezilla! Guess so - but i don not need root-permissions.  btw - i have secure-shell-access (ssh2 access) guess that this is enough -With that i can setup a sftp-connection to the server with filezilla just lemme know - if i can use the exactly same data for the shell access (with the command line tool=?!=


Conditional multivariate Gaussian distribution

I am trying to understand how 'completing the square' method is used to determine mean and co-variance of multivariate Gaussian distribution but I am not able to make much sense of the following step $$−((x−μ)^TΣ^-(x − μ))/2 = −(x^TΣ^−x + x^TΣ^-μ + const)/2$$ where x and μ are vectors and Σ is co-variance matrix.  What does this step indicate and how is it derived?   P.S. I am not well versed with linear algebra which might be a reason for not being able to comprehend this fully, if you can point me to certain properties from linear algebra that are being used here, that will be very helpful


What measures can/should I take to make sure that security around my SSH server is absolutely impermeable?  This will be community wiki from the start, so lets see what people do to secure their servers.


Which of the statements are true (CSIR)?

Question :  Let $f$ be real valued function on $R^3$ satisfying (for a fixed $\alpha \in \mathbb R$) $f(rx) = r^{\alpha}f(x)$ for any $r>0$ and $x \in \mathbb R^3$. Then which of the following statements are true.   If $f(x) = f(y)$ whenever $||x|| = ||y|| = \beta$ for a $\beta >0$, then $f(x) = \beta ||x||^{\alpha}$ If $f(x) = f(y)$ whenever $||x|| = ||y|| = 1$ for a $\beta >0$, then $f(x) = ||x||^{\alpha}$ If $f(x) = f(y)$ whenever $||x|| = ||y|| = \beta$ for a $\beta >0$, then $f(x) = c||x||^{\alpha}$ for a some constant c. If $f(x) = f(y)$ whenever $||x|| = ||y|| $ , then $f$ must be constant function.   Please help me to see this question more clearly and help me to answer this.


Linux - Why are my core IDs not consistent?

I'm currently looking at a system where I don't understand how the core IDs are assigned by the Linux kernel.   Some info on the system -   @mySystem~]$ lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 24 On-line CPU(s) list: 0-23 Thread(s) per core: 1 Core(s) per socket: 12 Socket(s): 2 NUMA node(s): 2 Vendor ID: GenuineIntel CPU family: 6 Model: 85 Model name: Intel(R) Xeon(R) Gold 6126 CPU @ 2.60GHz Stepping: 4 CPU MHz: 2600.000 BogoMIPS: 5200.00 Virtualization: VT-x L1d cache: 32K L1i cache: 32K L2 cache: 1024K L3 cache: 19712K NUMA node0 CPU(s): 0,2,4,6,8,10,12,14,16,18,20,22 NUMA node1 CPU(s): 1,3,5,7,9,11,13,15,17,19,21,23   The system has 12 cores per socket and 2 sockets and no hyperthreading. I see that all the cores are listed as online in /sys/devices/system/cpu/cpu*/online. However, when I look at /proc/cpuinfo, the core IDs do not have a consistent relationship with socket IDs.   > cat ~/proc/cpuinfo | grep -e "processor" -e "core id" -e "physical id" | paste - - - processor   : 0     physical id : 0     core id     : 0 processor   : 1     physical id : 1     core id     : 0 processor   : 2     physical id : 0     core id     : 6 processor   : 3     physical id : 1     core id     : 6 processor   : 4     physical id : 0     core id     : 1 processor   : 5     physical id : 1     core id     : 1 processor   : 6     physical id : 0     core id     : 5 processor   : 7     physical id : 1     core id     : 4 processor   : 8     physical id : 0     core id     : 2 processor   : 9     physical id : 1     core id     : 3 processor   : 10    physical id : 0     core id     : 4 processor   : 11    physical id : 1     core id     : 14 processor   : 12    physical id : 0     core id     : 3 processor   : 13    physical id : 1     core id     : 8 processor   : 14    physical id : 0     core id     : 13 processor   : 15    physical id : 1     core id     : 13 processor   : 16    physical id : 0     core id     : 8 processor   : 17    physical id : 1     core id     : 9 processor   : 18    physical id : 0     core id     : 12 processor   : 19    physical id : 1     core id     : 12 processor   : 20    physical id : 0     core id     : 9 processor   : 21    physical id : 1     core id     : 10 processor   : 22    physical id : 0     core id     : 11 processor   : 23    physical id : 1     core id     : 11   Here, we see that for physical IDs 0 and 1, we do not have a matching pair of core IDs. for Eg: core ID 5 is associated ONLY with physical ID 0 and core ID 14 is associated ONLY with physical ID 1, and core ID 7 is completely missing.  My question is: Is this a valid configuration assigned by the linux kernel? If so, what is the explanation behind this "anomaly"?  EDIT: I understand that the firmware is in charge of assigning core IDs and it may not be sequential. What I am unclear with is why each physical ID has a different list of core IDs under them. If we have a 16 CPU system (8 cores and 2 sockets) we have core ids from 0-7 for each of the physical ids 0 & 1. However, in my case that does not seem to be respected.


what will happen if we dont use free() for allocated memory

If I use malloc() to allocate memory and do not use free() to de-allocate the the memory. why cannot that memory be accessed by other program by just over writing the previous content  void main() {     int *a;            //here a is holding a junk value      MALLOC(a,1,int);     *a=100;            //a is holding 100      MALLOC(a,1,int);     *a=200;            //a is holding 200       /* so memory location where the value 100 is stored is inaccessible        cannot be reused */     //why can't we just over write that memory space when used next time }


Word to describe parent or category word

I am looking for a word...     Red is a color       Blue is a color       Color is a ____ of blue and red   What word goes in the blank?


I came across the form $\sum_{r=1}^{n}r(r!)=\sum_{r=1}^{n}[(r+1)!-r!]=(n+1)!-1$ while solving a question in determinants. How do we get to the formula stated above?


How to transfer class data from a Array to a ArrayList

Let me introduce you to the components of my problem. A Array called cards that has been created in the main method. A class called Card that has 2 class variables, suit and number. A ArrayList called ph (stands for playerHand) in a public class called Hand and finally a static public variable called counter. So now let me explain my dilemma.  In the main method the Array cards contains 52 card objects each with their own data. In the hand class I have a method called draw().  Here is some of the code inside the hand class.  ArrayList<Card> ph = new ArrayList<Card>(); public static int cc = 0;        void draw() { ph.add(new Card());  ph.get(cc).num = cards[cc].num; ph.get(cc).suit = cards[cc].suit;  cc = cc + 1; }   However I have the following error on the 2 lines before cc = cc + 1. "cards cannot be resolved to a variable"  How do I transfer the data between the Array and the ArrayList?  EDIT: This is different from the post this is marked as a duplicate of because here the array is in a different class so that solution wouldn't work.


Let $f$ be a continuous real valued function defined on $[a,b]$. Prove that, if $f$ is convex, then:  $$f\left(\frac{a+b}{2}\right)(b-a) \geq \int_a^b f$$  I am looking for a proof of this that doesn’t involve Riemann sums, but I can’t find any.  Thanks in advance.


How to choose critical F value from statistical tables when the df is large?

For an F(2, 237) distribution, how should I determine a critical F value from a statistical table? Would I look up (2, 150) or (2, 300)? Should it simply be the closest degrees of freedom?


Remove duplicate words in a string using Regex JS

I am trying to complete a coding challange on CodeWars and i am trying to use a regex expression instead of splitting it into an array etc.  My code is   const removeDuplicateWords = s => s.replace(/(\b\S.+\b)(?=.*\1)/g, "")  removeDuplicateWords('alpha beta beta gamma gamma gamma delta alpha beta beta gamma gamma gamma delta');               I have gotten to a point that it replaces all the duplicates but I cannot get rid of the white space at the beginning.  Native Browser JavaScript  => ' alpha beta gamma delta'  can anyone help, please?


Once I read a rule on the internet that if the second part of a sentence is a universal truth then don't change it to past.   For example: My teacher told me that the sun rises from the east.   But I'm not sure about the following examples whether it's right or wrong. Both sentences have different meaning to me   1: She told me yesterday that she was pregnant.  2: She told me yesterday that she's pregnant.  In the first example it sounds like she has already given birth to a baby and she's no longer pregnant.  In the second example it sounds like she still has some time to deliver a baby.  Am I right? And sorry if it sounds silly to you.


What's the term for fallaciously including an assumption in a question?

For example, if I ask someone "What does it feel like to be a gay Christian?" I'm suggesting that the person to whom I'm asking is gay and Christian, neither of which may be true.


Radius of convergence of power series $\sum c_n x^{2n}$ and $\sum c_n x^{n^2}$

I've got a start on the question I've written below. I'm hoping for some help to finish it off.     Suppose that the power series $\sum_{n=0}^{\infty}c_n x^n$ has a radius of convergence $R \in (0, \infty)$. Find the radii of convergence of the power series $\sum_{n=0}^{\infty}c_n x^{2n}$ and $\sum_{n=0}^{\infty}c_n x^{n^2}$.   From Hadamard's Theorem I know that the radius of convergence for $\sum_{n=0}^{\infty}c_n x^n$ is $R=\frac{1}{\alpha}$, where  $$\alpha = \limsup_{n \to \infty} |a_n|^{\frac{1}{n}}.$$  Now, applying the Root Test to $\sum_{n=0}^{\infty}c_n x^{2n}$ gives  $$\limsup |a_nx^{2n}|^{\frac{1}{n}}=x^2 \cdot \limsup |a_n|^{\frac{1}{n}}=x^2 \alpha$$  which gives a radius of convergence $R_1 = \frac{1}{\sqrt{\alpha}}$. Now for the second power series. My first thought was to take  $$\limsup |a_nx^{n^2}|^{\frac{1}{n^2}}=|x| \cdot \limsup |a_n|^{\frac{1}{n^2}}$$  but then I'm stuck. I was trying to write the radius of convergence once again in terms of $\alpha$. Any input appreciated and thanks a bunch.


I want to limit input field to one letter only(with JS),after one I want to get an error. How to do it?


How do I limit the number stored in a cookie to 2 decimal places?

I want to be able to retrieve a number value from a cookie but limit the number to 2 decimal places. The value is stored in a cookie as a result of a change function that calculates, dynamically, a price given preset variable values. Sometimes that number displays as 34.000012, for example. I store the value in a cookie using this:          $(function () {         $("#btnCookie").bind("click", function () {             $.cookie("name", $("#txtName").val());             $.cookie("amount", $("#txtAmount").val());   I retrieve the value using this:           <b>Amount:</b> $" + $.cookie("amount")   Since it's supposed to be a price, I'd like it to display only two values after the decimal. How can I accomplish this?  EDIT: This question is different than the alleged duplicate because the value is the result of a change function that calculates price in dollars, the user below has posted the answer I've been seeking. Thanks!


Prove that there is an irrational number and a rational number between any two distinct real numbers

Prove that between any two different real numbers there is a rational number and an irrational number.  My attempt at a proof: (Throughout this proof it is assumed without any loss of generality that $x < y$)  1.) $x$ is irrational and $y$ is irrational.  In this case the arithmetic mean $\frac{x+y}{2}$ is always an irrational number between $x$ and $y$. Also, if $y$ is irrational then it has a non-terminating decimal expansion and so we can always find a positive integer $n$ such that $x < y - 10^{-n}y < y$. The middle of the three numbers here will have a terminating decimal expansion, and hence it is rational. It also clearly lies between $x$ and $y$. These examples of rational and irrational numbers should also work in the cases:  2.) $x$ is irrational and $y$ is rational.  3.) $x$ is rational and $y$ is irrational.  There is one last case to consider.  4.) $x$ is rational and $y$ is rational.  In this case the arithmetic mean of $x$ and $y$ is rational. An irrational number for example could be the ratio $\frac{ex + \pi y}{e + \pi}$  I'm not sure if this proof is a good method or if it is even valid, so some feedback would be appreciated.


In The Force Awakens we see a powerful weapon capable of immense destruction. When it's activated, we see       five or so planets and a sun that are   enemies of the First Order destroyed.  Is there a verified list of the targets by name?   I'm not asking for merely the most publicized target.


How to prove this criteria of differentiability?

Let $f: I \to \mathbb{R}$ continuous and $a\in \operatorname{int}(I)$. Suppose that there is $L\in\mathbb{R}$ such that $$\lim \frac{f(y_n)-f(x_n)}{ y_n-x_n}=L$$ for all sequences $(x_n)$ and $(y_n)$ in $I$ with $x_n < a < y_n$ and $\lim x_n =\lim y_n = a$. Prove that $f$ is differentiable in $a$ and $f'(a)=L$.  I have proved a similar result, but that assumes $f$ differentiable, something like the converse of the criteria above. Some hint for that one?


Understanding calculation of collisions in hash-functions

I am going through some of my notes from class (About Information Security) and I'm stuck understanding how my teacher got this result. The question is:     How many collisions would you expect to find in the following cases?      a) Your hash function generates a 12-bit output and you hash 1024 randomly selected messages.      b) Your hash function generates an n-bit output and you hash m randomly selected messages.    The teacher's only answered a) like so:         We expect to find one collision every $2^{n/2}$ hashes. There are $2^{(n/2) * 2} = 2^n$ comparisons. Since the output is 12-bit the answer is $2^{10 * 2}/2 ^{12} = 2^{8} = 256$ collisions.   However I don't quite understand how he got this?  I get that the expected number of collision after n hashes would be $2^{n/2}$. But the rest doesn't make sense to me. I mean if the output is 12 bits (4096 arrangements), why would we expect to get 256 collision after only hashing 1024 messages (1/4 of the possible outputs)?


So, I have this Struct. It has some functions and operators overridden, but that's not so important.  public struct Vector3 {     public float X, Y, Z; }   I'm filtering a Collection of these via a HashTable and it works fine. But I want to verify that only duplicates are removed. By default my IDE gave me this code for the GetHashCode() method:  public override int GetHashCode() {     var hashCode = -307843816;     hashCode = hashCode * -1521134295 + X.GetHashCode();     hashCode = hashCode * -1521134295 + Y.GetHashCode();     hashCode = hashCode * -1521134295 + Z.GetHashCode();     return hashCode; }   Which looks fishy to me. I'm pretty sure that the factors alone will generate a overflow on a INT_32. Furthermore i am confused that all three floats seem to have the same "weight" (-1521134295). Plus I am not really sure what GetHashCode() of a float does. It's bit Pattern itself should be unique already.   It has to be impossible, to create a unique 32 bit pattern from 96 bit's of input.  So how does it work?   Does the HashMap uses the equal Method before removing items with the same HashCode. Am I just lucky? And what are these Numbers my IDE generated as "weights" and startvalue?   PS: For those who are interested, the struct's code is here.  public struct Vector3 {     public float X, Y, Z;      public Vector3(float x, float y, float z)     {         X = x;         Y = y;         Z = z;     }           public static bool operator ==(Vector3 a, Vector3 b)     {         return (a.X == b.X && a.Y == b.Y && a.Z == b.Z);     }      public static bool operator !=(Vector3 a, Vector3 b)     {         return (a.X != b.X || a.Y != b.Y || a.Z != b.Z);     }      public static Vector3 operator +(Vector3 a, Vector3 b)     {         return new Vector3(a.X + b.X, a.Y + b.Y, a.Z + b.Z);     }      public static Vector3 operator -(Vector3 a, Vector3 b)     {         return new Vector3(a.X - b.X, a.Y - b.Y, a.Z - b.Z);     }      public float Magnitued     {         get         {             return (float)Math.Sqrt((X * X) + (Y * Y) + (Z * Z));         }         private set { }     }      public Vector3 Normalized     {         get         {             var mag = Magnitued;             return new Vector3(X / mag, Y / mag, Z / mag);         }          private set { }     }      public override bool Equals(object obj)     {         if (!(obj is Vector3))         {             return false;         }          var vector = (Vector3)obj;         return X == vector.X && Y == vector.Y && Z == vector.Z;     }      public override int GetHashCode()     {         var hashCode = -307843816;         hashCode = hashCode * -1521134295 + X.GetHashCode();         hashCode = hashCode * -1521134295 + Y.GetHashCode();         hashCode = hashCode * -1521134295 + Z.GetHashCode();         return hashCode;     } }


Expatriates doesn't appear in the list of sites on the iOS app (operator error)

The iOS app has an icon that gets me a list of SE sites. I have scrolled slowly through the entire list on my iPad, and Expatriates is not there:      With Patrick's suggestion, I typed "expat" into the search box and they appeared, but they do not appear otherwise.  So, it seems to be a bug, but it is not, as explained in the accepted answer (and in the edited title).  Version 1.6.6.2


What is $GL_n(\mathbb{R}) /SL_n(\mathbb{R})$?

$SL_n(\mathbb{R})$ is the set of all real n by n matrices whose determinant is 1. $GL_N(\mathbb{R})$ is the set of all real n by n matrices whose determinant is non-zero. I have proved that $SL_n$ is normal in $GL_n$.  Then What is $GL_N(\mathbb{R})/SL_n(\mathbb{R})$? I mean, can we find another expression for $GL_n /SL_n=\{ASL_n \mid A \in GL_n \}$? My guess is it's the set of all real n by n matrices whose determinant is not 1.  is my guess correct? or what should it be?


Recommendations for small hosting solution with lots of support

I maintain a personal website though have never put much effort in building up the front-end.  I really just use it as a testbed for various projects I'm working on or tinkering with.  For a few years I've maintained an account with Hostgator but they've gotten to the point where I'm rather fed up.  Anyone have recommendations on best alternative?  I don't need a ton of space, or bandwidth, but I do need full ssh access, ftp access, php, perl, mysql, etc.. the basics.., and the ability to modify or change the php installation and install various packages (ruby, php, python is an extra plus) and I don't want to pay an arm and a leg.  Doesn't exist.. yeah, I know.


How much hard disk space should be needed for Xbox 360?

I want to get a 360 and don't know wether to get the bigger (250GB), newer, more expensive Elite, or get one of the older, smaller (120GB), last gen ones. I know the arcade is going to be too small to save anything useful  How much hard disk space is recommend? What else is stored besides games?


When trying to install Chrome onto my AWS Ubuntu instance, I ran the following command:  sudo curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add   And got: This command can only be used by root


Foxit reader allows you to create new bookmarks and also set style properties     With Evince, you can view bookmarks without style, you can't create new ones     With Adobe Reader 9, you can view long bookmarks, but can't create bookmarks    I am looking for a pdf reader/editor which allows you to create fancy bookmarks and also view long bookmark names without having to enlarge the bookmarks panel. Such task can be done by Adobe Acrobat Pro, but it is not supported by Ubuntu anymore.   I am using Ubuntu 16.04. This is the only thing that I need to permanently stay in Linux, any help will be apreciated.


Limitations associated with returning a reference as opposed to a pointer

What is the difference between returning by pointer and returning by reference? In both cases, the address is returned to the caller, am I right?  According to this little program - its obviously the same - it prints the value of an integer.  Are the any limitations concerning returning by reference rather than returning by pointer? My teacher tells us - when you return by reference to a receiver, the receiver "borrows" the object. When you on the other hand return a pointer - you "transfer" the ownership of the object to the receiver.   #include <iostream> using namespace std;  class A {     int x;    public:     A() : x(10) { }      void print() {         cout << "x = : " << x << endl;     }  };  class B {     int y;    public:     B() : y(30) { }      void print() {         cout << "x = : " << y << endl;     }      A& create() {         A* a = new A;         return *a;     } };   Return by pointer, then these parts of the code I changed:  A* create() {    A* a = new A;    return a; }   And in the main:   b.create()->print();


Box2d contant speed before and after collision

I want to make my body fly at constant speed, how to make it fly at constant speed before and after collision? I set restitution of my body to 1.0 but after some direct and powerful collisions my objects begins to slow, I want it to fly same speed as before. I heard this can be done by setting liner damping of the object, I think it can prevent only from fast flying objects not slow.   Thanks in advance.  Edit* I can simply modify velocity of the object every frame, is it a solution?  var velocity:b2Vec2=b.GetLinearVelocity(); var speed:Number=velocity.Length(); var ratio:Number=circleSpeed/speed; velocity.Multiply(ratio); b.SetLinearVelocity(velocity);


How can I backup my photos while travelling?

I'm going travelling around the world for a year in September and am already panicking about how best to send my photos home while in various countries.  Requirements:   I only need to backup JPEG files (I don't shoot RAW but that's another thread ;) ) I need to be able to upload in a web-based manner (I will be using Internet cafes and so can't assume I can use FTP etc) I need plenty of space, preferably unlimited (I racked up about 200GB last year) I need to store the full image (no lossy compression is acceptable!)   Options I can think of:   Burning and posting DVDs (can I trust these in the post and not to get corrupt? It may be better than waiting for upload speed though...) Flickr (I have a pro account but not sure how hard it'll be to get the photos back down again. Will I even be able to get the original snaps?) Setting up a server at a friend's house and hosting some kind of file server with a web-app front end   What have other people done? Or does anyone else have a better idea?


Do Caster Levels from different sources stack?

This seems like a glaring oversight, but what are caster levels? Do characters only have one score called caster level just like sneak attack? Why do most classes not state what their caster level increases are? Do all arcane and divine caster levels stack? What about just all arcane caster levels? I have been playing Spheres of Power lately and it clearly defines when caster levels are gained and how they stack with caster levels from other classes (at least other SoP classes). It got me wondering about original caster levels. So I started doing research. Under the  for caster level  A spell’s power often depends on its caster level, which for most spellcasting characters is equal to her class level in the class she’s using to cast the spell.   are one of the exceptions which within their own rules state what the CL of the class is suppose to be.  Through 3rd level, a paladin has no caster level. At 4th level and higher, her caster level is equal to her paladin level – 3.  But the core casting classes of , , and  have no statement on how their CL increases as you progress in the class so I guess we are forced to assume its equal to the levels in that class. Under the  is another definition of caster level  Caster level represents a creature’s power and ability when casting spells. When a creature casts a spell, it often contains a number of variables, such as range or damage, that are based on the caster’s level.  Finally we have the  which does seem to have mention that classes have their own isolated caster levels.  This essentially means that he adds the level of mystic theurge to the level of whatever other arcane spellcasting class and divine spellcasting class the character has, then determines spells per day, spells known, and caster level accordingly.  As shown in the FAQ/Editors Note  The increase to his spellcasting level does not grant any other benefits, except for spells per day, spells known (for spontaneous casters), and an increase to his overall caster level.  So would a cleric 1 wizard 1 have an overall caster level of 2, or would each class have their own caster level? What about a cleric 1 and druid 1?


My SanDisk USB flash drive shows that 43GB is used when I just copied a 10GB folder after formatting

I recently bought a SanDisk 128GB USB flash drive.  And after formatting the USB flash drive in exFAT format, I copied a folder whose capacity is around 10GB. There are lots of small files in it, so it took some time.  However, when I see in the Windows Explorer after copying the folder, it says that around 43GB of the storage is occupied and now only 70GB of the storage is free to use.  What is happening and how should I deal with it? Is my USB flash drive physically broken?  It is still weird because when I copied a single file with 7 GB capacity, it showed the remaining capacity correctly at around 110 GB available..


Expectation of Minimum of $n$ i.i.d. uniform random variables.

$X_1, X_2, \ldots, X_n$ are $n$ i.i.d. uniform random variables. Let $Y = \min(X_1, X_2,\ldots, X_n)$. Then, what's the expectation of $Y$(i.e., $E(Y)$)?  I have conducted some simulations by Matlab, and the results show that $E(Y)$ may equal to $\frac{1}{n+1}$. Can anyone give a rigorous proof or some hints? Thanks!


Does Java Connection.close rollback into a finally block?.  I know .Net SqlConnection.close does it.  With this I could make try/finally blocks without catch...  Example:  try {     conn.setAutoCommit(false);     ResultSet rs = executeQuery(conn, ...);     ....     executeNonQuery(conn, ...);     ....      conn.commit(); } finally {    conn.close(); }


I am revising for my exam but could not figure a way to solve the linear congruence $$ 57x \equiv -3 \pmod{50}.$$ I have done $-3 = 50 × (-1) + 47$ but don't think i am on right track. May someone give me a hint please. Thanks


I have three classes: Movement, Collision and Variables(The Variables class is where I store my variables and all of them are public and static. Considering I am new to java I don't really understand what the static keyword does, so my problem might be with the static keyword.). In my Collision class there is a method which checks for collision within the map. Now this method works perfectly:  public void checkCollision(int x, int y)  {      if (x == 100){         Variables.collisionRight = true;      } else {         Variables.collisionRight = false;     }  }   Here I have a method in my Movement class which does not work:  public void playerMovement (int x, int y) {     if (RightKeyPressed == true & collisionRight == false) {         x += Variables.speed;      } }   Here is how i call these methods:  someObject.checkCollision(Variables.playerX, Variables.playerY); someOtherObject.playerMovement(Variables.playerX, Variables.playerY);   Seems to me the problem is that this line:  x += Variables.speed;   If i change   x   to  Variables.playerX   Everything works fine, but that's not how I want it to work.  It's not working. Which basically should be (Variables.playerX += Variables.speed) All the methods are samples.  I want to know why is my x (Variables.playerX) variable not incrementing by 3(which is my Variables.speed variable);


Getting null pointer exception while open the url in selenium automation

Here, I am using page object model and I want to pass the driver to other classes.But i am getting null pointer exception while launch the website (driver.get("")). This is my base class public class BaseClass { public WebDriver driver; public Logger logger = Logger.getLogger(Common.class.getPackage().getName()); public void startBrowser() {     if(driver == null) {         System.setProperty("webdriver.chrome.driver", "desktop/chromedriver.exe");         driver = new ChromeDriver();     } } public void quitBrowser() {     driver.quit(); }  } and then this is my runner class: public class TestRunnerTestNG extends AbstractTestNGCucumberTests { BaseClass a; @BeforeClass public void launch() {     a = new BaseClass();     a.startBrowser(); }  @AfterClass public void tearBrowser() {     a.quitBrowser(); }  } Here, I am starting the browser using Beforeclass annotation and quit the browser using afterClass annotation. and the following class is my page Object class: and here I have the method for launch the url: public class SignIn extends BaseClass {   public SignIn(WebDriver driver) {      this.driver = driver ;     PageFactory.initElements(driver, this); }  //Locators @FindBy(id = "email") private WebElement user_Email;  @FindBy(id = "password") private WebElement user_Password;  @FindBy(xpath = "//span[text()='Sign In']") private WebElement signIn_Btn;  public void landing() {   driver.get("https://***************"); <<<< Here I am getting the null pointer exception.  }   public void signInPageGUI() {     boolean checkSignInTextGUI = waitElement(signInText);     Assert.assertTrue(checkSignInTextGUI);     boolean CheckEmailField = waitElement(user_Email);     Assert.assertTrue(CheckEmailField);     boolean checkPwdField = waitElement(user_Password);     Assert.assertTrue(checkPwdField); }  private void emailField(String emailName) {      user_Email.sendKeys(emailName); }  private void passwordField(String password) {      user_Password.sendKeys(password); }  } and the final code is my step definition class and this is place I am calling the code. public class LoginPage { WebDriver driver ;  @Given("user landed to the yoco URL {string}") public void landedOnYoCo(String string) {      System.out.println("print the string" +string);      System.out.println("driver value is " );      SignIn logIN = new SignIn(driver);      logIN.landing();  }  } Here, Only I am calling the landing method to launch the website. and The error is: java.lang.NullPointerException at pageObject.SignIn.landing(SignIn.java:83) at stepDefs.LoginPage.landedOnYoCo(LoginPage.java:32) at ✽.user landed to the yoco URL "https://my.yocoboard.com"(file:///Users/vinoth/Git/YoCoAutomation/src/test/resources/logIN.feature:7)


Some users' chat icons are sometimes displaying as default gravatar depending on size

In , there are some users (e.g.  and ) of which the user icon is recently displaying wrongly most of the time:   cl-netbox' icon on all sites id a blue square with the white letters cl. It shows up this way in the user list on the right and even in the popup bubble opening when I click his name. However, some chat messages have him with a default Gravatar (those green random triangles) showing up as you can see in the screenshot above. Not all messages show up the default icon though, it probably depends on the displayed icon size. I tried both Firefox and Chrome, with and without add-ons, logged in and logged out, all show the same behaviour. Strange thing is that initially only cl-netbox was displaying incorrectly on my Windows 10 work laptop, but now also Thomas Ward is displaying incorrectly on my home Ubuntu notebook. Hard refreshing using Ctrl+F5 sometimes changed the appearance of the icon on the left to some of the messages, but not necessarily all of them, and not always to the correct direction. Later posted messages may still show up with either icon... I know this bug is very strange and probably difficult to reproduce for someone else, so it might probably be necessary that you provide me instructions on how to investigate the problem locally further and provide important information.


First of all, sorry about my english. I installed ubuntu like, 5 months ago, but now my ubuntu gets freezed and stuck, it waits too way long to load an application,  I had to run another OS to do somenthing that I could perfectly do in Ubuntu. Do you guys know, how to "clean" my ubuntu? I mean, to make it faster? like it used to be at the beginning Thanks in advance.


I just downvoted this question  (screenshot in case it gets deleted):    However, when I go to the timeline, it shows that my vote happened 14 hours ago. The question was only asked 2 hours ago:    Has SE invented a voting time machine?


Prove that a ring of fractions is a local ring

I have no idea how to prove this:  Let be $B$ a prime ideal of a commutative ring $A$. Show that $A_B$, the ring of fractions respect $B$ as multiplicative set is a local ring.  Any suggestions?


Proving a simple claim concerning order without using LaGrange's Theorem

For whatever reason, I am having trouble proving the following claim without using LaGrange's Theorem.  Claim: Let $G$ be a group of order $n < \infty$. Then, $x^{n}=1$, where $1$ is the identity, for all $x \in G$.  If $|x|=m$, then I can use the Division Algorithm (specifically, I can divide $n$ by $m$) to obtain that $x^{n} = x^{r}$, where $r=0,1,2,..., \text{or}\> m-1$. Then, well, I can't see the next step.


Practical Book on Hamiltonian and Lagrangians?

Are there any terse, accessible books that are geared specifically at learning these two formalisms and how to effectively use them? So far I've only see either topic introduced as a part of another book, like QM or classical mechanics. I was hoping for something focused more or less exclusively on these formulations that would then go on to explain important nuances and limitations, and then systematically show how to apply them effectively.


I have two passports with different names in each. Which name should I use for booking my ticket?

I will be travelling with my minor son (17 yrs) from South Africa to Germany later this year. He is South African and German citizen. The passports have different surnames. Firstly, on which name must i book the ticket? Secondly, which passport does he have to use when during his travels?


Can you share a report to a Guest User in the Customer Community Portal ? (non-logged user)

I am trying to share a report chart in a Customer Account Portal; I have checked multiple items but still no luck when viewing the portal as a Guest User:  I have created a Sharing Rule for the object; granting access to the Site Guest User The report is in a Folder shared with the Public Group: "All Customer Portal Users" I enabled "report options for external users" and the "Partner Super User Access" in the Community Settings I've checked in the Guest Profile>Object Settings>Reports but the only option is "Tab Settings", which is on I also noticed, in the "Sharing Settings>Other Settings", the tick box "Secure guest user record access" is enable and I am not able to deselect it, as it's greyed out. I tried to do a workaround creating a Public Group and including the Guest User into the group, but help Article "Guest User Security Policies and Timelines" clearly says Guest Users cannot be part of Public Groups  Am I missing something? The report is still not visible when switching to a Guest User View but it is visible as a Authenticated User View.


extract the 4th column from a csv file using unix command

I have a csv file formatted as below.  "col1","col2","col3","col4" "1","text1","
big       html      text
 ","4th column" "2","text2","
big2       html2      text2
 ","4th column2"   I want to extract the 4th column using.  I think that awk is the best tool for this ( let me know if I am wrong). I tried this   awk -F, '{print $4}' myFile.csv    but it fails.  I think because the 3rd column is multiline one.  How can I use awk or any other unix command to extract the 4th column.  I am looking for an efficient solution since my real file is big (> 2GB)


Any  group of order four is either cyclic or isomorphic to $V$

I will try and show that if our group $G$ is not cyclic then it is isomorphic to .  So suppose $G$ is not cyclic. Then its elements, excluding $e$, are of order $3$ or $2$. Supposing there is an element of order $3$ gives three distinct elements $g, g^2, g^3$. By hypothesis there exists  $h \in G$ such that $h$ is distinct from these three elements. So we can make $gh$ which must be equal to one of the elements previously mentioned. Setting this equal to the various elements:  \begin{align} &gh=g \Rightarrow h=e && gh=g^2 \Rightarrow h=g & \\ &gh=h \Rightarrow g=e, && gh=g^3 \Rightarrow h=g^2 & \end{align} Each of which is a contradiction. Therefore all the elements are of order two and we can get an isomorphism between $G$ and $H \times H$ where $ H$ is cyclic of order two. But this direct product is isomorphic to Klein's four-group so $G$ is isomorphic to $V$.  Is this correct?  Also it is just given in the book that $V$ is isomorphic to this product; how do I show this without checking that $f(gh)=f(g)f(h)$ for all combinations?


In the films, we only see male students from Durmstrang. Do we know if witches also attend that school?  If not, where do they go to school?


I've heard Google's algorithm is based on PageRank, and that it has something to do with the links to your site. Can someone explain it, and more importantly, how I can increase my site's PageRank?


Is there a QGIS alternative for ArcMap's Append (to Shapefile) Data management tool?

Is there something out there for QGIS that is similar to the Append Tool in ArcMap? Reason I am looking: I am currently working on a storm drainage project that involves GPSing Storm drain lids. My issue is when I capture the points with the GPS unit, and then bring them into the office. The GPS unit produces a CSV file for me to import into QGIS. It gives the CSV file with generic header names ( field1, field2, field3..etc) This is fine, until I try to copy it into the working shapefile that has all the other storm drains. The beautiful thing with ArcMap's append tool was that I could map each field from my CSV file to the destination shape file...ex... "field1" from CSV is equal to "Elevation" field in my shapefile. And thus update my shapefile with the newest points.


Best factor extraction methods in factor analysis

SPSS offers several methods of factor extraction:   Principal components (which isn't factor analysis at all) Unweighted least squares Generalized least squares Maximum Likelihood Principal Axis Alpha factoring Image factoring   Ignoring the first method, which isn't factor analysis (but  principal component analysis, PCA), which of these methods is "the best"? What are the relative advantages of the different methods? And basically, how would I choose which one to use?  Additional question: should one obtain similar results from all 6 methods?


We tried to rename a project in Xcode 7 using the  but it didn't work.   After the rename the build option was greyed out.  Seems there are additional steps required but I haven't found a list which is up to date as of v7.  How can you do the rename in v7?


>Prove that $\frac d {dx} x^n=nx^{n-1}$ for all $n \in \mathbb R$.

Prove that $\frac d {dx} x^n=nx^{n-1}$ for all $n \in \mathbb R$.   I saw some proof of $\frac d {dx} x^n=nx^{n-1}$ using binomial theorem, which is only available for $n \in\mathbb N$. Do anyone have the proof of $\frac d {dx} x^n=nx^{n-1}$ for all real $n$? Thank you.


How to validate whether a regex itself is valid or not?

In JS, is there a regex to check the given regex itself is valid or not?


JQuery Datepicker Default by Business Days Only

I am able to set the value to a certain amount of days past the current day, like so:  $(function () {     $("#PriorityLevelID").on("change", function() {         $("#DueDate").datepicker("setDate", 2);     }); });   But is there a way to exclude weekends? For example, 2 days past Friday would not be Sunday, it would be Tuesday in business days.


What's the shelf life on crushed specialty grains?


Complex Numbers -- Find $z$ such that $(z+1)^6 = z^6.$

Find all $z$ such that $$(z+1)^6 = z^6.$$  I have moved $z + 1$ to the other side such that $$\left(\frac{z}{z+1}\right)^6 = 1,$$ which then makes it so   $$\frac{z}{z+1} = 1 = \frac{z}{z+1} = e^{ik\pi/3}.$$  I know $k \neq 0$ where $k = 0, 1, 2,\dotsc ,5$, but I don't know where to go from here.


Why the conversions between compatible reference types will compile (Excel 2010, .Net 4.5) in this case  using Excel = Microsoft.Office.Interop.Excel; Excel.Application excelApplication = null; excelApplication = new Excel.Application();  Excel.Worksheet worksheet = workbook.Worksheets[1] as Excel.Worksheet;   and in the case below it will not, although I saw exampales shown like that:  Excel.Worksheet worksheet = (Excel.Worksheet)workbook.Worksheets[1];   In this case I get the following compiling error :  > CSC : error CS0518: Predefined type 'Microsoft.CSharp.RuntimeBinder.Binder' is not  defined or imported  > error CS1969: One or more types required to compile a dynamic expression cannot be  found. Are you missing a reference?   Best,  EDIT : Thanks to the both answerer below the following explanation sounds reasonable:     without including Microsoft.CSharp in the Project References for projects with .Net Version >= 4.0, support for   inter operation between the Dynamic Language Runtime (DLR) and C# is not   possible, i.e. no dynamic cast is possible.


Continuous but not uniformly continuous example

Let $f(x) = \frac{1}{x}$ for $x > 0$ and take our set at which the function act on $(0,1]$. This function is continuous but not uniformly continuous on $A$.  To prove this consider $\epsilon = 10$,and suppose we have $\delta$, $0 < \delta < 1$. Taking $x = \delta$ and $p = \frac{\delta}{11}$, we get  $|x - p| < \delta$ and $|f(x) - f(p)| = \frac{11}{\delta} - \frac{1}{\delta} > 10$.   In the following example from my book shows this is continuous but not uniform continuous but the example is missing correct ? since we also need to find counter example for $\delta \geq 1$ right ? If someone could present that example too that would be nice.  Also my question is different since the possible duplicate above shows very different question to the question I am asking here since I am asking why we must consider $\delta \geq 1$ so please read carefully my question.


At wikipedia and here at math.stackexchange.com it is often said that a vector space is a set with some properties and then one goes on to refer to the set as the vector space. I am guessing that this is "just" an abuse of terminology and notation, right? Shouldn't the tuple $(X, S, +, *)$ be the vector space, where $X$ is a set, which elements we can add up using $+$ (and receive an element of $X$), and which we can multiply with elements of the set $S$ (and receive an element of $X$) using $*$? Often it is said that $X$ is the vector space, but that is strictly speaking wrong isn't it? I am asking, so that I may understand the mathematical concepts better. Bonus question: $X$ would be the underlying set of the vector space $(X, S, +, *)$, I guess. Could I say that, if $X=\mathbb R^n$, $X$ is the Euclidean spaced set or do I have to go route of writing in my publications that "$X$ is the underlying set of an Euclidean space"? Background: I submitted a paper and, even though it was ultimately accepted, one of the reviewers said that my math is not precise enough. I think (s)he might be right... especially with this topic.


Terminal not opening when in root mode in nautilus. What to do?

Opening nautilus in administrator mode and then opening terminal in any directory is not functioning. Trying to open it always gives out the error.  I have Ubuntu 17.04 and Unity.


Why am I getting two different expressions for capacitance?

The question is:   A capacitor of capacitance C1 is connected to a battery of potential V0. The battery is then disconnected and a second capacitor of capacitance C2 is connected to the first capacitor. The new potential of the capacitors is V. Express C2 in terms of C1, V0 and V.   I made two approaches.   At first I used charge conservation. If q is the charge of the first capacitor, then after the second capacitor is connected, q will be distributed among them. If q1 and q2 are charges of capacitor 1 and 2, respectively, then $q = q_1 + q_2$. Using this,  I got $$C_2 = C_1*\frac{V_0-V}{V}$$ My second approach was using energy conservation. Before capacitor 2 was introduced, the energy saved in capacitor 1 was $E = \frac{1}{2}C_1V_0^2 $. Afterwards, the energy saved in each capacitor is given by,  $E_1 = \frac{1}{2}C_1V^2$ and $E_2 = \frac{1}{2}C_2V^2$. If I assume $E = E_1 + E_2$, I get $$C_2 = C_1*\frac{V_0^2-V^2}{V^2}$$   Why am I getting two different expressions? The energy I began with doesn't seem to be the energy I ended up with. Why is that?


Is there much performance fiction in the British magical world?

Throughout the books, we see a lot of reading, but nearly all of it is for school or non-fiction. The only fiction I can remember seeing mentioned is Ron's comic books and Beedle the Bard. Obviously there's no TV or films, but are there plays? Are there other mentions of magical fiction not in the books that I'm missing, like Pottermore or something JK has said?


How to make Firefox use the newest Java version, which is already installed?

Apparently, I have OpenJDK 6 JRE (openjdk-6-jre 6b27-1.12.6-1ubuntu0.12.04.2) and 7 JRE (openjdk-7-jre 7u25-2.3.10-1ubuntu0.12.04.2) installed in parallel – I don't know why I have both of them, I can't remember installing any of them manually.  However, the Firefox Java plugin is occasionally reported to be out of date by some websites, and it seems to me that it relies on JRE 6. How can I make Firefox use the newer version? Removing JRE 6 seems like a bad idea; when I attempted to do so in synaptic it appeared to me that a lot of software still relies on the older JRE, since removing it would have removed programs like jedit as well.  Do I mix up stuff? I'm not even sure how the FF plugin interferes with the OpenJDK JRE's.  EDIT:  Having tried even more, the problem persists. Using update-alternatives --config java, I see that the default Java version (with status "manual mode") is already set to Java 7, and java -version returns "1.7.0_25". The file /usr/lib/jvm/java-7-openjdk-i386/jre/lib/i386/IcedTeaPlugin.so exists, but still Firefox shows the Java 6 plugin when looking at about:plugins.  To sum it up:  How do I make Firefox use the IcedTea plugin belonging to the default Java version?


Evaluate $\lim_{x \to 0} \left(\frac{ \sin x }{x} \right)^{\frac{1}{x^2}}$

$$\lim_{x \to 0} \bigg(\frac{\sin x}{x} \bigg)^{\frac{1}{x^2}}$$  The task should be solved by using Maclaurin series so I did some kind of asymptotic simplification  $$\lim_{x \to 0} \bigg(\frac{\sin x}{x} \bigg)^{\frac{1}{x^2}} \approx \lim_{x \to 0} \bigg(\frac{x - \frac{x^3}{6}}{x} \bigg)^{\frac{1}{x^2}} \approx \lim_{x \to 0} \bigg(1 - \frac{x^2}{6} \bigg)^{\frac{1}{x^2}}$$ How can we say answer that is $e$ in the power of $-\frac{1}{6}$. I want some proving of that fact.   Thank you.


Is there an integral domain containing an element having no factorization into irreducible elements?

I know that the ring of algebraic integers can be an answer because this ring has no irreducible elements.  So, is there an integral domain with nonempty set of irreducible elements and an element having no factorization into irreducibles?


Are CBP officers allowed to search and clone media devices?

I'm travelling to LAX and from some anecdotal horror stories I've seen online and in real life, I worry that customs officers may ask to search my laptop, seize it indefinitely and/or possibly clone the hard drive seeing as I've read that they have power to inspect you and every item when entering/leaving the United States.  I have a significant amount of pornography (all legal) on my laptop which I wonder would I have to declare to the officers as other countries such as Australia make travellers declare on arrival.


Installed Ubuntu 14.04 from USB and need help

I just installed Ubuntu 14.04 via a USB drive over my Windows 7, and I cannot boot into it without installing the USB. Even with USB installed, it wants me to reinstall Ubuntu every time, even though when I do that it says Ubuntu is installed and asks if I would like to install over it.  I put everything on to the USB with a program in Windows (I believe it was called Universal USB Installer). when I try to boot without a USB, it brings me to a list of boot options, but no matter which I choose, the screen says the following:  Intel UNDI, PXE-2.1 (build 883) Copyright (C) 1997-2000 Intel Corporation  This Product is covered by one or more of the following patents: US5,307,459, US5,434,072, US5,732,094, US6,570,884, US6,115,776 and US6,327,625  Realtek PCIe GBE Family Controller Series v2.35 (06/14/10) PXE-E61: Media test failure, check cable  PXE-M0F: Exiting PXE ROM


How to sort movie names (varchar) that contain sequel numbers correctly?

Let's say I have a table of movies. The name of the movie is a varchar. But sometimes the movie names contain sequel (or series or episode) numbers that go over 9. How can I sort the movie name to handle numbers like a human would?  This is how it sorts by default:  select * from movies order by name  Alpha Beta Gamma 1 Gamma 10 Gamma 2 Gamma 3 Gamma 4 Gamma 5 Gamma 6 Gamma 7 Gamma 8 Gamma 9 Delta   See the 10 after 1? I know why it does that, what I want to know is how to make it sort like this:  Alpha Beta Gamma 1 Gamma 2 Gamma 3 Gamma 4 Gamma 5 Gamma 6 Gamma 7 Gamma 8 Gamma 9 Gamma 10 Delta   I have looked for solutions all over and haven't found anything that solves this.  Please note that this is just a simple example, the actual names can be much more complex, like Gamma The Explorer 1. episode or Gamma The Explorer 2. series 1. episode or Gamma  The Explorer 3. episode Director's Cut and that most other movie names don't have numbers in them, so please no solutions that count on the number being in a specific place or position in the string or sorting using name+0 - that's not the solution I want.  I know for a fact that Windows Explorer, among other software, handles sorting file names in the correct (human) fashion, and I don't believe MySQL wouldn't be able to handle something so obvious, so there ought to be a feasible solution for this.  Edit: Apparently it's called natural sorting. Does MySQL really not have this at all? Optionally: What is UDF, and where do I get one for natural sorting, and how do I get it on my server?


Am new at ubuntu. I downloaded flash plugin for my ubuntu, and install it from the terminal but it does not play the movie on YouTube it seams installed, and there is sound and the first picture is there. and when I installed the libflashplayer.so, and in terminal i type:            # rah -Uvh libflashplayer.so.    I tried several times and it seems installed but those are  not working probably.  Can some one please help me?


Do the principal components change if we apply PCA more than once (recursively) on data?

Consider a set $X=(X_1; \dots; X_n)$ of $n$ data points such that $X_i \in \mathbb{R}^d$ is a column vector. Let $Y = \text{pca_proj}(X)$ denote the projection of points in $X$ according to the PCA components i.e.  $$Y_i \in \mathbb{R}^d\\ Y_i = W X_i$$  where $W \in \mathbb{R}^{d \times d}$ is the projection matrix obtained from PCA, and each row of $W$ is an eigen vector of $X^T X$.   Now let's define $Z = \text{pca_proj}(Y)$. My questions is: does $Y = Z$? If not, what happens if we keep applying PCA recursively on a matrix? Does it converge to a specific matrix?


I have tried commenting on a post on apple.stackexchange.com, but it said I needed 50 reputation. I then wanted to upvote the post instead since I don't have 50 reputation, but that was another 15 reputation.   So my question is if it takes 50 reputation to write a comment and 15 reputation to like something, how do I even start getting reputation?   Please help and if this is a stupid question can someone please point me in the right direction. I thought this meta page would be the best place to ask this; please do not roast me.


performence - random record from php or random record from mysql?

Given a table of N records, what would be considered the fastest way of getting a single random PK from that table(for later use in php)?  The two methods I'm wondering about are : mysql : perform the random query directly and get a single ID as the query result. php   : get a list of IDs from mysql and use array_rand() to fetch one at random  Also : Does scale matter for such a query? Would a table N=200 records be faster using mysql but a table of N=200,000 be faster with php?(or vice verca)    My intuition tells me that MySQL should be faster and use much less memory, as you must create an array of N keys using the php method and store them at least temporarily.


In the phrase "none of us is promised tomorrow", should it be is or are?


In several contributions here on M.SE I saw notations like $$a/bc$$ where from the context one could conclude that it actually meant $a/(bc)$, not $(a/b)c$.  Both terms are obviously different in general, and the programming languages I know of have semantics  a/b*c = (a/b)*c   i.e. evaluate left-to-right.  The examples I saw all had "$b$" and "$c$" short like in $1/2x$ and did obviously not mean $\frac12x$ but $\frac1{2x}$as the context revealed.  How should one handle this? I am always avoiding such ambiguities and am writing the clunky $1/(2x)$, but then $1/2x$ could still be misread as $\frac1{2x}$.  If typesetting is available, then I'd use $\frac12x$ vs. $\frac1{2x}$ or $(2x)^{-1}$ or $0.5x$ or $0.5/x$, where the decimal expansions are ugly, IMO, even uglier for ⅙ etc.  Are there different conventions, e.g. in the U.S., Europe, Russia, Far East?  Using / vs. ÷ wouldn't help either. Never used the latter though, only know it from calculator's key for division.  The question about different conventions depending on the corner of the planet you live in or school vs. university is because there are already related questions, and their answers are far from conclusive. For example  claims $abc/xyz$ is to be read as $(abc)/(xyz)$ because "dropping the multiplication glyph (·, ×, * or whatever) binds stronger than with explicit mention, i.e. $$abc/xzy\neq a·b·c/x·y·z=abc/x·yz$$  So my question is less on which exact notation to use but rather on cultural differences and how established that juxtaposition rule is.


Google AdSense stuck on We're Reviewing Your Site

I am a new user to AdSense.  I received an email on Feb 5th 2017 saying "your application has been successfully reviewed".  When I click on the "Get Started Now" button and login to AdSense, it says "We're reviewing your site" and all other options are disabled.  It is now Feb 20th and I am unable to progress.  The code is pasted into my site and I am getting traffic but can't see to go any further.  Please help.  I tried asking for help on Google forums too but that doesn't work either!


"I am poor in english" or "I am poor at english" Which one is correct?

Well the title pretty much speaks for itself. Also all kinds of other suggestions are accepted. I just want to know the correct usage.


In electromagnetism, why does nature prefer the right-hand rule over the left-hand rule?

At school I learnt the  to remember the resulting direction of different phenomena, such as geometrical cross products, mechanical torque, or the direction a screw will move when turning it. This directions are however decided by humans, and we could have easily defined the directions in the opposite way.  However the right hand rule also predicts phenomena which is not arbitrarily set by humans, but is intrinsic to the nature. If you have a coil in which you put some current, and the nature creates a magnetic field in a direction perpendicular to it, the direction depends on the right hand rule.  My question is, why this direction and not the opposite? Nature tends to be symmetric and not have apparent preferences for two equal options, so in a so why is one direction preferred over the other one? Why doesn't a "left hand" rule apply?


How To Make A Solid Object Drop To The Ground Like It Was Liquid

So I have a simple bouncing ball animation, but I just wanted to something "weird" for the ending. Is there a way to change the ball's material on the fly, where after the last bounce it changes materials and physical composition from a rigid body(baked animation now) to a fluid sim?  (within 30-40 frames)


Why is $(2,x)$ non-principal in $\Bbb Z[x]$?  Apparently this is the case, I just read it on wiki, as a counter example to $\Bbb Z[x]$ being a PID.  What is $x$ here? I mean $2$ can surely generate $x$ right?


If a black hole with an event horizon of 1 cm were placed in the Sun core what would be the Suns' lifespan as a visible star? I want to get a visualisation of how much mass per second would be absorbed inside that BH.Should the cross section area be calculated,the growth of the event horizon with time which increases the cross section area of the inward flow? When we get the surface area of the event horizon should that be divided by the area of a helium or hydrogen atom to get how much atoms in parallel transpass the event horizon. After that we should calculate how much atoms in series transpass the e.h. and as we know their speed being almost 300.000kmps and the length of a single atom we can figure out their number per second transpassing the cross section area with the surface of the He or H atom? Or it is much more complicated?


Windows 8.1, is there way to log into my OneDrive acct without changing local login

Using Windows 8.1, is there a way to log into my OneDrive account while continuing to log into my machine using my local signin so I can continue access everything on my LAN?  When I open OneDrive it seems to want me to change my machine login.  If I try to install OneDrive for Windows 7, the installation says there is a higher version already installed.  I could not find a way to uninstall the current Windows 8.1 OneDrive.   -rwg


Can I use one of my attacks to cast a cantrip?

In the D&D campaign I am currently participating in, I am playing as a level 5 high elf champion (I actually just reached level 5 at the end of the last session).  As a High Elf, I got a free cantrip at first level, and chose the firebolt cantrip.  Here's what I'm wondering now: for the purposes of the extra attack feature, does firebolt (and similar cantrips) count as an attack?


Filtering questions based on my Favorite Tags

Is there a way to filter  based on my Favorite Tags? (not searching)


Area between two functions is the same as area between the inverse functions

Ultimately I want to prove that for two random variables with cdfs F and G, with inverses $F^{-1}(t)=\inf\{x:F(x)\ge t\}$, we have $\int_{\mathbb{R}}|F(x)-G(x)|dx = \int_0^1 |F^{-1}(t)-G^{-1}(t)|dt$.  This fact seems kind of obvious to me, since we are talking about the area between the graphs.  So firstly I tried to prove that the area between bijections $f$, $g$ is the same as the area between the inverses, provided that the area is finite, and then generalise it to my problem.  I thought of doing some substitution in the integral, but I am stuck. Probably there is an easy way of showing this fact and I would appreciate any help.


Citations with no bibliography at the end

How do you produce a document with citations (\citep, \citet) working properly in the paper but without a bibliography at the end?  I've come up with one solution that is bad because it breaks my makefile.  latex file.tex bibtex file # comment out \bibliography{} command latex file.tex   Similarly, is there a way to produce the bibliography with no accompanying text?  Again, I've come up with a solution: fill an otherwise blank .tex file with \nocite{} commands.  However, this is a pain because I have to keep two files synced by hand (and regular expressions to search for \citep{author1, author2} can be a huge pain when there are pagebreaks...).


I am looking for a Calculator which can do calculations in the terminal itself without any other extra prefixes and suffixes.  For example: If I typed something like 10000-9000 in the terminal, the answer should come out as 1000.  Once again I am saying, I just need a quick calculator in terminal, without any characters added. I know if I switch to Python, it can do that but I don't want it in such a way.


Documentation for a piece of software will often include a tour of its features. Sometimes this is called "Feature Tour", and sometimes "Features Tour". From querying web search engines, it would seem that "Feature Tour" is twice as frequent, both being widely used. Can someone expand on the correctness of both, the subtle difference in meaning, and/or reasons to prefer either form?


I have recently moved into a new home, and for now, I'm stuck with a horrible electric glass top stove.  My old place had a gas stove with a continuous grate across the cooking surface.  All my pans are carbon steel or cast iron.  (I take good care of my pans, so it's not an issue of abuse or putting cold water in a hot pan, or immediately rinsing a hot pan in cold water.  With the exception of my woks, they are bullet proof).   I am finding that most of my carbon steel pans have a slight warp to the bottom, which was never a problem on the gas range.  But is proving to be rather annoying on the new electric one.  So in theory is there a way to unwarp or to lessen the warping on the bottom of the pan?  In a way this will be academic and I am willing to sacrifice one of my cheaper pans to experiment the unwarping theories.  Thanks.


Does Thunderwave normally deal falling damage?

Is normal that if a target is Thunderwave'd into a wall, then they take initial damage from the Spell, and then additional "falling damage" from being flung into the wall. Similarly, if there's an object (say, a cart) between the target at the caster, would it be normal for the target to get hit by the cart and be dealt additional damage as a result? I can't find anything in RAW that explicitly covers it either way, and obviously the DM can Rule Zero whatever they want. But would doing so be considered normal?


Is this a sign of virus attack on my computer?

I have a PC at home running on Windows 7, 32-bit.  Recently, when clearing the temp folder (accessible by pressing %temp% on the Run command), I found that the folder has got some foul videos downloaded from Internet. By foul, I mean totally disgusting, of a very, very, very low level (like pornographic, horrible scenes, etc. which I can't mention). This has been occurring quite often. They come after some days even if I delete them.  I have a licensed copy of QuickHeal in my computer, and a full system scan at great depths shows that there is no virus, malware or any other system change. Behaviour Detection is set to highest security. Firewall is also on.  Our computer is accessed only by my father and me. We never visit any foul site, not even Facebook or Twitter or Google Plus. My father visits a travel forum, while I mostly use it for Java programming.  Moreover, the computer has recently started to crash frequently. We've called a mechanic, who could find no error. The computer has got 4GB RAM, yet sometimes everything on the screen freezes and then everything crashes, including Windows. The task bar and start button are not accessible, and mostly we have to power off the computer and reboot it.  The files come only if connected to Internet. We've tested, and not connected the PC to Internet for a month, and no videos had come.  We work on either Opera browser or Chrome. Both these browsers are known for protecting users from malicious sites. We've installed anti-tracking extensions to browsers like  to prevent tracking.  So, why are these videos coming? I feel somebody is bypassing QuickHeal security firewall and accessing the computer. I conduct a full system scan and a backup every week, so I'm not greatly worried for files, but what is it? What can I do to prevent this? How can I know who is accessing the computer by hacking firewall?  N.B.: somebody wanted to mark this as a duplicate to  one. Let me explain the difference. I don't even know till now whether the computer has been hacked or its a virus. Until and unless I'm confirmed it's a virus, it's not a duplicate.


Removing news headlines from Spotlight Search in iOS 9

How can I turn off news headlines from Spotlight Search in iOS 9?


How would I make a function to determine whether or not a file exist?

bool file_exists(char* path) { }  So I want to know on how I could make a function that's a Boolean that lets me know whether a file exists or not in C language using the access() function in C. What other functions would I need? I'm new to C and I'm coming from java just as a heads up. I haven't played around with accessing local files on computer from a program yet either so I'm just a bit stumped on what to do. Any help is appreciated!


Easy way to increase one minute using strftime in python

I need to increase the current time by one minute and my code looks very complicated. I would be glad to know if there is any simple way for this.  My code is:  import time a = (time.strftime("%I:%M %p")).lower() if a[0]=='0':     #time = a.replace(a[0],"")     time = a[1:]     #print (time)     if time[3]=='9':         time = list(time)         time[3] = 0         time[3] = str(time[3])         time[2] = (int(time[2])+1)         time[2] = str(time[2])         times = ''.join(time)         time = times         print (time)     else:            time = list(time)         time[3] = (int(time[3])+1)         time[3] = str(time[3])         times = ''.join(time)         time = times         print ((time))  else:     time = a     print (time)     print (time[4]+"1")   On the whole if the time is 3:49 pm it should return me 3:50 pm and if it's closing to an hour i.e if it is 3:59 pm it should be 4:00 pm  Please let me know if there's any simple way for this. Thanks in advance.


Why are the time stamps in UTC instead of localized for the client?

Just curious as to what the reasoning behind making the time stamps for the questions and answers in UTC instead of localizing the time for the client.  I do realize it's easier to store the value in UTC.  But, I would guess most of us think in local time and showing the date and time of the post isn't as meaningful if it's in UTC, having to do a conversion each time we see it.  I think it would be more useful and intuitive if it showed "answered Jul 2 at 15:38 EST" where EST is the viewer's local time zone.  It's possible I'm just not Skeet enough to think in Coordinated Universal Time.  (Skeet is an adjective as well as a verb, right?)    EDIT: As noted by me and others, perhaps defaulting to UTC, but allowing a user to select a different timezone in their profile would be a reasonable request.


if $X,Y$ i.i.d $\mathcal{N}(0,1)$, then $X+Y$ is independent of $X-Y$

I found on another thread* that if $(X+Y)$ is independent $(X-Y)$, and if $X,Y$ are i.i.d., then $X,Y$ are $\mathcal{N}(0,1)$ distributed.  Is also the opposite true? Being $X,Y$ i.i.d $\mathcal{N}(0,1)$, then $X+Y$ is independent of $X-Y$?   here *


Working on  question, I found an inconsistent behavior.    Why reference binding behave different in a constructor from a common function?  struct A { };  struct B : public A {   B(){} private:   B(const B&); };  void f( const B& b ) {}  int main() {   A a( B() ); // works   A const & a2 = B(); // C++0x: works, C++03: fails   f( B() );  // C++0x: works, C++03: fails }   I have tested it for C++03 with g++-4.1 and Comeau 4.2.45.2 in strict C++03 mode and with C++0x extensions disabled. I got same results.  For C++0x was tested with g++-4.4 and Comeau 4.3.9 in relaxed mode and with C++0x extensions enabled. I got same results.


How can I extract records from a file if they include a specific set of strings?

I am analyzing a file xyz.txt which contains hifen separated records. I want to extract records based on the presence of the strings FADED:100,  AM:FF and GG. Subsequently, I need to write them to a new file, faded100.txt. The source file include more then 40 thousand records, looking like below.   --- --------  --- -- -- -- -- -- -- -- -- -- -- -- -- -- --  --- --- -- --      rtuyss  A/A go go go go go go go go go go go go go go  IRE AP  QQ Z ORDER xxxxxxx1  country: 201  NVDS        TEMPROR   EXTREME  BUS TIME:       TRASS: 12       AIDED: 12        FADED: 100                        U  U  U  u  U  A  U  O  O  O  O  O  O  O                  GG   Y  Y  Y  Y  Y  O  Y  O  O  O  O  O  O  O   POU ATM UNITED #  AM:FF   Y  Y  Y  Y  Y  O  Y  O  O  O  O  O  O  O   POU POU POU POU --- --------  --- -- -- -- -- -- -- -- -- -- -- -- -- -- --  --- --- -- --  rtuyss  A/A go go go go go go go go go go go go go go  IRE AP  QQ Z ORDER xxxxxxx1  country: 201  NVDS        TEMPROR   EXTREME  BUS TIME:       TRASS: 12       AIDED: 12        FADED: 200                        U  U  U  u  U  A  U  O  O  O  O  O  O  O                   ZZ  Y  Y  Y  Y  Y  O  Y  O  O  O  O  O  O  O   POU ATM UNITED #   AM:FF  Y  Y  Y  Y  Y  O  Y  O  O  O  O  O  O  O   POU POU POU POU  --- --------  --- -- -- -- -- -- -- -- -- -- -- -- -- -- --  --- --- -- --  rtuyss  A/A go go go go go go go go go go go go go go  IRE AP  QQ Z ORDER xxxxxxx1  country: 201  NVDS        TEMPROR   EXTREME  BUS TIME:       TRASS: 12       AIDED: 12        FADED: 100                       U  U  U  u  U  A  U  O  O  O  O  O  O  O                   IP Y  Y  Y  Y  Y  O  Y  O  O  O  O  O  O  O   POU ATM UNITED #   AM:FF Y  Y  Y  Y  Y  O  Y  O  O  O  O  O  O  O   POU POU POU POU  --- --------  --- -- -- -- -- -- -- -- -- -- -- -- -- -- --  --- --- -- --


Does there exist a model of $ZF¬C$ in which there is a function on $\mathbb R$ which is sequentially continuous at a point where it is not continuous?

Does there exist a model of $ZF¬C$ in which there is a function $f:\mathbb R \to \mathbb R$ such that $f$  is sequentially continuous at some $a \in \mathbb R$ but not $\epsilon-\delta$ continuous , i.e., for any sequence $\{x_n\}$ converging to $a$ , $\lim f(x_n)=f(a)$ but still $f$ is not continuous at $a \in \mathbb R$ ?


Is it possible when comparing two strings with '==' returns true but return false with '.equals' in java

I'm bit confused about the difference between == and .equals, I been searching for answers but still not quite clear. So, I'm wondering is there an example code can demonstrate that when comparing two strings, == and .equals return different results.


Is there a term for real-world science-based SciFi?

I've read just a few books in SciFi genre, never liked it, because it's usually written by writers, not scientists. Though, recently I've read few books written by Peter Watts and Stanislaw Lem. There is actual science in those books, with some speculation, but still: science instead of usual mumbo jumbo. How do I find more of such books? Is it some specific sub-genre?


Fisher-type unit-root test for panel data. Results interpretation in Stata

As part of my master thesis, I'm performing several tests on panel data.  One of these is a Fisher-type unit-root test, which works well with an unbalanced panel.  I have performed the test, but I haven't managed to find an explanation of how to interpret the results.  This is the setup:   Fisher-type test Time-trend included Cross-sectional mean removed Variables are being lagged once   The code that makes this happen is:  . xtunitroot fisher beta, dfuller trend demean lags(1)   The output for variable beta is:  Fisher-type unit-root test for beta Based on augmented Dickey-Fuller tests  Ho: All panels contain unit roots           Number of panels  =      5 Ha: At least one panel is stationary        Number of periods =     61  AR parameter: Panel-specific                Asymptotics: T -> Infinity Panel means:  Included Time trend:   Included                      Cross-sectional means removed Drift term:   Not included                  ADF regressions: 1 lag  Statistic      p-value  Inverse chi-squared(10)   P        77.8047       0.0000 Inverse normal            Z        -7.2246       0.0000 Inverse logit t(29)       L*       -9.7556       0.0000 Modified inv. chi-squared Pm       15.1616       0.0000  P statistic requires number of panels to be finite. Other statistics are suitable for finite or infinite number of panels.   Questions:   Based on the results, does my data contain a unit-root, or is it stationary?  How do I know the confidence level at which I can accept/reject H0?


Is a capacitor in an open circuit charged?

Say I have a circuit consisting of a battery, a wire, an open switch, and a capacitor. The circuit is open since the switch is open.  My book says that the capacitor will only be charged when the switch is closed, but I don't see why this is true. I would expect the capacitor to be charged a little - not as much as if the circuit is closed, but still charged none the less.  To further illustrate my point consider this: If the circuit is open, the current must be zero. Consequently the field must be zero. For the field to be zero, the capacitor's field must cancel out the battery's field. Therefore the capacitor must be charged.  Generalizing this concept, shouldn't capacitors be charged (to a lesser degree) in open circuits?  EDIT: In other words, if the field is zero, the capacitor must be charged to cancel out the field of the battery.


What is the "other type of visa" needed travelling from India to Dublin via Heathrow?

I am an Indian Citizen and have Irish Visitor visa and will be travel transiting through London Heathrow to Dublin. The stop over is 3 h 45 mins.  As I am transiting to common travel area (Ireland), it states on the website that I may need another type of visitor visa.  Statement from uk gov website 3. Visitor in Transit visa:     "You’ll need to apply for another type of visitor visa if you’ll be   either: travelling to the Republic of Ireland, the Channel Islands or   the Isle of Man"   What type of visa is that?


I'm addicted to certain websites to the point where it's interfering with my life regularly and sick of it. I want to install website blockers that aren't easy to circumvent.  In Chrome, incognito mode is easily accessible with a ctrl-shift-n. That is ridiculous. Whenever I feel an urge to go on an addictive website, it doesn't matter what blockers and regulators I've got installed; three keys can get round them in a second.  Simply uninstalling chrome isn't an option either, as it's way too easy to sudo apt-get install it right back.  So yes, I want to disable incognito mode completely (and if possible making it totally impossible to get it back). I note that some guy has figured out how to do it on windows with a registry entry:   If it can be done on windows it can be done on ubuntu!


I have a question about choice of using this phrases. What different between "Some words" and "a few words"?  What I need to use?


A user copy-pasting answers without proper attribution

I came across  while I was going through the  and most if not all answers seem to be copied from other Stack Overflow answers or from external sources.  This is a small list of what I found. I suspect there are more as I haven't gone through all of his answers:    is an exact copy of   is an exact copy of   is an exact copy of   is an exact copy of   is an exact copy of   is an exact copy of   is an exact copy of   is an exact copy of   is an exact copy of   is an exact copy of   is an exact copy of   is an exact copy of   is an exact copy of   is an exact copy of   is an exact copy of   is copied from   is copied from  (WTF? Really?)  is copied from  ...   Wow. This list continues.    (thanks to Martin for finding that one) could be considered as a duplicate, but it does not fully address my question. Here's why:   Editing - There are over 140 answers -- I don't think it's easy (or appropriate) to edit all of them to add attribution Flagging - Flagging is not an option because of the number of answers Educating the OP - People already  and . I don't think that's going to work either.   I'm pretty sure I can find more of such answers.  I've flagged a few of them (maybe three or four) but I don't think that's going to stop him from continuing this behavior.   Should I flag all similar answers? Or let moderators handle this issue?


When multiple Jedi attack one target, why do they all attack physically?

Jedi are masters of telepathy, telekinesis, and physical combat.  When two or more Jedi attack one target, why do they all crowd around to physically confront him?  The gang should have some Jedi mentally attacking their target, some Jedi using physical force attacks (whether on the target or by smashing things into his legs/face), and some using physical combat.  One example is Qui-gon versus Darth Maul, while Obi Wan had to watch through the laser gate. The Force can cross star systems, so Obi Wan could have done telekinetic nut punches to Maul.  Or, even better for their mission, scanned Maul's brain to learn his secrets while Maul was concentrating on his fight with Qui-gon.


Is it appropriate to down-vote posts containing SQL injection vulnerabilities?

Should question, or answers for that matter, with SQL Injection or other security issues be down voted?    I lean towards down voting them, so if in the future someone finds the question, the number of down votes may lead them to question the validity of the question.


I'm trying to compile a tex file using TexMaker but I got the following error     LaTeX Font Info: Try loading font information for OT1+pcr on input line 220.   (/usr/share/texlive/texmf-dist/tex/latex/psnfss/ot1pcr.fd   File: OT1pcr.fd 1995/12/14 Fontinst v1.500 font definitions for OT1/pcr.   )      ! Font OT1/pcr/m/n/12=pcrr7t at 12.0pt not loadable: Metric (TFM) file not found.   I understand that some packages are missing, I've tried to install the latest version of TexMaker from the website but it didn't solve the problem. I've also tried to edit the OT1pcr.fd file according to this  with no success.  How can I fix this problem? Thanks


I'm from the UK, currently living in China with a valid Z Visa. Both my visa and passport expire in April 2017. I plan to take a quick break in America before I return home and I need to start booking flights etc asap. Problem is I will have to get a new passport before it expires as the US does not permit entry with a passport that's due to expire within six months of the date of departure from USA.  If I get a new passport now and keep my old passport, can I still provide this to the police if I have a random spot check between now and April or does the new passport void the visa?  Also, will airport security have any issues with me leaving the country with my visa being on my old passport?


Complex Analysis - Bruce P . Palka - Ex: 4.12

Please help me with this question. I tried to prove the HINT. But I have no idea how to solve this.  Question :  Knowing that  $ Re(z)>0 $ , demonstrate that $|z+\sqrt{z^2-1}|\geqslant 1$, with equality holding only when z is a real number in the interval $(0,1]$. ( Hint : First check that $Re(\bar{z}\sqrt{z^2-1})\geqslant 0$ for every $z$ under consideration.  I proved that $|z+\sqrt{z^2-1}|^2\geqslant 1+Re(\bar{z}\sqrt{z^2-1})$ . But I can not prove the HINT.


Intersection of two curves given by coprime polynomials

Let $f$ and $g$ are positive-degree polynomials in $k[X,Y]$, $k$  is an  infinite field, and $f,g$ have no common-factor. I want to prove: Intersection of two curves $f=0$  and $g=0$ is a finite set.    Can anyone help me out ?   P/S: I think this problem can be solved by the Euclid-algorithm, but I'm confused by the fact $k[X]$ no longer be a field.


Any official or semi-official continuation of Terminator - the Sarah Connor Chronicles TV-show?

I've been re-watching the 2nd and final season of "Terminator - the Sarah Connor Chronicles" (I used to love that show) with great joy, and wonder if there were any official or semi-official continuation of the show - E.g. books, graphic-novels/comics, cartoons, audio-plays?  Has the plans/outlines for the never-made 3rd season been leaked?    Alternatively, are/were there any really good fanfiction that took up the threds from the show in a good way?  BTW, were there any books, graphic-novels etc. released while the show ran (that tied in to episodes)?