Hello i am new to programming and am learning Data Structures on Java,  i am making a simple Palindrome program that works fine, but the only think i am stuck with is that when i enter the String to exit from the program it continues to Loop. I am trying to have it continue the loop when the user enters anything but "!"  package Palindrome; import java.util.Stack; import java.util.Scanner; public class Palindrome { static String input; static String reverseInput = ""; public Palindrome() {     // TODO Auto-generated constructor stub }  public static void main(String[] args) {      Scanner keyboard = new Scanner(System.in);     String check = null;     System.out.println("Enter a string that you want to check (or enter ! to exit): ");             input = keyboard.nextLine();     do     {                    input = keyboard.nextLine();              Stack<Character> stack = new Stack<Character>();              for (int i = 0; i < input.length(); i++) {                     stack.push(input.charAt(i));              }               while (!stack.isEmpty()) {                     reverseInput += stack.pop();              }              isPalindrome(reverseInput);           System.out.println("Enter a string that you want to check (or enter ! to exit): ");             input = keyboard.nextLine();      } while (input != "!"); }  public static boolean isPalindrome(String aString){     if (input.equals(reverseInput))         System.out.println("Yes! that is a palindrome.");     else         System.out.println("No! that isn't a palindrome.");     return false; }  }

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


I have an /etc/sudoers with the following:  glens   ALL=NOPASSWD:/usr/sbin/service php5-fpm glens   ALL=(ALL:ALL) ALL   And I'm trying to run the command:  sudo /usr/sbin/service php5-fpm restart   However, I'm still prompted for my password.  This  question/answer suggests I have the correct syntax, but I'm still prompted.

I need to run something as sudo without a password, so I used visudo and added this to my sudoers file:  MYUSERNAME ALL = NOPASSWD: /path/to/my/program   Then I tried it out:  $ sudo /path/to/my/program [sudo] password for MYUSERNAME:    Why does it ask for a password? How can I run/use commands as root with a non-root user, without asking for a password?


This always returns the value of "else"...     public void onClick(View view) {              System.out.println("Palabra1= "+palabraDes.getText());             System.out.println("Palabra2= "+palabraOrd.getText());              String pla1 = palabraDes.getText().toString();             String pla2 = palabraOrd.getText().toString();                if (pla1 == pla2) {                  ttsManager.initQueue("Resultado correcto, buen trabajo.");              } else                  ttsManager.initQueue("Incorrecto, intente de nuevo.");          }     });   Launching app: I/System.out: Palabra1= perro     Palabra2= perro


When I start Nautilus as root from the terminal, I always get this error message.     Failed to execute child process "net" (No such file or directory)   I need to kill the process from the terminal with Ctrl + C. I don't know if the process has something to do with Samba settings, or otherwise, it is for the installation of Dropbox or MEGASync.

I was trying to use gedit, when I came across the following problem:  myPC@TM77:~$ sudo gedit /etc/pm/config.d/config (gedit:12512): IBUS-WARNING **: The owner of /home/myPC/.config/ibus/bus is not root! (gedit:12512): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files   What is happening?


I was having confusion over the concepts of roots. My confusion begins as: I know that if $x^{1/n}=y$ then $y^n=x$ must be true.   Case 1: With square roots, let's take $y=4^{1/2}$  We know $y=2$ is a solution as $2^2=4$, but $y=-2$ must also be a solution as $(-2)^2=4$ is also true. But I browsing here I read that $(x^2)^{1/2}$ is actually equivalent to absolute value of $x$, hence only $y=2$ is solution of my above case.  Case 2: With cubic root, let's restrict ourselves to the real no.s's domain, let's take $y=(-8)^{1/3}$, then $y=-2$ seems feasible solution as $(-2)^3=-8$ but why in this case absolute value after cube root is not required. Also, why $(-x)^{1/3}=-(x)^{1/3}$, but $(-x)^{1/2}$ is not equal to $-(x)^{1/2}$  The same apparent ambiguity goes with $x^{1/4}$ and $x^{1/5}$  So, in general what is the general function definition of $x^{1/n}$?

Let $n \in \mathbb N$ be a natural number and $a \in \mathbb R$ be a real number. The $n$-th root of the number $a$ is defined as follows:  Case I: $n$ is an odd number. In this case the $n^{\text{th}}$ root of $a$ is defined to be that number $b \in \mathbb R$ such that $b^n = a$.  Case II: $n$ is an even number. In this case the $n^{\text{th}}$ root of $a$ is defined to be that number $b \geq 0$ such that $b^n = a$.  Why is it that when $n$ is even, we only consider $b \geq 0$. For example, both $+2$ and $-2$ squared equal $4$, but when we say the square root of $4$ is $2$. Is there a reason for this?


I'd like to connect a fan at 7V in a PC.  If I connect the fan's + to a 12V rail and - to a 5V rail, can I safely use that for 7V?  Would the current rating just be the lower of what the 5V and 12V rail will handle?

I have a 3 pin 12 V Fan, rated at 2000 RPM max. Its nominal voltage is 12 V which will make it spin at full throttle. That's what is happening when I plug it in the motherboard. However I don't like that, because the fan is making a lot of noise. I would like to lower its speed to about half. I have figured out I should supply it with 7 V instead. There are methods online ,  and even a famous video on YouTube  demonstrating the procedure.   I've read a lot about this and I'm unsure about whether this is safe. I use a modern and pretty good and reliable 80 Plus PSU. So I'm skeptical now and I want to ask here to understand better. What we have to do is pretty much shown on the picture below.    Instead of supplying the fan with 12 V, using the yellow 12 V pin and the black ground pin from the Molex cable, we instead supply it with 12 V for VCC and 5 V for "ground". So the fan sees voltage difference of 12-5=7 V, but shouldn't there be a path to 0 V ground? This is the part where I'm confused.  Is this secure, is this possible?


I'm looking for options to get from the US mainland to Hawaii and I thought doing crew work on a boat/ship/yacht might be an option. How would I go about doing this?

Is there a feasible way to take a one year break from a IT job and work as a crew member on a big ship? How can one go about this? I am a recreational sailor and know intermediate sailing, coastal navigation, radio handling and all that stuff. I think this could be the experience of a life time. Where should  I look? I imagine getting it would be hard since obviously this is a lucrative job.


The ICE CYBER virus is particularly nasty.  I thought it snuck in while Avira Free Antivir was off, and then became active later.  Being more carefull for the two days after removing it with a Kaspersky rescue disk, I have it again.    It's time for new antivirus software.  What will prevent infection from the ICE CYBER virus?  I tried AVG a while back:  I uninstalled it because it required that all internet traffic be diverted through it's program, and I don't want some AVG person to be able to log all of my internet traffic.    (It would not run without internet access.  I didn't allow AVG with my firewall.  Upon specifically allowing AVG, I got inernet access back.  Goodbye, AVG.)  How I removed the ICE CYBER virus.  I made a Kaspersky rescue disk, and did a scan.  It restored access to my computer.  I then restored XP back to a restore point a couple weeks old with rstrui.exe.  I then ran Kaspersky again, plus Malwarebytes, plus Hitman pro, plus an Antivir full scan.  Two days later I have it again.  Avira Free Antivir failed to prevent the virus.  I had it set for web protection, plus all file reads and writes.

What should I do if my Windows computer seems to be infected with a virus or malware?  What are the symptoms of an infection? What should I do after noticing an infection? What can I do to get rid of it? how to prevent from infection by malware?   This question comes up frequently, and the suggested solutions are usually the same. This community wiki is an attempt to serve as the definitive, most comprehensive answer possible. Feel free to add your contributions via edits.


I have dual boot on my laptop: - Windows 7 with Ubuntu 13.10 installed alongside.  How do I upgrade my ubuntu installation to 14.04 without affecting the Windows installation?

What are the different ways I can use to upgrade Ubuntu from one release to another?


I am not really sure if this sentence is translated correctly into English :     Access keys have been researched and the implementation will be done in a future sprint, that will have something to do with GUI.    Is the use of the word "that" in this sentence correct? Can I, or should I, exchange "that" for "which"?

When is it appropriate to use that as opposed to which with relative clauses?


I am currently following this guide:   It all works great and the login script works fine. Only what I want to do is insert a simple piece of code that the session times out in like 30 minutes or something and than the user automaticly logs out.  How can I archieve this

I need to keep a session alive for 30 minutes and then destroy it.


I'm trying to understand the t-test, and don't quite understand the differences I'm seeing between t-statistic and number of standard deviations between means for a Gaussian random variable, if the number of samples is large. Let's say I have two populations $x_1$ and $x_2$ each with an assumed normal distribution of roughly equal variance, and I obtain $N=100$ samples from each population, where the sample statistics are $\bar{x}_1=10.44, \bar{x}_2=12.01, \sigma_{x1} = 1.33, \sigma_{x2} = 1.49$. I want to know my confidence level that the population mean of $x_2$ is greater than the population mean of $x_1$. Applying the t-test gives me $$ t=\frac{\bar{x}_2-\bar{x}_1}{\sqrt{\frac{\sigma_{x1}{}^2+\sigma_{x2}{}^2}{N}}} = 7.860816 $$ I'm computing a probability of about $10^{-13}$ from using scipy's survival function  (= 1 - CDF): >>> import scipy.stats >>> scipy.stats.t.sf(7.860816, 198) 1.1995112158126528e-13  It looks like $t$ could also be considered a normalized version of $v = x_2 - x_1$ where $\bar{v} = \bar{x}_2 - \bar{x}_1$ and $\sigma_{v} = \sqrt{\sigma_1{}^2+\sigma_2{}^2}$: $$t = \frac{\bar{v}}{\sigma_{v}\sqrt{N}}$$ namely that $t$ is equivalent to the random variable $v = x_2 - x_1$ normalized by its standard deviation and by the square root of the number of samples, so that I would expect $\sigma_t \approx 1$ if I ran lots of these tests. (This neglects the fact that the sample statistics have variation, which I think is the difference.) And the probability of $t<0$ (my hypothesis about the relative values of the population means) should therefore be around the ballpark of scipy.norm.sf(7.860816): >>> scipy.stats.norm.sf(7.860816) 1.9081952314663672e-15  But this is about a factor of 63 smaller than the probability computed from the t-distribution. Is this really supposed to be that big a difference for large $N$?

Given an IID normally distributed sample $X_1,...,X_n$ for $n$ small with mean $\mu$, standard deviation $\sigma$, sample mean $\overline{X}$ and sample standard deviation $s$ (the unbiased estimator form).  I understand that  $$\frac{\overline{X} - \mu}{\frac{\sigma}{\sqrt{n}}} \sim N(0,1),$$  but I'm having trouble reconciling this with the fact that  $$\frac{\overline{X} - \mu}{\frac{s}{\sqrt{n}}} \sim t_{n-1}.$$  Since the $t$-distribution is like the standard normal distribution but with a higher variance (smaller peak and fatter tails), this would seem to suggest that the sample standard deviation $s$ systematically underestimates the population standard deviation, making it in fact a biased estimator.


