Update: I realized that this post attracted a lot of downvotes maybe because it's lacking context.  A question got posted on The Workplace SE. I wrote an answer to it. I realized I can slightly edit the answer. While I was midway editing the answer, the post was deleted by a site moderator.  The linked question below is me seeking the reasoning from the moderator (on The Workplace Meta) behind deleting the question as I couldn't see a reason for deletion.    I recently posted this on The Workplace Meta:      It was duly answered by a site moderator to whom it was addressed. (Clarification: The moderator was addressed by pinging them in a comment, as it is about an action performed by them. I am only interested in a reasonable explanation, irrespective of the person it comes from.).  However, I don't feel satisfied with the answer.  Now I am curious to know, if as per SE sites policy, is it appropriate/allowed for a site moderator to curtail information from a user?  I want to note there's nothing against any individual person here. I am generically curious if as per site governance rules, can a moderator (with access to certain special privileges) deny giving a reason for a question by a regular user of the site? And if yes, is it documented anywhere?  I understand there may be generic cases where withholding such information may be necessary. I am curious to learn about such condition(s).

I've noticed over the few years that I've participated on Stack Exchange websites that moderators and moderation behavior in general is rather secretive, in that moderators take action with little or no explanation.  While this has been remedied a bit with explanation boxes detailing why a thread was closed or moved, there are still plenty of actions being taken that leave no paper trail.  For example, in a closed topic that I was participating in, I asked in a comment why my answer was still being down voted.  I return a day or two later to find my comment was gone.  Why was it removed?  I don't know.  And I can't find out.  I'm not upset that my comment was removed, I am upset that action was taken with NO communication routed back to me.  If my question was removed because of some specific undesirable quality, then I'd like to know that and what policy it violates.  But nothing was provided.  That in itself can create bitter, rebellious users, which leads to trolls, ranters, and other detestable behavior.  My feature request is this: moderators regardless of rank should always have to provide an explanation for any action they take that affects a user or group of users, and that explanation should be routed to those who are affected by said actions.


I found this strange behavior while adding a number, javascript increases the number precision, because of this I have to round the number to one decimal place. Why is this so   var n = 1; do {   n = n + 0.2;   console.log(n) } while (n < 100)

Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?


For inserting dashed lines inside matrix structures, I have to use the command \hdashline from the package  arydshln prodominantly. I am wondering whether TeXstudio supports assigning a specific command or statement to a certain keyboard shortcut.  So more explicitly:  assign \hdashline[2pt/2pt] to the key combination Alt+Shift+0 (any combination will do).

This is not about new macros like \newcommand, \def and others. This is not about autocompletion like using .cwl (in TexStudio) This is also not about using shortcuts for predefined commands that are listed in the shortcuts sections.   It is more closely related to the 3. Though. I want to define shortcuts for commands that are not listed there.  e.g. When I type Ctrl + Shift + B, I want   \begin{bmatrix} \end{bmatrix}   to be inserted just like Ctrl+ Enter inserts \\.


I would like to know whether I should use "from where" or "from which" in the following sentence:  The bird was standing on the table, from where/from which it flew toward me.

The following is an excerpt from a New York Times article of April 6.     “Tonight, I ordered a targeted military strike on the air base in Syria from where the chemical attack was launched,” Mr. Trump said in remarks at his Mar-a-Lago estate in Florida. “It is in this vital national security interest of the United States to prevent and deter the spread and use of deadly chemical weapons.”    Shouldn't that "from where" be either "from which" or else just "where" without "from?"


I use the following command to copy a folder (named 'dist') containing a react project to my frontend folder: cd apps/react-app sudo cp -R dist ../server/frontend/client  The first time I run the 'cp'-command, the content of the 'dist'-folder gets copied into the 'client'-folder. I would expect that when I run this command again, the cp-command would overwrite the files in the 'client'-folder. This doesn't happen, instead, the 'cp'-command now creates a 'dist'-folder inside the 'client'-folder en puts all the new files in there. The 3th, 4th, ... time I run the 'cp'-command, it overwrites all the files in the 'dist'-folder, but the files from the first 'cp'-command are still in the 'client'-folder also. How can I cp the files from the 'dist'-folder to the 'client'-folder, and whenever I run this command again, it overwrites (instead of creating a new folder)?

When I use   cp -R inputFolder outputFolder   the result is context-dependent:   if outputFolder does not exist, it will be created, and the cloned folder path will be outputFolder. if outputFolder exists, then the clone created will be outputFolder/inputFolder   This is horrible, because I want to create some installation script, and if the user runs it twice by mistake, he will have outputFolder created the first time, then on the second run all the stuff will be created once again in outputFolder/inputFolder.   I want always the first behavior: create a clone next to the original (as a sibling). I want to use cp to be portable (e.g. MINGW does not have rsync shipped) I checked cp -R --parents but this recreates the path all the way up the directory tree (so the clone will not be outputFolder but some/path/outputFolder) --remove-destination or --update in case 2 do not change anything, still things are copied into outputFolder/inputFolder   Is there a way to do this without first checking for existence of the outputFolder (if folder does not exist then...) or using rm -rf outputFolder?  What is the agreed, portable UNIX way of doing that?


Suppose I have a group $G$ such that $n_p \not \equiv 1 \pmod{p^2}$, where $n_p = |\operatorname{Syl}_p(G)|$. Consider a $P \in \operatorname{Syl}_p(G)$ acting on $ \operatorname{Syl}_p(G)$ by conjugation. I want to show that $\exists Q \in \operatorname{Syl}_p(G) : |\mathcal{O} (Q)| = p$. I was considering how to apply the orbit-stabilizer theorem, but I do not know how to apply the fact that $n_p \not \equiv 1 \pmod{p^2}$.

The question is: If the number of Sylow $p$ groups is not congruent to $1 \pmod{p^{2}}$, then there exists two distinct Sylow $p$ subgroups $P,Q$ such that $[P : P\cap Q] = [Q : P\cap Q] = p$. I know that whenever $PQ$ is a group, $|PQ| = \frac{|P||Q|}{|P \cap Q| }$ and that there are $1+kp : 1 \leq k \leq p-1$ possible Sylow $P$ subgroups, but I do not know how to proceed.


I understand that dictionary is not ordered. I know that.  However, this is a code of counting word frequency.  def wordCount(kalimat):     counter = {}     for kata in kalimat.split(" "):         if kata in counter:             counter[kata] += 1         else:             counter[kata] = 1     for I in sorted(counter):         if counter[I] == 1:             print("{:<10} appears 1   time.".format(I,counter[I]))         else:             print("{:<10} appears {:<3} times.".format(I,counter[I]))   I called the wordCount with the following string.     A word may appear once but twice may appear twice since this one will not appear again with this animal   This is the result.   Run #1  again      appears 1   time. not        appears 1   time. one        appears 1   time. may        appears 2   times. word       appears 1   time. appear     appears 3   times. since      appears 1   time. twice      appears 2   times. but        appears 1   time. with       appears 1   time. will       appears 1   time. A          appears 1   time. animal     appears 1   time. this       appears 2   times. once       appears 1   time.   Run #2  once       appears 1   time. word       appears 1   time. will       appears 1   time. animal     appears 1   time. appear     appears 3   times. again      appears 1   time. A          appears 1   time. not        appears 1   time. one        appears 1   time. but        appears 1   time. twice      appears 2   times. may        appears 2   times. with       appears 1   time. since      appears 1   time. this       appears 2   times.   I understand that is not ordered, but even if they are not ordered, why the order is different? My imagination is the reason it's not alphabetically ordered because the order is based on the time they are registered (ie.queue)  I can't imagine that they call random.shuffle() when I want to display it.

Here is the dictionary I have  propertyList = {     "id":           "int",     "name":         "char(40)",      "team":         "int",     "realOwner":    "int",      "x":            "int",     "y":            "int",      "description":  "char(255)",      "port":         "bool",     "secret":       "bool",     "dead":         "bool",     "nomadic":      "bool",      "population":   "int",     "slaves":       "int", }   But when I print it out with "\n".join(myDict) I get this  name nomadic dead port realOwner secret slaves team y x population id description   I know that a dictionary is unordered but it comes out the same every time and I've no idea why.


let $X$ be a Gaussian random vector in $R^n$ such that   $$X \sim \mathcal{N}(\mathbf{0}, \mathbf{I_n}),$$  How can I find the PDF of $\frac{X}{\|X\|}$?

It is known that given $X=(X_1, X_2, \ldots, X_n)$ iid $\sim N(0,1)$, then $X/\sqrt{X_1^2+\cdots+X_n^2}$ is uniformly distributed on the surface of unit sphere.  Intuitively, I know that that's because the probability of $X/\sqrt{X_1^2+\cdots+X_n^2}$ belonging to any region with the same area on the surface should be the same. But how can I prove it mathematically?


If light passes near a massive object, the gravitational interaction causes a bending of the ray. This can be thought of as happening due to a change in the effective refrative index of the medium given by $$n(r) = 1 + 2 \frac{GM}{rc^2}$$ where $r$ is the distance of the point of consideration from the centre of the mass of the massive body, G is the universal gravitational constant, M the mass of the body and c the speed of light in vacuum. Considering a spherical object find the deviation of the ray from the original path as it grazes the object.

I understand that a black hole bends the fabric of space time to a point that no object can escape.   I understand that light travels in a straight line along spacetime unless distorted by gravity. If spacetime is being curved by gravity then light should follow that bend in spacetime.  In Newton's Law of Universal Gravitation, the mass of both objects must be entered, but photon has no mass, why should a massless photon  be affected by gravity in by Newton's equations?  What am I missing?


Today my answer was edited and a link from  was changed to cppreference.com. The edit comment was "use better reference".  I read this , which was provided by the editor.    The problem is that the word "better" is extremely relative. Better for someone is worse for another. I absolutely don't care about cppreference.com and cplusplus.com, but changing links to another website, just because you prefer that one, is wrong. I don't think one is better than the other, but I edited it back to cplusplus. People, don't try to push your opinions onto others.  Imagine  is my favorite cpp reference. Why would anybody edit the link to another reference?

Someone just edited a link in one of my answers to point to a 'better reference'.    I've no problem with links being changed in general, but this smells like part of a concerted attempt to redirect traffic.   Is this kind of activity acceptable on SO?


Sirius gets a wand during the Battle of the Department of Mysteries in Harry Potter and the Order of the Phoenix, but how is this possible since Sirius is an escaped convict from Azkaban? The same goes for all the escaped Death Eaters that broke out of Azkaban. Plus how did Voldemort get his wand back in Goblet of Fire. Didn't the wand get lost in the rubble in the Potter's house?

