Suppose file stores the pathname of a non-dir file.  How can I get its parent directory?  why does the following way by appending /.. to its value not work  $ cd $file/..    cd: ./Tools/build.bat/..: No such file or directory   Thanks.
I can type:  dirname ~/home/blah/file.zip   for instance, and this works fine alone, but when I use this syntax as the parameter for some command it always reads 'dirname' as the desired directory. i.e.:  cd dirname ~/home/blah/file.zip bash: cd: dirname: No such file or directory   Basically, how do I get 'dirname file' to be read as one entity?
Let $(x_n)_{n\in \mathbb{N}}$ be a sequence of real numbers. A well known result is:     The sequence $(x_n)_{n\in \mathbb{N}}$ converges to $a\in \mathbb{R}$ if and only if every subsequence $(x_{n_k})_{k\in \mathbb{N}}$ converges to $a\in \mathbb{R}$.   Now, I'm working on an exercise which essentialy asks to prove the following:     The sequence $(x_n)_{n\in \mathbb{N}}$ converges to $a\in \mathbb{R}$ if and only if for every subsequence $(x_{n_k})_{k\in \mathbb{N}}$ there is a (sub)subsequence $(x_{n_{k_j}})_{j\in \mathbb{N}}$ which converges to $a$.   Now, one direction is trivial. If in fact $(x_n)_{n\in \mathbb{N}}$ converges to $a$, then by the result I've mentioned, every subsequence of $(x_{n})_{n\in \mathbb{N}}$ converges to $a$. Let then $(x_{n_k})_{k\in \mathbb{N}}$ be an arbitrary subsequence. In that case, we know that it is a subsequence of itself, and hence we've found a (sub)subsequence which converges to $a$.  The other way around seems quite complicated for me. The reason is as follows: I must assume that every subsequence $(x_{n_k})_{k\in \mathbb{N}}$ has a (sub)subsequence which converges to $a$ and the proof that the original one converges to $a$.  My problem is exactly that "a". If it had all (sub)subsequences converging to $a$, then by the result i've mentionted, the subsequence $(x_{n_k})_{k\in \mathbb{N}}$ would converge to $a$. In that case, we would have every subsequence converging to $a$ and the result would follow.  My idea to prove the claim was then:  First remember that a subsequence is the restriction of the original one $x: \mathbb{N}\to \mathbb{R}$ to an infinite subset $\mathbb{N}'\subset \mathbb{N}$. In that case a (sub)subsequence is the restriction of $\tilde{x} = x|\mathbb{N}'$ to an infinite subset $\mathbb{N}''\subset \mathbb{N}$. But since $\tilde{x}$ is the restriction of $x$ to $\mathbb{N}'$ and since $\mathbb{N}''\subset \mathbb{N}'$, the restriction of $\tilde{x}$ to $\mathbb{N}''$ is itself the restriction of $x$ to $\mathbb{N}''$.  In other words, every (sub)subsequence can be viewed as a subsequence of the original one. Considering this, by hypothesis every subsequence has a (sub)subsequence which converges to $a$. But by this argument, this means that we can replace every subsequence with a convergent one. And then we can use the result I stated.  Is my idea correct? Is this really the way to prove the claim? My only doubt is that I need every subsequence converging to $a$ to use the result. In this case I can't see how I can argue that this implies every subsequence converges to $a$.  How can I finish this proof? I wonder whether it is possible to draw the three following quadric surfaces (cone, hyperboloids)  x^2+y^2-z^2=0  x^2+y^2-z^2=1  x^2+y^2-z^2=-1  (and the axis)   using pgfplots 3d or TikZ as it is done in the following image Can a concentration spell be cast without actually concentrating on it for an "instant" effect? The book says:     Concentration. Some spells require you to maintain concentration in order to keep   their magic active. If you lose concentration, such a spell ends.   So what happens if, for example, you are already concentrating on a spell, and cast Witch Bolt without concentrating. Would you get the initial arc of blue energy, or would it not even go off?  I am asking if you can cast a spell that says concentration without concentrating for an immediate effect. This would be useful to avoid interrupting your existing concentration. In essence, if you are concentrating on thing A (doesn't have to be a spell since other things need concentration), can you cast a concentration spell getting an immediate effect without losing concentration on thing A?  Since the definition of concentration is to keep the spell active (meaning it is already active) I would think that you would get the initial effect (if it had one) without the need to concentrate on it. What canonical momenta are the "right" ones? I'm doing some classical field theory exercises with the Lagrangian $$\mathscr{L} = -\frac{1}{4}F_{\mu \nu}F^{\mu \nu}$$ where $F_{\mu \nu} = \partial_\mu A_\nu - \partial_\nu A_\mu$. To find the conjugate momenta $\pi^\mu_{\ \ \ \nu} = \partial \mathscr{L} / \partial(\partial_\mu A^\nu)$, I can use two methods.  First method: directly apply this to $\mathscr{L}$. We get a a factor of $2$ since there are two $F$'s, and another factor of $2$ since each $F$ contains two $\partial_\mu A_\nu$ terms, giving $$\pi^\mu_{\ \ \ \nu} = -F^\mu_{\ \ \ \nu}.$$  Second method: get $\mathscr{L}$ in terms of $A$ by expanding and integrating by parts, yielding $$\mathscr{L} = \frac{1}{2}(\partial_\mu A^\mu)^2 - \frac{1}{2}(\partial_\mu A^\nu)^2.$$ Differentiating this gets factors of $2$ and gives $$\pi^\mu_{\ \ \ \nu} = \partial_\rho A^\rho \delta^\mu_\nu - \partial^\mu A_\nu.$$  These two answers are different! (They do give the same equations of motion, at least.) I guess that means doing the integration by parts changed the canonical momenta.  Is this something I should be worried about? In particular, I have another exercise that wants me to show that one of the canonical momenta vanishes -- this isn't true for the ones I get from the second method! Plus, my stress-energy tensor is changed too. When a problem asks for "the" canonical momenta, am I forbidden from integrating by parts? Why does $a^n - b^n$ never divide $a^n + b^n$? Help with footer always to bottom How to compare the strings using < (Greater than symbol) Below is my input file:  PA43410-2,1,3,/vobs/atlas-idc/src/utils/logger/IDCLogger/IDC.cpp,48,19:16:46.523.177, 2 PS Sensor Value = -5.501000 , Min = -5.583000 , Max = -5.319000 PA43410-2,1,3,/vobs/atlas-idc/src/utils/logger/IDCLogger/IDC.cpp,48,19:16:46.523.210, 3 PS Sensor Value = 15.996000 , Min = 15.814000 , Max = 16.078000 PA43410-2,1,3,/vobs/atlas-idc/src/utils/logger/IDCLogger/IDC.cpp,48,19:16:46.523.231, 4 PS Sensor Value = -16.505000 , Min = -16.587000 , Max = -16.323000 PA43410-2,1,3,/vobs/atlas-idc/src/utils/logger/IDCLogger/IDC.cpp,48,19:16:46.523.263, 5 PS Sensor Value = 6.509000 , Min = 6.327000 , Max = 6.591000 PA43410-2,1,3,/vobs/atlas-idc/src/utils/logger/IDCLogger/IDC.cpp,48,19:16:46.523.302, 6 PS Sensor Value = 4.002000 , Min = 3.820000 , Max = 4.084000 PA43410-2,1,3,/vobs/atlas-idc/src/utils/logger/IDCLogger/IDC.cpp,48,19:17:46.481.557, 1 PS Sensor Value = 6.199000 , Min = 6.017000 , Max = 6.281000 PA43410-2,1,3,/vobs/atlas-idc/src/utils/logger/IDCLogger/IDC.cpp,48,19:17:46.518.691, 2 PS Sensor Value = -5.503000 , Min = -5.585000 , Max = -5.321000 PA43410-2,1,3,/vobs/atlas-idc/src/utils/logger/IDCLogger/IDC.cpp,48,19:17:46.523.156, 3 PS Sensor Value = 15.996000 , Min = 15.814000 , Max = 16.078000 PA43410-2,1,3,/vobs/atlas-idc/src/utils/logger/IDCLogger/IDC.cpp,48,19:17:46.523.195, 4 PS Sensor Value = -16.505000 , Min = -16.587000 , Max = -16.323000 PA43410-2,1,3,/vobs/atlas-idc/src/utils/logger/IDCLogger/IDC.cpp,48,19:17:46.523.221, 5 PS Sensor Value = 6.509000 , Min = 6.327000 , Max = 6.591000 PA43410-2,1,3,/vobs/atlas-idc/src/utils/logger/IDCLogger/IDC.cpp,48,19:17:46.523.240, 6 PS Sensor Value = 4.002000 , Min = 3.820000 , Max = 4.084000 PA43410-2,1,3,/vobs/atlas-idc/src/utils/logger/IDCLogger/IDC.cpp,48,19:18:46.480.644, 1 PS Sensor Value = 6.199000 , Min = 6.017000 , Max = 6.281000 PA43410-2,1,3,/vobs/atlas-idc/src/utils/logger/IDCLogger/IDC.cpp,48,19:18:46.522.615, 2 PS Sensor Value = -5.501000 , Min = -5.583000 , Max = -5.319000 PA43410-2,1,3,/vobs/atlas-idc/src/utils/logger/IDCLogger/IDC.cpp,48,19:18:46.522.729, 3 PS Sensor Value = 15.996000 , Min = 15.814000 , Max = 16.078000 PA43410-2,1,3,/vobs/atlas-idc/src/utils/logger/IDCLogger/IDC.cpp,48,19:18:46.522.765, 4 PS Sensor Value = -16.505000 , Min = -16.587000 , Max = -16.323000 PA43410-2,1,3,/vobs/atlas-idc/src/utils/logger/IDCLogger/IDC.cpp,48,19:18:46.522.788, 5 PS Sensor Value = 6.509000 , Min = 6.327000 , Max = 6.591000 PA43410-2,1,3,/vobs/atlas-idc/src/utils/logger/IDCLogger/IDC.cpp,48,19:18:46.522.810, 6 PS Sensor Value = 4.002000 , Min = 3.820000 , Max = 4.084000   I need to compare the PS Sensor Value, Min and Max value. (Min greater than PS Sensor greater than Max)   I'm expecting the output like below and here I should have only the normal lines.  What is normal lines? :  If Min value greater than PS Sensor value &amp;&amp; PS Sensor value  is greater than Max value then the line is normal lines and that should removed.        Expected Output:                                                                                                                                    PA43410-2  PS Sensor Value = 6.509000 , Min = 6.327000 , Max = 6.591000 PA43410-2 PS Sensor Value = 6.199000 , Min = 6.017000 , Max = 6.281000  Eg:     If   Min &lt; PS sensor value &lt; Max,    // Don’t care the normal  lines.          Throw this line away.    Else           Pull this line to consolidated new file. //Only focus on abnormal lines. Finding the dual basis for the space of polynomials of degree $\leq$ 2 Let $V$ be the space of polynomials of degree at most $2$, with basis $\{1,x,x^2 \}$.Find the dual basis to $\{1,x,x^2\}$.   I know that the dual basis of $\{f_1,f_2,f_3\}$ is the basis $\{f_1^*,f_2^*,f_3^*\}$ where $f_i^*(a_1f_1,\ldots,a_3f_3)$ but I'm not sure how to actually compute the dual basis. Possible Beamer bug: Frame number has different color than date in infolines footer Is it possible to downgrade an OEM Windows 8 install to Windows 7? I recently purchased an ASUS K55A. Like all Windows 8 machines, it come with a UEFI feature called Secure Boot. This basically makes sure that the laptop won't load anything other than the Windows 8 OEM version that came with it.  However the Asus UEFI allows for me to disable Secure Boot, and therefore I should be able to revert to Windows 7, Linux, etc. (drivers may or may not be supported). When I insert my Linux Mint boot disc and try to boot from it, though, nothing happens. There isn't even a boot priority list in the UEFI settings (I can provide screenshots later). It just says "Windows 8 Bootloader" and also on the other tab it says "WINDOWS 8 BOOT OVERRIDE".  Has anybody purchased a Windows 8 machine and successfully installed Windows 7 or Linux on it? The Android OS monitors the power consumption of running apps and hardware (display). As you may guess, this is a useful feature as it allows to track down energy greedy apps.  Is there an application that would do such monitoring on Mac OS?  It should calculate the percentages of the charge that an application/process/hardware has used.  I use plenty of little software that runs in the background permanently. It would be nice to know if such little helpers drain the battery significantly. Why does space expansion not expand matter? HTML 5 Video stretch Duality discrete math problem This is the only answer I got wrong on my HW and the prof does not want to give us the correct answers before our midterm     The dual of a compound proposition that contains only the logical operators $\lor$ , $\land$ , and   $\neg$ is the compound proposition obtained by replacing each $\lor$ by $\land$ , each $\land$ by $\lor$ , each $\def\T{{\rm T}}\def\F{{\rm F}}$   $\T$ by $\F$ , and each $\F$ by $\T$ . The dual of $s$ is denoted by $s^*$. Find the dual of these compound propositions.      a) $p \lor\neg q$     I got $\neg p \land q$       b) $p \land (q \lor (r \land \T))$     My answer was $\neg p \lor (\neg q \land r)$       c) $(p \land \neg q) \lor (q \land \F)$     My answer was $(\neg p \lor q) \land  \neg q$  I have tried googling the problem and cannot come up with anything on duals and our lectures are online and upon reviewing do not see anything. I am just confused and looking for a little guidance on what was incorrect with my answers. What is $\sqrt{i}$? If $i=\sqrt{-1}$, is $\large\sqrt{i}$ imaginary?     Is it used or considered often in mathematics? How is it notated? It is written everywhere that gravity is curvature of spacetime caused by the mass of the objects or something to the same effect. This raises a question with me: why isn't spacetime curved due to other forces or aspects of bodies?  Why isn't it that there are curvatures related to the charge of a body or the spin of particles or any other characteristics? LED light fixture glows when not turned on This past week at Menards I bought 2 Smart Electrician® 3650 Lumens 46" LED Linkable Shop Light Model Number: 0053-0011  |  Menards® SKU: 3481400.  The LED shop light fixture has a glow to it. Looked like the LEDs were turned on, but not all the way. The power switch is turned off. Don’t know why I did this but I took one of those three prong adaptors converters to two prong and to my surprise the light fixture didn’t light up. I unplug the cord with the adaptor and turned it around and it still didn’t light up. The power supply electronics inside the light fixture must be using the earth ground wire somehow. Using my volt meter. I measured to earth ground to the green wire that comes out of the adaptor and to my surprise depending how I plug in the adaptor. I’m getting 112 volts AC. That's because the adaptor isn't keyed and I'm switching the HOT and NEUTRAL around depending how I  plug it in.  I connected the LED light fixture to “Safety Analyzer tester”. When I press the “Open Ground” button, the fixture stops glowing (lightly lite LED’s).  Looks like the power supply circuit inside the fixture has a connection to “Earth Ground”.  I then switched the “Normal” on the polarity switch to “Reverse” and the LED’s were off. Switching the Neutral to open position has no effect. I'm thinking of taking them apart and see inside what's going on or take them back.  I figured out the problem.    In this light fixture you can clearly see the white wire (neutral/common) is connected to the light switch, turning the power off the LED light strip. Commonly we switch off the “HOT” to your light socket so when you change your bulb you have a less of a chance of getting electrocuted (that’s another story for later). Sometimes in Power supply circuits they place capacitors in there to help filter electrical noise out. Also known as suppressers (electronics to reduce unwanted noise or oscillation in a circuit or unwanted frequencies in a signal). Depending on how or where they are placed in the circuit it could possible cause some issue if not installed correctly or if the circuit isn’t designed correctly.   Since the BLACK live wire is connected to the LED PCB all the time, anything connected to that line will potentially be LIVE voltage, that way when I disconnected the earth ground from the socket and measured 112 volts on it. My guess is they have capacitors connected to both LIVE and NEUTRAL to the earth ground wire.  The current is flowing through capacitor C2, just enough to turn the LED’s on slightly. If the switch was on the hot side, this problem wouldn’t be happening. I still may use them just not connect the “earth ground” wire. Because that’s providing the return path for lighting the LED’s. How to stop creating .DS_Store on Mac? Enabling GPU rendering for Cycles? I want to enable GPU rendering, but there is no option in User Preferences > System:    Why is this? How can I get cycles to render using my GPU? How to decide whether to replace or repair?