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 |
|---|---|---|---|---|---|
16,617,586 | I am using a jquery to slide a div "slidingDiv" when an anchor "show\_hide" is clicked. I am wondering if i can show the div open when the page is loaded. Because i have textboxes in the div and want to have some text when the page is loaded sometimes.
```
$(document).ready(function()
{
$(".slidingDiv").hide();
... | 2013/05/17 | [
"https://Stackoverflow.com/questions/16617586",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/397062/"
] | Ha, now I see what is bothering you. Your problem is either onResume or onCreate happens second time and this resets your image to your default value you set in your XML. You can simply log and see which of these occurs. Once you see where your image is returned to default, simply create field in your activity class wh... | I got the answer from this thread: [Android: What's the best hierarchy for this app?](https://stackoverflow.com/questions/16634598/android-whats-the-best-hierarchy-for-this-app)
The key was learning the concept of checking if an object is null before calling it.
The code I used was this:
```
if (mGetClickTime !... |
8,248 | Hi All,
I have been looking at moving me stereo short doco films with background music to a surround experience. At the moment the design is fairly simple, interview vocals center and music as it comes from the artist (stereo). What can you guys suggest to move the music towards using a full surround experience. I am ... | 2011/05/26 | [
"https://sound.stackexchange.com/questions/8248",
"https://sound.stackexchange.com",
"https://sound.stackexchange.com/users/830/"
] | The way I normally start when mixing music for 5.1 (mostly in feature films, but sometimes also in documentaries), is to pull the music slightly towards the center, so that it isn't strictly L-R but more L-R with a little bit of center, so you don't get too much of the "hole in the middle" syndrome. Sometimes I pull it... | The simplest solution is to worldize sections using subtle reverb and send that to the surrounds. You have to be careful what you send to the surrounds and how often as sounds arriving from behind the audience can often make listeners feel uncomfortable.
I would leave the music as left and right and move some of the s... |
8,248 | Hi All,
I have been looking at moving me stereo short doco films with background music to a surround experience. At the moment the design is fairly simple, interview vocals center and music as it comes from the artist (stereo). What can you guys suggest to move the music towards using a full surround experience. I am ... | 2011/05/26 | [
"https://sound.stackexchange.com/questions/8248",
"https://sound.stackexchange.com",
"https://sound.stackexchange.com/users/830/"
] | The simplest solution is to worldize sections using subtle reverb and send that to the surrounds. You have to be careful what you send to the surrounds and how often as sounds arriving from behind the audience can often make listeners feel uncomfortable.
I would leave the music as left and right and move some of the s... | From everything I've heard, mixing music into the surrounds is supposedly a big no-no. Same goes for mixing dialogue in the surrounds. Personally, I like mixing music in surround, and depending on the context of the dialogue, I'll mix that in surround as well I'm not one for playing inside the rules or playing it safe ... |
8,248 | Hi All,
I have been looking at moving me stereo short doco films with background music to a surround experience. At the moment the design is fairly simple, interview vocals center and music as it comes from the artist (stereo). What can you guys suggest to move the music towards using a full surround experience. I am ... | 2011/05/26 | [
"https://sound.stackexchange.com/questions/8248",
"https://sound.stackexchange.com",
"https://sound.stackexchange.com/users/830/"
] | The way I normally start when mixing music for 5.1 (mostly in feature films, but sometimes also in documentaries), is to pull the music slightly towards the center, so that it isn't strictly L-R but more L-R with a little bit of center, so you don't get too much of the "hole in the middle" syndrome. Sometimes I pull it... | It depends what you're mixing in.
Logic is easiest for surround panning as you just change the output to surround and you can use the planner to position your centre point and alter the stereo spread across the 5.1 field. This also works for auxiliary busses for your reverbs.
Protools is a bit more faffy - you cant... |
8,248 | Hi All,
I have been looking at moving me stereo short doco films with background music to a surround experience. At the moment the design is fairly simple, interview vocals center and music as it comes from the artist (stereo). What can you guys suggest to move the music towards using a full surround experience. I am ... | 2011/05/26 | [
"https://sound.stackexchange.com/questions/8248",
"https://sound.stackexchange.com",
"https://sound.stackexchange.com/users/830/"
] | It depends what you're mixing in.
Logic is easiest for surround panning as you just change the output to surround and you can use the planner to position your centre point and alter the stereo spread across the 5.1 field. This also works for auxiliary busses for your reverbs.
Protools is a bit more faffy - you cant... | From everything I've heard, mixing music into the surrounds is supposedly a big no-no. Same goes for mixing dialogue in the surrounds. Personally, I like mixing music in surround, and depending on the context of the dialogue, I'll mix that in surround as well I'm not one for playing inside the rules or playing it safe ... |
8,248 | Hi All,
I have been looking at moving me stereo short doco films with background music to a surround experience. At the moment the design is fairly simple, interview vocals center and music as it comes from the artist (stereo). What can you guys suggest to move the music towards using a full surround experience. I am ... | 2011/05/26 | [
"https://sound.stackexchange.com/questions/8248",
"https://sound.stackexchange.com",
"https://sound.stackexchange.com/users/830/"
] | The way I normally start when mixing music for 5.1 (mostly in feature films, but sometimes also in documentaries), is to pull the music slightly towards the center, so that it isn't strictly L-R but more L-R with a little bit of center, so you don't get too much of the "hole in the middle" syndrome. Sometimes I pull it... | From everything I've heard, mixing music into the surrounds is supposedly a big no-no. Same goes for mixing dialogue in the surrounds. Personally, I like mixing music in surround, and depending on the context of the dialogue, I'll mix that in surround as well I'm not one for playing inside the rules or playing it safe ... |
239,971 | If I use a transformer to step the voltage down from 220V to around ~30V and I expect the 30V end to draw up to ~30A, what kind of current magnitude will I have to plan for or expect to see on the 220V side?
I am very noob. Please feel free to help make this question better/clearer or give suggestions. | 2016/06/08 | [
"https://electronics.stackexchange.com/questions/239971",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/38695/"
] | For a ideal transformer, current scales inversely proportional to voltage. Put another way, current x voltage is constant. That's because current x voltage is power, and for a ideal transformer, power in and power out are the same.
Of course no transformer is ideal. There will always be some loss, so power in will be ... | Power in has to equal power out. V1\*I1 = V2\*I2
Solving the equation (30\*30)/220 = 4 amps.
This is theoretical. In reality there will be losses. Provision for 5 to 6 amps to have enough overhead at the output. |
14,520,616 | Is there any way in C# that I can take an empty image and for example draw lines onto it? If possible can you show me an example on how to do this? I've seen something like this before but I don't know to much on how to do it and everywhere online I found was doing it from a pre existing image, then drawing over it. I ... | 2013/01/25 | [
"https://Stackoverflow.com/questions/14520616",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2006145/"
] | A friend function should be defined outside, you could hit issues like [Access friend function defined in class](https://stackoverflow.com/questions/7785886/access-friend-function-defined-in-class) . You should just leave a friend declaration within the class and define the function outside the class.
But your error c... | If you are concerned about tight coupling like me, you are especially concerned about `friend` (because that's the tightest coupling C++ has to offer). That said, there is a view of `operator<<` that makes it easy to implement, inside the class, without any friend declarations:
Simply put, `operator<<` for ostream is ... |
2,841,195 | Problem:[](https://i.stack.imgur.com/lRVXS.png)
In this problem, I multiplied the left side of the AX=B equation by the inverse of A, but what I am confused about is why then I must multiply B by the inverse of A in this order: (inverse of A) \* (B). ... | 2018/07/04 | [
"https://math.stackexchange.com/questions/2841195",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/572099/"
] | There's no need to multiply by anything at all. An $m\times n$ matrix multiplied by an $n\times k$ matrix will be an $m\times k$ matrix. We cannot multiply an $m\times n$ matrix by a $p\times k$ matrix unless $n=p.$ Use this to find the size of $X,$ instead. | We have that
$$AX=B$$
and by left multiplication by $A^{-1}$ and associativity we obtain
$$A^{-1}(AX)=A^{-1}B\implies (A^{-1}A)X=A^{-1}B\implies X=A^{-1}B$$
Recall also that matrix multiplication is not commutative and moreover in that case the multiplication $BA^{-1}$ is not well defined since the dimensions of th... |
3,915,202 | I have this array:
```
$a = array('it' => 'italiano',
'fr' => 'francese',
'en' => 'inglese',
'es' => 'spagnolo',
'de' => 'deutsch',
);
```
Is there any function that i give as arguments the array and a key (for example 'en') and it r... | 2010/10/12 | [
"https://Stackoverflow.com/questions/3915202",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/248959/"
] | What's wrong with using `$a['en']`? Which would give 'inglese' as well.
```
function get_value($array, $key){
return (isset($array[$key]) ? $array[$key] : null;
}
echo get_value($array, 'en'); # => echoes inglese
``` | Why not simply do:
```
echo $a['en'];
```
This will give you `inglese` |
3,915,202 | I have this array:
```
$a = array('it' => 'italiano',
'fr' => 'francese',
'en' => 'inglese',
'es' => 'spagnolo',
'de' => 'deutsch',
);
```
Is there any function that i give as arguments the array and a key (for example 'en') and it r... | 2010/10/12 | [
"https://Stackoverflow.com/questions/3915202",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/248959/"
] | This doesn't necessitate a function. This is just standard array access logic.
```
$a['en']
```
Or if `$key` was 'en', then
```
$a[$key]
``` | ```
$languageName = 'Default';
$languageCode = 'en';
if (isset($a[$languageCode])) {
$languageName = $a[$languageCode];
}
``` |
3,915,202 | I have this array:
```
$a = array('it' => 'italiano',
'fr' => 'francese',
'en' => 'inglese',
'es' => 'spagnolo',
'de' => 'deutsch',
);
```
Is there any function that i give as arguments the array and a key (for example 'en') and it r... | 2010/10/12 | [
"https://Stackoverflow.com/questions/3915202",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/248959/"
] | ```
$languageName = 'Default';
$languageCode = 'en';
if (isset($a[$languageCode])) {
$languageName = $a[$languageCode];
}
``` | ```
function language($array, $language){
if(isset($array[$language]))
return $array[$language];
else
return false;
}
$language = language($a, 'en');
if($language != false)
echo $language;
``` |
3,915,202 | I have this array:
```
$a = array('it' => 'italiano',
'fr' => 'francese',
'en' => 'inglese',
'es' => 'spagnolo',
'de' => 'deutsch',
);
```
Is there any function that i give as arguments the array and a key (for example 'en') and it r... | 2010/10/12 | [
"https://Stackoverflow.com/questions/3915202",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/248959/"
] | ```
$languageName = 'Default';
$languageCode = 'en';
if (isset($a[$languageCode])) {
$languageName = $a[$languageCode];
}
``` | There are a couple of ways you can do this
```
$a = array(
'it' => 'italiano',
'fr' => 'francese',
'en' => 'inglese',
'es' => 'spagnolo',
'de' => 'deutsch',
);
$lang = 'it';
echo getValueFromKey($a,$lang);
function getValueFromKey($array,$key) {
return $array[$key];
}
```
or l... |
3,915,202 | I have this array:
```
$a = array('it' => 'italiano',
'fr' => 'francese',
'en' => 'inglese',
'es' => 'spagnolo',
'de' => 'deutsch',
);
```
Is there any function that i give as arguments the array and a key (for example 'en') and it r... | 2010/10/12 | [
"https://Stackoverflow.com/questions/3915202",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/248959/"
] | ```
$languageName = 'Default';
$languageCode = 'en';
if (isset($a[$languageCode])) {
$languageName = $a[$languageCode];
}
``` | What's wrong with using `$a['en']`? Which would give 'inglese' as well.
```
function get_value($array, $key){
return (isset($array[$key]) ? $array[$key] : null;
}
echo get_value($array, 'en'); # => echoes inglese
``` |
3,915,202 | I have this array:
```
$a = array('it' => 'italiano',
'fr' => 'francese',
'en' => 'inglese',
'es' => 'spagnolo',
'de' => 'deutsch',
);
```
Is there any function that i give as arguments the array and a key (for example 'en') and it r... | 2010/10/12 | [
"https://Stackoverflow.com/questions/3915202",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/248959/"
] | This doesn't necessitate a function. This is just standard array access logic.
```
$a['en']
```
Or if `$key` was 'en', then
```
$a[$key]
``` | ```
function language($array, $language){
if(isset($array[$language]))
return $array[$language];
else
return false;
}
$language = language($a, 'en');
if($language != false)
echo $language;
``` |
3,915,202 | I have this array:
```
$a = array('it' => 'italiano',
'fr' => 'francese',
'en' => 'inglese',
'es' => 'spagnolo',
'de' => 'deutsch',
);
```
Is there any function that i give as arguments the array and a key (for example 'en') and it r... | 2010/10/12 | [
"https://Stackoverflow.com/questions/3915202",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/248959/"
] | This doesn't necessitate a function. This is just standard array access logic.
```
$a['en']
```
Or if `$key` was 'en', then
```
$a[$key]
``` | Why not simply do:
```
echo $a['en'];
```
This will give you `inglese` |
3,915,202 | I have this array:
```
$a = array('it' => 'italiano',
'fr' => 'francese',
'en' => 'inglese',
'es' => 'spagnolo',
'de' => 'deutsch',
);
```
Is there any function that i give as arguments the array and a key (for example 'en') and it r... | 2010/10/12 | [
"https://Stackoverflow.com/questions/3915202",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/248959/"
] | This doesn't necessitate a function. This is just standard array access logic.
```
$a['en']
```
Or if `$key` was 'en', then
```
$a[$key]
``` | What's wrong with using `$a['en']`? Which would give 'inglese' as well.
```
function get_value($array, $key){
return (isset($array[$key]) ? $array[$key] : null;
}
echo get_value($array, 'en'); # => echoes inglese
``` |
3,915,202 | I have this array:
```
$a = array('it' => 'italiano',
'fr' => 'francese',
'en' => 'inglese',
'es' => 'spagnolo',
'de' => 'deutsch',
);
```
Is there any function that i give as arguments the array and a key (for example 'en') and it r... | 2010/10/12 | [
"https://Stackoverflow.com/questions/3915202",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/248959/"
] | ```
$languageName = 'Default';
$languageCode = 'en';
if (isset($a[$languageCode])) {
$languageName = $a[$languageCode];
}
``` | Why not simply do:
```
echo $a['en'];
```
This will give you `inglese` |
3,915,202 | I have this array:
```
$a = array('it' => 'italiano',
'fr' => 'francese',
'en' => 'inglese',
'es' => 'spagnolo',
'de' => 'deutsch',
);
```
Is there any function that i give as arguments the array and a key (for example 'en') and it r... | 2010/10/12 | [
"https://Stackoverflow.com/questions/3915202",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/248959/"
] | There are a couple of ways you can do this
```
$a = array(
'it' => 'italiano',
'fr' => 'francese',
'en' => 'inglese',
'es' => 'spagnolo',
'de' => 'deutsch',
);
$lang = 'it';
echo getValueFromKey($a,$lang);
function getValueFromKey($array,$key) {
return $array[$key];
}
```
or l... | Why not simply do:
```
echo $a['en'];
```
This will give you `inglese` |
2,674,207 | It was suggested Taylor series for that.
$e^1 = \sum\_{k=0}^\infty \frac{1}{k!}$
I don't know how to prove the convergence of this series, so I tried to set the upper limit to 5 (I'm doing all this with a very simple calculator, it's basically by hand). Then $e \approx 2.71$
Since $4\arctan(1)= \pi$
$4\arctan(1)=4 ... | 2018/03/02 | [
"https://math.stackexchange.com/questions/2674207",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/401136/"
] | With your approximations and using [Interval arithmetics](https://en.wikipedia.org/wiki/Interval_arithmetic), you just have to show that $5<e+\pi <6$. | With very crude approximations you can show that
$ 5 \lt e +\pi \lt 6$, and the rest follows.
For crudely approximating $\pi$, we can use Taylor series expansion of $\tan^{-1}(x)$ Since it's an alternating series we can bound $\pi$ on both sides.
Since $\frac\pi6 = \tan^{-1}(\frac1{\sqrt{3}})$.
$$ 6(x - \frac{x^3}3... |
2,674,207 | It was suggested Taylor series for that.
$e^1 = \sum\_{k=0}^\infty \frac{1}{k!}$
I don't know how to prove the convergence of this series, so I tried to set the upper limit to 5 (I'm doing all this with a very simple calculator, it's basically by hand). Then $e \approx 2.71$
Since $4\arctan(1)= \pi$
$4\arctan(1)=4 ... | 2018/03/02 | [
"https://math.stackexchange.com/questions/2674207",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/401136/"
] | With your approximations and using [Interval arithmetics](https://en.wikipedia.org/wiki/Interval_arithmetic), you just have to show that $5<e+\pi <6$. | On calculating $\pi :$ If $\arctan u +\arctan v =\arctan 1=\frac {\pi}{4}$ we may estimate $\pi$ using $$\arctan x=x\sum\_{n=0}^{\infty}\frac {(-x^2)^n}{2n+1}.$$
If $|ab|<1$ then $\arctan a + \arctan b =\arctan \frac {a+b}{1-ab}. $
$\frac {\pi}{4}=\arctan 1=\arctan \frac {1}{2}+\arctan \frac {1}{3}.$
$\arctan \frac ... |
2,674,207 | It was suggested Taylor series for that.
$e^1 = \sum\_{k=0}^\infty \frac{1}{k!}$
I don't know how to prove the convergence of this series, so I tried to set the upper limit to 5 (I'm doing all this with a very simple calculator, it's basically by hand). Then $e \approx 2.71$
Since $4\arctan(1)= \pi$
$4\arctan(1)=4 ... | 2018/03/02 | [
"https://math.stackexchange.com/questions/2674207",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/401136/"
] | With your approximations and using [Interval arithmetics](https://en.wikipedia.org/wiki/Interval_arithmetic), you just have to show that $5<e+\pi <6$. | As @karakfa stated that you can prove $5\lt e+\pi\lt6$ using valid approximations. Better approximations would have been: $3\frac{10}{71}<\pi<3\frac{16}{113}$ for $\pi$ and $$\left(3+\sum\_{i=2}^n \frac{-1}{i!(1-1)i}\right)\gt e \gt \sum\_{i=0}^n \frac{1}{i!}$$ for $e$ (if $n$ is a finite natural number) as given in fo... |
2,674,207 | It was suggested Taylor series for that.
$e^1 = \sum\_{k=0}^\infty \frac{1}{k!}$
I don't know how to prove the convergence of this series, so I tried to set the upper limit to 5 (I'm doing all this with a very simple calculator, it's basically by hand). Then $e \approx 2.71$
Since $4\arctan(1)= \pi$
$4\arctan(1)=4 ... | 2018/03/02 | [
"https://math.stackexchange.com/questions/2674207",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/401136/"
] | With very crude approximations you can show that
$ 5 \lt e +\pi \lt 6$, and the rest follows.
For crudely approximating $\pi$, we can use Taylor series expansion of $\tan^{-1}(x)$ Since it's an alternating series we can bound $\pi$ on both sides.
Since $\frac\pi6 = \tan^{-1}(\frac1{\sqrt{3}})$.
$$ 6(x - \frac{x^3}3... | On calculating $\pi :$ If $\arctan u +\arctan v =\arctan 1=\frac {\pi}{4}$ we may estimate $\pi$ using $$\arctan x=x\sum\_{n=0}^{\infty}\frac {(-x^2)^n}{2n+1}.$$
If $|ab|<1$ then $\arctan a + \arctan b =\arctan \frac {a+b}{1-ab}. $
$\frac {\pi}{4}=\arctan 1=\arctan \frac {1}{2}+\arctan \frac {1}{3}.$
$\arctan \frac ... |
2,674,207 | It was suggested Taylor series for that.
$e^1 = \sum\_{k=0}^\infty \frac{1}{k!}$
I don't know how to prove the convergence of this series, so I tried to set the upper limit to 5 (I'm doing all this with a very simple calculator, it's basically by hand). Then $e \approx 2.71$
Since $4\arctan(1)= \pi$
$4\arctan(1)=4 ... | 2018/03/02 | [
"https://math.stackexchange.com/questions/2674207",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/401136/"
] | With very crude approximations you can show that
$ 5 \lt e +\pi \lt 6$, and the rest follows.
For crudely approximating $\pi$, we can use Taylor series expansion of $\tan^{-1}(x)$ Since it's an alternating series we can bound $\pi$ on both sides.
Since $\frac\pi6 = \tan^{-1}(\frac1{\sqrt{3}})$.
$$ 6(x - \frac{x^3}3... | As @karakfa stated that you can prove $5\lt e+\pi\lt6$ using valid approximations. Better approximations would have been: $3\frac{10}{71}<\pi<3\frac{16}{113}$ for $\pi$ and $$\left(3+\sum\_{i=2}^n \frac{-1}{i!(1-1)i}\right)\gt e \gt \sum\_{i=0}^n \frac{1}{i!}$$ for $e$ (if $n$ is a finite natural number) as given in fo... |
2,674,207 | It was suggested Taylor series for that.
$e^1 = \sum\_{k=0}^\infty \frac{1}{k!}$
I don't know how to prove the convergence of this series, so I tried to set the upper limit to 5 (I'm doing all this with a very simple calculator, it's basically by hand). Then $e \approx 2.71$
Since $4\arctan(1)= \pi$
$4\arctan(1)=4 ... | 2018/03/02 | [
"https://math.stackexchange.com/questions/2674207",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/401136/"
] | As @karakfa stated that you can prove $5\lt e+\pi\lt6$ using valid approximations. Better approximations would have been: $3\frac{10}{71}<\pi<3\frac{16}{113}$ for $\pi$ and $$\left(3+\sum\_{i=2}^n \frac{-1}{i!(1-1)i}\right)\gt e \gt \sum\_{i=0}^n \frac{1}{i!}$$ for $e$ (if $n$ is a finite natural number) as given in fo... | On calculating $\pi :$ If $\arctan u +\arctan v =\arctan 1=\frac {\pi}{4}$ we may estimate $\pi$ using $$\arctan x=x\sum\_{n=0}^{\infty}\frac {(-x^2)^n}{2n+1}.$$
If $|ab|<1$ then $\arctan a + \arctan b =\arctan \frac {a+b}{1-ab}. $
$\frac {\pi}{4}=\arctan 1=\arctan \frac {1}{2}+\arctan \frac {1}{3}.$
$\arctan \frac ... |
19,616,246 | I have 3 controllers named Site, Ads and Message. All controllers have captcha action class definition and they are allowed in accessrules of each controller.
The captcha works well in the site controller but in other controllers its validation wont work. It shows captcha image and recaptcha works too but just validat... | 2013/10/27 | [
"https://Stackoverflow.com/questions/19616246",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1579757/"
] | 1. In the model validation rule specify `captchaAction` to point exactly to your controller captcha action:
array('verifyCode', 'captcha', 'allowEmpty'=>!CCaptcha::checkRequirements(), 'captcaAction' => 'site/captcha'),
2. In the view when capthca widget is used again point exactly to your controller captcha action vi... | I think my hole problem is that CCaptchaAction uses **name of controller** to name the session key to store **verification key**.
Finally As a not bad solution I overloaded CCaptchaAction by following class :
```
class CCaptchaActionExtension extends CCaptchaAction{
protected function getSessionKey(){
... |
44,199,493 | We have using three project code is same but package name is different and then API also different URL,we have using switch-case get package Name based, we want get that particular case URL and then call the URL in another class. can you help me
```
public class AllChanges extends Application {
public static Con... | 2017/05/26 | [
"https://Stackoverflow.com/questions/44199493",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7140462/"
] | Try `X` which is `ISO 8601 time zone`
```
public static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ssX";
``` | If you use JDK 8 `java.time` API, you will get the desired format `(ISO 8601)` by default.
```
System.out.println(OffsetDateTime.now(ZoneId.systemDefault())); // 2017-05-26T16:20:42.821+05:30
``` |
44,199,493 | We have using three project code is same but package name is different and then API also different URL,we have using switch-case get package Name based, we want get that particular case URL and then call the URL in another class. can you help me
```
public class AllChanges extends Application {
public static Con... | 2017/05/26 | [
"https://Stackoverflow.com/questions/44199493",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7140462/"
] | Try `X` which is `ISO 8601 time zone`
```
public static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ssX";
``` | I would make sure to always use the ISO8601.
As shazin stated you can replace your Z with X to perform the accepting of a Date.
As addition I would suggest to use the OffsetDateTime API like this:
```
OffsetDateTime time = OffsetDateTime.parse( YOUR_DATE_STRING );
```
this will give you an OffsetDateTime object yo... |
44,199,493 | We have using three project code is same but package name is different and then API also different URL,we have using switch-case get package Name based, we want get that particular case URL and then call the URL in another class. can you help me
```
public class AllChanges extends Application {
public static Con... | 2017/05/26 | [
"https://Stackoverflow.com/questions/44199493",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7140462/"
] | Try `X` which is `ISO 8601 time zone`
```
public static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ssX";
``` | Note that not all time zones are shifted from UTC by an integral number of
hours. So when standards where created, nobody thought that there would
be a demand to print the time shift as only 2 digits.
And probably this is why "Z" as a time shift placeholder is converted to
"+" or "-" char, and just **four** digits.
I... |
44,199,493 | We have using three project code is same but package name is different and then API also different URL,we have using switch-case get package Name based, we want get that particular case URL and then call the URL in another class. can you help me
```
public class AllChanges extends Application {
public static Con... | 2017/05/26 | [
"https://Stackoverflow.com/questions/44199493",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7140462/"
] | Try `X` intead of `Z` in your format string. | If you use JDK 8 `java.time` API, you will get the desired format `(ISO 8601)` by default.
```
System.out.println(OffsetDateTime.now(ZoneId.systemDefault())); // 2017-05-26T16:20:42.821+05:30
``` |
44,199,493 | We have using three project code is same but package name is different and then API also different URL,we have using switch-case get package Name based, we want get that particular case URL and then call the URL in another class. can you help me
```
public class AllChanges extends Application {
public static Con... | 2017/05/26 | [
"https://Stackoverflow.com/questions/44199493",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7140462/"
] | Try `X` intead of `Z` in your format string. | I would make sure to always use the ISO8601.
As shazin stated you can replace your Z with X to perform the accepting of a Date.
As addition I would suggest to use the OffsetDateTime API like this:
```
OffsetDateTime time = OffsetDateTime.parse( YOUR_DATE_STRING );
```
this will give you an OffsetDateTime object yo... |
44,199,493 | We have using three project code is same but package name is different and then API also different URL,we have using switch-case get package Name based, we want get that particular case URL and then call the URL in another class. can you help me
```
public class AllChanges extends Application {
public static Con... | 2017/05/26 | [
"https://Stackoverflow.com/questions/44199493",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7140462/"
] | Try `X` intead of `Z` in your format string. | Note that not all time zones are shifted from UTC by an integral number of
hours. So when standards where created, nobody thought that there would
be a demand to print the time shift as only 2 digits.
And probably this is why "Z" as a time shift placeholder is converted to
"+" or "-" char, and just **four** digits.
I... |
30,407,175 | ```
MAP_PERSONAL_DATA_WITH_TAG = {"Flat/Unit No." => "FLD_ADD_1Line1",
"Building No./Name" => "FLD_ADD_2Line2",
"Street" => "FLD_ADD_3Line3",
"Postcode" => "FLD_ADD_4Postcode",
"City/Town" => "FLD_ADD_5City",
... | 2015/05/22 | [
"https://Stackoverflow.com/questions/30407175",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2787335/"
] | Instead of checking for all words that have the letter "a" check for all words that have an 'a' in the second position. You can use `string.charAt(1) == 'a'` to accomplish this.
You could write a method that checks an array for letters and returns an `ArrayList` with all of the words like this.
```
public static List... | A simple solution could be iterating and checking for character:
```
// String[] candidateWords is your list of words,
// int targetIndex, is the index you want to check (i.e. 2)
// char targetChar, is the character you want in that position (i.e. a)
for(int i=0; i < candidateWords.length; i++)
if(candidateWords[... |
30,407,175 | ```
MAP_PERSONAL_DATA_WITH_TAG = {"Flat/Unit No." => "FLD_ADD_1Line1",
"Building No./Name" => "FLD_ADD_2Line2",
"Street" => "FLD_ADD_3Line3",
"Postcode" => "FLD_ADD_4Postcode",
"City/Town" => "FLD_ADD_5City",
... | 2015/05/22 | [
"https://Stackoverflow.com/questions/30407175",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2787335/"
] | Instead of checking for all words that have the letter "a" check for all words that have an 'a' in the second position. You can use `string.charAt(1) == 'a'` to accomplish this.
You could write a method that checks an array for letters and returns an `ArrayList` with all of the words like this.
```
public static List... | There are several options. I have tried to showcase several of those. You will notice that I have used some Java 8 specific concepts, specifically Stream's and Lambda's. Streams will allow you to handle bigger data sets because of the possibility to parallelize your word matching.
```
import java.util.function.Predica... |
30,407,175 | ```
MAP_PERSONAL_DATA_WITH_TAG = {"Flat/Unit No." => "FLD_ADD_1Line1",
"Building No./Name" => "FLD_ADD_2Line2",
"Street" => "FLD_ADD_3Line3",
"Postcode" => "FLD_ADD_4Postcode",
"City/Town" => "FLD_ADD_5City",
... | 2015/05/22 | [
"https://Stackoverflow.com/questions/30407175",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2787335/"
] | There are several options. I have tried to showcase several of those. You will notice that I have used some Java 8 specific concepts, specifically Stream's and Lambda's. Streams will allow you to handle bigger data sets because of the possibility to parallelize your word matching.
```
import java.util.function.Predica... | A simple solution could be iterating and checking for character:
```
// String[] candidateWords is your list of words,
// int targetIndex, is the index you want to check (i.e. 2)
// char targetChar, is the character you want in that position (i.e. a)
for(int i=0; i < candidateWords.length; i++)
if(candidateWords[... |
55,527,231 | I'm trying to code a discord bot that edits the same message that it just sent every few minutes, I have some code already written but it only edits it once. I'm new to this style of thing, any idea what could be wrong or what I need to do?
This is supposed to edit with my FiveM Server but I want to get the editing pa... | 2019/04/05 | [
"https://Stackoverflow.com/questions/55527231",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10103511/"
] | 60,000 milliseconds = 60 seconds. `setInterval` executes the given function each `x` milliseconds:
```
client.on('message', msg => {
client.channels.get("channelid").send(`${players}`)
.then((msg) => {
setInterval(function() {
msg.edit(`${players}`)
}, 60000)}
)}
)
``` | this worked:
```
client.on('ready', msg => {
client.channels.get("555945877483814915").send(`${players}`)
.then((msg) => {
setInterval(function() {
msg.edit(`${players}`)
}, 60000)}
)}
)
``` |
55,527,231 | I'm trying to code a discord bot that edits the same message that it just sent every few minutes, I have some code already written but it only edits it once. I'm new to this style of thing, any idea what could be wrong or what I need to do?
This is supposed to edit with my FiveM Server but I want to get the editing pa... | 2019/04/05 | [
"https://Stackoverflow.com/questions/55527231",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10103511/"
] | You can do it using [`setInterval()`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setInterval) method.
>
> The `setInterval()` method repeatedly calls a function or executes a code snippet, with a fixed time delay between each call.
>
>
>
```
client.on('message', msg => {
client... | 60,000 milliseconds = 60 seconds. `setInterval` executes the given function each `x` milliseconds:
```
client.on('message', msg => {
client.channels.get("channelid").send(`${players}`)
.then((msg) => {
setInterval(function() {
msg.edit(`${players}`)
}, 60000)}
)}
)
``` |
55,527,231 | I'm trying to code a discord bot that edits the same message that it just sent every few minutes, I have some code already written but it only edits it once. I'm new to this style of thing, any idea what could be wrong or what I need to do?
This is supposed to edit with my FiveM Server but I want to get the editing pa... | 2019/04/05 | [
"https://Stackoverflow.com/questions/55527231",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10103511/"
] | You can do it using [`setInterval()`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setInterval) method.
>
> The `setInterval()` method repeatedly calls a function or executes a code snippet, with a fixed time delay between each call.
>
>
>
```
client.on('message', msg => {
client... | this worked:
```
client.on('ready', msg => {
client.channels.get("555945877483814915").send(`${players}`)
.then((msg) => {
setInterval(function() {
msg.edit(`${players}`)
}, 60000)}
)}
)
``` |
7,854,611 | For some reason lately, every time I pull and get a merge conflict, running `git mergetool` reports "No files need merging":
```
$ git pull
First, rewinding head to replay your work on top of it...
Applying: replaced home button with Cancel
Using index info to reconstruct a base tree...
Falling back to patching base a... | 2011/10/21 | [
"https://Stackoverflow.com/questions/7854611",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/214350/"
] | ***Trivial solution***
which worked for me:
Git creates some merge related files in the very same directory where the conflicted file is, so remember to run `git mergetool` in correct path. | In my case the issue was that I had another console window open and was running the application (based on create-react-app, with hot reloading) in that window.
Killing the process and closing the other window, then aborting the rebase and retrying worked for me. |
7,854,611 | For some reason lately, every time I pull and get a merge conflict, running `git mergetool` reports "No files need merging":
```
$ git pull
First, rewinding head to replay your work on top of it...
Applying: replaced home button with Cancel
Using index info to reconstruct a base tree...
Falling back to patching base a... | 2011/10/21 | [
"https://Stackoverflow.com/questions/7854611",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/214350/"
] | ***Trivial solution***
which worked for me:
Git creates some merge related files in the very same directory where the conflicted file is, so remember to run `git mergetool` in correct path. | Could it be that you must first run merge? Then if there are merge conflicts to resolve, you can run mergetool. But until there are created as the results of an incomplete merge, I think mergetool will simply report there is nothing to merge. |
7,854,611 | For some reason lately, every time I pull and get a merge conflict, running `git mergetool` reports "No files need merging":
```
$ git pull
First, rewinding head to replay your work on top of it...
Applying: replaced home button with Cancel
Using index info to reconstruct a base tree...
Falling back to patching base a... | 2011/10/21 | [
"https://Stackoverflow.com/questions/7854611",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/214350/"
] | This fixed it for me:
`git mergetool .`
I found this fix [here](https://stackoverflow.com/questions/15707104/git-tells-me-that-i-merge-conflict-but-also-tells-me-that-no-files-need-merging/42261185#42261185) | Could it be that you must first run merge? Then if there are merge conflicts to resolve, you can run mergetool. But until there are created as the results of an incomplete merge, I think mergetool will simply report there is nothing to merge. |
7,854,611 | For some reason lately, every time I pull and get a merge conflict, running `git mergetool` reports "No files need merging":
```
$ git pull
First, rewinding head to replay your work on top of it...
Applying: replaced home button with Cancel
Using index info to reconstruct a base tree...
Falling back to patching base a... | 2011/10/21 | [
"https://Stackoverflow.com/questions/7854611",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/214350/"
] | ***Trivial solution***
which worked for me:
Git creates some merge related files in the very same directory where the conflicted file is, so remember to run `git mergetool` in correct path. | Solution 1:
```
$git config --global core.trustctime false
```
If false, the ctime differences between the index and the working copy are ignored; useful when the inode change time is regularly modified by something outside Git (file system crawlers and some backup systems).
and core.trustctime is true by default.
... |
7,854,611 | For some reason lately, every time I pull and get a merge conflict, running `git mergetool` reports "No files need merging":
```
$ git pull
First, rewinding head to replay your work on top of it...
Applying: replaced home button with Cancel
Using index info to reconstruct a base tree...
Falling back to patching base a... | 2011/10/21 | [
"https://Stackoverflow.com/questions/7854611",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/214350/"
] | Solution 1:
```
$git config --global core.trustctime false
```
If false, the ctime differences between the index and the working copy are ignored; useful when the inode change time is regularly modified by something outside Git (file system crawlers and some backup systems).
and core.trustctime is true by default.
... | In my case the issue was that I had another console window open and was running the application (based on create-react-app, with hot reloading) in that window.
Killing the process and closing the other window, then aborting the rebase and retrying worked for me. |
7,854,611 | For some reason lately, every time I pull and get a merge conflict, running `git mergetool` reports "No files need merging":
```
$ git pull
First, rewinding head to replay your work on top of it...
Applying: replaced home button with Cancel
Using index info to reconstruct a base tree...
Falling back to patching base a... | 2011/10/21 | [
"https://Stackoverflow.com/questions/7854611",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/214350/"
] | It looks like my problem had to do with file timestamps. Thanks to [this SO answer](https://stackoverflow.com/questions/5074136/git-rebase-fails-your-local-changes-to-the-following-files-would-be-overwritte/5255710#5255710) suggested by Mark Longair, the following setting fixed it for me:
```
git config --global core.... | In my case the issue was that I had another console window open and was running the application (based on create-react-app, with hot reloading) in that window.
Killing the process and closing the other window, then aborting the rebase and retrying worked for me. |
7,854,611 | For some reason lately, every time I pull and get a merge conflict, running `git mergetool` reports "No files need merging":
```
$ git pull
First, rewinding head to replay your work on top of it...
Applying: replaced home button with Cancel
Using index info to reconstruct a base tree...
Falling back to patching base a... | 2011/10/21 | [
"https://Stackoverflow.com/questions/7854611",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/214350/"
] | It looks like my problem had to do with file timestamps. Thanks to [this SO answer](https://stackoverflow.com/questions/5074136/git-rebase-fails-your-local-changes-to-the-following-files-would-be-overwritte/5255710#5255710) suggested by Mark Longair, the following setting fixed it for me:
```
git config --global core.... | Solution 1:
```
$git config --global core.trustctime false
```
If false, the ctime differences between the index and the working copy are ignored; useful when the inode change time is regularly modified by something outside Git (file system crawlers and some backup systems).
and core.trustctime is true by default.
... |
7,854,611 | For some reason lately, every time I pull and get a merge conflict, running `git mergetool` reports "No files need merging":
```
$ git pull
First, rewinding head to replay your work on top of it...
Applying: replaced home button with Cancel
Using index info to reconstruct a base tree...
Falling back to patching base a... | 2011/10/21 | [
"https://Stackoverflow.com/questions/7854611",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/214350/"
] | It looks like my problem had to do with file timestamps. Thanks to [this SO answer](https://stackoverflow.com/questions/5074136/git-rebase-fails-your-local-changes-to-the-following-files-would-be-overwritte/5255710#5255710) suggested by Mark Longair, the following setting fixed it for me:
```
git config --global core.... | Merge tools are better at resolving conflicts than stock git. It can't be too opinionated. For example Beyond Compare is syntax aware and will do a lot for you. If you have it configured right, you can just compile and run your solution to test. If it's all good, then just `git add -A` and `git rebase --continue`. What... |
7,854,611 | For some reason lately, every time I pull and get a merge conflict, running `git mergetool` reports "No files need merging":
```
$ git pull
First, rewinding head to replay your work on top of it...
Applying: replaced home button with Cancel
Using index info to reconstruct a base tree...
Falling back to patching base a... | 2011/10/21 | [
"https://Stackoverflow.com/questions/7854611",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/214350/"
] | This fixed it for me:
`git mergetool .`
I found this fix [here](https://stackoverflow.com/questions/15707104/git-tells-me-that-i-merge-conflict-but-also-tells-me-that-no-files-need-merging/42261185#42261185) | In my case the issue was that I had another console window open and was running the application (based on create-react-app, with hot reloading) in that window.
Killing the process and closing the other window, then aborting the rebase and retrying worked for me. |
7,854,611 | For some reason lately, every time I pull and get a merge conflict, running `git mergetool` reports "No files need merging":
```
$ git pull
First, rewinding head to replay your work on top of it...
Applying: replaced home button with Cancel
Using index info to reconstruct a base tree...
Falling back to patching base a... | 2011/10/21 | [
"https://Stackoverflow.com/questions/7854611",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/214350/"
] | It looks like my problem had to do with file timestamps. Thanks to [this SO answer](https://stackoverflow.com/questions/5074136/git-rebase-fails-your-local-changes-to-the-following-files-would-be-overwritte/5255710#5255710) suggested by Mark Longair, the following setting fixed it for me:
```
git config --global core.... | ***Trivial solution***
which worked for me:
Git creates some merge related files in the very same directory where the conflicted file is, so remember to run `git mergetool` in correct path. |
39,711,924 | I'm hoping to use docker to set up some bioinformatic analysis.
I have found two docker images that I would like to use:
1. jupyter/datascience-notebook
2. bioconductor/devel\_base
I have been successful in running each of these images independently, however I don't know how to merge them together.
Is merging two d... | 2016/09/26 | [
"https://Stackoverflow.com/questions/39711924",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/697065/"
] | You can't just merge the images. You have to recreate your own based on what was in each of the images you want. You can download both images and re-create the Docker files for each like this:
```
docker history --no-trunc=true image1 > image1-dockerfile
docker history --no-trunc=true image2 > image2-dockerfile
```
... | You start with one then manually install the features of the other one. Merging would be far to complex, and too many unknowns. |
39,711,924 | I'm hoping to use docker to set up some bioinformatic analysis.
I have found two docker images that I would like to use:
1. jupyter/datascience-notebook
2. bioconductor/devel\_base
I have been successful in running each of these images independently, however I don't know how to merge them together.
Is merging two d... | 2016/09/26 | [
"https://Stackoverflow.com/questions/39711924",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/697065/"
] | If there are specific files or directories that you want to cherry-pick from the one of the two images, you can create a new Dockerfile that builds `FROM` one of them and copy over specific paths from the other using [COPY's --from option](https://docs.docker.com/engine/reference/builder/#copy). For example:
```
FROM ... | You start with one then manually install the features of the other one. Merging would be far to complex, and too many unknowns. |
39,711,924 | I'm hoping to use docker to set up some bioinformatic analysis.
I have found two docker images that I would like to use:
1. jupyter/datascience-notebook
2. bioconductor/devel\_base
I have been successful in running each of these images independently, however I don't know how to merge them together.
Is merging two d... | 2016/09/26 | [
"https://Stackoverflow.com/questions/39711924",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/697065/"
] | You can't just merge the images. You have to recreate your own based on what was in each of the images you want. You can download both images and re-create the Docker files for each like this:
```
docker history --no-trunc=true image1 > image1-dockerfile
docker history --no-trunc=true image2 > image2-dockerfile
```
... | If there are specific files or directories that you want to cherry-pick from the one of the two images, you can create a new Dockerfile that builds `FROM` one of them and copy over specific paths from the other using [COPY's --from option](https://docs.docker.com/engine/reference/builder/#copy). For example:
```
FROM ... |
1,509,915 | Is there any ready function which converts camel case Strings into underscore separated string?
I want something like this:
```
"CamelCaseString".to_underscore
```
to return "camel\_case\_string".
... | 2009/10/02 | [
"https://Stackoverflow.com/questions/1509915",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/105514/"
] | Here's how [Rails does it](http://rails.rubyonrails.org/classes/Inflector.html#M001631):
```
def underscore(camel_cased_word)
camel_cased_word.to_s.gsub(/::/, '/').
gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
gsub(/([a-z\d])([A-Z])/,'\1_\2').
tr("-", "_").
downcase
end
``` | Receiver converted to snake case: <http://rubydoc.info/gems/extlib/0.9.15/String#snake_case-instance_method>
This is the Support library for DataMapper and Merb. (<http://rubygems.org/gems/extlib>)
```
def snake_case
return downcase if match(/\A[A-Z]+\z/)
gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2').
gsub(/([a-z])([A-... |
1,509,915 | Is there any ready function which converts camel case Strings into underscore separated string?
I want something like this:
```
"CamelCaseString".to_underscore
```
to return "camel\_case\_string".
... | 2009/10/02 | [
"https://Stackoverflow.com/questions/1509915",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/105514/"
] | [Rails' ActiveSupport](http://api.rubyonrails.org/classes/ActiveSupport/Inflector.html#method-i-underscore)
adds underscore to the String using the following:
```
class String
def underscore
self.gsub(/::/, '/').
gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
gsub(/([a-z\d])([A-Z])/,'\1_\2').
tr("-", "_").
... | The ruby core itself has no support to convert a string from (upper) camel case to (also known as pascal case) to underscore (also known as snake case).
So you need either to make your own implementation or use an existing gem.
There is a small ruby gem called **lucky\_case** which allows you to convert a string from... |
1,509,915 | Is there any ready function which converts camel case Strings into underscore separated string?
I want something like this:
```
"CamelCaseString".to_underscore
```
to return "camel\_case\_string".
... | 2009/10/02 | [
"https://Stackoverflow.com/questions/1509915",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/105514/"
] | Receiver converted to snake case: <http://rubydoc.info/gems/extlib/0.9.15/String#snake_case-instance_method>
This is the Support library for DataMapper and Merb. (<http://rubygems.org/gems/extlib>)
```
def snake_case
return downcase if match(/\A[A-Z]+\z/)
gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2').
gsub(/([a-z])([A-... | The ruby core itself has no support to convert a string from (upper) camel case to (also known as pascal case) to underscore (also known as snake case).
So you need either to make your own implementation or use an existing gem.
There is a small ruby gem called **lucky\_case** which allows you to convert a string from... |
1,509,915 | Is there any ready function which converts camel case Strings into underscore separated string?
I want something like this:
```
"CamelCaseString".to_underscore
```
to return "camel\_case\_string".
... | 2009/10/02 | [
"https://Stackoverflow.com/questions/1509915",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/105514/"
] | [Rails' ActiveSupport](http://api.rubyonrails.org/classes/ActiveSupport/Inflector.html#method-i-underscore)
adds underscore to the String using the following:
```
class String
def underscore
self.gsub(/::/, '/').
gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
gsub(/([a-z\d])([A-Z])/,'\1_\2').
tr("-", "_").
... | There is a Rails inbuilt method called 'underscore' that you can use for this purpose
```
"CamelCaseString".underscore #=> "camel_case_string"
```
The 'underscore' method can typically be considered as inverse of 'camelize' |
1,509,915 | Is there any ready function which converts camel case Strings into underscore separated string?
I want something like this:
```
"CamelCaseString".to_underscore
```
to return "camel\_case\_string".
... | 2009/10/02 | [
"https://Stackoverflow.com/questions/1509915",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/105514/"
] | You can use
```
"CamelCasedName".tableize.singularize
```
Or just
```
"CamelCasedName".underscore
```
Both options ways will yield `"camel_cased_name"`. You can check more details it [here](http://api.rubyonrails.org/classes/String.html#method-i-underscore). | There is a Rails inbuilt method called 'underscore' that you can use for this purpose
```
"CamelCaseString".underscore #=> "camel_case_string"
```
The 'underscore' method can typically be considered as inverse of 'camelize' |
1,509,915 | Is there any ready function which converts camel case Strings into underscore separated string?
I want something like this:
```
"CamelCaseString".to_underscore
```
to return "camel\_case\_string".
... | 2009/10/02 | [
"https://Stackoverflow.com/questions/1509915",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/105514/"
] | You can use
```
"CamelCasedName".tableize.singularize
```
Or just
```
"CamelCasedName".underscore
```
Both options ways will yield `"camel_cased_name"`. You can check more details it [here](http://api.rubyonrails.org/classes/String.html#method-i-underscore). | Here's how [Rails does it](http://rails.rubyonrails.org/classes/Inflector.html#M001631):
```
def underscore(camel_cased_word)
camel_cased_word.to_s.gsub(/::/, '/').
gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
gsub(/([a-z\d])([A-Z])/,'\1_\2').
tr("-", "_").
downcase
end
``` |
1,509,915 | Is there any ready function which converts camel case Strings into underscore separated string?
I want something like this:
```
"CamelCaseString".to_underscore
```
to return "camel\_case\_string".
... | 2009/10/02 | [
"https://Stackoverflow.com/questions/1509915",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/105514/"
] | Here's how [Rails does it](http://rails.rubyonrails.org/classes/Inflector.html#M001631):
```
def underscore(camel_cased_word)
camel_cased_word.to_s.gsub(/::/, '/').
gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
gsub(/([a-z\d])([A-Z])/,'\1_\2').
tr("-", "_").
downcase
end
``` | The ruby core itself has no support to convert a string from (upper) camel case to (also known as pascal case) to underscore (also known as snake case).
So you need either to make your own implementation or use an existing gem.
There is a small ruby gem called **lucky\_case** which allows you to convert a string from... |
1,509,915 | Is there any ready function which converts camel case Strings into underscore separated string?
I want something like this:
```
"CamelCaseString".to_underscore
```
to return "camel\_case\_string".
... | 2009/10/02 | [
"https://Stackoverflow.com/questions/1509915",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/105514/"
] | Short oneliner for CamelCases when you have spaces also included (doesn't work correctly if you have a word inbetween with small starting-letter):
```
a = "Test String"
a.gsub(' ', '').underscore
=> "test_string"
```
**EDIT:** As pointed out by @dft then this method is not part of Ruby but Rails. | The ruby core itself has no support to convert a string from (upper) camel case to (also known as pascal case) to underscore (also known as snake case).
So you need either to make your own implementation or use an existing gem.
There is a small ruby gem called **lucky\_case** which allows you to convert a string from... |
1,509,915 | Is there any ready function which converts camel case Strings into underscore separated string?
I want something like this:
```
"CamelCaseString".to_underscore
```
to return "camel\_case\_string".
... | 2009/10/02 | [
"https://Stackoverflow.com/questions/1509915",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/105514/"
] | Check out **snakecase** from [Ruby Facets](https://github.com/rubyworks/facets#ruby-facets)
The following cases are handled, as seen below:
```
"SnakeCase".snakecase #=> "snake_case"
"Snake-Case".snakecase #=> "snake_case"
"Snake Case".snakecase #=> "snake_case"
"Snake - Case".snakecase #=>... | I had trouble running `"CamelCaseString".underscore` in a rake task. This helped me:
```
ActiveSupport::Inflector.underscore "CamelCaseString"
=> "camel_case_string"
```
Of course, you need to require ActiveSupport |
1,509,915 | Is there any ready function which converts camel case Strings into underscore separated string?
I want something like this:
```
"CamelCaseString".to_underscore
```
to return "camel\_case\_string".
... | 2009/10/02 | [
"https://Stackoverflow.com/questions/1509915",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/105514/"
] | [Rails' ActiveSupport](http://api.rubyonrails.org/classes/ActiveSupport/Inflector.html#method-i-underscore)
adds underscore to the String using the following:
```
class String
def underscore
self.gsub(/::/, '/').
gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
gsub(/([a-z\d])([A-Z])/,'\1_\2').
tr("-", "_").
... | I had trouble running `"CamelCaseString".underscore` in a rake task. This helped me:
```
ActiveSupport::Inflector.underscore "CamelCaseString"
=> "camel_case_string"
```
Of course, you need to require ActiveSupport |
58,631,246 | I try to understand why the user has to call the `taskYIELD_FROM_ISR()` method and why it isn't automatically called by the RTOS within the `xStreamBufferSendFromISR` method.
My question refers to the [FreeRTOS\_Manual](https://www.freertos.org/wp-content/uploads/2018/07/FreeRTOS_Reference_Manual_V10.0.0.pdf) p. 369.
... | 2019/10/30 | [
"https://Stackoverflow.com/questions/58631246",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5467686/"
] | 1. Yes, without a call to `taskYIELD_FROM_ISR`, the scheduler gives context to `Task1` on the next scheduled tick. This can be verified with Segger SystemView. `uartPrintTask` blocks on a semaphore and then prints data from a buffer. Notice the long delay between when uartPrintTask is "ready" and when it is "running". ... | * 1) I think so
* 2) I'm not really sure of this. I think that is done to keep interrupt fast and to keep context switch overhead low. So it is in your choice to trigger a context switch or not depending on the response time you need. |
22,190,578 | I installed the ADT bundle from <http://developer.android.com/sdk/index.html> yesterday, and I was following a basic Hello World tutorial. I created a new Android Application Project with a Blank Activity named `MainActivity`. The resulting project has an empty `src` folder and empty `res\layout` folder. There is a `R.... | 2014/03/05 | [
"https://Stackoverflow.com/questions/22190578",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3382208/"
] | It's new feature of ADT 22.6.2
Even in "None" theme ADT(22.6.2) create "Fragment Layout"
There is four ways:
Try to change "Target" and "Compile" to API 14 or higher. But you need then remove all entries of "Fragment Layouts"
Uncheck "Create activity" checkbox, and create activity manually. Good howto: Best way to ... | When you upgrade to SDK tools by 22.x you need to upgrade ADT plugin.
follow these steps to upgrade ADT:
Help > Install New software install
add the below url and click on next.
url: <https://dl-ssl.google.com/android/eclipse/>.
But some times it complaining about conflicts, in that case,
First uninstall the exis... |
22,190,578 | I installed the ADT bundle from <http://developer.android.com/sdk/index.html> yesterday, and I was following a basic Hello World tutorial. I created a new Android Application Project with a Blank Activity named `MainActivity`. The resulting project has an empty `src` folder and empty `res\layout` folder. There is a `R.... | 2014/03/05 | [
"https://Stackoverflow.com/questions/22190578",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3382208/"
] | It's new feature of ADT 22.6.2
Even in "None" theme ADT(22.6.2) create "Fragment Layout"
There is four ways:
Try to change "Target" and "Compile" to API 14 or higher. But you need then remove all entries of "Fragment Layouts"
Uncheck "Create activity" checkbox, and create activity manually. Good howto: Best way to ... | workspace has to be set to the the SDK folder. After doing this, I have had no problems. For example, after downloading and installing Eclipse, my directory structure is as follows:
```
/Users/username/Development/adt-bundle-mac-x86_64-20140702/
/eclipse/
/sdk/
/HelloWorld/
```
It's annoying because ... |
22,190,578 | I installed the ADT bundle from <http://developer.android.com/sdk/index.html> yesterday, and I was following a basic Hello World tutorial. I created a new Android Application Project with a Blank Activity named `MainActivity`. The resulting project has an empty `src` folder and empty `res\layout` folder. There is a `R.... | 2014/03/05 | [
"https://Stackoverflow.com/questions/22190578",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3382208/"
] | If you updated to Android SDK Tools version 22.6, you are required to Update DDMS Tools and Plugins.
**Go to "Help Menu Bar" -> "Install New software" and install (this will update it)
url: <https://dl-ssl.google.com/android/eclipse/>**
Also update **"Developer Tools"** and **"NDK Plugins"** to latest Version.
This... | workspace has to be set to the the SDK folder. After doing this, I have had no problems. For example, after downloading and installing Eclipse, my directory structure is as follows:
```
/Users/username/Development/adt-bundle-mac-x86_64-20140702/
/eclipse/
/sdk/
/HelloWorld/
```
It's annoying because ... |
22,190,578 | I installed the ADT bundle from <http://developer.android.com/sdk/index.html> yesterday, and I was following a basic Hello World tutorial. I created a new Android Application Project with a Blank Activity named `MainActivity`. The resulting project has an empty `src` folder and empty `res\layout` folder. There is a `R.... | 2014/03/05 | [
"https://Stackoverflow.com/questions/22190578",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3382208/"
] | If you updated to Android SDK Tools version 22.6, you are required to Update DDMS Tools and Plugins.
**Go to "Help Menu Bar" -> "Install New software" and install (this will update it)
url: <https://dl-ssl.google.com/android/eclipse/>**
Also update **"Developer Tools"** and **"NDK Plugins"** to latest Version.
This... | When you upgrade to SDK tools by 22.x you need to upgrade ADT plugin.
follow these steps to upgrade ADT:
Help > Install New software install
add the below url and click on next.
url: <https://dl-ssl.google.com/android/eclipse/>.
But some times it complaining about conflicts, in that case,
First uninstall the exis... |
22,190,578 | I installed the ADT bundle from <http://developer.android.com/sdk/index.html> yesterday, and I was following a basic Hello World tutorial. I created a new Android Application Project with a Blank Activity named `MainActivity`. The resulting project has an empty `src` folder and empty `res\layout` folder. There is a `R.... | 2014/03/05 | [
"https://Stackoverflow.com/questions/22190578",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3382208/"
] | If you updated to Android SDK Tools version 22.6, you are required to Update DDMS Tools and Plugins.
**Go to "Help Menu Bar" -> "Install New software" and install (this will update it)
url: <https://dl-ssl.google.com/android/eclipse/>**
Also update **"Developer Tools"** and **"NDK Plugins"** to latest Version.
This... | The comment [see comment](https://stackoverflow.com/questions/22190578/adt-will-not-allow-creation-of-android-activity#comment33730649_22190578) by [NewShelbyWoo](https://stackoverflow.com/users/3382208/newshelbywoo) solved the issue |
22,190,578 | I installed the ADT bundle from <http://developer.android.com/sdk/index.html> yesterday, and I was following a basic Hello World tutorial. I created a new Android Application Project with a Blank Activity named `MainActivity`. The resulting project has an empty `src` folder and empty `res\layout` folder. There is a `R.... | 2014/03/05 | [
"https://Stackoverflow.com/questions/22190578",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3382208/"
] | It's new feature of ADT 22.6.2
Even in "None" theme ADT(22.6.2) create "Fragment Layout"
There is four ways:
Try to change "Target" and "Compile" to API 14 or higher. But you need then remove all entries of "Fragment Layouts"
Uncheck "Create activity" checkbox, and create activity manually. Good howto: Best way to ... | With Luna and ADT plug-in version: 23.0.4.1468518
there is a patch available right now to fix:
<https://code.google.com/p/android/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars&groupby=&sort=&id=82393>
Just follow directions near bottom to uninstall and download and instal... |
22,190,578 | I installed the ADT bundle from <http://developer.android.com/sdk/index.html> yesterday, and I was following a basic Hello World tutorial. I created a new Android Application Project with a Blank Activity named `MainActivity`. The resulting project has an empty `src` folder and empty `res\layout` folder. There is a `R.... | 2014/03/05 | [
"https://Stackoverflow.com/questions/22190578",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3382208/"
] | If you updated to Android SDK Tools version 22.6, you are required to Update DDMS Tools and Plugins.
**Go to "Help Menu Bar" -> "Install New software" and install (this will update it)
url: <https://dl-ssl.google.com/android/eclipse/>**
Also update **"Developer Tools"** and **"NDK Plugins"** to latest Version.
This... | With Luna and ADT plug-in version: 23.0.4.1468518
there is a patch available right now to fix:
<https://code.google.com/p/android/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars&groupby=&sort=&id=82393>
Just follow directions near bottom to uninstall and download and instal... |
22,190,578 | I installed the ADT bundle from <http://developer.android.com/sdk/index.html> yesterday, and I was following a basic Hello World tutorial. I created a new Android Application Project with a Blank Activity named `MainActivity`. The resulting project has an empty `src` folder and empty `res\layout` folder. There is a `R.... | 2014/03/05 | [
"https://Stackoverflow.com/questions/22190578",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3382208/"
] | If you updated to Android SDK Tools version 22.6, you are required to Update DDMS Tools and Plugins.
**Go to "Help Menu Bar" -> "Install New software" and install (this will update it)
url: <https://dl-ssl.google.com/android/eclipse/>**
Also update **"Developer Tools"** and **"NDK Plugins"** to latest Version.
This... | It's new feature of ADT 22.6.2
Even in "None" theme ADT(22.6.2) create "Fragment Layout"
There is four ways:
Try to change "Target" and "Compile" to API 14 or higher. But you need then remove all entries of "Fragment Layouts"
Uncheck "Create activity" checkbox, and create activity manually. Good howto: Best way to ... |
22,190,578 | I installed the ADT bundle from <http://developer.android.com/sdk/index.html> yesterday, and I was following a basic Hello World tutorial. I created a new Android Application Project with a Blank Activity named `MainActivity`. The resulting project has an empty `src` folder and empty `res\layout` folder. There is a `R.... | 2014/03/05 | [
"https://Stackoverflow.com/questions/22190578",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3382208/"
] | The comment [see comment](https://stackoverflow.com/questions/22190578/adt-will-not-allow-creation-of-android-activity#comment33730649_22190578) by [NewShelbyWoo](https://stackoverflow.com/users/3382208/newshelbywoo) solved the issue | When you upgrade to SDK tools by 22.x you need to upgrade ADT plugin.
follow these steps to upgrade ADT:
Help > Install New software install
add the below url and click on next.
url: <https://dl-ssl.google.com/android/eclipse/>.
But some times it complaining about conflicts, in that case,
First uninstall the exis... |
22,190,578 | I installed the ADT bundle from <http://developer.android.com/sdk/index.html> yesterday, and I was following a basic Hello World tutorial. I created a new Android Application Project with a Blank Activity named `MainActivity`. The resulting project has an empty `src` folder and empty `res\layout` folder. There is a `R.... | 2014/03/05 | [
"https://Stackoverflow.com/questions/22190578",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3382208/"
] | The comment [see comment](https://stackoverflow.com/questions/22190578/adt-will-not-allow-creation-of-android-activity#comment33730649_22190578) by [NewShelbyWoo](https://stackoverflow.com/users/3382208/newshelbywoo) solved the issue | workspace has to be set to the the SDK folder. After doing this, I have had no problems. For example, after downloading and installing Eclipse, my directory structure is as follows:
```
/Users/username/Development/adt-bundle-mac-x86_64-20140702/
/eclipse/
/sdk/
/HelloWorld/
```
It's annoying because ... |
186,960 | What is a word that can best describe YouTube bad content such as pranking videos, which negatively affect children?
I thought about the word banal but it doesn't seem to fit.
[Edit] As we know that children love to imitate actions they like, I'm implying the fact that this content, which get a lot of views by chil... | 2018/11/29 | [
"https://ell.stackexchange.com/questions/186960",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/66374/"
] | "Banal" would mean "dull, uninteresting, and generally pointless". I think you're looking for something more like ["malicious"](https://dictionary.cambridge.org/us/dictionary/english/malicious):
>
> The worst thing about those **malicious** videos of children doing terrible things to strangers, is that their **notori... | You can use the catch-all phrase:
>
> "Content unsuitable for younger viewers"
>
>
> |
186,960 | What is a word that can best describe YouTube bad content such as pranking videos, which negatively affect children?
I thought about the word banal but it doesn't seem to fit.
[Edit] As we know that children love to imitate actions they like, I'm implying the fact that this content, which get a lot of views by chil... | 2018/11/29 | [
"https://ell.stackexchange.com/questions/186960",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/66374/"
] | "Banal" would mean "dull, uninteresting, and generally pointless". I think you're looking for something more like ["malicious"](https://dictionary.cambridge.org/us/dictionary/english/malicious):
>
> The worst thing about those **malicious** videos of children doing terrible things to strangers, is that their **notori... | You could describe such content as being:
* **damaging**
* **harmful**
* **detrimental**
* **malignant**
* **poisoning**
For example -
>
> Content on YouTube which glorifies jokes at the expense of others has a detrimental effect on the mental health of younger viewers.
>
>
> |
186,960 | What is a word that can best describe YouTube bad content such as pranking videos, which negatively affect children?
I thought about the word banal but it doesn't seem to fit.
[Edit] As we know that children love to imitate actions they like, I'm implying the fact that this content, which get a lot of views by chil... | 2018/11/29 | [
"https://ell.stackexchange.com/questions/186960",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/66374/"
] | You could describe such content as being:
* **damaging**
* **harmful**
* **detrimental**
* **malignant**
* **poisoning**
For example -
>
> Content on YouTube which glorifies jokes at the expense of others has a detrimental effect on the mental health of younger viewers.
>
>
> | You can use the catch-all phrase:
>
> "Content unsuitable for younger viewers"
>
>
> |
44,665,128 | I want to delete duplicate rows from a table based on a condition.
e.g.,
Table ABC:
```
ID Name Pin Status
111 Pope 909 New
222 Jazz 909 New
333 Volk 767 Assigned
444 Audi 767 New
555 Pink 435 New
```
I want to remove duplicate records which has same 'Pin' based on below conditions:
1. If both ... | 2017/06/21 | [
"https://Stackoverflow.com/questions/44665128",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1046830/"
] | Unless you would like to limit the operations that can be preformed on that data member, I would recommend using the public member. If all you are doing is wrapping the methods with your own method names, it doesn't make sense to have them there. | * Generally, you should avoid public derivation if IS-A relationship is not respected as it cause an higher coupling that composition.
* You should also avoid public member as it can make the application harder to maintain in the future.
* If you could use `PointerSet` directly in your second sample, then in version 1,... |
44,665,128 | I want to delete duplicate rows from a table based on a condition.
e.g.,
Table ABC:
```
ID Name Pin Status
111 Pope 909 New
222 Jazz 909 New
333 Volk 767 Assigned
444 Audi 767 New
555 Pink 435 New
```
I want to remove duplicate records which has same 'Pin' based on below conditions:
1. If both ... | 2017/06/21 | [
"https://Stackoverflow.com/questions/44665128",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1046830/"
] | >
> Will having a "function tunnel" take a hit to performance?
>
>
>
Most likely not. Especially since you are dealing with templates here, and so the definitions will all be visible and easy for the compiler to inline. Take a look at this link: <https://godbolt.org/g/cWR7N3>
What I've done is compiled these two ... | Unless you would like to limit the operations that can be preformed on that data member, I would recommend using the public member. If all you are doing is wrapping the methods with your own method names, it doesn't make sense to have them there. |
44,665,128 | I want to delete duplicate rows from a table based on a condition.
e.g.,
Table ABC:
```
ID Name Pin Status
111 Pope 909 New
222 Jazz 909 New
333 Volk 767 Assigned
444 Audi 767 New
555 Pink 435 New
```
I want to remove duplicate records which has same 'Pin' based on below conditions:
1. If both ... | 2017/06/21 | [
"https://Stackoverflow.com/questions/44665128",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1046830/"
] | >
> Will having a "function tunnel" take a hit to performance?
>
>
>
Most likely not. Especially since you are dealing with templates here, and so the definitions will all be visible and easy for the compiler to inline. Take a look at this link: <https://godbolt.org/g/cWR7N3>
What I've done is compiled these two ... | * Generally, you should avoid public derivation if IS-A relationship is not respected as it cause an higher coupling that composition.
* You should also avoid public member as it can make the application harder to maintain in the future.
* If you could use `PointerSet` directly in your second sample, then in version 1,... |
35,752 | I want to know what is the form for "when" in a phrase like "I was reading a book, when someone knocked on my door." I'm aware of the usage of "toki" in phrases like "When I was a teacher..." and "When I talk to someone, they run away...," but I'm not sure if I can use "toki" for "when" in the phrase I want to write ( ... | 2016/06/07 | [
"https://japanese.stackexchange.com/questions/35752",
"https://japanese.stackexchange.com",
"https://japanese.stackexchange.com/users/15676/"
] | This type of "when" in English is called [non-restrictive relative clauses](https://en.wikipedia.org/wiki/Non-restrictive_clause) (非制限用法). The basic idea is that the *when*-clause gives an additional piece of information like an independent sentence, rather than adverbially modifying and "narrowing" the preceding noun.... | I am not 100% sure to understand the difference you are trying to express in your question. In case I did not catch it, consider this answer just an extension about possible structures to express "while".
Anyway, I think that one thing you could use is 〜ている間{あいだ}に, which is another expression to indicate "while (doin... |
3,582,368 | I'm reading [Wikipedia](https://en.wikipedia.org/wiki/Hilbert_system) and it lists the first four logical axioms that allow (together with modus ponens) for the manipulation of logical connectives.
1. $\phi \to \phi $
2. $\phi \to \left(\psi \to \phi \right)$
3. $\left(\phi \to \left(\psi \rightarrow \xi \right)\right... | 2020/03/15 | [
"https://math.stackexchange.com/questions/3582368",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/706719/"
] | Hint: Remember you get to pick what $\psi$ is. Is there any formula $\psi$ such that you know $(\phi\to\psi)$ is true?
More details are hidden below.
>
> By axiom 2, if you choose $\psi$ to have the form $(\psi'\to\phi)$ for some formula $\psi'$, then you know $(\phi\to \psi)$ is true.
>
>
> | By (3) we have
$$
(\phi\to((\phi\to\phi)\to\phi))\to((\phi\to(\phi\to\phi))\to(\phi\to\phi))
$$
By (2),
$$
\phi\to ((\phi\to\phi)\to\phi)
$$
So
$$
((\phi\to(\phi\to\phi))\to(\phi\to\phi))
$$
by Modus Ponens.
By (2),
$$
\phi\to (\phi\to\phi)
$$
so
$$
\phi\to\phi
$$
by Modus Ponens again. |
32,170,852 | For example, If I have `*ggg*`written on Notepad++. I want it to substitute the odd numbered `*`'s for `Pl` and the even numbered `*`'s for `Pk`. That is, after the replacement, it would be:
`PlgggPk`
Accross all the text. How can I do that? At the moment, I found only a way to substitute all the symbols. | 2015/08/23 | [
"https://Stackoverflow.com/questions/32170852",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1418135/"
] | This can be done using the regex replace from notepad++.
Go to the replace dialog
Find: \\*(.\*)\\*
Replace:Pl\1PK
Searchmode: Regular Expression | As I mentioned in a comment to your question, this can be done by searching using regular expressions. I've now had time to verify my suggested regex.
In the "Find what" box, enter `\*([^*]*)\*`
This consists of three parts:
* `\*`: Match the symbol `*` (The `\` escapes the asterisk because it has special meaning in ... |
36,538,780 | I have two dataframes and each one has two index columns. I would like to merge them. For example, the first dataframe is the following:
```
V1
A 1/1/2012 12
2/1/2012 14
B 1/1/2012 15
2/1/2012 8
C 1/1/2012 17
2/1/2012 9
```
The second datafram... | 2016/04/11 | [
"https://Stackoverflow.com/questions/36538780",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5018666/"
] | You should be able to use `join`, which joins on the index as default. Given your desired result, you must use `outer` as the join type.
```
>>> df1.join(df2, how='outer')
V1 V2
A 1/1/2012 12 15
2/1/2012 14 NaN
3/1/2012 NaN 21
B 1/1/2012 15 24
2/1/2012 8 9
C 1/1/2012 17 NaN
2/1/2012 9... | You can do this with [`merge`](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.merge.html):
```
df_merged = df1.merge(df2, how='outer', left_index=True, right_index=True)
```
The keyword argument `how='outer'` keeps all indices from both frames, filling in missing indices with `NaN`. The `left... |
14,180,972 | What is the regex for these cases:
**29000.12345678900**, expected result **29000.123456789**
**29000.000**, expected result **29000**
**29000.00003400**, expected result **29000.000034**
In short, I want to eliminate the 0 point if there is no 1-9 found again behind decimal and I also want to eliminate the dot (.)... | 2013/01/06 | [
"https://Stackoverflow.com/questions/14180972",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1352755/"
] | If you think regex is the best way of doing it, you can just use something like this:
```
\.?0+$
```
It works for both cases:
```
> '12300000.000001130000000'.replace(/\.?0+$/g, '')
"12300000.00000113"
> '12300000.000000000000'.replace(/\.?0+$/g, '')
"12300000"
``` | You can use this regex
```
^\d+(\.\d*[1-9])?
- -------------
| |->this would match only if the digits after . end with [1-9]
|
|->^ depicts the start of the string..it is necessary to match the pattern
```
that solves your problem
try it [here](http://regexhero.net/tester/) |
14,180,972 | What is the regex for these cases:
**29000.12345678900**, expected result **29000.123456789**
**29000.000**, expected result **29000**
**29000.00003400**, expected result **29000.000034**
In short, I want to eliminate the 0 point if there is no 1-9 found again behind decimal and I also want to eliminate the dot (.)... | 2013/01/06 | [
"https://Stackoverflow.com/questions/14180972",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1352755/"
] | If you think regex is the best way of doing it, you can just use something like this:
```
\.?0+$
```
It works for both cases:
```
> '12300000.000001130000000'.replace(/\.?0+$/g, '')
"12300000.00000113"
> '12300000.000000000000'.replace(/\.?0+$/g, '')
"12300000"
``` | You simply want this:
```
^\d*(\.?\d*[1-9])?
```
1. `^\d*` that means one or more digit before the first group.
2. In the `()` that describes matching group.
3. `\.?` means single DOT`(.)` can be there but optional. `eg. (.)`
4. `\d*` there can be one or more digits. `eg. (1234)`
5. `\.?\d*` there can be one DOT and... |
14,180,972 | What is the regex for these cases:
**29000.12345678900**, expected result **29000.123456789**
**29000.000**, expected result **29000**
**29000.00003400**, expected result **29000.000034**
In short, I want to eliminate the 0 point if there is no 1-9 found again behind decimal and I also want to eliminate the dot (.)... | 2013/01/06 | [
"https://Stackoverflow.com/questions/14180972",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1352755/"
] | If you think regex is the best way of doing it, you can just use something like this:
```
\.?0+$
```
It works for both cases:
```
> '12300000.000001130000000'.replace(/\.?0+$/g, '')
"12300000.00000113"
> '12300000.000000000000'.replace(/\.?0+$/g, '')
"12300000"
``` | I don't know whether Objective-C supports something like the following construct, but in Python you can do it completely without regular expressions using [`str.rstrip()`](http://docs.python.org/2.7/library/stdtypes.html?highlight=rstrip#str.rstrip):
```
In [1]: def shorten_number(number):
...: return number.rs... |
14,180,972 | What is the regex for these cases:
**29000.12345678900**, expected result **29000.123456789**
**29000.000**, expected result **29000**
**29000.00003400**, expected result **29000.000034**
In short, I want to eliminate the 0 point if there is no 1-9 found again behind decimal and I also want to eliminate the dot (.)... | 2013/01/06 | [
"https://Stackoverflow.com/questions/14180972",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1352755/"
] | You can use this regex
```
^\d+(\.\d*[1-9])?
- -------------
| |->this would match only if the digits after . end with [1-9]
|
|->^ depicts the start of the string..it is necessary to match the pattern
```
that solves your problem
try it [here](http://regexhero.net/tester/) | You simply want this:
```
^\d*(\.?\d*[1-9])?
```
1. `^\d*` that means one or more digit before the first group.
2. In the `()` that describes matching group.
3. `\.?` means single DOT`(.)` can be there but optional. `eg. (.)`
4. `\d*` there can be one or more digits. `eg. (1234)`
5. `\.?\d*` there can be one DOT and... |
14,180,972 | What is the regex for these cases:
**29000.12345678900**, expected result **29000.123456789**
**29000.000**, expected result **29000**
**29000.00003400**, expected result **29000.000034**
In short, I want to eliminate the 0 point if there is no 1-9 found again behind decimal and I also want to eliminate the dot (.)... | 2013/01/06 | [
"https://Stackoverflow.com/questions/14180972",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1352755/"
] | You can use this regex
```
^\d+(\.\d*[1-9])?
- -------------
| |->this would match only if the digits after . end with [1-9]
|
|->^ depicts the start of the string..it is necessary to match the pattern
```
that solves your problem
try it [here](http://regexhero.net/tester/) | I don't know whether Objective-C supports something like the following construct, but in Python you can do it completely without regular expressions using [`str.rstrip()`](http://docs.python.org/2.7/library/stdtypes.html?highlight=rstrip#str.rstrip):
```
In [1]: def shorten_number(number):
...: return number.rs... |
3,503,113 | >
> If $\int^x\_{\log 2}\dfrac{dy}{e^y-1}=\dfrac{\pi}{6}$, then find x
>
>
>
Set $e^y-1=t\implies e^y.dy=dt$
$$
\int^x\_{\log 2}\dfrac{dy}{e^y-1}=\int^x\_{\log 2}\dfrac{e^y.dy}{e^y(e^y-1)}=\int\_1^{e^x-1}\frac{dt}{t(t+1)}=\int\_1^{e^x-1}\Big[\frac{1}{t}-\frac{1}{t+1}dt\Big]\\
=\bigg[\log\dfrac{t}{t+1}\bigg]\_1^{e^... | 2020/01/09 | [
"https://math.stackexchange.com/questions/3503113",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/223599/"
] | Let $q=e^{-x}$.
Then
$$\begin{align}
\ln(1-q)&=\frac\pi6-\ln2\\
1-q&=\frac12\exp\frac\pi6\\
q&=1-\frac12\exp\frac\pi6\\
\Rightarrow x&=-\ln\left(1-\frac12\exp\frac\pi6\right).
\end{align}$$ | $$I=\int\_{\ln 2}^{x} \frac{dy}{e^y-1} =\ln(1-e^{-x})-\ln (1/2)=\frac{\pi}{6} \implies x=-\ln(1-\frac{e^{-\pi/6}}{2}).$$ |
3,503,113 | >
> If $\int^x\_{\log 2}\dfrac{dy}{e^y-1}=\dfrac{\pi}{6}$, then find x
>
>
>
Set $e^y-1=t\implies e^y.dy=dt$
$$
\int^x\_{\log 2}\dfrac{dy}{e^y-1}=\int^x\_{\log 2}\dfrac{e^y.dy}{e^y(e^y-1)}=\int\_1^{e^x-1}\frac{dt}{t(t+1)}=\int\_1^{e^x-1}\Big[\frac{1}{t}-\frac{1}{t+1}dt\Big]\\
=\bigg[\log\dfrac{t}{t+1}\bigg]\_1^{e^... | 2020/01/09 | [
"https://math.stackexchange.com/questions/3503113",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/223599/"
] | Let $q=e^{-x}$.
Then
$$\begin{align}
\ln(1-q)&=\frac\pi6-\ln2\\
1-q&=\frac12\exp\frac\pi6\\
q&=1-\frac12\exp\frac\pi6\\
\Rightarrow x&=-\ln\left(1-\frac12\exp\frac\pi6\right).
\end{align}$$ | Substitute $e^y-1↦t$
$$\int\_{\ln\left(2\right)}^{x}\frac{dy}{e^{y}-1}=\ln\left(e^{x}-1\right)-x+\ln\left(2\right)=\frac{\pi}{6}$$
then since $x=\ln e^{x}$ follows:
$$\ln\left(\frac{e^{x}-1}{e^{x}}\right)=\frac{\pi}{6}-\ln\left(2\right)$$
$$1-e^{-x}=e^{\left(\frac{\pi}{6}-\ln\left(2\right)\right)}$$
$$\color{green} ... |
57,195,522 | Let's say I have this class
```
struct IDebug {
virtual void print(std::ostream&) const = 0;
};
```
and the prints should follow some format defined for each class implementing `IDebug`.
the format is static in the sense that for a certain implementation will always have the same format and that I want the form... | 2019/07/25 | [
"https://Stackoverflow.com/questions/57195522",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2717954/"
] | You could make use of some CRTP like class to create a base class that does what you want:
```
struct MooDebug : DebugHelper<MooDebug>
{
static std::string format() { return "whatever"; }
};
template<typename T>
struct DebugHelper : IDebug
{
std::string format_impl() const override { return T::format(); }
};... | based on @JVApen answer I ended up doing this:
```
template <class T>
struct IDebug {
void print(std::ostream& o) const { // no longer virtual
auto myformat = T::format();
// preprocess using format
print_impl(o);
// postprocess using format
}
protected:
virtual void print_impl(std::ostre... |
65,385,236 | I have the following cucumber feature:
```
Feature: Myfeature
@tag1
Scenario: 1st scenario
Given
When
Then
@tag2
Scenario: 2nd scenario
Given
When
Then
```
I want to run ONLY the tagged scenario @tag1 from Myfeature file and ignore @tag1 from others features files
I tried the following command ... | 2020/12/20 | [
"https://Stackoverflow.com/questions/65385236",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4774302/"
] | The role can't be deleted. From [docs](https://docs.aws.amazon.com/awssupport/latest/user/using-service-linked-roles-sup.html):
>
> The AWSServiceRoleForSupport role is necessary for AWS Support to provide administrative, operational, and technical support for your account. As a result, this role **can't be deleted**... | As @marcin said you cant, but i would like to mention The reasons `why` it cannot be deleted :-
* To provide world-class customer service and technical support in
order to gather information about your AWS resources through API
calls.
* AWS Support uses this service-linked role in various ways like
**Billing, administ... |
36,336,421 | I have a 3rd-party C++ assembly, which I need to use in my C# project. Hence I wrote a C++/CLI wrapper for the C++ assembly. Everything compiles and runs fine on my development machine.
But when I copy the content of my `bin` directory to one of our other machines, it crashes. The reason is, that it cannot load my C++... | 2016/03/31 | [
"https://Stackoverflow.com/questions/36336421",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1353211/"
] | And, after some hacking, here is the simplest solution I have found:
```
# ~/.nixpkgs/config.nix
{ pkgs }: {
packageOverrides = super: let pkgs = super.pkgs; in with pkgs; rec {
myVim = pkgs.vim_configurable.override {
config.vim = {
ruby = true;
};
ruby = ruby;
};
myEnv = p... | You can try to compile vim yourself. In order to get ruby support this way all you have to do is add the `--rubyinterp` flag when you run `./configure` |
71,063,230 | Knowing I have 2 variables declared called @Variable and @Name, I need something like this:
```
SELECT * from (myDbTable)
CASE WHEN (@Variable IS NOT NULL AND @Variable <> '')
THEN WHERE myDbTable.variable LIKE @Variable
ELSE WHERE myDbTable.name LIKE @Name
```
Basically, if the user enters a "variable" value, it sh... | 2022/02/10 | [
"https://Stackoverflow.com/questions/71063230",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3384458/"
] | There is an `/EXCLUDE` option of [`xcopy`](https://ss64.com/nt/xcopy.html "XCOPY"), which allows to specify (the path to) a text file that contains partial file paths/names one per line (note also the fixed quotation):
```cmd
xcopy /S /Y /R /I /EXCLUDE:exclude.txt "C:\SourceCodeOld\Release\Source Code\*.vb" "C:\Source... | Create a file `excludes.txt` and add the files to exclude to it (each in a new line)
```
AssemblyInfo.vb
anotherfile.vb
```
Then run your `xcopy` command using the `/EXCLUDE` parameter pointing to the file that contains the files to exclude:
```
xcopy "C:\SourceCodeOld\Release\Source Code\*.vb" "C:\SourceCodeNew\So... |
98,264 | The following is my opinion, please correct it if I'm wrong or not good explanation:
if we get $a, b$, then there must be a constant changing-rate $m$ of $(a, f(a))$ and $(b, f(b))$, if the function go this straight line, then everything point has derivative equal to m, if $f'(x)$ **greater or lower** than m, then it ... | 2012/01/11 | [
"https://math.stackexchange.com/questions/98264",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/9288/"
] | Generally speaking, yes, your intuition is in fact the standard way in which, for instance, I explain the Mean Value Theorem: if you think of $f(t)$ as the position function, and the slope of the line from $(a,f(a))$ to $(b,f(b))$ is the average velocity.
If the average velocity is $m$ units of distance per units of t... | 
This picture can aid in intuition. from [Cauchy's Generalized Mean Value Theorem. Required function. (S.A. pp 140 t5.3.5)](https://math.stackexchange.com/q/692845/85079)
I parameterized the picture to question the Cauchy Generalized Mean Value Theor... |
35,502 | I was going to tag this question as 'recreational-mathematics' because it is not directly related to core syllabus topics.
[Placing an integer's divisors around a circle](https://math.stackexchange.com/questions/3371458/placing-an-integers-divisors-around-a-circle)
But then I observed that I do not know what 'core sy... | 2023/02/14 | [
"https://math.meta.stackexchange.com/questions/35502",
"https://math.meta.stackexchange.com",
"https://math.meta.stackexchange.com/users/210189/"
] | We cannot differentiate recreational mathematics on subject-matter, because recreational problems might make use of any kind of mathematical concept.
It is also different from being elementary, because not everything elementary is recreational, and not everything recreational is elementary.
I would also prefer not to... | To me, perusing a few papers , namely those of
>
> Trigg,Charles W., **[What is recreational mathematics?](https://www.jstor.org/stable/2689642?origin=JSTOR-pdf)**, doi:10.2307/2689642i ,*Mathematics Magazine*, Vol. 51, No. 1 (Jan. 1978), pp. 18-21
>
>
>
and
>
> Bàrtlovà, Tereza , **[History and current state o... |
4,124,585 | I have created a testing Google Analytics sample app as directed in on [Google Analytics SDK for Android documentation](http://code.google.com/mobile/analytics/docs/android/) and I have initiated Tracking in my code using:
```
tracker = GoogleAnalyticsTracker.getInstance();
tracker.trackEvent(
"Clicks", /... | 2010/11/08 | [
"https://Stackoverflow.com/questions/4124585",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28557/"
] | Have you started the tracker after your call to `.getInstance()`?
Like this:
```
tracker.start("UA-YOUR-ACCOUNT-HERE", this);
```
You also need to call the following to send the data to Google Analytics:
```
tracker.dispatch();
``` | By default, analytics data is one day behind, are you modifying the reporting dates to show the current day? If so, bear in mind that a 30 minute delay is not at all unusual. |
4,124,585 | I have created a testing Google Analytics sample app as directed in on [Google Analytics SDK for Android documentation](http://code.google.com/mobile/analytics/docs/android/) and I have initiated Tracking in my code using:
```
tracker = GoogleAnalyticsTracker.getInstance();
tracker.trackEvent(
"Clicks", /... | 2010/11/08 | [
"https://Stackoverflow.com/questions/4124585",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28557/"
] | Have you started the tracker after your call to `.getInstance()`?
Like this:
```
tracker.start("UA-YOUR-ACCOUNT-HERE", this);
```
You also need to call the following to send the data to Google Analytics:
```
tracker.dispatch();
``` | Refer below code
```
public class TestActivity extends Activity {
GoogleAnalyticsTracker tracker;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
tracker = GoogleAnalyticsTracker.getInstance();
// Start the tracker in manual dispatch mode..... |
4,124,585 | I have created a testing Google Analytics sample app as directed in on [Google Analytics SDK for Android documentation](http://code.google.com/mobile/analytics/docs/android/) and I have initiated Tracking in my code using:
```
tracker = GoogleAnalyticsTracker.getInstance();
tracker.trackEvent(
"Clicks", /... | 2010/11/08 | [
"https://Stackoverflow.com/questions/4124585",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28557/"
] | By default, analytics data is one day behind, are you modifying the reporting dates to show the current day? If so, bear in mind that a 30 minute delay is not at all unusual. | Refer below code
```
public class TestActivity extends Activity {
GoogleAnalyticsTracker tracker;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
tracker = GoogleAnalyticsTracker.getInstance();
// Start the tracker in manual dispatch mode..... |
2,420,176 | I have a sequence as follows:
$$1, 2, 4, 4, 8, 8, 8, 8, 16, 16, 16, 16, 16, 16, 16, 16, 32, 32 ...$$
What will be the closed form of the above sequence for the nth term?
I clearly see the pattern of $2^x$ getting repeated $2^{x-1}$ times. But I am getting confused in finding the closed form of this sequence.
EDIT:
... | 2017/09/07 | [
"https://math.stackexchange.com/questions/2420176",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/307922/"
] | If we start indexing at $n = 1$, we get $$a\_n = 2^{\lceil \log\_2 n\rceil}$$where $\lceil - \rceil$ is the ceiling function. | If we start indexing at $n=1$, the sum I believe is this:
$$s\_n=(n-2^{\lfloor\log\_2 n\rfloor})\cdot a\_n+2\cdot\frac{4^{\lfloor\log\_2 n\rfloor}-1}{3}+1$$ |
54,301,925 | I am a beginner to python, I wanted to symbolic computations. I came to know with sympy installation into our pc we can do symbolic computation. I have installed python 3.6 and I am using anaconda nagavitor, through which I am using spyder as an editor. now I want to install symbolic package sympy how to do that.
I che... | 2019/01/22 | [
"https://Stackoverflow.com/questions/54301925",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9049579/"
] | Agree with Dixit.
### First Solution:
It's okay to use `pip3 install sympy` on MacOS.
1. List item
2. Open your "Terminal".
3. Input `pip3 install sympy` and press enter.
4. It will automatically download and install the Sympy Package.
### Second Solution:
Using git.
# Notice: Before install Sympy, it's necessary ... | To use conda install, open the Anaconda Prompt and enter the *conda install sympy* command.
Alternatively, navigate to the scripts sub-directory in the Anaconda directory, and run *pip install sympy*. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.