Sirius Black and a few Death Eaters escape Azkaban and seem to operate after that with their wands intact.  How come?  If a mere expulsion from Hogwarts entails wand destruction (as happened with Hagrid), shouldn't an Azkaban sentence entail the same?  And even if we imagine that the perceived impossibility of escape from Azkaban made it seem unnecessary to destroy the wand, this would apply to Sirius but not to Death Eaters.  PS: Two comments suggested that the escapees acquired new wands. It would be nice to have a more definitive answer than just a suggestion or a list of possibilities. Thanks.  PPS: Returning the personal property to a released prisoner is one thing, but the wand is a different matter: this is usually the tool of the crime, and I don't see how it can be argued that it should be returned and not destroyed. Again, Hagrid had his wand destroyed and he was not even sentenced to Azkaban.  PPPS: Maybe wand destruction is only done for non-fully-qualified wizards?


As far as I know, the time dilation at the event horizon of a black hole is infinite, so everything falls asymptotically towards, but never reaching, the horizon for an outside observer. How then can a black hole gain in mass for this observer?

From observer point of view an object, which falls into black hole never crosses its horizon. Then how does black hole appears and grows its mass?  Or does any black hole looks (and feels by all other information sources) for us like a void sphere with all mass around its horizon?


$z_1,z_2,z_3 \in \mathbb{C}$ Prove that $z_1^2+z_2^2+z_3^2=z_1z_2+z_1z_3+z_2z_3$ is true iff $z_1,z_2,z_3$ are points of a equilateral triangle.(not necessarily in the coordinate begining)  Ive proved for example that $|z_1|=|z_2|=|z_3|$ and $z_1+z_2+z_3$ that mean that these numbers are points of a equilateral triangle in the coordinate begining, using some trig identities, but this one I really don't know how to go about doing.

I need some help proving this, I've seen it proven in the other direction (prove the formula if it is an equilateral) but cant figure out how to prove it this way around.     Given three complex numbers $z_1, z_2, z_3$ prove that the points $z_1, z_2, z_3$ are vertices of an equilateral triangle in $\Bbb C$, if $$z_1^2 + z_2^2 + z_3^2 = z_1z_2 + z_1z_3 + z_2z_3$$


I have a 6th gen iPad (v13.1.3) and an iMac 27 2019 (latest 10.15) on the same wifi network. I can choose my iPad from the dropdown of the sidecar menu, but I always get "Unable to Connect to “iPad name” error message while connecting. I tried it with both wifi and cable without any success. Previously about a week (and few versions) ago I was able to connect. I can see any options to set or debug the connection.  Any idea how can I fix this?

I have been trying to use Sidecar in the public betas of macOS Catalina and iPadOS 13.  I have a 2019 Macbook Pro, and a 3rd generation iPad Pro, so I know I have supported devices.  Both devices are on the same Wifi network, and both have Bluetooth enabled.  Both devices are logged into iCloud with the same AppleID.  Both devices have two-factor authentication enabled.  I have tried this both with and without a USB-C cable connection between the two devices.  The Sidecar preference pane in System Preferences does appear, and when I go into it I can see in the "Select Device" dropdown that my Mac can "see" my iPad Pro.  However, when I try to connect to it, I get the following after a pause:    I keep  for troubleshooting tips, but none have been useful for me thus far.  FWIW, I have been a "good citizen" and reported my problems to Apple via the Feedback Assistant apps on both devices, so in case this is a temporary bug, I've reported it.  I'm just asking here in case someone else has encountered this issue.  Edit: Eventually, Sidecar started working for me (sometimes) after some of the later public betas came out.  I'm not sure exactly which version(s) of Catalina and/or iPadOS made the difference for me.  So far it has worked without any timeouts in the final versions. I didn't need to downgrade and then re-upgrade as the submitted answer suggests, although I'm glad that has worked for some.


I have a certain set of equations in my document which I would prefer cleverref to reference using a different noun. That is, for some equations I would like cleverref to reference those equations as usual, e.g., Equation 1. However, for a specific set of equations I would like cleverref to reference them as Rule 1.  MWE  \documentclass{article} \usepackage{amsmath} \usepackage{cleveref}  \begin{document}  \begin{equation}\tag{I-EQ}     \label{eq:1}     a + b \end{equation}  \begin{equation}     \label{eq:2}     c + d \end{equation}  Reference \Cref{eq:1}. Reference \Cref{eq:2}.  \end{document}   In the above example, I would like eq:1 to be referenced as 'Rule  (I-EQ)', while eq:2 continues to be referenced as 'Equation 1'.

I have inequalities being cross-referenced by \cref as equations.  1-) How can I change that? (and still have inequalities with the same numbering as equations)  2-) How can I change that and have inequalities with their own numbering?  \documentclass[12pt]{article} \usepackage{amsmath} \usepackage{cleveref} \usepackage[letterpaper]{geometry} \begin{document}  \begin{flalign} &f(x) \geq g(x)& \label{i:positivity} \end{flalign}  Admitting that \cref{i:positivity} has a solution, ...    \end{document}


After trying, I realized that I can't evaluate this using the usual simple integration:   $\int_{0}^{\pi} \frac{d\theta}{(a+cos\theta)^2}, a>1$  I was given the hint that:  $\int_{0}^{\pi} \frac{d\theta}{(a+cos\theta)^2}, a>1 = -\frac{d}{da} \int_{0}^{\pi}  \frac{d\theta}{(a+cos\theta)}$  Although, I have not yet figured out why they are equal. But after that, what do I do next? Possibly contour integration or Weierstrass/tangent half-angle substitution but I'm having difficulty understanding how to do that. Any help to clear this out or teach me how to do it. Any help would be appreciated! Thank you in advance!

I had taken a long break from math and physics for months due to stress and an illness so when I returned to it and tried answering problems given, I had difficulty figuring out how to do some of them all over again. Here were the items I had encountered:  1) Evaluate $\sum_{n=0}^{\infty} {p^n}{sin(2nx)}$  2) Solve for x(t): $\frac{dx}{dt} = x_o =-cos(t)x + t^3, x(t=0)$  3) Evaluate $\int_{0}^{\pi} \frac{d\theta}{(a+cos\theta)^2}, a>1$  4) Evaluate $\int_{-\infty}^{\infty} {x^6 e^{-x^2}} dx$  5) Evaluate $L_n(0)$ given the generating function for Laguerre polynomials is $g(x,t) = \sum_{n=0}^{\infty} L_n(x) t^n = \frac {e^{xt/(1-t)}}{1-t}$  6) Solve: $y'' + x^2 y'+(x-1)y = 0$  -> For this, I tried the Frobenius method but didn't get far.  Some weren't taught in my previous class but I was expected to already know it for my course this coming semester. I have tried searching already but I have not gotten far for these. I am not expecting all of these to be answered. I just really need help getting started again so any help for any of these would be really appreciated. You can just choose one among them. If you could perhaps give me a way I can try, step-by-step, or a really good reference for me to look at so I can self-study.


Even more important update: I tried the same code on Java 8, and System.currentTimeMillis() works as expected:  1449242048.588 368936.080131 1449242048.590 368936.082132 1449242048.592 368936.084132 1449242048.594 368936.086132 1449242048.596 368936.088133 1449242048.598 368936.090133 1449242048.600 368936.092133 1449242048.602 368936.094133 1449242048.604 368936.096133 1449242048.606 368936.098134 1449242048.608 368936.100134 1449242048.610 368936.102134 Main run took 20.036 seconds. Expected time: 20.0   Thanks to @Tunaki for the hint.  Update: I think it's useful to quote the  referenced in the response to the duplicate question here:     System.currentTimeMillis() is implemented using the   GetSystemTimeAsFileTime method, which essentially just reads the low   resolution time-of-day value that Windows maintains. Reading this   global variable is naturally very quick - around 6 cycles according to   reported information. This time-of-day value is updated at a constant   rate regardless of how the timer interrupt has been programmed -   depending on the platform this will either be 10ms or 15ms (this value   seems tied to the default interrupt period).   (emphasis mine)  I have some data recorded with timestamps derived from System.nanoTime(). When I play it back, I use a thread that spins in a tight loop calling System.nanoTime() until enough nanoseconds elapse to duplicate the difference between the timestamps.  I've noticed that mixing System.currentTimeMillis() with this kind of playback produces very strange results, at least on Windows 7. The nano time updates as expected, but milli time jumps 16 millis at a time.  Overall waiting time (measured using millis) is still as expected. Here is the tail end of the log of the little program I wrote to illustrate this:  1449238154.610 365042.452692 1449238154.626 365042.454692 1449238154.626 365042.456692 1449238154.626 365042.458692 1449238154.626 365042.460692 1449238154.626 365042.462693 1449238154.626 365042.464693 1449238154.626 365042.466693 1449238154.626 365042.468693 1449238154.642 365042.470693 1449238154.642 365042.472694 1449238154.642 365042.474694 1449238154.642 365042.476694 1449238154.642 365042.478694 1449238154.642 365042.480694 Main run took 20.0 seconds. Expected time: 20.0   To the left is millis time, to the right is nanos time, both normalized to seconds. As you can see, millis time is not updated every millisecond but rather about once per 16 milliseconds.  Can someone explain what's going on?  I am attaching the code I wrote for testing this effect. The environment is Windows 7 Enterprise, Java 7, 8 cores on 2 CPUs.  public class NanotimeTest {      private static final long DELAY_NANOS = 2_000_000;     private static final int ITERATIONS = 10_000;      private static class Times {         public long millis;         public long nanos;     }      Times[] times = new Times[ITERATIONS];      public static void main(String[] args) {         new NanotimeTest().run();     }      private void run() {         for (int i = 0; i < ITERATIONS; i++) {             times[i] = new Times();         }           System.out.println("Starting warmup");         produceTimes(1000);          System.out.println("Starting main run");         long start = System.currentTimeMillis();         produceTimes(DELAY_NANOS);         long end = System.currentTimeMillis();           for(Times t : times) {             System.out.printf("%.3f %f\n", t.millis / 1000.0, t.nanos / 1_000_000_000.0);         }          System.out.println("Main run took " + (end - start)/1000.0 + " seconds. Expected time: " + (DELAY_NANOS * ITERATIONS)/1_000_000_000.0);      }      private void produceTimes(long delayNanos) {         for (int i = 0; i < ITERATIONS; i++) {              long start;              times[i].millis = System.currentTimeMillis();             times[i].nanos = start = System.nanoTime();              while (System.nanoTime() - start < delayNanos) {                 // go on             }         }     }  }

Accuracy Vs. Precision  What I would like to know is whether I should use System.currentTimeMillis() or System.nanoTime() when updating my object's positions in my game?  Their change in movement is directly proportional to the elapsed time since the last call and I want to be as precise as possible.  I've read that there are some serious time-resolution issues between different operating systems (namely that Mac / Linux have an almost 1 ms resolution while Windows has a  50ms resolution??).  I'm primarly running my apps on windows and 50ms resolution seems pretty inaccurate.  Are there better options than the two I listed?  Any suggestions / comments?


