I couldnot find this anywhere , so asking it here.   Say I have a query such as   SELECT * from TABLE WHERE col in ('a', 'b', 'c', .......);   This data is provided by list of strings and it is quite huge with length more than 100. What is efficient way of parameter binding in such scenario.  I am currently doing   'SELECT * from TABLE WHERE col in {0}'.format(str(tuple(LIST_OF_DATA)))   Another way I could think of is prepare a bind string with length of list such as ','.join(itertools.repeat("%s", len(LIST_OF_DATA))) and concatenate to query.  Is there any other way other than these to bind with in query a list of data ?
I have a python list, say l  l = [1,5,8]   I want to write a sql query to get the data for all the elements of the list, say  select name from students where id = |IN THE LIST l|   How do I accomplish this?
So I just got this Nikon D3100 Camera.  And I am trying to take a picture using autofocus with the kit lens(18-55mm).    The system is in Auto mode, AF-A, single frame and the lens A-M switch is on "A",  VR is "ON".  When I press shutter half way down, focus confirmation light in lower left corner of viewfinder neither lit nor blinks(hear clicking). When I press the shutter all the way down, the shutter seems locked (hear clicking, but shutter not released).    The manual says the shutter will lock itself if it can't get focus. But the place is well lit and have distinct color and I can easily focus using my old Canon.    The camera works fine in manual focusing, but I can't get it to take picture under auto-focusing.  I wonder is there something wrong with the setting that I don't know or is that I got a lemon?  Thanks What are all possible ways to stop a zombie from despawning? Is there any way for which we are able to stop a zombie from de-spawning no matter how far we go? If so, what are all possible ways?  Bonus question: what are all the other techniques for which we can prevent a zombie from de-spawning within a specific block radius? Is there a specific term for the association of certain verb(s) with certain nouns (as direct objects)? Or vice versa. Or perhaps a name for the pair itself?  For example:   hold an opinion make a complaint offer an apology   Also, where might I find a list of such pairs?    EDIT: I chose my title wording randomly. I have no idea whether 'cognate verb' is the correct term for these things. However, I've just found out that 'cognate objects' are a defined class in linguistics, so perhaps my choice of words was inappropriate. I'm going to leave the title as it is, anyway. Two different solutions to integral Given the very simple integral  \begin{equation} \int -\frac{1}{2x} dx \end{equation}  The obvious solution is  \begin{equation} \int -\frac{1}{2x} dx = -\frac{1}{2} \int \frac{1}{x} dx = -\frac{1}{2} \ln{|x|} + C \end{equation}  However, by the following integration rule \begin{equation} \int \frac{1}{ax + b} dx = \frac{1}{a} \ln{|ax + b|} + C \end{equation}  the following solution is obtained \begin{equation} \int -\frac{1}{2x} dx = -\frac{1}{2}\ln{|-2x|} + C \end{equation}  Why are these solutions different? Which is correct?   The second solution can be simplified \begin{equation} -\frac{1}{2}\ln{|-2x|} + C = -\frac{1}{2}\ln{|-2|} -\frac{1}{2}\ln{|x|} + C= -\ln{\frac{1}{\sqrt{2}}} - \frac{1}{2}\ln{|x|} + C \end{equation} but they still differ. How to delete all music on my iPhone Do trees really get a large share of their mass from the carbon in the air? I remember hearing that trees and other plants actually obtain a large amount of their mass from the carbon floating in the air, not the ground beneath them. Does the makeup of air actually contain enough carbon to support this theory, and is a tree's surface area actually large enough to obtain the amount of carbon it needs directly from the air? On a "1-D line", the point that minimizes the sum of the distances is the median, WHY? There is a set A which contains some discrete points (1-dimension), for example {1, 3, 37, 59}. And I want to pick one point from A which can minimize the sum of distances between this point and others.  For this "1-D line", many people say the median is the right point, but could anybody give me a concrete proof on it? Making a Laser in Cycles - Straight Beam of Light? Change font size of labels in figures to any font size I want to change the font size of the label of a figure environment to any font size. It's possible to use the package caption with the argument font=Large for example. But I found no way to choose any font size, e.g. fontsize=28pt.  Here an example code:  \documentclass{standalone} \usepackage{anyfontsize}  \usepackage[font=Large]{caption} %\usepackage[fontsize=28pt]{caption} % not implemented   \begin{document} \parbox[t]{20cm}{  \fontsize{28}{30} \selectfont  \begin{figure}     %\includegraphics{figure.eps}     \caption{\label{fig_req_osnr} \fontsize{28}{30} \selectfont My caption.} \end{figure}  }  \end{document}     Do you have any ideas? Why cant we replace diode connected BJTs by simple diodes in a current mirror circuit? $f(x)f(1/x)=f(x)+f(1/x)$ Find a function $f(x)$ such that:  $$f(x)f(1/x)=f(x)+f(1/x)$$  with $f(4)=65$.  I have tried to let $f(x)$ be a general polynomial: $$a_0+a_1x+a_2x^2+\ldots a_nx^n$$  which leaves $f(1/x)$ as:  $$a_0+a_1{1\over x}+a_2{1\over x^2}+\ldots + a_n{1\over x^n}$$  On comparing the coefficients of both sides, we see that:  $$2a_0=(a_0)^2+(a_1)^2+(a_2)^2+\ldots+(a_n)^2$$  And  $$a_1=(a_0a_1)+(a_1a_2)+ \ldots +(a_{n-1}a_n)$$  I don't know how to proceed further. I know I need to compare coefficients and come to a conclusion based on their values, but I don't see what to do next. Evaluating the integral $\int \frac{x^2+x}{(e^x+x+1)^2}dx$ Why don't more mainstream statically typed languages support function/method overloading by return type?  I can't think of any that do.  It seems no less useful or reasonable than supporting overload by parameter type.  How come it's so much less popular? Should we sign-then-encrypt, or encrypt-then-sign? The title is kind of obscure. What I want to know is if this is possible:  string typeName = &lt;read type name from somwhere&gt;; Type myType = Type.GetType(typeName);  MyGenericClass&lt;myType&gt; myGenericClass = new MyGenericClass&lt;myType&gt;();   Obviously, MyGenericClass is described as:  public class MyGenericClass&lt;T&gt;   Right now, the compiler complains that 'The type or namespace 'myType' could not be found." There has got to be a way to do this. Find where java class is loaded from I have a hard time finding a how-to.  I would like to set up a simple ESD mat and wrist wrap, but I am not sure about is the the 1 MOhm resistor should be, if at all.  Several options:   1 MOhm from ground outlet to the mat, wire from the common earthing on the mat to the wrist wrap. 1 MOhm from ground outlet to the mat, wire from another contact on the mat to the wrist wrap. 1 MOhm from ground outlet to the mat, 1 MOhm from the same mat contact to the wrist wrap. wire from ground outlet to the mat, 1 MOhm from the same mat contact to the wrist wrap. wire from ground outlet to the mat, wire from another mat contact to the wrist wrap.   I am not sure why the 1 MOhm wire is needed since the mat itself already has that kind of resistance (as long as the wrist wrap does not connect to ground directly, but through the mat).  Which solutions above are ok? Which is best? Should I do something else instead? options for appearance of links in hyperref In a multi server architecture, is it possible to find out from which machine a user logged into current machine using ssh?  For example, user1 logged into host1. From there, the user logged into host2 as sruser using ssh.  In above example, would it be possible to trace the sruser session of host2 back to user1 session in host1?  Would it be possible to get the hostname or terminal of user1 session? Around 3 months ago, I submitted a paper to a Math journal for peer-review through an online submission system. The same day I received in my e-mail an acknowledgement saying that the paper had been received.  The problem is that the status of the paper on the online submission system is still "Manuscript submitted".  I think this means that the paper has not even been assigned to an editor yet (once this happens, the editor will probably start looking for reviewers), but as far as I know submissions are assigned to editors within a few weeks (I once submitted a paper to another journal and when an editor had been assigned, the status on the online system changed to "Editor handles" or something like that).  I know that publishing is a long and complicated process and I'm not trying to rush anybody, but sometimes manuscripts are lost in the system. In fact, this has once happened to me, so I just want to make sure that the paper was not lost in the system.  Should I send an e-mail asking for the status of the paper?  PS: I think that, at the time of submitting the paper, I didn't choose any specific editor to submit the paper to.