In one dimension, a function $f: I:= [a,b] \to \mathbb{R}$ is said to be of bounded variation if $$\mathrm{Var}(f,I):= \sup_{P}\left \{ \sum_{i=1} ^n \|f(x_i) - f(x_{i-1})\| : \mathrm{for} \; P:=\{x_0,\dots, x_n\} \; \mathrm{partition \; of \;} I \right \} < \infty.$$  In many variables, we have that a function $u \in L_{loc}^1(\Omega, \mathbb{R})$ is said to be of bounded variation if  $$\mathrm{Var}(u,\Omega) := \sup\left\{ \int_{\Omega} u\,\mathrm{div}\varphi \, dx:\varphi\in C_c^1(\Omega,\mathbb{R}^N), \|\varphi\|_{\infty} \leq 1 \right\} < \infty.$$ Where $\Omega \subset \mathbb{R}^N$ is a bounded domain (open and connected in $\mathbb{R}^N$).  Question. In the case of one variable, if we set $\Omega = I$ and $u = f$. How are these definitions equivalent?  My thoughts:    Since $\varphi\in C_c^1(\Omega,\mathbb{R}^N)$, then $\varphi$ is of bounded variation. then use Riemann Stieltjes integral, but I may need my function $u$ to be in $(C(I), \|\cdot\|_{\infty})$. Is $u$ in $(C(I), \|\cdot\|_{\infty})$ to write $\int_{\Omega} u \, d\varphi$?  Second, how is supremum over the partitions equal to the supremum over functions in $C_c^1(\Omega,\mathbb{R}^N)$ with $\|\varphi\|_{\infty} \leq 1$  Many thanks

According to , the total variation of the real-valued function $f$, defined on an interval $[a,b]\subset \mathbb{R}$, is the quantity $$V_b^a=\sup_{P\in\mathcal{P}}\sum_{i=0}^{n_P-1}\left | f(x_{i+1})-f({x_i)}\right |$$ where $\mathcal{P}= \left \{P=\{x_0,\ldots, x_{n_P}\} \mid P \text{ is a partition of } [a,b]\right \}$.  This is actually the more traditional definition of total variation, found for example in Rudin's Principles of Mathematical Analysis from the 1960s. However, in modern image analysis applications, the total variation is defined differently: $$\text{TV}(f,\Omega)= \sup \, \bigg\{ \int_{\Omega} f\, div \phi \, dx :   \phi \in C_c^{\infty} (\Omega,\mathbb{R}^N), \, \lvert \phi (x) \rvert \leq 1\, \forall x\in \Omega  \bigg \}  $$ where $\Omega$ is the domain on which we define the TV (and unlike the previous definition it could have dimension higher than 1).  Are these definitions somehow related? Perhaps equivalent?


Assume I have a distribution governing the possible outcome from a single random variable X.  This is something like [0.1, 0.4, 0.2, 0.3] for X being a value of either 1, 2, 3, 4.  Is it possible to sample from this distribution, i.e. generate pseudo random numbers upon each of the possible outcomes given the probability of that outcome. So if I wanted to know what the probability of getting a 2 is, the sampling operation may return 0.34 or something like that.  The reason I ask is that I'm trying to implement an action selection policy for a reinforcement learning method based on a research paper. From what I gather from the paper, the author is able to sample the distribution by "mapping the uniform distribution U[0,1] through cumulative probability density functions obtained by adaptive numerical integration". From this he then samples the transition probabilities for each trial...  I would be grateful for any info on this...  Thanks in advance

How do I generate numbers based on an arbitrary discrete distribution?  For example, I have a set of numbers that I want to generate. Say they are labelled from 1-3 as follows.  1: 4%, 2: 50%, 3: 46%  Basically, the percentages are probabilities that they will appear in the output from the random number generator. I have a pesudorandom number generator that will generate a uniform distribution in the interval [0, 1]. Is there any way of doing this?   There are no bounds on how many elements I can have, but the % will add up to 100%.


I need to identify substrings found in a string such as:  "CityABCProcess Test" or "cityABCProcess Test"  to yield : [ "City/city", "ABC", "Process", "Test" ]   The first string in the substring can be lowercase or uppercase Any substring with recurring uppercase letters will be a substring until a lowercase letter or space is found "ABCProcess -> ABC, ABC Process -> ABC" If there is an uppercase letter followed by a lowercase letter the substring will be  everything until the next uppercase letter.   Can this be handled by regex? Or should I convert my strings to a character array and manually check these cases using some indexing logic. Would a lambda solution work here? What is the best way to go about this?

How do I go from this string: "ThisIsMyCapsDelimitedString"  ...to this string: "This Is My Caps Delimited String"  Fewest lines of code in VB.net is preferred but C# is also welcome.  Cheers!


How would I go about solving the problem:  $$\sum_{n = -1}^{15}n 2^n$$  Edit: I've already looked at similar questions to these but none of the answers made sense to me. I'd really appreciate it if someone could explain it to me in a very easy to understand method. Thanks so much.

How can I evaluate $$\sum_{n=1}^\infty\frac{2n}{3^{n+1}}$$? I know the answer thanks to , but I'm more concerned with how I can derive that answer. It cites tests to prove that it is convergent, but my class has never learned these before. So I feel that there must be a simpler method.  In general, how can I evaluate $$\sum_{n=0}^\infty (n+1)x^n?$$


An open map between topological spaces is one that maps open sets to open sets. It says  that  Although their definitions seem more natural, open and closed maps are much less important than continuous maps.  The usual "explanation" is that continuous functions are morphisms in Top, but why should that be the case? What does preserving pre-images have to do with being the "right" morphisms in a category? This also happens with concepts like measurability, where the "right" functions to look at are those where pre-images of measurable sets are measurable. I see no inconsistencies with defining morphisms to be e.g. open maps between objects in Top and something similar for the category of measurable sets, so why are these categories not as important? The morphisms here seem just as "structure-preserving" as the usual ones. Is there some deeper reason why it's the pre-images we should be looking at in both these cases (and more)?

Recently, someone mentioned to me that given a function $f: X \to Y$ there are two natural functions between the powersets $P(X)$ and $P(Y)$. Namely $f: U \subset X \mapsto f(U)$ and $f^{-1}: V \subset Y \mapsto f^{-1}(V)$. Then if we consider maps between $P(P(X)), P(P(Y))$, each of the above maps induce two more, so there are four natural maps.  Thus, it seems on the face of it like there are four natural choices for morphisms of topological spaces (since a topology on $X$ is an element of $P(P(X))$). Why is it that continuous functions are the morphisms we choose and not one of the other four maps?  I understand that the theory we get from taking continuous functions as morphisms is incredibly rich and so this alone provides adequate justification. However, I am looking for a different sort of justification along the lines of "is there some property of continuous functions that immediately suggests they are the 'right' choice of morphisms between topological spaces?".


Ubuntu 16.04 LTS Im using ubuntu for the first time. I tried to install Windows 7 onto my new pc using a usb boot i made on my vista 32bit laptop, but it wasnt detecting any hard drives to install on.  I made a ubuntu boot drive instead with the same usb, but I know nothing about Ubuntu. Whenever I select the Win 7 ISO from the file browser in Make Start Up Disk nothing happens at all. I want to try making a new iso boot on a new usb stick using a different program. My laptop has since died. Ive been trying for hours, but my dyslexia is getting the better of me. Please write to me simply, thank you!

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


I rarely if ever need to log in to Stack Overflow. It remembers me.  I always have to log in to Programmers. Yes, it's not too hard because I can log in with my SO credentials, but it's one extra step and 3 clicks every single time. Why is that? What can I do to stayed logged in, if anything?  Browser: Firefox OS: Windows 8

Hello guys,  Whenever i visit a new stack subdomain website, i have to re-register with my google open id. Why not have one login for all sites, that way it wouldn't have to keep re-asking me for my info for a new stack overflow website. Just a suggestion.  Thanks for all the help on all stack subdomains everybody.


I have a file and can't delete it.  File created by user www-data:  -rw-rw-r-- 1 www-data www-data 17408 Jun  3 16:18 0.48257900 1464959885_555.png   I am also trying to delete it by user lifesim:   rm -rf * rm: cannot remove '0.48257900 1464959885_555.png': Permission denied   Why I can't delete that file?  lifesim@srvJH:~/public_html/upload/blog/posts/2016-06-03$ whoami lifesim lifesim@srvJH:~/public_html/upload/blog/posts/2016-06-03$ id lifesim uid=1001(lifesim) gid=33(www-data) groups=33(www-data) lifesim@srvJH:~/public_html/upload/blog/posts/2016-06-03$ id www-data uid=33(www-data) gid=33(www-data) groups=33(www-data),1001(lifesim)   File created by my PHP script.

First of all, I'm not looking for an answer on how to remove the files. I am looking for a reason why this doesn't work - and a suggestion on how to remove the files without sudo.  I have a directory in my Desktop that has a few inner directories (don't judge the naming - I just extract what I need from files I'm given) and after getting the files I try and remove the files with rm -rf Bengal\ Tiger\ Creative/, I am surprised to see the following warning for each image.     rm: cannot remove ‘Bengal Tiger Creative/Bengal Tiger Creative/images/customer-services-landscape.jpg’: Permission denied   Below is some code outputs.  tree  nathan@nathan-pc:~/Desktop$ tree . ├── Bengal Tiger Creative │   └── Bengal Tiger Creative │       └── images │           ├── awards.jpg │           ├── blank.gif │           ├── bullet1-light-green.gif │           ├── bullet2-light-green.gif │           ├── bullet3-light-green.gif │           ├── bullet4-light-green.gif │           ├── customer-services-landscape.jpg │           ├── desktop.ini │           ├── header-img1.jpg │           ├── header-img2.jpg │           ├── header-img4.jpg │           ├── header-img5.jpg │           ├── softhr.gif │           ├── Thumbs.db │           ├── tiger_main-img1.jpg │           ├── tiger_main-img2.jpg │           ├── tiger_main-img3.jpg │           ├── tiger_main-img4.jpg │           ├── Vanquis-benefits-icons_iphone-green.gif │           └── white-arrow-green.gif   ls -laR  nathan@nathan-pc:~/Desktop$ ls -laR Bengal* Bengal Tiger Creative: total 12 drwxrwxr-x 3 nathan nathan 4096 Aug 10 11:30 . drwxr-xr-x 6 nathan nathan 4096 Aug 10 11:34 .. drwxrwxr-x 3 nathan nathan 4096 Aug 10 11:34 Bengal Tiger Creative  Bengal Tiger Creative/Bengal Tiger Creative: total 12 drwxrwxr-x 3 nathan nathan 4096 Aug 10 11:34 . drwxrwxr-x 3 nathan nathan 4096 Aug 10 11:30 .. dr-xr-xr-x 2 nathan nathan 4096 Aug 10 11:36 images  Bengal Tiger Creative/Bengal Tiger Creative/images: total 356 dr-xr-xr-x 2 nathan nathan   4096 Aug 10 11:36 . drwxrwxr-x 3 nathan nathan   4096 Aug 10 11:34 .. -rwxrwxrwx 1 nathan nathan  14910 Mar 18 12:29 awards.jpg -rw-rw-r-- 1 nathan nathan   1093 Mar 21  2014 blank.gif -rw-rw-r-- 1 nathan nathan   1978 May  8  2014 bullet1-light-green.gif -rw-rw-r-- 1 nathan nathan   1969 May  8  2014 bullet2-light-green.gif -rw-rw-r-- 1 nathan nathan   2416 May  8  2014 bullet3-light-green.gif -rw-rw-r-- 1 nathan nathan   2449 May  8  2014 bullet4-light-green.gif -rw-rw-r-- 1 nathan nathan 113138 Apr 14  2014 customer-services-landscape.jpg -r--r--r-- 1 nathan nathan    142 Mar 25 11:58 desktop.ini -rw-rw-r-- 1 nathan nathan  14312 Mar 23 11:39 header-img1.jpg -rw-rw-r-- 1 nathan nathan   1480 Mar 23 11:41 header-img2.jpg -rw-rw-r-- 1 nathan nathan   1278 Mar 23 11:41 header-img4.jpg -rw-rw-r-- 1 nathan nathan   1168 Mar 23 11:41 header-img5.jpg -rw-rw-r-- 1 nathan nathan   1703 Mar 21  2014 softhr.gif -rw-rw-r-- 1 nathan nathan  88064 Aug  4 10:39 Thumbs.db -rw-rw-r-- 1 nathan nathan  23607 Mar 23 11:56 tiger_main-img1.jpg -rw-rw-r-- 1 nathan nathan  23400 Mar 23 11:56 tiger_main-img2.jpg -rw-rw-r-- 1 nathan nathan   6970 Mar 23 11:56 tiger_main-img3.jpg -rw-rw-r-- 1 nathan nathan   8996 Mar 23 11:57 tiger_main-img4.jpg -rw-rw-r-- 1 nathan nathan    275 Jul 31  2014 Vanquis-benefits-icons_iphone-green.gif -rw-rw-r-- 1 nathan nathan   1821 Jul  9  2014 white-arrow-green.gif   Doing chmod 777 and then delete does not work.  Doing rm -rf * inside the directory does not work.  Doing sudo rm file does work.   I can easily remove these files using sudo, however, I cannot see why they cannot be removed without sudo. As a relatively new Ubuntu user, I would like to learn why.  Thanks in advance, Nathan


