Which is the django url regex for a token as a parameter?

I want to activate my users in my django server when they follow a link from their email with a token, like this:  http://127.0.0.1:8000/user-activation/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImdhYm8iLCJ1c2VyX2lkIjoxOSwiZW1haWwiOiJsYXRvcnJlZ2FiQGdtYWlsLmNvbSIsImV4cCI6MTQ2NDE3ODk1N30.5FDKdxKxWuOkqe3rMNE-eHwmtrlWpD7EZ-EXw0yQM3U/   I have this pattern   url(r'^user-activation/(?P<id>\w+)/', views.UserActivation.as_view()),   But it's returning 404. I searched a lot and nothing seems to work. What am I doing wrong?  I couldn't find any answer that works reading    nor    Edit:   I've read the post    But there was no example about receiving hyphens and dots at the same time, which was what caused my confusion.  The marked answer solved my problem. Thanks


A question about long exact sequence of finite dim vector spaces

Q) Prove that if $0\rightarrow V_1\rightarrow V_2\rightarrow...\rightarrow V_k\rightarrow 0$ is an exact sequence of finite dimensional vector spaces, then $\sum_{i=1}^{k}(-1)^idim (V_i) = 0$.  For $k=3$, I see that the statement is true. For $k>3$, am I correct in understanding that $V_2 = V_1\oplus V_3 (\implies dim(V_2)=dim(V_1)+dim(V_3))$ and $V_3 = V_2\oplus V_4(\implies dim(V_3)=dim(V_2)+dim(V_4))$ and so on?   If it is true, then for $k=4$, $\sum_{i=1}^{4}(-1)^idim (V_i) = -m_1+m_1+m_3-m_2-m_4+m_4$ and am not sure why $m_2=m_3$ for the sum to be $0$? where $m_i = dim(V_i)$. Thanks.


Prove that $\sqrt{\frac{a}{a+b}}+\sqrt{\frac{b}{b+c}}+\sqrt{\frac{c}{c+a}}\gt1$, where a, b, c >0. I tried, $\sqrt{\frac{a}{a+b}}+\sqrt{\frac{b}{b+c}}+\sqrt{\frac{c}{c+a}} = \frac{a}{\sqrt{a}\sqrt{a+b}}+\frac{b}{\sqrt{b}\sqrt{b+c}}+\frac{c}{\sqrt{c}\sqrt{c+a}} \ge \frac{(\sqrt{a}+\sqrt{b}+\sqrt{c})^2}{\sqrt{a}\sqrt{a+b}+\sqrt{b}\sqrt{b+c}+\sqrt{c}\sqrt{c+a}}$. Then $\sqrt{a}\sqrt{a+b} \le \sqrt{2}/2 (2a+(a+b))$. This only gave me $\sqrt{2}/2 + \sqrt{2}(\frac{ab+bc+ca}{a+b+c})$.


Need help with a book title - something like "Sting"

My son was telling me about a book that he read last year in class that had a picture of a bee on the cover, but where its abdomen is a syringe (with the needle in place of a stinger). It was kind of post-apocalyptic where people were being driven insane by bee stings or something. Somehow he's not even sure of the major plot points. :)  Anyway, we would like to figure out the title and author of this book. Apparently it is fairly recent, and a second book in the series was released this year.


Assuming we're talking about a magnet in a perfect vacuum.  What exactly is the magnetic flux/field?  If it is not matter, it is a form of energy, but energy is a rather vague term; what is it really?


When copy-pasting images from the clipboard, automatically reduce image size to below the 2 MB requirement

The copy-paste feature is great (and I think was only implemented recently).  I wonder though if it could be further improved by also automatically reducing the size of the image if the image is above the 2 MB requirement? That would be even better.  Right now for images on my clipboard that are >2 MB, I have to paste the image somewhere else, save and reduce it, and then try again.


Override operator using class method in c++

Is there a way to override a stream operator like << or >> by using other class methods, such as read() and write()?  For example,  //In the header file class Customer {     void read(istream &, Customer &);     istream & operator>>(Customer &) = read();      void write(ostream &, const Customer &);     ostream & operator<<(const Customer &) = write(); }   It is a requested feature from a question in the textbook, no friend allowed.


How can I install software or packages without Internet (offline)?

I have a friend who has got a computer that is not connected to the Internet. Is there any way to install software offline easily?


How can I solve "Media change: please insert the disc labeled"?

When I run sudo apt install npm  I get: Media change: please insert the disc labeled                                     'Ubuntu 20.04.1 LTS _Focal Fossa_ - Release amd64 (20200731)' in the drive '/cdrom/' and press [Enter]


How can I fix my NullPointerException error?

I've been breaking my head over how to fix my code, but I haven't had any success. I'm trying to create a generic method that allows the user to specify what type of data the array will hold. Unfortunately, my methods don't work on the array, which causes it to be empty...which leads to the error. Here's the relevant code which includes the declared variables, constructor, addLast method, and relevant line numbers:  public class ArrayLinearList<E> implements LinearListADT<E> {  private E[] list; private E[] temp; private int counter = 0; private int length = DEFAULT_MAX_CAPACITY;  public ArrayLinearList() {     list = (E[]) new Object [length]; }  public void addLast(E obj) {     increaseSize();     list[counter] = obj;     counter++; }   Here is part of the tester program:     public class P1Tester {     private LinearListADT<Integer> list;     public P1Tester() {        list = new ArrayLinearList<Integer>();     16     runTests(); 17 } 18     19 private void runTests() {  20     for(int i=1; i <= 10; i++) 21     list.addLast(i);          22     System.out.println("Should print 1 .. 10");  23 for(int x : list)        System.out.print(x + " ");        System.out.println("\n");    }   And finally, here's part of the interface I need to implement:  public interface LinearListADT<E> extends Iterable<E> { public static final int DEFAULT_MAX_CAPACITY = 100;  //  Adds the Object obj to the end of list.   public void addLast(E obj); }   Whenever I run the tester, I get this error:  Should print 1 .. 10 ERROR java.lang.NullPointerException java.lang.NullPointerException at data_structures.P1Tester.runTests(P1Tester.java:23) at data_structures.P1Tester.<init>(P1Tester.java:16) at data_structures.P1Tester.main(P1Tester.java:95)   Sorry if this is long but I really need the help!  EDIT: Here is my code for iterator.  public Iterator<E> iterator() {     return new Iterator<E>(){          int iterIndex = 0;          public boolean hasNext() {         return iterIndex <= counter;         }          public E next() {             if (!hasNext())             throw new NoSuchElementException();             return (list[iterIndex++]);             }         public void remove(){             throw new UnsupportedOperationException();             }         };      }


How do I force the cp command to create subdirectories?  For example, if have this file: /home/test1/x/y/z.jpg and this folder /home/test2/temp/.  cd /home/test1 cp -r ./x/y/z.jpg /home/test2/temp   gives /home/test2/temp/z.jpg if /home/test2/temp/x/y doesn't exists. I want /home/test2/temp/x/y/z.jpg to be created.


Is it possible to open a remote terminal session on a Windows XP machine?

Remote desktop is... useable, but I'd like to get a proper remote terminal window open on the Windows XP machine, like I'm able to with Linux. A quick Google points at , but it looks like it's only for Vista/Server.


what construct makes PRIVATE serialversionUID useful?

I have a clue of what serialVersionUID is for, and in as far as I don't I can look it up. But it can be a private variable that's not used inside the class. Is there some construct or so behind that? Are there other examples of private variables / methods that are not used inside the same class? Can I make them while still doing something else to make it useful? How can I access private variables myself from another class without creating getters?


trying to create a dll which opens a file, originally i was trying to open batch file but it seems the process isnt executed when the dll is used by other program. The code was tested in console application project and is working.  in the dll i put some logging but even though the  logs are written the process does nothing.   I tried this simple code for example:  System.Diagnostics.Process.Start("C:\\QcOSD.txt\\");   tried other code like:  Process p = new Process();  p.StartInfo.FileName = "cmd.exe";  p.StartInfo.Arguments = @"/C D:\test.bat";  p.Start();  p.WaitForExit();   not working when using the dll file on other program but working well on console application project.    EDIT: possible solution that worked for me: allowing the service that runs the dll to interact with the desktop. windows services > properties of the service running the dll > Log on > check "Allow service to interact with desktop".


Javascript naming convention for public functions prefixed with dollar sign

/**  * @author paula  */  function A(name){     this.name = name;     this.sayHi();     this.$sayHi();     this.sayBye(); };  (function(){     this.sayHi = function(){         console.log("[sayHi] Hi there, "+ this.name);     };      this.$sayHi = function(){         console.log("[$sayHi] Hi there, " + this.name);     };      this.sayBye = function(){         console.log("[sayBye] Bye bye now, " + this.name);     }; }).call(A.prototype);  var objA1 = new A("Luca");   Found this article:  javascript.crockford.com/code.html where is mentioned that "Do not use $ (dollar sign) or \ (backslash) in names. Most variables and functions should start with a lower case letter"  I have some framework code with many functions prefixed with dollar sign (functions that look similar to $sayHi). Is a function prefixed with $ intended to be used for special purposes ? Thanks.


Intuitive proof of multivariable changing of variables formula (jacobian) without using mapping and/or measure theory?

What is an intuitive proof of multivariable changing of variables formula (jacobian) without using mapping and/or measure theory?  I was thinking that textbooks over-complicate the proof.  If possible, using linear algebra and calculus to solve it, that way would be simplest for me?


How would you unit test the nested function f1() in the following example?  def f():     def f1():        return 1     return 2   Or should functions that need testing not be nested?


How do you identify what spell is on a spell scroll?

Are they always unidentified, except for when a Wizard already knows the spell? If the wizard already knows it, is it already identified?


Showing H is a normal subgroup by calculating left and right coset

If $G = \begin{pmatrix} a & b \\ 0 & 1 \end{pmatrix} a,b\in (\mathbb{R}) : a \neq 0$)   and assume G is a group under matrix multpication  Prove that H = ($\begin{pmatrix} 1 & t \\ 0 & 1 \end{pmatrix}: t\in\mathbb{R}$) is a normal subgroup of G  I'm meant to show that H is a normal subgroup by showing that the left coset is equal to the right coset.  So far I have shown the following:  take $g=\begin{pmatrix} a & b \\ 0 & 1 \end{pmatrix}$   then  $gH=\begin {pmatrix}a &at+b \\ 0 &1 \end{pmatrix}$  and take $g'=\begin{pmatrix} a' & b' \\ 0 & 1 \end{pmatrix}$  then $Hg'=\begin{pmatrix} a' & b'+t \\ 0 & 1 \end{pmatrix}$  I don't quite understand how $gH=Hg'$


I have one sample with values of sugar intake pre and post intervention. I transformed the values for t test as the change from pre to post was negatively skewed but now I dont know how to report the results from t test? Can I just square back the mean and CI?


