I have to cut double values to for digits, but i don't know how to do it with values from tables. i need to get from 0.254300 this 0.2543. This is my code, so how to cut extra zeros.  public class Diagonal{ public static void main(String[] args){       double [][] tab = new double [5][5];       for (int i = 0; i < 5; i++){         for (int j = 0; j < 5; j++){             tab[i][j] = (int) (Math.random() * 9000) / 10000.0;          }     }     for(int i = 0; i < 5; i++){         for (int j = 0; j < 5; j++)             if(i==j || i+j==4)                   System.out.printf("%4f", tab[i][j]);             else                 System.out.printf("%4c",' ');              System.out.println();        }                      }  }

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


Is there a command line to find and delete duplicated entries in the /etc/apt/sources.list file?  or  is this possible via synaptic perhaps?

I keep getting this warning whenever I try to run sudo apt-get update.  W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ precise-updates/main i386 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_precise-updates_main_binary-i386_Packages) W: You may want to run apt-get update to correct these problems   Below is the output from /etc/apt/sources.list file:  deb http://archive.ubuntu.com/ubuntu precise main restricted deb-src http://archive.ubuntu.com/ubuntu precise main restricted  deb http://archive.ubuntu.com/ubuntu precise-updates main restricted deb-src http://archive.ubuntu.com/ubuntu precise-updates main restricted  deb http://archive.ubuntu.com/ubuntu precise universe deb-src http://archive.ubuntu.com/ubuntu precise universe deb http://archive.ubuntu.com/ubuntu precise-updates universe deb-src http://archive.ubuntu.com/ubuntu precise-updates universe  deb http://archive.ubuntu.com/ubuntu precise multiverse deb-src http://archive.ubuntu.com/ubuntu precise multiverse deb http://archive.ubuntu.com/ubuntu precise-updates multiverse deb-src http://archive.ubuntu.com/ubuntu precise-updates multiverse  deb http://archive.ubuntu.com/ubuntu precise-security main restricted deb-src http://archive.ubuntu.com/ubuntu precise-security main restricted deb http://archive.ubuntu.com/ubuntu precise-security universe deb-src http://archive.ubuntu.com/ubuntu precise-security universe deb http://archive.ubuntu.com/ubuntu precise-security multiverse deb-src http://archive.ubuntu.com/ubuntu precise-security multiverse   How do I fix it?


