Instead of  WHERE foo = 'one' and bar = 'two'   I would like to store parts of it in a variable to allow changing WHERE clause easily  DECLARE @var VARCHAR(50) SET @var = "foo = 'one' and bar = 'two'" ... ... WHERE @var   This notation doesn't work but I think it indicates what I am trying to do. Does anyone have any ideas?
Problem:  Ajax suggest-search on [n] ingredients in recipes. That is: match recipes against multiple ingredients.  For instance: SELECT Recipes using "flower", "salt" would produce: "Pizza", "Bread", "Saltwater" and so forth.  Tables:  Ingredients [     IngredientsID INT [PK],     IngredientsName VARCHAR ]  Recipes [     RecipesID INT [PK],     RecipesName VARCHAR ]  IngredientsRecipes [     IngredientsRecipesID INT [PK],     IngredientsID INT,     RecipesID INT ]   Query:  SELECT     Recipes.RecipesID,     Recipes.RecipesName,     Ingredients.IngredientsID,     Ingredients.IngredientsName FROM     IngredientsRecipes      INNER JOIN Ingredients     ON IngredientsRecipes.IngredientsID = Ingredients.IngredientsID      INNER JOIN Recipes     ON IngredientsRecipes.RecipesID = Recipes.RecipesID WHERE     Ingredients.IngredientsName IN ('salt', 'water', 'flower')   I am currently constructing my query using ASP.NET C# because of the dynamic nature of the WHERE clause.  I bites that I have to construct the query in my code-layer instead of using a stored procedure/pure SQL, which in theory should be much faster.  Have you guys got any thoughts on how I would move all of the logic from my code-layer to pure SQL, or at least how I can optimize the performance of what I'm doing?  I am thinking along the lines of temporary tables:  Step one: SELECT IngredientsID FROM Ingredients and INSERT INTO temp-table  Step two: SELECT RecipesName FROM Recipes joined with IngredientsRecipes joined with temp-table.IngredientsID
Calculating $1+\frac13+\frac{1\cdot3}{3\cdot6}+\frac{1\cdot3\cdot5}{3\cdot6\cdot9}+\frac{1\cdot3\cdot5\cdot7}{3\cdot6\cdot9\cdot12}+\dots? $ How to find infinite sum How to find infinite sum $$1+\dfrac13+\dfrac{1\cdot3}{3\cdot6}+\dfrac{1\cdot3\cdot5}{3\cdot6\cdot9}+\dfrac{1\cdot3\cdot5\cdot7}{3\cdot6\cdot9\cdot12}+\dots? $$   I can see that 3 cancels out after 1/3, but what next? I can't go further. Chaining the Imperius curse What would happen if a wizard w successfully casts the Imperius curse on a equally powerful wizard a and then order him to cast the same curse back on w?  Follow-up questions.  It is established that casting the curse can be done .  What would happen in the case of a chain of casts that would hit back the original wizard? w-&gt;a-&gt;b-&gt;c-&gt;w  The original wizard could rather command the last wizard c, in the chain, to curse his first target instead. w-&gt;a-&gt;b-&gt;c-&gt;a wich would create a loop of a-&gt;b-&gt;c-&gt;a...  In what kind of limbo would wizards a, b and c exist in?  ( for the sake of simplicity, we can assume that every curse target is not very good at resisting the curse ) Changing CSS Values with Javascript Where has all the RAM gone? How to place an image at the right top of a document? I've been learning LaTeX and this community has been very helpful. Currently, I'm trying to set up corporate letters but as a newbie I'm encountering a  of , so I'm posting them one by one instead of putting it in the comments... maybe this helps others as well.  Anyway, I am trying to implement this  that indicates that I can use vbox to float an image to the right of my header. I almost have this working, but I now try to adjust this to get my logo to stick to the top of the page. So I want to have this at the right top of my document. This is quite difficult! When I place the vbox, it creates unwanted spacing, for some odd reason. So I can not get the logo to be at the right top, even though I 'reset' every possible margin to 0 (in my opinion). Here is my distilled code:  \documentclass[a4paper]{article} \usepackage{graphicx} \graphicspath{{./img/}} \usepackage{color} \usepackage{xcolor} \definecolor{orange}{HTML}{DD4616} \definecolor{white}{HTML}{FFFFFF} \usepackage{fullpage} \usepackage[margin=0cm, paperwidth=215.9mm, paperheight=30mm,top=0cm]{geometry} \parindent=0pt  \begin{document} \fboxsep0pt  \pagecolor{orange}   \fbox{\vbox to 0pt{\hfill\fbox{\includegraphics[height=3cm]{logo}}}}  \end{document}   I've used a full black logo for illustrative purposes. Here you can see this:    The black line is the vbox border. For some reason, it jumps down. The only way to get rid of this that I found out about is this:    Which means that I need to add:  \edef\theprevdepth{\the\prevdepth}\nointerlineskip \vbox to 0pt{...}\prevdepth=\theprevdepth   But there are two problems with this:   I get an error with I try this (Improper \prevdepth.) More importantly, I really want to understand my code at this point, and get to master the basics of positioning elements. This feels overcomplicated and I do not understand it at all.    Is there any easy way to position an image at the right top of a document? How do I remove a file named "NUL" on Windows? I have a Windows XP box (NTFS filesystem) on which I found a file named NUL. I have not been able to remove this file in any usual way. The file appears to be owned by Administrator in the SYSTEM group, unlike any other file in the same directory (the other files are owned by my user id).  How do I get rid of this file? Where did it come from? Tasks in custom Environment I need to wrap a tasks environment inside a custom \NewEnviron. Apparently, tasks chokes on code besides its \task or \item due to the , presumably causing it to do so on \BODY. Any way to get around this? Exact error given is "Something's wrong--perhaps a missing \item", as per:  \documentclass[a4paper]{book} \usepackage{environ} \usepackage[more]{tasks}  \NewTasks[style=enumerate,counter-format=tsk[1]),label-width=2ex]{mytaskenum}[\item](3) \NewEnviron{mytaskenv}[1][Exercises]{   % Misc. stuff to precede the tasks env here   \begin{mytaskenum}   \BODY   \end{mytaskenum}   % Misc. stuff to follow }{}  \begin{document}  \begin{mytaskenv}   \item item 1   \item item 2   \item item 3 \end{mytaskenv}  \end{document} When I press F3 to see the debug screen in I use Minecraft 1.8.1, some information is missing.   Most notably, there are no X, Y, Z coordinates.     What happened to my debug overlay? How to concatenate text from multiple rows into a single text string in SQL server? I have a character playing a multiclass Barbarian/Monk. Does the resistance from rage combine with Deflect Missiles to negate the damage and make the reaction attack? Difference between $\mathbb C$ and $\mathbb R^2$ What are the basic differences between $\mathbb C$ and $\mathbb R^2$?  The points in these two sets are written as ordered pairs, I mean the structure looks similar to me. So what is the reason to denote these two sets differently? How are "related" questions selected? If $A\simeq\prod A_i$ then $\sum e_i=1$ Given $A$ commutative ring with unity. If we have rings $A_1,\dots, A_n$such that $A\simeq A_1\times \dots \times A_n$ there are $e_1,\dots,e_n$ idempotent elements of $A$ such that $e_1+\dots+e_n = 1$ and $e_i e_j =0$ if $i\neq j$.  I'm not sure how general the proof should be written...  The isomorphic relation suggest that if $f$ defines the isomorphism then there is a $(a_1,\dots, a_n)\in \prod A_i$ such that $f(a_1,\dots,a_n)=1\in A$. Could it work thinking of the idemmpotent terms as $e_i=(0,\dots,0, a_i,0, \dots,0)?$ This should satisfy $e_i e_j =0$ if $i\neq j$. But I have two problems with it (1) I don't see why $e_i$ should idempotent as no assumptions in regard to the existence of idempotent elements in $A_i$ has been made. (2) The sum $\sum e_i=1$ has no reason to be true. I'm in trouble with this homework.  Find the sum of the series $ 1 + \frac12 + \frac13 + \frac14 + \frac16 + \frac18 + \frac19 + \frac1{12} +\cdots$, where the terms are the inverse of the positive integers whose only prime factors are 2 and 3.  Hint: write the series as a product of two geometric series.  Ok, I found some patterns in these numbers, but I can't find the two series. Given two separate annulus with centers $[C_1,C_2]$ and their corresponding radii being $[R_1,r_1]$ and $[R_2,r_2]$ respectively, larger radius being $R$. There are methods to look at whether they are overlapping or not. If they overlap how to find the overlapping area. Is there any close form expression for it?  equation of first annulus   $r_1^2&lt;(x-x_{c1})^2 + (y-y_{c1})^2 &lt;R_1^2$   equation of second annulus  $r_2^2&lt;(x-x_{c2})^2 + (y-y_{c2})^2 &lt;R_2^2$  If there are three circles overlapping, we get overlapping area as solution to set of 4 in-equations by least squares approach(Though we don't end up getting total area but, area within tangents of circles ). How to install Canon LBP2900b drivers? nginx open reverse proxy? Somehow, and I'm not sure how, we have configured an nginx reverse proxy that is acting as an open proxy.  The log files tells us the matching requests are going against the following conf file:  map $http_upgrade $connection_upgrade {         default upgrade;         ''      close; }  access_log      /var/log/nginx/access.p.log; error_log       /var/log/nginx/error.p.log;  proxy_next_upstream     error timeout invalid_header http_500 http_502 http_503 http_504; proxy_buffers           8 32k; proxy_buffer_size       64k; proxy_http_version      1.1; proxy_set_header        Host            $host; proxy_set_header        X-Real-IP       $remote_addr; proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for; proxy_redirect          off; proxy_set_header        Upgrade         $http_upgrade; proxy_set_header        Connection      $connection_upgrade;  server {         listen          80;         server_name     ~first.*\.second\.com;          location / {                 resolver                172.16.1.1 172.16.1.2;                 proxy_pass              http://$host;                 proxy_read_timeout      7200s;         } }  server {         listen          443;         server_name     ~first.*\.second\.com;         ssl             on;          location / {                 resolver                172.16.1.1 172.16.1.2;                 proxy_pass              https://$host;                 proxy_read_timeout      7200s;         } }   The top-level conf file looks like this:  user nginx; worker_processes 8; pid /var/run/nginx.pid;  events {         worker_connections 4096;         # multi_accept on; }  http {      ##     # Basic Settings     ##      sendfile on;     tcp_nopush on;     tcp_nodelay on;     keepalive_timeout 65;     types_hash_max_size 2048;     # server_tokens off;      # server_names_hash_bucket_size 64;     # server_name_in_redirect off;      include /etc/nginx/mime.types;     default_type application/octet-stream;      ##     # Logging Settings     ##      access_log /var/log/nginx/access.log;     error_log /var/log/nginx/error.log;      ##     # Gzip Settings     ##      gzip on;     gzip_disable "msie6";      # gzip_vary on;     # gzip_proxied any;     # gzip_comp_level 6;     # gzip_buffers 16 8k;     # gzip_http_version 1.1;     # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;      ##     # nginx-naxsi config     ##     # Uncomment it if you installed nginx-naxsi     ##      #include /etc/nginx/naxsi_core.rules;      ##     # nginx-passenger config     ##     # Uncomment it if you installed nginx-passenger     ##      #passenger_root /usr;     #passenger_ruby /usr/bin/ruby;      ##      include /etc/nginx/conf.d/*.conf;     #include /etc/nginx/sites-enabled/*;   }  what here is causing this? When I capture packets using the packet analyser wireshark while visiting  I can see packets that use the HTTP protocol (e.g.a GET request). My Get request uses 4 protocols: Ethernet II, IPv4, TCP and HTTP.  For the IPv4 I can see my own local IPv4 address of my pc as the source, for the destination I see the IPv4 address 91.198.174.225. When I go to this address in my browser I get to some wikipedia related website that says'wiki does not exist'. Why am I not seeing the Hydrogen article when I go to that ip address? How do I SSH to machine A via B in one command? Reading list in topological QFT