Let $X_{1},X_{2},X_{3}....X_{n}$ be independent and identically distributed random variables with continuous density symmetric around 0. Also suppose $\mathbb{E}(|X_{1}|)$=2. Define two variables Y and Z as $Y=\sum_{i=1}^{n}X_{i}$ and $Z=\sum_{i=1}^{n}$1$_{X_{i}>0}$ We are asked to find the covariance between Y and Z. My approach: As $X_{i} $ has symmetric density around 0, $\mathbb{P}(X_{i}>0)=\frac{1}{2}$ and because Z is an indicator function for each $X_{i}$ being greater than 0, Z $\sim$ Bin(n,$\frac{1}{2}$). Because $\mathbb{E}(|X_{i}|)$=2, $\int_{0}^{\infty}xf_{x}(x) dx=1$ and $\int_{-\infty}^{0}xf_{x}(x) dx=-1$ Which means that expectations of $x$ given $x$ is positive or negative are 1 and -1 respectively. Now $\mathrm{Cov}(Y,Z)=\mathbb{E}(YZ) - \mathbb{E}(Y)\mathbb{E}(Z)$, let’s call $W=f(Y,Z)=YZ$, using law of iterated expectations with a slight abuse of notation $\mathbb{E}(W)=\mathbb{E}(\mathbb{E}(W|Z=r)$, where the first expectation on right is with respect to the marginal of Z and inner expectation is with respect to conditional distribution of W with for a given Z=r. For the inner expectation, given a value of Z=r, the term in Z would have exactly $r$ $1$’s and $n-r$ $0$’s which would be multiplied with each $X_{i}$ term in Y so $W|(Z=r)=r(\sum_{i=1}^{n}X_{i})$ so that the inner expectation becomes $\mathbb{E}(W|Z=r)=r\mathbb{E}(\sum_{i=1}^{N}X_{i})$. The expectation on right has exactly $r$ times $1$’s and $n-r$ times $-1$’s corresponding to $X_{i}$ being positive $r$ times with expectation of $1$ and negative $n-r$ times with expectation of $-1$. So $\mathbb{E}(W|Z=r)=r(2r-n)=2r^{2}-rn$ Since Z$\sim$ Bin(n,$\frac{1}{2}$), $\mathbb{E}(Z)=\frac{n}{2}$, $\mathrm{Var}(Z)=\frac{n}{4}$ so $\mathbb{E}(Z^{2})=\frac{n}{4}+\frac{n^{2}}{4}=\frac{n(n+1)}{4}$ Hence the final expression becomes $\mathbb{E}(W)=2\mathbb{E}(r^{2})-n\mathbb{E}(r)=\frac{n^{2}+n}{2}-\frac{n^{2}}{2}=\frac{n}{2}$ And since $\mathbb{E}(Y)=0$ due to symmetric density around 0, $\mathrm{Cov}(Y,Z)=\mathbb{E}(W)-\mathbb{E}(Y)\mathbb{E}(Z)=\frac{n}{2}$ Is the above approach correct for finding the covariance between Y and Z? Any suggestions/corrections will helpful


giving link inside a table row using javascript

I am passing values to a table from my dropdown values using JavaScript.   I need to give a link on the last row of my table. I tried the following code, but it's not working. Can anyone suggest any other idea please?  $("#btnadd").click(function(){     var lov_name  = $("#lov_name option:selected").text();     var lov_value = $("#lov_value").val();     var markup    = "
" + lov_name + "	" + lov_value + "	 Edit
";      $("table tbody").append(markup);     $(".alert-success").css('display','block'); });


How to fix "The system is running in low-graphics mode" error?

Note: This is an attempt to create a canonical question that covers all instances of "low-graphics mode" error that occurs to a user, including but not limited to installation of wrong drivers, incorrect or invalid lightdm greeters, low disk space, incorrect installation of graphics card like ATI and Nvidia, incorrect configuration of xorg.conf file while setting up multiple monitors among others. If you are experiencing the "low-graphics mode" error when trying to login but none of the following answers work for you, please do ask a new question and then update the answers of this canonical question as and when your new question gets answered.   When I try to boot into my computer, I am getting this error:  The system is running in low-graphics mode Your screen, graphics cards, and input device settings could not be detected correctly. You will need to configure these yourself.   How do I fix the failsafe X mode and login into my computer?  Answer index:


What is the proof that the universal constants ($G$, $\hbar$, $\ldots$) are really constant in time and space?

Cavendish measured the gravitation constant $G$, but actually he measured that constant on the Earth. What’s the proof that the value of the gravitation constant if measured on Neptune would remain the same? What’s the guarantee of its being a constant?  There are many such constants; I just took one example so that you can understand what I intended to ask. Is the value of the speed of light really a constant? Who knows that it wouldn’t change its value on other planets, or, more precisely, what’s the guarantee that the speed of light remains the same even near a black hole? If no one can ever reach a black hole, then how can a scientist claim the value of the speed of light?


I am reading Ahlfors' complex analysis.  He let $0<k<1$ and defined $$K=\int_{-1}^1 \frac1{\sqrt{1-t^2} \sqrt{1-k^2t^2}}dz$$ $$K'=\int_{1}^{1/k} \frac1{\sqrt{t^2-1} \sqrt{1-k^2t^2}}dz$$ An exercise requires me to prove that $K=K'$ iff $k=(\sqrt{2}-1)^2$. So these are elliptic integral and I read online that in general, they cannot be computed. And since Ahlfors did not say much about it, I don't think we can compute $K$ and $K'$. So how do we approach?


Data recovery after Copying file to block device

I have an NTFS formatted USB Hard drive that has my personal files backup. Today I mounted the drive to an Oracle Linux system and copied a regular file using the below command (please see below commands). By mistake I used the device file /dev/sdb1 during copy.  mount -t ntfs-3g /dev/sdb1 /sample cp file1 /dev/sdb1   After this I unmounted the drive and connected to Windows system. Now Windows system complains that the drive need to be formatted and/or corrupted.  My question is: can we recover this drive without losing any personal data? How can I view the files available on this drive? Just mounting back to Linux system will show the files?


How to retrieve all keys (or values) from a std::map and put them into a vector?

This is one of the possible ways I come out:  struct RetrieveKey {     template <typename T>     typename T::first_type operator()(T keyValuePair) const     {         return keyValuePair.first;     } };  map<int, int> m; vector<int> keys;  // Retrieve all keys transform(m.begin(), m.end(), back_inserter(keys), RetrieveKey());  // Dump all keys copy(keys.begin(), keys.end(), ostream_iterator<int>(cout, "\n"));   Of course, we can also retrieve all values from the map by defining another functor RetrieveValues.  Is there any other way to achieve this easily? (I'm always wondering why std::map does not include a member function for us to do so.)


Regular $n$-gon in the plane with vertices on integers?

For which $n \geq 3$ is it possible to draw a regular $n$-gon in the plane ($\mathbb{R}^2$) such that all vertices have integer coordinates? I figured out that $n=3$ is not possible. Is $n=4$ the only possibility?


Will I be allowed to board a two-legged flight if I do not have the required visa for the second leg of the flight?

I purchased a flight from Brazil to Spain, with stopover in Morocco. My intention is to fly to Morocco and not take the second leg to Spain. I do not need a visa to Morocco but I need a Schengen Visa to enter Spain. Will I be allowed to board the first leg (Brazil->Morocco)?  Thanks.


Reason for the discreteness arising in quantum mechanics?

What is the most essential reason that actually leads to the quantization. I am reading the book on quantum mechanics by Griffiths. The quanta in the infinite potential well for e.g. arise due to the boundary conditions, and the quanta in harmonic oscillator arise due to the commutation relations of the ladder operators, which give energy eigenvalues differing by a multiple of $\hbar$. But what actually is the reason for the discreteness in quantum theory? Which postulate is responsible for that. I tried going backwards, but for me it somehow seems to come magically out of the mathematics.


Remove labels from showing up in final document

I have these labels in the margin everywhere in my final document. I don't think they look good, and I want to get rid of them, but I can't figure out how.   I searched around and this is the closest I could find -   However, the text "showlabels" is nowhere in my files.  \usepackage[nolabel, final]{showlabels} does not remove the labels from the final pdf.  \usepackage[right]{showlabels} also does not move the labels to the right margin, which must mean the labels are coming from something else  Thanks


How many ways are there to arrange 10 distinct men and 10 distinct women on 7 seats, such that no 2 women are together?

The part where the number of seats are limited is causing a difficulty. Seating all of the men and women with this restriction is easy. But the restriction on number of seats mixed it all up.


What is the meaning of the phrase:  "I am but one." In sentence it is used as: "I am but one person out of the billions that exist on this earth."


If the polynomial $x^4-6x^3+16x^2-25x+10$ is divided by another polynomial $x^2-2x+k$, theremainder is $x+a$, find $k$ and $a$.  My Attempt,  $f(x)=x^4-6x^3+16x^2-25x+10$  $g(x)=x^2-2x+k$  $R=x+a$  Here, the divisor is in the quadratic form. so how do I  use the synthetic division


Installing Windows 8.1 after Ubuntu 14.04

So I'm new to Ubuntu and I want to dual boot it with Windows 8.1.So first I installed my Ubuntu in my laptop and it is installed successfully(I think) so it's working well now. I have my Windows 8.1 in my flashdrive and when I try to run the setup.exe I got this error:     An error occurred while loading your archive   And so my question now:   Is it the same to make a dual boot from Windows to Ubuntu? (Because mostly what I've searched is FROM Windows to Ubuntu) and in my case is Ubuntu to Windows (I installed Ubuntu first because IN Windows normally the second OS will be the primary OS) e.g. when Windows is installed and you try to install Ubuntu and so the priority OS now will be Ubuntu. And I want to boot automatically to Windows that's why I installed the Ubuntu first.  How to install Windows 8.1 now after installing Ubuntu? How to make partition in Ubuntu ?


Can we construct a non-measurable set using only the axiom of countable choice?

I know that it's established that non-measurable sets cannot be constructed without the axiom of choice but I was wondering if countable choice was enough? Since the ones that I have seen use uncountable choice. My intuition tells me no. Since I tend to think of measurable sets as being closed under "countable operations". Although if we're being precise the operations in question are unions, intersections and complements; so i was wondering if we can use countable choice in some way to construct a non-measurable set.


Dometic cfx50w fridge - how to choose small DIY battery setup

I am looking for some help to understand what kind of battery could power a Dometic cfx50w 12/24/120V compressor fridge, while on-the-go. Here are the electrical specifications:     Input voltage (AC) 120-240 V   Input voltage (DC) 12/24 V   Rated input current (AC) 0.79 A   Rated input current (DC) 7.8 A   Input frequency 50/60 Hz     ()  Most people choose a dual battery DC/DC setup for their car. I am looking for a more compact and portable solution, to get a few hours (minimum 4) running in normal conditions. I am thinking of a battery pack like those used in the RC hobby. Would this work?  I am looking for best battery chemistry and recommended ah rating considering the fridge would run for 10 minutes every hour and battery would have to provide 4 hours of power without getting damaged. Fridge has a cutoff voltage of 11.1v. I am wondering if lipo or lifepo4 batteries could replace a flooded lead acid and what would be the usable capacity. Battery would be charged at home by small rc charger.


Why is sudo colourless when user is colourful for `ls` command?

When I run the ls command using sudo-powers the file and directory names are all in white. When I run it as user the directory names are in bluish-purple, the scripts are in green and and the Asembler program is in white. I did do a modification to from "color-prompt = YES" or something like that in some place but I don't remember configuring colour file names based on my User ID. Example  I like the coloured file types, how can I extend this to sudo?


This in Java as well.  I can't seem to get this method to work, the saving part works great and saves the object. But once I try to read the file it doesn't work and I get ObjectInputStream errors. I'm new to using the Serializable interface and none of the other questions seem to help me.  The expected output is name Joe, weight 153, height 69.  The errors are:    java.io.InvalidClassException: Person; local class incompatible: stream classdesc serialVersionUID = -1404541419531259795, local class serialVersionUID = 3020781085877336930     at java.io.ObjectStreamClass.initNonProxy(Unknown Source)     at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)     at java.io.ObjectInputStream.readClassDesc(Unknown Source)     at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)     at java.io.ObjectInputStream.readObject0(Unknown Source)     at java.io.ObjectInputStream.readObject(Unknown Source)      public static boolean save(Person p, String filename) {         try {         ObjectOutputStream os = new ObjectOutputStream(                 new FileOutputStream(filename));         os.writeObject(p);         os.close();         return true;     } catch (Exception e) {         e.printStackTrace();     }     return false; }      public static Person read(String filename) {     try {         ObjectInputStream oi = new ObjectInputStream(new FileInputStream(                 filename));         Object o = oi.readObject();         oi.close();         if (o instanceof Person)             return (Person) o;     } catch (Exception e) {         e.printStackTrace();     }     return null; }  public static void main(String[] args) {     Scanner s = new Scanner(System.in);     System.out.println("Do you want to save or load?");     String option = s.next();     Person p = new Person("Joe", 154, 69);     if (option.equals("save")) {         if (save(p, "newfile")) {             System.out.println("Saved.");         }     }     if (option.equals("load")) {         Person p1 = read("newfile");         if ((p1 != null)) {             System.out.println(p1.getInfo());         }     }  }   }


How does an implementation of the c sharp specification ensure static constructors are executed in a threadsafe manner?

The c# static constructors is guaranteed to execute only once. Therefore, if I have say ten threads accessing a member of class A, and the static constructor of A hasn't been run, and the static constructor of A takes 10 seconds to run, these threads will block for ten seconds.   This seems amazing to me - how is this achieved within the JIT/CLR? Does every access to a static field enter a lock, check if the static constructor is initalized, then initialize it if it isn't? Wouldn't this be very slow?    To be clear, I want to know how an implementation of the specification achieves this. I know that static constructors are threadsafe, this question is not asking that. It is asking how the implementation ensures this, and whether it uses locks and checks under the hood (these locks are not locks in c sharp, rather locks used by the JIT/CLR/other implementation).


Minimizing a functional with a free boundary condition

Find the extremals of the functional    $$\text{J}(y)=  y^2(1)  + \int_0^1 y'^2(x)dx   , \ \ y(0)=1.$$   Answer: $y(x)=1-\frac{1}{2}x$   My solution:   $ F (x,y,y')=y'^2(x)$  After solving the Euler Lagrange equation we get $\frac{\mathrm{d}}{\mathrm{d}x}(2y')=0$  Which implies that $y=\frac{a}{2}x+b$ , using initial value condition we get $b=1$. Could you please help me find value of $a$?