Using a Blender python script I want to get the world coordinate of a specific pixel (or all).  Assume a camera has been defined (focal length, fov/angle, sensor size,etc.), and orientated/pointed as desired. Also, a large surface is defined, so the camera rays would actually "hit" objects in the scene (& not cast into infinity).  For example, Given 4 corners pixels of camera, where do they in fall in world coordinates (XYZ)?  Alternatively, a script could export the world coordinates (XYZ) for all pixels, then a "camera ray hit map" could be generated.  There's probably a better name for this.  From the very similiar question, , there are recommendations to use:   &   However I'm new to blender, and ray-tracing in general, and it is not clear to me how to proceed with these functions.

My issue is that I want to access the buffer data from python, pixel after pixel, for being able to use it for arbitrary computations. How can I achieve this?  (Please dont tell me about exporting to different kinds of formats like exr etc, because I want to do computations  in place).   Also I'm talking about blender 2.68 or higher.


I was writing to a friend of mine, back and forth, and suddenly I am getting the following message back:  <email@example.com>: host mx1.example.com[123.123.123.123] said: 554 5.7.1 Spam     detected by content scanner.  Message rejected.  (in reply to end of DATA     command)   This is strange, because I am not even using words or phrases that are "SPAMMY."  I tried to re-send the message with a slight change in the content, but I get the same reply.  Could it be that this has not something to do with the content but with something else, such as my server reputation?  As a note, I am using a local mail server here, not GMAIL or something.

I have my own email server and I've recently noticed that many of the emails I sent ended up in the recipients' spam folder. I have verified the IP of my mail server and it's not in any blacklist. What could be causing this? Could it be that my IP doesn't have a long history? How can I fix this?


I wonder why the function can see the variables "a" and "b" even though they are declared and defined outside of the function scope?  function whichOneGreater() {   a > b ? console.log("a: ", a) : console.log("b: ", b); }  var a = 3/4; var b = 4/9;  whichOneGreater()   if I change the variable name from a to c  function whichOneGreater() {   a > b ? console.log("a: ", a) : console.log("b: ", b); }  var c = 3/4; var b = 4/9;  whichOneGreater()   then the error happens  script.js:2 Uncaught ReferenceError: a is not defined     at whichOneGreater (script.js:2)     at script.js:8   Edit: I found an article that answers my question well

What is the scope of variables in javascript? Do they have the same scope inside as opposed to outside a function? Or does it even matter? Also, where are the variables stored if they are defined globally?


I want to know how overloading methods affects their execution time. I made a simple project with method add() public static double add(double a, double b){         return a+b;     }  Next step I overload this method with new parameters. public static double add(double a, double b, double c){         return a+b+c;     }  public static double add(double a, double b, double c, double d){         return a+b+c+d;     }  The results I'm getting are really strange. Method with 2 parameters takes much longer to execute than method with 4 parameters. I have no idea why it's happening because I thought more parameters = longer execution time. public static void main(String[] args) {         double avg1 = 0;         double avg2 = 0;         double avg3 = 0;         int a = 10000000;          for(int i = 0; i < a; i++){             double startTime = System.nanoTime();             add(1,1);             double endTime   = System.nanoTime();             double totalTime = (endTime - startTime)/1000000;             avg1 = avg1 + totalTime;         }         for(int i = 0; i < a; i++){             double startTime = System.nanoTime();             add(1,1,1);             double endTime   = System.nanoTime();             double totalTime = (endTime - startTime)/1000000;             avg2 = avg2 + totalTime;         }         for(int i = 0; i < a; i++){             double startTime = System.nanoTime();             add(1,1,1,1);             double endTime   = System.nanoTime();             double totalTime = (endTime - startTime)/1000000;             avg3 = avg3 + totalTime;         }         System.out.println(avg1/a);         System.out.println(avg2/a);         System.out.println(avg3/a);      }  Here is example result what I'm getting: 2.0166120000545003E-5 1.9719660000539676E-5 1.9088180000519356E-5  And it seems that running method with 2 param takes longer to run then method with 3 parameters. And method with 3 parameters takes longer to run then method with 4 parameters. Any ideas what I'm doing wrong?

How do you write (and run) a correct micro-benchmark in Java?  I'm looking for some code samples and comments illustrating various things to think about.  Example: Should the benchmark measure time/iteration or iterations/time, and why?  Related:


I am a little bit confused. Suppose I have a method  void test(){ }  How exactly can I make this package-protected? The protected modified makes it overridable by children.

In Java, are there clear rules on when to use each of access modifiers, namely the default (package private), public, protected and private, while making class and interface and dealing with inheritance?


Good evening,  I would like to filter a file's content with some piped commands and then write the result back to the same file. I know, I can't do that the way I wrote it. Hold on …  This is the piece of bash script I have.  grep '^[a-zA-Z.:]' "$filepath" \     | sed -r '/^(rm|cd)/d' \     | uniq -u \     > "$filepath"   So I thought I could succeed in, using process substitution instead. I then wrote:  grep '^[a-zA-Z.:]' < <(cat "$filepath") | …   This did not solve anything either. I expected process substitution to « save » my input file content somewhere, like in a temporary file. It seams I haven't understood process substitution either.  I read threads about "inplace" edition but these articles highlighted special options of some binaries like sed -i or sort -o but I need a general solution (I mean it has to suit any piped commands).  So first, why 'pipes standard way' cannot do this, what's happening underneath ? :/ And how should I solve my issue ? Could someone please explain me what is this all about ?  Thank you.

I know this is sort of a duplicate of another question () but I wanted to expand on the question in response to the answers given.  The command  shuf example.txt > example.txt  Returns a blank file, because the shell truncates the file before shuffling it, leaving only a blank file to shuffle. However,  cat example.txt | shuf > example.txt  will produce a shuffled file as expected.  Why does the pipeline method work when the simple redirection doesn't? If the file is truncated before the commands are run, shouldn't the second method also leave an empty file?


The current version of Notepad++ (at the time of this writing) is 6.6.3. Version  is the first that introduced a native (without a plugin) sorting function. At least, that's what they claim; even though we're nine releases after version 6.5.2, I have found nothing about this feature:   There is no sign of it in the menu (or I am blind), There isn't even a word in Notepad++ documentation (online help).   Everything I read around the Internet (including ) still talks about sorting lines using the TextFX plugin. There isn't anything about a native (QuickSort-based) function.  So: How do I sort lines in Notepad++ without using the TextFX plugin?

I have lists of files that contain a few columns of data. It is not sorted the way I want from the output, so I'm manually hunting for where a line should be. Is there a way in Notepad++ to sort the lines alphabetically? If so, how?


I am currently studying this type of Jacobi matrix for all n  Example of the type of matrix $n=4$ $$\mathbf{X}=\left[\begin{array}{*{20}{c}} {0}&{1}&{0}&{0}\\ {1}&{0}&{1}&{0}\\ {0}&{1}& {0} &{1}\\ {0}&{0}&{1}&{0} \end{array}\right]$$  I am struggling to prove that all eigenvalues for all n will be; $ \lambda \leq |2|$

$$A=\begin{array}{ccc} 0 & 1/2 & 0 & \cdots & 0 \\ 1/2 & 0 & 1/2 &\cdots& 0\\ 0 & 1/2 & 0 & \cdots & 0\\ \vdots & \vdots & \vdots &\ddots & 1/2\\ 0 & 0 & 0 & 1/2 & 0 \end{array}$$  I need to know the spectral radius of $A$ in function of the dimension of the matrix $n$. I know only one way to know the spectral radius, using the definition I find all eigenvalues and then find the maximum. but it very hard if $n$ is changing. Some help please!  I did some iteration by   $$det(\lambda I-A)$$  $$n=2 \quad r=\frac{\sqrt{1}}{2}$$ $$n=3 \quad r=\frac{\sqrt{2}}{2}$$  for $n=2$ and $n=3$ are correct.  and if we take this rule, for   $$n=5\quad \quad r=\frac{\sqrt{4}}{2}$$  but this isn´t true since I know radius for this matrix should be $< 1$ and if we take this rule  for $n=5$ we have  $$\frac{\sqrt4}{2}=1$$   Some hint?


I'm trying to generate i.i.d samples from two uniformly distributed random variables in MATLAB. However, when I correlate the two sets of samples, I find that the correlation is almost zero, but the p-value is above 0.05. How should I interpret this test? Is it even possible to generate i.i.d samples in real life?  >> [r,p] = corrcoef(rand(1,1000),rand(1,1000))  r =      1.0000   -0.0508    -0.0508    1.0000   p =      1.0000    0.1082     0.1082    1.0000

After taking a statistics course and then trying to help fellow students, I noticed one subject that inspires much head-desk banging is interpreting the results of statistical hypothesis tests.  It seems that students easily learn how to perform the calculations required by a given test but get hung up on interpreting the results.  Many computerized tools report test results in terms of "p values" or "t values".  How would you explain the following points to college students taking their first course in statistics:   What does a "p-value" mean in relation to the hypothesis being tested?  Are there cases when one should be looking for a high p-value or a low p-value? What is the relationship between a p-value and a t-value?


This type of questions has been asked, but did not find solution to my current setup (setup with soundcard).    I have Xonar DGX sound card, and Nvidia Graphics card.  I have connected TV to my graphics card HDMI.   I have connected my pc monitor to my graphics card DVI.  I have PC speakers connected to soundcard.   I have Windows 8.1.   Currently all sound is played through PC speakers. The TV shows up in device playback settings and the test sound works.   How to make it automatically play sound over HDMI if application runs on TV? So I hear sound from my TV if TV screen is used for the application. And if the application is run on my PC monitor, it would play sound to my pc speakers?  EDIT: I don't know the details but I know that in Windows 7 if I connected my laptop to TV with HDMI, it automatically used TV speakers, if I moved for example chrome window to TV monitor that played youtube. And if I moved it back to laptop it played on laptop speakers. I can't get the same behavior with this setup.

I have a PC that is hooked up to my HDTV (via a long hdmi cable) and to a monitor, which is in another room. I have speakers directly plugged to the PC audio out. The PC is next to the monitor and speakers.   I am not sure but I think Windows can play sound on only 1 audio device at a time. And I can only set 1 device as the default output. I can get sound on the TV or speaker depending on which device I set to default. But I would have to do this every time I switch between using my TV or my monitor!   Is there some way to configure such that sound plays through the TV if the TV is on, else it plays in the speakers? If this is not possible, then the next best alternative would be to get the sound to play on both the devices at the same time.


I was reading an article on a power analysis and sample size calculations for a class of models that known as joint longitudinal-survival models. The paper derives a closed form formula for power and sample size calculation. This paper is a frequentist paper in a sense that it assumes parametric assumptions and based on those assumptions, it gets likelihood, score function, … and it eventually gets the formula.  I was wondering how power analysis and sample size calculations are done in Bayesian framework?  Probably my question is naive especially given that I'm not expert in power analysis, but I think no matter how we approach a problem, once we have a hypothesis, power analysis is essential. So, I wanted to  ask:   Is power analysis also done in Bayesian framework? Could someone kindly references some papers on power analysis from Bayesian perspective? Would be great if I can find a power analysis for problems tackled with Bayesian nonparameteric approaches.

