I'm sure this is something that AJAX gurus learn very early on, but this is the first time I've run into it.  Using jQuery, I have assigned .click() handlers to certain CSS classes.  However, if I reload some of the content via AJAX, the .click() handlers are not firing for that content.  It seems I have two choices:   put my .click() handler assignments within a JScript function, and call it every time content is refreshed via AJAX. use onclick="" rather than jQuery within my AJAX content.   So far, it seems #1 would be the best; it's more consistent and yields smaller HTML for AJAX.  Is there another way to do it?  Perhaps a different way of assigning the .click() handlers from the outset?
I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.
What should I focus on when converting photos to black and white? When I look at the black and white photographs from professional photographers, I notice that they have a special look. Not a specific style—obviously each photographer has her own style—but a look which make them different from similar color photos, a special feeling, which makes them shine specifically as black and white and makes color irrelevant.  When I convert my own photos to black and white in Lightroom, they don't have any special look. They just look like any other of my photos, simply converted to black and white. I imagine that there are two reasons for that:   Some scenes are better for black and white. Talented and/or experienced photographers know which scenes would be beautiful in black and white, and shoot specifically those scenes. Moreover, they know how to adapt the scene itself and the lighting to black and white (for instance by not relying on the color contrast itself).  In my case, I don't think much about shooting for black and white. It comes only in post-processing, when I either think that the photo will look great in black and white (and very often, it doesn't), or I find the colors to be poor and turn the photo to black and white (which actually doesn't make the photo any better). Post-processing is much more complex than clicking on black and white button in an app. It involves not only adjusting black and white mix (i.e. raising or lowering the lightness of specific colors), but doing lots of other adjustments.  In my case, I do black and white mix, but other adjustments I do are similar to what I would do for a color photo: actually, I may even do them on a color photo, and only then turn it to black and white.   So, what should I take in account if I want to have decent black and white photographs? Are there specific techniques, tips, tricks or warnings for someone who usually shots in color and wants to start black and white photography?  Let me show some examples. Are those scenes not great for black and white photos in the first place? Or can they be salvaged through proper post-processing?  1.  First, a poorly done photo from Scotland with dubious composition and very poor colors that I was unable to correct in Lightroom.  The same image in black and white isn't much better. The difference between the trees and the grass on the hill is barely visible. Houses on the hill fade with the sky much more than in the original version.      2.  Here's a photo of a cute pet.  In black and white, the gap between the mouse's ear and the background is barely visible. There is absolutely no benefit compared to the original.      3.  Finally, an example of a much more contrasty picture. The black and white version is weird, since the lack of color makes it difficult to understand whether the soil is the actual sand or something else. I find the sky to be weird as well, and making the blue channel darker or lighter in Lightroom haven't changed that. Determine the Set of a Sum of Numbers I want to determine the set of natural numbers that can be expressed as the sum of some non-negative number of 3s and 5s.  $$S=\{3k+5j∣k,j∈\mathbb{N}∪\{0\}\}$$  I want to check whether that would be: 0,3, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, and so on.  Meaning that it would include 0, 3, 5, 8. Then from 9 and on, every Natural Number. But how would I explain it as a set? or prove that these are the numbers in the set? How to return to the GUI? I am very new to Linux and Ubuntu. I use Ubuntu 11.10.  I was trying to exit the X server (in order to install some Nvidia drivers) and I typed in the terminal:  sudo service lightdm stop   How can I return to the Ubuntu interface? Can newsletters take into account a user's ignored tags on that site? I have seen several questions that discuss using your "Favorite" tags to construct a newsletter.   I'm looking for a similar request - but for ignored tags.  I figure it might make sense to split this request from the "favorite" requests because it has different implementation.  Can we exclude questions on the "ignore" tags lists in the newsletter?   For example, I subscribe to the Board and Card Games newsletter.   Currently (and frequently) 6 of the 7 questions are about magic-the-gathering, a tag I have in my ignored list.     I now get a newsletter where at best 1/7 questions is interesting and worth clicking on.  Related questions about using "Favorites": How to use Terminal to delete all .svn folders recursively? What command can I type into the Terminal so that I can delete all .svn folders within a folder (and from all subdirectories) but not delete anything else? One-hot vs dummy encoding in Scikit-learn There are two different ways to encoding categorical variables. Say, one categorical variable has n values.  converts it into n variables, while  converts it into n-1 variables. If we have k categorical variables, each of which has n values. One hot encoding ends up with kn variables, while dummy encoding ends up with kn-k variables.  I hear that for one-hot encoding, intercept can lead to collinearity problem, which makes the model not sound. Someone call it "".  My questions:   Scikit-learn's linear regression model allows users to disable intercept. So for one-hot encoding, should I always set fit_intercept=False? For dummy encoding, fit_intercept should always be set to True? I do not see any "warning" on the website. Since one-hot encoding generates more variables, does it have more degree of freedom than dummy encoding? Scaling problem with fillbetween in pgfplots Exploring ocean depths: is pressure an issue? Should it be? An upcoming adventure will have the party exploring the depths of the ocean. Breathing underwater shouldn't be an issue for them, as there are both items and rituals to take care of that, however, I was wondering what to do about about pressure, since none of these options mention it. I'll have to split my question into two, since they are closely related.   Is pressure an issue in 4e adventures? Is it mentioned in any of the published material? Has it been ruled anywhere that options that enable water breathing also grant immunity to pressure? Should it be an issue? This is somewhat subjective, but I really am wondering what other people have done. Would it be unresonable to assume that these options grant immunity to pressure? Should the players work to find another solution? Can I use the valid Schengen visa in old passport? Simple Past vs. Present Perfect: "was" vs. "has been" I tried to find a topic here on this (possible problem) but I didn't.   I reported it at  but Tim Hoffmann pointed me that it is not a problem of editor. After tested with nano and pdflatex I'm posting here.  The minimal code produces errors. OK, we can solve it using \\{}.   But is this a problem with TeXlive 2014 or there are some good reasons to have that behavior.  \documentclass{report} \begin{document} test\\ [foo]  test\linebreak [foo]  test\newline [foo] \end{document}      ! Missing number, treated as zero.                        f l.3 test\ [foo] I'm downloading some images from a service that doesn't always include a content-type and doesn't provide an extension for the file I'm downloading (ugh, don't ask).  What's the best way to determine the image format in .NET?  The application that is reading these downloaded images needs to have a proper file extension or all hell breaks loose. Inspired by , say you have a 4x4 two dimensional array, write a function that rotates it 90 degrees. Raymond links to a solution in pseudo code, but I'd like to see some real world stuff.  [1][2][3][4] [5][6][7][8] [9][0][1][2] [3][4][5][6]   Becomes:  [3][9][5][1] [4][0][6][2] [5][1][7][3] [6][2][8][4]   Update: Nick's answer is the most straightforward, but is there a way to do it better than n^2? What if the matrix was 10000x10000? When can I make opportunity attacks? How to disable touchscreen permanently on ubuntu 18.04 How do I match any character across multiple lines in a regular expression? For example, this regex  (.*)&lt;FooBar&gt;   will match:  abcde&lt;FooBar&gt;   But how do I get it to match across multiple lines?  abcde fghij&lt;FooBar&gt; If $a,b$ are the roots of the equation $2 x^2 -3 x +1 = 0$, find an equation whose roots are $a/(2b +3)$, $b/(2a +3)$ How do I create directory if it doesn't exist to create a file? Cannon Locations in New Super Mario Bros. Wii? In Super Mario Bros. Wii, there are cannons on the overworld map that you can use to skip worlds. However, the cannons are initially inaccessible, and you need to complete certain levels in a specific manner to get to them. What levels do I need to complete in order to access these cannons? How do I stop Outlook Out-Of-Office from replying to certain addresses? When I am out of the office, if I turn Out-of-Office on, it auto-replies to the automated emails I get from our Bug Tracking system, which leads to our Bug Tracking system getting full of message about my holiday.  With Outlook Out-of-Office, how do I set it to not respond to certain 'From' addresses? I see its something to do with the optional Rules in the O-o-O dialog, but its not that clear how to stop it from replying using the rules.  I'm on Outlook 2003 and Exchange 2003 but advice for any version will probably be useful to people.