I was able to use the following new environment to number the examples automatically quite conveniently  until yesterday when I updated TeXstudio to version 2.12.8. That is, I only needed to type \begin{in to get the suggestion of this environment and then hit Enter to insert it to the text body. This trick no longer works. Pleases help.  Thanks in advance.  \newenvironment{inlineexample} {\par\vskip\medskipamount     \refstepcounter{theorem}%     {\usebeamercolor[fg]{block title example}\translate{Example}~\theexample}:} {\par\vskip\smallskipamount}
TeXstudio does a pretty good job with autocompletion. For example, when I type \eqref{, it already comes with suggestions, see the example below.    However, suppose that I don't want to use \eqref but a customized command using newcommand (I do this so that I can quickly switch to different styles, e.g., some for journals/conferences "Eq. (1)" is needed, whereas sometimes "(1)" suffices). In this case, TeXstudio does not do the auto-completion, see the example below.    Is it possible to configure TeXstudio such that it does the auto-completion for custom commands that require a reference?  Note that one option is to redefine \eqref using \renewcommand, but I'm looking for another way so that I can use if for many more commands, not just for \eqref.   Here is my MWE:  \documentclass{article} \usepackage{amsmath}  \newcommand{\alternative}[1]{Eq.~(\ref{#1})}  \begin{document}     \begin{equation}         \label{eq:emc2}         E = mc^2     \end{equation}     I can refer to the equation using \eqref{eq:emc2} and using \alternative{eq:emc2}. \end{document}
Get different and common items in two arrays with LINQ When does Thread.CurrentThread.Join() make sense? Escaping quotes in zsh alias Following on from  about stripping newlines out of text, I want to turn this into a zsh alias as follows:  alias striplines=' awk " /^$/ {print \"\n\"; } /./ {printf( \" %s \",$0);}"'   I've tried escaping the quotes inside the awk script, but I'm getting this error:  awk: (FILENAME=bspsrobustness FNR=1) fatal: division by zero attempted   (The file is called bspsrobustness)  Is there a way to do what I want? I suppose I could turn this into an awk script rather than a zsh alias, is that my best option? Show the commutator subgroup of $S_{n}$ is $A_{n}$ for $n \geq 5$ Show that for $n \geq 5$, the commutator subgroup of $S_{n}$ is $A_{n}$ for $n \geq 5$.     I'm not sure on how to handle this problem. I know that the commutator subgroup $G'$ will consist of products of commutators $[\sigma_{i}, \tau_{i}]$ for permutations $\sigma_{i}, \tau_{i} \in S_{n}$. However, I don't know where to start. What would be the best way to approach this? Why are there so many different ways to measure disk usage? ResultSet exception - before start of result set What is the greatest integer that divides $p^4-1$ for every prime number $p$ greater than $5$? What is the greatest integer that divides $p^4-1$ for every prime number $p &gt; 5$?  This was on a practice math GRE so it's probably really easy. Why can I modify a read-only file? Short Question:  Why can we manipulate a read-only file in Vim using : + w + q + ! even without being an administrator?  Long Question:  I have a text file (myFile.txt) which is read-only for everyone:  navid@navid-ThinkPad-T530:~/ubuntuTest$ ls -l myFile.txt  -r--r--r-- 1 navid navid 26 Aug 22 21:21 myFile.txt   I can open it with Vim without having admin privileges:  navid@navid-ThinkPad-T530:~/ubuntuTest$ vi myFile.txt    I modify it and press: Esc + : + w + q + Enter and I see this error message:  E45: 'readonly' option is set (add ! to override)   So far, everything makes sense.  But when I press: Esc + : + w + q + ! + Enter, Vim saves the changes.  I'm using Ubuntu 16.04 and VIM 7.4. Secure hash and salt for PHP passwords It is currently said that MD5 is partially unsafe. Taking this into consideration, I'd like to know which mechanism to use for password protection.  This question,   suggests that hashing multiple times may be a good idea, whereas  suggests using salt.  I'm using PHP. I want a safe and fast password encryption system. Hashing a password a million times may be safer, but also slower. How to achieve a good balance between speed and safety? Also, I'd prefer the result to have a constant number of characters.   The hashing mechanism must be available in PHP It must be safe It can use salt (in this case, are all salts equally good? Is there any way to generate good salts?)   Also, should I store two fields in the database (one using MD5 and another one using SHA, for example)? Would it make it safer or unsafer?  In case I wasn't clear enough, I want to know which hashing function(s) to use and how to pick a good salt in order to have a safe and fast password protection mechanism.  Related questions that don't quite cover my question: What's the origin of referring to female superior officers as "sir"? It is well established in Star Trek: The Next Generation that female superior officers are normally referred to as sir.  This is applied to Dr. Crusher, Counselor Troi, Cmdr. Shelby, Maj. Kira, Lt. Dax, and numerous admirals.   This obviously fits in well with the egalitarian ideals of Star Trek. This convention is made explicit in &quot;Thine Own Self&quot;:  DATA: Counsellor, have you been promoted in my absence? TROI: That's right. Which means from now on you can call me sir. DATA: Yes, sir.  In Addition, the first episode of Star Trek: Voyager, &quot;Caretaker&quot; contains this dialog:  KIM: Thank you, sir. JANEWAY: Mister Kim, at ease before you sprain something. Ensign, despite Starfleet protocol, I don't like being addressed as sir. KIM: I'm sorry, ma'am. JANEWAY: Ma'am is acceptable in a crunch, but I prefer Captain. We're getting ready to leave. Let me show you to the bridge.  which again establishes that sir is the norm, although Capt. Janeway doesn't prefer it. Did this usage of the honorific sir start with ST: TNG or does it predate TNG in either sci-fi or the real world?  Related: NRPE unable to read output, but why? Baker-Hausdorff Lemma from Sakurai's book I'd like to show that, given to hermitian operators $A,G$ on a Hilbert space $\mathscr{H}$, the following identity holds: $$ e^{iG\lambda}A e^{-iG\lambda} = A + i\lambda [G,A] + \frac{\left(i\lambda\right)^2}{2!}[G,[G,A]]+\ldots+\frac{(i\lambda)^n}{n!}\underbrace{[G,[G,[G,\ldots[G}_{n\ times},A]]]\ldots]+\ldots $$ where $\lambda$ denotes a real parameter and $[\ \!,]$ indicates the commutator.  This is a proof left to the reader by Sakurai in his books on Modern Quantum Mechanics. Why is James Bond less tech savvy in the Daniel Craig movies? When you search on any of the SE network sites, with a tag (so that a description is shown); it shows the tag info content box, with the highlight-search-term span elements.  For eg. I searched ; ; and the results are as shown:                  Notice the &lt;span class='search-highlight'&gt; boxes around searched tag terms. The only solutions that I know of till now are $(x,y) = (1,1) \space , (19,7)$. We can note that: $$x^2-x+1 = y^3 \implies (2x-1)^2 = 4y^3-3$$ Thus, if odd prime $p \mid y$, then $(2x-1)^2 \equiv -3 \pmod{p}$ and thus, $-3$ is a quadratic residue. This implies that $p \equiv 1 \pmod{6}$ .  How can we further proceed into this problem?  Note: As mentioned in one of the links in the comments, if we instead replace $x$ by $x+1$, we get $x^2+x+1 = y^3$. Thus, the solutions for this is $(x,y) = (0,1) \space, (18,7)$. I wish to familiarize myself with the capabilities of QGIS up to and beyond QGIS version 3.0.   Can you recommend some good web resources and tutorials that would show me QGIS' capabilities?   I am interested in both using QGIS through its GUI and in developing applications using QGIS. How do I read the manifest file for a webapp running in apache tomcat? Prove existence of disjoint open sets containing disjoint closed sets in a topology induced by a metric. I don't want to use the Super for that, I want to use Alt+Space instead. Proving that the given set has at most $2^{n-1}$ elements