Jquery button click() function is not working
Event binding on dynamically created elements?
New to both Ruby and Rails but I'm book educated by now (which apparently means nothing, haha).  I've got two models, Event and User joined through a table EventUser  class User &lt; ActiveRecord::Base   has_many :event_users   has_many :events, :through =&gt; :event_users end  class EventUser &lt; ActiveRecord::Base   belongs_to :event   belongs_to :user    #For clarity's sake, EventUser also has a boolean column "active", among others end  class Event &lt; ActiveRecord::Base   has_many :event_users   has_many :users, :through =&gt; :event_users end   This project is a calendar, in which I have to keep track of people signing up and scratching their name out for a given event. I figure the many to many is a good approach, but I can't do something like this:  u = User.find :first active_events = u.events.find_by_active(true)   Because events don't actually HAVE that extra data, the EventUser model does.  And while I could do:  u = User.find :first active_events = [] u.event_users.find_by_active(true).do |eu|   active_events &lt;&lt; eu.event end   This seems to be contrary to "the rails way".  Can anyone enlighten me, this has been bugging me for a long time tonight (this morning)? I have put his on wolfram and obtained answer as follows:  $\sum_{n=1}^{\infty}\frac{n}{2^n} = 2$  And the series is convergent too because $\lim_{n\to\infty} \frac {n}{2^n} = 0$  However I am wondering if there is a convenient way to solve this; I don't think you can represent it by a geometric progression either. So how do we have to do it on paper? How many times can I benefit from Advantage if I attack multiple times while not seen? A hidden ranger with Extra Attack attacks a surprised creature. Do both attacks benefit from Advantage, or just the first one?  If the ranger used Horde Breaker on another creature, would this attack benefit from Advantage? Let $a_k:=(-1)^k$ where $k\in\mathbb{N}$. $\mathbb{N}$ is the set of all non-negative integer.  And we define the partial sum $S_n:=\sum \limits_{k=0}^{n}a_k$. Notice that the sequence $\{S_k\}$ diverges which also implies that the infinite series $\sum \limits_{k=0}^{\infty}a_k$ cannot be defined.  If I consider the infinite sum $1-1+1-1+1-1+\cdots$, then this statement is equivalent that I just defined the infinite series $\sum \limits_{k=0}^{\infty}a_k$, which is contradiction.  But, suppose that the sum $1-1+1-1+1-1+\cdots$ exists and let the value of the sum be $S$. Then, we can easily observe that $S=1-S$, therefore $S=1/2$. The supposition of this proposition already proved as false, but if I ignore the definition of infinite series, it holds.  Which one is right? Or are these propositions depends on what we define? Is there a minimum damage rule? In D&amp;D3e, if you successfully hit a target you always did at least 1 point of damage (before applying Damage Resistance), even if you had a Strength penalty.  I can't find any mention of that rule in the 5e PHB.  Does the rule no longer apply, or did I just overlook it? Transferring a Windows 8 license and proper un- and reinstallation Long story short  I have two computers: a laptop and a desktop computer. Both have Windows 7 on them.  I buy the Windows 8 Pro upgrade. To see if it screws up anything, I install it on my laptop as a guinea pig. I intend to use Windows 8 for my main computer, my desktop, but I want to test it on the laptop, so I know I don’t risk losing access to my desktop and the data on it. I never use my laptop, and only used it, because it already has a Windows 7 installation on it.  The problem  At some point, I must have entered the license key on my laptop, because when I go to the activation screen on my desktop, I get this:    Uh-oh. I can’t use the key on my desktop. Now how the hell do I transfer the key from my laptop to my desktop computer?  Answers and suggestions so far  Let’s just say that I tried everything possible to get some answers on this matter. The best response I got from Microsoft is this:     To install Windows 8 on your desktop, do the following:         Uninstall Windows 8 on your laptop   Afterwards, install Windows 8 on your desktop   If it won’t activate, call product activation at (...)      I am not a fan of that last point. The error message does allude to such a solution, however:     If you’ve reinstalled Windows or made changes to your hardware recently, you may be able to use your current key.   The question  My main question is this: has anyone been in a similar situation, and if so, what did you do to resolve this?  Failing that, what is the proper way to   uninstall the Windows 8 installation on my laptop, and reinstall the Windows 8 installation on my desktop?   Ad 1  I have already tried using the “reset” feature on my laptop, but that only resulted in a new Windows 8 installation that was already activated. But which is the right way to uninstall the installation in a way that allows me to use the license key on the desktop computer?  Ad 2  Which is the proper way to reinstall the Windows 8 installation on my desktop computer? Why do I even have to reinstall it in the first place?  I won’t get around to do this, until my USB key with 3.0 support arrives in the mail, but it is going to be a while, until I find a assuaging response to the best way to go about this anyway. Can you use Magical Secrets to choose high level spells when multiclassing as a Bard? Say you have a Wizard 7/Bard 9. You gain your 17th level and choose to gain the level in Bard (which grants you Magical Secrets). According to the Multiclass Spellcaster: Spell Slots per Spell Level table, you now have a single 9th level spell slot. Can the spells you choose from Magical Secrets be 9th level spells even though you can only cast up to 5th level Bard spells? How can I avoid soft dull "spots" in my pictures? Recently, I've been doing a lot more photography, particularly with my 100-400mm telephoto and 16-35mm wide. I am skilled enough that I can capture the shot mostly as I want with just the camera gear, requiring minimal post processing. I'm a huge fan of ETTR now, so most of my shots are overexposed to support more shadow DR and improve the noise performance of my el-chepo 450D body.  I've noticed quite a bit lately during post processing in lightroom that my sky's or any other lighter areas of my shots tend have spots on them. They are soft and dull to one degree or another (seems to depend on the zoom factor), so probably something either on the sensor or the lens. I'm having a hard time figuring out exactly what they are, as I try to use my lens pen brush before any shoot, yet I still have them. I am having to make quite a few healing corrections post-process to get rid of them.  Is there an easy way to identify where the spots are on my lenses? Once identified, if a quick brush of the outer lens element with a lens pen (or soft camel hair brush) doesn't do the trick, does that mean the spots are on my sensor? Is it possible there is particulate inside the lens body (all of my gear is less than a year old outside of my 450D body, and its all Canon L-Series gear, so I would home that I don't already have detrimental particulates floating around inside my lenses messing up my shots. :|)  Here are a couple examples. The spots are harder to see on screen, and I first noticed them when I printed a few of my more recent shots. There are quite a few, and the shot the examples below were taken from, where the sky took up about 30% of the top edge of the photo, there were probably 10-12 different spots, some of them darker, many of them lighter. The darker ones are the ones that are very visible in prints, where as the softer ones are not as visible, but still apparent enough to ruin an expensive print. Incredible frequency of careless mistakes Color the edges of $K_6$ red or blue. Prove that there is a cycle of length 4 with monochromatic edges. Color the edges of $K_6$ red or blue. Prove that there is a cycle of length 4 with monochromatic edges.  Attempt: I know that i have to...  prove that there must be TWO vertices with “red-degree” at least 3, or two with "blue-degree" at least 3. Call these U and V. (We'll assume we're in the red case; the blue case is similar.) Now, ask if they’re connected by a red edge, and how many red-adjacent neighbors they share. If you analyze this, there should be only a few cases to consider – and each should be relatively straightforward. For each case, you’ll show either that that case can’t actually happen in $K_6$, or that it gives rise to a monochromatic 4-cycle. For any smooth manifold, is it true that for any two points on the manifold, there exists a chart that covers the two points? Some say that we can connect two points with a continuous curve and a small contractible neighborhood of the path together with the charts of the points can be regarded as the chart. But I don't know how to verify this statement. I've bought a  to use with my EOS 200D and while I love the wide aperture, it appears to be quite difficult to achieve sharp focus on people's faces when shooting at f/1.8. I've tried both using Dual Pixel focus in Live View and using the center focusing point in the viewfinder, but it doesn't get me perfect results.  Is this simply a characteristic of cheap wide-aperture lenses? Or is it impossible to get sharp focus with a fully open aperture?  When I'm at at home using a tripod and focusing on a still subject I do get good focus (so it's not a camera or lens issue). But it's hard to do with people who are slightly moving between shots. The following is an Exercise of Conway's Functional Analysis.   Prove that $X$ is a $\,Banach$ space iff whenever $\{x_n\}$ is a sequence in $X$, such that $\sum \| x_n \| &lt; \infty$, then $\sum x_n$ converges.   I easily can show that if $X$ is a Banach space then $\sum x_n$ converges. My problem is showing that $X$ is a Banach space. For this I suppose that $\{s_n\}$ is a Cauchy sequence in $X$, then I want to make a series. For this I do not have any idea. Please help me. modular arithmetic, solving $ax + b \equiv c \pmod d$? For example $151x - 294\equiv 44\pmod 7 $. How would I go about solving that?  The answer says to simplify it into the $ax\equiv b\pmod c $ form first, but I have no clue on how to get rid of the $294$... help? At the moment the most frustrating part of my brewday is getting the cold wort into the fermenter. Here is my process. I have a 20 litre saucepan that i use as a kettle that does not have a tap. At flame out I add my immerseion chiller that is plumbed into my kitchen sink tap. When I have reached temperature I remove the chiller and whirlpool and leave it to rest to 30 minutes. I am use a siphon to rack directly into the plastic bucket fermenter.  The problem is that the siphon always gets clogged with the hops after i have only transfered about 20% of the wort. I have also tried carefully pouring the wort through a seive, but this sort of depfeats the point of the whirlpool and also the seive got blocked with hops as well. All in all i end up wasting a lot of the wort because i am afraid of getting a lot trub in the fermenter.  What are the best processes to use with my current equpment to get the wort into the fermenter? Let $H$, $K$ be subgroups of $G$. Prove that $o(HK) = \frac{o(H)o(K)}{o(H \cap K)}$.  I need this theorem to prove something. How do I execute the following shell command using the Python  module?  echo "input data" | awk -f script.awk | sort &gt; outfile.txt   The input data will come from a string, so I don't actually need echo.  I've got this far, can anyone explain how I get it to pipe through sort too?  p_awk = subprocess.Popen(["awk","-f","script.awk"],                           stdin=subprocess.PIPE,                           stdout=file("outfile.txt", "w")) p_awk.communicate( "input data" )   UPDATE:  Note that while the accepted answer below doesn't actually answer the question as asked, I believe S.Lott is right and it's better to avoid having to solve that problem in the first place! What is the rough estimate of salary value for a taxpayer to pay AMT? For US federal tax, whether a taxpayer is subject to AMT is determined by a complicated way in Instructions for Form 1040, Line 45, which involves an incomprehensible "worksheet to see if you should fill in form 6251".  By simplification and approximation, is there a rule of thumb for an estimate of a salary value of a taxpayer, so that a salary above the value might cause the taxpayer to pay AMT with a big possibility, and a salary below the value might not with a big possibility?  Why do the following two sources seem to differ greatly in estimates of the boundary salary value:    says that  the possible boundary salary value for a single taxpayer  to pay AMT is $53,900.  says that      Taxpayers with small incomes fall within the AMT exemption limits.   That leaves the upper middle class to face the tax, especially those   with incomes between $200,000 and $500,000    Thanks. I’m currently working on a solar powered boat with a modest sized team of people. For our competition we are only allowed to have 3 12v batteries on board but we are allowed to have up to 52v at any point in our setup. We are hoping to kick up the speed of our outboard motor for the sprint portion of the completion and are looking into using a boost converter for this.   After doing a little research I’m a bit confused about how they fundamentally work. From what I can tell they take in a voltage and current and put out a higher voltage with a lower current with some level of efficiency. But it seems to be independent from the load( in this case the motor) which doesn’t make much sense to me because I thought the current would be determined by whatever my load is. How do loads actually interact with boost converters?( The simpler the better.)  For reference we are using the Saietta 119r motor system and I’m considering using the MPS MPQ3425 boost converter. Upload images from the Stack Exchange Android app I would like to request implementation of uploading images to questions/answers from the Stack Exchange Android app, especially now as it would definitely help uploading screenshots for reporting bugs and feature requests.