qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
20,608,330 | How would I go about making a print screen run in flash. So when a user has arranged some artwork via a drag and drop flash/app - they click a button to 'Print' and there current design activates a printer?
Is this straight forward?
Thanks | 2013/12/16 | [
"https://Stackoverflow.com/questions/20608330",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3082874/"
] | Updating VirtualBox to newest version fixed my issue. | **For MAC users**
After some research, this worked for me:
* Quit VirtualBox
* Right click "Applications" folder
* Click on "Get Info"
* Change "Everyone" Permission to "Read Only"
* Open VirtualBox, and now it should work.
 |
20,608,330 | How would I go about making a print screen run in flash. So when a user has arranged some artwork via a drag and drop flash/app - they click a button to 'Print' and there current design activates a printer?
Is this straight forward?
Thanks | 2013/12/16 | [
"https://Stackoverflow.com/questions/20608330",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3082874/"
] | Updating VirtualBox to newest version fixed my issue. | This worked for me:
1. In the Oracle VM Manager - right click on your virtual maching (for example kali linux).
2. In the menu choose "discard saved state".
Then press discard and restart your virtual machine. |
20,608,330 | How would I go about making a print screen run in flash. So when a user has arranged some artwork via a drag and drop flash/app - they click a button to 'Print' and there current design activates a printer?
Is this straight forward?
Thanks | 2013/12/16 | [
"https://Stackoverflow.com/questions/20608330",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3082874/"
] | If you are in Windows and the error message shows `VT-x is not available` make sure Hyper-V is disabled in Windows components. | In my case I gave administrator privilege to Virtualbox and it solved my problem.
i.e., run `run as administrator` on windows 10 |
20,608,330 | How would I go about making a print screen run in flash. So when a user has arranged some artwork via a drag and drop flash/app - they click a button to 'Print' and there current design activates a printer?
Is this straight forward?
Thanks | 2013/12/16 | [
"https://Stackoverflow.com/questions/20608330",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3082874/"
] | Killing VM process dint work in my case.
Right click on the VM and click on "Discard Saved State".
[](https://i.stack.imgur.com/0w2XJ.png)
This worked for me. | Ubuntu based system, solution that worked for me...
Delete virtualbox and download the latest deb package from the virtualbox website. |
20,608,330 | How would I go about making a print screen run in flash. So when a user has arranged some artwork via a drag and drop flash/app - they click a button to 'Print' and there current design activates a printer?
Is this straight forward?
Thanks | 2013/12/16 | [
"https://Stackoverflow.com/questions/20608330",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3082874/"
] | Updating VirtualBox to newest version fixed my issue. | The only thing that solved the issue for me is to unmount the second hard disk on my laptop.
My current setup contains 1 HDD on SATA0 port and 1 SSD on SATA1 port. I've the OS and Oracle VirtualBox installed on the SSD drive.
When I deleted the partition on the HDD, the issue was solved. |
20,608,330 | How would I go about making a print screen run in flash. So when a user has arranged some artwork via a drag and drop flash/app - they click a button to 'Print' and there current design activates a printer?
Is this straight forward?
Thanks | 2013/12/16 | [
"https://Stackoverflow.com/questions/20608330",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3082874/"
] | Killing VM process dint work in my case.
Right click on the VM and click on "Discard Saved State".
[](https://i.stack.imgur.com/0w2XJ.png)
This worked for me. | In my case I gave administrator privilege to Virtualbox and it solved my problem.
i.e., run `run as administrator` on windows 10 |
20,608,330 | How would I go about making a print screen run in flash. So when a user has arranged some artwork via a drag and drop flash/app - they click a button to 'Print' and there current design activates a printer?
Is this straight forward?
Thanks | 2013/12/16 | [
"https://Stackoverflow.com/questions/20608330",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3082874/"
] | Something that I tried and work for me is simply you create a new virtual machine and you use the existing virtual hard disk file and everything is like you left it. | This solved my problem:
1. open a cmd with admin privilige
2. bcdedit /set hypervisorlaunchtype off
3. reboot
Error gone and VMs are working again. |
20,608,330 | How would I go about making a print screen run in flash. So when a user has arranged some artwork via a drag and drop flash/app - they click a button to 'Print' and there current design activates a printer?
Is this straight forward?
Thanks | 2013/12/16 | [
"https://Stackoverflow.com/questions/20608330",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3082874/"
] | On Ubuntu, this can also be caused by incorrect permissions. I `chmod 755 Logs/` which fixed the issue. | The only thing that solved the issue for me is to unmount the second hard disk on my laptop.
My current setup contains 1 HDD on SATA0 port and 1 SSD on SATA1 port. I've the OS and Oracle VirtualBox installed on the SSD drive.
When I deleted the partition on the HDD, the issue was solved. |
20,608,330 | How would I go about making a print screen run in flash. So when a user has arranged some artwork via a drag and drop flash/app - they click a button to 'Print' and there current design activates a printer?
Is this straight forward?
Thanks | 2013/12/16 | [
"https://Stackoverflow.com/questions/20608330",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3082874/"
] | On Ubuntu, this can also be caused by incorrect permissions. I `chmod 755 Logs/` which fixed the issue. | Normally this error occurs when it try to load the previous state. This happened in Mac Virtual box.
I tried after restarting the virtual box but again also i've encountered this issue.
Right Click on the operating system in the virtual box and then Click on the **Discard Saved State..** .This fixed the issue. |
20,608,330 | How would I go about making a print screen run in flash. So when a user has arranged some artwork via a drag and drop flash/app - they click a button to 'Print' and there current design activates a printer?
Is this straight forward?
Thanks | 2013/12/16 | [
"https://Stackoverflow.com/questions/20608330",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3082874/"
] | On Ubuntu, this can also be caused by incorrect permissions. I `chmod 755 Logs/` which fixed the issue. | This solved my problem:
1. open a cmd with admin privilige
2. bcdedit /set hypervisorlaunchtype off
3. reboot
Error gone and VMs are working again. |
37,741,855 | It will be very good if you help me do this guys ! thanks a million in advance
```js
//Something like this I am thingking
$(document).on('mousedown',function(){
//code that prevents cursor leaving a page
});
``` | 2016/06/10 | [
"https://Stackoverflow.com/questions/37741855",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6447214/"
] | There is a pointer lock API that should do what you are looking for using `canvas.requestPointerLock || canvas.mozRequestPointerLock`
There is a demo [here](http://mdn.github.io/pointer-lock-demo/)
[Check out the docs](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_Lock_API) | I'm not sure it is possible to *prevent* mouse move.
But, an approach would be to track mouse x/y position and alert user when he's going off the page.
Look [this SO answer](https://stackoverflow.com/a/7790764/2159528) about mouse tracking. |
56,109 | Currently, I have trained my model through 5-fold cross validation with very small amount of the sample (n=100).
I used whole data set to train and got quite low performance in terms of accuracy, which is bit higher than 70%.
However, if I put my data which was used for training back to trained model to validate, it ... | 2019/07/21 | [
"https://datascience.stackexchange.com/questions/56109",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/78134/"
] | Typically you would use the best model parameters and then re-run the model with the portion of the data set aside for training to come up with a new 'best' that you can run against your test set. | I will suggest you to read a post on [K-Fold CV](https://datascience.stackexchange.com/questions/53773/in-k-fold-cross-validation-why-do-we-compute-the-mean-of-the-metric-of-each-fol/53782#53782)
Once we have mean score of each model, we generally select the best model out of it. |
56,109 | Currently, I have trained my model through 5-fold cross validation with very small amount of the sample (n=100).
I used whole data set to train and got quite low performance in terms of accuracy, which is bit higher than 70%.
However, if I put my data which was used for training back to trained model to validate, it ... | 2019/07/21 | [
"https://datascience.stackexchange.com/questions/56109",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/78134/"
] | Typically you would use the best model parameters and then re-run the model with the portion of the data set aside for training to come up with a new 'best' that you can run against your test set. | Cross validation is a procedure used to get a sense of model performance with the procedure (type of model, preprocessing, selected hyperparameters etc) you have selected. Let's suppose you have 2 models A and B and you want to know which to select. You would perform similar CV on both the models and avergae the score ... |
56,109 | Currently, I have trained my model through 5-fold cross validation with very small amount of the sample (n=100).
I used whole data set to train and got quite low performance in terms of accuracy, which is bit higher than 70%.
However, if I put my data which was used for training back to trained model to validate, it ... | 2019/07/21 | [
"https://datascience.stackexchange.com/questions/56109",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/78134/"
] | Typically you would use the best model parameters and then re-run the model with the portion of the data set aside for training to come up with a new 'best' that you can run against your test set. | We usually take best model. But I have come across a notebook on Kaggle where the user has taken best two models from k-fold validation and then used both of them in ensemble learning. She has given 60% weight to the best model and 40% to the second best model. You can try that. Doesn't hurt, rt? |
56,109 | Currently, I have trained my model through 5-fold cross validation with very small amount of the sample (n=100).
I used whole data set to train and got quite low performance in terms of accuracy, which is bit higher than 70%.
However, if I put my data which was used for training back to trained model to validate, it ... | 2019/07/21 | [
"https://datascience.stackexchange.com/questions/56109",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/78134/"
] | I will suggest you to read a post on [K-Fold CV](https://datascience.stackexchange.com/questions/53773/in-k-fold-cross-validation-why-do-we-compute-the-mean-of-the-metric-of-each-fol/53782#53782)
Once we have mean score of each model, we generally select the best model out of it. | Cross validation is a procedure used to get a sense of model performance with the procedure (type of model, preprocessing, selected hyperparameters etc) you have selected. Let's suppose you have 2 models A and B and you want to know which to select. You would perform similar CV on both the models and avergae the score ... |
56,109 | Currently, I have trained my model through 5-fold cross validation with very small amount of the sample (n=100).
I used whole data set to train and got quite low performance in terms of accuracy, which is bit higher than 70%.
However, if I put my data which was used for training back to trained model to validate, it ... | 2019/07/21 | [
"https://datascience.stackexchange.com/questions/56109",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/78134/"
] | I will suggest you to read a post on [K-Fold CV](https://datascience.stackexchange.com/questions/53773/in-k-fold-cross-validation-why-do-we-compute-the-mean-of-the-metric-of-each-fol/53782#53782)
Once we have mean score of each model, we generally select the best model out of it. | We usually take best model. But I have come across a notebook on Kaggle where the user has taken best two models from k-fold validation and then used both of them in ensemble learning. She has given 60% weight to the best model and 40% to the second best model. You can try that. Doesn't hurt, rt? |
41,958,771 | I have TK application with several frames containing different widgets.
To hide a frame (and its content) I use *grid remove $frame*".
How can I achieve the resizing of the TK toplevel to the minimum needed geometry?
```
grid [ttk::frame .f ] -sticky nwse
grid [ttk::frame .f.f] -sticky nwse
foreach el {a b c d e f} {
... | 2017/01/31 | [
"https://Stackoverflow.com/questions/41958771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5089464/"
] | While [`grid remove`](http://www.tcl-lang.org/man/tcl8.6/TkCmd/grid.htm#M25) takes the widget out of the grid, it doesn't forget the information about how to lay that widget out (in case you want to add it back in at the same location, an occasionally useful operation). To really forget it entirely, you should use [`gr... | What about:
wm geometry $toplevel {}
Regards,
jima |
41,958,771 | I have TK application with several frames containing different widgets.
To hide a frame (and its content) I use *grid remove $frame*".
How can I achieve the resizing of the TK toplevel to the minimum needed geometry?
```
grid [ttk::frame .f ] -sticky nwse
grid [ttk::frame .f.f] -sticky nwse
foreach el {a b c d e f} {
... | 2017/01/31 | [
"https://Stackoverflow.com/questions/41958771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5089464/"
] | While [`grid remove`](http://www.tcl-lang.org/man/tcl8.6/TkCmd/grid.htm#M25) takes the widget out of the grid, it doesn't forget the information about how to lay that widget out (in case you want to add it back in at the same location, an occasionally useful operation). To really forget it entirely, you should use [`gr... | I am suprised wht *wm geometry $toplevel {}.* It redraws. Great.
But it does not solve my issue, but understand now the situation.
If a the toplevelFrame (the first and only frame in a toplevel) is removed from the grid, the toplevel is "empty" and not redrawn.
If the toplevel as at least to widgets/frames which are ... |
41,958,771 | I have TK application with several frames containing different widgets.
To hide a frame (and its content) I use *grid remove $frame*".
How can I achieve the resizing of the TK toplevel to the minimum needed geometry?
```
grid [ttk::frame .f ] -sticky nwse
grid [ttk::frame .f.f] -sticky nwse
foreach el {a b c d e f} {
... | 2017/01/31 | [
"https://Stackoverflow.com/questions/41958771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5089464/"
] | What about:
wm geometry $toplevel {}
Regards,
jima | I am suprised wht *wm geometry $toplevel {}.* It redraws. Great.
But it does not solve my issue, but understand now the situation.
If a the toplevelFrame (the first and only frame in a toplevel) is removed from the grid, the toplevel is "empty" and not redrawn.
If the toplevel as at least to widgets/frames which are ... |
105,034 | $n = 4k + 3 $
We start by letting $a \not\equiv 0\pmod n$ $\Rightarrow$ $a \equiv k\pmod n$ .
$\Rightarrow$ $a^{4k+2} \equiv 1\pmod n$
Now, I know that the contradiction will arrive from the fact that if we can show $a^2 \equiv 1 \pmod n $ then we can say $b^2 \equiv -1 \pmod n $ then it is not possible since soluti... | 2012/02/02 | [
"https://math.stackexchange.com/questions/105034",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/24077/"
] | **Hint:** If $p \equiv 3 \pmod{4}$, then $x$ is a [quadratic residue](http://en.wikipedia.org/wiki/Quadratic_residue#Prime_modulus) $\bmod{p}$ if and only if $-x$ is a quadratic nonresidue $\bmod{p}$.
---
Edit, to be more direct:
**Lemma:**
Suppose that $p$ is an odd prime, and assume that $x$ is a nonzero quadrat... | You are on the right track, the problem is that you don't know what $a^2$ is to relate it to $b^2$.
**Hint** Can you relate somehow $a^{4k+2} \equiv 1\pmod n$ to $b$?
**Edit:** Since you figured it, here is the complete solution.
First note that if we prove $a \equiv 0\pmod p$ it follows imediately that $b$ is also... |
105,034 | $n = 4k + 3 $
We start by letting $a \not\equiv 0\pmod n$ $\Rightarrow$ $a \equiv k\pmod n$ .
$\Rightarrow$ $a^{4k+2} \equiv 1\pmod n$
Now, I know that the contradiction will arrive from the fact that if we can show $a^2 \equiv 1 \pmod n $ then we can say $b^2 \equiv -1 \pmod n $ then it is not possible since soluti... | 2012/02/02 | [
"https://math.stackexchange.com/questions/105034",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/24077/"
] | **Hint:** If $p \equiv 3 \pmod{4}$, then $x$ is a [quadratic residue](http://en.wikipedia.org/wiki/Quadratic_residue#Prime_modulus) $\bmod{p}$ if and only if $-x$ is a quadratic nonresidue $\bmod{p}$.
---
Edit, to be more direct:
**Lemma:**
Suppose that $p$ is an odd prime, and assume that $x$ is a nonzero quadrat... | Assume that $a$ and $b$ are coprime. If $a$ and $b$ are odd, replace
$a$ and $ b$ by $(a-b)/2$ and $(a+b)/2$. Then $a^2 + b^2 = pm$, and by reducing $a$ and $b$
modulo $p$ you can make sure that $m < p$. Since $p = 4n+3$ and $a^2 + b^2 = 4k+1$,
we must have $m = 4j+3$. But then $m$ is divisible by a prime number $q = ... |
105,034 | $n = 4k + 3 $
We start by letting $a \not\equiv 0\pmod n$ $\Rightarrow$ $a \equiv k\pmod n$ .
$\Rightarrow$ $a^{4k+2} \equiv 1\pmod n$
Now, I know that the contradiction will arrive from the fact that if we can show $a^2 \equiv 1 \pmod n $ then we can say $b^2 \equiv -1 \pmod n $ then it is not possible since soluti... | 2012/02/02 | [
"https://math.stackexchange.com/questions/105034",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/24077/"
] | **Hint:** If $p \equiv 3 \pmod{4}$, then $x$ is a [quadratic residue](http://en.wikipedia.org/wiki/Quadratic_residue#Prime_modulus) $\bmod{p}$ if and only if $-x$ is a quadratic nonresidue $\bmod{p}$.
---
Edit, to be more direct:
**Lemma:**
Suppose that $p$ is an odd prime, and assume that $x$ is a nonzero quadrat... | This is solution from *Prasolov V.V. Zadachi po algebre, arifmetike i analizu* (В. В. Прасолов. Задачи по алгебре, арифметике и анализу.) This book (in Russian) is freely available at <http://www.mccme.ru/free-books/>
The problem appears there as Problem 31.2.
We want to show that if $p=4k+3$ is a prime number and $... |
426,429 | Consider the figure below (figure 6.12 from Griffiths, *Introduction to Quantum Mechanics*, p 249 in the 1995 edition), which shows the Zeeman effect on the $n=2$ eigenvalues of hydrogen. The figure shows two dashed lines. What's the significance of dashed lines? I mean, why are they dashed while others are not?
>
> ... | 2018/09/03 | [
"https://physics.stackexchange.com/questions/426429",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/197399/"
] | There isn't enough mention of those lines in the text to be able to tell for sure, but the obvious interpretation is that the dashed lines are only there as a guide to the eye so that it is easier to see that the second and sixth eigenvalues (either order) in the strong-field regime scale linearly with $B\_\mathrm{ext}... | I tend to agree with what @Emilio Pisanty said, but there is some subtlety involving the n=2 level of hydrogen. Namely, according to relativistic quantum mechanics, ${}^{2}S\_{1/2}$ and ${}^{2} P\_{1/2}$ of hydrogen are degenerate up to fine structure. The degeneracy is broken by the Lamb shift, which needs QED to expl... |
426,429 | Consider the figure below (figure 6.12 from Griffiths, *Introduction to Quantum Mechanics*, p 249 in the 1995 edition), which shows the Zeeman effect on the $n=2$ eigenvalues of hydrogen. The figure shows two dashed lines. What's the significance of dashed lines? I mean, why are they dashed while others are not?
>
> ... | 2018/09/03 | [
"https://physics.stackexchange.com/questions/426429",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/197399/"
] | There isn't enough mention of those lines in the text to be able to tell for sure, but the obvious interpretation is that the dashed lines are only there as a guide to the eye so that it is easier to see that the second and sixth eigenvalues (either order) in the strong-field regime scale linearly with $B\_\mathrm{ext}... | The dashed lines are the ones that arise from the S state (n=2, l=0, j=1/2).
The other lines all arise from P states.
This graph ignores the lamb shift.
According to Dirac (not quantizing the EM field), the state (n=2, l=1, j=1/2) has the same zero-field energy, splits also in two at non-zero fields, but has a small... |
426,429 | Consider the figure below (figure 6.12 from Griffiths, *Introduction to Quantum Mechanics*, p 249 in the 1995 edition), which shows the Zeeman effect on the $n=2$ eigenvalues of hydrogen. The figure shows two dashed lines. What's the significance of dashed lines? I mean, why are they dashed while others are not?
>
> ... | 2018/09/03 | [
"https://physics.stackexchange.com/questions/426429",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/197399/"
] | I tend to agree with what @Emilio Pisanty said, but there is some subtlety involving the n=2 level of hydrogen. Namely, according to relativistic quantum mechanics, ${}^{2}S\_{1/2}$ and ${}^{2} P\_{1/2}$ of hydrogen are degenerate up to fine structure. The degeneracy is broken by the Lamb shift, which needs QED to expl... | The dashed lines are the ones that arise from the S state (n=2, l=0, j=1/2).
The other lines all arise from P states.
This graph ignores the lamb shift.
According to Dirac (not quantizing the EM field), the state (n=2, l=1, j=1/2) has the same zero-field energy, splits also in two at non-zero fields, but has a small... |
18,691,889 | I have 5 grayscale images in the form of 288x288 `ndarray`s. The values in each `ndarray` are just `numpy.float32` numbers ranging from 0.0 to 255.0. For each `ndarray`, I've created a `numpy.ma.MaskedArray` object as follows:
```
def bool_row(row):
return [value == 183. for value in row]
mask = [bool_row(row) fo... | 2013/09/09 | [
"https://Stackoverflow.com/questions/18691889",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1061413/"
] | I suspect the problem is in how `ma.median` handles a non-array argument. It might be converting a list to a plain numpy array, without checking the types of the elements of the list.
Consider the following example with 1-D arrays:
```
In [64]: a = ma.array([1, 2, -10, 3, -10, -10], mask=[0,0,1,0,1,1])
In [65]: b = ... | you can use the following to get rid of all of the 183 values just while calculating the median:
```
masked_arrays=[masked_array_1, masked_array_2, masked_array_3]
no_junk_arrays=[[x for x in masked_array if x is not 183] for masked_array in masked_arrays]
ma.median(no_junk_arrays)
```
For example
```
>>> masked_a... |
18,691,889 | I have 5 grayscale images in the form of 288x288 `ndarray`s. The values in each `ndarray` are just `numpy.float32` numbers ranging from 0.0 to 255.0. For each `ndarray`, I've created a `numpy.ma.MaskedArray` object as follows:
```
def bool_row(row):
return [value == 183. for value in row]
mask = [bool_row(row) fo... | 2013/09/09 | [
"https://Stackoverflow.com/questions/18691889",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1061413/"
] | I suspect the problem is in how `ma.median` handles a non-array argument. It might be converting a list to a plain numpy array, without checking the types of the elements of the list.
Consider the following example with 1-D arrays:
```
In [64]: a = ma.array([1, 2, -10, 3, -10, -10], mask=[0,0,1,0,1,1])
In [65]: b = ... | I'm sure it can be done if you find the clever sequence of numpy functions to invoke. But it can also be done naively:
```
def merge(a1, a2):
result = []
for x, y in zip(a1, a2):
if x == 183:
x = y
result.append(x)
return result
array_1 = [1, 183, 2]
array_2 = [1, 183, 183]
arr... |
18,691,889 | I have 5 grayscale images in the form of 288x288 `ndarray`s. The values in each `ndarray` are just `numpy.float32` numbers ranging from 0.0 to 255.0. For each `ndarray`, I've created a `numpy.ma.MaskedArray` object as follows:
```
def bool_row(row):
return [value == 183. for value in row]
mask = [bool_row(row) fo... | 2013/09/09 | [
"https://Stackoverflow.com/questions/18691889",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1061413/"
] | I suspect the problem is in how `ma.median` handles a non-array argument. It might be converting a list to a plain numpy array, without checking the types of the elements of the list.
Consider the following example with 1-D arrays:
```
In [64]: a = ma.array([1, 2, -10, 3, -10, -10], mask=[0,0,1,0,1,1])
In [65]: b = ... | If what you are after is fetching the non-nan value for every pixel, you could do someting along the lines of:
```
stacked_imgs = np.dstack((img1, img2, img3))
mask = stacked_imgs == 183
# Find the first False, i.e. non-183 entry, along stack axis
index = np.argmin(mask, axis=-1)
correct_image = stacked_image[..., ind... |
32,608,881 | I'm trying to understand .Net marshalling and now i'm working with strings. I write an app but it doesn't work as expected. What am I doing wrong here?
C++
```
EXPORT void GetString(wchar_t **pBuff)
{
std::wcout << "Initial string was: " << *pBuff << std::endl << "Changing its value..." << std::endl;
*pBuff =... | 2015/09/16 | [
"https://Stackoverflow.com/questions/32608881",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2559709/"
] | Maybe you could consider using pseudo-elements:
<http://jsfiddle.net/pjr7wbhk/2/>
```
.foo{
background: red;
width: 50%;
text-align: center;
}
.foo:hover{
color: white;
}
.foo:hover::after {
content: '';
display: block;
height: 50px;
}
``` | If you have your height variable like this:
```css
@foo-height : 50px; /* here goes your initial height value */
```
you can write these rules in your .less file:
```css
.foo {
background: red;
width: 50%;
height: @foo-height;
text-align: center;
}
.foo:hover {
height: ~'calc(@{foo-height} + 50p... |
32,608,881 | I'm trying to understand .Net marshalling and now i'm working with strings. I write an app but it doesn't work as expected. What am I doing wrong here?
C++
```
EXPORT void GetString(wchar_t **pBuff)
{
std::wcout << "Initial string was: " << *pBuff << std::endl << "Changing its value..." << std::endl;
*pBuff =... | 2015/09/16 | [
"https://Stackoverflow.com/questions/32608881",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2559709/"
] | Following my comment: I advise another approach. Simply set the box-shadow to the container element, like so:
```css
a {
text-indent: -9999px;
overflow: hidden;
background: url('http://nationalevents.cityofhope.org/images/content/pagebuilder/facebook-icon.png');
background-size: cover;
width: 32px;
h... | If you have your height variable like this:
```css
@foo-height : 50px; /* here goes your initial height value */
```
you can write these rules in your .less file:
```css
.foo {
background: red;
width: 50%;
height: @foo-height;
text-align: center;
}
.foo:hover {
height: ~'calc(@{foo-height} + 50p... |
32,608,881 | I'm trying to understand .Net marshalling and now i'm working with strings. I write an app but it doesn't work as expected. What am I doing wrong here?
C++
```
EXPORT void GetString(wchar_t **pBuff)
{
std::wcout << "Initial string was: " << *pBuff << std::endl << "Changing its value..." << std::endl;
*pBuff =... | 2015/09/16 | [
"https://Stackoverflow.com/questions/32608881",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2559709/"
] | Maybe you could consider using pseudo-elements:
<http://jsfiddle.net/pjr7wbhk/2/>
```
.foo{
background: red;
width: 50%;
text-align: center;
}
.foo:hover{
color: white;
}
.foo:hover::after {
content: '';
display: block;
height: 50px;
}
``` | Using an extra html element and some abs/rel positioning:
<http://jsfiddle.net/pjr7wbhk/6/>
```
<div class="foo">
<div class="inner-helper">foo text</div>
</div>
```
CSS:
```
.foo {
position: relative;
}
.foo .inner-helper {
position: absolute;
top:0;
bottom: 0;
left:0;
right: 0;
}
.foo... |
32,608,881 | I'm trying to understand .Net marshalling and now i'm working with strings. I write an app but it doesn't work as expected. What am I doing wrong here?
C++
```
EXPORT void GetString(wchar_t **pBuff)
{
std::wcout << "Initial string was: " << *pBuff << std::endl << "Changing its value..." << std::endl;
*pBuff =... | 2015/09/16 | [
"https://Stackoverflow.com/questions/32608881",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2559709/"
] | Following my comment: I advise another approach. Simply set the box-shadow to the container element, like so:
```css
a {
text-indent: -9999px;
overflow: hidden;
background: url('http://nationalevents.cityofhope.org/images/content/pagebuilder/facebook-icon.png');
background-size: cover;
width: 32px;
h... | Maybe you could consider using pseudo-elements:
<http://jsfiddle.net/pjr7wbhk/2/>
```
.foo{
background: red;
width: 50%;
text-align: center;
}
.foo:hover{
color: white;
}
.foo:hover::after {
content: '';
display: block;
height: 50px;
}
``` |
32,608,881 | I'm trying to understand .Net marshalling and now i'm working with strings. I write an app but it doesn't work as expected. What am I doing wrong here?
C++
```
EXPORT void GetString(wchar_t **pBuff)
{
std::wcout << "Initial string was: " << *pBuff << std::endl << "Changing its value..." << std::endl;
*pBuff =... | 2015/09/16 | [
"https://Stackoverflow.com/questions/32608881",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2559709/"
] | Following my comment: I advise another approach. Simply set the box-shadow to the container element, like so:
```css
a {
text-indent: -9999px;
overflow: hidden;
background: url('http://nationalevents.cityofhope.org/images/content/pagebuilder/facebook-icon.png');
background-size: cover;
width: 32px;
h... | Using an extra html element and some abs/rel positioning:
<http://jsfiddle.net/pjr7wbhk/6/>
```
<div class="foo">
<div class="inner-helper">foo text</div>
</div>
```
CSS:
```
.foo {
position: relative;
}
.foo .inner-helper {
position: absolute;
top:0;
bottom: 0;
left:0;
right: 0;
}
.foo... |
29,869,206 | As a general convention, should static method(s) be separated into another class from a class with instance methods?
Is there also an example of your reason? | 2015/04/25 | [
"https://Stackoverflow.com/questions/29869206",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4764751/"
] | There is no general convention that dictates that a static method must be separate from a non-static method. In fact, if the two methods are related enough to one another, it would be counter-intuitive to have the methods separated.
Recall what use case static methods (and fields) have: they're methods/fields that can... | It probably is a duplicate question, but no, static methods have very specific benefits that are often valuable in classes that are instantiated as objects. |
29,869,206 | As a general convention, should static method(s) be separated into another class from a class with instance methods?
Is there also an example of your reason? | 2015/04/25 | [
"https://Stackoverflow.com/questions/29869206",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4764751/"
] | There is no general convention that dictates that a static method must be separate from a non-static method. In fact, if the two methods are related enough to one another, it would be counter-intuitive to have the methods separated.
Recall what use case static methods (and fields) have: they're methods/fields that can... | There is no such convention. It's completely depends on your situation. Some class may really needs mixture of both static and non-static members.
But some times it's is seen the use of `Constatns.java/ Utils.java` class in some java project. You may found -
```
public static final double PI = 3.1416;
public static... |
29,869,206 | As a general convention, should static method(s) be separated into another class from a class with instance methods?
Is there also an example of your reason? | 2015/04/25 | [
"https://Stackoverflow.com/questions/29869206",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4764751/"
] | There is no general convention that dictates that a static method must be separate from a non-static method. In fact, if the two methods are related enough to one another, it would be counter-intuitive to have the methods separated.
Recall what use case static methods (and fields) have: they're methods/fields that can... | Definitely answer would be dictated by the use case but there is no convention as such. At most you have some `Utility` class that may have bunch of static methods that are used by other classes as helper methods. For example to test whether a String is an email or to extract username from email etc. |
29,869,206 | As a general convention, should static method(s) be separated into another class from a class with instance methods?
Is there also an example of your reason? | 2015/04/25 | [
"https://Stackoverflow.com/questions/29869206",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4764751/"
] | There is no general convention that dictates that a static method must be separate from a non-static method. In fact, if the two methods are related enough to one another, it would be counter-intuitive to have the methods separated.
Recall what use case static methods (and fields) have: they're methods/fields that can... | Putting all static methods in a separate class would be useful while writing an API or a framework. [Collections](http://docs.oracle.com/javase/7/docs/api/java/util/Collections.html) class is an example. java.lang.Math or java.lang.System is another.
Normally, define static methods in the following scenarios:
* While... |
45,881,054 | i'm try to create media player for clients using vlcj with out need to install VLC in their PCs, from VLC.
i take this code from official site of VLC it work fine until i add EmbeddedMediaPlayerComponent() it get error
when i use
>
> new NativeDiscovery().discover();
>
>
>
it work fine because i installed VLC ... | 2017/08/25 | [
"https://Stackoverflow.com/questions/45881054",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7773867/"
] | The best solution for me was to write my own discovery strategy and bundle the VLC libraries with the application. This way, an installation of VLC is not required. Everything comes with the app.
Here's an example of a discovery strategy:
<https://github.com/johndeverall/BehaviourCoder/blob/master/src/main/java/de/b... | Since I don't have comment privileges...
Is it possible you have more then 1 VLC installation installed?
The reason for asking is that a 64bit jdk/jre is not able to use a 32bit VLC installation and vice versa. Just guessing if it could be that VLCJ finds a incorrect version of vlc and then throws an error..just guessi... |
45,881,054 | i'm try to create media player for clients using vlcj with out need to install VLC in their PCs, from VLC.
i take this code from official site of VLC it work fine until i add EmbeddedMediaPlayerComponent() it get error
when i use
>
> new NativeDiscovery().discover();
>
>
>
it work fine because i installed VLC ... | 2017/08/25 | [
"https://Stackoverflow.com/questions/45881054",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7773867/"
] | I observed this issue with VLCJ - 3.10.1, JNA 4.1 combination.
I solved it by adding JNA 4.2 in my pom.xml file.
```
<dependency>
<groupId>uk.co.caprica</groupId>
<artifactId>vlcj</artifactId>
<version>3.10.1</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna... | Since I don't have comment privileges...
Is it possible you have more then 1 VLC installation installed?
The reason for asking is that a 64bit jdk/jre is not able to use a 32bit VLC installation and vice versa. Just guessing if it could be that VLCJ finds a incorrect version of vlc and then throws an error..just guessi... |
57,502,446 | WHen I use the AWS Toolkit in Visual Studio, I get the option of "Container type", but that list only contains Windows:
[](https://i.stack.imgur.com/AFrIR.png)
Can this be worked around somehow, so I get the full backing of Beanstalk, but I want it r... | 2019/08/14 | [
"https://Stackoverflow.com/questions/57502446",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/178143/"
] | Currently there is not a Linux .NET Core offering for the Elastic Beanstalk service. The the easiest way to deploy an ASP.NET Core application to Linux from Visual Studio is as a Docker application to AWS Fargate.
In Visual Studio if you right click on the project and select Add -> Docker Support to have Visual Studio... | In linux environments you can use AWS CLI applications to every AWS Service. In your case you can use [AWS EB CLI](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3.html).
**Tip**: Create your default environment on AWS Console and then use only the *eb deploy* command to deploy your application. It's les... |
73,062 | The text reads: "וישלחהו ה' אלהים מגן עדן לעבד את האדמה אשר לקח משם"
"And Hashem God banished him from the garden of Eden to work the ground from which he was taken"
Why does it only say "ישלחהו" "banished him" and not "ישלחם" "banished them", since the woman was banished as well (as far as I know)? Is there any sig... | 2016/06/15 | [
"https://judaism.stackexchange.com/questions/73062",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/9231/"
] | The most straightforward reading of the passuk is most likely "And Hashem God banished him (Adam) from Gan Eden to work the ground from which he (Adam) was taken" and, as can easily be inferred, Chavah as well, though she was neither to work the ground nor taken from the ground. Why it specifies Adam specifically? Who ... | Adam is tzurah, Chava is chomer. The chet etz hadaas was to split the hashpaah of tzurah and chomer so each became destructive in its own right, es hakruvim (chomer) vees lahat hacherev (tzurah).
Adam (super tzurah) now needs to serve the earth to reconnect himself to chomer.
Chava (super chomer) now needs pain in ch... |
73,062 | The text reads: "וישלחהו ה' אלהים מגן עדן לעבד את האדמה אשר לקח משם"
"And Hashem God banished him from the garden of Eden to work the ground from which he was taken"
Why does it only say "ישלחהו" "banished him" and not "ישלחם" "banished them", since the woman was banished as well (as far as I know)? Is there any sig... | 2016/06/15 | [
"https://judaism.stackexchange.com/questions/73062",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/9231/"
] | The most straightforward reading of the passuk is most likely "And Hashem God banished him (Adam) from Gan Eden to work the ground from which he (Adam) was taken" and, as can easily be inferred, Chavah as well, though she was neither to work the ground nor taken from the ground. Why it specifies Adam specifically? Who ... | If you see the previous verse (22), it is obviously a statement about mankind. Mor, you can see that the verse 22 states "האדם".
G-d chase away mankind from Garden of Eden. |
73,062 | The text reads: "וישלחהו ה' אלהים מגן עדן לעבד את האדמה אשר לקח משם"
"And Hashem God banished him from the garden of Eden to work the ground from which he was taken"
Why does it only say "ישלחהו" "banished him" and not "ישלחם" "banished them", since the woman was banished as well (as far as I know)? Is there any sig... | 2016/06/15 | [
"https://judaism.stackexchange.com/questions/73062",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/9231/"
] | The most straightforward reading of the passuk is most likely "And Hashem God banished him (Adam) from Gan Eden to work the ground from which he (Adam) was taken" and, as can easily be inferred, Chavah as well, though she was neither to work the ground nor taken from the ground. Why it specifies Adam specifically? Who ... | Although none of the following point out the singular use of the word the way you did, Radak, Vilna Gaon in Aderes Eliyahu and Rabbi Hirsch all see this passuk as a sharp slap to Adam specifically.
The wording in the passuk points out his failure in his great mission in Gan Eden and his return to his original place o... |
73,062 | The text reads: "וישלחהו ה' אלהים מגן עדן לעבד את האדמה אשר לקח משם"
"And Hashem God banished him from the garden of Eden to work the ground from which he was taken"
Why does it only say "ישלחהו" "banished him" and not "ישלחם" "banished them", since the woman was banished as well (as far as I know)? Is there any sig... | 2016/06/15 | [
"https://judaism.stackexchange.com/questions/73062",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/9231/"
] | If you see the previous verse (22), it is obviously a statement about mankind. Mor, you can see that the verse 22 states "האדם".
G-d chase away mankind from Garden of Eden. | Adam is tzurah, Chava is chomer. The chet etz hadaas was to split the hashpaah of tzurah and chomer so each became destructive in its own right, es hakruvim (chomer) vees lahat hacherev (tzurah).
Adam (super tzurah) now needs to serve the earth to reconnect himself to chomer.
Chava (super chomer) now needs pain in ch... |
73,062 | The text reads: "וישלחהו ה' אלהים מגן עדן לעבד את האדמה אשר לקח משם"
"And Hashem God banished him from the garden of Eden to work the ground from which he was taken"
Why does it only say "ישלחהו" "banished him" and not "ישלחם" "banished them", since the woman was banished as well (as far as I know)? Is there any sig... | 2016/06/15 | [
"https://judaism.stackexchange.com/questions/73062",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/9231/"
] | Although none of the following point out the singular use of the word the way you did, Radak, Vilna Gaon in Aderes Eliyahu and Rabbi Hirsch all see this passuk as a sharp slap to Adam specifically.
The wording in the passuk points out his failure in his great mission in Gan Eden and his return to his original place o... | Adam is tzurah, Chava is chomer. The chet etz hadaas was to split the hashpaah of tzurah and chomer so each became destructive in its own right, es hakruvim (chomer) vees lahat hacherev (tzurah).
Adam (super tzurah) now needs to serve the earth to reconnect himself to chomer.
Chava (super chomer) now needs pain in ch... |
779 | I have been building Joomla extensions since v1 but I soon need to take an API live that I have built and have been using for a while. Currently I am using Joomla 2.5 and have written plugins for this system:
<https://github.com/techjoomla/com_api>
Before going live I would like to future proof the system as much as ... | 2014/05/12 | [
"https://joomla.stackexchange.com/questions/779",
"https://joomla.stackexchange.com",
"https://joomla.stackexchange.com/users/218/"
] | From my experience:
**About Joomla framework**
I tried to build a simple RESTful API for integrated authentication based on Joomla framework. It's fairly complex, quite different than the current Joomla API. Also, current source code can't be copy-pasted, and libraries may return unexpected results (being executed in... | My two cents:
For a customer I needed to access the contents of his joomla site from a smartphone app. The contents were placed in com\_content so initially I used obRSS feeds. Then I found jBackend on JED and tried it. It is available here <http://www.selfget.com/products/jbackend.html>
The code seems very clean and ... |
779 | I have been building Joomla extensions since v1 but I soon need to take an API live that I have built and have been using for a while. Currently I am using Joomla 2.5 and have written plugins for this system:
<https://github.com/techjoomla/com_api>
Before going live I would like to future proof the system as much as ... | 2014/05/12 | [
"https://joomla.stackexchange.com/questions/779",
"https://joomla.stackexchange.com",
"https://joomla.stackexchange.com/users/218/"
] | From my experience:
**About Joomla framework**
I tried to build a simple RESTful API for integrated authentication based on Joomla framework. It's fairly complex, quite different than the current Joomla API. Also, current source code can't be copy-pasted, and libraries may return unexpected results (being executed in... | The following site seems to be an excellent resource for guidelines on how to build a RESTful JSON API:
<http://jsonapi.org/>
For what it's worth, I am also launching an API product for Joomla 3.4.x called cAPI <http://getcapi.org>.
The primary differentiator here is that I staked my routing framework on Slim micro... |
779 | I have been building Joomla extensions since v1 but I soon need to take an API live that I have built and have been using for a while. Currently I am using Joomla 2.5 and have written plugins for this system:
<https://github.com/techjoomla/com_api>
Before going live I would like to future proof the system as much as ... | 2014/05/12 | [
"https://joomla.stackexchange.com/questions/779",
"https://joomla.stackexchange.com",
"https://joomla.stackexchange.com/users/218/"
] | com\_api is definitely a good way to build REST services for your site if the extension itself is not based on FOF/RAD. However be careful with a few gotchas if you plan to create a separate Joomla instance only for the API
* Domain specific stuff (Eg: If you are supporting user registration, then the welcome email wo... | My two cents:
For a customer I needed to access the contents of his joomla site from a smartphone app. The contents were placed in com\_content so initially I used obRSS feeds. Then I found jBackend on JED and tried it. It is available here <http://www.selfget.com/products/jbackend.html>
The code seems very clean and ... |
779 | I have been building Joomla extensions since v1 but I soon need to take an API live that I have built and have been using for a while. Currently I am using Joomla 2.5 and have written plugins for this system:
<https://github.com/techjoomla/com_api>
Before going live I would like to future proof the system as much as ... | 2014/05/12 | [
"https://joomla.stackexchange.com/questions/779",
"https://joomla.stackexchange.com",
"https://joomla.stackexchange.com/users/218/"
] | com\_api is definitely a good way to build REST services for your site if the extension itself is not based on FOF/RAD. However be careful with a few gotchas if you plan to create a separate Joomla instance only for the API
* Domain specific stuff (Eg: If you are supporting user registration, then the welcome email wo... | The following site seems to be an excellent resource for guidelines on how to build a RESTful JSON API:
<http://jsonapi.org/>
For what it's worth, I am also launching an API product for Joomla 3.4.x called cAPI <http://getcapi.org>.
The primary differentiator here is that I staked my routing framework on Slim micro... |
779 | I have been building Joomla extensions since v1 but I soon need to take an API live that I have built and have been using for a while. Currently I am using Joomla 2.5 and have written plugins for this system:
<https://github.com/techjoomla/com_api>
Before going live I would like to future proof the system as much as ... | 2014/05/12 | [
"https://joomla.stackexchange.com/questions/779",
"https://joomla.stackexchange.com",
"https://joomla.stackexchange.com/users/218/"
] | My two cents:
For a customer I needed to access the contents of his joomla site from a smartphone app. The contents were placed in com\_content so initially I used obRSS feeds. Then I found jBackend on JED and tried it. It is available here <http://www.selfget.com/products/jbackend.html>
The code seems very clean and ... | The following site seems to be an excellent resource for guidelines on how to build a RESTful JSON API:
<http://jsonapi.org/>
For what it's worth, I am also launching an API product for Joomla 3.4.x called cAPI <http://getcapi.org>.
The primary differentiator here is that I staked my routing framework on Slim micro... |
50,784,420 | like so
```
► add language identifier to highlight code
```python
def function(foo):
print(foo)
```
► put returns between paragraphs
► for linebreak add 2 spaces at end
► *italic* or **bold**
► indent code by 4 spaces
► backtick escapes `like _so_`
► quote by placing > at start of line
► to make links (us... | 2018/06/10 | [
"https://Stackoverflow.com/questions/50784420",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You can do it using flask, example app.py
```
from flask import Flask, render_template
app = Flask(__name__)
random_message = "some random message"
@app.route("/")
def main():
return render_template(["index.html"], value=random_message)
if __name__ == '__main__':
app.run(debug=True)
```
create a director... | Use flask it will render you message to to HTML file its is a Python micro framework |
51,359 | I am not quite understanding why Hisoka tried to kill all Phantom Troupe member after he lost to its leader, Chrollo Lucifer. That fight, Chrollo vs Hisoka, I think is reasonable because Hisoka always intended to beat a person that more powerful than himself,
>
> but in the end he lost and was also confirmed dead by... | 2019/04/02 | [
"https://anime.stackexchange.com/questions/51359",
"https://anime.stackexchange.com",
"https://anime.stackexchange.com/users/35019/"
] | The thing is, it's quite hard to interpret or understand Hisoka's motives. So, as to the reason behind Hisoka's seemingly abrupt decision to kill or hunt down all Phantom Troupe members, **we don't know yet as of now unless it will be revealed in upcoming chapters**. **Chapter 357** also surprised me as his decision wa... | It's because hisoka fought chrollo and chrollo used the phantom troupes powers to aid him in the fight, so he's going to kill them all in order to have a fair fight with chrollo.
because killing the user removes the ability from chrollo's book. |
51,359 | I am not quite understanding why Hisoka tried to kill all Phantom Troupe member after he lost to its leader, Chrollo Lucifer. That fight, Chrollo vs Hisoka, I think is reasonable because Hisoka always intended to beat a person that more powerful than himself,
>
> but in the end he lost and was also confirmed dead by... | 2019/04/02 | [
"https://anime.stackexchange.com/questions/51359",
"https://anime.stackexchange.com",
"https://anime.stackexchange.com/users/35019/"
] | The thing is, it's quite hard to interpret or understand Hisoka's motives. So, as to the reason behind Hisoka's seemingly abrupt decision to kill or hunt down all Phantom Troupe members, **we don't know yet as of now unless it will be revealed in upcoming chapters**. **Chapter 357** also surprised me as his decision wa... | In my opinion its because, whenever Hisoka was fighting with Chrollo, he was actually 1(Hisoka) vs 4(Chrollo, Machi, Shalnark, Kortopi). And it is obviously unfair matchup. I found this video very helpful explaining hisoka reason to kill every troupe.
Part1: <https://www.youtube.com/watch?v=-Km6l5gRXuY>
Part2: <https... |
51,359 | I am not quite understanding why Hisoka tried to kill all Phantom Troupe member after he lost to its leader, Chrollo Lucifer. That fight, Chrollo vs Hisoka, I think is reasonable because Hisoka always intended to beat a person that more powerful than himself,
>
> but in the end he lost and was also confirmed dead by... | 2019/04/02 | [
"https://anime.stackexchange.com/questions/51359",
"https://anime.stackexchange.com",
"https://anime.stackexchange.com/users/35019/"
] | The thing is, it's quite hard to interpret or understand Hisoka's motives. So, as to the reason behind Hisoka's seemingly abrupt decision to kill or hunt down all Phantom Troupe members, **we don't know yet as of now unless it will be revealed in upcoming chapters**. **Chapter 357** also surprised me as his decision wa... | probably hisoka realized that lying in wait made him become rusty. Evidence is that when he fought chrollo, the latter showed off his offensive strategies, while the former observed in amazement. After his rebirth, hisoka considers he might have caused his own loss and swears to become a new person entirely. |
51,359 | I am not quite understanding why Hisoka tried to kill all Phantom Troupe member after he lost to its leader, Chrollo Lucifer. That fight, Chrollo vs Hisoka, I think is reasonable because Hisoka always intended to beat a person that more powerful than himself,
>
> but in the end he lost and was also confirmed dead by... | 2019/04/02 | [
"https://anime.stackexchange.com/questions/51359",
"https://anime.stackexchange.com",
"https://anime.stackexchange.com/users/35019/"
] | The thing is, it's quite hard to interpret or understand Hisoka's motives. So, as to the reason behind Hisoka's seemingly abrupt decision to kill or hunt down all Phantom Troupe members, **we don't know yet as of now unless it will be revealed in upcoming chapters**. **Chapter 357** also surprised me as his decision wa... | From the first instance where we learned that Hisoka was trying to fight the leader of the Phantom Troupe Chrollo Lucifer, one of the major obstacles in his path were the other members of the Phantom troupe, several of whom were formidable nen users, and some are at least comparable to Hisoka's combat abilities. If His... |
51,359 | I am not quite understanding why Hisoka tried to kill all Phantom Troupe member after he lost to its leader, Chrollo Lucifer. That fight, Chrollo vs Hisoka, I think is reasonable because Hisoka always intended to beat a person that more powerful than himself,
>
> but in the end he lost and was also confirmed dead by... | 2019/04/02 | [
"https://anime.stackexchange.com/questions/51359",
"https://anime.stackexchange.com",
"https://anime.stackexchange.com/users/35019/"
] | It's because hisoka fought chrollo and chrollo used the phantom troupes powers to aid him in the fight, so he's going to kill them all in order to have a fair fight with chrollo.
because killing the user removes the ability from chrollo's book. | In my opinion its because, whenever Hisoka was fighting with Chrollo, he was actually 1(Hisoka) vs 4(Chrollo, Machi, Shalnark, Kortopi). And it is obviously unfair matchup. I found this video very helpful explaining hisoka reason to kill every troupe.
Part1: <https://www.youtube.com/watch?v=-Km6l5gRXuY>
Part2: <https... |
51,359 | I am not quite understanding why Hisoka tried to kill all Phantom Troupe member after he lost to its leader, Chrollo Lucifer. That fight, Chrollo vs Hisoka, I think is reasonable because Hisoka always intended to beat a person that more powerful than himself,
>
> but in the end he lost and was also confirmed dead by... | 2019/04/02 | [
"https://anime.stackexchange.com/questions/51359",
"https://anime.stackexchange.com",
"https://anime.stackexchange.com/users/35019/"
] | From the first instance where we learned that Hisoka was trying to fight the leader of the Phantom Troupe Chrollo Lucifer, one of the major obstacles in his path were the other members of the Phantom troupe, several of whom were formidable nen users, and some are at least comparable to Hisoka's combat abilities. If His... | It's because hisoka fought chrollo and chrollo used the phantom troupes powers to aid him in the fight, so he's going to kill them all in order to have a fair fight with chrollo.
because killing the user removes the ability from chrollo's book. |
51,359 | I am not quite understanding why Hisoka tried to kill all Phantom Troupe member after he lost to its leader, Chrollo Lucifer. That fight, Chrollo vs Hisoka, I think is reasonable because Hisoka always intended to beat a person that more powerful than himself,
>
> but in the end he lost and was also confirmed dead by... | 2019/04/02 | [
"https://anime.stackexchange.com/questions/51359",
"https://anime.stackexchange.com",
"https://anime.stackexchange.com/users/35019/"
] | probably hisoka realized that lying in wait made him become rusty. Evidence is that when he fought chrollo, the latter showed off his offensive strategies, while the former observed in amazement. After his rebirth, hisoka considers he might have caused his own loss and swears to become a new person entirely. | In my opinion its because, whenever Hisoka was fighting with Chrollo, he was actually 1(Hisoka) vs 4(Chrollo, Machi, Shalnark, Kortopi). And it is obviously unfair matchup. I found this video very helpful explaining hisoka reason to kill every troupe.
Part1: <https://www.youtube.com/watch?v=-Km6l5gRXuY>
Part2: <https... |
51,359 | I am not quite understanding why Hisoka tried to kill all Phantom Troupe member after he lost to its leader, Chrollo Lucifer. That fight, Chrollo vs Hisoka, I think is reasonable because Hisoka always intended to beat a person that more powerful than himself,
>
> but in the end he lost and was also confirmed dead by... | 2019/04/02 | [
"https://anime.stackexchange.com/questions/51359",
"https://anime.stackexchange.com",
"https://anime.stackexchange.com/users/35019/"
] | From the first instance where we learned that Hisoka was trying to fight the leader of the Phantom Troupe Chrollo Lucifer, one of the major obstacles in his path were the other members of the Phantom troupe, several of whom were formidable nen users, and some are at least comparable to Hisoka's combat abilities. If His... | In my opinion its because, whenever Hisoka was fighting with Chrollo, he was actually 1(Hisoka) vs 4(Chrollo, Machi, Shalnark, Kortopi). And it is obviously unfair matchup. I found this video very helpful explaining hisoka reason to kill every troupe.
Part1: <https://www.youtube.com/watch?v=-Km6l5gRXuY>
Part2: <https... |
51,359 | I am not quite understanding why Hisoka tried to kill all Phantom Troupe member after he lost to its leader, Chrollo Lucifer. That fight, Chrollo vs Hisoka, I think is reasonable because Hisoka always intended to beat a person that more powerful than himself,
>
> but in the end he lost and was also confirmed dead by... | 2019/04/02 | [
"https://anime.stackexchange.com/questions/51359",
"https://anime.stackexchange.com",
"https://anime.stackexchange.com/users/35019/"
] | From the first instance where we learned that Hisoka was trying to fight the leader of the Phantom Troupe Chrollo Lucifer, one of the major obstacles in his path were the other members of the Phantom troupe, several of whom were formidable nen users, and some are at least comparable to Hisoka's combat abilities. If His... | probably hisoka realized that lying in wait made him become rusty. Evidence is that when he fought chrollo, the latter showed off his offensive strategies, while the former observed in amazement. After his rebirth, hisoka considers he might have caused his own loss and swears to become a new person entirely. |
26,276,154 | I am working on an event management project, I need to get upcoming event from database, can anyone help me ?
I am using
```
SELECT *FROM EVENTS WHERE DATE_ADD(event_date, INTERVAL YEAR(CURDATE())-YEAR(event_date) YEAR)
BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 7 DAY) LIMIT 1;
```
But it gives ... | 2014/10/09 | [
"https://Stackoverflow.com/questions/26276154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3736676/"
] | Isn't this a simple where clause comparing with current date
```
SELECT *
FROM EVENTS
WHERE event_date > CURDATE()
ORDER BY event_date
LIMIT 1;
``` | Wouldn't this work?
```
SELECT * FROM EVENTS WHERE event_date > CURDATE() ORDER BY event_date ASC LIMIT 1;
``` |
26,276,154 | I am working on an event management project, I need to get upcoming event from database, can anyone help me ?
I am using
```
SELECT *FROM EVENTS WHERE DATE_ADD(event_date, INTERVAL YEAR(CURDATE())-YEAR(event_date) YEAR)
BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 7 DAY) LIMIT 1;
```
But it gives ... | 2014/10/09 | [
"https://Stackoverflow.com/questions/26276154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3736676/"
] | Wouldn't this work?
```
SELECT * FROM EVENTS WHERE event_date > CURDATE() ORDER BY event_date ASC LIMIT 1;
``` | try
If column type `datetime` you can use `CURDATE()`(mysql function) or `date()`(php function)
```
"SELECT *FROM EVENTS WHERE event_date > '".date('Y-m-d H:i:s')."' ORDER BY event_date limit 1"
```
or
```
"SELECT *FROM EVENTS WHERE event_date > CURDATE() ORDER BY event_date limit 1"
```
If column type `dat... |
26,276,154 | I am working on an event management project, I need to get upcoming event from database, can anyone help me ?
I am using
```
SELECT *FROM EVENTS WHERE DATE_ADD(event_date, INTERVAL YEAR(CURDATE())-YEAR(event_date) YEAR)
BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 7 DAY) LIMIT 1;
```
But it gives ... | 2014/10/09 | [
"https://Stackoverflow.com/questions/26276154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3736676/"
] | Wouldn't this work?
```
SELECT * FROM EVENTS WHERE event_date > CURDATE() ORDER BY event_date ASC LIMIT 1;
``` | thank you everyone,
I got the answer:
```
SELECT * FROM EVENTS
WHERE event_date > CURDATE()
ORDER BY event_date ASC LIMIT 1;
``` |
26,276,154 | I am working on an event management project, I need to get upcoming event from database, can anyone help me ?
I am using
```
SELECT *FROM EVENTS WHERE DATE_ADD(event_date, INTERVAL YEAR(CURDATE())-YEAR(event_date) YEAR)
BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 7 DAY) LIMIT 1;
```
But it gives ... | 2014/10/09 | [
"https://Stackoverflow.com/questions/26276154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3736676/"
] | Wouldn't this work?
```
SELECT * FROM EVENTS WHERE event_date > CURDATE() ORDER BY event_date ASC LIMIT 1;
``` | try below it works perfectly fine
```
select * from table where start_time between NOW() AND DATE_ADD(NOW(), INTERVAL 7 DAY)
```
you can use like this to get next 7 days data or in case you want last 7 days then instead of DATE\_ADD USE DATE\_SUB It will work or you can use like
```
start_time between NOW() AND DA... |
26,276,154 | I am working on an event management project, I need to get upcoming event from database, can anyone help me ?
I am using
```
SELECT *FROM EVENTS WHERE DATE_ADD(event_date, INTERVAL YEAR(CURDATE())-YEAR(event_date) YEAR)
BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 7 DAY) LIMIT 1;
```
But it gives ... | 2014/10/09 | [
"https://Stackoverflow.com/questions/26276154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3736676/"
] | Isn't this a simple where clause comparing with current date
```
SELECT *
FROM EVENTS
WHERE event_date > CURDATE()
ORDER BY event_date
LIMIT 1;
``` | try
If column type `datetime` you can use `CURDATE()`(mysql function) or `date()`(php function)
```
"SELECT *FROM EVENTS WHERE event_date > '".date('Y-m-d H:i:s')."' ORDER BY event_date limit 1"
```
or
```
"SELECT *FROM EVENTS WHERE event_date > CURDATE() ORDER BY event_date limit 1"
```
If column type `dat... |
26,276,154 | I am working on an event management project, I need to get upcoming event from database, can anyone help me ?
I am using
```
SELECT *FROM EVENTS WHERE DATE_ADD(event_date, INTERVAL YEAR(CURDATE())-YEAR(event_date) YEAR)
BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 7 DAY) LIMIT 1;
```
But it gives ... | 2014/10/09 | [
"https://Stackoverflow.com/questions/26276154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3736676/"
] | Isn't this a simple where clause comparing with current date
```
SELECT *
FROM EVENTS
WHERE event_date > CURDATE()
ORDER BY event_date
LIMIT 1;
``` | thank you everyone,
I got the answer:
```
SELECT * FROM EVENTS
WHERE event_date > CURDATE()
ORDER BY event_date ASC LIMIT 1;
``` |
26,276,154 | I am working on an event management project, I need to get upcoming event from database, can anyone help me ?
I am using
```
SELECT *FROM EVENTS WHERE DATE_ADD(event_date, INTERVAL YEAR(CURDATE())-YEAR(event_date) YEAR)
BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 7 DAY) LIMIT 1;
```
But it gives ... | 2014/10/09 | [
"https://Stackoverflow.com/questions/26276154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3736676/"
] | Isn't this a simple where clause comparing with current date
```
SELECT *
FROM EVENTS
WHERE event_date > CURDATE()
ORDER BY event_date
LIMIT 1;
``` | try below it works perfectly fine
```
select * from table where start_time between NOW() AND DATE_ADD(NOW(), INTERVAL 7 DAY)
```
you can use like this to get next 7 days data or in case you want last 7 days then instead of DATE\_ADD USE DATE\_SUB It will work or you can use like
```
start_time between NOW() AND DA... |
26,276,154 | I am working on an event management project, I need to get upcoming event from database, can anyone help me ?
I am using
```
SELECT *FROM EVENTS WHERE DATE_ADD(event_date, INTERVAL YEAR(CURDATE())-YEAR(event_date) YEAR)
BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 7 DAY) LIMIT 1;
```
But it gives ... | 2014/10/09 | [
"https://Stackoverflow.com/questions/26276154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3736676/"
] | try
If column type `datetime` you can use `CURDATE()`(mysql function) or `date()`(php function)
```
"SELECT *FROM EVENTS WHERE event_date > '".date('Y-m-d H:i:s')."' ORDER BY event_date limit 1"
```
or
```
"SELECT *FROM EVENTS WHERE event_date > CURDATE() ORDER BY event_date limit 1"
```
If column type `dat... | thank you everyone,
I got the answer:
```
SELECT * FROM EVENTS
WHERE event_date > CURDATE()
ORDER BY event_date ASC LIMIT 1;
``` |
26,276,154 | I am working on an event management project, I need to get upcoming event from database, can anyone help me ?
I am using
```
SELECT *FROM EVENTS WHERE DATE_ADD(event_date, INTERVAL YEAR(CURDATE())-YEAR(event_date) YEAR)
BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 7 DAY) LIMIT 1;
```
But it gives ... | 2014/10/09 | [
"https://Stackoverflow.com/questions/26276154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3736676/"
] | try below it works perfectly fine
```
select * from table where start_time between NOW() AND DATE_ADD(NOW(), INTERVAL 7 DAY)
```
you can use like this to get next 7 days data or in case you want last 7 days then instead of DATE\_ADD USE DATE\_SUB It will work or you can use like
```
start_time between NOW() AND DA... | thank you everyone,
I got the answer:
```
SELECT * FROM EVENTS
WHERE event_date > CURDATE()
ORDER BY event_date ASC LIMIT 1;
``` |
40,724 | I live in Maine and am planning to insulate my basement. It has fairly smooth poured concrete walls. I've read online that spray foam is one option, and 2" of XPS directly against the wall is another option.
I was at Home Depot today, and a salesperson there told me that he would leave a 1" gap between the wall and th... | 2014/04/05 | [
"https://diy.stackexchange.com/questions/40724",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/12346/"
] | It doesn't make sense to me at all. Yes adding a one inch gap does add R value as does any dead space - but then why not a 20 inch gap?
Also I am not sure how you install xps with a one inch gap. Of course your could add furring strips and then you still have to fire block. Wow that is just tons of work.
Why would h... | Adding a 1" gap behind the XPS creates a dead air space that adds to the R value of the overall insulation. This is a standard recommendation with sheet foam insulation. It does assume that you have a good seal at all joints.
If you have a moisture seepage problem, this doesn't add to it. if the walls are damp, they a... |
40,724 | I live in Maine and am planning to insulate my basement. It has fairly smooth poured concrete walls. I've read online that spray foam is one option, and 2" of XPS directly against the wall is another option.
I was at Home Depot today, and a salesperson there told me that he would leave a 1" gap between the wall and th... | 2014/04/05 | [
"https://diy.stackexchange.com/questions/40724",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/12346/"
] | Adding a 1" gap behind the XPS creates a dead air space that adds to the R value of the overall insulation. This is a standard recommendation with sheet foam insulation. It does assume that you have a good seal at all joints.
If you have a moisture seepage problem, this doesn't add to it. if the walls are damp, they a... | The reason to attach it directly to the wall is to try and make sure the surface of the wall doesn't have air contact for condensation. This works perfectly with spray foam (one of the big advantages) but of course, this is impossible to do with sheet foam as no concrete wall is 100% flat. So whether you have a 1mm gap... |
40,724 | I live in Maine and am planning to insulate my basement. It has fairly smooth poured concrete walls. I've read online that spray foam is one option, and 2" of XPS directly against the wall is another option.
I was at Home Depot today, and a salesperson there told me that he would leave a 1" gap between the wall and th... | 2014/04/05 | [
"https://diy.stackexchange.com/questions/40724",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/12346/"
] | It doesn't make sense to me at all. Yes adding a one inch gap does add R value as does any dead space - but then why not a 20 inch gap?
Also I am not sure how you install xps with a one inch gap. Of course your could add furring strips and then you still have to fire block. Wow that is just tons of work.
Why would h... | The reason to attach it directly to the wall is to try and make sure the surface of the wall doesn't have air contact for condensation. This works perfectly with spray foam (one of the big advantages) but of course, this is impossible to do with sheet foam as no concrete wall is 100% flat. So whether you have a 1mm gap... |
32,940,555 | I'm having trouble with a single table inheritence (STI) data model where a model can be one of the types OR both. I can add a third type, which would be something like `TradingCompanyClearingMember` but then I need to duplicate code from both models into the 3rd. Where this becomes especially difficult is defining pol... | 2015/10/05 | [
"https://Stackoverflow.com/questions/32940555",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3233810/"
] | The closest thing ruby has to multiple inheritance is mixing in modules. You might be able to put the TradingCompany code into a TradingCompanyModule which you import into both trading company type classes. But I think you're probably better served making Company have one TradingCompany and one ClearingMember instead o... | You can create a concerns module and include it the models you require it.
```
module Trader
extend ActiveSupport::Concern
has_many :trading_companies
end
class TradingCompanyAndClearingMember < Company
include Trader
end
class ClearingMember < Company
include Trader
end
``` |
18,182,211 | i have very weird problem. If i put style or script tag on page, the browser sees them as html elements. In other words they are displayed, printed on page physically. Bottom code is shown in browser, on page, when i start my project. Any suggestions?
, but on many browsers, this can be changed with CSS. It’s normally not useful, but... | Validate your page for unclosed tags: <http://validator.w3.org/> |
18,182,211 | i have very weird problem. If i put style or script tag on page, the browser sees them as html elements. In other words they are displayed, printed on page physically. Bottom code is shown in browser, on page, when i start my project. Any suggestions?
, but on many browsers, this can be changed with CSS. It’s normally not useful, but... | Just manually add inline `display: none` to those tags.
That would make it work.
Like, make your `<script>` like this:
```
<script type="text/javascript" style="display: none">
//Some JS here
</script>
```
and `<style>` as
```
<style type="text/css" style="display: none">
/* Some CSS */
</style>
```
Work... |
170,632 | Ruby by default does not include the method `[]` for `NilClass`
For example, to check if `foo["bar"]` exists when `foo` may be nil, I have to do:
```
foo = something_that_may_or_may_not_return_nil
if foo && foo["bar"]
# do something with foo["bar"] here
end
```
If I define this method:
```
class NilClass
def [... | 2012/10/19 | [
"https://softwareengineering.stackexchange.com/questions/170632",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/69408/"
] | If this is for a specific condition, and I suspect it is, then delegate the behavior. Check that the object is defined, and then check if it is nil, and work accordingly.
It will preserve the expected behavior in core, and give you the specific changed behavior when you want it.
If later you need to modify the behavi... | I wrote a gem designed for just this case. I came across this question when looking for a solution, so I thought I'd post here on what I ended up with.
Them gem is called Dottie and is available at <https://github.com/nickpearson/dottie>.
Here's a quick sample of how it's designed to be used:
```
car = {
'type' =>... |
170,632 | Ruby by default does not include the method `[]` for `NilClass`
For example, to check if `foo["bar"]` exists when `foo` may be nil, I have to do:
```
foo = something_that_may_or_may_not_return_nil
if foo && foo["bar"]
# do something with foo["bar"] here
end
```
If I define this method:
```
class NilClass
def [... | 2012/10/19 | [
"https://softwareengineering.stackexchange.com/questions/170632",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/69408/"
] | In some ruby code that I've had to tweak, I have added isFalse or something of that nature to the nil object to make some parts be not unhappy with each other.
Open classes are not my favorite thing and making such a change to the nil class is not a small change. It is a significant change because it can change the en... | I wrote a gem designed for just this case. I came across this question when looking for a solution, so I thought I'd post here on what I ended up with.
Them gem is called Dottie and is available at <https://github.com/nickpearson/dottie>.
Here's a quick sample of how it's designed to be used:
```
car = {
'type' =>... |
170,632 | Ruby by default does not include the method `[]` for `NilClass`
For example, to check if `foo["bar"]` exists when `foo` may be nil, I have to do:
```
foo = something_that_may_or_may_not_return_nil
if foo && foo["bar"]
# do something with foo["bar"] here
end
```
If I define this method:
```
class NilClass
def [... | 2012/10/19 | [
"https://softwareengineering.stackexchange.com/questions/170632",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/69408/"
] | In some ruby code that I've had to tweak, I have added isFalse or something of that nature to the nil object to make some parts be not unhappy with each other.
Open classes are not my favorite thing and making such a change to the nil class is not a small change. It is a significant change because it can change the en... | I'd recommend you use [Hash#fetch](http://www.ruby-doc.org/core-1.9.3/Hash.html#method-i-fetch) to access hash entries when you're unsure they'll be present. This way if the requested key is not found you'll get a `KeyError` which you can handle appropriately. When you blindly access nonexistent keys you get subtly con... |
170,632 | Ruby by default does not include the method `[]` for `NilClass`
For example, to check if `foo["bar"]` exists when `foo` may be nil, I have to do:
```
foo = something_that_may_or_may_not_return_nil
if foo && foo["bar"]
# do something with foo["bar"] here
end
```
If I define this method:
```
class NilClass
def [... | 2012/10/19 | [
"https://softwareengineering.stackexchange.com/questions/170632",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/69408/"
] | Why does `something_that_may_or_may_not_return_nil` have to return `nil`? And if you don't want to change that method, just wrap it in another method that returns an empty hash if the wrapped method returns `nil`.
As for nesting, you can use `Hash`'s `default_proc` to return empty hashes when a key isn't found:
```
#... | I wrote a gem designed for just this case. I came across this question when looking for a solution, so I thought I'd post here on what I ended up with.
Them gem is called Dottie and is available at <https://github.com/nickpearson/dottie>.
Here's a quick sample of how it's designed to be used:
```
car = {
'type' =>... |
170,632 | Ruby by default does not include the method `[]` for `NilClass`
For example, to check if `foo["bar"]` exists when `foo` may be nil, I have to do:
```
foo = something_that_may_or_may_not_return_nil
if foo && foo["bar"]
# do something with foo["bar"] here
end
```
If I define this method:
```
class NilClass
def [... | 2012/10/19 | [
"https://softwareengineering.stackexchange.com/questions/170632",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/69408/"
] | Nullable values must be addressed carefully, it's not the same a variable that always has a certain type than other which sometimes has this type, sometimes is null. Functional languages are usually the most careful on this regard and they have custom types to manage it (`Maybe` in Haskell, `Option` in Ocaml/F#/Scala, ... | I wrote a gem designed for just this case. I came across this question when looking for a solution, so I thought I'd post here on what I ended up with.
Them gem is called Dottie and is available at <https://github.com/nickpearson/dottie>.
Here's a quick sample of how it's designed to be used:
```
car = {
'type' =>... |
170,632 | Ruby by default does not include the method `[]` for `NilClass`
For example, to check if `foo["bar"]` exists when `foo` may be nil, I have to do:
```
foo = something_that_may_or_may_not_return_nil
if foo && foo["bar"]
# do something with foo["bar"] here
end
```
If I define this method:
```
class NilClass
def [... | 2012/10/19 | [
"https://softwareengineering.stackexchange.com/questions/170632",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/69408/"
] | If this is for a specific condition, and I suspect it is, then delegate the behavior. Check that the object is defined, and then check if it is nil, and work accordingly.
It will preserve the expected behavior in core, and give you the specific changed behavior when you want it.
If later you need to modify the behavi... | I'd recommend you use [Hash#fetch](http://www.ruby-doc.org/core-1.9.3/Hash.html#method-i-fetch) to access hash entries when you're unsure they'll be present. This way if the requested key is not found you'll get a `KeyError` which you can handle appropriately. When you blindly access nonexistent keys you get subtly con... |
170,632 | Ruby by default does not include the method `[]` for `NilClass`
For example, to check if `foo["bar"]` exists when `foo` may be nil, I have to do:
```
foo = something_that_may_or_may_not_return_nil
if foo && foo["bar"]
# do something with foo["bar"] here
end
```
If I define this method:
```
class NilClass
def [... | 2012/10/19 | [
"https://softwareengineering.stackexchange.com/questions/170632",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/69408/"
] | Nullable values must be addressed carefully, it's not the same a variable that always has a certain type than other which sometimes has this type, sometimes is null. Functional languages are usually the most careful on this regard and they have custom types to manage it (`Maybe` in Haskell, `Option` in Ocaml/F#/Scala, ... | If this is for a specific condition, and I suspect it is, then delegate the behavior. Check that the object is defined, and then check if it is nil, and work accordingly.
It will preserve the expected behavior in core, and give you the specific changed behavior when you want it.
If later you need to modify the behavi... |
170,632 | Ruby by default does not include the method `[]` for `NilClass`
For example, to check if `foo["bar"]` exists when `foo` may be nil, I have to do:
```
foo = something_that_may_or_may_not_return_nil
if foo && foo["bar"]
# do something with foo["bar"] here
end
```
If I define this method:
```
class NilClass
def [... | 2012/10/19 | [
"https://softwareengineering.stackexchange.com/questions/170632",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/69408/"
] | Why does `something_that_may_or_may_not_return_nil` have to return `nil`? And if you don't want to change that method, just wrap it in another method that returns an empty hash if the wrapped method returns `nil`.
As for nesting, you can use `Hash`'s `default_proc` to return empty hashes when a key isn't found:
```
#... | I'd recommend you use [Hash#fetch](http://www.ruby-doc.org/core-1.9.3/Hash.html#method-i-fetch) to access hash entries when you're unsure they'll be present. This way if the requested key is not found you'll get a `KeyError` which you can handle appropriately. When you blindly access nonexistent keys you get subtly con... |
170,632 | Ruby by default does not include the method `[]` for `NilClass`
For example, to check if `foo["bar"]` exists when `foo` may be nil, I have to do:
```
foo = something_that_may_or_may_not_return_nil
if foo && foo["bar"]
# do something with foo["bar"] here
end
```
If I define this method:
```
class NilClass
def [... | 2012/10/19 | [
"https://softwareengineering.stackexchange.com/questions/170632",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/69408/"
] | Nullable values must be addressed carefully, it's not the same a variable that always has a certain type than other which sometimes has this type, sometimes is null. Functional languages are usually the most careful on this regard and they have custom types to manage it (`Maybe` in Haskell, `Option` in Ocaml/F#/Scala, ... | Why does `something_that_may_or_may_not_return_nil` have to return `nil`? And if you don't want to change that method, just wrap it in another method that returns an empty hash if the wrapped method returns `nil`.
As for nesting, you can use `Hash`'s `default_proc` to return empty hashes when a key isn't found:
```
#... |
170,632 | Ruby by default does not include the method `[]` for `NilClass`
For example, to check if `foo["bar"]` exists when `foo` may be nil, I have to do:
```
foo = something_that_may_or_may_not_return_nil
if foo && foo["bar"]
# do something with foo["bar"] here
end
```
If I define this method:
```
class NilClass
def [... | 2012/10/19 | [
"https://softwareengineering.stackexchange.com/questions/170632",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/69408/"
] | Nullable values must be addressed carefully, it's not the same a variable that always has a certain type than other which sometimes has this type, sometimes is null. Functional languages are usually the most careful on this regard and they have custom types to manage it (`Maybe` in Haskell, `Option` in Ocaml/F#/Scala, ... | In some ruby code that I've had to tweak, I have added isFalse or something of that nature to the nil object to make some parts be not unhappy with each other.
Open classes are not my favorite thing and making such a change to the nil class is not a small change. It is a significant change because it can change the en... |
7,938,863 | Using core data, how do I initialize the IVAR values? Analyzer gives me the error "Receiver in message expression is an uninitialized value"
Here is my snippet of code to call the object which is throwing the issue in analyzer :
```
CDCamera *camForAnnotation;
for(CDCamera *cams in fetchedObjects){
NSSet *ann... | 2011/10/29 | [
"https://Stackoverflow.com/questions/7938863",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/893219/"
] | You're not guaranteed to have a value in camForAnnotation, if nothing matches inside your for loop.
You should initialize the value to nil when declaring it, and possibly wrap your subsequent code in an if statement to save running anything if camForAnnotation is still nil. | Phil,
Core Data has methods that are called when an object is fetched. These are used for custom initialization. `-awakeFromFetch`, `-awakeFromInsert` and `-awakeFromSnapshotEvents:` are the methods you should examine.
Andrew |
19,573,373 | I'm trying to figure out a way to display custom text based on the users selection of the variable product.
The attribute is 'pricing' and the tag is deposit - which I've added a text description to when adding the attribute. So I'm trying to make this text appear when the user selects 'deposit'
But the code I'm usi... | 2013/10/24 | [
"https://Stackoverflow.com/questions/19573373",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2916995/"
] | Here is how I would rewrite your code to get it work:
`layout_info_panel.xml`
```
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<TextView
android:id="@+id/txtAccName"
android:layout_width="0dp"
android:layout_height="wrap_conten... | try to remove the argument from @EViewGroup, it has solved a simiilar problem for me. |
70,472,906 | I have 2 columns. I want to count the unique values from A if the corresponding value from b is grather than 0
| A | B |
| --- | --- |
| John | 2 |
| Mary | |
| John | 2 |
| John | |
| Sally | 2 |
| Terry | 1 |
| Terry | |
In the above example the result will be 3 (john + sally + terry).
I am using excel 2016. I s... | 2021/12/24 | [
"https://Stackoverflow.com/questions/70472906",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14020285/"
] | You can use this complex formula:
```
=SUM(IF(FREQUENCY(IF(LEN(IF($B$1:$B$7>0,$A$1:$A$7,""))>0,MATCH(IF($B$1:$B$7>0,$A$1:$A$7,""),IF($B$1:$B$7>0,$A$1:$A$7,""),0),""),IF(LEN(IF($B$1:$B$7>0,$A$1:$A$7,""))>0,MATCH(IF($B$1:$B$7>0,$A$1:$A$7,""),IF($B$1:$B$7>0,$A$1:$A$7,""),0),""))>0,1))
```
[![enter image description her... | In Office 365 this could be done like this: `=COUNTA(UNIQUE(FILTER(A:A,B:B>0)))`
You already referenced you do not have this, but if somebody searches this and do have Office 365 this may be helpful. |
12,246 | Would an exoplanet that has more ocean than Earth rotate at a different speed as a result of this? Would the amount of water impact the weight, gravitational pull, and/or tidal forces and cause a difference in the exoplanet's rotation period? (For simplicity's sake, say, if it was earth-like in every respect other than... | 2015/10/24 | [
"https://astronomy.stackexchange.com/questions/12246",
"https://astronomy.stackexchange.com",
"https://astronomy.stackexchange.com/users/2301/"
] | >
> Would an exoplanet that has more ocean than Earth rotate at a
> different speed as a result of this?
>
>
>
Basically no. Rotation speed, or [angular velocity](https://en.wikipedia.org/wiki/Angular_velocity) doesn't measurably change with your proposed example.
To explain this in more detail, there's two impo... | I would assume so seeing as how it would change the density
If it is exactly like earth but has a crap ton more of an ocean- it is perceivable that it's (average) density would be lower,
Also, minutely, it would compress this water more and heat it and make something of an atmosphere given that it doesn't escape. Tra... |
12,246 | Would an exoplanet that has more ocean than Earth rotate at a different speed as a result of this? Would the amount of water impact the weight, gravitational pull, and/or tidal forces and cause a difference in the exoplanet's rotation period? (For simplicity's sake, say, if it was earth-like in every respect other than... | 2015/10/24 | [
"https://astronomy.stackexchange.com/questions/12246",
"https://astronomy.stackexchange.com",
"https://astronomy.stackexchange.com/users/2301/"
] | If the mass, radius and total angular momentum of the planet is the same as Earth, then I can put forward an answer. (Of course if the angular momentum is allowed to be different you could have any rotation rate...)
First, surface gravity is unchanged since this only depends on the mass and radius of a planet.
Second... | I would assume so seeing as how it would change the density
If it is exactly like earth but has a crap ton more of an ocean- it is perceivable that it's (average) density would be lower,
Also, minutely, it would compress this water more and heat it and make something of an atmosphere given that it doesn't escape. Tra... |
12,246 | Would an exoplanet that has more ocean than Earth rotate at a different speed as a result of this? Would the amount of water impact the weight, gravitational pull, and/or tidal forces and cause a difference in the exoplanet's rotation period? (For simplicity's sake, say, if it was earth-like in every respect other than... | 2015/10/24 | [
"https://astronomy.stackexchange.com/questions/12246",
"https://astronomy.stackexchange.com",
"https://astronomy.stackexchange.com/users/2301/"
] | >
> Would an exoplanet that has more ocean than Earth rotate at a
> different speed as a result of this?
>
>
>
Basically no. Rotation speed, or [angular velocity](https://en.wikipedia.org/wiki/Angular_velocity) doesn't measurably change with your proposed example.
To explain this in more detail, there's two impo... | If the mass, radius and total angular momentum of the planet is the same as Earth, then I can put forward an answer. (Of course if the angular momentum is allowed to be different you could have any rotation rate...)
First, surface gravity is unchanged since this only depends on the mass and radius of a planet.
Second... |
64,311,141 | I want to scrape elements from a page, for example the page-
<https://www.aacr.org/?s=breast+cancer&search_type=global>
The tag in html for the title, has an html link and the title attached. When I run my code, it prints both the HTML (first position) and then the title(second position/what i want)
For example- the ... | 2020/10/12 | [
"https://Stackoverflow.com/questions/64311141",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14358886/"
] | If you are having a problem in downloading Sass below is the code without compass component just pure css.
----------------------------------------------------------------------------------------------------------
This will work in your apache server.
=====================================
```js
var timer=document.get... | Add this JS code and change css with the one given below and you will get what you need.
JS
==
```
var wrapper=document.getElementsByClassName('wrapper')[0];
var spinner=document.getElementsByClassName('spinner')[0];
var filler=document.getElementsByClassName('filler')[0];
var mask=document.getElementsByClassName('ma... |
5,598,851 | Since the WebBrowser control doesn't allow transparent backgrounds I'm trying to set the background in the WebBrowser control.
I've tried modifying the HTML before calling NavigateToString(), but since the html is a string in memory, I'm not sure what the path should be for my image
Trying this doesn't work:
```
bod... | 2011/04/08 | [
"https://Stackoverflow.com/questions/5598851",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/306339/"
] | Any paths need to be absolute paths to files on the Internet or relative paths to content in IsolatedStorage. | Try setting WebBrowser.Base appropriatelly, it sets the 'root directory' for a webbrowser that displays local or generated contents |
5,598,851 | Since the WebBrowser control doesn't allow transparent backgrounds I'm trying to set the background in the WebBrowser control.
I've tried modifying the HTML before calling NavigateToString(), but since the html is a string in memory, I'm not sure what the path should be for my image
Trying this doesn't work:
```
bod... | 2011/04/08 | [
"https://Stackoverflow.com/questions/5598851",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/306339/"
] | Any paths need to be absolute paths to files on the Internet or relative paths to content in IsolatedStorage. | try full image path like this
```
body { background-image:url('C:/Images/texture.jpg'); }
```
and this winform Webbrowser
```
webBrowser1.Document.Write("<BODY background= D:\\Desktop\\123.jpg bgColor=#ffffff text=#000000>");
``` |
14,403,023 | I just updated my jQuery from `jquery-1.6.1.min.js` to `jquery-1.8.2.js` and now this piece of code doesn't work anymore:
```
<script type='text/javascript'>
$(window).load(function(){
$('.freezebg').click(function() {
var ftop = $('.sort-wrap').offset().top - $(window).scrollTop();
var fleft = $('... | 2013/01/18 | [
"https://Stackoverflow.com/questions/14403023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1964162/"
] | is this what you're looking for?
```
SELECT *
FROM tableName
WHERE 1 IN (col1, col2, col3, col4)
``` | How about using `or` logical operator on your `where` clause?
```
select *
from your_table
where col_a = 'value'
or col_b = 'value'
or col_c = 'value'
or col_d = 'value'
``` |
14,403,023 | I just updated my jQuery from `jquery-1.6.1.min.js` to `jquery-1.8.2.js` and now this piece of code doesn't work anymore:
```
<script type='text/javascript'>
$(window).load(function(){
$('.freezebg').click(function() {
var ftop = $('.sort-wrap').offset().top - $(window).scrollTop();
var fleft = $('... | 2013/01/18 | [
"https://Stackoverflow.com/questions/14403023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1964162/"
] | Use IN only like below:
```
select * from TableName where 2 IN (ColumnOne,ColumnTwo,ColumnThree)
``` | How about using `or` logical operator on your `where` clause?
```
select *
from your_table
where col_a = 'value'
or col_b = 'value'
or col_c = 'value'
or col_d = 'value'
``` |
14,403,023 | I just updated my jQuery from `jquery-1.6.1.min.js` to `jquery-1.8.2.js` and now this piece of code doesn't work anymore:
```
<script type='text/javascript'>
$(window).load(function(){
$('.freezebg').click(function() {
var ftop = $('.sort-wrap').offset().top - $(window).scrollTop();
var fleft = $('... | 2013/01/18 | [
"https://Stackoverflow.com/questions/14403023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1964162/"
] | Use IN only like below:
```
select * from TableName where 2 IN (ColumnOne,ColumnTwo,ColumnThree)
``` | is this what you're looking for?
```
SELECT *
FROM tableName
WHERE 1 IN (col1, col2, col3, col4)
``` |
22,821 | Does "gestational age" of an unborn child count from the first day of the last menstrual period of the mother? | 2015/11/01 | [
"https://parenting.stackexchange.com/questions/22821",
"https://parenting.stackexchange.com",
"https://parenting.stackexchange.com/users/19427/"
] | Yes, the gestational age is counted from the first day of the mother's most recent menstrual cycle. From [Gestational Age on the NIH site](https://www.nlm.nih.gov/medlineplus/ency/article/002367.htm):
>
> Gestational age is the common term used during pregnancy to describe how far along the pregnancy is. It is measur... | Gestational age is the common term used during pregnancy to describe how far along the pregnancy is. It is measured in weeks, from the first day of the woman's last menstrual cycle to the current date. A normal pregnancy can range from 38 to 42 weeks.
Select the first day of the last menstrual period and the calculato... |
22,821 | Does "gestational age" of an unborn child count from the first day of the last menstrual period of the mother? | 2015/11/01 | [
"https://parenting.stackexchange.com/questions/22821",
"https://parenting.stackexchange.com",
"https://parenting.stackexchange.com/users/19427/"
] | Yes, the gestational age is counted from the first day of the mother's most recent menstrual cycle. From [Gestational Age on the NIH site](https://www.nlm.nih.gov/medlineplus/ency/article/002367.htm):
>
> Gestational age is the common term used during pregnancy to describe how far along the pregnancy is. It is measur... | Gestational age, or the age of the baby, is calculated from the first day of the mother’s last menstrual period. Since the exact date of conception is almost never known, the first day of the last menstrual period is used to measure how old the baby is.
i suggest you to take a look at this tool <https://calculatricedeg... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.