How can I automatically rotate my wallpaper regularly? Is there a program or a way for doing so?

How do  I create a desktop wallpaper slideshow with my own set of images?   With the images coming from a pictures folder, or pre-selected With the images displayed in order, or randomly With the images changing every few minutes, or after random periods of time


I have a very large data set (~300'000 data points) and a subset of it (6000 data points), which shows the difference of travel time [in seconds] of agents before and after a road closure. I want to show the difference in their distribution.  However, the data set is so large, that the outliers are still so many and nothing can be read from the boxplot. A simple table would be an option of course, but I believe if done right, a graph can be more helpful to see the difference.   Really interesting, for the analysis, is the difference between -1000 and 1000. So I wonder, is it ok to simply truncate the data set or is it more appropriate to transform the data?

For approximately normally distributed data, boxplots are a great way to quickly visualize the median and spread of the data, as well as the presence of any outliers.  However for more heavy-tailed distributions, a lot of points are shown as outliers, since outliers are defined as being outside of fixed factor of the IQR, and this happens of course a lot more frequently with heavy-tailed distributions.  So what do people use to visualize this kind of data? Is there something more adapted? I use ggplot on R, if that matters.


I would like to cite numerous references in beamer. Everything is Ok except the way beamer orders the references. It shows the references by the first names not by numbers which makes it harder to refer to the actual reference. References look like the following picture    however in the presentation, they are numbered such as [2], [4]. With many references, it is difficult to count a certain reference. My question is Is there a way to show the number beside each reference?  \begin{frame}{Bibliography} \bibliographystyle{IEEEtran} \bibliography{references} \end{frame}

Instead of the default icons or the text option, I would like to have numbered entries in my bibliography.  I added the line:  \setbeamertemplate{bibliography item}{}  to get rid of the icons, but can't figure out how to get numbers to display in their place. The references in the content slides are numbered, but without the corresponding number in the bibliography it's not very helpful.  MWE:  \documentclass[t]{beamer}  \setbeamertemplate{navigation symbols}{} \setbeamertemplate{bibliography item}{} \setbeamertemplate{frametitle continuation}[from second]  \setbeamertemplate{footline}{     \hspace*{0.1cm}     \text{short title}     \hspace{1cm}     \insertshortauthor     \hspace{3.5cm}     \insertsectionhead     \hfill     \insertframenumber     /     \inserttotalframenumber     \hspace{0.1cm} }  \title{a title} \author[me]{my full name} \institute{where I work} \date{today}  \begin{document}  \begin{frame}     \titlepage \end{frame}  \begin{frame}     \frametitle{1st slide}     Some text. \cite{ref_1} More interesting text. \cite{ref_2} Some even more interesting stuff. \cite{ref_3}  \end{frame}  \begin{frame}[allowframebreaks] \frametitle{References}     \tiny{\bibliographystyle{abbrv} }     \bibliography{refs} \end{frame}  \end{document}   Bib file:  @inproceedings{ref_1,   title={title 1},   author={A. Author},   booktitle={book title},   year={2010} } @article{ref_2,   title={title 2},   author={B. Author},   journal={Journal},   volume={35},   number={10},   pages={1217--1256},   year={2010},   publisher={Publisher} } @incollection{ref_3,   title={title 3},   author={C. Author},   booktitle={book title},   pages={595--606},   year={2012},   publisher={publisher} }   Resulting bibliography:


I quote:  By homomorphic encryption, we mean the family of encryption schemes being able to perform homomorphic operations on ciphertexts, without decrypting them. The first time someone introduced such a notion goes back to 1978, when Rivest, Adleman and Dertouzos [RAD78] described the privacy homomorphisms. An homomorphic encryption scheme, as traditional encryption schemes, has a key generation, an encryption and a decryption algorithm, and it has an additional algorithm called evaluation.   Key generation Encryption Decryption Evaluation  How could one explain to someone with zero background on cryptography, what the evaluation step entails ?

In some homomorphic encryption schemes (e.g , ), it defines an encryption key, a decryption key, and an evaluation key to perform an evaluation f on the encrypted data. Could you please explain what is the difference between the evaluation key and the other keys?


I see that this has been marked as a duplicate, I don't think it is a duplicate, the linked question is about deleting down-voted answers for the purpose of removing negative reputation. This question is about deleting the answer to shed the down-vote and then posting higher quality content.  It seems as people are voting their agreement or disagreement here. Let me encourage voters to consider the value of    this discussion the transparency of the poster   The drama:  Questioner explained what they were doing, and inquired about an error.   No one else had responded, so I quickly pulled up the help on the function as I saw it used and quickly typed a one-liner to explain the source of the error. I begin furiously editing/elaborating as I see another answer pop up, offering an alternative and I see a downvote on my answer. Spirit undiminished, I continued, explaining how to check for the source of the error, and thus how to avoid it. I edited further, I demonstrated how to recreate the error.  I then see the other answerer has identically adopted my approach to his mishmash, and although I don't have a monopoly on Python's best practices, a bit of attribution/credit would be apropos.  An Underhanded Move:  Feeling now quite frustrated with the effort I have spent, I perceive a way to overturn the single downvote (on what was now substantially an entirely different answer). I copy the source of my answer, delete the old answer, and paste it in as a new one.  The End Result:  I see as I have composed this I have earned an upvote on my full answer, although the other respondent got the best of me with an accepted answer. If the upvote came from the original downvoter, then I am no better for the deletion and replacement. If the upvote came from someone else, I am better for the deletion, for I would otherwise be at zero and down 2 rep points.  The Final Question:  Was I right to act as I did, in principle? If not, do circumstances mitigate the harm? Or is the point infinitesimal, and I would be better off trying to fit angels on the heads of pins, and Stack Overflow is working just as it should? Or perhaps we just don't want to talk transparently about how people abuse the system to their advantage?  A Final Conclusion After Many Responses:  The community has decided that although the Stack Overflow mechanisms allow for this tactic, it is viewed as underhanded and abusive, and a user being found to do so is likely to be punished, if not officially, then by the efforts of those who have discovered him.

I have in this question:  an example of an answer (of mine) which while valid, especially for developers looking to avoid 3rd party libraries, was not used by the asker. In spite of what were (in my opinion) clear instructions - the user used the wrong regex string even after multiple attempts and did not see their desired results, and so gave up on the solution and downvoted it.  As an answerer defending my rep (especially around a milestone that controls privileges) - my only immediate reaction is to delete the answer so that the downvote no longer counts towards my rep total.  I still strongly feel that this sort of answer would be useful to future visitors who aren't limited by the inability to follow instructions - but why leave it up when all that effort only leads to a loss of rep?  (I apologize for the frustration exhibited in this post.)


I am nominally in a Professor X's lab, but I work with and communicate with his PhD Student Y most of the time. Would it be looked down upon for Y to write me a LoR for grad school, since even though he knows me better, he is only a grad student/would be a fresh PhD by the time I get around to applying? Should I plan to ask X for a rec letter even though I don't directly work with him?

I am a MA student who frequently works with undergraduates on projects. One student has asked me if I can write her a letter of recommendation for graduate school. Are there any risks to me submitting a letter, as opposed to her finding a faculty member (who likely would not be in the same field as her interests)? For graduate school applications how much does the position of the person writing a recommendation letter matter, as opposed to his/her academic familiarity with the student? I have already advised her to check with the programs she is applying to in case they have requirements.  Edit: I realize I left this unclear before-- she has two tenured professors willing to write letters. If I agreed to, I would be the third letter. The department is small, so there might not be too many options for an additional letter.


Let $a_1,a_2,...$ be nonnegative numbers whose sum is $1$ and let $x_1,x_2,...>0$. I want to show that $\prod_{i=1} ^ \infty x_i^{a_i} \leq \sum_{i=1} ^ \infty a_ix_i$.  This looks awfully similar to the $AM \geq GM$ inequality. In fact, the AM-GM inequality is a special case of this.  I was thinking of using Jensen's inequality which states, if a function $\phi$ is convex on all of $\mathbb{R}$ and $f$ is Lebesgue integrable on $[0,1]$ and $\phi \circ f$ is nonnegative on $[0,1]$, then $\phi(\int_0 ^1 f)\leq \int_0 ^1 \phi \circ f$.

Given that $\{\phi_n\}$ is a sequence of non-negative numbers whose sum is $1$ and $\{\psi_n\}$ is a sequence of positive numbers, how can I show that  $$ \prod_{n=1}^{\infty}~\psi_n^{\phi_n}~\leq~\sum_{n=1}^{\infty}~\phi_n\psi_n~? $$    Thanks.    PS: I'm not too sure about the title. Perhaps, someone could give it a better title?


Let $d=1$.  (i) Show that if $\lambda$ is a distribution and $n\geq1$ is an integer, then $\lambda x^n=0$ if and only if $\lambda$ is a linear combination of $\delta:=\delta_{\{0\}}$ and its first $n-1$ derivatives $\delta', \delta'', \cdots, \delta^{(n-1)}$.  (ii) Show that a distribution $\lambda$ is supported on $\{0\}$ if and only if it is a linear combination of $\delta$ and finitely many of its derivatives.  (iii) Generalise (ii) to the case of general dimension $d$ (where of course one now uses partial derivatives instead of derivatives).  I don't need exact solutions, I just like to get the main ideas.   In part (i) I need a generalized version of  that includes higher order derivatives.   For part (ii), I am interested in the nontrivial direction, i.e. the "only if" part.  For part (iii) I am just interested to see the generalized statement.  In case you are wondering, I am going through  on my own and the above question is exercise 22 of the notes.

Let $u$ be a distribution on $\mathbb{R}^n$ with support = $\left\{0\right\}$. Then there exists $N$ such that $u$ has order $N$. Let $\chi\in C_0^{\infty}(\mathbb{R}^n)$ a smooth function with  $\chi(x) = 1$ for $0\leq |x|\leq 1 $,   $\chi(x)\in [0,1]$ for $1\leq |x|\leq 2$,  $\chi(x)=0$ for $|x|\geq 2$  Denote $ \chi(x/r) = k_r(x)$ for $r\in (0,1]$. For the case $N=0$ I want to show that there exists $c_1$ such that $$|\left\langle u,\phi \right\rangle|\leq c_1 |\phi(0)|  $$ for all $\phi \in C_0^{\infty}(\mathbb{R}^n)$. The idea would be to apply $u$ on $\phi = k_r\phi+(1-k_r)\phi$ and letting $r\to 0$.   So then I guess we can write $$ |\left\langle u,\phi \right\rangle| \leq |\left\langle u,k_r\phi \right\rangle| + |\left\langle u,(1-k_r)\phi \right\rangle |$$ But not really sure how this follows...  Moreover how can i show that $\left\langle u,\phi \right\rangle = \left\langle u,\phi \chi\right\rangle = \left\langle u,\chi\right\rangle\phi(0) $?


I have been told that my proof is not true at all without any explanation why, I would like if any one can help. Let $T: V\to V$ linear operator in finite inner product space, show that $$\left(\operatorname{Im}\left(T^*\right)\right)^\perp=(\ker T)$$ My attempt: $\left(\operatorname{Im}\left(T^*\right)\right)^\perp=(\ker T) \iff \operatorname{Im}(T^*)^=\ker\left(T^{}\right)^\perp$ Let  $\vec v\in Im(T^*) $ and let $\vec w \in \ker(T)$ so we can write : $\langle T^*(v),w\rangle=\langle v,T(w)\rangle=\langle v,0\rangle=0$

How can I prove that, if $V$ is a finite-dimensional vector space with inner product and $T$ a linear operator in $V$, then the range of $T^*$ is the orthogonal complement of the null space of $T$?  I know what I must do (for a $v$ in the range of $T^*$, I have to show that $v\perp w$ for every $w$ in $\ker(T)$ and then do the opposite), but I don't know how to show that this inner product is zero.


I have a queue class that has this definition:      template <typename T>     class SharedQueue     {     public:         SharedQueue();         ~SharedQueue();     };   In test.h, I have as one of the variables in the class:  SharedQueue<int>* sharedQueue;   In test.cpp, I am trying to do:  sharedQueue = new SharedQueue<int>;   But, for some reason, it's giving me errors. Am I not initializing the template class properly?   I looked and noticed this:  but it's difficult to see how relevant that is to me  UPDATE:  The error is  Error   LNK2001 unresolved external symbol "public: __cdecl SharedQueue<int>::SharedQueue<int>(void)" (??0?$SharedQueue@H@@QEAA@XZ) Demo    C:\test\foo.obj 1         1 unresolved externals   UPDATE TWO:  SharedQueue.h:  #pragma once  #include <queue> #include <mutex> #include <condition_variable>  template <typename T> class SharedQueue { public:     SharedQueue();     ~SharedQueue();     T& front();     void pop_front();     void push_back(const T& item);     void push_back(T&& item);     int size();     bool empty();  private:     std::deque<T> queue_;     std::mutex mutex_;     std::condition_variable cond_; };   SharedQueue.cpp:  #include "SharedQueue.h"  template <typename T> SharedQueue<T>::SharedQueue() {  }  template <typename T> SharedQueue<T>::~SharedQueue() {  }  template <typename T> T& SharedQueue<T>::front() {     std::unique_lock <std::mutex> mlock(mutex_);     while (queue_.empty())     {         cond_.wait(mlock);     }     return queue_.front(); }  template <typename T> void SharedQueue<T>::pop_front() {     std::unique_lock<std::mutex> mlock(mutex_);     while (queue_.empty())     {         cond_.wait(mlock);     }     queue_.pop_front(); }  template <typename T> void SharedQueue<T>::push_back(const T& item) {     std::unique_lock<std::mutex> mlock(mutex_);     queue_.push_back(item);     mlock.unlock();     cond_.notify_one(); }  template <typename T> void SharedQueue<T>::push_back(T&& item) {     std::unique_lock<std::mutex> mlock(mutex_);     queue_.push_back(std::move(item));     mlock.unlock();     cond_.notify_one(); }  template <typename T> int SharedQueue<T>::size() {     std::unique_lock<std::mutex> mlock(mutex_);     int size = queue_.size();     mlock.unlock();     return size; }

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


I found this regex:  ^[^\s()<>@,;:\/]+@\w[\w\.-]+\.[a-z]{2,}$   but I have 2 problems with it:   I can't enter a single letter domain - like: a@a.me I can enter slashback \ which is not valid   Can you help fixing this?

Over the years I have slowly developed a  that validates MOST email addresses correctly, assuming they don't use an IP address as the server part.  I use it in several PHP programs, and it works most of the time.  However, from time to time I get contacted by someone that is having trouble with a site that uses it, and I end up having to make some adjustment (most recently I realized that I wasn't allowing 4-character TLDs).  What is the best regular expression you have or have seen for validating emails?  I've seen several solutions that use functions that use several shorter expressions, but I'd rather have one long complex expression in a simple function instead of several short expression in a more complex function.


