It is known that $N$ is a perfect square if and only if $N$ is a quadratic residue for every prime $p$.  This gives a good probabilistic algorithm for testing if a randomly chosen positive integer is a perfect square - simply compute it's Legendre Symbol for a sufficiently large set of randomly chosen primes.  A single result of $-1$ definitively tells you that $N$ is not a perfect square, while repeated results of only $+1$ or $0$ increase the probability that $N$ is a perfect square.  This probabilistic test could be much quicker with lower probability of a false positive if we could check only primes less than the integer $N$.  The proofs I've seen that $N$ is a perfect square IFF $N$ is a QR mod p for all primes $p$ cannot be used to prove the result using only the finitely many primes less than $N$.    Has anyone seen or know of a proof of this more specific result, or alternatively, know of a counter-example?  I've burned more than a few CPU cycles on Mathematica looking for a counterexample and have not found one yet.

The following question popped up during a conversation with a friend of mine: is there any integer $n$ such that $n$ is not a square in $\mathbb{Z}$ but it is a square in every field $\mathbb{Z}_p$ with $p>n$?  It sounds like an elementary question, and I am almost sure that the answer is no (mostly because of some distant memories of mine about a theorem of Hasse and Minkowsky), but I was not able to find a definitive answer.    I tried to apply some Model Theory to it, but I don't think it can be a fruitful path to follow. Another thing I noticed is that if I can prove that there is an $a$ such that $n=a^2$ in two different fields $\mathbb{Z}_p$ and $\mathbb{Z}_q$, then the the statement must be false: otherwise, writing $$a^2=n+bp$$ and $$a^2=n+cq$$ for the smallest possible $b$ and $c$, we would have $bp=cq$, a contradiction since neither $b$ nor $c$ can be $0$. But again, I got stuck after this consideration. Do you have any ideas or suggestions?


I'm trying to make a variation on the sticky-piston hidden door, in which two sticky pistons are activated by a pressure plate in a corridor to reveal either a hidden room, or a treasure chest, or trap, or anything else.  Stepping on the pressure plate would turn off the circuit so that one sticky piston pulls a block up into the ceiling, and the other pulls a block down into the floor. The resultant opening is one block wide by two blocks high.  The problem is I don't know how to wire the redstone vertically. A basic sticky-piston door is easy, as long as the blocks slide left or right but are harder to hide, which is why I want up-down activation. I just can't figure out the signal transmission.  I got half of it working - the down part - after I first posted this. It's getting the current to run up that is giving me trouble. I tried mirror-inverting my system for down to up and it didn't working  I have shredded Google trying to find a tutorial for vertical piston doors, but have failed to find anything. Can somebody give me a step-by-step or the link to a video tutorial in which this has already been done?  Thanks!

I'm making a door with piston sliding sideways that reacts to pressure plates. As the pressure plates are sending the current to redstone at a very low level, I need to raise it somehow, and this leads to awkward stairs of redstone.    So I'm wondering whether there are better ways of sending the redstone current up, maybe even vertically.


I'm trying to convert uploaded images to png in order to strip out any unwanted malicious content before saving them on amazon s3. I don't want to create any new files on my server, just to send the newly created png file.  Currently my code looks like this ($photos is is an array made from $_FILES['photo'] which could contain multiple photos. $x is stepping through them):  $result = $client->putObject(array(     'Bucket'     => $bucket,     'Key'        => $file_name,     'SourceFile' => $photos["tmp_name"][$x]      ));   I'd like to do something first like this:  $newPNG = becomePNGfile($photos["tmp_name"][$x]);   then replace the last line with something like   'SourceFile' => $newPNG  //possibly should be 'Body' not 'SourceFile' here?   I have found lots of ways to do this by making a new file using Imagick and GD but can't find a way to do the conversion and hand or stream the data straight to s3. Is this possible?

Here's my situation - I want to create a resized jpeg image from a user uploaded image, and then send it to S3 for storage, but am looking to avoid writing the resized jpeg to the disk and then reloading it for the S3 request.  Is there a way to do this completely in memory, with the image data JPEG formatted, saved in a variable?


I'm using \usepackage[title,titletoc]{appendix} and putting my appendices in the appendices environment. I'm trying to remove the appendix page numbers from the TOC.  I've looked at the documentation for the appendix packaged and tried using \noappendicestocpagenum without success.  \documentclass{article} \usepackage[title,titletoc]{appendix} \usepackage{lipsum}  \begin{document}      \tableofcontents     \clearpage     \section{first}     \section{second}     \pagebreak     \begin{appendices}          \section{additional material}         \setcounter{page}{1}         \renewcommand{\thepage}{\thesection -\arabic{page}}          \lipsum          \pagebreak         \section{more of it}         \setcounter{page}{1}         \renewcommand{\thepage}{\thesection -\arabic{page}}          \lipsum      \end{appendices} \end{document}     Advice on better formatting of my page numbers would also be welcome.

I would very much like that the the appendix sections of the Table of Contents doesn't have a section numbers, dots, and page numbers. If I do the following  \documentclass{article} \usepackage{tocloft} \addtocontents{toc}{\cftpagenumbersoff{section}} \renewcommand{\cftdot}{} \begin{document} \tableofcontents \newpage \section{Appendix} \section*{Another Letter} \addcontentsline{toc}{section}{Another Letter} \end{document}   then the section "Another Letter" is left aligned, so it doesn't look like the  others.  Question  Is it possible to have "Another Letter" styled the same way as normal TOC entries, but just without section number, dots, and page number?


I am trying to create multiple buffers around point data. I need to crate buffers of 10 miles, but I cannot find a way to define this. I have tried using both the multiring buffer plugin and the multi-distance buffer plugin, but both of these are not producing the doughnut style rings, but instead just fill the map. I have limited the attribute table to the 10 ring and this still fills the table, so I can only assume the problem is with not being able to state I want miles. Is there a way to define the distances needed?

I  have had no luck getting the buffer tool to accept anything but degrees as units of measure.  I have found lots of stuff saying the layer needs to be reprojected and saved but it hasn't worked at all for me.   Is there a way I could create a buffer without using ftools or at least force the units to meters somehow?  As a workaround I converted meters to degrees (lat) and used that but the final product needs to be as close to reality as possible.  Things I've tried:   setting every unit option I could find to meters (where possible). setting everything to NAD83/Maryland (data is for Washington, DC) and saving it as such (as layers in ESRI shape files). reimporting the reprojected layers setting relevant layers to Google Mercator   The was tried followed by creating a buffer. Many were tried in combination. QGIS 1.7.3 Slackware64 current (qgis from SBo-13.37 repo, tried on multilib and plain 64it with same results)


I am trying to install kubuntu into my Arch Linux laptop. The laptop's hard disk is partitioned to 4 parts. It currently uses systemd as bootloader. I'd like to remove my system and install Kubuntu. On selecting the USB option from the boot potions I get:  In legacy BIOS option: A black screen followed directly by Kubuntu live session loading.  In UEFI option: A choce to load Kubuntu live session, install oem(for manufacturers) and inspect disk.  What do I do to install kubuntu?

I would like to see a full how-to guide on how to install Ubuntu.


I'm looking for a term -- from linguistics or semantics -- that indicates phrases of this structure have TWO (possible) senses:   Men are taller than women. Seafood costs more than hamburger. Anchors are heavier that water.   The construction is fungible, and in some cases means "tends to", and it others it means "in all cases".  The first two sentences are true IF you interpret them as meaning "tend to", or "in the mean"   The median height of men is a few inches taller than the median height of women. In most cases, seafood costs more than hamburger.   The third sentence is true in the "all" and "always" sense:   All anchors are heavier than water. Anchors are always heavier than water.   Sentences like these are common in everyday speech, where the "tends to" or "always" is implied and/or clear from context, and the subject matter is not emotionally sensitive.  So I'm looking for the term, so when I DO stumble in to a conversation where someone makes a comment like that, and someone else argues (example: "but I know plenty of women who are taller than certain men!") I can say:  "Hold it, timeout; that statement is just a SOMETHING-ism; it has two meanings, depending if you interpret in to mean 'tends to' or 'all'.  Let's figure out which the speaker intended, and then lets go from there."  (I imagine someone will point me to a refernce to "E-prime" and inform me of the dangers of the verb "to be".  OK, granted.  But what is the TERM for this ambiguity or ambiguous construction?)

The President also knows that we have to stop blaming victims for these crimes.  No one ever asks the person who got robbed at gunpoint in the street -- why were you there, what were you doing, what were you wearing?  What did you say?  Did you offend someone?  We encourage people to come forward.  We don't have to explain why someone took our money.     I think the "No one ever [...]" claim is literally false, and actually obviously so. So, I understand it to mean:          The President also knows that we have to stop blaming victims for these crimes.  No one in their right mind ever asks the person who got robbed at gunpoint in the street -- why were you there, what were you doing, what were you wearing?  What did you say?  Did you offend someone?  We encourage people to come forward.  We don't have to explain why someone took our money.      Supposing that I am right, what is this kind of rhetoric called?