I've been researching the Bayesian take on classical statistics lately. After reading about the Bayes factor I've been left wondering if power analysis is a necessity in this view of statistics. My main reason for wondering this is the Bayes factor really just appears to be a likelihood ratio. Once it's like 25:1 it seems like I can call it a night.  Am I far off? Any other reading I can do to learn more? Currently reading this book: , by W.M. Bolstad (Wiley-Interscience; 2nd ed., 2007).


I'm not sure what they're called, but I notice that 2-word verbs can be arranged around and yet both sound okay.     Have you tried out baseball yet?      Have you tried baseball out yet?   or     Do you want to take out your burger?      Do you want to take your burger out?   or     Remember to shut down the computer.      Remember to shut the computer down.   Which usage is correct?

I thought of this question right after I posted a tweet about a service upgrading me to a free student account since I am in college. I said "That really helps a broke college student out." I actually paused for a second while I was writing that to decide if I should say     That really helps out a broke college student.   or     That really helps a broke college student out.   Are there any prescriptive rules about splitting phrasal verbs like this? I know this breaks the "don't put a preposition at the end of a sentence" rule, but that "rule" has an exception for phrasal verbs.  To clarify:   Is there any rule that says phrasal verbs can't be split, even if it is just an imposed, prescriptive rule? Does splitting a phrasal verb to put a preposition at the end of a sentence fall under the phrasal verb exception to the prepositions at the end of a sentence rule?


I do not see any way to use Windows 7 search to search file content ONLY w/o it also including file names. For example, how do you search for files that contain "L:\" and only files that CONTAIN "L:\"? I do not want a list of files that have that in their name (filespec) but only a list of files that have that in their content.  Someone suggested L:\ System.FileName:NOT ~L:\ but that excludes all files with L:\ in their name (filespec) including the ones that contain "L:\".

In Windows XP we can search for files that contain a defined keyword (inside all files types).  Windows 7 can look inside files for a keyword, but only for text files. (*.doc, *.txt, *.inf, ...), not (*.conf, *.dat, *.*, ...).   don't contain any filter I can use for this.  How is this possible?


(Analysis 1 by Tao) Exercise 8.1.8 Use Corollary 8.1.13 to prove Corollary 8.1.14. Corollary 8.1.13. The set $\mathbb{N} \times \mathbb{N}$ is countable. Corollary 8.1.14. If $X$ and $Y$ are countable, then $X \times Y$ is countable.  For the proof of Corollary 8.1.13, the book shows that $\mathbb{N} \times \mathbb{N} = A \cup B$, where $A = \{(n,m) \in \mathbb{N} \times \mathbb{N} : 0 \le m \le n\}$ and $B = \{(m,n) \in \mathbb{N} \times \mathbb{N} : 0 \le n \le m\}$. I also know that $X$ and $Y$ are countable, there exists bijections from $\mathbb{N}$ to $X$ and $\mathbb{N} $ to $Y$. To finish the proof, I need to find the bijection from $\mathbb{N} \times \mathbb{N}$ to $X \times Y$, but I do not know how to get this. Any help would be appreciated.

The Cartesian product of a family $(A_i\mid i\in I)$ is defined as $$\prod\limits_{i\in I}A_i=\{f:I\to\bigcup A_i\mid f(i)\in A_i\}$$ Let $I_n=\{i \in \mathbb N \mid i \le n\}$ for $n\in \Bbb N$ and $A_i$ be countable for all $i\in I_n$. Then $\prod\limits_{i\in I_n}A_i$ is countable.   My attempt: Lemma 1: $(\prod\limits_{i\in I_n}A_i) \times A_{n+1}$ and $\prod\limits_{i\in I_{n+1}}A_i$ are equinumerous for all $n \in \mathbb N$. (I presented a proof ) Lemma 2: If $A$ and $B$ are countable, then $A \times B$ is countable. (I presented a proof ) I will prove the theorem by induction on $n$. The theorem is trivially true for $n=0$. Assume that the theorem is true for $n=k$, then $\prod\limits_{i\in I_k}A_i$ is countable. Since $\prod\limits_{i\in I_k}A_i$ is countable (by inductive hypothesis) and $A_{k+1}$ is countable, then by Lemma 2 $(\prod\limits_{i\in I_n}A_i) \times A_{n+1}$ is countable. Furthermore, by Lemma 1 $(\prod\limits_{i\in I_k}A_i) \times A_{k+1}$ and $\prod\limits_{i\in I_{k+1}}A_i$ are equinumerous, then $\prod\limits_{i\in I_{k+1}}A_i$ is countable too. Thus the theorem is true for $n=k+1$. This completes the proof.   Does this proof look fine or contain gaps? Do you have suggestions? Many thanks for your dedicated help!


There is a proposition in Beachy and Blair's Abstract Algebra that I don't entirely follow. The proposition is the following:   Let $G$ be a group of order $pq$, where $p > q$ are primes.  a) If $q$ is not a divisor of $p-1$, the $G$ is cyclic.  b) If $q$ is a divisor of $p-1$, then either $G$ is cyclic or else $G$ is generated by two elements $a$ and $b$ satisfying the following equations: $$a^p = e, \\ b^q = e,\\ ba = a^nb $$ where $n \not \equiv 1  \ (mod \ p)$ but $n^q \equiv 1 \ (mod \ p)$.  Can one of you prove how this is true? I understand a similar proof for when $q=2$, but this one is more complicated.

Let $G$ be a group of order $pq$, $p>q$  and $p$, $q$ are primes. Then prove that  If $q\mid p-1$ then there exists a non abelian group of order $pq$. Any two non-abelian groups of order $pq$ are isomorphic.   I have proved that if $q\not\mid p-1$ then $G$ is cylic . But how to prove this one I have no idea. Any kind of hint is very much welcome. This problem is in Herstein book, page 75.


So I am having this strange issue with PDO, in that queries with bound variables are not executing properly for some reason. Let me show some code:  $conn = new PDO("mysql:host=$db_host;dbname=$db_name", $db_user, $db_pwd); $sth=$conn->prepare("select count(*) from article"); $sth->execute(); var_dump($sth->fetchColumn());   This will print out the correct number of entries in the table "article".  However, if we change it slightly, by making the table a named parameter instead of a constant:  $conn = new PDO("mysql:host=$db_host;dbname=$db_name", $db_user, $db_pwd); $sth=$conn->prepare("select count(*) from :article"); $sth->execute(array(":article"=>"article")); var_dump($sth->fetchColumn());   This will print a boolean false. Both statements should return the same result, but I have no idea why the second one is not working. I suspect I have a typo somewhere, but I checked several times, and I don't see any issue. Anyone have any idea?

Why can't I pass the table name to a prepared PDO statement?  $stmt = $dbh->prepare('SELECT * FROM :table WHERE 1'); if ($stmt->execute(array(':table' => 'users'))) {     var_dump($stmt->fetchAll()); }   Is there another safe way to insert a table name into a SQL query? With safe, I mean that I don't want to do  $sql = "SELECT * FROM $table WHERE 1"


How do I show that this sum diverges/converges?  $$\sum_{n=2}^\infty \frac1{\log(n!)}$$    I want to use the comparison test, but I do not know how to approach.  Also, Wolfram says this diverges by the comparison test, but Mathematica gives me a numerical answer using the NSum function.

I am sorry that my question is not whether $\sum^\infty_{n=2} \frac{1}{\ln{(n!)}}$ convergent or not.  My question is how to compute the sum of series:  $$\sum^\infty_{n=2} \frac{1}{\ln{(n!)}},$$ It is a question in a textbook, and I have worked on it for days, but fail.


I need your help,  I can't seem to be able to strip away the whitespaces in my data string before adding them to my select box.  (BTW the spaces in between the data string are deliberate as I am working with an old dataset and slowly converting it to a non-space string)  How do you accomplish this? I thought that I had the logic all right:  <!DOCTYPE html>  <html>  <head>  <script type="text/javascript"> function parseData() {      var data = "1234567, 8910111, 9632587,6541237,9631478, 1010232"      var options = data.split(",");      var select = document.getElementById('list')     select.innerHTML = ""      for(var i=0; i<options.length; i++)       select.options[i] = new Option(options[i], i); } </script>  </head>  <body> <input type="button" value="load list" onclick="parseData()"/> <br> <select id="list"></select> </body>  </html>

How do I trim a string in JavaScript? That is, how do I remove all whitespace from the beginning and the end of the string in JavaScript?


I have not managed to evaluate the integral. I feel the idea is just split the integral into a sum of integrals $$\int \frac{1}{x(x+1)...(x+n)}dx = \int \left(\frac{A_1}{x} + \frac{A_2}{x+1} +... +\frac{A_n}{x+n} \right) dx$$ So, technically, the main problem is to determine the coefficients in the numerators of these fractions. Hhm, it has occurred to me that I might bypass the system of $n$ equations just putting $x = 0$, $x = - 1$,..., $x = - n$ after multipling the whole expression by $x(x+1)...(x+n)$. The idea can be of help to solve the risen problem. Another idea is just to decompose the fraction by representing the numerator of the initial fraction, which is 1, as an expression considered to be suitable to attain the objective. For example, $$ 1 = x + 1 - (x + 2) + (x + 3) - (x + 4) +... $$ I might attempt to adopt the idea but there is a nice trick that solves the problem? I came across the integral when searching for the competition problems on integration. When trying to apply "brutal force" method, I got many brackets and equations afterwards. Hence, there must be more cunning technique.

I try to find a partial fraction expansion of $\dfrac{1}{\prod_{k=0}^n (x+k)}$ (to calculate its integral). After checking some values of $n$, I noticed that it seems to be true that $\dfrac{n!}{\prod_{k=0}^n (x+k)}=\sum_{k=0}^n\dfrac{(-1)^k{n \choose k}}{x+k}$. However, I can't think of a way to prove it. Can somebody please help me?


I've heard people say that the cheese used in pizzas is not suitable for many other things and for this recipe you need to have this particular cheese. Is there some broad principle as to which cheese should be used and where??

I have been trying to improve my skills in the kitchen by watching some professional chefs on television, I have a serious problem though, many of the recipes they describe contain different kinds of cheese,  I can get cheddar easily but after several disasters I have discovered that I can not replace some of the hard to get cheese discussed in some recipes with cheddar, to my surprise there are even different varieties of cheddar.   Could someone point me to a comprehensive easy to follow cheese guide for beginners? I would prefer a PDF document I can freely download and print. the guide should contain the different types of cheese, their characteristics and what they are best used for I will then use this to try and make substitutions.


When filling text and a solid shape fill or slide background with the same RGB colour values, the text appears darker than the shape or background. This makes the colour inconsistent when using the same swatch from a colour theme for text and fills. Frustrating for clients who want the simplicity of a consistent colour template.

