CREATE TABLE logistics (     id int auto_increment primary key,     campaign VARCHAR(255),     process_status VARCHAR(255),     delivery_type VARCHAR(255),     quantity INT );  INSERT INTO logistics (campaign, process_status, delivery_type, quantity ) VALUES  ("C001", "offer", "fedex", "500"), ("C001", "offer", "fedex", "200"), ("C001", "order", "ubs", "400"), ("C001", "shipped", "ubs", "100"),  ("C002", "offer", "fedex", "800"), ("C002", "offer", "fedex", "100"), ("C002", "order", "fedex", "650"), ("C002", "shipped", "fedex", "250"),  ("C003", "offer", "fedex", "730"), ("C003", "order", "fedex", "620"), ("C003", "shipped", "dhl", "530"),  ("C004", "order", "fedex", "200"), ("C004", "shipped", "fedex", "130"),  ("C005", "order", "fedex", "900"), ("C005", "shipped", "ubs", "475"),  ("C006", "order", "fedex", "635");   Expected Result  campaign      process_status       delivery_type      quantity C001          offer                fedex              700 C001          order                ubs                400 C001          shipped              ubs                100 C003          offer                fedex              730 C003          order                fedex              620         C003          shipped              dhl                530 C005          offer                fedex              900 C005          shipped              ubs                475     In the above table I have different campaigns, their process_status and delivery_type.  Now, I want to extract all campaigns which switch their delivery_type between different process_status.   Therefore, I am looking for a query that does something like this:  SELECT campaign, process_status, delivery_type, quantity FROM logistics WHERE delivery_type differes in different process_status   I have no clue how the WHERE condition must look to achieve the expected result.  Do you have any idea?
This is a very basic query I can't figure out....  Let's say I have a two column table like this:  userid  |  roleid --------|--------    1    |    1    1    |    2    1    |    3    2    |    1   I want to get all distinct userids that have roleids 1, 2 AND 3.  Using the above example, the only result I want returned is userid 1.  How do I do this?
Add a transparent image on top of a material I'm designing this animal-type creature, and want to add a transparent .png image to its face with the face features (object has a subsurf). On the left is the image with the features, on the right is the part of the object where I want it to be.    I tried to import the image as a plane, but matching the shape of the plane with the face didn't work, and the lines of the face left shadows on the head, and could be seen as a different object from some angles (although it's the closest I've gotten yet). It looked like this:    So , I tried selecting the faces of the head that the features should go over, and create a new material for it. Unfortunately, since the .png is transparent, the result produced was this:    (where it's impossible to tell the transparency from a black background default color, and where I wouldn't know where to start to adjust size and position).  I also tried UV mapping, but then the whole object became black with the features repeated all over.   Is it something I have to go into Nodes for? I'm kind of stuck here. Creating a new material and applying it is simple, but applying a material that is an image is a bit more complex it seems... Ideally, I would reproduce the same technique for the adhesive bandage on its arm (seen on the right of image 1). How to create a sequence with leading zeroes using brace expansion When I use the following, I get a result as expected:  $ echo {8..10} 8 9 10   How can I use this brace expansion in an easy way, to get the following output?   $ echo {8..10} 08 09 10   I now that this may be obtained using seq (didn't try), but that is not what I am looking for.  Useful info may be that I am restricted to this bash version. (If you have a zsh solution, but no bash solution, please share as well)  $ bash -version GNU bash, version 3.2.51(1)-release (x86_64-suse-linux-gnu) Is there a term for coining a phrase for a word that already exists? Why does inertia happen? In  R P Feynman relates a story where his father told him that, even though we know the word "inertia" and what it means, nobody knows why inertia happens. Is that still true? How to inset a face? I am trying to set up a Minecraft rig mouth that will have more controls and will be rounded, but I am having issues trying to figure out what this guy did here. First, he did what looked like a loop cut and slide, but instead of drawing a line it selected all the edges it passed through. He then cut to a new clip where the mouth was already set up like this.    The video is in 3 times speed but if you download a youtube plugin you can slow it down to 0.25 speed of the video and then if you do the spacebar trick you can slow it down so it shows 1 frame at a time and it is really slow.  if you want or need to see the video.  All I am asking is how can I create those 8 basic segments. How to call a constructor on an already allocated memory? How can I call a constructor on a memory region that is already allocated? In the decimal system: $...-3, -2, -1, 0, 1, 2, 3...$ In the binary system: $...-11, -10, -1, 0, 1, 10, 11...$ In the unary system: $-111, -11, -1, \text{ ??? }, 1, 11, 111...$   I was only able to find a related question but none with an answer so far: Can I connect to a sandbox using JWT Flow and Prod connect app? I'm trying to connect to a sandbox using the sfdx cli and the JWT flow through force:auth:jwt:grant. According to , we can use the same connected app information from Production to connect to our Scratch Org.  Is it something that should work for sandbox too ? I'm getting a "Failed: Not approved" error.  Connected app in sandbox comes from the refresh but has a different consumer key. The Permission set is set correctly on my user.  Is there a way to connect to a recently refreshed sandbox using the JWT flow (without manually changing something like the consumer key) ? UILabel truncate tail and skip not complete word Divergence of $\frac{ \hat {\bf r}}{r^2} \equiv \frac{{\bf r}}{r^3}$, what is the 'paradox'? Grant the OP a binding close as duplicate vote Since the  to the close as duplicate mechanism it is a lot more visible to the OP that there is/might be a duplicate to their question. Empirically, I've noticed a lot more people agreeing, in the comments under their question, that their question is a dupe.   For instance, :        I'm aware that allowing  is  (back in the stone age) but now Stack Exchange is so much larger, and Stack Overflow is groaning under the weight of questions, I think this should be partially revisited.  Based on the principle that the simplest way to keep a site clean is to have as many people as possible nibbling away, I propose that the OP gets granted a binding close-as-duplicate vote.  It should simply be an additional line in the banner, which is . It might be something like this:     This question may already have an answer here:   &nbsp; "" 3 answers   &nbsp; Does this fully answer your question?  Yes / No   I'm not wedded to the Yes / No thing I just can't think of a better way at the moment.  Clicking on Yes would take the OP to the close as duplicate dialogue with that question highlighted. If there are multiple duplicate questions you'd need to ask the OP multiple times. A No could be used to track the relative success of the project, i.e.   Whether the question subsequently gets closed. Whether the question gets reopened again. How many times the OP actually clicks. How many times the OP disagrees with the analysis of the community.   Potentially, a No could be used to open a comment dialogue asking the OP to explain why they think their question is not a duplicate thereby stopping them simply putting "this is not a duplicate" in the question and formalising this process somewhat. Not sure about this idea...  I do not think this should be restricted by reputation, anyone should be able to close their own question as a duplicate. It gives people with lower reputation a more positive experience of the closing process and emphasises the importance of duplicate finding.  Most importantly, self-closes should not, initially, count towards the question ban. We can help new users learn how to use a lot more of the site than they might otherwise see and encourage them to search for duplicates more thoroughly. If the OP then goes on to do the same thing 10 times in a row then you can start using it toward the ban as they're obviously using the users as a personalised search service but at least the first 3-4 times this should not have any effect.  This question is, deliberately, only requesting 20% of the linked question (from 2009) and then only based on the new UI. The linked question asks for binding migration votes etc, which I do not want to see and I am not requesting a binding close-as-duplicate for the OP until someone else has already voted to close (though I think if the OP has 3k rep this might be allowable). This, I hope, addresses the concern's raised in the linked question and explains why this is not a duplicate of that question. I am trying to implement  using additive ElGamal.  I am trying to run the full protocol mentioned in Section 3.4 on the following inputs:   $p = 17$ (prime) $g = 6$ (generator) $x = 5$ (private key) $k = g^x \pmod p = 6^5 \pmod{17} = 7$ (public key)   Suppose the clients inputs are 1, 2. Then $P(x) = (x-1)(x-2) = x^2-3x+2$, and therefore the coeffiecients to encrypt are $(1, -3, 2)$. I chose $y = 10$ and so the encrypted values are:   $1$ becomes $(15,12)$ $-3$ becomes $(15, 1)$ $2$  becomes $(15, 4)$.   The Server Side Input Set $S=\{1\}$ and the random value $r0$ corresponding to $\{1\}$ is $r_0=2$.    With the above problem in context, I have some questions:   What does P 0,j refer to in Step 7. Can you please give an example? In Step 8, suddenly variable i is introduced along with j. What does i, j, refer to? In Step 8, ENC() function has a ; in between. How do we interpret ENC(a;b)? From this paper:     Shouldn't $du$ be $dt$? And also how do you get from that line to the final result if $du$ is not $dt$? Installing to SDCard by default I would like to know whether there is a way to tell Android to install applications on the micro SD card by default instead of having to download applications to internal memory first and then having to move them to the SD card manually.  Thanks Solve for $x$ in the $80^\circ$-$80^\circ$-$20^\circ$ triangle I've been solving this for days but I still I couldn't solve this. Can I know how to solve $x$ ? I'm getting this error:  ! Undefined control sequence. l.64 ...p(- \frac{E_j - E_i}{k_B T}) &amp; \quad \text                                                   {:  E_j &gt; E_i}\\ ?  ! Undefined control sequence. l.65     1 &amp; \quad \text                         {:  E_j&lt;E_i}\\ ?    which is from this:  \begin{equation}\label{eq:hop} w_{i,j}=w_0 exp(-2 \gamma R_{i,j})\left\{    \begin{array}{l l}     exp(- \frac{E_j - E_i}{k_B T}) &amp; \quad \text{:  E_j &gt; E_i}\\     1 &amp; \quad \text{:  E_j&lt;E_i}\\   \end{array} \right. \end{equation}   But I don't understand why I get the error. This is my header:  \documentclass[11pt]{iopart} %\newcommand{\gguide}{{\it Preparing graphics for IOP journals}} %Uncomment next line if AMS fonts required \usepackage{iopams} \usepackage{graphicx, wrapfig} \usepackage{fixltx2e} \graphicspath{{images/}} \DeclareGraphicsExtensions{.pdf,.png,.jpg,.gif} \makeatletter \g@addto@macro\@floatboxreset\centering %\def\@cite#1{\textsuperscript{[#1]}} \makeatother   And my class file is the standard IoP one from   Can anyone help me get read of this error? Proving the Cauchy-Schwarz inequality by induction I ran across this problem in some old notes, and I frustratingly can't figure out how to do it   Let $a_i$ and $b_i$ be sequences of natural numbers, use induction to show  $\sum_{i=1}^n (a_ib_i)^{1/2} \le (\sum_{i=1}^n a_i)^{1/2}(\sum_{i=1}^n b_i)^{1/2} $  Obviously this is trivial to show for n=1. I can't make much progress on n+1. I've tried various tactics, squaring both sides etc.   Any hint or help would be appreciated. Thanks. Applying graduated renderer in PyQGIS? Just trying to run the following code already given in the pyqgis cookbook to create graduated colors symbology (as in example with 2 classes)  I define the source info for the shapefile but when I run execute the code within my test-plugin, it just adds the layer without classifiying. Just adds as usual, all polylines appear same.  Any solution or working code/method?  link to code in cookbook   from qgis.core import  (QgsVectorLayer, QgsMapLayerRegistry, QgsGraduatedSymbolRendererV2, QgsSymbolV2,QgsRendererRangeV2)  myVectorLayer = QgsVectorLayer('C:/my_test_shape_file.shp', 'test_shp_file', 'ogr')  myTargetField = 'target_field' myRangeList = [] myOpacity = 1  # Make our first symbol and range... myMin = 0.0 myMax = 50.0 myLabel = 'Group 1' myColour = QtGui.QColor('#ffee00') mySymbol1 = QgsSymbolV2.defaultSymbol(myVectorLayer.geometryType()) mySymbol1.setColor(myColour) mySymbol1.setAlpha(myOpacity) myRange1 = QgsRendererRangeV2(myMin, myMax, mySymbol1, myLabel) myRangeList.append(myRange1)  #now make another symbol and range... myMin = 50.1 myMax = 100 myLabel = 'Group 2' myColour = QtGui.QColor('#00eeff') mySymbol2 = QgsSymbolV2.defaultSymbol(myVectorLayer.geometryType()) mySymbol2.setColor(myColour) mySymbol2.setAlpha(myOpacity) myRange2 = QgsRendererRangeV2( myMin, myMax, mySymbol2, myLabel) myRangeList.append(myRange2)  myRenderer = QgsGraduatedSymbolRendererV2('', myRangeList) myRenderer.setMode(QgsGraduatedSymbolRendererV2.EqualInterval) myRenderer.setClassAttribute(myTargetField) myVectorLayer.setRendererV2(myRenderer) QgsMapLayerRegistry.instance().addMapLayer(myVectorLayer)      @Kelly's code works perfectly.   However I noticed that both the code (one I have typed in my first message and yours in the 2nd message) DO NOT work in QGIS v1.7.3 but WORKS in QGIS v1.8.0. I think this was a bug(?) that already resolved in v1.8.0  And one more question;  Do you have any sample code for (natural breaks, Jenks) classification of the "numeric_attribute_field" based on given number of classes (i.e. no of classes will be a variable in the code, say "n", and I will pass that from the plugin GUI i.e. n = spinBox.value() ) I wanted to discuss my intuition of why we formulate the concept of continuity in terms of pre-image of open set is open instead of images for example if we consider $f(x) = c$ where $c$ is some constant, then that should be continuous, but if we formulated continuity in terms of images it won't be continuous. Is the reason we do it that way, because pre-images will always guarantee that function in the domain can only have $1$ value? For every matrix $A\in M_{2}( \mathbb{C}) $ there's  $X\in M_{2}( \mathbb{C})$ such that $X^2=A$?