qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
4,404,298 | I don't understand the correlation between $2k^2$ being an integer and $n^2$ being even.
>
> **Prove:** For all integers $n$, if $n$ is even, then $n^2$ is even.
>
>
> *To fill in the details, we will basically just explain what it means for $n$ to be even, and then see what that means for $n^2$. Here is a
> comple... | 2022/03/15 | [
"https://math.stackexchange.com/questions/4404298",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/1036525/"
] | Asserting that an integer is even is the same thing as asserting that it is twice *another integer*. So, since $2k^2$ is an integer, $2(2k^2)$ is an even integer. But $n^2=2(2k^2)$. | Because n is even we can write it of the from $n=2k$ where k is an integer (because if n is even then $\frac{n}{2}$ must be integer. As you have written in the proof $n^2=2(2k^2)$, and because of the fact $2k^2$ is an integer, 2 multiplied by an integer must be even.
Hopefully that helps you :) |
4,404,298 | I don't understand the correlation between $2k^2$ being an integer and $n^2$ being even.
>
> **Prove:** For all integers $n$, if $n$ is even, then $n^2$ is even.
>
>
> *To fill in the details, we will basically just explain what it means for $n$ to be even, and then see what that means for $n^2$. Here is a
> comple... | 2022/03/15 | [
"https://math.stackexchange.com/questions/4404298",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/1036525/"
] | Asserting that an integer is even is the same thing as asserting that it is twice *another integer*. So, since $2k^2$ is an integer, $2(2k^2)$ is an even integer. But $n^2=2(2k^2)$. | To show that $n^2$ is even, by definition we need to show that it is twice an integer—it is not enough for it to simply be twice any number. For example, $1^2=1=2\times\dfrac{1}{2}$, but $1^2$ is not even. |
4,404,298 | I don't understand the correlation between $2k^2$ being an integer and $n^2$ being even.
>
> **Prove:** For all integers $n$, if $n$ is even, then $n^2$ is even.
>
>
> *To fill in the details, we will basically just explain what it means for $n$ to be even, and then see what that means for $n^2$. Here is a
> comple... | 2022/03/15 | [
"https://math.stackexchange.com/questions/4404298",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/1036525/"
] | Asserting that an integer is even is the same thing as asserting that it is twice *another integer*. So, since $2k^2$ is an integer, $2(2k^2)$ is an even integer. But $n^2=2(2k^2)$. | If $n^2$ is even, then it can be written $n^2=2m$ (where $m$ is an integer) in the same way that $n=2k$ was written (where $k$ is an integer).
The "since $2k^2$ is an integer" bit is just reiterating that the "where $m$ is an integer" bit is proven already by the choice of $m=2k^2$ (because multiplying integers by int... |
4,404,298 | I don't understand the correlation between $2k^2$ being an integer and $n^2$ being even.
>
> **Prove:** For all integers $n$, if $n$ is even, then $n^2$ is even.
>
>
> *To fill in the details, we will basically just explain what it means for $n$ to be even, and then see what that means for $n^2$. Here is a
> comple... | 2022/03/15 | [
"https://math.stackexchange.com/questions/4404298",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/1036525/"
] | Because n is even we can write it of the from $n=2k$ where k is an integer (because if n is even then $\frac{n}{2}$ must be integer. As you have written in the proof $n^2=2(2k^2)$, and because of the fact $2k^2$ is an integer, 2 multiplied by an integer must be even.
Hopefully that helps you :) | If $n^2$ is even, then it can be written $n^2=2m$ (where $m$ is an integer) in the same way that $n=2k$ was written (where $k$ is an integer).
The "since $2k^2$ is an integer" bit is just reiterating that the "where $m$ is an integer" bit is proven already by the choice of $m=2k^2$ (because multiplying integers by int... |
4,404,298 | I don't understand the correlation between $2k^2$ being an integer and $n^2$ being even.
>
> **Prove:** For all integers $n$, if $n$ is even, then $n^2$ is even.
>
>
> *To fill in the details, we will basically just explain what it means for $n$ to be even, and then see what that means for $n^2$. Here is a
> comple... | 2022/03/15 | [
"https://math.stackexchange.com/questions/4404298",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/1036525/"
] | To show that $n^2$ is even, by definition we need to show that it is twice an integer—it is not enough for it to simply be twice any number. For example, $1^2=1=2\times\dfrac{1}{2}$, but $1^2$ is not even. | If $n^2$ is even, then it can be written $n^2=2m$ (where $m$ is an integer) in the same way that $n=2k$ was written (where $k$ is an integer).
The "since $2k^2$ is an integer" bit is just reiterating that the "where $m$ is an integer" bit is proven already by the choice of $m=2k^2$ (because multiplying integers by int... |
44,504,268 | I have a problem where I need to read in a very large file and then print the results of a parse per chunk. Not a complete list in the end.
So far I can get the uniq results in a MapSet but am unable to figure out how to write to a file per `chunk_size`
using this method to get a unique file name
```
def new_file_... | 2017/06/12 | [
"https://Stackoverflow.com/questions/44504268",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4807889/"
] | You can use `Enum.reduce/3` with the file handle as the accumulator to open a file once and then write to it one chunk at a time:
```
def parse(file_path, chunk_size) do
file_path
|> File.stream!(read_ahead: chunk_size)
|> Stream.drop(1) # remove header
|> Stream.map(&"#{&1}\") # Prepare to be written as a c... | Found an interesting way to do this with the help of @Dogbert. Using Stream would lock me to max 100% cpu usage. With this I was able to reach top 256% cpu usage. This was ran on a couple files 300MB each. 30 mins to parse through.
```
def alt_flow_parse_dir(path, out_file, chunk_size) do
concat_unique = File.open... |
2,484,588 | I want to prove the following lemma:
>
> Let $x'=f(x,t)$ be a ODE and consider a derivable function $y(t)$ such that $y'(t) < f(y(t), t)$. Then if for a certain solution $x$ of the ODE and a certain $t\_0$ we have that $x(t\_0) \ge y(t\_0)$ then we always have that $x(t) > y(t)$ for all $t > t\_0$
>
>
>
Intuitive... | 2017/10/22 | [
"https://math.stackexchange.com/questions/2484588",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/240304/"
] | I assume that $f(x, t)$ is jointly continuous in $x$ and $t$. This is a pretty typical assumption for such $f(x, t)$ in the context of ordinary differential equations.
We observe that the above assumption implies that $x(t)$ and $y(t)$ are both continuous. This follows from the fact that they are both differentiable, ... | Let $t\_\*>t\_0$ be the point of the first intersection of $y=y(t)$ and $x=x(t)$:
[](https://i.stack.imgur.com/KQym9.png)
We have $x(t\_\*)=y(t\_\*)$;
$y(t)$ is below $x(t)$, thus, $\dot y(t\_\*)\ge \dot x(t\_\*)=f(x(t\_\*),t)=f(y(t\_\*),t)$. It contradicts with the c... |
364,464 | I would like to know if the following is possible, and if it is possible, roughly how the wiring should be done ...
I have 2 light bulbs (BULB1 and BULB2) connected to SEPARATE switches. I want to install BULB3 so that BULB3 turns on when ...
1. BULB1 is on, or
2. BULB2 is on, or
3. BULB1 and BULB2 are both on
and t... | 2018/03/24 | [
"https://electronics.stackexchange.com/questions/364464",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/183431/"
] | @Transistor has some good ideas. Perhaps a couple of big 4-diode bridges would allow LAMP3 to be driven, if you only have access to LAMP1 & LAMP2. Haven't shown the power sources to LAMP1 and LAMP2. They are assumed to be wired up to AC source via their respective switches.
Makes my head hurt to imagine if phasing is i... | It's not clear why you'd ever want to only have two of the three bulbs turned on. All of the answers, so far, seem workable, but they all show that the two-bulb condition requires some special circuitry, that has to meet electrical codes and mount somewhere. You can connect all three bulbs in parallel and let either sw... |
364,464 | I would like to know if the following is possible, and if it is possible, roughly how the wiring should be done ...
I have 2 light bulbs (BULB1 and BULB2) connected to SEPARATE switches. I want to install BULB3 so that BULB3 turns on when ...
1. BULB1 is on, or
2. BULB2 is on, or
3. BULB1 and BULB2 are both on
and t... | 2018/03/24 | [
"https://electronics.stackexchange.com/questions/364464",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/183431/"
] | another relay option.

[simulate this circuit](/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fSVbdE.png) – Schematic created using [CircuitLab](https://www.circuitlab.com/)
with appropriate choice of relay this layout could be used in the case where both s... | There is no simple way to do this (without relays, etc). I would recommend putting two bulbs in the middle and wiring one in parallel with bulb 1 and one in parallel with bulb 2. |
364,464 | I would like to know if the following is possible, and if it is possible, roughly how the wiring should be done ...
I have 2 light bulbs (BULB1 and BULB2) connected to SEPARATE switches. I want to install BULB3 so that BULB3 turns on when ...
1. BULB1 is on, or
2. BULB2 is on, or
3. BULB1 and BULB2 are both on
and t... | 2018/03/24 | [
"https://electronics.stackexchange.com/questions/364464",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/183431/"
] | This might be a good use case for some home-automation tech. It’s a bit expensive (maybe $150?) but doesn’t require opening walls to run extra wires, etc.
There are several different kinds, but the approach using Insteon would be
* replace the two switches with Insteon switches. They directly control their respectiv... | It's not clear why you'd ever want to only have two of the three bulbs turned on. All of the answers, so far, seem workable, but they all show that the two-bulb condition requires some special circuitry, that has to meet electrical codes and mount somewhere. You can connect all three bulbs in parallel and let either sw... |
364,464 | I would like to know if the following is possible, and if it is possible, roughly how the wiring should be done ...
I have 2 light bulbs (BULB1 and BULB2) connected to SEPARATE switches. I want to install BULB3 so that BULB3 turns on when ...
1. BULB1 is on, or
2. BULB2 is on, or
3. BULB1 and BULB2 are both on
and t... | 2018/03/24 | [
"https://electronics.stackexchange.com/questions/364464",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/183431/"
] | @Transistor has some good ideas. Perhaps a couple of big 4-diode bridges would allow LAMP3 to be driven, if you only have access to LAMP1 & LAMP2. Haven't shown the power sources to LAMP1 and LAMP2. They are assumed to be wired up to AC source via their respective switches.
Makes my head hurt to imagine if phasing is i... | Half-in-earnest-answer, ideas that are more appropriate for equipment design than house wiring, just to explore theoretical possibilities... and highlight the traps and safety hazards in some ideas that one might come up with.
There is a simpler version of the circuit with the bridge rectifiers, BUT I can make no clai... |
364,464 | I would like to know if the following is possible, and if it is possible, roughly how the wiring should be done ...
I have 2 light bulbs (BULB1 and BULB2) connected to SEPARATE switches. I want to install BULB3 so that BULB3 turns on when ...
1. BULB1 is on, or
2. BULB2 is on, or
3. BULB1 and BULB2 are both on
and t... | 2018/03/24 | [
"https://electronics.stackexchange.com/questions/364464",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/183431/"
] | @Transistor has some good ideas. Perhaps a couple of big 4-diode bridges would allow LAMP3 to be driven, if you only have access to LAMP1 & LAMP2. Haven't shown the power sources to LAMP1 and LAMP2. They are assumed to be wired up to AC source via their respective switches.
Makes my head hurt to imagine if phasing is i... | This might be a good use case for some home-automation tech. It’s a bit expensive (maybe $150?) but doesn’t require opening walls to run extra wires, etc.
There are several different kinds, but the approach using Insteon would be
* replace the two switches with Insteon switches. They directly control their respectiv... |
364,464 | I would like to know if the following is possible, and if it is possible, roughly how the wiring should be done ...
I have 2 light bulbs (BULB1 and BULB2) connected to SEPARATE switches. I want to install BULB3 so that BULB3 turns on when ...
1. BULB1 is on, or
2. BULB2 is on, or
3. BULB1 and BULB2 are both on
and t... | 2018/03/24 | [
"https://electronics.stackexchange.com/questions/364464",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/183431/"
] | There is no simple way to do this (without relays, etc). I would recommend putting two bulbs in the middle and wiring one in parallel with bulb 1 and one in parallel with bulb 2. | It's not clear why you'd ever want to only have two of the three bulbs turned on. All of the answers, so far, seem workable, but they all show that the two-bulb condition requires some special circuitry, that has to meet electrical codes and mount somewhere. You can connect all three bulbs in parallel and let either sw... |
364,464 | I would like to know if the following is possible, and if it is possible, roughly how the wiring should be done ...
I have 2 light bulbs (BULB1 and BULB2) connected to SEPARATE switches. I want to install BULB3 so that BULB3 turns on when ...
1. BULB1 is on, or
2. BULB2 is on, or
3. BULB1 and BULB2 are both on
and t... | 2018/03/24 | [
"https://electronics.stackexchange.com/questions/364464",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/183431/"
] | There is no simple way to do this (without relays, etc). I would recommend putting two bulbs in the middle and wiring one in parallel with bulb 1 and one in parallel with bulb 2. | Hate to be overly simplistic - have a bulb 4 next to bulb 3! Then you can simply wire directly from bulb 1 to 3 (so when 1 is on so is 3) and when bulb 2 is on so is 4. Basically a direct power connection, no electronics, just an extra bulb. |
364,464 | I would like to know if the following is possible, and if it is possible, roughly how the wiring should be done ...
I have 2 light bulbs (BULB1 and BULB2) connected to SEPARATE switches. I want to install BULB3 so that BULB3 turns on when ...
1. BULB1 is on, or
2. BULB2 is on, or
3. BULB1 and BULB2 are both on
and t... | 2018/03/24 | [
"https://electronics.stackexchange.com/questions/364464",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/183431/"
] | another relay option.

[simulate this circuit](/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fSVbdE.png) – Schematic created using [CircuitLab](https://www.circuitlab.com/)
with appropriate choice of relay this layout could be used in the case where both s... | This might be a good use case for some home-automation tech. It’s a bit expensive (maybe $150?) but doesn’t require opening walls to run extra wires, etc.
There are several different kinds, but the approach using Insteon would be
* replace the two switches with Insteon switches. They directly control their respectiv... |
364,464 | I would like to know if the following is possible, and if it is possible, roughly how the wiring should be done ...
I have 2 light bulbs (BULB1 and BULB2) connected to SEPARATE switches. I want to install BULB3 so that BULB3 turns on when ...
1. BULB1 is on, or
2. BULB2 is on, or
3. BULB1 and BULB2 are both on
and t... | 2018/03/24 | [
"https://electronics.stackexchange.com/questions/364464",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/183431/"
] | Half-in-earnest-answer, ideas that are more appropriate for equipment design than house wiring, just to explore theoretical possibilities... and highlight the traps and safety hazards in some ideas that one might come up with.
There is a simpler version of the circuit with the bridge rectifiers, BUT I can make no clai... | This might be a good use case for some home-automation tech. It’s a bit expensive (maybe $150?) but doesn’t require opening walls to run extra wires, etc.
There are several different kinds, but the approach using Insteon would be
* replace the two switches with Insteon switches. They directly control their respectiv... |
364,464 | I would like to know if the following is possible, and if it is possible, roughly how the wiring should be done ...
I have 2 light bulbs (BULB1 and BULB2) connected to SEPARATE switches. I want to install BULB3 so that BULB3 turns on when ...
1. BULB1 is on, or
2. BULB2 is on, or
3. BULB1 and BULB2 are both on
and t... | 2018/03/24 | [
"https://electronics.stackexchange.com/questions/364464",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/183431/"
] | another relay option.

[simulate this circuit](/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fSVbdE.png) – Schematic created using [CircuitLab](https://www.circuitlab.com/)
with appropriate choice of relay this layout could be used in the case where both s... | Half-in-earnest-answer, ideas that are more appropriate for equipment design than house wiring, just to explore theoretical possibilities... and highlight the traps and safety hazards in some ideas that one might come up with.
There is a simpler version of the circuit with the bridge rectifiers, BUT I can make no clai... |
47,276 | In this description regarding [positive theory and normative theory](https://sk.sagepub.com/reference/ethics/n583.xml), from what I understand, positive theory is based on fact and cannot be approved or disapproved (e.g., explain how the economy actually operates), and "normative theory" is about the goal at which econ... | 2021/08/18 | [
"https://economics.stackexchange.com/questions/47276",
"https://economics.stackexchange.com",
"https://economics.stackexchange.com/users/33142/"
] | Yes, the government has to pay interest on debt even if it is held by the central bank. That is true at least for major modern central banks.
For example, from a press [release](https://www.federalreserve.gov/newsevents/pressreleases/other20210111a.htm) from the US Federal Reserve Board:
>
> Net income for 2020 was ... | This may vary from country to country, but in most countries government pays interest *de jure* but not *de facto* as all major central banks send their profits (including profits made from interest payments) back to their governments as they are government institutions.
For example, take Fed. US has to, *de jure*, pa... |
47,276 | In this description regarding [positive theory and normative theory](https://sk.sagepub.com/reference/ethics/n583.xml), from what I understand, positive theory is based on fact and cannot be approved or disapproved (e.g., explain how the economy actually operates), and "normative theory" is about the goal at which econ... | 2021/08/18 | [
"https://economics.stackexchange.com/questions/47276",
"https://economics.stackexchange.com",
"https://economics.stackexchange.com/users/33142/"
] | This may vary from country to country, but in most countries government pays interest *de jure* but not *de facto* as all major central banks send their profits (including profits made from interest payments) back to their governments as they are government institutions.
For example, take Fed. US has to, *de jure*, pa... | The ridiculous part of the whole thing is, if the fed decides to "buy" bonds" and the hold over two trillion of them... they didn't pay a dime for them, they simple increase the bank balance of what ever bank they "bought" them from. But there is no corresponding decrease in anyone's account for the purchase. The fed's... |
47,276 | In this description regarding [positive theory and normative theory](https://sk.sagepub.com/reference/ethics/n583.xml), from what I understand, positive theory is based on fact and cannot be approved or disapproved (e.g., explain how the economy actually operates), and "normative theory" is about the goal at which econ... | 2021/08/18 | [
"https://economics.stackexchange.com/questions/47276",
"https://economics.stackexchange.com",
"https://economics.stackexchange.com/users/33142/"
] | Yes, the government has to pay interest on debt even if it is held by the central bank. That is true at least for major modern central banks.
For example, from a press [release](https://www.federalreserve.gov/newsevents/pressreleases/other20210111a.htm) from the US Federal Reserve Board:
>
> Net income for 2020 was ... | The ridiculous part of the whole thing is, if the fed decides to "buy" bonds" and the hold over two trillion of them... they didn't pay a dime for them, they simple increase the bank balance of what ever bank they "bought" them from. But there is no corresponding decrease in anyone's account for the purchase. The fed's... |
43,563 | The Buddha often makes this requests on his monks, *"incline your mind towards Nibbana"*
Does this mean concentration with no object?
As far as I can ascertain, concentration with no object does not seem to be possible.
I have a particular interest in the Mahayana perspective but answers from other traditions are we... | 2020/12/28 | [
"https://buddhism.stackexchange.com/questions/43563",
"https://buddhism.stackexchange.com",
"https://buddhism.stackexchange.com/users/17652/"
] | It means to incline your mind towards dispassion, dispassion towards the sense objects, dispassion towards craving for existence and dispassion towards craving for non-existence.
Inclining your mind toward dispassion means to incline your mind towards disenchantment, no longer being enchanted with sense objects, cravi... | From Mahayana perspective true Nirvana is the *non-abiding Nirvana*, which is a state of not being bounded by any single interpretative framework whatsoever.
>
> Does Master Gotama have any position at all?"
>
>
> "A 'position,' Vaccha, is something that a Tathagata has done away with. - [MN 72](https://www.accesst... |
43,563 | The Buddha often makes this requests on his monks, *"incline your mind towards Nibbana"*
Does this mean concentration with no object?
As far as I can ascertain, concentration with no object does not seem to be possible.
I have a particular interest in the Mahayana perspective but answers from other traditions are we... | 2020/12/28 | [
"https://buddhism.stackexchange.com/questions/43563",
"https://buddhism.stackexchange.com",
"https://buddhism.stackexchange.com/users/17652/"
] | It means to incline your mind towards dispassion, dispassion towards the sense objects, dispassion towards craving for existence and dispassion towards craving for non-existence.
Inclining your mind toward dispassion means to incline your mind towards disenchantment, no longer being enchanted with sense objects, cravi... | It means the object is Nibbana and the mental attitudes leading to Nibbana, as literally said as follows:
>
> And what is the faculty of concentration? There is the case where a
> monk, a disciple of the noble ones, making it his **object to** **let go**,
> attains concentration, attains singleness of mind.
>
>
> [... |
43,563 | The Buddha often makes this requests on his monks, *"incline your mind towards Nibbana"*
Does this mean concentration with no object?
As far as I can ascertain, concentration with no object does not seem to be possible.
I have a particular interest in the Mahayana perspective but answers from other traditions are we... | 2020/12/28 | [
"https://buddhism.stackexchange.com/questions/43563",
"https://buddhism.stackexchange.com",
"https://buddhism.stackexchange.com/users/17652/"
] | It means to incline your mind towards dispassion, dispassion towards the sense objects, dispassion towards craving for existence and dispassion towards craving for non-existence.
Inclining your mind toward dispassion means to incline your mind towards disenchantment, no longer being enchanted with sense objects, cravi... | Let's say you go to the doctor and get your blood pressure measured and it turns out to be high, probably because you were anxious at that moment. The doctor tells you to calm down, and then he will take another reading.
In order to do so, what would you concentrate on? Surely not on the blood pressure measurement dev... |
43,563 | The Buddha often makes this requests on his monks, *"incline your mind towards Nibbana"*
Does this mean concentration with no object?
As far as I can ascertain, concentration with no object does not seem to be possible.
I have a particular interest in the Mahayana perspective but answers from other traditions are we... | 2020/12/28 | [
"https://buddhism.stackexchange.com/questions/43563",
"https://buddhism.stackexchange.com",
"https://buddhism.stackexchange.com/users/17652/"
] | It means to incline your mind towards dispassion, dispassion towards the sense objects, dispassion towards craving for existence and dispassion towards craving for non-existence.
Inclining your mind toward dispassion means to incline your mind towards disenchantment, no longer being enchanted with sense objects, cravi... | I searched Bhikkhu Bodhi's translations of the Samyutta Nikaya, Angutarra Nikaya, and Majjima Nikaya, as well as Maurice Walsche's translation of the Dhiga Nikaya. The closest I could come to "incline your mind toward Nibbana" was advice from Sariputta to Anurudda, wherein the latter - who had achieved the jnanas was c... |
43,563 | The Buddha often makes this requests on his monks, *"incline your mind towards Nibbana"*
Does this mean concentration with no object?
As far as I can ascertain, concentration with no object does not seem to be possible.
I have a particular interest in the Mahayana perspective but answers from other traditions are we... | 2020/12/28 | [
"https://buddhism.stackexchange.com/questions/43563",
"https://buddhism.stackexchange.com",
"https://buddhism.stackexchange.com/users/17652/"
] | From Mahayana perspective true Nirvana is the *non-abiding Nirvana*, which is a state of not being bounded by any single interpretative framework whatsoever.
>
> Does Master Gotama have any position at all?"
>
>
> "A 'position,' Vaccha, is something that a Tathagata has done away with. - [MN 72](https://www.accesst... | I searched Bhikkhu Bodhi's translations of the Samyutta Nikaya, Angutarra Nikaya, and Majjima Nikaya, as well as Maurice Walsche's translation of the Dhiga Nikaya. The closest I could come to "incline your mind toward Nibbana" was advice from Sariputta to Anurudda, wherein the latter - who had achieved the jnanas was c... |
43,563 | The Buddha often makes this requests on his monks, *"incline your mind towards Nibbana"*
Does this mean concentration with no object?
As far as I can ascertain, concentration with no object does not seem to be possible.
I have a particular interest in the Mahayana perspective but answers from other traditions are we... | 2020/12/28 | [
"https://buddhism.stackexchange.com/questions/43563",
"https://buddhism.stackexchange.com",
"https://buddhism.stackexchange.com/users/17652/"
] | It means the object is Nibbana and the mental attitudes leading to Nibbana, as literally said as follows:
>
> And what is the faculty of concentration? There is the case where a
> monk, a disciple of the noble ones, making it his **object to** **let go**,
> attains concentration, attains singleness of mind.
>
>
> [... | I searched Bhikkhu Bodhi's translations of the Samyutta Nikaya, Angutarra Nikaya, and Majjima Nikaya, as well as Maurice Walsche's translation of the Dhiga Nikaya. The closest I could come to "incline your mind toward Nibbana" was advice from Sariputta to Anurudda, wherein the latter - who had achieved the jnanas was c... |
43,563 | The Buddha often makes this requests on his monks, *"incline your mind towards Nibbana"*
Does this mean concentration with no object?
As far as I can ascertain, concentration with no object does not seem to be possible.
I have a particular interest in the Mahayana perspective but answers from other traditions are we... | 2020/12/28 | [
"https://buddhism.stackexchange.com/questions/43563",
"https://buddhism.stackexchange.com",
"https://buddhism.stackexchange.com/users/17652/"
] | Let's say you go to the doctor and get your blood pressure measured and it turns out to be high, probably because you were anxious at that moment. The doctor tells you to calm down, and then he will take another reading.
In order to do so, what would you concentrate on? Surely not on the blood pressure measurement dev... | I searched Bhikkhu Bodhi's translations of the Samyutta Nikaya, Angutarra Nikaya, and Majjima Nikaya, as well as Maurice Walsche's translation of the Dhiga Nikaya. The closest I could come to "incline your mind toward Nibbana" was advice from Sariputta to Anurudda, wherein the latter - who had achieved the jnanas was c... |
26,748 | Is there an example in history where two leaders, or even just foreign travelers, who could not understand each other's spoken language, communicated by food?
I am not talking about very specific communication, just a general "Hi, I am a friend and I'm not going to kill you."
I would like a fairly verifiable example,... | 2015/12/09 | [
"https://history.stackexchange.com/questions/26748",
"https://history.stackexchange.com",
"https://history.stackexchange.com/users/12141/"
] | Tom Reiss, in [his biography of Kurban Said, pp 58-59](https://rads.stackoverflow.com/amzn/click/com/0812972767), provided an example of this. Central Asian nomads would leave caches of bread in the desert; how much was eaten would communicate to other passing nomads information about who had traveled through, etc.
So... | There are lots of examples of Native American communities offering food such as roasted roots to Spanish colonists, who would often give glass beads and packets of seeds to the natives. |
26,748 | Is there an example in history where two leaders, or even just foreign travelers, who could not understand each other's spoken language, communicated by food?
I am not talking about very specific communication, just a general "Hi, I am a friend and I'm not going to kill you."
I would like a fairly verifiable example,... | 2015/12/09 | [
"https://history.stackexchange.com/questions/26748",
"https://history.stackexchange.com",
"https://history.stackexchange.com/users/12141/"
] | Tom Reiss, in [his biography of Kurban Said, pp 58-59](https://rads.stackoverflow.com/amzn/click/com/0812972767), provided an example of this. Central Asian nomads would leave caches of bread in the desert; how much was eaten would communicate to other passing nomads information about who had traveled through, etc.
So... | This is not a case of using food to cross a language barrier, but rather of using food as a symbol for insisting on a diplomatic message: during the [Whisky war](https://www.mnn.com/earth-matters/wilderness-resources/blogs/canada-denmark-wage-whisky-war-on-rocks), Schnapps and Whisky have repeatedly been offered by Can... |
26,748 | Is there an example in history where two leaders, or even just foreign travelers, who could not understand each other's spoken language, communicated by food?
I am not talking about very specific communication, just a general "Hi, I am a friend and I'm not going to kill you."
I would like a fairly verifiable example,... | 2015/12/09 | [
"https://history.stackexchange.com/questions/26748",
"https://history.stackexchange.com",
"https://history.stackexchange.com/users/12141/"
] | Tom Reiss, in [his biography of Kurban Said, pp 58-59](https://rads.stackoverflow.com/amzn/click/com/0812972767), provided an example of this. Central Asian nomads would leave caches of bread in the desert; how much was eaten would communicate to other passing nomads information about who had traveled through, etc.
So... | During a siege, a food is throw over the wall by the defenders, obviously accompanied by some swearing. When the attackers see it, they think "these guys are not starving if they are throwing away food like that. Lets abandon our siege!"
I have heard stories like about a couple of places, and it is certainly the local... |
26,748 | Is there an example in history where two leaders, or even just foreign travelers, who could not understand each other's spoken language, communicated by food?
I am not talking about very specific communication, just a general "Hi, I am a friend and I'm not going to kill you."
I would like a fairly verifiable example,... | 2015/12/09 | [
"https://history.stackexchange.com/questions/26748",
"https://history.stackexchange.com",
"https://history.stackexchange.com/users/12141/"
] | During a siege, a food is throw over the wall by the defenders, obviously accompanied by some swearing. When the attackers see it, they think "these guys are not starving if they are throwing away food like that. Lets abandon our siege!"
I have heard stories like about a couple of places, and it is certainly the local... | There are lots of examples of Native American communities offering food such as roasted roots to Spanish colonists, who would often give glass beads and packets of seeds to the natives. |
26,748 | Is there an example in history where two leaders, or even just foreign travelers, who could not understand each other's spoken language, communicated by food?
I am not talking about very specific communication, just a general "Hi, I am a friend and I'm not going to kill you."
I would like a fairly verifiable example,... | 2015/12/09 | [
"https://history.stackexchange.com/questions/26748",
"https://history.stackexchange.com",
"https://history.stackexchange.com/users/12141/"
] | During a siege, a food is throw over the wall by the defenders, obviously accompanied by some swearing. When the attackers see it, they think "these guys are not starving if they are throwing away food like that. Lets abandon our siege!"
I have heard stories like about a couple of places, and it is certainly the local... | This is not a case of using food to cross a language barrier, but rather of using food as a symbol for insisting on a diplomatic message: during the [Whisky war](https://www.mnn.com/earth-matters/wilderness-resources/blogs/canada-denmark-wage-whisky-war-on-rocks), Schnapps and Whisky have repeatedly been offered by Can... |
54,329,435 | I'm banging my head against the wall with this issue. We're running many containers in parallel, they're running simple filesystem operations or simple linux commands and some of them under certain circumstances fail with memory allocation issues, the Docker container get OOMKiled.
I believe it is not related to the ... | 2019/01/23 | [
"https://Stackoverflow.com/questions/54329435",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4570977/"
] | Seems you have problem with "Write cache size".
When you want to write something to the disk it's not written directly, but it's stored in write cache (called dirty\_pages). It's beacause all processes don't need to wait until they get privilage to write to the disk and they continue their work. But when the process ... | I don't have the rep to comment, so here's a guess at an answer! We suffered a similar problem, and it turned out for us that disk memory isn't just how much space you use in total - there are also things called inodes which have a separate, finite number, and things like node\_modules (in js) or any form of large libr... |
563,033 | I'd like to use `/dev/fb0` or whichever other files are provided by the linux.
This in a system specific way as low as possible how to read/write/interpret those device files for GUI frame-buffer non-console based.
I'd like to do it for low-level fun, just like accessing keyboard events. | 2020/01/20 | [
"https://unix.stackexchange.com/questions/563033",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/358149/"
] | You open a file descriptor for the framebuffer device and use `ioctl()`, with `FBIOGET_FSCREENINFO` and `FBIOGET_VSCREENINFO`. From the returned structures, you can straightforwardly determine the X resolution, Y resolution, stride, and bits per pixel.
If the framebuffer is shared with the kernel's built-in terminal e... | Sure, there are lots of documentation and articles on how to read/write/interpret linux devices. For the framebuffer e.g you can write to it even from your console using the `cat` command from a `tty` console to test the waters.
```
# cat /dev/urandom >/dev/fb0
```
Read [this](http://seenaburns.com/2018/04/04/writin... |
563,033 | I'd like to use `/dev/fb0` or whichever other files are provided by the linux.
This in a system specific way as low as possible how to read/write/interpret those device files for GUI frame-buffer non-console based.
I'd like to do it for low-level fun, just like accessing keyboard events. | 2020/01/20 | [
"https://unix.stackexchange.com/questions/563033",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/358149/"
] | You open a file descriptor for the framebuffer device and use `ioctl()`, with `FBIOGET_FSCREENINFO` and `FBIOGET_VSCREENINFO`. From the returned structures, you can straightforwardly determine the X resolution, Y resolution, stride, and bits per pixel.
If the framebuffer is shared with the kernel's built-in terminal e... | Not certain if you can get mouse / keyboard input from fb0. It is great fun though and you'll learn a great deal of how things work in the Unix world.
What you want to begin with is to use the open system call to open the file descriptor and from there you will use ioctl to set the parameters that you need. Then you'l... |
440,779 | Why would someone use numeric(12, 0) datatype for a simple integer ID column? If you have a reason why this is better than int or bigint I would like to hear it.
We are not doing any math on this column, it is simply an ID used for foreign key linking.
I am compiling a list of programming errors and performance issue... | 2009/01/13 | [
"https://Stackoverflow.com/questions/440779",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5255/"
] | In your example I can't think of any logical reason why you wouldn't use INT. I know there are probably reasons for other uses of numeric, but not in this instance. | In some databases, using a decimal(10,0) creates a packed field which takes up less space. I know there are many tables around my work that use that. They probably had the same kind of thought here, but you have gone to the documentation and proven that to be incorrect. More than likely, I would say it will boil down t... |
440,779 | Why would someone use numeric(12, 0) datatype for a simple integer ID column? If you have a reason why this is better than int or bigint I would like to hear it.
We are not doing any math on this column, it is simply an ID used for foreign key linking.
I am compiling a list of programming errors and performance issue... | 2009/01/13 | [
"https://Stackoverflow.com/questions/440779",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5255/"
] | Perhaps they're used to working with Oracle?
All numeric types including ints are normalized to a standard single representation among all platforms. | It is possible they spend a LOT of time in MS Access and see 'Number' often and just figured, its a number, why not use numeric?
Based on your findings, it doesn't sound like they are the optimization experts, and just didn't know. I'm wondering if they used schema generation tools and just relied on them too much.
... |
440,779 | Why would someone use numeric(12, 0) datatype for a simple integer ID column? If you have a reason why this is better than int or bigint I would like to hear it.
We are not doing any math on this column, it is simply an ID used for foreign key linking.
I am compiling a list of programming errors and performance issue... | 2009/01/13 | [
"https://Stackoverflow.com/questions/440779",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5255/"
] | How old is this application that you are looking into?
Previous to SQL Server 2000 there was no bigint. Maybe its just something that has made it from release to release for many years without being changed or the database schema was copied from an application that was this old?!? | It is possible they spend a LOT of time in MS Access and see 'Number' often and just figured, its a number, why not use numeric?
Based on your findings, it doesn't sound like they are the optimization experts, and just didn't know. I'm wondering if they used schema generation tools and just relied on them too much.
... |
440,779 | Why would someone use numeric(12, 0) datatype for a simple integer ID column? If you have a reason why this is better than int or bigint I would like to hear it.
We are not doing any math on this column, it is simply an ID used for foreign key linking.
I am compiling a list of programming errors and performance issue... | 2009/01/13 | [
"https://Stackoverflow.com/questions/440779",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5255/"
] | There are many reasons to use numeric - for example - financial data and other stuffs which need to be accurate to certain decimal places. However for the example you cited above, a simple int would have done.
Perhaps sloppy programmers working who didn't know how to to design a database ? | It is possible they spend a LOT of time in MS Access and see 'Number' often and just figured, its a number, why not use numeric?
Based on your findings, it doesn't sound like they are the optimization experts, and just didn't know. I'm wondering if they used schema generation tools and just relied on them too much.
... |
440,779 | Why would someone use numeric(12, 0) datatype for a simple integer ID column? If you have a reason why this is better than int or bigint I would like to hear it.
We are not doing any math on this column, it is simply an ID used for foreign key linking.
I am compiling a list of programming errors and performance issue... | 2009/01/13 | [
"https://Stackoverflow.com/questions/440779",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5255/"
] | Perhaps they're used to working with Oracle?
All numeric types including ints are normalized to a standard single representation among all platforms. | In your example I can't think of any logical reason why you wouldn't use INT. I know there are probably reasons for other uses of numeric, but not in this instance. |
440,779 | Why would someone use numeric(12, 0) datatype for a simple integer ID column? If you have a reason why this is better than int or bigint I would like to hear it.
We are not doing any math on this column, it is simply an ID used for foreign key linking.
I am compiling a list of programming errors and performance issue... | 2009/01/13 | [
"https://Stackoverflow.com/questions/440779",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5255/"
] | How old is this application that you are looking into?
Previous to SQL Server 2000 there was no bigint. Maybe its just something that has made it from release to release for many years without being changed or the database schema was copied from an application that was this old?!? | According to: <http://doc.ddart.net/mssql/sql70/da-db_1.htm>
>
> **decimal**
>
>
> Fixed precision and scale numeric data from -10^38 -1 through 10^38 -1.
>
>
> **numeric**
>
>
> A synonym for decimal.
>
>
> **int**
>
>
> Integer (whole number) data from -2^31 (-2,147,483,648) through 2^31 - 1 (2,147,483,6... |
440,779 | Why would someone use numeric(12, 0) datatype for a simple integer ID column? If you have a reason why this is better than int or bigint I would like to hear it.
We are not doing any math on this column, it is simply an ID used for foreign key linking.
I am compiling a list of programming errors and performance issue... | 2009/01/13 | [
"https://Stackoverflow.com/questions/440779",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5255/"
] | There are many reasons to use numeric - for example - financial data and other stuffs which need to be accurate to certain decimal places. However for the example you cited above, a simple int would have done.
Perhaps sloppy programmers working who didn't know how to to design a database ? | In your example I can't think of any logical reason why you wouldn't use INT. I know there are probably reasons for other uses of numeric, but not in this instance. |
440,779 | Why would someone use numeric(12, 0) datatype for a simple integer ID column? If you have a reason why this is better than int or bigint I would like to hear it.
We are not doing any math on this column, it is simply an ID used for foreign key linking.
I am compiling a list of programming errors and performance issue... | 2009/01/13 | [
"https://Stackoverflow.com/questions/440779",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5255/"
] | There are many reasons to use numeric - for example - financial data and other stuffs which need to be accurate to certain decimal places. However for the example you cited above, a simple int would have done.
Perhaps sloppy programmers working who didn't know how to to design a database ? | How old is this application that you are looking into?
Previous to SQL Server 2000 there was no bigint. Maybe its just something that has made it from release to release for many years without being changed or the database schema was copied from an application that was this old?!? |
440,779 | Why would someone use numeric(12, 0) datatype for a simple integer ID column? If you have a reason why this is better than int or bigint I would like to hear it.
We are not doing any math on this column, it is simply an ID used for foreign key linking.
I am compiling a list of programming errors and performance issue... | 2009/01/13 | [
"https://Stackoverflow.com/questions/440779",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5255/"
] | Before you take things too seriously, what is the data storage requirement for each row or set of rows for this item?
Your observation is correct, but you probably don't want to present it too strongly if you're reducing storage from 5000 bytes to 4090 bytes, for example.
You don't want to blow your credibility by br... | In some databases, using a decimal(10,0) creates a packed field which takes up less space. I know there are many tables around my work that use that. They probably had the same kind of thought here, but you have gone to the documentation and proven that to be incorrect. More than likely, I would say it will boil down t... |
440,779 | Why would someone use numeric(12, 0) datatype for a simple integer ID column? If you have a reason why this is better than int or bigint I would like to hear it.
We are not doing any math on this column, it is simply an ID used for foreign key linking.
I am compiling a list of programming errors and performance issue... | 2009/01/13 | [
"https://Stackoverflow.com/questions/440779",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5255/"
] | Perhaps they're used to working with Oracle?
All numeric types including ints are normalized to a standard single representation among all platforms. | There are many reasons to use numeric - for example - financial data and other stuffs which need to be accurate to certain decimal places. However for the example you cited above, a simple int would have done.
Perhaps sloppy programmers working who didn't know how to to design a database ? |
52,861,141 | I am new to **subqueries**, and I am trying to understand why my regular query isn't returning the same result as this subquery. I am following this [tutorial](http://www.mysqltutorial.org/mysql-subquery/) and it is the first "[Try it out](http://www.mysqltutorial.org/tryit/query/mysql-subquery/#1)" question. ->
**My... | 2018/10/17 | [
"https://Stackoverflow.com/questions/52861141",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10398599/"
] | As you used aggregate function `max()` so you are bound to use group by and your query will be like below
```
SELECT customerNumber,
checkNumber,
MAX(amount)
FROM payments
group by customerNumber,
checkNumber
``` | The query you are testing from the tutorial is different, it gets you the row with the maximun amount (just one row):
```
SELECT customerNumber,
checkNumber,
amount
FROM payments
WHERE amount = (
SELECT MAX(amount)
FROM payments
);
```
And the query with the aggregation function gets the m... |
63,497,859 | I am installing firebase-tools with yarn with the following command:
```
yarn global add firebase-tools
```
After it I am trying:
```
firebase login
```
And It giving me command not found an error. Please answer to solve this problem.
I am using Windows 10 operating systems.
/// Also I have tried some methods d... | 2020/08/20 | [
"https://Stackoverflow.com/questions/63497859",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10971498/"
] | If you installing firebase-tools using this command :
```
yarn global add firebase-tools
```
After that execute this command :
```
export PATH="$(yarn global bin):$PATH"
```
and then run the command `firebase login` | If you're having trouble getting `firebase-tools` to work through Node.js, I recommend installing the pre-built binary for your platform. The standalone binary for windows can be found [here](https://firebase.google.com/docs/cli#install-cli-windows). |
63,497,859 | I am installing firebase-tools with yarn with the following command:
```
yarn global add firebase-tools
```
After it I am trying:
```
firebase login
```
And It giving me command not found an error. Please answer to solve this problem.
I am using Windows 10 operating systems.
/// Also I have tried some methods d... | 2020/08/20 | [
"https://Stackoverflow.com/questions/63497859",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10971498/"
] | If you installing firebase-tools using this command :
```
yarn global add firebase-tools
```
After that execute this command :
```
export PATH="$(yarn global bin):$PATH"
```
and then run the command `firebase login` | 1. First, you need to check if the `firebase-tools` package is installed, using `yarn info firebase-tools`.
2. Then, to log in, use `yarn firebase login`. |
48,507,986 | I'm running Pylint 1.7.2 with Python 3.6.2. Pylint is showing the following error:
```
Invalid function name "create_maximization_option_dataframe" (invalid-name)
```
I define a function like so in my code:
```
def create_maximization_option_dataframe(file_name):
```
The PEP8 style guide basically just says:
>
... | 2018/01/29 | [
"https://Stackoverflow.com/questions/48507986",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9094687/"
] | Make a config file by doing pylint `pylint --generate-rcfile`. The scope of that depends where you put it. Quoting <https://docs.pylint.org/en/1.6.0/run.html>
1. pylintrc in the current working directory
2. .pylintrc in the
current working directory
3. If the current working directory is in a
Python module, Pylint s... | [According to PyLint documentation](http://pylint-messages.wikidot.com/messages:c0103), a function name must have from 2 to 30 characters. Yours has 36. |
65,441,630 | I have the following query that is returning the expected results:
```sql
SELECT
locations.*,
(
SELECT
id
FROM
hauls
WHERE
haul_type_id = 1
AND location_id = locations.id
ORDER BY
created_at DESC
LIMIT 1) AS las... | 2020/12/24 | [
"https://Stackoverflow.com/questions/65441630",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3207609/"
] | ```js
function lookForKey( arr ){
for ( let i = 0; i < arr.length; i++ ) {
if( arr[i] == "key" ){
console.log( "Key found.");
return true;
} else if( Array.isArray( arr[i] ) ){
if (lookForKey(arr[i])) return true;
}
}
return false;
}
let arr = [
... | The result comes as false because we are trying to return false from the function. While the for loop is running, the one way to break it when we get the desired result is to use `break`. And we can save the status of find in a variable called `result` which can be returned from the function `lookForKey`
```
function ... |
65,441,630 | I have the following query that is returning the expected results:
```sql
SELECT
locations.*,
(
SELECT
id
FROM
hauls
WHERE
haul_type_id = 1
AND location_id = locations.id
ORDER BY
created_at DESC
LIMIT 1) AS las... | 2020/12/24 | [
"https://Stackoverflow.com/questions/65441630",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3207609/"
] | The result comes as false because we are trying to return false from the function. While the for loop is running, the one way to break it when we get the desired result is to use `break`. And we can save the status of find in a variable called `result` which can be returned from the function `lookForKey`
```
function ... | Asserting a found condition by returning true can be done in a single logical expression that will shortcut as soon as truth is undeniable.
```js
function myFind( haystack, needle ){
for ( let i = 0; i < haystack.length; i++ ) {
if ( haystack[i] === needle
||
( Array.isArray( hay... |
65,441,630 | I have the following query that is returning the expected results:
```sql
SELECT
locations.*,
(
SELECT
id
FROM
hauls
WHERE
haul_type_id = 1
AND location_id = locations.id
ORDER BY
created_at DESC
LIMIT 1) AS las... | 2020/12/24 | [
"https://Stackoverflow.com/questions/65441630",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3207609/"
] | ```js
function lookForKey( arr ){
for ( let i = 0; i < arr.length; i++ ) {
if( arr[i] == "key" ){
console.log( "Key found.");
return true;
} else if( Array.isArray( arr[i] ) ){
if (lookForKey(arr[i])) return true;
}
}
return false;
}
let arr = [
... | Asserting a found condition by returning true can be done in a single logical expression that will shortcut as soon as truth is undeniable.
```js
function myFind( haystack, needle ){
for ( let i = 0; i < haystack.length; i++ ) {
if ( haystack[i] === needle
||
( Array.isArray( hay... |
65,441,630 | I have the following query that is returning the expected results:
```sql
SELECT
locations.*,
(
SELECT
id
FROM
hauls
WHERE
haul_type_id = 1
AND location_id = locations.id
ORDER BY
created_at DESC
LIMIT 1) AS las... | 2020/12/24 | [
"https://Stackoverflow.com/questions/65441630",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3207609/"
] | ```js
function lookForKey( arr ){
for ( let i = 0; i < arr.length; i++ ) {
if( arr[i] == "key" ){
console.log( "Key found.");
return true;
} else if( Array.isArray( arr[i] ) ){
if (lookForKey(arr[i])) return true;
}
}
return false;
}
let arr = [
... | Recursion is a functional heritage and so using it with functional style yields the best results. This means avoiding things like mutations, variable reassignments, and other side effects. `for` is a side effect and is the looping construct used in imperative style. Notice when we use functional style there's no reason... |
65,441,630 | I have the following query that is returning the expected results:
```sql
SELECT
locations.*,
(
SELECT
id
FROM
hauls
WHERE
haul_type_id = 1
AND location_id = locations.id
ORDER BY
created_at DESC
LIMIT 1) AS las... | 2020/12/24 | [
"https://Stackoverflow.com/questions/65441630",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3207609/"
] | Recursion is a functional heritage and so using it with functional style yields the best results. This means avoiding things like mutations, variable reassignments, and other side effects. `for` is a side effect and is the looping construct used in imperative style. Notice when we use functional style there's no reason... | Asserting a found condition by returning true can be done in a single logical expression that will shortcut as soon as truth is undeniable.
```js
function myFind( haystack, needle ){
for ( let i = 0; i < haystack.length; i++ ) {
if ( haystack[i] === needle
||
( Array.isArray( hay... |
12,522,676 | I have a maven settings.xml located in:
```
/home/u123/.m2/settings.xml
```
where I specify a remote maven repository:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<profiles>
<profile>
<id>default</id>
<repositories>
<repository>
<id>my.repo</id>
... | 2012/09/21 | [
"https://Stackoverflow.com/questions/12522676",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/363603/"
] | You have to declare all repositories in your Gradle build script. `settings.xml` is only used to find the location of the local Maven repository, for example when resolving `repositories { mavenLocal() }`. | See: <https://github.com/ci-and-cd/maven-settings-decoder>
I use it in gradle build script to avoid expose nexus password in build.gradle or environment variable.
```
buildscript {
repositories {
...
mavenCentral()
}
dependencies {
...
classpath 'cn.home1.tools:maven-settings-decoder:1.0.5.OSS'
... |
12,522,676 | I have a maven settings.xml located in:
```
/home/u123/.m2/settings.xml
```
where I specify a remote maven repository:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<profiles>
<profile>
<id>default</id>
<repositories>
<repository>
<id>my.repo</id>
... | 2012/09/21 | [
"https://Stackoverflow.com/questions/12522676",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/363603/"
] | There is an open ticket related to this that will be hopefully implemented:
<http://issues.gradle.org/browse/GRADLE-2365>
But as a workaround you can use some groovy scripting in the build.gradle to achieve this. In my case I needed the authentication information from settings.xml. But this could easily be adapted to... | I used maven-publish, maven-publish-auth plugins to accomplish this without parsing the settings by hand
[How can Gradle Use Repository Settings From Maven's Settings.xml to publish artifacts](http://forums.gradle.org/gradle/topics/how_can_gradle_use_repository_settings_from_mavens_settings_xml_to_publish_artifacts_to... |
12,522,676 | I have a maven settings.xml located in:
```
/home/u123/.m2/settings.xml
```
where I specify a remote maven repository:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<profiles>
<profile>
<id>default</id>
<repositories>
<repository>
<id>my.repo</id>
... | 2012/09/21 | [
"https://Stackoverflow.com/questions/12522676",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/363603/"
] | There is an open ticket related to this that will be hopefully implemented:
<http://issues.gradle.org/browse/GRADLE-2365>
But as a workaround you can use some groovy scripting in the build.gradle to achieve this. In my case I needed the authentication information from settings.xml. But this could easily be adapted to... | You have to declare all repositories in your Gradle build script. `settings.xml` is only used to find the location of the local Maven repository, for example when resolving `repositories { mavenLocal() }`. |
12,522,676 | I have a maven settings.xml located in:
```
/home/u123/.m2/settings.xml
```
where I specify a remote maven repository:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<profiles>
<profile>
<id>default</id>
<repositories>
<repository>
<id>my.repo</id>
... | 2012/09/21 | [
"https://Stackoverflow.com/questions/12522676",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/363603/"
] | There is an open ticket related to this that will be hopefully implemented:
<http://issues.gradle.org/browse/GRADLE-2365>
But as a workaround you can use some groovy scripting in the build.gradle to achieve this. In my case I needed the authentication information from settings.xml. But this could easily be adapted to... | [gradle-maven-settings-plugin](https://github.com/mark-vieira/gradle-maven-settings-plugin) works for me (at least in my Windows environment)
One should add
```
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
}
plugins {
id 'net.linguica.maven-set... |
12,522,676 | I have a maven settings.xml located in:
```
/home/u123/.m2/settings.xml
```
where I specify a remote maven repository:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<profiles>
<profile>
<id>default</id>
<repositories>
<repository>
<id>my.repo</id>
... | 2012/09/21 | [
"https://Stackoverflow.com/questions/12522676",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/363603/"
] | You have to declare all repositories in your Gradle build script. `settings.xml` is only used to find the location of the local Maven repository, for example when resolving `repositories { mavenLocal() }`. | I used maven-publish, maven-publish-auth plugins to accomplish this without parsing the settings by hand
[How can Gradle Use Repository Settings From Maven's Settings.xml to publish artifacts](http://forums.gradle.org/gradle/topics/how_can_gradle_use_repository_settings_from_mavens_settings_xml_to_publish_artifacts_to... |
12,522,676 | I have a maven settings.xml located in:
```
/home/u123/.m2/settings.xml
```
where I specify a remote maven repository:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<profiles>
<profile>
<id>default</id>
<repositories>
<repository>
<id>my.repo</id>
... | 2012/09/21 | [
"https://Stackoverflow.com/questions/12522676",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/363603/"
] | There is an open ticket related to this that will be hopefully implemented:
<http://issues.gradle.org/browse/GRADLE-2365>
But as a workaround you can use some groovy scripting in the build.gradle to achieve this. In my case I needed the authentication information from settings.xml. But this could easily be adapted to... | Please use mavenLocal() in your repositories section of build.gradle file. This should read ~/.m2/settings.xml file in your home directory.
```
repositories {
mavenCentral()
mavenLocal()
}
``` |
12,522,676 | I have a maven settings.xml located in:
```
/home/u123/.m2/settings.xml
```
where I specify a remote maven repository:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<profiles>
<profile>
<id>default</id>
<repositories>
<repository>
<id>my.repo</id>
... | 2012/09/21 | [
"https://Stackoverflow.com/questions/12522676",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/363603/"
] | There is an open ticket related to this that will be hopefully implemented:
<http://issues.gradle.org/browse/GRADLE-2365>
But as a workaround you can use some groovy scripting in the build.gradle to achieve this. In my case I needed the authentication information from settings.xml. But this could easily be adapted to... | See: <https://github.com/ci-and-cd/maven-settings-decoder>
I use it in gradle build script to avoid expose nexus password in build.gradle or environment variable.
```
buildscript {
repositories {
...
mavenCentral()
}
dependencies {
...
classpath 'cn.home1.tools:maven-settings-decoder:1.0.5.OSS'
... |
12,522,676 | I have a maven settings.xml located in:
```
/home/u123/.m2/settings.xml
```
where I specify a remote maven repository:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<profiles>
<profile>
<id>default</id>
<repositories>
<repository>
<id>my.repo</id>
... | 2012/09/21 | [
"https://Stackoverflow.com/questions/12522676",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/363603/"
] | [gradle-maven-settings-plugin](https://github.com/mark-vieira/gradle-maven-settings-plugin) works for me (at least in my Windows environment)
One should add
```
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
}
plugins {
id 'net.linguica.maven-set... | See: <https://github.com/ci-and-cd/maven-settings-decoder>
I use it in gradle build script to avoid expose nexus password in build.gradle or environment variable.
```
buildscript {
repositories {
...
mavenCentral()
}
dependencies {
...
classpath 'cn.home1.tools:maven-settings-decoder:1.0.5.OSS'
... |
12,522,676 | I have a maven settings.xml located in:
```
/home/u123/.m2/settings.xml
```
where I specify a remote maven repository:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<profiles>
<profile>
<id>default</id>
<repositories>
<repository>
<id>my.repo</id>
... | 2012/09/21 | [
"https://Stackoverflow.com/questions/12522676",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/363603/"
] | You have to declare all repositories in your Gradle build script. `settings.xml` is only used to find the location of the local Maven repository, for example when resolving `repositories { mavenLocal() }`. | Please use mavenLocal() in your repositories section of build.gradle file. This should read ~/.m2/settings.xml file in your home directory.
```
repositories {
mavenCentral()
mavenLocal()
}
``` |
12,522,676 | I have a maven settings.xml located in:
```
/home/u123/.m2/settings.xml
```
where I specify a remote maven repository:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<profiles>
<profile>
<id>default</id>
<repositories>
<repository>
<id>my.repo</id>
... | 2012/09/21 | [
"https://Stackoverflow.com/questions/12522676",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/363603/"
] | [gradle-maven-settings-plugin](https://github.com/mark-vieira/gradle-maven-settings-plugin) works for me (at least in my Windows environment)
One should add
```
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
}
plugins {
id 'net.linguica.maven-set... | You have to declare all repositories in your Gradle build script. `settings.xml` is only used to find the location of the local Maven repository, for example when resolving `repositories { mavenLocal() }`. |
197,542 | Today, I found negative rep in my account. So when I checked it I found that the question was removed. However when I tried to click the question link it didn't allowed.

**1)** So what I did is *I copy pasted the question title in Google and the re... | 2013/09/19 | [
"https://meta.stackexchange.com/questions/197542",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/233367/"
] | Caching
-------
We all love to blame it for every little issue, but it's valid in this case: Google simply hasn't indexed Stack Overflow (or at least that one question) since it was deleted. Therefore, Google doesn't know any better than to show it in search results.
The next time the question link is indexed, Google... | From [Google](https://support.google.com/webmasters/answer/1663688):
>
> If the page, site or image has already been removed from the site in question, it may still show up in Google’s search results if we have not crawled the page recently. While you wait for our search results to get updated, use this tool to [requ... |
17,231,829 | I made simple structure:
```
struct sToken
{
std::string token;
unsigned int lineNb;
};
```
I want to insert this structure in standard vector using `push_back()` method, but when I do this:
```
std::vector<sToken> result;
result.push_back(tkn); //compiler-error
```
I get following error messages:
`no mat... | 2013/06/21 | [
"https://Stackoverflow.com/questions/17231829",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1925060/"
] | try this
```
@Override
public void onItemClick(AdapterView<?> arg0, View arg1,
int arg2, long arg3) {
Intent intent = new Intent(MainActivity.this,Descripsn.class);
intent.putExtra("smily", smily[arg2].toString());
intent.putEx... | Inside your Descripsn class you must use the same identifier for getExtras..
try like this..
```
Intent i =getIntent();
Bundle b=getIntent().getExtras();
String smily = b.getString("smily");
String img = b.getString("image");
tv.setText(smily);
```
**EDIT:-**
you will get the text pa... |
17,231,829 | I made simple structure:
```
struct sToken
{
std::string token;
unsigned int lineNb;
};
```
I want to insert this structure in standard vector using `push_back()` method, but when I do this:
```
std::vector<sToken> result;
result.push_back(tkn); //compiler-error
```
I get following error messages:
`no mat... | 2013/06/21 | [
"https://Stackoverflow.com/questions/17231829",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1925060/"
] | try this
```
@Override
public void onItemClick(AdapterView<?> arg0, View arg1,
int arg2, long arg3) {
Intent intent = new Intent(MainActivity.this,Descripsn.class);
intent.putExtra("smily", smily[arg2].toString());
intent.putEx... | ```
String smily = b.getString("smiley");
```
Wrong))
try this:
```
String smily = b.getString("smily");
``` |
17,231,829 | I made simple structure:
```
struct sToken
{
std::string token;
unsigned int lineNb;
};
```
I want to insert this structure in standard vector using `push_back()` method, but when I do this:
```
std::vector<sToken> result;
result.push_back(tkn); //compiler-error
```
I get following error messages:
`no mat... | 2013/06/21 | [
"https://Stackoverflow.com/questions/17231829",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1925060/"
] | try this
```
@Override
public void onItemClick(AdapterView<?> arg0, View arg1,
int arg2, long arg3) {
Intent intent = new Intent(MainActivity.this,Descripsn.class);
intent.putExtra("smily", smily[arg2].toString());
intent.putEx... | **main.java**
package com.example.androidlistview;
```
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.O... |
1,756,293 | I have to divide the rows equally,
so here, for example, there are 15 rows. I want to divide equally, which is in three groups, but I want the name to come only in front of the first entry of each group, as shown:
```
DECLARE @NAMES TABLE
(
[ID] INT IDENTITY,
[NAME] VARCHAR(20)
)
INSERT INTO @NAMES
SELECT 'NAME1' UNI... | 2009/11/18 | [
"https://Stackoverflow.com/questions/1756293",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/165873/"
] | If you are using SQL 2005 or above, the following should do the job for any number of rows:
```
declare @numBuckets;
select @numBuckets = 3;
;with nameBase as
(
select ntile(@numBuckets) over(order by ID) as bucket,
NAME, ID
from @NAMES
),
nameRows as
(
select row_number() over(partition ... | ```
SELECT ID, CASE WHEN (ID = 1 OR ID = 6 OR ID = 11) THEN Name Else NULL END
FROM @Names
```
I know it is a stupid way of doing it.
But, it is much better to write it in this way for a limited set of rows (as per your example).
If you have more number of rows (than 15), please post.
I will try to see if I ca... |
1,756,293 | I have to divide the rows equally,
so here, for example, there are 15 rows. I want to divide equally, which is in three groups, but I want the name to come only in front of the first entry of each group, as shown:
```
DECLARE @NAMES TABLE
(
[ID] INT IDENTITY,
[NAME] VARCHAR(20)
)
INSERT INTO @NAMES
SELECT 'NAME1' UNI... | 2009/11/18 | [
"https://Stackoverflow.com/questions/1756293",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/165873/"
] | If you are using SQL 2005 or above, the following should do the job for any number of rows:
```
declare @numBuckets;
select @numBuckets = 3;
;with nameBase as
(
select ntile(@numBuckets) over(order by ID) as bucket,
NAME, ID
from @NAMES
),
nameRows as
(
select row_number() over(partition ... | You could calculate the row number and the total number of rows in a subquery. The outer select can then choose based on those columns:
```
select
id,
case
when id = 1 then name
when id = total/3+1 then name
when id = total*2/3+1 then name
else ''
end
from (
select... |
405,808 | >
> Given a random variable $X\sim Bin(n,p)$, where $p$ is known $p\in
> (0,1)$ , $n$ is an unknown positive integer and
> $x\in\{0,1,2,....n\}$, what is the maximum likelihood estimator of
> $n$?
>
>
>
I found [this answer on maths.stackexchange](https://math.stackexchange.com/questions/2628304/maximum-likeli... | 2019/04/30 | [
"https://stats.stackexchange.com/questions/405808",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/240699/"
] | In [this answer](https://math.stackexchange.com/questions/2628304/maximum-likelihood-estimator-for-n-in-binomial-with-known-p) to the question
$$\dfrac{{n+1 \choose x}p^x(1-p)^{n+1-x}}{{n \choose x}p^x(1-p)^{n-x}} = \dfrac{n+1}{n+1-x}(1-p)$$
represents the likelihood ratio
$$\frac{L(n+1\mid x,p)}{L(n\mid x,p)}$$
If thi... | Binomial PMF is a discrete function of $n$, say $f(n)$, given others, i.e. $x,p$. We want to maximize it in terms of $n$. Typically, we would take the derivate and equate it to zero, but in discrete cases we shouldn't do that. This PDF is known to have its peak value(s) around its mean (not exactly but close). Its grap... |
405,808 | >
> Given a random variable $X\sim Bin(n,p)$, where $p$ is known $p\in
> (0,1)$ , $n$ is an unknown positive integer and
> $x\in\{0,1,2,....n\}$, what is the maximum likelihood estimator of
> $n$?
>
>
>
I found [this answer on maths.stackexchange](https://math.stackexchange.com/questions/2628304/maximum-likeli... | 2019/04/30 | [
"https://stats.stackexchange.com/questions/405808",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/240699/"
] | In [this answer](https://math.stackexchange.com/questions/2628304/maximum-likelihood-estimator-for-n-in-binomial-with-known-p) to the question
$$\dfrac{{n+1 \choose x}p^x(1-p)^{n+1-x}}{{n \choose x}p^x(1-p)^{n-x}} = \dfrac{n+1}{n+1-x}(1-p)$$
represents the likelihood ratio
$$\frac{L(n+1\mid x,p)}{L(n\mid x,p)}$$
If thi... | As [Xi'an](https://stats.stackexchange.com/users/7224/xian) correctly points out, this is a maximisation problem over integers, not real numbers. The objective function is quasi-concave, so we can obtain the maximising value by finding the point at which the (forward) likelihood ratio first drops below one. His answer ... |
4,766,938 | I have created a custom View which I usually attach an onClickListener to. I'd like to have some button like behavior: if it is pressed, it should alter its appearance which is defined in the onDraw() method. However, this code does not work:
```
//In my custom View:
@Override
protected void onDraw(Canvas canvas)
{
... | 2011/01/22 | [
"https://Stackoverflow.com/questions/4766938",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/292233/"
] | have you considered just using a button to do what you want? you could use ToggleButton and write a short selector in xml that will allow you to specify an image to use when pressed or not. [this question](https://stackoverflow.com/questions/1533038/android-specify-two-different-images-for-togglebutton-using-xml) may b... | To make your new custom button draw on clicks don't forget to invalidate the form as necessary. This is a little gotcha. E.g.
```
@Override
public boolean onTouch(View v, MotionEvent event)
{
/* Parse Event */
this.invalidate();
return true;
}
``` |
4,766,938 | I have created a custom View which I usually attach an onClickListener to. I'd like to have some button like behavior: if it is pressed, it should alter its appearance which is defined in the onDraw() method. However, this code does not work:
```
//In my custom View:
@Override
protected void onDraw(Canvas canvas)
{
... | 2011/01/22 | [
"https://Stackoverflow.com/questions/4766938",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/292233/"
] | hey buddy,your fault is you are not implementing click or touch evnt for ur custom view.thr is no click evnt for view.you can use touch event instead of this:so below code work 4 u:
---
```
myView.setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generate... | To make your new custom button draw on clicks don't forget to invalidate the form as necessary. This is a little gotcha. E.g.
```
@Override
public boolean onTouch(View v, MotionEvent event)
{
/* Parse Event */
this.invalidate();
return true;
}
``` |
12,009,593 | So I found myself wishing that I could iterate through command-line arguments with va\_list and I believe I have seen it done somewhere.
I've tried googling with no avail.
Does anyone know how to achieve this or know if it can be achieved? | 2012/08/17 | [
"https://Stackoverflow.com/questions/12009593",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/477013/"
] | You can't. `va_list` applies to varargs functions, which `main` is not. However, what I would like to know is why you would prefer this (if it were possible):
```
char *arg;
va_list vl;
va_start(vl, argc);
while ((arg = va_arg(vl, char*)))
// use arg
va_end(vl);
```
to this:
```
for (int i = 0; i < argc; ++i)
... | <http://www.cplusplus.com/reference/clibrary/cstdarg/va_start/>
This doesn't apply specifically to command lines arguments. |
21,121,808 | I have a webform with a **Download LinkButton**, on the button's click event I'm fetching data and then **generating an .XLSX file** for download. During the generation of the file, **Response.Clear()** is called, **Response.ContentType** is set and eventually **Response.End()** is called.
I need to **display a spinne... | 2014/01/14 | [
"https://Stackoverflow.com/questions/21121808",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/715865/"
] | I actually ended up going with a solution that **did not require the use of an iFrame**. Instead I make use of a **Cookie**, which the file generation process writes into it simple a Name Value pair. This cookie can then be checked later from the client side via JavaScript to determine when the response (.xlsx file) ha... | It should go like this : (one solution among others)
1) create an iframe on your page which will actually download your file ( so your main page wont be blank )
2) Add a cookie to the response. via
`Response.AddHeader("content-disposition", "attachment;filename=1.jpg");`
3) when a user press "download" you set (vi... |
34,647,227 | When I run my program this error comes out for the following sql statement
```
SqlCommand Item1 = new SqlCommand("UPDATE ItemTable (ItemProductPlu = '" + ProductPlu1 + "',ItemProductQty ='" + ProductQty1 + "' ,Fufilled'" + Fufilled + " ')' WHERE ItemId = Max(ItemId)", conn);
```
Error :
>
> SqlException wa... | 2016/01/07 | [
"https://Stackoverflow.com/questions/34647227",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5747087/"
] | <http://php.net/manual/en/pdo.query.php>
There's nothing necessarily wrong with doing it that way, but in virtually all the code I've seen/written fetch modes are specified. | The 'query' and similarly 'execute' are methods related to PDO (PHP Data Objects) which provides methods to interact with databases (not only MySQL but others like SQL Server, Oracle, SQLite and others) therefore it is good idea to learn how to use those methods (query, execute and many there are many more, check our P... |
2,864,374 | We are at a stage where we are considering different Web UI frameworks (most likely component based ones such as GWT, JSF, Wicket, Vaadin, etc).
One of the main use cases / constraints is that it must support generating dynamic pages. I.e., the page/form layout and components is stored in a database and is changeable ... | 2010/05/19 | [
"https://Stackoverflow.com/questions/2864374",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/90566/"
] | Neither of the mentioned frameworks supports creating components from DB out-of-the-box. But there are frameworks which can do this. I only know client side frameworks such as swixml but there are webframeworks which can do this, I am sure.
But it is fairly easy to define some json/xml format and create components fro... | I'am trying dynamic (programmatic) generation of pages using JSF 2. I wanted to make use of existing tuned ajax components (ICEfaces). So I decided to use Composite Components.
It is great pain. Many things that should work straigthforward simply doesn't. I have to go around so many weird problems that I'm slowly ge... |
2,864,374 | We are at a stage where we are considering different Web UI frameworks (most likely component based ones such as GWT, JSF, Wicket, Vaadin, etc).
One of the main use cases / constraints is that it must support generating dynamic pages. I.e., the page/form layout and components is stored in a database and is changeable ... | 2010/05/19 | [
"https://Stackoverflow.com/questions/2864374",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/90566/"
] | As GWT allows building page components programmatically, it should be good for you.
About using JSF - I would not recommend. | I'am trying dynamic (programmatic) generation of pages using JSF 2. I wanted to make use of existing tuned ajax components (ICEfaces). So I decided to use Composite Components.
It is great pain. Many things that should work straigthforward simply doesn't. I have to go around so many weird problems that I'm slowly ge... |
21,188,214 | I have added a new field to an existing database and set the Data Type to Yes/No as shown in Pic1.

This defaults to Check Box. If I then try and select Text Box (as shown Pic2) it immediately reverts to Check Box. Combo Box can be selected successfully.

This defaults to Check Box. If I then try and select Text Box (as shown Pic2) it immediately reverts to Check Box. Combo Box can be selected successfully.
.TableDefs("YourTable").Fields("YourField").Properties("DisplayControl")=109 |
21,188,214 | I have added a new field to an existing database and set the Data Type to Yes/No as shown in Pic1.

This defaults to Check Box. If I then try and select Text Box (as shown Pic2) it immediately reverts to Check Box. Combo Box can be selected successfully.
.TableDefs("YourTable").Fields("YourField").Properties("DisplayControl")=109 |
4,468,842 | I have an app running at the Machine-A, now Machine-B is requesting a remote desktop to Machine-A. The app running at Machine-A needs to capture this request and log it. Is this possible through either C++/C#.
I have googled to find, if there's any widows message being transmitted, but in vain. Also I won't be able to... | 2010/12/17 | [
"https://Stackoverflow.com/questions/4468842",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50388/"
] | Check third parameter [MidpointRounding](http://msdn.microsoft.com/en-us/library/system.midpointrounding.aspx).
By default used MidpointRounding.ToEven, so
```
Math.Round(result,0); // 6.0
//or
Math.Round(result,0, MidpointRounding.ToEven); // 6.0
//But:
Math.Round(result,0, MidpointRounding.AwayFromZero); // 7.0 ... | It must be the same reason as why
```
Math.Round(6.5, 0);
```
similarly yields 6 rather than 7. It all comes down to the MSDN documentation [link text](http://msdn.microsoft.com/en-us/library/zy06z30k.aspx) which exemplify
```
Console.WriteLine(Math.Round(3.45, 1)); //Returns 3.4.
Console.WriteLine(Math.R... |
4,468,842 | I have an app running at the Machine-A, now Machine-B is requesting a remote desktop to Machine-A. The app running at Machine-A needs to capture this request and log it. Is this possible through either C++/C#.
I have googled to find, if there's any widows message being transmitted, but in vain. Also I won't be able to... | 2010/12/17 | [
"https://Stackoverflow.com/questions/4468842",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50388/"
] | From [MSDN](http://msdn.microsoft.com/en-us/library/3s2d3xkk.aspx):
>
> If the fractional component of d is
> halfway between two integers, one of
> which is even and the other odd, the
> even number is returned.
>
>
> | Use Math.Ceiling Method().
decimal num1=390, num2=60, result;
result=Math.Ceiling(num1/num2); |
4,468,842 | I have an app running at the Machine-A, now Machine-B is requesting a remote desktop to Machine-A. The app running at Machine-A needs to capture this request and log it. Is this possible through either C++/C#.
I have googled to find, if there's any widows message being transmitted, but in vain. Also I won't be able to... | 2010/12/17 | [
"https://Stackoverflow.com/questions/4468842",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50388/"
] | This kind of rounding is sometimes called rounding to nearest, or banker's rounding. It minimizes rounding errors that result from consistently rounding a midpoint value in a single direction.
<http://msdn.microsoft.com/en-us/library/3s2d3xkk.aspx>
Example:
```
// 11.1 --> 11
// 11.2 --> 11
// 11.3... | decimal.Math.Round uses MidpointRounding.ToEven as default.
Meaning if the one's digit is odd, it is changed to an even digit. Otherwise, it is left unchanged. This behavior follows IEEE Standard 754, section 4. It is sometimes called rounding to nearest, or banker's rounding. It minimizes rounding errors that result... |
4,468,842 | I have an app running at the Machine-A, now Machine-B is requesting a remote desktop to Machine-A. The app running at Machine-A needs to capture this request and log it. Is this possible through either C++/C#.
I have googled to find, if there's any widows message being transmitted, but in vain. Also I won't be able to... | 2010/12/17 | [
"https://Stackoverflow.com/questions/4468842",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50388/"
] | From [MSDN](http://msdn.microsoft.com/en-us/library/3s2d3xkk.aspx):
>
> If the fractional component of d is
> halfway between two integers, one of
> which is even and the other odd, the
> even number is returned.
>
>
> | decimal.Math.Round uses MidpointRounding.ToEven as default.
Meaning if the one's digit is odd, it is changed to an even digit. Otherwise, it is left unchanged. This behavior follows IEEE Standard 754, section 4. It is sometimes called rounding to nearest, or banker's rounding. It minimizes rounding errors that result... |
4,468,842 | I have an app running at the Machine-A, now Machine-B is requesting a remote desktop to Machine-A. The app running at Machine-A needs to capture this request and log it. Is this possible through either C++/C#.
I have googled to find, if there's any widows message being transmitted, but in vain. Also I won't be able to... | 2010/12/17 | [
"https://Stackoverflow.com/questions/4468842",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50388/"
] | Check third parameter [MidpointRounding](http://msdn.microsoft.com/en-us/library/system.midpointrounding.aspx).
By default used MidpointRounding.ToEven, so
```
Math.Round(result,0); // 6.0
//or
Math.Round(result,0, MidpointRounding.ToEven); // 6.0
//But:
Math.Round(result,0, MidpointRounding.AwayFromZero); // 7.0 ... | From [MSDN](http://msdn.microsoft.com/en-us/library/3s2d3xkk.aspx):
>
> If the fractional component of d is
> halfway between two integers, one of
> which is even and the other odd, the
> even number is returned.
>
>
> |
4,468,842 | I have an app running at the Machine-A, now Machine-B is requesting a remote desktop to Machine-A. The app running at Machine-A needs to capture this request and log it. Is this possible through either C++/C#.
I have googled to find, if there's any widows message being transmitted, but in vain. Also I won't be able to... | 2010/12/17 | [
"https://Stackoverflow.com/questions/4468842",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50388/"
] | Check third parameter [MidpointRounding](http://msdn.microsoft.com/en-us/library/system.midpointrounding.aspx).
By default used MidpointRounding.ToEven, so
```
Math.Round(result,0); // 6.0
//or
Math.Round(result,0, MidpointRounding.ToEven); // 6.0
//But:
Math.Round(result,0, MidpointRounding.AwayFromZero); // 7.0 ... | Use Math.Ceiling Method().
decimal num1=390, num2=60, result;
result=Math.Ceiling(num1/num2); |
4,468,842 | I have an app running at the Machine-A, now Machine-B is requesting a remote desktop to Machine-A. The app running at Machine-A needs to capture this request and log it. Is this possible through either C++/C#.
I have googled to find, if there's any widows message being transmitted, but in vain. Also I won't be able to... | 2010/12/17 | [
"https://Stackoverflow.com/questions/4468842",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50388/"
] | Check third parameter [MidpointRounding](http://msdn.microsoft.com/en-us/library/system.midpointrounding.aspx).
By default used MidpointRounding.ToEven, so
```
Math.Round(result,0); // 6.0
//or
Math.Round(result,0, MidpointRounding.ToEven); // 6.0
//But:
Math.Round(result,0, MidpointRounding.AwayFromZero); // 7.0 ... | This kind of rounding is sometimes called rounding to nearest, or banker's rounding. It minimizes rounding errors that result from consistently rounding a midpoint value in a single direction.
<http://msdn.microsoft.com/en-us/library/3s2d3xkk.aspx>
Example:
```
// 11.1 --> 11
// 11.2 --> 11
// 11.3... |
4,468,842 | I have an app running at the Machine-A, now Machine-B is requesting a remote desktop to Machine-A. The app running at Machine-A needs to capture this request and log it. Is this possible through either C++/C#.
I have googled to find, if there's any widows message being transmitted, but in vain. Also I won't be able to... | 2010/12/17 | [
"https://Stackoverflow.com/questions/4468842",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50388/"
] | This kind of rounding is sometimes called rounding to nearest, or banker's rounding. It minimizes rounding errors that result from consistently rounding a midpoint value in a single direction.
<http://msdn.microsoft.com/en-us/library/3s2d3xkk.aspx>
Example:
```
// 11.1 --> 11
// 11.2 --> 11
// 11.3... | It must be the same reason as why
```
Math.Round(6.5, 0);
```
similarly yields 6 rather than 7. It all comes down to the MSDN documentation [link text](http://msdn.microsoft.com/en-us/library/zy06z30k.aspx) which exemplify
```
Console.WriteLine(Math.Round(3.45, 1)); //Returns 3.4.
Console.WriteLine(Math.R... |
4,468,842 | I have an app running at the Machine-A, now Machine-B is requesting a remote desktop to Machine-A. The app running at Machine-A needs to capture this request and log it. Is this possible through either C++/C#.
I have googled to find, if there's any widows message being transmitted, but in vain. Also I won't be able to... | 2010/12/17 | [
"https://Stackoverflow.com/questions/4468842",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50388/"
] | Check third parameter [MidpointRounding](http://msdn.microsoft.com/en-us/library/system.midpointrounding.aspx).
By default used MidpointRounding.ToEven, so
```
Math.Round(result,0); // 6.0
//or
Math.Round(result,0, MidpointRounding.ToEven); // 6.0
//But:
Math.Round(result,0, MidpointRounding.AwayFromZero); // 7.0 ... | decimal.Math.Round uses MidpointRounding.ToEven as default.
Meaning if the one's digit is odd, it is changed to an even digit. Otherwise, it is left unchanged. This behavior follows IEEE Standard 754, section 4. It is sometimes called rounding to nearest, or banker's rounding. It minimizes rounding errors that result... |
4,468,842 | I have an app running at the Machine-A, now Machine-B is requesting a remote desktop to Machine-A. The app running at Machine-A needs to capture this request and log it. Is this possible through either C++/C#.
I have googled to find, if there's any widows message being transmitted, but in vain. Also I won't be able to... | 2010/12/17 | [
"https://Stackoverflow.com/questions/4468842",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50388/"
] | This kind of rounding is sometimes called rounding to nearest, or banker's rounding. It minimizes rounding errors that result from consistently rounding a midpoint value in a single direction.
<http://msdn.microsoft.com/en-us/library/3s2d3xkk.aspx>
Example:
```
// 11.1 --> 11
// 11.2 --> 11
// 11.3... | Use Math.Ceiling Method().
decimal num1=390, num2=60, result;
result=Math.Ceiling(num1/num2); |
9,053,705 | We have contacts displayed as `Name <123-456-767>`
I want to fetch only the number part `123456767` if the specified address is a valid one.
Can anyone can help me !!!
Thanks in advance | 2012/01/29 | [
"https://Stackoverflow.com/questions/9053705",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/922998/"
] | Or, even simpler:
`"Name <123-456-767>".replaceAll("[^0-9]", "");` | Use regular expressions:
```
private static final Pattern NUMBER_PART = Pattern.compile(".+ <([0-9\\-]+)>");
...
Matcher matcher = NUMBER_PART.matcher(contact);
if (matcher.find()) {
String number_part = matcher.group(1);
number_part = number_part.replace("-", "");
}
``` |
9,053,705 | We have contacts displayed as `Name <123-456-767>`
I want to fetch only the number part `123456767` if the specified address is a valid one.
Can anyone can help me !!!
Thanks in advance | 2012/01/29 | [
"https://Stackoverflow.com/questions/9053705",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/922998/"
] | Or, even simpler:
`"Name <123-456-767>".replaceAll("[^0-9]", "");` | `public static String stripSeparators (String phoneNumber)`
Since: API Level 1
Strips separators from a phone number string.
Parameters phoneNumber phone number to strip
`Returns phone string stripped of separators.` |
47,634,107 | I have made a game named `Two Dice Pig` in java. The game has a simple GUI interface showing two dice faces as well as both players scores and names. The game starts with the simple dialog message asking for both players' name and the game starts. Both players interact with only one GUI interface and play as their turn... | 2017/12/04 | [
"https://Stackoverflow.com/questions/47634107",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8967249/"
] | To edit the `value` attribute and assign the value **`foo`** to it you can use the following code block which uses the JavascriptExecutor :
```
ele = browser.find_element_by_css_selector("input#input-value")
browser.execute_script("arguments[0].setAttribute('value','foo')", ele)
``` | Using .click() before .send\_keys() like:
```
ele = browser.find_element_by_id("input-value")
ele.click()
ele.send_keys("foo")
ele.send_keys(Keys.RETURN)
``` |
22,225,325 | I'm binding a kendo grid with 12 Columns (12 months), i want a last column that will be the aggregation of all the 12 months (total of the year)..
i have this:
```
@(Html.Kendo().Grid<WebAnalise.Models.map_sel_fabr_prod>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.nameFabr).Visible(true).Width(50).... | 2014/03/06 | [
"https://Stackoverflow.com/questions/22225325",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1314869/"
] | You can use the built-in aggregate functionality of the Kendo UI Grid as shown in this demo:
<http://demos.telerik.com/kendo-ui/web/grid/aggregates.html>
You can display the aggregate information in the footer template of the last column (shown in the demo) | Are you using LinQ or ADO for data access??? Whichever it is it doesn't really matter but you can just return the sum using your LinQ query or in your stored procedure and tie the sum to a property of your model class |
22,225,325 | I'm binding a kendo grid with 12 Columns (12 months), i want a last column that will be the aggregation of all the 12 months (total of the year)..
i have this:
```
@(Html.Kendo().Grid<WebAnalise.Models.map_sel_fabr_prod>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.nameFabr).Visible(true).Width(50).... | 2014/03/06 | [
"https://Stackoverflow.com/questions/22225325",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1314869/"
] | Try this
* First Make sure your model columns are decimal
* Add the Total Column in the end of the grid if you want to use the footer then add client footer.
* Add Aggregate as shown
* Add Javascript
* Finally total column will sum total of given columns dynamically and will show grand total in footer as well.
\*\**\... | You can use the built-in aggregate functionality of the Kendo UI Grid as shown in this demo:
<http://demos.telerik.com/kendo-ui/web/grid/aggregates.html>
You can display the aggregate information in the footer template of the last column (shown in the demo) |
22,225,325 | I'm binding a kendo grid with 12 Columns (12 months), i want a last column that will be the aggregation of all the 12 months (total of the year)..
i have this:
```
@(Html.Kendo().Grid<WebAnalise.Models.map_sel_fabr_prod>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.nameFabr).Visible(true).Width(50).... | 2014/03/06 | [
"https://Stackoverflow.com/questions/22225325",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1314869/"
] | Try this
* First Make sure your model columns are decimal
* Add the Total Column in the end of the grid if you want to use the footer then add client footer.
* Add Aggregate as shown
* Add Javascript
* Finally total column will sum total of given columns dynamically and will show grand total in footer as well.
\*\**\... | Are you using LinQ or ADO for data access??? Whichever it is it doesn't really matter but you can just return the sum using your LinQ query or in your stored procedure and tie the sum to a property of your model class |
6,475,959 | I hate how .NET Programs want you to download the .NET Framework to run them , so I was thinking of embedding the MONO Runtime with my program. Is there any third party software for doing it easily or would I need to do it by hand or by C/C++? Also , how much extra hard drive space would it need and are there any disad... | 2011/06/25 | [
"https://Stackoverflow.com/questions/6475959",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/753341/"
] | You can distribute the Microsoft .NET Framework 4 redistributable package alongside your application.
Have a look at [smallestdotnet.com](http://www.hanselman.com/smallestdotnet/). | Interesting idea - it looks like Mr. Icaza has documented exactly how to do that [here](http://www.mono-project.com/Embedding_Mono). |
6,475,959 | I hate how .NET Programs want you to download the .NET Framework to run them , so I was thinking of embedding the MONO Runtime with my program. Is there any third party software for doing it easily or would I need to do it by hand or by C/C++? Also , how much extra hard drive space would it need and are there any disad... | 2011/06/25 | [
"https://Stackoverflow.com/questions/6475959",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/753341/"
] | Interesting idea - it looks like Mr. Icaza has documented exactly how to do that [here](http://www.mono-project.com/Embedding_Mono). | This question is an old one. But it's the first link to the StackOverflow that Google gave me.
So for anyone else who lands here after googling:
* Take a look at the [mkbundle](http://www.mono-project.com/archived/guiderunning_mono_applications/#bundles) utility that is a part of the Mono project's SDK.
* And see thi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.