I made PowerPoint template on PowerPoint 2010 for PC and everything seemed to be just fine.  But when I opened it on my Mac (PPT 2011), I could see the background color was wrong. So I tripple checked the RGB-values on the background and they was OK.  So I tried to write some text over the background with the SAME RGB-value on the text as on the background. There was clearly a difference here. It seems to me that the text got the correct color and the background is wrong.  I tried to do the same thing on a blank presentation (and blank document in Word) and I could reproduce the same result.   Why is there a difference in the background color and the text color when they both have got the same RGB-value?


I am using Django and here are the get and post methods. After refreshing page, on first form submit, Ajax jquery is called. On success, it returns json.msg which is another form rendered as given in below post call. When I try to submit this rendered form, ajax is not called but it directly calls the django POST method.  On ajax success, I tried '$('#school').unbind('submit').submit();'. This way, it ensured to call ajax on every form submit. But, the above method, refreshed the whole page which I do not want. May I know how can I unbind the previous submit without page refresh or get Ajax called(and not direct django post) on every submit.  def get(self, request):     ...     ...     return render(request, self.template_name, {'form':next_form_obj})   def post(self, request):     ...     t = get_template('school/fun_activities.html')     msg = t.render({'form': next_form_obj}, request)     return JsonResponse({'msg': msg})   Here's the Ajax call.  $('#school').on('submit', function(event){ $.ajax({     type: 'POST',     url: '/school/fun/',     data: $("#school").serialize(),     success: function (json) {                                    event.preventDefault();                 $('#msg-list').append(json.msg); #json.msg is another form     },         error: function(data) {         $("#msg-list-div").html("Something went wrong!");     } }); return false; });   HTML:  <form id = "school" method="post" action=".">     <input type="submit" value="Next" /> </form>

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.


String s = "Hi Hello Hola"; String[] d = s.split(" "); System.out.println(d[0] == "Hi"); // prints false String[] e = { "Hi", "Hello", "Hola" }; System.out.println(e[0] == "Hi"); // prints true   Here we have an array d with the values Hi, Hello, and Hola. We have another array e with the same set of values.  But why does this comparison behaves differently? Why does it print false and then true?  I expected false for both! As we are comparing a string literal value with the string value by using ==.  Why is this difference?  Update Here my question is not about the comparison of String values. I'm aware of the differences between == which compares the references and equals() which compares the content of the string.  From the answers, i understand that in the second case, Hi value is interned and refers to the same object. But in the other case, split creates new values without checking the literal pool. Is it right? Am i missing anything?

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


If I press the windows key I am able to type in the command which I want to execute. I like this autocomplete feature.  I have directory ~/scripts which is in my PATH.  There is a script called ~/scripts/win.sh which starts rdesktop to a remote terminal server with my preferred resolution.  I can call this script via the terminal.  But the autocomplete input which I see after pressing the windows key does not know this command.  I would like to avoid opening a terminal to call win.sh.  How can I start my script via the windows key?  I use default Ubuntu 18.04

I just installed the lastest version of . I works fine but in order to use it, I have to enter the following in the terminal: cd ugene-1.11.5/ then execute ./ugene -ui to launch UGENE GUI.   This takes too long. I would like to build a .desktop file for UGENE to be used in Ubuntu 12.04 so that I can simply open it from the unity launcher.  Not sure if this is helpful but the website says: By default ugene script launches the command-line version of UGENE.  Here's what I have (not sure if it's right):  [Desktop Entry] Version=1.0 Name=my Unipro UGENE GenericName=Integrated Bioinformatics Suite Comment=Unipro UGENE is a cross-platform visual environment for DNA and protein sequence analysis. MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++; Exec=/home/samuel/ugene-1.11.5 ./ugene -ui -c %F Icon=/usr/share/icons/hicolor/scalable/apps/ugene.svg Type=Application Terminal=true Categories=Utility;Development; StartupWMClass=UGENE   I added the launcher named my Unipro UGENE to my unity bar and tried opening it but it doesn't appear. I must be missing something. I don't know what the StartWMCClass field is suppose to be nor do I know whether I entered the correct MimeType.


I am trying to make a simple ink drop animation. The image looks great in Preview, but when I Render a second later the screen is just black. I can't figure out why this is happening.    Here's the project file!     Would love some help!

When blender is rendering I can see my model but at the very end the render goes black and the image saves as a black image. I am using cycles. Any help would be awesome!


I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3  The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]    Then I changed one of the innermost values: my_list[0][0] = 5  Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]]    which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it?


Let $f:M(n,\mathbb C) \to \mathbb C$ be a linear transformation such that $f(AB)=f(BA) , \forall A,B \in M(n,\mathbb C)$ , then is it true that $\exists k \in \mathbb C$ such that $f(A)=kTrace (A),\forall A \in M(n,\mathbb C) $ ?  I can only figure out that $\exists X\in M(n,\mathbb C)$ such that  $f(A)=Trace (AX),\forall A \in M(n,\mathbb C) $ and that $f$ is continuous .   Please help . Thanks in advance

We know that the trace of a matrix is a linear map for all square matrices and that $\operatorname{trace}(AB)=\operatorname{trace}(BA)$ when the multiplication makes sense.   On the , under properties, it says that these properties characterize the trace completely in the following sense: If $f$ is a linear function on the space of square matrices satisfying $f(xy)=f(yx)$, then $f$ and $\operatorname{tr}$ are proportional. A  of the page gives the justification, but I do not understand the logic of it. Thanks


Any ideas on how to position a div or a footer without using position absolute or fixed? If I use absolute, it overflows the content at smaller screens and I do not want to use fixed as I do not want the footer to visable at all times. I would be grateful for any tips or tricks. Thank you in advance.

I have a simple 2-column layout with a footer that clears both the right and left div in my markup.  My problem is that I can't get the footer to stay at the bottom of the page in all browsers.  It works if the content pushes the footer down, but that's not always the case.


This is the faulty calculator code. which prints wrong answers for some questions whereas gives the right answer to other all computations. I want this code to loop so that the user can do more than one calculation. num1 = int(input("Please  input first number: ")) num2 = int(input("Please input second number: ")) ope1 = input("What would you like to perform:    "             " +    "             " -    "             " /    "             " *    "             " %    :")  if ope1 == "+":     ans = num1+num2 elif ope1 == "-":     ans = num1-num2 elif ope1 == "/":     ans = num1/num2 elif ope1 == "*":     ans = num1*num2  if ans == 4*2:     print("Your calculation is 9.") elif ans == 2+4:     print("Your calculation is 7.") elif ans == 5-3:     print("Your calculation is 1.") else:     print("Your calculation is:", ans)

It's a really basic question but i can't think at the second. How do i set up a loop that asks each time the function inside runs whether to do it again. So it runs it then says something like;  "loop again? y/n"


I have read  but it doesn't have any well-explained answer for this case: I understand the ROC curve in overall, but I'm looking for a step-to-step explanation in order to understand how the curve changes when one true-positive becomes false-positive (and so on). For example, how can I draw a ROC curve with this set?. Does the score means the "certainty" for the value given? (for example: for the id == A the is a 0.03 of certainty that the value is active/decoy == a?)  id  score   active/decoy  A   0.03    a B   0.08    a C   0.10    d C   0.11    a D   0.22    d E   0.32    a F   0.35    a G   0.43    a H   0.57    a I   0.61    d J   0.68    a

I am interested in calculating area under the curve (AUC), or the c-statistic, by hand for a binary logistic regression model.  For example, in the validation dataset, I have the true value for the dependent variable, retention (1 = retained; 0 = not retained), as well as a predicted retention status for each observation generated by my regression analysis using a model that was built using the training set (this will range from 0 to 1).  My initial thoughts were to identify the "correct" number of model classifications and simply divide the number of "correct" observations by the number of total observations to calculate the c-statistic. By "correct", if the true retention status of an observation = 1 and the predicted retention status is > 0.5 then that is a "correct" classification. Additionally, if the true retention status of an observation = 0 and the predicted retention status is < 0.5 then that is also a "correct" classification. I assume a "tie" would occur when the predicted value = 0.5, but that phenomenon does not occur in my validation dataset. On the other hand, "incorrect" classifications would be if the true retention status of an observation = 1 and the predicted retention status is < 0.5 or if the true retention status for an outcome = 0 and the predicted retention status is > 0.5. I am aware of TP, FP, FN, TN, but not aware of how to calculate the c-statistic given this information.


Sometimes, I encounter questions with vague titles: they do not always specify what is really being asked.  For example, there is a question called  which is asking only about files on Linux/Unix. This is clearly a useful question, but I think "How do I find all the files that were created today in Unix/Linux?" would be a more descriptive title.  In a situation such as this one, should I change the title to describe a question's topic more accurately, or should I leave the question's title as-is?

Titles should be completely independent of tags.  A good title tells an expert whether they want to read the full question all by itself. I know this has come up multiple times before, before, but in each case, the discussion has seemed to have turned into a different question.  For example,   really asks, "Don't we need tags in titles to help with SEO"? So, "no, we don't, because we add the top tag (or two, in some cases) to the crawler results," is correct, but it appears that people are interpreting that to mean that people generally can (or should) omit key terms from their titles if they exist in the tags.  To be clear:  I agree that we should never force a tag into a title if it's not helpful;  should NOT have "[Baking]:" jammed into the title, because it adds nothing to a reader's understanding of what it's about, BUT...  Nothing should be left out of a title just because it exists in the tags.   Trilogy examples:   , ,   examples: , , , The problem with all of these is that without a language, OS, or game title, they fail to convey whether you care to read the question, because you need to read the tags to even figure out if you work with the language or own the game in question. A term being in a tag in no way reduces the need for it in the title.  Tags are great for filtering, but a title is supposed to function like a headline. This is a good headline:  This is not very good headline:  Titles, like headlines, are BIG AND BOLD on the front and other pages.  So you can browse and stuff.  Tags are small, and kind of low contrast.  So they don't, you know, distract you from the headlines. Bear in mind that on non-technical sites, new visitors, even new experts, don't necessarily even know what tags are. The title test:  If you assume the reader can't even see the tags, is your title a good, stand-alone summary of the question for an expert on that topic?  I'm sticking with gaming examples because they're more broadly accessible than some topics:   does not need, "in Starcraft" added, because it's impossible to be interested in the answer and not know that a zergling question relates to Starcraft.  but...  , absolutely needs "...in Starcraft 2" added to it, because without the tags, it's currently useless as a way to decide if you want to read it.  This is really no change from :  In the wake of that comment, people seemed to mostly hear:  "stop forcing a word you don't need in just cuz it's a tag"  ... which is right, but what it really says is,  "most of the time, some tags will naturally belong in a title that effectively summarizes the question".  EDIT: Some folks felt this was (an unduly public) way to call out gaming specifically. It's not - I think this is a problem to varying degrees on a number of sites, but used examples from gaming because they're easy for most readers to follow. Sincere apologies to anyone in the Arqade community who felt I was using a network-wide forum to criticize a gaming practice - I wanted to clarify the best practice for all the sites that encounter this at least sometimes, including SO, where you still see people stripping languages from titles in edits sometimes.


