qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
510,518 | Install 14.04 through live usb to external-hdd on ASUS 105E-DS02, currently running 12.04 with broken wifi. The 8GB live usb and 3 dvds from PRIZX will provide the software. Have read through many answers and web sites, did note the need for internet connection which is not available until thats fixed. Hoping that wifi... | 2014/08/12 | [
"https://askubuntu.com/questions/510518",
"https://askubuntu.com",
"https://askubuntu.com/users/315054/"
] | Overall just start the installation but when it gets to the page where it asks you to select install location and such select "something else" then set the bootloader install location to the external hdd and the / mount point on it as well. | You should be able to do this quite easily using manual partitioning. See [this answer](https://askubuntu.com/a/343352/205638) and make sure you're installing to your external, which will likely be `/dev/sdb` and not internal, which will likely be `/dev/sda`. You also have to choose your external for Bootloader Install... |
28,678,095 | I have an excel sheet named InputData. I have 9 different columns present at the moment. I want to have a loop which counts the number of columns in the excel sheet. Also, for each value of the counter, I want to select that individual column and the last column (to be selected default for each iteration). Once I have ... | 2015/02/23 | [
"https://Stackoverflow.com/questions/28678095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4597187/"
] | I am going to assume you've attempted a few things know the basics of excel-vba (for future questions and maybe this one as well, show the work you've done so far).
I would create a formula cell that counts how many columns there. Put it in another sheet so the formula is `=COUNTA('InputData'!1:1)`. COUNTA counts the ... | Unfortunately I will not be able to provide you your answer however following code can guide you through your start. Following code will find your last column and repeat your code until "i" hits your column number. In between you can add your code which you want to repeat.
```
Sub rowvscol()
Dim lastColno As Long
Dim ... |
26,746,253 | How can I express the following without the nested case statements? Specifically, I would like to do the steps in order, and call fail if any of the steps hit the "bad" branch.
```
loadData :: IO [Market]
loadData = do
filedata <- B.readFile "markets.json"
case parseData filedata of
Left err -> fail err
R... | 2014/11/04 | [
"https://Stackoverflow.com/questions/26746253",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/105678/"
] | You probably want the exception monad transformer here. Something like this (utterly untested):
```
import Control.Monad.Trans
import Control.Monad.Except
type MyMonadStack a = ExceptT String IO a
loadData :: MyMonadStack [Market]
loadData = do filedata <- lift $ B.readFile "markets.json"
v <- ExceptT ... | If `parseData` and `fromJSON` both have `Either Err a` as their codomain, where `Err` is a fixed type (maybe defined by you), then you can use the `Either e` monad instance like so:
```
loadData :: IO (Either Err [Market])
loadData = do
filedata <- B.readFile "markets.json"
return $ parseData filedata >>= fromJSON... |
336,364 | I would like to ask some help on how I can get the Mod 10 check digit of Contact.DonorID.
the result should be
```
Contact.CRN__c = Contact.DonorID + CheckDigit
```
Just like this:
>
> Check Digit is **2**
>
>
> CRN: 0018457**2**
>
>
>
It is my first time to do it and I don't have any idea, I've been struggl... | 2021/03/10 | [
"https://salesforce.stackexchange.com/questions/336364",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/93802/"
] | I found that to add a button to a list view, navigate to "Search Layouts for Salesforce Classic" (right below Search Layouts) and add the button to the List View Layout there.
Note that the button will not appear in the "Recently Viewed" list view, but it will appear in all the other list views. | Setup > Object Manager > Case > In the sidebar > ListView Page Layout > Edit List View then in the custom button section add your list button, And Save it.
You see the list button on the list views other than recently view. |
56,840,971 | I am trying to create a function that prints each word on a new line. The argument given is a string with words that aren't separated by a space but capitalized except the first word i.e. "helloMyNameIsMark". I have something that works but wondering if there's a better way of doing this in javaScript.
```
separateWor... | 2019/07/01 | [
"https://Stackoverflow.com/questions/56840971",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11725805/"
] | You could use the regex `[A-Z]` and [`replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) each upper case letter with `\n` prefix
```js
const separateWords = str => str.replace(/[A-Z]/g, m => '\n' + m)
console.log(separateWords('helloMyNameIsMark'))
```
Or you ... | I would separate the breaking of words into an array and the printing of that array into two distinct functions. Regular expressions make that first part much easier than your `reduce` call. (But that `reduce` is a good thought if you don't see a regex solution.)
My version might look like this:
```js
const separateW... |
56,840,971 | I am trying to create a function that prints each word on a new line. The argument given is a string with words that aren't separated by a space but capitalized except the first word i.e. "helloMyNameIsMark". I have something that works but wondering if there's a better way of doing this in javaScript.
```
separateWor... | 2019/07/01 | [
"https://Stackoverflow.com/questions/56840971",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11725805/"
] | You could use the regex `[A-Z]` and [`replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) each upper case letter with `\n` prefix
```js
const separateWords = str => str.replace(/[A-Z]/g, m => '\n' + m)
console.log(separateWords('helloMyNameIsMark'))
```
Or you ... | Very similar to adiga's answer, but it can actually be simpler:
```
const separateWords = str => str.replace(/[A-Z]/g, '\n$&');
```
This will also benefit from improved performance (might matter if used at scale). |
56,840,971 | I am trying to create a function that prints each word on a new line. The argument given is a string with words that aren't separated by a space but capitalized except the first word i.e. "helloMyNameIsMark". I have something that works but wondering if there's a better way of doing this in javaScript.
```
separateWor... | 2019/07/01 | [
"https://Stackoverflow.com/questions/56840971",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11725805/"
] | You could use the regex `[A-Z]` and [`replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) each upper case letter with `\n` prefix
```js
const separateWords = str => str.replace(/[A-Z]/g, m => '\n' + m)
console.log(separateWords('helloMyNameIsMark'))
```
Or you ... | Here's a more literal interpretation of your stated requirement: *prints each word* on a new line.
```js
function separateWords(str){
let currentWord = '';
for (let chr of str){
if (chr == chr.toUpperCase()){
console.log(currentWord);
currentWord = chr;
} else {
currentWord += ch... |
1,561,193 | I get the Extended Euclidean Algorithm but I don't understand what this question is asking me:
In this question we consider arithmetic modulo 60 ("clock arithmetic" on the clock with numbers {0,1,2,3,...,58,59}).
Which of the following statements apply?
a. 50 X 50 = 40 modulo 60
b. 17 + 50 = 3 modulo 60
c. 4100 x ... | 2015/12/05 | [
"https://math.stackexchange.com/questions/1561193",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/242148/"
] | You need to differentiate between two different questions:
Q1: Does the right road lead to the ruins?
Q2: Would you say "yes" to question Q1?
If the right road does lead to the ruins, the liar will say "No" to Q1, and *therefore* say "Yes" to Q2! | You have to consider each of the cases separately. First, let us assume that right path leads to the ruins. Then a villager telling the truth would answer "Yes". A lying villager would answer "Yes" as well, since his answer to the question "Does the right path lead to the ruins?" would be "No".
On the other hand, if t... |
1,561,193 | I get the Extended Euclidean Algorithm but I don't understand what this question is asking me:
In this question we consider arithmetic modulo 60 ("clock arithmetic" on the clock with numbers {0,1,2,3,...,58,59}).
Which of the following statements apply?
a. 50 X 50 = 40 modulo 60
b. 17 + 50 = 3 modulo 60
c. 4100 x ... | 2015/12/05 | [
"https://math.stackexchange.com/questions/1561193",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/242148/"
] | If you ask a liar a question the answer will be lie.
If you ask a liar what his answer will be, he will lie about his answer being a lie and he will say that his answer is the truth.
So if the path leads to ruins and you ask if the path leads to ruins he will lie and say "no". If you ask him if he will answer "yes" h... | You have to consider each of the cases separately. First, let us assume that right path leads to the ruins. Then a villager telling the truth would answer "Yes". A lying villager would answer "Yes" as well, since his answer to the question "Does the right path lead to the ruins?" would be "No".
On the other hand, if t... |
1,561,193 | I get the Extended Euclidean Algorithm but I don't understand what this question is asking me:
In this question we consider arithmetic modulo 60 ("clock arithmetic" on the clock with numbers {0,1,2,3,...,58,59}).
Which of the following statements apply?
a. 50 X 50 = 40 modulo 60
b. 17 + 50 = 3 modulo 60
c. 4100 x ... | 2015/12/05 | [
"https://math.stackexchange.com/questions/1561193",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/242148/"
] | You need to differentiate between two different questions:
Q1: Does the right road lead to the ruins?
Q2: Would you say "yes" to question Q1?
If the right road does lead to the ruins, the liar will say "No" to Q1, and *therefore* say "Yes" to Q2! | If I were in this situation in real life, I will ask them about a different place different from the two in the fork, The truth teller will always say "no". On the other hand the liar will say "yes". For that I can identify whether the person is a truth-teller or not, then I will ask him the direct question.
For exampl... |
1,561,193 | I get the Extended Euclidean Algorithm but I don't understand what this question is asking me:
In this question we consider arithmetic modulo 60 ("clock arithmetic" on the clock with numbers {0,1,2,3,...,58,59}).
Which of the following statements apply?
a. 50 X 50 = 40 modulo 60
b. 17 + 50 = 3 modulo 60
c. 4100 x ... | 2015/12/05 | [
"https://math.stackexchange.com/questions/1561193",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/242148/"
] | If you ask a liar a question the answer will be lie.
If you ask a liar what his answer will be, he will lie about his answer being a lie and he will say that his answer is the truth.
So if the path leads to ruins and you ask if the path leads to ruins he will lie and say "no". If you ask him if he will answer "yes" h... | If I were in this situation in real life, I will ask them about a different place different from the two in the fork, The truth teller will always say "no". On the other hand the liar will say "yes". For that I can identify whether the person is a truth-teller or not, then I will ask him the direct question.
For exampl... |
1,561,193 | I get the Extended Euclidean Algorithm but I don't understand what this question is asking me:
In this question we consider arithmetic modulo 60 ("clock arithmetic" on the clock with numbers {0,1,2,3,...,58,59}).
Which of the following statements apply?
a. 50 X 50 = 40 modulo 60
b. 17 + 50 = 3 modulo 60
c. 4100 x ... | 2015/12/05 | [
"https://math.stackexchange.com/questions/1561193",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/242148/"
] | If you ask a liar a question the answer will be lie.
If you ask a liar what his answer will be, he will lie about his answer being a lie and he will say that his answer is the truth.
So if the path leads to ruins and you ask if the path leads to ruins he will lie and say "no". If you ask him if he will answer "yes" h... | You need to differentiate between two different questions:
Q1: Does the right road lead to the ruins?
Q2: Would you say "yes" to question Q1?
If the right road does lead to the ruins, the liar will say "No" to Q1, and *therefore* say "Yes" to Q2! |
1,561,193 | I get the Extended Euclidean Algorithm but I don't understand what this question is asking me:
In this question we consider arithmetic modulo 60 ("clock arithmetic" on the clock with numbers {0,1,2,3,...,58,59}).
Which of the following statements apply?
a. 50 X 50 = 40 modulo 60
b. 17 + 50 = 3 modulo 60
c. 4100 x ... | 2015/12/05 | [
"https://math.stackexchange.com/questions/1561193",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/242148/"
] | You need to differentiate between two different questions:
Q1: Does the right road lead to the ruins?
Q2: Would you say "yes" to question Q1?
If the right road does lead to the ruins, the liar will say "No" to Q1, and *therefore* say "Yes" to Q2! | Since the liar always lies, the only way to extract a truth from a liar is to make him lie a lie, as $\neg (\neg T) = T$.
Let $p$ be the case that the villager tells the truth.
Let $q$ be the case that the right branch leads to the ruins.
We shall prove this by taking cases:
1. The right branch leads to the r... |
1,561,193 | I get the Extended Euclidean Algorithm but I don't understand what this question is asking me:
In this question we consider arithmetic modulo 60 ("clock arithmetic" on the clock with numbers {0,1,2,3,...,58,59}).
Which of the following statements apply?
a. 50 X 50 = 40 modulo 60
b. 17 + 50 = 3 modulo 60
c. 4100 x ... | 2015/12/05 | [
"https://math.stackexchange.com/questions/1561193",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/242148/"
] | If you ask a liar a question the answer will be lie.
If you ask a liar what his answer will be, he will lie about his answer being a lie and he will say that his answer is the truth.
So if the path leads to ruins and you ask if the path leads to ruins he will lie and say "no". If you ask him if he will answer "yes" h... | Since the liar always lies, the only way to extract a truth from a liar is to make him lie a lie, as $\neg (\neg T) = T$.
Let $p$ be the case that the villager tells the truth.
Let $q$ be the case that the right branch leads to the ruins.
We shall prove this by taking cases:
1. The right branch leads to the r... |
1,061,357 | A really good friend of mine is an elementary school math teacher. He is turning 50, and we want to put a mathematical expression that equals 50 on his birthday cake but goes beyond the typical "order of operations" problems. Some simple examples are
$$e^{\ln{50}}$$
$$100\sin{\frac{\pi}{6}}$$
$$25\sum\_{k=0}^\infty \f... | 2014/12/10 | [
"https://math.stackexchange.com/questions/1061357",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/61030/"
] | I hope he doesn't calculate it by adding all numbers ;)
\begin{align}
50 = \sum\_{k=0}^{100} (-1)^k k
\end{align}
And a last one, involving only $4$s and $9$s:
\begin{align}
4^9 \mod 49 + \sqrt{49}
\end{align} | You could go Roman with $$\Huge{L}$$
Or with $$\begin{array}{c} \\ \\ \end{array}$$
$$\begin{array}{ccccccccccccc} \Huge{X}&&&&&&&&&&&&\Huge{X}\\ \\ \\ \\
&&&&&&\Huge{X}\\ \\ \\ \\ \Huge{X}&&&&&&&&&&&&\Huge{X} \end{array}\\ $$ |
1,061,357 | A really good friend of mine is an elementary school math teacher. He is turning 50, and we want to put a mathematical expression that equals 50 on his birthday cake but goes beyond the typical "order of operations" problems. Some simple examples are
$$e^{\ln{50}}$$
$$100\sin{\frac{\pi}{6}}$$
$$25\sum\_{k=0}^\infty \f... | 2014/12/10 | [
"https://math.stackexchange.com/questions/1061357",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/61030/"
] | We can use only two [famous numbers in mathematics](http://list25.com/25-famous-numbers-and-why-they-are-important/), [$\large\pi$](http://en.wikipedia.org/wiki/Pi) and [$\large e$](http://en.wikipedia.org/wiki/E_%28mathematical_constant%29), to produce number $50$.
[$$\bbox[8pt,border:3px #FF69B4 solid]{\color{red}{\... | $$\frac{2^{\frac{(2\cdot2)!}{2+2}}+22+2^{2^2}-\sqrt 2^2}{2^{2-\frac{2}{2}}}$$ |
1,061,357 | A really good friend of mine is an elementary school math teacher. He is turning 50, and we want to put a mathematical expression that equals 50 on his birthday cake but goes beyond the typical "order of operations" problems. Some simple examples are
$$e^{\ln{50}}$$
$$100\sin{\frac{\pi}{6}}$$
$$25\sum\_{k=0}^\infty \f... | 2014/12/10 | [
"https://math.stackexchange.com/questions/1061357",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/61030/"
] | I hope he doesn't calculate it by adding all numbers ;)
\begin{align}
50 = \sum\_{k=0}^{100} (-1)^k k
\end{align}
And a last one, involving only $4$s and $9$s:
\begin{align}
4^9 \mod 49 + \sqrt{49}
\end{align} | The Complex Answers
===================
I'd suggest $4.471527458208!=50$, but this isn't readily solvable. You suggested summations, and I thought "Hey! Why not *nested* summations?" The product of my "why not" statement:
$$\sum \_{n=0}^4\sum \_{i=n}^7n=50$$
If you're okay with floor functions:
$$\left\lfloor\prod ... |
1,061,357 | A really good friend of mine is an elementary school math teacher. He is turning 50, and we want to put a mathematical expression that equals 50 on his birthday cake but goes beyond the typical "order of operations" problems. Some simple examples are
$$e^{\ln{50}}$$
$$100\sin{\frac{\pi}{6}}$$
$$25\sum\_{k=0}^\infty \f... | 2014/12/10 | [
"https://math.stackexchange.com/questions/1061357",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/61030/"
] | We can use only two [famous numbers in mathematics](http://list25.com/25-famous-numbers-and-why-they-are-important/), [$\large\pi$](http://en.wikipedia.org/wiki/Pi) and [$\large e$](http://en.wikipedia.org/wiki/E_%28mathematical_constant%29), to produce number $50$.
[$$\bbox[8pt,border:3px #FF69B4 solid]{\color{red}{\... | Some solutions:
$$\dfrac{50(-1)^{-i}}{i^{i^{2}}}=50$$
$$50=\sum\_{n=1}^{10}(2n-1) \mod 10$$
$$50=1212\_3$$
$$\left(4+\frac{4}{4}\right)\dfrac{\binom{4}{4-\frac{4}{4}}}{0.4}=50$$ |
1,061,357 | A really good friend of mine is an elementary school math teacher. He is turning 50, and we want to put a mathematical expression that equals 50 on his birthday cake but goes beyond the typical "order of operations" problems. Some simple examples are
$$e^{\ln{50}}$$
$$100\sin{\frac{\pi}{6}}$$
$$25\sum\_{k=0}^\infty \f... | 2014/12/10 | [
"https://math.stackexchange.com/questions/1061357",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/61030/"
] | Whenever one of my friends has a birthday, I find out how old they get and then I visit [their number on Wikipedia](http://en.wikipedia.org/wiki/50_%28number%29)
For your friend, I would write something like this:
>
> 50 is the smallest number that is the sum of two non-zero square numbers in two distinct ways: $1^2... | Some solutions:
$$\dfrac{50(-1)^{-i}}{i^{i^{2}}}=50$$
$$50=\sum\_{n=1}^{10}(2n-1) \mod 10$$
$$50=1212\_3$$
$$\left(4+\frac{4}{4}\right)\dfrac{\binom{4}{4-\frac{4}{4}}}{0.4}=50$$ |
1,061,357 | A really good friend of mine is an elementary school math teacher. He is turning 50, and we want to put a mathematical expression that equals 50 on his birthday cake but goes beyond the typical "order of operations" problems. Some simple examples are
$$e^{\ln{50}}$$
$$100\sin{\frac{\pi}{6}}$$
$$25\sum\_{k=0}^\infty \f... | 2014/12/10 | [
"https://math.stackexchange.com/questions/1061357",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/61030/"
] | Quoting [Wikipedia](http://en.wikipedia.org/wiki/50_(number))
>
> Fifty is the smallest number that is the sum of two non-zero square
> numbers in two distinct ways: $50 = 1^2 + 7^2 = 5^2 + 5^2$.
>
>
>
So you could write something like
\begin{align}
50 = \min\_{n\in \mathbb{N}}\{n =p\_i^2+p\_j^2=p\_k^2+p\_l^2 \q... | $$
\begin{align}
&50 = \frac{5}{24} \zeta(-7)\\
&50 = \frac{ 1600 \sqrt{2} }{3 \pi ^3}\int\_0^{\infty } \frac{x^2 \log ^2(x)}{x^4+1} \, dx
\end{align}
$$ |
1,061,357 | A really good friend of mine is an elementary school math teacher. He is turning 50, and we want to put a mathematical expression that equals 50 on his birthday cake but goes beyond the typical "order of operations" problems. Some simple examples are
$$e^{\ln{50}}$$
$$100\sin{\frac{\pi}{6}}$$
$$25\sum\_{k=0}^\infty \f... | 2014/12/10 | [
"https://math.stackexchange.com/questions/1061357",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/61030/"
] | No fancy math here, but if you want to emphasize how old your friend is getting, nothing says it better than implying he's halfway to the century mark:
$$100\over2$$ | Compute the smallest positive integer $n$ such that the first two digits of $n^2$ is $\frac{n}{2}$. |
1,061,357 | A really good friend of mine is an elementary school math teacher. He is turning 50, and we want to put a mathematical expression that equals 50 on his birthday cake but goes beyond the typical "order of operations" problems. Some simple examples are
$$e^{\ln{50}}$$
$$100\sin{\frac{\pi}{6}}$$
$$25\sum\_{k=0}^\infty \f... | 2014/12/10 | [
"https://math.stackexchange.com/questions/1061357",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/61030/"
] | We also have
\begin{align\*}
50 &= 11+12+13+14 \\
&= (8+4)+(8-4)+(8\cdot 4)+(8/4) \\
&= 4^2 + 4^2 + 3^2 + 3^2\\
&= 6^2 + 3^2 + 2^2 + 1^2\\
&= (7+i)(7-i) \\
&= (10-\color{red}{5})(10-\color{red}{0})\\
&= 10(\color{red}{5}+\color{red}{0})\\
&= \sqrt{30^2+40^2}\\
&= \sqrt[3]{170^2+310^2}\\
&= \sqrt[3]{146^2+322^2}\\
&= ... | Some solutions:
$$\dfrac{50(-1)^{-i}}{i^{i^{2}}}=50$$
$$50=\sum\_{n=1}^{10}(2n-1) \mod 10$$
$$50=1212\_3$$
$$\left(4+\frac{4}{4}\right)\dfrac{\binom{4}{4-\frac{4}{4}}}{0.4}=50$$ |
1,061,357 | A really good friend of mine is an elementary school math teacher. He is turning 50, and we want to put a mathematical expression that equals 50 on his birthday cake but goes beyond the typical "order of operations" problems. Some simple examples are
$$e^{\ln{50}}$$
$$100\sin{\frac{\pi}{6}}$$
$$25\sum\_{k=0}^\infty \f... | 2014/12/10 | [
"https://math.stackexchange.com/questions/1061357",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/61030/"
] | $$
\begin{align}
&50 = \frac{5}{24} \zeta(-7)\\
&50 = \frac{ 1600 \sqrt{2} }{3 \pi ^3}\int\_0^{\infty } \frac{x^2 \log ^2(x)}{x^4+1} \, dx
\end{align}
$$ | $$50 = \int\_{\ln 1}^{3!+2^2}\frac{\Gamma(\frac{1}{2})^4}{6\sum\_{1}^{\infty}\frac{1}{n^2}}\sqrt{3^2+4^2}dx$$
can make it more complicated but it wont fit on a cake :) |
1,061,357 | A really good friend of mine is an elementary school math teacher. He is turning 50, and we want to put a mathematical expression that equals 50 on his birthday cake but goes beyond the typical "order of operations" problems. Some simple examples are
$$e^{\ln{50}}$$
$$100\sin{\frac{\pi}{6}}$$
$$25\sum\_{k=0}^\infty \f... | 2014/12/10 | [
"https://math.stackexchange.com/questions/1061357",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/61030/"
] | Quoting [Wikipedia](http://en.wikipedia.org/wiki/50_(number))
>
> Fifty is the smallest number that is the sum of two non-zero square
> numbers in two distinct ways: $50 = 1^2 + 7^2 = 5^2 + 5^2$.
>
>
>
So you could write something like
\begin{align}
50 = \min\_{n\in \mathbb{N}}\{n =p\_i^2+p\_j^2=p\_k^2+p\_l^2 \q... | $$-\frac{12!! - 3^{10}}{705 \text{ mod } 101}-\int\_0^3 4x^3\;dx = 50$$
Or, if the double factorial is too weird:
$$\frac{9! - 2^{15}}{10000000\_2}-\sqrt[5]{243}^2 = 50$$ |
392,269 | I have a customer that uses a VPN connection, however it automatically configures my DNS settings to a non-existent DNS server, meaning every DNS resolution times out until the alternative is tried, which really slows down all Internet traffic.
Is there a way that I can prevent an application from overriding my DNS se... | 2012/02/21 | [
"https://superuser.com/questions/392269",
"https://superuser.com",
"https://superuser.com/users/23951/"
] | I don't believe there is a way to *prevent* it from happening, apart from statically assigning the DNS servers on the VPN connection.
To change the order in which DNS servers are queried, one is supposed to be able to change the interface binding order as per <https://superuser.com/a/314379/120267>, but that doesn't s... | As of 2017 this is now possible if its based on **OpenVPN**
Add a line to your client config file of
>
> pull-filter ignore "dhcp-option DNS "
>
>
>
and it will ignore all pushed config lines that start with the quoted text.
The three action keywords are `accept` `ignore` `reject`.
I have not discovered a use ... |
392,269 | I have a customer that uses a VPN connection, however it automatically configures my DNS settings to a non-existent DNS server, meaning every DNS resolution times out until the alternative is tried, which really slows down all Internet traffic.
Is there a way that I can prevent an application from overriding my DNS se... | 2012/02/21 | [
"https://superuser.com/questions/392269",
"https://superuser.com",
"https://superuser.com/users/23951/"
] | Unfortunately netsh can not delete dns servers assigned by dhcp. But this can be done by clearing DhcpNameServer parameter in
```
HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\{id}
```
registry key. | >
> Is there a way that I can prevent an application from overriding my DNS settings (without enabling UAC)?
>
>
>
At least there is no easy way to do that.
>
> Alternatively, is there a way that I can set up some kind of local routing that says 'when a DNS request for IP address A comes in, actually use IP add... |
392,269 | I have a customer that uses a VPN connection, however it automatically configures my DNS settings to a non-existent DNS server, meaning every DNS resolution times out until the alternative is tried, which really slows down all Internet traffic.
Is there a way that I can prevent an application from overriding my DNS se... | 2012/02/21 | [
"https://superuser.com/questions/392269",
"https://superuser.com",
"https://superuser.com/users/23951/"
] | Unfortunately netsh can not delete dns servers assigned by dhcp. But this can be done by clearing DhcpNameServer parameter in
```
HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\{id}
```
registry key. | Can you check the status of the 'Use default gateway on remote network' checkbox. This is found by opening the properties of your VPN connection and go to Networking tab and select either TCP/IP v4 or TCP/IP V6 and then select properties and then advanced.
This may be enabled which could mean that all internet traffic ... |
392,269 | I have a customer that uses a VPN connection, however it automatically configures my DNS settings to a non-existent DNS server, meaning every DNS resolution times out until the alternative is tried, which really slows down all Internet traffic.
Is there a way that I can prevent an application from overriding my DNS se... | 2012/02/21 | [
"https://superuser.com/questions/392269",
"https://superuser.com",
"https://superuser.com/users/23951/"
] | I don't believe there is a way to *prevent* it from happening, apart from statically assigning the DNS servers on the VPN connection.
To change the order in which DNS servers are queried, one is supposed to be able to change the interface binding order as per <https://superuser.com/a/314379/120267>, but that doesn't s... | I had a similar problem; connecting to a VPN server would override my workstation's (remote VPN client) DNS so that the local LAN DNS would be obscured. I described the problem more in detail on [Stackoverflow side](https://stackoverflow.com/questions/14078824/how-to-prevent-openvpn-from-overriding-local-dns) before I ... |
392,269 | I have a customer that uses a VPN connection, however it automatically configures my DNS settings to a non-existent DNS server, meaning every DNS resolution times out until the alternative is tried, which really slows down all Internet traffic.
Is there a way that I can prevent an application from overriding my DNS se... | 2012/02/21 | [
"https://superuser.com/questions/392269",
"https://superuser.com",
"https://superuser.com/users/23951/"
] | I don't believe there is a way to *prevent* it from happening, apart from statically assigning the DNS servers on the VPN connection.
To change the order in which DNS servers are queried, one is supposed to be able to change the interface binding order as per <https://superuser.com/a/314379/120267>, but that doesn't s... | I simply remove this option from the client VPN config
*setenv opt block-outside-dns*
It resolved the issue |
392,269 | I have a customer that uses a VPN connection, however it automatically configures my DNS settings to a non-existent DNS server, meaning every DNS resolution times out until the alternative is tried, which really slows down all Internet traffic.
Is there a way that I can prevent an application from overriding my DNS se... | 2012/02/21 | [
"https://superuser.com/questions/392269",
"https://superuser.com",
"https://superuser.com/users/23951/"
] | I don't believe there is a way to *prevent* it from happening, apart from statically assigning the DNS servers on the VPN connection.
To change the order in which DNS servers are queried, one is supposed to be able to change the interface binding order as per <https://superuser.com/a/314379/120267>, but that doesn't s... | Unfortunately netsh can not delete dns servers assigned by dhcp. But this can be done by clearing DhcpNameServer parameter in
```
HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\{id}
```
registry key. |
392,269 | I have a customer that uses a VPN connection, however it automatically configures my DNS settings to a non-existent DNS server, meaning every DNS resolution times out until the alternative is tried, which really slows down all Internet traffic.
Is there a way that I can prevent an application from overriding my DNS se... | 2012/02/21 | [
"https://superuser.com/questions/392269",
"https://superuser.com",
"https://superuser.com/users/23951/"
] | I don't believe there is a way to *prevent* it from happening, apart from statically assigning the DNS servers on the VPN connection.
To change the order in which DNS servers are queried, one is supposed to be able to change the interface binding order as per <https://superuser.com/a/314379/120267>, but that doesn't s... | Can you check the status of the 'Use default gateway on remote network' checkbox. This is found by opening the properties of your VPN connection and go to Networking tab and select either TCP/IP v4 or TCP/IP V6 and then select properties and then advanced.
This may be enabled which could mean that all internet traffic ... |
392,269 | I have a customer that uses a VPN connection, however it automatically configures my DNS settings to a non-existent DNS server, meaning every DNS resolution times out until the alternative is tried, which really slows down all Internet traffic.
Is there a way that I can prevent an application from overriding my DNS se... | 2012/02/21 | [
"https://superuser.com/questions/392269",
"https://superuser.com",
"https://superuser.com/users/23951/"
] | Unfortunately netsh can not delete dns servers assigned by dhcp. But this can be done by clearing DhcpNameServer parameter in
```
HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\{id}
```
registry key. | I simply remove this option from the client VPN config
*setenv opt block-outside-dns*
It resolved the issue |
392,269 | I have a customer that uses a VPN connection, however it automatically configures my DNS settings to a non-existent DNS server, meaning every DNS resolution times out until the alternative is tried, which really slows down all Internet traffic.
Is there a way that I can prevent an application from overriding my DNS se... | 2012/02/21 | [
"https://superuser.com/questions/392269",
"https://superuser.com",
"https://superuser.com/users/23951/"
] | I had a similar problem; connecting to a VPN server would override my workstation's (remote VPN client) DNS so that the local LAN DNS would be obscured. I described the problem more in detail on [Stackoverflow side](https://stackoverflow.com/questions/14078824/how-to-prevent-openvpn-from-overriding-local-dns) before I ... | I simply remove this option from the client VPN config
*setenv opt block-outside-dns*
It resolved the issue |
392,269 | I have a customer that uses a VPN connection, however it automatically configures my DNS settings to a non-existent DNS server, meaning every DNS resolution times out until the alternative is tried, which really slows down all Internet traffic.
Is there a way that I can prevent an application from overriding my DNS se... | 2012/02/21 | [
"https://superuser.com/questions/392269",
"https://superuser.com",
"https://superuser.com/users/23951/"
] | Unfortunately netsh can not delete dns servers assigned by dhcp. But this can be done by clearing DhcpNameServer parameter in
```
HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\{id}
```
registry key. | As of 2017 this is now possible if its based on **OpenVPN**
Add a line to your client config file of
>
> pull-filter ignore "dhcp-option DNS "
>
>
>
and it will ignore all pushed config lines that start with the quoted text.
The three action keywords are `accept` `ignore` `reject`.
I have not discovered a use ... |
48,931,483 | I am using Laravel 5.6
I have 2 tables. User Table and Role Table in migration folder. Also installed Laravel Passport
When I ran this command `php artisan migrate`, I saw the auth tables created first and then role table and user table.
Can I run role and user table first because I want to put reference constraints... | 2018/02/22 | [
"https://Stackoverflow.com/questions/48931483",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/726802/"
] | I don't know the exact stuff Laravel Passport does, but in general the Migrator classes are ran in alphabetic order. Given the fact that they are prefixed with the generation timestamp, it should be enough just renaming the role migrator, to having a timstamp before the user migrator.
When you do this, don't forget to... | Laravel Migration run on the alpahbetical order .
Consider an example where you Auth table with the migration named as
```
2018_03_18_12_create_auth_tables.php
```
User table migration as
```
2018_03_18_13_create_users_tables.php
```
In this case the Auth table will run first and User table will run second due ... |
30,654 | How would you describe the **Power Law** in simple words? The Wikipedia entry is too long and verbose. I would like to understand the concept of the power law and how and why it shows up everywhere.
For example, a recent Economist article **[Cry havoc! And let slip the maths of war](http://www.economist.com/node/18483... | 2011/04/03 | [
"https://math.stackexchange.com/questions/30654",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/8941/"
] | Just to expand on Ross Millikan's answer. Power-laws are important and pop up all the time because they obey [scale-invariance](http://en.wikipedia.org/wiki/Scale_invariance). Scale-invariance is the property that a system behaves the same when all length-scales are multiplied with a common factor. System show scale in... | The power law just is the equation $f(x)=ax^k$ (the Wikipedia article allows some deviation.) If $k \lt 0$ it says that big events get less likely than small events and how fast. It shows up many places in science, and finding the exponent is often a clue to the underlying laws. It also shows up in the real world. [Thi... |
30,654 | How would you describe the **Power Law** in simple words? The Wikipedia entry is too long and verbose. I would like to understand the concept of the power law and how and why it shows up everywhere.
For example, a recent Economist article **[Cry havoc! And let slip the maths of war](http://www.economist.com/node/18483... | 2011/04/03 | [
"https://math.stackexchange.com/questions/30654",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/8941/"
] | As Ross Millikan points out, a function $p(x)$ obeys a power law if
$$p(x) \propto x^\alpha, \ \ \alpha \in \mathbb{R}$$
There are many real-world [examples](http://en.wikipedia.org/wiki/Power_law#Examples_of_power_law_functions) of power law functions. For example, [Newtonian gravity](http://en.wikipedia.org/wiki/Ne... | The power law just is the equation $f(x)=ax^k$ (the Wikipedia article allows some deviation.) If $k \lt 0$ it says that big events get less likely than small events and how fast. It shows up many places in science, and finding the exponent is often a clue to the underlying laws. It also shows up in the real world. [Thi... |
30,654 | How would you describe the **Power Law** in simple words? The Wikipedia entry is too long and verbose. I would like to understand the concept of the power law and how and why it shows up everywhere.
For example, a recent Economist article **[Cry havoc! And let slip the maths of war](http://www.economist.com/node/18483... | 2011/04/03 | [
"https://math.stackexchange.com/questions/30654",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/8941/"
] | The power law just is the equation $f(x)=ax^k$ (the Wikipedia article allows some deviation.) If $k \lt 0$ it says that big events get less likely than small events and how fast. It shows up many places in science, and finding the exponent is often a clue to the underlying laws. It also shows up in the real world. [Thi... | An easy to read article with data: <http://www.jmir.org/2015/6/e160/> |
30,654 | How would you describe the **Power Law** in simple words? The Wikipedia entry is too long and verbose. I would like to understand the concept of the power law and how and why it shows up everywhere.
For example, a recent Economist article **[Cry havoc! And let slip the maths of war](http://www.economist.com/node/18483... | 2011/04/03 | [
"https://math.stackexchange.com/questions/30654",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/8941/"
] | As Ross Millikan points out, a function $p(x)$ obeys a power law if
$$p(x) \propto x^\alpha, \ \ \alpha \in \mathbb{R}$$
There are many real-world [examples](http://en.wikipedia.org/wiki/Power_law#Examples_of_power_law_functions) of power law functions. For example, [Newtonian gravity](http://en.wikipedia.org/wiki/Ne... | Just to expand on Ross Millikan's answer. Power-laws are important and pop up all the time because they obey [scale-invariance](http://en.wikipedia.org/wiki/Scale_invariance). Scale-invariance is the property that a system behaves the same when all length-scales are multiplied with a common factor. System show scale in... |
30,654 | How would you describe the **Power Law** in simple words? The Wikipedia entry is too long and verbose. I would like to understand the concept of the power law and how and why it shows up everywhere.
For example, a recent Economist article **[Cry havoc! And let slip the maths of war](http://www.economist.com/node/18483... | 2011/04/03 | [
"https://math.stackexchange.com/questions/30654",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/8941/"
] | Just to expand on Ross Millikan's answer. Power-laws are important and pop up all the time because they obey [scale-invariance](http://en.wikipedia.org/wiki/Scale_invariance). Scale-invariance is the property that a system behaves the same when all length-scales are multiplied with a common factor. System show scale in... | An easy to read article with data: <http://www.jmir.org/2015/6/e160/> |
30,654 | How would you describe the **Power Law** in simple words? The Wikipedia entry is too long and verbose. I would like to understand the concept of the power law and how and why it shows up everywhere.
For example, a recent Economist article **[Cry havoc! And let slip the maths of war](http://www.economist.com/node/18483... | 2011/04/03 | [
"https://math.stackexchange.com/questions/30654",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/8941/"
] | As Ross Millikan points out, a function $p(x)$ obeys a power law if
$$p(x) \propto x^\alpha, \ \ \alpha \in \mathbb{R}$$
There are many real-world [examples](http://en.wikipedia.org/wiki/Power_law#Examples_of_power_law_functions) of power law functions. For example, [Newtonian gravity](http://en.wikipedia.org/wiki/Ne... | An easy to read article with data: <http://www.jmir.org/2015/6/e160/> |
3,513,134 | Suppose that $f : \mathbb{R} →\mathbb{R}$ and $\lim\_{x\to a} f(x) = L$ (L-finite). Show that $f$ must be bounded in an open interval centered at $x = a$.
---
By definition of function limits.
$\forall\epsilon >0$, there $\exists \delta \in \mathbb{R}$ s.t if $x\in D$ and $0<|x-a|< \delta$, then $|f(x)-L|<\epsilon$
... | 2020/01/18 | [
"https://math.stackexchange.com/questions/3513134",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/553585/"
] | The open interval is precisely the values of $x$ for which $|x-a|<\delta$; if you restrict it to positive absolute values, you punch a hole in the open interval at $a$. Since the function has a definite value at $a$, however, if you've shown that the function is bounded for the punctured interval, you can extend the bo... | If $|f(x)| \leq M$ for $0<|x-a|<\delta$ then $|f(x)| \leq C$ for all $x \in (a-\delta, a+\delta)$ where $C$ is the maximum of $M$ and $|f(a)|$. |
37,680,473 | I want to install a Hybris Commerce 5.7 on an Azure VM (Windows Server 2012, D13 configuration) for testing. The install.bat -r b2c\_acc command builds successfull, but on install.bat -r b2c\_acc **initialize** I get the following error:
```
[java] ERROR [main] [DefaultSolrServerService] de.hybris.platform.solrse... | 2016/06/07 | [
"https://Stackoverflow.com/questions/37680473",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3629694/"
] | I am pretty sure you have something using your port 8983, I would say it's probably another Solr instance. Try accessing
<http://localhost:8983/solr>
If you're able to access the solr server, that's your problem. You can stop it running this command from hybris/bin/platform:
```
ant stopSolrServer
```
To avoid t... | Found the solution: Using the pre-installed by Azure Administrator user the initialize process built fine. Don't know why it wouldn't work with my other account, which is set to admin. |
37,499,567 | I'm trying to interface to a classic HD44780 LCD.
I have implemented local ram to which I write the data I wish to show up on the display.
I have defined the ram in this way:
```
type ram_type is array (0 to (16*2)-1) of std_logic_vector(7 downto 0);
signal lcd_mem : ram_type;
```
I've tried initializing the ram in... | 2016/05/28 | [
"https://Stackoverflow.com/questions/37499567",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4340598/"
] | Yes there is. Note that your definition of `ram_type` is an array of `std_logic_vector`. And `x"45_72_72_6F_72_73_3A"` is a hex string literal. These are not the same type, hence your error.
So, you have to put the value into an array of vectors. Such as:
```
lcd_mem(0 to 6) <= (0 => x"45", 1 => x"72", 2 => x"72", 3 ... | Above answer is good. May also code as follows:
type init\_type is array (0 to 6) of std\_logic\_vector(7 downto 0);
constant c\_lcd\_int : init\_type:= (45,72,72,6F,72,73,3A);
lcd\_mem(0 to 6) <= c\_lcd\_int; |
2,862,370 | I'm building a Route Planner Webapp using Spring/Hibernate/Tomcat and a mysql database,
I have a database containing read only data, such as Bus Stop Coordinates, Bus times which is never updated. I'm trying to make the app run faster, each time the application is run it will preform approx 1000 reads to the database ... | 2010/05/19 | [
"https://Stackoverflow.com/questions/2862370",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/310783/"
] | >
> I have setup a Ehcache which greatly improves the read from database times. I'm now setting terracotta + Ehcache distributed caching to share the cache with multiple Tomcat JVMs. This seems a bit complicated.
>
>
>
Since your data are read-only, I'm tempted to say that you could live without [distributed and r... | First of all mongodb is not a cache per se. its a persistent data store just like mysql is a persistent data store.
so now your question boils down to "should i use ehcache or redis". having used ehcache i can tell you that is a pretty good solution for a distributed cache that does replication/clustering, cache inval... |
2,862,370 | I'm building a Route Planner Webapp using Spring/Hibernate/Tomcat and a mysql database,
I have a database containing read only data, such as Bus Stop Coordinates, Bus times which is never updated. I'm trying to make the app run faster, each time the application is run it will preform approx 1000 reads to the database ... | 2010/05/19 | [
"https://Stackoverflow.com/questions/2862370",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/310783/"
] | if you want to try routing, you even might look at Neo4j, see [the blog on using an A\* algo for](http://blogs.neotechnology.com/peter/2010/04/cool-spatial-algos-with-neo4j-part1-routing-with-a.html) | First of all mongodb is not a cache per se. its a persistent data store just like mysql is a persistent data store.
so now your question boils down to "should i use ehcache or redis". having used ehcache i can tell you that is a pretty good solution for a distributed cache that does replication/clustering, cache inval... |
16,930,121 | I am trying to build a simple application using MapKit that will automatically search for a specific place when the app launches and drop pin(s) on the map at the locations(s). I am seeing all sorts of ways to load locations (lat/lon, etc), but nothing that lets me search for a specific business name, restaurant name, ... | 2013/06/05 | [
"https://Stackoverflow.com/questions/16930121",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2453899/"
] | iOS >= 6.1 provides [MKLocalSearch](http://developer.apple.com/library/ios/#documentation/MapKit/Reference/MKLocalSearch/Reference/Reference.html), [MKLocalSearchRequest](http://developer.apple.com/library/ios/#documentation/MapKit/Reference/MKLocalSearchRequest_class/Reference/Reference.html) to search for natural lan... | Make the following steps to display nearest places.
Using google API find the Nearest Places [Google Places API](https://developers.google.com/places/documentation/search)
The google API provide LAt and Long and address Informations.
Then Store the LAt and Long Values to Array then USing this lat and long values you... |
16,930,121 | I am trying to build a simple application using MapKit that will automatically search for a specific place when the app launches and drop pin(s) on the map at the locations(s). I am seeing all sorts of ways to load locations (lat/lon, etc), but nothing that lets me search for a specific business name, restaurant name, ... | 2013/06/05 | [
"https://Stackoverflow.com/questions/16930121",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2453899/"
] | iOS >= 6.1 provides [MKLocalSearch](http://developer.apple.com/library/ios/#documentation/MapKit/Reference/MKLocalSearch/Reference/Reference.html), [MKLocalSearchRequest](http://developer.apple.com/library/ios/#documentation/MapKit/Reference/MKLocalSearchRequest_class/Reference/Reference.html) to search for natural lan... | i know its late but hope this helps!
```
[super viewDidLoad];
[self.searchDisplayController setDelegate:self];
[self.ibSearchBar setDelegate:self];
self.ibMapView.delegate=self;
// Zoom the map to current location.
[self.ibMapView setShowsUserLocation:YES];
[self.ibMapView setUserInteractionEnabled:YES];
[self.ibMap... |
16,930,121 | I am trying to build a simple application using MapKit that will automatically search for a specific place when the app launches and drop pin(s) on the map at the locations(s). I am seeing all sorts of ways to load locations (lat/lon, etc), but nothing that lets me search for a specific business name, restaurant name, ... | 2013/06/05 | [
"https://Stackoverflow.com/questions/16930121",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2453899/"
] | i know its late but hope this helps!
```
[super viewDidLoad];
[self.searchDisplayController setDelegate:self];
[self.ibSearchBar setDelegate:self];
self.ibMapView.delegate=self;
// Zoom the map to current location.
[self.ibMapView setShowsUserLocation:YES];
[self.ibMapView setUserInteractionEnabled:YES];
[self.ibMap... | Make the following steps to display nearest places.
Using google API find the Nearest Places [Google Places API](https://developers.google.com/places/documentation/search)
The google API provide LAt and Long and address Informations.
Then Store the LAt and Long Values to Array then USing this lat and long values you... |
39,183,275 | So this question is sort of one of translation. I am new to C++, and was looking through the class documentation. However, it looks like finding the answer to my question is a bit hard via the documentation.
I have code for generating a random number between 0 and 1 in C++: (obtained from [here](http://en.cppreferenc... | 2016/08/27 | [
"https://Stackoverflow.com/questions/39183275",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3834415/"
] | Seems like you just need some form of probability generation class, see below for a basic implementation which meets your question requirements:
```
template<class Ty = double,
class = std::enable_if_t<std::is_floating_point<Ty>::value>
> class random_probability_generator {
public:
// default constructor uses... | You can create a class that holds a random number generator as a private member variable (like `std::mt19937`) and seeds it in the constructor. Your `next` function could just invoke the stored generator to get the next value (applying whatever distribution you want (if any) of course).
This is not very complicated, s... |
10,556,425 | I am using the following regular expression.
(?=.+[a-z])(?=.+[A-Z])(?=.+[^a-zA-Z]).{8,}
my goal is to have a password that has 3 of the 4 properties below
upper case character, lower case character, number, special character
I am using <http://rubular.com/r/i26nwsTcaU> and <http://regexlib.com/RETester.aspx> to test... | 2012/05/11 | [
"https://Stackoverflow.com/questions/10556425",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/993802/"
] | Essentially, the `.+` subexpressions are to blame, they should be `.*`. Otherwise, the lookahead part looks for lower case, upper case or non-alpha but a character of each corresponding type does not count if it is the first one in string. So, you are validating not the password, but the password with first char trunca... | Your regex right now says you must have 1 or more lowercase characters, followed by 1 or more upper case characters followed by 1 or more upper or lowercase characters, followed by 8 characters or more.
Regex can't do AND unless you specify where a particular character appears. You basically need to split each part o... |
10,556,425 | I am using the following regular expression.
(?=.+[a-z])(?=.+[A-Z])(?=.+[^a-zA-Z]).{8,}
my goal is to have a password that has 3 of the 4 properties below
upper case character, lower case character, number, special character
I am using <http://rubular.com/r/i26nwsTcaU> and <http://regexlib.com/RETester.aspx> to test... | 2012/05/11 | [
"https://Stackoverflow.com/questions/10556425",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/993802/"
] | Essentially, the `.+` subexpressions are to blame, they should be `.*`. Otherwise, the lookahead part looks for lower case, upper case or non-alpha but a character of each corresponding type does not count if it is the first one in string. So, you are validating not the password, but the password with first char trunca... | As I said in a comment, position-0 capital letters are being ignored.
Here's a regex to which all four passwords match.
```
(?=.+\\d)(?=.+[a-z])(?=\\w*[A-Z]).{8,}
``` |
10,556,425 | I am using the following regular expression.
(?=.+[a-z])(?=.+[A-Z])(?=.+[^a-zA-Z]).{8,}
my goal is to have a password that has 3 of the 4 properties below
upper case character, lower case character, number, special character
I am using <http://rubular.com/r/i26nwsTcaU> and <http://regexlib.com/RETester.aspx> to test... | 2012/05/11 | [
"https://Stackoverflow.com/questions/10556425",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/993802/"
] | Essentially, the `.+` subexpressions are to blame, they should be `.*`. Otherwise, the lookahead part looks for lower case, upper case or non-alpha but a character of each corresponding type does not count if it is the first one in string. So, you are validating not the password, but the password with first char trunca... | I wouldn't use such a regex.
* it is hard to understand
* hard to debug
* hard to extend
* you can't do much with its result
If you like to tell the client what is wrong with his password, you have investigate the password again. In real world environments you might want to support characters from foreign locales.
... |
43,299,737 | I don't know what's going on with the `FileWriter`, because it only writes out the HTML part, but nothing from the `String` array `content`. `content` stores a lot of long `String`s. Is it because of Java's garbage collector?
I print out the `content` and everything is there, but `FileWrter` did not write anything fr... | 2017/04/08 | [
"https://Stackoverflow.com/questions/43299737",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7838345/"
] | You code is working. The only thing that prevents `content` to be written - empty `content`. It has no elements. | Your code iis basically correct, maybe the content array is empty.
The following is in modernized java style.
```
public void writeHtml(String[] content) {
Path file = Paths.get("final.html");
try (BufferedWriter fw = Files.newBufferedWriter(file, StandardCharsets.UTF_8)) {
fw.write("<!DOCTYPE html>\n"... |
2,388 | This question has been closed as general reference: [Who is the cat in chapter 17 of Prisoner of Azkaban?](https://scifi.stackexchange.com/questions/26481/who-was-the-cat-in-the-chapter-17-of-3rd-book)
I think the question deserves downvotes but not close votes. If you see comments there, CVers have chosen Wikia and G... | 2012/11/03 | [
"https://scifi.meta.stackexchange.com/questions/2388",
"https://scifi.meta.stackexchange.com",
"https://scifi.meta.stackexchange.com/users/931/"
] | The Wikipedia entry for [Prisoner of Azkaban](http://en.wikipedia.org/wiki/Prisoner_of_azkaban) describes clearly the relevant plot from chapter 17.
>
> While at his cabin, **Hermione discovers *Scabbers* in Hagrid's milk jug**.
> They leave, and Buckbeak is executed. As Ron, Harry, and Hermione are
> leaving Hagri... | >
> [We should only consider as general reference questions that can be easily answered by typing all or part of the question into Google](https://scifi.meta.stackexchange.com/q/689/3267)
>
>
>
[Who is the cat in Prisoner of Azkaban](https://www.google.com/#hl=en&sugexp=les;&gs_nf=3&tok=gtK427mJW24YjdkLF-IbcA&cp=3... |
29,642 | I noticed in the book "A Beautiful Mind", by Sylvia Nasar, that a recommendation letter, for PhD applications, written for John F. Nash runs as follows: *This man is a genius.*
Then, out of curiosity, I wonder that if such reference letters for PhD applications work in the present days?
Image taken from the [Graduat... | 2014/10/09 | [
"https://academia.stackexchange.com/questions/29642",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/18107/"
] | Even though the event that inspired this questions may or may not have actually happened, the question is still a valid one.
I suspect it greatly depends on who wrote the recommendation. If the person writing that recommendation is a great authority in this field and is known for not giving praise easily, then such a... | A letter that simply states "This man is a genius" is not helpful for judging the likelihood of a PhD applicant being successful since it takes a lot more than genius to succeed at a PhD and genius is not a requirement for success. Further, the skills required to become "academically famous" do not necessarily make you... |
29,642 | I noticed in the book "A Beautiful Mind", by Sylvia Nasar, that a recommendation letter, for PhD applications, written for John F. Nash runs as follows: *This man is a genius.*
Then, out of curiosity, I wonder that if such reference letters for PhD applications work in the present days?
Image taken from the [Graduat... | 2014/10/09 | [
"https://academia.stackexchange.com/questions/29642",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/18107/"
] | Even though the event that inspired this questions may or may not have actually happened, the question is still a valid one.
I suspect it greatly depends on who wrote the recommendation. If the person writing that recommendation is a great authority in this field and is known for not giving praise easily, then such a... | In my experience, most communities of high achieving people don't openly value intelligence. Generally they dismiss it and say that hard work and luck is what's really important. And they would laugh at you if you wrote your IQ score on your resume.
If someone said "Person X is very smart" and didn't write anything el... |
29,642 | I noticed in the book "A Beautiful Mind", by Sylvia Nasar, that a recommendation letter, for PhD applications, written for John F. Nash runs as follows: *This man is a genius.*
Then, out of curiosity, I wonder that if such reference letters for PhD applications work in the present days?
Image taken from the [Graduat... | 2014/10/09 | [
"https://academia.stackexchange.com/questions/29642",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/18107/"
] | A letter that simply states "This man is a genius" is not helpful for judging the likelihood of a PhD applicant being successful since it takes a lot more than genius to succeed at a PhD and genius is not a requirement for success. Further, the skills required to become "academically famous" do not necessarily make you... | In my experience, most communities of high achieving people don't openly value intelligence. Generally they dismiss it and say that hard work and luck is what's really important. And they would laugh at you if you wrote your IQ score on your resume.
If someone said "Person X is very smart" and didn't write anything el... |
582,190 | The compiler says "Package amsmath Error: \begin{aligned} allowed only in math mode." which I don't understand because "aligned" is inside an "equation" which per se is math mode.
```
\documentclass{article}
\usepackage{amsmath}
\usepackage{adjustbox}
\usepackage[utf8]{inputenc}
\begin{document}
\begin{adjustbox}{m... | 2021/02/06 | [
"https://tex.stackexchange.com/questions/582190",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/216807/"
] | An easy way to do it could be using tikz matrix library. That an a couple of lines and you have it.
```
\documentclass {standalone}
\usepackage {amssymb}
\usepackage {tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}[line cap=round,line join=round]
\def\sep{0.3cm}
\matrix(D)[matrix of nodes... | With `nicematrix` and Tikz.
```
\documentclass{article}
\usepackage{amssymb}
\usepackage{nicematrix}
\usepackage{tikz}
\begin{document}
\begingroup
\setlength{\arraycolsep}{8pt}
\setlength{\extrarowheight}{4mm}
$\begin{NiceMatrix}[xdots/shorten=6pt]
|\alpha|+|\beta|=0 & \Cdots & \lambda_{1,0} & \lam... |
56,961,159 | I am a python beginner going over a tutorial on neural networks and the PY torch module. I don't quite understand the behavior of this line.
```
import torch.nn as nn
loss = nn.MSELoss()
print(loss)
>>MSELoss()
```
Since nn.MSELoss is a class, why does calling it to the variable loss not instantiate it as a clas... | 2019/07/09 | [
"https://Stackoverflow.com/questions/56961159",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11761984/"
] | Lots of questions.
For a reference, the source code is in `src/backend/access/transam/commit_ts.c`.
1. I am not sure if it can be guaranteed that a later commit log sequence number implies a later timestamp. I would certainly not rely totally on it if the system clock can jump backwards due to time adjustments.
2. Th... | Laurenz, first off, you're a champion for digging in and helping me out. **Thank you.** For background, I've asked this question in more detail on a few of the PG mailing lists, and got zero responses. I think it was because my complete question was too long.
I tried to be shorter here and, sadly, have not explained ... |
56,961,159 | I am a python beginner going over a tutorial on neural networks and the PY torch module. I don't quite understand the behavior of this line.
```
import torch.nn as nn
loss = nn.MSELoss()
print(loss)
>>MSELoss()
```
Since nn.MSELoss is a class, why does calling it to the variable loss not instantiate it as a clas... | 2019/07/09 | [
"https://Stackoverflow.com/questions/56961159",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11761984/"
] | As this subject doesn't seem to show up in the archives very much, I want to add a bit of detail before moving on. I asked related questions on several lists, forums, and by direct communication. Several people were kind enough to review the source code, provide historical background, and clear this up for me. Hopefull... | Lots of questions.
For a reference, the source code is in `src/backend/access/transam/commit_ts.c`.
1. I am not sure if it can be guaranteed that a later commit log sequence number implies a later timestamp. I would certainly not rely totally on it if the system clock can jump backwards due to time adjustments.
2. Th... |
56,961,159 | I am a python beginner going over a tutorial on neural networks and the PY torch module. I don't quite understand the behavior of this line.
```
import torch.nn as nn
loss = nn.MSELoss()
print(loss)
>>MSELoss()
```
Since nn.MSELoss is a class, why does calling it to the variable loss not instantiate it as a clas... | 2019/07/09 | [
"https://Stackoverflow.com/questions/56961159",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11761984/"
] | As this subject doesn't seem to show up in the archives very much, I want to add a bit of detail before moving on. I asked related questions on several lists, forums, and by direct communication. Several people were kind enough to review the source code, provide historical background, and clear this up for me. Hopefull... | Laurenz, first off, you're a champion for digging in and helping me out. **Thank you.** For background, I've asked this question in more detail on a few of the PG mailing lists, and got zero responses. I think it was because my complete question was too long.
I tried to be shorter here and, sadly, have not explained ... |
120,940 | I am creating a resumé. I want to know whether mentioning stackoverflow profile counts for much in terms of interview factors, e.g. showing my knowledgeability and performance. | 2012/02/01 | [
"https://meta.stackexchange.com/questions/120940",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/177840/"
] | It entirely depends on the person who is going to interview you, I guess. And of course, what your profile looks like. In general, Stack Overflow has become a very well-known resource over the past years - especially in the US, there is a good chance your interviewer knows the site.
If you are referring to your [curre... | Currently the answer is No, as Pekka [already said](https://meta.stackexchange.com/a/120941/152859).
However, if and when you will gain enough reputation you will be invited to create a professional profile [here](http://careers.stackoverflow.com/). ( Stack Overflow Careers site)
This can be introduced in job intervi... |
230,222 | I am wondering if anyone could clarify my confusion on how to use JavaScript to read/filter SharePoint List items, please? As a code example from MSDN: <https://msdn.microsoft.com/en-us/library/office/hh185007(v=office.14).aspx>
In the CAML query XML, what is the FieldRef field in SharePoint List? Is it defined column... | 2017/11/15 | [
"https://sharepoint.stackexchange.com/questions/230222",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/70870/"
] | Actually, you can add a dummy field not present on the list by adding to the `ctx.ListSchema.Field` collection in `OnPreRender`. Then, when the actual rendering starts, SharePoint will just add another column on the view automatically. Then you can add something into that cell in `OnPostRender`.
Here's an example of t... | Here is some sample code I wrote for your situation. I was initially thinking about adding an actual `<td>` element to the `<table>`, however, manipulating an existing field is much easier than the DOM.
You need to first add a new placeholder field in your list. That is where the button will be rendered. You basicall... |
10,789 | I was riding late in the night and weather was colder than what we normally have.
(May not be cold for others, but it was cold for us, people used to with typical subcontinental weather. Temperature had dropped to 5 oC, which is wayyy cold for us)
While riding my way back home which takes hours, I kept on getting te... | 2016/02/04 | [
"https://outdoors.stackexchange.com/questions/10789",
"https://outdoors.stackexchange.com",
"https://outdoors.stackexchange.com/users/2303/"
] | **EDIT:** Please also read the other answer, which tells you why wrong (well perhaps not for 100% of the cases=)
This is just *my* experience: I would warm up if I felt cold and had the opportunity to do so. Sure, slowly getting cold again is not comfortable, but staying cold for an even longer time is worse.
Anothe... | I think part of what is missing in your question and the answer by flawr is core body temperature.
When you first get cold your body automatically shunts blood away from the surface of your skin to decrease heat loss. As you get colder your core body temperature falls (you could think of it like the cold sinking in, ... |
12,780,524 | I have an array with 40 elements. I just need to show from array the first set of 10 elements and then show some static row in table. After displaying that static row, I just want to show another set of 10 rows. Like wise I need to show all 40 elements. | 2012/10/08 | [
"https://Stackoverflow.com/questions/12780524",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1627627/"
] | You can try
```
$array = range(1,40);
foreach (array_chunk($array, 10) as $current)
{
foreach($current as $data)
{
// Display your Information
}
}
``` | You can try `array_slice` <http://php.net/manual/en/function.array-slice.php> |
12,780,524 | I have an array with 40 elements. I just need to show from array the first set of 10 elements and then show some static row in table. After displaying that static row, I just want to show another set of 10 rows. Like wise I need to show all 40 elements. | 2012/10/08 | [
"https://Stackoverflow.com/questions/12780524",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1627627/"
] | You can try `array_slice` <http://php.net/manual/en/function.array-slice.php> | ### Use [`array_slice()`](http://php.net/manual/en/function.array-slice.php)
>
> It returns the sequence of elements from the array array as specified by the offset and length parameters.
>
>
>
### Example:
```
<?php
$myArray = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, ... |
12,780,524 | I have an array with 40 elements. I just need to show from array the first set of 10 elements and then show some static row in table. After displaying that static row, I just want to show another set of 10 rows. Like wise I need to show all 40 elements. | 2012/10/08 | [
"https://Stackoverflow.com/questions/12780524",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1627627/"
] | You can try `array_slice` <http://php.net/manual/en/function.array-slice.php> | The most efficient way is using the [**modulus**](http://php.net/manual/en/language.operators.arithmetic.php) operator, like so:
```
$tot = count($array);
for($i=0;$i<$tot;$i++) {
echo $array[$i] . '<br>';
if(($i+1) % 10 == 0) {
echo '--- TEN GROUP --- <br>';
}
}
```
Example output:
```
text_1
text_2... |
12,780,524 | I have an array with 40 elements. I just need to show from array the first set of 10 elements and then show some static row in table. After displaying that static row, I just want to show another set of 10 rows. Like wise I need to show all 40 elements. | 2012/10/08 | [
"https://Stackoverflow.com/questions/12780524",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1627627/"
] | You can try
```
$array = range(1,40);
foreach (array_chunk($array, 10) as $current)
{
foreach($current as $data)
{
// Display your Information
}
}
``` | ### Use [`array_slice()`](http://php.net/manual/en/function.array-slice.php)
>
> It returns the sequence of elements from the array array as specified by the offset and length parameters.
>
>
>
### Example:
```
<?php
$myArray = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, ... |
12,780,524 | I have an array with 40 elements. I just need to show from array the first set of 10 elements and then show some static row in table. After displaying that static row, I just want to show another set of 10 rows. Like wise I need to show all 40 elements. | 2012/10/08 | [
"https://Stackoverflow.com/questions/12780524",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1627627/"
] | You can try
```
$array = range(1,40);
foreach (array_chunk($array, 10) as $current)
{
foreach($current as $data)
{
// Display your Information
}
}
``` | The most efficient way is using the [**modulus**](http://php.net/manual/en/language.operators.arithmetic.php) operator, like so:
```
$tot = count($array);
for($i=0;$i<$tot;$i++) {
echo $array[$i] . '<br>';
if(($i+1) % 10 == 0) {
echo '--- TEN GROUP --- <br>';
}
}
```
Example output:
```
text_1
text_2... |
29,698,240 | I have a bunch of `EditTexts` and I want to pass data gotten from the `EditTexts` to another `Activity` using `Intents`. Whenever I run the app, it gets a runtime error or something like that and crashes. The Logcat says my application is doing too much work on the thread. Is there any way around this?
Here's my code... | 2015/04/17 | [
"https://Stackoverflow.com/questions/29698240",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4758643/"
] | you can pass data upto 1mb but log says its due to NumberFormatException | As such there is no limit on the number of extras defined.
You can use the number of extras you are currently using.
But the issue is related to NumberFormatException.
This is not related to Android at all.
Check the line of your program on which exception is happening.
Line number 43 of your program is causing issue.
... |
11,423,725 | Here is the code I have. I'm getting a red line under `new MainFragment();` with the error `Type mismatch: cannot convert from WishlistFragment to Fragment`:
```
Fragment newfragment = new MainFragment();
```
Here is what my MainFragment.java file looks like:
```
public class MainFragment extends Fragment {
... | 2012/07/11 | [
"https://Stackoverflow.com/questions/11423725",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/546509/"
] | Make sure that both places are importing the same `Fragment` class. It feels a bit like in one place you are importing `android.app.Fragment` (the native API Level 11 version of fragments) and in the other places you are importing `android.support.v4.app.Fragment` (the fragments from the Android Support package). | Figured out the issue.... my MainActivity.java file was using:
```
import android.support.v4.app.Fragment;
```
and my MainFragment.java file was using:
```
import android.app.Fragment;
```
So there was a mismatch. I am using ICS 4.0 and higher as my lowest API version. Changing everything to import to the v4 API ... |
40,579,894 | I am making a custom grid-view in android studio, every cell consist of an image-view and a text-view, but it gives an extra space between the the top and the image, and between the image and the text, see the [Image](https://i.stack.imgur.com/zRZWV.png). i want to get rid of that extra space, but i can't figure out th... | 2016/11/13 | [
"https://Stackoverflow.com/questions/40579894",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6770022/"
] | remove weightsum and in your imageview just add
```
android:adjustViewBounds="true"
android:scaleType="fitXY"
```
and if you want to use weightsum then try to add layoutweight for imageview and textview | try implemets
```
android:adjustViewBounds="true"
``` |
40,579,894 | I am making a custom grid-view in android studio, every cell consist of an image-view and a text-view, but it gives an extra space between the the top and the image, and between the image and the text, see the [Image](https://i.stack.imgur.com/zRZWV.png). i want to get rid of that extra space, but i can't figure out th... | 2016/11/13 | [
"https://Stackoverflow.com/questions/40579894",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6770022/"
] | remove weightsum and in your imageview just add
```
android:adjustViewBounds="true"
android:scaleType="fitXY"
```
and if you want to use weightsum then try to add layoutweight for imageview and textview | Remove "android:verticalSpacing="0dip" from your code or You can try this ,
```
<GridView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mGridView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent"
android:cacheColorHin... |
33,236,469 | I have the following switch:
My groupPosition is 0 and childPosition is 1:
```
switch (groupPosition) {
case 0:
switch (childPosition) {
case 0:
if (NetworkManager.isNetworkAvailable(this)) {
new UserAwayTask().execu... | 2015/10/20 | [
"https://Stackoverflow.com/questions/33236469",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2822178/"
] | You forgot to add a `break` for the top-level `case 0`:
```
case 0:
switch (childPosition) {
case 0:
if (NetworkManager.isNetworkAvailable(this)) {
new UserAwayTask().execute();
} else
Toast.makeText(this, "Network not available", Toast.LENGTH_LONG).s... | You do not break from your outer switch case 0. Add a `break` at the closing bracket of your inner switch.
```
case 0:
switch (childPosition) {
//
} break;
``` |
33,236,469 | I have the following switch:
My groupPosition is 0 and childPosition is 1:
```
switch (groupPosition) {
case 0:
switch (childPosition) {
case 0:
if (NetworkManager.isNetworkAvailable(this)) {
new UserAwayTask().execu... | 2015/10/20 | [
"https://Stackoverflow.com/questions/33236469",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2822178/"
] | You forgot to add a `break` for the top-level `case 0`:
```
case 0:
switch (childPosition) {
case 0:
if (NetworkManager.isNetworkAvailable(this)) {
new UserAwayTask().execute();
} else
Toast.makeText(this, "Network not available", Toast.LENGTH_LONG).s... | Your are missing a break:
```
switch (groupPosition) {
case 0:
switch (childPosition) {
...
}
break; // <-- here
case 1:
selection = Employee.COL_DEPARTMENT + " IS ? COLLATE NOCASE";
selectionArgs = new String[]{valueReceived};
break;
case 2:
... |
33,236,469 | I have the following switch:
My groupPosition is 0 and childPosition is 1:
```
switch (groupPosition) {
case 0:
switch (childPosition) {
case 0:
if (NetworkManager.isNetworkAvailable(this)) {
new UserAwayTask().execu... | 2015/10/20 | [
"https://Stackoverflow.com/questions/33236469",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2822178/"
] | Your are missing a break:
```
switch (groupPosition) {
case 0:
switch (childPosition) {
...
}
break; // <-- here
case 1:
selection = Employee.COL_DEPARTMENT + " IS ? COLLATE NOCASE";
selectionArgs = new String[]{valueReceived};
break;
case 2:
... | You do not break from your outer switch case 0. Add a `break` at the closing bracket of your inner switch.
```
case 0:
switch (childPosition) {
//
} break;
``` |
1,435,959 | Does PHP have global variables that can be modified by one running script and read by another? | 2009/09/16 | [
"https://Stackoverflow.com/questions/1435959",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/41021/"
] | You can use [$\_SESSION](http://php.net/manual/en/book.session.php), i.e.:
**script1.php**
```
<?php
session_start();
$_SESSION['myVar'] = "something";
?>
```
**script2.php**
```
<?php
session_start();
echo $_SESSION['myVar'];
//something
?>
``` | I made a tiny library (~2 KB; <100 lines) that allows you to do just this: [varDx](https://github.com/rahuldottech/varDx)
It has functions to write, read, modify, check and delete data.
It implements serialization, and therefore supports all data types.
Here's how you can use it:
```
<?php
require 'varDx.php';
$dx =... |
1,435,959 | Does PHP have global variables that can be modified by one running script and read by another? | 2009/09/16 | [
"https://Stackoverflow.com/questions/1435959",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/41021/"
] | No, by design PHP is a "share nothing" architecture, which means nothing is shared between processes running at the same time or between requests running one after another. There are ways to share data, but you have to do it explicitly.
If you just want to share between 2 requests from the same user, sessions or cooki... | Not as such, but you can use cookies or sessions to maintain data for duration of a user's browsing experience, or you can write to a database or file on-disk if the information needs to persist beyond that. |
1,435,959 | Does PHP have global variables that can be modified by one running script and read by another? | 2009/09/16 | [
"https://Stackoverflow.com/questions/1435959",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/41021/"
] | No, by design PHP is a "share nothing" architecture, which means nothing is shared between processes running at the same time or between requests running one after another. There are ways to share data, but you have to do it explicitly.
If you just want to share between 2 requests from the same user, sessions or cooki... | You can use [$\_SESSION](http://php.net/manual/en/book.session.php), i.e.:
**script1.php**
```
<?php
session_start();
$_SESSION['myVar'] = "something";
?>
```
**script2.php**
```
<?php
session_start();
echo $_SESSION['myVar'];
//something
?>
``` |
1,435,959 | Does PHP have global variables that can be modified by one running script and read by another? | 2009/09/16 | [
"https://Stackoverflow.com/questions/1435959",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/41021/"
] | You can use [$\_SESSION](http://php.net/manual/en/book.session.php), i.e.:
**script1.php**
```
<?php
session_start();
$_SESSION['myVar'] = "something";
?>
```
**script2.php**
```
<?php
session_start();
echo $_SESSION['myVar'];
//something
?>
``` | Each request is handled by a php instance of its own. Global variables in php are only accessible from within the same php instance. However you can use something like the [memchached module](http://docs.php.net/memcached) to share data between different instances (which should usually be faster than writing the data t... |
1,435,959 | Does PHP have global variables that can be modified by one running script and read by another? | 2009/09/16 | [
"https://Stackoverflow.com/questions/1435959",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/41021/"
] | Not as such, but you can use cookies or sessions to maintain data for duration of a user's browsing experience, or you can write to a database or file on-disk if the information needs to persist beyond that. | I made a tiny library (~2 KB; <100 lines) that allows you to do just this: [varDx](https://github.com/rahuldottech/varDx)
It has functions to write, read, modify, check and delete data.
It implements serialization, and therefore supports all data types.
Here's how you can use it:
```
<?php
require 'varDx.php';
$dx =... |
1,435,959 | Does PHP have global variables that can be modified by one running script and read by another? | 2009/09/16 | [
"https://Stackoverflow.com/questions/1435959",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/41021/"
] | You can use [$\_SESSION](http://php.net/manual/en/book.session.php), i.e.:
**script1.php**
```
<?php
session_start();
$_SESSION['myVar'] = "something";
?>
```
**script2.php**
```
<?php
session_start();
echo $_SESSION['myVar'];
//something
?>
``` | Global variables are bad in most programming. They're especially bad in multithreaded/multiuser systems like webapps. Avoid. If you must use global variables (rather than global constants) put them in a database with transactions guarding updates.
Since you talk about different scripts though, it sounds like what you ... |
1,435,959 | Does PHP have global variables that can be modified by one running script and read by another? | 2009/09/16 | [
"https://Stackoverflow.com/questions/1435959",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/41021/"
] | Each request is handled by a php instance of its own. Global variables in php are only accessible from within the same php instance. However you can use something like the [memchached module](http://docs.php.net/memcached) to share data between different instances (which should usually be faster than writing the data t... | Global variables are bad in most programming. They're especially bad in multithreaded/multiuser systems like webapps. Avoid. If you must use global variables (rather than global constants) put them in a database with transactions guarding updates.
Since you talk about different scripts though, it sounds like what you ... |
1,435,959 | Does PHP have global variables that can be modified by one running script and read by another? | 2009/09/16 | [
"https://Stackoverflow.com/questions/1435959",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/41021/"
] | Not as such, but you can use cookies or sessions to maintain data for duration of a user's browsing experience, or you can write to a database or file on-disk if the information needs to persist beyond that. | Global variables are bad in most programming. They're especially bad in multithreaded/multiuser systems like webapps. Avoid. If you must use global variables (rather than global constants) put them in a database with transactions guarding updates.
Since you talk about different scripts though, it sounds like what you ... |
1,435,959 | Does PHP have global variables that can be modified by one running script and read by another? | 2009/09/16 | [
"https://Stackoverflow.com/questions/1435959",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/41021/"
] | Each request is handled by a php instance of its own. Global variables in php are only accessible from within the same php instance. However you can use something like the [memchached module](http://docs.php.net/memcached) to share data between different instances (which should usually be faster than writing the data t... | Not as such, but you can use cookies or sessions to maintain data for duration of a user's browsing experience, or you can write to a database or file on-disk if the information needs to persist beyond that. |
1,435,959 | Does PHP have global variables that can be modified by one running script and read by another? | 2009/09/16 | [
"https://Stackoverflow.com/questions/1435959",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/41021/"
] | You can actually do this using [shared memory](http://us.php.net/sem), or [APC](http://php.net/apc) (which is using shared memory itself). | Not as such, but you can use cookies or sessions to maintain data for duration of a user's browsing experience, or you can write to a database or file on-disk if the information needs to persist beyond that. |
22,990,945 | If you see the google maps app(the out of box app) and say you search for something like 'food', you will wither see a couple of markers as parker pins or as dots. When you tap on a dot, the dot animates and becomes a full marker pin(you can see the marker scaling up.
I was wondering if we can do the same using goole m... | 2014/04/10 | [
"https://Stackoverflow.com/questions/22990945",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1070021/"
] | Your regex is wrong for what you're trying to do. You will need negative lookahead.
Try this code:
```
$re = '/\b(?!(?:true|false|TRUE|FALSE))\w+\b/';
$str = 'I need true to allow only false specific FALSE words in a TRUE string';
$repl = preg_replace($re, "", $str);
//=> true false FALSE TRUE
```
### ... | Is this what you want?
(?=.)(true|false|TRUE|FALSE|\s\*)(?!.)

[Debuggex Demo](https://www.debuggex.com/r/8oX3ibPh6h4SQjKq)
```
$regex = '/(?=.)(true|false|TRUE|FALSE|\\s{0,})(?!.)/';
$testString = ''; // Fill this in
preg_match($re... |
22,990,945 | If you see the google maps app(the out of box app) and say you search for something like 'food', you will wither see a couple of markers as parker pins or as dots. When you tap on a dot, the dot animates and becomes a full marker pin(you can see the marker scaling up.
I was wondering if we can do the same using goole m... | 2014/04/10 | [
"https://Stackoverflow.com/questions/22990945",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1070021/"
] | In this case you don't need a regex, you can use `in_array`:
```
$arr = array('true', 'false', 'TRUE', 'FALSE');
$result = (in_array($str, $arr, true)) ? $str : '';
``` | Is this what you want?
(?=.)(true|false|TRUE|FALSE|\s\*)(?!.)

[Debuggex Demo](https://www.debuggex.com/r/8oX3ibPh6h4SQjKq)
```
$regex = '/(?=.)(true|false|TRUE|FALSE|\\s{0,})(?!.)/';
$testString = ''; // Fill this in
preg_match($re... |
22,990,945 | If you see the google maps app(the out of box app) and say you search for something like 'food', you will wither see a couple of markers as parker pins or as dots. When you tap on a dot, the dot animates and becomes a full marker pin(you can see the marker scaling up.
I was wondering if we can do the same using goole m... | 2014/04/10 | [
"https://Stackoverflow.com/questions/22990945",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1070021/"
] | Not sure I well understand your needs, but is that OK for you:
```
if (preg_match('/^(true|false|TRUE|FALSE)$/', $string, $match)) {
echo "Found : ",$m[1],"\n";
} else {
echo "Not found\n";
}
``` | Is this what you want?
(?=.)(true|false|TRUE|FALSE|\s\*)(?!.)

[Debuggex Demo](https://www.debuggex.com/r/8oX3ibPh6h4SQjKq)
```
$regex = '/(?=.)(true|false|TRUE|FALSE|\\s{0,})(?!.)/';
$testString = ''; // Fill this in
preg_match($re... |
50,963,258 | I'm using Elasticsearch [Phrase Suggester](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters-phrase.html) for correcting user's misspellings. everything is working as I expected unless user enters a query which it's first letter is misspelled. At this situation phrase suggester returns n... | 2018/06/21 | [
"https://Stackoverflow.com/questions/50963258",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4720169/"
] | In the codepen you have a width of 150px set. You need to remove this to allow for a full width container.
All columns need to be contained in a row.
I have removed the width from the style, and added a row class to the card-container div. See here:
<https://codepen.io/anon/pen/MXVGVE>
```
<div class="card-container... | **YOU CAN NOT SET `col-..` without wrap it `row` div**
Set `width: 100%;` instead `width: 150px;` to `.card-container`
and add `row` to `card-container`
```css
.card-container {
cursor: pointer;
height: 150px;
perspective: 600;
position: relative;
width: 100%;
}
.card {
height: ... |
38,668,710 | I wrote several functions to check if the two passwords are equal. I first type two passwords. When I click out of the "verify password" box, it should either display "The passwords match" or "A second try is needed. Please enter your password in the first password box again because the two passwords don't match" depen... | 2016/07/29 | [
"https://Stackoverflow.com/questions/38668710",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6642730/"
] | Solved! :D
```
function getXML() {
fetch('https://privateapi.com/xml')
.then(response => response.text()) // the promise
.then(data => console.log('Data', data)) // data
.catch(error => console.log('Error', error))
}
```
1.Figured out that I had to enable some settings in the server since I was receiv... | You are calling `response.json()` which is failing to parse the XML into an object, change that to `response.text()`
```
function getGithubGists() {
fetch('https://privateapi.com/xml')
.then(function(response) {
response.text().then(function(data) {
console.log('data', data)
})
})
.cat... |
3,816,718 | I have an enum that I'd like to display all possible values of. Is there a way to get an array or list of all the possible values of the enum instead of manually creating such a list? e.g. If I have an enum:
```
public enum Enumnum { TypeA, TypeB, TypeC, TypeD }
```
how would I be able to get a `List<Enumnum>` that ... | 2010/09/28 | [
"https://Stackoverflow.com/questions/3816718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/388739/"
] | Try this code:
```
Enum.GetNames(typeof(Enumnum));
```
This return a `string[]` with all the enum names of the chosen enum. | The OP asked for How to get an array of all `enum` values in C# ?
**What if you want to get an array of selected `enum` values in C# ?**
**Your Enum**
```
enum WeekDays
{
Sunday,
Monday,
Tuesday
}
```
If you want to just select `Sunday` from your `Enum`.
```
WeekDays[] week... |
3,816,718 | I have an enum that I'd like to display all possible values of. Is there a way to get an array or list of all the possible values of the enum instead of manually creating such a list? e.g. If I have an enum:
```
public enum Enumnum { TypeA, TypeB, TypeC, TypeD }
```
how would I be able to get a `List<Enumnum>` that ... | 2010/09/28 | [
"https://Stackoverflow.com/questions/3816718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/388739/"
] | You may want to do like this:
```
public enum Enumnum {
TypeA = 11,
TypeB = 22,
TypeC = 33,
TypeD = 44
}
```
All int values of this `enum` is `11,22,33,44`.
You can get these values by this:
```
var enumsValues = Enum.GetValues(typeof(Enumnum)).Cast<Enumnum>... | If you prefer a more generic way, here it is. You can add up more converters as per your need.
```
public static class EnumConverter
{
public static string[] ToNameArray<T>()
{
return Enum.GetNames(typeof(T)).ToArray();
}
public static Array ToValueArray<T>()
... |
3,816,718 | I have an enum that I'd like to display all possible values of. Is there a way to get an array or list of all the possible values of the enum instead of manually creating such a list? e.g. If I have an enum:
```
public enum Enumnum { TypeA, TypeB, TypeC, TypeD }
```
how would I be able to get a `List<Enumnum>` that ... | 2010/09/28 | [
"https://Stackoverflow.com/questions/3816718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/388739/"
] | This is way easier now with the generic method in .NET 5.0.
```
ColorEnum[] colors = Enum.GetValues<ColorEnum>();
```
[MS Doc: Enum.GetValues](https://learn.microsoft.com/en-us/dotnet/api/system.enum.getvalues?view=net-5.0#System_Enum_GetValues__1) | The OP asked for How to get an array of all `enum` values in C# ?
**What if you want to get an array of selected `enum` values in C# ?**
**Your Enum**
```
enum WeekDays
{
Sunday,
Monday,
Tuesday
}
```
If you want to just select `Sunday` from your `Enum`.
```
WeekDays[] week... |
3,816,718 | I have an enum that I'd like to display all possible values of. Is there a way to get an array or list of all the possible values of the enum instead of manually creating such a list? e.g. If I have an enum:
```
public enum Enumnum { TypeA, TypeB, TypeC, TypeD }
```
how would I be able to get a `List<Enumnum>` that ... | 2010/09/28 | [
"https://Stackoverflow.com/questions/3816718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/388739/"
] | Try this code:
```
Enum.GetNames(typeof(Enumnum));
```
This return a `string[]` with all the enum names of the chosen enum. | Something little different:
```
typeof(SomeEnum).GetEnumValues();
``` |
3,816,718 | I have an enum that I'd like to display all possible values of. Is there a way to get an array or list of all the possible values of the enum instead of manually creating such a list? e.g. If I have an enum:
```
public enum Enumnum { TypeA, TypeB, TypeC, TypeD }
```
how would I be able to get a `List<Enumnum>` that ... | 2010/09/28 | [
"https://Stackoverflow.com/questions/3816718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/388739/"
] | You may want to do like this:
```
public enum Enumnum {
TypeA = 11,
TypeB = 22,
TypeC = 33,
TypeD = 44
}
```
All int values of this `enum` is `11,22,33,44`.
You can get these values by this:
```
var enumsValues = Enum.GetValues(typeof(Enumnum)).Cast<Enumnum>... | also you can use
```
var enumAsJson=typeof(SomeEnum).Name + ":[" + string.Join(",", Enum.GetValues(typeof(SomeEnum)).Cast<SomeEnum>().Select(e => e.ToString())) + "]";
```
for get all elements in enum as json format. |
3,816,718 | I have an enum that I'd like to display all possible values of. Is there a way to get an array or list of all the possible values of the enum instead of manually creating such a list? e.g. If I have an enum:
```
public enum Enumnum { TypeA, TypeB, TypeC, TypeD }
```
how would I be able to get a `List<Enumnum>` that ... | 2010/09/28 | [
"https://Stackoverflow.com/questions/3816718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/388739/"
] | ```
Enum.GetValues(typeof(Enumnum));
```
returns an array of the values in the Enum. | with this:
```
string[] myArray = Enum.GetNames(typeof(Enumnum));
```
and you can access values array like so:
```
Array myArray = Enum.GetValues(typeof(Enumnum));
``` |
3,816,718 | I have an enum that I'd like to display all possible values of. Is there a way to get an array or list of all the possible values of the enum instead of manually creating such a list? e.g. If I have an enum:
```
public enum Enumnum { TypeA, TypeB, TypeC, TypeD }
```
how would I be able to get a `List<Enumnum>` that ... | 2010/09/28 | [
"https://Stackoverflow.com/questions/3816718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/388739/"
] | Try this code:
```
Enum.GetNames(typeof(Enumnum));
```
This return a `string[]` with all the enum names of the chosen enum. | If you prefer a more generic way, here it is. You can add up more converters as per your need.
```
public static class EnumConverter
{
public static string[] ToNameArray<T>()
{
return Enum.GetNames(typeof(T)).ToArray();
}
public static Array ToValueArray<T>()
... |
3,816,718 | I have an enum that I'd like to display all possible values of. Is there a way to get an array or list of all the possible values of the enum instead of manually creating such a list? e.g. If I have an enum:
```
public enum Enumnum { TypeA, TypeB, TypeC, TypeD }
```
how would I be able to get a `List<Enumnum>` that ... | 2010/09/28 | [
"https://Stackoverflow.com/questions/3816718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/388739/"
] | Something little different:
```
typeof(SomeEnum).GetEnumValues();
``` | The OP asked for How to get an array of all `enum` values in C# ?
**What if you want to get an array of selected `enum` values in C# ?**
**Your Enum**
```
enum WeekDays
{
Sunday,
Monday,
Tuesday
}
```
If you want to just select `Sunday` from your `Enum`.
```
WeekDays[] week... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.