public class Reverse {  public static void main(String[] args) {     String [] simpsons = {"Homer", "Flanders", "Apu"};     reverse(simpsons);     System.out.println(simpsons[0] + " " + simpsons[1] + " "             + " " + simpsons[2]);   } //End main  public static void reverse(String[] list) {     String[] temp = new String[list.length];     for (int i =0; i<list.length; i++)     {         temp[i] = list[list.length-i-1];     }     //System.arraycopy(temp, 0 , list, 0, list.length);     list = temp;; }  }       I'm just getting started in Java, and this problem confused me. As you can see, I've solved the problem with the commented out arraycopy method. I'm simply confused as to why the list = temp still returns the original, non-reversed array. I believe I understand conceptually that references are just locations in memory, but doesn't list = temp assign the passed in array to the memory location of temp, AKA the reversed array?

I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?


I accidentally changed my GRUB options to boot from memtest instead of the correct linux kernel.  Holding shift, esc, arrow keys, and every other combination will not bring up the GNU GRUB as desired.  Is there any other option besides reinstalling and starting over with a new linux version?

I installed Windows 7, which ate Ubuntu's boot file. When starting up the computer, it now goes straight to Windows, without giving me the option of booting Ubuntu.   How can I get Ubuntu back?


(In the US, just to clarify)So, from a physics perspective weight and mass are different, but when people are talking about weight in everyday(non-physics) situations ("how much do you weigh" etc.), are they actually talking about mass and it's just common to refer to it as 'weight'?  Expanding on that, when you step on a scale, i've read it displays your mass(after conversion from weight as it's displaying the "results"). Seeing as pounds is a measurement of weight, why will it use pounds as a unit of mass?  Maybe i'm getting things completely confused, any help is appreciated.

What is the difference between the weight of an object and the mass of an object?


I have a composite key which houses 3 keys.  Composite key =>  @Embeddable public class CompositeId implements Serializable{      @Column(unique = true)     private int deliveryId;     @MapsId     @OneToOne     @JoinColumn(name = "invoiceId",unique = true)     private Invoice invoiceId;     @MapsId     @ManyToOne     @JoinColumn(name = "customerId",nullable = false)     private Customer customerId; }   Delivery Class=>  @Entity public class Delivery {     @EmbeddedId     private CompositeId compositeId; }   That's how the composite ID is used. deliveryId is for delivery entity itself and other keys are for shared primary keys.  When I write a session.createQuery  Query query = session.createQuery("from Delivery where compositeId.deliveryId=?"); query.setParameter(0,1);   and when it runs, it throws an exception:     javax.persistence.PersistenceException: org.hibernate.HibernateException: More than one row with the given identifier was found: 1, for class: example.test.Delivery   So I though of overriding equals and hashcode methods  @Override     public boolean equals(Object obj) {         if (this == obj) {             return true;         }         if (obj == null) {             return false;         }         if (obj instanceof Invoice) {             Invoice invoice = (Invoice) obj;             if (invoice.getInvoiceId() == this.invoiceId.getInvoiceId()) {                 return true;             }             if (invoice.getDeliveryId() == this.invoiceId.getDeliveryId()) {                 return true;             }         }         if (obj instanceof Customer) {             Customer customer = (Customer) obj;             if (customer.getCustomerId() == this.customerId.getCustomerId()) {                 return true;             }             if (customer.getDeliveryId() == this.customerId.getDeliveryId()) {                 return true;             }         }         return false;     }   but still I get the same error. And I thought It will fix it. But it didn't. I found the reason by following SQL and the reason is this gets 2 Customer and Item objects because of bidirectional relations. So how can I solve it?  Thanks :)

What issues / pitfalls must be considered when overriding equals and hashCode?


I have looked at other questions that deal with similar problems, but it seems that this particular case is rather unique.  The code below is supposed to go through a list of Events and put them in a map if their times overlap.  // identify events that occur at the same time List<Event> remainingEvents = new LinkedList<>(); remainingEvents = Event.getAllEvents();  for (Event event1 : Event.getAllEvents()) {     for (Event event2 : remainingEvents) {          // check if it is the same event         if (event1 == event2)             continue;          // check whether they overlap         if (event1.overlapsWith(event2)) {             simultEvents.put(event1, event2);         }     }      // event1 is now exhausted     remainingEvents.remove(event1); }   Notice that I am modifying the remainingEvents list after the iteration is complete, not during. Therefore, I do  not understand why I am getting a ConccurentModificationException.   Elipse also tells me that the error occurs on this line:   for (Event event1 : Event.getAllEvents()) {   which makes no sense since I am not modifying anything relating to it.  Note that this is not a duplicate because I am not modifying the list until I am done Iterating with it (unlike other questions), and the error occurs on a line that has nothing to do with the removal

We all know you can't do the following because of ConcurrentModificationException:  for (Object i : l) {     if (condition(i)) {         l.remove(i);     } }   But this apparently works sometimes, but not always. Here's some specific code:  public static void main(String[] args) {     Collection<Integer> l = new ArrayList<>();      for (int i = 0; i < 10; ++i) {         l.add(4);         l.add(5);         l.add(6);     }      for (int i : l) {         if (i == 5) {             l.remove(i);         }     }      System.out.println(l); }   This, of course, results in:  Exception in thread "main" java.util.ConcurrentModificationException   Even though multiple threads aren't doing it. Anyway.  What's the best solution to this problem? How can I remove an item from the collection in a loop without throwing this exception?  I'm also using an arbitrary Collection here, not necessarily an ArrayList, so you can't rely on get.


I'm using winedt and would like to insert something like   \caption [blabla  [-1, 1]V] {blabla  [-1, 1]V...}    in one of the tables, but I do not know how to escape the character ].  I've tried \\] and ]] but it does not work.  Is there any one that could help me with this?

LaTeX is trying to add a missing $ that I don't want to the following code. Minimal working example:  \documentclass[letter,12pt]{article}  \newcommand{\monkeyBeans}[2][]{   \parbox{4in}{#1} }  \begin{document}  \parbox{4in}{$[a, b]$}   \monkeyBeans[$[a, b]$]{yo monkey}  \end{document}   If I try any of the following lines in my document instead of the call to monkeyBeans, there is no error:  \parbox{4in}{$[a, b]$}  \monkeyBeans[yo monkey]{$[a, b]$} \monkeyBeans[$(a, b)$]{yo monkey} \monkeyBeans{$[a, b]$}{yo monkey}   What is the deal with square brackets in optional arguments?


Suppose that $f$ and $g$ are two analytic functions on the set $\phi$ of all complex numbers with $f(\frac{1}{n})=g(\frac{1}{n})$ for $n=1,2,3,\ldots$ Then show that $f(z)=g(z)$ for each $z$ in $\phi$.   I am not able to even start proving it. Can some one please help me?

Suppose that $f$ ang $g$ are two analytic functions on the set $\Bbb C$ of all complex numbers with $f(1/n) = g(1/n)$ for $n= 1,2,3,\ldots$, then show that $f(z) = g(z)$ for all $z\in\Bbb C$.


I know that describing the trajectory of all planets in the solar system around the Earth is much more complicated than if we take the Sun as the reference point. But besides this, what is the simplest experiment that can prove that the Sun is a more "inertial" point of reference than the Earth? Do we have to look at the stars in the background or something like that?

In history we are taught that the Catholic Church was wrong, because the Sun does not move around the Earth, instead the Earth moves around the Sun.  But then in physics we learn that movement is relative, and it depends on the reference point that we choose.  Wouldn't the Sun (and the whole universe) move around the Earth if I place my reference point on Earth?  Was movement considered absolute in physics back then?


We have a multivariate normal vector ${\boldsymbol Y} \sim \mathcal{N}(\boldsymbol\mu, \Sigma)$. Consider partitioning  ${\boldsymbol Y}$ into   $${\boldsymbol Y}=\begin{bmatrix}{\boldsymbol y}_1 \\  {\boldsymbol y}_2 \end{bmatrix}$$  Say that $f_Y$ is a probability density function for $Y$. What can we say about the probability density function $f_{y_1|y_2 = a}$ of conditional multivariate distribution $(y_1|y_2 = a)$?   Does this hold? :  $$f_{y_1|y_2 = a}(y_1) \stackrel{?}{=} {f_Y([y_1,y_2 = a]) \over \int_{y_1} f_Y([y_1,y_2 = a])}$$  Intuitively, I would assume that we could use $f_Y$ in the appropriate $y_2 = a$, and then normalize it to integrate to 1... Or is there some "gotcha" that the density scales differently in the space of $y_1$? I know that it the conditional distribution could be computed with the  but this could save computational time in cases when you don't actually need a density normalized to 1, which is my case.  PS: and then, probably, $\int_{y_1} f_Y([y_1,y_2 = a]) \stackrel{?}{=} f_{y_2}(y_2 = a)$, so perhaps the normalization would also be simple?

We have a multivariate normal vector $\mathbf{X} \sim \mathcal{N}(\boldsymbol{\mu}, \boldsymbol{\Sigma})$, where $\mathbf{X} =  \left[ \begin{matrix} X_1 \\ X_2 \\ \dot\\\\ \dot\\\\ X_n \end{matrix} \right]$,    $\boldsymbol{\mu} =  \left[ \begin{matrix} \mu_1 \\ \mu_2 \\ \dot\\\\ \dot\\\\ \mu_n \end{matrix} \right]$, and  $\boldsymbol{\Sigma} =  \begin{bmatrix} \sigma_1^2 & \sigma_1\sigma_2 & \dots & \sigma_1\sigma_n   \\ \sigma_2\sigma_1 & \sigma_2^2 & \dots & \sigma_2\sigma_n  \\ \dot\\\\ \dot\\\\ \sigma_n\sigma_1 & \sigma_n\sigma_2  & \dots & \sigma_n^2 \end{bmatrix} $ is the covariance matrix.  Y is a random scalar of the form $Y = \beta_0 + \boldsymbol{\beta^TX} + \epsilon$, where $\epsilon \sim \mathcal{N}(0, \sigma_\epsilon^2)$  How can we go about deriving the joint probability density function(pdf) of the random vector $(Y, \boldsymbol{X^T})$?  The marginal multivariate pdf of $\boldsymbol{X}$ is given by  $ pdf(\boldsymbol{x}) = \frac{1}{\sqrt{(2\pi})^n. \begin{vmatrix} \boldsymbol{\Sigma} \end{vmatrix}}.exp\left[ \frac{-1}{2}\boldsymbol{(x-\mu)}^T \boldsymbol{\Sigma^{-1}}\boldsymbol{(x-\mu)} \right]$  The conditional probability density function of $Y \,\mid \, \boldsymbol{X=x}$ is given by  $pdf(y\mid \boldsymbol{X=x}) = \frac{1}{2\pi\sigma_\epsilon}.exp\left[  \frac{-1}{2\sigma_\epsilon^2}(y - \beta_0 - \boldsymbol{\beta^Tx})^2  \right]   $  To compute the joint probability density function, we can use the fact that   $pdf(y, \boldsymbol{x})=  pdf(y\mid \boldsymbol{X=x}).pdf(\boldsymbol{x})$  I am unable to do the witty manipulation required in the algebra to arrive at the result the joint distribution will have a probability density function of a normal distribution. All questions previously asked seem to address the problem of deriving the conditional density function given the joint probability density function, for example,   Edit:  Multiplying the pdfs, we get $pdf(y, \boldsymbol{x}) = \frac{1}{\sqrt{(2\pi})^n. \begin{vmatrix} \boldsymbol{\Sigma} \end{vmatrix}}. \frac{1}{2\pi\sigma_\epsilon}.exp\left[ \frac{-1}{2}\boldsymbol{(x-\mu)}^T \boldsymbol{\Sigma^{-1}}\boldsymbol{(x-\mu)} + \frac{-1}{2\sigma_\epsilon^2}(y - \beta_0 - \boldsymbol{\beta^Tx})^2 \right]$   Like the comment below mentions, most manipulations dealing with normal pdfs involve completing squares; but since this specific algebraic expression contains $\boldsymbol{x}$ in both terms within the exp term, I'm unsure on how to go about completing the squares.