I want to the Ubuntu terminal to show art like this picture:    How to do that? I want put my own logo using the word character. I would like to arrange it and form a logo.  Please teach me the way..

As you can see on this screenshot of 's Guake he has a startup message of ASCII art when he opens it, and that's what I'd like to do, can someone help me?


I have a script that fails to detect zero length strings,the script uses [ -n $value  ] in a bash conditional expression, i.e.  #!/usr/bin/env bash  value="" if [ -n $value ] then     echo "value is non-zero" fi   result     value is non-zero   If I use [[ -n $value ]] it works, i.e.  #!/usr/bin/env bash  value="" if [[ -n $value ]] then     echo "value is non-zero" fi   using [[ produces no output as expected. From the man page:      [[ expression ]]       Return a status of 0 or 1 depending on the evaluation of the conditional expression expression.  Expressions are composed of the pri‐       maries described below under CONDITIONAL EXPRESSIONS.  Word splitting and pathname expansion are not performed on the  words  between       the  [[  and ]]; tilde expansion, parameter and variable expansion, arithmetic expansion, command substitution, process substitution,       and quote removal are performed.  Conditional operators such as -f must be unquoted to be recognized as primaries.    I can't make out an explanation for the behaviour from this. Why does [[ detect zero length strings but [ doesn't?

I'm confused with using single or double brackets. Look at this code:  dir="/home/mazimi/VirtualBox VMs"  if [[ -d ${dir} ]]; then     echo "yep" fi   It works perfectly although the string contains a space. But when I change it to single bracket:  dir="/home/mazimi/VirtualBox VMs"  if [ -d ${dir} ]; then     echo "yep" fi   It says:  ./script.sh: line 5: [: /home/mazimi/VirtualBox: binary operator expected   When I change it to:  dir="/home/mazimi/VirtualBox VMs"  if [ -d "${dir}" ]; then     echo "yep" fi   It works fine. Can someone explain what is happening? When should I assign double quotes around variables like "${var}" to prevent problems caused by spaces?


I need to find $$\lim_{n\to\infty}\frac{1^{k}+2^{k}+...+n^{k}}{n^{k+1}}$$ for $k>0$ And I just need an explanation on how come $$\lim_{n\to\infty} \sum_{i=1}^{n} \frac{1}{n}\left(\frac{i}{n}\right)^{k} = \int_{0}^{1}x^{k}dx$$

By considering:  $$\lim_{n\to\infty}\frac{\sum_{k=1}^n k^1}{n^{2}} = \frac 1 2$$ $$\lim_{n\to\infty}\frac{\sum_{k=1}^n k^2}{n^{3}} = \frac 1 3$$ $$\lim_{n\to\infty}\frac{\sum_{k=1}^n k^3}{n^{4}} = \frac 1 4$$  Determine if this is true: $$\lim_{n\to\infty}\frac{\sum_{k=1}^n k^m}{n^{m+1}} = \frac 1 {{m+1}}$$  If it is, prove it.  If it is not, evaluate $\lim\limits_{n\to\infty}\frac{\sum_{k=1}^n k^m}{{m+1}}$.


When i log in to my Ubuntu 12.04.4 LTS it takes me immediately back to my log in screen. This behavior began when I pressed the power button during installation of updates (to a new version of Ubuntu) somewhere around June or July of this year. If I type the wrong password it says "incorrect login". If I type the correct password, it goes black for a second then comes back to the log in page again. The log in page looks completely different than it used to under Ubuntu 12.04.4 LTS. When I press    and then log in it just says incorrect login over and over again no matter what.

My Ubuntu is stuck in a login loop when trying to enter my desktop. When I login, the screen gets black and soon after that the login screen comes back.   I've read that the problem might be caused by an error depending on the graphics, here's my graphics card: ATI Radeon 7670M


Are these packages in some directory called java? I have not been able to find any package called java though in my IDE. Where would these packages java.lang or java.util be located at? If it is located in the JRE or JDK, is the word "java" inside java.lang representing the directory/package where the JDK is located at? The reason I ask is because typically such syntax is used for packages.

This may sound like a stupid question. Where are the core class files from Sun, like Button.class, located in the JDK installation folder C:\Program Files\Java\jdk1.5.0_12?   Or do the class files reside in C:\Program Files\Java\jre1.5.0_12 folder?


In DS9 shuttles seem to be a-dime-a-dozen. They get destroyed on and off screen so many times that I've lost count. They then get replaced pretty fast.  Voyager only has two shuttles as far as I can tell. But they get damaged, crash land almost every other episode, get taken by the Kazon, etc.    One was taken by Kazon when Chakotay was taken prisoner. One was destroyed. (Sometime in Season 2 or 3) One crash-landed but Tuvok seemingly repaired it with the power of Hollywoodism.   etc. EDIT:  Not interested in how many Voyager has as this answer can be infinite. Intrepid can hold 2 but we see many, many more.  So my question/s are how many Shuttles get destroyed in the show (on or off screen) and do they just replicate more when they lose them?

In the episode , at the start of the episode when Voyager is in the process of a major maintenance overhaul there are at least 3 shuttles that can be seen. I have lost track of the number of times a shuttle has been destroyed. How many shuttles does Voyager have, not including The Delta Flyer?


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

I tend to use the words define, declare and assign interchangeably but this seems to cause offense to some people. Is this justified? Should I only use the word declare for the first time I assign to a variable? Or is there more to it than that?


relatively new to java.  I'm trying to programm Battleship into java. I'm getting a java.lang.nullPointerException. I know that this means that I initialized an object (in this case an ArrayList), but didn't give it a value. This is what my code looks like, what am I doing wrong?  for(Ship toDestroy : shipList) {         ArrayList<String> newLocation;         if(name.equals("Destroyer") || name.equals("Victoire")){             newLocation = helper.placeShip(3);             toDestroy.setLocationCells(newLocation);         }else if(name.equals("Dingy")) {             newLocation = helper.placeShip(2);             toDestroy.setLocationCells(newLocation);         }else if(name.equals("S.S. Anne")) {             newLocation = helper.placeShip(4);             toDestroy.setLocationCells(newLocation);         }else if(name.equals("Titanic")) {             newLocation = helper.placeShip(5);             toDestroy.setLocationCells(newLocation);         }else {             newLocation = helper.placeShip(0);         }     }   I added the last else statement, because I figured that in that case 'newLocation' will always have a value, but it's still not working. else{newLocation = null} also did not work.

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