Is there a shortcut in excel that will expand all the column width(s) to show the entire column header as well as complete column data?  Now I need to go to each and every column in the excel sheet and double click on the border between every column and expand it completely to increase the column width to show the complete text in that column. I want to get this done in one click per excel worksheet

I have a spreadsheet with many columns. The columns are all a small standard width. Double-clicking the partition line between columns will expand the column width to encompass the longest string in that column.  Is there a shortcut to perform this operation on every column in the spreadsheet?


I'm reading a book and it says $x^2+y^2=3$ doesn't have a rational answer beacuse : $x^2+y^2=3z^2$ (which $z$ is not zero) has only $(0,0,0)=(x,y,z)$ as an answer. Can someone explane the second part? Why are we using the second statement to prove the first part? Cause the book I'm reading just said it as a statement and I dont get it. Thank you.

I need to find all natural $x,y,z$ that satisfy the following   $x^2+y^2 = 3z^2$   $(0,0,0)$ is an answer of course.  What I tried: I tried solving with congruences. I know that every square number is either $0\pmod4$ or $1\pmod4$ so the sum of two squares is either $0\pmod4$ or $2\pmod4$. Now I'm stuck... Any help will be appreciated.


I applied for UK visa 3 weeks back and today I collected my documents. My application has been refused with following reason:        You state that the cost to you personally is 500 (GBP)  and that you are employed as xxx and receive a monthly income of yyyy. As   evidence of your funds you have submitted a photocopy of your bank   statement however, I am unable to see a salary being deposited to the   amount stated in your application for and therefore I am not satisfied   that your income or employment is as stated.          In light of the above, I am not satisfied that you have sufficient   funds to cover your costs whilst in the UK without working or   accessing public fund. You application has therefore been refused   under paragraph V4.2 (e).   I didn't attach any playslip or any proof of employment. I had just attached NOC from employer, bank statements and tax returns as part of financial.   I have been working in a startup for last 10 months and it doesn't pay me regularly. Although over a period of 8-9 months, total amount deposited by company is same as the amount stated in my application. Generally employer transfers 2-3 times of my stated salary once and for next 2-3 months there are no deposits.  Should I apply again with more documents, such as letter of employment from company, salary slip and proof of income?   I have flight tickets booked for Saturday (3rd June). Will going for priority visa help my case. Although there is a visa application center in my city, all applications are sent to different city for processing. I am planning to book an appointment for Monday and travel to that city to get it done.  Questions:   How to document the case of irregular payments? What type of documents should I get from the company? What do I need to ensure in the application considering refusal? What is the general timeline for priority visa? I know official site says 5 days, but I guess it decided earlier Is it worth trying again considering travel date is hardly a week away?

The UK Visas and Immigration Directorate publishes  that provides helpful tips that can result in successful visa applications. Section 2 of this guidance opens is entitled "other documents you may want to provide" (emphasis mine).  Section 2: other documents you may want to provide – all visitors This section provides guidance on the types of documents that you may want to provide to help us consider your application against the Immigration Rules. Previous travel documents/passports, which show previous travel. Financial documents showing that you have sufficient funds available.  These must clearly show that you have access to the funds, such as:  bank statements building society book proof of earnings such as a letter from employer confirming employment details (start date of employment, salary, role, company contact details) where a third party (who is either in the UK or will be legally in the UK at the time of your visit) is providing financial support to you e.g. a business, a friend or a relative, documents to show that they have sufficient resources to support you in addition to themselves and any dependant family should be provided   The first item is "bank statements" and this ties in with the , which says...  evidence that you can support yourself during your trip, eg bank statements or payslips from the last 6 months  (Note 'eg' is a Latin abbreviation meaning "for example"; this appears to be optional rather than a fixed requirement.) Question: How should someone interpret this such that the chances of success are maximized? How many statements should I submit? What are they looking for and what do my bank statements tell about me?


how to define electric charge ? How to explain this term ? As learned by me  electric charge is an intrinsic property of atoms like mass of different atoms.

Is there a definition of  and proper explanation of it?  It is said "Electric charge is the physical property of matter that causes it to experience a force when close to other electrically charged matter."  How is it though that matter can get charged?  Defining charge as the property of feeling a force with other charged matter seems circular.  What is charge?  Is there a non-circular definition / explanation?


I have a pop up which contains an ASP.NET form, click the link "Request Information" and the form appears.  However, the pages that have the link "Request Information" to trigger the pop up have a lot of content therefore scrolling is required to see the link.   I need to have the div always centered if a user scrolls to read the content, otherwise if they don't scroll the pop up still appears centered on screen.  The div is positioned absolutely, the whole page width is 960px with margin set to 0 auto.

Best way to center a <div> element on a page both vertically and horizontally?  I know that margin-left: auto; margin-right: auto; will center on the horizontal, but what is the best way to do it vertically, too?


I think about buying a new mountainbike when sale is starting.    Now my Problem is that my favorite mountainbike has only 2 chainrings with 36/26 teeth. I am used to ride with 3 chainrings and don't know if it's too hard for me to ride or if it feels like "some gears are missing" if there is one chainring less. I am just a hobby cyclist, I love to do some tours an evening rides, but just for fun.    Maybe someone can explain advantages and disadvantages of 2 vs 3 chainrings.

I'm bike shopping for my first road bike, and I've asked for a lot of advice from my father who was a serious cyclist once upon a time.  After showing him one prospective bike, he dismissed it with a simple "you don't want a triple" with zero explanation on why.  What are the pros and cons in having a Triple, vs having a Double crankset?  Does it differ from road bikes, to mountain bikes?


So, I have the xml file with structure:  <?xml version="1.0" encoding="utf-8"?> <Students>   <Student Id="0">     <FirstName>Robert</FirstName>     <Last>Jarman</Last>     <Age>21</Age>     <Gender>0</Gender>   </Student>   <Student Id="1">     <FirstName>Leona</FirstName>     <Last>Menders</Last>     <Age>20</Age>     <Gender>1</Gender>   </Student> <Students>   What is the best way to read(one or several elements), write, delete and update records inside a document?

Is there a simple method of parsing XML files in C#? If so, what?


Where is Stack Overflow hosted?  Is it in its own structure, or is it in some other data center?

What tools and technologies are used to build the Stack Exchange Network?  See also:


int idx5 = frm.tabControl1.TabPages.IndexOf(frm.tabPage7);             frm.tabControl1.TabPages.RemoveAt(idx5);              int idx6 = frm.tabControl1.TabPages.IndexOf(frm.tabPage8);             frm.tabControl1.TabPages.RemoveAt(idx6);         I have to remove 6 tabs but it says Index out of range. Remove tabs using indexes.

How to hide TabPage from TabControl in WinForms 2.0?


Every time I plug in a USB device or SD card, Nautilus brings up a new window at that path. I know that there used to be a configuration option to determine whether or not you want this to happen, but I can’t find it any more. So where can I deactivate this? I only want the device to be mounted, not brought up front.

Every time I plug a USB stick in, nautilus opens a new window with the contents of the drive. I would like to disable this auto-opening of the nautilus window, but I would like the actual auto-mount to keep working. Is this possible?


Two circles intersect at two points maximum when we want to draw intersecting circles. But there we are solving quadratic equations, what is the argument about the other two missing points?

Could you tell what are all the four points in following? Two circles intersect at two points maximum when we want to draw intersecting circles. But there we are solving quadratic equations, what is the argument about the other two missing points ?


Ok i've spent my whole afternoon trying to get this running:   Setup a freshly installed Drupal 8 Activate the WebServices (HAL, HTTP Basic Auth, Restful Webservices, Serialization) Install REST UI Module Activate the REST Module for e.g. /user/{user} under Configuration -> Web-Services -> REST (i'm activating GET/POST with json and basic_auth) Fix the permissions so all "authenticated user" can access the Restful Webservices for User content   I basically followed this tutorial to get there:   Then i go forward and create a POST call looking like this:  GET http://{my-host}/user/testing  // with following headers obj {   'Authorization': 'Basic dGVzdGluZzptYXN0ZXI=',   'Content-Type': 'application/json' }   Well, the user "testing" really exists, i've checked this like 100 times. The Basic Authorization user i'm giving him (i obfuscated the data here since it is still plain text base64) - believe me, it is a correct credential too, even from the admin user.  The path is correct too with /user/{user} - but he is always returning a 404 Not Found ...? Why?  Well what i try to achieve is a login trough a REST API call - so i can login with an existing drupal user from an external system (auth0). As far is i understood from the docs this should all be possible with the /user/{user} endpoint - but i'm totally unsure because i couldn't find any working examples for it.

Do anyone have a working REST Login on Drupal 8? This is what I tried. POST /user/login HTTP/1.1 Host: 8.d8.local Content-Type: application/x-www-form-urlencoded Accept-Encoding: http://nikhilmohan.in Cache-Control: no-cache  name=test&pass=password&form_id=user_login_form  It returns me HTML instead of JSON.


Prove or disprove $\frac{1}{5}(3-4i)$ is a root of unity.  Here is the definition of root of unity:  An nth root of unity, where $n$ is a positive integer $(i.e. n = 1, 2, 3, …)$, is a number $z$ satisfying the equation $z^n=1$.

$\frac35+i\frac45$ is not a root of unity though its absolute value is $1$.   Suppose I don't have a calculator to calculate out its argument then how do I prove it?  Is there any approach from abstract algebra or can it be done simply using complex numbers?  Any help will be truly appreciated.


I bought a used iPhone 4, got the carrier to unlock to use, but I still can't use because I don't have the previous owner's Apple ID or password. Is there any way to unlock to use?

I bought a used iPhone 4.  The previous owner re-set the phone, but did not remove the device from their iCloud.  It is asking me for their iCloud information when I try to set-up the phone.  I don't have contact with the previous owner anymore.  Is there a way to remove the device from their iCloud so I can use a new one?


I  have Syrian passport with USA visa. I will travel from USA to Lebanon but I have one stop in Frankfurt. I want to ask if I need visa to stay in the airport in Frankfurt until I have my next flight.

I am flying from Mumbiai to Montego Bay via Dubai and Frankfurt as my final destination. Do i require airport transit visa at Frankfurt. i will be having invitation letter from husband and  even visa from Montego Bay.


How can I log all commands executed on Linux, including their command-line arguments (parameters)?  So, for example, if someone runs:  rm -rf /tmp/foo   I would see a log entry similar to this:  2016-01-01 18:00:00 user=bob command='rm -rf /tmp/foo'   And not just this:  2016-01-01 18:00:00 user=bob command='rm'   I have only been able to find uses of auditd which don't log command-line arguments (parameters). Is there a way to properly configure auditd to record this? It looks like FreeBSD has a , but this doesn't seem to be present in Debian derivatives.

