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 |
|---|---|---|---|---|---|
6,314,998 | I was wondering if there is any script that will allow one to limit the network bandwidth (download\upload) for a certain process on a mac? | 2011/06/11 | [
"https://Stackoverflow.com/questions/6314998",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/793810/"
] | The first .NET version of Visual Studio was internal version 7.0, so I think they named the folder Common7 based on that. Then later there were a lot of dependencies (probably external, like plugins or whatnot) that used the name Common7 so it would break too much if they changed it in later version. | There are too many add-ins and build scripts that have hard-coded the "Common7" folder name. Somewhat self-inflicted, it isn't that easy to find the proper path to the folder. The environment variable name is VS90COMNTOOLS for VS2008. Note the version number in the name, also not sure if it was available back in VS2003... |
12,036,496 | So I have a servlet which prints content of various files. But when I want to print .xml file my servlet page doesn't print anything, because page uses this xml tags as html and is parsing them istead of printing. And I want to print this tags. I am reading file line by line and lines are stored in variable line. | 2012/08/20 | [
"https://Stackoverflow.com/questions/12036496",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1568385/"
] | can you call JS from Delphi ?
<http://www.delphidabbler.com/articles?article=21>
<http://jansfreeware.com/articles/delphi-ie-javascript.html>
<http://www.programmersheaven.com/article/12946-How+to+call+JavaScript+functions+in+a+TWebBrowser+from+Delphi/info.aspx>
---
probably there should be way
<http://www.rosei... | No need for javascript as Arioch implies.
You can have access to the complete DOM via TWebBrowser.Document.
There are many resources on the net on this subject, this is the most complete one:
<http://www.cryer.co.uk/brian/delphi/twebbrowser/read_write_form_elements.htm>
if you look around on SO you also will find som... |
2,337,355 | >
> What is the probability of rolling three twenty-sided dice and having at least two of the same number appear?
>
>
>
I thought that the probability would be:
$$1 - \bigg(1 - \frac{1}{20}\bigg) \bigg(1 - \frac{1}{20}\bigg) \bigg(1 - \frac{1}{20}\bigg) = 1 - \frac{19^3}{20^3}$$
That is one in twenty is the prob... | 2017/06/26 | [
"https://math.stackexchange.com/questions/2337355",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/458102/"
] | Consider the complement namely all three dice are distinct. There are $20\times19\times18$ possible such outcomes out of $20^3$ possible outcomes. Hence the probability is
$$
1-\frac{20\times19\times18}{20^3}=1-\frac{20}{20}\times\frac{19}{20}\times\frac{18}{20}.
$$ | You're very close. Once the first one is rolled, there is a $(1-1/20)$ chance it is not replicated by the second die. Once the second has also been rolled, assuming it did not replicate the first, there is a $(1-2/20)$ that the third die replicates neither of the original two. Thus the probability is $$1 - (1-1/20)(1-2... |
2,337,355 | >
> What is the probability of rolling three twenty-sided dice and having at least two of the same number appear?
>
>
>
I thought that the probability would be:
$$1 - \bigg(1 - \frac{1}{20}\bigg) \bigg(1 - \frac{1}{20}\bigg) \bigg(1 - \frac{1}{20}\bigg) = 1 - \frac{19^3}{20^3}$$
That is one in twenty is the prob... | 2017/06/26 | [
"https://math.stackexchange.com/questions/2337355",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/458102/"
] | You're very close. Once the first one is rolled, there is a $(1-1/20)$ chance it is not replicated by the second die. Once the second has also been rolled, assuming it did not replicate the first, there is a $(1-2/20)$ that the third die replicates neither of the original two. Thus the probability is $$1 - (1-1/20)(1-2... | Assuming that the rolls are independent, the event X of rolling 3, 20-sided dice may be considered as a binomial distributed variable with n=3 and p=1/20. You are looking for P(X>1) which is the probability that you will get at least 2 outcomes the same. This is 0.00725. However, since there are 20 possible outcomes, y... |
2,337,355 | >
> What is the probability of rolling three twenty-sided dice and having at least two of the same number appear?
>
>
>
I thought that the probability would be:
$$1 - \bigg(1 - \frac{1}{20}\bigg) \bigg(1 - \frac{1}{20}\bigg) \bigg(1 - \frac{1}{20}\bigg) = 1 - \frac{19^3}{20^3}$$
That is one in twenty is the prob... | 2017/06/26 | [
"https://math.stackexchange.com/questions/2337355",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/458102/"
] | Consider the complement namely all three dice are distinct. There are $20\times19\times18$ possible such outcomes out of $20^3$ possible outcomes. Hence the probability is
$$
1-\frac{20\times19\times18}{20^3}=1-\frac{20}{20}\times\frac{19}{20}\times\frac{18}{20}.
$$ | We will consider the probability that two of the same number do not appear. After the first role, this is of course $1$. Then, after the second roll, there is a $\frac {19}{20}$ chance that the die role is not repeated. On the third role, there is a $\frac {18}{20}$ chance that the role is repeated. Multiplying togethe... |
2,337,355 | >
> What is the probability of rolling three twenty-sided dice and having at least two of the same number appear?
>
>
>
I thought that the probability would be:
$$1 - \bigg(1 - \frac{1}{20}\bigg) \bigg(1 - \frac{1}{20}\bigg) \bigg(1 - \frac{1}{20}\bigg) = 1 - \frac{19^3}{20^3}$$
That is one in twenty is the prob... | 2017/06/26 | [
"https://math.stackexchange.com/questions/2337355",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/458102/"
] | Consider the complement namely all three dice are distinct. There are $20\times19\times18$ possible such outcomes out of $20^3$ possible outcomes. Hence the probability is
$$
1-\frac{20\times19\times18}{20^3}=1-\frac{20}{20}\times\frac{19}{20}\times\frac{18}{20}.
$$ | Assuming that the rolls are independent, the event X of rolling 3, 20-sided dice may be considered as a binomial distributed variable with n=3 and p=1/20. You are looking for P(X>1) which is the probability that you will get at least 2 outcomes the same. This is 0.00725. However, since there are 20 possible outcomes, y... |
2,337,355 | >
> What is the probability of rolling three twenty-sided dice and having at least two of the same number appear?
>
>
>
I thought that the probability would be:
$$1 - \bigg(1 - \frac{1}{20}\bigg) \bigg(1 - \frac{1}{20}\bigg) \bigg(1 - \frac{1}{20}\bigg) = 1 - \frac{19^3}{20^3}$$
That is one in twenty is the prob... | 2017/06/26 | [
"https://math.stackexchange.com/questions/2337355",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/458102/"
] | We will consider the probability that two of the same number do not appear. After the first role, this is of course $1$. Then, after the second roll, there is a $\frac {19}{20}$ chance that the die role is not repeated. On the third role, there is a $\frac {18}{20}$ chance that the role is repeated. Multiplying togethe... | Assuming that the rolls are independent, the event X of rolling 3, 20-sided dice may be considered as a binomial distributed variable with n=3 and p=1/20. You are looking for P(X>1) which is the probability that you will get at least 2 outcomes the same. This is 0.00725. However, since there are 20 possible outcomes, y... |
34,522,201 | In ANTLR 4 is there a way to access tokens on the hidden channel (or some other channels) in semantic predicates of the parser?
I would like to send the \r\n to hidden channel since mostly I don't need the EOL characters. But in some cases in a semantic predicate I would need to see if there is an EOL after the given ... | 2015/12/30 | [
"https://Stackoverflow.com/questions/34522201",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/352050/"
] | Tbh. I have no experience with ANLTR 4 but in ANTLR 3 you can use the token source to get all tokens, regardless of the channel. Something similar is certainly possible in version 4 too. I use this feature to restore the original input for AST subtrees (i.e. from token stream start index to end index). | Yes, this can be done. Look at [this question](https://stackoverflow.com/questions/41667217/antlr4-how-can-i-both-hide-and-use-tokens-in-a-grammar) and [this question](https://stackoverflow.com/questions/13661754/semantic-predicates-in-antlr4) for some examples. The first one of these seems to directly address your que... |
58,280,159 | I'm trying to extract birthdate with Selenium (java & chrome) from 'about page' on Facebook's profile. How should I do it?
On Facebook 'about' tab there is an element that contains person's birthdate (if disclosed). I really would like to have it as a String.
Example here:
<https://www.facebook.com/zuck/about?lst=10... | 2019/10/08 | [
"https://Stackoverflow.com/questions/58280159",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11276636/"
] | Most of the developers like JSON data as request and it's good practice in RESTful apis. why?
JSON format is `{key1: value1, key2: value 2,....}`
You are passing
`this.http.post(this.basePath + this.modulePath + '/getArrayValue',{'test' : YOUR_ACTUAL_ARRAY})`
form the front-end. The `httpClient.post(url,body,opti... | For your client put your data directly on POST's body:
```
public passingOfValues( test : Array<string> ) : Observable<Array<string>> {
let headers = new Headers({ 'Content-Type': 'application/json'} );
let options = new RequestOptions({ headers: headers);
let response = this.http.post(this.basePath + th... |
10,492,409 | ```
public boolean used[] = new boolean[26];
```
Here is what I have, and it's working great. I know they are all going to be set as false by default. But, as my application is used for a while, some of those are changed to "true". (Which is fine, since that's what my code is supposed to do).
I'm trying to crea... | 2012/05/08 | [
"https://Stackoverflow.com/questions/10492409",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1377329/"
] | Use [`Arrays.fill`](http://docs.oracle.com/javase/7/docs/api/java/util/Arrays.html#fill%28boolean%5B%5D,%20boolean%29):
```
Arrays.fill(used, false);
``` | Use `java.util.Arrays.fill()`:
```
Arrays.fill(used, false);
``` |
10,492,409 | ```
public boolean used[] = new boolean[26];
```
Here is what I have, and it's working great. I know they are all going to be set as false by default. But, as my application is used for a while, some of those are changed to "true". (Which is fine, since that's what my code is supposed to do).
I'm trying to crea... | 2012/05/08 | [
"https://Stackoverflow.com/questions/10492409",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1377329/"
] | Use [`Arrays.fill`](http://docs.oracle.com/javase/7/docs/api/java/util/Arrays.html#fill%28boolean%5B%5D,%20boolean%29):
```
Arrays.fill(used, false);
``` | *Arrays.fill* uses a *rangecheck* before filling your array.
```
public static void fill(Object[] a, int fromIndex, int toIndex, Object val) {
rangeCheck(a.length, fromIndex, toIndex);
for (int i=fromIndex; i<toIndex; i++)
a[i] = val;
}
/**
* Check that fromIndex and toIndex are ... |
10,492,409 | ```
public boolean used[] = new boolean[26];
```
Here is what I have, and it's working great. I know they are all going to be set as false by default. But, as my application is used for a while, some of those are changed to "true". (Which is fine, since that's what my code is supposed to do).
I'm trying to crea... | 2012/05/08 | [
"https://Stackoverflow.com/questions/10492409",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1377329/"
] | Use [`Arrays.fill`](http://docs.oracle.com/javase/7/docs/api/java/util/Arrays.html#fill%28boolean%5B%5D,%20boolean%29):
```
Arrays.fill(used, false);
``` | You can just recreate your array, it will be initialized by default to false.
That is when you implement the reset yo can do
```
used[] = new boolean[26];
``` |
10,492,409 | ```
public boolean used[] = new boolean[26];
```
Here is what I have, and it's working great. I know they are all going to be set as false by default. But, as my application is used for a while, some of those are changed to "true". (Which is fine, since that's what my code is supposed to do).
I'm trying to crea... | 2012/05/08 | [
"https://Stackoverflow.com/questions/10492409",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1377329/"
] | Use [`Arrays.fill`](http://docs.oracle.com/javase/7/docs/api/java/util/Arrays.html#fill%28boolean%5B%5D,%20boolean%29):
```
Arrays.fill(used, false);
``` | ```
boolean a[]= new boolean[nums.length];
Arrays.fill(a, false);
```
// this will help you fill array of boolean with false.
// remember to -> import java.util.Arrays; |
10,492,409 | ```
public boolean used[] = new boolean[26];
```
Here is what I have, and it's working great. I know they are all going to be set as false by default. But, as my application is used for a while, some of those are changed to "true". (Which is fine, since that's what my code is supposed to do).
I'm trying to crea... | 2012/05/08 | [
"https://Stackoverflow.com/questions/10492409",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1377329/"
] | *Arrays.fill* uses a *rangecheck* before filling your array.
```
public static void fill(Object[] a, int fromIndex, int toIndex, Object val) {
rangeCheck(a.length, fromIndex, toIndex);
for (int i=fromIndex; i<toIndex; i++)
a[i] = val;
}
/**
* Check that fromIndex and toIndex are ... | Use `java.util.Arrays.fill()`:
```
Arrays.fill(used, false);
``` |
10,492,409 | ```
public boolean used[] = new boolean[26];
```
Here is what I have, and it's working great. I know they are all going to be set as false by default. But, as my application is used for a while, some of those are changed to "true". (Which is fine, since that's what my code is supposed to do).
I'm trying to crea... | 2012/05/08 | [
"https://Stackoverflow.com/questions/10492409",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1377329/"
] | You can just recreate your array, it will be initialized by default to false.
That is when you implement the reset yo can do
```
used[] = new boolean[26];
``` | Use `java.util.Arrays.fill()`:
```
Arrays.fill(used, false);
``` |
10,492,409 | ```
public boolean used[] = new boolean[26];
```
Here is what I have, and it's working great. I know they are all going to be set as false by default. But, as my application is used for a while, some of those are changed to "true". (Which is fine, since that's what my code is supposed to do).
I'm trying to crea... | 2012/05/08 | [
"https://Stackoverflow.com/questions/10492409",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1377329/"
] | Use `java.util.Arrays.fill()`:
```
Arrays.fill(used, false);
``` | ```
boolean a[]= new boolean[nums.length];
Arrays.fill(a, false);
```
// this will help you fill array of boolean with false.
// remember to -> import java.util.Arrays; |
10,492,409 | ```
public boolean used[] = new boolean[26];
```
Here is what I have, and it's working great. I know they are all going to be set as false by default. But, as my application is used for a while, some of those are changed to "true". (Which is fine, since that's what my code is supposed to do).
I'm trying to crea... | 2012/05/08 | [
"https://Stackoverflow.com/questions/10492409",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1377329/"
] | *Arrays.fill* uses a *rangecheck* before filling your array.
```
public static void fill(Object[] a, int fromIndex, int toIndex, Object val) {
rangeCheck(a.length, fromIndex, toIndex);
for (int i=fromIndex; i<toIndex; i++)
a[i] = val;
}
/**
* Check that fromIndex and toIndex are ... | ```
boolean a[]= new boolean[nums.length];
Arrays.fill(a, false);
```
// this will help you fill array of boolean with false.
// remember to -> import java.util.Arrays; |
10,492,409 | ```
public boolean used[] = new boolean[26];
```
Here is what I have, and it's working great. I know they are all going to be set as false by default. But, as my application is used for a while, some of those are changed to "true". (Which is fine, since that's what my code is supposed to do).
I'm trying to crea... | 2012/05/08 | [
"https://Stackoverflow.com/questions/10492409",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1377329/"
] | You can just recreate your array, it will be initialized by default to false.
That is when you implement the reset yo can do
```
used[] = new boolean[26];
``` | ```
boolean a[]= new boolean[nums.length];
Arrays.fill(a, false);
```
// this will help you fill array of boolean with false.
// remember to -> import java.util.Arrays; |
61,321,376 | I am calling a rest api which returns the data in json array of object format like this
[](https://i.stack.imgur.com/yWLfx.png)
Now when I call this rest api from my typecsript code and print on console data received i get this
`gameRecord: Fifa = ne... | 2020/04/20 | [
"https://Stackoverflow.com/questions/61321376",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10799470/"
] | gameRecord: Fifa = new Fifa();
```
this.fifaService.fetchGameRecord(gameId).subscribe(
data => {
this.gameRecord = data[0]; // <= data is an array
console.log(this.gameRecord.kashScore);
}
);
``` | here data is an array of type `Fifa` objects, not single object
so you can access it like `this.gameRecord[0].kashScore`
Also you might need to update `gameRecord: Fifa = new Fifa()` this statement if you are expecting more records in the array as this.gamerecord will be array of objects else you can access the 0th el... |
37,263,964 | ```
1. select count(*) from tableX where code = "XYZ";
2. select count(*) from tableX where code like "%XYZ";
```
Result for query 1 is 18734. <== Not Correct
Result for query 2 is 93003. <== Correct
We know that query 2's count is correct based on independent verification.
We expect these two queries to have the ... | 2016/05/16 | [
"https://Stackoverflow.com/questions/37263964",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2274557/"
] | It's up to you. If you leave them there nothing bad will happen because the executables have different names (`dnx`/`dotnet`).
You can have dnx and dotnet side by side. | You should not delete this folders if you have old (DNX-based) projects that you still want to run. Otherwise, you will need to reinstall the dnx runtimes again to work with your old (RC1) apps.
Your new (RC2, `dotnet cli`) projects will known nothing about this old dnx-based folder and will ignore it completely. |
37,263,964 | ```
1. select count(*) from tableX where code = "XYZ";
2. select count(*) from tableX where code like "%XYZ";
```
Result for query 1 is 18734. <== Not Correct
Result for query 2 is 93003. <== Correct
We know that query 2's count is correct based on independent verification.
We expect these two queries to have the ... | 2016/05/16 | [
"https://Stackoverflow.com/questions/37263964",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2274557/"
] | It's up to you. If you leave them there nothing bad will happen because the executables have different names (`dnx`/`dotnet`).
You can have dnx and dotnet side by side. | Microsoft advise you to remove any old version of .Net Core. The DNX was the runtime and toolset used to build .Net Core and .Net Core apps as per Microsoft. It was consisted of DNVM, DNX and DNU.
With the .Net Core CLI all above (DNVM, DNX and DNU) are part of a single toolset.
You'll may find some issues when remov... |
37,263,964 | ```
1. select count(*) from tableX where code = "XYZ";
2. select count(*) from tableX where code like "%XYZ";
```
Result for query 1 is 18734. <== Not Correct
Result for query 2 is 93003. <== Correct
We know that query 2's count is correct based on independent verification.
We expect these two queries to have the ... | 2016/05/16 | [
"https://Stackoverflow.com/questions/37263964",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2274557/"
] | You should not delete this folders if you have old (DNX-based) projects that you still want to run. Otherwise, you will need to reinstall the dnx runtimes again to work with your old (RC1) apps.
Your new (RC2, `dotnet cli`) projects will known nothing about this old dnx-based folder and will ignore it completely. | Microsoft advise you to remove any old version of .Net Core. The DNX was the runtime and toolset used to build .Net Core and .Net Core apps as per Microsoft. It was consisted of DNVM, DNX and DNU.
With the .Net Core CLI all above (DNVM, DNX and DNU) are part of a single toolset.
You'll may find some issues when remov... |
12,202,156 | I am trying to connect to a REST resource and retrieve the data using Python script (Python 3.2.3). When I run the script I am getting error as HTTP Error 401: Unauthorized. Please note that I am able to access the given REST resource using REST client using Basic Authentication. In the REST Client I have specified the... | 2012/08/30 | [
"https://Stackoverflow.com/questions/12202156",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1636640/"
] | Try to give the correct realm name. You can find this out for example when opening the page in a browser - the password prompt should display the name. | You can also read the realm by catching the exception that was raised:
```
import urllib.error
import urllib.request
# set up authentication info
auth_handler = urllib.request.HTTPBasicAuthHandler()
auth_handler.add_password(realm=None,
uri=r'http://hostname/',
user='admi... |
89,767 | As far as I know, it is valid to say "they can produce music ***on*** their own terms" when you want to say that a group can produce music without having to answer to anybody but themselves.
Is it also valid to say "they can produce music ***in*** their own terms"? Does this convey the same thing? If not, what does i... | 2012/10/31 | [
"https://english.stackexchange.com/questions/89767",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/2668/"
] | “**On** someone’s terms” means according to the “terms”—stipulations or provisions—which that person sets. “We do it on my terms” means “We do it my way.” “We bought it on his terms” means “We bought it at a price he set.”
“**In** someone’s terms” means using the “terms”—the language, the categories, the concepts—whic... | The "standard" idiomatic meaning of [on one's own terms](http://www.merriam-webster.com/dictionary/term) is *in accordance with one's wishes : in one's own way*. In that link, Merriam-Webster's example is *he prefers to live on his own terms*.
*"In one's own terms"* isn't such an established idiom, but it's [certainly... |
89,767 | As far as I know, it is valid to say "they can produce music ***on*** their own terms" when you want to say that a group can produce music without having to answer to anybody but themselves.
Is it also valid to say "they can produce music ***in*** their own terms"? Does this convey the same thing? If not, what does i... | 2012/10/31 | [
"https://english.stackexchange.com/questions/89767",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/2668/"
] | The "standard" idiomatic meaning of [on one's own terms](http://www.merriam-webster.com/dictionary/term) is *in accordance with one's wishes : in one's own way*. In that link, Merriam-Webster's example is *he prefers to live on his own terms*.
*"In one's own terms"* isn't such an established idiom, but it's [certainly... | They indeed seem to have (re-)created music ***in*** their own terms as Bruce Eder writes in the Bee Gees [biography](http://www.allmusic.com/artist/bee-gees-mn0000043714).
>
> *Saturday Night Fever*, as an album and a film, supercharged the phenomenon and broadened its audience by tens of millions, with the Bee Gee... |
89,767 | As far as I know, it is valid to say "they can produce music ***on*** their own terms" when you want to say that a group can produce music without having to answer to anybody but themselves.
Is it also valid to say "they can produce music ***in*** their own terms"? Does this convey the same thing? If not, what does i... | 2012/10/31 | [
"https://english.stackexchange.com/questions/89767",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/2668/"
] | “**On** someone’s terms” means according to the “terms”—stipulations or provisions—which that person sets. “We do it on my terms” means “We do it my way.” “We bought it on his terms” means “We bought it at a price he set.”
“**In** someone’s terms” means using the “terms”—the language, the categories, the concepts—whic... | They indeed seem to have (re-)created music ***in*** their own terms as Bruce Eder writes in the Bee Gees [biography](http://www.allmusic.com/artist/bee-gees-mn0000043714).
>
> *Saturday Night Fever*, as an album and a film, supercharged the phenomenon and broadened its audience by tens of millions, with the Bee Gee... |
4,197,550 | I have Operation Aborted each time I Refresh my website's page.
I read the article of MSFT about this issue, and I dont have that case.
I have a div inside the body that appends a script to the head
and the head modifies all the body elements...
What can cause this??
Thanks ! | 2010/11/16 | [
"https://Stackoverflow.com/questions/4197550",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/261052/"
] | You can't use `IN` with more than one column but you can usually achieve the same effect using `EXISTS`:
```
SELECT *
FROM tbl1
WHERE NOT EXISTS
(
SELECT *
FROM tbl2
WHERE tbl2.col1 = tbl1.col1
AND tbl2.col2 = tbl1.col2
)
``` | ```
Select * from some_table
where (((Some_Value) Not IN (Select Column1 & Column2 from Some_Other_Table)));
```
I saw where you indicated this was for Access |
4,197,550 | I have Operation Aborted each time I Refresh my website's page.
I read the article of MSFT about this issue, and I dont have that case.
I have a div inside the body that appends a script to the head
and the head modifies all the body elements...
What can cause this??
Thanks ! | 2010/11/16 | [
"https://Stackoverflow.com/questions/4197550",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/261052/"
] | Your question is a bit unclear. Is this what you need?
```
SELECT *
FROM
MY_TABLE MT
WHERE 'Smith' NOT IN (MT.FIRST_NAME)
AND 'Smith' NOT IN (MT.LAST_NAME)
```
This will show you all records where the search phrase ("Smith") is in neither the first\_name nor the last\_name column. | Perhaps you meant
```
SELECT *
FROM MY_TABLE
WHERE (FIRST_NAME, LAST_NAME) NOT IN (SELECT FIRST_NAME, LAST_NAME
FROM SOME_OTHER_TABLE)
```
This is allowed under Oracle - not sure about SQL Server.
Share and enjoy. |
4,197,550 | I have Operation Aborted each time I Refresh my website's page.
I read the article of MSFT about this issue, and I dont have that case.
I have a div inside the body that appends a script to the head
and the head modifies all the body elements...
What can cause this??
Thanks ! | 2010/11/16 | [
"https://Stackoverflow.com/questions/4197550",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/261052/"
] | General syntax:
```
where col not in (items)
```
Items can be
* a list of items -- `(4,5,3,5,2)` or `('243','3','cdds')` or any other datatype.
* Or a select statement `(select hatefulthings from table)`
---
*Addition 6 years later*
All major platforms support tuples with NOT IN, for example
```
SELECT *
FROM ... | Perhaps you meant
```
SELECT *
FROM MY_TABLE
WHERE (FIRST_NAME, LAST_NAME) NOT IN (SELECT FIRST_NAME, LAST_NAME
FROM SOME_OTHER_TABLE)
```
This is allowed under Oracle - not sure about SQL Server.
Share and enjoy. |
4,197,550 | I have Operation Aborted each time I Refresh my website's page.
I read the article of MSFT about this issue, and I dont have that case.
I have a div inside the body that appends a script to the head
and the head modifies all the body elements...
What can cause this??
Thanks ! | 2010/11/16 | [
"https://Stackoverflow.com/questions/4197550",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/261052/"
] | You can't use `IN` with more than one column but you can usually achieve the same effect using `EXISTS`:
```
SELECT *
FROM tbl1
WHERE NOT EXISTS
(
SELECT *
FROM tbl2
WHERE tbl2.col1 = tbl1.col1
AND tbl2.col2 = tbl1.col2
)
``` | Perhaps you meant
```
SELECT *
FROM MY_TABLE
WHERE (FIRST_NAME, LAST_NAME) NOT IN (SELECT FIRST_NAME, LAST_NAME
FROM SOME_OTHER_TABLE)
```
This is allowed under Oracle - not sure about SQL Server.
Share and enjoy. |
4,197,550 | I have Operation Aborted each time I Refresh my website's page.
I read the article of MSFT about this issue, and I dont have that case.
I have a div inside the body that appends a script to the head
and the head modifies all the body elements...
What can cause this??
Thanks ! | 2010/11/16 | [
"https://Stackoverflow.com/questions/4197550",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/261052/"
] | Your question is a bit unclear. Is this what you need?
```
SELECT *
FROM
MY_TABLE MT
WHERE 'Smith' NOT IN (MT.FIRST_NAME)
AND 'Smith' NOT IN (MT.LAST_NAME)
```
This will show you all records where the search phrase ("Smith") is in neither the first\_name nor the last\_name column. | It is not clear what you are asking, but I gather that you would like to have a NOT IN condition based on two columns instead of just one.
As an example, lets say you have a column called F\_Name and another called L\_Name (both variable in size), and that you want to exclude specific combination of those names from a... |
4,197,550 | I have Operation Aborted each time I Refresh my website's page.
I read the article of MSFT about this issue, and I dont have that case.
I have a div inside the body that appends a script to the head
and the head modifies all the body elements...
What can cause this??
Thanks ! | 2010/11/16 | [
"https://Stackoverflow.com/questions/4197550",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/261052/"
] | Perhaps you meant
```
SELECT *
FROM MY_TABLE
WHERE (FIRST_NAME, LAST_NAME) NOT IN (SELECT FIRST_NAME, LAST_NAME
FROM SOME_OTHER_TABLE)
```
This is allowed under Oracle - not sure about SQL Server.
Share and enjoy. | It is not clear what you are asking, but I gather that you would like to have a NOT IN condition based on two columns instead of just one.
As an example, lets say you have a column called F\_Name and another called L\_Name (both variable in size), and that you want to exclude specific combination of those names from a... |
4,197,550 | I have Operation Aborted each time I Refresh my website's page.
I read the article of MSFT about this issue, and I dont have that case.
I have a div inside the body that appends a script to the head
and the head modifies all the body elements...
What can cause this??
Thanks ! | 2010/11/16 | [
"https://Stackoverflow.com/questions/4197550",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/261052/"
] | Perhaps you meant
```
SELECT *
FROM MY_TABLE
WHERE (FIRST_NAME, LAST_NAME) NOT IN (SELECT FIRST_NAME, LAST_NAME
FROM SOME_OTHER_TABLE)
```
This is allowed under Oracle - not sure about SQL Server.
Share and enjoy. | ```
Select * from some_table
where (((Some_Value) Not IN (Select Column1 & Column2 from Some_Other_Table)));
```
I saw where you indicated this was for Access |
4,197,550 | I have Operation Aborted each time I Refresh my website's page.
I read the article of MSFT about this issue, and I dont have that case.
I have a div inside the body that appends a script to the head
and the head modifies all the body elements...
What can cause this??
Thanks ! | 2010/11/16 | [
"https://Stackoverflow.com/questions/4197550",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/261052/"
] | You can't use `IN` with more than one column but you can usually achieve the same effect using `EXISTS`:
```
SELECT *
FROM tbl1
WHERE NOT EXISTS
(
SELECT *
FROM tbl2
WHERE tbl2.col1 = tbl1.col1
AND tbl2.col2 = tbl1.col2
)
``` | General syntax:
```
where col not in (items)
```
Items can be
* a list of items -- `(4,5,3,5,2)` or `('243','3','cdds')` or any other datatype.
* Or a select statement `(select hatefulthings from table)`
---
*Addition 6 years later*
All major platforms support tuples with NOT IN, for example
```
SELECT *
FROM ... |
4,197,550 | I have Operation Aborted each time I Refresh my website's page.
I read the article of MSFT about this issue, and I dont have that case.
I have a div inside the body that appends a script to the head
and the head modifies all the body elements...
What can cause this??
Thanks ! | 2010/11/16 | [
"https://Stackoverflow.com/questions/4197550",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/261052/"
] | You can't use `IN` with more than one column but you can usually achieve the same effect using `EXISTS`:
```
SELECT *
FROM tbl1
WHERE NOT EXISTS
(
SELECT *
FROM tbl2
WHERE tbl2.col1 = tbl1.col1
AND tbl2.col2 = tbl1.col2
)
``` | It is not clear what you are asking, but I gather that you would like to have a NOT IN condition based on two columns instead of just one.
As an example, lets say you have a column called F\_Name and another called L\_Name (both variable in size), and that you want to exclude specific combination of those names from a... |
4,197,550 | I have Operation Aborted each time I Refresh my website's page.
I read the article of MSFT about this issue, and I dont have that case.
I have a div inside the body that appends a script to the head
and the head modifies all the body elements...
What can cause this??
Thanks ! | 2010/11/16 | [
"https://Stackoverflow.com/questions/4197550",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/261052/"
] | You can't use `IN` with more than one column but you can usually achieve the same effect using `EXISTS`:
```
SELECT *
FROM tbl1
WHERE NOT EXISTS
(
SELECT *
FROM tbl2
WHERE tbl2.col1 = tbl1.col1
AND tbl2.col2 = tbl1.col2
)
``` | Your question is a bit unclear. Is this what you need?
```
SELECT *
FROM
MY_TABLE MT
WHERE 'Smith' NOT IN (MT.FIRST_NAME)
AND 'Smith' NOT IN (MT.LAST_NAME)
```
This will show you all records where the search phrase ("Smith") is in neither the first\_name nor the last\_name column. |
27,127,826 | Is there a way to change the shape of the points for missing data in R? I am plotting .csv files like this one in a lollipop style.
```
Name,chr,Pos,Reads...ME_016,Reads...ME_017,Reads...ME_018,Reads...ME_019
cg01389728,chr10,6620395,33.82,41.38,41.38,38.46
cg01389728,chr10,6620410,0,-,-,-
cg01389728,chr10,6620430,0,... | 2014/11/25 | [
"https://Stackoverflow.com/questions/27127826",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3401516/"
] | This comes pretty close, I think.

```
ggplot(dataset, aes(x=Pos, y=variable,
color=cut(value, breaks=10),
shape=ifelse(is.na(value),"Missing","Present"))) +
geom_point(size=4) +
geom_line() +
scale_shape_manual(name="",values=c(... | Here is another approach that comes closer to producing the graph you specified (circular points with black outline and fill color determined by coverage).
```
fill.colors <- hcl(h=seq(15, 375, length=11), l=65, c=100)[1:10]
ggplot(dataset, aes(x=Pos, y=variable,
fill=cut(value, breaks=10),
... |
27,127,826 | Is there a way to change the shape of the points for missing data in R? I am plotting .csv files like this one in a lollipop style.
```
Name,chr,Pos,Reads...ME_016,Reads...ME_017,Reads...ME_018,Reads...ME_019
cg01389728,chr10,6620395,33.82,41.38,41.38,38.46
cg01389728,chr10,6620410,0,-,-,-
cg01389728,chr10,6620430,0,... | 2014/11/25 | [
"https://Stackoverflow.com/questions/27127826",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3401516/"
] | This comes pretty close, I think.

```
ggplot(dataset, aes(x=Pos, y=variable,
color=cut(value, breaks=10),
shape=ifelse(is.na(value),"Missing","Present"))) +
geom_point(size=4) +
geom_line() +
scale_shape_manual(name="",values=c(... | I can't see, why this is not working:
```
fill.colors <- hcl(h=seq(15, 375, length=11), l=65, c=100)[1:10]
ggplot(dataset, aes(x=Pos, y=variable
,color=cut(value, breaks=c(-0.01,10,20,30,40,50,60,70,80,90,100))
,shape=ifelse(is.na(value),"Missing","Present"))) +
geom_point(si... |
86,385 | I know that most of the people use "I belong to ABC" but I have seen "He is hailing from Mardan". So, Is there any difference?
Also, can I say "I belong to Swat" or "I belong to Mingora"? Swat is the name of my district while Mingora is the city where I live. | 2016/04/02 | [
"https://ell.stackexchange.com/questions/86385",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/31692/"
] | You do not "belong to" a country.
It is possible to say: "I belong here", meaning: I feel at home here and I will always live here.
"Hailing from" is formal and also a little bit old-fashioned.
"I am from" remains the best option, and also "I am originally from..." if you want to give the idea of origins/ r... | I hail from Swat vs I belong to Swat
If you want to say that some place is your place of birth, or the place where you live, you usually use the phrasal verb "come from'. For example:
I come from Swat.
You can also use the phrasal verb "hail from" instead, but it's usually used in formal English.
As for the use of ... |
86,385 | I know that most of the people use "I belong to ABC" but I have seen "He is hailing from Mardan". So, Is there any difference?
Also, can I say "I belong to Swat" or "I belong to Mingora"? Swat is the name of my district while Mingora is the city where I live. | 2016/04/02 | [
"https://ell.stackexchange.com/questions/86385",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/31692/"
] | In American English, one would usually just say
>
> 1 I am from Mingora, Swat.
>
>
> 2 I am from Swat. I am from the Switzerland of the East. I am from Pakistan.
>
>
>
We don't usually say
>
> ? 3 I come from somewhere.
>
>
>
But we can say that to stress that we are not from the place that we are cu... | I hail from Swat vs I belong to Swat
If you want to say that some place is your place of birth, or the place where you live, you usually use the phrasal verb "come from'. For example:
I come from Swat.
You can also use the phrasal verb "hail from" instead, but it's usually used in formal English.
As for the use of ... |
3,013,259 | I am trying to show that the $\sigma$-algebra generated by $F = \{A \subseteq \mathbb{R} : 0 \in A^{\circ} \text{or } 0 \in (A^c)^\circ\}$ contains all singleton sets $\{x\} \in \mathbb{R}$.
I know that $F$ is an algebra. I believe $F$ itself is **not** a $\sigma$-algebra, since, if we take an infinite sequence of $A\... | 2018/11/25 | [
"https://math.stackexchange.com/questions/3013259",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/397536/"
] | It contains $\{0\}$ because that is the intersection of the sets $A\_n = (-\frac{1}{n},\frac{1}{n})$, which all verify $0\in A\_n^\circ$, hence $A\_n \in F$. On the other hand, if $x\in\mathbb{R}\setminus \{0\}$, then we have that $\{x\}$ is closed and $\{x\}^c$ is an open set containing $0$, hence $\{x\} \in F$. | Every $S\subset \Bbb R$ belongs to $\sigma(F).$
(I)... $S\setminus (-1/n,1/n)\in F$ for each $n\in \Bbb N$ so $S\setminus \{0\}=\cup\_{n\in \Bbb N}\,(\,S\setminus (-1/n,1/n)\,)\in \sigma (F).$
(II)... $(-1/n,1/n)\in F$ for each $n\in \Bbb N$ so $\{0\}=\cap\_{n\in \Bbb N}(-1/n,1/n)\in \sigma (F).$
(III)... So either ... |
43,871,090 | I found [this](https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_popup) on how to make a popout on click in Javascript, however I am trying to alter it a bit so when it's clicked on it should automatically disappear again after some seconds... But i can't get it to work, i tried to set the animation to
```... | 2017/05/09 | [
"https://Stackoverflow.com/questions/43871090",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I think you need to set the default state of `.popup .show` to `opacity: 0` because after the animation runs it will return to the default state you define.
```
.popup .show {
opacity: 0; /* add this */
visibility: visible;
-webkit-animation: fadeIn 3s;
animation: fadeIn 3s;
}
```
```js
function myFu... | Your fade in should be:
```
@keyframes fadeIn {
0% {opacity: 0;}
100%{opacity: 1;}
}
```
By setting it back to 0 at 100% like you do, it does a fadeIn / fadeOut animation
EDIT: Sorry I got the question wrong |
16,237,441 | If I have this list...
```
<div class="class1">
<div class="class2">
<div class="class3">
<span class="class4">test</span>
</div>
</div>
</div>
<div class="class1">
<div class="class2">
<div class="class3">
<span class="class4">test</span>
</div>
... | 2013/04/26 | [
"https://Stackoverflow.com/questions/16237441",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1902402/"
] | You can use `:last`
<http://api.jquery.com/last-selector/>
```
$(".class4:last").addClass("class5");
``` | There is a stray closing parenthesis after `.class4` in your selector:
```
jQuery(".class4").addclass("class5");
```
This still does not work because `addClass` is case sensitive[1]:
```
jQuery(".class4").addClass("class5");
```
But to target only the last `.class4` you can use the `:last` pseudo-selector[2]...
... |
16,237,441 | If I have this list...
```
<div class="class1">
<div class="class2">
<div class="class3">
<span class="class4">test</span>
</div>
</div>
</div>
<div class="class1">
<div class="class2">
<div class="class3">
<span class="class4">test</span>
</div>
... | 2013/04/26 | [
"https://Stackoverflow.com/questions/16237441",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1902402/"
] | Use [last](http://api.jquery.com/last/):
```
jQuery('.class4').last().addClass('class5');
``` | There is a stray closing parenthesis after `.class4` in your selector:
```
jQuery(".class4").addclass("class5");
```
This still does not work because `addClass` is case sensitive[1]:
```
jQuery(".class4").addClass("class5");
```
But to target only the last `.class4` you can use the `:last` pseudo-selector[2]...
... |
16,237,441 | If I have this list...
```
<div class="class1">
<div class="class2">
<div class="class3">
<span class="class4">test</span>
</div>
</div>
</div>
<div class="class1">
<div class="class2">
<div class="class3">
<span class="class4">test</span>
</div>
... | 2013/04/26 | [
"https://Stackoverflow.com/questions/16237441",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1902402/"
] | Use the last selector of jQuery
<http://api.jquery.com/last-selector/>
```
$(".class4:last").addClass("class5")
``` | There is a stray closing parenthesis after `.class4` in your selector:
```
jQuery(".class4").addclass("class5");
```
This still does not work because `addClass` is case sensitive[1]:
```
jQuery(".class4").addClass("class5");
```
But to target only the last `.class4` you can use the `:last` pseudo-selector[2]...
... |
16,237,441 | If I have this list...
```
<div class="class1">
<div class="class2">
<div class="class3">
<span class="class4">test</span>
</div>
</div>
</div>
<div class="class1">
<div class="class2">
<div class="class3">
<span class="class4">test</span>
</div>
... | 2013/04/26 | [
"https://Stackoverflow.com/questions/16237441",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1902402/"
] | Use
```
jQuery('.class4').last().addClass('class5');
``` | There is a stray closing parenthesis after `.class4` in your selector:
```
jQuery(".class4").addclass("class5");
```
This still does not work because `addClass` is case sensitive[1]:
```
jQuery(".class4").addClass("class5");
```
But to target only the last `.class4` you can use the `:last` pseudo-selector[2]...
... |
16,237,441 | If I have this list...
```
<div class="class1">
<div class="class2">
<div class="class3">
<span class="class4">test</span>
</div>
</div>
</div>
<div class="class1">
<div class="class2">
<div class="class3">
<span class="class4">test</span>
</div>
... | 2013/04/26 | [
"https://Stackoverflow.com/questions/16237441",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1902402/"
] | Use [last](http://api.jquery.com/last/):
```
jQuery('.class4').last().addClass('class5');
``` | You can use `:last`
<http://api.jquery.com/last-selector/>
```
$(".class4:last").addClass("class5");
``` |
16,237,441 | If I have this list...
```
<div class="class1">
<div class="class2">
<div class="class3">
<span class="class4">test</span>
</div>
</div>
</div>
<div class="class1">
<div class="class2">
<div class="class3">
<span class="class4">test</span>
</div>
... | 2013/04/26 | [
"https://Stackoverflow.com/questions/16237441",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1902402/"
] | Use
```
jQuery('.class4').last().addClass('class5');
``` | You can use `:last`
<http://api.jquery.com/last-selector/>
```
$(".class4:last").addClass("class5");
``` |
16,237,441 | If I have this list...
```
<div class="class1">
<div class="class2">
<div class="class3">
<span class="class4">test</span>
</div>
</div>
</div>
<div class="class1">
<div class="class2">
<div class="class3">
<span class="class4">test</span>
</div>
... | 2013/04/26 | [
"https://Stackoverflow.com/questions/16237441",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1902402/"
] | Use [last](http://api.jquery.com/last/):
```
jQuery('.class4').last().addClass('class5');
``` | Use the last selector of jQuery
<http://api.jquery.com/last-selector/>
```
$(".class4:last").addClass("class5")
``` |
16,237,441 | If I have this list...
```
<div class="class1">
<div class="class2">
<div class="class3">
<span class="class4">test</span>
</div>
</div>
</div>
<div class="class1">
<div class="class2">
<div class="class3">
<span class="class4">test</span>
</div>
... | 2013/04/26 | [
"https://Stackoverflow.com/questions/16237441",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1902402/"
] | Use
```
jQuery('.class4').last().addClass('class5');
``` | Use [last](http://api.jquery.com/last/):
```
jQuery('.class4').last().addClass('class5');
``` |
16,237,441 | If I have this list...
```
<div class="class1">
<div class="class2">
<div class="class3">
<span class="class4">test</span>
</div>
</div>
</div>
<div class="class1">
<div class="class2">
<div class="class3">
<span class="class4">test</span>
</div>
... | 2013/04/26 | [
"https://Stackoverflow.com/questions/16237441",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1902402/"
] | Use
```
jQuery('.class4').last().addClass('class5');
``` | Use the last selector of jQuery
<http://api.jquery.com/last-selector/>
```
$(".class4:last").addClass("class5")
``` |
679,924 | Can somebody please explain the following application of L’Hospital’s Rule?
Find the limit:
$$\lim\_{x\rightarrow 0} \frac{5^x-3^x}{x}$$
Solution:
Determining that this function has indeterminate form $0/0$, we apply L’Hospital’s rule.
Applying L.H. rule, we get $\lim\_{x\to0} \frac{5^x\ln 5- 3^x\ln 3}{1} = \lim\... | 2014/02/17 | [
"https://math.stackexchange.com/questions/679924",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/129478/"
] | The exterior of the Alexander Horned sphere (Hatcher p.171-172) has $H\_1=0$ but $\pi\_1\neq 0$. (This is what Hatcher refers to as $\mathbb{R}^3\smallsetminus B$.)
Below is a diagram I made to help with Hatcher's computation of $\pi\_1$ of the horned sphere. You'll find a fuller explanation in my [Hatcher notes](http... | First, suppose that you have a compact connected submanifold $C$ with nonempty boundary in 3d sphere. If some boundary components are spheres, you add the 3-ball which they bound $C$ without changing 1st homology or fundamental group. Suppose the result, which I will still call $C$, still has nonempty boundary. Recall ... |
730,967 | When assigning a default default-value to a field (here false to a bool), FxCop says:
```
Resolution : "'Bar.Bar()' initializes field 'Bar.foo'
of type 'bool' to false. Remove this initialization
because it will be done automatically by the runtime."
```
Now, I know that code as `in... | 2009/04/08 | [
"https://Stackoverflow.com/questions/730967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/86751/"
] | FxCop has to provide rules for everyone, so if this rule doesn't appeal to you, just exclude it.
Now, I would suggest that if you want to explicitly declare a default value, use a constant (or static readonly variable) to do it. It will be even clearer than initializing with a value, and FXCop won't complain.
```cs
p... | It's relies not on every programmer knowing some locally defined "corporate standard" which might change between at any time, but on something formally defined in the Standard. You might as well say "don't using `x++` because that relies on the knowledge of every programmer. |
730,967 | When assigning a default default-value to a field (here false to a bool), FxCop says:
```
Resolution : "'Bar.Bar()' initializes field 'Bar.foo'
of type 'bool' to false. Remove this initialization
because it will be done automatically by the runtime."
```
Now, I know that code as `in... | 2009/04/08 | [
"https://Stackoverflow.com/questions/730967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/86751/"
] | There can be significant performance benefits from this, in some cases. For details, [see this CodeProject article.](http://www.codeproject.com/KB/dotnet/DontInitializeVariables.aspx?fid=182387&df=90&mpp=25&noise=3&sort=Position&view=Quick&select=1112738)
The main issue is that it is unnecessary in C#. In C++, things ... | You have to remember that FxCop rules are only guidelines, they are not unbreakable. It even says so on the page for the description of the rule you mentioned (<http://msdn.microsoft.com/en-us/library/ms182274(VS.80).aspx>, emphasis mine):
**When to Exclude Warnings**:
Exclude a warning from this rule if the construc... |
730,967 | When assigning a default default-value to a field (here false to a bool), FxCop says:
```
Resolution : "'Bar.Bar()' initializes field 'Bar.foo'
of type 'bool' to false. Remove this initialization
because it will be done automatically by the runtime."
```
Now, I know that code as `in... | 2009/04/08 | [
"https://Stackoverflow.com/questions/730967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/86751/"
] | [Reed Copsey said](https://stackoverflow.com/a/730990/146622) specifying default values for fields impacts performance, and he refers to [a test from 2005](http://www.codeproject.com/Articles/10439/Gain-performance-by-not-initializing-variables).
```csharp
public class A
{
// Use CLR's default value
private in... | It's relies not on every programmer knowing some locally defined "corporate standard" which might change between at any time, but on something formally defined in the Standard. You might as well say "don't using `x++` because that relies on the knowledge of every programmer. |
730,967 | When assigning a default default-value to a field (here false to a bool), FxCop says:
```
Resolution : "'Bar.Bar()' initializes field 'Bar.foo'
of type 'bool' to false. Remove this initialization
because it will be done automatically by the runtime."
```
Now, I know that code as `in... | 2009/04/08 | [
"https://Stackoverflow.com/questions/730967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/86751/"
] | [Reed Copsey said](https://stackoverflow.com/a/730990/146622) specifying default values for fields impacts performance, and he refers to [a test from 2005](http://www.codeproject.com/Articles/10439/Gain-performance-by-not-initializing-variables).
```csharp
public class A
{
// Use CLR's default value
private in... | FX Cop sees it as adding unnecessary code and unnecessary code is bad. I agree with you, I like to see what it's set to, I think it makes it easier to read.
A similar problem we encounter is, for documentation reasons we may create an empty constructor like this
```cs
/// <summary>
/// a test class
/// </summary>
///... |
730,967 | When assigning a default default-value to a field (here false to a bool), FxCop says:
```
Resolution : "'Bar.Bar()' initializes field 'Bar.foo'
of type 'bool' to false. Remove this initialization
because it will be done automatically by the runtime."
```
Now, I know that code as `in... | 2009/04/08 | [
"https://Stackoverflow.com/questions/730967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/86751/"
] | There can be significant performance benefits from this, in some cases. For details, [see this CodeProject article.](http://www.codeproject.com/KB/dotnet/DontInitializeVariables.aspx?fid=182387&df=90&mpp=25&noise=3&sort=Position&view=Quick&select=1112738)
The main issue is that it is unnecessary in C#. In C++, things ... | FxCop has to provide rules for everyone, so if this rule doesn't appeal to you, just exclude it.
Now, I would suggest that if you want to explicitly declare a default value, use a constant (or static readonly variable) to do it. It will be even clearer than initializing with a value, and FXCop won't complain.
```cs
p... |
730,967 | When assigning a default default-value to a field (here false to a bool), FxCop says:
```
Resolution : "'Bar.Bar()' initializes field 'Bar.foo'
of type 'bool' to false. Remove this initialization
because it will be done automatically by the runtime."
```
Now, I know that code as `in... | 2009/04/08 | [
"https://Stackoverflow.com/questions/730967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/86751/"
] | There can be significant performance benefits from this, in some cases. For details, [see this CodeProject article.](http://www.codeproject.com/KB/dotnet/DontInitializeVariables.aspx?fid=182387&df=90&mpp=25&noise=3&sort=Position&view=Quick&select=1112738)
The main issue is that it is unnecessary in C#. In C++, things ... | FX Cop sees it as adding unnecessary code and unnecessary code is bad. I agree with you, I like to see what it's set to, I think it makes it easier to read.
A similar problem we encounter is, for documentation reasons we may create an empty constructor like this
```cs
/// <summary>
/// a test class
/// </summary>
///... |
730,967 | When assigning a default default-value to a field (here false to a bool), FxCop says:
```
Resolution : "'Bar.Bar()' initializes field 'Bar.foo'
of type 'bool' to false. Remove this initialization
because it will be done automatically by the runtime."
```
Now, I know that code as `in... | 2009/04/08 | [
"https://Stackoverflow.com/questions/730967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/86751/"
] | There can be significant performance benefits from this, in some cases. For details, [see this CodeProject article.](http://www.codeproject.com/KB/dotnet/DontInitializeVariables.aspx?fid=182387&df=90&mpp=25&noise=3&sort=Position&view=Quick&select=1112738)
The main issue is that it is unnecessary in C#. In C++, things ... | It's relies not on every programmer knowing some locally defined "corporate standard" which might change between at any time, but on something formally defined in the Standard. You might as well say "don't using `x++` because that relies on the knowledge of every programmer. |
730,967 | When assigning a default default-value to a field (here false to a bool), FxCop says:
```
Resolution : "'Bar.Bar()' initializes field 'Bar.foo'
of type 'bool' to false. Remove this initialization
because it will be done automatically by the runtime."
```
Now, I know that code as `in... | 2009/04/08 | [
"https://Stackoverflow.com/questions/730967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/86751/"
] | [Reed Copsey said](https://stackoverflow.com/a/730990/146622) specifying default values for fields impacts performance, and he refers to [a test from 2005](http://www.codeproject.com/Articles/10439/Gain-performance-by-not-initializing-variables).
```csharp
public class A
{
// Use CLR's default value
private in... | You have to remember that FxCop rules are only guidelines, they are not unbreakable. It even says so on the page for the description of the rule you mentioned (<http://msdn.microsoft.com/en-us/library/ms182274(VS.80).aspx>, emphasis mine):
**When to Exclude Warnings**:
Exclude a warning from this rule if the construc... |
730,967 | When assigning a default default-value to a field (here false to a bool), FxCop says:
```
Resolution : "'Bar.Bar()' initializes field 'Bar.foo'
of type 'bool' to false. Remove this initialization
because it will be done automatically by the runtime."
```
Now, I know that code as `in... | 2009/04/08 | [
"https://Stackoverflow.com/questions/730967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/86751/"
] | FxCop has to provide rules for everyone, so if this rule doesn't appeal to you, just exclude it.
Now, I would suggest that if you want to explicitly declare a default value, use a constant (or static readonly variable) to do it. It will be even clearer than initializing with a value, and FXCop won't complain.
```cs
p... | You have to remember that FxCop rules are only guidelines, they are not unbreakable. It even says so on the page for the description of the rule you mentioned (<http://msdn.microsoft.com/en-us/library/ms182274(VS.80).aspx>, emphasis mine):
**When to Exclude Warnings**:
Exclude a warning from this rule if the construc... |
730,967 | When assigning a default default-value to a field (here false to a bool), FxCop says:
```
Resolution : "'Bar.Bar()' initializes field 'Bar.foo'
of type 'bool' to false. Remove this initialization
because it will be done automatically by the runtime."
```
Now, I know that code as `in... | 2009/04/08 | [
"https://Stackoverflow.com/questions/730967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/86751/"
] | There can be significant performance benefits from this, in some cases. For details, [see this CodeProject article.](http://www.codeproject.com/KB/dotnet/DontInitializeVariables.aspx?fid=182387&df=90&mpp=25&noise=3&sort=Position&view=Quick&select=1112738)
The main issue is that it is unnecessary in C#. In C++, things ... | [Reed Copsey said](https://stackoverflow.com/a/730990/146622) specifying default values for fields impacts performance, and he refers to [a test from 2005](http://www.codeproject.com/Articles/10439/Gain-performance-by-not-initializing-variables).
```csharp
public class A
{
// Use CLR's default value
private in... |
45,847,724 | I'm trying to better understand the magic behind git-rebase. I was very pleasantly surprised today by the following behavior, which I didn't expect.
TLDR: I rebased a shared branch, causing all commit sha1s to change. Despite this, a derived branch was able to accurately identify that its original commits were "alias... | 2017/08/23 | [
"https://Stackoverflow.com/questions/45847724",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4816322/"
] | Internally, `git rebase` lists commits that should be rebased, and then computes a [patch-id](https://git-scm.com/docs/git-patch-id) for these commits. Unlike the commit id, it only hashes the content of the *patch*, not the content of the tree and commit objects. **So, A1 and A2, while having different identifiers, ha... | **The branch-Y commits are empty upon the second rebase**
There is really no magic hidden inside. Rebase searches for common history and ignores it (only commit M1 in this case). Detaches the history from rebased branch (Y) and tries to pick it on the new base (branch-X).
The picking method derives a patch from a pre... |
45,847,724 | I'm trying to better understand the magic behind git-rebase. I was very pleasantly surprised today by the following behavior, which I didn't expect.
TLDR: I rebased a shared branch, causing all commit sha1s to change. Despite this, a derived branch was able to accurately identify that its original commits were "alias... | 2017/08/23 | [
"https://Stackoverflow.com/questions/45847724",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4816322/"
] | There are in fact several different method `git rebase` uses to eliminate redundant copies.
### Patch-ID
The first, and safest, one is via the same method that [`git cherry`](https://www.kernel.org/pub/software/scm/git/docs/git-cherry.html) uses to identify cherry-picked commits. If you read the linked documentation,... | **The branch-Y commits are empty upon the second rebase**
There is really no magic hidden inside. Rebase searches for common history and ignores it (only commit M1 in this case). Detaches the history from rebased branch (Y) and tries to pick it on the new base (branch-X).
The picking method derives a patch from a pre... |
45,847,724 | I'm trying to better understand the magic behind git-rebase. I was very pleasantly surprised today by the following behavior, which I didn't expect.
TLDR: I rebased a shared branch, causing all commit sha1s to change. Despite this, a derived branch was able to accurately identify that its original commits were "alias... | 2017/08/23 | [
"https://Stackoverflow.com/questions/45847724",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4816322/"
] | Internally, `git rebase` lists commits that should be rebased, and then computes a [patch-id](https://git-scm.com/docs/git-patch-id) for these commits. Unlike the commit id, it only hashes the content of the *patch*, not the content of the tree and commit objects. **So, A1 and A2, while having different identifiers, ha... | There are in fact several different method `git rebase` uses to eliminate redundant copies.
### Patch-ID
The first, and safest, one is via the same method that [`git cherry`](https://www.kernel.org/pub/software/scm/git/docs/git-cherry.html) uses to identify cherry-picked commits. If you read the linked documentation,... |
44,890,720 | I have a large size 2d numpy array (*size = (2000, 2000)*) with only five possible values *1.0, 2.0, 3.0, 4.0* and *5.0*. I want to save and show this array as an image in RGB colored format, here each unique value of array should be represented by different color. Please help i am a beginner to python. | 2017/07/03 | [
"https://Stackoverflow.com/questions/44890720",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8238751/"
] | You could use `PIL.Image` to do that, but first transform your array.
You could say for example, that:
1. 1.0 Should be red, represented as (255,0,0)
2. 2.0 Should be green -> (0,255,0)
3. 3.0 Should be blue -> (0,0,255)
4. 4.0 Should be black -> (0,0,0)
5. 5.0 Should be white -> (255,255,255)
You could of course ch... | `matplotlib` is useful for tasks like this, though there are other ways.
Here's an example:
```
import numpy as np
import matplotlib.image
src = np.zeros((200,200))
print src.shape
rgb = np.zeros((200,200,3))
print rgb.shape
src[10,10] = 1
src[20,20] = 2
src[30,30] = 3
for i in range(src.shape[0]):
for j in ra... |
29,380,972 | When I am getting a value back from an API that I am hitting, when I print the data it appears as
```
Optional((
jknjknjkn
))
```
for example. I use a selector to run a method when the data is returned
```
func result(data: AnyObject){
println(data["info"])
}
```
What is printed is the Optional thing above.... | 2015/04/01 | [
"https://Stackoverflow.com/questions/29380972",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1978820/"
] | In Swift, an optional is a variable that can either hold a value or `nil` (no value at all). To get the value from it, you have to *unwrap* it with an exclamation point:
```
func result(data: AnyObject){
println(data["info"]!)
}
```
Note that if `data["info"]` was `nil`, your app would crash with this error messa... | Disregard this, I am trying to use Parse in a swift project and their documentation has multiple ways to show the code. I just copied a different code block and now I am able to do what I need to do just fine. |
33,952,311 | I am trying to access a single table inside of a single function using python and tornado.
From the suggestions for my previous question am trying to use `Bulk` operation available in `mongodb` to do so. My attempt to insert was successful but during update am getting error.
My code is
```
bulk = db.Test.initialize_... | 2015/11/27 | [
"https://Stackoverflow.com/questions/33952311",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5039470/"
] | You need to `.find()` what you want to `.update()`.
```
bulk.find({"test": "we"}).update({'$set': {"test": "false"}, '$unset': {"Cid", ""}})
```
Also you to find documents in your collection simply use the [`.find`](https://api.mongodb.org/python/current/api/pymongo/collection.html?highlight=find#pymongo.collection.... | If you're using Motor, you need to "yield" the Future returned by bulk.execute in order to await its completion and get a result:
```
@gen.coroutine
def f():
bulk = db.Test.initialize_unordered_bulk_op()
print("1")
bulk.insert({"test":"we"})
# bulk.find({"test": "we"})
bulk.update({"test": "we"},{'... |
40,781,651 | Very simple vba problem, not sure where it is going wrong, but:
```
Range("J21").Select
For tastetherainbow = 1 To 1000
skittle = ActiveCell.Offset(0, 2).Value
Selection.Interior.Color = skittle
ActiveCell.Offset(1, 0).Select
Next
```
The cell containing each appropriate skittle value contain... | 2016/11/24 | [
"https://Stackoverflow.com/questions/40781651",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6948125/"
] | It's recommended not using `Select` , `Selection` and `ActiveCell` , instead I preffer to start the `For` loop from Cell "J21" and just advance the row by 1.
**Code**
```
Option Explicit
Sub CellColors()
Dim Skittle As Long
Dim tastetherainbow As Long
' modify "Sheet1" to your sheet's name
With Sheets("Sheet1")
... | ```
'little modification is required in your code as follows
Range("J21").Select
For tastetherainbow = 1 To 1000
skittle = ActiveCell.Offset(0, 2).Value
Selection.Interior.Color = RGB(skittle)
ActiveCell.Offset(1, 0).Select
Next
``` |
40,781,651 | Very simple vba problem, not sure where it is going wrong, but:
```
Range("J21").Select
For tastetherainbow = 1 To 1000
skittle = ActiveCell.Offset(0, 2).Value
Selection.Interior.Color = skittle
ActiveCell.Offset(1, 0).Select
Next
```
The cell containing each appropriate skittle value contain... | 2016/11/24 | [
"https://Stackoverflow.com/questions/40781651",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6948125/"
] | Thanks for all the help guys, I modified it and cheated a little... This is running as part of a *much* larger macro, so I decided to just make the array of R, G, and B values explicit, and do it this way. From reading online Victor it says that RGB() expects values as integers - Long is more efficient but does the sam... | ```
'little modification is required in your code as follows
Range("J21").Select
For tastetherainbow = 1 To 1000
skittle = ActiveCell.Offset(0, 2).Value
Selection.Interior.Color = RGB(skittle)
ActiveCell.Offset(1, 0).Select
Next
``` |
54,873,755 | I am trying to set up a grid of thumbnails for blog posts using Bootstrap 4.
The size of the columns are `col-md-6`. Inside each of the columns is an anchor with a background photo, and a black -> transparent gradient overlay.
It all works fine, however, the gradient overlay is expanding past the width of the contain... | 2019/02/25 | [
"https://Stackoverflow.com/questions/54873755",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4220994/"
] | Add a rule in your css:
```
.img-holder { position: relative; }
```
I think your issue is that `.dualGradient` is positioned absolutely, but the nearest parent that has a position set is the `.dualBlogCallout`.
By default, anything that has `position: absolute` will traverse up the markup to find the nearest elemen... | `position: relative;` is missing on your `img-holder` class. Here is a solution displaying your code.
Note: I added the border radius class because that was not included in the original post
```css
.img-holder {
position: relative;
}
.dualBlogCallout{
color: white;
position: relative;
width: 100%;
b... |
24,128,602 | I was wondering how I could create a new directory for each user that registered to my site so that they would be able to upload their material to their own directory. I've looked all over the place but haven't really found anything that I could use, because I need it to be dynamic, and I've only found how to name the ... | 2014/06/09 | [
"https://Stackoverflow.com/questions/24128602",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3712497/"
] | Say `$user` contains username of the user this will do the work.
```
$user = "youruser";
if (!file_exists("path/to/".$user)) {
mkdir("path/to/".$user, 0755, true);
}
```
be careful about permissions and input sanitization. | Use `mkdir` function : `mkdir("some/path/{$username}", 0755);` |
47,066,725 | Hi I am trying to compare the last seen time of a user to now using flask-moment. Here is the logic:
```
user.last_seen = 3 mins ago #I already know how to get this using flask-moment
time_now = 5:00 pm
```
My goal is to do this:
```
{% if (time_now - user.last_seen) <= 5 mins %}
...do something...
{% else %}
...d... | 2017/11/02 | [
"https://Stackoverflow.com/questions/47066725",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8624007/"
] | The pattern for resource folder names is defined in Table 2 here:
<https://developer.android.com/guide/topics/resources/providing-resources.html#Alternative%20Resources>
Specifically, try:
`font-zh-rCN` | As @SeanBarbeau pointed out, the correct pattern should be `{language}-r{country}`.
I definitely have tried this 4 months ago before I asked this question, but at that time, I believe there are other factors which make it fail.
And therefore I would like to add some more info here, in the hope of helping more people ... |
419,732 | How we can show if the sum of $$\lim\_{n\rightarrow \infty }\sum\_{k=0}^{n} \frac{1}{{n \choose k}}$$ converges and then find the result of the sum if it converges?
Thanks for any help. | 2013/06/13 | [
"https://math.stackexchange.com/questions/419732",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/58529/"
] | By the linearity of expectation, we have:
$$
E(Y) = E(-X + 1) = -E(X) + 1
$$
Alternatively, you could use the definition directly. Let $Y=g(X)=-X+1$. Then:
$$ \begin{align\*}
E(Y)&=E(g(X))\\
&=\int\_{-\infty}^\infty g(x)f(x)dx\\
&=\int\_{-\infty}^\infty(-x+1)f(x)dx\\
&=-\int\_{-\infty}^\infty xf(x)dx + \int\_{-\infty}... | You can calculate the expected value of some function $g$ of $X$ using the following formula:
$$E[g(X)]=\int\_{-\infty}^{\infty}g(x)f(x)\:dx$$
An explanation for this can be found on the [wikipedia page](http://en.wikipedia.org/wiki/Expected_value#General_definition). |
9,157 | I am teaching some students how to write a 5-paragraph essay. Their writing is coming together, but when it comes to conclusions, they get lost. They have difficulty assembling the ideas for a conclusion. I can show them a list of ideal features, show them sample conclusions, and give them a list of types of conclusion... | 2013/10/14 | [
"https://writers.stackexchange.com/questions/9157",
"https://writers.stackexchange.com",
"https://writers.stackexchange.com/users/3375/"
] | Different schools have different methods (for example, some insist that the last line of the introduction must be the thesis statement), but I learned that a "conclusion" is essentially reiterating the essay. So they summarize each paragraph in one or two sentences, and that's the conclusion.
From the old saw about s... | Conclusions wrap up what you have been saying in your paper. They tie up any loose ends, briefly summarize the focal point of the paper, and ultimately end the paper with any relevant last words.
[Conclusions](https://owl.english.purdue.edu/owl/resource/724/04/)
As per the linked resource from Purdue's Online Writing... |
9,157 | I am teaching some students how to write a 5-paragraph essay. Their writing is coming together, but when it comes to conclusions, they get lost. They have difficulty assembling the ideas for a conclusion. I can show them a list of ideal features, show them sample conclusions, and give them a list of types of conclusion... | 2013/10/14 | [
"https://writers.stackexchange.com/questions/9157",
"https://writers.stackexchange.com",
"https://writers.stackexchange.com/users/3375/"
] | Different schools have different methods (for example, some insist that the last line of the introduction must be the thesis statement), but I learned that a "conclusion" is essentially reiterating the essay. So they summarize each paragraph in one or two sentences, and that's the conclusion.
From the old saw about s... | In the concluding paragraph you should include the following:
1. An allusion to the pattern used in the introductory paragraph.
2. A restatement of the thesis statement, using some of the original language or language that "echoes" the original language. (The restatement, however, must not be a duplicate thesis statem... |
41,176 | I have a dataset as `(var1, var2, out)`, where the ordered pair `<var1, var2>` gives `out`. Most of the frequent pattern mining algorithms like the Apriori and FP growth algorithms do not preserve the order of `var1` and `var2`.
Which are some of the available pattern mining algorithms (maybe also a NN trick), to find... | 2018/11/13 | [
"https://datascience.stackexchange.com/questions/41176",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/54968/"
] | You begin by asking about image normalisation, but then refer to other techniques, which I believe all fall under "image augmentation". So I will answer the more general question:
>
> how can I perform image augmentation to improve my model?
>
>
>
I would generally say that the more augmentation you can apply, th... | [Keras data argumention](https://keras.io/preprocessing/image/) could be a right tool for you. |
41,176 | I have a dataset as `(var1, var2, out)`, where the ordered pair `<var1, var2>` gives `out`. Most of the frequent pattern mining algorithms like the Apriori and FP growth algorithms do not preserve the order of `var1` and `var2`.
Which are some of the available pattern mining algorithms (maybe also a NN trick), to find... | 2018/11/13 | [
"https://datascience.stackexchange.com/questions/41176",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/54968/"
] | **Disclaimer:** I will try to answer the question but promote [Image Augmentation Library Albumentations](https://github.com/albu/albumentations), which may collaborators and I develop in free time and which we believe is the best image augmentation library at the market :)
There are many ways to augment the image dat... | [Keras data argumention](https://keras.io/preprocessing/image/) could be a right tool for you. |
41,176 | I have a dataset as `(var1, var2, out)`, where the ordered pair `<var1, var2>` gives `out`. Most of the frequent pattern mining algorithms like the Apriori and FP growth algorithms do not preserve the order of `var1` and `var2`.
Which are some of the available pattern mining algorithms (maybe also a NN trick), to find... | 2018/11/13 | [
"https://datascience.stackexchange.com/questions/41176",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/54968/"
] | You begin by asking about image normalisation, but then refer to other techniques, which I believe all fall under "image augmentation". So I will answer the more general question:
>
> how can I perform image augmentation to improve my model?
>
>
>
I would generally say that the more augmentation you can apply, th... | **Disclaimer:** I will try to answer the question but promote [Image Augmentation Library Albumentations](https://github.com/albu/albumentations), which may collaborators and I develop in free time and which we believe is the best image augmentation library at the market :)
There are many ways to augment the image dat... |
49,019,190 | I'm trying to implement a setInterval() method but I'm not sure exactly where to put it. Basically, I want this whole JavaScript script to run every minute or so. I think the code that I want to add is the one line I have added below, but I don't know exactly where to put it, and I don't know what the first parameter s... | 2018/02/27 | [
"https://Stackoverflow.com/questions/49019190",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9416738/"
] | You would need to do something like this
```
<!DOCTYPE html>
<html>
<head>
<title>Ethereum Tracker</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
function update(){
... | Assuming you want to update the price every minute, it should look like:
```
$(document).ready(function(){
setInterval(updatePrice,60000);
});
function updatePrice(){
let myData = "";
let dataTest = "";
$.get("https://api.coinmarketcap.com/v1/ticker/ethereum/",
function(data, status){
... |
8,905,429 | Long story short, the snippets below is about converting the texted month to numbered month (ex, Jan -> 1). There's no error but in the end I keep getting 0 as the result of m. Where's the problem?
```
//date1s[] is the result of splitting date1 by spaces (date1 = 1 Jan 2012)
m = convertMonth(date1s[1]); //date1s[1] c... | 2012/01/18 | [
"https://Stackoverflow.com/questions/8905429",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1147296/"
] | Instead of doing
```
if (monw == "Jan") {
x = 1;
}
```
Use,
```
if (monw.equals("Jan")) {
x = 1;
}
``` | Another lean approach would be, to store the Names in a List:
```
List <String> as = Arrays.asList ("Jan", "Feb", "Mar");
System.out.println (as.indexOf ("Feb"));
System.out.println (as.indexOf ("Fex"));
```
The first returns 1, the second -1. For you, you would add +1 to the 0-based index, and check for it not be... |
8,905,429 | Long story short, the snippets below is about converting the texted month to numbered month (ex, Jan -> 1). There's no error but in the end I keep getting 0 as the result of m. Where's the problem?
```
//date1s[] is the result of splitting date1 by spaces (date1 = 1 Jan 2012)
m = convertMonth(date1s[1]); //date1s[1] c... | 2012/01/18 | [
"https://Stackoverflow.com/questions/8905429",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1147296/"
] | In Java7, you can use the `switch` statement, instead of `if-else`. It supports String too. | ```
if ("Jan".equals (monw))
{
x = 1;
}
``` |
8,905,429 | Long story short, the snippets below is about converting the texted month to numbered month (ex, Jan -> 1). There's no error but in the end I keep getting 0 as the result of m. Where's the problem?
```
//date1s[] is the result of splitting date1 by spaces (date1 = 1 Jan 2012)
m = convertMonth(date1s[1]); //date1s[1] c... | 2012/01/18 | [
"https://Stackoverflow.com/questions/8905429",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1147296/"
] | Use the `.equals()` method of String.
`if (monw.equals("Jan"))`
When you use `==` operator, it compares the memory locations of the two objects and returns `false`. In other words, it only returns `true` if the same object is on both sides of equation. So you should use the `.equals()` method instead, which returns `... | You're using `==` rather than `equals()` for String comparison. |
8,905,429 | Long story short, the snippets below is about converting the texted month to numbered month (ex, Jan -> 1). There's no error but in the end I keep getting 0 as the result of m. Where's the problem?
```
//date1s[] is the result of splitting date1 by spaces (date1 = 1 Jan 2012)
m = convertMonth(date1s[1]); //date1s[1] c... | 2012/01/18 | [
"https://Stackoverflow.com/questions/8905429",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1147296/"
] | Use the `.equals()` method of String.
`if (monw.equals("Jan"))`
When you use `==` operator, it compares the memory locations of the two objects and returns `false`. In other words, it only returns `true` if the same object is on both sides of equation. So you should use the `.equals()` method instead, which returns `... | Your problem of string comparision is very well explained by others so I will not rewrite that. Other than that...
In your case, *if your month names are contant*, it will be *better* to use a `Map<String,Integer>` of month names and value or `Enum` having month names. It will omit your long `if...else..if...else` con... |
8,905,429 | Long story short, the snippets below is about converting the texted month to numbered month (ex, Jan -> 1). There's no error but in the end I keep getting 0 as the result of m. Where's the problem?
```
//date1s[] is the result of splitting date1 by spaces (date1 = 1 Jan 2012)
m = convertMonth(date1s[1]); //date1s[1] c... | 2012/01/18 | [
"https://Stackoverflow.com/questions/8905429",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1147296/"
] | Your problem of string comparision is very well explained by others so I will not rewrite that. Other than that...
In your case, *if your month names are contant*, it will be *better* to use a `Map<String,Integer>` of month names and value or `Enum` having month names. It will omit your long `if...else..if...else` con... | Another lean approach would be, to store the Names in a List:
```
List <String> as = Arrays.asList ("Jan", "Feb", "Mar");
System.out.println (as.indexOf ("Feb"));
System.out.println (as.indexOf ("Fex"));
```
The first returns 1, the second -1. For you, you would add +1 to the 0-based index, and check for it not be... |
8,905,429 | Long story short, the snippets below is about converting the texted month to numbered month (ex, Jan -> 1). There's no error but in the end I keep getting 0 as the result of m. Where's the problem?
```
//date1s[] is the result of splitting date1 by spaces (date1 = 1 Jan 2012)
m = convertMonth(date1s[1]); //date1s[1] c... | 2012/01/18 | [
"https://Stackoverflow.com/questions/8905429",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1147296/"
] | Use the `.equals()` method of String.
`if (monw.equals("Jan"))`
When you use `==` operator, it compares the memory locations of the two objects and returns `false`. In other words, it only returns `true` if the same object is on both sides of equation. So you should use the `.equals()` method instead, which returns `... | In Java7, you can use the `switch` statement, instead of `if-else`. It supports String too. |
8,905,429 | Long story short, the snippets below is about converting the texted month to numbered month (ex, Jan -> 1). There's no error but in the end I keep getting 0 as the result of m. Where's the problem?
```
//date1s[] is the result of splitting date1 by spaces (date1 = 1 Jan 2012)
m = convertMonth(date1s[1]); //date1s[1] c... | 2012/01/18 | [
"https://Stackoverflow.com/questions/8905429",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1147296/"
] | In Java7, you can use the `switch` statement, instead of `if-else`. It supports String too. | Another lean approach would be, to store the Names in a List:
```
List <String> as = Arrays.asList ("Jan", "Feb", "Mar");
System.out.println (as.indexOf ("Feb"));
System.out.println (as.indexOf ("Fex"));
```
The first returns 1, the second -1. For you, you would add +1 to the 0-based index, and check for it not be... |
8,905,429 | Long story short, the snippets below is about converting the texted month to numbered month (ex, Jan -> 1). There's no error but in the end I keep getting 0 as the result of m. Where's the problem?
```
//date1s[] is the result of splitting date1 by spaces (date1 = 1 Jan 2012)
m = convertMonth(date1s[1]); //date1s[1] c... | 2012/01/18 | [
"https://Stackoverflow.com/questions/8905429",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1147296/"
] | Your problem of string comparision is very well explained by others so I will not rewrite that. Other than that...
In your case, *if your month names are contant*, it will be *better* to use a `Map<String,Integer>` of month names and value or `Enum` having month names. It will omit your long `if...else..if...else` con... | ```
if ("Jan".equals (monw))
{
x = 1;
}
``` |
8,905,429 | Long story short, the snippets below is about converting the texted month to numbered month (ex, Jan -> 1). There's no error but in the end I keep getting 0 as the result of m. Where's the problem?
```
//date1s[] is the result of splitting date1 by spaces (date1 = 1 Jan 2012)
m = convertMonth(date1s[1]); //date1s[1] c... | 2012/01/18 | [
"https://Stackoverflow.com/questions/8905429",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1147296/"
] | Use the `.equals()` method of String.
`if (monw.equals("Jan"))`
When you use `==` operator, it compares the memory locations of the two objects and returns `false`. In other words, it only returns `true` if the same object is on both sides of equation. So you should use the `.equals()` method instead, which returns `... | Another lean approach would be, to store the Names in a List:
```
List <String> as = Arrays.asList ("Jan", "Feb", "Mar");
System.out.println (as.indexOf ("Feb"));
System.out.println (as.indexOf ("Fex"));
```
The first returns 1, the second -1. For you, you would add +1 to the 0-based index, and check for it not be... |
8,905,429 | Long story short, the snippets below is about converting the texted month to numbered month (ex, Jan -> 1). There's no error but in the end I keep getting 0 as the result of m. Where's the problem?
```
//date1s[] is the result of splitting date1 by spaces (date1 = 1 Jan 2012)
m = convertMonth(date1s[1]); //date1s[1] c... | 2012/01/18 | [
"https://Stackoverflow.com/questions/8905429",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1147296/"
] | Instead of doing
```
if (monw == "Jan") {
x = 1;
}
```
Use,
```
if (monw.equals("Jan")) {
x = 1;
}
``` | ```
if ("Jan".equals (monw))
{
x = 1;
}
``` |
43,083,308 | I have an issue with a little regex code I wrote. The code basically checks my "longString" which contains the string that's being checked and outputs the words in the string that matches the regex.
```
import java.util.regex.*;
public class regexPractice
{
public static void main(String[] args) {
Strin... | 2017/03/29 | [
"https://Stackoverflow.com/questions/43083308",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7783217/"
] | There are a couple of issues with your code.
1) The function parameters are not specified correctly; it should be:
```
function IterateThroughMachineSubkeys([string]$machine, [Microsoft.Win32.RegistryKey]$subKey)
{
...
}
```
2) The function call is incorrect; it should be:
```
IterateThroughMachineSubkeys -machi... | Had this problem, just wanted to point out what fixed it for me:
Print out the variable (echo, Write-Host whatever) and pay incredible attention to what it prints out.
In my case, I didn't assign a return value to a regex search inside my function, so it automatically printed out "True" inside my function, and printo... |
69,899,039 | My function is receiving a `JsValue`, now this json have lists, and this lists element could also be lists, for example:
```json
{
"firstName": "Elon",
"lastName": "Musk",
"companies": [
{
"name": "Tesla",
"city": "San Francisco",
"offices": ["sf", "ny"],
"management": {
"losc... | 2021/11/09 | [
"https://Stackoverflow.com/questions/69899039",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/827251/"
] | You can do:
```scala
val jsPath = JsPath \ "companies" \\ "management" \ "boardMembers" \\ "name"
val result = jsPath(Json.parse(input))
println(result)
```
Which will print the expected output. See [Scastie](https://scastie.scala-lang.org/7qndWdHvTBeZw0mGSt3qIQ) example.
Please note the difference between `\` and ... | As you can see in the documentation, you can use the `Reads` typeclass to define the way to decode types from JSON.
```scala
import play.api.libs.json._
val input = """{
"firstName": "Elon",
"lastName": "Musk",
"companies": [
{
"name": "Tesla",
"city": "San Francisco",
"offices": ["sf","ny... |
7,344,899 | I want to merge those two arrays and get only the unique key values. Is there a php function for this? array\_merge() doesn't work.
```
Array
(
[1] => 3
[2] => 4
[3] => 1
)
Array
(
[1] => 3
[2] => 1
[3] => 2
)
```
**RESULT ARRAY THAT I WANT**
```
Array
(
[1] => 1
[2] => 2
[3] ... | 2011/09/08 | [
"https://Stackoverflow.com/questions/7344899",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/69654/"
] | ```
$values = array_unique(array_merge($array1, $array2));
sort($values);
```
This returns the unique values from array1 and array2 (as per your example).
Try it here: <http://codepad.org/CeZewRNT>
See [`array_merge()`](http://php.net/array_merge) and [`array_unique()`](http://php.net/array_unqiue). | Try this:
```
$merged = array_unique(array_merge($array1, $array2));
``` |
7,344,899 | I want to merge those two arrays and get only the unique key values. Is there a php function for this? array\_merge() doesn't work.
```
Array
(
[1] => 3
[2] => 4
[3] => 1
)
Array
(
[1] => 3
[2] => 1
[3] => 2
)
```
**RESULT ARRAY THAT I WANT**
```
Array
(
[1] => 1
[2] => 2
[3] ... | 2011/09/08 | [
"https://Stackoverflow.com/questions/7344899",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/69654/"
] | ```
$values = array_unique(array_merge($array1, $array2));
sort($values);
```
This returns the unique values from array1 and array2 (as per your example).
Try it here: <http://codepad.org/CeZewRNT>
See [`array_merge()`](http://php.net/array_merge) and [`array_unique()`](http://php.net/array_unqiue). | ```
$merged = array_unique(array_merge($array1, $array2));
``` |
7,344,899 | I want to merge those two arrays and get only the unique key values. Is there a php function for this? array\_merge() doesn't work.
```
Array
(
[1] => 3
[2] => 4
[3] => 1
)
Array
(
[1] => 3
[2] => 1
[3] => 2
)
```
**RESULT ARRAY THAT I WANT**
```
Array
(
[1] => 1
[2] => 2
[3] ... | 2011/09/08 | [
"https://Stackoverflow.com/questions/7344899",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/69654/"
] | ```
$values = array_unique(array_merge($array1, $array2));
sort($values);
```
This returns the unique values from array1 and array2 (as per your example).
Try it here: <http://codepad.org/CeZewRNT>
See [`array_merge()`](http://php.net/array_merge) and [`array_unique()`](http://php.net/array_unqiue). | Following peice of code gives exact what you wants but the question is do you really want the keys in the result are starting from 1 instead of 0? If you don't Arnaud his option is the best solution.
```
$array1 = array(
1 => 3,
2 => 4,
3 => 1
);
$array2 = array(
1 => 3,
2 => 1,
3 => 2
);
$v... |
7,344,899 | I want to merge those two arrays and get only the unique key values. Is there a php function for this? array\_merge() doesn't work.
```
Array
(
[1] => 3
[2] => 4
[3] => 1
)
Array
(
[1] => 3
[2] => 1
[3] => 2
)
```
**RESULT ARRAY THAT I WANT**
```
Array
(
[1] => 1
[2] => 2
[3] ... | 2011/09/08 | [
"https://Stackoverflow.com/questions/7344899",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/69654/"
] | ```
$merged = array_unique(array_merge($array1, $array2));
``` | Try this:
```
$merged = array_unique(array_merge($array1, $array2));
``` |
7,344,899 | I want to merge those two arrays and get only the unique key values. Is there a php function for this? array\_merge() doesn't work.
```
Array
(
[1] => 3
[2] => 4
[3] => 1
)
Array
(
[1] => 3
[2] => 1
[3] => 2
)
```
**RESULT ARRAY THAT I WANT**
```
Array
(
[1] => 1
[2] => 2
[3] ... | 2011/09/08 | [
"https://Stackoverflow.com/questions/7344899",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/69654/"
] | Following peice of code gives exact what you wants but the question is do you really want the keys in the result are starting from 1 instead of 0? If you don't Arnaud his option is the best solution.
```
$array1 = array(
1 => 3,
2 => 4,
3 => 1
);
$array2 = array(
1 => 3,
2 => 1,
3 => 2
);
$v... | Try this:
```
$merged = array_unique(array_merge($array1, $array2));
``` |
7,344,899 | I want to merge those two arrays and get only the unique key values. Is there a php function for this? array\_merge() doesn't work.
```
Array
(
[1] => 3
[2] => 4
[3] => 1
)
Array
(
[1] => 3
[2] => 1
[3] => 2
)
```
**RESULT ARRAY THAT I WANT**
```
Array
(
[1] => 1
[2] => 2
[3] ... | 2011/09/08 | [
"https://Stackoverflow.com/questions/7344899",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/69654/"
] | ```
$merged = array_unique(array_merge($array1, $array2));
``` | Following peice of code gives exact what you wants but the question is do you really want the keys in the result are starting from 1 instead of 0? If you don't Arnaud his option is the best solution.
```
$array1 = array(
1 => 3,
2 => 4,
3 => 1
);
$array2 = array(
1 => 3,
2 => 1,
3 => 2
);
$v... |
73,236,800 | I'm struggling with the following issue: I'm trying to build a very simple app that lets you add items in a dedicated view that can be collapsed. I managed to write a simple function that lets me add multiple of these custom collapsable views. It's my first app so I wanted to follow the MVVM protocol. I think I got con... | 2022/08/04 | [
"https://Stackoverflow.com/questions/73236800",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19622298/"
] | There is the anwser for your comment about add item in each CollapsedView2.
Because ListViewModel is not ObservableObject (ListViewModel is difference from each CollapsableItem). You should use "@State var items: [ItemModel]".
```
struct CollapsedView2<Content: View>: View {
@State var collapsableItem: Collapsable... | There is the anwser. Ask me if you have some questions
```
struct ListView: View {
@StateObject var collapsedViewModel = CollapsedViewModel()
var body: some View {
ScrollView{
VStack{
HStack{
Text("MyFirstApp")
.font(.largeTitle.b... |
54,524,815 | I want to install sonarqube. And I want to see bug etc in my C# project.
But I didn't get results. Can you help me with why I can't?
1. Install download sonarqube.
2. Install ms build sonar-scanner.
3. I write sonar.project-properties and scanner into the bin file.
```
sonar.projectKey= //projectkey
sonar.projectNam... | 2019/02/04 | [
"https://Stackoverflow.com/questions/54524815",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Are you aware of [SonarLint for Visual Studio](https://marketplace.visualstudio.com/items?itemName=SonarSource.SonarLintforVisualStudio2017) | To scan your C# code and push the results to SonarQube you need to use the [SonarScanner for MSBuild](https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+MSBuild), not the [SonarScanner](https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner).
SonarLint is a Visual Studio ext... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.