I don't understand what's wrong with the IndexOf function ???  public String[] PseudoExisteTest() {   // looking if an XML tag contain "OK" String exampleText = "<result>OK</result>";  int ind1; int ind2;  String returnTable[] = new String[4]; String tag="result"; String textresult;  ind1=exampleText.indexOf("<"+tag+">");   // 0 ind2=exampleText.indexOf("</"+tag+">");  // 10  textresult=exampleText.substring(ind1+tag.length()+2, ind2);      if ((textresult=="OK")) {     // YES  => Normally we pass here (="OK") !           returnTable[0]="It'OK";         }     else {         returnTable[0]="Not, value is : "+textresult+"!";  // Not, value is : OK !!! ?????      }     returnTable[1]="blabla";      return returnTable; }          The value is "OK" but on the condition, that's don't works well ???? Is anybody can help me ?  Thanks in advance.

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 would like to say: Available calculation methods are limited to few software. With "few", I mean 3 programs. However, "software" is an uncountable noun. "Some" and "little" sound also weird?  Available calculation methods are limited to few software.   Available calculation methods are limited to little software.   Available calculation methods are limited to some software.

Is it correct to use softwares, as in the following sentence?  There are various video conversion softwares in the market.


I've a question: How do I calculate $2^{2020} + 3^{2020}\pmod{11}$?  Is there a theorem or any trick to do it? I need to show all the steps I used to calculate the Rest but I've no clue how to even start with the calculation...  Does anyone have any tips and could show me how to calculate it?   Greetings!!!

I've read about Fermat's little theorem and generally how congruence works. But I can't figure out how to work out these two:   $13^{100} \bmod 7$ $7^{100} \bmod 13$   I've also heard of this formula:  $$a \equiv b\pmod n \Rightarrow a^k \equiv b^k \pmod n $$  But I don't see how exactly to use that here, because from $13^1 \bmod 7$ I get 6, and $13^2 \bmod 7$ is 1. I'm unclear as to which one to raise to the kth power here (I'm assuming k = 100?)  Any hints or pointers in the right direction would be great.


Can you set up a website to make a default redirect to a virtual directory?  I tried to do this but it overrode every single website in my setup to that redirect.   I want to be able to open  and have that redirect somewhere.

So I have a website running on a discount asp.net account, and I put an asp.net mvc app in a subdirectory. If my url is 'www.website.com' and my app is in directory 'sample', then 'www.website.com/sample' will execute the mvc app.  My problem is that I want the app to be shown when you go to 'www.website.com' not just 'www.website.com/sample'.  I have access to the IIS Manager, and I'm sure there are many ways to do this.  What's the best way to do this?


Let matrix $A_{n\times n}$, be such that there exists a matrix $B$ for which $$AB-BA=A$$  Prove or disprove that there exists $m\in \mathbb N^{+}$such  $$A^m=0,$$  I know $$tr(A)=tr(AB)-tr(BA)=0$$ then I can't.Thank you

Possible Duplicate:             Let $A$ and $B$ be two $n\times n$-matrices over some field of characteristic $0$. If $A$ and $AB-BA$ commute, show that $AB-BA$ is nilpotent.   My brother asked me for help on this but I quite embarrassingly can't figure it out. I vaguely recall solving a similar problem in school, but with the added condition that $B$ also commutes with $AB-BA$.   Any help would be appreciated.


Say someone like The Hulk? Or Galactus even?

If mass and matter cannot be created nor destroyed, then how does Mystique get taller or shorter, for example when she      imitates Trask in X-Men: Days of Future Past   Do her atoms and organs simply rearrange themselves? Does she become more dense?


Using the lstlisting package on a large number of items (200 +) I get   ! TeX capacity exceeded, sorry [pool size=3174358].<argument> \XC@@tmp \FPsub{\scratch}{1}{\scratch} %   I have absolutely no clue if there is a way for me to increase this pool size, and if there is, how. Am using MikTeX 2.9.

I'm using MiKTex 2.9.4196 with TeXnicCenter 2.0 beta on Windows 7. As I have to compile very large tikzpictures I use tikz externalize. Nevertheless some tikzpicture still produce an error.  ! TeX capacity exceeded, sorry [pool size=3147270].   I already did increase the main memory, but I couldn't find out how to change the pool-size.


I know the reason I can't see Pokemon in AR mode is because I don't have a gyroscope on my phone. Anyway I don't really know much about gyroscope sensors or anything but what I really want to know is can this be something they can fix in the future with an update? Will I be able to see Pokemon in the future in AR mode even if my phone doesn't have a gyroscope or will I just have to get a new phone?

When initiating a battle it starts off in AR mode, but then warns me saying my phone's orientation is not detected. I am then forced to turn off AR mode. Has anybody experienced this? If so, what are the solutions?    Per comments, I am unsure this is a permissions issue. I have everything turned on.


I need to find the remainder when $2222^{5555} + 5555^{2222}$ is divided by $7$. I'm thinking that Fermat's Little Theorem might help. Any suggestions?

What will be the ones digit of the remainder in: $$\frac{\left|5555^{2222} + 2222^{5555}\right|} {7}$$


I am studying the orthochronous Lorentz algebra $\mathfrak{so}(3,1)^\uparrow $ and it reads  $$ [X_i,X_j]=i \varepsilon_{ijk} X_k $$ $$ [X_i,Y_j]=i \varepsilon_{ijk} Y_k $$ $$ [Y_i,Y_j]=-i\varepsilon_{ijk}X_k $$  If I complexify this by taking complex combinations of the form  $$ X_i^\pm = \frac{1}{2}(X_i \pm iY_i)$$  I find that I have two $\mathfrak{su}(2)$ Lie algebras:  $$ [X^+_i,X^+_j]=i \varepsilon_{ijk} X^+_k $$ $$ [X^-_i,X^-_j]=i \varepsilon_{ijk} X^-_k $$ $$ [X^+_i,X^-_j]=0 $$  which is two $\mathfrak{su}(2)$ subalgebras, so I should be able to say that $\mathfrak{so}(3,1)_{\mathbb{C}}^\uparrow \cong \mathfrak{su}(2) \oplus \mathfrak{su}(2)$. However I have read in a lot of places, including , that $\mathfrak{so}(3,1)_{\mathbb{C}}^\uparrow \cong \mathfrak{su}_\mathbb{C}(2) \oplus \mathfrak{su}_\mathbb{C}(2)$. Why do the $\mathfrak{su}(2)$s have to be complexified? The commutators of $\{ X_i^\pm, Y_j^\pm \} $ are $\mathfrak{su}(2)$, why can I complexify them? and why should they be? Is my decomposition not correct?

This question is based on  problem II.3.1 in Anthony Zee's book Quantum Field Theory in a Nutshell      Show, by explicit calculation, that $(1/2,1/2)$ is the Lorentz Vector.    I see that the generators of SU(2) are the Pauli Matrices and the generators of SO(3,1)is a matrix composed of two Pauli Matrices along the diagonal. Is it always the case that the Direct Product of two groups is formed from the generators like this?   I ask this because I'm trying to write a Lorentz boost as two simultaneous quatertion rotations [unit quaternions rotations are isomorphic to SU(2)] and tranform between the two methods. Is this possible?      In other words, How do I construct the SU(2) representation of the Lorentz Group using the fact that $SU(2)\times SU(2) \sim SO(3,1)$?  Here is some background information:  Zee has shown that the algebra of the Lorentz group is formed from two separate $SU(2)$ algebras [$SO(3,1)$ is isomorphic to $SU(2)\times SU(2)$] because the Lorentz algebra satisfies:   $$\begin{align}[J_{+i},J_{+j}] &= ie_{ijk}J_{k+} & [J_{-i},J_{-j}] &= ie_{ijk} J_{k-} & [J_{+i},J_{-j}] &= 0\end{align}$$  The representations of $SU(2)$ are labeled by $j=0,\frac{1}{2},1,\ldots$ so the $SU(2)\times SU(2)$ rep is labelled by $(j_+,j_-)$ with the $(1/2,1/2)$ being the Lorentz 4-vector because and each representation contains $(2j+1)$ elements so $(1/2,1/2)$ contains 4 elements.


Prove that the relation 'is parallel to' on the set 'S' of all straight lines in a plane is an equivalence relation .  My attempt:  The relation 'is parallel to' on set 'S' is:  (1). Reflexive, because every line is parallel to itself.

Let $L$ denote the set of all lines in the Euclidean plane $\Bbb R^2$. We say that two lines $L$ and $M$ are parallel if either $L = M$ or $L$ and $M$ have no points in common.  Using Euclid’s Parallel Postulate prove that parallelism is an equivalence relation on the set $L$.  I need some help determining if I have the right idea about this.  $L=L$ which means that $L$ is parallel to itself. So this is reflexive.  Suppose we have $L || M$. Then Either $L=M$ or $L$ and $M$ share no points. So Then $M=L$ or $M$ and $L$ share no points. Then $M||L$. So this is symmetric.  Suppose we have $L || M$ and $M || N$. So then either $L=M$ or $L$ and $M$ share no points and either $M=N$ or $M$ and $N$ share no points. So we have that either $L=N$ or $L$ and $N$ share no points. So $L || N$. So then this is transitive.  So from all of this, parallelism is an equivalence relation. I'm not sure if this is correct or not. Any help would be appreciated.


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

Let $G$ be a finite group, and $g$ be a an element of $G$. How could we go about proving $g^{|G|}=e$ without using cosets? I would admit Lagrange's theorem if a proof without talking about cosets can be found.  I have a proof for abelian groups which basically consists in taking the usual proof of Euler's theorem and using it in a group, I do not know if it can be modified to work in arbitrary finite groups.  The proof is as follows: the function from $G$ to $G$ that consists of mapping $h$ to $gh$ is a bijection. Therefore   $\prod\limits_{h\in G}h=\prod\limits_{h\in G}gh$ but because of commutativity $\prod\limits_{h\in G}gh=\prod\limits_{h\in G}g\prod\limits_{h\in G}h=g^{|G|}\prod\limits_{h\in G}h$.  So we have $\prod\limits_{h\in G}h=g^{|G|}\prod\limits_{h\in G}h$.  The cancellation property yields $e=g^{|G|}$.  I am looking for some support as to why it may be hard to prove this result without talking about cosets, or if possible an actual proof without cosets.    Thank you very much in advance, regards.


In Kittens, I need to get Time Crystals for my next technology, Chrono Physics. The Wiki says to get them by sacrificing Alicorns.  Great, I finally have the Alicorns (17 at this time). Checking the Wiki, and checking all the tabs, I do not see an option to sacrifice them. How do I sacrifice them, and get my special Time Crystals? I expected them to be under Science or Religion, but I don't see a button there to sacrifice them. Build 1.0.3.2

I'm trying for a total completionist run, slightly editor-assisted (I keep a separate "testing" save from my main, legit save).  Long story short, I have more than seventy Sky Palaces, but I still haven't gotten a single      alicorn.   What am I missing?  How do I get this rare resource so that I can finish out my technology tree?


I have three cheap mouses which has two extra mouse buttons for going forward and backward.  However, two of them have the xbutton1 (the one which performs backward) closer to me but one have it farther from me.  Which is the standard? I tried some googling but nothing useful turned out.  Just FYI, these buttons are on the side, lies left to the left mouse button, and can easily be pressed by the thumb. The one closer to me can be pressed easier than the one farther from me.

A local overstock store had a sale on a wireless mouse/keyboard set, so I got one. It is very similar to the (cheap Chinese) kind available on eBay. It works fine except that the two side buttons (XButton1/2) which normally map to Forward/Backward in Windows Explorer and browsers are backwards. The same is true for the browser-back and browser-forward buttons on the keyboard.  This mouse and keyboard has no drivers or manual; the box says “driverless” because Windows automatically detects it as a generic USB HID mouse, so I cannot use drivers or software to configure them.  Research has found this issue coming up very rarely and no solutions. There is  here which has the same problem, but only for Firefox, not in Windows Explorer like I’m experiencing.  As for the keyboard, I tried using the key remapping available in Windows, but that would affect all keyboards that are plugged in, including normal, correct ones.  I’ve emailed the company (I was a little bit surprised that they even had a website), but their email bounces as undeliverable. ◔_◔  I know there is a built-in option to swap the left and right mouse buttons, but what about the side buttons? Does anyone know of a device-specific way of remapping buttons and keys in Windows?  For the time being, I am using a AutoHotkey script as a (hopefully only temporary) work-around.


I have an svg file foo.svg which I would like to present in a presentation using latex beamer.   Please give me a minimal working example that accomplishes that. None of the solutions I have found on this site works, they all produce error messages.

I'm making all my diagrams in SVG format using Inkscape and then I export them to some other format (e.g. PDF, EPS or PNG). I wrote a short script that does this for me automatically, but I'd like to avoid this step, if possible --- sometimes the conversion from SVG converts the text labels into vectors, and that's annoying. Hence the question:  Is there a way to include SVG diagrams directly without conversion to an intermediate format?  Package suggestions, or instructions for specific LaTeX distribution are welcome. Tips and personal experience on which tools you have found to be working reliably would be also appreciated.


. I am reposting here to add visibility to the issue.    The URI detector breaks when it encounters a degree symbol (°) or U+00B9:  °08'06.5%22S+59°54'08.7%22W/@-3.1351316,-59.9374329,14z  The link was copied and pasted from the browser's address field. This problem is exacerbated on travel since we often link to Google maps.

Questions like:   ♦ ♦-should-discriminate-more-when-bumping-unanswered-questions ≠-users-who-want-to-write-good-posts   well, you can see there.  The diamond (and other problematic Unicode characters) in the title breaks the automatic prettification of internal question links.  This becomes a bit more of an issue when one wants to link to an answer.  For example ♦-break-the-automatic-hyperlink-parser/242572#242572 should link to Martijn's answer, but, it doesn't (tangent, but a different issue is that  which is the share link doesn't auto-prettify unless the userid part is removed - one keeps having to manually remove things to get the auto prettify to engage).  If one looks at the html generated for  for the title and the url linked in the
 of the page, we get:  <title>Users who can&#39;t write good posts ≠ users who want to write good posts - Meta Stack Exchange</title>
 Users who can&#39;t write good posts ≠ users who want to write good posts
   And while that's a long link title, I will point out that the quote as part of the word "can't" was removed from the slug.  The bug is that this should be done for other characters too.


I am unable to find where you can type in the dimensions of an object. Scale, transform etc are all there but not dimensions. I am trying to edit the active object under the Properties/Data menu. I can successfully scale the object but I need to be able to type in values. I found this question but the answer did not help, i.e. that you had to be in Object mode.  It does not matter if I am in Object or Edit mode. I am using 2.91. I guess I'm doing something daft or missing something so please take pity :-)

Anyone seen this panel? Essential for precise modeling.


I am using different STLs to make a special creature.  For example: I have a panther STL, but only want to use the head for my project, and then just the wings from another STL, etc.  Is there an easy way to separate the parts I need?  I have looked through some other Q&A and found some things that are close, but I have yet to find the best solution.  Thanks

I want to make the teeth a separate child object from the mouth. I want to know the best way to do this.   I have tried going into edit mode with Tab and trying to select all the vertices but that doesn't move the teeth. Is there an easy way to select just that part and make it a separate child mesh to the rest of the mouth?


I've put together a system to parse JSON and render it with some simple CSS. Though, I've done this using a variable. I don't want to output the data within the script. Instead, gather it from a local or remote URL.     How could I gather the JSON data from a URL source and output it like I am now?  Update

I need to do an  request in JavaScript. What's the best way to do that?  I need to do this in a Mac OS X dashcode widget.


If $b \in \mathbb F$, then $U = \{(x_1, x_2, x_3, x_4) \in \mathbb F^4: x_3 = 5x_4 + b\}$ is subspace of $ \mathbb F^4 \iff b = 0$.  I know the thread "" already exists. I tried slightly different approach and only in one direction, but unsure if that qualifies as a proof of the direction:  Suppose $u = (x_1, x_2, 5x_4, x_4)$ and $v = (y_1, y_2, 5y_4, y_4) \in U$. Let $a \in \mathbb F$. Then $a(u + v)  = (a(x_1 + y_1) + a(x_2 + y_2) + 5a(x_4 + y_4) + a(x_4 + y_4))$. So, $a(u + v) \in U$ Since $a \in U$, scalar $0 \in U$. Then $0(u + v) = 0$, so then the vector $0 \in U$.  Des this method work? Thanks.

Let $b\in\mathbb{F}$ then {$(x_1,x_2,x_3,x_4)\in\mathbb{F}^4$:$x_3=5x_4+b$} is a subspace iff $b=0$. This is from axler's Linear algebra done right. $\mathbb{F}$ stands for a field either the real numbers or complex numbers. I proved the reverse direction but now I have to show the foward direction. This is what I have so far.      ($\rightarrow$) Assume that $b\in\mathbb{F}$ and let T={$(x_1,x_2,x_3,x_4)\in\mathbb{F}^4$: $x_3=5x_4+b$} where $T$ is a subspace of $\mathbb{F}^4$. Suppose not that $b\neq 0$. Since  $T$ is a subspace by assumption that means that $0\in T$ That is $(x_1,x_2,x_3,x_4)=(0,0,0,0)$ This means that $x_3=0$ and $x_4=0$. If $x_3=0$ then we have $0=5x_3+b \implies \frac{5}{b}=x_4$ but since $b\neq 0$ we have that $x_4\neq 0$. Suppose that $x_4=0$. Again we have $x_3=5(0)+b=b$ Since $b\neq 0$ this means $x_3\neq 0$. Thus a contradiction. Would this be right?


I want to set default Desktop environment (the question is not about gnome-panel, KDE etc.), need to unlock unnecessary icons from launcher and lock needed applications on launcher, set keyboard layout 2 or 3 languages on menu bar. And when I create new user and he/she will log in, the desktop environment will be same that I created.

How to ensure that all new users have the same profile settings as the current user?  I am using  Ubuntu 12.04.


I have a Dell laptop running Windows 7. When running on battery power, an alert pops up when the battery goes below 7% remaining battery life. Within 5 minutes of hitting 7% it goes into sleep mode. I understand my battery is having a problem and it does not last for even 1 minute after reaching 7% remaining battery life.  I want Windows to show an alert when it reaches 20% remaining battery life so that I will have enough time to plugin my laptop to AC power.  Can any body please tell me if it is possible to have Windows show a warning when battery reaches 20% battery life remaining?

How do I change the low and critical battery levels to below 10%? I understand that this is a reasonable limit for most portable computers, but what about those with large batteries? On my computer (which has two batteries) 10% is an hour of runtime and is therefore way too high.


I've just did an update.   $ sudo tlmgr update --self tlmgr: package repository http://sunsite.informatik.rwth-aachen.de/ftp/pub/mirror/ctan/systems/texlive/tlnet tlmgr: saving backups to /usr/local/texlive/2013/tlpkg/backups tlmgr: no updates for tlmgr present. tlmgr: no updates available $ sudo tlmgr update --all [...] [108/109, 06:49/06:49] update: collection-pictures [1k] (32769 -> 33307) ... done [109/109, 06:51/06:51] update: collection-publishers [1k] (32864 -> 33330) ... done tlmgr: package log updated: /usr/local/texlive/2013/texmf-var/web2c/tlmgr.log running mktexlsr ...  mktexlsr failed (status -1), output:  running mtxrun --generate ...  mtxrun --generate failed (status -1), output:  Can't exec "kpsewhich": No such file or directory at ./tlmgr line 679. Use of uninitialized value $TEXMFSYSVAR in scalar chomp at ./tlmgr line 679. Can't exec "kpsewhich": No such file or directory at ./tlmgr line 680. Use of uninitialized value $TEXMFSYSCONFIG in scalar chomp at ./tlmgr line 680. Can't exec "kpsewhich": No such file or directory at ./tlmgr line 681. Use of uninitialized value $TEXMFLOCAL in scalar chomp at ./tlmgr line 681. Can't exec "kpsewhich": No such file or directory at ./tlmgr line 682. Use of uninitialized value $TEXMFDIST in scalar chomp at ./tlmgr line 682. Use of uninitialized value $TEXMFDIST in concatenation (.) or string at ./tlmgr line 693. Can't exec "kpsewhich": No such file or directory at /usr/local/texlive/2013/tlpkg/TeXLive/TLUtils.pm line 2785. Use of uninitialized value $tmfsysconf in scalar chomp at /usr/local/texlive/2013/tlpkg/TeXLive/TLUtils.pm line 2785. Use of uninitialized value $tmfsysconf in concatenation (.) or string at /usr/local/texlive/2013/tlpkg/TeXLive/TLUtils.pm line 2786. Cannot open /web2c/updmap.cfg for writing: No such file or directory at /usr/local/texlive/2013/tlpkg/TeXLive/TLUtils.pm line 2928.   Then I run mtxrun --generate which seemed to work.  Then I've tried to compile  and got:  (/usr/local/texlive/2013/texmf-dist/tex/generic/pgfplots/pgfplots.revision.tex) (/usr/local/texlive/2013/texmf-dist/tex/latex/pgf/frontendlayer/tikz.sty (/usr/local/texlive/2013/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty (/usr/local/texlive/2013/texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty (/usr/local/texlive/2013/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.te x ! I can't find file `pgfutil-common-lists.tex'. l.556 \input pgfutil-common-lists.tex  (Press Enter to retry, or Control-D to exit) Please type another input file name:   When I enter /usr/local/texlive/2013/texmf-dist/tex/generic/pgf/utilities/pgfutil-common-lists.tex it seems to work until it gets to pgfmathfunctions.integerarithmetics.code.tex which it also doesn't find.  As  with the same problem had problems with the path, I checked it (added breaks to make it easier to read):  $ echo $PATH /usr/local/texlive/2013/bin/x86_64-linux: /usr/local/texlive/2013/bin/x86_64-linux: /usr/local/texlive/2013/bin/x86_64-linux: /usr/local/texlive/2013/bin/x86_64-linux: /usr/local/texlive/2013/bin/x86_64-linux: /usr/local/sbin:/usr/local/bin: /usr/sbin:/usr/bin:/sbin:/bin:/usr/games: /usr/local/games   I don't know why TexLive is there 5 times, but that should not be a problem (?)  Before the update, I had pgfplot 1.09.  Can anybody please tell me how to fix this problem?

I am using texlive 2013, and just ran the following command to update the packages.  sudo ./tlmgr update  -all   After it finished, I tried to compile tex documents that uses tikz package as the following MWE shows:   \documentclass{article}  \usepackage{tikz}  \begin{document}       aaaa  \end{document}   Then pdflatex complains; it said:   (/usr/local/texlive/2013/texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty  (/usr/local/texlive/2013/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex  ! I can't find file `pgfutil-common-lists.tex'.  l.556 \input pgfutil-common-lists.tex   The problem is that, pgfutil-common-lists.tex is indeed in the directory:   /usr/local/texlive/2013/texmf-dist/tex/generic/pgf/utilities/   Why is that? pdflatex should be able to find it, right? I even download the  again, and replace the pgf directory in   /usr/local/texlive/2013/texmf-dist/tex/generic/   Nothing changed at all........... Any idea? Thank you for your critics.  %=====================================================================  Then followed the comments, I type the following command in the terminal:    sudo mktexlsr gives me command not found;  mktexlsr gives me:  mktexlsr: /usr/local/texlive/2013/../texmf-local: directory not writable.     Skipping...  mktexlsr: /usr/local/texlive/2013/texmf-config: directory not writable. Skipping...  mktexlsr: /usr/local/texlive/2013/texmf-dist: directory not writable. Skipping...  mktexlsr: /usr/local/texlive/2013/texmf-var: directory not writable. Skipping... mktexlsr: Done; Forkpsewhich pgfutil-common-lists.tex, nothing pops up.


Do I need a UK transit visa if my layover in Heathrow is for 2 hours? I will land at Terminal 5 and depart from Terminal 3. I won't leave the airport. My flight is from New Delhi to Vancouver. I have a connecting flight so collecting baggage isn't an issue. Please help me.  I am an Indian citizen and I will have a Canadian visa by then.

Is there a website or some other way to find out if I need a transit visa for a short stop in the UK on my way somewhere else? Ideally this should give me the answer for all nationalities, and take into account any other visas I may have.


I need to move my washing machine for a couple of days to a friends place due to some construction in my place.  I remember that when I first bought it the seller, when delivering it, removed a security brake, that is used to transport the machine without damaging it.  I would like to know how important it is to brake the machine for transport and how to do it.

I have been contemplating accepting a job offer on the opposite side of USA. If everything works out, I was thinking about putting all my belongings to a couple of u-haul u-boxes and have them shipped.  So for this reason I wanted to ask if I needed to somehow secure the drums on my washer and dryer?  Both are electric (not gas) and of the front-loading variety.


Consider a box floating on water having a coin on top, now suppose after some time by some external influence, the coin is dropped into water. After doing the calculations, to my surprise, I found that the water level actually drops...I just can't understand this phenomena. For what reason does this happen? I think that my whole conception of buoyancy is wrong after this because intuitively I think water level rises because the coin would apply both it's weight and take up some volume while in the water.   Notes for future answers/ existing answers:  After some deep thinking, I started to realize the problem was that I had this intuition that water would have been compressed by the weight somehow. How exactly does that effect vary in the scenario displayed above? After even more deep thinking, how does the behaviour of fluid change as we relax/ impose the condition of compressibility ? specifically how would results in this case differ? ( A diagram would be nice) Suppose we constantly applied a force onto the surface of a water, like a pressure, by the logic given in most answers, the water level should rise! but, intuitively it is often said that water level drops as we apply more pressure on the face open to atmosphere   My question is different  because my confusion is mostly about the actual structure of the fluid and response of fluids to load rather than the directly calculated volume changes.

This comes from a brain teaser but I'm not sure I can solve it:     You are in a rowing boat on a lake. A large heavy rock is also in the boat. You heave the rock overboard. It sinks to the bottom of the lake. What happens to the water level in the lake? Does it rise, fall or stay the same?   I'd say that the water level drops, because when you drop the stone in the lake, the water level rises according to the volume of the stone, BUT the water level decreases by a volume of water weighting the stone's weight, when you take it off the boat.  Is that correct?


iOS App, version 1.0.1.  Edit → Close → Off topic because… → Belongs on another site…  Crash!  I'm a moderator on the site — maybe that's a contributing factor.  It is 100% reproducible on all questions I have tried on both the main site and meta site.  This bug is distinct from .

As the title suggests, when choosing to flag a question as "this question should be closed for another reason" -> "off topic", the application crashes.  I have tried multiple questions on both Stack Overflow and Meta, and observed this behaviour.


I've just bought a tacx turbo trainer and want to get a tacx training tyre for my mountain bike.  Can I fit a tacx 26x1.25" training tyre to my wheel with current tire 26x2.1" ?  Thanks  Matt

I currently ride a hybrid that came with 700x32c tires. Can I swap out a narrower tire without changing the rims, or do rims only fit a specific size of tire?   How small can I go before I have to buy new rims?  I hear having narrower tires makes you go quite a bit faster.  Does it really help that much?


I land on the user profile page when I login as user. I would like to land on the front page after login. How do I achieve that?  This is my basic site settings:

I am trying to redirect users to a custom URL after they logged in, but my code doesn't work.  How do I redirect users after they logged in?


According to Gauss's law in magnetism, we know that there is no magnetic monopoles. But my teacher told in the class that magnetic monopoles exists but he didn't told us where instead told to search and find. Do magnetic monopoles exist anywhere on Earth?

One thing I've heard stated many times is that "most" or "many" physicists believe that, despite the fact that they have not been observed, there are such things as magnetic monopoles.  However, I've never really heard a good argument for why this should be the case. The explanations I've heard tend to limit themselves to saying that "it would create a beautiful symmetry within Maxwell's equations" or similar. But I don't see how the fact that "it would be beautiful" is any kind of reason for why they should exist! That doesn't sound like good science to me.  So obviously there must be at least another reason apart from this to believe in the existence of natural magnetic monopoles. (I'm aware that recent research has shown that metamaterials (or something similar) can emulate magnetic monopole behaviour, but that's surely not the same thing.) Can anyone provide me with some insight?


I can't login using the  to disable the GUI on macOS Big Sur.  Is there any other way to use macOS Big Sur in console mode?

First: I'm obviously not talking about logging in and then automatically launching Terminal.app.  In , you used to be able to type >console in the username field on the login screen and go directly into a command line terminal session.  I haven't done it in years until the other day. However, now, when I try it, my computer just locks up. I can't cancel, and it never sends me to a terminal session.  Is it even possible to do this anymore? If not, does anybody know when it was removed? It seems odd that typing >console would cause the machine to lock up if it wasn't recognizing it in some way.


I did a lot of work today and enhanced the look of my Lubuntu 13.10.   I also installed  a lot of packages, like Numix icon theme from their PPA, downloaded icons and changed the taskbar color, size etc.  Now I want to save that all as a backup so that, if I have any errors, I can restore my customizations.

If I want to make a backup of everything I have done since the fresh install of Ubuntu, what are the possible options? What all should I backup? I want to get all the settings that I changed, all the packages I installed, etc.


I would like to know what software was used to make www.tellasda.com - I would like to make something similar with as little codeing required as possible.  Thanks!

I'd like to know which software was used for the development of the web page from . How can I do it? Is there any tool for Firefox that could help me finding out this information?


Is there a solution if this happens to your question, esp. if the topic of the question is not that popular.

Note: If you're looking for a simple explanation as to why comments aren't required on downvotes, see .   I used to get "upset" (though that is too strong a term) when I got downvoted without comment. If my answer isn't good enough then I'd like to know why. Not only does it improve the answer for the OP but it improves my knowledge too.  Where the down-vote has been explained I've found it useful & it has improved my answer, or forced me to delete the answer if it was totally wrong.  So is there any way we can encourage people to leave a comment? Perhaps they don't lose rep if they explain their down-vote?  I must admit though that I haven't always explained my down-vote either so you could call me a hypocrite. I've also grown a thicker skin over the months of using SO (it seems to have come with the higher rep score ;-)), so I'm less bothered about this now.


Is there any Ubuntu alternative for team-viewer software for Windows?

Poll on best VNC / remote desktop software for assisting others on Windows/Mac machines from Ubuntu?    I've heard good things about TeamViewer and Fog Creek Copilot, but I'm wondering if the included GNOME Vinaigre VNC client is good enough for this.  To specify, I'm looking for best option based on:   SIMPLEST ease-of-use for client to download/use on their end. See #1. Works cross-platform I am able to control client's mouse and/or keyboard from remote machine.


Am calling an ajax call to validate n number of data.Since it takes lot of time to complete, I thought of showing the user the progress bar or tell that 1/n completed In-order to display that, I should get the status from the controller.Can someone please tell me is there any way to get the status from controller before completing? Or Is there any other better way to implement.

Is it possible to get the progress of an XMLHttpRequest (bytes uploaded, bytes downloaded)?   This would be useful to show a progress bar when the user is uploading a large file. The standard API doesn't seem to support it, but maybe there's some non-standard extension in any of the browsers out there? It seems like a pretty obvious feature to have after all, since the client knows how many bytes were uploaded/downloaded.  note: I'm aware of the "poll the server for progress" alternative (it's what I'm doing right now). the main problem with this (other than the complicated server-side code) is that typically, while uploading a big file, the user's connection is completely hosed, because most ISPs offer poor upstream. So making extra requests is not as responsive as I'd hoped. I was hoping there'd be a way (maybe non-standard) to get this information, which the browser has at all times.


I am using the package amsthm to type my assignments and I have encountered the following problem. Here's the code I use:  \newtheorem{claim}{Claim} : : \begin{enumerate}   \item \begin{claim}     $lefthalf(L) := \{w_1 :  \exists w_2 \in \Sigma^*.w_1w_2 \in L.|w_1| = |w_2|\}$. \end{claim}  \item  {\textbf{Claim 1.}} $lefthalf(L) := \{w_1 :  \exists w_2 \in \Sigma^*.w_1w_2 \in L.|w_1| = |w_2|\}$.  \end{enumerate}   This gives the following result:    As you can see in (a), the claim begins on the second line. I would like my claim to be as in (b) where I simulate the style I want. Is there any way I could get rid of this extra newline occuring when I use newthm in a list? I have tried to change theoremstyle but couldn't get it to work.  Any ideas on how to solve this problem?  Thanks a lot.

I'm using amsart. When I create an enumeration inside a theorem environment, the numbering is not aligned properly:  Theorem 14. (1) (2) (3) (4)   How do I shift the (2),(3),... to be aligned with (1)?  MWE:  \documentclass{amsart} \newtheorem{thm}{Theorem}[section]  \begin{document} \begin{thm} \begin{enumerate} \item Item 1 \item Item 2 \item Item 3 \end{enumerate} \end{thm} \end{document}


Can anyone assist me regarding the design of a circular polarized rectangular patch antenna that is driven at adjacent sides through a power divider?   I already calculated the parameters of the width and length of the patch and the substrate size. However, I am having difficulties calculating the positioning of the microstrip transmission line in order to get a circularly polarized antenna. I am running at a frequency of 915MHz, using FR-4 substrate and a height of 1.6mm.

after a bit more research I realized what my mistake was, after a user pointed it out. As such my new post.  I have come across a CIRCULAR POLARIZED PATCH ANTENNA DESIGN (FINALLY!). Which is shown below. However, as you can see there is very little data that is shown on how to exactly construct such an antenna. My frequency is 915MHz, input impedance is 50 ohm.  My questions are (i.e. what are the equations?):   The patch design is easy as I know of many resources that can assist me. But how do you calculate the width of the microstrip feed? How do you calculate the position of where the microstrip intercepts the patch antenna? How do you calculate the exact position of where the second feed line braches of the main feed line to form the 90degree out of phase feed line?


I am applying for a family visit visa for my mum to come to the UK. On the visa form, I need to fill in travel history into the UK in the past 10 years.  My mum has been to the UK many times to visit me. Every time she is here, we go on short holidays to Europe (3-4 days) and then come back into the UK. Do I need to include all entry and exit dates even for very short trips out of the UK? It looks as if she comes in to the UK and then leaves and then comes in again very frequently. Please kindly advise. Thank you.

I am a 21 year old from Canada applying for a Tier 5 Youth Mobility Visa.  This is my travel history in the UK:  1: October 20th 2017 - Mid January 2018  2: Approx January 29th 2018 - January 31st 2018 (was in UK for around 2-3 days just catching a flight from London to Norway  3: March 15th - April 31st 2018  On my application it asks for my two most recent trips to the UK. I can ONLY list two maximum. I cannot list all three.  Should I not include my transit trip as it was so minor?   Basically should I list my March and January trips?  Or should I list my March and October trips?  I don't want to seem like I'm hiding my October history. But I want to do what's best.  Thank you!


I'm currently using jQuery datatables to make the table I am displaying. Currently I have it set up so when I select a row in the table, the text in that row appears in a textbox in another panel. I can then type in something else and press "Save" and it changes the text in that row. My current issue is when I add a new row via a button, I cant edit the text in the new row, I can select it however...  Example: I have 3 rows, I select Test1 and I can successfully change the text. Then I click Add Row and then I select the new row and attempt to change the text in that row, it changes the previously selected row's text (a row that was in the table upon load).  How can I fix this issue? I've looked into cell.data, cell.edit but that's for the Editor which I'm not currently using for various reasons.  Table:

                             Name

                             All

                             Test1

                             Test2

                     <button type="submit" class="btn btn-sm btn-primary m-r-5" id="addbtn" >New Group</button>

 //Text box
                 Group Name:
                         <input type="text" id="groupname" class="form-control" value="Name"/>

   Code for making the selected row's text appear in textbox:  (function () {        var table = document.querySelector('#data-table');       var textbox = document.querySelector('#groupname');        table.addEventListener('click', onTableClick);        function onTableClick (e) {         var tr = e.target.parentElement;          var data = [];         for (var td of tr.children) {           data.push(td.innerHTML);         }         textbox.value = data[0];       }     })();   Changing the selected row's text:      var row = null;      $("#data-table tr td").click(function() {       $("#groupname").val($(this).text());       row = $(this);           $("#saverow").click(function() {           if (row != null) {             row.text($("#groupname").val());           }         });     });   Add row:  $("#addbtn").click( function() {     var t = $('#data-table').DataTable();  $('#data-table').dataTable();     t.row.add( [         "New Group"      ] ).draw( false ); });

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


I have an NGINX server setup that is already hosting two applications, and SSL is set up on that NGINX server.  Now, I need to setup the NGINX server to be a front-end for a legacy Apache application so that the service that the legacy application is providing can be reached via SSL/HTTPS.  How do I configure my NGINX server to be a "pass through" server to the legacy application?

How would I set my webservers to work in way described below?   Http request: mypublic.com ---> handled normally by nginx as it is set up already (listen 80;) Http request: myprivate.com ---> handled by apache set up to work on 8080 (listen 8080)    I'd like to avoid including ports when typing address in browser, some kind of mockup (proxy?/squid?) at nginx. Both of domains are pointing to my machine and set up by named.


I'm trying to fix a Null Pointer Exception I'm getting when running Minecraft on my Mac. Some instructions I've found said that I needed to do two things:   Uninstall/Reinstall Java 'Nuke' the Minecraft folder   I've done the first, but I am unsure how to delete the Minecraft folder.  So how can I delete (nuke) a Minecraft folder?

I have a friend who is playing with me on a server we've created. Unfortunately, he is on a  Mac whereas I am on a Windows machine. I told him that I should be able to compile and send a .minecraft folder to him so that we can both play. Unfortunately, he can't find his .minecraft folder where it is supposed to be. Is it hidden and how can I unhide it?


I'm translating a C++ function I wrote some time ago into python when I noticed that my C++ code contains the following lines:    if(MIsScaledOut()) {     if(DataType()==UnknownDataType or DataType()==h)       Descriptor = Descriptor + DataTypeString() + "OverM";   There's an or in there!  This was probably because I previously translated from python, and forgot to switch to ||.  This code compiles in various OSes, with various compilers, and I've never seen a problem with it.  Is this standard, or have I just gotten lucky so far, and this is something I should worry about?

I've just read this  from Reddit.  They mention and and or being "Alternative Tokens" to && and ||  I was really unaware of these until now. Of course, everybody knows about the , but and and or? Since when? Is this a recent addition to the standard?  I've just checked it with Visual C++ 2008 and it doesn't seem to recognize these as anything other than a syntax error. What's going on?


I have an Activity with two Fragments, and I am getting a list of users from my database and storing in an ArrayList in my MainActivity. The problem is that the Adapter is in one of my Fragments. So what I want to do is call this method "initAdapter" inside my Fragment only when I finish getting the data from my Activity.  I tried this:  ExternsFragment fragment =     (ExternsFragment) getSupportFragmentManager().findFragmentById(R.id.viewPager); fragment.initAdapters(listUsers);   But I am getting an "Attempt to invoke a virtual method on a null object or reference" error. So I think this is not the right way to do that. How can I execute this method inside my Fragment only after I finish another in my Activity?  This is my stack trace:  09-13 18:05:30.948 23890-23890/com.construct.test I/System.out: 200 09-13 18:05:30.953 23890-23890/com.construct.test D/AndroidRuntime: Shutting down VM 09-13 18:05:30.993 1121-24364/? I/EventLogSendingHelper: Sending log events. 09-13 18:05:31.103 23890-23890/com.construct.test E/AndroidRuntime: FATAL EXCEPTION: main                                                                     Process: com.construct.test, PID: 23890                                                                     java.lang.NullPointerException: Attempt to invoke virtual method 'void com.construct.v2.activities.teams.ExternsFragment.initAdapters(java.util.List)' on a null object reference                                                                         at com.construct.v2.activities.teams.ActivityTeams$3.onResponse(ActivityTeams.java:165)                                                                         at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall$1$1.run(ExecutorCallAdapterFactory.java:70)                                                                         at android.os.Handler.handleCallback(Handler.java:751)                                                                         at android.os.Handler.dispatchMessage(Handler.java:95)                                                                         at android.os.Looper.loop(Looper.java:154)                                                                         at android.app.ActivityThread.main(ActivityThread.java:6123)                                                                         at java.lang.reflect.Method.invoke(Native Method)                                                                         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)                                                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757) 09-13 18:05:31.104 3100-4960/? W/ActivityManager:   Force finishing activity com.construct.test/com.construct.v2.activities.teams.ActivityTeams

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