I want to create a set of maps using the QGIS atlas feature. It works quite well, however when printing the maps to an image or pdf, the base map (google maps areal imagery) is shifted under the rest of the map.   The screenshots show (a) the correct representation in the print composer and (b) the defective map I get when printing to .tiff. Is there any workaround on this issue?   (a) correct map in print composer   (b) defective map printed to .tiff

I've had this problem before but I'm not succeeding in fixing it using what I thought worked before.  This has been brought up as an issue previously, but I'm stuck when I apply the previous answers.  There must be numerous people doing the same thing.  I am running QGIS 2.8.2 on Mac OS X (10.10 Yosemite) with OpenLayers 1.3.6   I start off a new project by using the OpenLayers plugin to connect to Google or Bing Maps. I confirm or set the project projection to EPSG3857 for WGS 84 Pseudo Mercator. Then I add a layer in a different project (happens to be IRENET95). Zoom to the new layer and everything fits very nicely on the screen. Open a new Print Composer and add a map.  Things look good on the screen still. Export as a pdf or image and the image base seems to have shifted.   Am I missing something simple or obvious here? In case this is not all clear I've attached two images below.  The first is the screen (of Print Composer) and the second is the exported file.


So now I can retrieve a string and integer  by doing this for string   LastName = formCollection["LastName"]   and for int  Amount = int.Parse(formCollection["Amount"])   My problem now is for enum. I tried this, still have an error    Issuer = Enum.Parse(formCollection["Issuer"]);   Issuer = Enum.Parse(typeof(Issuer), formCollection["Issuer"]);

What's the best way to convert a string to an enumeration value in C#? I have an HTML select tag containing the values of an enumeration. When the page is posted, I want to pick up the value (which will be in the form of a string) and convert it to the corresponding enumeration value. In an ideal world, I could do something like this: StatusEnum MyStatus = StatusEnum.Parse("Active");  but that isn't a valid code.


I was studying from some book and I came across something I haven't been able to justify. Let's suppose se have a field $K$ and an ordered group $G$ (with multiplicative notation) with an extra element called $0$ satisfying $$0x=0$$ and $$0<x$$ for all $x\in G$.  We then define a valuation as a function $$v:K\to G$$ satisfying $$v(x)=0\Leftrightarrow x=0$$ $$(\forall x,y),v(xy)=v(x)v(y)$$ $$v(x+y)\leq \max(v(x),v(y))$$  We can prove that $v(1)=1,v(- x)=v(x)$ for all $x$. Then in the book the proposition     If $v(x)<v(y)$ then $v(x+y)=v(y)$   is proved like this: $$v(y)=v(y+x-x)\leq \max(v(y+x),v(x))=v(y+x)\leq \max(v(y),v(x))=v(y)$$  Then step I've trouble with is:  $$\max(v(y+x),v(x))=v(y+x)$$  Why can we say that? I mean, why can we say that $v(y+x)>v(x)$ if $v(x)<v(y)$?

Let $F$ be a field and $v:F\rightarrow G\cup\{\infty\}$ be a valuation on $F$ so $G$ is a totally ordered abelian group with $\infty$ having the properties $\infty+\infty=g+\infty=\infty+g=\infty$ and $\infty\leq\infty$ for all $g\in G$, $\infty \notin G$.     Show if $v(a)\neq v(b)$ then $v(a+b)=\min(v(a),v(b)$).   I must be missing some trick here on how to show this is true.  My approach has been to use that $G$ is a totally ordered group so I start by assuming $v(a)\neq v(b)$ and letting my first case be $v(a)<v(b)$ as trichotomy holds in $G$. By $v$ being a valuation on $F$, we then have that $v(a+b)\geq \min(v(a),v(b))=v(a)$. From here what I've tried doing doesn't seem to help much.  I've said lets assuming $v(a+b)>\min(v(a),v(b))=v(a)$ and we also have $$v(a+b)> v(a) \Rightarrow v(a+b)+v(a^{-1}) > 0 \Rightarrow v(1+ba^{-1}) > 0$$ and $$v(a)<v(b) \Rightarrow 0< v(b)+v(a^{-1}) \Rightarrow 0 < v(ba^{-1})$$ also $$v(1+ba^{-1})\geq\min(v(1),v(ba^{-1}))=\min(0,v(ba^{-1}))=0.$$  How does one solve this?


I'm unable to understand the working of this piece of code.  #include<stdio.h> void main(){   int a,b;   a=3,1;   b=(5,4);   printf("%d",a+b); }     The output is 7. What is that assignment?


What are the charges of cancelling the UK visa application? I haven't done the biometrics yet in fact not even booked the appointment, just submitted the application on gov.uk website and done the payment. So -   Will I get a full refund or there is some cancellation fees if I cancel the visa application? Can I reapply immediately after cancellation?   This is for standard Visitor Visa.

I applied online for a visa application to the UK. I'm from Sri Lanka. Yesterday I cancelled the appointment, I changed my mind. I will not go to the visa appointment. Now my question is how I get my refund?


I'm using visual studio code to develop an aura component. Usually when i deploy a source to my org the error i was receiving was the same i can find in the "Deployment Status" Section on salesforce, but since yesterday the only error i'm getting is the following:    While the real error is the following:  I have already tried to uninstall and reinstall the extension but it still showing the same error.  I've also tried to run force:source:deploy with the Terminal in VSCODE with loglevel: trace and it's sill not showing anything detailed.   Does anyone know how to help? Thank you.

VS Code plugin for salesforce seems to be broken yesterday, It does not provide proper error message in case of failure.  Tried this in a developer org as well as scratch org. Neither deploy code or push gives an error message, and every time we need to go to Salesforce setup -> Deployment Status to view the details.  Is anyone aware of any workaround?


What would be the best method to compare to products on a question rated 1-7?  The current technique being utilized in my team is compare mean for the 2 groups using F test.  but doesn't it violates the very assumption of normal distribution of variable being compared?

I have a data set from a customer survey, I want to deploy a statistical test to see whether there is significance difference between product 1 and product 2.  Here is a data set of customers' reviews.   The rate is from very bad,bad,okay,good,to very good.  customer    product1    product2 1           very good   very bad 2           good        bad 3           okay        bad 4           very good   okay 5           bad         very good 6           okay        good 7           bad         okay 8           very good   very bad 9           good        good 10          good        very good 11          okay        okay 12          very good   good 13          good        good 14          very good   okay 15          very good   okay   What methods should I use to see if there is any difference betw these two products?