I'm learning LaTeX and writing code on overleaf. This code with a skipped line does not work, it only outputs the second sentence without any formatting ... \begin{align}     This is my first sentence.\\          This is my second sentence.     \end{align}   But this code with a comment placed on the skipped line works and returns the string with math formatting ... why?  \begin{align}     This is my first sentence. \\     %     This is my second sentence. \end{align}

Possible Duplicate:          \documentclass[12pt,a4paper]{article} \usepackage[version=3]{mhchem} \usepackage{siunitx}  \begin{document} \begin{align*}  \ce{K_a} & = \frac{\ce{[H3O+][A^-]}}{\ce{[HA]}} \\  \end{align*} \end{document}   gives   Runaway argument?  \ce {K_a} & = \frac {\ce {[H3O+][A^-]}}{\ce {[HA]}} \\  ! Paragraph ended before \align* was complete. <to be read again>                     \par  l.8    ?


Which command can I use to minimize the current terminal window. i.e. this should do the same as a click on the minimize window control:

How can I minimize the Terminal window using a command? For example: I use the clear command to clear the terminal output, which command can I have to use to minimize the terminal window?


EDIT: This is NOT a duplicate of the standard templating questions.  My scenario involves a templated class and a member function of that class whith one argument that is templated, but not of the same type as the class.  Even when I put the definition in the header I still can't find the correct syntax.  Can someone help me with my specific question?    My oversimplified code:  Foo.h:  template<typename T1> class Foo { public:     template<typename T2>     static void bar(vector<T1>& a, vector<T2>& b); };   Foo.cpp:  #include <Foo.h>  template<typename T1> template<typename T2> void Foo<T1>::bar(vector<T1>& a, vector<T2>& b) {     //code logic }   Goo.cpp:  #include <Foo.h>  int main(int argc, char** argv) {     vector<int> a;     vector<double> b;     Foo<int>::bar(a, b); }     My error:  undefined reference to void Foo<int>::bar<double>(std::vector<int, std::allocator<int> >&,  std::vector<double, std::allocator<double> >&)     I couldn't find the proper way to define the templates.  I also noticed that the order of the typenames will change the error (also putting the entire function in the class declaration).  What is the correct syntax?

Quote from :     The only portable way of using templates at the moment is to implement them in header files by using inline functions.   Why is this?  (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)


What is the difference between a law and a theory?  Some seem to think that a law is a single relationship or a single equation, while a theory is an explanatory framework in which these laws come into play.  But do physicists keep this distinction intact? They say "Newton's laws of motion", right? But isn't Newton's laws an "explanatory framework"? All interaction is "explained" as forces (vectors) between matter, right?

What is a , a , and what is the relationship among them?  I know this is a very basic question, so any reference to epistemology will be greatly appreciated :)


I want to sync my files on the Google Drive cloud and use them offline for free.  I have many types of files on Google Drive.

I'd like to install a  client for Xubuntu (12.04).  I'm getting non-English Google results, and I didn't find  in the Xubuntu repositories.   Does anyone know of a client that works well for Ubuntu or it's supported derivates (or installation instructions for grive?)


Hi i'm making a function that checks if a number is a prime or not but its telling me that 9 is a prime.  def eprimo(num):     if num < 2:         return False     if num == 2:         return True     else:         for div in range(2,num):             if num % div == 0:                 return False             else:                 return True

Could someone please tell me what I'm doing wrong with this code? It is just printing 'count' anyway.  I just want a very simple prime generator (nothing fancy).   import math  def main():     count = 3     one = 1     while one == 1:         for x in range(2, int(math.sqrt(count) + 1)):             if count % x == 0:                  continue             if count % x != 0:                 print count          count += 1


Why I'm asking:  I wanted to know it there is any optimization going on at the compiler side that would make one or the other method to return preferable. Since I have read  that python does not optimize the method to run faster.  The example:  I've declared 2 methods that deliver the same value. But barA returns it via an internal field declaration.   public class Foo {     public int barA(){         int a = 1;         return a;     }      public int barB(){         return 1;     } }   The tests:  public class TestFoo {     Foo foo = new Foo();     Method methodA = foo.getClass().getMethod("barA");     Method methodB = foo.getClass().getMethod("barB");       public TestFoo() throws NoSuchMethodException {     }       @Test     public void methodA() throws Exception {         assertTrue(Integer.TYPE.equals(methodA.getReturnType()));     }      @Test     public void methodB() throws Exception {         assertTrue(Integer.TYPE.equals(methodB.getReturnType()));     }     @Test     public void equalsSame() throws Exception{         assertEquals(foo.barA(), foo.barB());     } }   The results:  The tests showed that I'm in fact dealing with the same value and return type in both methods.  Disclaimer: This picture is not meant to highlight the stop watch, junit runs for each method, as it's in no way linked to the compiler optimization I'm asking about.    The question:  Does Java actually try to optimize away "useless" field declarations in order to execute faster?  I was not able to find a question addressing this.  Using:   jdk 1.8.0_121 junit 4.10

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:


Do i have to use a disc to load ubuntu on to my pc. Can't i partition it and install a copy?  Or copy/burn to a usb drive.  Sorry new to this.

I've downloaded the daily Ubuntu 12.04 iso.  I currently have windows 7 x64 operating system installed.  How can I make a bootable usb from the Ubuntu iso?