"I took you for a girl with brains" Is this sentence right?  Technically and scientificically. Cause humans have only 1brain I presume.


Components of an n-dimensional random variable from a uniform distribution are independent

For a random variable $X \in \mathcal{R}^n$ from a uniform distribution, are the components independent? i.e,  $Pr(X_1,X_2,...,X_n) = Pr(X_1)Pr(X_2)....Pr(X_n)$   If so, does it depend on the uniform distribution? e.g if the uniform distribution is a p-dimensional hypercube.


How to prove that $n^5 - n$ is a multiple of $5$?

Hello I'm new to induction so please bare with me. For this problem I have to use induction to prove: For every integer $n\geq 1$, the number $n^5 − n$ is a multiple of $5$. Can someone please help me figure this out. I've tried to follow the examples in the book, but they were very confusing.


After upgrading to OS X Yosemite I cannot run xelatex

When compiling TeX files that compiled OK before the upgrade I get an error message -bash: xelatex: command not found. I have not changed my PATH:   /opt/local/bin:/opt/local/sbin:/Users/richard/.iraf/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/texbin


How to identify spammy domains giving backlinks to my site (to submit in disavow links in WMT)

Google is out with much awaited feature. But out of 100's of domains giving backlink to my site I want to simply find the spammy ones and disavow domain-wise using "domain:" feature.  I'm looking for a tool wherein I'll feed list of domains and then it should tell me a domain's spammy-ness in a scale.  Currently I'm trying Netpeak Checker.  Any suggestions?


How to delete duplicate rows in SQL Server?

How can I delete duplicate rows where no unique row id exists?  My table is  col1  col2 col3 col4 col5 col6 col7 john  1    1    1    1    1    1  john  1    1    1    1    1    1 sally 2    2    2    2    2    2 sally 2    2    2    2    2    2   I want to be left with the following after the duplicate removal:  john  1    1    1    1    1    1 sally 2    2    2    2    2    2   I've tried a few queries but I think they depend on having a row id as I don't get the desired result. For example:  DELETE FROM table WHERE col1 IN (     SELECT id     FROM table     GROUP BY id     HAVING (COUNT(col1) > 1) )


