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 |
|---|---|---|---|---|---|
263,238 | I have a prediction model tested with four methods as you can see in the boxplot figure below. The attribute that the model predicts is in range of 0-8.
You may notice that there is **one upper-bound outlier** and **three lower-bound outliers** indicated by all methods. I wonder if it is appropriate to remove these in... | 2017/02/21 | [
"https://stats.stackexchange.com/questions/263238",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/91142/"
] | It is **almost always** a cheating to remove observations **to improve** a regression model. You should drop observations only when you truly think that these are in fact outliers.
For instance, you have time series from the heart rate monitor connected to your smart watch. If you take a look at the series, it's easy... | I believe it is only reasonable to remove outliers when one has a solid qualitative reason for doing so. By this I mean that one has information that another variable, that is not in the model, is impacting the outlier observations. Then one has the choice of removing the outlier or adding additional variables.
I find... |
263,238 | I have a prediction model tested with four methods as you can see in the boxplot figure below. The attribute that the model predicts is in range of 0-8.
You may notice that there is **one upper-bound outlier** and **three lower-bound outliers** indicated by all methods. I wonder if it is appropriate to remove these in... | 2017/02/21 | [
"https://stats.stackexchange.com/questions/263238",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/91142/"
] | It is **almost always** a cheating to remove observations **to improve** a regression model. You should drop observations only when you truly think that these are in fact outliers.
For instance, you have time series from the heart rate monitor connected to your smart watch. If you take a look at the series, it's easy... | I'm not even convinced that they are "outliers". You might want to look make a normal probability plot. Are they data or residuals from fitting a model? |
56,943,623 | Hi,
I have this html code:
```
<ul>
<li>
<a href="#">Locations</a>
<ul class="submenu1">
<li><a href="https://url.com">London</a></li>
<li><a href="https://url.com">York</a></li>
</ul>
</li>
<li>
<a href="#">About</a>
<ul class="submenu2">
<li><a href="https://url.com">Site</a></li>
<li><a hr... | 2019/07/08 | [
"https://Stackoverflow.com/questions/56943623",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2230939/"
] | Hello dear CSS friend!
In other words, taking your example, you want to select "Locations" and "About" links but not the others.
(Kind of) dirty one
-------------------
The easier to understand solution is to apply styles to all `a` then remove the styles to the others.
```
li > a {
/* Styles you want to apply... | **Option 1:**
This will work:
```
ul li a {
background-color: darkkhaki;
}
ul ul li a {
background-color: transparent;
}
```
Just reset the styles on the elements you don't want styled.
**Option 2:**
If you have a container, for example a `<div id="menu">` you can do:
```
#menu > ul > li > a {
background-c... |
15,150,430 | I am trying to use the TimePicker in the 24 hour format and I am using setIs24HourView= true, but I am still not getting 24 hour format on the TimePicker. Here is my code in the onCreate of the Activity.
```
timePicker = (TimePicker) findViewById(R.id.timePicker1);
timePicker.setIs24HourView(true);
```
I eve... | 2013/03/01 | [
"https://Stackoverflow.com/questions/15150430",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2103792/"
] | ok, I see what the problem is now.
It's not correctly setting the currentHour to the new 24 hour format, which is why you got 9:05 instead of 21:05. I'm guessing it isn't 9am where you are!
It is a bug, as mentioned in this [question](https://stackoverflow.com/questions/13662288/timepicker-hour-doesnt-update-after-swi... | You can just use the device settings and thus let the user make this decision;
```
String clockType = android.provider.Settings.System.getString(context.getContentResolver(), android.provider.Settings.System.TIME_12_24);
``` |
15,150,430 | I am trying to use the TimePicker in the 24 hour format and I am using setIs24HourView= true, but I am still not getting 24 hour format on the TimePicker. Here is my code in the onCreate of the Activity.
```
timePicker = (TimePicker) findViewById(R.id.timePicker1);
timePicker.setIs24HourView(true);
```
I eve... | 2013/03/01 | [
"https://Stackoverflow.com/questions/15150430",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2103792/"
] | I notice this problem in jelly bean You can set the time to show in 24 hour view
```
TimePicker picker = (TimePicker) findViewById(R.id.timePicker1);
picker.setIs24HourView(true);
Calendar calendar = Calendar.getInstance();
int h = calendar.get(Calendar.HOUR_OF_DAY);
int m = calendar.get(Calendar... | You can just use the device settings and thus let the user make this decision;
```
String clockType = android.provider.Settings.System.getString(context.getContentResolver(), android.provider.Settings.System.TIME_12_24);
``` |
15,150,430 | I am trying to use the TimePicker in the 24 hour format and I am using setIs24HourView= true, but I am still not getting 24 hour format on the TimePicker. Here is my code in the onCreate of the Activity.
```
timePicker = (TimePicker) findViewById(R.id.timePicker1);
timePicker.setIs24HourView(true);
```
I eve... | 2013/03/01 | [
"https://Stackoverflow.com/questions/15150430",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2103792/"
] | ok, I see what the problem is now.
It's not correctly setting the currentHour to the new 24 hour format, which is why you got 9:05 instead of 21:05. I'm guessing it isn't 9am where you are!
It is a bug, as mentioned in this [question](https://stackoverflow.com/questions/13662288/timepicker-hour-doesnt-update-after-swi... | I notice this problem in jelly bean You can set the time to show in 24 hour view
```
TimePicker picker = (TimePicker) findViewById(R.id.timePicker1);
picker.setIs24HourView(true);
Calendar calendar = Calendar.getInstance();
int h = calendar.get(Calendar.HOUR_OF_DAY);
int m = calendar.get(Calendar... |
15,150,430 | I am trying to use the TimePicker in the 24 hour format and I am using setIs24HourView= true, but I am still not getting 24 hour format on the TimePicker. Here is my code in the onCreate of the Activity.
```
timePicker = (TimePicker) findViewById(R.id.timePicker1);
timePicker.setIs24HourView(true);
```
I eve... | 2013/03/01 | [
"https://Stackoverflow.com/questions/15150430",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2103792/"
] | ok, I see what the problem is now.
It's not correctly setting the currentHour to the new 24 hour format, which is why you got 9:05 instead of 21:05. I'm guessing it isn't 9am where you are!
It is a bug, as mentioned in this [question](https://stackoverflow.com/questions/13662288/timepicker-hour-doesnt-update-after-swi... | setting `timePicker.setCurrentHour(Calendar.get(Calendar.HOUR_OF_DAY))` solved the problem |
15,150,430 | I am trying to use the TimePicker in the 24 hour format and I am using setIs24HourView= true, but I am still not getting 24 hour format on the TimePicker. Here is my code in the onCreate of the Activity.
```
timePicker = (TimePicker) findViewById(R.id.timePicker1);
timePicker.setIs24HourView(true);
```
I eve... | 2013/03/01 | [
"https://Stackoverflow.com/questions/15150430",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2103792/"
] | ok, I see what the problem is now.
It's not correctly setting the currentHour to the new 24 hour format, which is why you got 9:05 instead of 21:05. I'm guessing it isn't 9am where you are!
It is a bug, as mentioned in this [question](https://stackoverflow.com/questions/13662288/timepicker-hour-doesnt-update-after-swi... | ```
timePicker = (TimePicker) findViewById(R.id.timePicker1);
timePicker.setIs24HourView(true);
```
We need to add this:
```
Calendar calendar = Calendar.getInstance();
timePicker.setCurrentHour(calendar.get(calendar.HOUR_OF_DAY));
``` |
15,150,430 | I am trying to use the TimePicker in the 24 hour format and I am using setIs24HourView= true, but I am still not getting 24 hour format on the TimePicker. Here is my code in the onCreate of the Activity.
```
timePicker = (TimePicker) findViewById(R.id.timePicker1);
timePicker.setIs24HourView(true);
```
I eve... | 2013/03/01 | [
"https://Stackoverflow.com/questions/15150430",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2103792/"
] | I notice this problem in jelly bean You can set the time to show in 24 hour view
```
TimePicker picker = (TimePicker) findViewById(R.id.timePicker1);
picker.setIs24HourView(true);
Calendar calendar = Calendar.getInstance();
int h = calendar.get(Calendar.HOUR_OF_DAY);
int m = calendar.get(Calendar... | setting `timePicker.setCurrentHour(Calendar.get(Calendar.HOUR_OF_DAY))` solved the problem |
15,150,430 | I am trying to use the TimePicker in the 24 hour format and I am using setIs24HourView= true, but I am still not getting 24 hour format on the TimePicker. Here is my code in the onCreate of the Activity.
```
timePicker = (TimePicker) findViewById(R.id.timePicker1);
timePicker.setIs24HourView(true);
```
I eve... | 2013/03/01 | [
"https://Stackoverflow.com/questions/15150430",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2103792/"
] | I notice this problem in jelly bean You can set the time to show in 24 hour view
```
TimePicker picker = (TimePicker) findViewById(R.id.timePicker1);
picker.setIs24HourView(true);
Calendar calendar = Calendar.getInstance();
int h = calendar.get(Calendar.HOUR_OF_DAY);
int m = calendar.get(Calendar... | ```
timePicker = (TimePicker) findViewById(R.id.timePicker1);
timePicker.setIs24HourView(true);
```
We need to add this:
```
Calendar calendar = Calendar.getInstance();
timePicker.setCurrentHour(calendar.get(calendar.HOUR_OF_DAY));
``` |
56,908,604 | I'm on Fedora 30. I am trying to install "epel-release".
I am following this guide: <https://www.phusionpassenger.com/library/install/standalone/install/oss/el7/> -- I am unable to successfully run the command:
```
$ sudo yum install -y epel-release yum-utils
```
I get as a result:
```
No match for argument: ep... | 2019/07/05 | [
"https://Stackoverflow.com/questions/56908604",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5479897/"
] | Note that [EPEL](https://fedoraproject.org/wiki/EPEL) is not suitable for use in Fedora! Fedora is not Enterprise Linux. EPEL provides "a high quality set of additional packages **for Enterprise Linux**, including, but not limited to, Red Hat Enterprise Linux (RHEL), CentOS and Scientific Linux (SL), Oracle Linux (OL)"... | Okay, so turns out that this can be simplified to just:
```
$ sudo dnf install passenger
```
Crazy that they have an entire tutorial for how to install passenger when it can just be simplified to this one line. |
56,908,604 | I'm on Fedora 30. I am trying to install "epel-release".
I am following this guide: <https://www.phusionpassenger.com/library/install/standalone/install/oss/el7/> -- I am unable to successfully run the command:
```
$ sudo yum install -y epel-release yum-utils
```
I get as a result:
```
No match for argument: ep... | 2019/07/05 | [
"https://Stackoverflow.com/questions/56908604",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5479897/"
] | Okay, so turns out that this can be simplified to just:
```
$ sudo dnf install passenger
```
Crazy that they have an entire tutorial for how to install passenger when it can just be simplified to this one line. | you'll need to install the EPEL (Extra Packages for Enterprise Linux) repository.
The EPEL project is run by the Fedora team.
When you install third-party repositories on Red Hat and CentOS systems.
Install in centos:
```
sudo yum install yum-plugin-priorities epel-release
```
When the installation completes, naviga... |
56,908,604 | I'm on Fedora 30. I am trying to install "epel-release".
I am following this guide: <https://www.phusionpassenger.com/library/install/standalone/install/oss/el7/> -- I am unable to successfully run the command:
```
$ sudo yum install -y epel-release yum-utils
```
I get as a result:
```
No match for argument: ep... | 2019/07/05 | [
"https://Stackoverflow.com/questions/56908604",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5479897/"
] | Okay, so turns out that this can be simplified to just:
```
$ sudo dnf install passenger
```
Crazy that they have an entire tutorial for how to install passenger when it can just be simplified to this one line. | For RHEL - dnf install <https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm>
Try with the above command to install epel-release in RHEL 8 |
56,908,604 | I'm on Fedora 30. I am trying to install "epel-release".
I am following this guide: <https://www.phusionpassenger.com/library/install/standalone/install/oss/el7/> -- I am unable to successfully run the command:
```
$ sudo yum install -y epel-release yum-utils
```
I get as a result:
```
No match for argument: ep... | 2019/07/05 | [
"https://Stackoverflow.com/questions/56908604",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5479897/"
] | Note that [EPEL](https://fedoraproject.org/wiki/EPEL) is not suitable for use in Fedora! Fedora is not Enterprise Linux. EPEL provides "a high quality set of additional packages **for Enterprise Linux**, including, but not limited to, Red Hat Enterprise Linux (RHEL), CentOS and Scientific Linux (SL), Oracle Linux (OL)"... | you'll need to install the EPEL (Extra Packages for Enterprise Linux) repository.
The EPEL project is run by the Fedora team.
When you install third-party repositories on Red Hat and CentOS systems.
Install in centos:
```
sudo yum install yum-plugin-priorities epel-release
```
When the installation completes, naviga... |
56,908,604 | I'm on Fedora 30. I am trying to install "epel-release".
I am following this guide: <https://www.phusionpassenger.com/library/install/standalone/install/oss/el7/> -- I am unable to successfully run the command:
```
$ sudo yum install -y epel-release yum-utils
```
I get as a result:
```
No match for argument: ep... | 2019/07/05 | [
"https://Stackoverflow.com/questions/56908604",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5479897/"
] | Note that [EPEL](https://fedoraproject.org/wiki/EPEL) is not suitable for use in Fedora! Fedora is not Enterprise Linux. EPEL provides "a high quality set of additional packages **for Enterprise Linux**, including, but not limited to, Red Hat Enterprise Linux (RHEL), CentOS and Scientific Linux (SL), Oracle Linux (OL)"... | For RHEL - dnf install <https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm>
Try with the above command to install epel-release in RHEL 8 |
56,908,604 | I'm on Fedora 30. I am trying to install "epel-release".
I am following this guide: <https://www.phusionpassenger.com/library/install/standalone/install/oss/el7/> -- I am unable to successfully run the command:
```
$ sudo yum install -y epel-release yum-utils
```
I get as a result:
```
No match for argument: ep... | 2019/07/05 | [
"https://Stackoverflow.com/questions/56908604",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5479897/"
] | you'll need to install the EPEL (Extra Packages for Enterprise Linux) repository.
The EPEL project is run by the Fedora team.
When you install third-party repositories on Red Hat and CentOS systems.
Install in centos:
```
sudo yum install yum-plugin-priorities epel-release
```
When the installation completes, naviga... | For RHEL - dnf install <https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm>
Try with the above command to install epel-release in RHEL 8 |
2,168,510 | The question is related to the question [Transition between matrices of full rank](https://math.stackexchange.com/questions/2166866/transition-between-matrices-of-full-rank)
Suppose we have in matrix space (I treat matrices here as vectors describing points in some $n \times n$ dimensional space) three real square mat... | 2017/03/02 | [
"https://math.stackexchange.com/questions/2168510",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/334463/"
] | Given a curve $\gamma$ of class $C^{1}$ in $\mathbb{R}^{2}$ parametrized by a
function $h:[a,b]\rightarrow\mathbb{R}^{2}$, the integral of a function $f$
along $\gamma$ is given by
$$
\int\_{\gamma}f\,d\sigma=\int\_{a}^{b}f(h(t))\sqrt{(h\_{1}^{\prime}%
(t))^{2}+(h\_{2}^{\prime}(t))^{2}}dt.
$$
In your case, you can take... | In polar coordinates the gradient is
$$\nabla u=\hat{r}\frac{\partial u}{\partial r} + \hat{\theta}\frac{1}{r}\frac{\partial u}{\partial\theta}$$
Dotting with the outward normal $\hat{r}$ yields
$$\hat{r}\cdot\nabla u=\frac{\partial u}{\partial r}$$
Likewise, in polar coordinates, the differential of a circular arc i... |
38,766,636 | i m trying to keep Hello as a heading below nav tag.
This is my HTML.
```
<nav class="navbar navbar-default navbar-fixed-top" style="background-color: aliceblue;" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<img class="img-responsive" src="img/logo.png" style="width: 330px... | 2016/08/04 | [
"https://Stackoverflow.com/questions/38766636",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6677896/"
] | <http://getbootstrap.com/components/#navbar-fixed-top>
Look particularly at the part where it says the body requires padding.
>
> The fixed navbar will overlay your other content, unless you add padding to the top of the `<body>`. Try out your own values or use our snippet below. Tip: By default, the navbar is 50px ... | You can solve this with media screen, just give another margin top for screens less than 767px(except tablet,laptop and desktop)
Hope it will help you.
```
<style>
body
{
background-color:#4FE1A8;
}
#wrapper
{
margin-top:50px;
}
@media screen and (max-width:767px)
{
#wrapper
{
margin-top:100px... |
232,805 | In *Asterix and the Magic Carpet*, [Cacofonix's](https://www.asterix.com/en/portfolio/cacofonix/) singing produces rain. (Previously, this had never happened.)
**Why is it that when Cacofonix sings, it rains in #28 (*Magic Carpet*, 1987), but not in Books #1-27 (1961-83)?** (Others may disagree, but I find this proble... | 2020/06/15 | [
"https://scifi.stackexchange.com/questions/232805",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/130048/"
] | According to [the Wikipedia section on Cacofonix](https://en.wikipedia.org/wiki/List_of_Asterix_characters#Cacofonix):
>
> In later albums his music is so spectacularly horrible that it actually starts thunderstorms (even indoors), because of an old French saying that bad singing causes rain.
>
>
>
A French perso... | As many have pointed out, it could be because of the French connection and the French proverb that bad singing may cause rain.
Another possibility could be interpreted from the fact that Watziznehm requests the Gauls to help him with draught in his region in the Ganges region. In the Ganges region, although the timeli... |
232,805 | In *Asterix and the Magic Carpet*, [Cacofonix's](https://www.asterix.com/en/portfolio/cacofonix/) singing produces rain. (Previously, this had never happened.)
**Why is it that when Cacofonix sings, it rains in #28 (*Magic Carpet*, 1987), but not in Books #1-27 (1961-83)?** (Others may disagree, but I find this proble... | 2020/06/15 | [
"https://scifi.stackexchange.com/questions/232805",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/130048/"
] | On page 6 of *Asterix and the Magic Carpet* (in-panel numbering), Vitalstatistix says regarding Cacofonix’ rainmaking abilities:
>
> Oh, yes … I was forgetting, Cacofonix has new string to his lyre these days.
>
>
>
As noted by [Darren](https://scifi.stackexchange.com/users/75476/darren), this is probably a pun i... | Perhaps not immediately clear for English readers, the original French name of the bard in the cartoons is *Assurancetourix*, a contraction of the French term *Assurance tous risques*, literally "all-risk insurance".
An all-risk insurance includes coverage that automatically covers any risk, including natural disaster... |
232,805 | In *Asterix and the Magic Carpet*, [Cacofonix's](https://www.asterix.com/en/portfolio/cacofonix/) singing produces rain. (Previously, this had never happened.)
**Why is it that when Cacofonix sings, it rains in #28 (*Magic Carpet*, 1987), but not in Books #1-27 (1961-83)?** (Others may disagree, but I find this proble... | 2020/06/15 | [
"https://scifi.stackexchange.com/questions/232805",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/130048/"
] | In France we have this saying that if you sing badly it will produce rain. More precisely if you sing out of key, or pitchy, then you'll make it rain. "Cacophonix" means "cacophonie" which is French for "cacophony": harsh discordant mixture of sounds. Thus triggering the rain. | Perhaps not immediately clear for English readers, the original French name of the bard in the cartoons is *Assurancetourix*, a contraction of the French term *Assurance tous risques*, literally "all-risk insurance".
An all-risk insurance includes coverage that automatically covers any risk, including natural disaster... |
232,805 | In *Asterix and the Magic Carpet*, [Cacofonix's](https://www.asterix.com/en/portfolio/cacofonix/) singing produces rain. (Previously, this had never happened.)
**Why is it that when Cacofonix sings, it rains in #28 (*Magic Carpet*, 1987), but not in Books #1-27 (1961-83)?** (Others may disagree, but I find this proble... | 2020/06/15 | [
"https://scifi.stackexchange.com/questions/232805",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/130048/"
] | This is an ongoing joke that Cacofonix's singing is so bad, it causes negative things to happen (a common trope).
[](https://i.s... | As many have pointed out, it could be because of the French connection and the French proverb that bad singing may cause rain.
Another possibility could be interpreted from the fact that Watziznehm requests the Gauls to help him with draught in his region in the Ganges region. In the Ganges region, although the timeli... |
232,805 | In *Asterix and the Magic Carpet*, [Cacofonix's](https://www.asterix.com/en/portfolio/cacofonix/) singing produces rain. (Previously, this had never happened.)
**Why is it that when Cacofonix sings, it rains in #28 (*Magic Carpet*, 1987), but not in Books #1-27 (1961-83)?** (Others may disagree, but I find this proble... | 2020/06/15 | [
"https://scifi.stackexchange.com/questions/232805",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/130048/"
] | This is an ongoing joke that Cacofonix's singing is so bad, it causes negative things to happen (a common trope).
[](https://i.s... | In France we have this saying that if you sing badly it will produce rain. More precisely if you sing out of key, or pitchy, then you'll make it rain. "Cacophonix" means "cacophonie" which is French for "cacophony": harsh discordant mixture of sounds. Thus triggering the rain. |
232,805 | In *Asterix and the Magic Carpet*, [Cacofonix's](https://www.asterix.com/en/portfolio/cacofonix/) singing produces rain. (Previously, this had never happened.)
**Why is it that when Cacofonix sings, it rains in #28 (*Magic Carpet*, 1987), but not in Books #1-27 (1961-83)?** (Others may disagree, but I find this proble... | 2020/06/15 | [
"https://scifi.stackexchange.com/questions/232805",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/130048/"
] | This is an ongoing joke that Cacofonix's singing is so bad, it causes negative things to happen (a common trope).
[](https://i.s... | On page 6 of *Asterix and the Magic Carpet* (in-panel numbering), Vitalstatistix says regarding Cacofonix’ rainmaking abilities:
>
> Oh, yes … I was forgetting, Cacofonix has new string to his lyre these days.
>
>
>
As noted by [Darren](https://scifi.stackexchange.com/users/75476/darren), this is probably a pun i... |
232,805 | In *Asterix and the Magic Carpet*, [Cacofonix's](https://www.asterix.com/en/portfolio/cacofonix/) singing produces rain. (Previously, this had never happened.)
**Why is it that when Cacofonix sings, it rains in #28 (*Magic Carpet*, 1987), but not in Books #1-27 (1961-83)?** (Others may disagree, but I find this proble... | 2020/06/15 | [
"https://scifi.stackexchange.com/questions/232805",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/130048/"
] | According to [the Wikipedia section on Cacofonix](https://en.wikipedia.org/wiki/List_of_Asterix_characters#Cacofonix):
>
> In later albums his music is so spectacularly horrible that it actually starts thunderstorms (even indoors), because of an old French saying that bad singing causes rain.
>
>
>
A French perso... | In France we have this saying that if you sing badly it will produce rain. More precisely if you sing out of key, or pitchy, then you'll make it rain. "Cacophonix" means "cacophonie" which is French for "cacophony": harsh discordant mixture of sounds. Thus triggering the rain. |
232,805 | In *Asterix and the Magic Carpet*, [Cacofonix's](https://www.asterix.com/en/portfolio/cacofonix/) singing produces rain. (Previously, this had never happened.)
**Why is it that when Cacofonix sings, it rains in #28 (*Magic Carpet*, 1987), but not in Books #1-27 (1961-83)?** (Others may disagree, but I find this proble... | 2020/06/15 | [
"https://scifi.stackexchange.com/questions/232805",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/130048/"
] | This is an ongoing joke that Cacofonix's singing is so bad, it causes negative things to happen (a common trope).
[](https://i.s... | According to [the Wikipedia section on Cacofonix](https://en.wikipedia.org/wiki/List_of_Asterix_characters#Cacofonix):
>
> In later albums his music is so spectacularly horrible that it actually starts thunderstorms (even indoors), because of an old French saying that bad singing causes rain.
>
>
>
A French perso... |
232,805 | In *Asterix and the Magic Carpet*, [Cacofonix's](https://www.asterix.com/en/portfolio/cacofonix/) singing produces rain. (Previously, this had never happened.)
**Why is it that when Cacofonix sings, it rains in #28 (*Magic Carpet*, 1987), but not in Books #1-27 (1961-83)?** (Others may disagree, but I find this proble... | 2020/06/15 | [
"https://scifi.stackexchange.com/questions/232805",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/130048/"
] | This is an ongoing joke that Cacofonix's singing is so bad, it causes negative things to happen (a common trope).
[](https://i.s... | Perhaps not immediately clear for English readers, the original French name of the bard in the cartoons is *Assurancetourix*, a contraction of the French term *Assurance tous risques*, literally "all-risk insurance".
An all-risk insurance includes coverage that automatically covers any risk, including natural disaster... |
232,805 | In *Asterix and the Magic Carpet*, [Cacofonix's](https://www.asterix.com/en/portfolio/cacofonix/) singing produces rain. (Previously, this had never happened.)
**Why is it that when Cacofonix sings, it rains in #28 (*Magic Carpet*, 1987), but not in Books #1-27 (1961-83)?** (Others may disagree, but I find this proble... | 2020/06/15 | [
"https://scifi.stackexchange.com/questions/232805",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/130048/"
] | According to [the Wikipedia section on Cacofonix](https://en.wikipedia.org/wiki/List_of_Asterix_characters#Cacofonix):
>
> In later albums his music is so spectacularly horrible that it actually starts thunderstorms (even indoors), because of an old French saying that bad singing causes rain.
>
>
>
A French perso... | Perhaps not immediately clear for English readers, the original French name of the bard in the cartoons is *Assurancetourix*, a contraction of the French term *Assurance tous risques*, literally "all-risk insurance".
An all-risk insurance includes coverage that automatically covers any risk, including natural disaster... |
191 | I'm having a hard time figuring out which is the correct form of asking this kind of question. I mean speaking strictly, this doesn't sound right: ***You alright?*** or ***You eaten anything?*** compared to ***Are you alright?*** and ***Have you eaten anything?***.
So please enlighten me. Are those both forms correc... | 2013/01/24 | [
"https://ell.stackexchange.com/questions/191",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/101/"
] | Those phrases are examples of ellipsis: the omission of words that can be understood from the context, or given contextual clues.
While ellipsis is not normally used in formal English, it is more used in spoken English, or informal English. | These aren't correct in formal English. Here, the sentences say "Are you alright?", "Have you eaten anything", as you mentioned. The "Are"/"Have" are implied here, that's all. One finds this a lot in informal English -- words which can be guessed from context are sometimes dropped altogether.
It's just a way to save ... |
191 | I'm having a hard time figuring out which is the correct form of asking this kind of question. I mean speaking strictly, this doesn't sound right: ***You alright?*** or ***You eaten anything?*** compared to ***Are you alright?*** and ***Have you eaten anything?***.
So please enlighten me. Are those both forms correc... | 2013/01/24 | [
"https://ell.stackexchange.com/questions/191",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/101/"
] | These aren't correct in formal English. Here, the sentences say "Are you alright?", "Have you eaten anything", as you mentioned. The "Are"/"Have" are implied here, that's all. One finds this a lot in informal English -- words which can be guessed from context are sometimes dropped altogether.
It's just a way to save ... | *“You alright?”* is not necessarily true according to the grammar rules. It is instead used for conversations with friends and relatives. The most correct sentence, in my opinion, would definitely be: **“*Are you alright*?”** |
191 | I'm having a hard time figuring out which is the correct form of asking this kind of question. I mean speaking strictly, this doesn't sound right: ***You alright?*** or ***You eaten anything?*** compared to ***Are you alright?*** and ***Have you eaten anything?***.
So please enlighten me. Are those both forms correc... | 2013/01/24 | [
"https://ell.stackexchange.com/questions/191",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/101/"
] | These aren't correct in formal English. Here, the sentences say "Are you alright?", "Have you eaten anything", as you mentioned. The "Are"/"Have" are implied here, that's all. One finds this a lot in informal English -- words which can be guessed from context are sometimes dropped altogether.
It's just a way to save ... | We use ellipsis a lot in spoken English. It's certainly not good written style though!
I might have a conversation like this with friends:
Alright? Coming to the pub tonight?
Naa (No). Too tired. Went out last night.
Stay out late, did ya (you)?
Yeah. Got home about 2 in the morning. Wife wasn't happy! |
191 | I'm having a hard time figuring out which is the correct form of asking this kind of question. I mean speaking strictly, this doesn't sound right: ***You alright?*** or ***You eaten anything?*** compared to ***Are you alright?*** and ***Have you eaten anything?***.
So please enlighten me. Are those both forms correc... | 2013/01/24 | [
"https://ell.stackexchange.com/questions/191",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/101/"
] | Those phrases are examples of ellipsis: the omission of words that can be understood from the context, or given contextual clues.
While ellipsis is not normally used in formal English, it is more used in spoken English, or informal English. | *“You alright?”* is not necessarily true according to the grammar rules. It is instead used for conversations with friends and relatives. The most correct sentence, in my opinion, would definitely be: **“*Are you alright*?”** |
191 | I'm having a hard time figuring out which is the correct form of asking this kind of question. I mean speaking strictly, this doesn't sound right: ***You alright?*** or ***You eaten anything?*** compared to ***Are you alright?*** and ***Have you eaten anything?***.
So please enlighten me. Are those both forms correc... | 2013/01/24 | [
"https://ell.stackexchange.com/questions/191",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/101/"
] | Those phrases are examples of ellipsis: the omission of words that can be understood from the context, or given contextual clues.
While ellipsis is not normally used in formal English, it is more used in spoken English, or informal English. | We use ellipsis a lot in spoken English. It's certainly not good written style though!
I might have a conversation like this with friends:
Alright? Coming to the pub tonight?
Naa (No). Too tired. Went out last night.
Stay out late, did ya (you)?
Yeah. Got home about 2 in the morning. Wife wasn't happy! |
191 | I'm having a hard time figuring out which is the correct form of asking this kind of question. I mean speaking strictly, this doesn't sound right: ***You alright?*** or ***You eaten anything?*** compared to ***Are you alright?*** and ***Have you eaten anything?***.
So please enlighten me. Are those both forms correc... | 2013/01/24 | [
"https://ell.stackexchange.com/questions/191",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/101/"
] | We use ellipsis a lot in spoken English. It's certainly not good written style though!
I might have a conversation like this with friends:
Alright? Coming to the pub tonight?
Naa (No). Too tired. Went out last night.
Stay out late, did ya (you)?
Yeah. Got home about 2 in the morning. Wife wasn't happy! | *“You alright?”* is not necessarily true according to the grammar rules. It is instead used for conversations with friends and relatives. The most correct sentence, in my opinion, would definitely be: **“*Are you alright*?”** |
30,343,029 | I am new to Perl. How do I create a a loop that runs until the current time is a multiple of 5 seconds? | 2015/05/20 | [
"https://Stackoverflow.com/questions/30343029",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | If you just want to suspend your process until the seconds are a multiple of 5, then you can use the [`Time::HiRes`](https://metacpan.org/pod/Time::HiRes) module like this
```
use Time::HiRes qw/ gettimeofday usleep /;
my ($s, $us) = gettimeofday;
my $delay = 1_000_000 * (5 - $s % 5) - $us;
usleep $delay;
# Do stuff... | Borodin's answer is what you want if you really need the seconds to be a multiple of five. However, is it possible you just want to implement five second delays in your program? If so:
```
sleep 5;
``` |
9,648,015 | I put [a package on PyPi](http://pypi.python.org/pypi/powerlaw) for the first time ~2 months ago, and have made some version updates since then. I noticed this week the download count recording, and was surprised to see it had been downloaded hundreds of times. Over the next few days, I was more surprised to see the do... | 2012/03/10 | [
"https://Stackoverflow.com/questions/9648015",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/897578/"
] | This is kind of an old question at this point, but I noticed the same thing about a package I have on PyPI and investigated further. It turns out PyPI keeps reasonably detailed [download statistics](http://pypi.python.org/stats/), including (apparently slightly anonymised) user agents. From that, it was apparent that m... | You also have to take into account that virtualenv is getting more popular. If your package is something like a core library that people use in many of their projects, they will usually download it multiple times.
Consider a single user has 5 projects where he uses your package and each lives in its own virtualenv. Us... |
9,648,015 | I put [a package on PyPi](http://pypi.python.org/pypi/powerlaw) for the first time ~2 months ago, and have made some version updates since then. I noticed this week the download count recording, and was surprised to see it had been downloaded hundreds of times. Over the next few days, I was more surprised to see the do... | 2012/03/10 | [
"https://Stackoverflow.com/questions/9648015",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/897578/"
] | Starting with Cairnarvon's summarizing statement:
>
> "It looks like the main reason PyPI needs mirrors is because it has them."
>
>
>
I would slightly modify this:
>
> It might be more the **way** PyPI actually works and thus has to be mirrored, that might contribute an additional bit (or two :-) to the *rea... | You also have to take into account that virtualenv is getting more popular. If your package is something like a core library that people use in many of their projects, they will usually download it multiple times.
Consider a single user has 5 projects where he uses your package and each lives in its own virtualenv. Us... |
9,648,015 | I put [a package on PyPi](http://pypi.python.org/pypi/powerlaw) for the first time ~2 months ago, and have made some version updates since then. I noticed this week the download count recording, and was surprised to see it had been downloaded hundreds of times. Over the next few days, I was more surprised to see the do... | 2012/03/10 | [
"https://Stackoverflow.com/questions/9648015",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/897578/"
] | You also have to take into account that virtualenv is getting more popular. If your package is something like a core library that people use in many of their projects, they will usually download it multiple times.
Consider a single user has 5 projects where he uses your package and each lives in its own virtualenv. Us... | Hypothesis: CI tools like Travis CI and Appveyor also contribute quite a bit. It might mean that each commit/push leads to a build of a package and the installation of everything in requirements.txt |
9,648,015 | I put [a package on PyPi](http://pypi.python.org/pypi/powerlaw) for the first time ~2 months ago, and have made some version updates since then. I noticed this week the download count recording, and was surprised to see it had been downloaded hundreds of times. Over the next few days, I was more surprised to see the do... | 2012/03/10 | [
"https://Stackoverflow.com/questions/9648015",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/897578/"
] | This is kind of an old question at this point, but I noticed the same thing about a package I have on PyPI and investigated further. It turns out PyPI keeps reasonably detailed [download statistics](http://pypi.python.org/stats/), including (apparently slightly anonymised) user agents. From that, it was apparent that m... | Starting with Cairnarvon's summarizing statement:
>
> "It looks like the main reason PyPI needs mirrors is because it has them."
>
>
>
I would slightly modify this:
>
> It might be more the **way** PyPI actually works and thus has to be mirrored, that might contribute an additional bit (or two :-) to the *rea... |
9,648,015 | I put [a package on PyPi](http://pypi.python.org/pypi/powerlaw) for the first time ~2 months ago, and have made some version updates since then. I noticed this week the download count recording, and was surprised to see it had been downloaded hundreds of times. Over the next few days, I was more surprised to see the do... | 2012/03/10 | [
"https://Stackoverflow.com/questions/9648015",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/897578/"
] | This is kind of an old question at this point, but I noticed the same thing about a package I have on PyPI and investigated further. It turns out PyPI keeps reasonably detailed [download statistics](http://pypi.python.org/stats/), including (apparently slightly anonymised) user agents. From that, it was apparent that m... | Hypothesis: CI tools like Travis CI and Appveyor also contribute quite a bit. It might mean that each commit/push leads to a build of a package and the installation of everything in requirements.txt |
9,648,015 | I put [a package on PyPi](http://pypi.python.org/pypi/powerlaw) for the first time ~2 months ago, and have made some version updates since then. I noticed this week the download count recording, and was surprised to see it had been downloaded hundreds of times. Over the next few days, I was more surprised to see the do... | 2012/03/10 | [
"https://Stackoverflow.com/questions/9648015",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/897578/"
] | Starting with Cairnarvon's summarizing statement:
>
> "It looks like the main reason PyPI needs mirrors is because it has them."
>
>
>
I would slightly modify this:
>
> It might be more the **way** PyPI actually works and thus has to be mirrored, that might contribute an additional bit (or two :-) to the *rea... | Hypothesis: CI tools like Travis CI and Appveyor also contribute quite a bit. It might mean that each commit/push leads to a build of a package and the installation of everything in requirements.txt |
9,653,926 | I have a directory
```
D:\SVN_HOME\EclipseWorkspace\MF_CENTER_INFO
```
`SVN_HOME` - is a root svn working folder
`MF_CENTER_INFO` - the folder which I want to be commited to another svn repository
The default repository for `D:\SVN_HOME\` is `svn://10.101.101.101/svn/ee/trunk`
but `MF_CENTER_INFO` has to be commit... | 2012/03/11 | [
"https://Stackoverflow.com/questions/9653926",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/272869/"
] | I had the same problem when I upgraded to Google App Engine 1.6.0 from 1.5.5 .
I solved the problem by installing `python-memcached`:
```
pip install python-memcached
``` | For gentoo users it's recommended:
`emerge -av dev-python/python-memcached` |
9,653,926 | I have a directory
```
D:\SVN_HOME\EclipseWorkspace\MF_CENTER_INFO
```
`SVN_HOME` - is a root svn working folder
`MF_CENTER_INFO` - the folder which I want to be commited to another svn repository
The default repository for `D:\SVN_HOME\` is `svn://10.101.101.101/svn/ee/trunk`
but `MF_CENTER_INFO` has to be commit... | 2012/03/11 | [
"https://Stackoverflow.com/questions/9653926",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/272869/"
] | I had the same problem when I upgraded to Google App Engine 1.6.0 from 1.5.5 .
I solved the problem by installing `python-memcached`:
```
pip install python-memcached
``` | I alse do like this:
```
sudo pip install python-memcached
```
then restart the django, it works. |
61,205,622 | Can Anyone Please Convert the following Arduino Code to Embedded c code? I am very thankful to the one who converts this to an embedded c code. (this code is for Arduino lcd interfacing with Ultrasonic sensor)
```
#include <LiquidCrystal.h>
int inches = 0;
int cm = 0;
// initialize the library w... | 2020/04/14 | [
"https://Stackoverflow.com/questions/61205622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Accepted answer is not an accessible solution.
----------------------------------------------
I have made some corrections and some observations here. Do not use the accepted answer in production if you stumble across this question in the future. It is an awful experience with a keyboard.
The answer below fixes some ... | It is just radio buttons... Keyboard can be used to navigate through them using tab and space bar to check them.
I'd use `:focus` to highlight the chosen tab and the `tabindex` property to make it work as I wanted.
Please provide more dept if you have problem with a SPECIFIC problem related to it, and provide a basi... |
53,949,061 | I have various formats of dates, in strings, all in ColumnA. Here is a small example.
```
-rw-r--r-- 35 30067 10224 <-- 2018-09
-rw-r--r-- 36 30067 10224 <-- 2018-09
-rw-r--r-- 65 30067 10224 <-- 2018-10-24
```
Is there a way I can interpret any date from any given string? | 2018/12/27 | [
"https://Stackoverflow.com/questions/53949061",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5212614/"
] | Try
```
Sub test()
Dim rngDB As Range
Dim vDB As Variant, vR() As Variant
Dim vS As Variant
Dim i As Long, j As Integer, c As Integer
Dim s As String
Set rngDB = Range("a1", Range("a" & Rows.Count).End(xlUp))
vDB = rngDB
r = UBound(vDB, 1)
ReDim vR(1 To r, 1 To 1)
For i = 1 T... | Without any fixed pattern it will be complicated.
The better way in your case on a logical way would by to associate date pattern to files like
* 1 => \*.BUS -> YYMM
* 2 => \*.IDE -> YYMMDD
* 3 => TTN\* -> YYYYMMDD
And on the same logic get a mapping table with position of date string in the file name
* 1 => Last 4... |
53,949,061 | I have various formats of dates, in strings, all in ColumnA. Here is a small example.
```
-rw-r--r-- 35 30067 10224 <-- 2018-09
-rw-r--r-- 36 30067 10224 <-- 2018-09
-rw-r--r-- 65 30067 10224 <-- 2018-10-24
```
Is there a way I can interpret any date from any given string? | 2018/12/27 | [
"https://Stackoverflow.com/questions/53949061",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5212614/"
] | I tried to get date with regular expression. As far as I see, the date is either in the end of the string or there's a dot after it (followed by extension). The regex takes into account the length of the year: either 4 or 2. Also it manages the case when month is expressed in text. *Important!* When the day is absent, ... | Without any fixed pattern it will be complicated.
The better way in your case on a logical way would by to associate date pattern to files like
* 1 => \*.BUS -> YYMM
* 2 => \*.IDE -> YYMMDD
* 3 => TTN\* -> YYYYMMDD
And on the same logic get a mapping table with position of date string in the file name
* 1 => Last 4... |
53,949,061 | I have various formats of dates, in strings, all in ColumnA. Here is a small example.
```
-rw-r--r-- 35 30067 10224 <-- 2018-09
-rw-r--r-- 36 30067 10224 <-- 2018-09
-rw-r--r-- 65 30067 10224 <-- 2018-10-24
```
Is there a way I can interpret any date from any given string? | 2018/12/27 | [
"https://Stackoverflow.com/questions/53949061",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5212614/"
] | I tried to get date with regular expression. As far as I see, the date is either in the end of the string or there's a dot after it (followed by extension). The regex takes into account the length of the year: either 4 or 2. Also it manages the case when month is expressed in text. *Important!* When the day is absent, ... | Try
```
Sub test()
Dim rngDB As Range
Dim vDB As Variant, vR() As Variant
Dim vS As Variant
Dim i As Long, j As Integer, c As Integer
Dim s As String
Set rngDB = Range("a1", Range("a" & Rows.Count).End(xlUp))
vDB = rngDB
r = UBound(vDB, 1)
ReDim vR(1 To r, 1 To 1)
For i = 1 T... |
66,234,556 | I have a file path which I access like this
```
string[] pathDirs = { Path.GetFullPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..\\..\\")),
"config", "file.txt" };
string pathToFile = Path.Combine(pathDirs);
```
When I run the build from within visual studio it gets the `config` director... | 2021/02/17 | [
"https://Stackoverflow.com/questions/66234556",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3531792/"
] | You should specify what column(s) contain(s) duplicates:
```
removeDuplicates = data.drop_duplicates(subset=['COUNTY'])
``` | You need to specify not to keep any duplicates with the keyword argument `keep`:
```
removeDuplicates = data.drop_duplicates(keep=False)
```
From the [`pandas.DataFrame.drop_duplicates()`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.drop_duplicates.html) documentation:
`keep`: Determ... |
25,789,664 | I have a spreadsheet with roughly 750 part numbers and costs on it. I need to add $2 to each cost (not total the whole column). The range would be something like D1:D628 and I've tried using =SUM but either I'm doing it wrong or it isn't possible.
I initially tried `=SUM(D1:D628+2)` and got a circular reference warni... | 2014/09/11 | [
"https://Stackoverflow.com/questions/25789664",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1139955/"
] | If you just want to add 2 to a range of numbers (not formulas) then
enter the number 2 in a blank cell somewhere
copy it
Select the cells you want to add 2 to, and then select paste special, choose ADD as the operation option. | The following formula should work
`{=SUM(D1:D628+2)}`
Leave out the curly braces but press `CTRL`+`SHIFT`+`ENTER` to enter the function (rather than just `ENTER`)
EDIT: explanation
by pressing `CTRL`+`SHIFT`+`ENTER` excel treats the formula as an array, and loops through each cell individually adding 2 and then sum... |
52,952,279 | Write the number of days in months program so that the program prompts the user for the file name and reads the dates from the file.
The dates in the file are written in the format dd.mm.yyyy. The program looks for the month in each line (hint: use split) and prints out the number of days in that month.
Rewrite the f... | 2018/10/23 | [
"https://Stackoverflow.com/questions/52952279",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | **Yes**.
I could make it work by adding this at the end of the pubspec.yaml:
```
module:
androidPackage: com.teste.embeded
iosBundleIdentifier: com.teste.embeded
```
Add this and then call a *packages get*. This will create 2 hidden folders in your project structure: .android and .ios.
**Becareful with the ide... | You can do that in tow ways:
1- Convert your project to Flutter module and then put that along side the native project and call your FlutterActivity from native
2- Convert your project to Flutter module and make an AAR from it ant import in the native project
Read this Flutter documentation:
<https://flutter.... |
712,463 | In C, is there a nice way to track the number of elements in an enum? I've seen
```
enum blah {
FIRST,
SECOND,
THIRD,
LAST
};
```
But this only works if the items are sequential and start at zero. | 2009/04/03 | [
"https://Stackoverflow.com/questions/712463",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/66349/"
] | I don't believe there is. But what would you do with such a number if they are not sequential, and you don't already have a list of them somewhere? And if they are sequential but start at a different number, you could always do:
```
enum blah {
FIRST = 128,
SECOND,
THIRD,
END
};
const int blah_count = ... | Well, since enums can't change at run-time, the best thing you can do is:
```
enum blah {
FIRST = 7,
SECOND = 15,
THIRD = 9,
LAST = 12
};
#define blahcount 4 /* counted manually, keep these in sync */
```
But I find it difficult to envisage a situation where that information would come in handy. What... |
712,463 | In C, is there a nice way to track the number of elements in an enum? I've seen
```
enum blah {
FIRST,
SECOND,
THIRD,
LAST
};
```
But this only works if the items are sequential and start at zero. | 2009/04/03 | [
"https://Stackoverflow.com/questions/712463",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/66349/"
] | I don't believe there is. But what would you do with such a number if they are not sequential, and you don't already have a list of them somewhere? And if they are sequential but start at a different number, you could always do:
```
enum blah {
FIRST = 128,
SECOND,
THIRD,
END
};
const int blah_count = ... | ```
int enaumVals[] =
{
FIRST,
SECOND,
THIRD,
LAST
};
#define NUM_ENUMS sizeof(enaumVals) / sizeof ( int );
``` |
712,463 | In C, is there a nice way to track the number of elements in an enum? I've seen
```
enum blah {
FIRST,
SECOND,
THIRD,
LAST
};
```
But this only works if the items are sequential and start at zero. | 2009/04/03 | [
"https://Stackoverflow.com/questions/712463",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/66349/"
] | I know this is a very old question, but as the accepted answer is wrong, I feel compelled to post my own. I'll reuse the accepted answer's example, slightly modified.
(Making the assumption that enums are sequential.)
```
// Incorrect code, do not use!
enum blah {
FIRST = 0,
SECOND, // 1
THIRD, // 2
END ... | ```
int enaumVals[] =
{
FIRST,
SECOND,
THIRD,
LAST
};
#define NUM_ENUMS sizeof(enaumVals) / sizeof ( int );
``` |
712,463 | In C, is there a nice way to track the number of elements in an enum? I've seen
```
enum blah {
FIRST,
SECOND,
THIRD,
LAST
};
```
But this only works if the items are sequential and start at zero. | 2009/04/03 | [
"https://Stackoverflow.com/questions/712463",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/66349/"
] | Unfortunately, no. There is not. | ```
#include <stdio.h>
// M_CONC and M_CONC_ come from https://stackoverflow.com/a/14804003/7067195
#define M_CONC(A, B) M_CONC_(A, B)
#define M_CONC_(A, B) A##B
#define enum_count_suffix _count
#define count(tag) M_CONC(tag, enum_count_suffix)
#define countable_enum(tag, ...) \
enum tag {__VA_ARGS__}; \
const si... |
712,463 | In C, is there a nice way to track the number of elements in an enum? I've seen
```
enum blah {
FIRST,
SECOND,
THIRD,
LAST
};
```
But this only works if the items are sequential and start at zero. | 2009/04/03 | [
"https://Stackoverflow.com/questions/712463",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/66349/"
] | ```
int enaumVals[] =
{
FIRST,
SECOND,
THIRD,
LAST
};
#define NUM_ENUMS sizeof(enaumVals) / sizeof ( int );
``` | ```
#include <stdio.h>
// M_CONC and M_CONC_ come from https://stackoverflow.com/a/14804003/7067195
#define M_CONC(A, B) M_CONC_(A, B)
#define M_CONC_(A, B) A##B
#define enum_count_suffix _count
#define count(tag) M_CONC(tag, enum_count_suffix)
#define countable_enum(tag, ...) \
enum tag {__VA_ARGS__}; \
const si... |
712,463 | In C, is there a nice way to track the number of elements in an enum? I've seen
```
enum blah {
FIRST,
SECOND,
THIRD,
LAST
};
```
But this only works if the items are sequential and start at zero. | 2009/04/03 | [
"https://Stackoverflow.com/questions/712463",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/66349/"
] | I know this is a very old question, but as the accepted answer is wrong, I feel compelled to post my own. I'll reuse the accepted answer's example, slightly modified.
(Making the assumption that enums are sequential.)
```
// Incorrect code, do not use!
enum blah {
FIRST = 0,
SECOND, // 1
THIRD, // 2
END ... | Well, since enums can't change at run-time, the best thing you can do is:
```
enum blah {
FIRST = 7,
SECOND = 15,
THIRD = 9,
LAST = 12
};
#define blahcount 4 /* counted manually, keep these in sync */
```
But I find it difficult to envisage a situation where that information would come in handy. What... |
712,463 | In C, is there a nice way to track the number of elements in an enum? I've seen
```
enum blah {
FIRST,
SECOND,
THIRD,
LAST
};
```
But this only works if the items are sequential and start at zero. | 2009/04/03 | [
"https://Stackoverflow.com/questions/712463",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/66349/"
] | I don't believe there is. But what would you do with such a number if they are not sequential, and you don't already have a list of them somewhere? And if they are sequential but start at a different number, you could always do:
```
enum blah {
FIRST = 128,
SECOND,
THIRD,
END
};
const int blah_count = ... | Unfortunately, no. There is not. |
712,463 | In C, is there a nice way to track the number of elements in an enum? I've seen
```
enum blah {
FIRST,
SECOND,
THIRD,
LAST
};
```
But this only works if the items are sequential and start at zero. | 2009/04/03 | [
"https://Stackoverflow.com/questions/712463",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/66349/"
] | Unfortunately, no. There is not. | I know this is a very old question, but as the accepted answer is wrong, I feel compelled to post my own. I'll reuse the accepted answer's example, slightly modified.
(Making the assumption that enums are sequential.)
```
// Incorrect code, do not use!
enum blah {
FIRST = 0,
SECOND, // 1
THIRD, // 2
END ... |
712,463 | In C, is there a nice way to track the number of elements in an enum? I've seen
```
enum blah {
FIRST,
SECOND,
THIRD,
LAST
};
```
But this only works if the items are sequential and start at zero. | 2009/04/03 | [
"https://Stackoverflow.com/questions/712463",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/66349/"
] | If you don't assign your enums you can do somethings like this:
```
enum MyType {
Type1,
Type2,
Type3,
NumberOfTypes
}
```
NumberOfTypes will evaluate to 3 which is the number of real types. | ```
int enaumVals[] =
{
FIRST,
SECOND,
THIRD,
LAST
};
#define NUM_ENUMS sizeof(enaumVals) / sizeof ( int );
``` |
712,463 | In C, is there a nice way to track the number of elements in an enum? I've seen
```
enum blah {
FIRST,
SECOND,
THIRD,
LAST
};
```
But this only works if the items are sequential and start at zero. | 2009/04/03 | [
"https://Stackoverflow.com/questions/712463",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/66349/"
] | I don't believe there is. But what would you do with such a number if they are not sequential, and you don't already have a list of them somewhere? And if they are sequential but start at a different number, you could always do:
```
enum blah {
FIRST = 128,
SECOND,
THIRD,
END
};
const int blah_count = ... | ```
#include <stdio.h>
// M_CONC and M_CONC_ come from https://stackoverflow.com/a/14804003/7067195
#define M_CONC(A, B) M_CONC_(A, B)
#define M_CONC_(A, B) A##B
#define enum_count_suffix _count
#define count(tag) M_CONC(tag, enum_count_suffix)
#define countable_enum(tag, ...) \
enum tag {__VA_ARGS__}; \
const si... |
187,922 | I have a need to support multiple websites on a single IIS 7 server. One of these websites needs to be able to support wildcard subdomains. I was hoping to use host headers for this approach but am thinking this is not possible. The site that requires wildcard subdomains won't let me use \*.site.com in the host header ... | 2009/10/23 | [
"https://serverfault.com/questions/187922",
"https://serverfault.com",
"https://serverfault.com/users/46124/"
] | Give each separate website its own IP address and configure IIS to listen based on IP address rather than `Host` header.
Then, any single website with multiple or wildcard subdomains but at a separate IP will work with IIS listening to all incoming requests on that IP. | Just use site.com not \*.site.com |
187,922 | I have a need to support multiple websites on a single IIS 7 server. One of these websites needs to be able to support wildcard subdomains. I was hoping to use host headers for this approach but am thinking this is not possible. The site that requires wildcard subdomains won't let me use \*.site.com in the host header ... | 2009/10/23 | [
"https://serverfault.com/questions/187922",
"https://serverfault.com",
"https://serverfault.com/users/46124/"
] | Give each separate website its own IP address and configure IIS to listen based on IP address rather than `Host` header.
Then, any single website with multiple or wildcard subdomains but at a separate IP will work with IIS listening to all incoming requests on that IP. | My understanding is IIS doesnt support this. Im assuming the next best option is to use URL rewriting and set a rewrite in the global rules (not per site). I've been using IIRF with good results, and it is free. Version 2.x now has a server-level global re-write rules, then each site has its own per-site rewrite rules.... |
23,443,464 | I am new to bootstrap, and I am trying to align a logo and navbar to in the same line. Actually, in the image you see below. I want the menus, logo and navbar to start from the same point.

I know how the 12 grid-system works. But how do we make cla... | 2014/05/03 | [
"https://Stackoverflow.com/questions/23443464",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2520374/"
] | ```
#include <iostream>
int addNumber(int x, int y)
{
int answer = x + y;
return answer;
}
int main()
{
int x,y;
std::cin >> x >> y;
std::cout << addNumber(x,y) << std::endl;
return 0;
}
``` | ```
#include <iostream>
using namespace std;
int addNumber(int x, int y)
{
int answer = x + y;
return answer;
}
int main()
{
int x,y;
cout<<"Enter first number"<<endl;
cin>>x;
cout<<"Enter second number"<<endl;
cin>>y;
cout<<addNumber(x,y)<<endl;
return 0;
}
``` |
12,883,490 | If I load a customer in the following way:
```
$customer = Mage::getModel('customer/customer')
->load($customer_id);
```
Whats the difference between:
```
$customer -> getDefaultShippingAddress();
```
and
```
$customer -> getPrimaryShippingAddress();
```
Thanks in advance! | 2012/10/14 | [
"https://Stackoverflow.com/questions/12883490",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1259801/"
] | They return the same result
See /app/code/core/Mage/Customer/Model/Customer.php
```
/*
* @return Mage_Customer_Model_Address
*/
public function getPrimaryBillingAddress()
{
return $this->getPrimaryAddress('default_billing');
}
/**
* Get customer default billing address
*
* @return Mage_Customer_Model_Addre... | Nothing because getDefaultShippingAddress() calls internally getPrimaryShippingAddress(). You can check the code yourself in /app/code/local/Mage/Customer/Model/Customer.php
```
/**
* Get default customer shipping address
*
* @return Mage_Customer_Model_Address
*/
public function getPrimaryShippingAddress()
{
... |
6,523,653 | Prior to Rails 3, I used this code to observe a field dynamically and pass the data in that field to a controller:
```
<%= observe_field :transaction_borrower_netid,
:url => { :controller => :live_validations, :action => :validate_borrower_netid },
:frequency => 0.5,
:update => :borrower_netid_message,... | 2011/06/29 | [
"https://Stackoverflow.com/questions/6523653",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/751114/"
] | You are able to do this, but it's not very clean, in terms of the proper `$_GET` variable values. The solution automatically type casts the values to integers:
```
sscanf($_GET['id'], '%d,%d', $id, $lang);
// $id = int(5)
// $lang = int(1)
``` | ```
$id = $id . ',' . $lang;
<a href="?<?php echo $id; ?>">
``` |
6,523,653 | Prior to Rails 3, I used this code to observe a field dynamically and pass the data in that field to a controller:
```
<%= observe_field :transaction_borrower_netid,
:url => { :controller => :live_validations, :action => :validate_borrower_netid },
:frequency => 0.5,
:update => :borrower_netid_message,... | 2011/06/29 | [
"https://Stackoverflow.com/questions/6523653",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/751114/"
] | You can use `mod_rewrite` to rewrite `?id=5,1` to `?id=5&lang=1` internally.
Otherwise, the value of `id` will be `5,1`. Your application would then need to know that `id` contains more than the `id`. It could then parse out the language from the id. However, this will become confusing when you introduce more paramet... | ```
$id = $id . ',' . $lang;
<a href="?<?php echo $id; ?>">
``` |
6,523,653 | Prior to Rails 3, I used this code to observe a field dynamically and pass the data in that field to a controller:
```
<%= observe_field :transaction_borrower_netid,
:url => { :controller => :live_validations, :action => :validate_borrower_netid },
:frequency => 0.5,
:update => :borrower_netid_message,... | 2011/06/29 | [
"https://Stackoverflow.com/questions/6523653",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/751114/"
] | Assuming you have already built the URL in the way you have specified, you can break the id field based on the comma and extract the real id and lang field
```
$urlPieces = explode(",", $_GET['id']);
$id = $urlPieces[0];
$lang = $urlPieces[1];
``` | ```
$id = $id . ',' . $lang;
<a href="?<?php echo $id; ?>">
``` |
6,523,653 | Prior to Rails 3, I used this code to observe a field dynamically and pass the data in that field to a controller:
```
<%= observe_field :transaction_borrower_netid,
:url => { :controller => :live_validations, :action => :validate_borrower_netid },
:frequency => 0.5,
:update => :borrower_netid_message,... | 2011/06/29 | [
"https://Stackoverflow.com/questions/6523653",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/751114/"
] | Two solutions:
Firstly, you could simply reformat the parameters when they arrive in your PHP program. With `?id=5,1`, you'll get a PHP `$_GET` array with `id` `'5,1'`. This you can simply split using the `explode()` function to get the two values you want.
The second solution is to use the Apache `mod_rewrite` featu... | ```
$id = $id . ',' . $lang;
<a href="?<?php echo $id; ?>">
``` |
6,523,653 | Prior to Rails 3, I used this code to observe a field dynamically and pass the data in that field to a controller:
```
<%= observe_field :transaction_borrower_netid,
:url => { :controller => :live_validations, :action => :validate_borrower_netid },
:frequency => 0.5,
:update => :borrower_netid_message,... | 2011/06/29 | [
"https://Stackoverflow.com/questions/6523653",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/751114/"
] | You are able to do this, but it's not very clean, in terms of the proper `$_GET` variable values. The solution automatically type casts the values to integers:
```
sscanf($_GET['id'], '%d,%d', $id, $lang);
// $id = int(5)
// $lang = int(1)
``` | Two solutions:
Firstly, you could simply reformat the parameters when they arrive in your PHP program. With `?id=5,1`, you'll get a PHP `$_GET` array with `id` `'5,1'`. This you can simply split using the `explode()` function to get the two values you want.
The second solution is to use the Apache `mod_rewrite` featu... |
6,523,653 | Prior to Rails 3, I used this code to observe a field dynamically and pass the data in that field to a controller:
```
<%= observe_field :transaction_borrower_netid,
:url => { :controller => :live_validations, :action => :validate_borrower_netid },
:frequency => 0.5,
:update => :borrower_netid_message,... | 2011/06/29 | [
"https://Stackoverflow.com/questions/6523653",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/751114/"
] | You can use `mod_rewrite` to rewrite `?id=5,1` to `?id=5&lang=1` internally.
Otherwise, the value of `id` will be `5,1`. Your application would then need to know that `id` contains more than the `id`. It could then parse out the language from the id. However, this will become confusing when you introduce more paramet... | Two solutions:
Firstly, you could simply reformat the parameters when they arrive in your PHP program. With `?id=5,1`, you'll get a PHP `$_GET` array with `id` `'5,1'`. This you can simply split using the `explode()` function to get the two values you want.
The second solution is to use the Apache `mod_rewrite` featu... |
6,523,653 | Prior to Rails 3, I used this code to observe a field dynamically and pass the data in that field to a controller:
```
<%= observe_field :transaction_borrower_netid,
:url => { :controller => :live_validations, :action => :validate_borrower_netid },
:frequency => 0.5,
:update => :borrower_netid_message,... | 2011/06/29 | [
"https://Stackoverflow.com/questions/6523653",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/751114/"
] | Assuming you have already built the URL in the way you have specified, you can break the id field based on the comma and extract the real id and lang field
```
$urlPieces = explode(",", $_GET['id']);
$id = $urlPieces[0];
$lang = $urlPieces[1];
``` | Two solutions:
Firstly, you could simply reformat the parameters when they arrive in your PHP program. With `?id=5,1`, you'll get a PHP `$_GET` array with `id` `'5,1'`. This you can simply split using the `explode()` function to get the two values you want.
The second solution is to use the Apache `mod_rewrite` featu... |
8,751,082 | Trying to put the Dark colored Like Box on my website, everything seems to function properly but the color looks like its the light scheme, what's the problem?
Here's the code I used:
```
<iframe src="//www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fplatform&width=360&height=258&... | 2012/01/05 | [
"https://Stackoverflow.com/questions/8751082",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1133216/"
] | The dark color scheme is rendering properly, but by design it doesn't have a background (it's transparent). Put it in front of a `div` with the background you want, as [demonstrated here](http://jsfiddle.net/R85V4/). | The developer button wizard wasn't working for me (using Chrome). Not sure why, but I found the data element that changes the colorscheme from light to dark. You can manually add the following and it will work just fine.
**data-colorscheme="dark"**
Example:
```
<div class="fb-like" data-href="http://www.nike.com" da... |
8,751,082 | Trying to put the Dark colored Like Box on my website, everything seems to function properly but the color looks like its the light scheme, what's the problem?
Here's the code I used:
```
<iframe src="//www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fplatform&width=360&height=258&... | 2012/01/05 | [
"https://Stackoverflow.com/questions/8751082",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1133216/"
] | The dark color scheme is rendering properly, but by design it doesn't have a background (it's transparent). Put it in front of a `div` with the background you want, as [demonstrated here](http://jsfiddle.net/R85V4/). | I seem to get a similar error..
I'm using the 'like' and the 'login' plugin.. when I'm logged everything is fine.. when I'm not, my 'like' button is light...
issue: [187studio.ch](http://187studio.ch) (top of the page) |
8,751,082 | Trying to put the Dark colored Like Box on my website, everything seems to function properly but the color looks like its the light scheme, what's the problem?
Here's the code I used:
```
<iframe src="//www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fplatform&width=360&height=258&... | 2012/01/05 | [
"https://Stackoverflow.com/questions/8751082",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1133216/"
] | The dark color scheme is rendering properly, but by design it doesn't have a background (it's transparent). Put it in front of a `div` with the background you want, as [demonstrated here](http://jsfiddle.net/R85V4/). | I know I'm late to this thread, but at the present time the dark color scheme appears broken so perhaps others might end up here looking for a solution.
Jimmy Sawczuk's example above still works but that is because he isn't showing the 'stream'. If you set the 'stream' property to true you can see a big problem or tw... |
8,751,082 | Trying to put the Dark colored Like Box on my website, everything seems to function properly but the color looks like its the light scheme, what's the problem?
Here's the code I used:
```
<iframe src="//www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fplatform&width=360&height=258&... | 2012/01/05 | [
"https://Stackoverflow.com/questions/8751082",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1133216/"
] | The developer button wizard wasn't working for me (using Chrome). Not sure why, but I found the data element that changes the colorscheme from light to dark. You can manually add the following and it will work just fine.
**data-colorscheme="dark"**
Example:
```
<div class="fb-like" data-href="http://www.nike.com" da... | I seem to get a similar error..
I'm using the 'like' and the 'login' plugin.. when I'm logged everything is fine.. when I'm not, my 'like' button is light...
issue: [187studio.ch](http://187studio.ch) (top of the page) |
8,751,082 | Trying to put the Dark colored Like Box on my website, everything seems to function properly but the color looks like its the light scheme, what's the problem?
Here's the code I used:
```
<iframe src="//www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fplatform&width=360&height=258&... | 2012/01/05 | [
"https://Stackoverflow.com/questions/8751082",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1133216/"
] | The developer button wizard wasn't working for me (using Chrome). Not sure why, but I found the data element that changes the colorscheme from light to dark. You can manually add the following and it will work just fine.
**data-colorscheme="dark"**
Example:
```
<div class="fb-like" data-href="http://www.nike.com" da... | I know I'm late to this thread, but at the present time the dark color scheme appears broken so perhaps others might end up here looking for a solution.
Jimmy Sawczuk's example above still works but that is because he isn't showing the 'stream'. If you set the 'stream' property to true you can see a big problem or tw... |
29,310,998 | I can not set the name of the selected object in "BarraNome" how can I do?
```
public class MainActivity2Activity extends Activity {
String[] lista1 = { "JAN", "FEB", "MAR", "APR", "MAY", "JUNE", "JULY","AUG", "SEPT", "OCT", "NOV", "DEC" };
Button BarraNome;
private ListView lista;
private ArrayAdapter arrayAdapter;... | 2015/03/27 | [
"https://Stackoverflow.com/questions/29310998",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4671207/"
] | You may need to call out to `expr`, depending on your mystery shell:
```
d1="2015-03-31" d2="2015-04-01"
if [ "$d1" = "$d2" ]; then
echo "same day"
elif expr "$d1" "<" "$d2" >/dev/null; then
echo "d1 is earlier than d2"
else
echo "d1 is later than d2"
fi
```
```
d1 is earlier than d2
```
---
The `test... | You can use `date +%s -d your_date` to get the number of seconds since a fixed instance (1970-01-01, 00:00 UTC) called "epoch". Once you get that it's really easy to do almost anything with dates. And there are a couple of options to convert a number back to date too. |
18,243,921 | I'm very new to Objective-C so sorry if this is extremely obvious to many of you, but I'm trying to work out how the following piece of code is actually working:
```
- (IBAction)chooseColour:(UIButton *)sender {
sender.selected = !sender.isSelected;
}
```
Now it obviously toggles between the selected and unselected... | 2013/08/14 | [
"https://Stackoverflow.com/questions/18243921",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2658664/"
] | You are entirely correct, it's calling the getter to obtain the value and calling the setter with the NOT (`!`) of the value. It isn't Objective-C, it's plain C syntax. | >
> Is it just 'set the sender selected property to the opposite (i.e. ! not) of the getter'?
>
>
>
Exactly. That.
>
> Or is this a piece of convenience code that I'm not yet privy to?
>
>
>
No, the only piece of syntactic sugar is the dot notation for getters/setters, but you are already aware of it. |
18,243,921 | I'm very new to Objective-C so sorry if this is extremely obvious to many of you, but I'm trying to work out how the following piece of code is actually working:
```
- (IBAction)chooseColour:(UIButton *)sender {
sender.selected = !sender.isSelected;
}
```
Now it obviously toggles between the selected and unselected... | 2013/08/14 | [
"https://Stackoverflow.com/questions/18243921",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2658664/"
] | You are entirely correct, it's calling the getter to obtain the value and calling the setter with the NOT (`!`) of the value. It isn't Objective-C, it's plain C syntax. | The portion of the code:
```
sender.selected = !sender.isSelected;
```
Basically inverts the selection. It asks the question `Is this false?` so true evaluates false, and false evaluates to true. So it's a toggle. |
18,243,921 | I'm very new to Objective-C so sorry if this is extremely obvious to many of you, but I'm trying to work out how the following piece of code is actually working:
```
- (IBAction)chooseColour:(UIButton *)sender {
sender.selected = !sender.isSelected;
}
```
Now it obviously toggles between the selected and unselected... | 2013/08/14 | [
"https://Stackoverflow.com/questions/18243921",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2658664/"
] | You are entirely correct, it's calling the getter to obtain the value and calling the setter with the NOT (`!`) of the value. It isn't Objective-C, it's plain C syntax. | from documentation :
```
@property(nonatomic,getter=isSelected) BOOL selected; // default is NO may be used by some subclasses or by application
```
//explanation
if you use ![sender isSelected] value in property isn't changed. then if you use setter sender.selected = ![sender isSelec... |
18,243,921 | I'm very new to Objective-C so sorry if this is extremely obvious to many of you, but I'm trying to work out how the following piece of code is actually working:
```
- (IBAction)chooseColour:(UIButton *)sender {
sender.selected = !sender.isSelected;
}
```
Now it obviously toggles between the selected and unselected... | 2013/08/14 | [
"https://Stackoverflow.com/questions/18243921",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2658664/"
] | >
> Is it just 'set the sender selected property to the opposite (i.e. ! not) of the getter'?
>
>
>
Exactly. That.
>
> Or is this a piece of convenience code that I'm not yet privy to?
>
>
>
No, the only piece of syntactic sugar is the dot notation for getters/setters, but you are already aware of it. | The portion of the code:
```
sender.selected = !sender.isSelected;
```
Basically inverts the selection. It asks the question `Is this false?` so true evaluates false, and false evaluates to true. So it's a toggle. |
18,243,921 | I'm very new to Objective-C so sorry if this is extremely obvious to many of you, but I'm trying to work out how the following piece of code is actually working:
```
- (IBAction)chooseColour:(UIButton *)sender {
sender.selected = !sender.isSelected;
}
```
Now it obviously toggles between the selected and unselected... | 2013/08/14 | [
"https://Stackoverflow.com/questions/18243921",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2658664/"
] | >
> Is it just 'set the sender selected property to the opposite (i.e. ! not) of the getter'?
>
>
>
Exactly. That.
>
> Or is this a piece of convenience code that I'm not yet privy to?
>
>
>
No, the only piece of syntactic sugar is the dot notation for getters/setters, but you are already aware of it. | from documentation :
```
@property(nonatomic,getter=isSelected) BOOL selected; // default is NO may be used by some subclasses or by application
```
//explanation
if you use ![sender isSelected] value in property isn't changed. then if you use setter sender.selected = ![sender isSelec... |
24,056,020 | Here is HTML:
```
<div class="vl-article-title">
<h3>
<span style="font-size: 24px;">
<a href="http://www.15min.lt/naujiena/sportas/fifa-2014/desimt-pasaul…onato-debiutantu-kurie-atkreips-jusu-demesi-813-430673?cf=vl"></a>
</span>
</h3>
</div>
```
I need to get only links (a) bu... | 2014/06/05 | [
"https://Stackoverflow.com/questions/24056020",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2788600/"
] | The > sign is the direct descendant selector. It will not match the A element because there's a span in between.
You should be able to do this:
```
h3 = soup.select('div.vl-article-title > h3 > span > a')
```
Or, if it's OK to be a little less specific with the selector:
```
h3 = soup.select('div.vl-article-title ... | If that's the entire HTML, then you can simply do the following:
```
soup = BeautifulSoup(html)
link = soup.find("a").attrs["href"] # this gives you the link as a string
```
If there are multiple `<a>` tags in the page, you can replace the `find("a")` with `find_all("a")`, which returns an iterator.
**EDIT** per r... |
124,576 | On the Account page, I have a lookup for Secondary Contact. I also have two formula fields: Secondary Contact Email and Secondary Contact Phone.
If you choose someone in the Secondary Contact field, it should populate the Secondary Contact Email and Secondary Contact Phone fields. And this is mostly happening.
I ha... | 2016/06/03 | [
"https://salesforce.stackexchange.com/questions/124576",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/32133/"
] | Something like this should work
```
IF(NOT(ISBLANK(Secondary_Contact__r.npe01__HomeEmail__c))
,Secondary_Contact__r.npe01__HomeEmail__c,
(IF(NOT(ISBLANK(Secondary_Contact__r.npe01__WorkEmail__c))),Secondary_Contact__r.npe01__WorkEmail__c,
Secondary_Contact__r.npe01__AlternateEmail__c))
```
Your... | You can try `BLANKVALUE`:
```
BLANKVALUE(Secondary_Contact__r.npe01__HomeEmail__c,
BLANKVALUE(
Secondary_Contact__r.npe01__WorkEmail__c,
Secondary_Contact__r.npe01__AlternateEmail__c
)
)
```
What this formula says is basically:
1. If the `Home Email` is not blank, use that value.
2. Else if ... |
32,311 | I'm interested in \*coin, but I'm afraid of sinking money into something out of idle curiosity and then losing that money to value fluctuations. Would it be a good idea to have several different \*coin (lite, doge, idk what else there is) so that the fluctuations balance each other?
Have different \*coin in the past ... | 2014/11/04 | [
"https://bitcoin.stackexchange.com/questions/32311",
"https://bitcoin.stackexchange.com",
"https://bitcoin.stackexchange.com/users/13856/"
] | I don't see how different coins would protect against volatility, as Bitcoin is by far the leading cryptocurrency, and the others (even all of them combined) are really totally insignificant in terms of market cap and trading volume.
If you want to protect against volatility (given that you measure volatility in term... | You should see \*coin as a **very high risk** asset. The strategy "diversify your investment" only works on regular stocks since people generally see the markets rising over large amounts of time on established companies. (The fluctuations average in accordance to the *law of large numbers*)
It is much more risky to i... |
32,311 | I'm interested in \*coin, but I'm afraid of sinking money into something out of idle curiosity and then losing that money to value fluctuations. Would it be a good idea to have several different \*coin (lite, doge, idk what else there is) so that the fluctuations balance each other?
Have different \*coin in the past ... | 2014/11/04 | [
"https://bitcoin.stackexchange.com/questions/32311",
"https://bitcoin.stackexchange.com",
"https://bitcoin.stackexchange.com/users/13856/"
] | I don't see how different coins would protect against volatility, as Bitcoin is by far the leading cryptocurrency, and the others (even all of them combined) are really totally insignificant in terms of market cap and trading volume.
If you want to protect against volatility (given that you measure volatility in term... | There are services emerging to combat the volatility of Bitcoin. Bitreserve is one. But to be honest if you are worried about the volatility, just keep your funds in your native currency and buy bitcoin when you need bitcoin since there are plenty of places you can buy bitcoin almost instantly. |
29,220,881 | I am working with VPN on iOS using the NetworkExtension framework. I am able to install the config and make connection. My question is if there's a way to detect if the VPN config is still installed or detect if user has un-installed the config?
I am not necessarily looking for a notification or anything in the backg... | 2015/03/23 | [
"https://Stackoverflow.com/questions/29220881",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2060112/"
] | You can try following
```
if ([[[NEVPNManager sharedManager] connection] status] == NEVPNStatusInvalid) {
//...
}
``` | Might be a little late. But i've encountered the same problem. However, your approach got me in the right direction. You should load it within the completion handler of: `loadFromPreferencesWithCompletionHandler`
The propper use, in my opinion, of checking if there is a profile installed:
```
manager = [NEVPNManag... |
1,019,267 | Consider 3 baskets. Basket A contains 3 white and 5 red marbles. Basket B contains 8 white and 3 red marbles. Basket C contains 4 white and 4 red marbles. An experiment consists of selecting one marble from each basket at random. What is the probability that the marble selected from basket A was white, given that exact... | 2014/11/12 | [
"https://math.stackexchange.com/questions/1019267",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/177356/"
] | By Bayes rule, the required probability is equal to
$$P(A\_w|W=2)=\frac{P(W=2|A\_w)P(A\_w)}{P(W=2)}=\frac{\frac{1}{2}\frac{3}{8}}{\frac{73}{176}}=\frac{33}{73}$$ since $$P(W=2|A\_w)=P(B\_w)P(C\_r)+P(B\_r)(C\_w)=\frac{1}{2}$$ and $$\begin{align\*}P(W=2)&=P(A\_w)P(B\_w)P(C\_r)+P(A\_w)P(B\_r)P(C\_w)+P(A\_r)P(B\_w)P(C\_w)\... | Let $A,B,C$ be the event of selecting a white marble from the relevant container.
$$\mathsf P(A) = 3/8, \mathsf P(B) = 8/11, \mathsf P(C) = 1/2$$
We want: $$\require{cancel} \begin{align}
\mathsf P(A\mid ABC^c\cup AB^cC\cup A^cBC)
& = \frac{\mathsf P(ABC^c\cup AB^cC)}{\mathsf P(ABC^c\cup AB^cC\cup A^cBC)}
\\[1ex] & ... |
14,841,746 | I have a JS app that saves to localStorage. No big deal. However, what's being stored are fairly large JSONs. 10MB vanishes quickly. What I'd like to do is, if storage is full, delete the oldest record.
Is there a way to reliably find the oldest record in localStorage? | 2013/02/12 | [
"https://Stackoverflow.com/questions/14841746",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/435175/"
] | In order to make your LayerSlider display at 100% height and width, leave the "Slider height" attribute in "Slider Settings" blank, and then use a script like the following to set the height:
```
<script type="text/javascript">
function resize()
{
var heights = window.innerHeight;
document.get... | you can add style to the div element
```
<div style="background: url(images/xyz.jpg) no-repeat center center fixed;">...</div>
```
I just took the css from your sample page and copy/pasted! |
36,287,160 | DataBase has table with saved Tweets.
There is controller:
```
<?php
namespace app\controllers;
use yii\rest\ActiveController;
class TweetController extends ActiveController
{
public $modelClass = 'app\models\Tweet';
}
```
Corresponding model `app\model\Tweet` created by `gii`.
In `app\web\config` added:
... | 2016/03/29 | [
"https://Stackoverflow.com/questions/36287160",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5923447/"
] | The path should be
```
http:://localhost/yii2/tweets
```
or
```
http:://localhost/yii2/index.php/tweets
```
(depending by the correct configuration of urlManager)
try also
```
http:://localhost/yii2/tweets/index
```
or
```
http:://localhost/yii2/index.php/tweets/index
```
could be you can find us... | add followings lines to your controller:
```
protected function verbs() {
$verbs = parent::verbs();
$verbs = [
'index' => ['GET', 'POST', 'HEAD'],
'view' => ['GET', 'HEAD'],
'create' => ['POST'],
'update' => ['PUT', 'PATCH']
];
return $verbs;
}
``` |
36,287,160 | DataBase has table with saved Tweets.
There is controller:
```
<?php
namespace app\controllers;
use yii\rest\ActiveController;
class TweetController extends ActiveController
{
public $modelClass = 'app\models\Tweet';
}
```
Corresponding model `app\model\Tweet` created by `gii`.
In `app\web\config` added:
... | 2016/03/29 | [
"https://Stackoverflow.com/questions/36287160",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5923447/"
] | The path should be
```
http:://localhost/yii2/tweets
```
or
```
http:://localhost/yii2/index.php/tweets
```
(depending by the correct configuration of urlManager)
try also
```
http:://localhost/yii2/tweets/index
```
or
```
http:://localhost/yii2/index.php/tweets/index
```
could be you can find us... | I just encountered this issue and spent some time tracing through the code to find that you must have an alias defined for your project. Without that, it cannot load your controllers.
I am working in a Yii2 advanced template setup where I have this structure:
```
/common
/mainApp
/api
```
In `/common/config/bootstr... |
36,287,160 | DataBase has table with saved Tweets.
There is controller:
```
<?php
namespace app\controllers;
use yii\rest\ActiveController;
class TweetController extends ActiveController
{
public $modelClass = 'app\models\Tweet';
}
```
Corresponding model `app\model\Tweet` created by `gii`.
In `app\web\config` added:
... | 2016/03/29 | [
"https://Stackoverflow.com/questions/36287160",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5923447/"
] | I also got the same problem.This is my solution,which worked well for me(Apache 2.2).
\*\*Editing the apache2.conf file and changing the AllowOverride from None to All. Then restart Apache Service \*\* | add followings lines to your controller:
```
protected function verbs() {
$verbs = parent::verbs();
$verbs = [
'index' => ['GET', 'POST', 'HEAD'],
'view' => ['GET', 'HEAD'],
'create' => ['POST'],
'update' => ['PUT', 'PATCH']
];
return $verbs;
}
``` |
36,287,160 | DataBase has table with saved Tweets.
There is controller:
```
<?php
namespace app\controllers;
use yii\rest\ActiveController;
class TweetController extends ActiveController
{
public $modelClass = 'app\models\Tweet';
}
```
Corresponding model `app\model\Tweet` created by `gii`.
In `app\web\config` added:
... | 2016/03/29 | [
"https://Stackoverflow.com/questions/36287160",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5923447/"
] | I also got the same problem.This is my solution,which worked well for me(Apache 2.2).
\*\*Editing the apache2.conf file and changing the AllowOverride from None to All. Then restart Apache Service \*\* | I just encountered this issue and spent some time tracing through the code to find that you must have an alias defined for your project. Without that, it cannot load your controllers.
I am working in a Yii2 advanced template setup where I have this structure:
```
/common
/mainApp
/api
```
In `/common/config/bootstr... |
36,287,160 | DataBase has table with saved Tweets.
There is controller:
```
<?php
namespace app\controllers;
use yii\rest\ActiveController;
class TweetController extends ActiveController
{
public $modelClass = 'app\models\Tweet';
}
```
Corresponding model `app\model\Tweet` created by `gii`.
In `app\web\config` added:
... | 2016/03/29 | [
"https://Stackoverflow.com/questions/36287160",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5923447/"
] | I had the same problem, I set `'enableStrictParsing' => false` and it worked for me. | add followings lines to your controller:
```
protected function verbs() {
$verbs = parent::verbs();
$verbs = [
'index' => ['GET', 'POST', 'HEAD'],
'view' => ['GET', 'HEAD'],
'create' => ['POST'],
'update' => ['PUT', 'PATCH']
];
return $verbs;
}
``` |
36,287,160 | DataBase has table with saved Tweets.
There is controller:
```
<?php
namespace app\controllers;
use yii\rest\ActiveController;
class TweetController extends ActiveController
{
public $modelClass = 'app\models\Tweet';
}
```
Corresponding model `app\model\Tweet` created by `gii`.
In `app\web\config` added:
... | 2016/03/29 | [
"https://Stackoverflow.com/questions/36287160",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5923447/"
] | I had the same problem, I set `'enableStrictParsing' => false` and it worked for me. | I just encountered this issue and spent some time tracing through the code to find that you must have an alias defined for your project. Without that, it cannot load your controllers.
I am working in a Yii2 advanced template setup where I have this structure:
```
/common
/mainApp
/api
```
In `/common/config/bootstr... |
69,679,870 | Is there a simple solution (lint rule perhaps?) which can help enforce clean code imports through index files? I'd like to prevent importing code from "cousin" files, except if it is made available through an index file.
Ex:
```
- app
+ dogs
| + index.ts
| + breeds
| | + retriever.ts
| | + schnauzer.ts
... | 2021/10/22 | [
"https://Stackoverflow.com/questions/69679870",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2908576/"
] | You can use eslint's [`import/no-internal-modules` rule](https://github.com/import-js/eslint-plugin-import/blob/HEAD/docs/rules/no-internal-modules.md) and configure separate `.eslintrc` rules per "root" module.
In your `dogs` folder, create a new `.eslintrc` file with this contents:
```
{
"rules": {
"import/no... | The eslint [`no-restricted-imports`](https://eslint.org/docs/rules/no-restricted-imports) rule can be used to provide custom rules for import patterns. This pattern prevents anything 2+ levels up and then 2+ levels down, which prevents cousin imports.
```json
"no-restricted-imports": [
"warn",
{
"patterns": [
... |
46,250 | I'm using an API which returns text in the following format:
```
#start
#p 09060 20131010
#p 09180 AK
#p 01001 19110212982
#end
#start
#p 09060 20131110
#p 09180 AB
#p 01001 12110212982
#end
```
I'm converting this to a list of objects:
```
var result = data.match(/#start[\s\S]+?#end/ig).map(function(v){
var l... | 2014/04/04 | [
"https://codereview.stackexchange.com/questions/46250",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/26558/"
] | I totally agree with Uri and have some further comments:
>
> the class has no idea what the set will contain, it does however know there maybe a IDescriptor that is meant for video..
>
>
>
I'm sorry, but I have to ask: If you're not sure about exactly what the Set contains, why are you storing it in a set in the ... | Are you asking if you can find the first element in a list of a certain type without asking for its type? That's a strange question... What's wrong with `instanceof`?
As for the code, being code-review, I've got some observations:
This code actually finds the *last* instance of type `VideoDescriptor` in `mDescriptor`... |
30,336,337 | I'm a bit confused about the different between **Events** and **Listeners**.
I understood how you can create your events under `Events` then register them and implement the Handlers in `Handlers\Events`. So here I have events and the handling of events.
They work after I define them in `Providers\EventServiceProvide... | 2015/05/19 | [
"https://Stackoverflow.com/questions/30336337",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/391986/"
] | In your example `UserHasSignedUp` is an `Event`. `SendWelcomeEmail` and `SendAdminEmail` are two listeners "waiting" for the event UserHasSignedUp to be fired and they should implement the required business logic at `handle` method of each one.
Super simple example:
Somewhere in UserController
```
Event::fire(new Us... | There's not too much information on this out there, so this might just be speculation. I took a look at [this video](https://www.youtube.com/watch?v=WNYb1r4eMio) and saw that you can use handlers with commands. I think if you're using commands, that makes sense to have all your handlers in one spot. However if you're n... |
30,336,337 | I'm a bit confused about the different between **Events** and **Listeners**.
I understood how you can create your events under `Events` then register them and implement the Handlers in `Handlers\Events`. So here I have events and the handling of events.
They work after I define them in `Providers\EventServiceProvide... | 2015/05/19 | [
"https://Stackoverflow.com/questions/30336337",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/391986/"
] | In your example `UserHasSignedUp` is an `Event`. `SendWelcomeEmail` and `SendAdminEmail` are two listeners "waiting" for the event UserHasSignedUp to be fired and they should implement the required business logic at `handle` method of each one.
Super simple example:
Somewhere in UserController
```
Event::fire(new Us... | Listeners vs. Handlers :
A listener `listen` for a specific event to be fired. xxxxCreatedListener will only listen for xxxx
A handler can handle multiple events to be fired. For exemple, let's say you use performing CRUD operations, your handler could wait for the xxxxCreatedEvent, xxxxDeletedEvent, xxxxUpdatedEven... |
30,336,337 | I'm a bit confused about the different between **Events** and **Listeners**.
I understood how you can create your events under `Events` then register them and implement the Handlers in `Handlers\Events`. So here I have events and the handling of events.
They work after I define them in `Providers\EventServiceProvide... | 2015/05/19 | [
"https://Stackoverflow.com/questions/30336337",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/391986/"
] | In your example `UserHasSignedUp` is an `Event`. `SendWelcomeEmail` and `SendAdminEmail` are two listeners "waiting" for the event UserHasSignedUp to be fired and they should implement the required business logic at `handle` method of each one.
Super simple example:
Somewhere in UserController
```
Event::fire(new Us... | The only difference between them seems to be is, `handler:event` is from Laravel 5.0's folder structure, and `make:listener` is the **new & current** folder structure. **Functionally, they are the same**! - [Upgrade Guide to Laravel 5.1](https://laravel.com/docs/5.1/upgrade#upgrade-5.1.0)
>
> **Commands & Handlers**
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.