my code was:  package javaapplication1;   import java.io.Console; public class JavaApplication1 {       public static void main(String[] args) {          Console console =System.console();         // TODO code application logic here         String ageInString ;         ageInString= console.readLine("how old are you?  ");         int age = Integer.parseInt(ageInString);         if(age<18)         {console.printf("not valid");         System.exit(0);         }      }  }   and the error is:  Exception in thread "main" java.lang.NullPointerException     at javaapplication1.JavaApplication1.main(JavaApplication1.java:20) Java Result: 1

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


I voted to close . It has actually been closed with this reason:     "Questions must demonstrate a minimal understanding of the problem being solved. Tell us what you've tried to do, why it didn't work, and how it should work. See also: Stack Overflow question checklist" – Blorgbeard, his   As you can see, only two people voted for this reason (Blorgbeard and his). Benjamin Gruenbaum and myself voted to close as     This question appears to be off-topic because it is about a typo   (I can guess that Ben voted for the above because it is displayed as a comment under the question.)  My questions:   In general, if the close votes do not have a majority close reason, how does the system decide which reason gets displayed? Specifically for this case where there is a tie, why did one reason get chosen over the other? What happens if there are 5 different close reasons? Which one gets displayed?

Questions can be closed or marked as duplicates.  What does it mean for a question to be "closed"? What does it mean for a question to be marked as a "duplicate"? Who can close a question? What are the reasons for closing a question ? Is closure the end of the road for a question? When are closed questions eligible for deletion?   Related        For more information, see "" in the .


I've got some bread flour that has been in the refrigerator that has a best use date of Sept. 2015, and it's now Nov. 2015, is it okay to still bake with it?

As the title says, is it safe to consume flour once its past its expiry date or should it be thrown away?


How can I compile some LaTeX source into PDF and keep the LaTeX source as some meta-information in the PDF? (or somehow embedded otherwise in the way that it is easy to retrieve the LaTeX source while having the option not to view it when reading the PDF)

Several times now I have inadvertently lost the .tex file that generated a PDF file with pdflatex. Given what I know of the internal structure of PDF files, it should be possible to embed a text file containing the original LaTeX file into the PDF file so that it can be extracted later.   I am aware of no technology for doing this, but perhaps you are. Does anybody have something like this?


Once I'm well into a software project I post specific programming questions. But with new projects it's sometime hard to get going because I don't have enough knowledge to pick the right tools or take the right approach. I usually have some ideas but like to get some input from the many stack exchange experts. However these type of questions often get voted down, closed as deemed opinion based as if opinions are a dirty word. I see why a question like 'which is best programming language' are not helpful but questions such as  are not the same and would benefit other programmers, and surely that's one of the main objectives of stack overflow.  Stack exchange is my first port of call because of user expertise and the great ease of use of the site, and the single login for all the stack exchange sites. I don't really don't want to use other sites.

Recently  was "closed as subjective and argumentative".  I wonder, where would you recommend to ask such questions?


Every time I search the internet for what all of the Christmas items on the list in Merry Clickmas, I only find incomplete lists.   Right now I have 360% on my current speed - these are the decorations I have unlocked (each decoration adds +4% speed):     a Christmas tree a partridge in a pear tree tinsel baubles glass ornaments a star an angel a fairy a cherub pine cones Christmas lights candles a lantern bells five gold rings a trumpet a drum ribbons glitter a Merry Christmas banner a Christmas wreath mistletoe holly an advent calendar paper chains Christmas crackers Christmas cards Christmas presents toys wrapping paper a Christmas stocking a Christmas sack candy canes chocolate decorations a Christingle a nativity scene a figure of Mary a figure of Joseph a figure of Jesus wise men figures a toy soldier a donkey decoration a robin decoration a reindeer decoration a penguin decoration a polar bear decoration a santa decoration an elf decoration a sleigh decoration a Christmas pudding decoration a turkey decoration a chimney decoration a snow globe a snowman snow decoration icicles santa hats a lump of coal ivy poinsettia a nutcracker a toy train a Christmas pickle chestnuts roasting on an open fire and a gingerbread house     Are there any more or is that the limit?

After you get the Reindeer Stables, you can add decorations through a text form to increase production speed. I've added a few decorations myself, but I was wondering what all of them are. I know that some entries seem to be "synonyms". For example, if you enter "wreath" and then "garland", you'll only add the "a Christmas wreath" and trying to put up the garland will return "We already have a Christmas wreath".  These are the decorations I've already added along with discovered synonyms.   Nutcracker (Nutcracker) a Christmas tree (tree) baubles (bauble) glass ornaments (ornament) a star (star) Christmas lights (lights) a Christmas wreath (wreath, garland) mistletoe (mistletoe) a Christmas stocking (stocking) candy canes (candy cane) a chimney decoration (chimney, fireplace) a Santa decoration (santa) an elf decoration (elf) a reindeer decoration (reindeer) a nativity scene (stable) toys (toy) wrapping paper (wrap) candles (candles) tinsel (tinsel) a star (star) an angle (angle) holly (holly) paper chains (chains) Christmas crackers (cracker) Christmas cards (card) a figure of Mary (mary) a figure of Joseph (joseph) a figure of Jesus (jesus) wise men figures (wise men) a donkey decoration (donkey) a sleigh decoration (sleigh) a snowman (snowman) snow decoration (snow) Santa hats (hat) bells (bell) ribbons (ribbon) a turkey decoration (turkey) ?


I want to create a shallow and dim lighting effect around my scene, but I also want the shadows to be slightly darker. Unfortunately the only method I have found to make shadows sharper and darker is to increase the strength of the lamp, which creates an extremely bright scene.  Is there any way to make shadows artificially darker?

I want to make certain shadows more prominent (using Cycles) without further illuminating the rest of the scene.  Example: I have a simple studio with a bowl of fruit and 3-point lighting.  The light looks great so I don't want to change it but I want the bowl to cast a darker shadow on the ground (without dimming the back-light).  Alternatively, and this would be really cool, an anti-light source.  Like a spot light that throws darkness instead of light. (Am I crazy for wanting this?)  Thanks!


I am trying to format a list of dates in google sheets. One of the dates are 20161001, I highlight the cell and go up to Format-> Number -> More Formats -> More Date and Time Formats and choose DD MMM YY format. The the cell changes to 10 Dec 98. As you can see once formatted the date is incorrect.   The original date is pull from an Excel spreadsheet out of a system.

I generated a report that formats date as 20160509 and my Google Sheets locale is already set to United States. I've played around with various options within Format > Number > Date Format but I can't change the dates to MM/DD/YYYY format without doing a simple find and replace. How do I accomplish this?


I'm on Mac OS X and have texlive 2013 installed. For a journal paper, I need to install two .cls and .clo files. All the read says is Copy svjour3.cls and svglov3.clo to a place where LaTeX can find them.  I dropped these files to  /usr/local/texlive/texmf-local/tex/latex   and tried to run texhash but this is what happens:  texhash: /usr/local/texlive/2013/../texmf-local: directory not writable. Skipping... texhash: /usr/local/texlive/2013/texmf-config: directory not writable. Skipping... texhash: /usr/local/texlive/2013/texmf-dist: directory not writable. Skipping... texhash: /usr/local/texlive/2013/texmf-var: directory not writable. Skipping... texhash: Done.   If I try to compile a .tex file that's in the same directory as the .cls and .clo files, it works, but not if the file is somewhere else. So where is the proper place to put this?

I've searched online, but I have not found any clear instructions how to permanently add .sty files to my TeXShop installation. I'm using a Mac with OSX (TeXShop is a mac only program).  What is the best way of doing this? The one comprehensive set of instructions I found .   I've got as far as extracting the files (running LaTeX on the .ins and . dtx files) but after that I don't know what to do. I also don't understand how to update the index of my distribution, and whether there are particular OSX specifics (the instructions are for Windows).


I am working on coding something as an assignment we are working with stacks and queues right now.  This is the first part of what I have in the Stack.java file:  import java.util.*;  class Stack {  private ArrayList<Integer> array; /* this should implement a Stack that holds Integers. It should have a constructor and the methods push(Integer), pop()and toString(). */     public void push(int value)     {         // adds the value to the end of the array         array.add(value);     }   A small part of runner class is:    class Main {  public static void main(String[] args) {     Stack myStack = new Stack();    myStack.push(1);    myStack.push(2);    myStack.push(3);    myStack.push(4);    myStack.push(5);    myStack.push(6);   The error message I get is   "Exception in thread "main" java.lang.NullPointerException     at Stack.push(Stack.java:12)     at Main.main(Main.java:5)"   What is wrong?

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


I have two mxd files created by data driven pages.   How is it possible to export them to one pdf file?  First a page from the first mxd file, then the first page of the second mxd file. Next the second page from the first mxd file, then the second page of mxd file.

Is there an easy way to add a PDF to the backside of each map printed using data driven pages?   I know I could print one sided and then reinsert the printed pages upside down, and print the PDF on the reverse side. However, we may deliver this to our client digitally and would like it to be setup for them.  For example, I have data driven pages set up for 50 parcels. Each map printed will show a single parcel's data. I need a generic PDF to print on the backside of each of these 50 maps.


I have a python script that restarts the mouse driver   import os  os.system("sudo modprobe -r psmouse") os.system("sudo modprobe psmouse")   since my mouse doesn't always show up on start. What is a way I can run it on start up without being prompted for a password?

... but still be required for applications that need admin privilegies?  In order to allow the following:  $ apache2ctl restart httpd not running, trying to start (13)Permission denied: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down Unable to open logs  $ sudo !! sudo apache2ctl restart             #no password asked $                                   #works!   For reference I've seen this setup on amazon's e3 instances  Any idea?


I have a database file .mdf created in SQL server 2016. I am planning to move at a new web hosting provider who supports 2014sp1 version. Should I proceed or this is out of specs? Can I restore an 2016 version at a 2014 one?

When trying to restore a backup to a SQL Server Express 2008 database I got the following error:  Restore failed for Server '...\SQLEXPRESS'.  (Microsoft.SqlServer.SmoExtended) System.Data.SqlClient.SqlError: The database was backed up on a server running version 10.50.1600.  That version is incompatible with this server, which is running version 10.00.2531.  Either restore the database on a server that supports the backup, or use a backup  that is compatible with this server. (Microsoft.SqlServer.Smo)   Is there a way to get a backup which is compatible with the older (in my case 10.00.2531) version from the newer (in my case 10.50.1600) version of SQL Server Express?


After Thor's banishment in the first movie we find out how Odin took pity on a frost giant baby who turns out to be Loki. It is also found out he is the son of Laufey who is the ruler of frost giants. Assuming he is a pure breed Frost Giant why isn't his son's skin blue. We see it briefly blue when Odin lifts Loki as a infant and then when Loki lifts the Casket of Ancient Winters. So why doesn't Loki share the color of his race and that of Asgard.

Apologies for the slightly vague title.  It is revealed during Thor that      Loki was taken as a baby and is actually the son of Laufey, king of the Frost Giants.   Is there any explanation as to why he doesn't look like the rest of his race?


I have been doing sheet.stopTC(aVal)  and it seems to go fine, however here:  key: "stopTC", value: function stopTC(z) {    if (z == true) {     z = false;     console.log("cache started");   } else {     z = true;     console.log("cache stopped");   }   return z; }  //globals aVal = false   the variable is globally set to false but when it comes back the aVal stays false instead of changing to true`.  Sorry I'm new to programming and can't get my head around it.

The primitive types (number, string, etc.) are passed by value, but objects are unknown, because they can be both passed-by-value (in case we consider that a variable holding an object is in fact a reference to the object) and passed-by-reference (when we consider that the variable to the object holds the object itself).  Although it doesn't really matter at the end, I want to know what is the correct way to present the arguments passing conventions. Is there an excerpt from JavaScript specification, which defines what should be the semantics regarding this?


Is there a way to put any application I want on top of all others? I'm on a windows XP machine.

Some software have an option for their window to be "Always on Top". Is there any way to get the same functionality for any window. Let me give an example where this would be useful.  Suppose I have a small browser window with real time stats from a game. The window is automatically updated at the rate of once every 10 seconds. I would like the small window to be always on top. so that I can just look at it whenever I want to, without actually going to it and at the same time I could continue working in my main application, which is at full screen.  Is there any Windows hack or App which can give me this functionality?


I have sections in my report in latex.  I want to know how can I fix the position of the section in the report.  I have some pictures after the section, but all of them come before the section,  \begin{figure}[!htb]      \begin{center}         \includegraphics[trim=0.5cm 7cm 0cm  6.5cm,clip,scale=.75]{Figures/Conductivity_Result_20C_Fitting.pdf}         \caption{Conductivity Measurements at 20C}         \label{fig:Conductivity_Result_20C_Fitting}     \end{center} \end{figure}   and the section code is:  \section{Summary}

How to influence the position of float environments like figure and table in LaTeX?   This is a general question and should collect useful answers for all users. I hope we can use this as a reference


Ok, I have a weird thing going on -  I have LAMP setup with a pseudo virtual hosting where for each user a system user is created and all his files are owned by the user.  So here is the flow -> user signs up using the web service -> a new system user is created (Say user1) -> A new group is created (user1 with user1 and www-data as memebers) -> all the files the user uploads are owned by user1:user1 with permissions - Files: 0770 and Folders: 0771  Now my issue is when I try to open (example.com/UserFolder/abc.html), apache gives a "Forbidden : File permissions deny server access).  If I restart/reload apache, it starts working fine. What is going on here? Why do I need to restart apache for it to be able to recognize the new user?

I have a server setup where new linux users are created using (PHP)  shell_exec ( '/usr/sbin/useradd ' . $username ); exec ('usermod -a -G ' . $username . ' '. $username); #add user into the usergroup exec ('usermod -a -G ' . $username . ' www-data'); #add usergroup with the www-data   And then the user script changes the owner and group of the files to this owner. The server is setup with suPHP which then allows these files to be run as the owner.  This setup worked fine with Apache 2.2 but is breaking in Apache 2.4. Everything works fine except when I try to oepn the files, it gives a 403 forbidden error. Restarting apache after the user is added fixes the issue but that is not a viable solution for me. The users are added using a web server and hence I need to be able to do this without having to reload/restart apache everytime.  I have searched for serveral hours and tried to fix the issue but haven't been able to do so! I am running ubuntu 14.04 and I am not able to downgrade to apache 2.2 as well.


Here are the constraints :   Only  STL must be used for stack creation (do not use struct to create stack) Sort the stack without using any loops   I have figured out the solution with constraint 2. But when I create a stack using STL to satisfy constraint 1, the stack is not getting sorted and the output is just same as the input.  Expected Output : 5 4 3 2 1 My Output       : 1 2 4 3 5  Below is the code :  #include<iostream> #include<stack> using namespace std;  void SortedInsert(stack<int> S,int x) {     if(S.empty() || x > S.top())         S.push(x);     else     {         int temp = S.top();         S.pop();         SortedInsert(S,x);         S.push(temp);     }  }   void StackSort(stack<int> S) {     if(!S.empty())     {            int x = S.top();         S.pop();                 StackSort(S);         SortedInsert(S,x);     } }  void main() {     int arr[5] = {1,2,4,3,5};      stack<int> S;      for(int i=4 ; i>=0 ; i--)         S.push(arr[i]);      StackSort(S);      while(!S.empty())     {         cout<<S.top()<<" ";         S.pop();     }      cin.get(); }

What is the difference between    a parameter passed by reference a parameter passed by value?   Could you give me some examples, please?


I have linux installed as my only OS on my macbook pro retina version and i need to create a installation usb that will boot on the usb...this has been frustrating for me and i need some help with this :/(internet recovery to get bootcamp IS NOT an option,the download is too long and my internet will cut off before it can install fully.)  Thanks in advance

I'd like to create a Windows bootable USB stick, but I don't have a Windows machine with me at the moment to do so. How could I achieve the same using Ubuntu?


I have been playing with the  dataset for sometime. I have been using only the non-categorical features.  After fitting LASSO I plotted the residual error vs true value scatter plot. Blue points are from training set and red points are from validation set.    As expected there are some outliers with high residual error. Most of the residuals are clustered around zero. I think it is expected that the mean value of residual errors should be zero.   But the more interesting question is how does the mean residual error change across the whole range of output. In this case the residuals tend to be positive when outputs are high and residuals tend to be negative when outputs are low. There seems to be a linear relationship. This relationship is present in both the train set and validation set. Apart from LASSO I also tried Ridge and OLS with similar results.  I also tried a random forest model. The result is almost same. There is more overfitting but the general trend is there. Even random forest fails to capture this trend.  So my question is why cannot neither a linear nor a non-linear model learn this linear relationship?

I am fitting a linear model to a problem, and a little confused by what is going on. Without the details here are the two plots confusing me:  Residuals vs Fitted    Residuals vs Y    Now the residuals vs fitted looks good to me. Fairly evenly dispersed, no clear pattern. However, the $y$ vs fitted do not look good. I would have expected there to also not be a clear trend in this relationship.   This seems basic, but I'm rather lost. I don't want to fit a model that allows large positive errors at high values of $Y$ to make up for large negative errors at low values of $Y$.  Is this just an indication of a poorly fitting model? Or is something else going on here?  EDIT: Asked for fitted vs y (changed to have labels)    EDIT2: Just want to point out that this question has already been asked and answered (albeit in a more abstract sense)  .


I have a problem with this HTML code I'm trying to write. This is the actual code:

Search your carport
         <input type="text" placeholder="Search...">

   In my container fluid I just have a picture, which is like a BG cover, but I want to put a
 and <input> on top of that picture to pretend it's a search bar in the middle of this picture.  This is my CSS for it: (I'm also putting there .cover so you can imagine there is that picture as a background)  .cover {     background-image: url("../img/cover.jpg");     background-repeat: no-repeat;     background-size: cover;     background-position: 50% 60%;     height: 525px; }  .search {     position: relative;     text-align: center;     height: 525px; }   So as you can see, the
 and <input> they are centered, but they are on the top. vertical-align: middle; is not working, also align-item: center; is not working.  Hopefully, I've mentioned everything that is needed. If not, I'm sorry. I'm pretty much new to this.

How can I horizontally center a
 within another
 using CSS?

Foo foo


Not all Borel sets are Jordan measurable.  For instance, the set of rational numbers is Borel but not Jordan measurable.  But my question is, are all Jordan measurable sets Borel sets?  I know all Jordan measurable sets are Lebesgue measurable, but of course not all Lebesgue measurable sets are Borel sets.

Is a set whose boundary is measure zero a Borel set?  Does any given Borel set has a measure zero boundary?  I want to give my ideas first: If $E \subseteq  R^n $ is some set whose boundary has Lebesgue measure zero, then we can safely do the Riemann integral $\int _E1dx$, which means we can calculate the "volumn" of $E$. Hence I think $E$ is a Borel set.     But how about the inverse arguement?


I have the following circuit which uses an LM2903 comparator. But Im not sure if it is designed well enough, and not sure about the open collector output is used correct:  THIS CIRCUIT UPDATED AND MODIFIED PLEASE SCROLL DOWN AND SEE MY EDIT AT THE END OF THE QUESTION    I want to modify the above circuit for two types of inputs from two types of pulse outputting devices.  Input to the circuit will be two types of pulse trains coming from one of the two types of devices. The devices will be either powered by 12VDC and which outputs 12VDC pulses or will be powered by 24VDC which outputs 24VDC pulses. Pulse freq. range is 5Hz to 800Hz. I want the device and the comparator circuit to be powered from the same power supply.  And as I tried to clarify the pulse outputs of the devices will go to the circuit as an input.  I want to modify this circuit in a way that:  1-)The output will be 0 to 5V or 6V pulse, for both 24V and 12V cases.  2-)I want the circuit has a large hysteresis in Schmitt trigger configuration and immune to noise(i.e. output as clean as possible).  3-) I also want an LED to blink and indicate whether there is output by not effecting the pulse freq. or introduce noise to the pulse outputs.  I would be glad to have your version or suggestions for this.  EDIT 1:  To add large amount of hysteresis I had to use the inverting input.  And to use an LED indicator I followed analogsystemsrf's suggestion.  Below is the circuit so far:   (click to view the image)  Now I have large hysteresis but LED doesn't go off.  But now I have the following problems and worries?     How can I employ an LED so that I don't introduce noise?      And what do you think about the capacitors in this circuit? Do you   recommend additional ones?   EDIT 2:  With analogsystemsrf's suggestion I modified the circuit again. When I did that, I had to rearrange some resistors to increase hysteresis. I also used 8V zener. Here is the last version:  (click to view image)  And here is the LED current(ringing due to LTSPICE?).