I am trying to test a method sendEmail. I would like to do a negative test on the method. I want to catch the IllegalStateException case. The sendemail method is in my ServiceClient class. In the test I am mocking serviceClient and apiClient the code for the method looks like this: public HttpStatus sendEmail(){         Supplier<HttpStatus> apiRequest = apiclient.post(command);         return retry(apiRequest).orElseThrow(() -> new IllegalStateException()); }  private <T> Optional<T> retry(Supplier<T> apiRequest) {     T result = apiRequest.get();     if (result != null) {       return Optional.of(result);     }     result = apiRequest.get();     if (result != null) {       return Optional.of(result);     }     return Optional.empty(); }   The test that I am trying to run looks like this   @Test   void sendEmailShouldThrowIllegalStateException() {      when(apiclient.post(any())         .thenReturn(null, null);          assertThrows(IllegalStateException.class,         () -> serviceClient         .sendEndpointRegistrationEmail());   }  I thought this would work because the mock method should return null which would trigger the exception, but it throws org.opentest4j.AssertionFailedError: Unexpected exception type thrown ==> expected: <java.lang.IllegalStateException> but was: <java.lang.NullPointerException>  Just to clarify the issue isn't that I'm getting a NPE. The issue is that the wrong exception is being thrown.


C# Lambda Expression - Condense And/Or Logic

I have the following lambdas generated by reflection and need to know how to condense these into a single expression:  Current:  {((txliferequest.OLifE.Party.Any(party => party.Address.Any(address => address.Line1.Contains("Address 1"))) AndAlso     txliferequest.OLifE.Party.Any(party => party.Address.Any(address => address.Line2.Contains("Address 2")))) AndAlso     txliferequest.OLifE.Party.Any(party => party.Address.Any(address => address.City.Contains("City"))))}   Needed:     {((txliferequest.OLifE.Party.Any(party => party.Address.Any(address => {         address.Line1.Contains("Address 1") AndAlso         address.Line2.Contains("Address 2") AndAlso         address.City.Contains("City")         })     )}   Is there a way to do this using the Expression API?  It says the final expression is not able to be reduced.


.Net Application Using Inefficient Query Plan - caused by ARITHABORT setting?

One of our applications is causing a problem in that there is a stored procedure that returns fine in SSMS, in under 1 sec, but in the application its taking anything up to 10 minutes, depending on the parameters used. Any combination of parameters work fine in SSMS and the execution plan looks good to me.   However, when profiled the Application is clearly using a different, less efficient plan. The SqlClient used to connect has the ARITHABORT setting, set to OFF, which when replicated in SSMS I run into the same performance issues.  I'm guessing ARITHABORT OFF will not allow the optimizer to use the cached plan? Or does it run a separate plan?  According to the Apps guys, there is no way to change the SQLClient connection to use ARITHABORT ON  I'm guessing the ARITHABORT setting is a bit of a misnomer here, and it's actually a parameter sniffing thing caused by the optimizer not using the good plan?  I need to force it to use a good plan regardless, so how best to address the issue? Do I create a plan guide or optimize the stored proc in some way?  This is SQL Server 2008R2 SP2.


How do I install Skype or Viber on Ubuntu Touch?  My platform: Google Nexus 4, Ubuntu Touch stable


Why would Ramsay Snow be so cruel to his prisoner in season 3?

I recently finished watching the 3rd season of Game of Thrones (I haven't read the book, I should admit).  One thing does bother me. Ramsay Snow      kept Theon Greyjoy as his prisoner in order to get some information and as a hostage.   But why do we see such terrible tortures? And most of all, why      the castration of the prisoner   that is an irreversible act? Now, it's clear, that the value of the hostage after such procedure decreases very significantly - we can see that      in episode 10, there the father refuses to trade for his son any of the lands.   This is definitely not required to retrieve information - they already had all the information they needed before. Therefore, this procedure is not just cruel, it's also very unprofitable, and can expose serious threats -      I think in season 4 we shall see that, since the sister of Theon marched to his resque.   So, why would Ramsay do that - is he just a psychopath, who tries to satisfy his wicked wishes, despite the cost?  The difference with Lannister Jaimie is that      Jaimie lost only his hand   and this does not give his father very big reasons to start a revenge war.


Why only finite intersection of open sets is open

We all know the definition of a topology $T$ on a nonempty set $X$: A collection $T$ of subsets of a nonempty set $X$ is a topology on $X$ if, (1) $\emptyset,X\in T$ (2) For any arbitrary collection of elements of $T$ their union is also in $T$ (3) For any finite collection of elements of $T$ their intersection is also in $T$. My question is why in the definition only the finite intersection is allowed why not arbitrary intersection?


How to Create My OWN LaTeX Template Document?

For almost every document that I type in LaTeX, I start by opening one of the most recent documents that I made, copying all of the packages and pre-set commands, and pasting them in the new document. This is because I have a lot of packages that I use on a regular basis. However, it gets pretty annoying and my preamble is messy.  I would like to create some sort of a template that contains all of the packages and commands that I normally use so that when I decide to start a new document I can use a single command and call on a file that has all of those packages already set up. Is something like this possible?   Thank you for your time


Why would Sith Masters teach apprentices, at all?

We know (from the accidents that happened between 1999-2005) that      The Sith rely on their passion for their strength. They think inward, only about themselves.   and we also know that     Always two there are, no more, no less. A master and an apprentice.   And from the EU, we know that each Sith apprentice will (try to) kill and replace their master at some point, in order to become the one who bundles the entirety of the Sith power (so to say).    Q1: Given these points, why do Sith bother to take up apprentices at all? It doesn't make sense to pass on their knowledge of the dark side, because they only care about themselves, and it would also contradict this philosophy to teach competition that will endanger their power and ultimately their life.    Q2: As a special case of this question in The Empire Strikes Back, Vader tries to turn Luke by saying     Luke, you can destroy the Emperor. He has foreseen this. It is your destiny. Join me, and together we can rule the galaxy as father and son.   (emphasis by me)  Now, the same question rises: If the Emperor has foreseen that Luke can destroy him, why would he want Luke to become a Sith?


Proving the sum of two functions is $\Theta$ of the max of those functions?

Suppose that the functions $\ f_1, f_2, g_1, g_2: \mathbb{N}\to\mathbb{R}$ (set of real numbers greater or equal to 0) are such that $\ f_1 \in \Theta \ (g_1)$ and $\ f_2 \in \Theta \ (g_2)$.  Prove that $ \ f_1 + f_2 \in \Theta (\max\{\ g_1, g_2\})$  I have no idea how to go about this proof. Could someone please explain?  Thank you!


count data that does not follow poisson distribution

Im analysing count data (number of clinic visits) when I test for poisson distribution using 1 sample KS test in spss the sig is <0.05( meaning it doesnt follow poisson distribution ) it does not follow normal distribution either,  no values of zero, the values are either 1,2,3,or 5, what can I do


Is there a way to check when the OS was installed?

I was wondering if there is a way to check the date the OS was first installed. Or maybe when it was first booted. I can't remember when i did d installation n i was just wondering if there was a way to find out.


Regular Expression, getting there but not quite

Using this code, I can remove all words that start with affirm (lower case "a" at the beginning of the word.  But I can't get other versions, without respect to case, to be removed.  This is despite using "re.I" at the end of my re.sub statement. Any advice?   import re txt='affirmed and the affirmance and AFFIRMED and Affirm case' wordList = ['affirm\w+', '(ca\w+)'] for word in wordList:     txt = re.sub(word, '', txt, re.I) print txt   Output:   and the  and AFFIRMED and Affirm


For which $n, 120\mid n^5-n$ is true?  I could show that $30\mid n^5-n$ is always true by following way:  $n^5-n = (n-1)n(n+1)(n^2+1)$  Since the product of three consecutive integers is a factor of $n^5-n$, the number is divisible by $2$ and $3.$  For divisibility by $5$: $n \equiv 0,1,2,3,4 \pmod 5 \implies n^2 \equiv 0,1,4,4,1 \pmod 5\implies n^2+1 \equiv 1,2,0,0,2 \pmod 5$.  It follows that $n^5-n$ is divisible by $5$.  Combining everything together, we conclude that $n^5-n $ is divisible by $30.$  For divisibility by $120$, since, the number is divisible by $3\cdot5=15,$ consider divisibility by $8$:  $n \equiv 0,1,2,3,4,5,6,7 \pmod 8 \implies n^2 \equiv 0,1,4,1,0,1,4,1 \pmod 8\implies n^2+1 \equiv 1,2,5,2,1,2,5,2 \pmod 8$   Therefore $n^2+1$ is never divisible by $8.$ So, $n^5-n$ will be divisible by $120,$ when $n \equiv 0,1,7 \pmod 8.$  The answer key says that the statement is true for all odd values of $n$. Help me.


Inconsistent shell behavior involving endline characters

Why does:  [ "a" != "$(printf "\na")" ] && echo true || echo false   print true while:  [ "a" != "$(printf "\n")a" ] && echo true || echo false   print false?


I understand that adding content to a tag wiki gets two reputation points.  Today, I appear to get four points (2 x 2) for    which I do not understand. Why the double allocation?


Is it possible to use `find -exec sh -c` safely?

I'm trying to use find to echo 0 into some files, but apparently this only works with sh -c:  find /proc/sys/net/ipv6 -name accept_ra -exec sh -c 'echo 0 > {}' \;   But using sh -c with find -exec makes me feel very uneasy because I suspect quoting problems. I fiddled a bit with it and apparently my suspicions were justified:   My test setup:  martin@dogmeat ~ % cd findtest  martin@dogmeat ~/findtest % echo one > file\ with\ spaces martin@dogmeat ~/findtest % echo two > file\ with\ \'single\ quotes\' martin@dogmeat ~/findtest % echo three > file\ with\ \"double\ quotes\" martin@dogmeat ~/findtest % ll insgesamt 12K -rw-rw-r-- 1 martin martin 6 Sep 17 12:01 file with "double quotes" -rw-rw-r-- 1 martin martin 4 Sep 17 12:01 file with 'single quotes' -rw-rw-r-- 1 martin martin 4 Sep 17 12:01 file with spaces  Using find -exec without sh -c seems to work without problems - no quoting necessary here:  martin@dogmeat ~ % find findtest -type f -exec cat {} \; one two three  But when I'm using sh -c {} seems to require some kind of quoting:  martin@dogmeat ~ % LANG=C find findtest -type f -exec sh -c 'cat {}' \; cat: findtest/file: No such file or directory cat: with: No such file or directory cat: spaces: No such file or directory cat: findtest/file: No such file or directory cat: with: No such file or directory cat: single quotes: No such file or directory cat: findtest/file: No such file or directory cat: with: No such file or directory cat: double quotes: No such file or directory  Double quotes work as long as no file name contains double quotes:  martin@dogmeat ~ % LANG=C find findtest -type f -exec sh -c 'cat "{}"' \; one two cat: findtest/file with double: No such file or directory cat: quotes: No such file or directory  Single quotes work as long as no file name contains single quotes:  martin@dogmeat ~ % LANG=C find findtest -type f -exec sh -c "cat '{}'" \; one cat: findtest/file with single: No such file or directory cat: quotes: No such file or directory three    I haven't found a solution that works in all cases. Is there something I'm overlooking, or is using sh -c in find -exec inherently unsafe?


Is taking the lim of the series the same to taking the series of the lims?

Given non negative real sequences $(a_{1,k})_k, (a_{2,k})_k, ..., (a_{n,k})_k$,... with $n$ all over $\mathbb{N}$. Assume that $\lim\limits_{n \to \infty} a_{n,k}$ exists for all $k$ and $\sum\limits_{k=1}^{\infty} a_{n,k}$ exists for all $n$.   Is it necessary that $\lim\limits_{n \to \infty} \sum\limits_{k=1}^{\infty} a_{n,k} =  \sum\limits_{k=1}^{\infty} \lim\limits_{n \to \infty} a_{n,k}$, if both of the sides is either a real number of $+\infty$?  My friends and I were arguing over this, and still we came to no conclusion. If it isn't necessary, in what conditions will the equality holds?


If $U$ is uniformly distributed on $S^{2}$, then its first component is uniformly distributed on $(-1,1)$.

Assume $\mathbf{U} = (U_{1}, U_{2}, U_{3})' \sim unif(S^{2})$. How would I show that $U_{1} \sim unif(-1,1)$?  I don't know if I'm confusing myself, because I can't see this as being true for higher dimensions.


Group with exactly two subgroups of index 2

I am looking for a group $G$ such that $G$ has exactly two subgroups of index 2.   I have searched by GAP but I couldn't find it.


Where does the extra kinetic energy of the rocket come from?

Consider a rocket in deep space with no external forces. Using the formula for linear kinetic energy $$\text{KE} = mv^2/2$$ we find that adding $100\ \text{m/s}$ while initially travelling at $1000\ \text{m/s}$ will add a great deal more energy to the ship than adding $100 \ \text{m/s}$ while initially at rest: $$(1100^2 - 1000^2) \frac{m}{2} \gg (100^2) \frac{m}{2}.$$ In both cases, the $\Delta v$ is the same, and is dependent on the mass of fuel used, hence the same mass and number of molecules is used in the combustion process to obtain this $\Delta v$. So I'd wager the same quantity of chemical energy is converted to kinetic energy, yet I'm left with this seemingly unexplained $200,000\ \text{J/kg}$ more energy, and I'm clueless as to where it could have come from.


Sum of one column values from sql database using java?

The code seems to show no errors yet when I run it, my ide shows a lang.nullpointerexception. I have no idea what is wrong or how to fix this problem. Thank you so much for taking the time to help me. Much appreciated.   String sql="Select cast(Sum(Copper) as varchar(255)) as sumcu from RawMaterials"; st=conn.prepareStatement(sql); rs=st.executeQuery(); if(rs.next()){ String sum = rs.getString("sumcu"); sum_text.setText(sum);


I just posted on a closed question on the iOS app

I just posted on a closed question   How?  Side point:  I do not see any indication that the post is closed on the app


fontspec defines the commands  \setmainfont{font name}[font features] \setsansfont{font name}[font features] \setmonofont{font name}[font features]   to set the document’s default fonts. However, if I use a sans-serif font as the main font, e. g. \setmainfont{Latin Modern Sans}, \rmfamily is redefined as Latin Modern Sans, so I lose the ability to specify a separate serif font. Of course, I could set the serif font with \setsansfont, but then I have the fonts all backwards.  Shouldn’t there also be a command \setseriffont? I don't think a “main” font should necessarily always be a serif font. If this is intended, what is the best way to have a sans-serif font as the default font, but still have a serif font defined as \rmfamily?  (This is unrelated to . I already explained that I could typeset the document in a sans-serif font by using \setmainfont. This question is about the semantics of the command \setmainfont, which doesn’t seem to imply any specific font characteristics from its name, compared to \setsansfont, \rmfamily and \sffamily – see also .)


Historical average with exponential smoothing model

This topic similar with this one  But I perfrom exponential smoothing model in R.  df=structure(list(date = structure(1:12, .Label = c("01.01.2017",  "01.02.2017", "01.03.2017", "01.04.2017", "01.05.2017", "01.06.2017",  "01.07.2017", "01.08.2017", "01.09.2017", "01.10.2017", "01.11.2017",  "01.12.2017"), class = "factor"), value = c(200L, 100L, 460L,  300L, 280L, 280L, 140L, 180L, 80L, 80L, 180L, 60L), common = structure(c(1L,  1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = "158150- 01195т", class = "factor")), .Names = c("date",  "value", "common"), class = "data.frame", row.names = c(NA, -12L ))   i perform forecast for each groups separately) using ets function from forecast package (common is grouping variable)  here forecast for initial dataset   it is wrong result, but the main is that forecast on 1 year age ahead has static values(like historical mean)   How can i understand why forecast show same value in exponential smoothing model. Is it possible to fix it?  I can provide my R code, if it is needed.


Show that $\lim (\int_{a}^{b} f^n )^{\frac{1}{n}} = \sup(f(x))$

Let $f$ be continuous on $[a,b]$, let $f(x) \geq 0$ for all $x \in [a,b]$ and let $M_n = (\int_{a}^{b} f^n )^{\frac{1}{n}}$. Show that $\lim(M_n) = \sup\{f(x):x\in [a,b]\}$   Here is what I have so far: Let $M = \sup(f)$ and $p \in [a,b]$ such that $M = f(p)$. Given $\epsilon > 0$, there exists an interval $[c,d]$ containing $p$ such that   $$M - \epsilon \leq f(x) \leq M, ~~~x \in [c,d]$$  Note that $0 \leq (d-c) \leq (b-a)$ so I raise everything to the power of $n$ and then add $(d-c)$ and $(b-a)$ to the inequality. $$ (M-\epsilon)^n(d-c) \leq \int_{c}^{d}f^n \leq \int_{a}^{b}f^n \leq M^n(b-a)$$  Then I take the $nth$ root to get  $$(M-\epsilon)(d-c)^{1/n} \leq M_n \leq M(b-a)^{1/n}$$  Then since $\lim(\alpha)^{1/n} \to 0$, by the squeeze theorem, $\lim(M_n) = \sup(f(x)) = 0$?


How can I change the chapter numbers in Bengali numerals/words. The chapter numbers are coming in Arabic format by default, instead of specifying numeral in font option.  \documentclass[12pt]{book} \usepackage{fontspec} \usepackage{polyglossia} \setmainlanguage[numerals = Bengali, changecounternumbering=true]    {bengali} \setmainfont{Bangla Akademi}   \begin{document}  \chapter{ভূমিকা}  \end{document}   The above code give the following result    I expect an output like this  অধ্যায় ১  অধ্যায় ২ ...  or like this  প্রথম অধ্যায় (=First Chapter)  দ্বিতীয় অধ্যায় (=Second Chapter)


wordpress function to change post status

I'm running the  plugin at . It fetches videos using the youtube api and displays them on your website.  Within the plugin script, there is the following sequence:      if (empty($items)) {$ret .= " 'No new videos.'";}     else foreach ( $items as $item ) :   Is it possible to change the wordpress post status from published to draft if "No new videos" are found?  I am thinking the solution is using the wp update post function and something along the lines of the following:          <?php         // Update post         $my_post = array();         $my_post['ID'] = $id;         $my_post['post_status'] = 'draft';          // Update the post into the database         wp_update_post( $my_post );         ?>


I have been using Python more and more, and I keep seeing the variable __all__ set in different __init__.py files.  Can someone explain what this does?


Why do 7 segment LED displays break apart when I brush my teeth?

This question might sound silly, but it is very serious (although geeky, I must admit). When I use my electric toothbrush in front of my alarm clock (one of those with a big red LED display), the numbers seem to break apart. Why?  With my current alarm clock the first 3 segments (a,b,c) make one group and the other 4 make another one. The striking thing is that both groups seem to slowly oscillate, in anti-phase. I cannot affirm that the grouping is the same for every display of the kind -- and I cannot check now because I only have this one LED display at home -- but I've seen this illusion on many different displays in the past.   I think this illusion is fascinating (told you I'm a geek) and I would like to understand why it is...  I believe that it has something to do with    1) the vibrations of the toothbrush making my eyes oscillate in their orbits so the image seems to move (a bit like when you touch your eye on the side with your finger and the whole image seems to move),    2) with the periodic refresh of the segments. I suspect that the two groups I'm seeing actually correspond to two groups of bars blinking in sync, so there really are two groups, (but why do they dislocate like that?)    3) with our periodic perceptual "refresh rate". Something similar to what makes us see car wheels as stationary when they rotate at a certain speed.   I must say my competence in electronics is close to zero, so my questions might be trivial to you guys. How does the refresh of the line segments in a 7 segments display happen? Is it cycling (a,b,c,d,e,f,g,a,b,c...)? How come I see two groups, then? At what frequency are the LEDs blinking? I understand some of these questions depend on the specifications of my alarm clock, but since I've seen this illusion on basically every type of LED display I passed by with my toothbrush (microwave, VHS video recorder (yes the story started long ago. I bought the toothbrush I'm now using just for understanding this silly illusion, but it was actually as a teenager that I noticed it)...), I guess there is something constant there...


Variation of ladder/barn paradox: can observer on ladder see that barn was too small?

Image Source and Extract:   The simplest version of the problem involves a garage, with a front and back door which are open, and a ladder which, when at rest with respect to the garage, is too long to fit inside. We now move the ladder at a high horizontal velocity through the stationary garage. Because of its high velocity, the ladder undergoes the relativistic effect of length contraction, and becomes significantly shorter. As a result, as the ladder passes through the garage, it is, for a time, completely contained inside it. We could, if we liked, simultaneously close both doors for a brief time, to demonstrate that the ladder fits. So far, this is consistent. The apparent paradox comes when we consider the symmetry of the situation. As an observer moving with the ladder is travelling at constant velocity in the inertial reference frame of the garage, this observer also occupies an inertial frame, where, by the principle of relativity, the same laws of physics apply. From this perspective, it is the ladder which is now stationary, and the garage which is moving with high velocity. It is therefore the garage which is length contracted, and we now conclude that it is far too small to have ever fully contained the ladder as it passed through: the ladder does not fit, and we can't close both doors on either side of the ladder without hitting it. This apparent contradiction is the paradox.   I just read about the ladder/barn paradox and was wondering about the following variation: The barn is equipped with some electronics to measure whether the ladder is completely contained, and will switch on a light (on the barn's roof) if the ladder is inside. Now would an observer on the ladder, looking back at the barn after he's gone through, see the light turn on? I assume he should be able to see the light, which moves quicker than the ladder, if it was turned on. From what I've read in posts here, and on , I would guess that the barn electronics will find the ladder small enough and switch on the light. So the observer on the ladder will be surprised by this, which contradicts his own experience. Is that simply the kind of surprises the observer has to live with (when using such transport :-) or is there some fault in my reasoning?


What is $\lim_{n\to \infty}\frac{2n \choose {n}}{4^n}$?

What is the result of the following limit? $$\lim_{n\to \infty}\frac{2n \choose {n}}{4^n}$$  since $$\sum_{k=0}^{2n}{2n \choose {k}}=2^{2n}=4^n$$  then $$\frac{4^n}{2n+1}\leq{2n \choose {n}}\leq 4^n$$  and limit is clealy $\in [0,1]$, but what is it exactly?


Does an unplugged hard drive used for data archival deteriorate?

If I were to archive data on a hard drive, unplug it, and set it on a (not dusty, temperature-controlled) shelf somewhere, would that drive deteriorate much?  How does the data retention of an unplugged hard drive compare to tapes?


I made a high poly model and then baked its textures onto a low poly model. Now I want to give another normal map's details to the model. How can this be done?


How do I trace out the second qubit to find the reduced density operator?

I'm doing an exercise to trace out the second qubit to find the reduced density operator for the first qubit: $tr_2|11\rangle\langle00| = |1\rangle\langle0|\langle0|1\rangle$ I'm just wondering if I do trace for the first qubit, should I have: $tr_1|11\rangle\langle00| = |1\rangle\langle0|\langle0|1\rangle$ or $tr_1|11\rangle\langle00| = \langle0|1\rangle|1\rangle\langle0|$  ? In the Nielsen-and-Chuang textbook, we have $tr(|b_1\rangle\langle b_2|)=\langle b_2|b_1\rangle$. Can I say the left and right hand side are just two ways to locate an element in a matrix? Thanks!!


Ensuring network drives are mounted before performing a backup

I'm trying to write a backup script that can be deployed on many different linux servers, some of which mount network drives as described in /etc/fstab. I want my script to be able to see if any network drives have come unmounted before a backup to ensure that they don't go unsaved. Is there any way to reliably check for this in a bash script?


Making a program to detect if a word is a palindrome (ignoring capitalization)

I have trouble making this program because I don't know how to make it so the program will ignore capitalization. I used .lower but I think I'm inserting it wrong. word=input("Give me a word to detect if it is a palindrome") word=str(word)  if word.lower[::-1]=word :     print("That's a palindrome") else:     print("Sorry this isn't a palindrome")


In terms of conditional sentences, is it correct to say:   if you knew why I WAS here, then I wouldn't need to be here.   or   If you knew why I WERE here, then I wouldn't need to be here.   Which type of conditional is this? Type 2? I was thought at school that there are three types of conditionals. Are there more of them?


If $i^2=-1$ why isn't $i$ also equal to $-\sqrt{-1}$?

I've read on this site several times that it is better to say $i^2=-1$ as opposed to $i=\sqrt{-1}$.   If we let $i^2=-1$, why doesn't $i=-\sqrt{-1}$? This makes sense since $(-\sqrt{-1})(-\sqrt{-1})=-1$.  Does the property $x^2=4\Rightarrow x=\pm2$ not hold here? If so, could someone please explain?  Note; This question is unique because I'm asking just about the fact that since $i^2=-1$, why isn't $i$ equal to $\pm\sqrt{-1}$. User64786 and Dietrich Burde's comment's reveal that what I am asking about is different than the tagged question. It seems that the answer is a matter of convention, not algebra.  Thank you.


Does conservation of information mean that the direction of causality is arbitrary?

If it is the case that the information content of the universe is conserved, and the past can be constructed from a complete knowledge of the future just as easily as vice versa, then is there any reason to conceptualize the past as causally preceding the future, or do the terms "past" and "future" simply refer to "the direction of time in which entropy decreases" and "the direction in which it increases," respectively? If it's the latter, then does the universe's lower entropy in the past explain why information about the past is macroscopically accessible to us, but information about the future is not?  EDIT: To be more specific, the Second Law of Thermodynamics describes entropy as increasing "over time." By "over time," I assume it means "as we observe the past, followed by the future." My question is this: given conservation of information, is there an equally valid alternative way of describing time in which the Second Law states that entropy decreases over time, but "over time" is considered to mean "as we observe the future, followed by the past"? Is this alternative description, combined with complete knowledge of the final state of the universe, sufficient to reconstruct the entire history of the universe farther and farther into the past in such a way that the future appears to causally determine the past, just as we perceive the past as causally determining the future?


What do I do when a moderator has a "God" complex?

Recently, I gave my opinion to a moderator on the Stack Exchange Movies & TV chat room and was scolded like a child. It is very frustrating to me to make a comment in the chat room and constantly be scrutinized for not being in their "club".  I read a previous question, . The answer to that question is:        Send a message to the Stack Exchange team via the "contact us" link at the bottom of any page with your complaint and links to the questions/answers.   Flag for moderator attention and request a second moderator to have a look.         For the record, here are levels of moderation (from highest to lowest):         Developers - Stack Exchange developer team   Community team   Diamond moderators - Elected by the community or appointed as moderators "pro tempore" for beta-sites.   Regular users with reputation points-based privileges      There are only a handful of users that chat in that room, and I believe that most of them are moderators due to the fact that they have the power to delete comments/questions, etc. They all agree with the one moderator who is basically their "leader" So, that is where my frustration lies.  Also, there is never any chat about movies and TV. It is only complaining about ID questions or putting down other Stack Exchange sites if they are beta. It is just frustrating because I love movies and TV, but unfortunately, the chat room never discusses any of that. They are all too worried about the way their Stack Exchange site looks to other Stack Exchange sites… (but only the ones that matter).  What can I do as a new user to chat about Movies & TV on Stack Exchange without a moderator always in the room "judging" every word I say?


Calculating the effect of a marinade on nutrition

While watching a collection of  I was wondering if there is an effective way of calculating the effect that a marinade might have on the nutritional value of meat being marinaded? While I am principally interested in 'calories' I would also like to, for instance, be able to calculate differences in fats and/or carbs. I am not so interested (at the moment) about vitamins or minerals.  The tools I have seen simply aggregate the total of ingredients, but in a marinade many of those ingredients are left behind (and therefore should not count as calories for the dish) but I have to believe (and other articles suggest as much) that there is 'an effect' but I am yet to find a manner for calculating that effect.  Several answers to  dance around the question, and as @Bikerboy389 suggests, maybe I'm "sweating the small stuff" here...still I would like to know. Especially where oils are concerned I'm thinking the effect might be more than just 'a little'


Calling the override function in a vector (C++)

I'm having trouble trying to call the override function of an object that was appended to a vector. I'm not quite sure if I just don't completely understand pointers and references, so I'm not quite sure what to look for when debugging this issue. Here is my code: #include <iostream> #include <vector>  class Task {     public:         Task(std::vector<Task> *list) {             list->push_back(*this);         }          virtual void Run() {             std::cout << "Called Task Run!" << std::endl;         } };  class OverrideTask : public Task {     public:         OverrideTask(std::vector<Task> *list) : Task(list) {}         void Run() override {             std::cout << "Called Override Run!" << std::endl;         } };  int main() {     std::cout << "Main method entered" << std::endl;     std::vector<Task> listOfTasks;      OverrideTask ot = OverrideTask(&listOfTasks);     Task t = Task(&listOfTasks);      for(int i = 0; i < listOfTasks.size(); i++) {         listOfTasks[i].Run(); // Will print "Called Task Run!" twice.     }      ot.Run(); // Prints "Called Override Run!"     t.Run(); // Prints "Called Task Run!" }  When I loop through the vectors, it seems that I can't call the override function, but when I call them directly from the object, they seem to work. Can anybody point me in the correct direction?


How to quantize a system if kinetic energy depends on coordinate?

In a standard physics course we usually learn that quantization of a system is ambiguous if momentum and position happen to be multiplied in the classical Hamiltonian (i.e. the classical Hamiltonian contains a term like $xp$). This ambiguity of quantization seemed more like of an academic interest to me, until I tried to quantize this simple classical system. Suppose we want to model the oscillations of an electron bubble in a system of . If an alkali metal atom, for instance sodium, is thrown into liquid ammonia (NH$^3$), the ammonia dissolves the metal atom it into Na$^+$ ion and $e^-$ ion (see a video of dissolution ). The $e^-$ ion is formed by ammonia turning with more positively charged hydrogen towards electron, forming a cavity of the radius $R\approx 0.32$ nm around the electron.  The electron occupies the lowest energy level inside the cavity. I would like to model radial quantum oscillation of the bubble within adiabatic approximation, where the energy of the electron is added to the effective potential energy of the bubble (the static bubble model was developed by Cohen and Thompson in ; for a free access review paper see ). From a classical picture, everything is more or less clear. The potential energy of the bubble is assumed to consist of the polarization energy, electron energy and energy of surface tension, and it is a function of the radius of the bubble. The kinetic energy of the bubble is assumed to consist only of the kinetic energy of the liquid around the bubble. The liquid is assumed to be continuous and incompressible, and the bubble is assumed perfectly spherical. Classical Lagrangian looks like this: $$ L(R,\dot{R})=K-\Pi=4\pi \rho R\frac{\dot{R}^2}{2}-\Pi(R).\tag{1} $$ The corresponding classical Hamiltonian looks like this: $$ H=\frac{1}{4\pi\rho R}\frac{p^2}{2}+\Pi(R).\tag{2} $$ Now, I know I cannot quantize the system naively by substituting $p\rightarrow \hat{p}$ and $R\rightarrow \hat{R}$ into the Hamiltonian, because the kinetic energy contains the product $R$ and $p$, which do not commute. Is there any good way of quantizing such system? What do people usually do, if they find that kinetic energy of the classical Hamiltonian depends on the position?


Two observers moving opposite to each other will see each other moving at speeds greater than light?

I read this question at another forum but the thread was already closed. Here's the description: Two observers A and B are both moving at a velocity of 0.9 times the speed of light with respect to a stationary object. So, won't A see B moving at a speed greater than light?


How to active class click function after using 'createElement'

I am trying to active function when clicking on button which is created with createElement.  On html code:  <fieldset class="form-fieldset">    <button type="button" class="btn-ref">Hello</button> </fieldset>   On javascript:  $('.btn-ref').click(function(){    var newButton = document.createElement('button');    newButton.className="btn-ref";    $('.form-fieldset').append(newButton); });   On original code, when clicking on button does create new button. But after clicking on created button, it does not create new button.  Can someone tell me what is wrong?


Collective nouns - singular vs. plural verbs?

What about "youth"? As in:  "The youth of today is highly interconnected in many ways."  vs. "The youth of today are highly interconnected in many ways."


When should we mark a Test case as "No Apply"?

When should we mark a test case as "No Apply". When requirement are not clear or when test case is not testable or it is not understood.  Kindly explain when to fail or pass a test case, rather than NA.


Does anyone know where I can find a good proof for the basis theorem of the cohomology ring of the Grassmannian, or give me a sketch of the proof?  I'm already familiar with basic Schubert Calculus.


Consider the set $A=\{\sin k:k\in\mathbb Z  \}$. I want to know whether this set is dense in $[-1,1]$.  I have a hunch that this problem can somehow be reduced to the approximation of $\pi$ using rationals, although I don't know how to make a connection.


How to change figure caption to Fig. 1. in stead of Fig. 1:

My Figure caption is now like this: (Fig. 1:Caption of figure) and I want to change it to (Fig. 1. Caption of figure).  Also in the Table caption I want to get it like this: (Table II. Title of table). I am uisng IEEE conference document.


I'm working on creating a small graph in tikz. However, I'm a bit lazy and don't want to create the actual curve in tikz, but I do want the axes and some text to be done in LateX because it looks much nicer. So I'm basically including a graphic and then doing  the tikz picture "on top". However, when I use the following code  \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \includegraphics[scale=.5]{fig12.PNG}; \draw [->] (0,0) -- (8,0); \draw [->] (0,0) -- (0,4); \end{tikzpicture} \end{document}   I get     Which isn't quite what I'm looking for =)  When I include the the graphic at the end of the tikz picture, it sits on top of the axes and stuff, and I'd still need to put points and text on top of it. How can I properly position this image?


Can you use Extended Spell Metamagic more than once?

Can you use Extend Spell Meta Magic more than once? Meaning can you pay more SP to extend the duration by one factor?  EX: 1SP = Spell Duration of minute last 1 minute becomes 10 minutes, 3SP 1 hour, 4SP 8 Hours, 5 SP 24 hours


prove that $a^{N-1} \not\equiv 1(\bmod N)$

I need to prove the following: $$\begin{aligned} &\text { Prove that } a^{N-1} \not\equiv 1(\bmod N) \text { if } \operatorname{gcd}(a, N)>1, \text { where } a, N \in \mathbb{Z} \text { and }\\ &N \geq 1 \end{aligned}$$  My attempt on a solution. set $d=gcd(a,N)>1$. Since $d$ divides a, we have: $$a\equiv 0 (\bmod d)$$ using this repeatedly we have: $$a^{N-1}\equiv 0 (\bmod d)$$ Since $d\mid N$ does that imply: $$\implies a^{N-1}\equiv 0 (\bmod N)$$?  I'm not quite convinced that this is true. If $d\mid a^{N-1}$ and $d \mid N$. Does that imply $N \mid a^{N-1}$? And how should I use the assumption $d>1$?. I believe it would be obvious if it was the other way around. if $N \mid d$


Are functions of independent variables also independent?

It's a really simple question. However I didn't see it in books and I tried to find the answer on the web but failed.  If I have two independent random variables, $X_1$ and $X_2$, then I define two other random variables $Y_1$ and $Y_2$, where $Y_1$ = $f_1(X_1)$ and $Y_2$ = $f_2(X_2)$.  Intuitively, $Y_1$ and $Y_2$ should be independent, and I can't find a counter example, but I am not sure. Could anyone tell me whether they are independent? Does it depend on some properties of $f_1$ and $f_2$?  Thank you.


Is accepting answers really not that important?

I've always thought that having solved issues marked as accepted is important on several ways, like:   When searching questions to get an answer, it helps choosing which questions to look at first (not all problems have a matching epic question with answers explaining everything and more). It helps finding questions which are not answered satisfactorily yet. It helps avoid ugly [solved] kind of text tags in question titles, which are often used in forums which don't have other kind of "accept" feature.   But then just today I found and read , quote from @RobertHarvey (emphasis mine):     Accepting answers is an entirely optional activity. Users are not   required to accept answers, and should not be compelled, badgered or   otherwise nudged to accept answers.   This supports only point 3 in above list, which IMO is least important of them.  My personal opinion in the matter is, accepting when there is an acceptable answer is optional yes, but highly recommended. When there clearly are such answers (for example indicated by comments), any new user should be nudged to accept one (in a non-self-promoting neutral way). Accepted-status or lack of it is an important piece of information.    Actual question: why accepts would not really be as important piece of information for SO and its users, as I think they are?    Optional part: If someone feels like writing an essay, then some discussion or conclusions about how to develop the current accept system to match whatever its real purpose is would be interesting (to me). There are plenty of various suggestions about nudging to accept, community accepts, etc. Or if accepts are really not important, perhaps the concept should be changed, accepted-status hidden and "Accept" tickmark used only as extra upvote OP can give to one answer, much like bounty, with no deeper meaning.


The knight's tour is a sequence of 64 squares on a chess board, where each square is visted once, and each subsequent square can be reached from the previous by a knight's move.  Tours can be cyclic, if the last square is a knight's move away from the first, and acyclic otherwise.  There are several symmetries among knight's tours.  Both acyclic and cyclic tours have eight reflectional symmetries, and cyclic tours additionally have symmetries arising from starting at any square in the cycle, and from running the sequence backwards.  Is it known how many knight's tours there are, up to all the symmetries?


Is there a test for the different styles inside maths mode?

Is there a test for the different styles within maths mode?  What I really want is to be able to save the current style to reinvoke it later on, but a \if along the lines of \ifmmode would work just as well.  In the specific example, I want to measure how big something will be when displayed in maths mode, so I do:  \settoheight{\mathheight}{some bit of maths}   except that it complains because the some bit of maths gets put in a box and measured, and the box doesn't know that it's maths.  So instead I put:  \settoheight{\mathheight}{\(some bit of maths\)}   except that then I get the wrong answer if this is used in displayed maths.  So ideally, I want:  \ifdisplaystyle  \let\currentstyle\displaystyle \else  \iftextstyle   \let\currentstyle\textstyle  ...  \fi \fi \settoheight{\mathheight}{\(\currentstyle some bit of maths\)}   and then I'll be happy.  Is there such a test?    Okay, so \mathchoice is clearly the way to go (thanks Martin!), but its behaviour is a little odd and since I want to use it to define a macro depending on which mode I'm in, this oddity is quite important.  Here's the code:  \newcommand{\mathtest}{% \gdef\name{a}% \mathchoice{% \name \gdef\name{b}% }{% \name \gdef\name{c}% }{% \name \gdef\name{d}% }{% \name \gdef\name{e}% }% \name}  \[ \mathtest \]   If \mathchoice behaved like \if, this ought to print ab.  But it prints ae.  All the options to \mathchoice get processed (which makes me wonder a bit how it works, but that's by-the-by).  So, is there an obvious way to make \mathchoice behave a little more like \if?


Ridge regression is similar to Linear regression

I can not see any difference between  Ridge Regression and Linear Regression  MY understanding, The point of ridge Regression is based on the training data we find the best line that fits training data.  Best line means minimum RMSE  then try to play with the line sloop to get better results through n-fold cross validatin!.  isn't easier and simpler to use all dataset (both training and test) to build this line and find sloop through   $y\ =\ \beta_0+{\beta_1x}_1$  $\beta_1\ =\ \rho\frac{\sigma_y}{\sigma_x}$  $\beta_0\ =\ \mu_y\ -\ \mu_x\beta_1\ $  $\rho\ =\ [(x-μx)(y-μy)] [(x-μx)2][(y-μy)2]$  $\sigma_x=\ \sqrt{\frac{{\sum{(x-\mu_x)}}^2}{n}}$  $\sigma_y=\ \sqrt{\frac{{\sum{(y-\mu_y)}}^2}{n}}$  the linear regression will give us the best fit.  if i misunderstood.  please tell me what is the difference between these models before down rating my question.  Thanks


How did Newton figure out the law of gravity?

How did Newton figure out the ? I know there are two other questions answering the same question but I did not understand anything from the answers  Is there a third way of knowing how he did it without using complex formula and derivation.  I am dumb but curious :-)


After I change the identity specification to "Yes", why does it change back to "No" in SQL Server?

I need to set 3 columns (idUser, idLab, idProfile) as identity, but when I change one of them all the others set identity as "No" and only the latest one sets to "Yes".  Already checked its data type and all are set to "int"


Where to use 'historic' and where to use 'historical'

I have read the previous topics but still don't know where I should use historic or historical in the following examples.  Athens is a historic/historical city. This chair is historic/historical. This building is historic/historical. This is a historic/historical winning for Manchester United.  Thank you so much.


Can you copy blocks on Minecraft Bedrock?

I'm making a bed wars map and the command blocks are VERY boring, is there a way to copy a command block so that when you place it down again it has the same command. I'm on Xbox by the way


Same computer, under Ubuntu 8.04 no problem at all. Under 12.04, floppy drive is non existent for Ubuntu. Drive and floppy disquette works well on DOS. Computer boots from the floppy W98se, no problem at all.  How I can use floppys under Ubuntu 12.04 ?.


Is there a version available for the Samsung Galaxy S6?


How does dependency resolution work if you apt-get install a list of packages?

Does apt-get automatically resolve dependencies if you apt-get install a literal list of packages?  I understand the default behavior of a command like apt-get install foo is to install the latest version of foo.  However, if I do:  sudo apt-get install foo bar   ... and assume that foo depends on version 2.0 of bar, while the latest version of bar is 3.0.  Is apt-get smart enough to install the latest version of foo and version 2.0 of bar, or will it fail as it can't resolve the dependencies?


Is there a name for "sts", "sks" and "sps" sounds found in words like "tastes", "tasks", and "wasps"?  I seem to remember someone telling me the name for it.


I would like to build a regexp in Java that would be passed in a FilenameFilter to filter the files in a dir.  The problem is that I can't get the hang of the regexp "mind model" :)  This is the regexp that I came up with to select the files that I would like to exclude   ((ABC|XYZ))+\w*Test.xml  What I would like to do is to select all the files that end with Test.xml but do not start with ABC or XYZ.  Could you please add any resources that could help me in my battle with regexps.  Thanks  The following resource explains a lot of things about regexp


how to handle double affiliation in a research article?

I would like to know how to handle the following situation:   I was working previously as a part time lecturer, or lecturer paid by hours, in an X university. While working there I developed a lecturing system that helped the students to cope with a subject in computer programming. I moved for working in another university Y, in which they employed me for performing lecturing and research tasks. Actually university X did not pay for research, but only for lecturing tasks.   I have made a research paper based on the lecturing system that I implemented and tested in university X, but the place that will be paying for its actual publication, if accepted; will be my current place of work. So the question that I have is how should I handle that situation?  Should I put a double affiliation like:  Author: Layla University Y (the place that is actually paying for the research task) University X (my former place of work where I developed that methodology in my free time)   or should I only put University Y as my main affiliation?  I was wondering if that is possible, because if I put only as my affiliation university X (in which I am not longer working) they would not pay for the research, leaving me with financial problems to publish the article.  Any help?  Thanks


Black Screen on boot fresh install 14.04.2

Ive looked around and can't find an answer to my question. I just installed Lubuntu with a live USB and now when i try to boot the only thing i get is a black screen it appears its working but i cant see anything. I had to fix this same problem when trying to boot into try Lubuntu without installing and to fix that i had to change some parameters like nomodeset and xforcevesa. Is there a similar fix to my problem? I am sorta tech savy but new to Linux in general so any help is appreciated in advance.  GPU - 750 ti CPU - i7 - 4790k  edit - Holding shift does not enter grub either i tried thanks J. Steen


Drawing unit vectors in spherical coordinates

I have this  in spherical coordinates taken from . I would like to use this figure to illustrate unit vectors at the point P. I have not been able to adapt the figures given on various posts. I manged to run the asymptote code  but in pdf format it comes compressed such that it is unreadable. I would appreciate if someone can add me some code in tikz so that I can draw a circle through P, with vectors in the three directions, east, north and zenith. I reproduce the code from the first site quoted above (appreciation and thanks @jubobs)  Yes the code by jubobs is half of what I want. What I want added to this are three unit vectors in the direction of the coordinate direction, i.e. at P we probably would have a circle running from north pole to south pole, and through P a vector in z-direction, a vector in $\phi$ direction and a vector in $\theta$ direction.  Please note that I am only adding a small addition to this post. The addition is explained in the last paragraph above.  The code supplied by mammot does exactly what I was looking for, my real appreciation for spending time and effort mammot. When I incorporate the code I get . I had tried to turn the vector in the positive x-direction (opposite to what is the figure) no success so far. Seconddly I would appreciate adding a circle from north pole to south pole through P. Sorry for being too demanding, but the work is done. This is what I wanted and its fine. Once more my appreciation.  \documentclass{article}  \usepackage{tikz} \usepackage{tikz-3dplot}  \begin{document} \tdplotsetmaincoords{60}{110} \pgfmathsetmacro{\rvec}{.8} \pgfmathsetmacro{\thetavec}{30} \pgfmathsetmacro{\phivec}{60} %  \begin{tikzpicture}[scale=5,tdplot_main_coords] \coordinate (O) at (0,0,0); \draw[thick,->] (0,0,0) -- (1,0,0) node[anchor=north east]{$x$}; \draw[thick,->] (0,0,0) -- (0,1,0) node[anchor=north west]{$y$}; \draw[thick,->] (0,0,0) -- (0,0,1) node[anchor=south]{$z$}; \tdplotsetcoord{P}{\rvec}{\thetavec}{\phivec} \draw[-stealth,color=red] (O) -- (P) node[above right] {$P$};  \draw[dashed, color=red] (P) -- (Pxy); \tdplotdrawarc{(O)}{0.2}{0}{\phivec}{anchor=north}{$\phi$} \tdplotsetthetaplanecoords{\phivec} \tdplotdrawarc[tdplot_rotated_coords]{(0,0,0)}{0.5}{0}% {\thetavec}{anchor=south west}{$\theta$} % \tdplotsetthetaplanecoords{\phivec} \tdplotdrawarc[tdplot_rotated_coords]{(0,0,0)}{0.5}{0} {\thetavec} {anchor=south west}{$\theta$} \coordinate (Shift) at (P); \tdplotsetrotatedcoords{-\phivec}{-\thetavec}{\phivec}; \tdplotsetrotatedcoordsorigin{(Shift)}; \begin{scope}[tdplot_rotated_coords,scale=0.4,blue] \draw[thick,->] (0,0,0) -- (1,0,0) node[anchor=north east]{$x'$}; \draw[thick,->] (0,0,0) -- (0,1,0) node[anchor=north west]{$y'$}; \draw[thick,->] (0,0,0) -- (0,0,1) node[anchor=south]{$z'$}; \end{scope} \end{tikzpicture} \end{document}


"java.lang.OutOfMemoryError: PermGen space" in Maven build

I'm  getting this error while building Maven project, I increased MAVEN_OPTS but all the same, I found some similar posts but they are refering to something else. How do I fix this?  The system is out of resources. Consult the following stack trace for details. java.lang.OutOfMemoryError: PermGen space         at java.lang.ClassLoader.defineClass1(Native Method)         at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)         at java.lang.ClassLoader.defineClass(ClassLoader.java:616)         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)         at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)         at java.net.URLClassLoader.access$000(URLClassLoader.java:58)         at java.net.URLClassLoader$1.run(URLClassLoader.java:197)         at java.security.AccessController.doPrivileged(Native Method)         at java.net.URLClassLoader.findClass(URLClassLoader.java:190)         at org.codehaus.plexus.compiler.javac.IsolatedClassLoader.loadClass(IsolatedClassLoader.java:56)         at com.sun.tools.javac.comp.Annotate.<init>(Annotate.java:52)         at com.sun.tools.javac.comp.Annotate.instance(Annotate.java:36)         at com.sun.tools.javac.jvm.ClassReader.<init>(ClassReader.java:215)         at com.sun.tools.javac.jvm.ClassReader.instance(ClassReader.java:168)         at com.sun.tools.javac.main.JavaCompiler.<init>(JavaCompiler.java:293)         at com.sun.tools.javac.main.JavaCompiler.instance(JavaCompiler.java:72)         at com.sun.tools.javac.main.Main.compile(Main.java:340)         at com.sun.tools.javac.main.Main.compile(Main.java:279)         at com.sun.tools.javac.main.Main.compile(Main.java:270)         at com.sun.tools.javac.Main.compile(Main.java:87)         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)         at java.lang.reflect.Method.invoke(Method.java:597)         at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess(JavacCompiler.java:420)         at org.codehaus.plexus.compiler.javac.JavacCompiler.compile(JavacCompiler.java:141)         at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:493)         at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)   I'm not as worried about how to fix as to how to fix it in the maven ecosystem


How to print converted object from QuickType.io?

I'm trying to find out how QuickType.io works, however I cannot find a way to show my converted results.  I converted a JSON file to C# and got a satisfactory output:  public partial class Welcome {     [JsonProperty("relatiesoort")]     public string[] Relatiesoort { get; set; }      [JsonProperty("modifiedOn")]     public DateTimeOffset ModifiedOn { get; set; }      [JsonProperty("relatiecode")]     public long Relatiecode { get; set; }      [JsonProperty("naam")]     public string Naam { get; set; } }   I think the Welcome class can be used to do what I want:  public partial class Welcome {     public static Welcome[] FromJson(string json) => JsonConvert.DeserializeObject<Welcome[]>(json, APIconnectV2.JSON.Converter.Settings); }   This is the code I use to print the results:  var result = httpClient.GetAsync(new Uri("http://hidden.com')")).Result; var json = result.Content.ReadAsStringAsync().Result;  dynamic jObject = JArray.Parse(json); System.Diagnostics.Debug.WriteLine(Welcome.FromJson(json)[0]);   However, the output I receive is:  APIconnectV2.JSON.Welcome   Any number greater than 0 results in an out of bounds error. I'm not even sure if this is the correct way to print my output, however I cannot find a lot of documentation surrounding QuickType.


I tried to login to Pokémon GO today and the ground seems to be missing. I have a second account that works fine, though.  How can I fix this?


How do I make it so that my camera shows the actual objects?

So I have been doing a tutorial  and for some reason when I did the camera rigging part, the screen just goes black. This is when I view what the camera sees. Any tips? This is my project file:  (MediaFire) Trying images now: Out of camera:  In camera:


Update the position of the ball at each iteration of the loop

Firstly I apologize for being an absolute rookie at programming. My idea was moving the ball (o) until the end of the track so the ball should update its position every iteration but not printing a new line for each position but in a single line so I can see the ball moves along the track. This is my code  track=['o','.','.','.','.','.','.','.'] blank='.' for i in range(1,len(track)):     track[i]='o'     track[i-1]=blank     print(''.join(track))


I flagged a "thank you" comment as "it's no longer needed" and it was autodeleted: was there a change I'm unaware of?

Just now I flagged a comment on  that said nothing other than ~"thank you, that's helpful" and it was deleted immediately.  I did not know this was a feature.  Moreover, I didn't find any documentation on this feature here at meta.SE. Question: I flagged a "thank you" comment as it's "no longer needed" and it was auto-deleted: was there a change I'm unaware of? I'd be particularly interested in understanding precisely how this feature works. This comment was not offensive nor was it spam, just a run-of-the-mill "thank you" comment.  I don't recall this happening for previous "it's no longer needed" flags.  I'm sure it was a single flag that caused this, because it's a 5-month old post. If I knew precisely what was going on, I'd pay a bit more attention to flagging these.


What is required to wield an infinity gem?

In the Guardians of the Galaxy movie it is stressed that a mortal human cannot wield the Infinity Stones.  In the comics, however, several humans appear to have wielded one or more Infinity Gems including The Hood, Iron Man, Dr. Strange, Mr. Fantastic, Beast, and Charles Xavier.  I don't know the details of most of these, however, as I learned of some of them via Wikipedia...    In Thor: The Dark World I can only imagine that Natalie Portman’s character somewhat wielded the red gem, though she definitely did not appear to be in control of it.  I would suggest that the human-destroying nature of the purple stone in Guardians could be exclusive to that one stone, but Power and Reality (the gems that seem to fit the appearance of the purple stone) were both wielded in the comics by The Hood.  So my question/s: is the idea that a simple human cannot wield the gem exclusive to the MCU/Earth 199999?  Do human characters in Earth 616 (or others) have some way to more safely wield them?


Redirecting all subdirectories of a folder via htaccess

I've searched around and haven't found this specific question asked.  I need to redirect all the 'subfolders' of a directory to the parent directory.  For example, the parent directory is example.tld/directory and all subdirectories such as example.tld/directory/subdirectory-1 and example.tld/directory/subdirectory-2 etc all need to redirect to example.tld/directory  For clarification, these aren't actual directories but Drupal sub-paths, but I believe it should work to do this via htaccess.  Just to make it crystal clear, the URLs  example.tld/directory/subdirectory-1  example.tld/directory/subdirectory-2  etc...  should all redirect to  example.tld/directory  The idea is to make these subdirectories inaccessible to anyone and be sure that the search engine crawlers do not index these subdirectories.  What would be the proper htaccess code to achieve this?


I am trying to find a Banach Space X and a singular operator (Infinite Dimensional Space)

I am trying to find a Banach space $X$ (Infinite dimensional Space) and a singular operator $A\in \mathcal L(X)  $ such that for some $\epsilon \gt 0, $ there is no bounded linear operator $B$ with bounded linear inverse and such that $||A-B||\lt\epsilon $ ?  Making some attempt I thought of letting $X = \ell^2({\mathbb C}) $ where ${X}$ are sequences in $\mathbb C$ that are square summable and uses the linear shift operator $$A\in \mathcal L(X)$$ given by $A(x_1, x_2,...) = (x_2, x_3,...) $


I am working on Sharepoint 2013 Autocomplete functionality  I created 2 lists  1) FruitsList --> List 1 |  FruitName --> column   2) FruitFetching --> List 2 |  Name of the fruit --> column   I gave the list of items to the FruitsList and what I want to achieve is I want to fetch the list of items from Fruitfetching list through Autocomplete.  I added the code in SharePoint webpart. Sharing the code below.  <link href= https://alshayacom.sharepoint.com/sites/TimesheetDEV/MasterDetailSite/SiteAssets/autocomplete-0.3.0.css rel="stylesheet" /> <script src= https://alshayacom.sharepoint.com/sites/TimesheetDEV/MasterDetailSite/SiteAssets/jquery-3.1.1.js type="text/javascript" ></script> <script src= https://alshayacom.sharepoint.com/sites/TimesheetDEV/MasterDetailSite/SiteAssets/jquery-ui.js type="text/javascript" ></script>     <script src= https://alshayacom.sharepoint.com/sites/TimesheetDEV/MasterDetailSite/SiteAssets/jquery.SPServices-0.7.2.js type="text/javascript" ></script>    <script type = "text/javascript"> $(document).ready(function(){         readyCall();     });  function readyCall() {    var externalParties = [];    $().SPServices({    operation:"GetListItems",    listName:"FruitsList",    CAMLViewFields:"<ViewFields><FieldRef Name='FruitName'/></ViewFields>",     async:false,    completrefunc:function(xData,Status){      $(xData.responseXML).SPFilterNode("z:row").each(function(){     externaParties.push($(this).attr("FruitName")); }); }  });     $("input[id$='Name_x0020_Of_x0020_the_x0020_Fr_5df8c07d-1dd7-4e65-a9fe-695dbe65f187_$TextField']").autocomplete({      source:externalParties});  } </script>   This is my code. I added debugger  inside the function. but it is not going inside SPservices it is directly going to the input text box.   As I am new to SharePoint can anyone plz help on resolving this issue.  If I add an alert in the complete function I am geeting like this below screen shot   Thanks in Advance