I have a 1T usb 2.0 portable hard drive that I need to get rid of. I didn't know it's such a pain to get it wiped!   Tried Eraser, 1 pass(psuedorandom) by default took 18 hours.  Tried Western Digital's own software to wipe, took another 19 hours for 1 pass. During the process, due to the bad contact of the USB connector(common problem with this disk), it interrupted so many times, so I had to restart the above process many times to finish them. tried recovery software, took another 18 hours, and EVERYTING was able to be recovered!!!   I'm at a lost, at my wits' end. Please help me. How to get rid of this disk fast??? Should I just crash it with a hammer???

I need to make two hard drives unreadable. Unfortunately, I have some constraints which make this harder than usual (in particular, they rule out the answers to ):   I don’t have a computer to mount the drives and erase them (weird, right?) I don’t have a strong magnet I don’t have the right tools (screwdrivers …) to properly dismantle the drives I don’t have access to corrosive chemicals I don’t have a sledgehammer.   How can I destroy the drives with the least monetary / material requirements?  The only thing I can think of off the top of my head is to pinch off the connection pins, and perhaps destroy the circuit board using a small hammer.  I realise that given all the above constraints this may be too much to ask. I’m willing to settle for whatever I can get. I don’t have to fulfil legal obligations of data security, and the data on the discs, though personal, is not critical. I don’t want to prevent the FBI from reading my discs, just the next door wannabe MacGyver.


