When I run a perl script  in bash, I want to set the value of a variable TEXMFVAR needed by the  script, and pass it to the script.  I googled around, and thought  I found a solution:  $ TEXMFVAR=/usr/local/texlive/2014/texmf-var sudo /usr/local/texlive/2014/texmf-dist/scripts/pax/pdfannotextractor.pl --install   But it seems TEXMFVAR is still empty in the script, because it creates a directory $TEXMFVAR under my current dir. I am puzzled.   $ ls \$TEXMFVAR/* $TEXMFVAR/ls-R  $TEXMFVAR/scripts: pax   Do I need to export the variable?  Is this a problem of usage of environment variables?  Note: My original problem is about texlive  and here
Is this a correct way for passing an environment variable in sudo ?  sudo -u www-data -b env FOOBAR="foobar" /home/user/folder/daemon
Best way to compare 2 XML documents in Java I'm trying to write an automated test of an application that basically translates a custom message format into an XML message and sends it out the other end.  I've got a good set of input/output message pairs so all I need to do is send the input messages in and listen for the XML message to come out the other end.  When it comes time to compare the actual output to the expected output I'm running into some problems.  My first thought was just to do string comparisons on the expected and actual messages.  This doens't work very well because the example data we have isn't always formatted consistently and there are often times different aliases used for the XML namespace (and sometimes namespaces aren't used at all.)  I know I can parse both strings and then walk through each element and compare them myself and this wouldn't be too difficult to do, but I get the feeling there's a better way or a library I could leverage.   So, boiled down, the question is:  Given two Java Strings which both contain valid XML how would you go about determining if they are semantically equivalent?  Bonus points if you have a way to determine what the differences are. Why did I receive a message saying I have been granted a privilege, yet I don't have enough reputation? The site shown a message saying I have been granted a privilege, but the reputation required for that privilege is higher than the one I actually have. What happened? How to determine whether a given Linux is 32 bit or 64 bit? When I type uname -a, it gives the following output.  Linux mars 2.6.9-67.0.15.ELsmp #1 SMP Tue Apr 22 13:50:33 EDT 2008 i686 i686 i386 GNU/Linux   How can I know from this that the given OS is 32 or 64 bit?  This is useful when writing configure scripts, for example: what architecture am I building for? Removing OS from Dual Boot computer, and recovering HD space. Really stuck with this, \begin{cases}  2tx'(t)-1=x^2t \\  x(t=1)=1 \\  \end{cases} I don't understand the variables. What does it mean that $x$ differentiated have $t$ as a function value, like this: $x'(t)$? Don't get it :( Simulate Multiple Monitors I'm trying to find out if there is a product out there to simulate Multiple Monitors on one large monitor/tv?  So take a screen and turn it into something like below...  -------------------------------- |               |              | |               |              | |               |              | |               |              | -------------------------------- |               |              | |               |              | |               |              | |               |              | --------------------------------   Something like this...even though in reality it's a single screen.  A software solution is perfectly fine as long as it functions like the built in Windows 8 functionality (Start screen only consumes the screen it was started on/etc).  If anyone is curious as to the reason.  I'm looking to get a treadmill desk since I'm a developer and don't like being sedentary all day.  So the two options that I see are having 4 monitors and mirroring them (I don't want to have to worry about forgetting to move the window that I need) or getting a large monitor/tv and putting it on an arm that I can simply swivel into place.  There are dual-monitor swivel mounts, but they are EXTREMELY pricey and the ones I've found don't appear to have the range of motion that I'm anticipating needing.  EDIT:  I found ... but I can't find the answer to the start menu question (I've sent the company a message on facebook).  Hoping I hear good news as this appears to offer many of the features I'm wanting.  So Fingers crossed there. How can I prove that $n^7 - n$ is divisible by $42$ for any integer $n$? I can see that this works for any integer $n$, but I can't figure out why this works, or why the number $42$ has this property. I am trying to make a floor plan for my office, have managed to make all of the rectangular components (e.g. the rooms) however some of the desk layouts are circular and I haven't been able to work out how to make exact and measured circles. They need to have a radius of 1.45m. Can "who" as a relative pronoun sometimes be omitted? How do we perform transverse measurements in a two level system? In quantum mechanics any two level system can be mapped onto effective spin variables. If the system is defined by two energy levels, $|E_1\rangle$ and $|E_2\rangle$, the Hamiltonian is  $$ H = \left(\begin{array}{cc} E_1 &amp; 0 \\ 0 &amp; E_2 \end{array}\right) \, .$$  This can be recast as  $$ H = \frac{E_1+E_2}{2} 1\!\!1 + \frac{E_1-E_2}{2} \sigma_3\, .$$  $1\!\!1$ is the identity operator and $\sigma_3$ is the third pauli matrix. This is very nice because we can now apply our knowledge and intuition of spin dynamics to any two level system.  My question is the following: for a real spin I can measure expectation values of $\sigma_{1,2}$ by physically rotating my system and align its $x$ or $y$ axis with my measuring apparatus. How do I do this (in the lab!) with a pseudo-spin system? Imagine I am looking at a cold atom and I want to know if the system is in an symmetric or anti-symmetric superposition of $|E_1\rangle$ and $|E_2\rangle$, how do I do it? Delete all lines in Notepad++ except lines containing a word I need? Why is inductance (L) proportional with turns-square (N²)? We start from the   $$ \mathbf{\nabla} \times \mathbf{B} = \mu \mathbf{J} + \overbrace{\mu \epsilon \dfrac{\partial \mathbf{E}}{\partial t}}^0. $$  We take surface integration of both sides, for the surface (\$s\$) inside the mean path (\$c\$) of the core.  $$ \int_s \left( \mathbf{\nabla} \times \mathbf{B} \right) \cdot d\mathbf{s} = \mu \int_s \mathbf{J} \cdot d\mathbf{s} $$  We use the  to rewrite the left hand side; where \$c\$ is in the same direction with the magnetic flux \$\Phi\$.  $$ \oint_c \mathbf{B} \cdot d \mathbf{\ell} = \mu N I $$  (The integral on the left hand side results \$NI\$, because there are \$N\$ different wires on the winding.)  The magnetic field density inside these kind of cores are considered to be uniform. So, we can write  $$ B \ell_c \overset\sim= \mu NI \implies B = \dfrac{\mu NI}{\ell_c}; $$  where \$\ell_c\$ is the mean path lenght of the core.  We can find magnetic flux from the magnetic flux density we have found by using the cross sectional area of the core \$A_c\$.  $$ \Phi = BA_c = \dfrac{\mu NIA_c}{\ell_c} $$  By definition, inductance is the amount of magnetic flux generated per applied current, that is  $$ L \overset\triangle= \dfrac{\Phi}{I}. $$  So, we find inductance of the system as  $$ \boxed{ L = \dfrac{\Phi}{I} = \dfrac{\dfrac{\mu NIA_c}{\ell_c}}{I} = \dfrac{\mu NA_c}{\ell_c} }. $$  But, all other sources () give inductance of an inductor like this as  $$ L = \dfrac{\mu N^2A_c}{\ell_c}. $$  What is the mistake I did in my derivation? Please explain in detail. Best way to recover mysql from a "chmod -R 777 /" with databases intact Weird Integer boxing in Java proper usage of didn't had or didnt have What is the difference between an "API," a "framework," an "IDE," and an "engine?" I am just starting out trying to learn to develop games. At first I thought C++ and OpenGL were the tools a beginner would start out to make a game, but quickly found out the OpenGL was just a API for graphics. Then I thought C++ and SFML were what I needed to learn to make a game, but found out the SFML was a media framework that could be used to make games but wasn't a game engine.  I don't want to use a software that does all the work for me, I want to code my own game, the way a game programmer would. I don't understand the difference between a IDE, framework, API, and a engine; What separates them from each other? Do some game programmers use the SFML framework, while other programmers use a game engine? Why have header files and .cpp files? I have a range and need to sum it using SUM function but the result is N/A if there is any N/A value. How can I make the SUM function to treat the N/A value as 0 value?  Please help! Is rejecting the hypothesis using p-value equivalent to hypothesis not belonging to the confidence interval? While formally deriving the confidence interval of an estimate, I ended up with a formula that resembles very closely the way $p$-value is computed.  Thus the question: are they formally equivalent? I.e. is rejecting an hypotheses $H_0 = 0$ with a critical value $\alpha$ equivalent to $0$ not belonging to the confidence interval with critical value $\alpha$? Why does a cork float to the side of a glass? Why does a cork ball float to the side of a glass as illustrated in the following GIF? What is the physical phenomenon behind this observation and why does it happen?