I'm a first time user of Ubuntu. Where can I get the Sound, Video, and Ethernet drivers for Ubuntu 12.04.2?


Forgot baggage at Dubai. How to get it to Los Angeles?

Last week, I travelled via Dubai to Los Angeles. During the security checking at Dubai Airport, I was asked to remove my laptop from my bag and after that I forgot to to take it back. i realised that only after I reached Los Angeles.   What is the best way I can get it to Los Angeles now. I called Dubai lost and found and they have identified the laptop there.


What is the most efficient way to create HTML elements using jQuery?

Recently I've been doing a lot of modal window pop-ups and what not, for which I used jQuery. The method that I used to create the new elements on the page has overwhelmingly been along the lines of:   $("

");   However, I'm getting the feeling that this isn't the best or the most efficient method of doing this. What is the best way to create elements in jQuery from a performance perspective?   has the benchmarks to the suggestions below.


Who gets listed on a close as duplicate message?

I just flagged a question as a duplicate. A few minutes later the question was closed as a duplicate with only a much higher rep user's name and Community (two users total) in the close message.  Why doesn't my name appear in the close message since I was the first to flag it?


If you reference an instantiated object in different classes, do changes get updated to the actual object or just the reference ..  public class First {      List<String> numbers;      public First(){          this.numbers.add("one");          this.numbers.add("two");      } }  public class Second{      First InstanceOfFirst;      public Second(First F){            this.InstanceOfFirst = F;      }      public void printList(){           for(String s : this.InstanceOfFirst.numbers){                System.out.print(i+", ");           }      } }  public class Third {      First Reference;      public Third(First F){          this.Reference = F;      }      public void Update(){          this.Reference.numbers.add("three");      } }   So let's say my main looks likes this:  public static main(String args[]){     First F = new Frist();     Second sec = new Second(F);     Third  th = new Third(F);     th.Update();     sec.printList(); }   Would I get one, two or one, two, three as a result.  I guess what I'm trying to ask is: Deos Java make different copies of objects when referenced like this or do they point to the same object??  Please excuse me if my question seems vague ..