In The Flash, Flash is running at speeds greater than the speed of sound. Then how is he able to communicate live with his team (Cisco, Caitlin) while running? Since he is moving faster than sound it should not be possible to communicate live with his team. As we know when thunder happens light reaches first and then sound. There is a delay since sound travels slower than light. How are Flash and his team communicating? Did I miss something?

I am not a physicist, however, when Barry is running/flashing, he gets to talk to the team back in HQ - How?  When he talks back to them, I have a feeling, his voice needs to be distorted, even if not possible, as everything is ultra fast with him.  Isn't there some law in physics, that the movie is breaking, by allowing him to talk normally (vocal cords, breathing) while moving at 1000's steps per seconds (or whatever?)


I am going to have multiple machines that I am going to connect to via SSH so I am going to have multiple Terminal windows up, though what I want to do is to execute a command so that all the machines execute it, but currently what I will have to do is execute it in each individual Terminal window, is there any way that I can execute a command in one Terminal which will execute a specified command in all specified Terminal sessions for greater efficiency as I don't want to have to enter it into every individual Terminal window? I am going to be using gnome-terminal if that makes any difference.  I am running Ubuntu GNOME 15.10 with GNOME 3.18 and the other machines should be running the same.

I'd like to control several ssh connections from one terminal. For example, I would type ifconfig in the main terminal and all the other ssh connections would run ifconfig. That's what offered PuttyCM on Windows .  This may be a very simple question but I did not manage to find such a ssh connection manager. I would not be too hard to code but it surely already exists. Could you give some hints?