I am having trouble displaying an image on a JLabel. I have another class called ControlPanel which saves the image in the project folder. I had the methods which save the image in this class but for some reason, I was getting a NullPointerException. When I moved them in the other class everything started working properly.  The actual image is a bufferedImage on which the user draws.  import java.awt.Color; import java.awt.Dimension; import java.awt.GridLayout; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException;  import javax.imageio.ImageIO; import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel;  public class GalleryPanel extends JPanel  {      private static final long serialVersionUID = 1L;     private JLabel[] images;     private static final int MAX_IMAGES = 12;     private int currentImage;       public void init()     {            images = new JLabel[MAX_IMAGES];         setLayout(new GridLayout(3,4));         setBackground(Color.GRAY);     }       public void addImageToGallery(String fileName, String fileExtension)     {         if ( currentImage < images.length - 1)         {                ImageIcon icon = new ImageIcon(fileName + fileExtension);              images[currentImage] = new JLabel(icon, JLabel.CENTER);              add(images[currentImage]);              displayImage(currentImage);              currentImage++;         }         else         {             throw new ArrayIndexOutOfBoundsException("The gallery is full");         }     }       // display the doily image in the gallery     public void displayImage(int index)     {         images[index].setSize(300, 300);         add(images[index]);     }       public final int getMaxImages()     {         return MAX_IMAGES;     }       public Dimension getPreferredSize()      {           return new Dimension(380, 700);     }  }   those are the two methods in my other class which are responsible for saving the actual image  // Shows a dialog box which asks the user to choose a name for the file that he wants to save public void saveImage(BufferedImage bufImage) {     String fileName = JOptionPane.showInputDialog("Choose image name");      if (fileName != null)     {            if(fileName.equals(""))         {             fileName = "Untitled";         }          chooseImageFormat(bufImage, fileName);     }     }       //shows a dialog box which asks the user to select the file format of the image he would like to save public void chooseImageFormat(BufferedImage bufImage, String fileName) {     Object[] imageFormats = {"PNG", "JPEG"};      String userInput = (String) JOptionPane.showInputDialog(null, "Choose file format", "File Format Settings", JOptionPane.PLAIN_MESSAGE, null, imageFormats, "PNG");       String imageFormat = (userInput.equals("PNG")) ? "PNG" : "JPEG";     String fileExtension = (imageFormat.equals("PNG")) ? ".png" : ".jpg";      File file = new File(fileName + fileExtension );      try      {         ImageIO.write(bufImage, imageFormat, file);     }      catch (IOException e)      {         e.printStackTrace();     }      gallery.addImageToGallery(fileName, fileExtension); }


Matrix norm is defined as  \begin{aligned}\|A\|&=\sup \left\{{\frac {\|Ax\|}{\|x\|}}:x\in K^{n}{\text{ with }}x\neq 0\right\}.\end{aligned}  How can we derive the following calculating formulas  \begin{aligned}\|A\|_{1}=\max _{1\leq j\leq n}\sum _{i=1}^{m}|a_{ij}|\end{aligned}  \begin{aligned}\|A\|_{\infty }=\max _{1\leq i\leq m}\sum _{j=1}^{n}|a_{ij}|\end{aligned}  \begin{aligned} \|A\|_{2}=\sigma _{\max }(A)\end{aligned}

I know the title isn't very clear. The question is the following. Let $\|\cdot\|$ be a vector norm on $\mathbb{C}^n$. Define the induced norm on $\mathbb{C}^{n\times n}$ as: $$\|A\|_{op}=\max\limits_{x\in\mathbb{C}^n\smallsetminus\{0\}}\dfrac{\|Ax\|}{\|x\|}.$$ How do I prove that:   If $\|\cdot\|_{2}$ is the Euclidean norm, then: $$\|A\|_{2}=\rho^{\frac12}(A^{*}A),$$ with $\rho(A)$ the spectral radius of $A$ and $A^{*}$ the conjugate transpose of $A$? If $\|\cdot\|_{\infty}$ is the max norm ($\|x\|_{\infty}=\max|x_i|$, $x_i$ being the components of $x$) then: $$\|A\|_{\infty}=\max_{i=1,\dots,n}\left(\sum\limits_{j=1}^n|a_{ij}|\right)?$$ And that if $\|\cdot\|_{1}$ is the sum norm ($\|x\|_{1}=\sum_{i=1}^n|x_i|$, $x_i$ being, again, the components of $x$), then: $$\|A\|_{1}=\max\limits_{j=1,\dots,n}\left(\sum\limits_{i=1}^n|a_{ij}|\right)?$$


I saw this expression as a title of a short documentary on Youtube and was wondering, because it makes no sense to me grammatically.

The header of  states:     High-level languages need not be slower than low-level ones.     Why use need not instead of do not need? What does it mean? Also, why no to before be?


When I’m in survival I double click jump like the way you fly in creative mode. But I just stay on the ground. Am I doing something wrong?

So the new item, Elytra on 1.9 are supposed to make you glide. I have used them at my friend's house when we were playing snapshots but when the update came out, I tried them at my house and all that happened was I fell to my death. Does anyone know what I'm doing wrong and how I can fix it?


It is well known that quarks have a charge of either 2/3e or -1/3e depending on quark. What is the evidence behind that?   Did someone simply write $q_u+q_u+q_d=q_{proton}=1e$ and $q_u+q_d+q_d=q_{neutron}=0$ and solve it? If so, why do we assume that the total charge is the sum of the parts? It's clearly not the case with mass. Maybe some charge is added or lost because of the binding interaction?

How has quark electric charge been directly measured when quarks are never directly observed in isolation (due to a phenomenon known as )?


I've done everything but kill the developer and am missing the Heart Pendant.  I've spent a couple hours AFKing the ocean and no fin.  I have no clue where the Heart Pendant is and can't find an answer anywhere.

After beating the game, I still have several empty inventory spots.  I most likely missed several items in my addicted frenzy to finish the game.  What are all the items that can be found in the game? And where can they found?


I am confused as to what the sizeof function returns.    Suppose I enter the following into a program for sizeof, and this is what is returned:   sizeof(char) ==  1 sizeof(int) == 4 sizeof(float) == 4 sizeof(long) ==  8 sizeof(double) == 8 sizeof(void *) == 8   sizeof Pointer is 8. So if I malloc a long array:  long *array = (long *)malloc(64)   Would this sizeof() inserted into the malloc of my long array be equivalent?  long *array = (long *)malloc(8*sizeof(long))   Now if I have a struct:  typedef struct treenode {     struct treenode *left;     struct treenode *right;     void *content; } Treenode;    And I run sizeof(Treenode), do I add all the elements of the struct together?     Pointer + Pointer + void * = 8 + 8 + 8 = 24   I tried running this in a program, however I get sizeof(Treenode) to return 12.  I am also wondering why when I create a new struct like this:    typedef struct country {     char city[40];     int population;     int rank; }   and try to malloc(sizeof(country *)) only 8 bytes are allocated instead of the bytes of the struct.    Finally when I do sizeof("Korea"), why is my return value 6 and not 5? Should it not be 5 because there are only 5 chars in the string?

Why does the sizeof operator return a size larger for a structure than the total sizes of the structure's members?


Given 3 | $(a^2+b^2)$. Show that 9 | $(a^2+b^2)$  I was given only examples, but not a rigorous proof. No clue how to do it, even using contradiction method. Thanks in advice

I am trying to prove this by contradiction. So if $3$ doesn't divide $a$ or $3$ doesn't divide $b$, then the remainder is either $1$ or $2$. I am struggling on what to do next. How do I get the remainder of $a^2$ and $b^2$ for these cases?  Any help is greatly appreciated. Thank you!


I ahve a table called info_acc (id,state,country,zip) now i need to compare a set of keywords with al the fileds of this table say value is Alaska I need to compare this with id,state,country,zip and in match with any filed then row(s) will be selected. How can I do this with efficient way? Thanks

I'm trying to figure out how to locate all occurrences of a url in a database. I want to search all tables and all fields. But I have no idea where to start or if it's even possible.


Let $g(x)=(x-a)(x-b)(x-c)$ with $a\neq b\neq c$. Then $\mathbb{C}[x,y]/\langle y^2-g(x) \rangle$ is integrally closed in its fraction field.   I manage to do with the following theorem:     A smooth function $f$ is non-singular if and only if $\mathbb{C}[x,y]/\langle f(x,y) \rangle$ is integrally closed in its fraction field.   But how will I do without using this? Like an example has done .

A problem on an algebra qual reads     Show that the ring $R = \mathbb{C}[x,y]/(y^2 - x^3 +1)$ is a Dedekind   domain. (Hint: compare $R$ with the subring $\mathbb{C}[x]$.)   $R$ is clearly Noetherian. It is an integral extension of $\mathbb{C}[x]$, so inherits its dimension, which is one. How do I know it is normal?


char *one = new char[1024]; char one1[] = "hello"; one = hello; cout << sizeof(one) << endl;   I really want the last line to output sizeof(one1) but I know as it stands it will output the size of the pointer which is 4 or 8. Is there a way to extract the sizeof() of the array from just the pointer to the first letter?

First off, here is some code:  int main()  {     int days[] = {1,2,3,4,5};     int *ptr = days;     printf("%u\n", sizeof(days));     printf("%u\n", sizeof(ptr));      return 0; }   Is there a way to find out the size of the array that ptr is pointing to (instead of just giving its size, which is four bytes on a 32-bit system)?


The Desired Result: via rechargeable battery, power a 12v 1 meter led strip that takes 1.2 amps.  I have purchased an orico power bank with 12v 1.35amps output as it meets the dimensions needed for the project.   The issue: the power bank automatically detects the charing environment and currently is stuck with the 5V output option and can not power the leds.   Possible Solution: I am curious if there is a way to, perhaps use a micro-controller to cause the power bank to detect the desired charging environment to output the 12V.    alternatively: if there is another power bank that outputs 12V and 1.35+amps close to these dimensions: 102 x 76.8 x 21.5 mm that doesnt require additional steps, id be open to purchasing another. ( I have searched quite a bit for rechargeable packs and seem to have only found the one listed above)  or  some configuration of rechargeable batteries like the 18560 to power it (I'm just hoping to use a recharge pack as it often has additional feature to keep it more safe)

I am trying to power up my raspberry pi 3 with a Xiaomi 10000mAh fast charging power bank through the L298N motor controller. The motor controller can receive from 7 to 35V, and it has a 5v output, which I use to power my pi through the 5V pin. I also use a USB 2.0 to TTL UART Module 6Pin Serial Converter ().  I read a bit about fast charging and how they control the voltage, and this is how the charger decides what voltage to output using the d+ and d- pin:   The first problem is that the usb converter doesn't have the D+ and D-, but I believe it should be the RXD and TXD pin. I want my power bank to output 9V to the motor controller so I tried plugging a 3.3V to the 0.6V to the RXD and TXD (tried both way) but it doesn't change the output voltage. The second problem is that if I just plug the power bank to the motor controller, which it will automatically output 5V, it doesn't turn on the Pi.  I am new to these kinds of stuff so any suggestion on how to do this will be really helpful. Thank you.


I have never used ubuntu before. For the first time I'm going install ubuntu 20.04 on my PC. I checked the system requirements for 20.04 version - it requires 4GB of memory & my PC has only 4GB of memory. I need to run the Android Studio on it but Android Studio usually consumes a lot of memory. So my question is, Is 4GB RAM enough to run both ubuntu 20.04 version & Android Studio?

I'm an android developer and have laptop with 4GB RAM. When I compile my project the RAM is used at 100%.    If I add more RAM will it solve the problem?


Q: Prove by induction that $n^3-n$ is divisible by 24 for all odd positive integers  After proving the first part for n=1  Assume true for some positive integer $n=k$  ie $k^3-k=24x$ where x is an integer  Prove true for $n=k+2$  ie $(k+2)^3-(k+2)=24y$ where y is an integer  $=k^3+6k^2+11k+6$  $=24x+12k+6k^2+6$ But how do I get this in the form $24y$? Am i supposed to use $2k+1$ instead?

At our college, a professor told us to prove by a semi-formal demonstration (without complete induction):   For every odd natural: $24\mid(u^3-u)$   He said that that example was taken from a high school book - maybe I din't get something, but I really have no idea to prove that without using complete induction.  Any idea of smart demonstration?  Thanks for your help. (Excuse my bad English.)


Unfortunately, I am not able to setup up Ubuntu on my system as I am having trouble creating a functional live usb.  I have downloaded the installer and the iso from the Ubuntu download page and have created the usb but when it tries to boot up it stays stuck on "SYSLINUX 4.07 EDD 2013-07-25 Copyright (C) 1994-2013 H. Peter Anvin et al" and just hangs till I restart it.  I have formatted my usb drive to FAT32 I am running on Windows 8.1 with secure boot disabled I am trying to install the latest Ubuntu version 14.04 (dual boot)

This is the third time I've tried to install Ubuntu Server 14.04.03 64-bit on the same laptop, and each time it caused different problems.  Each time I wrote the same iso image to a USB flash drive by using a different application and OS.   Universal USB Installer (pendrivelinux.com) from Windows WinImage writer from Windows built-in image writer from Linux Mint 17.2    The iso image is the same in all three cases, the USB flash drive is the same, and the laptop is the same. However each time the installation of Ubuntu gave me different installation options. For example, the last time I installed Ubuntu, it didn't show all the packages to choose while installing (Basic Ubuntu server, etc.).


I got my greenhouse and didn't account for the sloping away of the wall it was to go against. Meaning a small gap at the bottom becomes 4" at the top.  I can't push it into the wall as it warps the greenhouse and can't leave the huge gap. Is there a way of deal with this?   I was thinking of maybe   some type of structure around it then fill with expanding foam then remove the structure. some mesh then plaster it.

Added this to  and was advised to post here.  I got my greenhouse and didn’t account for the sloping away of the wall it was to go against. Meaning a small gap at the bottom becomes 4” at the top.  I can’t push it into the wall as it warps the greenhouse and can’t leave the huge gap. Is there a way of deal with this?   I was thinking of maybe  - some type of structure around it then fill with expanding foam then remove the structure. - some mesh then plaster it


I do have a Stack Exchange account that I log in using Google auth. I'd like to provide myself with alternative access to my account, i.e. without Google - a separate login/password, Google-independent, for the same account. I've been searching for that and found only merging accounts, but that's precisely not the case.  What can I do to add standard login/password access to my Google-dependent account?

I no longer use the service that I originally used to register, and would like to change the service I use to log in, or at least add a second account.  Is this possible? How do I change my login provider or associate a backup method to log in?     For more information, see "" in the .


Is a quotient group always cyclic.  I see nothing on the internet that tells me it's the case, but since a quotient group: $\Phi : G \rightarrow G/H$ such that $\Phi(g) = gH$ Its kernel is H therefore intuitively, this implies the notion of cyclic groups

Suppose that $H$ is a (cyclic) subgroup of order $m$ of a cyclic group   $G$ of order $n$. What is $G/H$?   It's a very simple question but I am still struggling with getting accustomed to the notion of the quotient group.   Now, I know that $m$ divides $n$ and that $G/H$ will be a group of cosets such that $\{gH:g\in G\}$. As a result, there will be $n/m$ of such cosets. I was wondering I can say anything more specific than just that?


This question has been asked and supposedly answered before, but I can't make sense of the answers so I thought I'd ask my own question and hope for the best. So, I use mcode.sty a lot and as things are now I have to copy that file into every folder where I have tex files that use mcode. What "central place" can I put it so I don't have to copy it all the time? What I've tried:  sudo mkdir /usr/share/texlive/texmf-dist/tex/latex/mcode sudo cp ~/.../mcode.sty /usr/share/texlive/texmf-dist/tex/latex/mcode  It doesn't work.

I know how to define a package or a class, but how do I make it available (to myself) at all times?  Say I have the package file commonstuff.sty (or myprettyclass.cls), that I want to be able to include in any .tex file I create on my computer. Where do I put it? Do I need to run some installer on it, or is it enough to keep it in a certain folder?  Note: I know I can just place it in the same folder as the .tex file, but that's not what I'm after here. I'm looking for a way to "install" the package centrally on my computer.


I'm training a classifier for a supervised classification problem. Some of my features interact, how should I normalize these interaction terms?   For example, if x1 and x2 interact, the interaction term is x1*x2. Should the values of x1*x2 be computed before x1 and x2 are normalized, and then normalized. Or should x1*x2 be computed from normalized values of x1 and x2?

I am currently running a multiple linear regression, and I am bit confused in regards to how to properly add interaction terms to the model by hand. All of the variables I am using are continuous and have different scales and units.  So far, the way I have done it has been to   Standardize the observations for each variables Multiply corresponding standardized values from specific variables to create the interaction terms and then add these new variables to the set of regression data Run the regression   Is this the correct way to go about doing this? Should I standardize the interaction term variables also after calculating the 'raw' terms?


I'm trying to use a custom font on a TextView... but i got that exception when when run my app     Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setTypeface(android.graphics.Typeface)' on a null object reference      in the right path and that's my code:    My XML

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


Suppose $g_1$ and $g_2$ are two metrics defining the same angles, which means $g_1(X,Y)/(g_1(X,X)g_1(Y,Y))^{0.5}=g_2(X,Y)/(g_2(X,X)g_2(Y,Y))^{0.5}$ for all pairs of vector $X,Y$.I want to prove that $g_1=cg_2$ for a constant $c$. I have tried to use the polarization identity，but it doesn't work.

This an exercise out of Spivak's "Calculus on Manifolds".  Edit:  There was a typo in the exercise as is noted below in the answers.  The statement has been edited to reflect this.  Given $x,y\in\mathbb{R}^{n}$, the angle between $x$ and $y$ is defined by  $$\angle(x,y) = \arccos\left(\frac{\langle x,y \rangle}{|x|\cdot |y|}\right),$$ where $\langle x,y \rangle$ denotes the standard Euclidean inner product.  A linear operator $T:\mathbb{R}^{n}\to\mathbb{R}^{n}$ is said to be angle-preserving if $\angle(T(x),T(y)) = \angle(x,y)$ for every $x,y\in\mathbb{R}^{n}$.  The exercise as stated:  Let $\{x_{1},\dots, x_{n}\}$ be a basis for $\mathbb{R}^{n}$.  Then suppose that $\lambda_{1}, \dots, \lambda_{n}\in \mathbb{R}$ are such that $Tx_{j} = \lambda_{j}x_{j}$ for each $j = 1,\dots, n$.  Then $T$ is angle-preserving only if (not if and only if!)$|\lambda_{i}| = |\lambda_{j}|$ for every $1\leq i\leq j\leq n$.  I'm having problems with the $(\Rightarrow)$ direction.  My best attempt (which seems to lead nowhere) is to suppose that $|\lambda_{j}|\neq |\lambda_{k}|$.  Then by assumption, \begin{align*} \angle(Tx_{j},Tx_{k}) & = \arccos\left(\frac{\langle Tx_{j},Tx_{k} \rangle}{|Tx_{j}|\cdot |Tx_{k}|}\right)\\ & = \arccos\left(\frac{\langle \lambda_{j}{x_{j}},\lambda_{k}{x_{k}} \rangle}{|\lambda_{j}{x_{j}}|\cdot |\lambda_{k}{x_{k}}|}\right)\\ & = \arccos\left(\frac{\lambda_{j}\lambda_{k}\langle {x_{j}},{x_{k}} \rangle}{|\lambda_{j}|\cdot|\lambda_{k}|\cdot|{x_{j}}|\cdot |{x_{k}}|}\right)\\ & = \arccos\left(\text{sign}(\lambda_{j})\text{sign}(\lambda_{k})\frac{\langle {x_{j}},{x_{k}} \rangle }{|{x_{j}}|\cdot |{x_{k}}|}\right)\\ \end{align*} may also be calculated as \begin{align*} \angle(Tx_{j},Tx_{k}) & =  \angle(x_{j},x_{k})\\ & = \arccos\left(\frac{\langle x_{j},x_{k} \rangle}{|x_{j}|\cdot |x_{k}|}\right). \end{align*}  Then since $\arccos$ is injective, I believe I can make the jump that $\text{sign}(\lambda_{j})\text{sign}(\lambda_{k}) = 1$, which does not resemble the conclusion that I should arrive at.  Note:  I wasn't sure what tag to put this under, so anyone who knows better please feel free to adjust.  Thanks for any help you can give.


Let A, B ⊆ R, and let f : A → B be a bijective function. Show that if $f$ is strictly increasing on A, then $f^{-1}$ is strictly increasing on B.  How  would I write this proof? I think by contradiction but I don't know where to start.

Let $f:\mathbb{R}\to\mathrm{S}$, where $\mathrm{S}\subseteq\mathbb{R}$, be a strictly increasing (decreasing) function. I wish to find out whether its inverse $f^{-1}$ is also strictly increasing (decreasing) or not. While a proof for this exists online, I will provide a counterexample that seems to contradict the conclusions in the proof.  The proof can be found in:   I will for simplicity only consider a strictly increasing function. From the provided link above we have that: \begin{align*} x < y & \quad\Leftrightarrow\quad f(x) < f(y) \\ f^{-1}(x) < f^{-1}(y) & \quad\Leftrightarrow\quad f^{-1}(f(x)) < f^{-1}(f(y)) \\ f^{-1}(x) < f^{-1}(y) & \quad\Leftrightarrow\quad x < y \\ \end{align*} Thus, if $f$ is a strictly increasing function, then so is $f^{-1}$.  Now for the counterexample. With some loss of generality, let $f:\mathbb{R}\to\mathbb{R}_{++}$ be a strictly positive function, where $\mathbb{R}_{++}=\{ x\in\mathbb{R}: x>0\}$. Furthermore, for an inverse it follows that $f^{-1}(x)f(x)=f(x)f^{-1}(x)=1$. Then from  \begin{align*} x < y & \quad\Leftrightarrow\quad f(x) < f(y) \end{align*} we can rewrite the right-hand side as  \begin{align*} f^{-1}(y)=\frac{1}{f(y)}<\frac{1}{f(x)}=f^{-1}(x) \end{align*} which implies that if $f$ is a strictly increasing function, then its inverse $f^{-1}$ is strictly decreasing.  Please provide comments if and why my counterexample is invalid. Thank you in advance.


Imagine giving a quick gentle kick to a small wooden block resting on a frictionless table. It starts moving. I'm wondering if all the atoms/molecules of the wood start moving at the same time... I'm not sure if it takes some time for the atoms on the other side to feel the kick. I'm familiar with newton laws but I think newton laws treat the object as a point mass and don't really care about how the force is perceived by the atoms/molecules/lattice of the object. If possible I'm trying to have a simple explanation of how the force propagates from one side to the other side, and why the object starts moving in a straight line, instead of oscillating left and right or doing some other thing.

Is it possible for information (like 1 and 0s) to be transmitted faster than light?   For instance, take a rigid pole of several AU in length. Now say you have a person on each end, and one of them starts pulling and pushing on his/her end.   The person on the opposite end should receive the pushes and pulls instantaneously as no particle is making the full journey.  Would this actually work?


I'm looking at a few "fully" funded PhD's in the UK. Now I understand it is a terrible timing with the whole Brexit travesty. But disregarding that, I'm failing to understand a few things and I hope you may be able to assist.  1) "...first-class or strong upper second-class undergraduate degree with honours (or equivalent international qualifications), as a minimum, in science or mathematics..."   What nightmarish system is this? I tried converting my Masters Degree in Science(2 years), which by the Danish system has an average at 10.93. Now according to a conversion guide I located, a 10 is 2:1 whilst an average of 12 is a first-class(Which is unrealistic to obtain by the way).  Am I right to assume an undergraduate degree would be equivalent to my bachelors in science(3 years) and won't matter? So if I only look at my masters degree average, then what am I? First class graduate or 2:1 graduate? Who determines this when applying? What about honours? This doesn't exist in my country at all. I also found something about some information about early courses counting less, than harder courses later on - where as we count everything by the ECTS system.   2) When finding fully funded PhD positions, it often says that as a non-UK citizen, a fee is applicable. However, I cannot find anything specific detailing this. I find this concept slightly difficult to grasp, as any EU citizen that comes to my university here in Denmark, and is accepted into a fully funded PhD, will have no economic expenses and will be paid very VERY well every month. Generally regarded as an employee.  I hope my questions was specific enough. I appreciate you taking your time to look it through.  Best regards.

I'm trying to figure out the equivalence between grade schemes in different countries.  According to some Google results:   If you are a U.S. citizen, you need a GPA of 3.2+ (it varies, some say 3.2 and some others say 3.6, etc) to apply for a position in the UK (job or university) where the prerequisite is to have a minimum grade of 2:1. In UK 2:1 is earned if you have a 60-69% of the points. I've read that 2:1 is the same as 67%. In Spain we use a grading scheme of 10 points. So according to (2), for have a UK 2:1 you need to have 6-6.9 points. If you are Spanish and have 6.7, when converting it to GPA the result is 1.5.   However, if you take the above points and treat them as a math equation, the final result will be GPA 1.5 = GPA 3.2, which doesn't make any sense.  GPA 3.2 = UK 2:1 UK 2:1 = Spain 6.7 Spain 6.7 = GPA 1.5   Replacing now...  UK 2:1 = GPA 1.5     GPA 3.2 = GPA 1.5   My question is if someone has a better explanation on converting grades obtained in different countries.


What to do when tempdb is full ? I would like to know if tempdb has become full and  what to do if you can't truncate the log?  I want to understand the process why you can't truncate it.

Somebody did something stupid and tempdb exploded in size.  Alerts are firing because the drive is full. I tried shrinking it, and it would not shrink (even though shrink queries said they worked).    There is lots of free space in tempdb (SQL2014 SP1); tempdb > Tasks > Shrink > Files > (shows how much available space I can release)  I shrink (SSMS 2016) to leave more space then the 'minimum shrink to size'.  But the files do not actually shrink.  I am working with the business owner, I am watching the server (sp_whoisactive, etc) the server is at rest.  Searching for a solution leads me to   I run the following, and it works tempdb, is back to original size.    DBCC FREEPROCCACHE   USE [tempdb]  GO  DBCC SHRINKFILE (N'tempdev' , 2048)  GO   I understand that  releases all the cache data, and impacts plans.  But if it was taking space in tempdb, it should have showed as used space, and not been available for normal shrinking.     Why did this work?   Based on the comments pointing to  Let me phrase this question from the other way.  Tempdb thinks it has space to shed as evidenced by 'minimum shrink to size', the space that won't go away got created in a temp processes that are no longer running. There is a big chunk of allocated and unused space, why can't I release it without destroying the query plan(s)?    Are the query plans or cache not living on allocated disc space, but still being protected from shrinking?   Analogy: 'minimum shrink to size' shows me the glass is half full/empty but it is not possible to transfer to a smaller glass without breaking the glass and loosing almost all of the contents.    A couple years later, same issue on a SQL 2014 instance, less emergent allows time to try experiment.  If you could somehow identify the query plan, you might be able to delete just that plan releasing the hold on the pages, and then be able to shrink tempdb.  I am looking for ways to accomplish this but have not yet been successful.  Maybe you can use  to see what is on that page so you can address it?   DBCC TRACEON (3604)  -- By default, the output is sent to the errorlog. If you want the output to come back to your current connection, turn on trace flag 3604. GO DBCC PAGE ([tempdb], 1, 1, 3); -- detailed dump of the PFS page GO    I see the last page is 937, so I go look at it.   DBCC PAGE ([tempdb], 1, 937, 3); GO   Nothing clearly an issue there, The last few pages look empty.   I have tried the suggestion by  Multiple attempts did not even free 1MB.     I ran into this problem yesterday, using the SSMS task to shrink files never accomplished anything, then I re-read the documentation on Shrink File and realized I needed to try this:   DBCC SHRINKFILE (N'tempdev' , NOTRUNCATE) -- Move allocated pages from end of file to top of file DBCC SHRINKFILE (N'tempdev' , 0, TRUNCATEONLY) -- Drop unallocated pages from end of file      I did this for all 8 of the tempdev files and slowly, over time, it finally recovered about 80% of the space. I was truly surprised by this as nothing else had worked. I had to run a job every 15 minutes through the day but it eventually recovered the space   On a SQL 2014 instance I have 'naturally' cleared the cache when a large database was rebuilt with a clustered column store indexes (nightly process). The same SHRINKFILE that would not do anything the previous day works as expected in the morning.   USE [tempdb] GO DBCC SHRINKFILE (N'tempdev' , 2000) GO   Maybe if I could recreate the problem on demand on a 2016+ instance with Query Store, it would be easier to track down exactly what is happening?


i have a file is name  -ksh.l.15092015.log  to delete this file i do this: rm -rf -ksh.l.15092015.log  but i have this error:  rm: Not a recognized flag: k Usage: rm [-firRe] [--] File...  i have do this: rm -rf *ksh*  but i have the same errors, why ? Thx for your help !

How do you remove a file whose filename begins with a dash (hyphen or minus) -?  I'm ssh'd into a remote OSX server and I have this file in my directory:  tohru:~ $ ls -l total 8 -rw-r--r--    1 me  staff  1352 Aug 18 14:33 --help ...   How in the world can I delete --help from a CLI?  This issue is something that I come across in different forms on occasion, these files are easy to create, but hard to get rid of.  I have tried using backslash  rm \-\-help   I have tried quotes  rm "--help"   How do I prevent the minus (dash or hyphen) character to be interpreted as an option?


According to my understanding, a protected method can be accessed by any class within the same package, but only subclasses to this class can access from other packages .  package Parent;  public class Parent {     protected void display() {     //Code here     }  }     import Parent;  package Child;  class Child extends Parent{     void view(Parent p1) {         this.display(); // Success         p1.display();  // Error     }      void next(Parent p2) {          p2.foo(); //Success     } }      Here this.display() is successful because the child class  is responsible for implementation. But p1.display() does not work as p1 is not part of Child class. How can we justify this behaviour in the case of accessing protected methods from classes within the same package?

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


I have a timeseries classification dataset that has about 2000 data points (binary classification).  When I use a LSTM model straighly on data, I got really bad results (nearly 0.1). But when I use first order differences in timeseries I got more improve results (nearly 0.3).  Example of first order difference: [1, 6, 6, 8, 9] = [5, 0, 2, 1]   Therefore, I concluded that LSTM works better when we provide more processed data.  While doing some Google search I discovered that there is something called second-order differences. However, I am not clear what is the objective of second order difference and how to calculate it. Please let me know your thoughts on this.  I am happy to provide more details if needed.

I understand that a stationary time series is one whose mean and variance is constant over time. Can someone please explain why we have to make sure our data set is stationary before we can run different ARIMA or ARM models on it? Does this also apply to normal regression models where autocorrelation and/or time is not a factor?


The term 'feature function' is very frequently used in the context of machine learning, but I'm still not sure what it really is. Could anyone give the precise definition? Can it be understood as a function that maps from the data-points to the feature vector? What would be the feature function e.g. in the logistic regression?

I'm working in the area of natural language processing, to be specific I'm reviewing the parsers that take advantage of data-mining techniques.   I've read an introduction to natural language processing, specifically the  by Della Pietra and others. In that paper, the authors explain that features are indicator functions that take into account certain aspects of the text. The problem is that this aspects affect the maximum entropy function.  In the case of parsing, I have problems understanding the concept of features. For parsing one must have:   Two sets, $X$ for the sentences and $Y$ for the parses For each sentence $x \in X$, one must have the N-best list of candidate parses; denoted $GEN(x) \subset Y$. Training samples $(x_j,y_j)$. The $x_j$ are sentences and the $y_j$ are parses. And a feature mapping $\Phi(X,Y)$ that maps each pair (x,y) to a vector of feature values.   The problem of parsing will consist of finding the weight vector such that the following expression is minimized  $$ -\sum log P(y_j|x_j,w) + \lambda ||w||_1 $$  where   $$ P(y_j|x_j,w) = \frac{exp \{w^T \Phi(x_j,y_j)\}   }{ \sum_{u \in GEN(x)} exp\{ w^T\Phi(x_j,u) \}  } $$  My question is, what are the features in this case? Some codified version of the parsing tree? Are the features a statistical concept?  I will also appreciate any bibliography that can be useful in tackling this issue.  UPDATE: I've talked to a professor and he had just told me that the features are obtained after doing a classification algorithm based on the parse-tree. Do you know what kind of classification is done with the parse tree?


In my one of the interview the interview ask me about the tuple and the list in python. And ask which is more efficient in case of finding a element on both .

What's the difference?  What are the advantages / disadvantages of tuples / lists?


I can't seem to get the measure tool to match up with my distance matrix tool regardless of what measurements I use. There are conflicting answers on other posts about this question. Both of my layers are on WGS84

I have a point data set. Now there are cluster of points based on a field. So I take out one such cluster which has points with same field.I want to find distance between all the points in cluster and find out if any point is far away so that I can check if that point is faulty.  Ok to elaborate more on the above one, I have say just 4 points and I have tried to use the distance matrix from the ftools plugin in QGIS.I have chosen the linear matrix and got a csv output. The distance which gives it here what would be the unit for it.


Prove that for $x,y \geq 0$ and $p>1$ , $xy \leq \frac {x^p} {p} +\frac {y^q} {q}$ whenever $ \frac {1} {p} + \frac {1} {q} = 1$.  My attempt $:$  Let us consider a function $f : (0,\infty) \longrightarrow \mathbb {R}$ defined by $f(x) = \frac {x^p} {p}$ , $x \in (0,\infty)$ where $0< p < \infty$. Then we have $f'(x)=x^{p-1}>0$ , $x \in (0,\infty)$.This shows that the function $f$ is strictly increasing in its entire domain.Now it can be easily observed that if $x=0$ or $y=0$ then the above inequality holds trivially.So WLOG let us assume that $x>0$ and $y>0$.If $x,y \geq 1$ then from the fact that $f$ is strictly increasing we must have $\frac {x^p} {p} +\frac {y^q} {q}  \geq \frac {x^{\frac {p} {2}}} {p} + \frac {y^{\frac {q} {2}}} {q}$.  Now how can I proceed?But I find trouble to prove the remaining part of the inequality.Please help me.  EDIT $:$  $\frac {x^p} {p} +\frac {y^q} {q} = \frac {qx^{p} + py^{q}} {pq} = \frac {p+q} {pq} .\frac {qx^{p} + py^{q}} {p+q}=\frac {qx^{p} + py^{q}} {p+q} \geq  (xy)^{\frac {1} {\frac {1}{p} + \frac {1} {q}}}=xy$, by the weighted AM-GM inequality and by using the fact that $\frac {1} {p} + \frac {1} {q} =1$.  Is my edit correct at all?Please verify it.  Thank you in advance.


Can someone correct me if I am wrong.  For example,  43 kJ work energy has been done on the system, sign convention is +43kJ, because work is entering into the system  62 kJ work energy has been generated from the system, sign convention is -62kJ, because work is entering out of the system  21 kJ of heat energy supplied to the system from its surroundings, sign convention is +21kJ, because heat energy is entering into the system.  I apologize for my unclear phrasing. The actual question is here:   I got mixed up with the sign convention.

Which one true in First law of thermodynamics:    $Q = \Delta U \pm W = \Delta U \pm p\Delta V$? (where $\Delta U$ is change of internal energy, $W$ work made by system and $Q=cm\Delta T $ heat made by system.)    or $\Delta U= \Delta Q + \Delta W $? (where $\Delta U$ is change of internal energy, $W$ work made by system and $Q=cm\Delta T $ heat made by system.)   First one from one the finnish physics texbook another is from .


I'm trying to identify an object based on user input and have no idea why it's not working...  userInput is just a scanner, and allGames is an arraylist of a bunch of 'Game' classes with IDs like S01, S02 etc.    Game gameToChange = null; for (Game g : allGames){         System.out.println(g.getId()); } String gameInput = userInput.nextLine();     System.out.println(gameInput);     for (Game g : allGames){         if (gameInput == g.getId()){             System.out.println("Found it");             gameToChange =g;         }     }   The Game class:  public abstract class Game {      private String identifier;      public Game(String id){         identifier = id;     }      public String getId(){         return this.identifier;     } }   I have the printout for "found it" just so I can check when it's working...but no matter when I enter the correct string, one that matches one which is already printed out, it never equals it.

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


I want to know the key differences between html 4 and html 5? Should I prefer html 4 or html 5 for development? What are the benefits of HTML 5 and how to know if a website is using html 5 or not?

What are the key differences between  and ?  Please keep the answers related to changed syntax and added/removed html elements.


I have a foreach loop that returns something like this:  value 1 value 1 value 1 value 2 value 2 value 2 value 2   I need to get that list but only the first of each type. So,   value 1 value 2   below is my code.  <div>     @foreach (var publishedVideo in allVideos)     {         <p>@publishedVideo.GetPropertyValue("segment")</p>     } </div>   How do I de-duplicate the list?

Anyone have a quick method for de-duplicating a generic List in C#?


I was collecting some cars in my garage and it appeared to me that it was full, so it asked me to select a car to exchange it and I chose the Zentorno. I tried to get it back, please tell me how.

I was asked to replace a car in order to put another car in my garage. However I thought I would be able to swap the car I wanted in and take out the other car that was already in there so I could bring it to my other garage. Can I get my car back?


I have installed Ubuntu 16.04 on Nvidia TX1 but forgot my root password.   Is there any way to restore or reset the password even though GRUB is not installed?  I tried pressing shift or ESC to go to recovery mode when booting but failed since GRUB is not installed.  If I can't reset the password, how can I format TX1 and reinstall Ubuntu on it without the root password?

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


Just a little question. I was wondering why the waves of different colors (so different wave lengths) in white light do not interfere one another. Why interference is not taken place? I believe white light is not a result of interference since a prism can separate different waves in white light. Please explain me. Thanks.

The book I'm reading about optics says at some point that "each color (wavelength) contained in the white light interferes only with itself". But why is this so?  Edit: I moved the rest of the question .