Rotate a long bar in space and get close to (or even beyond) the speed of light $c$

Imagine a bar   spinning like a helicopter propeller,  At $\omega$ rad/s because the extremes of the bar goes at speed  $$V = \omega * r$$  then we can reach near $c$ (speed of light) applying some finite amount of energy just doing   $$\omega = V / r$$  The bar should be long, low density, strong to minimize the amount of energy needed  For example a $2000\,\mathrm{m}$ bar  $$\omega = 300 000 \frac{\mathrm{rad}}{\mathrm{s}} = 2864789\,\mathrm{rpm}$$  (a dental drill can commonly rotate at $400000\,\mathrm{rpm}$)  $V$ (with dental drill) = 14% of speed of light.  Then I say this experiment can be really made and bar extremes could approach $c$.  What do you say?   EDIT:  Our planet is orbiting at sun and it's orbiting milky way, and who knows what else, then any Earth point have a speed of 500 km/s or more agains CMB.  I wonder if we are orbiting something at that speed then there would be detectable relativist effect in different direction of measurements, simply extending a long bar or any directional mass in different galactic directions we should measure mass change due to relativity, simply because $V = \omega * r$  What do you think?


GNOME - How to adress a shortcut for workspace 5+?

I would like to know how I can address shortcuts for more than 4 workspaces in GNOME.   Unfortunately, I can only see 4 entries for the workspace 1-4 in the  keyboard settings.     I would like to switch to workspace 5 when I press  Ctrl+5. It already works for the Workspaces 1-4.  It is possible to create a new shortcut, but I don't know the command which I have to use.


