DELETE WHERE IN C# Sqlite Duplicate of this question, as it was not answered to satisfaction.   In virtually the exact same scenario as the original poster, Cholo, I am attempting a simple parameterised Delete statement.  string UIDcsv = "1, 2, 3, 4, 5, 6"; Console.WriteLine(UIDcsv);  var sqlite_DeleteEmployee = new SQLiteCommand(sqlite_Conn); sqlite_DeleteEmployee.CommandText = "DELETE FROM myTable WHERE UID IN (@x);"; sqlite_DeleteEmployee.Parameters.AddWithValue("@x", UIDcsv); sqlite_DeleteEmployee.Prepare(); sqlite_DeleteEmployee.ExecuteNonQuery();   Like Cholo found in the linked 'Accepted Answer', the code runs fine but does not actually execute this statement. This has been frustrating me all evening!  Now I've written this, I'm looking at rest of my code and realising that this C# Sql command generator is more than likely auto-appending quotation marks around @xyz in the command, turning the list of UIDs into a single string. How do I stop this happening?   Output of the WriteLine:  1, 2, 3, 4, 5, 6
Parameterize an SQL IN clause How do I parameterize a query containing an IN clause with a variable number of arguments, like this one?  SELECT * FROM Tags  WHERE Name IN ('ruby','rails','scruffy','rubyonrails') ORDER BY Count DESC   In this query, the number of arguments could be anywhere from 1 to 5.  I would prefer not to use a dedicated stored procedure for this (or XML), but if there is some elegant way specific to , I am open to that.
E: Malformed entry 54 in list file /etc/apt/sources.list (Component) A friend asked me to help her with her old iPhone 4 (she has upgraded to a 7). When I turn it on, it says, "iPhone is disabled" and "connect to iTunes."  When I do so, iTunes reports that it is locked with a passcode, and that I need to type that in to continue. However, the iPhone does not display a keypad or allow any sort of input.  Apple suggests the only solution is a wipe, but this will lose all of her photos.  Can photos be retrieved (at a minimum) from a disabled iPhone 4? How to factor numbers that are the product of two primes Can one construct a non-measurable set without Axiom of choice? Is axiom of choice required to show the existence of non-measurable sets? Is there a Lebesgue non-measurable set that can be constructed without axiom of choice?  Related question on MO says it is consistent: Schwarz's Lemma and functions with positive real part Problem:     Let $D = \{ z \in \mathbb C : |z| &lt; 1 \}$. Suppose $f : D \to \mathbb C$ is a non-constant analytic function such that $\mathrm{Re} f(z) \geq 0$ for all $z \in D$.      (a) Show that $\mathrm{Re} f(z) \neq 0$ for all $z \in D$.      (b) Using a Möbius transformation and Schwarz's lemma, prove that if   $f(0) = 1$, then $$ |f(z)| \leq {1+|z| \over 1-|z|}. $$   What can be said if $f(0) \neq 1$?      (c) Show that if $f(0) = 1$, then $f$ also satisfies $$ |f(z)| \geq {1-|z| \over 1+|z|}. $$   Progress:  (a) We can use the open mapping theorem.  (b) We can compose a Möbius transformation $m$ that sends the right-half plane to $D$ with $f$. Then $h = m \circ f$ satisfies the hypotheses of Schwarz's lemma by construction. Simple manipulations of the inequality from Schwarz's lemma give the result.  (c) Looking at part (a), we know that $\mathrm{Re} f(z) \neq 0$, and so $f(z) \neq 0$. Thus, we can use the function $g = 1/f$ in the statement of part (b).  Question:  What about when $f(0) \neq 1$? I don't think you can get anything from $f(z)-f(0)+1$ unless $\mathrm{Re} f(0) &lt; 1$. And you can't in general rearrange the inputs of $f$ because $1$ isn't necessarily in the image of $f$. Also, I don't think you can get anything from $f(z)/f(0)$ unless $f(0)$ is real, because otherwise the range of $f(z)/f(0)$ could extend into the left-half plane. Is it better to initialize class member variables on declaration  private List&lt;Thing&gt; _things = new List&lt;Thing&gt;(); private int _arb = 99;   or in the default constructor?  private List&lt;Thing&gt; _things; private int _arb;  public TheClass() {   _things = new List&lt;Thing&gt;();   _arb = 99; }   Is it simply a matter of style or are there performance trade-offs, one way or the other? I'm trying to use the \citep command in Latex and my document class is elsarticle. The problem is that it displays numbers not authoryear citations in the text which is what I'm looking for. Here are related parts of my code:      \documentclass[preprint,11pt]{elsarticle}      \usepackage{natbib}   ...      \bibliographystyle{plainnat}      \bibliography{ML}   And I'm obviously using the \citep command like this:      I once read \citep{edelman1993magnetic}   And my .bib file looks like this:  @article{wolf2009regional, title={Regional brain activation changes and abnormal functional connectivity of the         ventrolateral prefrontal cortex during working memory processing in adults with attention-deficit/hyperactivity disorder}, author={Wolf, Robert C and Plichta, Michael M and Sambataro, Fabio and Fallgatter,     Andreas J and Jacob, Christian and Lesch, Klaus-Peter and Herrmann, Martin J and     Sch{\"o}nfeldt-Lecuona, Carlos and Connemann, Bernhard J and Gr{\"o}n, Georg and others}, journal={Human brain mapping}, volume={30}, number={7}, pages={2252--2266}, year={2009}, publisher={Wiley Online Library} }   The result looks like:  I once read[1]   I'm looking for a result like this:  I once read(wolf., 2009)   Elsevier is actually looking for:  Text: All citations in the text should refer to:    Single author: the author's name (without initials, unless there is ambiguity) and the year of publication;  Two authors: both authors' names and the year of publication;  Three or more authors: first author's name followed by 'et al.' and the year of publication.    Thanks in advance Read it in the 90's. I remember one specific part where the inventor of the peeking mechanic has his Eureka moment, and has the presence of mind to give a thumbs-up/wave to the future, when they look back on his Eureka moment.  I also remember that they had computer screens that were like plastic cloth that they would just unfold on whatever surface was handy.  Sorry I don't have much more to go on.  Please and thank you! I'm looking for a javascript that can limit the number of lines (by line I mean some text ended by user pressing enter on the keyboard) the user is able to enter in textarea. I've found some solutions but they simply don't work or behave really weird. The best solution would be a jquery plugin that can do the work - something like , but it should be able to limit text line count not character count. How to show that $x^4+1$ is irreducible in $\mathbb Z[x]$ but it is reducible modulo every prime $p$?   For example I know that $x^4+1=(x+1)^4\bmod 2$. Also $\bmod 3$ we have that $0,1,2$ are not solutions of $x^4+1=0$ then if it is reducible the factors are of degree $2$. This gives that $x^4+1=(x^2+ax+b)(x^2+cx+d)$ and solving this system of equations $\bmod 3$  gives that $x^4+1=(x^2+x+2) (x^2+2x+2) \pmod 3$. But is there a simpler method to factor $x^4+1$ modulo a prime $p$? Word order: "10 minutes more" or "10 more minutes"? Best Pattern For Adding Commentary in align Environment? I've been using the align environment to line up equations in proofs/explanations/etc and I like to place parenthetical commentary for each step, similar to the code below:  \documentclass{article} \usepackage{amsmath} \begin{document}  \begin{align*}   f(ax + by) &amp; = f(ax) + f(by) &amp; (By Property 1) \\              &amp; = af(x) + bf(y) &amp; (By Property 2) \\ \end{align*}  \end{document}   The problem I have with this is that the commentary completely distorts the overall alignment of the equation area; far too much space is allocated to the column containing the commentary.  I would like, insofar as it is possible, for the equations themselves to be aligned in the center of the page and for the commentary to simply appear on the right without affecting the overall justification of the equations. What's the best way to achieve this? $\operatorname{Hom}(X \times Z, Y) \cong \operatorname{Hom}(X, \operatorname{Map}(Z, Y))$ is not true in $\textbf{Top}$ I read that in the category of topological space it is not true that $\operatorname{Hom}(X \times Z, Y) \cong \operatorname{Hom}(X, \operatorname{Map}(Z, Y))$ for every $X, Y, Z$ topological spaces. In particular, I read that this does not work when $Z = \mathbb{R} \setminus \{ 1/n \mid n \in \mathbb{N}\}$. This was not explained, i.e. there was no example.   I am looking for an example or – maybe better – just a hint.  EDIT   $\operatorname{Map}(Z, Y)$ is endowed with the compact-open topology $\cong$ means just bijection; i.e. there is already an obvious bijection as sets, but the claim is that (I think) sometimes the "output function" is not continuous What are all the font styles I can use in math mode? As can be seen in above picture, there are lots of fonts or font styles that can be used in math mode.  What are all the fonts or font styles I can use in math mode, and which packages are required in order to use them?  Let's assume I'm using standard Computer Modern or Latin Modern (lmodern) fonts.  Edit: It'd be great to see examples of what the different styles look like, probably via images.    I'm not interested in a reproduction of the picture, which can be found at ; the picture is for illustration purposes only. Furthermore, this is supposed to become a one-catches-all question for questions like the beforementioned. If I actually were looking for these fonts, I wouldn't just lazily ask here but look e.g. at  , tables 3.14 and 6.4 first.) How to prove a matrix is nilpotent? Given an $n\times n$ upper triangular matrix $A$ with zero on main diagonal, show that $A^n = 0$.   I did some matrix operation and noticed that the diagonal moves up, ultimately all entries will be zero. Is there a nicer way to do it? I´m having some trouble with my udev rule. At the moment, I had my udev rule setup to execute a script whenever a Android phone is connected to any USB port on the computer. But I don´t want the script to be executed from every USB port. I just want that the script to be execute in example when the phone is connected to the 4th USB port and nothing should happen when it is connected to 1st, 2nd or 3rd USB port.  How can I achieve that and how can I determine the for example 4th USB Port?  I would highly appreciate your help.  My current udev rule:  KERNELS="1-2:1.1", ACTION=="add", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}!="1d6b", ATTRS{idVendor}!="203a", ATTRS{idVendor}=="****", ATTRS{idProduct}=="****", RUN+="/usr/local/bin/tmp.sh $attr{serial}" How do I bleed Avid Elixir brakes My bike has a set of Avid Elixir R hydraulic brakes. The front brake barely goes on when I pull the lever and the back brake feels pretty soft. I think I need to bleed them. How do I go about doing this?  I think the brakes got like this because I pressed the brake level when the bike was upside down or when the wheel was removed putting the bike into my car. Confused AUC ROC score I am working on binary classification problem, I try to evaluate the performance of some classification algorithms (LR,Decission Tree , Random forest ...). I am using  a cross validation technique (to avoid over-fitting) with AUC ROC as scoring function to compare the performance of the algorithms, but I am getting a weird results with Random forest and AdbBoost, I have a perfect AUC_ROC score (i.e. =1) despite the fact that the recall(TPR) and FPR of this algorithms are different from 1 and 0 respectively .  def FPR(y_true, y_pred):     tn, fp, fn, tp = confusion_matrix(y_true, y_pred).ravel()     result = fp / (fp+tn)     return result def FNR(y_true, y_pred):     tn, fp, fn, tp = confusion_matrix(y_true, y_pred).ravel()     result = fn / (tp+fn)     return result FPR_scorer = make_scorer(FPR) FNR_scorer = make_scorer(FNR)     def get_CrossValResults2(model,cv_rst,bestIndx):     best=pd.DataFrame.from_dict(cv_rst).iloc[bestIndx]     roc=&quot;{:.12f}&quot;.format(best['mean_test_roc_auc'])     acc =&quot;{:.0%}&quot;.format(best['mean_test_accuracy'])     prec =&quot;{:.0%}&quot;.format(best['mean_test_precision'])     rec =&quot;{:.0%}&quot;.format( best['mean_test_recall'])     f1 =&quot;{:.0%}&quot;.format(best['mean_test_f1'])     r2=&quot;{:.2f}&quot;.format(best['mean_test_r2'])     g_mean=&quot;{:.2f}&quot;.format(best['mean_test_gmean'])     pr_auc=&quot;{:.8f}&quot;.format(best['mean_test_pr'])     fnr=&quot;{:.0%}&quot;.format(best['mean_test_fnr'])     fpr=&quot;{:.0%}&quot;.format(best['mean_test_fpr'])     rst = pd.DataFrame([[ model, acc,prec,rec,fpr,fnr,f1,roc,pr_auc,g_mean,r2]],columns = ['Model', 'Accuracy', 'Precision', 'Recall','FPR','FNR', 'F1-Score','ROC_auc','PR_auc','gmean','r2'])     return rst        cross_val_rst = pd.DataFrame(columns = ['Model', 'Accuracy', 'Precision', 'Recall','FPR','FNR', 'F1-Score','ROC_auc','PR_auc','gmean','r2'])              scoring = {'accuracy':'accuracy','recall':'recall','precision':'precision','fpr':FPR_scorer,'fnr':FNR_scorer,'f1':'f1' ,'roc_auc':'roc_auc','pr':'average_precision','gmean':Gmean_scorer,'r2':'r2'}     param_grid = {'n_estimators': [200],               'max_depth': [80,90],               'min_samples_leaf': [2,3, 4],             'min_samples_split': [2,5,12],             'criterion': [ 'gini'],              'class_weight' : [class_weights], 'n_jobs' : [-1]}  clf = GridSearchCV(RandomForestClassifier(class_weight=class_weights), param_grid, cv=kfold,scoring=scoring,refit=refit)#Fit the model bestmodel = clf.fit(X,Y)       cross_val_rst = cross_val_rst.append(get_CrossValResults2(model='Random Forrest',bestIndx=bestmodel.best_index_,cv_rst=bestmodel.cv_results_),ignore_index=True) Delete all but the most recent n file for each group of files that share the same prefix in a directory My question is a bit different from some older questions simply asking for "deleting all but the most recent n files in a directory".  I have a directory that contains different 'groups' of files where each group of files share some arbitrary prefix and each group has at least one file. I do not know these prefixes in advance and I do not know how many groups there are.  EDIT: actually, I know something about the file names, that is they all follow the pattern prefix-some_digits-some_digits.tar.bz2. The only thing matters here is the prefix part, and we can assume that within each prefix there is no digit or dash.  I want to do the following in a bash script:   Go through the given directory, identify all existing 'groups', and for each group of files, delete all but the most recent n files of the group only. If there are less than n files for a group, do nothing for that group, i.e. do not delete any file for that group.   What is a robust and safe way of doing the above in bash? Could you please explain the commands step-by-step? I have the following validation rule:  AND(  $Profile.Name &lt;&gt; 'System Administrator',  OR(  ISPICKVAL(PRIORVALUE(Level__c), "Archived"),  ISPICKVAL(PRIORVALUE(Level__c), "Closed")  )  )   This validation rule is on the opportunity object, and what I want to achieve is, if the picklist Level__c is either set to Archived or Closed, the opportunity record can only be edited by the System Administrator.  For some reason though, the validation rule also triggers, when I want to set the Level__c to Archived or Closed. But this is not what I want.   Any idea what's wrong with the validation rule?