How to modify and apply concatination on the following result  This is the first table:  DECLARE @item_tbl TABLE ( ItemId INT,Title NVARCHAR(20)) INSERT INTO @item_tbl VALUES (1,'Title 1'),(2,'Title 2') ,(3,'Title 3'),(4,'Title 4'),(5,'Title 5')   This is the second table:  DECLARE @item_ref TABLE (ReferenceId INT, FromItemId INT, ToItemId INT)  INSERT INTO @item_ref VALUES(1,1,2),(2,1,3),(3,4,5),(4,5,1)   There is some interelation between table 1 &amp; table 2  SELECT AA.Title, ISNULL(BB.Hasreferenceto,'') Hasreferenceto, ISNULL(CC.Isreferencedfrom,'') Isreferencedfrom FROM   @item_tbl AA LEFT JOIN ( SELECT A.FromItemId, B.Title Hasreferenceto FROM @item_ref A LEFT JOIN @item_tbl B  ON A.ToItemId =B.ItemId  ) BB ON AA.ItemId = BB.FromItemId LEFT JOIN ( SELECT C.ToItemId, D.Title Isreferencedfrom  FROM @item_ref C LEFT JOIN @item_tbl D ON C.FromItemId = D.ItemId ) CC ON AA.ItemId = CC.ToItemId   This is giving me:  +---------+------------------+--------------------+ | Title   | Hasreferenceto   | Isreferencedfrom   | +---------+------------------+--------------------+ | Title 1 | Title 2          | Title 5            | +---------+------------------+--------------------+ | Title 1 | Title 3          | Title 5            | +---------+------------------+--------------------+ | Title 2 |                  | Title 1            | +---------+------------------+--------------------+ | Title 3 |                  | Title 1            | +---------+------------------+--------------------+ | Title 4 | Title 5          |                    | +---------+------------------+--------------------+ | Title 5 | Title 1          | Title 4            | +---------+------------------+--------------------+   What i want is:  +---------+------------------+--------------------+ | Title   | Hasreferenceto   | Isreferencedfrom   | +---------+------------------+--------------------+ | Title 1 | Title 2, Title 3 | Title 5            | +---------+------------------+--------------------+ | Title 2 |                  | Title 1            | +---------+------------------+--------------------+ | Title 3 |                  | Title 1            | +---------+------------------+--------------------+ | Title 4 | Title 5          |                    | +---------+------------------+--------------------+ | Title 5 | Title 1          | Title 4            | +---------+------------------+--------------------+   Can someone help in this please?
I'm trying to migrate a MySQL-based app over to Microsoft SQL Server 2005 (not by choice, but that's life).  In the original app, we used almost entirely ANSI-SQL compliant statements, with one significant exception -- we used MySQL's group_concat function fairly frequently.  group_concat, by the way, does this: given a table of, say, employee names and projects...  SELECT empName, projID FROM project_members;   returns:  ANDY   |  A100 ANDY   |  B391 ANDY   |  X010 TOM    |  A100 TOM    |  A510   ... and here's what you get with group_concat:  SELECT      empName, group_concat(projID SEPARATOR ' / ')  FROM      project_members  GROUP BY      empName;   returns:  ANDY   |  A100 / B391 / X010 TOM    |  A100 / A510   So what I'd like to know is: Is it possible to write, say, a user-defined function in SQL Server which emulates the functionality of group_concat?   I have almost no experience using UDFs, stored procedures, or anything like that, just straight-up SQL, so please err on the side of too much explanation :)
Overriding the final destination of the OAuth2.0 flow from a custom OAuth2.0 Auth provider Background:  I have created a custom Auth. Provider in Salesforce to reach out to an authorization server that isn't on the default list of Provider Types. I used  as a good starting point to extend the Auth.AuthProviderPluginClass. Once appropriately added to my org, it then became an option on the list of Provider Types. I was able to create an Auth. Provider using that new provider type and it works to initiate the OAuth2.0 flow. I am appropriately able to get the access token and refresh token from the authorization server.  The Problem:  As it currently stands, we will have users click on a button that will send them to the provided "OAuth-Only Initialization URL" link that was generated when I created the actual Auth. Provider record. The trick is that when the OAuth2.0 flow is completed, the user is redirected back to the Salesforce Setup Home page, and I don't see a good way in the documentation to override the final destination to be something else (like a success page or something).  Question:  Does anyone know of a way to override the final destination of the OAuth2.0 flow from a custom OAuth2.0 Auth provider?    UPDATE: I tried using the startUrl (and also tried retUrl for good measure) as query params, but doing so didn't change the behavior after the OAuth2.0 flow finished.  Meaning, both of the following URLs gave me the same final destination as not having any query params at all:  https://&lt;scratch org random url&gt;.my.salesforce.com/services/auth/oauth/MyCustomAuthProvider?retUrl=lightning%2Fpage%2Fhome   https://&lt;scratch org random url&gt;.my.salesforce.com/services/auth/oauth/MyCustomAuthProvider?startUrl=lightning%2Fpage%2Fhome     Another Update: This WORKED:  https:/&lt;scratch org random url&gt;.my.salesforce.com/services/auth/oauth/MyCustomAuthProvider?startURL=%2Flightning%2Fn%2FCustomPage   Apparently, it was important to add the leading /, (of course, url encoded to be %2F) and %2Flightning%2Fpage%2Fhome gets interpreted as the setup home and sends you there.    (Parallel posted to Salesforce Dev Forum: ) Lebesgue integral uniform convergence Let $f_n, f \colon [a,b] \to \mathbb{R}.$ Show that, if $f_n \to f$ uniformly, then the Lebesgue integrals are equal, i.e. $\int f = \lim \int f_n$.  This is clearly true for continuous functions, but how do I handle the case of non-continuous functions? The  doesn't give me much hope, but I'm hoping it's an undocumented (and/or GNU-specific) feature. Since upgrading to 13.10, I can't log in to unity desktop. Light dm works correctly, but attempting to log in tries to start the session then drops back to light. I've already dropped to terminal (ctrl+alt+f2) and done this:  sudo apt-get update  sudo apt-get install --reinstall ubuntu-desktop  sudo apt-get install unity   Logging in as a guest session also fails. Logging in to other window managers works with varying degrees of success.  Note: I have Cinnamon 2.0 installed from PPA.  I'm using a 2 monitor setup.  Also of note is that the session prior to my upgrade to 13.10 the background of unity failed to display at all, instead showing what was there in the screen buffer from the previous frame. The entire OS worked correctly otherwise though, so I just ignored it for the session. No other upgrades or even updates were done prior to this occurring.  My upgrade path to 13.10 was basically this: Install 13.04 alongside Windows 7, use ubuntu as a glorified web browser for a while, get updates (in preparation for 13.10), install 13.10.  I also used Unity Tweak Tool to change some aspects of unity, particularly auto-hide.  Any help or ideas would be appreciated, as I'm typing this on my phone :( Are software titles italicized? The titles of freestanding works (books, movies, plays, albums, etc.) are italicized; smaller parts within these works (chapters in a book, articles in a magazine, songs within an album) are not (they are put in quotes, instead).  How are software titles treated?  My understanding is that if a particular program resembles a book or a dramatic work (like a video game), its title is italicized -- otherwise, it is treated as a proper noun, just like any other product.     I played Grand Theft Auto, instead of reading "Democracy in Ancient Greece" in Microsoft Encarta and preparing my presentation in PowerPoint.   Is this approach correct? Who was/were the first Jedi? Tracking down an old sci-fi book I'm trying to track down an old sci-fi book I read when I was a teenager.  The book was at the Cottage Grove, OR Public Library around 1982-1985.  The plot followed a brother and sister who were scientists or spies, or both.  The brother once used a series of pills to change his weight, height and appearance.  Towards the end of the book, the brother takes a space ship that his sister invented, removes a governor so that he can travel faster than the speed of light and goes back in time several hours.  This is really vague, but thanks for any leads you can share. How do I delete Windows.old in Windows? I used to run Windows 7 32 bit, but installed the 64 bit version because of a RAM upgrade. During the installation I got this message:      The partition you selected might contain files from a previous Windows installation. If it does, these files and folders will be moved to a folder named Windows.old. You will be able to access the information in Windows.old, but you will not be able to use your previous version of Windows.   The C:\ drive now has two (2) Windows folders:   Windows (15.3 GB) Windows.old (15.7 GB)     Don't see why I need the Windows.old taking over 15GB of space on my hard drive so I tried to delete it. It didn't work.  How can I safely delete this folder? Logitech LS21 recognized as 2.0 system - Windows 8.1 doesn't detect Subwoofer I got my dad a Logitech LS21 system for Christmas. It's a 2.1 system, but it's recognized in Windows 8 as a 2.0 system (it says there is no subwoofer connected).    How would I go about getting the sub recognized?  It plays some sound now, but it's so quiet you can't hear it without putting your ear right next to it. How to align checkboxes and their labels consistently cross-browsers This is one of the minor CSS problems that plague me constantly. How do folks around Stack Overflow vertically align checkboxes and their labels consistently cross-browser? Whenever I align them correctly in Safari (usually using vertical-align: baseline on the input), they're completely off in Firefox and IE. Fix it in Firefox, and Safari and IE are inevitably messed up. I waste time on this every time I code a form. Here's the standard code that I work with:   &lt;form&gt;     &lt;div&gt;         &lt;label&gt;&lt;input type="checkbox" /&gt; Label text&lt;/label&gt;     &lt;/div&gt; &lt;/form&gt;    I usually use Eric Meyer's reset, so form elements are relatively clean of overrides. Looking forward to any tips or tricks that you have to offer! Getting error using JMeter behind a proxy I am new to JMeter and trying to run a test from behind a corporate proxy. I read on the same from apache site and followed the same process so as to run the test. However, i am still  unable to record a test from behind the proxy.      This message always appears after pressing on 'Start' recording:     After that, I have changed apache port to 8000 as in below and made it different      This time after pressing on start was this message I really can't understand what Leonard Susskind means when he says in the video  that information is indestructible.  Is that information that is lost, through the increase of entropy really recoverable?   He himself said that entropy is hidden information. Then, although the information hidden has measurable effects, I think information lost in an irreversible process cannot be retrieved. However, Susskind's claim is quite the opposite. How does one understand the loss of information by an entropy increasing process, and its connection to the statement “information is indestructible”.  Black hole physics can be used in answers, but, as he proposes a general law of physics, I would prefer an answer not involving black holes. In Captain America: Civil War, T'Challa takes the mantle of the Black Panther after his father is killed. As the Black Panther, he appears to have enhanced abilities.  In , the Russos talk about T'Challa having superpowers and being enhanced during Civil War     JOE: It can absorb the energy, so it’s much harder to damage him as a character, and you can see that in the movie he can take a lot of punishment including bullets to the face. He is very well trained. He’s from one of the wealthiest countries on the planet, so there’s great infrastructure there; very technologically advanced country. So he’s been trained at the highest levels to fight, but he also has his own superpowers, which derive from the mythology of his nation. Those will be explored more in Black Panther, it’s clearly evident when he’s able to fight the Winter Soldier out of costume, and go toe-to-toe with him, that he is an enhanced individual.    In Black Panther, we see that in order to become the Black Panther,       one must imbibe juice from the heart-shaped flower and visit the spirit plane after being buried.   But before this,       T'Challa must have his Black Panther powers removed prior to the ritual combat challenge, which he does twice in the film.   This raises the question of how T'Challa could have possibly become the Black Panther abroad - or if he even really had.  How did Black Panther have his powers during Civil War? How can I show that if the second fundamental form of a surface is identically equal to zero, then the surface is a plane? This is my question:  Let P be a plane considered as a surface in 3-space. Show that its second fundamental form is zero. Conversely, show that if the second fundamental form of a surface is identically zero then the surface is a plane.  So far I have that the general equation of the plane is $$ax+by+cz+d=0.$$ Then $$M(u,v)=(u,v,\alpha u + \beta v + \gamma),$$ where $a,b,c,d,\alpha,\beta, \gamma$ are all constants and $c\not=0$. Then $M_u=(1,0,\alpha)$ and $M_v=(0,1,\beta)$. I know that $\vec{n} =\frac{M_u \times M_v}{|M_u \times M_v|}$ which gives $$ \vec{n}=\frac{(-\alpha,-\beta, 1)}{\sqrt{\alpha^2+\beta^2+1}}.$$ Hence, the unit norm is a constant. $$ M_{uu}=M_{uv}=M_{vv}=0$$ Hence $l=m=n=0$, so the second fundamental form is $$ ldu^2+mdudv+ndv^2=0.$$  Now I need to show the converse, but I don't know how. Please help :) Fourier series identity I need to prove that $\dfrac{a \sin(bx)}{1 - 2a \cos(bx) + a^2} = \sum_{n=1}^\infty a^n \sin(nbx)$ where $|a| &lt; 1$.  It seems that this can be proved by using Euler's formula identities for $\cos(bx)$ and $\sin(bx)$ and substituting $z = e^{ibx}$. From that, I get $$ \dfrac{a \sin(bx)}{1 - 2a \cos(bx) + a^2} = \dfrac{a (z - 1/z)}{2i(1 - a(z + 1/z) + a^2)}$$ $$= \dfrac{a (z^2 -1)}{2i(z - a(z^2 +1) + za^2)}$$ $$= \dfrac{a (z^2 -1)}{-2ai(z^2 - z(1-a^2)/a + 1)}$$  I don't understand what I am supposed to do next. Are locks unnecessary in multi-threaded Python code because of the GIL? If you are relying on an implementation of Python that has a Global Interpreter Lock (i.e. CPython) and writing multithreaded code, do you really need locks at all?  If the GIL doesn't allow multiple instructions to be executed in parallel, wouldn't shared data be unnecessary to protect?  sorry if this is a dumb question, but it is something I have always wondered about Python on multi-processor/core machines.    same thing would apply to any other language implementation that has a GIL. Why my sql query run faster than my stored procedure? I am trying to write a script in MYSQL Workbench to update my database every day using stored procedure but I find it too slow compared normal query or temporary tables. If i use temporary table the time of execution : 6 second but my stored procedure 370 second.  I really need help.        CREATE DEFINER=`datasll`@`...` PROCEDURE `product`()       BEGIN       EXPLAIN SELECT                cs.id,              cs.fk_c,              cs.so,               cs.pr,              cs.date,              cs.o_p,              cs.sh_c,              cs.x,              LEFT(cs.x,2),              cs.doc,              cs.fk_op,              cc.id_c_c,              cc.name,              cc.descrip,              left(cc.n_o,3) as bon,              cc.fk_c_br,              cc.de,              cc.m_mat,              cc.color,               cc.fk_c_s       FROM             data_pro.catas cs        LEFT OUTER JOIN             data_pro.c_co cc ON  data_pro.cs.fk_c_c = data_pro.cc._id_cc       WHERE             data_pro.cc.pap = 1       AND   data_pro.cc.stati = 'b';       END   When i use EXPLAIN this's the result :   Many Thanks for any help. When there are several cottages each with several tariffs (depending on the season), should the plural be "cottage tariffs" or "cottages tariffs"?  For context, this is to be a section title on a website renting out the cottages.  An explanation of the grammatical rules would be helpful. Version Control: Entire site or just pieces? I've been using git to track changes in the plugins and themes I've developed for different sites. Each plugin or theme has their own repository in whichever local install of WordPress I happen to be using for that project. This works fine when I'm just working on one solitary plugin or theme.  But when I have a local version of an entire site which is a collection of different plugins, themes, WordPress core, etc. Should I be keeping that entire directory under version control?  Is there a best practice to always have a collection of repositories for each theme/plugin, or for each client site to have one monolithic repository that includes all the code used in the project (including the latest copy of WordPress via svn.) Refreshing open attribute table in ArcMap using ArcPy rather than ArcObjects? I am running the Calculate Field GP tool from the arcpy in ArcMap. When a row value is updated, it does not show up untill I use the Reload Cache tool (Table Options > Reload Cache). How do I refresh the attribute table automatically without using ArcObjects?  I have tried updating the definition query as @blah238 suggested , but this doesn't help. Resetting the data source is not an option because the feature class might be in the editing session and I don't want to lose the connection to the source data.