It is company policy for admins to login to the servers via a personal username, and then run sudo -i to become root.  Upon running sudo -i, sudo will create an environmental variable called SUDO_USER, which contains the original user's username.  Is there a way to log ALL commands within syslog with something akin to the following syntax:  ${TIME/DATE STAMP}: [${REAL_USER}|${SUDO_USER}]: ${CMD}   An example entry would be:  Sat Jan 19 22:28:46 CST 2013: [root|ksoviero]: yum install random-pkg   Obviously it doesn't have to be exactly the above syntax, it just has to include a minimum of the real user (eg. root), the sudo user (eg. ksoviero), and the full command that was run (eg. yum install random-pkg).  I've already tried snoopy, but it did not include the SUDO_USER variable.


I had a question about the requirements for winning the bronze tag badge:     You must have a total score of 100 in at least 20 non-community wiki answers to achieve this badge.   Does this mean I can take at least 20 or more answers to eventually get a 100 total answer score?  Or do I need to get the total 100 answer score in a certain finite amount of answers.

Formerly List of all badges with full descriptions.  What are badge name's requirements? Why didn't I get badge name ? Which badges can I earn multiple times?    Jump to:                    Note: Some badges are awarded based on score. The term score means the total number of upvotes minus the total number of downvotes.  Any badge with a *** next to it is one of 20 badges that count towards the  displayed on a moderator candidate in an election. The candidate score is a total of 40 points: the first 20 are awarded based on the user's rep divided by 1000 and rounded down; the second 20 represents the total number of unique badges earned of the 20 that count. Note that if the same badge is earned multiple times, it will only count once towards the candidate score.  Any badge with a "(retired)" next to it is no longer awarded, but is retained by users who previously earned them. See  for more info on what it means for a badge to be retired.       Visit the  of the  on any site to see a complete list of badges that you can filter by earned, unearned, or type.


I have read that under ESTA europeans can be in the USA for up to 90 days, and we need to have a return flight to prove our way out before the time ends. I've read that if I travel to Mexico, Canada or Caribbean Islands, the ESTA period is still counting and I need to have a visa for one of those countries if I decide to stay longer. Based on this , I'm not sure if having a flight to a Caribbean Island will count as leaving the USA, and therefore do I need a flight to leave the Caribbean Islands too?

According to numerous online reports (e.g. ), a VWP national who enters the US by air solely in transit to Canada or Mexico, and then spends over 90 days in Canada/Mexico, unless a resident of Canada/Mexico, will be in violation of the VWP, refused re-entry to the US and barred from future travel under the VWP. Is this really correct? It would imply a VWP national wishing to spend e.g. 4 months in Mexico would need a tourist/transit visa for the US if both the trip to and from Mexico takes place with a flight connection in the US. This would frankly be ridiculous. My understanding is instead that stays in Canada/Mexico do not count towards the VWP admission duration on an automatic, strictly binding basis (as the reports suggest); rather, if the stay in Canada/Mexico is sufficiently short that it can reasonably be considered a mere side trip from the US, the CBP is likely not to grant a new 90-day admission period, but only the remainder of the original 90 days.


i need the decimal places output to be like this: 1000.00 -> 1000 1000.10 -> 1000.10 remove trailing zero if decimal places is both zero, but keep two decimal places if there is at least one value.  I tried DecimalFormat(".##"), but its not what im looking for: 1000 1000.1 (need to keep two decimal places 1000.10)

What I would like is a method to convert a double to a string which rounds using the half-up method - i.e. if the decimal to be rounded is 5, it always rounds up to the next number. This is the standard method of rounding most people expect in most situations.  I also would like only significant digits to be displayed - i.e. there should not be any trailing zeroes.  I know one method of doing this is to use the String.format method:  String.format("%.5g%n", 0.912385);   returns:  0.91239   which is great, however it always displays numbers with 5 decimal places even if they are not significant:   String.format("%.5g%n", 0.912300);   returns:  0.91230   Another method is to use the DecimalFormatter:  DecimalFormat df = new DecimalFormat("#.#####"); df.format(0.912385);   returns:  0.91238   However as you can see this uses half-even rounding. That is it will round down if the previous digit is even. What I'd like is this:  0.912385 -> 0.91239 0.912300 -> 0.9123   What is the best way to achieve this in Java?


