I'm trying to run through a for loop, but looking at the indices, rather than the values of the list. My list looks like this:  ubermin_values = [8350.1416, 13167.329, 29200.063, 19283.514, 23596.0309...]   and it has a total of 100 values (but this changes with each run of the program). I'm trying to keep track of which value in minimum_pixels each value in ubermin_values came from, for plotting. If I use this loop in my code,  ubermin_vals_x = [] for i in ubermin_values:     value = ubermin_pixels[i]     ubermin_vals_x.append(minimum_pixels[i])   it tries to iterate over the values (8350.1416, 13167.329...) but of course this can't be done. I think my scheme should work if I can iterate over the indices of ubermin_values, rather than the values, but I can't see how to do that.  If it helps, here's how the first values should be mapped:   so that I can plot the points (4, 8350.1416), (10, 13167.329), (7, 29200.063), etc.  The numpy docs list  for iterating over arrays. Am I on the right track with this, or is there a better way to do it?
How do I access the index in a for loop like the following?  ints = [8, 23, 45, 12, 78] for i in ints:     print('item #{} = {}'.format(???, i))   I want to get this output:  item #1 = 8 item #2 = 23 item #3 = 45 item #4 = 12 item #5 = 78   When I loop through it using a for loop, how do I access the loop index, from 1 to 5 in this case?
Counting the number of propagating degrees of freedom in Lorenz Gauge Electrodynamics How do I definitively show that there are only two propagating degrees of freedom in the Lorenz Gauge $\partial_\mu A^\mu=0$ in classical electrodynamics.  I need an clear argument that   involves the equations of motion for just the potentials $A^0$ and $\mathbf{A}$, and not the electric and magnetic fields.   includes sources $\rho$ and $\mathbf{J}$ in the equations of motion.  This is to justify the assertion that there are degrees of freedom that decouple from the rest of system. does not critically rely on quantum field theoretic arguments (although any supplementary remarks are welcome).     To illustrate the level of clarity I expect, I provide an argument in the Coulomb gauge $\nabla\cdot \mathbf{A} = 0$:  Of the four field degrees of freedom, the gauge condition $\nabla\cdot \mathbf{A} = 0$ removes one degree of freedom (the longitudinally polarized EM waves).  To show that among the remaining three degrees of freedom only two are propagating, consider the field equations of motion in the Coulomb gauge:  \begin{align} \nabla^2 A^0 &amp;= -\rho/\epsilon_0,\\ \big[\frac{1}{c^2}\frac{\partial^2}{\partial t^2}-\nabla^2\big]\mathbf{A}&amp;= \mu_0 \mathbf{J}-\nabla \frac{1}{c^2}\frac{\partial}{\partial t}A^0. \end{align}  The first equation is NOT a wave equation for $A^0$, and thus does not propagate.  The final equation IS a wave equation, and describes the propagation of two degrees of freedom (Gauss' law in first eq. can be solved, and then inserted into the second equation to show that $\mathbf{A}$ only couples to the Solenoidal part of the current). How to export debug logs? I spend my days waiting on the Force.com Console and it makes me crazy, I have a pretty nice machine and it still chokes on the details sometimes.  Anyways, I saw  had given a  and is presenting again this year Dreamforce '12.  However, it seems like they're presentation is targeted at using their product, or for that matter others like it (, ) on Heroku, and not really targeting APEX/VisualForce development!  Is this the case? Are there any better solutions out there for reviewing logs?  Are there any APIs that allow you to export your debug logs out of SFDC programatically? Or has anyone even tried to tackle this? At one point, I decided to make friends with the low-lying spectrum of QCD. By this I do not mean the symmetry numbers (the "quark content"), but the actual dynamics, some insight.  The pions are the sloshing of the up-down condensate, and the other pseudoscalars by extending to strangeness. Their couplings are by soft-particle theorems. The eta-prime is their frustrated friend, weighed down by the instanton fluid. The rho and omega are the gauge fields for flavor SU(2), and A1(1260) gauges the axial SU(2), and they have KaluzaKlein-like echoes at higher energies, these can decay into the appropriate "charged" hadrons with couplings that depend on the flavor symmetry multiplet. The proton and the neutron are the topological defects. That accounts for everything up to 1300 but a few scalars and the b1.  There are scalars starting at around 1300 MeV which are probably some combination of glue-condensate sloshing around and quark-condensate sloshing around, some kind of sound in the vacuum glue. Their mass is large, their lifetime is not that big, they have sharp decay properties.  On the other hand, there is nothing in AdS/QCD which should correspond to the sigma/f0(600), or (what seems to be) its strange counterpart f0(980). While looking around, I found this discussion: . The literature that it pointed to suggests that the sigma is a very unstable bound state of pions (or, if you like, tetraquarks).   gives strong evidence for an actual pole;  gives a more cursory review. The location of the pole is far away from the real axis, the width is larger than the mass by 20% or so, and the mass is about 400MeV. The authors though are confident that it is real because they tell me that the interpolation the interactions of pions is safe in this region because their goldstone properties dominate the interactions. I want to believe it, but how can you be sure?  I know this particle was controversial. I want to understand what kind of picture this is giving. The dispersion subtraction process is hard for me to visualize in terms of effective fields, and the result is saying that there is an unstable bound state.  Is there a physical picture of the sigma which is more field theoretical, perhaps even just an effective potential for pions? Did anyone who convinced himself of the reality of the sigma have a way of understanding the bound state properties? Is there an analog unstable bound state for other goldstone bosons? Any insight would be welcome. \xymatrix undefined Inner product of two continuous maps is continuous Let f,g be continuous maps of S in $\mathbb{R}^n$, to $\mathbb{R}^m$. Show the inner product h(x) = $\langle f(x), g(x)\rangle$ is continuous.  My attempt: Since f,g are continuous, their product is a continuous mapping, so for $\epsilon \gt 0\: t.e\:  \delta \gt 0$ such that $\parallel x - a\parallel \lt \delta $ implies $\parallel \langle f(x),g(x)\rangle - \langle f(a)g(a)\rangle \parallel \le\parallel f(x)g(x) - f(a)g(a)\parallel \lt \epsilon$ by schwartz inequality. Can I use a USB stick for a normal install? (to get platform adaptability) So I know I can make a persistent LiveUSB whereby there would be anywhere up to 4GB (I think that's the max) of persistent storage for downloads, etc.  I am asking the opposite, in a sense. I'd like to configure a USB install to have the platform adaptability that a Live OS offers while fully utilizing the 120GB of space I have.  In essence I'm hoping to have a boot up install that reconfigures most/all the hardware/drivers as necessary every boot as I'd like to be able to boot off of it on nearly any machine. (Within reason - they will all be 64-bit)  The biggest gripe with doing multi-platform booting is the video driver stuff. Sometimes the system I'm booting off of is AMD, sometimes Nvidia, sometimes Intel.  Alternatively, a usable answer may be a way to better configure the LiveUSB setup for more storage utilization and customization. The line numbers for the text of a paragraph with an equation defined by \begin{align} command do not show as expected. How to fix this?    The LaTeX codes are attached here.   \documentclass[a4paper, 12pt]{article} \usepackage[utf8]{inputenc}    % Use the UTF-8 encoding \usepackage{amsmath}           % For the use of math \usepackage{amsfonts} \usepackage{amssymb}           % For the use of AMS symbols \usepackage{indentfirst}       % For indentation \usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]{geometry}  \usepackage{lineno} \linenumbers  \usepackage{titlesec} \titleformat*{\section}{\large\bfseries} \titleformat*{\subsection}{\normalsize\bfseries} \titleformat*{\subsubsection}{\normalsize}   \renewcommand{\baselinestretch}{1.5}    \usepackage{authblk}           % Use author package \renewcommand*{\Authfont}{\large} \renewcommand*{\Affilfont}{\normalsize\normalfont}  \makeatletter \g@addto@macro\normalsize{%   \setlength\abovedisplayskip{0pt}   \setlength\belowdisplayskip{0pt}   \setlength\abovedisplayshortskip{0pt}   \setlength\belowdisplayshortskip{0pt} } \makeatother  \title{\textbf{Globally cumstomize the spacing between the text and equation}}    \date{}  \begin{document}  \maketitle  \section{Air filter} The air filter is simulated by the Control Valve module (AFT in Fig. 2(a)). The pressure drop through the air filter ($ \Delta P_{af} $) is given by the following equation [11,16]. \begin{align} \Delta P = \Delta P_{d} \left( \frac{m}{m_{d}}\right)^{1.84}  \left( \frac{T}{T_{d}}\right)  \left( \frac{P}{P_{d}}\right)^{-1}  \end{align} where, $ \Delta P_{af} $ is the pressure drop, $ m $ is the mass flow rate, $ T $ is the temperature, and $ P $ is the pressure, and subscript $ d $ denotes the design condition.  \newpage \section{Air compressor (AC)} The AC operating characteristics can be described by its performance map, which relates the following dimensionless operational variables. The AC operating characteristics can be described by its performance map, which relates the following dimensionless operational variables. \begin{align} &amp; \text{Relative pressure ratio:} &amp;&amp; PR_{r} = \frac{PR-1}{PR_{d}-1}\\ &amp; \text{Relative isentropic efficiency:} &amp;&amp; \eta_{r} = \frac{\eta}{\eta_{d}} \\ &amp; \text{Relative corrected mass flow:} &amp;&amp; m_{cor,r} = \frac{\left(\frac{m_{in}}{P_{in}}\sqrt{T_{in}}\right)}{\left(\frac{m_{in,d}}{P_{in,d}}\sqrt{T_{in,d}}\right)} \\ &amp; \text{Relative corrected speed:} &amp;&amp; N_{cor,r} = \frac{\left(\frac{N}{\sqrt{T_{in}}}\right)}{\left(\frac{N_{d}}{\sqrt{T_{in,d}}}\right)} \end{align} where, $ \eta $ is the efficiency, $ N $ is the shaft speed, and $ PR = P_{in}/P_{out} $. Subscript $ cor $ denotes the corrected value, $ r $ denotes the relative value, $ in $ denotes the inlet, and $ out $ denotes the outlet.  \end{document} How to import a jar in Eclipse I have a Xonar DX (CMI8788 driver) 7.1 surround sound card installed on my Ubuntu 11.10 system.   I want to use the outputs of the card as 4 separate stereo outputs and I am struggling with ALSA to get it to work.  This is my asound.conf:  #/etc/asound.conf pcm_slave.eightchannels {         pcm "hw:0,0"            # or "hw:1,0" for the second card         channels 8 } pcm.stereo1 {         type plug         slave.pcm {                 type dshare                 ipc_key 87882222                 slave eightchannels                 bindings [ 2 3 ]         } } pcm.stereo2 {         type plug         slave.pcm {                 type dshare                 ipc_key 87882222                 slave eightchannels                 bindings [ 4 5 ]         } } pcm.stereo3 {         type plug         slave.pcm {                 type dshare                 ipc_key 87882222                 slave eightchannels                 bindings [ 6 7 ]         } } pcm.stereo4 {         type plug         slave.pcm {                 type dshare                 ipc_key 87882222                 slave eightchannels                 bindings [ 0 1 ]         } }   This is my aplay -l output:  $ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: DX [Xonar DX], device 0: Multichannel [Multichannel]   Subdevices: 1/1   Subdevice #0: subdevice #0 card 0: DX [Xonar DX], device 1: Digital [Digital]   Subdevices: 1/1   Subdevice #0: subdevice #0 card 1: Intel [HDA Intel], device 0: ALC662 rev1 Analog [ALC662 rev1 Analog]   Subdevices: 1/1   Subdevice #0: subdevice #0 card 1: Intel [HDA Intel], device 1: ALC662 rev1 Digital [ALC662 rev1 Digital]   Subdevices: 1/1   Subdevice #0: subdevice #0   This is my aplay -L output:   The system seems to completely ignore my configuration. However, I am sure that the config is used, because when i insert a random string at the top, i get a parsing error.  Any help is greatly appreciated. How to differentiate read and unread messages in android ListView? Sample query/DDL for producing page locks on a clustered index in SQL Server (without hints) We currently have some indexes where ALLOW_PAGELOCKS is set to off. This presumably was done in order to reduce deadlocks. However I doubt that it would really had an effect back then.   Now I am trying to understand WHEN SQL Server actually chooses to start locking pages rather than keys in a clustered index. I asked Jonathan Keyhaisas recently and he told me that this could happen if I am touching rows on several subsequent pages. However I didn't manage to get any exclusive page locks by updating rows in a clustered index with a sample query.   Could you help me understand page locks better with a sample query and table? I am running SQL Server 2008 SP4.  Thanks in advance  Martin How did nobody at Hogwarts (especially Dumbledore) figure out what killed Myrtle? Why is the wild card character * so different between the zip and rm commands? I put together a script to do some file operations for me. I am using the wild card operator * to apply functions to all files of a type, but there is one thing I don't get. I can unzip all files in a folder like this  unzip "*".zip   However, to remove all zip files afterward, I need to do   rm *.zip   That is, it does not want the quotation marks. The unzip, on the other hand, does not work if I just give it the * (gives me a warning that "files were not matched").   Why is this different? To me, this seems like the exact same operation. Or am I using the wild card incorrectly?   in Unix do not really go into this, and I could not locate anything in the rm or zip docs.  I am using the terminal on a Mac (Yosemite). Testing equality of coefficients from two different regressions This seems to be a basic issue, but I just realized that I actually don't know how to test equality of coefficients from two different regressions. Can anyone shed some light on this?   More formally, suppose I ran the following two regressions:  $$ y_1 = X_1\beta_1 + \epsilon_1 $$ and  $$ y_2 = X_2\beta_2 + \epsilon_2 $$ where $X_i$ refers to the design matrix of regression $i$, and $\beta_i$ to the vector of coefficients in regression $i$. Note that $X_1$ and $X_2$ are potentially very different, with different dimensions etc. I am interested in for instance whether or not $\hat\beta_{11} \neq \hat\beta_{21}$.   If these came from the same regression, this would be trivial. But since they come from different ones, I am not quite sure how to do it. Does anyone have an idea or can give me some pointers?   My problem in detail: My first intuition was to look at the confidence intervals, and if they overlap, then I would say they are essentially the same. This procedure does not come with the correct size of the test, though (i.e. each individual confidence interval has $\alpha=0.05$, say, but looking at them jointly will not have the same probability). My "second" intuition was to conduct a normal t-test. That is, take   $$ \frac{\beta_{11}-\beta_{21}}{sd(\beta_{11})} $$  where $\beta_{21}$ is taken as the value of my null hypothesis. This does not take into account the estimation uncertainty of $\beta_{21}$, though, and the answer may depend on the order of the regressions (which one I call 1 and 2).   My third idea was to do it as in a standard test for equality of two coefficients from the same regression, that is take  $$ \frac{\beta_{11}-\beta_{21}}{sd(\beta_{11}-\beta_{21})} $$   The complication arises due to the fact that both come from different regressions. Note that   $$ Var(\beta_{11}-\beta_{21}) = Var(\beta_{11}) + Var(\beta_{21}) -2 Cov(\beta_{11},\beta_{21}) $$ but since they are from different regressions, how would I get $Cov(\beta_{11},\beta_{21})$?  This led me to ask this question here. This must be a standard procedure / standard test, but I cound not find anything that was sufficiently similar to this problem. So, if anyone can point me to the correct procedure, I would be very grateful! After a very long time will we see more stars (due to the fact that more light is get to us) or less stars (as the universe expends and light have to pass larger distance)? In general, can stellar objects go outside of the scope of the observable universe or is it only growing with time? Calculations are always better than just discussion. Does it have any connection to dark matter? How to achieve this 3D "Card" effect How do I create this type of effect with an image? I'm wondering how to get the thick edges and the tilted look. Is there an online tool that will convert a flat image to look like this? How do you prove the follwing $|\sqrt[n]{x}-\sqrt[n]{y}| \le \sqrt[n]{|x-y|}$ how do you prove this inequality? $|\sqrt[n]{x}-\sqrt[n]{y}| \le \sqrt[n]{|x-y|}$ At first glance I thought the triangle inequality would be useful but it's not form what I see. If I raise everything to the power of n I get the following: Possibility 1 (n uneven) : $|x + ... -y| \le |x-y|$ I guess I would have to prove that ... $\le$ 0 but I don't know how to do that. Possibility 2 (n even) : $|x + ... +y| \le |x-y|$ Same as above but now I have to prove that ... $\le$ -y. Am I even on the right track here? Any help would be appreciated. Thanks in advance. I've recently decided that I just have to finally learn C/C++, and there is one thing I do not really understand about pointers or more precisely, their definition.  How about these examples:   int* test; int *test; int * test; int* test,test2; int *test,test2; int * test,test2;   Now, to my understanding, the first three cases are all doing the same: Test is not an int, but a pointer to one.  The second set of examples is a bit more tricky. In case 4, both test and test2 will be pointers to an int, whereas in case 5, only test is a pointer, whereas test2 is a "real" int. What about case 6? Same as case 5? Rootspaces are $\mathop{ad}$ nilpotent If I have bought 3 tickets for the same flight, can I bring three times the cabin allowance allowed per ticket?  The way I see it I am doing the airline a favor  Related: