qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
710,750 | I am having trouble calculating the quadratic curve $f(x)$ that goes through 3 points;
for example a curve that goes through $A(1,3), B(-1,-5), and C(-2,12)$.
I can only guess that the curve is upwards and that I may create the system:
$$
y\_1 = ax^2\_1 + bx\_1 + c\\
y\_2 = ax^2\_2 + bx\_2 + c\\
y\_3 = ax^2\_3 + bx\_3 ... | 2014/03/13 | [
"https://math.stackexchange.com/questions/710750",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/99172/"
] | The matrix you are about to build is a [Vandermonde Matrix](http://en.wikipedia.org/wiki/Vandermonde_matrix):
$$
\vec y = \pmatrix{1&x\_1&x\_1^2\\1&x\_2&x\_2^2\\1&x\_3&x\_3^2\\}\pmatrix{c\\b\\a}
$$
*A square Vandermonde matrix is thus invertible if and only if the $x\_i$ are distinct; an explicit formula for the inver... | You don't need matrices to calculate the answer
$$a=((y\_1-y\_2)-(y\_2-y\_3)(x\_1-x\_2)/(x\_2-x\_3))/((x\_1^2-x\_2^2)-(x\_2^2-x\_3^2)(x\_1-x\_2)/(x\_2-x\_3))$$
$$b=((y\_1-y\_2)-a(x\_1^2-x\_2^2))/(x\_1-x\_2)$$
$$c=y\_1-ax\_1^2-bx\_1$$
If you want to check you got the correct result then
$$c=y\_2-ax\_2^2-bx\_2$$... |
710,750 | I am having trouble calculating the quadratic curve $f(x)$ that goes through 3 points;
for example a curve that goes through $A(1,3), B(-1,-5), and C(-2,12)$.
I can only guess that the curve is upwards and that I may create the system:
$$
y\_1 = ax^2\_1 + bx\_1 + c\\
y\_2 = ax^2\_2 + bx\_2 + c\\
y\_3 = ax^2\_3 + bx\_3 ... | 2014/03/13 | [
"https://math.stackexchange.com/questions/710750",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/99172/"
] | The matrix you are about to build is a [Vandermonde Matrix](http://en.wikipedia.org/wiki/Vandermonde_matrix):
$$
\vec y = \pmatrix{1&x\_1&x\_1^2\\1&x\_2&x\_2^2\\1&x\_3&x\_3^2\\}\pmatrix{c\\b\\a}
$$
*A square Vandermonde matrix is thus invertible if and only if the $x\_i$ are distinct; an explicit formula for the inver... | ```
For the three points
P1=(x1,y1),
P2=(x2,y2),
P3=(x3,y3),
use the coefficients a, b and c,
a = y1/(x1*x1 - x1*x2 - x1*x3 + x2*x3) + y2/(-x1*x2 + x1*x3 + x2*x2 - x2*x3) + y3/(x1*x2 - x1*x3 - x2*x3 + x3*x3)
b = - (x2*y1)/(x1*x1 - x1*x2 - x1*x3 + x2*x3) - (x3*y1)/(x1*x1 - x1*x2 - x1*x3 + x2*x3) - (x1*y2)/(-x1*x2 ... |
710,750 | I am having trouble calculating the quadratic curve $f(x)$ that goes through 3 points;
for example a curve that goes through $A(1,3), B(-1,-5), and C(-2,12)$.
I can only guess that the curve is upwards and that I may create the system:
$$
y\_1 = ax^2\_1 + bx\_1 + c\\
y\_2 = ax^2\_2 + bx\_2 + c\\
y\_3 = ax^2\_3 + bx\_3 ... | 2014/03/13 | [
"https://math.stackexchange.com/questions/710750",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/99172/"
] | Each of the points (1,3), (-1,-5) and (-2,12) satisfies the equation $y = ax^2 + bx + c$ for some unknown a,b,c. The task is to find a,b and c. Start by substituting each of the points into the equation, we have
$$
\begin{align}
3 &= a(1)^2 + b(1) + c \\
-5 &= a(-1)^2 + b(-1) + c \\
12 &= a(-2)^2 + b(-2) + c
\end{alig... | $\newcommand{\+}{^{\dagger}}
\newcommand{\angles}[1]{\left\langle #1 \right\rangle}
\newcommand{\braces}[1]{\left\lbrace #1 \right\rbrace}
\newcommand{\bracks}[1]{\left\lbrack #1 \right\rbrack}
\newcommand{\ceil}[1]{\,\left\lceil #1 \right\rceil\,}
\newcommand{\dd}{{\rm d}}
\newcommand{\down}{\downarrow}
\newcom... |
710,750 | I am having trouble calculating the quadratic curve $f(x)$ that goes through 3 points;
for example a curve that goes through $A(1,3), B(-1,-5), and C(-2,12)$.
I can only guess that the curve is upwards and that I may create the system:
$$
y\_1 = ax^2\_1 + bx\_1 + c\\
y\_2 = ax^2\_2 + bx\_2 + c\\
y\_3 = ax^2\_3 + bx\_3 ... | 2014/03/13 | [
"https://math.stackexchange.com/questions/710750",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/99172/"
] | Each of the points (1,3), (-1,-5) and (-2,12) satisfies the equation $y = ax^2 + bx + c$ for some unknown a,b,c. The task is to find a,b and c. Start by substituting each of the points into the equation, we have
$$
\begin{align}
3 &= a(1)^2 + b(1) + c \\
-5 &= a(-1)^2 + b(-1) + c \\
12 &= a(-2)^2 + b(-2) + c
\end{alig... | You don't need matrices to calculate the answer
$$a=((y\_1-y\_2)-(y\_2-y\_3)(x\_1-x\_2)/(x\_2-x\_3))/((x\_1^2-x\_2^2)-(x\_2^2-x\_3^2)(x\_1-x\_2)/(x\_2-x\_3))$$
$$b=((y\_1-y\_2)-a(x\_1^2-x\_2^2))/(x\_1-x\_2)$$
$$c=y\_1-ax\_1^2-bx\_1$$
If you want to check you got the correct result then
$$c=y\_2-ax\_2^2-bx\_2$$... |
710,750 | I am having trouble calculating the quadratic curve $f(x)$ that goes through 3 points;
for example a curve that goes through $A(1,3), B(-1,-5), and C(-2,12)$.
I can only guess that the curve is upwards and that I may create the system:
$$
y\_1 = ax^2\_1 + bx\_1 + c\\
y\_2 = ax^2\_2 + bx\_2 + c\\
y\_3 = ax^2\_3 + bx\_3 ... | 2014/03/13 | [
"https://math.stackexchange.com/questions/710750",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/99172/"
] | Each of the points (1,3), (-1,-5) and (-2,12) satisfies the equation $y = ax^2 + bx + c$ for some unknown a,b,c. The task is to find a,b and c. Start by substituting each of the points into the equation, we have
$$
\begin{align}
3 &= a(1)^2 + b(1) + c \\
-5 &= a(-1)^2 + b(-1) + c \\
12 &= a(-2)^2 + b(-2) + c
\end{alig... | ```
For the three points
P1=(x1,y1),
P2=(x2,y2),
P3=(x3,y3),
use the coefficients a, b and c,
a = y1/(x1*x1 - x1*x2 - x1*x3 + x2*x3) + y2/(-x1*x2 + x1*x3 + x2*x2 - x2*x3) + y3/(x1*x2 - x1*x3 - x2*x3 + x3*x3)
b = - (x2*y1)/(x1*x1 - x1*x2 - x1*x3 + x2*x3) - (x3*y1)/(x1*x1 - x1*x2 - x1*x3 + x2*x3) - (x1*y2)/(-x1*x2 ... |
710,750 | I am having trouble calculating the quadratic curve $f(x)$ that goes through 3 points;
for example a curve that goes through $A(1,3), B(-1,-5), and C(-2,12)$.
I can only guess that the curve is upwards and that I may create the system:
$$
y\_1 = ax^2\_1 + bx\_1 + c\\
y\_2 = ax^2\_2 + bx\_2 + c\\
y\_3 = ax^2\_3 + bx\_3 ... | 2014/03/13 | [
"https://math.stackexchange.com/questions/710750",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/99172/"
] | $\newcommand{\+}{^{\dagger}}
\newcommand{\angles}[1]{\left\langle #1 \right\rangle}
\newcommand{\braces}[1]{\left\lbrace #1 \right\rbrace}
\newcommand{\bracks}[1]{\left\lbrack #1 \right\rbrack}
\newcommand{\ceil}[1]{\,\left\lceil #1 \right\rceil\,}
\newcommand{\dd}{{\rm d}}
\newcommand{\down}{\downarrow}
\newcom... | You don't need matrices to calculate the answer
$$a=((y\_1-y\_2)-(y\_2-y\_3)(x\_1-x\_2)/(x\_2-x\_3))/((x\_1^2-x\_2^2)-(x\_2^2-x\_3^2)(x\_1-x\_2)/(x\_2-x\_3))$$
$$b=((y\_1-y\_2)-a(x\_1^2-x\_2^2))/(x\_1-x\_2)$$
$$c=y\_1-ax\_1^2-bx\_1$$
If you want to check you got the correct result then
$$c=y\_2-ax\_2^2-bx\_2$$... |
710,750 | I am having trouble calculating the quadratic curve $f(x)$ that goes through 3 points;
for example a curve that goes through $A(1,3), B(-1,-5), and C(-2,12)$.
I can only guess that the curve is upwards and that I may create the system:
$$
y\_1 = ax^2\_1 + bx\_1 + c\\
y\_2 = ax^2\_2 + bx\_2 + c\\
y\_3 = ax^2\_3 + bx\_3 ... | 2014/03/13 | [
"https://math.stackexchange.com/questions/710750",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/99172/"
] | $\newcommand{\+}{^{\dagger}}
\newcommand{\angles}[1]{\left\langle #1 \right\rangle}
\newcommand{\braces}[1]{\left\lbrace #1 \right\rbrace}
\newcommand{\bracks}[1]{\left\lbrack #1 \right\rbrack}
\newcommand{\ceil}[1]{\,\left\lceil #1 \right\rceil\,}
\newcommand{\dd}{{\rm d}}
\newcommand{\down}{\downarrow}
\newcom... | ```
For the three points
P1=(x1,y1),
P2=(x2,y2),
P3=(x3,y3),
use the coefficients a, b and c,
a = y1/(x1*x1 - x1*x2 - x1*x3 + x2*x3) + y2/(-x1*x2 + x1*x3 + x2*x2 - x2*x3) + y3/(x1*x2 - x1*x3 - x2*x3 + x3*x3)
b = - (x2*y1)/(x1*x1 - x1*x2 - x1*x3 + x2*x3) - (x3*y1)/(x1*x1 - x1*x2 - x1*x3 + x2*x3) - (x1*y2)/(-x1*x2 ... |
9,903 | I asked [how I can resize the browser window with JavaScript](https://stackoverflow.com/questions/7022787/can-i-resize-the-browser-window-size). Everybody told me not to do it. Why is this a bad practice?
I think sometimes it can be good. For example, I want to show users a tweeting popup page. After a user tweeted, I... | 2011/08/11 | [
"https://ux.stackexchange.com/questions/9903",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/6738/"
] | If you want to do a popup, consider jquery UI modal dialogs. Same effect, no popup window, no resizing neccessary. | Many users have multiple windows open at one time (some on multiple screens), and resizing can really mess with the layout. Additionally, most internet use (at least in my personal experience) invloves multiple open tabs. Resizing the browser window will affect not just your application, but the other tabs in the windo... |
9,903 | I asked [how I can resize the browser window with JavaScript](https://stackoverflow.com/questions/7022787/can-i-resize-the-browser-window-size). Everybody told me not to do it. Why is this a bad practice?
I think sometimes it can be good. For example, I want to show users a tweeting popup page. After a user tweeted, I... | 2011/08/11 | [
"https://ux.stackexchange.com/questions/9903",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/6738/"
] | I feel like everyone just read the title and not the whole question. He's specifically asking about the case of a popup window.
A very common practice in UI/UX is to use a popup window when the current application is interacting with another one. Think of submitting small bits of information like sharing the current p... | If you want to do a popup, consider jquery UI modal dialogs. Same effect, no popup window, no resizing neccessary. |
9,903 | I asked [how I can resize the browser window with JavaScript](https://stackoverflow.com/questions/7022787/can-i-resize-the-browser-window-size). Everybody told me not to do it. Why is this a bad practice?
I think sometimes it can be good. For example, I want to show users a tweeting popup page. After a user tweeted, I... | 2011/08/11 | [
"https://ux.stackexchange.com/questions/9903",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/6738/"
] | Sometimes small windows are required but these should be implemented using javascript or some framework based on it, say jQuery. You should always stick to working within the window provided by the browser and never try to resize it. I would dare to say it is like trying to change the resolution of the desktop because ... | My browser can only remember one intermediate size.
I can jump from intermediate to maximized and back, to minimized and back, and maximized->minimized->intermediate. But not between 2 different intermediate sizes.
So if I choosed an intermediate size, and it is some work to adjust my window, and somebody chooses a ... |
9,903 | I asked [how I can resize the browser window with JavaScript](https://stackoverflow.com/questions/7022787/can-i-resize-the-browser-window-size). Everybody told me not to do it. Why is this a bad practice?
I think sometimes it can be good. For example, I want to show users a tweeting popup page. After a user tweeted, I... | 2011/08/11 | [
"https://ux.stackexchange.com/questions/9903",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/6738/"
] | Don't move my cheese!
I have my windows expertly arranged on my multiple widescreen monitors, so I have a few non-maximise browsers (to avoid wasted space from some sites at the side). The last thing I want to happen is for you to resize my browser and all of its tabs to a size that you feel is appropriate.
Other les... | Personally, if you resize the browser or do anything that gets in my way I will close your page and banlist it on my firewall to make sure I never come across it again, not even by mistake.
"In this case, making the browser window bigger seems good for user." <- Anything that "seems good for the user" is inherently wr... |
9,903 | I asked [how I can resize the browser window with JavaScript](https://stackoverflow.com/questions/7022787/can-i-resize-the-browser-window-size). Everybody told me not to do it. Why is this a bad practice?
I think sometimes it can be good. For example, I want to show users a tweeting popup page. After a user tweeted, I... | 2011/08/11 | [
"https://ux.stackexchange.com/questions/9903",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/6738/"
] | You're taking control away from the user. For example; If the twitter page changes the browser to a small window and they then change their mind before actually tweeting and choose the 'back' browser button they're then left with a small window and have to sort it out themselves back to a size they want it to be.
It's... | The reason why you must not do it has nothing to do with users *owning their webpage* rather than the page itself.
If you do, however, you won't just modify the state of your web app. You will modify the state of all web apps that the user has open.
Before **browser tabs** existed, this was not an issue. Each web app... |
9,903 | I asked [how I can resize the browser window with JavaScript](https://stackoverflow.com/questions/7022787/can-i-resize-the-browser-window-size). Everybody told me not to do it. Why is this a bad practice?
I think sometimes it can be good. For example, I want to show users a tweeting popup page. After a user tweeted, I... | 2011/08/11 | [
"https://ux.stackexchange.com/questions/9903",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/6738/"
] | Personally, if you resize the browser or do anything that gets in my way I will close your page and banlist it on my firewall to make sure I never come across it again, not even by mistake.
"In this case, making the browser window bigger seems good for user." <- Anything that "seems good for the user" is inherently wr... | It's bad practice when your user is human.
When your user is a virtual framebuffer, it's different. In automated testing we often need to work with windows of specific sizes to ensure that elements and events and interactions are being captured and processed in a consistent manner.
It is extremely inconvenient to get... |
9,903 | I asked [how I can resize the browser window with JavaScript](https://stackoverflow.com/questions/7022787/can-i-resize-the-browser-window-size). Everybody told me not to do it. Why is this a bad practice?
I think sometimes it can be good. For example, I want to show users a tweeting popup page. After a user tweeted, I... | 2011/08/11 | [
"https://ux.stackexchange.com/questions/9903",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/6738/"
] | Personally, if you resize the browser or do anything that gets in my way I will close your page and banlist it on my firewall to make sure I never come across it again, not even by mistake.
"In this case, making the browser window bigger seems good for user." <- Anything that "seems good for the user" is inherently wr... | The other answers have missed one vital fact: *links in a popup can be set to open in the original window!* If your popup is loading another page that should be full-screen, you can open it in the window that spawned the popup, and close the popup at the same time. See [Example 4 here](http://www.blazonry.com/javascrip... |
9,903 | I asked [how I can resize the browser window with JavaScript](https://stackoverflow.com/questions/7022787/can-i-resize-the-browser-window-size). Everybody told me not to do it. Why is this a bad practice?
I think sometimes it can be good. For example, I want to show users a tweeting popup page. After a user tweeted, I... | 2011/08/11 | [
"https://ux.stackexchange.com/questions/9903",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/6738/"
] | Many users have multiple windows open at one time (some on multiple screens), and resizing can really mess with the layout. Additionally, most internet use (at least in my personal experience) invloves multiple open tabs. Resizing the browser window will affect not just your application, but the other tabs in the windo... | It's bad practice when your user is human.
When your user is a virtual framebuffer, it's different. In automated testing we often need to work with windows of specific sizes to ensure that elements and events and interactions are being captured and processed in a consistent manner.
It is extremely inconvenient to get... |
9,903 | I asked [how I can resize the browser window with JavaScript](https://stackoverflow.com/questions/7022787/can-i-resize-the-browser-window-size). Everybody told me not to do it. Why is this a bad practice?
I think sometimes it can be good. For example, I want to show users a tweeting popup page. After a user tweeted, I... | 2011/08/11 | [
"https://ux.stackexchange.com/questions/9903",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/6738/"
] | You're taking control away from the user. For example; If the twitter page changes the browser to a small window and they then change their mind before actually tweeting and choose the 'back' browser button they're then left with a small window and have to sort it out themselves back to a size they want it to be.
It's... | Sometimes small windows are required but these should be implemented using javascript or some framework based on it, say jQuery. You should always stick to working within the window provided by the browser and never try to resize it. I would dare to say it is like trying to change the resolution of the desktop because ... |
9,903 | I asked [how I can resize the browser window with JavaScript](https://stackoverflow.com/questions/7022787/can-i-resize-the-browser-window-size). Everybody told me not to do it. Why is this a bad practice?
I think sometimes it can be good. For example, I want to show users a tweeting popup page. After a user tweeted, I... | 2011/08/11 | [
"https://ux.stackexchange.com/questions/9903",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/6738/"
] | You shouldn't do anything that overrides what the user has previously chosen. Your application is hosted inside the browser windows. It doesn't own the browser window therefore it shouldn't do anything to it.
The same logic dictates that you shouldn't override any browser behaviour such as the back button.
In fact yo... | You're taking control away from the user. For example; If the twitter page changes the browser to a small window and they then change their mind before actually tweeting and choose the 'back' browser button they're then left with a small window and have to sort it out themselves back to a size they want it to be.
It's... |
49,167,667 | I want to create custom progressbar with different levels like below image;
[](https://i.stack.imgur.com/wXkuN.jpg)
xml code;
```
<ProgressBar
android:id="@+id/progress"
style="?android:attr/progressBarStyleLarge"
android:layout_width="... | 2018/03/08 | [
"https://Stackoverflow.com/questions/49167667",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4976247/"
] | Where did you get this program? Rebuild it with the current gfortran if you have the source or you need to find the old libgfortran. It will be in an old release of GCC. Try to install GCC 4.1 or similar. Such an old version will not be present in current repositories, you must install it manually. | In Ubuntu 18.04, the following error:
```
sander: error while loading shared libraries: libgfortran.so.3: cannot open shared object file: No such file or directory
```
was fixed by running
```
sudo apt-get install libgfortran3:amd64
```
It could be the same for libgfortran1, by running
```
sudo apt-get install l... |
30,076,913 | I'm trying to execute a stored procedure with mysql with Navicat and when I execute this stored procedure I got 0 rows but when I execute the part of the stored procedure which I want I get 1 row which is what I want. The stored procedure is this:
```
BEGIN
#Routine body goes here...
IF @autor=0 THEN
SELECT DISTINC... | 2015/05/06 | [
"https://Stackoverflow.com/questions/30076913",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1386382/"
] | Marcus, maybe you are just hitting Jetty bug [472621](https://bugs.eclipse.org/bugs/show_bug.cgi?id=472621)?
Edit: The mentioned bug is a separate timeout in Jetty that applies to the total operation, not just idle time. So by setting the http.timeout property you essentially define a maximum time any download is allo... | A timeout means your client isn't reading fast enough.
JMeter isn't reading the response data fast enough, so the connection sits idle long enough that it idle times out and disconnects.
We test with 800MB and 2GB files regularly.
On using HTTP/1.0, HTTP/1.1, and HTTP/2 protocols.
Using normal (plaintext) connectio... |
12,166,000 | I have finished an extension for my company and I want to put it on the company wiki so that in order to get it on everyone's machine all I have to do is go around and click the link.
First, I HAVE READ all the documentation from <http://developer.chrome.com/extensions/hosting.html> about hosting and autoupdating and ... | 2012/08/28 | [
"https://Stackoverflow.com/questions/12166000",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1558851/"
] | In version 21 (or so), Chrome disabled the ability to do a simple link-click install of off-store extensions. There is a discussion of the change in [this bug report](https://code.google.com/p/chromium/issues/detail?id=128748):
>
> You are no longer supposed to be able to install extensions off-store in Chrome... In ... | You can do an "[inline install](https://developers.google.com/chrome/web-store/docs/inline_installation)" of an app hosted on the web store. The new changes are forcing people to move our extensions to the web store, but the inline installation should allow your users to not need to leave your page to install. |
91,066 | Dear All,
there is one type of regular languages, over $\{a,b\}$, which appear naturally in what I am studying, so if anybody could recognise them, or say any sort of their characterisation, that would be great.
So, our languages $L\subseteq (a+b)^\*$ are defined as follows:
(0) First we choose some $n\geq 0$ and ne... | 2012/03/13 | [
"https://mathoverflow.net/questions/91066",
"https://mathoverflow.net",
"https://mathoverflow.net/users/13070/"
] | I don't know if this will be helpful at all, but I came across something related to this in a talk by Jean-Eric Pin recently:
A language $L\subseteq A^\*$ is called *dense* if for every word $u\in A^\*$, we have $L\cap A^\*uA^\*\neq \emptyset$.
So your languages $K$ are nondense in $(a+b+x\_1+\ldots+x\_n)^\*$. There... | Hi Victor,
am I missing something or is this "just" the complement of a finite set of strings? The problem with regular expressions is that expressing the absence of patterns is not really straightforward (which is why some people prefer using logics such as MSO to specify these languages edit: This is not quite what ... |
288,984 | I'm looking to calculate the number of months between 2 date time fields.
Is there a better way than getting the Unix timestamp and then dividing by 2 592 000 (seconds) and rounding up within MySQL? | 2008/11/14 | [
"https://Stackoverflow.com/questions/288984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5441/"
] | I prefer this way, because evryone will understand it clearly at the first glance:
```
SELECT
12 * (YEAR(to) - YEAR(from)) + (MONTH(to) - MONTH(from)) AS months
FROM
tab;
``` | ```
SELECT *
FROM emp_salaryrevise_view
WHERE curr_year Between '2008' AND '2009'
AND MNTH Between '12' AND '1'
``` |
288,984 | I'm looking to calculate the number of months between 2 date time fields.
Is there a better way than getting the Unix timestamp and then dividing by 2 592 000 (seconds) and rounding up within MySQL? | 2008/11/14 | [
"https://Stackoverflow.com/questions/288984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5441/"
] | [PERIOD\_DIFF](http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_period-diff) calculates months between two dates.
For example, to calculate the difference between now() and a time column in your\_table:
```
select period_diff(date_format(now(), '%Y%m'), date_format(time, '%Y%m')) as months... | Simple answer given start date as ins\_frm and end date as ins\_to
```
SELECT convert(TIMESTAMPDIFF(year, ins_frm, ins_to),UNSIGNED) as yrs,
mod(TIMESTAMPDIFF(MONTH, ins_frm, ins_to),12) mnths
FROM table_name
```
Enjoy :))) |
288,984 | I'm looking to calculate the number of months between 2 date time fields.
Is there a better way than getting the Unix timestamp and then dividing by 2 592 000 (seconds) and rounding up within MySQL? | 2008/11/14 | [
"https://Stackoverflow.com/questions/288984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5441/"
] | As many of the answers here show, the 'right' answer depends on exactly what you need. In my case, I need to *round to the closest whole number*.
Consider these examples:
1st January -> 31st January: It's 0 whole months, and almost 1 month long.
1st January -> 1st February? It's 1 whole month, and exactly 1 month long... | From the MySQL manual:
>
> PERIOD\_DIFF(P1,P2)
>
>
> Returns the number of months between periods P1 and P2. P1 and P2 should be in the format YYMM or YYYYMM. Note that the period arguments P1 and P2 are not date values.
>
>
> mysql> SELECT PERIOD\_DIFF(200802,200703);
> -> 11
>
>
>
So it may be possible to ... |
288,984 | I'm looking to calculate the number of months between 2 date time fields.
Is there a better way than getting the Unix timestamp and then dividing by 2 592 000 (seconds) and rounding up within MySQL? | 2008/11/14 | [
"https://Stackoverflow.com/questions/288984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5441/"
] | [PERIOD\_DIFF](http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_period-diff) calculates months between two dates.
For example, to calculate the difference between now() and a time column in your\_table:
```
select period_diff(date_format(now(), '%Y%m'), date_format(time, '%Y%m')) as months... | The [DATEDIFF](http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_datediff) function can give you the number of days between two dates. Which is more accurate, since... how do you define a month? (28, 29, 30, or 31 days?) |
288,984 | I'm looking to calculate the number of months between 2 date time fields.
Is there a better way than getting the Unix timestamp and then dividing by 2 592 000 (seconds) and rounding up within MySQL? | 2008/11/14 | [
"https://Stackoverflow.com/questions/288984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5441/"
] | Month-difference between any given two dates:
=============================================
I'm surprised this hasn't been mentioned yet:
Have a look at the [***TIMESTAMPDIFF()***](http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_timestampdiff) function in MySQL.
What this allows you to d... | The Query will be like:
```
select period_diff(date_format(now(),"%Y%m"),date_format(created,"%Y%m")) from customers where..
```
Gives a number of calendar months since the created datestamp on a customer record, letting MySQL do the month selection internally. |
288,984 | I'm looking to calculate the number of months between 2 date time fields.
Is there a better way than getting the Unix timestamp and then dividing by 2 592 000 (seconds) and rounding up within MySQL? | 2008/11/14 | [
"https://Stackoverflow.com/questions/288984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5441/"
] | Simple answer given start date as ins\_frm and end date as ins\_to
```
SELECT convert(TIMESTAMPDIFF(year, ins_frm, ins_to),UNSIGNED) as yrs,
mod(TIMESTAMPDIFF(MONTH, ins_frm, ins_to),12) mnths
FROM table_name
```
Enjoy :))) | This query worked for me:)
```
SELECT * FROM tbl_purchase_receipt
WHERE purchase_date BETWEEN '2008-09-09' AND '2009-09-09'
```
It simply take two dates and retrieves the values between them. |
288,984 | I'm looking to calculate the number of months between 2 date time fields.
Is there a better way than getting the Unix timestamp and then dividing by 2 592 000 (seconds) and rounding up within MySQL? | 2008/11/14 | [
"https://Stackoverflow.com/questions/288984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5441/"
] | I use also [PERIOD\_DIFF](http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_period-diff). To get the year and the month of the date, I use the function [EXTRACT](http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_extract):
```
SELECT PERIOD_DIFF(EXTRACT(YEAR_MONTH... | From the MySQL manual:
>
> PERIOD\_DIFF(P1,P2)
>
>
> Returns the number of months between periods P1 and P2. P1 and P2 should be in the format YYMM or YYYYMM. Note that the period arguments P1 and P2 are not date values.
>
>
> mysql> SELECT PERIOD\_DIFF(200802,200703);
> -> 11
>
>
>
So it may be possible to ... |
288,984 | I'm looking to calculate the number of months between 2 date time fields.
Is there a better way than getting the Unix timestamp and then dividing by 2 592 000 (seconds) and rounding up within MySQL? | 2008/11/14 | [
"https://Stackoverflow.com/questions/288984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5441/"
] | Although it's an old topic it shows on top in google and I don't see newer questions related to Mysql to calculate the difference in months. And I needed a very precise calculation including the fraction of the month.
This for the purpose to calculate a subscription fee e.g. 8 euro per month. Then 1 day in februari do... | This query worked for me:)
```
SELECT * FROM tbl_purchase_receipt
WHERE purchase_date BETWEEN '2008-09-09' AND '2009-09-09'
```
It simply take two dates and retrieves the values between them. |
288,984 | I'm looking to calculate the number of months between 2 date time fields.
Is there a better way than getting the Unix timestamp and then dividing by 2 592 000 (seconds) and rounding up within MySQL? | 2008/11/14 | [
"https://Stackoverflow.com/questions/288984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5441/"
] | [PERIOD\_DIFF](http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_period-diff) calculates months between two dates.
For example, to calculate the difference between now() and a time column in your\_table:
```
select period_diff(date_format(now(), '%Y%m'), date_format(time, '%Y%m')) as months... | The Query will be like:
```
select period_diff(date_format(now(),"%Y%m"),date_format(created,"%Y%m")) from customers where..
```
Gives a number of calendar months since the created datestamp on a customer record, letting MySQL do the month selection internally. |
288,984 | I'm looking to calculate the number of months between 2 date time fields.
Is there a better way than getting the Unix timestamp and then dividing by 2 592 000 (seconds) and rounding up within MySQL? | 2008/11/14 | [
"https://Stackoverflow.com/questions/288984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5441/"
] | Execute this code and it will create a function datedeifference which will give you the difference in date format yyyy-mm-dd.
```
DELIMITER $$
CREATE FUNCTION datedifference(date1 DATE, date2 DATE) RETURNS DATE
NO SQL
BEGIN
DECLARE dif DATE;
IF DATEDIFF(date1, DATE(CONCAT(YEAR(date1),'-', MONTH(date1), '-', ... | You can also try this:
```
select MONTH(NOW())-MONTH(table_date) as 'Total Month Difference' from table_name;
```
OR
```
select MONTH(Newer_date)-MONTH(Older_date) as 'Total Month Difference' from table_Name;
``` |
144,289 | To cast [cube](https://www.dndbeyond.com/sources/basic-rules/spellcasting#Cube)-shaped spells,
>
> You select a cube's point of origin, which lies anywhere on a face of the cubic effect.
>
>
>
After looking through a multitude of other questions regarding Thunderwave (see [1](https://rpg.stackexchange.com/questio... | 2019/04/01 | [
"https://rpg.stackexchange.com/questions/144289",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/31589/"
] | Yes, there is a difference
--------------------------
Or rather, No, your interpretation is incorrect.
First of all, let's look at the rules really quick.
[Area of Effect on a Grid](https://www.dndbeyond.com/sources/xgte/dungeon-masters-tools#AreasofEffectonaGrid), DMG (I don't have the DMG in DnD Beyond, so this ex... | Thunderwave has two ranges
--------------------------
Thunderwave has two ranges:
>
> **[Thunderwave](https://www.dndbeyond.com/spells/thunderwave)**
>
>
> Range: Self (15-foot cube)
>
>
>
### Self
The first part says you are the target. So you cast *thunderwave* on yourself. The self part it can **target** [... |
20,938,963 | I have a Middleman blog hosted on Heroku (<http://tomgillard.herokuapp.com>) and have been trying to optimise it based on google's PageSpeed recommendations. One recommendation is that I provide a character set on the site's HTML pages.
HTML pages contain the html5 <meta charset="utf-8"> in the <head> but this doesn't... | 2014/01/05 | [
"https://Stackoverflow.com/questions/20938963",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/725606/"
] | I had a similar problem and wanted to optimize my site. You just need to manually set your `Content-Type` header.
Here's my complete `config.ru` which achieves a 98/100 on Google PageSpeed (it complains about not embedding my css in the page):
```
# encoding: utf-8
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfi... | This no longer applies as I have moved my blog from heroku to github pages. Thanks for looking. |
51,311,831 | I have feature => `city` which is categorical data i.e string but instead of hardcoding using `replace()` is there any smart approach ?
```
train['city'].unique()
Output: ['city_149', 'city_83', 'city_16', 'city_64', 'city_100', 'city_21',
'city_114', 'city_103', 'city_97', 'city_160', 'city_65',
'city_9... | 2018/07/12 | [
"https://Stackoverflow.com/questions/51311831",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9224312/"
] | Try [`pd.factorize()`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.factorize.html):
```
train['city'] = pd.factorize(train.city)[0]
```
Or [`categorical` dtypes](https://pandas.pydata.org/pandas-docs/stable/categorical.html):
```
train['city'] = train['city'].astype('category').cat.codes
```
**F... | You can accomplish this via `mapping`:
```
value_mapper = dict(zip(train['city'].unique(), np.arange(1, 124)))
train['city'].map(value_mapper)
```
Or the more idiomatic `categorical data`:
```
pd.Categorical(train['city']).codes
``` |
51,311,831 | I have feature => `city` which is categorical data i.e string but instead of hardcoding using `replace()` is there any smart approach ?
```
train['city'].unique()
Output: ['city_149', 'city_83', 'city_16', 'city_64', 'city_100', 'city_21',
'city_114', 'city_103', 'city_97', 'city_160', 'city_65',
'city_9... | 2018/07/12 | [
"https://Stackoverflow.com/questions/51311831",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9224312/"
] | Try [`pd.factorize()`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.factorize.html):
```
train['city'] = pd.factorize(train.city)[0]
```
Or [`categorical` dtypes](https://pandas.pydata.org/pandas-docs/stable/categorical.html):
```
train['city'] = train['city'].astype('category').cat.codes
```
**F... | If your values always have an underscore before the integer, a list comprehension might work for you:
```
data = [int(x.split('_')[-1]) for x in train['city']]
```
The comprehension loops across each `x` in `train['city']`, splits `x` into underscore delimited parts, and converts the last part to an integer. This wo... |
397,446 | For a balanced binary training dataset i.e number of data points with class +1 are equal to number of data points with class -1 , what will happen if we use weak binary classifiers whose classification accuracy is less
than 50%, say 30%? Will the performance of the combined classifier improve with more iterations?
I a... | 2019/03/14 | [
"https://stats.stackexchange.com/questions/397446",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/241101/"
] | Semantic segmentation of an image (at least in context of CNN based methods) can simply be viewed as a pixel-wise classification problem, that is to say that you assign a class to every pixel of the image. So in your case if you are able to successfully perform a semantic segmentation of your camera feed then the probl... | Yes, having ground truth segmentation would make classification tasks quite easy, perhaps even trivial.
A small nitpick is that a semantic segmentation map is not an image "colored according to type". The colored image is merely a visualization of the $K$ channel segmentation map, which when $K > 3$, cannot be direct... |
123,739 | I currently use ntfs-3g on my mac to be able to write to NTFS-formatted drives. I have seen two commercial alternatives that boast better performance and more advanced features - [Tuxera](http://www.tuxera.com/products/tuxera-ntfs-for-mac/) (a commercial version of ntfs-3g it seems) and [Paragon](http://www.paragon-sof... | 2010/03/24 | [
"https://superuser.com/questions/123739",
"https://superuser.com",
"https://superuser.com/users/3007/"
] | Mixed-mode WPA2-PSK is probably good enough, as long as your passphrase is well-chosen. If you don't really need TKIP (WPA "1") anymore, consider making it WPA2-only (that is, AES-CCMP only), because there have been some attacks against TKIP recently.
MAC address filtering is a waste of time. MAC addresses are easily ... | You could use a penetration testing system like [BackTrack](http://www.backtrack-linux.org/ "BackTrack"). |
177,980 | My supervisor started the e-mail thread of welcoming me to the team/department. Several team members has already replied (including the boss of my supervisor so I'm extra nervous) with a brief but warm welcome message. I was wondering what is the best way to reply in this thread.
This is my first fully remote role so ... | 2021/08/30 | [
"https://workplace.stackexchange.com/questions/177980",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/129196/"
] | >
> "Thanks for the warm welcome, I'm excited to be working with everyone and I'm looking forward meeting you in the upcoming weeks."
>
>
>
Your suggested reply is perfect. Stop fretting. | It's human nature believe it or not for people to want to help, show or instruct others so use this to your advantage because you won't be able to later on. Very graciously thank everyone for the welcome and then fall on your sword and concede very briefly and in the tamest way express your appreciation for those who w... |
177,980 | My supervisor started the e-mail thread of welcoming me to the team/department. Several team members has already replied (including the boss of my supervisor so I'm extra nervous) with a brief but warm welcome message. I was wondering what is the best way to reply in this thread.
This is my first fully remote role so ... | 2021/08/30 | [
"https://workplace.stackexchange.com/questions/177980",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/129196/"
] | Since the position is fully remote, I think it would be appropriate to reply with:
* Friendly "thank you" as OP stated
* Your full and correct email signature. Follow the norms at your company, if everyone else has phone and title and pronouns, make sure your signature has those. If they just use a short signature, ma... | >
> "Thanks for the warm welcome, I'm excited to be working with everyone and I'm looking forward meeting you in the upcoming weeks."
>
>
>
Your suggested reply is perfect. Stop fretting. |
177,980 | My supervisor started the e-mail thread of welcoming me to the team/department. Several team members has already replied (including the boss of my supervisor so I'm extra nervous) with a brief but warm welcome message. I was wondering what is the best way to reply in this thread.
This is my first fully remote role so ... | 2021/08/30 | [
"https://workplace.stackexchange.com/questions/177980",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/129196/"
] | >
> Would a short reply like "Thanks for the warm welcome, I'm excited to be working with everyone and I'm looking forward meeting you in the upcoming weeks."
>
>
>
Yes
>
> Should I be adding my professional background/main tasks of my role/hobbies/etc. ?
>
>
>
No.
That type of detail is "need/reason to kno... | >
> "Thanks for the warm welcome, I'm excited to be working with everyone and I'm looking forward meeting you in the upcoming weeks."
>
>
>
Your suggested reply is perfect. Stop fretting. |
177,980 | My supervisor started the e-mail thread of welcoming me to the team/department. Several team members has already replied (including the boss of my supervisor so I'm extra nervous) with a brief but warm welcome message. I was wondering what is the best way to reply in this thread.
This is my first fully remote role so ... | 2021/08/30 | [
"https://workplace.stackexchange.com/questions/177980",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/129196/"
] | Remote or Large workforces are much the same in this regard, the point of the email is simply to open communications, sometimes everyone will ignore it, sometimes the enthusiastic few will respond, those who respond will reflect the culture of the workplace just as much as your response will.
What is important in a Re... | It's human nature believe it or not for people to want to help, show or instruct others so use this to your advantage because you won't be able to later on. Very graciously thank everyone for the welcome and then fall on your sword and concede very briefly and in the tamest way express your appreciation for those who w... |
177,980 | My supervisor started the e-mail thread of welcoming me to the team/department. Several team members has already replied (including the boss of my supervisor so I'm extra nervous) with a brief but warm welcome message. I was wondering what is the best way to reply in this thread.
This is my first fully remote role so ... | 2021/08/30 | [
"https://workplace.stackexchange.com/questions/177980",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/129196/"
] | You were lucky enough to end up in a workplace that seems personal enough, that the welcome messages actually sounded warm and welcoming. Personally, I would add something along the lines of "I'm hoping to meet you guys in person or over an online drink soon, to get to know you."
But the actual reason I write this ans... | It's human nature believe it or not for people to want to help, show or instruct others so use this to your advantage because you won't be able to later on. Very graciously thank everyone for the welcome and then fall on your sword and concede very briefly and in the tamest way express your appreciation for those who w... |
177,980 | My supervisor started the e-mail thread of welcoming me to the team/department. Several team members has already replied (including the boss of my supervisor so I'm extra nervous) with a brief but warm welcome message. I was wondering what is the best way to reply in this thread.
This is my first fully remote role so ... | 2021/08/30 | [
"https://workplace.stackexchange.com/questions/177980",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/129196/"
] | >
> Would a short reply like "Thanks for the warm welcome, I'm excited to be working with everyone and I'm looking forward meeting you in the upcoming weeks."
>
>
>
Yes
>
> Should I be adding my professional background/main tasks of my role/hobbies/etc. ?
>
>
>
No.
That type of detail is "need/reason to kno... | Since the position is fully remote, I think it would be appropriate to reply with:
* Friendly "thank you" as OP stated
* Your full and correct email signature. Follow the norms at your company, if everyone else has phone and title and pronouns, make sure your signature has those. If they just use a short signature, ma... |
177,980 | My supervisor started the e-mail thread of welcoming me to the team/department. Several team members has already replied (including the boss of my supervisor so I'm extra nervous) with a brief but warm welcome message. I was wondering what is the best way to reply in this thread.
This is my first fully remote role so ... | 2021/08/30 | [
"https://workplace.stackexchange.com/questions/177980",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/129196/"
] | >
> "Thanks for the warm welcome, I'm excited to be working with everyone and I'm looking forward meeting you in the upcoming weeks."
>
>
>
Your suggested reply is perfect. Stop fretting. | You don't need to respond to this email chain at all. It's assumed that you received those welcome messages and possibly read them. If you're not comfortable in replying to them, then don't.
If you do want to reply, then a simple "Thanks everyone for the warm welcomes!" is fine. Depending on the company, you may or ma... |
177,980 | My supervisor started the e-mail thread of welcoming me to the team/department. Several team members has already replied (including the boss of my supervisor so I'm extra nervous) with a brief but warm welcome message. I was wondering what is the best way to reply in this thread.
This is my first fully remote role so ... | 2021/08/30 | [
"https://workplace.stackexchange.com/questions/177980",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/129196/"
] | I will disagree with other answers: apply the desk decoration test. If the culture of the company is such that you would keep some decoration on your desk that related to your personal life (picture of your pet, funny mug about your hobby, whatever) then you can include something relating to your personal life in your ... | It's human nature believe it or not for people to want to help, show or instruct others so use this to your advantage because you won't be able to later on. Very graciously thank everyone for the welcome and then fall on your sword and concede very briefly and in the tamest way express your appreciation for those who w... |
177,980 | My supervisor started the e-mail thread of welcoming me to the team/department. Several team members has already replied (including the boss of my supervisor so I'm extra nervous) with a brief but warm welcome message. I was wondering what is the best way to reply in this thread.
This is my first fully remote role so ... | 2021/08/30 | [
"https://workplace.stackexchange.com/questions/177980",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/129196/"
] | >
> Would a short reply like "Thanks for the warm welcome, I'm excited to be working with everyone and I'm looking forward meeting you in the upcoming weeks."
>
>
>
Yes
>
> Should I be adding my professional background/main tasks of my role/hobbies/etc. ?
>
>
>
No.
That type of detail is "need/reason to kno... | It's human nature believe it or not for people to want to help, show or instruct others so use this to your advantage because you won't be able to later on. Very graciously thank everyone for the welcome and then fall on your sword and concede very briefly and in the tamest way express your appreciation for those who w... |
177,980 | My supervisor started the e-mail thread of welcoming me to the team/department. Several team members has already replied (including the boss of my supervisor so I'm extra nervous) with a brief but warm welcome message. I was wondering what is the best way to reply in this thread.
This is my first fully remote role so ... | 2021/08/30 | [
"https://workplace.stackexchange.com/questions/177980",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/129196/"
] | >
> Would a short reply like "Thanks for the warm welcome, I'm excited to be working with everyone and I'm looking forward meeting you in the upcoming weeks."
>
>
>
Yes
>
> Should I be adding my professional background/main tasks of my role/hobbies/etc. ?
>
>
>
No.
That type of detail is "need/reason to kno... | You were lucky enough to end up in a workplace that seems personal enough, that the welcome messages actually sounded warm and welcoming. Personally, I would add something along the lines of "I'm hoping to meet you guys in person or over an online drink soon, to get to know you."
But the actual reason I write this ans... |
1,724,791 | Setup:
One table called `documents` with columns `author_id` and `reviewer_id` (among others).
One table called `users` with column `user_id`.
I need to create two referential integrity links:
One-to-many between `user_id` and `author_id`.
One-to-many between `user_id` and `reviewer_id`.
In other words, t... | 2009/11/12 | [
"https://Stackoverflow.com/questions/1724791",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/209885/"
] | To add two individual relationships from one table to two different fields in another, you need to have multiple instances of the parent table in the relationship window.
So, you'd add your Users and Documents table to the relationships window and create the first relationship. Then add the Users table to the relation... | This is not a direct answer to your question, but if I were you I would use another data model to implement the complex many-to-many relation between `Documents` and `Users` by creating a third table called `DocumentsUsers` with the following fields:
```
PK documentUser_id (*)
FK document_id
FK user_id
document... |
1,724,791 | Setup:
One table called `documents` with columns `author_id` and `reviewer_id` (among others).
One table called `users` with column `user_id`.
I need to create two referential integrity links:
One-to-many between `user_id` and `author_id`.
One-to-many between `user_id` and `reviewer_id`.
In other words, t... | 2009/11/12 | [
"https://Stackoverflow.com/questions/1724791",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/209885/"
] | To add two individual relationships from one table to two different fields in another, you need to have multiple instances of the parent table in the relationship window.
So, you'd add your Users and Documents table to the relationships window and create the first relationship. Then add the Users table to the relation... | First, I suggest you change you columns' names to `author_user_id` and `reviewer_user_id` respectively, to make it clear that each reference `user_id`.
Second, you should be aware that use of Access's UI tools are not compulsory. Many of us find them unintuitive but happily there are alternatives. One is to use SQL DD... |
1,724,791 | Setup:
One table called `documents` with columns `author_id` and `reviewer_id` (among others).
One table called `users` with column `user_id`.
I need to create two referential integrity links:
One-to-many between `user_id` and `author_id`.
One-to-many between `user_id` and `reviewer_id`.
In other words, t... | 2009/11/12 | [
"https://Stackoverflow.com/questions/1724791",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/209885/"
] | This is not a direct answer to your question, but if I were you I would use another data model to implement the complex many-to-many relation between `Documents` and `Users` by creating a third table called `DocumentsUsers` with the following fields:
```
PK documentUser_id (*)
FK document_id
FK user_id
document... | First, I suggest you change you columns' names to `author_user_id` and `reviewer_user_id` respectively, to make it clear that each reference `user_id`.
Second, you should be aware that use of Access's UI tools are not compulsory. Many of us find them unintuitive but happily there are alternatives. One is to use SQL DD... |
52,675,037 | I'm newer to the scripting side of Bash. Receiving a syntax error on line 2. But, not sure what the issue is. Help is appreciated. Thanks!
```
#!/bin/bash
# Prints userlist, add users to system, add users to wheel group, and sets password.
userlist=(john mary dan jenna gary)
for i in {$userlist[@]}
do
echo ${userli... | 2018/10/06 | [
"https://Stackoverflow.com/questions/52675037",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8743212/"
] | You have a typo:
```
for i in {$userlist[@]}
```
should be:
```
for i in ${userlist[@]}
```
Since `userlist` is an array, `$userlist` expands to the first element, `john`, so `{$userlist[@]}` becomes `{john[@]}` which isn't what you want, presumably.
Also, inside the for loop you should be using `$i` to referenc... | Wouldn't be this script easier ?
```
for i in john mary dan jenna gary
do
echo $i
sudo useradd $i
usermod -aG wheel $i
passwd $i
done
``` |
31,902,437 | I have an array somewhat like this:
```
Arr=[[1,2],[3,5]];
```
I want to split this into two different arrays like `[1,2]` and `[3,5]`. How do I do that in JavaScript? | 2015/08/09 | [
"https://Stackoverflow.com/questions/31902437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3678457/"
] | They already *are* two different arrays. JavaScript doesn't have multi-dimensional arrays, it has arrays of arrays, and so in your question there are **three** arrays: The one referenced by `Arr` and the two referenced by that array at indexes `0` and `1`.
So if you want to use those separately from `Arr`, just do so:... | you can call them by their index,
```
var arr1 = Arr[0];
var arr2 = Arr[1];
``` |
323,136 | What is the best way to compress a file if it is more than 4 GB in size?
I am using the following for last several months.
```
mysqldump --all-databases | zip > mybackup.zip
```
Today I am got an error:
```
zip error: Entry too big to split, read, or write (file exceeds Zip's 4GB uncompressed size limit)
```
I a... | 2011/10/20 | [
"https://serverfault.com/questions/323136",
"https://serverfault.com",
"https://serverfault.com/users/16842/"
] | Use xz:
```
mysqldump --all-databases | xz -9 -c > mybackup.xz
```
The compression ratio is much higher than zip, just make sure to watch the memory usage. If you are running xz in a memory-restricted environment you could use the following table to tune the command and avoid paging:
```
Preset DictSize CompCPU ... | Either upgrade `zip` to at least version 3.0 to support Zip64:
```
$ zip -v
This is Zip 3.0 (July 5th 2008), by Info-ZIP.
Zip special compilation options:
LARGE_FILE_SUPPORT (can read and write large files on file system)
ZIP64_SUPPORT (use Zip64 to store large files in archives)
```
or use the di... |
323,136 | What is the best way to compress a file if it is more than 4 GB in size?
I am using the following for last several months.
```
mysqldump --all-databases | zip > mybackup.zip
```
Today I am got an error:
```
zip error: Entry too big to split, read, or write (file exceeds Zip's 4GB uncompressed size limit)
```
I a... | 2011/10/20 | [
"https://serverfault.com/questions/323136",
"https://serverfault.com",
"https://serverfault.com/users/16842/"
] | Why not use the industry standard for this kind of stuff: "gzip"?
```
mysqldump --all-databases | gzip > mybackup.gz
```
Size Comparison:
```
720K mybackup.gz (compressed)
2.6M mybackup.sql (same data, but uncompressed for comparison)
``` | Use xz:
```
mysqldump --all-databases | xz -9 -c > mybackup.xz
```
The compression ratio is much higher than zip, just make sure to watch the memory usage. If you are running xz in a memory-restricted environment you could use the following table to tune the command and avoid paging:
```
Preset DictSize CompCPU ... |
323,136 | What is the best way to compress a file if it is more than 4 GB in size?
I am using the following for last several months.
```
mysqldump --all-databases | zip > mybackup.zip
```
Today I am got an error:
```
zip error: Entry too big to split, read, or write (file exceeds Zip's 4GB uncompressed size limit)
```
I a... | 2011/10/20 | [
"https://serverfault.com/questions/323136",
"https://serverfault.com",
"https://serverfault.com/users/16842/"
] | Why not use the industry standard for this kind of stuff: "gzip"?
```
mysqldump --all-databases | gzip > mybackup.gz
```
Size Comparison:
```
720K mybackup.gz (compressed)
2.6M mybackup.sql (same data, but uncompressed for comparison)
``` | Either upgrade `zip` to at least version 3.0 to support Zip64:
```
$ zip -v
This is Zip 3.0 (July 5th 2008), by Info-ZIP.
Zip special compilation options:
LARGE_FILE_SUPPORT (can read and write large files on file system)
ZIP64_SUPPORT (use Zip64 to store large files in archives)
```
or use the di... |
54,869,085 | This sounds like a very simple query but I have never needed this calculation before. I'm using SQL Management Studio and SQL Server 2008.
I have a table **ct\_workers** which contains individual employees and a second table cs\_facilities which shows the sites that they work at.
The table ct\_workers has a field **p... | 2019/02/25 | [
"https://Stackoverflow.com/questions/54869085",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8320631/"
] | You can use a `GROUP BY` with `HAVING`
```
SELECT cw.person
FROM ct_workers cw
GROUP BY cw.person
HAVING COUNT(DISTINCT cw.facility) >= 2
``` | Your question suggests that you can use aggregation:
```
select w.person
from ct_workers w
group by w.person
having min(w.facility) <> max(w.facility); -- at least 2 values
```
However, if the `person` is the unique key in `ct_workers`, then a person can only be in one facility. So, your question would not make sen... |
28,071,515 | I have a WCF project referring another DAL project with entity framework 5 EDMX.
I can't retrieve the metadata of my service : <http://localhost:12034/DataService.svc/>$metadata
Its returning following error :
>
> An IEdmModel instance was found that failed validation. The following errors were reported:
> TypeMi... | 2015/01/21 | [
"https://Stackoverflow.com/questions/28071515",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2699762/"
] | That seems an issue of WCF Data Services with the composite key's order. A related thread: [Getting Metadata TypeMismatchRelationshipConstraint error for WCF Data Services project](https://social.msdn.microsoft.com/Forums/en-US/242da242-f2a9-498d-8f68-a29ef19ab222/getting-metadata-typemismatchrelationshipconstraint-err... | In your db, check the datatype of ResourceType on the Resource table, and verify it's the same datatype of the ResourceTypeID on the ResourceType table. Do the same for the TenantID field.
As long as those are the same, update your EDMX from the table, then, right click in your EDMX file and click, "Add Code Generatio... |
2,095,280 | I have a picture on my website which has to much space beneath a picture. I tried to search for extra
tags, but I quess it's controlled in a css file. Can someone tell me which part of the css is responsible for the space?
The location is: images/artikelen/123.png
this is a part of the html leading to the css con... | 2010/01/19 | [
"https://Stackoverflow.com/questions/2095280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/156875/"
] | You can use Firefox browser with its DOM Insector Tool to find out. Is it the piece of code from <http://www.friesecomputerservice.nl>? (I just googled over 'Friese Computer Service - Computerhulp en PC probleem' :) ) If so, then you've got the following in your <http://www.friesecomputerservice.nl/templates/rt_affinit... | Without the CSS it's hard to guess what's happening, but try putting this in your CSS:
```
.moduletable img { display: block; }
``` |
25,872 | Whenever I enter my school I'm forbidden to drink energy drinks. I asked them why and they listed lots of reasons why I wasn't allowed.
I asked "why is smoking not forbidden but something so simple as drinking energy drinks is?" and they replied "smoking is a personal decision and drinking energy drinks doesn't just h... | 2018/02/06 | [
"https://law.stackexchange.com/questions/25872",
"https://law.stackexchange.com",
"https://law.stackexchange.com/users/15495/"
] | >
> "When ever I enter my college I'm forbidden to drink energy drinks..."
>
>
>
You are under a contract and bound by the rules and regulations of the college; read the contract you signed when you registered for classes and paid tuition.
That contract will stipulate what you are allowed to do and not do in clas... | You could evade it by getting cancer.
-------------------------------------
Schools and colleges in the UK are required (by the Equality Act 2010) to provide '[reasonable adjustment](https://www.equalityhumanrights.com/en/advice-and-guidance/what-are-reasonable-adjustments)' for students with disability. Cancer and ot... |
25,872 | Whenever I enter my school I'm forbidden to drink energy drinks. I asked them why and they listed lots of reasons why I wasn't allowed.
I asked "why is smoking not forbidden but something so simple as drinking energy drinks is?" and they replied "smoking is a personal decision and drinking energy drinks doesn't just h... | 2018/02/06 | [
"https://law.stackexchange.com/questions/25872",
"https://law.stackexchange.com",
"https://law.stackexchange.com/users/15495/"
] | Unfortunately you cannot, the only solution is to stop at a shop after school finishes and buy an energy drink from there. Then you can drink it as you are not at school anymore. | You could evade it by getting cancer.
-------------------------------------
Schools and colleges in the UK are required (by the Equality Act 2010) to provide '[reasonable adjustment](https://www.equalityhumanrights.com/en/advice-and-guidance/what-are-reasonable-adjustments)' for students with disability. Cancer and ot... |
33,583 | I am using ubuntu for development. And I want to test my application on IE. So, instead of remote desktop I want to access IE as remote application from other windows machine. So the other guy whose working on windows machine can continue with his work and I can also test my application.
Are there any ways to access I... | 2011/04/05 | [
"https://askubuntu.com/questions/33583",
"https://askubuntu.com",
"https://askubuntu.com/users/12526/"
] | To run multiple sessions as you describe, the Windows machine would need to be running Windows Server. The terminal service for the desktop editions are limited to one active session at once so they don't devalue the server.
If you have a spare Windows license lying around, you could always install it in VirtualBox an... | There is something called TeamViewer (<http://www.teamviewer.com/en/index.aspx>) which can be installed on each system and is cross-platform. You might be able to use this for your needs. |
33,583 | I am using ubuntu for development. And I want to test my application on IE. So, instead of remote desktop I want to access IE as remote application from other windows machine. So the other guy whose working on windows machine can continue with his work and I can also test my application.
Are there any ways to access I... | 2011/04/05 | [
"https://askubuntu.com/questions/33583",
"https://askubuntu.com",
"https://askubuntu.com/users/12526/"
] | To run multiple sessions as you describe, the Windows machine would need to be running Windows Server. The terminal service for the desktop editions are limited to one active session at once so they don't devalue the server.
If you have a spare Windows license lying around, you could always install it in VirtualBox an... | You can try my packaged application called [WinConn](http://stanev.org/winconn/)
Further details in this AU Q&A:
* [Remmina remoteapp over RDP](https://askubuntu.com/questions/148159/remmina-remoteapp-over-rdp/167901#167901) |
2,334,883 | >
> **Possible Duplicate:**
>
> [How to clean HTML tags using C#](https://stackoverflow.com/questions/1038431/how-to-clean-html-tags-using-c)
>
>
>
What is the best way to strip HTML tags in C#? | 2010/02/25 | [
"https://Stackoverflow.com/questions/2334883",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/281296/"
] | ```
public static string StripHTML(string htmlString)
{
string pattern = @"<(.|\n)*?>";
return Regex.Replace(htmlString, pattern, string.Empty);
}
``` | To guarantee that no HTML tags get through, use: [`HttpServerUtility.HtmlEncode(string);`](http://msdn.microsoft.com/en-us/library/system.web.httpserverutility.htmlencode.aspx).
If you want *some* to get through, you can use this ["Whitelist" approach](http://refactormycode.com/codes/333-sanitize-html).
Update: Ther... |
2,334,883 | >
> **Possible Duplicate:**
>
> [How to clean HTML tags using C#](https://stackoverflow.com/questions/1038431/how-to-clean-html-tags-using-c)
>
>
>
What is the best way to strip HTML tags in C#? | 2010/02/25 | [
"https://Stackoverflow.com/questions/2334883",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/281296/"
] | Take your HTML string or document and parse it with [HTML Agility Pack](http://www.codeplex.com/htmlagilitypack). This will give you a HTMLDocument object that is very similar to a XmlDocument.
You can then use it's methods such as `SelectNodes` to access those portions of the document that you are interested in.
If ... | To guarantee that no HTML tags get through, use: [`HttpServerUtility.HtmlEncode(string);`](http://msdn.microsoft.com/en-us/library/system.web.httpserverutility.htmlencode.aspx).
If you want *some* to get through, you can use this ["Whitelist" approach](http://refactormycode.com/codes/333-sanitize-html).
Update: Ther... |
2,334,883 | >
> **Possible Duplicate:**
>
> [How to clean HTML tags using C#](https://stackoverflow.com/questions/1038431/how-to-clean-html-tags-using-c)
>
>
>
What is the best way to strip HTML tags in C#? | 2010/02/25 | [
"https://Stackoverflow.com/questions/2334883",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/281296/"
] | ```
public static string StripHTML(string htmlString)
{
string pattern = @"<(.|\n)*?>";
return Regex.Replace(htmlString, pattern, string.Empty);
}
``` | Take your HTML string or document and parse it with [HTML Agility Pack](http://www.codeplex.com/htmlagilitypack). This will give you a HTMLDocument object that is very similar to a XmlDocument.
You can then use it's methods such as `SelectNodes` to access those portions of the document that you are interested in.
If ... |
57,759,254 | I'm writing an app that requires an access code when starting the app. I also request this access code when retrieving the app from the background.
To do that I use the event "onResume". Unfortunately "onResume" is also triggered when I rotate the screen. But I do not want to miss the rotation of the screen.
I followe... | 2019/09/02 | [
"https://Stackoverflow.com/questions/57759254",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7261695/"
] | >
> is it better to set the left fragment to a 0dp width, or set android:visibility="gone"?
>
>
>
In terms of UI load, there is very little difference between these two. Regardless of the option you choose, the left fragment would still be inflated (even though it's not visible to the user). **So basically, it's y... | Yes. Its lifecycle events will be triggered. Because fragment lifecycle does not depend on the UI but on the connection to the fragmentManager of an activity. |
19,914,910 | I'm trying to use Indy's TIdHTTP component to send data to a website.
The code works perfectly on Windows platform but unfortunately it behaves strangely on Android platform. The problem occurs when I use TIdMultipartFormDataStream to send POST parameters.
On Android platform TIdMultipartFormDataStream behaves strange... | 2013/11/11 | [
"https://Stackoverflow.com/questions/19914910",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2980457/"
] | What you describe sounds like a `ZEROBASEDSTRINGS` bug, which should not exist in the current SVN version because Indy disables `ZEROBASEDSTRINGS` globally in all of its units after it kept suffering from lots of ZBS bugs in XE4. So I do suggest you upgrade to the lastest SVN verson. If you are having problems doing so... | Works..
```
procedure HTTPPOST;
var
HTTP: TIdHTTP;
POSTData: TIdMultipartFormDataStream;
begin
HTTP := TIdHTTP.Create(nil);
POSTData := TIdMultipartFormDataStream.Create;
try
POSTData.AddFile('myfile','file.txt'); // works
POSTData.AddFormField('username', UTF8En... |
48,202,422 | I had such API for async requests
```
request(pathParams, params, method, callback, error) {
...........
return $.ajax({
...requestAttrs,
url: url,
data: params,
xhrFields: {
withCredentials: true
},
type: metho... | 2018/01/11 | [
"https://Stackoverflow.com/questions/48202422",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I took the liberty to change your code a little bit.
My approach is to separate code as much as possible so you don't get into the [Callback Hell](http://callbackhell.com/).
1. Create `someAsyncFunction` and make whatever you judge necessary so then you can return its value
2. Same applies to your `ajax` call. In ca... | You may want to do like this. Hope this fits your case. If I misunderstood it, pls ping in the comment.
Here, I just returned a string, you can edit to return the ajax request.
```js
function someAsyncFunction(callback)
{
//do something
return callback();
}
function request(pathParams, params, method, c... |
48,202,422 | I had such API for async requests
```
request(pathParams, params, method, callback, error) {
...........
return $.ajax({
...requestAttrs,
url: url,
data: params,
xhrFields: {
withCredentials: true
},
type: metho... | 2018/01/11 | [
"https://Stackoverflow.com/questions/48202422",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | OK, I see where your problem is. Apologies for not thinking it through. The jqXHR that `$.ajax` returns functions in two ways: both as a promise, and also as a handle where you can abort it before it is done. The first requires we return it, so that we can continue the promise chain. The second requires we retain it, s... | You may want to do like this. Hope this fits your case. If I misunderstood it, pls ping in the comment.
Here, I just returned a string, you can edit to return the ajax request.
```js
function someAsyncFunction(callback)
{
//do something
return callback();
}
function request(pathParams, params, method, c... |
33,206,754 | the data is captured from a textarea to begin with.
Line1
Line2
Line3
etc
It is sent through this function before being stored in the DB (i'm open to better solutions, but if PDO is one of them, I don't understand it and have yet to get it to work)
```
function test_input($data) {
global $conn;
$data = trim... | 2015/10/19 | [
"https://Stackoverflow.com/questions/33206754",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4056141/"
] | Replace the `\r\n` in the text with ` ` before putting it into to the textarea and showing it to the user.
It worked for me. | Try This May be help full
```
<?php
function nl2br2($string) {
$string = str_replace(array("\r\n", "\r", "\n"), "<br />", $string);
return $string;
}
?>
``` |
33,206,754 | the data is captured from a textarea to begin with.
Line1
Line2
Line3
etc
It is sent through this function before being stored in the DB (i'm open to better solutions, but if PDO is one of them, I don't understand it and have yet to get it to work)
```
function test_input($data) {
global $conn;
$data = trim... | 2015/10/19 | [
"https://Stackoverflow.com/questions/33206754",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4056141/"
] | Replace the `\r\n` in the text with ` ` before putting it into to the textarea and showing it to the user.
It worked for me. | Html versus php and windows (carriage return and newline). Le
rning what happens
when you have a field of values in a buffer. A buffer can be coming from or going to an input/output device
What is inside the buffer may need to be substituted for a string appropriate to the device.
Pulling data from a DB line by line or... |
1,922,761 | On Linux systems (either 32- or 64-bit), what is the size of `pid_t`, `uid_t`, and `gid_t`? | 2009/12/17 | [
"https://Stackoverflow.com/questions/1922761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/156/"
] | ```
#include <stdio.h>
#include <sys/types.h>
int main()
{
printf("pid_t: %zu\n", sizeof(pid_t));
printf("uid_t: %zu\n", sizeof(uid_t));
printf("gid_t: %zu\n", sizeof(gid_t));
}
```
**EDIT:** Per popular request (and because, realistically, 99% of the people coming to this question are going to be runnin... | On intel architectures, sizes are defined in `/usr/include/bits/typesizes.h`:
```
#define __UID_T_TYPE __U32_TYPE
#define __GID_T_TYPE __U32_TYPE
#define __PID_T_TYPE __S32_TYPE
```
In other words, `uid_t` and `gid_t` are unsigned 32-bit integers and `pid_t` is a signed 32-bit intege... |
1,922,761 | On Linux systems (either 32- or 64-bit), what is the size of `pid_t`, `uid_t`, and `gid_t`? | 2009/12/17 | [
"https://Stackoverflow.com/questions/1922761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/156/"
] | On intel architectures, sizes are defined in `/usr/include/bits/typesizes.h`:
```
#define __UID_T_TYPE __U32_TYPE
#define __GID_T_TYPE __U32_TYPE
#define __PID_T_TYPE __S32_TYPE
```
In other words, `uid_t` and `gid_t` are unsigned 32-bit integers and `pid_t` is a signed 32-bit intege... | The [standard](http://pubs.opengroup.org/onlinepubs/007904975/toc.htm) defines `pid_t` as a "signed integer type" and `uid_t` and `gid_t` merely as "integer types" (so portable code shouldn't assume any particular type for them). |
1,922,761 | On Linux systems (either 32- or 64-bit), what is the size of `pid_t`, `uid_t`, and `gid_t`? | 2009/12/17 | [
"https://Stackoverflow.com/questions/1922761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/156/"
] | ```
#include <stdio.h>
#include <sys/types.h>
int main()
{
printf("pid_t: %zu\n", sizeof(pid_t));
printf("uid_t: %zu\n", sizeof(uid_t));
printf("gid_t: %zu\n", sizeof(gid_t));
}
```
**EDIT:** Per popular request (and because, realistically, 99% of the people coming to this question are going to be runnin... | The [standard](http://pubs.opengroup.org/onlinepubs/007904975/toc.htm) defines `pid_t` as a "signed integer type" and `uid_t` and `gid_t` merely as "integer types" (so portable code shouldn't assume any particular type for them). |
24,612,909 | I am a computer science student. I studied C, then came to C++[an object oriented one] and now Java[More Object Oriented]. My question is whether 'C' language is of any importance these days? Did I study it for the sake of studying the languages in the order in which they were developed so as to understand languages st... | 2014/07/07 | [
"https://Stackoverflow.com/questions/24612909",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2557939/"
] | The main scopes are:
* drivers
* operating systems
* systems where performance is critical
* small embedded systems (thanks Joachim) | C is still heavily used in situations where otherwise one would drop down to assembler, since it's one of the few structured languages to let users code that close to the hardware.
And a lot of what claims to be C++ code is C code with an OOP wrapper. |
26,249,118 | I am receiving the following error when running my code.
>
> error: incompatible types: double cannot be converted to JTextField
>
>
>
JGrasp is pointing to the following as the issue.
>
> Programming6\_4.Java:143: error: incompatible types: double cannot be
> converted to JTextField
> averageScoreTF = (tes... | 2014/10/08 | [
"https://Stackoverflow.com/questions/26249118",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4119667/"
] | Change this lines:
```
averageScoreTF = (test1 * wght1 + test2 * wght2 + test3 * wght3 + test4 * wght4);
```
to:
```
avgscore = (test1 * wght1 + test2 * wght2 + test3 * wght3 + test4 * wght4);
```
You cannot assign a double to `averageScoreTF` since `averageScoreTF` is not a numeric type (just like the error mess... | You clearly are confused - a double is a number, a jtextfield is a GUI widget.
Most likely you want to print your number into a text field for presentation. |
51,762,741 | Here is my piece of HTML code (please ignore not closed tags):
```
<div class="row" ng-hide="hideCaptiveRow">
<div class="col-md-6">
<div class="col-md-6">
<div data-ac-chart="'pie'"
data-ac-data="memCaptive.status.data"
data-ac-config="memCaptive.status.con... | 2018/08/09 | [
"https://Stackoverflow.com/questions/51762741",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8805641/"
] | In regular expressions, the dot usually is a placeholder for any character. Thus, you have to escape it. In .NET, this is done with a backslash: `A-Za-z0-9\.` | This may work :
```
[a-zA-Z]|\d|\s|\.*
``` |
5,112,462 | I want to be able to convert a html form to an ExtJs form. I have read that you have to do something with applyTo but wasn't really sure about what to do.
I hope someone can provide me with some help,
Cheers | 2011/02/25 | [
"https://Stackoverflow.com/questions/5112462",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/520771/"
] | If you want to convert every element in a form to an ExtJS element, someone on the [Sencha forums](http://www.sencha.com/forum/showthread.php?5481-Convert-Existing-HTML-Form) has posted a solution (which I will cross-post here):
```
function convertForm(formId) {
var frm = new Ext.form.BasicForm(formId);
//frm... | Additionally, who is interested, buttons can be converted too:
```
var objArray = Ext.DomQuery.select("input[type=button]");
Ext.each(objArray, function(obj) {
var btn = new Ext.Button({
text : obj.value,
applyTo : obj,
handler : obj.onclick,
... |
64,849,688 | I don't use PHP that often but when I do and I need to write a function to send E-Mails, I just used the mail() function. I have used it on a shared hosting service and I always received the E-Mails from a... well... not an account? A bot? It didn't even have an E-Mail address.
And that's what I want to achieve at thi... | 2020/11/15 | [
"https://Stackoverflow.com/questions/64849688",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14501117/"
] | This did make me laugh a bit...
No, emails can't just magically spring into existence, but there isn't necessarily a direct correlation between email user accounts and addresses.
When you send from a shared hosting account by calling `mail()`, the mail server knows the account you're sending from, and sometimes doesn... | To my knowledge it is possible and have it work correctly each time. In the last year I found that the e-mails I sent using the mail() function would immediately go into my spam box (as well as the junk box of others) causing great confusion. I upgraded to PHPMailer to solve this and I have never set it up to use SMTP ... |
27,483,215 | I'm trying to use the following style to create a text-stroke using text-shadow:
```
.text-stroke {
text-shadow: -1px -1px 0 white,
1px -1px 0 white,
-1px 1px 0 white,
1px 1px 0 white;
}
```
It doesn't work for the mobile versions of Firefox and Chrome. Is there anything I can do to make it work in mobile? | 2014/12/15 | [
"https://Stackoverflow.com/questions/27483215",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1744104/"
] | How about something like this? You may need to `install.packages("ggplot2")`
```
library(ggplot2)
my_df <- data.frame(uni=runif(100),
norm=rnorm(100),
bino=rbinom(100, 20, 0.5))
get_histogram <- function(df, varname, binwidth=1, save=T) {
stopifnot(varname %in% names(df))
... | So I ended up with 2 functions, one that can iterate over data frames, and another that takes a single vectors. Using parts of Adrian's [thanks!] solution:
`hist_dataframe <- function(variable, col ="gold1", ...) {
stopifnot(colName %in% colnames(df))
variable = df[,colName]
stopifnot(length (variable) >1 )
plotn... |
42,173,764 | I'm having a strange problem stacking dataframe columns into 3 columns. For some reason, the factor column loses its value when it's stacked.
When I use the below code, in theory, the Treatment values should stack on top of each other, not get replaced by one value.
```
library(reshape2)
test1<-reshape(df, direction=... | 2017/02/11 | [
"https://Stackoverflow.com/questions/42173764",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Duplicate column names causing this issue for you. Better way is to split them and correct for column names and then bind them together using `rbind`.
I tried to keep all information by creating two new columns to store the information of `q3_...`
```
do.call('rbind', lapply(seq(3, 12, by = 3), function(x) { y <- df1[... | You can also fix this and use the same code by giving unique names to your variables with `make.unique`.
```
names(df) <- make.unique(names(df))
test1 <- reshape(df, direction="long",
varying=split(names(df), rep(seq_len(ncol(df)/4), 3)))
```
This returns
test1
```
time q3_1mo q3_1yr Treat... |
842,390 | I have an ASP.NET page with a drop down (asp:DropDownList) control. I also have a defined ENUM
```
Public Enum myEnumType As Integer
A
B
C
End Enum
```
I want to define the "value" property of each asp:ListItem with one of the ENUM value (A,B,C represented as a string of course). I also want to assign the "tex... | 2009/05/09 | [
"https://Stackoverflow.com/questions/842390",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1363/"
] | The code doesn't make much sense. Why do you use Enum in this case? It's the same like using constants. It looks like you can get away with hard coding values.
```
<asp:DropDownList ID="myCombo" runat="server">
<asp:ListItem Text="cat" Value="A" />
<asp:ListItem Text="dog" Value="B" />
<asp:ListItem Text="ant" V... | Why not databind?
```
enum MyFavoriteEnum { A=1, B=2, C=3 }
for(int i =0; i<Enum.GetNames(typeof(MyFavoriteEnum)).Length;i++)
{
ListItem li = new ListItem(
Enum.GetNames(typeof(MyFavoriteEnum))[i],
((int)Enum.GetValues(typeof(MyFavoriteEnum)).GetValue(i)).ToString()
);
dropDown.Items.Add(li... |
842,390 | I have an ASP.NET page with a drop down (asp:DropDownList) control. I also have a defined ENUM
```
Public Enum myEnumType As Integer
A
B
C
End Enum
```
I want to define the "value" property of each asp:ListItem with one of the ENUM value (A,B,C represented as a string of course). I also want to assign the "tex... | 2009/05/09 | [
"https://Stackoverflow.com/questions/842390",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1363/"
] | The code doesn't make much sense. Why do you use Enum in this case? It's the same like using constants. It looks like you can get away with hard coding values.
```
<asp:DropDownList ID="myCombo" runat="server">
<asp:ListItem Text="cat" Value="A" />
<asp:ListItem Text="dog" Value="B" />
<asp:ListItem Text="ant" V... | ```
foreach(var item in Enum.GetValues(typeof(MyEnum)))
{
lbEnum.Items.Add(new ListItem(Enum.GetName(typeof(MyEnum), item), item.ToString()));
}
``` |
842,390 | I have an ASP.NET page with a drop down (asp:DropDownList) control. I also have a defined ENUM
```
Public Enum myEnumType As Integer
A
B
C
End Enum
```
I want to define the "value" property of each asp:ListItem with one of the ENUM value (A,B,C represented as a string of course). I also want to assign the "tex... | 2009/05/09 | [
"https://Stackoverflow.com/questions/842390",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1363/"
] | MathewMartin's answer works just seems really inefficient. Wouldn't this be a better/cleaner approach?
```
string[] names = Enum.GetNames(typeof(MyFavoriteEnum));
int[] values = (int[])Enum.GetValues(typeof(MyFavoriteEnum));
for(int i =0; i<names.Length;i++){
dropDown.Items.Add(
new ListItem(
names[i... | Why not databind?
```
enum MyFavoriteEnum { A=1, B=2, C=3 }
for(int i =0; i<Enum.GetNames(typeof(MyFavoriteEnum)).Length;i++)
{
ListItem li = new ListItem(
Enum.GetNames(typeof(MyFavoriteEnum))[i],
((int)Enum.GetValues(typeof(MyFavoriteEnum)).GetValue(i)).ToString()
);
dropDown.Items.Add(li... |
842,390 | I have an ASP.NET page with a drop down (asp:DropDownList) control. I also have a defined ENUM
```
Public Enum myEnumType As Integer
A
B
C
End Enum
```
I want to define the "value" property of each asp:ListItem with one of the ENUM value (A,B,C represented as a string of course). I also want to assign the "tex... | 2009/05/09 | [
"https://Stackoverflow.com/questions/842390",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1363/"
] | ```
foreach(var item in Enum.GetValues(typeof(MyEnum)))
{
lbEnum.Items.Add(new ListItem(Enum.GetName(typeof(MyEnum), item), item.ToString()));
}
``` | Why not databind?
```
enum MyFavoriteEnum { A=1, B=2, C=3 }
for(int i =0; i<Enum.GetNames(typeof(MyFavoriteEnum)).Length;i++)
{
ListItem li = new ListItem(
Enum.GetNames(typeof(MyFavoriteEnum))[i],
((int)Enum.GetValues(typeof(MyFavoriteEnum)).GetValue(i)).ToString()
);
dropDown.Items.Add(li... |
842,390 | I have an ASP.NET page with a drop down (asp:DropDownList) control. I also have a defined ENUM
```
Public Enum myEnumType As Integer
A
B
C
End Enum
```
I want to define the "value" property of each asp:ListItem with one of the ENUM value (A,B,C represented as a string of course). I also want to assign the "tex... | 2009/05/09 | [
"https://Stackoverflow.com/questions/842390",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1363/"
] | MathewMartin's answer works just seems really inefficient. Wouldn't this be a better/cleaner approach?
```
string[] names = Enum.GetNames(typeof(MyFavoriteEnum));
int[] values = (int[])Enum.GetValues(typeof(MyFavoriteEnum));
for(int i =0; i<names.Length;i++){
dropDown.Items.Add(
new ListItem(
names[i... | ```
foreach(var item in Enum.GetValues(typeof(MyEnum)))
{
lbEnum.Items.Add(new ListItem(Enum.GetName(typeof(MyEnum), item), item.ToString()));
}
``` |
37,354,203 | I'm typing a program where Olympic rings are drawn according to input (radius). My question is, given the input, how do I get the position coordinates (x,y) to scale accordingly?
The default radius I had for them to all match up is 70. Enter 70.
Here's my code:
```
radius =input('Enter the radius of your circle: ') ... | 2016/05/20 | [
"https://Stackoverflow.com/questions/37354203",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6362617/"
] | How about scaling the coordinates accordingly?
Code -
```
radius =input('Enter the radius of your circle: ') #Asking for radius of the circle
r = float(radius)
x = r / 70
import turtle
t = turtle.Turtle
t = turtle.Turtle(shape="turtle")
#Circle one
t.pensize(10)
t.penup()
t.goto(0,0)
t.pendown()
t.color("green") #... | What you need is a multiplicator. Your code is really repetetive though, whenever you've got something like this you want to use a loop instead of a bunch of commands, this will make your code easier to maintain and more readable. This would be my approach:
```
radius =input('Enter the radius of your circle: ') #Askin... |
18,105,299 | I've have to scripts:
```
#!/bin/bash
netcat -lk -p 12345 | while read line
do
match=$(echo $line | grep -c 'Keep-Alive')
if [ $match -eq 1 ]; then
[start a command]
fi
done
```
and
```
#!/bin/bash
netcat -lk -p 12346 | while read line
do
match=$(echo $line | grep -c 'Keep-Alive')
if ... | 2013/08/07 | [
"https://Stackoverflow.com/questions/18105299",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/892975/"
] | About the loop it could look like this.
```
#!/bin/bash
for (( ;; ))
do
netcat -lk -p 12345 | while read line
do
match=$(echo "$line" | grep -c 'Keep-Alive')
if [ "$match" -eq 1 ]; then
[start a command]
fi
done
sleep 4s
done
```
with added double quotes to keep i... | you may not use the -p option in the case you will wait for an incoming connect request.
(see man page of nc) Hostname and Port are the last two arguments of the command line.
May be it connects to the own port and after some hours there is some resource missing?? |
18,105,299 | I've have to scripts:
```
#!/bin/bash
netcat -lk -p 12345 | while read line
do
match=$(echo $line | grep -c 'Keep-Alive')
if [ $match -eq 1 ]; then
[start a command]
fi
done
```
and
```
#!/bin/bash
netcat -lk -p 12346 | while read line
do
match=$(echo $line | grep -c 'Keep-Alive')
if ... | 2013/08/07 | [
"https://Stackoverflow.com/questions/18105299",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/892975/"
] | About the loop it could look like this.
```
#!/bin/bash
for (( ;; ))
do
netcat -lk -p 12345 | while read line
do
match=$(echo "$line" | grep -c 'Keep-Alive')
if [ "$match" -eq 1 ]; then
[start a command]
fi
done
sleep 4s
done
```
with added double quotes to keep i... | I have often experienced strange behaviour with `nc` or `netcat`. You should have a look at `ncat` it's almost the same tool but it behaves the same on all platforms (`nc` and `netcat` behave differently depending on distri, linux, BSD, Mac). |
18,105,299 | I've have to scripts:
```
#!/bin/bash
netcat -lk -p 12345 | while read line
do
match=$(echo $line | grep -c 'Keep-Alive')
if [ $match -eq 1 ]; then
[start a command]
fi
done
```
and
```
#!/bin/bash
netcat -lk -p 12346 | while read line
do
match=$(echo $line | grep -c 'Keep-Alive')
if ... | 2013/08/07 | [
"https://Stackoverflow.com/questions/18105299",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/892975/"
] | I have often experienced strange behaviour with `nc` or `netcat`. You should have a look at `ncat` it's almost the same tool but it behaves the same on all platforms (`nc` and `netcat` behave differently depending on distri, linux, BSD, Mac). | you may not use the -p option in the case you will wait for an incoming connect request.
(see man page of nc) Hostname and Port are the last two arguments of the command line.
May be it connects to the own port and after some hours there is some resource missing?? |
18,105,299 | I've have to scripts:
```
#!/bin/bash
netcat -lk -p 12345 | while read line
do
match=$(echo $line | grep -c 'Keep-Alive')
if [ $match -eq 1 ]; then
[start a command]
fi
done
```
and
```
#!/bin/bash
netcat -lk -p 12346 | while read line
do
match=$(echo $line | grep -c 'Keep-Alive')
if ... | 2013/08/07 | [
"https://Stackoverflow.com/questions/18105299",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/892975/"
] | If none of your commands including netcat reads input from stdin you can completely make it run independent of the terminal. Sometimes background process that are still dependent on the terminal pauses (S) when they try to read input from it on a background. Actually since you're running a daemon, you should make sure ... | About the loop it could look like this.
```
#!/bin/bash
for (( ;; ))
do
netcat -lk -p 12345 | while read line
do
match=$(echo "$line" | grep -c 'Keep-Alive')
if [ "$match" -eq 1 ]; then
[start a command]
fi
done
sleep 4s
done
```
with added double quotes to keep i... |
18,105,299 | I've have to scripts:
```
#!/bin/bash
netcat -lk -p 12345 | while read line
do
match=$(echo $line | grep -c 'Keep-Alive')
if [ $match -eq 1 ]; then
[start a command]
fi
done
```
and
```
#!/bin/bash
netcat -lk -p 12346 | while read line
do
match=$(echo $line | grep -c 'Keep-Alive')
if ... | 2013/08/07 | [
"https://Stackoverflow.com/questions/18105299",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/892975/"
] | Periodically netcat will print, not a line, but a block of binary data. The read builtin will likely fail as a result.
I think you're using this program to verify that a remote host is still connected to port 12345 and 12346 and hasn't been rebooted.
My solution for you is to pipe the output of netcat to sed, then p... | you may not use the -p option in the case you will wait for an incoming connect request.
(see man page of nc) Hostname and Port are the last two arguments of the command line.
May be it connects to the own port and after some hours there is some resource missing?? |
18,105,299 | I've have to scripts:
```
#!/bin/bash
netcat -lk -p 12345 | while read line
do
match=$(echo $line | grep -c 'Keep-Alive')
if [ $match -eq 1 ]; then
[start a command]
fi
done
```
and
```
#!/bin/bash
netcat -lk -p 12346 | while read line
do
match=$(echo $line | grep -c 'Keep-Alive')
if ... | 2013/08/07 | [
"https://Stackoverflow.com/questions/18105299",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/892975/"
] | About the loop it could look like this.
```
#!/bin/bash
for (( ;; ))
do
netcat -lk -p 12345 | while read line
do
match=$(echo "$line" | grep -c 'Keep-Alive')
if [ "$match" -eq 1 ]; then
[start a command]
fi
done
sleep 4s
done
```
with added double quotes to keep i... | You mentioned *"after around 12 hours, the whole system stops working"* - It is likely that the scripts are executing whatever you have in `[start a command]` and is bloating the memory. Are you sure the `[start a command]` is not forking out many processes very frequently and releasing memory? |
18,105,299 | I've have to scripts:
```
#!/bin/bash
netcat -lk -p 12345 | while read line
do
match=$(echo $line | grep -c 'Keep-Alive')
if [ $match -eq 1 ]; then
[start a command]
fi
done
```
and
```
#!/bin/bash
netcat -lk -p 12346 | while read line
do
match=$(echo $line | grep -c 'Keep-Alive')
if ... | 2013/08/07 | [
"https://Stackoverflow.com/questions/18105299",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/892975/"
] | If none of your commands including netcat reads input from stdin you can completely make it run independent of the terminal. Sometimes background process that are still dependent on the terminal pauses (S) when they try to read input from it on a background. Actually since you're running a daemon, you should make sure ... | you may not use the -p option in the case you will wait for an incoming connect request.
(see man page of nc) Hostname and Port are the last two arguments of the command line.
May be it connects to the own port and after some hours there is some resource missing?? |
18,105,299 | I've have to scripts:
```
#!/bin/bash
netcat -lk -p 12345 | while read line
do
match=$(echo $line | grep -c 'Keep-Alive')
if [ $match -eq 1 ]; then
[start a command]
fi
done
```
and
```
#!/bin/bash
netcat -lk -p 12346 | while read line
do
match=$(echo $line | grep -c 'Keep-Alive')
if ... | 2013/08/07 | [
"https://Stackoverflow.com/questions/18105299",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/892975/"
] | About the loop it could look like this.
```
#!/bin/bash
for (( ;; ))
do
netcat -lk -p 12345 | while read line
do
match=$(echo "$line" | grep -c 'Keep-Alive')
if [ "$match" -eq 1 ]; then
[start a command]
fi
done
sleep 4s
done
```
with added double quotes to keep i... | Periodically netcat will print, not a line, but a block of binary data. The read builtin will likely fail as a result.
I think you're using this program to verify that a remote host is still connected to port 12345 and 12346 and hasn't been rebooted.
My solution for you is to pipe the output of netcat to sed, then p... |
18,105,299 | I've have to scripts:
```
#!/bin/bash
netcat -lk -p 12345 | while read line
do
match=$(echo $line | grep -c 'Keep-Alive')
if [ $match -eq 1 ]; then
[start a command]
fi
done
```
and
```
#!/bin/bash
netcat -lk -p 12346 | while read line
do
match=$(echo $line | grep -c 'Keep-Alive')
if ... | 2013/08/07 | [
"https://Stackoverflow.com/questions/18105299",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/892975/"
] | If none of your commands including netcat reads input from stdin you can completely make it run independent of the terminal. Sometimes background process that are still dependent on the terminal pauses (S) when they try to read input from it on a background. Actually since you're running a daemon, you should make sure ... | You mentioned *"after around 12 hours, the whole system stops working"* - It is likely that the scripts are executing whatever you have in `[start a command]` and is bloating the memory. Are you sure the `[start a command]` is not forking out many processes very frequently and releasing memory? |
18,105,299 | I've have to scripts:
```
#!/bin/bash
netcat -lk -p 12345 | while read line
do
match=$(echo $line | grep -c 'Keep-Alive')
if [ $match -eq 1 ]; then
[start a command]
fi
done
```
and
```
#!/bin/bash
netcat -lk -p 12346 | while read line
do
match=$(echo $line | grep -c 'Keep-Alive')
if ... | 2013/08/07 | [
"https://Stackoverflow.com/questions/18105299",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/892975/"
] | If none of your commands including netcat reads input from stdin you can completely make it run independent of the terminal. Sometimes background process that are still dependent on the terminal pauses (S) when they try to read input from it on a background. Actually since you're running a daemon, you should make sure ... | Periodically netcat will print, not a line, but a block of binary data. The read builtin will likely fail as a result.
I think you're using this program to verify that a remote host is still connected to port 12345 and 12346 and hasn't been rebooted.
My solution for you is to pipe the output of netcat to sed, then p... |
1,326,381 | I have to admit I couldn't find a way to deal with this problem. I am a newbie in mathematics.
$$\int \frac{1}{e^{2x}\cosh(x)^3}dx$$
The only idea I have is to substitute and use the formula below.
$$\int \frac{1}{\cosh^2}dx = \tanh(x)+c $$ | 2015/06/15 | [
"https://math.stackexchange.com/questions/1326381",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/187822/"
] | Using $$\cosh\left(x\right)=\frac{e^{x}+e^{-x}}{2}
$$ we have $$I=\int\frac{1}{e^{2x}\cosh^{3}\left(x\right)}dx=8\int\frac{e^{x}}{\left(e^{2x}+1\right)^{3}}dx
$$ now put $e^{x}=u
$ to get $$=8\int\frac{1}{\left(u^{2}+1\right)^{3}}du
$$ and $u=\tan\left(v\right),\, du=\sec^{2}\left(v\right)dv
$ $$=8\int\frac{1}{\le... | By setting $x=\log t$ we have:
$$\int\frac{dx}{e^{2x}\cosh^3 x}=\int\frac{8 e^{x}\,dx}{e^{6x}+3e^{4x}+3e^{2x}+1}=\int\frac{dt}{(t^2+1)^3}=\frac{1}{8}\left(\frac{5t+3t^3}{(1+t^2)^2}+3\arctan t\right).$$
The last equality follows from:
$$\frac{1}{t^2+1}=\frac{1}{2i}\left(\frac{1}{t-i}-\frac{1}{t+i}\right)$$
that leads t... |
71,611,334 | I want to join 2 python lists by selecting index randomly without changing the order,
```
a=(1,2,3,4,5)
b=(a,b,c,d)
```
to one of these randomly
```
final = (a,b,1,c,2,3,4,d,5)
final = (1,a,b,2,c,3,4,d,5)
final = (a,b,c,1,2,d,3,4,5)
```
etc. | 2022/03/25 | [
"https://Stackoverflow.com/questions/71611334",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17676289/"
] | You can use [`random.shuffle`](https://docs.python.org/3.8/library/random.html#random.shuffle):
```py
from random import shuffle
a = (1, 2, 3, 4, 5)
b = ("a", "b", "c", "d")
out = [iter(a)] * len(a) + [iter(b)] * len(b)
shuffle(out)
out = [next(i) for i in out]
print(out)
```
Prints (for example):
```py
['a', 'b... | I would do something like:
Pseudocode
```
list_a_index = 0
list_b_index = 0
new_list = []
for i in range(len(list_a) + len(list_b)):
which_list = chooseRandomList() #get random A or B
if (which_list == list_a)
new_list.append(list_a[list_a_index])
list_a_index++
#and the same for list_b
... |
35,824,750 | ```
;WITH tblEmployee AS (
SELECT * FROM (VALUES
(1, 'Tom', 'Male', 4000, 1),
(2, 'Pam', 'Female', 3000, 3),
(3, 'John', 'Male', 3500, 1),
(4, 'Sam', 'Male', 4500, 2),
(5, 'Todd', 'Male', 2800, 2),
(6, 'Ben', 'Male', 7000, 1),
(7, 'Sara', 'Female', 4800, 3),
(8, 'Valarie', 'Female', 5500, 1),
(9, 'James', 'Male', 6500,... | 2016/03/06 | [
"https://Stackoverflow.com/questions/35824750",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | This is a Left Outer Join. This will take all records from `tblEmployee` that do not join to `tblDepartment`.
[](https://i.stack.imgur.com/VQ5XP.png) | OP's assumption is correct, the following are a few aspects about `SQL` *JOIN* syntax that will be helpful for beginners to understand once they have grasped the concept of what a *join* is. Its often not enough to know that something is correct or works, we need to understand the reasons behind it.
>
> [This answer ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.