I went through the following  on oracle official site regarding performance tuning, which states "Assigning null to unused variable ease garbage collector to reclaim the memory"  Do I need to adopt the following code practice?  Student student = new Student(100L, "Brian Lara", "II", "B"); public String getSomeValue() {     String val = "";     try {         // Perform some action to get value using student ref. variable         // val = some val, using student      }     finally {         this.student = null;     }     return val; }    There are 3 possibilities (or may be more) for the instance variable:    Global static instance variable Global non static instance variable Local non static instance variable    Please suggest the correct way for the better coding practice.

Does assigning an unused object reference to null in Java improve the garbage collection process in any measurable way?  My experience with Java (and C#) has taught me that is often counter intuitive to try and outsmart the virtual machine or JIT compiler, but I've seen co-workers use this method and I am curious if this is a good practice to pick up or one of those voodoo programming superstitions?


Suppose $0<a_1<a_2<\cdots <a_n$,$\lambda_1<\lambda_2<\cdots<\lambda_n$and \begin{align*} A=\left({a_i}^{\lambda_j}\right)= \begin{pmatrix} {a_1}^{\lambda_1}&{a_1}^{\lambda_2}&\ldots &{a_1}^{\lambda_n}\\ {a_2}^{\lambda_1}&{a_2}^{\lambda_2}&\ldots &{a_2}^{\lambda_n}\\ \vdots &\vdots&\ldots&\vdots\\ {a_n}^{\lambda_1}&{a_n}^{\lambda_2}&\ldots &{a_n}^{\lambda_n} \end{pmatrix} \end{align*}  Prove that the determinant of A is greater than zero,$\mathrm{i,e.}$ $\det A>0$.  It is easy to check that the assertion is true when $n=2$,for when $n=2$, \begin{align*} \det A&=\begin{vmatrix} {a_1}^{\lambda_1}&{a_1}^{\lambda_2}\\ {a_2}^{\lambda_1}&{a_2}^{\lambda_2} \end{vmatrix} ={a_1}^{\lambda_1}{a_2}^{\lambda_2}-{a_1}^{\lambda_2}{a_2}^{\lambda_1}\\ &=\exp\{\lambda_1\ln a_1+\lambda_2 \ln a_2\}-\exp\{\lambda_2\ln a_1+\lambda_1 \ln a_2\} \end{align*} Since $(\lambda_1\ln a_1+\lambda_2 \ln a_2)-(\lambda_2\ln a_1+\lambda_1 \ln a_2)=(\lambda_2-\lambda_1) (\ln a_2-\ln a_1)>0$,then the case for $n=2$holds.While about the general case for $n>2$,I have no idea. Can anyone help me?It's a homework.

I'm stuck to prove the following exercise : Given real numbers $x_1,\ldots,x_n$ and $y_1,\ldots,y_n$, show that  $$ \det(e^{\large{x_iy_j}})_{i,j=1}^n>0 $$ provided that $x_1<\cdots<x_n$ and $y_1<\cdots<y_n$.   Any idea ?


If a moderator has deleted a post, users are not able to cast undelete votes on it. They will receive the following error:    However, if a post was deleted by someone who is no longer a moderator, users with more than 20k+ reputation can cast undelete votes on it. For example, , deleted by a former Science Fiction and Fantasy moderator:     Is this a feature or a bug?

If you vote to undelete a post that was deleted by a moderator, you will get the message  A moderator has deleted this post and it cannot be undeleted  Interestingly, this extends to posts that a user voted to delete prior to becoming a moderator. For example here's a question that is in that state.  The reverse can also happen. Once a user is no longer a moderator, posts that the moderator bindingly deleted become available to be undeleted. For example, I just voted to undelete this answer and it worked fine


I am new to Ubuntu, have v. 14.04. I look on installed apps page and see user apps installed but find no way to access them, and no way to place an app link in the launcher, why is this? People would get more use out of Ubuntu if there were an apps page showing all installed programs. Second it is difficult to find where the program is loaded, as in Windows they have a program directory.

How can I add new programs to the launcher (or the dock in Ubuntu 17.10 and later) in Ubuntu?


I'm trying to reclassify rasters based on standard deviation. I created this code, but I think I'm wrong using "Con". I would like to assign value 1 to rasters >= to threshold and rasters <= to threshold1 and assign NODATA to the remaining.  This is my code:      import arcpy     ws2 = r"C:\unsupervised_classification\output\raster_tagliati_su_flowacc"     v_name_sc_img = r"C:\unsupervised_classification\output\outliers\{0}_out1.img"     v_name1_sc_img = r"C:\unsupervised_classification\output\outliers\{0}_out2.img"     arcpy.env.workspace = ws2     ras_names = arcpy.ListRasters()     for ras_name in ras_names:         name, ext = os.path.splitext(ras_name)         ras = arcpy.Raster(os.path.join(ws2, ras_name))         mean =float(arcpy.GetRasterProperties_management(ras, "MEAN").getOutput(0).replace(',','.'))         STD=float(arcpy.GetRasterProperties_management(ras, "STD").getOutput(0).replace(',','.'))         threshold_sup=mean + 3* STD         threshold_inf= mean - 3* STD         expression="Con(" + ras + "=>" + str(threshold_sup) + ",1,setnull([ras])"         a= arcpy.gp.RasterCalculator_sa(expression, v_name_sc_img)         expression1="Con(" + ras + "<=" + str(threshold_inf) + ",1,setnull([ras])"         b= arcpy.gp.RasterCalculator_sa(expression1, v_name1_sc_img)         a.save(v_name_sc_img.format(name))         b.save(v_name1_sc_img.format(name))   Arcpy give me this error:         RuntimeError: ERROR 000732: Input Raster: Dataset Con( does not exist or is not supported

I am getting a not executed error for a raster calculator.   Here is part of the output:     File "C:\projectTemp\FloodAnalysis\floodxsectionanalysis.py", line   107, in makeSeemless            arcpy.gp.RasterCalculator_sa(Con(IsNull(rasterIn), FocalStatistics(rasterIn,NbrRectangle(3, 3), "MEAN"), rasterIn),   "{0}yrSeemless.img".format(increment))   File "C:\Program Files   (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\geoprocessing_base.py", line   498, in        return lambda *args: val(*gp_fixargs(args, True)) arcgisscripting.ExecuteError: ERROR 000539: Parsing error SyntaxError:   invalid syntax (line 5) Failed to execute (RasterCalculator).   This code I have setup to put into this calculator is:  def makeSeemless(outputPath, increment, rasterIn):     arcpy.gp.RasterCalculator_sa(Con(IsNull(rasterIn), FocalStatistics(rasterIn,NbrRectangle(3, 3), "MEAN"), rasterIn), "{0}yrSeemless.img".format(increment))


Find an example for a ring $R$ and ideals $I_1,...,I_n,J$ s.t $J\subseteq\bigcup_{i=1}^{n}I_i$ and $J\not\subseteq I_i$ for every $1\leq i\leq n$.  I tried looking at some familiar rings like $\Bbb{Z}, \Bbb{Z[X]}, \Bbb{Z_n}\times\Bbb{Z_n}, \Bbb{Z_n}$ but none of them gave me an example. I know three things: $1.$ n must be larger than $2$. $2.$ There must be more than two ideals that are not prime. $3.$ My ideal can not contain a copy of an infinite field. Any hint would be helpful  - I should I come up with an example? Is there other ways to know that it won't work?

Let $A$ be a commutative ring with $1$. Let $I$ and $J_k$, $k=1,\dots,n$ be ideals of $A$ with $I\subseteq \cup _{k=1}^n J_k$. Then I have obtained the following:  (1) If $J_k$, $k=1,\dots,n$, are prime ideals, then there exists some $j$ such that $I\subseteq J_j$.   (2) If $A$ is a principal ideal ring, then there exists some $j$ such that $I\subseteq J_j$.   I want some counterexamples that for all $k=1,\dots,n$, $I$ is not contained in $J_k$. How to get the counterexamples?


So I'm looking for a linear algebra book with a strong focus on proofs. It would be great if the book also uses concepts from regular abstract algebra like isomorphisms etc instead of dancing around it.  Note that a book of problems/solutions would also suffice and indeed possibly be more helpful.   Could someone suggest something?  EDIT : To be clear, This isnt exactly a duplicate question. I've already taken abstract algebra and I'm looking for a book which uses those concepts. Most of these links are for people who've never taken abstract algebra and want to start off with linear algebra

I plan to self-study linear algebra this summer. I am sorta already familiar with vectors, vector spaces and subspaces and I am really interested in everything about matrices (diagonalization, ...), linear maps and their matrix representation and eigenvectors and eigenvalues. I am looking for a book that handles every of the aforementioned topics in details. I also want to build a solid basis of the mathematical way of thinking to get ready to an exciting abstract algebra next semester, so my main aim is to work on proofs for somehow hard problems. I got Lang's "Intro. to Linear Algebra" and it is too easy, superficial.  Can you advise me a good book for all of the above? Please take into consideration that it is for self-study, so that it' gotta work on its own. Thanks.


I know that the cyclic group it contains at least one element that generates the group itself

I calculated the subgroups of $\mathbb Z / 2 \mathbb Z \times \mathbb Z / 2 \mathbb Z$ as $\{ (0, 0 ) \}, \{ (0, 0 ), ( 1, 0 ) \}, \{ (0, 0 ), (0, 1) \}, \{ (0, 0 ), (1, 1) \}$ and $ \mathbb Z / 2 \mathbb Z \times \mathbb Z / 2 \mathbb Z$ and itself. I  a bit and found couple of answers which did not include $\{ (0, 0), (1, 1)\}$. Isn't $\{ (0,0), (1,1)\}$ subgroup of  $\mathbb Z / 2 \mathbb Z \times \mathbb Z / 2 \mathbb Z$ ?


The two classes are in the same package(Vehicle and Use). public class Vehicle {         protected int speed;         int name;         int seats; }  public class Use {     public static void main(String[] args)     {         Vehicle v = new Vehicle();         v.speed = 150;                      // No Error         System.out.println(v.speed);     } }  But, In a different package, even after making speed protected, I am unable to use it public class Use2 extends Vehicle {     public static void main(String[] args)     {         Vehicle v = new Vehicle();         v.speed = 150; //error     } }

In Java, are there clear rules on when to use each of access modifiers, namely the default (package private), public, protected and private, while making class and interface and dealing with inheritance?


I am reading about a problem that states the following:  Suppose you have a balance and are allowed to choose the weights for its functionality. The objective is to pick the weights in a way that maximizes the number of items we can check by the scale.   Given $n$ weights all of which are different how many different ways are there to arrange them on the scales of the balance? Assuming that the two sides of the balance are indistinguishable what conclusion can we make about the max range of items that we can use the scale to weigh?  The solution logic goes as follows:  Each weight can be placed on the left scale, the right scale or on the table. These are 3 options so for $n$ weights we have $3^n$ configurations of the balance.   One of these is symmetric between left and right scale (when no weights are on the scales). The rest are asymmetric between the left and right scale. Which means the same configuration is counted twice.  So far it is clear. So we would have for e.g. ${1gram, 2gram}$: Left, Right, Table   -    -      (1,2) (--)   1    -      (2)     -    1      (2)  (*)     2    -      (1)     -    2      (1)  (*)   1    2      (-)     2    1      (-)  (*)   1,2  -      (-)     -    1,2    (-)  (*)   So we would have all the marked with $*$ as duplicates and the $--$ i.e. all on the table as the symmetric one we exclude since no weights are on the scales. But then it states:  The total number of different configurations is $\frac{3^n - 1}2 + 1$  Where is the $+1$ coming from? Going over an example for e.g. $n = 2$ for example $1gram, 3gram$ We can measure items of ${1gram, 2gram, 3gram, 4gram}$ which is a total of $\frac{3^2 - 1}2 =4$ and not $5$ as the solution claims. Am I misunderstanding something here?

You have $n+1$ weights, with each weighing $1,3,9, \dots, 3^n$  (one of each)  Prove that you can weigh with a traditional scale ( The one with two bowls) each integer weight between  $$1 ~~~~~\text{And }~~~~~\frac{3^{n+1} -1}{2}$$     My go: This was very confusing to me because I did not understand well how you can possibly weigh, let's say $4$ (Maybe it's just putting $1+3$ ?)    I tried proving using induction:     If $n=0$ then we have $1$ weight weighing 1, and so we can weigh $\frac{3^1 -1}{2} ~~~ \text{And} ~~~ 1 = 1$  which is obvious.   Assume you have $n+1$ weights and you can weigh each integer between $1$ and $\frac{3^{k+1} -1}{2}$  Now we prove for $n = k+1$ so: $1$ to $\frac{3^{k+2}-1}{2}$ using the fact we can weigh $\frac{3^{k+1} -1}{2}$ However I am stuck from here, I am clueless on how to use the fact we now have a weight of $1,3,9,\dots,3^k,3^{k+1}$      This seems like a known question, but I could not find anything on the web! Thank you!


Is the following code still needed...   To allow showidx to work with hyperref' forbook,article` document classes? To allow the emulation of showidx in the memoir document class to work with hyperref? In fact, does it actually do anything with memoir, or only with the free-standing showidx?     %Begin the ``quick and dirty hack'' due to Heiko Oberdiek which loads showidx \makeatletter \ifHy@hyperindex   \def\HyInd@ParenLeft{(}% % Hook in \HyInd@@wrindex   \let\HyInd@showidx\@empty % Hook in \HyInd@@wrindex for package showidx   \def\HyInd@showidx#1{%     \@showidx{#1}%     \if@nobreak       \ifvmode         \nobrak       \fi     \fi   }% % Load package showidx   \let\siOrg@makeindex\makeindex   \let\siOrg@@index\@index   \let\siOrg@@wrindex\@wrindex   \let\siOrg@index\index   \RequirePackage{showidx}   \let\makeindex\siOrg@makeindex   \let\@index\siOrg@@index   \let\@wrindex\siOrg@@wrindex   \let\index\siOrg@index % rest of hyperref part   \@ifpackageloaded{multind}{%     \let\HyInd@org@wrindex\@wrindex     \def\@wrindex#1#2{\HyInd@@wrindex{#1}#2||\\}%     \def\HyInd@@wrindex#1#2|#3|#4\\{%       \ifx\\#3\\%         \HyInd@org@wrindex{#1}{#2|hyperpage}%       \else         \def\Hy@temp@A{#3}%         \ifx\Hy@temp@A\HyInd@ParenLeft           HyInd@org@wrindex{#1}{#2|#3hyperpage}%         \else           \HyInd@org@wrindex{#1}{#2|#3}%         \fi       \fi     }%   }{%     \def\@wrindex#1{\@@wrindex#1||\\}     \def\@@wrindex#1|#2|#3\\{%       \ifx\\#2\\%         \protected@write\@indexfile{}{%           \string\indexentry{#1|hyperpage}{\thepage}%         }%       \else         \def\Hy@temp@A{#2}%         \ifx\Hy@temp@A\HyInd@ParenLeft           \protected@write\@indexfile{}{%              \string\indexentry{#1|#2hyperpage}{\thepage}%           }%         \else           \protected@write\@indexfile{}{%             \string\indexentry{#1|#2}{\thepage}%           }%         \fi       \fi       \endgroup       \HyInd@showidx{#1}%       \@esphack     }%   }% \fi \makeatother % %End the ``quick and dirty hack'' due to Heiko Oberdiek which loads showidx    As noted in , that code appears in examples in a number of posts.

In my document's preamble I have the following code related to showidx and hyperref, which also appears in many posts on this forum.   What is its purpose?  %Begin the ``quick and dirty hack'' due to Heiko Oberdiek which loads showidx \makeatletter \ifHy@hyperindex   \def\HyInd@ParenLeft{(}% % Hook in \HyInd@@wrindex   \let\HyInd@showidx\@empty % Hook in \HyInd@@wrindex for package showidx   \def\HyInd@showidx#1{%     \@showidx{#1}%     \if@nobreak       \ifvmode         \nobrak       \fi     \fi   }% % Load package showidx   \let\siOrg@makeindex\makeindex   \let\siOrg@@index\@index   \let\siOrg@@wrindex\@wrindex   \let\siOrg@index\index   \RequirePackage{showidx}   \let\makeindex\siOrg@makeindex   \let\@index\siOrg@@index   \let\@wrindex\siOrg@@wrindex   \let\index\siOrg@index % rest of hyperref part   \@ifpackageloaded{multind}{%     \let\HyInd@org@wrindex\@wrindex     \def\@wrindex#1#2{\HyInd@@wrindex{#1}#2||\\}%     \def\HyInd@@wrindex#1#2|#3|#4\\{%       \ifx\\#3\\%         \HyInd@org@wrindex{#1}{#2|hyperpage}%       \else         \def\Hy@temp@A{#3}%         \ifx\Hy@temp@A\HyInd@ParenLeft           HyInd@org@wrindex{#1}{#2|#3hyperpage}%         \else           \HyInd@org@wrindex{#1}{#2|#3}%         \fi       \fi     }%   }{%     \def\@wrindex#1{\@@wrindex#1||\\}     \def\@@wrindex#1|#2|#3\\{%       \ifx\\#2\\%         \protected@write\@indexfile{}{%           \string\indexentry{#1|hyperpage}{\thepage}%         }%       \else         \def\Hy@temp@A{#2}%         \ifx\Hy@temp@A\HyInd@ParenLeft           \protected@write\@indexfile{}{%              \string\indexentry{#1|#2hyperpage}{\thepage}%           }%         \else           \protected@write\@indexfile{}{%             \string\indexentry{#1|#2}{\thepage}%           }%         \fi       \fi       \endgroup       \HyInd@showidx{#1}%       \@esphack     }%   }% \fi \makeatother % %End the ``quick and dirty hack'' due to Heiko Oberdiek which loads showidx    Among posts where this appears are: , , , , .