How to exchange words in emacs(by replace them with each other one)
How can I swap or replace multiple strings in code at the same time?
A certain element which makes functionals positive Suppose $X$ is a possibly non-separable Banach space and let $X^*$ be its dual. Also, let $(f_n)_{n=1}^\infty$ be a sequence of [EDIT: linearly independent] norm-one functionals in $X^*$. Does there exist an element $x\in X$ such that $f_n(x) \in (0,\infty)$ for all $n$? I am trying to pass a member function within a class to a function that takes a member function class pointer.  The problem I am having is that I am not sure how to properly do this within the class using the this pointer.  Does anyone have suggestions?  Here is a copy of the class that is passing the member function:  class testMenu : public MenuScreen{ public:  bool draw;  MenuButton&lt;testMenu&gt; x;  testMenu():MenuScreen("testMenu"){     x.SetButton(100,100,TEXT("buttonNormal.png"),TEXT("buttonHover.png"),TEXT("buttonPressed.png"),100,40,&amp;this-&gt;test2);      draw = false; }  void test2(){     draw = true; } };   The function x.SetButton(...) is contained in another class, where "object" is a template.  void SetButton(int xPos, int yPos, LPCWSTR normalFilePath, LPCWSTR hoverFilePath, LPCWSTR pressedFilePath, int Width, int Height, void (object::*ButtonFunc)()) {      BUTTON::SetButton(xPos, yPos, normalFilePath, hoverFilePath, pressedFilePath, Width, Height);      this-&gt;ButtonFunc = &amp;ButtonFunc; }   If anyone has any advice on how I can properly send this function so that I can use it later. Induction and electromagnetic fields I've got a few questions on induction and electromagnetic fields. My current understanding of induction and electromagnetic fields is that, when electricity/current flows through a wire, it creates an electromagnetic field. If you twist that wire into a coil then you can concentrate that field. You can then induce current into a different coil by placing it inside of the electromagnetic field created by the first coil.  So here are my questions:  Q1. Does the electromagnetic field contain any energy?  EDITED QUESTION  Q2. Electromagnetic fields are the same as waves, so does that mean that when current is induced, they get the energy from electromagnetic waves being exchanged, or do they induce current directly from the electromagnetic field?   Q3. If electromagnetic fields and waves are the same, then doesn't that mean that you can induce current from waves? Therefore transferring electricity over long distances?  Q4. What spectrum of light are the electromagnetic waves that are in a field created by electricity?  Q5. Finally, why is it not possible to induce current from the Earth's magnetic field? I thought Maxwell said that electric fields and magnetic fields were the same thing.   Thank you to anyone who answers.  Edited Q2: So my original question (although asked poorly) still stands. Where does the current that gets induced in the secondary coil come from? How does the electricity transfer from the primary coil to the secondary? For example, is it taken from the stored energy in the e.m field? Does the field just act as a bridge between the 2 coils? Or do the 2 coils exchange e.m waves which carry the electricity that is being transferred from coil 1 to coil 2? Or is it none of these things and something completely different? How can I stand on the ground? EM or/and Pauli? There is this famous example about the order difference between gravitational force and EM force. All the gravitational force of Earth is just countered by the electromagnetic force between the electrons on the surface of my feet and the ground.  But also wave-function of electrons(fermions) do not overlap each other due to Pauli exclusion principle.  So which one is the true reason of me not flopping inside the earth forever? Is it only one of them(my guess is Pauli exclusion) or is it both? What does string theory predict for the singularity inside a black hole? The usual explanation for what's going on inside a black hole goes something like "General Relativity predicts a singularity with infinite curvature, but when matters gets so tightly compressed we should expect quantum effects to become important, so the singularity will probably be blurred". Authors then proceed to say that we need a quantum theory of gravity to answer such things, and quickly abandon the subject.  Well, while we don't have an experimentally confirmed quantum theory of gravity, we do have a speculative one, string theory. What does it say about singularities? Are they smeared out like the books say? Do they remain points (or rings for a rotating black hole) with infinite curvature and density? Do we not know? I'm looking to implement a phase lock in an FPGA without using any external components (other than the ADC). For simplicity locking to a simple binary pulse is adequate. The frequency of the signals is ~0.1-1% of the clock. I can't use the onboard clock PLL's because they are typically:   Not configurable (set during synthesis). Jittery. Don't support the frequency I need.   I've been sorting through the literature and found a few binary phase locked loops. Most notable a "pulse steal" design that I can post a link to if desired. I have implemented and synthesized with some success, but its jitter and lock range was not as good as advertised. I've also had success using a external DVCO, but I would prefer if I can implement everything on chip.  A digital circuit design or even a hint in the right direction would be helpful (I've been banging my head against this for a while), a proven FPGA implementation would be wonderful but not expected.   ADDED 10-27-2010   The actual DPLL design that I used has a "Random Walk Filter" as the loop filter (not the "pulse steal" described earlier, going through my notes that didn't work to well), which then drives the clock pulses to the DCO. The lock-in range is set via divider in the DCO. The sensitivity of the loop is established by varying the length of the random walk.   The paper in which this is found is cited at the end of this post. After implementing parts of it myself, I found that it was actually already implemented on OpenCores, however it turns out that in the last few months the project was deleted but I have the Verilog files saved if anyone wants them.  Yamamoto, H.; Mori, S.; , "Performance of Binary Quantized All Digital Phase-Locked Loop with a New Class of Sequential Filter," Communications, IEEE Transactions on , vol.26, no.1, pp. 35- 45, Jan 1978  doi: 10.1109/TCOM.1978.1093972  URL: Let $x_1,x_2,\ldots,x_n$ be the roots for $1+x+x^2+\ldots+x^n=0$. Find the value of   $$P(1)=\frac{1}{x_1-1}+\frac{1}{x_2-1}+\ldots+\frac{1}{x_n-1}$$   Source: IME entrance exam (Military Institute of Engineering, Brazil), date not provided (possibly from the 1950s)  My attempt: Developing expression $P(1)$, replacing the 1 by $x$, follows $$P(x)=\frac{(x_2-x)\cdots (x_n-x)+\ldots+(x_1-x)\cdots (x_{n-1}-x)}{(x_1-x)(x_2-x)\cdots (x_n-x)}$$    As $x_1,x_2,\ldots,x_n$ are the roots, it must be true that   $$Q(x)=(x-x_1)\cdots(x-x_n)=1+x+x^2+\ldots+x^n$$ and  $$Q(1)=(1-x_1)\cdots(1-x_n)=n+1$$ Therefore the denominator of $P(1)$ is  $$(-1)^{n} (n+1).$$ But I could not find a way to simplify the numerator.  Another fact that is probably useful is that  $$1+x^{n+1}=(1-x)(x^n+x^{n-1}+\ldots+x+1)$$ with roots that are 1 in addition of the given roots $x_1,x_2,\ldots,x_n$ for the original equation, that is  $$x_k=\text{cis}(\frac{2k\pi}{n+1}),\ \ k=1,\ldots,n.$$  This is as far as I could go...    Hints and full answers are welcomed. Does a four-divergence extra term in a Lagrangian density matter to the field equations? Greiner in his book "Field Quantization" page 173, eq.(7.11) did this calculation:     ${\mathcal L}^\prime=-\frac{1}{2}\partial_\mu A_\nu\partial^\mu A^\nu+\frac{1}{2}\partial_\mu A_\nu\partial^\nu A^\mu-\frac{1}{2}\partial_\mu A^\mu\partial_\nu A^\nu $   $\space\space\space\space=-\frac{1}{2}\partial_\mu A_\nu\partial^\mu A^\nu+\frac{1}{2}\partial_\mu[A_\nu(\partial^\nu A^\mu)-(\partial_\nu A^\nu) A^\mu]$        The last term is a four-divergence which has no influence on the field equations. Thus the dynamics of the electromagnetic field (in the Lorentz gauge) can be described by the simple Lagrangian        ${\mathcal L}^{\prime\prime}=-\frac{1}{2}\partial_\mu A_\nu\partial^\mu A^\nu$     Yes, if it is a four-divergence of a vector whose 0-component doesn't contain time derivatives of the field, indeed according to the variational principle this four-divergence will not influence the field equation.  And actually I calculated the time-derivative dependence of 0-component of $[A_\nu(\partial^\nu A^\mu)-(\partial_\nu A^\nu) A^\mu]$, in which only $[A_0(\partial^0 A^0)-(\partial_0 A^0) A^0]$ could possibly contain time-derivative, which vanishes fortunately, so whatever the general case it doesn't matter in this present case.  But how can he seem to claim that it holds for a general four-divergence term,The last term is a four-divergence which has no influence on the field equations?  EDIT: I only assumed the boundary condition to be $A^\mu=0$ at spatial infinity, not at time infinity. And the variation of the action $S = \int_{t_1}^{t_2}L \, dt$ is due to the variation of fields which vanish at time, $\delta A^\mu(\mathbf x,t_1)=\delta A^\mu(\mathbf x,t_2)=0$, not having the knowledge of $\delta \dot A^\mu(\mathbf x,t_1)$ and $\delta \dot A^\mu(\mathbf x,t_2)$, which don't vanish generally, so the four-divergence term will in general contribute to the action, $$\delta S_j=\delta \int_{t_1}^{t_2}dt\int d^3\mathbf x \partial_\mu j(A(x),\nabla A(x),\dot A(x))^\mu =\delta \int_{t_1}^{t_2}dt\int d^3\mathbf x \dot j^0 =\int d^3\mathbf x [\delta j(\mathbf x, t_2)^0-\delta j(\mathbf x, t_1)^0]$$ which does not vanish in general! I am searching for [free] software that can produce nice looking graphical models, e.g.     Any suggestions would be appreciated. Gravatar links on "Filtered Questions" page are not HTTPS Referencing equation counter value in custom float caption I have used the float package to create an equation float, eqfloat, so I can add captions to equations. Within the eqfloat I used the equation environment to typeset the math.  I want to keep the right hand arabic numbering within parentheses that is added by the equation environment but I also would like the eqfloat caption below the equation to use the same number as the equation environment.  The following code achieves this by making the eqfloat use the same counter as the equation environment and then manually adjusting the equation numbering within each eqfloat.   Is there a better way to make the eqfloat caption reference the current value of the equation environment counter?  Is it possible to prevent the custom float environment from increasing the counter and only to reference the current value of the equation counter?  \documentclass[a4paper]{article}  \usepackage[margin=25pt, labelfont=bf]{caption} \usepackage{amsmath, amsfonts, pifont, float, color, url} \usepackage[pdftex, plainpages=false, pdfpagelabels, bookmarks=true]{hyperref}  \newfloat{eqfloat}{h}{eqflts} \floatname{eqfloat}{Equation} \makeatletter \let\c@eqfloat\c@equation \makeatother  \begin{document}     ...     \begin{eqfloat}         \begin{equation}             E = mc^2         \end{equation}         \addtocounter{equation}{-1}         \caption{Equation caption here.}         \label{eq:example}     \end{eqfloat}  \end{document} Export Track Markers to csv I am trying to export markers from the Blender motion tracker and found the following script that will do exactly that:  for clip in D.movieclips:     for track in clip.tracking.tracks:         fn = 'data/tr_{0}_{1}.csv'.format(clip.name.split('.')[0], track.name)         with open(fn, 'w') as f:             frameno = 0             while True:                 markerAtFrame = track.markers.find_frame(frameno)                 if not markerAtFrame:                     break                 frameno += 1                 coords = markerAtFrame.co.xy                 f.write('{0} {1}\n'.format(coords[0], coords[1]))   It works but I have two questions:   How can I save the data on my Desktop rather than in folder in MacOS blender content where it saved right now. The following won't work:   fn = '/User/me/Desktop/data/tr_{0}_{1}.csv'.format(clip.name.split('.')[0], track.name) The resulting values I get do not represent the more user friendly marker values in den Blender GUI. Instead of x/y coordinates in screen coordinates, I get a value between 0/1. How can I convert them to those screen coordinates ?    Thanks for your help Android: Overlay on Android Camera Preview Passing list to viewparams variables in GeoServer SQL views? I just can't seem to figure this one out.  I want to use the command line to connect to a MySQL database residing on another server.  I went ahead and created the username and password for the user.  I have also granted all privileges on that user for that database.  When using the command: mysql -h &lt;hostname&gt; -u &lt;username&gt; -p, I get the following error:  ERROR 1045 (28000): Access denied for user '&lt;username&gt;'@'&lt;local_machine_hostname&gt;' (using password: YES)   The problem is that it keeps appending the current machine's hostname into the username.  Obviously, that user@&lt;local_machine_hostname&gt; is not correct.  It doesn't matter what I type.  For instance, if I type:  mysql -h &lt;hostname&gt; -u '&lt;username&gt;'@'&lt;hostname&gt;' -p   It does the same, only in the error output, it says:  Access denied for user '&lt;username&gt;@&lt;hostname&gt;'@'&lt;local_machine_hostname&gt;'   Is there a setting in a configuration file which is allowing this to happen?  It's really quite annoying.  I need to set up a tikiwiki server, and it cannot connect because during the step where you set up mysql, it keeps appending the local machine's hostname to the mysql login name. Electromagnetic wave properties of light vs radio waves I'm trying to determine if there is a best practice for typesetting the "evaluated at" bar for derivatives. The three possibilities I'm thinking of are shown in the code excerpt below:  \begin{gather*} 5 + \frac{df}{dt} \Bigr\rvert_{t = 0} \\ 5 + \frac{df}{dt} \biggr\rvert_{t = 0} \\ 5 + \left. \frac{df}{dt} \right\rvert_{t = 0} \\ \end{gather*}     The \Bigr option doesn't quite reach the top and bottom of the fraction. The \biggr option overshoots the top and bottom of the fraction by a little bit. And the \left...\right option has the same height as the \biggr option, but it introduces a little extra space between the + and the fraction. I'm having trouble deciding between these options. Is there a best practice for typesetting this? LibreOffice toolbar icons went blank after application hanged Cannot login to chat.meta.stackexchange.com; server error when trying to access chat homepage I just recreated my MSE account after having deleted it a few years ago. Now, I'm trying to log in to Meta Stack Exchange Chat, and whenever I try to do so, it just fails silently and I'm still logged out.  Additionally, in the same browser session that I'm supposedly logged out, I get a server error when accessing the chat homepage or the chat profile page of any user. I don't get any errors when trying to access any of these pages in a private session. I also was able to sign in to Stack Exchange Chat and Stack Overflow Chat without problems, since my accounts on SO and my parent site for SE chat haven't been deleted.  I think it might be because it's trying to sign me in to my old chat profile, which was not deleted, but that is associated to my old, deleted site account, which clash and thus cause it to fail. But when I try to run it using  tar zxvf jre-8u151-linux-i586   I get tar (child): jre-8u151-linux-i586: Cannot open: No such file or directory tar (child): Error is not recoverable: exiting now tar: Child returned status 2  What is wrong? The name and place matches prefectly.