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 |
|---|---|---|---|---|---|
769,007 | I'm creating a new VPN service, to enable players of the Crysis 1, Crysis Wars, and Crysis 2 games to continue playing after the online multiplayer is shut down at the end of this month.
The purpose of this VPN service is to provide a private LAN, where players can connect to the VPN and view the LAN server list to co... | 2014/06/15 | [
"https://superuser.com/questions/769007",
"https://superuser.com",
"https://superuser.com/users/300646/"
] | You have two easy approaches for this: Microsoft's horribly insecure PPTP and OpenVPN.
PPTP is built-in to Windows, and doesn't require a download for your players. The catch is that the data exchanged will not be secure - a dedicated attacker will be able to break into the data streams because there are flaws in the ... | If you're on linux and use openVPN, [VPNShift](https://github.com/crasm/vpnshift.sh) works beautifully. |
769,007 | I'm creating a new VPN service, to enable players of the Crysis 1, Crysis Wars, and Crysis 2 games to continue playing after the online multiplayer is shut down at the end of this month.
The purpose of this VPN service is to provide a private LAN, where players can connect to the VPN and view the LAN server list to co... | 2014/06/15 | [
"https://superuser.com/questions/769007",
"https://superuser.com",
"https://superuser.com/users/300646/"
] | I recommend using OpenVPN. There is an option called "redirect-gateway" in the client configuration which, if enabled, will redirect traffic from the client though your VPN. You obviously would not want this option in the OpenVPN configurations your clients have. Server-side, you could use "iptables" to prevent clients... | If you're on linux and use openVPN, [VPNShift](https://github.com/crasm/vpnshift.sh) works beautifully. |
769,007 | I'm creating a new VPN service, to enable players of the Crysis 1, Crysis Wars, and Crysis 2 games to continue playing after the online multiplayer is shut down at the end of this month.
The purpose of this VPN service is to provide a private LAN, where players can connect to the VPN and view the LAN server list to co... | 2014/06/15 | [
"https://superuser.com/questions/769007",
"https://superuser.com",
"https://superuser.com/users/300646/"
] | I recommend using OpenVPN. There is an option called "redirect-gateway" in the client configuration which, if enabled, will redirect traffic from the client though your VPN. You obviously would not want this option in the OpenVPN configurations your clients have. Server-side, you could use "iptables" to prevent clients... | I understand that the VPN is housed on Linux and Crysis on Windows. Therefore all VPN communication goes through the Linux server.
You could set the firewall to allow on the IP segment of the VPN only outgoing connections to the Windows server, so no connection to the Internet is possible on the VPN.
You control the ... |
769,007 | I'm creating a new VPN service, to enable players of the Crysis 1, Crysis Wars, and Crysis 2 games to continue playing after the online multiplayer is shut down at the end of this month.
The purpose of this VPN service is to provide a private LAN, where players can connect to the VPN and view the LAN server list to co... | 2014/06/15 | [
"https://superuser.com/questions/769007",
"https://superuser.com",
"https://superuser.com/users/300646/"
] | I understand that the VPN is housed on Linux and Crysis on Windows. Therefore all VPN communication goes through the Linux server.
You could set the firewall to allow on the IP segment of the VPN only outgoing connections to the Windows server, so no connection to the Internet is possible on the VPN.
You control the ... | The solution to this is found [here.](https://superuser.com/questions/294008/use-vpn-connection-only-for-selected-application?rq=1)
It is possible to have an installer, which modifies the firewall rules to accomplish this.
>
> Connect to your VPN as you normally would.
>
>
> Open the Network and Sharing Center - ri... |
769,007 | I'm creating a new VPN service, to enable players of the Crysis 1, Crysis Wars, and Crysis 2 games to continue playing after the online multiplayer is shut down at the end of this month.
The purpose of this VPN service is to provide a private LAN, where players can connect to the VPN and view the LAN server list to co... | 2014/06/15 | [
"https://superuser.com/questions/769007",
"https://superuser.com",
"https://superuser.com/users/300646/"
] | So i would use tunggle because it's very stable and easy to setup. You can also setup private networks. Check it out at <http://www.tunngle.net> | If you're on linux and use openVPN, [VPNShift](https://github.com/crasm/vpnshift.sh) works beautifully. |
769,007 | I'm creating a new VPN service, to enable players of the Crysis 1, Crysis Wars, and Crysis 2 games to continue playing after the online multiplayer is shut down at the end of this month.
The purpose of this VPN service is to provide a private LAN, where players can connect to the VPN and view the LAN server list to co... | 2014/06/15 | [
"https://superuser.com/questions/769007",
"https://superuser.com",
"https://superuser.com/users/300646/"
] | If you're on linux and use openVPN, [VPNShift](https://github.com/crasm/vpnshift.sh) works beautifully. | The solution to this is found [here.](https://superuser.com/questions/294008/use-vpn-connection-only-for-selected-application?rq=1)
It is possible to have an installer, which modifies the firewall rules to accomplish this.
>
> Connect to your VPN as you normally would.
>
>
> Open the Network and Sharing Center - ri... |
769,007 | I'm creating a new VPN service, to enable players of the Crysis 1, Crysis Wars, and Crysis 2 games to continue playing after the online multiplayer is shut down at the end of this month.
The purpose of this VPN service is to provide a private LAN, where players can connect to the VPN and view the LAN server list to co... | 2014/06/15 | [
"https://superuser.com/questions/769007",
"https://superuser.com",
"https://superuser.com/users/300646/"
] | I recommend using OpenVPN. There is an option called "redirect-gateway" in the client configuration which, if enabled, will redirect traffic from the client though your VPN. You obviously would not want this option in the OpenVPN configurations your clients have. Server-side, you could use "iptables" to prevent clients... | The solution to this is found [here.](https://superuser.com/questions/294008/use-vpn-connection-only-for-selected-application?rq=1)
It is possible to have an installer, which modifies the firewall rules to accomplish this.
>
> Connect to your VPN as you normally would.
>
>
> Open the Network and Sharing Center - ri... |
769,007 | I'm creating a new VPN service, to enable players of the Crysis 1, Crysis Wars, and Crysis 2 games to continue playing after the online multiplayer is shut down at the end of this month.
The purpose of this VPN service is to provide a private LAN, where players can connect to the VPN and view the LAN server list to co... | 2014/06/15 | [
"https://superuser.com/questions/769007",
"https://superuser.com",
"https://superuser.com/users/300646/"
] | So i would use tunggle because it's very stable and easy to setup. You can also setup private networks. Check it out at <http://www.tunngle.net> | I understand that the VPN is housed on Linux and Crysis on Windows. Therefore all VPN communication goes through the Linux server.
You could set the firewall to allow on the IP segment of the VPN only outgoing connections to the Windows server, so no connection to the Internet is possible on the VPN.
You control the ... |
42,620,411 | Usually on linux when we wish to use epoll, we first create a epfd, and then register fd and events to it.
```
int fd=open(...)
int epfd=epoll_create(1);
epoll_event ev,events[1];
ev.data.fd=fd;//already registered
ev.events=EPOLLIN|EPOLLET;
epoll_ctl(epfd,EPOLL_CTL_ADD,fd,&ev);//still need to specify fd?
```
... | 2017/03/06 | [
"https://Stackoverflow.com/questions/42620411",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6164172/"
] | Your `ev.data` is a union. You *can* use the `fd` member, but you don't have to. You can also stick other data in there.
The point of `ev.data` is of course that *that*'s the data you get back when the event fires, so you need some way of relating that to the original file descriptor. Writing that very file descriptor... | "When fd is ready, return ev. You don't have to set ev.fd to fd."
I have no idea why the man page doesn't write this way, way easier to understand. |
37,098,546 | As far as I know, `Variable` is the default operation for making a variable, and `get_variable` is mainly used for weight sharing.
On the one hand, there are some people suggesting using `get_variable` instead of the primitive `Variable` operation whenever you need a variable. On the other hand, I merely see any use o... | 2016/05/08 | [
"https://Stackoverflow.com/questions/37098546",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4794308/"
] | I'd recommend to always use `tf.get_variable(...)` -- it will make it way easier to refactor your code if you need to share variables at any time, e.g. in a multi-gpu setting (see the multi-gpu CIFAR example). There is no downside to it.
Pure `tf.Variable` is lower-level; at some point `tf.get_variable()` did not exi... | tf.Variable is a class, and there are several ways to create tf.Variable including `tf.Variable.__init__` and `tf.get_variable`.
**`tf.Variable.__init__`**: Creates a new variable with *initial\_value*.
```
W = tf.Variable(<initial-value>, name=<optional-name>)
```
**`tf.get_variable`**: Gets an existing variable ... |
37,098,546 | As far as I know, `Variable` is the default operation for making a variable, and `get_variable` is mainly used for weight sharing.
On the one hand, there are some people suggesting using `get_variable` instead of the primitive `Variable` operation whenever you need a variable. On the other hand, I merely see any use o... | 2016/05/08 | [
"https://Stackoverflow.com/questions/37098546",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4794308/"
] | tf.Variable is a class, and there are several ways to create tf.Variable including `tf.Variable.__init__` and `tf.get_variable`.
**`tf.Variable.__init__`**: Creates a new variable with *initial\_value*.
```
W = tf.Variable(<initial-value>, name=<optional-name>)
```
**`tf.get_variable`**: Gets an existing variable ... | Another difference lies in that one is in `('variable_store',)` collection but the other is not.
Please see the source [code](https://github.com/tensorflow/tensorflow/blob/r1.12/tensorflow/python/ops/variable_scope.py#L1352-L1358):
```
def _get_default_variable_store():
store = ops.get_collection(_VARSTORE_KEY)
... |
37,098,546 | As far as I know, `Variable` is the default operation for making a variable, and `get_variable` is mainly used for weight sharing.
On the one hand, there are some people suggesting using `get_variable` instead of the primitive `Variable` operation whenever you need a variable. On the other hand, I merely see any use o... | 2016/05/08 | [
"https://Stackoverflow.com/questions/37098546",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4794308/"
] | I'd recommend to always use `tf.get_variable(...)` -- it will make it way easier to refactor your code if you need to share variables at any time, e.g. in a multi-gpu setting (see the multi-gpu CIFAR example). There is no downside to it.
Pure `tf.Variable` is lower-level; at some point `tf.get_variable()` did not exi... | I can find two main differences between one and the other:
1. First is that `tf.Variable` will always create a new variable, whereas `tf.get_variable` gets an *existing* variable with specified parameters from the graph, and if it doesn't exist, creates a new one.
2. `tf.Variable` requires that an initial value be spe... |
37,098,546 | As far as I know, `Variable` is the default operation for making a variable, and `get_variable` is mainly used for weight sharing.
On the one hand, there are some people suggesting using `get_variable` instead of the primitive `Variable` operation whenever you need a variable. On the other hand, I merely see any use o... | 2016/05/08 | [
"https://Stackoverflow.com/questions/37098546",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4794308/"
] | I'd recommend to always use `tf.get_variable(...)` -- it will make it way easier to refactor your code if you need to share variables at any time, e.g. in a multi-gpu setting (see the multi-gpu CIFAR example). There is no downside to it.
Pure `tf.Variable` is lower-level; at some point `tf.get_variable()` did not exi... | Another difference lies in that one is in `('variable_store',)` collection but the other is not.
Please see the source [code](https://github.com/tensorflow/tensorflow/blob/r1.12/tensorflow/python/ops/variable_scope.py#L1352-L1358):
```
def _get_default_variable_store():
store = ops.get_collection(_VARSTORE_KEY)
... |
37,098,546 | As far as I know, `Variable` is the default operation for making a variable, and `get_variable` is mainly used for weight sharing.
On the one hand, there are some people suggesting using `get_variable` instead of the primitive `Variable` operation whenever you need a variable. On the other hand, I merely see any use o... | 2016/05/08 | [
"https://Stackoverflow.com/questions/37098546",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4794308/"
] | I can find two main differences between one and the other:
1. First is that `tf.Variable` will always create a new variable, whereas `tf.get_variable` gets an *existing* variable with specified parameters from the graph, and if it doesn't exist, creates a new one.
2. `tf.Variable` requires that an initial value be spe... | Another difference lies in that one is in `('variable_store',)` collection but the other is not.
Please see the source [code](https://github.com/tensorflow/tensorflow/blob/r1.12/tensorflow/python/ops/variable_scope.py#L1352-L1358):
```
def _get_default_variable_store():
store = ops.get_collection(_VARSTORE_KEY)
... |
43,815,959 | With this [code](https://codesandbox.io/s/0ggDnlOoL), I am able to successfully use `setState` on a simple object – when I click on "Joey" the name changes to "Igor".
```
class Card extends React.Component {
myFunc = () => {this.props.change('Igor')};
render() {
return (
... | 2017/05/06 | [
"https://Stackoverflow.com/questions/43815959",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4029354/"
] | As @slm says on the [link](http://#https://unix.stackexchange.com/questions/104641/how-can-i-suppress-output-from-grep-so-that-it-only-returns-the-exit-statushttp://), you can used -q for quiet. That way it don't output the command on the screen. Make sure there no space between the variable, the '=' and the command as... | The bash syntax you are after in your first command is probably "command substitution":
`VAR=$(sudo apachectl configtest)`
VAR will contain the output of the commandline.
But, if you just want to know if the output contains "Syntax OK", do it like this:
`sudo apachectl configtest | grep -q "Syntax OK" && proceed ||... |
43,815,959 | With this [code](https://codesandbox.io/s/0ggDnlOoL), I am able to successfully use `setState` on a simple object – when I click on "Joey" the name changes to "Igor".
```
class Card extends React.Component {
myFunc = () => {this.props.change('Igor')};
render() {
return (
... | 2017/05/06 | [
"https://Stackoverflow.com/questions/43815959",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4029354/"
] | I know this is the old thread and the question doesn't suit this particular site. Anyway, looking for the same question, this page was shown as the first search result. So, I am posting here my final solution, for a reference.
```
configtestResult=$(sudo apachectl configtest 2>&1)
if [ "$configtestResult" != "Syntax ... | The bash syntax you are after in your first command is probably "command substitution":
`VAR=$(sudo apachectl configtest)`
VAR will contain the output of the commandline.
But, if you just want to know if the output contains "Syntax OK", do it like this:
`sudo apachectl configtest | grep -q "Syntax OK" && proceed ||... |
43,815,959 | With this [code](https://codesandbox.io/s/0ggDnlOoL), I am able to successfully use `setState` on a simple object – when I click on "Joey" the name changes to "Igor".
```
class Card extends React.Component {
myFunc = () => {this.props.change('Igor')};
render() {
return (
... | 2017/05/06 | [
"https://Stackoverflow.com/questions/43815959",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4029354/"
] | I know this is the old thread and the question doesn't suit this particular site. Anyway, looking for the same question, this page was shown as the first search result. So, I am posting here my final solution, for a reference.
```
configtestResult=$(sudo apachectl configtest 2>&1)
if [ "$configtestResult" != "Syntax ... | As @slm says on the [link](http://#https://unix.stackexchange.com/questions/104641/how-can-i-suppress-output-from-grep-so-that-it-only-returns-the-exit-statushttp://), you can used -q for quiet. That way it don't output the command on the screen. Make sure there no space between the variable, the '=' and the command as... |
13,194,484 | It´s supposed there is, at least, two comands, poly and var. But I don´t know how to use them to perform a operation like this:
1/4\*b\*a^2 - a\*b/2(2/3\*a)^2
where a y b are symbolic variables.
How can I do this? | 2012/11/02 | [
"https://Stackoverflow.com/questions/13194484",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/470933/"
] | I don't think Scilab's symbolic capabilities extend to multiple variables. You can create polynomials in one variable using `poly`, e.g.
```
-->p = poly([1 2 3], 'x', 'c')
p =
2
1 + 2x + 3x
```
and can create polynomials in another variable similarly but if you try to combine them it gives... | Given `p = 2x^2 + 3x + 4` and `q = 5x + 7`
```
<enter code here> p=[2 3 4];
<enter code here> q=[5 7];
<enter code here> answer=convol(p,q);
<enter code here> disp(answer)
``` |
44,040,554 | I am developing webapp using erlang nitrogen web framework, studying elixir.
Is there a way i can code in elixir and use nitrogen web framework and existing developed code ? | 2017/05/18 | [
"https://Stackoverflow.com/questions/44040554",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/432128/"
] | It appears that the Nitrogen router assumes `.erl` files. I have not looked at the implementation details of the router. So, I'll assume that you will need Erlang wrappers for all the major modules. Additionally, Nitrogen uses Erlang records extensively. You can convert Erlang records to Elixir structs and back again, ... | I think that there is a way to work with Nitrogen using Elixir thought I would discourage that. Instead it would be better to create umbrella application where web part would be written in Erlang with Nitrogen and part would be written in Elixir (like logic and/or DB interface). |
283,740 | Say you do this in `R`:
```
g <- rgamma(5000, 4)
t <- rt(5000, 5)
```
So, now you've got data from the gamma and $t$-distributions.
Then you model these. I use 'gam' from 'mgcv'.
```
m1 <- gam(g ~1, family=Gamma)
m2 <- gam(g ~1, family=scat)
m3 <- gam(20 + t ~1, family=scat) # add 20 to get positive values
m4... | 2017/06/05 | [
"https://stats.stackexchange.com/questions/283740",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/164126/"
] | The function you called returns *deviance residuals* by default. (`resid` is an alias of `residuals` which when called on a `gam` object invokes `residuals.gam`; see its help)
These are typically considerably more normal looking than raw residuals ($y\_i-\hat{\mu\_i}$).
For a gamma random variable, the deviance resid... | There is nothing about a Q-Q plot that is intrinsically tied to the normal distribution. It is a plot of the quantile points of one distribution against the quantile points of another. If those two distributions are the same, the points will line up. If they are different, they will not.
If you make one of those distr... |
1,527,173 | When I want calculate $\lim\_{x\to 0^+} x^{(x^x-1)}$ , I have to calculate $\lim\_{x\to 0^+}(x^x-1)\ln x$ . I calculat $\lim\_{x\to 0^+}x^x=\lim\_{x\to 0^+}e^{x\ln x}=1$ so $\lim\_{x\to 0^+}(x^x-1)\ln x$ is $0\times \infty$ .
How can I calculate $\lim\_{x\to 0^+}(x^x-1)\ln x$? | 2015/11/13 | [
"https://math.stackexchange.com/questions/1527173",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/250703/"
] | You have to use an asymptotic expansion of $\;x^x-1=\mathrm e^{x\ln x}-1=x\ln x+o(x\ln x)$. Thus,
$$(x^x-1)\ln x=x\ln^2x+o(x\ln x)\ln x=x\ln^2x+o(x\ln^2x)\xrightarrow[x\to 0^+]{}0$$
hence by continuity of the exponential function,
$$\lim\_{x\to 0^+} x^{x^x-1}=\lim\_{x\to 0^+}\mathrm e^{(x^x-1)\ln x}=\mathrm e^0=1.$$ | $$\lim\_{x\to 0^+} \exp((x^x-1)\ln x) =$$
$$\exp(\lim\_{x\to 0^+} (x^x-1)\ln x) = \exp(\lim\_{x\to 0^+} \frac{x^x-1}{\frac1{\ln x}}) = \exp(\lim\_{x\to 0^+} \frac{\exp(x\ln x)-1}{\frac1{\ln x}})$$
Using Hopital
$$\exp(\lim\_{x\to 0^+} \frac{\exp(x\ln x)-1}{\frac1{\ln x}})=\exp(\lim\_{x\to 0^+} \frac{(\ln x+1)\exp(x\... |
71,303,671 | From the docs :
>
> cppyy is an automatic, run-time, Python-C++ bindings generator, for
> calling C++ from Python **and Python from C++**.
>
>
>
(Emphasis mine)
I don't see any instructions for doing the same, however, so is it possible to call Python via C++ using `cppyy`? | 2022/03/01 | [
"https://Stackoverflow.com/questions/71303671",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9050668/"
] | As a qualifier, since I don't know from where you obtained cppyy, the main code that was at the time the reason for typing that sentence does not exist in cppyy master, but does exist in its historic home of PyROOT. This so-called "class generator" plugin allows Cling to "see" Python classes as C++ classes, for straigh... | I do not know if it answer to your question (from your title I understand that you want to call python function from c++ side, but later it seems you ask specifically about [cpppy](https://github.com/tmr232/cpppy)) but you can do the binding with [pybind11](https://github.com/pybind/pybind11). This package is heavily u... |
5,105 | I'm writing a script that will rsycnc my Time Machine directory to a remote server using ssh. I've switched from a shell script to an AppleScript and then back to an Apple script and I don't really care what kind of script the solution will require.
I've had success starting the backup process with this little snippe... | 2010/12/19 | [
"https://apple.stackexchange.com/questions/5105",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/2095/"
] | You might also start the backup with `tmutil startbackup -b`. `-b` blocks the command until the backup has finished. | ### Absence of backup-related processes is *not* assurance that a Time Machine backup is complete
On the volume to which Time Machine writes its backups: alongside the …`/Latest/`… directory, consider:
* the …`.inProgress/`… bundle.
If that bundle exists, a backup is incomplete. |
5,105 | I'm writing a script that will rsycnc my Time Machine directory to a remote server using ssh. I've switched from a shell script to an AppleScript and then back to an Apple script and I don't really care what kind of script the solution will require.
I've had success starting the backup process with this little snippe... | 2010/12/19 | [
"https://apple.stackexchange.com/questions/5105",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/2095/"
] | ### Absence of backup-related processes is *not* assurance that a Time Machine backup is complete
On the volume to which Time Machine writes its backups: alongside the …`/Latest/`… directory, consider:
* the …`.inProgress/`… bundle.
If that bundle exists, a backup is incomplete. | `tmutils` only exists from 10.7 on. Before that you can use, as mentioned, `/System/Library/CoreServices/backupd.bundle/Contents/Resources/backupd-helper` to manually run Time Machine.
You can then use `wait` to wait until the process is finished. Without arguments it will simply wait; if you provide the PID you can g... |
5,105 | I'm writing a script that will rsycnc my Time Machine directory to a remote server using ssh. I've switched from a shell script to an AppleScript and then back to an Apple script and I don't really care what kind of script the solution will require.
I've had success starting the backup process with this little snippe... | 2010/12/19 | [
"https://apple.stackexchange.com/questions/5105",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/2095/"
] | Here's one way - I know it's nowhere near a "proper" solution, but I imagine it would work.
`ps ax | grep "/System/Library/CoreServices/backupd.bundle/Contents/Resources/backupd-helper" | grep -v 'grep'`
What it does is search the process list for the backupd-helper process, then filters out the grep command itself f... | `tmutils` only exists from 10.7 on. Before that you can use, as mentioned, `/System/Library/CoreServices/backupd.bundle/Contents/Resources/backupd-helper` to manually run Time Machine.
You can then use `wait` to wait until the process is finished. Without arguments it will simply wait; if you provide the PID you can g... |
5,105 | I'm writing a script that will rsycnc my Time Machine directory to a remote server using ssh. I've switched from a shell script to an AppleScript and then back to an Apple script and I don't really care what kind of script the solution will require.
I've had success starting the backup process with this little snippe... | 2010/12/19 | [
"https://apple.stackexchange.com/questions/5105",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/2095/"
] | You might also start the backup with `tmutil startbackup -b`. `-b` blocks the command until the backup has finished. | `tmutil status|grep -c "Running = 1"`
returns '1' when running, '0' when not. |
5,105 | I'm writing a script that will rsycnc my Time Machine directory to a remote server using ssh. I've switched from a shell script to an AppleScript and then back to an Apple script and I don't really care what kind of script the solution will require.
I've had success starting the backup process with this little snippe... | 2010/12/19 | [
"https://apple.stackexchange.com/questions/5105",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/2095/"
] | `tmutil status` is the Lion way now that we have a nice tool for this sort of query.
On newer OS, there is an undocumented command `tmutil currentphase` that shows the name of the current phase. | `tmutils` only exists from 10.7 on. Before that you can use, as mentioned, `/System/Library/CoreServices/backupd.bundle/Contents/Resources/backupd-helper` to manually run Time Machine.
You can then use `wait` to wait until the process is finished. Without arguments it will simply wait; if you provide the PID you can g... |
5,105 | I'm writing a script that will rsycnc my Time Machine directory to a remote server using ssh. I've switched from a shell script to an AppleScript and then back to an Apple script and I don't really care what kind of script the solution will require.
I've had success starting the backup process with this little snippe... | 2010/12/19 | [
"https://apple.stackexchange.com/questions/5105",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/2095/"
] | Here's one way - I know it's nowhere near a "proper" solution, but I imagine it would work.
`ps ax | grep "/System/Library/CoreServices/backupd.bundle/Contents/Resources/backupd-helper" | grep -v 'grep'`
What it does is search the process list for the backupd-helper process, then filters out the grep command itself f... | `tmutil status|grep -c "Running = 1"`
returns '1' when running, '0' when not. |
5,105 | I'm writing a script that will rsycnc my Time Machine directory to a remote server using ssh. I've switched from a shell script to an AppleScript and then back to an Apple script and I don't really care what kind of script the solution will require.
I've had success starting the backup process with this little snippe... | 2010/12/19 | [
"https://apple.stackexchange.com/questions/5105",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/2095/"
] | ### Absence of backup-related processes is *not* assurance that a Time Machine backup is complete
On the volume to which Time Machine writes its backups: alongside the …`/Latest/`… directory, consider:
* the …`.inProgress/`… bundle.
If that bundle exists, a backup is incomplete. | The following work for me...
---
Script backup\_status:
```
#!/usr/bin/env bash
#
# Determines if Time Machine is running and works with older Mac OS x versions
#
if [ x == x`type -P tmutil` ]; then
# Older OSx
count=`ps -ef | grep -v grep | grep -c 'CoreServices/backupd'`... |
5,105 | I'm writing a script that will rsycnc my Time Machine directory to a remote server using ssh. I've switched from a shell script to an AppleScript and then back to an Apple script and I don't really care what kind of script the solution will require.
I've had success starting the backup process with this little snippe... | 2010/12/19 | [
"https://apple.stackexchange.com/questions/5105",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/2095/"
] | `tmutil status` is the Lion way now that we have a nice tool for this sort of query.
On newer OS, there is an undocumented command `tmutil currentphase` that shows the name of the current phase. | `tmutil status|grep -c "Running = 1"`
returns '1' when running, '0' when not. |
5,105 | I'm writing a script that will rsycnc my Time Machine directory to a remote server using ssh. I've switched from a shell script to an AppleScript and then back to an Apple script and I don't really care what kind of script the solution will require.
I've had success starting the backup process with this little snippe... | 2010/12/19 | [
"https://apple.stackexchange.com/questions/5105",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/2095/"
] | `tmutil status|grep -c "Running = 1"`
returns '1' when running, '0' when not. | `tmutils` only exists from 10.7 on. Before that you can use, as mentioned, `/System/Library/CoreServices/backupd.bundle/Contents/Resources/backupd-helper` to manually run Time Machine.
You can then use `wait` to wait until the process is finished. Without arguments it will simply wait; if you provide the PID you can g... |
5,105 | I'm writing a script that will rsycnc my Time Machine directory to a remote server using ssh. I've switched from a shell script to an AppleScript and then back to an Apple script and I don't really care what kind of script the solution will require.
I've had success starting the backup process with this little snippe... | 2010/12/19 | [
"https://apple.stackexchange.com/questions/5105",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/2095/"
] | `tmutil status` is the Lion way now that we have a nice tool for this sort of query.
On newer OS, there is an undocumented command `tmutil currentphase` that shows the name of the current phase. | Here's one way - I know it's nowhere near a "proper" solution, but I imagine it would work.
`ps ax | grep "/System/Library/CoreServices/backupd.bundle/Contents/Resources/backupd-helper" | grep -v 'grep'`
What it does is search the process list for the backupd-helper process, then filters out the grep command itself f... |
20,407 | I just ordered the D7000 with three lenses, one of them was the Nikon AF 16-85 mm f/3.5-5.6 DX G AF-S ED. Now I found that they sell a package "D7000 with 16-85mm, AFS G VR" for $100 less. I can undo my order before midnight, is it the same lens? (If so I'll reorder with the package instead of the camera and lens separ... | 2012/02/19 | [
"https://photo.stackexchange.com/questions/20407",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/8439/"
] | [There is only one such lens](http://www.neocamera.com/lens/nikkor/af-s_dx_16-85mm_f3.5-5.6g_ed_vr) and so, yes, **they are the same**.
The full name is the **Nikkor AF-S DX 16-85mm F/3.5-5.6G ED VR** but it seems one of your vendors is omitting parts of the name. Unfortunately this is common practice and makes it ext... | You might have a look at the question [What do all those cryptic number and letter codes in a lens name mean?](https://photo.stackexchange.com/questions/496/what-do-all-those-cryptic-number-and-letter-codes-in-a-lens-name-mean) for some more information about what the different acronyms means.
I'm not too familiar wit... |
20,407 | I just ordered the D7000 with three lenses, one of them was the Nikon AF 16-85 mm f/3.5-5.6 DX G AF-S ED. Now I found that they sell a package "D7000 with 16-85mm, AFS G VR" for $100 less. I can undo my order before midnight, is it the same lens? (If so I'll reorder with the package instead of the camera and lens separ... | 2012/02/19 | [
"https://photo.stackexchange.com/questions/20407",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/8439/"
] | You might have a look at the question [What do all those cryptic number and letter codes in a lens name mean?](https://photo.stackexchange.com/questions/496/what-do-all-those-cryptic-number-and-letter-codes-in-a-lens-name-mean) for some more information about what the different acronyms means.
I'm not too familiar wit... | I own the lens and there is only one version of this lens. So they should be the same lens. |
20,407 | I just ordered the D7000 with three lenses, one of them was the Nikon AF 16-85 mm f/3.5-5.6 DX G AF-S ED. Now I found that they sell a package "D7000 with 16-85mm, AFS G VR" for $100 less. I can undo my order before midnight, is it the same lens? (If so I'll reorder with the package instead of the camera and lens separ... | 2012/02/19 | [
"https://photo.stackexchange.com/questions/20407",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/8439/"
] | [There is only one such lens](http://www.neocamera.com/lens/nikkor/af-s_dx_16-85mm_f3.5-5.6g_ed_vr) and so, yes, **they are the same**.
The full name is the **Nikkor AF-S DX 16-85mm F/3.5-5.6G ED VR** but it seems one of your vendors is omitting parts of the name. Unfortunately this is common practice and makes it ext... | I own the lens and there is only one version of this lens. So they should be the same lens. |
48,399,113 | My apologies if I didn't explain it clear the first time. I have edited my explanation further in bold below.
In the program below user enters a word and then enters a letter which the user would like to replace with any character. For instance, user enter's a word "Hello" and the replacement letter is "l" with "$". S... | 2018/01/23 | [
"https://Stackoverflow.com/questions/48399113",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7663141/"
] | Imagine you have a method like so:
```
function getString(){
return "string";
}
```
and then define a textbox:
```
<input type="text" value={getString()}/>
```
You would expect that the textbox would be rendered with a value of "string" not "getString()". This is because what is within the curly braces is eva... | In react application, we write html in javascript and not in HTML.
So at the time of rendering, javascript will execute this function: alert('hi')
By using this syntax:
```
<button onClick={() => alert('hi')}>Click me!</button>
```
we are passing function reference to on click. Inner block of this function will ... |
58,743,946 | Xcode Version: 11.2
iOS simulator version used: 13.2 and 12.4
Installed .app via drag and drop to iOS simulator but when I try to open it I get this error. This method was fine when my Xcode is still v10. [](https://i.stack.imgur.com/KvPkY.jpg) | 2019/11/07 | [
"https://Stackoverflow.com/questions/58743946",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1636421/"
] | try to download old Xcode 10 and test your app.
<https://developer.apple.com/download/more/>
hope it helps to find the bug | Installed Xcode 10 (Thanks Vlad Tagunkov) and changed the Command Line Tools to v10.3[](https://i.stack.imgur.com/9KVa5.png)
Also, this only works with iOS 12.4 simulator. Tried it on 13.2 and I still get the same error. |
58,743,946 | Xcode Version: 11.2
iOS simulator version used: 13.2 and 12.4
Installed .app via drag and drop to iOS simulator but when I try to open it I get this error. This method was fine when my Xcode is still v10. [](https://i.stack.imgur.com/KvPkY.jpg) | 2019/11/07 | [
"https://Stackoverflow.com/questions/58743946",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1636421/"
] | try to download old Xcode 10 and test your app.
<https://developer.apple.com/download/more/>
hope it helps to find the bug | you need to see what you have in log. turn logging mode in most detail mode and run the app.
you will probably see where the problem.
hope it helps. |
53,985,593 | I have this exercise that i can't understand and i hoped somebody could help me with it.
Develop a function that receives a table of strings, each one
with a maximum of 40 characters, and return the index of the largest of them. Note: The function receives a two-dimensional table, with the first dimension of the table... | 2018/12/31 | [
"https://Stackoverflow.com/questions/53985593",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10851388/"
] | This means, your function should work like this:
```
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int func (char table[][40], int numentries) {
...
}
int main (void) {
int index;
char example[][40] = {
"this",
"is",
"an",
"example",
"with",
"s... | Here is an example, make sure you understand what was done- if something is unclear- ask. I hope this helps:
Note that if there are multiple max the index returned will be for the first string of that length.
```
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int GetLongestString(char sArr[][40], int row... |
29,101,840 | I am using autoLayout for my customCell in xib, because I want to have variable height for rows based on the text.
Now in my VC.m
I am using these lines of code
```
- (void)viewdidLoad
{
m_tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
m_tableView.estimatedRowHeight = 97.0;
... | 2015/03/17 | [
"https://Stackoverflow.com/questions/29101840",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/827629/"
] | This is happening because when you reload your cell the table view is asking for the heights of all the cells again. Any cells that are offscreen above your scroll position will be asked for their estimated row heights and if they are different from their current height it will cause the cells to change height and you ... | You should use `dequeueReusableCellWithIdentifier:forIndexPath` rather than the version you are using.
The one you are using will have no size class due to the fact the cell returned has no parent. Its an issue which appears from xcode 6 onwards due to the size class changes.
Try changing to this version which return... |
36,288,010 | It's simple but I've confused at somewhere.
Let's say, we have `string array` with `size 5`. And we did;
```
array[0]="ted"
array[4]="barney"
```
So elements are;
```
{"ted", null, null, null, "barney"}
```
If I use `Arrays.sort`, what will be the *new position* of `new sorted array`?
```
1-) barney, ted, null... | 2016/03/29 | [
"https://Stackoverflow.com/questions/36288010",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4332555/"
] | ```
java.lang.NullPointerException
at java.util.ComparableTimSort.countRunAndMakeAscending(Unknown Source)
at java.util.ComparableTimSort.sort(Unknown Source)
at java.util.Arrays.sort(Unknown Source)
```
because String and null are not comparable to each other | When you have this kind of simple testable questions, the best way to have an answer is to run the code yourself on a new empty project.
And to answer your question, the result will be a NullPointerException because null is not a Comparable |
36,288,010 | It's simple but I've confused at somewhere.
Let's say, we have `string array` with `size 5`. And we did;
```
array[0]="ted"
array[4]="barney"
```
So elements are;
```
{"ted", null, null, null, "barney"}
```
If I use `Arrays.sort`, what will be the *new position* of `new sorted array`?
```
1-) barney, ted, null... | 2016/03/29 | [
"https://Stackoverflow.com/questions/36288010",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4332555/"
] | ```
java.lang.NullPointerException
at java.util.ComparableTimSort.countRunAndMakeAscending(Unknown Source)
at java.util.ComparableTimSort.sort(Unknown Source)
at java.util.Arrays.sort(Unknown Source)
```
because String and null are not comparable to each other | ```
Arrays.sort(myArray, new Comparator<String>() {
@Override
public int compare(String o1, String o2) {
if (o1 == null && o2 == null) {
return 0;
}
if (o1 == null) {
return 1;
}
if (o2 == null) {
return -1;
}
return o1.... |
6,602 | >
> **Possible Duplicate:**
>
> [Glossary of Guitar Effects](https://music.stackexchange.com/questions/1838/glossary-of-guitar-effects)
>
>
>
What are the major *types* of effect pedals for electric guitar?
I.e., as a novice, what effect pedal types should I be aware of, that "everybody" knows about? | 2012/06/28 | [
"https://music.stackexchange.com/questions/6602",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/2245/"
] | Unless you attend training with a skilled teacher, I think the best method to build your vocabulary is to listen to tunes played by renowned musicians from various genres, and play along.
It's a bit like what you have done already, but actively seek out new or challenging styles. For example, if you are a blues guitar... | In addition to what Dr Mayhem has mentioned, I would also suggest you to search in internet too for some guitar site specifically having a good colection of licks.
For example, I found [**Guitar Solo**](http://www.myguitarsolo.com/Licks/Licks.htm) pretty useful.
Give it a try and if you find it useful add it to you... |
6,602 | >
> **Possible Duplicate:**
>
> [Glossary of Guitar Effects](https://music.stackexchange.com/questions/1838/glossary-of-guitar-effects)
>
>
>
What are the major *types* of effect pedals for electric guitar?
I.e., as a novice, what effect pedal types should I be aware of, that "everybody" knows about? | 2012/06/28 | [
"https://music.stackexchange.com/questions/6602",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/2245/"
] | Unless you attend training with a skilled teacher, I think the best method to build your vocabulary is to listen to tunes played by renowned musicians from various genres, and play along.
It's a bit like what you have done already, but actively seek out new or challenging styles. For example, if you are a blues guitar... | Develop your ear and your sense of melody, phrasing and time.
I did this by figuring out songs I wanted to play, by **EAR**. No tab and no *how-to-play-x* lessons from *youtube*. *You* have to develop *your ear* for music.
That said, there are some lick lesson type things that can help with your vocabulary.
* Jeff M... |
6,602 | >
> **Possible Duplicate:**
>
> [Glossary of Guitar Effects](https://music.stackexchange.com/questions/1838/glossary-of-guitar-effects)
>
>
>
What are the major *types* of effect pedals for electric guitar?
I.e., as a novice, what effect pedal types should I be aware of, that "everybody" knows about? | 2012/06/28 | [
"https://music.stackexchange.com/questions/6602",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/2245/"
] | Develop your ear and your sense of melody, phrasing and time.
I did this by figuring out songs I wanted to play, by **EAR**. No tab and no *how-to-play-x* lessons from *youtube*. *You* have to develop *your ear* for music.
That said, there are some lick lesson type things that can help with your vocabulary.
* Jeff M... | In addition to what Dr Mayhem has mentioned, I would also suggest you to search in internet too for some guitar site specifically having a good colection of licks.
For example, I found [**Guitar Solo**](http://www.myguitarsolo.com/Licks/Licks.htm) pretty useful.
Give it a try and if you find it useful add it to you... |
61,947 | Have been developing a site and noticed that all of the media files were being saved in the default WP year/month/day rule in the `wp-content/uploads` directory. I decided to change this to `assets` and unchecked the option to store these in the date format.
End goal here is to bring over all of the existing media to... | 2012/08/15 | [
"https://wordpress.stackexchange.com/questions/61947",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/9605/"
] | The relative path, including the date directories, is stored in the postmeta for the attachment's post, using the `_wp_attached_file` meta\_key.
If you examine the data for that key, you'll find that the meta\_value is `2012/08/example.jpg` or something similar to that. This is used to build the URL. | Go to your dashboard settings > media
wp-admin/options-media.php
under the file uploads heading place your new path in the associated field |
71,596,851 | ```
age
0 55
1 45
2 58
4 N/A
```
i need to remove all the rows that doesn't contain numeric values in column age above given dataframe example
Expected output is given bellow
```
age
0 55
1 45
2 58
``` | 2022/03/24 | [
"https://Stackoverflow.com/questions/71596851",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14239872/"
] | Try this
```
import pandas as pd
import numpy as np
data = {
"age": [0, 55, 1,55,4,'N/A',5]
}
df = pd.DataFrame(data)
df=df[df['age'].apply(lambda x: type(x) in [int, np.int64,
float, np.float64])]
print(df)
``` | Use `pd.numeric` as boolean mask:
```
df = df.loc[pd.to_numeric(df['age'], errors='coerce').notna()]
print(df)
# Output
age
0 55
1 45
2 58
```
All non numeric values will be converted as `NaN`. |
71,596,851 | ```
age
0 55
1 45
2 58
4 N/A
```
i need to remove all the rows that doesn't contain numeric values in column age above given dataframe example
Expected output is given bellow
```
age
0 55
1 45
2 58
``` | 2022/03/24 | [
"https://Stackoverflow.com/questions/71596851",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14239872/"
] | Try this
```
import pandas as pd
import numpy as np
data = {
"age": [0, 55, 1,55,4,'N/A',5]
}
df = pd.DataFrame(data)
df=df[df['age'].apply(lambda x: type(x) in [int, np.int64,
float, np.float64])]
print(df)
``` | import pandas as pd
import numpy as np
data={"Name":["jhon","alex","lisa","maya"],"age":[10,14,np.nan,15]}
df=pd.DataFrame(data)
df.dropna()
Hope it was some help to you. dropna() method drop the rows with na value[](https://i.stack.imgur.com... |
71,596,851 | ```
age
0 55
1 45
2 58
4 N/A
```
i need to remove all the rows that doesn't contain numeric values in column age above given dataframe example
Expected output is given bellow
```
age
0 55
1 45
2 58
``` | 2022/03/24 | [
"https://Stackoverflow.com/questions/71596851",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14239872/"
] | Try this
```
import pandas as pd
import numpy as np
data = {
"age": [0, 55, 1,55,4,'N/A',5]
}
df = pd.DataFrame(data)
df=df[df['age'].apply(lambda x: type(x) in [int, np.int64,
float, np.float64])]
print(df)
``` | The shortest solution is to use `_convert(numeric=True)`:
```
df['age'] = df['age']._convert(numeric=True)
df.dropna(inplace=True)
``` |
71,596,851 | ```
age
0 55
1 45
2 58
4 N/A
```
i need to remove all the rows that doesn't contain numeric values in column age above given dataframe example
Expected output is given bellow
```
age
0 55
1 45
2 58
``` | 2022/03/24 | [
"https://Stackoverflow.com/questions/71596851",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14239872/"
] | import pandas as pd
import numpy as np
data={"Name":["jhon","alex","lisa","maya"],"age":[10,14,np.nan,15]}
df=pd.DataFrame(data)
df.dropna()
Hope it was some help to you. dropna() method drop the rows with na value[](https://i.stack.imgur.com... | Use `pd.numeric` as boolean mask:
```
df = df.loc[pd.to_numeric(df['age'], errors='coerce').notna()]
print(df)
# Output
age
0 55
1 45
2 58
```
All non numeric values will be converted as `NaN`. |
71,596,851 | ```
age
0 55
1 45
2 58
4 N/A
```
i need to remove all the rows that doesn't contain numeric values in column age above given dataframe example
Expected output is given bellow
```
age
0 55
1 45
2 58
``` | 2022/03/24 | [
"https://Stackoverflow.com/questions/71596851",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14239872/"
] | import pandas as pd
import numpy as np
data={"Name":["jhon","alex","lisa","maya"],"age":[10,14,np.nan,15]}
df=pd.DataFrame(data)
df.dropna()
Hope it was some help to you. dropna() method drop the rows with na value[](https://i.stack.imgur.com... | The shortest solution is to use `_convert(numeric=True)`:
```
df['age'] = df['age']._convert(numeric=True)
df.dropna(inplace=True)
``` |
48,256,991 | i have a problem regarding this highcharts. I am using Laravel as my framework. My problem is this: I have a button that has an on click event to get my data and plot it in highcharts. Now my first problem is this: When i click the button, the chart will appear and my data won't show, when i press the button again, the... | 2018/01/15 | [
"https://Stackoverflow.com/questions/48256991",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6037769/"
] | It looks like you are rendering the chart before your Ajax call completes. Calling the chart function after your ajax calls are completed should fix the problem.
It also appears that you have multiple AJAX calls fired in the `for-loop` so you will have to wait for all of them to finish before you can render the chart.... | Every time you click on view button you are pushing data to arrays like datas,datas2 and datas3.
solution for this is to make array empty whenever you click on function
```
function diff(from, to) {
var datas=[];
var datas2=[];
var datas3=[]
//Your code here
}
``` |
34,428 | I am early in the interview process with a company, which is hiring for multiple roles.
I suggested one role (not the same one I am interviewing for) to a former colleague of mine as I thought he would be a good fit and I know he is looking for new employment. I also told him that I would try to put in a good word fo... | 2014/10/01 | [
"https://workplace.stackexchange.com/questions/34428",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/10536/"
] | Since you are interviewing, I doubt that your recommendations as an outsider to the company would have any weight unless you are a legend or luminary in the field.
I'd say that your colleague should initiate contact with the company on his own, and mention in his cover letter that he is interested in applying because ... | In my opinion it never hurts to ask, the worst thing that can happen is that you get a no.
So, instead of making it look like a forced recommendation, I'd turn it into a question:
*..Oh yeah, concerning the x position you're trying to fill in, I happen to know a guy who has great potential, I can give you his contact... |
34,428 | I am early in the interview process with a company, which is hiring for multiple roles.
I suggested one role (not the same one I am interviewing for) to a former colleague of mine as I thought he would be a good fit and I know he is looking for new employment. I also told him that I would try to put in a good word fo... | 2014/10/01 | [
"https://workplace.stackexchange.com/questions/34428",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/10536/"
] | In my opinion it never hurts to ask, the worst thing that can happen is that you get a no.
So, instead of making it look like a forced recommendation, I'd turn it into a question:
*..Oh yeah, concerning the x position you're trying to fill in, I happen to know a guy who has great potential, I can give you his contact... | First - if you are interviewing, keep yourself focused on the fact that *you* want to make a great impression. Trying to work in a bid for a collegue could potentially distract from the fact that you would be great for the role you are interviewing for. Let that be the primary purpose.
Next - even if you work there, m... |
34,428 | I am early in the interview process with a company, which is hiring for multiple roles.
I suggested one role (not the same one I am interviewing for) to a former colleague of mine as I thought he would be a good fit and I know he is looking for new employment. I also told him that I would try to put in a good word fo... | 2014/10/01 | [
"https://workplace.stackexchange.com/questions/34428",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/10536/"
] | Since you are interviewing, I doubt that your recommendations as an outsider to the company would have any weight unless you are a legend or luminary in the field.
I'd say that your colleague should initiate contact with the company on his own, and mention in his cover letter that he is interested in applying because ... | First - if you are interviewing, keep yourself focused on the fact that *you* want to make a great impression. Trying to work in a bid for a collegue could potentially distract from the fact that you would be great for the role you are interviewing for. Let that be the primary purpose.
Next - even if you work there, m... |
6,570,733 | I am trying to extend a scalable image viewer in Android to use two images side-by side. To do this I am using `Bitmap.createBitmap(int, int, Bitmap.Config)`. Unfortunately this seems to be crashing the VM.
The code is
```
protected void combineBitmaps() {
image0Width = bitmap0.getWidth();
image0H... | 2011/07/04 | [
"https://Stackoverflow.com/questions/6570733",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/808808/"
] | If I am reading your code and question correctly, the bitmap is 2464 x 2048 x 4 bytes. That's 16 megabytes. And you are creating two of them. That's 32 megabytes. | I've read that you can allocate more memory for Bitmaps if you use an OpenGL texture, since that doesn't count towards Android's maximum memory per app restriction. Another way is allocating memory in the ndk which also doesn't count towards Android's maximum memory per app restriction. |
358,860 | I've recently been building a large photo library, and, now that almost all of the content is in, I would like to start completing the people album. Photos says that it will "continue to scan your remaining photos when you're not using the app and your Mac is connected to power", so what I've been doing is letting the ... | 2019/04/28 | [
"https://apple.stackexchange.com/questions/358860",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/244486/"
] | Apparently because the library is on an external drive there's a bug that's causing this to happen. I'll keep everyone posted for when there is a fix! | I found that `photoanalysisd` was using 0% CPU and 0 CPU time in Activity Monitor and nothing was happening.. However, I selected that line in Activity Monitor, and clicked the Cog Wheel icon. I picked SAMPLE PROCESS. It ran a sample of the Photoanslysisd process and that caused it to kickoff.
It is running and now I ... |
358,860 | I've recently been building a large photo library, and, now that almost all of the content is in, I would like to start completing the people album. Photos says that it will "continue to scan your remaining photos when you're not using the app and your Mac is connected to power", so what I've been doing is letting the ... | 2019/04/28 | [
"https://apple.stackexchange.com/questions/358860",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/244486/"
] | The conditions are unclear at this time.
----------------------------------------
>
> Apple does not inform on how `photoanalysisd` or `photolibraryd` work. It is something they need to address properly. As far as I know, `photoanalysis` uses CoreML and Vision to analyse what images contain, not only Faces in People.... | For me, the answer seems to be to ensure that photos is not running on any other device. That meant I need to close photos on my iPad and iPhones (for extra safety, I powered them off but I don't think that was necessary). On my AppleTV I signed out of my iCloud account. After doing this, Activity Monitor showed that p... |
358,860 | I've recently been building a large photo library, and, now that almost all of the content is in, I would like to start completing the people album. Photos says that it will "continue to scan your remaining photos when you're not using the app and your Mac is connected to power", so what I've been doing is letting the ... | 2019/04/28 | [
"https://apple.stackexchange.com/questions/358860",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/244486/"
] | Apparently because the library is on an external drive there's a bug that's causing this to happen. I'll keep everyone posted for when there is a fix! | @Elmo's answer solves problem for me (250k photos in library). One thing that helps is to do all of those steps with your Mac disconnected from the Internet. This means you don't have to go around turning off Photos on iPhones, iPads, Mac Minis, iMacs and all the other stuff that might be connected to your cloud. It al... |
358,860 | I've recently been building a large photo library, and, now that almost all of the content is in, I would like to start completing the people album. Photos says that it will "continue to scan your remaining photos when you're not using the app and your Mac is connected to power", so what I've been doing is letting the ... | 2019/04/28 | [
"https://apple.stackexchange.com/questions/358860",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/244486/"
] | Firstly, you should completely Quit photos. The scanning service will run in the background even if the app is closed.
Secondly, when you go to the People tab, is there a button to see the (incomplete) People album? This might give you better insight into its progress. | @Elmo's answer solves problem for me (250k photos in library). One thing that helps is to do all of those steps with your Mac disconnected from the Internet. This means you don't have to go around turning off Photos on iPhones, iPads, Mac Minis, iMacs and all the other stuff that might be connected to your cloud. It al... |
358,860 | I've recently been building a large photo library, and, now that almost all of the content is in, I would like to start completing the people album. Photos says that it will "continue to scan your remaining photos when you're not using the app and your Mac is connected to power", so what I've been doing is letting the ... | 2019/04/28 | [
"https://apple.stackexchange.com/questions/358860",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/244486/"
] | The conditions are unclear at this time.
----------------------------------------
>
> Apple does not inform on how `photoanalysisd` or `photolibraryd` work. It is something they need to address properly. As far as I know, `photoanalysis` uses CoreML and Vision to analyse what images contain, not only Faces in People.... | ### Initial stage
Mac Photos had 0 recognized faces, iPhone Photos had a few. For over a year. Both synching to iCloud.
### "Fix"
On my Mac I have disabled iCloud synch on my Mac via *Preferences* => *iCloud*, waited a while for the local image cache to be deleted and re-enabled iCloud synch.
Then I had to follow @... |
358,860 | I've recently been building a large photo library, and, now that almost all of the content is in, I would like to start completing the people album. Photos says that it will "continue to scan your remaining photos when you're not using the app and your Mac is connected to power", so what I've been doing is letting the ... | 2019/04/28 | [
"https://apple.stackexchange.com/questions/358860",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/244486/"
] | The conditions are unclear at this time.
----------------------------------------
>
> Apple does not inform on how `photoanalysisd` or `photolibraryd` work. It is something they need to address properly. As far as I know, `photoanalysis` uses CoreML and Vision to analyse what images contain, not only Faces in People.... | @Elmo's answer solves problem for me (250k photos in library). One thing that helps is to do all of those steps with your Mac disconnected from the Internet. This means you don't have to go around turning off Photos on iPhones, iPads, Mac Minis, iMacs and all the other stuff that might be connected to your cloud. It al... |
358,860 | I've recently been building a large photo library, and, now that almost all of the content is in, I would like to start completing the people album. Photos says that it will "continue to scan your remaining photos when you're not using the app and your Mac is connected to power", so what I've been doing is letting the ... | 2019/04/28 | [
"https://apple.stackexchange.com/questions/358860",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/244486/"
] | Firstly, you should completely Quit photos. The scanning service will run in the background even if the app is closed.
Secondly, when you go to the People tab, is there a button to see the (incomplete) People album? This might give you better insight into its progress. | ### Initial stage
Mac Photos had 0 recognized faces, iPhone Photos had a few. For over a year. Both synching to iCloud.
### "Fix"
On my Mac I have disabled iCloud synch on my Mac via *Preferences* => *iCloud*, waited a while for the local image cache to be deleted and re-enabled iCloud synch.
Then I had to follow @... |
358,860 | I've recently been building a large photo library, and, now that almost all of the content is in, I would like to start completing the people album. Photos says that it will "continue to scan your remaining photos when you're not using the app and your Mac is connected to power", so what I've been doing is letting the ... | 2019/04/28 | [
"https://apple.stackexchange.com/questions/358860",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/244486/"
] | The conditions are unclear at this time.
----------------------------------------
>
> Apple does not inform on how `photoanalysisd` or `photolibraryd` work. It is something they need to address properly. As far as I know, `photoanalysis` uses CoreML and Vision to analyse what images contain, not only Faces in People.... | Firstly, you should completely Quit photos. The scanning service will run in the background even if the app is closed.
Secondly, when you go to the People tab, is there a button to see the (incomplete) People album? This might give you better insight into its progress. |
358,860 | I've recently been building a large photo library, and, now that almost all of the content is in, I would like to start completing the people album. Photos says that it will "continue to scan your remaining photos when you're not using the app and your Mac is connected to power", so what I've been doing is letting the ... | 2019/04/28 | [
"https://apple.stackexchange.com/questions/358860",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/244486/"
] | Firstly, you should completely Quit photos. The scanning service will run in the background even if the app is closed.
Secondly, when you go to the People tab, is there a button to see the (incomplete) People album? This might give you better insight into its progress. | For me, the answer seems to be to ensure that photos is not running on any other device. That meant I need to close photos on my iPad and iPhones (for extra safety, I powered them off but I don't think that was necessary). On my AppleTV I signed out of my iCloud account. After doing this, Activity Monitor showed that p... |
358,860 | I've recently been building a large photo library, and, now that almost all of the content is in, I would like to start completing the people album. Photos says that it will "continue to scan your remaining photos when you're not using the app and your Mac is connected to power", so what I've been doing is letting the ... | 2019/04/28 | [
"https://apple.stackexchange.com/questions/358860",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/244486/"
] | The conditions are unclear at this time.
----------------------------------------
>
> Apple does not inform on how `photoanalysisd` or `photolibraryd` work. It is something they need to address properly. As far as I know, `photoanalysis` uses CoreML and Vision to analyse what images contain, not only Faces in People.... | Apparently because the library is on an external drive there's a bug that's causing this to happen. I'll keep everyone posted for when there is a fix! |
4,487,118 | Besides Visual Studio, any tool from designer side? | 2010/12/20 | [
"https://Stackoverflow.com/questions/4487118",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/496949/"
] | [Expression Blend](http://www.microsoft.com/expression/products/blend_overview.aspx). | My workflow, such as it is, is: prototype in Kaxaml, code in Visual Studio, prettify in Expression Blend.
There are a couple of issues I have with Kaxaml. It takes the notion that it's a temporary scratchpad a little too seriously, letting you close the program without prompting you to save, for one. And its exceptio... |
4,487,118 | Besides Visual Studio, any tool from designer side? | 2010/12/20 | [
"https://Stackoverflow.com/questions/4487118",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/496949/"
] | Check [kaxaml](http://www.kaxaml.com/downloads/Kaxaml_1.0.msi) and [XAMLPADX](http://blogs.msdn.com/b/llobo/archive/2008/08/25/xamlpadx-4-0.aspx) .Also Check [here](http://www.realsoftwaredevelopment.com/the-complete-list-of-xaml-tools/) for a complete list | My workflow, such as it is, is: prototype in Kaxaml, code in Visual Studio, prettify in Expression Blend.
There are a couple of issues I have with Kaxaml. It takes the notion that it's a temporary scratchpad a little too seriously, letting you close the program without prompting you to save, for one. And its exceptio... |
12,074,834 | I try to create a Venn Diagram with `venn()` function in R. It works but I want to be able to define my own labels instead of `"A"`, `"B"` e.t.c... I don't understand how one do that cause there is no label argument that can be passed to the function.
**EDIT**: Forgot to say that I use a list of vectors which contain... | 2012/08/22 | [
"https://Stackoverflow.com/questions/12074834",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1366362/"
] | The `venn` function takes the labels in the plot from the names of the list elements.
```
names(list_) <- c("First list", "Second list")
venn(list_)
``` | I couldn't find the venn() function that you are using. If you're willing to use a different package there is a short tutorial here -> <http://www.ats.ucla.edu/stat/r/faq/venn.htm> that will let you do what you want with the "names" argument. |
100,524 | So I'm trying to enable the search button (default disabled) after a select option is selected other than --None-- using Javascript. It works totally fine except after the button becomes enabled, clicking it performs no action. Can anybody tell me why and how to enable it properly?
Heres the page block section of my v... | 2015/11/25 | [
"https://salesforce.stackexchange.com/questions/100524",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/26621/"
] | Looks like we can't enable or disabled the command button.
In place of command button create a `<input type="button" value="save" onclick="ActionFunction()"/>`
and in your javascript try to enable or disable this html input button. | We have used disable="true" and action="{!categorySearch}" directly in commandbutton and when it executes it replaces action with onclick="return false". Now when we enable the command button which is now input tag with type="submit" will have onclick="return false", so anyhow the action will not work.
Solution :
In j... |
23,240,124 | I keep retrieving the first element from the array, i do have 13 items in the array but every time i iterate through the array it keeps pulling out the first element and i does not increment.
How do i get i to increment and pull data out of the array for every element within the array?
This is then JSON:
```
[
{... | 2014/04/23 | [
"https://Stackoverflow.com/questions/23240124",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/443626/"
] | You can make the following:
```
if (!Regex.IsMatch(token.Text, @"^[/{}\s]*$"))
{
// your code
}
```
Alternative:
```
if (Regex.IsMatch(token.Text, @"[^/{}\s]"))
{
// your code
}
``` | If you just want to check if there are other characters than those three you can use the efficient `Enumerable.Except` + `Enumerable.Any`:
```
static char[] comments = { '/', '{', '}', ' ', '\t' };
public static void IsCommentDisabledCodeComment(Class classItem, IfSQRules context)
{
// ...
if (token.Text.... |
18,402,027 | I have a multiple check box in a grid. my code sample is as follows:
```
<asp:Panel ID="FeatureGridViewPanel" runat="server" Visible="true" Width="100%">
<div class="topline"></div>
<div class="linebreak"></div>
<div style="float:left; width:90%;">
<asp:GridView ID="FeatureListGridView" runat="serv... | 2013/08/23 | [
"https://Stackoverflow.com/questions/18402027",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2560362/"
] | How about:
```
str.replace(/.}/g, '')
``` | Try This,
```
var st = "This} is} a} test}";
var rep = st.replace(/.\}/g, "");
console.log(rep);
``` |
18,402,027 | I have a multiple check box in a grid. my code sample is as follows:
```
<asp:Panel ID="FeatureGridViewPanel" runat="server" Visible="true" Width="100%">
<div class="topline"></div>
<div class="linebreak"></div>
<div style="float:left; width:90%;">
<asp:GridView ID="FeatureListGridView" runat="serv... | 2013/08/23 | [
"https://Stackoverflow.com/questions/18402027",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2560362/"
] | How about:
```
str.replace(/.}/g, '')
``` | ```
<script type="text/javascript">
var test = "This} is} a} test}";
var regexp = new RegExp(".}","g");
test = test.replace(regexp, "");
alert(test); //"Thi i tes"
</script>
``` |
34,584,932 | **How do I pull a value from a collection in Mongo?**
This is the query I'ved tried used to pull one of the values in one of the collections.
I am trying to delete a value in the array in the collection `srs.5689f5206f404774fc350407`
```js
db.dbName.update(
{ _id: ObjectId("5689e240d3235cbef83e41d0") },
{ $pull:{ ... | 2016/01/04 | [
"https://Stackoverflow.com/questions/34584932",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2036503/"
] | ```
db.dbName.update({
_id: "5689e240d3235cbef83e41d0"
}, {
$pull: {
"srs.5689e246d3235cbef83e41d1": {
"flashcardID": "5689e24cd3235cbef83e41d2"
}
}
})
```
Try this. You need to tell what you want to pull that is the first key after "$pull" in this case "srs.5689e246d3235cb... | 1. It appears the schema is not using an `objectid` -- but a string. unless pretty printed...
2. `$` is not a operator. you may be thinking of the `$in` operator. in this case it seems it is not needed just use the flashcard string.
db.dbName.update(
{ \_id: "5689e240d3235cbef83e41d0" },
{ $pull: {"srs.5689f5206f40477... |
54,406,901 | I need to replace some text in a string. I think an example can explain better:
[myFile.json]
```
{ "Dear":"newString1", "an example string":"newString2" }
```
[example.php]
```
$myString = "@Dear@ name, this is @an example string@.";
function gimmeNewVal($myVal){
$obj = json_decode(file_get_contents('myFile.... | 2019/01/28 | [
"https://Stackoverflow.com/questions/54406901",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2078421/"
] | You can isolate the fractional part of a `float` by using the function `modff` in `<math.h>`, which returns the fractional part as the function's return value and the whole-number part as an argument by reference:
```
float f = 3.141592f;
float numpart, fracpart;
fracpart = modff(f, &numpart);
```
Once you're done t... | Slightly more mathematical approach, but arguably less flexible would be this:
```
#include <stdio.h>
#include <math.h>
int main()
{
float num = 1.24456;
int num_noDecimals = (int)num; //truncate decimals in original number
float num_onlyDecimals = num - (float)num_noDecimals; //obtain only the number aft... |
54,406,901 | I need to replace some text in a string. I think an example can explain better:
[myFile.json]
```
{ "Dear":"newString1", "an example string":"newString2" }
```
[example.php]
```
$myString = "@Dear@ name, this is @an example string@.";
function gimmeNewVal($myVal){
$obj = json_decode(file_get_contents('myFile.... | 2019/01/28 | [
"https://Stackoverflow.com/questions/54406901",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2078421/"
] | You can isolate the fractional part of a `float` by using the function `modff` in `<math.h>`, which returns the fractional part as the function's return value and the whole-number part as an argument by reference:
```
float f = 3.141592f;
float numpart, fracpart;
fracpart = modff(f, &numpart);
```
Once you're done t... | If you just want the digits after the decimal point in variable, you could just have number - floor(number)
for example, if your number was 3.25, the calculation would be 3.25 - 3. This will give 0.25 |
54,406,901 | I need to replace some text in a string. I think an example can explain better:
[myFile.json]
```
{ "Dear":"newString1", "an example string":"newString2" }
```
[example.php]
```
$myString = "@Dear@ name, this is @an example string@.";
function gimmeNewVal($myVal){
$obj = json_decode(file_get_contents('myFile.... | 2019/01/28 | [
"https://Stackoverflow.com/questions/54406901",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2078421/"
] | You can isolate the fractional part of a `float` by using the function `modff` in `<math.h>`, which returns the fractional part as the function's return value and the whole-number part as an argument by reference:
```
float f = 3.141592f;
float numpart, fracpart;
fracpart = modff(f, &numpart);
```
Once you're done t... | In my code, I removed the integer part, then I reverse the float part to integer part by multiply each number of the float part by the number 10 then I classify each digit of in the array
My code :
```
int main()
{
float n = 1.2445601;
int m=(int)n;
float p=n-m;
int x=7,i=0,tab[x];
while(i<x)
... |
54,406,901 | I need to replace some text in a string. I think an example can explain better:
[myFile.json]
```
{ "Dear":"newString1", "an example string":"newString2" }
```
[example.php]
```
$myString = "@Dear@ name, this is @an example string@.";
function gimmeNewVal($myVal){
$obj = json_decode(file_get_contents('myFile.... | 2019/01/28 | [
"https://Stackoverflow.com/questions/54406901",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2078421/"
] | Slightly more mathematical approach, but arguably less flexible would be this:
```
#include <stdio.h>
#include <math.h>
int main()
{
float num = 1.24456;
int num_noDecimals = (int)num; //truncate decimals in original number
float num_onlyDecimals = num - (float)num_noDecimals; //obtain only the number aft... | If you just want the digits after the decimal point in variable, you could just have number - floor(number)
for example, if your number was 3.25, the calculation would be 3.25 - 3. This will give 0.25 |
54,406,901 | I need to replace some text in a string. I think an example can explain better:
[myFile.json]
```
{ "Dear":"newString1", "an example string":"newString2" }
```
[example.php]
```
$myString = "@Dear@ name, this is @an example string@.";
function gimmeNewVal($myVal){
$obj = json_decode(file_get_contents('myFile.... | 2019/01/28 | [
"https://Stackoverflow.com/questions/54406901",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2078421/"
] | In my code, I removed the integer part, then I reverse the float part to integer part by multiply each number of the float part by the number 10 then I classify each digit of in the array
My code :
```
int main()
{
float n = 1.2445601;
int m=(int)n;
float p=n-m;
int x=7,i=0,tab[x];
while(i<x)
... | If you just want the digits after the decimal point in variable, you could just have number - floor(number)
for example, if your number was 3.25, the calculation would be 3.25 - 3. This will give 0.25 |
63,752,243 | I'm trying to use the useSnack hook from notistack library but I keep getting this error
>
> TypeError: Cannot destructure property 'enqueueSnackbar' of 'Object(...)(...)' as it is undefined.
>
>
>
Here is the code:
```
import React, { useContext, useEffect } from "react";
import AlertContext from "../context/al... | 2020/09/05 | [
"https://Stackoverflow.com/questions/63752243",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13999901/"
] | `useSnackbar` hook accessible anywhere down the tree from `SnackbarProvider`.
So you cannot use it in the same component as `SnackbarProvier`.
```
import AlertContext from "../context/alert/alertContext";
import { SnackbarProvider } from "notistack";
const Alerts = (props) => {
const alertContext = useContext(Aler... | Wrap you index file with SnapBar provider:
**index.js**
```
import { SnackbarProvider } from "notistack";
const Index = () => (
<SnackbarProvider maxSnack={1} preventDuplicate>
index
</SnackbarProvider>
)
export default Index
```
**jsx file**
```
import { useSnackbar } from "notistack";
const Lo... |
27,666 | I have a tower of flat boxes, but the simulation is not stable. I have tried with split impulse turned off and on.
I have tried:
* setting the collision shape to box, convex hull, and mesh
* increasing the number of steps per second and iterations per step (though this does improve the stability, it still eventually ... | 2015/03/25 | [
"https://blender.stackexchange.com/questions/27666",
"https://blender.stackexchange.com",
"https://blender.stackexchange.com/users/3706/"
] | Put collision shape to box and increase linear and angular damping up to your needs. Remember higher the damping, higher the viscous effect will be (honey like). I suggest to start with 0.3 for both and then try to tune them up until they are stable. | if the boxes are inside of another object in the simulation Ex. inside another cube the boxes will instantly fly away from each other. |
27,666 | I have a tower of flat boxes, but the simulation is not stable. I have tried with split impulse turned off and on.
I have tried:
* setting the collision shape to box, convex hull, and mesh
* increasing the number of steps per second and iterations per step (though this does improve the stability, it still eventually ... | 2015/03/25 | [
"https://blender.stackexchange.com/questions/27666",
"https://blender.stackexchange.com",
"https://blender.stackexchange.com/users/3706/"
] | You can build quite stable towers of stacked boxes. The tricks:
1. Convex Hull. This is the best all-round physics shape. It's the most "stable" with the exception of capsule and sphere - which are unsuitable here. Yes, I've found convex hull better than cube type.
2. Big collision margins. These help bullet to figure... | if the boxes are inside of another object in the simulation Ex. inside another cube the boxes will instantly fly away from each other. |
27,666 | I have a tower of flat boxes, but the simulation is not stable. I have tried with split impulse turned off and on.
I have tried:
* setting the collision shape to box, convex hull, and mesh
* increasing the number of steps per second and iterations per step (though this does improve the stability, it still eventually ... | 2015/03/25 | [
"https://blender.stackexchange.com/questions/27666",
"https://blender.stackexchange.com",
"https://blender.stackexchange.com/users/3706/"
] | Put collision shape to box and increase linear and angular damping up to your needs. Remember higher the damping, higher the viscous effect will be (honey like). I suggest to start with 0.3 for both and then try to tune them up until they are stable. | You can build quite stable towers of stacked boxes. The tricks:
1. Convex Hull. This is the best all-round physics shape. It's the most "stable" with the exception of capsule and sphere - which are unsuitable here. Yes, I've found convex hull better than cube type.
2. Big collision margins. These help bullet to figure... |
26,783,024 | i have JSON data on user profiles that i want to eventually analyze with SPSS.
Currently i imported the data in Google Refine, to run some data cleansing. My problem is however that the original JSON consists of **nested objects**, namely e.g. the "professional\_experience" section with "**companies**", that includes ... | 2014/11/06 | [
"https://Stackoverflow.com/questions/26783024",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4223384/"
] | KyleK is right. You needed to select jQuery. I made a your script more generic, allowing you to click read more until all items are shown and also set the number of items to show for each click. Hope this is helpful.
```
var displayCount = -1; // tracks how many are showing
var readMoreIncrement = 4; // number of item... | You did not select jQuery in Frameworks & Extensions menu. So this simple code works:
```
$('ul#Galeria > li:gt(3)').fadeOut(0);
$( ".readmore > a" ).click(function() {
$("ul#Galeria > li:gt(3)").fadeIn("slow");
});
```
<http://jsfiddle.net/KyleKatarn/6w2nm7z1/3/> |
449,136 | I have 4 plots arranged using tabular:
[](https://i.stack.imgur.com/XxnGs.png)
```
\documentclass{scrartcl}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\pgfplotsset{
height=4cm, width=\linewidth*0.5,
every axis plot post/.append sty... | 2018/09/03 | [
"https://tex.stackexchange.com/questions/449136",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/169654/"
] | The groupplot library is made for this.
```
\documentclass{scrartcl}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\usepgfplotslibrary{groupplots}
\begin{document}
\pgfplotsset{
height=4cm, width=\linewidth*0.5,
every axis plot post/.append style={mark=none},
xmin=-1, xmax=1, domain=-1:1, samples=100, mino... | Simply use `\begin{tabular}{ll}`:
```
\documentclass{scrartcl}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\pgfplotsset{
height=4cm, width=\linewidth*0.5,
every axis plot post/.append style={mark=none},
xmin=-1, xmax=1, domain=-1:1, samples=100, minor y tick num=1,
xtick=\empty
}
\begin... |
2,217,949 | What are some simple examples of preorders — that is, binary relations that are reflexive and transitive — that are *not* partial orders (and hence not total orders, either)?
I'm looking for a couple of examples that do *not* involve graph theory or other less basic ideas in math. And preferably examples simpler than ... | 2017/04/04 | [
"https://math.stackexchange.com/questions/2217949",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/32337/"
] | Any real function (let's say a "measure") $\mu:X\to\mathbb{R}$ defines a preorder on $X$ by $x\preceq y$ iff $\mu(x)\leq\mu(y)$. For this not to be a partial order, your measure must not be injective.
This can be almost anything. Couple examples:
* diameter of compact subsets of $\mathbb{R}^n$ is a preorder on them.
... | Let $X$ denote the set of squares on a fixed plane. You can define the following preoder on $X$: $qRq'$ if and only if there exists an isometry $i$ such that $q'\supseteq i(q)$. |
2,217,949 | What are some simple examples of preorders — that is, binary relations that are reflexive and transitive — that are *not* partial orders (and hence not total orders, either)?
I'm looking for a couple of examples that do *not* involve graph theory or other less basic ideas in math. And preferably examples simpler than ... | 2017/04/04 | [
"https://math.stackexchange.com/questions/2217949",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/32337/"
] | In this answer I do not provide simple examples of preorders, but enable you to find them on base of simple examples of partial orders.
You can just start with a partial order $\langle B,\leq\rangle$ and a surjective function $\nu:A\to B$.
---
Then $\preceq$ defined by: $$x\preceq y\iff \nu(x)\leq \nu(y)$$ is a preo... | Let $X$ denote the set of squares on a fixed plane. You can define the following preoder on $X$: $qRq'$ if and only if there exists an isometry $i$ such that $q'\supseteq i(q)$. |
2,217,949 | What are some simple examples of preorders — that is, binary relations that are reflexive and transitive — that are *not* partial orders (and hence not total orders, either)?
I'm looking for a couple of examples that do *not* involve graph theory or other less basic ideas in math. And preferably examples simpler than ... | 2017/04/04 | [
"https://math.stackexchange.com/questions/2217949",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/32337/"
] | Any real function (let's say a "measure") $\mu:X\to\mathbb{R}$ defines a preorder on $X$ by $x\preceq y$ iff $\mu(x)\leq\mu(y)$. For this not to be a partial order, your measure must not be injective.
This can be almost anything. Couple examples:
* diameter of compact subsets of $\mathbb{R}^n$ is a preorder on them.
... | In this answer I do not provide simple examples of preorders, but enable you to find them on base of simple examples of partial orders.
You can just start with a partial order $\langle B,\leq\rangle$ and a surjective function $\nu:A\to B$.
---
Then $\preceq$ defined by: $$x\preceq y\iff \nu(x)\leq \nu(y)$$ is a preo... |
72,187,084 | I have a xib view and a button in it but when i try to configure it to present a ViewController with a WebView it shows some errors.
the xib file:
```
class popUpView: UIView, UITextFieldDelegate {
@IBOutlet weak var payNowPopUp: UIButton!
@IBOutlet weak var priceTextFieldPopUp: UITextField!
required init?(coder: N... | 2022/05/10 | [
"https://Stackoverflow.com/questions/72187084",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18100840/"
] | From the [documentation](https://react-dropzone.js.org/)
```
useDropzone({
accept: {
'image/png': ['.png'],
'text/html': ['.html', '.htm'],
}
})
```
I can't see anywhere that describes a structure like `accept: {accepted: ['...']}`
I'd say to change your code above to:
```
accept: {
'image/png': ['.p... | @arfi720 's answer does work for some browsers, but if you try to accept `.png`, `.jpeg`, and `.jpg` and following the documentation it won't work.
Here's an example
```js
// Does not work
const { getRootProps, getInputProps } = useDropzone({
accept: {
'image/png': ['.png'],
'image/jpg': ['.jpg'],
... |
74,210,907 | In SQL Server, I have an existing `Document_Add` stored procedure that works and returns a good `DocID` value (in Visual Studio vb code) and cannot change. Calling it like this in SQL:
```
EXEC @DocID = PADS2.dbo.Document_Add @SystemCode...
```
This runs the stored procedure, but `@DocID` is always 0 (whether declar... | 2022/10/26 | [
"https://Stackoverflow.com/questions/74210907",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20304191/"
] | This happens because of the following line in the modified code
```
(t) = new node;
```
You are assigning memory to your pointer which is being created in a function call, a memory that will be lost after the function call.
Note that if you make changes to a member of a struct in a function call, the change will ... | In the modified code, when you do
```
(t) = new node;
```
you are setting the value of the local variable t to point to the new node. This value does not get put in your tree it only exists in the push function.
In the original
```
(*t) = new node;
```
sets the variable pointed to by t to the address of the new ... |
56,018,611 | I wish to run my elasticsearch remotely on gcloud VM, this is configured to run at 127.0.0.1 at a specific port 9200. How to access this from a website outside this vm? If I change the network host to 0.0.0.0 on the yml file, even 9200 port becomes inaccessible. How do I overcome this problem?
```
Changed network.hos... | 2019/05/07 | [
"https://Stackoverflow.com/questions/56018611",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10814129/"
] | One way would be using [`str.ljust`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.str.ljust.html) to fill the right side of the numbers cast to string with as many `#` as needed to reach the maximum length:
```
max_len = len(str(max(data_df.Number)))
data_df['Number'] = data_df.Number.astyp... | Find the length of max number from the column and append `#`
```
from pandas import DataFrame as df
data_df = df(data={"Number": [234, 7892, 109736, 8384664088]})
n = len(str(data_df['Number'].max()))
data_df['Number'] = [str(i)+'#'*(n-len(str(i))) for i in data_df['Number']]
print(data_df)
```
Output:
```
... |
56,018,611 | I wish to run my elasticsearch remotely on gcloud VM, this is configured to run at 127.0.0.1 at a specific port 9200. How to access this from a website outside this vm? If I change the network host to 0.0.0.0 on the yml file, even 9200 port becomes inaccessible. How do I overcome this problem?
```
Changed network.hos... | 2019/05/07 | [
"https://Stackoverflow.com/questions/56018611",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10814129/"
] | One way would be using [`str.ljust`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.str.ljust.html) to fill the right side of the numbers cast to string with as many `#` as needed to reach the maximum length:
```
max_len = len(str(max(data_df.Number)))
data_df['Number'] = data_df.Number.astyp... | You can use
```
lng = len(str(max(data_df.Number)))
data_df['Number'] = data_df['Number'].map(lambda x: f'{x:#<lng}')
Number
0 234#######
1 7892######
2 109736####
3 8384664088
``` |
56,018,611 | I wish to run my elasticsearch remotely on gcloud VM, this is configured to run at 127.0.0.1 at a specific port 9200. How to access this from a website outside this vm? If I change the network host to 0.0.0.0 on the yml file, even 9200 port becomes inaccessible. How do I overcome this problem?
```
Changed network.hos... | 2019/05/07 | [
"https://Stackoverflow.com/questions/56018611",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10814129/"
] | Find the max width with [`str.len`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.str.len.html) and then use [`str.pad`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.str.pad.html) to pad each entry:
```
max_width = data_df['Number'].astype(str).str.len().max()
dat... | Find the length of max number from the column and append `#`
```
from pandas import DataFrame as df
data_df = df(data={"Number": [234, 7892, 109736, 8384664088]})
n = len(str(data_df['Number'].max()))
data_df['Number'] = [str(i)+'#'*(n-len(str(i))) for i in data_df['Number']]
print(data_df)
```
Output:
```
... |
56,018,611 | I wish to run my elasticsearch remotely on gcloud VM, this is configured to run at 127.0.0.1 at a specific port 9200. How to access this from a website outside this vm? If I change the network host to 0.0.0.0 on the yml file, even 9200 port becomes inaccessible. How do I overcome this problem?
```
Changed network.hos... | 2019/05/07 | [
"https://Stackoverflow.com/questions/56018611",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10814129/"
] | Find the max width with [`str.len`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.str.len.html) and then use [`str.pad`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.str.pad.html) to pad each entry:
```
max_width = data_df['Number'].astype(str).str.len().max()
dat... | You can use
```
lng = len(str(max(data_df.Number)))
data_df['Number'] = data_df['Number'].map(lambda x: f'{x:#<lng}')
Number
0 234#######
1 7892######
2 109736####
3 8384664088
``` |
190,113 | Im breaking my head over the solution of an old exam problem:
Given is the following hertzian dipole:

Given are also the equations: $I(t) = \Re\left(I\_0 e^{j\omega t}\right)$, $Q(t) = \Re\left(\underline{Q} e^{j\omega t}\right)$ and $\frac{dQ}{dt} = I(t)$
The task is ... | 2015/06/18 | [
"https://physics.stackexchange.com/questions/190113",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/83960/"
] | >
> *And while it is philosophically acceptable to just "know" that the speed of light is constant but it not to just "know" that it is invariant. Fixed constant values such as the mass of an electron or the spin set of an electron are things one can accept as given.*
>
>
>
Kind of: be careful. We can fix some of ... | I'm not sure I understand your question, but I'll try anyways. It's true that constancy (not changing in time) and invariance (same in all reference frames) are different.
SR and GR assume a constant speed of light, but lets imagine a theory where the speed of light changes in time. The passage of time is different fo... |
4,349,883 | >
> Let $g$ be a multiplicative function from $\mathbb R^+$ to $\mathbb R^+$. If $g(x+y)\le2\cdot\max\{g(x),g(y)\}$ for all positive reals $x,y$, prove that $g$ is subadditive.
>
>
>
For the function $g$, being multiplicative means $g(xy)=g(x)g(y)$ for all $x,y\in\mathbb R^+$, and being subadditive means $g(x+y)\l... | 2022/01/06 | [
"https://math.stackexchange.com/questions/4349883",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/1012058/"
] | First, consider the following lemma.
>
> Assume that $ g : \mathbb R ^ + \to \mathbb R ^ + $ is a function such that for some constant $ c \in \mathbb R ^ + $ we have
> $$ g ( x + y ) \le c \bigl ( g ( x ) + g ( y ) \bigr ) \tag 0 \label 0 $$
> for all $ x , y \in \mathbb R ^ + $. Then
> $$ g ( x + y + z ) \le \frac ... | First consider the following lemmas.
>
> Assume that $ h : \mathbb Z ^ + \to \mathbb R ^ + $ is a function satisfying $ h ( 1 ) = 1 $ and
> $$ h ( j + k ) \le 2 \max \{ h ( j ) , h ( k ) \} \tag 0 \label {eqn0} $$
> for all $ j , k \in \mathbb Z ^ + $. Then $ h ( k ) < 2 k $ for all $ k \in \mathbb Z ^ + $.
>
>
>
... |
54,848,404 | I decided to compile and run this piece of code (out of curiosity) and the G++ compiler successfully compiled the program. I was expecting to see a compile error or a runtime error, or at least the values of a and b swapped (as 5 > 1), since the `std::sort()` function is being called with two pointers to integers.
(Ple... | 2019/02/24 | [
"https://Stackoverflow.com/questions/54848404",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8107963/"
] | Your program is ill formed, no diagnostic required. You passed pointers that do not form a range to a std algorithm.
Any behaviour whatsoever by the program is conforming to the C++ standard.
Compilers optimize around the fact that pointers to unrelated objects are incomparable and their difference is undefined. A so... | C++ accepts your code as it is syntactically right. But it doesn't work because sort(it1, it2) expects it1 one to be some starting position of an array and it2 to be the ending position of the same array. you have provided two different arrays to the sort function which can yield any of two following situations:
**pos... |
26,858,531 | I see each [cfx tools](https://developer.mozilla.org/en-US/Add-ons/SDK/Tools/cfx) always produce xpi with its own minVersion and maxVersion. However, those are limited to the versions which the SDK is compatible with, e.g. SDK 1.14 only for FF 21 - 25.0a1 , SDK 1.17 only for FF 26 - 30. My questions are:
1. Do I need ... | 2014/11/11 | [
"https://Stackoverflow.com/questions/26858531",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/908771/"
] | The way you proposed is perfectly fine, except if in your code you need to make assignment of RockSolid variables, like this:
```
RockSolid a(0,1);
RockSolid b(0,1);
a = b;
```
This would not work as the copy assignment operator would have been deleted by the compiler.
So an alternative is to rewrite your struct as... | I assume your goal is true immutability -- each object, when constructed, cannot be modified. You cannot assign one object over another.
The biggest downside to your design is that it is not compatible with move semantics, which can make functions returning such objects more practical.
As an example:
```
struct Rock... |
26,858,531 | I see each [cfx tools](https://developer.mozilla.org/en-US/Add-ons/SDK/Tools/cfx) always produce xpi with its own minVersion and maxVersion. However, those are limited to the versions which the SDK is compatible with, e.g. SDK 1.14 only for FF 21 - 25.0a1 , SDK 1.17 only for FF 26 - 30. My questions are:
1. Do I need ... | 2014/11/11 | [
"https://Stackoverflow.com/questions/26858531",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/908771/"
] | The way you proposed is perfectly fine, except if in your code you need to make assignment of RockSolid variables, like this:
```
RockSolid a(0,1);
RockSolid b(0,1);
a = b;
```
This would not work as the copy assignment operator would have been deleted by the compiler.
So an alternative is to rewrite your struct as... | As of c++20, workarounds with getters is no longer needed.
You can now define your own copy-assignment operator for classes that contain const member objects without undefined behavior as of c++20.
This was undefined behavior prior to c++ and remains so for complete const objects but not non-const objects with const ... |
26,858,531 | I see each [cfx tools](https://developer.mozilla.org/en-US/Add-ons/SDK/Tools/cfx) always produce xpi with its own minVersion and maxVersion. However, those are limited to the versions which the SDK is compatible with, e.g. SDK 1.14 only for FF 21 - 25.0a1 , SDK 1.17 only for FF 26 - 30. My questions are:
1. Do I need ... | 2014/11/11 | [
"https://Stackoverflow.com/questions/26858531",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/908771/"
] | I assume your goal is true immutability -- each object, when constructed, cannot be modified. You cannot assign one object over another.
The biggest downside to your design is that it is not compatible with move semantics, which can make functions returning such objects more practical.
As an example:
```
struct Rock... | As of c++20, workarounds with getters is no longer needed.
You can now define your own copy-assignment operator for classes that contain const member objects without undefined behavior as of c++20.
This was undefined behavior prior to c++ and remains so for complete const objects but not non-const objects with const ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.