Stored Procedure or a query for this special requirement I want to write a query or a stored procedure in SQL Server to solve this problem - I tried a lot but no chance !   I have this data in a SQL table and I want to make a special operation on it :   0   3   1   0   0   0   0   NULL    NULL    35  117461  Mark    CEO     OBAMA   NULL    PARIS   FaceBook    NULL          NULL  NULL    NULL    NULL    NULL    NULL    NULL    01/10/2015  Very Good 0   3   1   0   0   0   0   1901    6925    35  117461  Mark    CEO     OBAMA   Med1    PARIS   FaceBook    One2Few 20/10/2015  NULL    NULL    NULL    NULL    NULL    NULL           NULL NULL 0   3   1   0   0   0   0   2135    7835    35  117461  Mark    CEO     OBAMA   Soft1   PARIS   FaceBook    One2Few 27/11/2015  NULL    NULL    NULL    NULL    NULL    NULL           NULL NULL 0   3   1   0   0   0   0   2574    9575    35  117461  Mark    CEO     OBAMA   Med1    PARIS   FaceBook    GroupMe 17/03/2016  NULL    NULL    NULL    NULL    NULL    NULL           NULL NULL 0   3   1   0   0   0   0   2832    1849    35  117461  Mark    CEO     OBAMA   Tech1   PARIS   FaceBook    One2Few 30/05/2016  NULL    NULL    NULL    NULL    NULL    NULL           NULL NULL   What I want is to remove the duplication and group those 5 rows into one single row containing the important information:   0   3   1   0   0   0   0     Mark          CEO         OBAMA     Med1|Soft1|Tech1     PARIS     FaceBook    01/10/2015    Very Good       I explain :   The 7 first columns are count operation and it is always the same in each row.  A concatenation of values Med1|Soft1|Tech1 - when two Values are the same take only one.  Take the comment when it exists here =  "very Good"  - The comment will exist once.
Simulating group_concat MySQL function in Microsoft SQL Server 2005? 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 :)
Local anchor for group master (move/translate/offset of group master moves group instances)? Let's say I start with the default Blender (2.64) file, except I set the cube to be 1 for all dimensions. At that point, the cube is at xyz location (0,0,0).  Then, let's say I select the cube with right mouse button, and go to Object / Group / Create New Group, and confirm the name "Group" in the "Create New Menu" bar with [Enter]. The selection outline turns green, meaning it's a group "master" (as far as I can see).  Now, let's say I press Shift-A; and choose "Group Instance" > "Group", and set the new instance to Z=2.3; with all selected, the view looks something like this:    Now, let's say I deselect all with A, then select the group master with right-click; and let's say I move it to Y=-2; then the result is:    ... that is, it is noticeable that the group instance/clone also moved in respect to its center (note the group instance axes, which remain in the set position)! Which means, I guess, that groups are defined in respect to the global coordinate center (0,0,0) as anchor.   My question is: is it possible to define a group, but in respect to the, say, bounding box center of the group as anchor - such that when I move/translate the group master, the group instances would remain anchored at their set position (basically, at the center of the group instance axes)? Also, is this documented anywhere in Blender documentation (I had problems finding this info)? I have come across a question about determining possible minimal polynomials for a rank one linear operator and I am wondering if I am using the correct proof method.  I think that the facts needed to solve this problem come from the section on Nilpotent operators from Hoffman and Kunze's "Linear Algebra".     Question: Let $V$ be a vector space of dimension $n$ over the field $F$ and consider a linear operator $T$ on $V$ such that $\mathrm{rank}(T) = 1$.  List all possible minimal polynomials for $T$.   Sketch of Proof:   If $T$ is nilpotent then the minimal polynomial of $T$ is $x^k$ for some $k\leq n$.  So suppose $T$ is not nilpotent, then we can argue that $T$ is diagonalizable based on the fact that $T$ must have one nonzero eigenvalue otherwise it would be nilpotent (I am leaving details of the proof of diagonalization but it is the observation that the characteristic space of the nonzero eigenvalue is the range of T and has dimension $1$).  Thus the minimal polynomial of $T$ is just a linear term $x-c$.    Did I make a mistake assuming that $T$ can have only one nonzero eigenvalue?  Thanks for your help submitting a GET form with query string params and hidden params disappear How to retrieve checkboxes values in jQuery Why is "women" pronounced the way it is? As far as I know, it is the only word where wo is pronounced as wee. What is the reason for this? Does it have to do with the origin of the word? Deleted user's posts showing in 'First Posts' queue On Scifi.SE, a user had their account deleted this morning.  Also this morning, about half a dozen of "their" posts were in the First Posts queue.  The posts were all roughly a month old, and they all had the same disassociated user#.   one of them.  Why'd this person's posts show up in the First Posts queue?  Why do a deleted user's posts ever show up in that queue, when it's purpose is to help the community provide feedback to new users?  A deleted user is no longer a member of the community, and they're not even going to be able to act on any feedback. list files and store it in variables I'm new with shell programming. My goal is to give the user a selection which file should be run. I catch all available scripts in one var with:  var=$(find script*)   so far so good, this is the output:      echo $var     script1 script2 script3 scr...   now I want to store each file in a singel variable to run it in later selection  select SEL in script1 script2 script3 .......... case $SEL in         $Script1) echo ($Script1 will start) &amp;&amp; ./$script1 ;;         $Script2) echo ($Script2 will start) &amp;&amp; ./$script2 ;;         $Script3) echo ($Script3 will start) &amp;&amp; ./$script3 ;;         $Sc..) echo ($Scr.... will start) &amp;&amp; ./$scrip.... ;;         $Sc...) echo ($Sc...... will start) &amp;&amp; ./$scrip..... ;;         *) echo "choose on of the availabel files";;     esac done   I don't have a clue how should I should separate all files if I don't know how many and the exactly length of each file.  I tried to split with echo ${var[1]} and echo $var[1] but this dosn't work. I recive either a empty output or the whole string. How do I convert a light circuit with a single pole switch to use two 3-way switches? I have a box in the hall which includes a 3-way switch (with another switch at the other end of the hall), a single pole switch to the garage lights and a single pole switch to the exterior lights on the garage.  The single pole switch to the garage is wired with a 3 wire plus ground. The white and black wires feed the garage lights from the switch and the red wire feeds the garage ceiling outlets and is hot all the time.  In the garage I would like to add a 3-way switch for the garage lights and another 3-way switch for the exterior garage lights.  In other words I would like to be able to turn on both of those light locations from both the inside hall and the garage as well. I know that I will of course have to replace the existing single pole switches in the hall with 3-way switches and add a junction box in the garage with 2 3-way switches in it.  The thing that I don't know is what wiring connections I need to make.  Can you help? How to run long time process on Udev event? I want to run a ppp connection when my USB modem is connected, so I use this udev rule:  ACTION=="add", SUBSYSTEM=="tty", ATTRS{idVendor}=="16d8",\     RUN+="/usr/local/bin/newPPP.sh $env{DEVNAME}"  (My modem appears in /dev as ttyACM0)  newPPP.sh:  #!/bin/bash /usr/bin/pon prov $1 &gt;/dev/null 2&gt;&amp;1 &amp;   Problem:  The udev event fires, and newPPP.sh is running, but newPPP.sh process is killed after ~4-5s. ppp does not have time to connect (its timeout is 10s for dial up).  How can I run a long time process, that will not be killed?  I tried using nohup, but it didn't work either.  System: Arch Linux  Update  I found a solution , thanks to .  I use at now to run my job detached from udev process.  But the one question remains unanswered: Why do nohup and &amp; not work? How to disable all Vim-LaTeX mappings? I like some of the features provided by the Vim-LaTeX suite, but not all of them.  In particular, I dislike all of the mappings like [[ = \left[ \right] and the automatic placeholder stuff with &lt;++&gt;. I am a very fast typist but with that comes more typing mistakes, which I correct almost instantly by pressing backspace. Unfortunately, if something has automatically added a bunch of place-holders or expanded some expression, I then have to move around the document and remove more characters than necessary. For example, if I accidentally press [ twice, instead of only having to delete one character, I have to delete 10.  Having already looked through the documentation, and some of the source, I have managed to disable some of these "features", but not all of them:  In particular:  let g:Tex_SmartKeyBS = 0 let g:Tex_SmartKeyQuote = 0 let g:Tex_SmartKeyDot = 0   (Turn off maps for backspace, double quote and triple dot.)  let g:Imap_UsePlaceHolders = 0   (Turn off &lt;++&gt; placeholder insertion.)  But I can't seem to find a way of turning off the other stuff. Anyone have any suggestions?  Edit: I was able to "disable" some more things by setting:  let g:Tex_Leader = '`tex' let g:Tex_Leader2 = ',tex'   (Which stops some expansions but still not all. It's not really disabling it but just making it less likely that you're going to type in `texa as opposed to the potentially more common `a, for example.)  PS: Personally, I think it is very poor practice to make an optional package that, when installed, greatly changes the default handling of your system. I don't mind some intelligent source highlighting etc, or some new commands (that don't clobber any old ones), but it seems unhelpful to enable this drastic kind of key remapping by default. Why do ssh operations always ask for passphrase? (with ed25519) I just updated my ssh key and added a passphrase, however it constantly nags me for it now, such as when I do a git (or mercurial hg) push.  ssh-agent is running:  xxx  1303  1118  0 09:16 ?  00:00:00 /usr/bin/ssh-agent    /usr/bin/dbus-launch --exit-with-session     /usr/bin/im-launch mate-session   I tried ssh-add:  &gt; ssh-add Identity added: /home/…/.ssh/id_rsa (/home/…/.ssh/id_rsa) Enter passphrase for /home/…/.ssh/id_ed25519:  Could not add identity "/home/…/.ssh/id_ed25519":      communication with agent failed   What is missing?  16.04 Ubuntu Mate, in case it matters. Do you have to take the second leg of a domestic flight? Say I want to book a flight from Fort Lauderdale to Chicago.  Say the airline also flies to St. Louis from Fort Launderdale but has a connecting flight through Chicago.  If I book that flights from FLL->ORD->STL and just get off in Chicago, what possible problems can I run into, assuming I didn't check any bags and only have carry on?  This scenario exist for Southwest, but I wanted this be more of a general question that would apply to all airlines. StructureMap error when invalid controller I am using Structure map like the MVC storefront by Rob Conery does and I have an AdminController and so to get to it I just type:  website/Admin/action   however if I miss spell the controller name I get the error below:  Exception Details: System.ArgumentNullException: Value cannot be null. Parameter name: key  There error occurs on this line:  Controller controller = ObjectFactory.GetInstance(controllerType) as Controller;   Does anyone have any ideas on how I can handle this error or not allow it to happen at all and maybe just goto a 404 page??  Cheers in advance Ideals in ring of continuous functions $\mathcal{C}[0,1]$ ... NBHM- Algebra I would like to compile all questions I have encountered with Ideals in the ring $\mathcal{C}[0,1]$ of all continuous real valued functions and ask if there are any gaps.  Question is to see if :     the ideal $\mathcal{I}=\{f\in \mathcal{C}[0,1] : f(0)=0\}$ is maximal ideal in the ring $\mathcal{C}[0,1]$ of all continuous real valued functions.   What I have done so far is :  consider $\eta :\mathcal{C}[0,1]\rightarrow \mathbb{R}$ where $f\rightarrow f(0)$   $Ker (\eta) = \{ f\in \mathcal{C}[0,1] : f(0)=0\}$  I could see that for each $r\in \mathbb{R}$, I would set $f$ such that $f(x)=x+r$  So, $\eta$ is surjective.  So, I would get $\mathcal{C}[0,1]/\mathcal{I}\cong \mathbb{R}$  As $\mathbb{R}$ is a field so ia the quotient $\mathcal{C}[0,1]/\mathcal{I}$ which means that $\mathcal{I}$ is an ideal in $\mathcal{C}[0,1]$.    Now Another Question on same idea :  Question is to see if :     the ideal $\mathcal{I}=\{f\in \mathcal{C}[0,1] : f(0)=f(1)=0\}$ is maximal ideal in the ring $\mathcal{C}[0,1]$ of all continuous real valued functions.   I thought of using same ideas as above but i am unable to choose perfect $\eta$  I believe that this is not even a prime ideal..  I set  $f(x)=x$ and $g(x)=x-1$ and consider $f(x)g(x)=(x)(x-1)$ then,   $(fg)(0)=f(0)g(0)=0.(-1)=0$   $(fg)(1)=f(1)g(1)=1.0=0$  So, $fg\in \mathcal{I}=\{f\in \mathcal{C}[0,1] : f(0)=f(1)=0\}$ but the neither $f$ nor $g$ is in $\mathcal{I}$.    I have two questions:   I see that $0$ does not play any role in the question $\mathcal{I}=\{f\in \mathcal{C}[0,1] : f(0)=0\}$ I mean I would have same case if i replace $0$ by any real number.  So, I would like to say that $$\mathcal{I}=\{f\in \mathcal{C}[0,1] : f(r)=0\}$$  is a maximal ideal in the ring $\mathcal{C}[0,1]$ of all continuous real valued functions.  And one more thing I would claim is that      If the collection $\mathcal{I}$ is such that all elements of $\mathcal{I}$ has more than $1$ common zero then $\mathcal{I}$ is not a maximal ideal and not even a prime ideal..   I would like to learn more about this kind of ideals in $\mathcal{C}[0,1]$.  I would be thankful if some one can assure that what  have done is sufficient to conlcude what i have concluded and I would be thankful if some one can suggest some material to read regarding this.  Thank you A question in Complex Analysis $\int_0^{2\pi}\log(1-2r\cos x +r^2)\,dx$ My problem is to integrate this expression:  $$\int_0^{2\pi}\log(1-2r\cos x +r^2)dx.$$ where $r$ is any constant in $[0,1]$.  I know the answer is zero. Can you explain you idea to me or just prove that? Maybe you will use the "Cauchy integral theorem ". What does goodness of fit mean in context of linear regression I am having trouble understanding the concept of 'goodness of fit' w.r.t linear regression. The name suggests that the goodness of fit test is used to determine how well a model fits the data.  But the linear model is already the 'best' fit since we have minimized the sum of the squared error terms. Why do we need to test 'goodness of fit' again? We know it is a good fit because we minimized the sum of the squared errors. Differences between the introduction of a sandwich thesis and a paper I would like to know what are the main differences between the introductory part of a paper and of a thesis. My thesis would be a sandwich type, so I would have to wrap everything there.  Some of the differences are:   Longer in thesis. Deeper in thesis. Extended definition of key terms, concepts and methodology in thesis. Clear definition of the whole goal in thesis, whereas paper smaller goal.   To narrow the possible answers, I do research on the molecular aspects of the infection steps of a pathogenic swine bacteria. Also develop strategies to block infection by using vaccines. Finding $\int_0^{\infty}xe^{-\lambda x} \, dx$ How to integrate:  $$\int_0^\infty x \, \lambda e^{-\lambda x} \, dx$$    I tried using integration by parts:  Let $u = x$ and $dv = \lambda e^{-\lambda x} \, dx$  Then $du = dx$  And $v = - \lambda e ^{-\lambda x}$  Correct so far?   Then   $$\begin{aligned} uv - \int v \, du &amp;= -\lambda x e^{-\lambda x} - \int (- \lambda e^{- \lambda x}) dx \\ &amp;= -\lambda x e^{-\lambda x} - \lambda e^{-\lambda x} \end{aligned}$$    The correct answer from lecture notes      UPDATE 2  Let $u=\lambda x$ and $dv = e^{-\lambda x} dx$  Then $du = \lambda \, dx$  $$dv = e^{-\lambda x} \, dx$$  Let $y = -\lambda x$  Then $dy = -\lambda \, dx$  So $dx = -\frac{1}{\lambda} dy$  $$\begin{aligned} v &amp;= \int e^u \cdot - \frac{1}{\lambda} du \\ &amp;= - \frac{1}{\lambda} e^{-\lambda x} \end{aligned}$$  But here I seem to have an extra $- \frac{1}{\lambda}$ in $v$?  If I continue using integration by parts, I get:   $$-x e^{-\lambda x} + \color{red}{\frac{1}{\lambda}} \int e^{-\lambda x} \, dx$$ How do I diagnose the source of focus problem in a camera? Probably a novice question, but how do I correctly diagnose from a photo for what reason that camera wasn't able to focus properly?  It can be any 1 of the following   Unsteady hand Lens issue Metering Re-Calibration required in camera or ...   Is there a set of unsaid protocols that needs to be followed by a photographer?  Goal is to get a sharp and crisp image prior to editing.  [PS: I own a Nikon D5200.] I need help with this exercise.  I need to prove $$\int_{0}^{1}x^{-x}\ dx=\sum_{n=1}^{\infty}n^{-n}$$  I think I should use some convergence theorem, but I'm stuck.  Thanks a lot!