This question is about a circuit I want to use as a schmitt-trigger and is directly related to my . I modified that and changed the output with suggestion of some users. Here is the circuit:   (please click to view the image in bigger size)  In brief, the goal of this circuit is to sharpen the incoming pulses which will have either 12V or 24V amplitude where Vcc will be same as the pulse amplitude.  But I still have five questions regarding this circuit and wanted to open as a new question not to bother and bombard the same users with several questions.  Here are my questions:  1-) I set the hysteresis around 1V. But to do that I modified R1. Do modifying R1 requires to modify R7 and R8 as well? In simulation I get the result I want but still I wonder if there must be a relation between R1 and R7 + R8.  2-) Is R2 necessary? What could be the reason for that?  3-) Why is C1 set to 1uF but not 100nF which is the typical value?  4-) ZD1 and ZD2 forms a surge protection. Is it better to let them stay there or move them right after C2, (between C2 and the inverting input)?  5-) In some examples I see speed up capacitors across R1 and R4. Do I need them in this case and what are they needed for?


I am looking for a word that evokes embarrassment in oneself through others, for example, watching a really bad performance on stage, it might not necessarily involves the humiliation of one party in public, the party can also be oblivious to what he is doing, but evokes a sense of embarrassment upon observation by someone else.

When I see someone else being embarrassed / humiliated, for example a singer forgetting their words in a concert, I would say something like "I feel embarrassed for them". But is there a better word to describe this feeling?  I would say it's a mix of:   Empathetic discomfort for someone else's humiliation Tension; hope that spectators will be forgiving Frustration that I cannot help them   Other scenarios I would feel the same emotion:   Seeing someone make a presentation, the slides are all out of order, and their face gets red with embarrassment while there's a tense silence in the room. Seeing someone make an embarrassing social blunder in front of unforgiving people. Seeing a speaker who keeps making a distracting and annoying gesture, and they don't realize that the whole audience is annoyed. Seeing someone be taken advantage of, like seeing someone naively and happily accept a terrible offer on a car. Seeing a person of strong image (for example the CEO of your company) do something like accidentally leave their webcam on after a conference call, and employees see him/her let out a big burp and pick their nose or something.   In these cases it's important that the audience is not forgiving, even if they don't confront the person about it. The person may or may not know they are being humiliated.  "Pity" as proposed in an answer seems very close, but I think it lacks a few components. I think "pity" has a chronic connotation - that you are referring to the general state of things rather than a specific event.  I think "pity" also depends on the subject suffering, but in my example they are often oblivious.  It could very well be that there is no word for this at all.  NOTE: Some people do not feel the same way I do in this scenario, so you may not think this question makes any sense.


I am new to Linq to SQL and I am looking for a concise way to get a list of Summoners from the SummonerTable based upon a primary key value "UserId" from the UserSummonerTable.  Each of the Summoner1-Summoner5id's in the UserSummonerTable are Foreign Keys referencing the Primary Key "Id" from the the SummonerTable.  I want to use all of the SummonerIds from the UserSummonerTable to grab all of the corresponding Summoners in the SummonerTable.  Thanks in advance!  EDIT: I have made objects for each of the tables referencing all of the columns and can grab each table individually but would like a way to do it all in one Select.  EDIT: This gets me close to what I want, although I would like to wrap the results into an Object "Summoner" with Id and Server attributes and it is very messy.  I am playing around with some of the more concise forms people have suggested to no avail but I will keep reading and trying!  If anyone has any suggestions they are much appreciated.  As soon as I get it working as intended I will mark an answer, or is it good practice to give people credit for getting me on the right track before I figure it out fully?  MyDataContext dc = new MyDataContext(ConfigurationManager.ConnectionStrings["StatServer"].ConnectionString);         var t = (from user in dc.GetTable<UserSummoner>()                 where (user.UserId.Equals(id))                 select user).First();         var summoners = (from summoner in dc.GetTable<SummonerTable>()                          where (summoner.Id == t.Summoner1Id || summoner.Id == t.Summoner2Id || summoner.Id == t.Summoner3Id || summoner.Id == t.Summoner4Id || summoner.Id == t.Summoner5Id)                          select new { summoner.Id, summoner.Server }).ToList();

I'm writing a LINQ to SQL statement, and I'm after the standard syntax for a normal inner join with an ON clause in C#.  How do you represent the following in LINQ to SQL:  select DealerContact.* from Dealer  inner join DealerContact on Dealer.DealerID = DealerContact.DealerID


I use save as methods as well as MXD Doctor but nothing happening. I have previously 10.5 version and I have saved my work in MXD. Now I have 10.3.2 version. How can I open .MXD files?

Working in an enterprise system. We need to determine if everyone needs to update to 10.6 at the same time for mxd cross-compatibility or can we update from 10.5 as needed.


