I have labels with for="#input_id" tag as illustrated below. However, multiple labels trigger the same input field (with id) to attach a user selected file. I want to now which label triggered the input field.  &lt;label id="label1" for="input1"&gt;Document1&lt;/label&gt; &lt;label id="label2" for="input1"&gt;Document2&lt;/label&gt; &lt;label id="label3" for="input1"&gt;Document3&lt;/label&gt; &lt;label id="label4" for="input1"&gt;Document4&lt;/label&gt;  &lt;input type="file" id="input1" accept="application/pdf" /&gt;  $("#input1").change(function() { //some js for checking file type and file size etc //looking for some code to findout which label clicked to trigger file input   });   When i click labels it triggers input field however i need to know which label clicked to save file path to suitable div by using data-fpath="some path".  I use jquery however any javascript solution is OK for me.
Is there any way to get the ID of the element that fires an event?  I'm thinking something like:    $(document).ready(function() {   $("a").click(function() {     var test = caller.id;     alert(test.val());   }); }); &lt;script type="text/javascript" src="starterkit/jquery.js"&gt;&lt;/script&gt;  &lt;form class="item" id="aaa"&gt;   &lt;input class="title"&gt;&lt;/input&gt; &lt;/form&gt; &lt;form class="item" id="bbb"&gt;   &lt;input class="title"&gt;&lt;/input&gt; &lt;/form&gt;     Except of course that the var test should contain the id "aaa", if the event is fired from the first form, and "bbb", if the event is fired from the second form.
How can you tell when a sunset is going to be spectacular? I have a spot that I like to take sunset pictures. I find that the most spectacular moments last for only maybe 5-10 minutes. What I would like to do is know about a half hour before that a sunset is going to be spectacular, so I can grab my camera, tripod, walk 5-10 minutes to my sunset spot, set up, and have a few minutes to spare in case something happens. However, I've often missed really cool sunsets, because I just don't know when to photograph them. How can you tell beforehand when a sunset is going to be spectacular? Thanks! How to disable Django query cache? Why is RAM not put on the CPU chip? Modern CPUs are very fast compared to all things external, including memory (RAM).   It is understandable, since CPU clock frequency has reached a point where it takes several clock ticks for an electric signal simply to run from from the CPU through the bus to RAM chips and back.   It also complicates life on many levels: multi-level cache hierarchies are built to deliver data closer to the CPU, which in turn require complex synchronization logic in the chip. Programs must be written in a cache-friendly way to avoid wait cycles while data is fetched.   Many of these problems could be avoided if a significant amount of RAM was located directly on the CPU chip. It doesn't have to an exclusive arrangement: maybe put 1-4 GB on the chip, depending on its class and allow additional memory installed separately.   I'm sure there are good reasons Intel, AMD and the like are not doing this. What are these reasons? Is it that there's no room to spare on the chip? Count if two criteria match while ignoring duplicates I have a simple Sheet with 2 cells that I need to countif 2 conditions match and treat  duplicates as 1.  Column A    Column B Male        closed Female      invalid # Male        exception Male        closed Male        closed Female      new   I would like a formula that counts Male closed and return 1 result (ignoring duplicates) I was solving a few problems from a textbook and I came across this one:     Find the tangent lines to the graph of $x^2+4y^2 = 36$ that go through   the point $P=(12,3)$   I could find the tangency points $$ but my solution was completely messy (I had four equations that I had to go back-and-forth with.  Is there an elegant/simple solution to that?  Tangency points:  $$P_1 = (0,3)$$ $$P_2 = \left( \frac{24}{5} , 3-\frac{24}{5} \right)$$ I'm sorry if this seems a bit too basic, but I guess I'm just looking to confirm understanding here. I get the sense I'd have to do this in two steps, and I've started trying to grok correlation matrices, but it's just starting to seem really involved. I'm looking for a concise explanation (ideally with hints towards a pseudocode solution) of a good, ideally quick way to generate correlated random numbers.   Given two pseudorandom variables height and weight with known means and variances, and a given correlation, I think I'm basically trying to understand what this second step should look like:     height = gaussianPdf(height.mean, height.variance)    weight = gaussianPdf(correlated_mean(height.mean, correlation_coefficient),                          correlated_variance(height.variance,                          correlation_coefficient))    How do I calculate the correlated mean and variance? But I want to confirm that's really the relevant problem here.  Do I need to resort to matrix manipulation? Or do I have something else very wrong in my basic approach to this problem? How could I define function with function such as Coefficient? Show that $a^{61} \equiv a\pmod{1001}$ for every $a \in \mathbb{N}$ self referential struct definition? php SimpleXML check if a child exists Static posts page with home.php Why can't the Klein-Gordon equation explain the hydrogen atom but the Dirac equation does? Why can't the Klein-Gordon equation with a Couloumb potential describe the hydrogen atom?  Why can the first order Dirac equation explain it? What are the failures? I hear the word architect used as a verb in the technical field and now more often in other industries and groups, for example:     We need to architect a better solution to the problem.   I am interested if this is considered acceptable usage, as I see this word being used more in published technical documents (not necessarily books, but corporate publications).  I can see how a conductor can conduct, a typist can type, but can a scientist "science"?  A scientist might research, analyze, and so forth, as an architect might design, create, build, etc.  Merriam-Webster , however, I have been told that other dictionaries exist that define architect as both a noun and a verb&nbsp;— is there a credible reference or source that authoritatively answers this question? How are Anonymous inner classes used in Java? Do iOS app visits count to your consecutive visits After S.H.I.E.L.D confiscates Jane's work in Thor, the researchers discuss what they'll do next.  Erik mentions two colleagues. The first is reasonably implied to be Bruce Banner, but who is the second colleague he mentions? Transcribed from the film:  Jane Who are these people? Erik I knew this scientist... a pioneer in gamma radiation. S.H.I.E.L.D showed up and... umm. He wasn't heard from again. Jane They're not going to do that to us. I'm going to get everything back. Erik mumbles Please. Let me contact one of my colleagues. He's had some dealings with these people before. I'll email him and maybe he can help. Darcy They took your laptop, too. I have very old Computer  What's the Best Operating System for Old Computer? It's been some weeks now, whenever I try to used my Youtube app, it tells me it's impossible to connect to Youtube. Since it's an iPad 1, I have had trouble finding information online.  Did Google or Apple stop supporting the app? Is it finally obsolete? Is there another app I could use that works on iOS 5?  Just to be clear, I did not tinker with my device. I did not change its parameters, I did not jailbreak it, it connects to the Internet just fine and I've tried the app on different Internet connections. Also, this is not a login problem, the app just refuses to let me browse videos, whether I'm logged in or not.  Thanks for your help. Can't access my home directory "Encrypted private directory is not setup properly" Hi I'm trying to access my home directory on my laptop hard drive through a live usb. I cannot boot into the OS on the hard drive and the home and root directory is encrypted. I have the encryption key but when I try to run the tool to gain access it pops up for a second then disappears and when I run the command in Terminal it says "Encrypted private directory is not setup properly". What are my options on getting into the directory? I really need to get the data off my laptop. Why is mathematical induction a valid proof technique?