qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
3,225,907
Is there an example for $\sum a\_nx^n$ with radius $R>0$ such that $a\_n \neq 0$ for some $n$ ($a\_n$ is not always $0$) but for all $x \in (-R,R)$ we have $\sum a\_nx^n=0$
2019/05/14
[ "https://math.stackexchange.com/questions/3225907", "https://math.stackexchange.com", "https://math.stackexchange.com/users/547001/" ]
Since the power series $g$ is convergent in the radius, it is infinitely times differentiable there. Since it is uniformly 0 there, it must have each of its derivatives be 0. Therefore, the constant term of $\frac{d^n}{dx^n}g$ must be 0 for all $n$. This implies that $a\_n=0$ for all $n$.
Hint: Differentiate the power series $n$ times to find $a\_n$.
3,225,907
Is there an example for $\sum a\_nx^n$ with radius $R>0$ such that $a\_n \neq 0$ for some $n$ ($a\_n$ is not always $0$) but for all $x \in (-R,R)$ we have $\sum a\_nx^n=0$
2019/05/14
[ "https://math.stackexchange.com/questions/3225907", "https://math.stackexchange.com", "https://math.stackexchange.com/users/547001/" ]
No, this is not possible. The series converges uniformly on $(-R\_0, R\_0)$ for any $R\_0 < R$, so the coefficient $a\_n$ gives the $n$th derivative of the function $f(x)=\sum a\_nx^n$ defined by the power series at $x=0$. Therefore, if one of the coefficients $a\_n$ is nonzero then $f^{(n)}(0) = a\_n\neq 0$, so $f$ is...
Hint: Differentiate the power series $n$ times to find $a\_n$.
44,988,957
I am using geom\_smooth and it gives me default legend line color blue that I cannot use in the plot. Is there a way of changing the default color for geom\_smooth legend line? for example, I wand to change the legend colour to black for line type in the following plot ``` library(reshape2) library(ggplot2)...
2017/07/08
[ "https://Stackoverflow.com/questions/44988957", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4057644/" ]
Per my comment, if you add an override to your legend you can change how the color displays. This should work: ``` p1<-p+geom_smooth(aes(linetype = as.factor(cyl)),se = F,stat = "smooth",method = "glm",size=.5, inherit.aes = T)+ scale_linetype_manual("line type",labels = c("100 yr", "50 yr", "25 yr"), values=c(1,5,...
if you add `+ guides(linetype = guide_legend(override.aes= list(color = "black")))` to your last plot do This solves thanks @Mike
36,912
I want to type "xy-plane" in a document so that it "looks right" when I print the document. (1) `xy-plane` does not look right to me. (2) `$xy-$plane` looks bad. (3) `$xy$-plane` looks ok, but I feel uneasy. What is the accepted convention for typing "xy-plane" in a (La)TeX document?
2011/12/02
[ "https://tex.stackexchange.com/questions/36912", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/7764/" ]
Here "x" and "y" are variables, so they have to go in math mode; the hyphen must go outside math mode. So ``` $xy$\nobreakdash-plane ``` Note that `\nobreakdash` is provided by the **amsmath** package; it disallows a break after the hyphen. Possible variation: ``` $x\,y$\nobreakdash-plane ``` where the two letter...
Here's a different suggestion: I wouldn't place a hyphen before the word "plane" but, instead, an unbreakable space. Second, I'd insert an (unbreakable) en-dash between $x$ and $y$: ``` \newcommand\xyplane{$x$\nobreakdash--$y$~plane} ``` ![enter image description here](https://i.stack.imgur.com/q4dQj.png) The en-da...
2,353,902
I'm struggling in finding a closed form for, > > $$ \int\_0^\infty Ae^{-bx}\sin\left(\frac{2\pi}{T}x\right) \,dx $$ > > > *My Attempt:* Let $H = \int Ae^{-bx}\sin\left(\frac{2\pi}{T}x\right)\,dx$. First I integrate by parts, splitting $f=e^{-bx}$ and $dg=\sin\left(\frac{2\pi}{T}x\right)\,dx$. Then another IBP us...
2017/07/10
[ "https://math.stackexchange.com/questions/2353902", "https://math.stackexchange.com", "https://math.stackexchange.com/users/274085/" ]
If you differentiate $f(x)$, you should end up with $f'(x) = 4x^3 - 12x^2-4x+12$ which you can factor as $f'(x) = 4\cdot[x^2(x-3) -(x-3)]=4(x^2-1)(x-3)$. Assess whether each of the roots of $f'(x)$ corresponds to a minimum or a maximum of $f$, or neither. Deduce that $f$ has two global minima which are positive at $x =...
First thing you have to do for yourself is trying to image this graph, and the line $y = 0$, what does it mean for these two functions to have no solution when they are put in an equation together? If you can answer this, then it should be rather straightforward.
2,353,902
I'm struggling in finding a closed form for, > > $$ \int\_0^\infty Ae^{-bx}\sin\left(\frac{2\pi}{T}x\right) \,dx $$ > > > *My Attempt:* Let $H = \int Ae^{-bx}\sin\left(\frac{2\pi}{T}x\right)\,dx$. First I integrate by parts, splitting $f=e^{-bx}$ and $dg=\sin\left(\frac{2\pi}{T}x\right)\,dx$. Then another IBP us...
2017/07/10
[ "https://math.stackexchange.com/questions/2353902", "https://math.stackexchange.com", "https://math.stackexchange.com/users/274085/" ]
If you differentiate $f(x)$, you should end up with $f'(x) = 4x^3 - 12x^2-4x+12$ which you can factor as $f'(x) = 4\cdot[x^2(x-3) -(x-3)]=4(x^2-1)(x-3)$. Assess whether each of the roots of $f'(x)$ corresponds to a minimum or a maximum of $f$, or neither. Deduce that $f$ has two global minima which are positive at $x =...
Usually the way to do this kind of question is to show $(\forall x)\,\,f(x)>0$ or $(\forall x)\,\,f(x)<0$. Showing this usually involves finding the solutions to $f'(x)=0$ for the turning points. $f''(x)$ will tell you the nature of these turning points, and you may be able to conclude from there. In addition, showin...
2,353,902
I'm struggling in finding a closed form for, > > $$ \int\_0^\infty Ae^{-bx}\sin\left(\frac{2\pi}{T}x\right) \,dx $$ > > > *My Attempt:* Let $H = \int Ae^{-bx}\sin\left(\frac{2\pi}{T}x\right)\,dx$. First I integrate by parts, splitting $f=e^{-bx}$ and $dg=\sin\left(\frac{2\pi}{T}x\right)\,dx$. Then another IBP us...
2017/07/10
[ "https://math.stackexchange.com/questions/2353902", "https://math.stackexchange.com", "https://math.stackexchange.com/users/274085/" ]
If you differentiate $f(x)$, you should end up with $f'(x) = 4x^3 - 12x^2-4x+12$ which you can factor as $f'(x) = 4\cdot[x^2(x-3) -(x-3)]=4(x^2-1)(x-3)$. Assess whether each of the roots of $f'(x)$ corresponds to a minimum or a maximum of $f$, or neither. Deduce that $f$ has two global minima which are positive at $x =...
The polynomial can be written as $$f(x)=\left(x^2-2 x-3\right)^2+3$$ therefore it is strictly greater than zero for all $x\in\mathbb{R}$
2,353,902
I'm struggling in finding a closed form for, > > $$ \int\_0^\infty Ae^{-bx}\sin\left(\frac{2\pi}{T}x\right) \,dx $$ > > > *My Attempt:* Let $H = \int Ae^{-bx}\sin\left(\frac{2\pi}{T}x\right)\,dx$. First I integrate by parts, splitting $f=e^{-bx}$ and $dg=\sin\left(\frac{2\pi}{T}x\right)\,dx$. Then another IBP us...
2017/07/10
[ "https://math.stackexchange.com/questions/2353902", "https://math.stackexchange.com", "https://math.stackexchange.com/users/274085/" ]
First thing you have to do for yourself is trying to image this graph, and the line $y = 0$, what does it mean for these two functions to have no solution when they are put in an equation together? If you can answer this, then it should be rather straightforward.
Usually the way to do this kind of question is to show $(\forall x)\,\,f(x)>0$ or $(\forall x)\,\,f(x)<0$. Showing this usually involves finding the solutions to $f'(x)=0$ for the turning points. $f''(x)$ will tell you the nature of these turning points, and you may be able to conclude from there. In addition, showin...
2,353,902
I'm struggling in finding a closed form for, > > $$ \int\_0^\infty Ae^{-bx}\sin\left(\frac{2\pi}{T}x\right) \,dx $$ > > > *My Attempt:* Let $H = \int Ae^{-bx}\sin\left(\frac{2\pi}{T}x\right)\,dx$. First I integrate by parts, splitting $f=e^{-bx}$ and $dg=\sin\left(\frac{2\pi}{T}x\right)\,dx$. Then another IBP us...
2017/07/10
[ "https://math.stackexchange.com/questions/2353902", "https://math.stackexchange.com", "https://math.stackexchange.com/users/274085/" ]
First thing you have to do for yourself is trying to image this graph, and the line $y = 0$, what does it mean for these two functions to have no solution when they are put in an equation together? If you can answer this, then it should be rather straightforward.
The polynomial can be written as $$f(x)=\left(x^2-2 x-3\right)^2+3$$ therefore it is strictly greater than zero for all $x\in\mathbb{R}$
8,871,253
In my project I have a simple `UIView` with a `UIScrollView` subview. I am trying to calculate the height based on the content within the `UIScrollView` with the following code: ![enter image description here](https://i.stack.imgur.com/HkZYE.png) file.h ``` @interface ScrollViewController : UIViewController { IBOutl...
2012/01/15
[ "https://Stackoverflow.com/questions/8871253", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1021610/" ]
JMS provides a mechanism for you to set expiry on messages. Look at the below two references 1. [setJMSExpiration(long expiration)](https://docs.oracle.com/javaee/1.3/api/javax/jms/Message.html#setJMSExpiration%28long%29): per message 2. [ActiveMQ: How do I set the message expiration](https://activemq.apache.org/how-d...
Well the setJMSExpiration(long expiration): is something you MUST not call when you are the client. See my talk on this a bit on the ActiveMQ forum. <https://apache-qpid-developers.2158895.n2.nabble.com/MRG-Java-JMS-Expiration-td7171854.html>
8,871,253
In my project I have a simple `UIView` with a `UIScrollView` subview. I am trying to calculate the height based on the content within the `UIScrollView` with the following code: ![enter image description here](https://i.stack.imgur.com/HkZYE.png) file.h ``` @interface ScrollViewController : UIViewController { IBOutl...
2012/01/15
[ "https://Stackoverflow.com/questions/8871253", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1021610/" ]
JMS provides a mechanism for you to set expiry on messages. Look at the below two references 1. [setJMSExpiration(long expiration)](https://docs.oracle.com/javaee/1.3/api/javax/jms/Message.html#setJMSExpiration%28long%29): per message 2. [ActiveMQ: How do I set the message expiration](https://activemq.apache.org/how-d...
Also mind that clocks between client - broker need to be in sync, for the expiry to work properly. If the clocks is not in sync, then the expiry set from the client, may already be expired when the message is received on the broker. Or the client time is ahead of the broker, so the expiry is longer than the 10 secs. I...
8,871,253
In my project I have a simple `UIView` with a `UIScrollView` subview. I am trying to calculate the height based on the content within the `UIScrollView` with the following code: ![enter image description here](https://i.stack.imgur.com/HkZYE.png) file.h ``` @interface ScrollViewController : UIViewController { IBOutl...
2012/01/15
[ "https://Stackoverflow.com/questions/8871253", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1021610/" ]
JMS provides a mechanism for you to set expiry on messages. Look at the below two references 1. [setJMSExpiration(long expiration)](https://docs.oracle.com/javaee/1.3/api/javax/jms/Message.html#setJMSExpiration%28long%29): per message 2. [ActiveMQ: How do I set the message expiration](https://activemq.apache.org/how-d...
On our side we choose to add expiration time to specific destinations by using a camel route deployed in the ActiveMQ service itself. The only thing to do is creating a XML file like the following with name e.g. `setJMSExpiration.xml`: ``` <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="htt...
8,871,253
In my project I have a simple `UIView` with a `UIScrollView` subview. I am trying to calculate the height based on the content within the `UIScrollView` with the following code: ![enter image description here](https://i.stack.imgur.com/HkZYE.png) file.h ``` @interface ScrollViewController : UIViewController { IBOutl...
2012/01/15
[ "https://Stackoverflow.com/questions/8871253", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1021610/" ]
JMS provides a mechanism for you to set expiry on messages. Look at the below two references 1. [setJMSExpiration(long expiration)](https://docs.oracle.com/javaee/1.3/api/javax/jms/Message.html#setJMSExpiration%28long%29): per message 2. [ActiveMQ: How do I set the message expiration](https://activemq.apache.org/how-d...
Endpoint option **timeToLive** (<http://camel.apache.org/jms.html>) worked for me as a solution for the described problem, messages are removed from a queue after 300000 miliseconds. e.g. "activemq:Q.QUEUE?disableReplyTo=true&**timeToLive**=300000" Setting header JMSExpiration, didn't cause removing message from a que...
8,871,253
In my project I have a simple `UIView` with a `UIScrollView` subview. I am trying to calculate the height based on the content within the `UIScrollView` with the following code: ![enter image description here](https://i.stack.imgur.com/HkZYE.png) file.h ``` @interface ScrollViewController : UIViewController { IBOutl...
2012/01/15
[ "https://Stackoverflow.com/questions/8871253", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1021610/" ]
Well the setJMSExpiration(long expiration): is something you MUST not call when you are the client. See my talk on this a bit on the ActiveMQ forum. <https://apache-qpid-developers.2158895.n2.nabble.com/MRG-Java-JMS-Expiration-td7171854.html>
Endpoint option **timeToLive** (<http://camel.apache.org/jms.html>) worked for me as a solution for the described problem, messages are removed from a queue after 300000 miliseconds. e.g. "activemq:Q.QUEUE?disableReplyTo=true&**timeToLive**=300000" Setting header JMSExpiration, didn't cause removing message from a que...
8,871,253
In my project I have a simple `UIView` with a `UIScrollView` subview. I am trying to calculate the height based on the content within the `UIScrollView` with the following code: ![enter image description here](https://i.stack.imgur.com/HkZYE.png) file.h ``` @interface ScrollViewController : UIViewController { IBOutl...
2012/01/15
[ "https://Stackoverflow.com/questions/8871253", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1021610/" ]
Also mind that clocks between client - broker need to be in sync, for the expiry to work properly. If the clocks is not in sync, then the expiry set from the client, may already be expired when the message is received on the broker. Or the client time is ahead of the broker, so the expiry is longer than the 10 secs. I...
Endpoint option **timeToLive** (<http://camel.apache.org/jms.html>) worked for me as a solution for the described problem, messages are removed from a queue after 300000 miliseconds. e.g. "activemq:Q.QUEUE?disableReplyTo=true&**timeToLive**=300000" Setting header JMSExpiration, didn't cause removing message from a que...
8,871,253
In my project I have a simple `UIView` with a `UIScrollView` subview. I am trying to calculate the height based on the content within the `UIScrollView` with the following code: ![enter image description here](https://i.stack.imgur.com/HkZYE.png) file.h ``` @interface ScrollViewController : UIViewController { IBOutl...
2012/01/15
[ "https://Stackoverflow.com/questions/8871253", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1021610/" ]
On our side we choose to add expiration time to specific destinations by using a camel route deployed in the ActiveMQ service itself. The only thing to do is creating a XML file like the following with name e.g. `setJMSExpiration.xml`: ``` <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="htt...
Endpoint option **timeToLive** (<http://camel.apache.org/jms.html>) worked for me as a solution for the described problem, messages are removed from a queue after 300000 miliseconds. e.g. "activemq:Q.QUEUE?disableReplyTo=true&**timeToLive**=300000" Setting header JMSExpiration, didn't cause removing message from a que...
1,167,966
> > Evaluate the integral $\int\_0^1 nx(1-x^2)^n \, dx$ ($n$ is constant here) > > > I actually have the solution which is: $$\int\_0^1 nx(1-x^2)^n = \left( \frac{-n}{2(n+1)} (1-x^2)^{n+1}\right)|\_0^1 = \frac{n}{2(n+1)}$$ It's unclear to me this was calculated. I'd be glad for reasoning. Thanks.
2015/02/27
[ "https://math.stackexchange.com/questions/1167966", "https://math.stackexchange.com", "https://math.stackexchange.com/users/188391/" ]
if you write $f(x) = 1-x^2$, your integral can be rewriten as $$\int\_0^1 nx(1-x^2)^n = \int\_0^1 -\frac{n}{2} f'(x)f(x)^n dx $$ $$ = \int\_0^1 -\frac{n}{2(n+1)} \left( f(x)^{n+1} \right)' dx$$ $$ = \left[-\frac{n}{2(n+1)} f^{n+1}(x)\right]\_0^1$$
Hint: change of variable $x^2=t$.
1,167,966
> > Evaluate the integral $\int\_0^1 nx(1-x^2)^n \, dx$ ($n$ is constant here) > > > I actually have the solution which is: $$\int\_0^1 nx(1-x^2)^n = \left( \frac{-n}{2(n+1)} (1-x^2)^{n+1}\right)|\_0^1 = \frac{n}{2(n+1)}$$ It's unclear to me this was calculated. I'd be glad for reasoning. Thanks.
2015/02/27
[ "https://math.stackexchange.com/questions/1167966", "https://math.stackexchange.com", "https://math.stackexchange.com/users/188391/" ]
We want to integrate $f(x)=nx(1-x^2)^n$ Let $u=1-x^2$ and thus $du=-2xdx$ $\int{f(x)dx}=\frac{-1}{2}\int{n\cdot u^n (-2x)dx}=\frac{-1}{2}\int{nu^ndu}=-\frac{nu^{n+1}}{2(n+1)}+c=-\frac{n(1-x^2)^{n+1}}{2(n+1)}+c$ Integrating from 0 to 1, we get $\frac{n}{2(n+1)}$
Hint: change of variable $x^2=t$.
1,167,966
> > Evaluate the integral $\int\_0^1 nx(1-x^2)^n \, dx$ ($n$ is constant here) > > > I actually have the solution which is: $$\int\_0^1 nx(1-x^2)^n = \left( \frac{-n}{2(n+1)} (1-x^2)^{n+1}\right)|\_0^1 = \frac{n}{2(n+1)}$$ It's unclear to me this was calculated. I'd be glad for reasoning. Thanks.
2015/02/27
[ "https://math.stackexchange.com/questions/1167966", "https://math.stackexchange.com", "https://math.stackexchange.com/users/188391/" ]
if you write $f(x) = 1-x^2$, your integral can be rewriten as $$\int\_0^1 nx(1-x^2)^n = \int\_0^1 -\frac{n}{2} f'(x)f(x)^n dx $$ $$ = \int\_0^1 -\frac{n}{2(n+1)} \left( f(x)^{n+1} \right)' dx$$ $$ = \left[-\frac{n}{2(n+1)} f^{n+1}(x)\right]\_0^1$$
Hint: $$\text{If } u = (1 - x^2)^k,\ du = k(1-x^2)^{k-1}(-2x) dx= -2kx(1-x^2)^{k-1}dx$$ Then $$\int nx(1-x^2)^n dx = -\frac{n}{2(n+1)}\int (n+1)(-2x)(1-x^2)^n dx$$ $$= -\frac{n}{2(n+1)}\int (1-x^2)^n\left((n+1)(-2x)\ dx\right)$$
1,167,966
> > Evaluate the integral $\int\_0^1 nx(1-x^2)^n \, dx$ ($n$ is constant here) > > > I actually have the solution which is: $$\int\_0^1 nx(1-x^2)^n = \left( \frac{-n}{2(n+1)} (1-x^2)^{n+1}\right)|\_0^1 = \frac{n}{2(n+1)}$$ It's unclear to me this was calculated. I'd be glad for reasoning. Thanks.
2015/02/27
[ "https://math.stackexchange.com/questions/1167966", "https://math.stackexchange.com", "https://math.stackexchange.com/users/188391/" ]
We want to integrate $f(x)=nx(1-x^2)^n$ Let $u=1-x^2$ and thus $du=-2xdx$ $\int{f(x)dx}=\frac{-1}{2}\int{n\cdot u^n (-2x)dx}=\frac{-1}{2}\int{nu^ndu}=-\frac{nu^{n+1}}{2(n+1)}+c=-\frac{n(1-x^2)^{n+1}}{2(n+1)}+c$ Integrating from 0 to 1, we get $\frac{n}{2(n+1)}$
Hint: $$\text{If } u = (1 - x^2)^k,\ du = k(1-x^2)^{k-1}(-2x) dx= -2kx(1-x^2)^{k-1}dx$$ Then $$\int nx(1-x^2)^n dx = -\frac{n}{2(n+1)}\int (n+1)(-2x)(1-x^2)^n dx$$ $$= -\frac{n}{2(n+1)}\int (1-x^2)^n\left((n+1)(-2x)\ dx\right)$$
1,167,966
> > Evaluate the integral $\int\_0^1 nx(1-x^2)^n \, dx$ ($n$ is constant here) > > > I actually have the solution which is: $$\int\_0^1 nx(1-x^2)^n = \left( \frac{-n}{2(n+1)} (1-x^2)^{n+1}\right)|\_0^1 = \frac{n}{2(n+1)}$$ It's unclear to me this was calculated. I'd be glad for reasoning. Thanks.
2015/02/27
[ "https://math.stackexchange.com/questions/1167966", "https://math.stackexchange.com", "https://math.stackexchange.com/users/188391/" ]
if you write $f(x) = 1-x^2$, your integral can be rewriten as $$\int\_0^1 nx(1-x^2)^n = \int\_0^1 -\frac{n}{2} f'(x)f(x)^n dx $$ $$ = \int\_0^1 -\frac{n}{2(n+1)} \left( f(x)^{n+1} \right)' dx$$ $$ = \left[-\frac{n}{2(n+1)} f^{n+1}(x)\right]\_0^1$$
We want to integrate $f(x)=nx(1-x^2)^n$ Let $u=1-x^2$ and thus $du=-2xdx$ $\int{f(x)dx}=\frac{-1}{2}\int{n\cdot u^n (-2x)dx}=\frac{-1}{2}\int{nu^ndu}=-\frac{nu^{n+1}}{2(n+1)}+c=-\frac{n(1-x^2)^{n+1}}{2(n+1)}+c$ Integrating from 0 to 1, we get $\frac{n}{2(n+1)}$
66,140,459
I have the React class below that shows a list of users(zoomers). Each `zoomer` has a property called `isHidden`. When the page first loads, I want it to just show zoomers who have the `isHidden = false`. I made a checkbox control that, when checked, should show all zoomers, including even the hidden ones. When it'...
2021/02/10
[ "https://Stackoverflow.com/questions/66140459", "https://Stackoverflow.com", "https://Stackoverflow.com/users/880874/" ]
UPDATED FOR TS4.5+ ------------------ Now that TypeScript supports [tail recursion elimination on conditional types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-5.html#tail-recursion-elimination-on-conditional-types) we can write `Kebab<T>` in a straightforward way that should handle string...
Here you have another approach: ```js export interface CssProperties { alignContent: number | string | null; alignItems: number | string | null; alignSelf: number | string | null; alignmentBaseline: number | string | null; } type ToCebab<T extends string> = T extends `align${infer Prefix}` ? `...
66,140,459
I have the React class below that shows a list of users(zoomers). Each `zoomer` has a property called `isHidden`. When the page first loads, I want it to just show zoomers who have the `isHidden = false`. I made a checkbox control that, when checked, should show all zoomers, including even the hidden ones. When it'...
2021/02/10
[ "https://Stackoverflow.com/questions/66140459", "https://Stackoverflow.com", "https://Stackoverflow.com/users/880874/" ]
UPDATED FOR TS4.5+ ------------------ Now that TypeScript supports [tail recursion elimination on conditional types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-5.html#tail-recursion-elimination-on-conditional-types) we can write `Kebab<T>` in a straightforward way that should handle string...
Here's a solution I came to that uses a trampolining technique to defer the typescript type so it doesn't throw recursive type errors. ```js export type KebabCase<S> = S extends `${infer C}${infer T}` ? KebabCase<T> extends infer U ? U extends string ? T extends Uncapitalize<T> ? `${Uncapitalize<C>...
66,140,459
I have the React class below that shows a list of users(zoomers). Each `zoomer` has a property called `isHidden`. When the page first loads, I want it to just show zoomers who have the `isHidden = false`. I made a checkbox control that, when checked, should show all zoomers, including even the hidden ones. When it'...
2021/02/10
[ "https://Stackoverflow.com/questions/66140459", "https://Stackoverflow.com", "https://Stackoverflow.com/users/880874/" ]
UPDATED FOR TS4.5+ ------------------ Now that TypeScript supports [tail recursion elimination on conditional types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-5.html#tail-recursion-elimination-on-conditional-types) we can write `Kebab<T>` in a straightforward way that should handle string...
Inspired by the great answer of @jcalz, I made a modified version to make snake\_case into kebab-case: ``` type KebabCase< T extends string, A extends string = '' > = T extends `${infer P1}_${infer P2}${infer R}` ? KebabCase<R, `${A}${P1}-${P2}`> : `${A}${T}`; ```
66,140,459
I have the React class below that shows a list of users(zoomers). Each `zoomer` has a property called `isHidden`. When the page first loads, I want it to just show zoomers who have the `isHidden = false`. I made a checkbox control that, when checked, should show all zoomers, including even the hidden ones. When it'...
2021/02/10
[ "https://Stackoverflow.com/questions/66140459", "https://Stackoverflow.com", "https://Stackoverflow.com/users/880874/" ]
Here's a solution I came to that uses a trampolining technique to defer the typescript type so it doesn't throw recursive type errors. ```js export type KebabCase<S> = S extends `${infer C}${infer T}` ? KebabCase<T> extends infer U ? U extends string ? T extends Uncapitalize<T> ? `${Uncapitalize<C>...
Here you have another approach: ```js export interface CssProperties { alignContent: number | string | null; alignItems: number | string | null; alignSelf: number | string | null; alignmentBaseline: number | string | null; } type ToCebab<T extends string> = T extends `align${infer Prefix}` ? `...
66,140,459
I have the React class below that shows a list of users(zoomers). Each `zoomer` has a property called `isHidden`. When the page first loads, I want it to just show zoomers who have the `isHidden = false`. I made a checkbox control that, when checked, should show all zoomers, including even the hidden ones. When it'...
2021/02/10
[ "https://Stackoverflow.com/questions/66140459", "https://Stackoverflow.com", "https://Stackoverflow.com/users/880874/" ]
Here's a solution I came to that uses a trampolining technique to defer the typescript type so it doesn't throw recursive type errors. ```js export type KebabCase<S> = S extends `${infer C}${infer T}` ? KebabCase<T> extends infer U ? U extends string ? T extends Uncapitalize<T> ? `${Uncapitalize<C>...
Inspired by the great answer of @jcalz, I made a modified version to make snake\_case into kebab-case: ``` type KebabCase< T extends string, A extends string = '' > = T extends `${infer P1}_${infer P2}${infer R}` ? KebabCase<R, `${A}${P1}-${P2}`> : `${A}${T}`; ```
59,101,674
So I was having issues with flutter http package when it came to making a post request so I used dart HttpClient. I made a post request according to what was described somewhere but I am having issues getting response. Here is my code ``` Future<HttpClientResponse> submit() async { print('start'); Map<String, dyna...
2019/11/29
[ "https://Stackoverflow.com/questions/59101674", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8390502/" ]
The way you do it above is correct. You should, in principle, never use `fit` on test data, only on the train data. The fact that you get "better" results using `fit_transform` on the test data is not indicative of any real performance gains. In other words, by using `fit` on the test data, you lose the ability to say ...
when you want to transform a data you should declare that. like: ``` data["afs"]=data["afs"].transform() ```
59,101,674
So I was having issues with flutter http package when it came to making a post request so I used dart HttpClient. I made a post request according to what was described somewhere but I am having issues getting response. Here is my code ``` Future<HttpClientResponse> submit() async { print('start'); Map<String, dyna...
2019/11/29
[ "https://Stackoverflow.com/questions/59101674", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8390502/" ]
> > Should I follow the documentation of StandardScaler such that the test dataset MUST be transformed only using ".transform()" without fit() function? Or it depends on the dataset such that I can use the "fit\_transform()" function for both training and testing datasets? > > > The moment you are re-training your...
when you want to transform a data you should declare that. like: ``` data["afs"]=data["afs"].transform() ```
59,101,674
So I was having issues with flutter http package when it came to making a post request so I used dart HttpClient. I made a post request according to what was described somewhere but I am having issues getting response. Here is my code ``` Future<HttpClientResponse> submit() async { print('start'); Map<String, dyna...
2019/11/29
[ "https://Stackoverflow.com/questions/59101674", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8390502/" ]
> > Should I follow the documentation of StandardScaler such that the test dataset MUST be transformed only using ".transform()" without fit() function? Or it depends on the dataset such that I can use the "fit\_transform()" function for both training and testing datasets? > > > The moment you are re-training your...
The way you do it above is correct. You should, in principle, never use `fit` on test data, only on the train data. The fact that you get "better" results using `fit_transform` on the test data is not indicative of any real performance gains. In other words, by using `fit` on the test data, you lose the ability to say ...
56,082,728
I'm writing automated test cases using Javascript to perform GUI actions. I'm writing a function to handle some basic "initialization" operations on the software under test but I wanted to have the option to not necessarily put every argument into the parameters. So I had a function that basically did this: ``` func...
2019/05/10
[ "https://Stackoverflow.com/questions/56082728", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4227893/" ]
There was an error in the code: the encoding declared was not actually used when opening the file. I created an issue in the module, and [this pull request to fix it](https://github.com/Tux/CSV/pull/15)
It looks like the documentation for `Text::CSV` requires that [the value passed to `encoding` must be the same as that accepted by the `open` function's `encoding` parameter](https://modules.perl6.org/dist/Text::CSV:cpan:HMBRAND/lib/Text/CSV.pod6#L1856). The list of possible values is listed in the [`IO::Handle::encod...
3,380,694
I need some help understanding the correct way to mix variables with strings like this. I have tried every configuration I can think of and I keep getting an error. ``` <?php include('connect.php'); foreach($_GET['item'] as $key=>$value) { mysql_query("UPDATE userprojectlist SET category_display_order = '$key' WHE...
2010/08/01
[ "https://Stackoverflow.com/questions/3380694", "https://Stackoverflow.com", "https://Stackoverflow.com/users/340688/" ]
Is `item` an array in the url like `item[]`? If it's not that's the reason you get that error, you cannot iterate through a non-iterator object! Also get rid of the single quotes around the values if they are numeric and use string concatenation, ``` "UPDATE userprojectlist SET category_display_order = " . $key . " W...
``` mysql_query('UPDATE userprojectlist SET category_display_order = ' . $key . ' WHERE category_id = ' . $value ); ``` or ``` mysql_query("UPDATE userprojectlist SET category_display_order = $key WHERE category_id = $value" ); ``` This is assuming both variables are integers.
3,380,694
I need some help understanding the correct way to mix variables with strings like this. I have tried every configuration I can think of and I keep getting an error. ``` <?php include('connect.php'); foreach($_GET['item'] as $key=>$value) { mysql_query("UPDATE userprojectlist SET category_display_order = '$key' WHE...
2010/08/01
[ "https://Stackoverflow.com/questions/3380694", "https://Stackoverflow.com", "https://Stackoverflow.com/users/340688/" ]
``` Notice: Undefined index: item in updatedb.php on line 3 ``` This error is saying that there's no such variable as `$_GET['item']` defined. You probably did not pass `$_GET['item']` to this page. ``` Warning: Invalid argument supplied for foreach() in pdatedb.php on line 3 ``` Thus because of the previous error...
``` mysql_query('UPDATE userprojectlist SET category_display_order = ' . $key . ' WHERE category_id = ' . $value ); ``` or ``` mysql_query("UPDATE userprojectlist SET category_display_order = $key WHERE category_id = $value" ); ``` This is assuming both variables are integers.
3,380,694
I need some help understanding the correct way to mix variables with strings like this. I have tried every configuration I can think of and I keep getting an error. ``` <?php include('connect.php'); foreach($_GET['item'] as $key=>$value) { mysql_query("UPDATE userprojectlist SET category_display_order = '$key' WHE...
2010/08/01
[ "https://Stackoverflow.com/questions/3380694", "https://Stackoverflow.com", "https://Stackoverflow.com/users/340688/" ]
Is `item` an array in the url like `item[]`? If it's not that's the reason you get that error, you cannot iterate through a non-iterator object! Also get rid of the single quotes around the values if they are numeric and use string concatenation, ``` "UPDATE userprojectlist SET category_display_order = " . $key . " W...
``` Notice: Undefined index: item in updatedb.php on line 3 ``` This error is saying that there's no such variable as `$_GET['item']` defined. You probably did not pass `$_GET['item']` to this page. ``` Warning: Invalid argument supplied for foreach() in pdatedb.php on line 3 ``` Thus because of the previous error...
2,377,603
There is a question having several parts. I solved the part (a) but I have problems with other parts. Let $f\in L^{1}(\mathbb{R}^{n}),$ with $f\geq 0\;$ a.e. in $\mathbb{R}^{n}$ and let $g:\mathbb{R}^{n}\to [0,+\infty)$ be the function defined by $$ g(x):=\int\_{B(x,\vert x\vert/2)}f(y)dy,$$ where $\vert \cdot\...
2017/07/31
[ "https://math.stackexchange.com/questions/2377603", "https://math.stackexchange.com", "https://math.stackexchange.com/users/277958/" ]
Note that the zero element of $\mathbb{Z}\oplus \mathbb{Z} / I $ is $I=0+I.$ Let $$((x\_1,y\_1)+I)((x\_2,y\_2)+I)=0+I$$ Then $$(x\_1x\_2,y\_1y\_2)\in I$$ Thus $$7\mid y\_1y\_2$$ As $7$ is prime, therefore $7 \mid y\_1$ or $7 \mid y\_2$. Hence, $(x\_1,y\_1) \in I$ or $(x\_2,y\_2)\in I$. So, $(x\_1,y\_1)+I = 0 + I$ ...
It would be a good exercise to prove the following results. > > **Result-1:** In $\Bbb Z \times \Bbb Z$ the prime ideals are of the form, $\Bbb Z/p\Bbb Z\times \Bbb Z$ or $\Bbb Z\times\Bbb Z/p\Bbb Z $ where $p$ is prime. > > > In fact you can generalize the above result as follows. > > **Result-2:** Let $R\_i$ ...
67,273,304
I'm creating a bunch of emails using Word 2013 mail merge (not sure about the English term; I'm working with German version). Outlook is set to *offline mode*, so that I can modify the mails before sending out. So far, everything is working. I want to add an attachment to each of the emails and am trying to write some...
2021/04/26
[ "https://Stackoverflow.com/questions/67273304", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3220554/" ]
The suggestion from @HackSlash didn't work either, but it prompted another idea: Separate the modifications into two loops, and voilà, this works: ``` Sub addAttachmentsToMailsInOutbox() Dim olNs As Outlook.NameSpace Dim olOutbox As Outlook.MAPIFolder Dim olItem As Object Set olNs = GetNamespace("MAPI") Set olOutbox...
I was unable to reproduce your problem using a newly created email. This suggests that it comes down to the properties of the mail item you are editing. For example, if the `BodyFormat` is not `olFormatHTML` then you might not be able to add attachments as expected. If the code I supply here works then that was your p...
73,368,464
i git yolov7(<https://github.com/WongKinYiu>) with `yolov7.pt` and try to run `detect.py`(i just want to run the example). it seems to be normal. but the output image has no mask.Why? here is my code and log: ``` (PyTorch) E:\yolov7>python detect.py --weights yolov7.pt --source inference\images\bus.jpg Namespace(weig...
2022/08/16
[ "https://Stackoverflow.com/questions/73368464", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19570683/" ]
Your code should be throwing errors I think? You're trying to declare result twice, but as the second time is within the forEach loop, it's actually a different variable, and is created and destroyed for each loop. Assuming your fetch works, this *should* work: ``` const data = ['item1','item2','item3'] let result =...
May this could help you :) ``` async function doRequest(data) { // process here } const requests = ['item1', 'item2', 'item3']; const results = requests.map(async (val) => { const response = await doRequest(); return response; }); await Promise.all(requests); ```
73,368,464
i git yolov7(<https://github.com/WongKinYiu>) with `yolov7.pt` and try to run `detect.py`(i just want to run the example). it seems to be normal. but the output image has no mask.Why? here is my code and log: ``` (PyTorch) E:\yolov7>python detect.py --weights yolov7.pt --source inference\images\bus.jpg Namespace(weig...
2022/08/16
[ "https://Stackoverflow.com/questions/73368464", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19570683/" ]
Your code should be throwing errors I think? You're trying to declare result twice, but as the second time is within the forEach loop, it's actually a different variable, and is created and destroyed for each loop. Assuming your fetch works, this *should* work: ``` const data = ['item1','item2','item3'] let result =...
Change: ``` const res = await fetch(`https://websitename.com/${item}`) const result = [...result,...res] ``` To: ``` const response = await fetch(`https://websitename.com/${item}`); const data = response.json(); // if your response is Json result.push(data); ``` * result should be `const` instead of `let`
73,368,464
i git yolov7(<https://github.com/WongKinYiu>) with `yolov7.pt` and try to run `detect.py`(i just want to run the example). it seems to be normal. but the output image has no mask.Why? here is my code and log: ``` (PyTorch) E:\yolov7>python detect.py --weights yolov7.pt --source inference\images\bus.jpg Namespace(weig...
2022/08/16
[ "https://Stackoverflow.com/questions/73368464", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19570683/" ]
Your code should be throwing errors I think? You're trying to declare result twice, but as the second time is within the forEach loop, it's actually a different variable, and is created and destroyed for each loop. Assuming your fetch works, this *should* work: ``` const data = ['item1','item2','item3'] let result =...
Method .forEach() makes sync iteration. It means that an iteration does not wait resolving of your async callback, but just starts it. As a result forEach starts all requests and jumps to line with console.log(result). But at the moment none of the requests are done and array is still empty. If you wrap like that s*etT...
49,427,419
I'm using $mdDialog to show popup alerts. I want to refresh the the page whenever I close the Pop up container. ``` $scope.updateCustomer = function(){ HomeService.updateCustomer($scope.update) .then (function success(response){ $mdDialog.show( $mdDialog.alert() .parent(angu...
2018/03/22
[ "https://Stackoverflow.com/questions/49427419", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9048829/" ]
This was the working answer for my problem... ``` $scope.updateCustomer = function(){ HomeService.updateCustomer($scope.update) .then (function success(response){ $mdDialog.show( $mdDialog.alert() .parent(angular.element(document.querySelector('#popupContainer'))) ...
Page reloading is not quite the angularjs pattern but you can use: ``` $mdDialog .show({ ... onRemoving: function() { window.location.reload(); } }); ``` Ref.: [$mdDialog Service](https://material.angularjs.org/latest/api/service/$mdDialog#mddialog-show-optionsorpreset)
84,684
Do we need to make changes for Salesforce Fast deploy to deploy our code via ANT migration tool ? OR does Salesforce take care of it automatically ? I would like to find some documentation which states that we don't have to make any changes for fast deploy.
2015/07/23
[ "https://salesforce.stackexchange.com/questions/84684", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/13059/" ]
If you will go through [this](http://releasenotes.docs.salesforce.com/en-us/winter15/release-notes/rn_quick_deployment.htm) article, it is clearly written : When deploying to non-production environments (sandbox), Apex tests aren’t required and aren’t run automatically. ***When using Metadata API (including the Force....
I may be wrong here. But thought its worth to put my thoughts. Once you validate using ANT, you can go to salesforce and use the quick deploy feature. Guess as of now, through ANT quick deploy is not supported into prod instance.
84,684
Do we need to make changes for Salesforce Fast deploy to deploy our code via ANT migration tool ? OR does Salesforce take care of it automatically ? I would like to find some documentation which states that we don't have to make any changes for fast deploy.
2015/07/23
[ "https://salesforce.stackexchange.com/questions/84684", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/13059/" ]
If you will go through [this](http://releasenotes.docs.salesforce.com/en-us/winter15/release-notes/rn_quick_deployment.htm) article, it is clearly written : When deploying to non-production environments (sandbox), Apex tests aren’t required and aren’t run automatically. ***When using Metadata API (including the Force....
``` <target name="quickdeployprod"> <sf:deployRecentValidation username="${sf.username}" password="${sf.password}" serverurl="${sf.sandboxurl}" recentValidationId = "recently validated id" deployroot="Retrieve"/> </target> ```
73,720,590
It appears that starting with Android 11, you are now required to include a `AndroidWindowSplashScreenAnimatedIcon` preference in your Cordova `config.xml` that includes a path to a path to a png/xml file and the `<splash>` tags are no longer supported. This appears to mean that we are now required to use an icon for ...
2022/09/14
[ "https://Stackoverflow.com/questions/73720590", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1278584/" ]
Gmail does not support svg image format, so for displaying it you should host somewhere png version of appstore badge to display it inside of the email. The easiest way to host this image is Amazon s3 bucket.
**Please apply this code** ```html <a href="https://apps.apple.com/us/app/symphony-secure-communications/id1098963705?itsct=apps_box_badge&amp;itscg=30200" style="display: inline-block; overflow: hidden; border-radius: 13px; width: 250px; height: 83px;"> <img src="https://apple-resources.s3.amazonaws.co...
845,593
How to I extract a subdirectory in a tarball into the current directory? Example, the tarball from [wordpress](http://wordpress.org/download/): ``` wordpress/ wordpress/wp-trackback.php wordpress/wp-config-sample.php wordpress/wp-settings.php wordpress/wp-rss2.php wordpress/readme.html wordpress/index.php ... ``` H...
2009/05/10
[ "https://Stackoverflow.com/questions/845593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16742/" ]
Why don't you untar normally, then just: ``` mv wordpress/.* . mv wordpress/* . rmdir wordpress ``` But alas, there's: ``` tar --strip-components=1 -zxvf wordpress.tgz ```
Surprisingly, my `tar` (GNU tar v1.16) doesn't have an option to strip initial pathname elements. However, it seems that more recent versions sport a `--strip-components=number` parameter, which will strip that many compononents from the start of the path. If like me you are using an older `tar`, and you are certain ...
31,081,750
I created this xslt mapping using Contivo but it's not working for the XML below. Would someone be able to identify what is wrong, please? I spent some time already working on it but was not able to figure out what is wrong. Here is the XSLT: ``` <?xml version="1.0" encoding="UTF-8"?> <!-- IMPORTANT: If this transfo...
2015/06/26
[ "https://Stackoverflow.com/questions/31081750", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2929206/" ]
There could be (and probably are) various things wrong with your XSL. The first thing that jumps to the eye (**after** removing the undeclared `s` prefix from the `exclude-result-prefixes` list) is that you're not using the correct namespaces of the source XML. For example, in your very first selection: ``` <xsl:val...
You have not declared the namespace "s" in the XSL. THat is already an error if you open the XSL in an editor and you have exclude-result-prefixes="xalan tns s".
50,823,950
So, I wanted to move a dataframe to a database into a table but I am encountering a few problems. I made the dataframe using the pandas library and wanted to upload the data into a table in my database. Relevant snippets of my Code and the error details are as follows: ``` #CONNECTION TO SQL DATABASE db=sql.connect(...
2018/06/12
[ "https://Stackoverflow.com/questions/50823950", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9071346/" ]
So apparently my approach has gone obsolete due to updates and therefore for the connection bit, I used 'create\_engine' from 'sqlalchemy' library instead of 'mysqldb.connect()' to access the database: ``` #relevant import: from sqlalchemy import create_engine #accessing database: engine = create_engine("mysql://root...
For me, it seems that you have nulls in the data. Try to fill the nulls in the dataframe before calling .to\_sql() ``` df_final.fillna('default string') ``` Or to remove the null rows ``` df_final.dropna(inplace=True) ```
39,070,962
I have learning Image Slider Using ViewPager. For that, I want the images to be dynamic. Glide is easy but I think I am not using it properly. Here's what I am trying to do. ``` //Initialize by default Images private static final Integer[] IMAGES = {R.drawable.image1,R.drawable.image2}; // Load images into Drawables...
2016/08/22
[ "https://Stackoverflow.com/questions/39070962", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2254802/" ]
you must provide the view in `.into()` please view the sample sample layout ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <Ima...
Instead of storing the image in memory, store the address instead. ``` private static final String[] IMAGES = {"https://google.com/someImage1.jpg", "https://google.com/someImage2.jpg"}; ``` Then load the image when you `instantiateItem` ``` @Override public Object instantiateItem(ViewGroup view, int position) { ...
39,070,962
I have learning Image Slider Using ViewPager. For that, I want the images to be dynamic. Glide is easy but I think I am not using it properly. Here's what I am trying to do. ``` //Initialize by default Images private static final Integer[] IMAGES = {R.drawable.image1,R.drawable.image2}; // Load images into Drawables...
2016/08/22
[ "https://Stackoverflow.com/questions/39070962", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2254802/" ]
you must provide the view in `.into()` please view the sample sample layout ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <Ima...
`imageView.setImageResource` simply needs replaced with a Glide call. Or use an ArrayAdapter of Strings for Urls that you want to download. I don't think you can "overwrite" a drawable from Glide
39,070,962
I have learning Image Slider Using ViewPager. For that, I want the images to be dynamic. Glide is easy but I think I am not using it properly. Here's what I am trying to do. ``` //Initialize by default Images private static final Integer[] IMAGES = {R.drawable.image1,R.drawable.image2}; // Load images into Drawables...
2016/08/22
[ "https://Stackoverflow.com/questions/39070962", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2254802/" ]
`imageView.setImageResource` simply needs replaced with a Glide call. Or use an ArrayAdapter of Strings for Urls that you want to download. I don't think you can "overwrite" a drawable from Glide
Instead of storing the image in memory, store the address instead. ``` private static final String[] IMAGES = {"https://google.com/someImage1.jpg", "https://google.com/someImage2.jpg"}; ``` Then load the image when you `instantiateItem` ``` @Override public Object instantiateItem(ViewGroup view, int position) { ...
155,607
> > Let a small pressure-sensing device be suspended inside a fluid-filled vessel. ... We find by experiment that at a given point in a fluid at rest, the **pressure has the same value no matter how the pressure sensor is placed.** > > > Why is it so?
2014/12/29
[ "https://physics.stackexchange.com/questions/155607", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/-1/" ]
Suppose we had a fluid where the pressure depended on direction: ![enter image description here](https://i.stack.imgur.com/zNkSH.gif) For the sake of argument let's suppose that $P\_1 > P\_2$. In that case we could take a tube with one end normal to direction $1$ and the other normal to direction $2$: ![enter image ...
In some circumstances, like that of homogeneous and isotropic fluids, the pressure can be described by a tensor which, by the said symmetries, becomes a scalar multiple of the "identity tensor". Such scalar is precisely $p$, the pressure (the tensor is more generally known as *stress tensor*, and the pressures are its ...
73,402,356
``` def openFood(): with open("FoodList.txt") as f: lines = f.readlines() for line in lines: if 'Food' in line: print(f.next()) openFood() ``` I want it where when it sees a certain header like 'Food' It will print the line below it. I c...
2022/08/18
[ "https://Stackoverflow.com/questions/73402356", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19730199/" ]
Just use the index. ``` def openFood(): with open("FoodList.txt") as f: lines = f.readlines() for i in range(len(lines)-1): if 'Food' in lines[i]: print(lines[i+1]) openFood() ```
Can you try the following: ``` def openFood(): with open("FoodList.txt") as f: lines = f.readlines() for ind, line in enumerate(lines): if 'Food' in line: try: print(lines[ind + 1]) except: print('No line after "Food"') openFood() ```
73,402,356
``` def openFood(): with open("FoodList.txt") as f: lines = f.readlines() for line in lines: if 'Food' in line: print(f.next()) openFood() ``` I want it where when it sees a certain header like 'Food' It will print the line below it. I c...
2022/08/18
[ "https://Stackoverflow.com/questions/73402356", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19730199/" ]
Just use the index. ``` def openFood(): with open("FoodList.txt") as f: lines = f.readlines() for i in range(len(lines)-1): if 'Food' in lines[i]: print(lines[i+1]) openFood() ```
Since `readlines()` returns a list of the lines in the file that you can iterate over, you can simply access the subsequent line via its index: ``` l = len(lines)-1 for i in range(l): if 'Food' in lines[i]: print(lines[i+1]) ```
73,402,356
``` def openFood(): with open("FoodList.txt") as f: lines = f.readlines() for line in lines: if 'Food' in line: print(f.next()) openFood() ``` I want it where when it sees a certain header like 'Food' It will print the line below it. I c...
2022/08/18
[ "https://Stackoverflow.com/questions/73402356", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19730199/" ]
Just use the index. ``` def openFood(): with open("FoodList.txt") as f: lines = f.readlines() for i in range(len(lines)-1): if 'Food' in lines[i]: print(lines[i+1]) openFood() ```
Method `readlines()` returns list object, you can convert it to an iterator and then use `next` function: ``` def openFood(): with open("FoodList.txt") as f: lines = iter(f.readlines()) for line in lines: if 'Food' in line: print(next(lines)) openFood() ```
73,402,356
``` def openFood(): with open("FoodList.txt") as f: lines = f.readlines() for line in lines: if 'Food' in line: print(f.next()) openFood() ``` I want it where when it sees a certain header like 'Food' It will print the line below it. I c...
2022/08/18
[ "https://Stackoverflow.com/questions/73402356", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19730199/" ]
Just use the index. ``` def openFood(): with open("FoodList.txt") as f: lines = f.readlines() for i in range(len(lines)-1): if 'Food' in lines[i]: print(lines[i+1]) openFood() ```
Reading a file one line at a time can be beneficial if the file is very large. This code will not load the full file into memory, but only one line at a time: ``` def openFood(): with open("FoodList.txt") as f: line = f.readline() while line: if 'Food' in line: print(f.r...
73,402,356
``` def openFood(): with open("FoodList.txt") as f: lines = f.readlines() for line in lines: if 'Food' in line: print(f.next()) openFood() ``` I want it where when it sees a certain header like 'Food' It will print the line below it. I c...
2022/08/18
[ "https://Stackoverflow.com/questions/73402356", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19730199/" ]
Just use the index. ``` def openFood(): with open("FoodList.txt") as f: lines = f.readlines() for i in range(len(lines)-1): if 'Food' in lines[i]: print(lines[i+1]) openFood() ```
`readlines()` reads all the lines in a file and returns a list. You could either read and iterate one line at a time (using `readline()`), or read all the lines and use the list for iteration (using `readlines()`). Apart from the ways mentioned, you could also use a `bool` like below (I've used `readlines()` here): `...
66,781,577
I need to print input from the user in reverse order using a function. As a condition, just words (no floats/ int) should be allowed & at least **four** words need to be entered. e.g.: How can I help you --> you help I can How It should'nt be possible to input: "4 5 6 7" or "There are 2 dogs" Here's my current code, h...
2021/03/24
[ "https://Stackoverflow.com/questions/66781577", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15469758/" ]
try to do this ```r df <- structure(list(animals = c("E1", "E1", "E1", "E2", "E2", "E2"), period = structure(c(18690, 18697, 18704, 18690, 18697, 18704), class = "Date"), weight1 = c(704, ...
You will get an error with what you are trying to do. Once you `group_by(animals)`, there are only three columns that `mutate` can operate on. So you could use: ``` cat %>% group_by(animals) %>% mutate(across(2:3, cumsum)) # A tibble: 6 x 4 # Groups: animals [2] animals period weight1 weight2 <chr> <d...
66,781,577
I need to print input from the user in reverse order using a function. As a condition, just words (no floats/ int) should be allowed & at least **four** words need to be entered. e.g.: How can I help you --> you help I can How It should'nt be possible to input: "4 5 6 7" or "There are 2 dogs" Here's my current code, h...
2021/03/24
[ "https://Stackoverflow.com/questions/66781577", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15469758/" ]
try to do this ```r df <- structure(list(animals = c("E1", "E1", "E1", "E2", "E2", "E2"), period = structure(c(18690, 18697, 18704, 18690, 18697, 18704), class = "Date"), weight1 = c(704, ...
Base R solution: ``` num_col_idx <- vapply(df, is.numeric, logical(1)) cbind(df[,!num_col_idx], data.frame(do.call(rbind, lapply( split(df[, num_col_idx], df$animals), cumsum)), row.names = NULL)) ```
66,781,577
I need to print input from the user in reverse order using a function. As a condition, just words (no floats/ int) should be allowed & at least **four** words need to be entered. e.g.: How can I help you --> you help I can How It should'nt be possible to input: "4 5 6 7" or "There are 2 dogs" Here's my current code, h...
2021/03/24
[ "https://Stackoverflow.com/questions/66781577", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15469758/" ]
You will get an error with what you are trying to do. Once you `group_by(animals)`, there are only three columns that `mutate` can operate on. So you could use: ``` cat %>% group_by(animals) %>% mutate(across(2:3, cumsum)) # A tibble: 6 x 4 # Groups: animals [2] animals period weight1 weight2 <chr> <d...
Base R solution: ``` num_col_idx <- vapply(df, is.numeric, logical(1)) cbind(df[,!num_col_idx], data.frame(do.call(rbind, lapply( split(df[, num_col_idx], df$animals), cumsum)), row.names = NULL)) ```
2,915,307
I am working on the design and implementation of an iPhone application ( a newbie, but I am getting the hang of it) where a person can download specific contact information about teachers based on their majors. The information is currently on different edu websites. And I have exported the information into SQLite data...
2010/05/26
[ "https://Stackoverflow.com/questions/2915307", "https://Stackoverflow.com", "https://Stackoverflow.com/users/351199/" ]
Mark, By setting some variable to the database name via an NSString, you should be able to open up any database you want that is bundled with the app when it's submitted. For instance, declare variable: `NSString *databaseName;` set database name: `databaseName = @"teachersDBNumber1.sql";` and then when you open i...
I would put all the databases on a web server; that way you can update them anytime you want, without redistributing the app. (I do this for fringegenie.com) Use NSMutableURLRequest to download the file you want and save it. The reason I suggest NSMutableURLRequest is so that you can add the If-Modified-Since header. ...
15,116,283
Is it possible to setup WebAPI to Self Host like Nancy. Such that it hosts an > > /api/... > > > section serving up json and xml responses and hosts a > > /content/... > > > section serving up \*.jpg and \*.html and \*.js I'm trying to create a self hosting Single Page Application with WebAPI as the back...
2013/02/27
[ "https://Stackoverflow.com/questions/15116283", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51841/" ]
Try this: ``` #if __has_feature(objc_arc) /* ARC is used */ #endif ```
Try to ``` [player release]; ``` It should give you "ARC Restrictions" Errors
15,116,283
Is it possible to setup WebAPI to Self Host like Nancy. Such that it hosts an > > /api/... > > > section serving up json and xml responses and hosts a > > /content/... > > > section serving up \*.jpg and \*.html and \*.js I'm trying to create a self hosting Single Page Application with WebAPI as the back...
2013/02/27
[ "https://Stackoverflow.com/questions/15116283", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51841/" ]
Try this: ``` #if __has_feature(objc_arc) /* ARC is used */ #endif ```
You can already tell you're building without ARC: were it enabled, your call to `autorelease` would result in a compiler error. This suggests that your actual problem has nothing to do with ARC, of course -- removing the `autorelease` call may be preventing an object from getting over-released, but it's also quite poss...
13,707,879
I have an Internet Explorer Add-On that generates some files in LocalAppDataFolder\Microsoft\Windows\Temporary Internet Files\CompanyName\AddOnName\ I have a WIX installer for the application that I would like to have delete the CompanyName\AddOnName\ folders on both install and uninstall. I have never used WIX befor...
2012/12/04
[ "https://Stackoverflow.com/questions/13707879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1506949/" ]
You need to manually initialize the whole array and all levels if multi-leveled: ``` point[] p1 = new point[5]; // Now the whole array contains only null elements for (int i = 0; i < 5; i++) p1[i] = new point(); p1[0].x = 1; // Will be okay ```
``` point p = new point(); ``` It is the `point` object. ``` point[] p1 = new point[5]; ``` This `point` object is an 1D array. It holds `point` object references. You should create a `point` object and keep into the array like - ``` for (int i = 0; i < 5; i++) p1[i] = new point(); p1[0].x = 1; ``` And for ...
13,707,879
I have an Internet Explorer Add-On that generates some files in LocalAppDataFolder\Microsoft\Windows\Temporary Internet Files\CompanyName\AddOnName\ I have a WIX installer for the application that I would like to have delete the CompanyName\AddOnName\ folders on both install and uninstall. I have never used WIX befor...
2012/12/04
[ "https://Stackoverflow.com/questions/13707879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1506949/" ]
You need to manually initialize the whole array and all levels if multi-leveled: ``` point[] p1 = new point[5]; // Now the whole array contains only null elements for (int i = 0; i < 5; i++) p1[i] = new point(); p1[0].x = 1; // Will be okay ```
When you construct an array of objects, the array itself is constructed, but the individual elements are initialized to null. So, assuming `Point()` is the constructor you want, ``` Point[] p1 = new Point[5]; for (int i = 0; i < p1.length; ++i) { p1[i] = new Point(); } ```
13,707,879
I have an Internet Explorer Add-On that generates some files in LocalAppDataFolder\Microsoft\Windows\Temporary Internet Files\CompanyName\AddOnName\ I have a WIX installer for the application that I would like to have delete the CompanyName\AddOnName\ folders on both install and uninstall. I have never used WIX befor...
2012/12/04
[ "https://Stackoverflow.com/questions/13707879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1506949/" ]
You need to manually initialize the whole array and all levels if multi-leveled: ``` point[] p1 = new point[5]; // Now the whole array contains only null elements for (int i = 0; i < 5; i++) p1[i] = new point(); p1[0].x = 1; // Will be okay ```
Think of it this way; when you do `new point[5]` (you should follow coding standards and name your classes with an upper case first letter btw.), you get an array with *every element being the default value for that type* (in this case null). The array is initialised, but if you want individual elements of the array to...
13,707,879
I have an Internet Explorer Add-On that generates some files in LocalAppDataFolder\Microsoft\Windows\Temporary Internet Files\CompanyName\AddOnName\ I have a WIX installer for the application that I would like to have delete the CompanyName\AddOnName\ folders on both install and uninstall. I have never used WIX befor...
2012/12/04
[ "https://Stackoverflow.com/questions/13707879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1506949/" ]
Think of it this way; when you do `new point[5]` (you should follow coding standards and name your classes with an upper case first letter btw.), you get an array with *every element being the default value for that type* (in this case null). The array is initialised, but if you want individual elements of the array to...
``` point p = new point(); ``` It is the `point` object. ``` point[] p1 = new point[5]; ``` This `point` object is an 1D array. It holds `point` object references. You should create a `point` object and keep into the array like - ``` for (int i = 0; i < 5; i++) p1[i] = new point(); p1[0].x = 1; ``` And for ...
13,707,879
I have an Internet Explorer Add-On that generates some files in LocalAppDataFolder\Microsoft\Windows\Temporary Internet Files\CompanyName\AddOnName\ I have a WIX installer for the application that I would like to have delete the CompanyName\AddOnName\ folders on both install and uninstall. I have never used WIX befor...
2012/12/04
[ "https://Stackoverflow.com/questions/13707879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1506949/" ]
Think of it this way; when you do `new point[5]` (you should follow coding standards and name your classes with an upper case first letter btw.), you get an array with *every element being the default value for that type* (in this case null). The array is initialised, but if you want individual elements of the array to...
When you construct an array of objects, the array itself is constructed, but the individual elements are initialized to null. So, assuming `Point()` is the constructor you want, ``` Point[] p1 = new Point[5]; for (int i = 0; i < p1.length; ++i) { p1[i] = new Point(); } ```
965,610
I have converted a GWT Eclipse based project to GWT-Maven but when I run the command ``` mvn clean gwt:compile ``` I get an awful lot of errors that specify: ``` [class name].java' is removed due to invalid reference(s): ``` My pom.xml dependencies are: * dom4j-1.6.1 * commons-httpclient-3.1 * gwt-servlet-1.6.4 ...
2009/06/08
[ "https://Stackoverflow.com/questions/965610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/71561/" ]
That's because the removed class refers to a method that is implemented as part of the GWT JRE emulation library : <http://library.igcar.gov.in/readit2007/tutori/tools/gwt-windows-1.4.10/doc/html/jre.html> If your software makes use of reflection it is very probably the cause.
Typically this means that something higher up in the calling chain was invalid, either because of a compile error, or because it was, or was using, a class that can't be 'compiled' by the GWT compiler. So, if you have class A which references class B, and class B cannot be compiled, class A will be removed due to an in...
19,801,679
I have been working on this issue for several days now and have been unable to find a solution. I will try to be as specific as I can, so that you understand the problem, and include code where necessary. I have a normal view with a Html.BeginForm (as seen in the first code example) with different controls inside, as ...
2013/11/06
[ "https://Stackoverflow.com/questions/19801679", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2679383/" ]
``` > df[ sapply(df$Col1,function(x) any(2:3 %in% x)) , ] Col1 Col2 1 1, 2, 3 1 2 2, 3 2 3 3 3 ```
``` dfss <- df[ grepl("2" , df[ ,1])| grepl("3" , df[ ,1]) , ] ```
19,801,679
I have been working on this issue for several days now and have been unable to find a solution. I will try to be as specific as I can, so that you understand the problem, and include code where necessary. I have a normal view with a Html.BeginForm (as seen in the first code example) with different controls inside, as ...
2013/11/06
[ "https://Stackoverflow.com/questions/19801679", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2679383/" ]
``` > df[ sapply(df$Col1,function(x) any(2:3 %in% x)) , ] Col1 Col2 1 1, 2, 3 1 2 2, 3 2 3 3 3 ```
In short words: check out `subset` and `grepl` if you are dealing with string. Here is how I read your data and assume the value type is string, otherwise you can remove the stringsAsFactors and coerce it to whatever type you want. ``` > df <- read.table(text=" + 1,2,3 1 + 2,3 2 + 3 3 + 4 3 + 4...
17,214,150
I have been trying to test my controllers as per this tutorial -> [Zend Framework 2.1 Unit testing](http://framework.zend.com/manual/2.1/en/tutorials/unittesting.html#testing-actions-with-post) I have tried every possible variation of the code to send POST or GET data along with the dispatch but the only thing I get b...
2013/06/20
[ "https://Stackoverflow.com/questions/17214150", "https://Stackoverflow.com", "https://Stackoverflow.com/users/393897/" ]
``` $p = new Parameters(); $p->set('username','foo'); $p->set('password','bar'); $this->getRequest()->setMethod('POST'); $this->getRequest()->setPost($p); $this->dispatch('/login'); ``` This works for me. The Parameters() constructor doesn't seem to be what you're expecting it to be. The docs say it takes an array, ...
Get/Post data not sending, this issue is related to server, can you check the function use for fetching data from server.
18,983,906
Why is time taken to access an element in a non-homogeneous list considered as constant or How is a non-homogeneous list stored in memory in case of python? In case of a homogeneous list, knowing the type and position, the memory location can be determined but how is it done in case of a non homogeneous list so fast a...
2013/09/24
[ "https://Stackoverflow.com/questions/18983906", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2216108/" ]
Expand your controller action with a new parameter: ``` public JsonResult ResolveProfileSelectionRequired(ResolveProfileSelectionRequiredModel model, bool newtransferee = false) ``` and check it inside the action.
You could use: ``` if (Request.Form["newtransferee"].ToLower() == "true") ``` or does it work if you write this instead of the manual html? ``` @Html.HiddenFor(model => model.NewTransferee) ```
18,983,906
Why is time taken to access an element in a non-homogeneous list considered as constant or How is a non-homogeneous list stored in memory in case of python? In case of a homogeneous list, knowing the type and position, the memory location can be determined but how is it done in case of a non homogeneous list so fast a...
2013/09/24
[ "https://Stackoverflow.com/questions/18983906", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2216108/" ]
If all you need to do is check the value of a boolean, that's just a conditional statement: ``` public JsonResult ResolveProfileSelectionRequired(ResolveProfileSelectionRequiredModel model) { if (model.NewTransferee) { // do something } else { // do something else } } ``` It's...
Expand your controller action with a new parameter: ``` public JsonResult ResolveProfileSelectionRequired(ResolveProfileSelectionRequiredModel model, bool newtransferee = false) ``` and check it inside the action.
18,983,906
Why is time taken to access an element in a non-homogeneous list considered as constant or How is a non-homogeneous list stored in memory in case of python? In case of a homogeneous list, knowing the type and position, the memory location can be determined but how is it done in case of a non homogeneous list so fast a...
2013/09/24
[ "https://Stackoverflow.com/questions/18983906", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2216108/" ]
If all you need to do is check the value of a boolean, that's just a conditional statement: ``` public JsonResult ResolveProfileSelectionRequired(ResolveProfileSelectionRequiredModel model) { if (model.NewTransferee) { // do something } else { // do something else } } ``` It's...
You could use: ``` if (Request.Form["newtransferee"].ToLower() == "true") ``` or does it work if you write this instead of the manual html? ``` @Html.HiddenFor(model => model.NewTransferee) ```
84,410
In the second theme of the recapitulation of Beethoven's Pathetique Sonata where the bass line goes into the treble clef and the bass register becomes part of the melody, I see the marking ***ben tenuto il basso***. I tried looking it up last night and couldn't find an answer. Google translate said that this means "wel...
2019/04/30
[ "https://music.stackexchange.com/questions/84410", "https://music.stackexchange.com", "https://music.stackexchange.com/users/9749/" ]
Finding the edition the OP referred to (<https://imslp.org/wiki/Special:ImagefromIndex/11070/torat>) didn't take long. It's the sort of marking that always reminds me of a John Cleese joke in *Fawlty Towers*: "You should be on *Mastermind*. Specialist subject, the bleedin' obvious." Looking through the editors of edi...
It simply means you need to play the bass tenuto. In this case I'd say he means the bass line in the treble clef, but it would help to see the relevant passage. (To me tenuto and fermata are quite different, i.e. I wouldn't describe it like that. Tenuto means you should hold the note to the maximum full value, but d...
20,834,941
My HTML5 Wordpress `<a href="#">site</a>` is not showing properly in IE, but it works well in Chrome and Firefox. What is the reason for this and how can I resolve it?
2013/12/30
[ "https://Stackoverflow.com/questions/20834941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2910583/" ]
You can see an example of something similar in the Routing guide: <http://guides.rubyonrails.org/routing.html#naming-routes> `get 'exit', to: 'sessions#destroy', as: :logout` You could use: `get 'about_us', to: 'main#about_us'`
you can use "path": option ``` resources :main, path: "/", only: [] do get :about_us end ``` Now, all actions in main controller will be accessed directly without controller name in url eg: localhost:3000/about\_us
20,834,941
My HTML5 Wordpress `<a href="#">site</a>` is not showing properly in IE, but it works well in Chrome and Firefox. What is the reason for this and how can I resolve it?
2013/12/30
[ "https://Stackoverflow.com/questions/20834941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2910583/" ]
you can use "path": option ``` resources :main, path: "/", only: [] do get :about_us end ``` Now, all actions in main controller will be accessed directly without controller name in url eg: localhost:3000/about\_us
I settled on this... ``` MainController.action_methods.each{ |a| a = a.to_s; match a => 'main#'+a} ``` Private actions are not accessible, but all others are
20,834,941
My HTML5 Wordpress `<a href="#">site</a>` is not showing properly in IE, but it works well in Chrome and Firefox. What is the reason for this and how can I resolve it?
2013/12/30
[ "https://Stackoverflow.com/questions/20834941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2910583/" ]
You can see an example of something similar in the Routing guide: <http://guides.rubyonrails.org/routing.html#naming-routes> `get 'exit', to: 'sessions#destroy', as: :logout` You could use: `get 'about_us', to: 'main#about_us'`
Try: ``` resources :main,:path => '',:only => [] ``` Now all actions of MainController can be accessed without controller name main in the url.
20,834,941
My HTML5 Wordpress `<a href="#">site</a>` is not showing properly in IE, but it works well in Chrome and Firefox. What is the reason for this and how can I resolve it?
2013/12/30
[ "https://Stackoverflow.com/questions/20834941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2910583/" ]
You can see an example of something similar in the Routing guide: <http://guides.rubyonrails.org/routing.html#naming-routes> `get 'exit', to: 'sessions#destroy', as: :logout` You could use: `get 'about_us', to: 'main#about_us'`
I settled on this... ``` MainController.action_methods.each{ |a| a = a.to_s; match a => 'main#'+a} ``` Private actions are not accessible, but all others are
20,834,941
My HTML5 Wordpress `<a href="#">site</a>` is not showing properly in IE, but it works well in Chrome and Firefox. What is the reason for this and how can I resolve it?
2013/12/30
[ "https://Stackoverflow.com/questions/20834941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2910583/" ]
You can see an example of something similar in the Routing guide: <http://guides.rubyonrails.org/routing.html#naming-routes> `get 'exit', to: 'sessions#destroy', as: :logout` You could use: `get 'about_us', to: 'main#about_us'`
match 'about\_us', :to => 'MainController#about\_us'
20,834,941
My HTML5 Wordpress `<a href="#">site</a>` is not showing properly in IE, but it works well in Chrome and Firefox. What is the reason for this and how can I resolve it?
2013/12/30
[ "https://Stackoverflow.com/questions/20834941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2910583/" ]
Try: ``` resources :main,:path => '',:only => [] ``` Now all actions of MainController can be accessed without controller name main in the url.
I settled on this... ``` MainController.action_methods.each{ |a| a = a.to_s; match a => 'main#'+a} ``` Private actions are not accessible, but all others are
20,834,941
My HTML5 Wordpress `<a href="#">site</a>` is not showing properly in IE, but it works well in Chrome and Firefox. What is the reason for this and how can I resolve it?
2013/12/30
[ "https://Stackoverflow.com/questions/20834941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2910583/" ]
match 'about\_us', :to => 'MainController#about\_us'
I settled on this... ``` MainController.action_methods.each{ |a| a = a.to_s; match a => 'main#'+a} ``` Private actions are not accessible, but all others are
3,900,172
> > $\textbf{Problem}$: An athletic facility has $5$ tennis courts. Pairs of players arrive at the > courts and use a court for an exponentially distributed time with mean $40$ minutes. > Suppose a pair of players arrives and finds all courts busy and k other pairs waiting in > queue. What is the expected waiting time...
2020/11/09
[ "https://math.stackexchange.com/questions/3900172", "https://math.stackexchange.com", "https://math.stackexchange.com/users/792588/" ]
Each $X\_i$ has rate $\lambda=\frac1{40}$ (with minutes as the time unit), so $Z$ has $\lambda=\frac5{40}=\frac18$ for a mean of $8$ minutes. You have applied the formula incorrectly: the rates add, not the means.
Let $Z=\min(X\_1,...,X\_5)$. We have $X\_1=Z$ with probability ${\large{\frac{1}{5}}}$, and by the memoryless property we have $$ E[X\_1-Z{\,\mid\,}X\_1 > Z]=40 $$ hence \begin{align\*} & E[X\_1-Z] = \left({\small{\frac{1}{5}}}\right)\!(0) + \left({\small{\frac{4}{5}}}\right)\!(40) \\[4pt] \implies\;& E[X\_1-Z]=32 \\...
379,117
I just set up nginx as a http/https reverse proxy and it worked well. After that, I realized that for some domains ftp services are available. I was able to install ftp.proxy and it also works well, although it just handles one single domain. My question is: Is there any possibility to reverse proxy ftp services base...
2012/04/13
[ "https://serverfault.com/questions/379117", "https://serverfault.com", "https://serverfault.com/users/81551/" ]
There's a G-WAN [rewrite example here](http://gwan.com/developers#handler) (look at the second handler source code, the first handler example illustrates FLV pseudo-streaming).
You can Use a virtual host, or even an alias, see the [G-WAN FAQs](http://gwan.com/faq#listener). For more elaborate rewrites, you can use a handler, some examples are provided in the download archive.
46,565,928
I am new to Matlab and i ran into this problem: I have a function that takes 3 doubles as arguments and outputs a single double e.g.: ``` function l = myFunct(a,b,c) l = a^2*b^2 + (2*(c^2 - b) / (a - sqrt(c))) end ``` Now, I need to plot the result of this function for intervals: a = b = [0.1,3], while keeping c...
2017/10/04
[ "https://Stackoverflow.com/questions/46565928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8720210/" ]
Add `ml-auto` class to `navbar-nav` along with `mr-auto`
You can add **margin-left: auto** by adding *mr-auto* to *navbar* to center the searchbar in the navbar. **But** it won't be at the center of the header, since there is another component beside the navbar. ``` <ul class="navbar-nav mr-auto ml-auto"> ``` ```html <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4...
12,739,297
In Global Config in joomla have 2 caching is conservative and progressive, what is difference both ?
2012/10/05
[ "https://Stackoverflow.com/questions/12739297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/840461/" ]
> > **Conservative caching** is the standard type of caching. Here’s how it works: > > > * A visitor visits a page on your website. > * Joomla checks if there is a non-expired version of that page in its cache directory. > * If the cached page exists (and it’s not expired), then Joomla will serve it to the visitor –...
For **Unique cache per visitor** * **Conservative cache** shows all visitors to your site the same exact cached content. * **Progressive caching** however caches the content for each user uniquely. From the [link](http://www.inmotionhosting.com/support/edu/joomla-25/caching/global-module-caching) Provided by @Tornad...
12,739,297
In Global Config in joomla have 2 caching is conservative and progressive, what is difference both ?
2012/10/05
[ "https://Stackoverflow.com/questions/12739297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/840461/" ]
For **Unique cache per visitor** * **Conservative cache** shows all visitors to your site the same exact cached content. * **Progressive caching** however caches the content for each user uniquely. From the [link](http://www.inmotionhosting.com/support/edu/joomla-25/caching/global-module-caching) Provided by @Tornad...
Progressive caching works just like conservative caching with a difference that buffers are updated progressively. If you look at the render function in JApplicationCMS (where progressive caching is set), you will find that its not applicable to logged in users. <https://github.com/joomla/joomla-cms/blob/staging/libra...
12,739,297
In Global Config in joomla have 2 caching is conservative and progressive, what is difference both ?
2012/10/05
[ "https://Stackoverflow.com/questions/12739297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/840461/" ]
> > **Conservative caching** is the standard type of caching. Here’s how it works: > > > * A visitor visits a page on your website. > * Joomla checks if there is a non-expired version of that page in its cache directory. > * If the cached page exists (and it’s not expired), then Joomla will serve it to the visitor –...
Progressive caching works just like conservative caching with a difference that buffers are updated progressively. If you look at the render function in JApplicationCMS (where progressive caching is set), you will find that its not applicable to logged in users. <https://github.com/joomla/joomla-cms/blob/staging/libra...
16,701,666
Please note this is not the same question as mentioned above since XML escaping to preserve codepoints is possible. I have a UTF-8 XML file which I can send via HTTP to some other system which I have no control over. For whatever crazy reason it decides to convert it to ISO-8859-1 loosing many Unicode characters and r...
2013/05/22
[ "https://Stackoverflow.com/questions/16701666", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1482815/" ]
Here are three standard API methods to produce ISO-8859-1 encoded documents. Using the [StAX API](http://docs.oracle.com/javase/7/docs/api/javax/xml/stream/package-summary.html): ``` // output stream ByteArrayOutputStream buffer = new ByteArrayOutputStream(); // transcode StringReader xml = new StringReader("<x>pi: \...
The Unicode code points above 127 can be encoded as numeric entities like `&#123;` using the following: From Apache commons [StringEscapeUtils](http://commons.apache.org/proper/commons-lang/javadocs/api-3.1/org/apache/commons/lang3/StringEscapeUtils.html#escapeXml%28java.lang.String%29). Read the javadoc, by default `...
22,702
*This question continues story of [one ESA vs NASA battle on Mars](https://worldbuilding.stackexchange.com/questions/22573/how-will-my-nerdy-mars-astronauts-do-battle-between-their-colonies). I tried to put everything important into this question. Also, being from Europe, I took ESA side as the one winning:* * **Year:...
2015/08/16
[ "https://worldbuilding.stackexchange.com/questions/22702", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/2071/" ]
**NASA/ESA Repsonse** *Surprise* The officials should be shocked. After Houston kept telling the astronauts, for example, to 'just learn to get along,' they will have decided to take things into their own hands and through a series of discussions in 'safe' spaces or on notes of paper, they planned their battles. It w...
While there would be the usual coverup/deflect/finger pointing aspect of bureaucratic and political response, I suspect that there would be another level of response, which is the sheer bloody mindedness of people. Many people will have been invested in the project, and of course the astronauts will have been celebrit...
22,702
*This question continues story of [one ESA vs NASA battle on Mars](https://worldbuilding.stackexchange.com/questions/22573/how-will-my-nerdy-mars-astronauts-do-battle-between-their-colonies). I tried to put everything important into this question. Also, being from Europe, I took ESA side as the one winning:* * **Year:...
2015/08/16
[ "https://worldbuilding.stackexchange.com/questions/22702", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/2071/" ]
**NASA/ESA Repsonse** *Surprise* The officials should be shocked. After Houston kept telling the astronauts, for example, to 'just learn to get along,' they will have decided to take things into their own hands and through a series of discussions in 'safe' spaces or on notes of paper, they planned their battles. It w...
The most effective way for the US and EU to defuse any political fallout over the rogue actions of a bunch of scientists is to *call it exactly that in public*. Admit to their errors in judgement in choosing (as yet unknown) members of the Mars teams who could go on to commit murder, and state that the number one prior...
22,702
*This question continues story of [one ESA vs NASA battle on Mars](https://worldbuilding.stackexchange.com/questions/22573/how-will-my-nerdy-mars-astronauts-do-battle-between-their-colonies). I tried to put everything important into this question. Also, being from Europe, I took ESA side as the one winning:* * **Year:...
2015/08/16
[ "https://worldbuilding.stackexchange.com/questions/22702", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/2071/" ]
The most effective way for the US and EU to defuse any political fallout over the rogue actions of a bunch of scientists is to *call it exactly that in public*. Admit to their errors in judgement in choosing (as yet unknown) members of the Mars teams who could go on to commit murder, and state that the number one prior...
While there would be the usual coverup/deflect/finger pointing aspect of bureaucratic and political response, I suspect that there would be another level of response, which is the sheer bloody mindedness of people. Many people will have been invested in the project, and of course the astronauts will have been celebrit...
13,075,617
I would like to know how to get the current week number from Rails and how do I manipulate it: 1. Translate the week number into date. 2. Make an interval based on week number. Thanks.
2012/10/25
[ "https://Stackoverflow.com/questions/13075617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/788357/" ]
Use [`strftime`](http://www.ruby-doc.org/core-1.9.3/Time.html#method-i-strftime): > > `%U` - Week number of the year. The week starts with Sunday. (00..53) > > `%W` - Week number of the year. The week starts with Monday. (00..53) > > > ``` Time.now.strftime("%U").to_i # 43 # Or... Date.today.strftime("%U").t...
``` date.commercial([cwyear=-4712[, cweek=1[, cwday=1[, start=Date::ITALY]]]]) → date Creates a date object denoting the given week date. The week and the day of week should be a negative or a positive number (as a relative week/day from the end of year/week when negative). They should not be zero. ``` For the int...
13,075,617
I would like to know how to get the current week number from Rails and how do I manipulate it: 1. Translate the week number into date. 2. Make an interval based on week number. Thanks.
2012/10/25
[ "https://Stackoverflow.com/questions/13075617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/788357/" ]
Use [`strftime`](http://www.ruby-doc.org/core-1.9.3/Time.html#method-i-strftime): > > `%U` - Week number of the year. The week starts with Sunday. (00..53) > > `%W` - Week number of the year. The week starts with Monday. (00..53) > > > ``` Time.now.strftime("%U").to_i # 43 # Or... Date.today.strftime("%U").t...
[`Date#cweek`](http://ruby-doc.org/stdlib-2.2.2/libdoc/date/rdoc/Date.html#method-i-cweek) seems to get the ISO-8601 week number (a Monday-based week) like `%V` in strftime (mentioned by @Robban in a comment). For example, the Monday and the Sunday of the week I'm writing this: ``` [ Date.new(2015, 7, 13), Date.new(2...
13,075,617
I would like to know how to get the current week number from Rails and how do I manipulate it: 1. Translate the week number into date. 2. Make an interval based on week number. Thanks.
2012/10/25
[ "https://Stackoverflow.com/questions/13075617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/788357/" ]
Use [`strftime`](http://www.ruby-doc.org/core-1.9.3/Time.html#method-i-strftime): > > `%U` - Week number of the year. The week starts with Sunday. (00..53) > > `%W` - Week number of the year. The week starts with Monday. (00..53) > > > ``` Time.now.strftime("%U").to_i # 43 # Or... Date.today.strftime("%U").t...
You are going to want to stay away from `strftime("%U")` and `"%W"`. **Instead, use `Date.cweek`.** The problem is, if you ever want to take a week number and convert it to a date, `strftime` won't give you a value that you can pass back to `Date.commercial`. `Date.commercial` expects a range of values that are 1 ba...
13,075,617
I would like to know how to get the current week number from Rails and how do I manipulate it: 1. Translate the week number into date. 2. Make an interval based on week number. Thanks.
2012/10/25
[ "https://Stackoverflow.com/questions/13075617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/788357/" ]
``` date.commercial([cwyear=-4712[, cweek=1[, cwday=1[, start=Date::ITALY]]]]) → date Creates a date object denoting the given week date. The week and the day of week should be a negative or a positive number (as a relative week/day from the end of year/week when negative). They should not be zero. ``` For the int...
[`Date#cweek`](http://ruby-doc.org/stdlib-2.2.2/libdoc/date/rdoc/Date.html#method-i-cweek) seems to get the ISO-8601 week number (a Monday-based week) like `%V` in strftime (mentioned by @Robban in a comment). For example, the Monday and the Sunday of the week I'm writing this: ``` [ Date.new(2015, 7, 13), Date.new(2...
13,075,617
I would like to know how to get the current week number from Rails and how do I manipulate it: 1. Translate the week number into date. 2. Make an interval based on week number. Thanks.
2012/10/25
[ "https://Stackoverflow.com/questions/13075617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/788357/" ]
You are going to want to stay away from `strftime("%U")` and `"%W"`. **Instead, use `Date.cweek`.** The problem is, if you ever want to take a week number and convert it to a date, `strftime` won't give you a value that you can pass back to `Date.commercial`. `Date.commercial` expects a range of values that are 1 ba...
``` date.commercial([cwyear=-4712[, cweek=1[, cwday=1[, start=Date::ITALY]]]]) → date Creates a date object denoting the given week date. The week and the day of week should be a negative or a positive number (as a relative week/day from the end of year/week when negative). They should not be zero. ``` For the int...
13,075,617
I would like to know how to get the current week number from Rails and how do I manipulate it: 1. Translate the week number into date. 2. Make an interval based on week number. Thanks.
2012/10/25
[ "https://Stackoverflow.com/questions/13075617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/788357/" ]
You are going to want to stay away from `strftime("%U")` and `"%W"`. **Instead, use `Date.cweek`.** The problem is, if you ever want to take a week number and convert it to a date, `strftime` won't give you a value that you can pass back to `Date.commercial`. `Date.commercial` expects a range of values that are 1 ba...
[`Date#cweek`](http://ruby-doc.org/stdlib-2.2.2/libdoc/date/rdoc/Date.html#method-i-cweek) seems to get the ISO-8601 week number (a Monday-based week) like `%V` in strftime (mentioned by @Robban in a comment). For example, the Monday and the Sunday of the week I'm writing this: ``` [ Date.new(2015, 7, 13), Date.new(2...
13,659,652
I have found good tutorial to for Handling Screen OFF and Screen ON Intents: <http://thinkandroid.wordpress.com/2010/01/24/handling-screen-off-and-screen-on-intents/> but i want that after screen is off every 5 minutes wifi is checked if is connected ``` ConnectivityManager connManager = (ConnectivityManager)context....
2012/12/01
[ "https://Stackoverflow.com/questions/13659652", "https://Stackoverflow.com", "https://Stackoverflow.com/users/267679/" ]
Everything is fine. You just need to take care of little things. In this case `;` is missing after declaring 'pri\_func2'. ``` pri_func2 = function() { //do something }; ``` This should be enough for this error.
Try this: ``` var Util = {}; Util.data = (function() { var privar, pri_func1 = function() { //do something }, pri_func2 = function() { //do something }; return { // JSLint error pub_fun1: function() { //do something },...
70,993
We know through [General Relativity](http://en.wikipedia.org/wiki/General_relativity) (GR) that matter curves spacetime (ST) like a "ball curves a trampoline" but then how energy curves spacetime? Is it just like matter curvature of ST?
2013/07/13
[ "https://physics.stackexchange.com/questions/70993", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/25589/" ]
Matter curves the spacetime because (experimentally verified and mathematically natural) Einstein's equations that govern the spacetime curvature say that the local-curvature-encoding Einstein tensor $G\_{\mu\nu}$ is proportional to the stress-energy $T\_{\mu\nu}$. The latter contains numbers, especially the density of...
The source of gravity in GR is not just mass, but the full energy-momentum tensor; this tensorial quantity is a measure of energy, momentum and stress, and applies to ALL forms of matter and all fields that are non-gravitational. Furthermore, there exists a quantity in differential geometry which is automatically conse...
70,993
We know through [General Relativity](http://en.wikipedia.org/wiki/General_relativity) (GR) that matter curves spacetime (ST) like a "ball curves a trampoline" but then how energy curves spacetime? Is it just like matter curvature of ST?
2013/07/13
[ "https://physics.stackexchange.com/questions/70993", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/25589/" ]
Theoretical viewpoint: ---------------------- Einstein field equations can be written in the form: $$\color{blue}{G\_{\mu\nu}}=\color{red}{\frac{8\pi G}{c^{4}}} \color{darkgreen}{T\_{\mu\nu}}$$ We can write in simple terms: $$\rm \color{blue}{Space-time \,\,geometry}=\color{red}{const.}\,\,\color{darkgreen}{Material \...
Matter curves the spacetime because (experimentally verified and mathematically natural) Einstein's equations that govern the spacetime curvature say that the local-curvature-encoding Einstein tensor $G\_{\mu\nu}$ is proportional to the stress-energy $T\_{\mu\nu}$. The latter contains numbers, especially the density of...
70,993
We know through [General Relativity](http://en.wikipedia.org/wiki/General_relativity) (GR) that matter curves spacetime (ST) like a "ball curves a trampoline" but then how energy curves spacetime? Is it just like matter curvature of ST?
2013/07/13
[ "https://physics.stackexchange.com/questions/70993", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/25589/" ]
Matter curves the spacetime because (experimentally verified and mathematically natural) Einstein's equations that govern the spacetime curvature say that the local-curvature-encoding Einstein tensor $G\_{\mu\nu}$ is proportional to the stress-energy $T\_{\mu\nu}$. The latter contains numbers, especially the density of...
According to Newtonian gravity if you made 100 million cannon balls (10kg each) and shipped them to deep space assembled them with some explosives and exploded it with enough force so none get hurt but they all went out spherically to a maximum of 2 miles (if you don't know what a mile is, just read it as a km and none...