I am an overseas student who was recently admitted to a PhD program in the US, and I will soon travel to the US to meet my future PhD advisor and my fellow grad students. My future PhD advisor has also kindly accepted to be my host for the duration of the several days I will spend in the US. I really appreciate his help, as I know hosting a student in addition to all the other responsibilities that come with being a professor may be a hassle, and also he has saved me from paying for a B&B by offering to host me.   Anyway, I think I would like to give a small gift to my professor just as a token of appreciation for his consideration, but I have doubts as to whether this would be appropriate, since I come from a different culture, and I cannot easily assess how people would react to such a thing in the US. In my culture, too, it would be inappropriate to buy an expensive gift for a professor. In the best case, the professor would sternly refuse to accept the gift, and in the worst case, the professor could have negative ideas about you, e.g., s/he could think you were trying to ingratiate yourself with him/her, that you intended to give the gift as a form of bribe, etc. BUT a small gift with little to no monetary value wouldn't be turned down, and it would most probably be accepted as a token of heartfelt thankfulness. The question for me is, of course, where this boundary is in the US.   And in case you're wondering what I consider buying for him...well, my country happens to have nice tea sets and/or plates made of porcelain, they are popular souvenirs that tourists like to buy here, and one can easily buy a nice, small decorative plate for under 10 dollars, for instance. So I suppose I could buy something like that.   Would that be acceptable? Or would I be judged negatively?   Thank you very much in advance for your answers.

I am nearing the end of my PhD and I would quite like to buy a "thank you" gift for my supervisor (although, she's the socially awkward type who I'm sure will be greatly embarrassed to receive one).  I'm just wondering whether a gift is the done thing? And if so, what sort of gift seems appropriate? I suppose a bottle of wine would be a safe choice?


I am trying to run sudo apt-get update and running in these kinds of errors. N: Ignoring file 'libjpeg8_8c-2ubuntu8_amd64.deb' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension N: Ignoring file 'libdouble-conversion1_3.1.0-3_amd64.deb' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension N: Ignoring file 'libjpeg-turbo8_2.0.3-0ubuntu1_amd64.deb' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension E: The repository 'http://ppa.launchpad.net/danielrichter2007/grub-customizer/ubuntu focal Release' does not have a Release file. N: Updating from such a repository can't be done securely and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.

When updating, I get the following error message:   W: The repository 'http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial Release' does not have a Release file.   Here, I find another statement on this error:   This recommends removing certain PPAs; and, I'm not sure if I should do that since it might mean not getting the updates that I need.    Is this what I should do?


Yes, question sounds strange. But I have a big code that wasn't written by my own and contains a lot of while loops and if statements and therefore a lot of braces. WHat I need is the automatic code rebuilding like MS Visual Studio does - no matter where I placed open-brace it will move at right place when I write close-brace. For example:  //I write: function func() { if(//some statement) { echo('hello world'); } }  //It will look like this: function func() {     if(//some statement)     {        echo('hello world');     } }

Do you know any good tools for nicely formatting messy php code? Preferably a script for Aptana/Eclipse, but a standalone tool will do too.


For $X$, a positive random variable, use Fubini's theorem applied to $\sigma$-finite measure to prove   \begin{align*} E(X)= \int_{[0, \infty)} P[X>t] dt \end{align*}  I found several references on the the site like this:        but all of them assume that $X$ has density or discrete is the are different proof that does not use this assumption.   This is what I tried  \begin{align*} \int_{[0, \infty)} P[X>t] dt&= \int_{[0, \infty)} E(\mathsf{1}_{[X>t]}) dt=\int_{[0, \infty)} \int_{\Omega} \mathsf{1}_{[X>t]}dP dt\\  &=\int_{\Omega} \int_{[0, \infty)} \mathsf{1}_{[X>t]} dt dP=\int_{\Omega} \int_{[0, X)} 1 dt dP=\int_{\Omega} X dP=E[X] \end{align*} where the first step in second line is due to Fubinni's theorem

Show that for a non-negative random variable $X$,   $$\mathbb E(X)=\int_0^\infty \mathbb P(X\ge x) \, dx.$$   I started with  $$\mathbb E(X)=\int_0^\infty x \, dF(x)=\int_0^\infty \int_0^x dt\,dF(x).$$ This is my try.


I have 2 files,  file1 ->   abc=3 abc=3 dfg=6 ggg=7   file2 ->   abc=3 dfg=4 sdf=9   I want the output in file3 as,  File2,File1,Result abc=3,abc=3,Match dfg=4,dfg=6,NoMatch sdf=9,,NotPresent ,abc=3,Duplicate   I currently have a script,  grep -E 'abc|dfg|sdf' file1 >> file3 comm  <( sort -n file2 ) <( sort -n file3 ) |awk -F$'\t' 'BEGIN { OFS="," } $3 { print $3, $3, "MATCH"; next } { print $1, $2, "NO MATCH" }' > final_result.txt   The output looks like,  abc=3,abc=3,MATCH ,abc=3,NO MATCH dfg=4,,NO MATCH ,dfg=6,NO MATCH sdf=9,,NO MATCH   The output displays a blank if the value in file2 does not match the value in file1. For example, the only difference between dfg=4,,NO MATCH and ,dfg=6,NO MATCH is that the value has changed from 4 to 6. I would like the output to be    dfg=4,dfg=6,NoMatch    instead of   dfg=4,,NO MATCH ,dfg=6,NO MATCH   And also,   abc=3   appears twice, but is displayed as   ,abc=3,NO MATCH   I would like to have it as,  abc=3,,Duplicate   Any help is greatly appreciated.

I am using Solaris 10 and so grep options involving -f don't work.  I have two pipe-separated files:   file1:  abc|123|BNY|apple| cab|234|cyx|orange| def|kumar|pki|bird|   file 2:   abc|123| kumar|pki| cab|234   I would like to compare the first two columns of file2 with file1 (search through the entire contents of file1 in first two columns) if they match print the matched line of file1. Then search for the second line of file 2 and so on.   Expected Output:  abc|123|BNY|apple| cab|234|cyx|orange|   The files I have are huge, containing about 400,000 lines, so I would like to make the execution fast.


How can I unescape a string that contains &#xxx; ?   Example:  "Quelque petite scratch sur l&#233;cran"  "Quelque petite scratch sur lécran"  &#232; | è  &#233; | é

I have email addresses encoded with HTML character entities. Is there anything in .NET that can convert them to plain strings?


I'm currently working on a financial planning app for class but I cant get a loop with a condition inside it to work. It just keeps looping despite the condition - it's almost as if the condition is being ignored completely.  Here's my code - please help!  while (true){         Scanner scanVar = new Scanner(System.in);         System.out.println("\nEnter expenditure item: ");         String myString = scanVar.nextLine();         Scanner scanVar2 = new Scanner(System.in);         System.out.println("\nEnter expenditure value: ");         double myDouble = scanVar2.nextDouble();         expenditureMap.put(myString, myDouble);         Scanner scanVar3 = new Scanner(System.in);         System.out.println("\nAnother item? ");         String myString2 = scanVar3.nextLine();             if (myString2 == "yes") {                 continue;             }             else {                 break;             }     }   Many thanks, Dylan

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?


Good day! Is there a  formula that approximate the summation of natural logarithm of N as N runs from 1 to infinity?

Context: I am learning Dijstra's Algorithm to find shortest path to any node, given the start node. Here, we can use Fibonnacci Heap as Priority Queue. Following is few lines of algorithm:  For each vertex in PriorityQueue{     do_something() }   If $V$ is the number of vertices, the subsequent lookup times in the priority queue will be: $$O(\log V), O(\log V-1), \ldots$$   Question:  What would the value of $O(\log V) + O(\log V-1) + O(\log V-2) + .. + O(\log 1)$?


Have been searching all over the internet on how to to remove Windows 10 from dual boot but all i get is answers that are not very clear to me on what to do.I have been using Ubuntu for like 5 months now and my Windows 10 is having glitches,that's why i'd like to uninstall it,without deleting files like music,pictures and videos.Also is there some other ways if i dont have a bootable CD? Am using an Acer Aspire V5. Kindly help me out.Thank you.

If I have a copy of the latest Ubuntu installer on DVD can I run it from within Ubuntu or simply boot from it and then be given the option to remove windows and the partition so I have just Ubuntu on my drive with no separate partition?  I'm trying to get rid of windows and the partition.  I'm currently running a dual boot, Ubuntu/windows system.


Does an unconscious creature or PC automatically hold their breath as pertaining to suffocation?  As pertaining to this question:      A creature can hold its breath for a number of minutes equal to 1 + its Constitution modifier (minimum of 30 seconds).   When a creature runs out of breath or is choking, it can survive for a number of rounds equal to its Constitution modifier (minimum of 1 round). At the start of its next turn, it drops to 0 Hit Points and is dying, and it can’t regain Hit Points or be stabilized until it can breathe again.   The question revolves around the first part “A creature can hold its breath. As opposed to A creature holds its breath