Not asking how one should use singletons here, nor advocating singletons or globals. With that clarified:  If we assume someone wants a global + unique object, why isn't a namespace always the preferred approach in C++, over implementing a singleton class?  I've only seen the namespace approach encouraged when there aren't statics being shared. Eg; from Google's style guidelines:      "Rather than creating classes only to group static member functions   which do not share static data, use namespaces instead."   But why not have non-member functions that share static data, declared in an unnamed namespace? And why isn't this generally suggested as a better alternative to writing a singleton class in C++?

Edit:    From another question I provided an answer that has links to a lot of questions/answers about singletons:   So I have read the thread  And the argument still rages.  I see Singletons as a Design Pattern (good and bad). The problem with Singleton is not the Pattern but rather the users (sorry everybody). Everybody and their father thinks they can implement one correctly (and from the many interviews I have done, most people can't). Also because everybody thinks they can implement a correct Singleton they abuse the Pattern and use it in situations that are not appropriate (replacing global variables with Singletons!).  So the main questions that need to be answered are:   When should you use a Singleton How do you implement a Singleton correctly   My hope for this article is that we can collect together in a single place (rather than having to google and search multiple sites) an authoritative source of when (and then how) to use a Singleton correctly. Also appropriate would be a list of Anti-Usages and common bad implementations explaining why they fail to work and for good implementations their weaknesses.  So get the ball rolling: I will hold my hand up and say this is what I use but probably has problems. I like "Scott Myers" handling of the subject in his books "Effective C++"     Good Situations to use Singletons (not many):         Logging frameworks   Thread recycling pools      /*  * C++ Singleton  * Limitation: Single Threaded Design  * See: http://www.aristeia.com/Papers/DDJ_Jul_Aug_2004_revised.pdf  *      For problems associated with locking in multi threaded applications  *  * Limitation:  * If you use this Singleton (A) within a destructor of another Singleton (B)  * This Singleton (A) must be fully constructed before the constructor of (B)  * is called.  */ class MySingleton {     private:         // Private Constructor         MySingleton();         // Stop the compiler generating methods of copy the object         MySingleton(MySingleton const& copy);            // Not Implemented         MySingleton& operator=(MySingleton const& copy); // Not Implemented      public:         static MySingleton& getInstance()         {             // The only instance             // Guaranteed to be lazy initialized             // Guaranteed that it will be destroyed correctly             static MySingleton instance;             return instance;         } };   OK. Lets get some criticism and other implementations together. :-)


When someone refers to a detective or police officer, they sometimes use the term 'gumshoe'. Where did this term originate from?

Why are detectives/inspectors colloquially referred to as Gumshoes?  Is it anything other that they would travel a lot in investigations and, presumably, wore hard-wearing shoes?


Occasionally, when running xelatex (using TeX Live 2018 on Linux Mint 19.2), I encounter the following error message:  (/usr/local/texlive/2018/texmf-dist/tex/latex/microtype/mt-cmr.cfg)) (/usr/local/texlive/2018/texmf-dist/tex/generic/oberdiek/se-ascii-print.def) [1 ! I can't write on file `xxx.pdf'. (Press Enter to retry, or Control-D to exit; default file extension is `.pdf') Please type another file name for output:   This happened to me yesterday evening, and I found myself expending an hour of my time trying to nail down what could be causing causing such a behavior.  I had a document viewer with the PDF open so naturally that could have been blocking access to the file so I closed the program, but to no avail (I'm using Evince which is most of the time fine, does automatically reload on document update, but has also occasionally been known to become unresponsive for no tractable reason).  I tried then to remove all temporary files and the PDF from the target folder; in my case this included all files matching *.aux, *.fls, *.log, *.out, and *.pdf; this had no discernible effect.  I also tried to write to another target:  (Press Enter to retry, or Control-D to exit; default file extension is `.pdf') Please type another file name for output: /tmp/x.pdf ! I can't write on file `/tmp/x.pdf'. (Press Enter to retry, or Control-D to exit; default file extension is `.pdf')   This did not spark joy.  During my continued efforts to come to grips with this I could produce a PDF roughly one out of two or three runs; I was unable to make the behavior predictable—it's not the viewer, it's none of the existing files in the directory, all packages that are loaded are always the exact same ones.  Has there been any experience as to possible reasons for failure to write to the target or any other file? If the specific target had been blocked, then surely entering a non-existing filename in the existing /tmp directory should always work, right? It feels as if the 'file writing mechanism' of TeX has a washer hopping around in the gear, sometimes causing it to grind to a halt.  I will say that this work is being done on a recent but not terribly performant netbook, IOW it might be the case that shortage of RAM is the underlying problem and failure to write just the visible side effect of that. Maybe someone can corroborate or refute that; personally I would of course prefer any software to fail with an Out of Memory error when that is indeed the problem.

Every so often I'll be working and all of a sudden xelatex won't work, saying "I can't write on file `test.pdf'". But why not? Is it something I did? Did I insult xelatex? Now it won't even compile my test.tex.  This is XeTeX, Version 3.1415926-2.2-0.9995.2 (TeX Live 2009/Debian) (format=xelatex 2011.4.22). Ubuntu 10.04.  The input  \documentclass{article} \usepackage{fontspec,xltxtra,xunicode} \setmainfont{Inconsolata} \begin{document} hello world \end{document}   The error  LaTeX Font Info:    Overwriting math alphabet `\mathsf' in version `bold' (Font)                  OT1/cmss/bx/n --> EU1/lmss/bx/n on input line 4. LaTeX Font Info:    Overwriting math alphabet `\mathtt' in version `bold' (Font)                  OT1/cmtt/m/n --> EU1/lmtt/bx/n on input line 4.  [1 ! I can't write on file `test.pdf'. (Press Enter to retry, or Control-D to exit; default file extension is `.pdf') Please type another file name for output:  ! Emergency stop. <to be read again>                     \endgroup \set@typeset@protect  l.6 \end{document}  End of file on the terminal!   Here is how much of TeX's memory you used:  5003 strings out of 495724  81422 string characters out of 1189346  150108 words of memory out of 3000000  8144 multiletter control sequences out of 15000+50000  3664 words of font info for 17 fonts, out of 3000000 for 9000  28 hyphenation exceptions out of 8191  40i,4n,27p,455b,147s stack positions out of 5000i,500n,10000p,200000b,50000s No pages of output.   The inconsistency of it all  Ten minutes later (now), after tinkering around, it works. So I delete the contents of the file, and paste what I posted here, and, it works. Then I delete test.* except for the tex file, try xelatex again, and it doesn't work. The tinkering was to change the tex file to this:  \documentclass[12pt,letterpaper]{article}   \usepackage{fontspec}% provides font selecting commands  \usepackage{xunicode}% provides unicode character macros  \usepackage{xltxtra} % provides some fixes/extras   \setromanfont[Mapping=tex-text]{Inconsolata} \begin{document} hello world \end{document}   strace -f  Strace shows a memory error right before the "cannot create pdf" line. I'm experimenting with adding more swap. Currently my system is down its last 300-400 MiB of ram, and I'm seeing xelatex using upwards of 200 MiB. Which means a couple more browser tabs or another pdf window could foul things up..  clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7887738) = -1 ENOMEM (Cannot allocate memory)`.


I'm currently working for a design firm (we'll call them Acme Design), and we own the domain name acmedesign.co.uk (have done since 2008). The name isn't trademarked.  I've just been contacted by another design agency about 2 miles away from us (we'll call them Foobar Media, ie. completely different) whose site is foobarmedia.co.uk - they've just registered acmedesign.com and acme-design.co.uk and are trying to sell them on to us.  At present, the domains both point to Foobar Media's site, so if any clients type the wrong version of the domain into their browser, effectively trying to drive our clients to themselves.  Is there anything we can do about this legally (ICANN UDRP, etc) or is it just a case of "tough luck"?

I currently have a classified ads domain in the .co.uk extension (say piggybank.co.uk). I am about to register the website and its name as a trademark.  There's also a website with the same name in the .com extension (say piggybank.com) which is currently on sale for several thousands USD.  Once I register the trademark, will I be able to legally get hold of the .com domain on the basis of trademark ownership (through ICANN or smth)?


I would like to define a shape for nodes in tikz using another tikzpicture. For instance, I would like to make the following into a node shape called monoid  \begin{tikzpicture}   \node (m) [circle,scale=.5,draw] at (0, 0) {};   \node (i1) at (-1,.5){};   \node (i2) at (-1,-.5){};   \node (o) at (1,|-m){};     \draw [-] (m) to (o);     \draw [-] (i1) to [out=0, in=135] (m);     \draw [-] (i2) to [out=0, in=-135] (m); \end{tikzpicture}   and be able to use it in another tikzpicture. For example, doing something like  \begin{tikzpicture}   \node(M)[monoid]at(0,0){};   \draw (-1,0)[out=0,in=180]to(M.i1); \end{tikzpicture}   If someone could point me to the part of the manual that I need to read in order to do this, it would be great. Thanks a lot in advance!  Elena

I know how to draw different shapes using tikz, like this:  \documentclass{minimal} \usepackage{tikz} \begin{document}  \begin{tikzpicture} \draw (0,0) ellipse (1 and 1.5)       (0,2.5) circle (1)       (2.5,0) circle (1.5); \end{tikzpicture}  \end{document}     However, I would like to put a number of different shapes together inside a node, and I couldn't yet find a simple way to do that. I will make a little figure to include in a large diagram which is already made of several nodes.  If this is not possible, or not easy, then how do I include a JPG or EPS file in a node?  Thank you!


is there a tutorial and patterns to write unit tests in Unity ?  Should we use the classical c# way and test the code or should we test the interactions in UI ? If so how?

How to implement Unit Test at Unity3D.   I wonder if it would be possible to extend the Unity editor to have some sort of testing framework in it.    Is there any guideline to implement it? Any reference like book, blog? Any working example or project?


A biased coin is tossed with probability 0.6 of landing on Heads (H) and probability 0.4 of landing on Tails (T). A group is a maximal sequence of consecutive tosses that land on the same side.  For instance, the groups of HTTTHTHTT are (H)(TTT)(H)(T)(H)(TT)  What is the expected number of groups after 10 tosses?

A coin with heads probability $p$ is flipped $n$ times. A "run" is a maximal sequence of consecutive flips that are all the same. For example, the sequence HTHHHTTH with $n=8$ has five runs, namely H, T, HHH, TT,H. Show that the expected number of runs is  $$1+2(n-1)p(1-p).$$  I have tried to use some generating function on this but calculus got pretty messy and didn't work.


Is it possible to run my scripts located in ~/scripts from anywhere?  Say i want to run ./scriptname regardless of my current working directory.

I'd like to know if there is a way to run  program/shell script without typing full path:  /opt/idea/bin/idea.sh


While creating leads in salesforce through the Lead API (/services/data/v39.0/sobjects/Lead), I am getting BadRequest response with the message: [{"message":"Use one of these records?","errorCode":"DUPLICATES_DETECTED","fields":[]}] The Allow duplicate leads is checked in the portal settings. When I try to create the same lead from the Portal, it shows me the warning and allows me to submit the lead which i understand is the expected behavior. My question is: How do i submit the duplicate leads using the API? Is there a way i can specify to forcibly create the leads like i do from the UI?

So we are experimenting with the new duplicate matching rules in salesforce which seems to work great.  My question is if its possible to use the more advanced features when working with data over the Rest API  So right now if you have a duplicate rule setup and you try to create record via the api it correctly errors and send you back the error message text as expected.  But if you say "allow" but "alert the user" it also throws an error when trying to save via the rest api.  So specifically is there a way to get the list of "possible matches" and related to that, how can we "Save (ignore alert)".  Id be curious if anyone knows how we might implement something like this either using apex or just the rest api  any insight you might have would be helpful.    UPDATE:  So i was able to find this for how to do it in apex here: is there similar functionality (ie. AllowSave = true) via the api


I'm browsing , and I found a curious thing:  /// <summary> /// The namespace that the rule is contained within. /// </summary> private string @namespace;  // [...]  internal Rule(string name, string @namespace, string checkId, string context, bool warning) : this(name, @namespace, checkId, context, warning, string.Empty, null, true, false) {     Param.Ignore(name, @namespace, checkId, context, warning); }   What is this thing? Is it just a simple field where at-sign is used to indicate that it is a field, and not a namespace keyword? If so, may at-sign be used for any reserved word (for example @dynamic, @using, etc.)?

I discovered that you can start your variable name with a '@' character in C#.  In my C# project I was using a web service (I added a web reference to my project) that was written in Java. One of the interface objects defined in the WSDL had a member variable with the name "params". Obviously this is a reserved word in C# so you can't have a class with a member variable with the name "params". The proxy object that was generated contained a property that looked like this:  public ArrayList @params {     get { return this.paramsField; }     set { this.paramsField = value; } }   I searched through the VS 2008 c# documentation but couldn't find anything about it. Also searching Google didn't give me any useful answers. So what is the exact meaning or use of the '@' character in a variable/property name?


I'm working on a database login system in PHP but one of my users has an exclamation mark in his password which breaks it, The line where it says ($password = $_GET['p'];) is where the password gets passed in  $username = $_GET['u']; $password = $_GET["p"]; function userLoginIpb($username, $password) { //select the password information froms elected user           $query = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT `members_pass_salt`, `members_pass_hash` FROM `members` WHERE `name` = '$username'");           $results = mysqli_fetch_assoc($query);           $password = md5(md5($results['members_pass_salt']).md5($password));           if ($password == $results['members_pass_hash']) {               return true;           } else {               return false;           }

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?


Hello I have some variables in Javascript that can have values as “Creación de” I need to convert to send to an html page as “Creaci%F3n%20de”. How can I make that conversion in Javascript? Thank you

How do you safely encode a URL using JavaScript such that it can be put into a GET string?  var myUrl = "http://example.com/index.html?param=1&anotherParam=2"; var myOtherUrl = "http://example.com/index.html?url=" + myUrl;   I assume that you need to encode the myUrl variable on that second line?


I am in the process of buying a house and the bank requires that my name needs to be taken out of the car loan. My son is the cosigner, and my daughter (whom I bought the car for) is making the monthly payments. What would I have to do to get my name out?

I co-signed on a car loan with my partner, and now that we are no longer together I want to have my name removed. He has had the car a year now and has been on his job over an year, but he won't do the refinance to have my name removed, and I would like to know if there is something legally that I can do to have my name removed.


The first part is clear but in the second I did this:  $2^{n+1}=2^n\cdot 2 \ge n^2\cdot 2=n^2+n^2=n^2+n\cdot n\ge  n^2+n\left(2+\frac{1}{n}\right)=(n+1)^2$  I'm not sure if I the assumption: $n\ge 2+(1/n)$ is correct or I should prove it. Can you help me? Thanks :)

I am trying to prove that $n^2 \leq 2^n$ for all natural $n$ with $n \ne 3$. My steps are:    induction base case: $n=0:$ $0² \leq 2⁰$ which is okay.    inductive step: $n \rightarrow n+1:$ $(n+1)²\leq2^{n+1}$ $$(n+1)^2 = n^2 + 2n + 1 = ...help...\leq 2^{n+1}$$   I know the bernoulli inequality but don't know where to use it, if I even need to. I have problems when it comes to proving things which are based on orders..


We had code like this in a shell script: CMD="docker container create \     --name $CONTAINER_NAME \     --network $NETWORK \     nginx:1.17 \     nginx-debug -g 'daemon off;'" $CMD  when we executed the script, it did not work as expected. The container gives following error: nginx: invalid option: "off;'"  Then we changed to: eval $CMD  in the bash script and then it started working! I'd like to understand what is the difference between the two.

$ ls -l /tmp/test/my\ dir/ total 0   I was wondering why the following ways to run the above command fail or succeed?  $ abc='ls -l "/tmp/test/my dir"'  $ $abc ls: cannot access '"/tmp/test/my': No such file or directory ls: cannot access 'dir"': No such file or directory  $ "$abc" bash: ls -l "/tmp/test/my dir": No such file or directory  $ bash -c $abc 'my dir'  $ bash -c "$abc" total 0  $ eval $abc total 0  $ eval "$abc" total 0


Nothing can escape from a black hole except for Hawking radiation. Nothing can travel faster than the speed of light. Gravity travels at the speed of light. How does gravity escape from a black hole ?

My understanding is that light can not escape from within a black hole (within the event horizon).  I've also heard that information cannot propagate faster than the speed of light.  It would seem to me that the gravitational attraction caused by a black hole carries information about the amount of mass within the black hole.  So, how does this information escape?  Looking at it from a particle point of view: do the gravitons (should they exist) travel faster than the photons?


My brother downloaded some books on my iBooks account and I want it permanently off my purchased and all books thing. I have iOS 8.1.2 so none of the answers in the previous question.

Yesterday, I saw that my brother has downloaded an "hentai" on my Mac (shame on me, I didn't lock it !) I deleted it, but it stays on my purchased books, and I don't want it !  Is it possible to totally remove a book from my account's purchased history?


How can the real, integer, and rational number sets be infinite, yet, they aren't all the same size?

I've been told that there are precisely the same number of rationals as there are of integers. The set of rationals is countably infinite, therefore every rational can be associated with a positive integer, therefore there are the same number of rationals as integers. I've ignored sign-related issues, but these are easily handled.  To count the rationals, consider sets of rationals where the denominator and numerator are positive and sum to some constant. If the constant is 2 there's 1/1. If the constant is 3, there's 1/2 and 2/1. If the constant is 4 there's 1/3, 2/2 and 3/1. So far we have counted out 6 rationals, and if we continue long enough, we will eventually count to any specific rational you care to mention.  The trouble is, I find this very hard to accept. I have two reasons. First, this logic seems to assume that infinity is a finite number. You can count to and number any rational, but you cannot number all rationals. You can't even count all positive integers. Infinity is code for "no matter how far you count, you have never counted enough". If it were possible to count to infinity, it would be possible to count one step less and stop at count infinity-1 which must be different to infinity.  The second reason is that it's very easy to construct alternative mappings. Between zero and one there are infinitely many rational numbers, between one and two there are infinitely many rational numbers, and so on. To me, this seems a much more reasonable approach, implying that there are infinite rational numbers for every integer.  But even then, this is just one of many alternative ways to map between ranges of rationals and ranges of integers. Since you can count the rationals, you can equally count stepping by any amount for each rational. You can use 1..10 for the first rational and 11..20 for the second etc. Or 1..100 and 101..200 etc, or 1..1000 and 1001..2000 etc. You can map finite range of integers of any size to each rational this way and, since there is no finite upper bound to the stepping amount, you could argue there are potentially infinite integers for every single rational.  So... can anyone convince me that there is a single unambiguous correct answer to this question? Are there more rational numbers than integers, or not?  EDIT  Although I've already accepted an answer, I'll just add some extra context.  My reason for questioning this relates to the Hilbert space-filling curve. I find this interesting because of applications to multi-dimensional indexing data structures in software. However, I found Hilberts claim that the Hilbert curve literally filled a multi-dimensional space hard to accept.  As mentioned in a comment below, a one meter line segment and a two meter line segment can both be seen as sets of points and, but (by the logic in answers below), those two sets are both the same size (cardinality). Yet we would not claim the two line segments are both the same size. The lengths are finite and different. Going beyond this, we most certainly wouldn't claim that the size of any finite straight line segment is equal to the size of a one-meter-by-one-meter square.  The Hilbert curve reasoning makes sense now - the set of points in the curve is equal to the set of points in the space it fills. Previously, I was thinking too much about basic geometry, and couldn't accept the size of a curve as being equal to the size of a space. However, this isn't based on a fallacious counting-to-infinity argument - it's a necessary consequence of an alternative line of reasoning. The two constructs are equal because they both represent the same set of points. The area/volume/etc of the curve follows from that.


I know the differences between client side and server side scripting on a web application. But when it comes to SharePoint what exactly means client side and server side?

There does not seem to be any clear explanation of the different hosting types and technology abbreviations, so I decided to make a community post about the different types. Perhaps there will never be any good distinctions, but we here at SharePoint Stack Exchange can at least coin our own definitions and perhaps live by these. I believe this could make everything much easier. I hope others will edit this post so it becomes even more correct, as there are probably a lot of errors and subjective ignorance.


When Genji uses his Deflect ability on an incoming projectile, what happens in the following situations?   If Mercy was buffing the player who originally fired the projectile, does it retain the damage bonus after Genji deflects it? If Mercy is buffing Genji at the time he reflects the projectile, does it gain the damage bonus?

In Overwatch, there are several ways to buff the damage dealt by a hero: the alternate fire of Mercy's Caduceus Staff, Ana's Nano Boost, and Orisa's Supercharger. Are they all governed by the same rules? What can they affect, or not affect?  This question exists to have a single reference point for the many, many questions that have been asked, instead of having to update each answer individually when game mechanics change


My laptop is always plugged in when it is switched off and  i many times forget to remove the charger.

When I'm at home, is it better to use the laptop plugged into AC power, or with just the battery, for the overall battery life?


I'd like to test last HBO GO android application to see how they implemented chromecast, but I'm in Canada and my devices are registered to play store Canada so I'm not able to install it. I have been looking for the single .apk on the web but I'm not sure if I could trust those I found.  Does any body has an idea how I could get it or how to get rid of the localization limitations ? Thanks

I'm travelling to country X. I want to install an application which isn't available in my country, but is available in country X; but I prefer to download and install it in advance, while the data connection is still cheap.  Unfortunately, the Play Stores does not allow me to install this app. Is there any way to circumvent this limitation?


In my physics textbook, the following points are given:-   The Law of Conservation of linear momentum emerges from the homogenecity of space.  Isotropy of Space gives rise to the Law of Conservation of angular momentum.  Homogenity of time gives rise to the Law of Conservation of Energy.    However, no explanation for the above three points has been given in my book.Can someone provide explanation for the above 3 points? (If possible, please include mathematics in your explanation.)

is one of those surprisingly clear results of mathematical calculations, for which I am inclined to think that some kind of intuitive understanding should or must be possible. However I don't know of any, do you?  *Independence of time $\leftrightarrow$ energy conservation. *Independence of position $\leftrightarrow$ momentum conservation. *Independence of direction $\leftrightarrow$ angular momentum conservation.  I know that the mathematics leads in the direction of Lie-algebra and such but I would like to discuss whether this theorem can be understood from a non-mathematical point of view also.


Is there a way to check if a specific string contains any lower/upper case ?  E.G :  String myStr = "test"; if (myStr.contains("test") { // I would like this condition to                                  check the spell of "test", weather it is                                 written like "Test" or "teSt" etc... //Do stuff }   With this syntax, it works only for the exact same string. How could I make my condition for anyform of "test", like : "Test", "tEst", "tesT" etc... ?

Say I have two strings,  String s1 = "AbBaCca"; String s2 = "bac";   I want to perform a check returning that s2 is contained within s1. I can do this with:  return s1.contains(s2);   I am pretty sure that contains() is case sensitive, however I can't determine this for sure from reading the documentation. If it is then I suppose my best method would be something like:  return s1.toLowerCase().contains(s2.toLowerCase());   All this aside, is there another (possibly better) way to accomplish this without caring about case-sensitivity?


For a project of mine i'm trying to convert a given Collection to an array  I currently have this:  public class InsertionSorter< T extends Comparable<T>> {     private T[] array;      @SuppressWarnings("unchecked")     public InsertionSorter(){         array = (T[]) new Object[0];     } }   This gives me the following error:   java.lang.ClassCastException: java.base/[Ljava.lang.Object; cannot be cast to java.base/[Ljava.lang.Comparable;   Is there a solution for this?  And after i converted it to an array i want to to sort it and return it back as an collection. I do this as following:  collection.clear(); collection.addAll(Arrays.asList(sort(array))); return collection;   The sort method is a method which sorts an array and returns an array of type T.

Due to the implementation of Java generics, you can't have code like this:   public class GenSet<E> {     private E a[];      public GenSet() {         a = new E[INITIAL_ARRAY_LENGTH]; // error: generic array creation     } }   How can I implement this while maintaining type safety?  I saw a solution on the Java forums that goes like this:  import java.lang.reflect.Array;  class Stack<T> {     public Stack(Class<T> clazz, int capacity) {         array = (T[])Array.newInstance(clazz, capacity);     }      private final T[] array; }   But I really don't get what's going on.


I'm trying to manually verify self signed certificate but the process is not clear. I created a self signed certificate server.cert using a ca.crt file which I also created.  I provided the server.key + server.crt to my SSL server.  now, how the client suppose to verify the server.cert (assuming the server send it server.cert)?  As I understand, when creating a server.crt, the ca supposed to encrypt the Hash(server.cert) using the ca's private-key and this whole thing (including the signature) is the server certificate. so how would I validate the certificate. I suppose I somehow need to be using the ca.cert in my client side? because the ca.cert also contains the ca.public key, but what do I need to do to the server.crt to be able to say that the signature is correct?

What is the series of steps needed to securely verify a ssl certificate?  My (very limited) understanding is that when you visit an https site, the server sends a certificate to the client (the browser) and the browser gets the certificate's issuer information from that certificate, then uses that to contact the issuerer, and somehow compares certificates for validity.     How exactly is this done?  What about the process makes it immune to man-in-the-middle attacks? What prevents some random person from setting up their own verification service to use in man-in-the-middle attacks, so everything "looks" secure?


I have an Ubuntu 16.04 web server. It only hosts one site using Nginx. I want to keep things very simple, and store the index.html file and the whole website in /var/www/html.  I need to be able to FTP files into /var/www/html. I have installed vsftp. I've created a user with the useradd command, which I'll call exampleuser. I then used this command:  sudo usermod -d /var/www/html exampleuser   ... thinking that this would make the home directory of exampleuser to be the default directory when I log in by FTP.  However, when I attempt to log in by FTP, I get a "login error". I've checked and double checked my username and password and I'm certain they're correct, so I'm guessing it's a permissions issue (also because my experience is that most of the time in Linux when things don't work as hoped it's because of permissions). Though it's possible it could be a vsftpd configurations issue.   I think I've set the html directory in /var/www to have the right access:  /var/www$ ls -la total 12 drwxr-xr-x  3 root          root          4096 Nov 10 06:54 . drwxr-xr-x 14 root          root          4096 Nov 10 06:54 .. drwxr-xr-x  2 exampleuser exampleuser 4096 Nov 10 08:04 html   What do I need to do so that I can ftp to /var/www/html?

I have an ec2 instance on AWS which already installed a few Wordpress-es in it.  I want to set things up to let more people handle their own projects, with me also being able to go into the server using terminal if I still want to.  I have been following tutorials such as  and a few others.  I figured all of them just teach users how to sftp into their own home folder, also the steps keep saying addUser but some users already existed and removing them might cause some issue.  How can I give existing users the permission to use SFTP for Wordpress projects?  Let's say all my Wordpress projects are already under /var/www/ which has already been set up with www-data:www-data.  Really new with setting things like this.  Thanks in advance for any help.


I was in the middle of installing several apps using the sodu apt-get install command when all of a sudden sodu started producing the error sodu:command not found. What is going on?     Editor's note: The spelling of the command is as he typed it.

Why  do we use sudo to perform a terminal command as an administrative? Why isn't it  admin or something else? Is there a reason for sudo?


My regular expression in Python below doesn't see the pattern. Can you please tell me what I am doing wrong here?  ================  import re  l = 'rootfs on / type rootfs (rw xyz' m_obj = re.match(r'on / type .*? \(rw', l)  if m_obj:     print "Found!" else:     print "Not found!"   =================  Thanks

What is the difference between the search() and match() functions in the ?  I've read the  (), but I never seem to remember it.  I keep having to look it up and re-learn it.  I'm hoping that someone will answer it clearly with examples so that (perhaps) it will stick in my head.  Or at least I'll have a better place to return with my question and it will take less time to re-learn it.


This function works, but I am thinking there must be a more elegant way to convert all '/' to '\/' (so that I can subsequently feed it into sed using the standard '/' for substitute):  escapeslash() {     val="$1"         fixed=""     while [ 1 ]; do         start=${val%%/*}         remainder=${val#*/}         if [ "${remainder}" = "${val}" ]; then             fixed="${fixed}${start}"             break;         fi         fixed="${fixed}${start}\/"         val="${remainder}"       done         echo "${fixed}"  }

In my bash script I have an external (received from user) string, which I should use in sed pattern.  REPLACE="<funny characters here>" sed "s/KEYWORD/$REPLACE/g"   How can I escape the $REPLACE string so it would be safely accepted by sed as a literal replacement?  NOTE: The KEYWORD is a dumb substring with no matches etc. It is not supplied by user.


Blender is not filling correctly the SVG file imported from illustrator even after trying all the options for SVG exporting on illustrator. On the attached photo, you can see the area referred with the blue arrow doesn't fill until I delete the red areas.  The filling before deleting the red areas:    The filling after deleting the red areas:    Would you please help me sort this out?

It should be noted that this question poses a similar issue to some other questions on SE, but (the ones that I saw) were caused by massively large scaling factors, which (as far as I can tell) isn't the source of this issue.   I'm trying to import  into blender so that I can extrude it afterwards. All I can manage to get is this result:    I'm very new to blender, so I don't know what the issue could be. All I did to get this was create a new scene, import the svg, and zoom/move the view to make it visible.  As well, I have uploaded (and publicly shared, of course) the  for those who are interested.


Now I’d like to present you guys, the trailer of the movie.   Vs     Now I’d like to present to you guys, the trailer of the movie.   Also,      This is the last letter she sent me.    Vs      This is the last letter she sent to me.    Is to required? Or is it not?

This is the gift that my dad sent me on my birthday.   Vs   This is the gift that my dad sent to me on my birthday.  Is to required?   Also   Presenting you guys, the trailer of the film.   Vs   Presenting to you guys, the trailer of the film.    Is to required?


Lately, my overall impression has been that the list of "Related questions" one sees once a question is posted is usually more relevant that the "Questions that may already have your answer" one is exposed to while typing.  My questions are :    How are the two lists constructed? Are the two lists generated in any significantly different way or am I completely wrong in believing that there is a difference between the two? If there is a difference in the way the lists are constructed, how is the difference justified?

For almost every question there's a list of "related" questions on the right.  How are those questions selected? Is it based solely on tags? Can I do anything if I see a question on the list that is really not related to prevent it from being incorrectly listed?


I couldn't log in to my system because of a certain command I ran,  I was able to access my system shell and saw the option for upgrade. Will the upgrade restore my rights privileges so that I can log in to my system again?  Please your help is highly  appreciated.

I can no longer log in to my system after running this command :  sudo chown -R &USER: $HOME   as ROOT because I couldn't access  a certain file.   Now I can't log in again.


I'd like to retrieve the content and href link from an HTML tag in Python.  I'm a beginner in regex and am able to retrieve the href content in this way:  urls = re.findall('<a class="title" href="(.*?)" title', page)   When trying to extract tag's content as well, I get nothing.  urls = re.findall('(.*?)', page)   How to do it the right way?  Thanks in advance.

I’m a newbie in Python. I’m learning regexes, but I need help here.  Here comes the HTML source:  http://www.ptop.se   I’m trying to code a tool that only prints out http://ptop.se. Can you help me please?


When a metal surface is illuminated with light of appropriate frequency so as to cause photoelectric emission, when does the work function of the metal come into play? Is it the energy required to bring an electron to the metal surface or is it the energy required to liberate the electron from the metal surface? Also, is it possible for any other substance( except metal) to emit photoelectrons?

Why the  is observed only for metals and not for non-metals?  Isn't it possible for the photon to release an electron from a non-metal surface?


I was unsure so I had to ask. Sorry if this is duplicate. I don't know if the system I am running is 32 or 64 bit. It has 2GB of RAM, which is apparently an indicator that it is 64bit, and it is win8.1, which I've heard only comes in 64bit. However, DXDIAG tells me that I am running a 32 bit OS. I'd be happy to supply more info as you require, and thanks in advance.

What is the difference between 32-bit and 64-bit Ubuntu? I've heard the 64-bit platform performs better and can detect more than 4GB of RAM. Also, while some apps haven't ported to 64-bit yet, ia32-libs lets a 64-bit machine run them.  If so, why not promote 64-bit over 32-bit?


Forgive the rookie question but still fairly new to Linux land. I'm trying to create a "self contained" Ubuntu 20.04 installation on a 64GB USB Stick. Summary Below:  All of the bare metal that I will be using has capacity 16gig RAM, My understanding is I don't need the Swap partition? FAT32 Partition? (What size to allocate & why) EXT4  Partition? (What size to allocate & why) I've been trying to install the full Ubuntu 20.04 on the same USB as I'm running Ubuntu Live (demo) without success. I presume this can't be done as it is mounted at the time? i.e you need 2 USB sticks, one with live running (to access G-Parted) the other the target (new full install)? I don't want to see any of the storage media on the host machine when booting from USB (20.04) i.e. OS and storage all contained on the USB. A fully isolated system.  Thanks in advance Cheers NewB

I need a method of creating a Full install USB that boots both BIOS and UEFI. Full install USB's have advantages over Persistent USB's as shown here:  I want to be able to carry my customized Ubuntu 20.04 OS around with me and boot it off any x86-64 computer that meets Ubuntu minimum spec's. I have seen a few methods of creating a Full install USB, but they are either not simple or do not boot  BIOS and UEFI. The use of an image file seems like the best method.


I am using Ubuntu 17.10 and I uninstalled Hex Workshop.exe and Immunity Debugger.exe from my PC using wine uninstall.exe . Why do I keep getting them as a search result even though they are uninstalled ??? Is there a way to remove them?

I installed  (for Windows) using wine but turns out LAN Messenger is also available for linux as well. So..   I uninstalled LAN Messenger from wine. I also removed wine. deleted the .wine directory. after that sudo apt-get autoremove and sudo apt-get autoclean. then I installed LAN Messenger using dpkg -i pkgname.deb and it installed successfully.   The problem is that now I get this in dash:   Any Help is highly appreciated.  [NOTE] I am using ubuntu 12.10


As the question is fairly self-explanatory, I would like to know how to set a cronjob to execute any random weekday without using any external script.  EDIT: In case people have not understood this question, We have 5 weekdays, viz., Monday, Tuesday, Wednesday, Thursday, Friday. I have a server running 24/7. I want to set a cron that will run on any 1 weekday per week.  Note: I highly doubt this is a duplicate question, as this question is not pertaining to daily/weekly/monthly cronjobs.

This is a  about using cron & crontab.   You have been directed here because the community is fairly sure that the answer to your question can be found below. If your question is not answered below then the answers will help you gather information that will help the community help you. This information should be edited into your original question.  The answer for 'Why is my crontab not working, and how can I troubleshoot it?' can be seen below.  This addresses the cron system with the crontab highlighted.


When using Nautilus you can use CTRL+L to display the addressbar. How do you revert back to the pathbar? Is there a shortcut key?

I'm on 12.04 Desktop.  When browsing the file system, it's convenient to type Ctrl+L so as to get the file path "Location" to render as a string; I can then modify the file path or even paste something in and get redirected right where I want to go.  But often, after typing Ctrl+L, I find myself wanting to revert back to the normal way Nautilus renders the file path (as a series of buttons/links). What's the magical shortcut to "undo" Ctrl+L and go back to "normal mode"? Thanks in advance!


I've been a long time user of xubuntu and finally bit the bullet and installed the server version as I am running this PC mainly for fileserver and streaming purposes.   That said, I'm trying to install xfce4 as the GUI, but even though every webpage states just use apt-get or just apt install xfce4 am met with the following:     Reading package list... Done   Building dependency tree   Reading state information... Done   E: unable to locate package xfce4     This seems to be the same for any files pertaining to xubuntu. I'm guessing there may be something lacking in my resources list,  But if this is the case....why do so many webpages just advise to install xfce4 and then lightdm??  I'm a stubborn @#£11!! and have no intention to go back to an xubuntu install as it takes an age to remove all the shash I don't want, so would rather get it right first time...

How do I get to the Universe Repository in supported versions of Ubuntu?


I am using Microsoft Edge, Version 88.0.705.53 (Official build) (64-bit). When I opening a new tab the following content is displayed:  But now I want to specify my default page when opening a new tab (like  ). Please guide me. Thanks.

How do I change the default new tab page in Google Chrome (version 41 on Win 8.1).  I want it to point to an HTML page on my own computer - the same page in fact as I am using for my home page.