There are some similar questions like  but I am thinking of a comprehensive list of the pros and cons of the two types of filters.  For example.  Linear  Pros:   Can be used as a variable ND density filter when combining two of them.   I am asking this becouse I have not used a circular one, and I am not sure how effective is to reduce reflection on glass for example, so there can be some categories on the technical aspect, like autofocus issues and the photographic results.  So the question is: What are the Pros and cons of circular polarizer filter vs a linear one?


Modified pattern does not see the pattern color option

I have modified the north east lines pattern to accept a \LineSpace option that sets the density of the pattern (see the question ). The code works very well but I can't modify the color of the pattern using the pattern color option as I did before.  \documentclass{minimal} \usepackage{pgfplots} \usepackage[active,tightpage]{preview} \PreviewEnvironment{tikzpicture} \setlength\PreviewBorder{2mm} \pgfplotsset{compat=newest} \usetikzlibrary{patterns}  \pgfdeclarepatternformonly[\LineSpace]{my north east lines}{\pgfqpoint{-1pt}{-1pt}}{\pgfqpoint{\LineSpace}{\LineSpace}}{\pgfqpoint{\LineSpace}{\LineSpace}}% {     \pgfsetlinewidth{0.4pt}     \pgfpathmoveto{\pgfqpoint{0pt}{0pt}}     \pgfpathlineto{\pgfqpoint{\LineSpace + 0.1pt}{\LineSpace + 0.1pt}}     \pgfusepath{stroke} }  \newdimen\LineSpace \tikzset{     line space/.code={\LineSpace=#1},     line space=3pt }   \begin{document} \begin{tikzpicture}     \begin{axis}[         ymin=0, ymax=1,         xmin=-1, xmax=1]                  \addplot[             pattern=my north east lines,             line space=8pt,             pattern color=green,             draw=black]              {x} \closedcycle;                 \addplot[             pattern=north east lines,             pattern color=red,             draw=black]             {-x} \closedcycle;     \end{axis}     \end{tikzpicture} \end{document}


Hidden password is being displayed when invoking the su command?

This is the first time it has happened to me where I am using the su command and it actually displays the password on the terminal and doesn't stay hidden. Here is my code snippet:  sshpass -p "password" ssh -q username@74.11.11.11 "su -lc 'mkdir temp/'"   Code explanation: I am accessing a remote server and trying be root on that server to create a folder. In doing so I have to use the su command and it prompts me for the password. When I enter the password, it gets displayed and doesn't stay hidden.