I had a player fighting against sahuagin by the shore the other day and he was dropped to 0 and dying. Because of his location, though, he landed in shallow water (2-3' deep) which I ruled was enough to drown in.  The rules for suffocation (PHB pg. 183) are specific to state:     A creature can hold its breath for a number of minutes equal to 1 + its Constitution modifier (minimum of 30 seconds). When a creature runs out of breath, it can survive for a number of rounds equal to its Constitution modifier (minimum 1 round). At the start of its next turn, it drops   to 0 hit points and is dying.   I was having difficulty adjudicating this because the character was already at 0 and now was just inhaling water.  In this scenario, does the character just make death saves as normal, or would they automatically fail them?  FYI, I ruled that he would auto-fail the saves since he's just inhaling salt water now and takes a level of exhaustion, but if the rules have something specific for this, it'd be helpful to know.


I've accidentally stumbled into the l command in ubuntu which is pretty similar to ls, although the output is slightly different.  For instance, the output of both commands in a directory with the following tree structure is:  Test |_ Folder1 |_ Folder2 |_ File1 |_ File2  ~/Test$ ls File1  File2  Folder1  Folder2  ~/Test$ l File1  File2  Folder1/  Folder2/   Note the slahes at the end of each folder. What exactly is l and which differences does it have with respect to ls?

There is a command l available on my machine which appears to do nothing.  which l also produces no output. Is this a real command, and does it actually do anything?


I am having trouble opening gnome-control-center. I have uninstalled and reinstalled which has temporarily alleviated the issue. Opening gnome-control-center through the terminal outputs this error: (gnome-control-center:7173):GLib-GIO-ERROR **: 10:55:20.351: Settings schema 'org.gnome.shell.extensions.pop-shell' is not installed. Trace/break point trap.  lsb release -a output: No LSB modules are available. Distributor ID: Ubuntu Description:    Ubuntu 20.04.1 LTS Release:    20.04 Codename:   focal  sudo ppa-purge ppa:system76/pop output: Updating packages lists PPA to be removed: system76 pop Warning:  Could not find package list for PPA: system76 pop  I did have the pop repositories installed, although I removed them before reinstalling gnome-control-center.

I'm trying to open System Settings but it won't open in any way. Using GUI, Settings are trying to load for a moment and then they are gone. Using Terminal (gnome-control-center), I get: (gnome-control-center:8823): GLib-ERROR **: 14:44:15.433: ../../../glib/gmem.c:138: failed to allocate 13477064712 bytes Trap Trace/breakpoint (core dumped)  I tried: sudo apt-get remove gnome-control-center sudo apt autoremove sudo apt-get install gnome-control-center  With multiple reboots, but I had no result. UPDATE!: Same errors persist BUT, when I type: sudo gnome-control-center  (instead of just "gnome-control-center") suddenly System Settings appear! Is it a user permissions issue? Any suggestions? UPDATE#2: After some system updates, sudo gnome-control-center now spawns "Segmentation fault".


How do you remove the default cube that appears in the scene upon opening the software? I wish to start with a blank scene when opening Blender.

How can I change Blender from the default cube/lamp/camera default setup? Also, is it possible to change other features, such as the default view direction (Top, Side, etc) or the Editor type (3D View, Node Editor, Graph Editor, etc)?


I am confused about using *. The first_example works, but why doesn't the second_example work?  The error states:     UnboundLocalError: local variable 'a' referenced before assignment   What can I do to fix this error?  a, b, c, d, e, f, g, h, i = range(1,10) alphabet = [a, b, c, d, e, f, g, h, i]  def first_example(*alphabet):     j = g + i     print (j)     second_example(*alphabet)  def second_example(*alphabet):     a = a + 1     print (a)  first_example(*alphabet)

The following code works as expected in both Python 2.5 and 3.0:  a, b, c = (1, 2, 3)  print(a, b, c)  def test():     print(a)     print(b)     print(c)    # (A)     #c+=1       # (B) test()   However, when I uncomment line (B), I get an UnboundLocalError: 'c' not assigned at line (A). The values of a and b are printed correctly. This has me completely baffled for two reasons:   Why is there a runtime error thrown at line (A) because of a later statement on line (B)? Why are variables a and b printed as expected, while c raises an error?   The only explanation I can come up with is that a local variable c is created by the assignment c+=1, which takes precedent over the "global" variable c even before the local variable is created. Of course, it doesn't make sense for a variable to "steal" scope before it exists.  Could someone please explain this behavior?


I am trying to draw a lattice in a coordinated plane such as this but have no idea how to do it. I have searched for similar posts but cannot find anything similar to this.


I want to compare my old and new webpage design, What is the fastest way to compare layouts of my old and new webpage versions?

Motivated by .  We currently have a rather rich subset of end-to-end tests for our AngularJS applications. And, we do get a lot of visual/layout/design issues on every single development iteration. Usually, we do not cover this kind of issues with end-to-end tests and testing the fixes manually. The reasoning was always - too hard, too fragile, too expensive to automate.  In some cases though, a style of an element or block on a page is really critical for an end-user and it would make sense to have an automated end-to-end test checking it. We try to check the colors, font styles and other CSS properties inside our Protractor tests, but it is still checking only these specific things and not an element or part of a page as a whole. Plus, the assertions themselves are not readable and easy to break, for example:  expect(somePage.someElement.getCssValue("background-color")).toEqual("rgba(255, 211, 205, 1)");     We are thinking of adding some sort of a visual component to our tests. Ideally, comparing screenshots of what we expect an element to look like and how it actually looks. But, there are a lot of open questions at this point:   how reliable can it be - would it depend on the browser, resolution and other parameters of the test machine setup? is it possible to integrate with our existing Protractor test codebase or we need a separate specialized tool for that? test result reporting - how would we present the test results?   Have you done something similar and how did you address the above mentioned issues? Was it worth the cost of maintenance?


I have a file upload functionality in my application which is for uploading a valid Image(JPG). However, a user is currently able to upload a .exe file by just changing the extension of the exe file to .jpg. Can we validate this file and give an error message to the user that it’s not a valid file? Anyone has implemented this check and can suggest?

I am looking for a simple way to get a mime type where the file extension is incorrect or not given, something similar to  only in .Net.


Picking up from where ...  I have my own take on this proof. I started by showing, by induction, that the sequence is monotonically increasing, and then, also by induction, I showed that the sequence is bounded above by $ x_n<1+\sqrt{a}$. (I can include this if need be) But I want to know if this sequence actually converges to $1+\sqrt{a}$. I know that this sequence is bounded above by this, but I don't know if it is the lease upper bound. Would anyone have any intuition as to prove that, or even where to begin?  Thanks in advance.

(Fitzpatrick Advanced Calculus 2e, Sec. 2.4 #12)  For $c \gt 0$, consider the quadratic equation $x^2 - x - c = 0, x > 0$.  Define the sequence $\{x_n\}$ recursively by fixing $|x_1| \lt c$ and then, if $n$ is an index for which $x_n$ has been defined, defining  $$x_{n+1} = \sqrt{c+x_n}$$  Prove that the sequence $\{x_n\}$ converges monotonically to the solution of the above equation.  Note: The answers below might assume $x_1 \gt 0$, but they still work, as we have $x_3 \gt 0$.    This is being repurposed in an effort to cut down on duplicates, see here: .  and here: .


I have simple code Scenario:  class Demo {    static void check(int z[])  {    z=null;  }   }  class arrNullCheck {   public static void main(String args[])  {     int arr[]={2,3,4,5};      Demo.check(arr);      for(int i=0;i<4;i++)      {        System.out.print(arr[i]);        }        } }   According to me this program should throw null pointer exception at runtime as z is equal to null,But output is as follows:  Output: 2 3 4 5   If i update method like:   static void check(int z[])  {    z[0]=9;  }    then it will update array with value 9 as expected. why doesn't null work here then ?

I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?


I was wondering why an  was gaining steam.  I looked at it just now, and lo and behold someone has a bounty on it!    When did that happen?  Why wasn't I ever informed that that a bounty was put on my question?

Can there be a notification for those people that participated in the question in the past (either who asked or answered it) once a bounty is started on it?


What is the acceptable way to clarify a question you ask? EDIT: That is, one that is still new?

I asked a question almost as soon as I got my account. I got a few decent answers, but none of them helped solve my problem. The question has long since become buried by newer questions, and there's still no accepted answer. Unfortunately, because there are quite a few answers with votes, to a casual observer it probably looks like the question was answered and I just neglected to mark an answer as accepted, and the system does not consider it "unanswered".  Or, I asked a question that was a bit more difficult to answer. After waiting for some time, I received no answers, little or no comments, and only a few views. The question does show up in the "unanswered" list, but no one has answered my question.  In either case, what's the protocol for me to try to get this question answered?  I see several options:   Post the question a second time, possibly linking to the original, to get attention for the original question. This is encouraged on sites like Reddit.  However, it's probably not appropriate here, since we're encouraged to check for duplicates and not submit a question that's already been asked by someone else, so this probably falls under that heading. Wait for some kind of wiki-like talk page to be implemented, then post a plea on the talk page for input and hope that activity on the talk page bumps up the question. Edit the question, but do nothing further on the Stack Exchange site. If I edit my post to say that I haven't accepted any of the current answers but am looking for more, then the question might get answered eventually by people browsing through old questions to find something they can answer. Post the question on other sites, but link to my original question on Stack Exchange. People will either answer here, or they'll answer on the other site and I can post the accepted answer here myself.  This might be considered spamming, so it might be better to do this without the link.      For more information, see the "" page in the .


In proving these inequalities, what I did was to take each of the "<" relations and prove them. Is this a valid way of proving if we have got several inequalities as in this problem?  So here is my proof by parts.    $a<\sqrt{ab}$:  Let $P$ be the set of all positive numbers. Since $a,b,b-a\in P$, we have $a(b-a)=ab-a^2\in P$, so $a^2<ab$, which implies that $a<\sqrt{ab}$. (I make a separate proof for this implication, which goes as follows: $a^2<b^2 \iff 0<b^2-a^2=(b-a)(b+a)\in P$, so $(b-a)\in P$, thus $a<b$). So this proves $a<\sqrt{ab}$.  $\displaystyle\sqrt{ab}<\frac{a+b}{2}:$  We have $\displaystyle\sqrt{ab}<\frac{a+b}{2}\iff2\sqrt{ab}<a+b\iff0<a-2\sqrt{ab}+b=(\sqrt{a}-\sqrt{b})^2$. Since $a,b$ are both non-zero, so $0<(\sqrt{a}-\sqrt{b})^2$ holds, thus, proving $\displaystyle\sqrt{ab}<\frac{a+b}{2}$.   $\displaystyle\frac{a+b}{2}<b$:  By closure under addition, $a<b \implies a+b < b+b = 2b$, dividing by $2$,  $\displaystyle\frac{a+b}{2}<b$.    Does this work? If not, where did I go wrong? Is there a much better way to show this?

If $0<a<b$, prove that $a<\sqrt{ab}<\frac{a+b}{2}<b$  So far I've got:  $a<b$  $a^2<ba$  $a<\sqrt{ab}$  And:  $a<b$  $a+b<2b$  $\frac{a+b}{2}<b$  So I need to prove that $\sqrt{ab}<\frac{a+b}{2}$  How can I do it?


I need a square polygon to clip layers to, in QGIS, a perfect square perhaps. It needs to be a certain size. Anyone have any experience or any good ideas?

I'm pretty new in QGIS and i'm searching a drawing tool like it is possible to find in microsoft word or excel.  I search something very user friendly (for dummies!) to add circles, arrows, lines... with no need to create a new layer!!  Can you help me?


One of our Business Research Analysts has a habit of accidentally updating without a where clause.  Preferably the solution is better training and following a procedure like writing a SELECT before UPDATE. Or just security policies...   However, those things aren't going to happen soon. So I would also like to know if there is a way to limit a user to only being able to update X number of rows. i.e if they run an update that will do 10 rows, let it go. If it will be 1 millions rows (happened the other day) prompt them to double check or just stop that query.

Is there a way to configure SQL Server to limit the number of rows than an update statement can modify?  Say I wanted the limit to be 30,000 rows and someone fired an update that would modify 45,000 rows, they would receive an error or some other preventive message.


I am 29 years old. I do freelance work and I can save around $500/Month from that.  In my country, $1500/month is more than enough to cover all living/health/entertainment expenses for me and possibly for my future family and should be  the case for years.  I am 80% sure that $1500/Month will still be  enough for a family to live on in 2040. I don't care about the stock's value. I only care about living off  the dividends and never touching the principal. Maybe my kids will be able to live off it too.  I want to retire after I save the sum of money needed to generate $1500/month in dividends. My question is how much money is that?

How much money do I need to make in order to generate 1k/month for the rest of my life? Is that even possible? If yes, in what way? Edit: I am 30 years old.


I have alot (like 50) duplicated meshes. i used SHIFT-D to duplicate the objects ,but then read that ALT-D saves memory. is there a way to link the mesh data (like using ALT-D) after i have used the wrong duplicate? attempting to go back and use ALT-D would take a long time.  The meshes i duplicated are all the same shape and size and only have different rotations.

I made many copies of an object, then I thought it would've been better if I made them to share the same Data (being an instance of the same original object), I know how to do it one by one, is there a way to do it for all of them at once? I tried Copy Attribute add-on but didn't find what option can do that, or even if this is possible in the first place.


I have thought about the following equalities for a while and maybe you can suggest are they true or false, and help me to solve some inconsistencies which occur. I am making one question for three equalities because they are connected. So: 1) Is $$\int f(x)\,dx = b + \int f(x)\,dx $$  where $f$ is some function and $b$ is some number. 2) Is $$\int f(x)\,dx - \int f(x)\,dx = 0$$ where $f$ is some function. This equality may seem a bit obvious but in connection with other one it can cause some problems (inconsistencies). 3) I definitely know that: $$\int \frac{1}{x}\,dx = 1 + \int \frac{1}{x}\,dx$$ and I know this because you can easily prove it using integration by parts. And now, this equality in combination with (2) leads to the following false equality $$0=1$$ So there can be two posibilities: either (2) is false or I am doing some technical mistakes when I conclude that $$0=1$$ So what is the mistake ? Thanks in advance

I've run into a strange situation while trying to apply Integration By Parts, and I can't seem to come up with an explanation.  I start with the following equation:  $$\int \frac{1}{f} \frac{df}{dx} dx$$  I let:  $$u = \frac{1}{f} \text{ and } dv = \frac{df}{dx} dx$$  Then I find:  $$du = -\frac{1}{f^2} \frac{df}{dx} dx \text{ and } v = f$$  I can then substitute into the usual IBP formula:  $$\int udv = uv - \int v du$$  $$\int \frac{1}{f} \frac{df}{dx} dx = \frac{1}{f} f - \int f \left(-\frac{1}{f^2} \frac{df}{dx}\right) dx$$  $$\int \frac{1}{f} \frac{df}{dx} dx = 1 + \int \frac{1}{f} \frac{df}{dx} dx$$  Then subtracting the integral from both sides, I've now shown that:  $$0 = 1$$  Obviously there must be a problem in my derivation here...  What wrong assumption have I made, or what error have I made?  I'm baffled.


I need to extract part of html markup:
   HOME   HOME   HOME   HOME   HOME
   JS    $(document).on('click', '.spant', function () {   var a = ... // - html of all spant before clicked, including clicked one; });   For example, if third spant is clicked, the result should be:  HOME HOME HOME   How can I do this ?

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.


Is there a difference or pros and cons betweeen those variations?  int main(int argc, char **argv) { return 1; }  int main(int argc, char * argv[]) { return 1; }

What is the correct (most efficient) way to define the main() function in C and C++ — int main() or void main() — and why? And how about the arguments? If int main() then return 1 or return 0?  There are numerous duplicates of this question, including:       — For C++, with a very good answer indeed.     Related:


I had a question with 100 bounty that had one answer - and it was a complete non-answer.   I was pretty shocked to see this answer got the bounty automatically.   Is there a way to prevent this?  edit:  It is entirely possible to game the bounty system.  Just wait for questions without answers that are about to expire, add some BS answer and have two sockpuppets upvote your answer.

Shouldn't there be a way to prevent automatic awarding of a bounty? For example, if someone provides an answer that sounds good but is totally wrong, it may happen that it gets a score of +2, but doesn't deserve the bounty. If no one else answers, half the bounty will automatically go to this person. Automatic awarding is good if an inactive user offers a bounty, but I think there should be a button that basically means "I know the bounty should now be awarded, but I have read the answers and none of them deserve the bounty".  The button should obviously not refund the bounty, just let it go to /dev/null instead of awarding it to someone who doesn't deserve it.


I'm trying to identify a novel I read around 1990 give or take 5 years. It was fairly short (maybe 120 pages or so) and I read it in Dutch, but it is most likely a translation of an English original. I'm very vague on the story content, but there are a couple of specific details that stuck in my mind and are hopefully enough to have someone be able to identify this. Story is set in a near-future USA. Computers and self-driving vehicles are everywhere. At the start the main character (a man about 30 or so) lives on a houseboat that travels the waterways in Florida (Everglades probably). He suffers from total memory loss, but gradually he recovers and start to discover his past. He (re-)discovers he can mind-link to computers, making him a uber-hacker. And he discovers that he used to work for a black-ops government outfit together with several other people with special powers. One of those (his love-interest?) is a lady with telepathic ability. Another is a former priest that specialized in prayer/healing sessions, but he is actually be able to heal for real without prayer. However he uses is ability mostly in reverse, as assasin, by giving people heart-attacks and strokes making it appear they died from natural causes. The main characters memory-loss may actually have been induced by this priest guy to make him forget all the dirty work he did for the government. (I'm not sure on this detail, but it is logical.) Now his memory returns the government agency is after him so he goes on the run. Eventually there is a showdown in which the telepathic lady gets killed. Someone else gets mortally wounded (not the main character I think) and is saved by the priest (who repents and, for the first time in years, prays again). Some other details: The main character while rummaging around in computer networks encounters an AI entity that has come into being in the interconnected computers of the world. The AI helps him several times. I'm not sure of this: I seem to recall his first contact with the AI was when he was a child and in hospital for a long time. With nothing better to do is mind "connected" with the hospital computers and there he encounterd the AI. When the telepathic lady dies her soul is "rescued" by the AI and she lives on in a virtual reality, or something similar to that, created by the AI. During the main characters flight across the USA he makes use of cargo-trucks. Those big 18-wheeler rigs still ply the interstates form coast to coast, but they are fully self-driving now. Due to Union/Teamsters pressure (this was explicitly mentioned in the novel) they still have a mandatory cabin, including sleeping space. The main character travels a long distance by hiding in such a sleeping cabin. It is not much to go on. Can anyone identify the novel?

I vaguely remember a book which I would like to read again. The plot was like this.  A man lives an ordinary life but one day he starts having some memories ... or headaches, I don't remember. The main thing is that he discovers he is able to feel and communicate with electric devices around him. And as soon as he discovers it, he starts having serious problems with some organization which had trained him and used his abilities for wrong purposes. Slowly he regains more and more memories and is forced to run and hide from physical and telepathic assassins. I remember, that there was one mystical "electrical being" which acted as his invisible "guardian angel" and this being had helped him in his early childhood when he was in a hospital. This being could manifest itself to the physical world only through electrical devices.  There was a woman who also had some telepathic abilities and her telepathic presence always was accompanied by some specific scent, like some flowers or something. This woman was an assassin sent to kill the protagonist, but then she switched sides and died. But the "electrical being" saved the woman, taking her into some "electrical" level of existence.  The style of the novel was mostly light and active adventure story. Not exactly teenager book, but also no any serious philosophical value to it.


How can an electromagnetic wave propagate on itself even if there is no source that has created it?

If there is no source then also there is electromagnetic waves described by Maxwell equation. how if there is no source then existence of EM waves. What gives energy to this EM  waves. Is it vacuum fluctuation or something else?


I do stuff such as :-  $ copy debian-8.2.0-amd64-DVD-1.iso /media/shirish/4719-38E5/   Copy here is an alias for :-  $ alias copy alias copy='rsync --progress -ravz'   When it does the command it takes a long time to complete and does :-  $ copy debian-8.2.0-amd64-DVD-1.iso /media/shirish/4719-38E5/ sending incremental file list debian-8.2.0-amd64-DVD-1.iso   3,607,855,104 100%    9.11MB/s    0:06:17 (xfr#1, to-chk=0/1)  sent 3,466,268,276 bytes  received 35 bytes  3,481,937.03 bytes/sec total size is 3,607,855,104  speedup is 1.04   Now I have two questions :-  a. -z in rsync is not documented, does anybody know what does it do ? It is very much possible that the flag was there before and is no longer there.   Another thing, does anybody know what xfr#1, to-chk=0/1 actually do ?  I usually perform sync after the command is finished, does anybody know if it's ok to use it or not as copying takes a long time.   Also can people some nicer, better ways so I could use an alias to accomplish the same. For me having progress is important. Few months ago, I did come across an advanced cp which also has a progress bar for showing the progress of a file being copied.   Hopeful of a quick resolution of the above.

If I run rsync with --info=progress2, I get an output like   105.45M  13%  602.83kB/s    0:02:50 (xfr#495, ir-chk=1020/3825)    But what do the single numbers mean? I haven't found a matching entry in the man page.   The first number seems to be the amount of data which was processed (the actual copied bytes as well as the bytes skipped, because they were already existing at the target location), right? It seem not to be the number of transferred data, because it increases faster than my internet connection is... Does the percentage refer to the amount of data or the number of files to be copied? Does it consider excluded files and files that are already up to date at the target location? The time at third position first seemed to be an time estimation for completion, but when I tried it, it jumped between few hours and a few seconds. What does it refer to, and how is it calculated? What do the last two numbers mean?


So I have an old windows vista laptop on which I decided to try ubuntu.  I thought I had got it right, but the windows OS is still there. I know it works alright as it is, but I'd like a fresh start with my pc, without the windows part. There is only one HDD in this computer, with both Ubuntu and windows. i noticed that after I installed Ubuntu, my HDD seemed to have split into two partitions (is this of any point?)  I wonder if I just format the HDD will i loose my Ubuntu installation? will it not be able to complete? will it not format the partitions?   Should I just format the entire pc using a bootable usb-stick and then install Ubuntu likewise? if that's the case, is there an ISO file somewhere that will do both or will i have to do this in two separated actions? like ... first making a bootable usb for formatting, and then making an other one to install Ubuntu (again)?  i have to problem to lose everything that's on the hdd whatsoever. I just need a fresh hdd with ubuntu, and the easiest way to do it?

I previously ran 12.04 alongside WinXP to see how it performed on my mom's older laptop.  i also migrated her email to Thunderbird. If I now convert from dual WinXP/Ubuntu to only run Ubuntu will things like her Thunderbird emails be transferred as part of the Ubuntu full install? Or must I do something else? I am fairly tech aware, but not a full IT boffin!