text:
Q: Definite integral involving an error function Let $$\mathrm{erf}(x) = \frac{2}{\sqrt{\pi}}\int\limits_{0}^x e^{-t^2}dt$$ be the error function. Then, I have tow questions.

*

*For a positive integer $n$, is there a close-form solution of
$f_n=\int_{0}^\infty 1- (\mathrm{erf}(x))^n dx$?

*Is there a positive $c<\infty$ such that $\lim\limits_{n\to\infty}\frac{f_n}{\sqrt{\log n}} =c$.
Mathematica returns $1/\sqrt{\pi}$ when $n=1$ and $\sqrt{2/\pi}$ when $n=2$.

A: To provide motivation for what follows, let's begin with the $n=1$ case.

$$n=1$$
Here we wish to evaluate
$$I_1 = \int_0^{\infty} dx\, \left (1-\operatorname{erf}{x} \right ) $$
where
$$\operatorname{erf}{x} = \frac{2}{\sqrt{\pi}} \int_0^x dt \, e^{-t^2} = \frac{2}{\sqrt{\pi}} x \int_0^1 dt \, e^{-x^2 t^2}$$
Note also that
$$\int_0^{\infty} dt \, e^{-x^2 t^2} = \frac{\sqrt{\pi}}{2 x} \implies 1 = \frac{2}{\sqrt{\pi}} x \int_0^{\infty} dt \, e^{-x^2 t^2} $$
Thus
$$1-\operatorname{erf}{x} = \frac{2}{\sqrt{\pi}} x \left [ \int_0^{\infty} dt \, e^{-x^2 t^2} - \int_0^1 dt \, e^{-x^2 t^2}\right ] = \frac{2}{\sqrt{\pi}} x \int_1^{\infty} dt \, e^{-x^2 t^2}$$
Yes, I know I took a lot of extra steps to derive something that could be presented in one step.  But I need this so the next cases do not seem out of left field.  Anyway, the integral in this case is readily derived by changing the order of integration:
$$\begin{align}I_1 &=  \frac{2}{\sqrt{\pi}} \int_1^{\infty} dt \,  \int_0^{\infty} dx\, x \, e^{-x^2 t^2}\\ &= \frac{1}{\sqrt{\pi}} \int_1^{\infty} dt \frac1{t^2} \\ &= \frac{1}{\sqrt{\pi}} \end{align}$$
OK, I hope that was straightforward.

$$n=2$$
Now let's step things up a bit and evaluate
$$I_2 = \int_0^{\infty} dx\, \left (1-\operatorname{erf}^2{x} \right ) $$
Here, we observe that
$$\operatorname{erf}^2{x} = \frac{4}{\pi} x^2 \int_0^1 dt_1 \, \int_0^1 dt_2 \, e^{-x^2 (t_1^2+t_2^2)} $$
However, in an analogous result as above, note that
$$1 = \frac{4}{\pi} x^2 \int_0^{\infty} dt_1 \, \int_0^{\infty} dt_2 \, e^{-x^2 (t_1^2+t_2^2)} $$
so that
$$1-\operatorname{erf}^2{x} = \frac{4}{\pi} x^2 \left [ \int_0^{\infty} dt_1 \, \int_0^{\infty} dt_2 \, e^{-x^2 (t_1^2+t_2^2)} - \int_0^{1} dt_1 \, \int_0^{1} dt_2 \, e^{-x^2 (t_1^2+t_2^2)} \right ]$$
I hope the reader appreciates why I set up the $n=1$ case as I had done.  Now we have a different sort of complementary region: a small square cut out of a larger one.  Drawing this out, one sees that there are three integration regions: $[0,1] \times [1,\infty)$,  $ [1,\infty) \times [0,1]$, and $[1,\infty) \times [1,\infty)$.  It should be appreciated that the first two regions will result in the same integral by symmetry.  Thus,
$$1-\operatorname{erf}^2{x} = \frac{4}{\pi} x^2 \left [ 2 \int_1^{\infty} dt_1 \, \int_0^{1} dt_2 \, e^{-x^2 (t_1^2+t_2^2)} + \int_1^{\infty} dt_1 \, \int_1^{\infty} dt_2 \, e^{-x^2 (t_1^2+t_2^2)} \right ]$$
Thus,
$$\begin{align} I_2 &= \frac{4}{\pi} \left [ 2 \int_1^{\infty} dt_1 \, \int_0^{1} dt_2 \,  + \int_1^{\infty} dt_1 \, \int_1^{\infty} dt_2 \, \right ] \int_0^{\infty} dx \, x^2 \, e^{-x^2 (t_1^2+t_2^2)} \\ &= \frac1{\sqrt{\pi}} \left [ 2 \int_1^{\infty} dt_1 \, \int_0^{1} dt_2 \, (t_1^2+t_2^2)^{-3/2}  + \int_1^{\infty} dt_1 \, \int_1^{\infty} dt_2 \, (t_1^2+t_2^2)^{-3/2} \right ]\\ &=\frac1{\sqrt{\pi}} \left [ \int_1^{\infty} dt_1 \, \int_0^{1} dt_2 \, (t_1^2+t_2^2)^{-3/2}  + \int_1^{\infty} dt_1 \, \int_0^{\infty} dt_2 \, (t_1^2+t_2^2)^{-3/2} \right ] \\ &= \frac1{\sqrt{\pi}} \left [ \int_1^{\infty} dt_1 \, \frac1{t_1^2} \, \int_0^{\arctan{(1/t_1)}}  d\theta \, \cos{\theta}  + \int_1^{\infty} dt_1 \,  \frac1{t_1^2} \,\int_0^{\pi/2} d\theta \, \cos{\theta} \right ] \\ &= \frac1{\sqrt{\pi}} \left (1+ \int_1^{\infty} \frac{dt_1}{t_1^2 \sqrt{1+t_1^2}} \right ) \\ &= \frac1{\sqrt{\pi}} \left (1+ \int_{\pi/4}^{\pi/2} d\theta \frac{\cos{\theta}}{\sin^2{\theta}} \right ) \\ &=\frac1{\sqrt{\pi}} \left ( 1 + \sqrt{2} - 1 \right ) \end{align} $$
Thus,
$$I_2 = \sqrt{\frac{2}{\pi}} $$

$$n=3$$
$$I_3 = \int_0^{\infty} dx\, \left (1-\operatorname{erf}^3{x} \right ) $$
Now, let's apply similar reasoning to the case $n=3$.  Yes, this involves triple integrals and is messy.
$$\begin{align}1-\operatorname{erf}^3{x} &= \frac{8}{\pi^{3/2}} x^3 \times \\ & \left [ \int_0^{\infty} dt_1 \, \int_0^{\infty} dt_2 \, \int_0^{\infty} dt_3 \, e^{-x^2 (t_1^2+t_2^2+t_3^2)} - \int_0^{1} dt_1 \, \int_0^{1} dt_2 \, \int_0^{1} dt_3 \, e^{-x^2 (t_1^2+t_2^2+t_3^2)} \right ]\end{align}$$
Now we have a three-dimensional space missing a small cube in one corner.  The result is seven different regions, 3 of which are $[1,\infty) \times [0,1] \times [0,1]$, 3 of which are $[1,\infty) \times [1,\infty) \times [0,1]$, and one being $[1,\infty) \times [1,\infty) \times [1,\infty)$.  I hope you are sensing the beginning of a pattern:
$$\begin{align}1-\operatorname{erf}^3{x} &= \frac{8}{\pi^{3/2}} x^3 \times \\ & \left [3 \int_1^{\infty} dt_1 \, \int_0^{1} dt_2 \, \int_0^{1} dt_3 \, e^{-x^2 (t_1^2+t_2^2+t_3^2)} + 3 \int_1^{\infty} dt_1 \, \int_1^{\infty} dt_2 \, \int_0^{1} dt_3 \, e^{-x^2 (t_1^2+t_2^2+t_3^2)} \\ + \int_1^{\infty} dt_1 \, \int_1^{\infty} dt_2 \, \int_1^{\infty} dt_3 \, e^{-x^2 (t_1^2+t_2^2+t_3^2)}\right ]\end{align}$$
Thus, switching the order of integration
$$\begin{align}I_3 &= \frac{8}{\pi^{3/2}} \left [3 \int_1^{\infty} dt_1 \, \int_0^{1} dt_2 \, \int_0^{1} dt_3 \,  + 3 \int_1^{\infty} dt_1 \, \int_1^{\infty} dt_2 \, \int_0^{1} dt_3 \,  + \int_1^{\infty} dt_1 \, \int_1^{\infty} dt_2 \, \int_1^{\infty} dt_3 \,  \right ]\times \int_0^{\infty} dx \, x^3 \, e^{-x^2 (t_1^2+t_2^2+t_3^2)}\\ &= \frac{4}{\pi^{3/2}} \left [3 \int_1^{\infty} dt_1 \, \int_0^{1} dt_2 \, \int_0^{1} \frac{dt_3}{(t_1^2+t_2^2+t_3^2)^{2}} \,  + 3 \int_1^{\infty} dt_1 \, \int_1^{\infty} dt_2 \, \int_0^{1} \frac{dt_3}{(t_1^2+t_2^2+t_3^2)^{2}} \,  + \int_1^{\infty} dt_1 \, \int_1^{\infty} dt_2 \, \int_1^{\infty} \frac{dt_3}{(t_1^2+t_2^2+t_3^2)^{2}} \,  \right ] \end{align} $$
The evaluation of these integrals by hand was a time-consuming exercise that I recommend doing by hand once in your life just to know how much organization and attention to detail it requires.  I did that and will outline below how I did the third one.  However, it should be kept in mind that Mathematica returns the correct value of these integrals.  (This should be seen as a minor victory in and of itself, as Mathematica certainly could not do the original integral.)
So let's consider
$$\int_1^{\infty} \frac{dt_3}{(t_1^2+t_2^2+t_3^2)^{2}}$$
Sub $t_3 = \sqrt{t_1^2+t_2^2} \tan{\theta}$; then the integral is equal to
$$\frac1{(t_1^2+t_2^2)^{3/2}} \int_{\arctan{1/\sqrt{t_1^2+t_2^2}}}^{\pi/2} d\theta\, \cos^2{\theta} \\ = \frac12 \frac1{(t_1^2+t_2^2)^{3/2}} \left [\arctan{\left (\sqrt{t_1^2+t_2^2} \right )} - \frac{\sqrt{t_1^2+t_2^2}}{1+t_1^2+t_2^2} \right ]$$
Now let's do the integration over $t_2$:
$$\begin{align}\int_1^{\infty} dt_2 \, \int_1^{\infty} \frac{dt_3}{(t_1^2+t_2^2+t_3^2)^{2}}  &= \frac12 \int_1^{\infty} dt_2 \, \frac1{(t_1^2+t_2^2)^{3/2}} \left [\arctan{\left (\sqrt{t_1^2+t_2^2} \right )} - \frac{\sqrt{t_1^2+t_2^2}}{1+t_1^2+t_2^2} \right ]\\ &= \frac1{2 t_1^2} \int_{\arctan{1/t_1}}^{\pi/2} d\theta \, \cos{\theta} \left [\tan{\left (\frac{t_1}{\cos{\theta}} \right )}  - \frac{t_1 \cos{\theta}}{t_1^2+\cos^2{\theta}}\right ] \end{align}$$
We integrate by parts and the integral is equal to
$$\frac1{2 t_1^2} \left [\sin{\theta} \arctan{\left (\frac{t_1}{\cos{\theta}} \right )} \right ]_{\arctan{1/t_1}}^{\pi/2} - \frac1{2 t_1^2} \int_{\arctan{1/t_1}}^{\pi/2} d\theta \, \frac{\sin{\theta}}{1+\frac{t_1^2}{\cos^2{\theta}}} \frac{t_1 \sin{\theta}}{\cos^2{\theta}} \\ - \frac1{2 t_1^2} \int_{\arctan{1/t_1}}^{\pi/2} d\theta \, \frac{t_1 \cos^2{\theta}}{t_1^2+\cos^2{\theta}}$$
or
$$\frac1{2 t_1^2} \left [\frac{\pi}{2} - \frac1{\sqrt{1+t_1^2}} \arctan{\sqrt{1+t_1^2}} \right ]  - \frac1{2 t_1} \int_{\arctan{1/t_1}}^{\pi/2} \frac{d\theta}{t_1^2+\cos^2{\theta}}$$
The integral on the RHS may be done by writing $\cos^2{\theta} = 1 - \sin^2{\theta}$, performing a partial fractions decomposition, and then using a Weierstrass substitution $u = \tan{(\theta/2)}$.  I assure the reader I did this by hand and leave the evaluation of the integral as an exercise.  The result is
$$\int \frac{d\theta}{t_1^2+\cos^2{\theta}} = \frac1{t_1 \sqrt{1+t_1^2}} \arctan{ \left (\frac{t_1 \tan{\theta}}{\sqrt{1+t_1^2}} \right )}+C $$
The result is that the integral over $t_2$ is equal to
$$\frac{\pi}{4 t_1^2} \left (1-\frac1{\sqrt{1+t_1^2}} \right ) - \frac1{2 t_1^2 \sqrt{1+t_1^2}} \left (\arctan{\sqrt{1+t_1^2}} - \arctan{\frac1{\sqrt{1+t_1^2}}} \right )$$
Finally, we integrate over $t_1$.  The manipulations at this point will look pretty familiar (i.e., trig substitution and integration by parts), so I will spare the reader the details which I assure I have done out completely by hand.  The result is
$$\int_1^{\infty} dt_1 \, \int_1^{\infty} dt_2 \, \int_1^{\infty} \frac{dt_3}{(t_1^2+t_2^2+t_3^2)^{2}} = \frac{3}{\sqrt{2}} \arctan{\frac1{\sqrt{2}}} - 3 \left ( \sqrt{2}-1 \right )  \frac{\pi}{4}$$
We of course have two other integrals to evaluate.  At this point, I will further spare the reader and just write the results out:
$$\int_1^{\infty} dt_1 \, \int_1^{\infty} dt_2 \, \int_0^1 \frac{dt_3}{(t_1^2+t_2^2+t_3^2)^{2}} = \left (2 \sqrt{2} - 1 \right ) \frac{\pi}{4} - \frac{3}{\sqrt{2}} \arctan{\frac1{\sqrt{2}}}  $$
$$\int_1^{\infty} dt_1 \, \int_0^1 dt_2 \, \int_0^1 \frac{dt_3}{(t_1^2+t_2^2+t_3^2)^{2}} =  \frac{3}{\sqrt{2}} \arctan{\frac1{\sqrt{2}}} - \sqrt{2} \frac{\pi}{4}$$
Finally, we can now simply write the value of the original integral as

$$I_3 = \frac{6}{\pi} \sqrt{\frac{2}{\pi}} \arctan{\frac1{\sqrt{2}}} $$

For arbitrary $n$, I hope it is clear how one may go about the evaluation of the integral:
$$\int_0^{\infty} dx \, \left (1-\operatorname{erf}^n{x} \right ) = \\\frac12 \Gamma \left (\frac{n+1}{2} \right ) \left (\frac{2}{\sqrt{\pi}} \right )^n \sum_{k=1}^n \binom{n}{k} \int_1^{\infty} dt_1 \, \cdots \int_1^{\infty} dt_k \, \int_0^1 dt_{k+1} \, \cdots \int_0^1 dt_n \left (t_1^2+\cdots t_n^2 \right )^{-(n+1)/2}  $$
I will leave it here at this point.

A: Let $\Delta^{n}$ be a portion of the unit $n$-sphere $S^n$ defined by
$$ \Delta^n = \{ \omega \in S^n : 0 < \omega_1 < \cdots < \omega_n < \tfrac{1}{\sqrt{2}} \omega_{n+1} \}. \tag{1} $$
Then it is not hard to check that for $n \geq 2$,
$$ f_n = 2^{n-\frac{5}{2}} \pi^{-n/2} n! \left( \tfrac{n-3}{2} \right)! \operatorname{Vol}(\Delta^{n-2}). $$
(Here, we use the convention that $\Delta^0$ is a single point and thus $\operatorname{Vol}(\Delta^0) = 1$.) This allows to compute $f_n$ for certain $n$'s:

*

*When $n = 2$, we immediately have
$$ f_2 = \sqrt{\frac{2}{\pi}}. $$

*When $n = 3$, then $\Delta^1$ is a portion of the unit circle with arc length $\arctan(1/\sqrt{2})$. So we have
$$ f_3 = \frac{6\sqrt{2}}{\pi^{3/2}} \arctan(1/\sqrt{2}). $$

*When $n = 4$, it is not hard to check that $\Delta^2$ is a spherical triangle with angles $\frac{\pi}{4}$, $\frac{\pi}{2}$ and $\arctan \sqrt{2}$. Consequently the area of $\Delta^2$ is $\frac{\pi}{4} - \arctan(1/\sqrt{2})$, which is equal to $\frac{1}{2}\arctan(1/\sqrt{8})$. So we have
$$ f_4 = \frac{12\sqrt{2}}{\pi^{3/2}} \arctan(1/\sqrt{8}). $$
I am not sure about $n =5$, but it probably requires some well-established theory on orthoschemes to compute the volume of $\Delta^3$. So I will stop here.
Instead, let us investiguate the asymptotic behavior of $f_n$.

Intuition. Let $X_1, X_2, \cdots$ be i.i.d. such that the common CDF $F_X$ is given by $\mathrm{erf}$. (In particular, $X_i$ are a.s. non-negative.) Let $M_n = \max\{X_1, \cdots, X_n\}$. Then
$$ \Bbb{P}(M_n > x) = 1 - \Bbb{P}(M_n \leq x) = 1 - F_X(x)^n = 1 - \operatorname{erf}(x)^n. $$
Consequently we have
$$ f_n = \int_{0}^{\infty} (1 - \operatorname{erf}(x)^n) \, dx
= \Bbb{E}M_n. $$
In general, $M_n$ has roughly the same asymptotics as the last $n$-quantile of the distribution of $X$. In other words, if $x_n$ is chosen so that $F_X(x_n) = 1 - n^{-1}$ then $M_n$ and $x_n$ has roughly the same order. But in our case, it is not hard to show that $x_n \sim (\log n)^{1/2}$. Thus we expect that $f_n \sim (\log n)^{1/2}$.

Solution. Apply the substitution $x \mapsto x \sqrt{\log n}$ to write
$$ \frac{f_n}{\sqrt{\log n}} = \int_{0}^{\infty} (1 - \operatorname{erf}(x \sqrt{\log n})^n ) \, dx. $$
In order to facilitate this identity, we first make the following simple observation:

Lemma. We have $\operatorname{erf}(x) = 1 - \frac{1 + o(1)}{x\sqrt{\pi}} e^{-x^2} $ as $x \to \infty$.

Indeed, this is a direct consequence of the L'Hospital's rule. Now fix any $R > 1$. By the lemma, there exists a sufficiently large $N = N(R)$ such that for $x \geq R$ and $n \geq N$ we have a uniform estimate
$$ 1 - \operatorname{erf}(x \sqrt{\log n})^n
\leq n \operatorname{erf}(x \sqrt{\log n})
\leq \frac{C}{x \sqrt{\log n}} n^{1-x^2}
\leq \frac{C}{x\sqrt{\log n}} N^{1 - x^2} $$
for some constant $C = C(R) > 0$. Thus it follows that
$$ 0 \leq \int_{R}^{\infty} (1 - \operatorname{erf}(x \sqrt{\log n})^n) \, dx
\leq \frac{C}{\sqrt{\log n}} \int_{R}^{\infty} \frac{N^{1 - x^2}}{x} \, dx \xrightarrow{n\to\infty} 0. $$
On the other hand, for any fixed $x > 0$ we have
$$ \operatorname{erf}(x \sqrt{\log n})^n
= \left(1 - \frac{1+o(1)}{x\sqrt{\pi \log n}} n^{-x^2} \right)^n \xrightarrow{n\to\infty} \begin{cases}
0, & x < 1 \\
1, & x \geq 1.
\end{cases} $$
Thus by the bounded convergence theorem, we have
$$ \int_{0}^{R} (1 - \operatorname{erf}(x \sqrt{\log n})^n) \, dx \xrightarrow{n\to\infty} 1. $$
Therefore we have
$$ \lim_{n\to\infty} \frac{f_n}{\sqrt{\log n}} = 1. $$

A: Here is a partial answer: For $n=3$ and $n=4$, closed-form solutions exist, according to Ng and
Geller (A Table of Integrals of the Error Function.  II. Additions and Corrections, Journal of Research of the National Bureau of Standards, Vol. 75B, 1971, pp. 149-163;
see $\S3.7$, Eqs. 21 and 22, p. 158),
$$f_3={6\over\pi}\sqrt{2\over\pi}\tan^{-1}(2^{-1/2})$$ and $$f_4={12\over\pi}\sqrt{2\over\pi}\tan^{-1}(8^{-1/2})\,.$$
I verified Ng and Geller's expressions via Mathematica's numerical integration routine, NIntegrate.  I don't quite see the derivation yet, but I'll try to generalize to other values of $n$.


text:
Q: Ora 00907 missing right parenthesis in SQL SELECT
    g.msisdn, c.name3, c.id_number,
    decode(g.sub_state, 'B01', 'Active', 'B02', 'Close', 'B03', 'Suspend','B02', 'Barring') STATUS,
    decode(g.prepaid_flag, '0', 'Prepaid', '1', 'Postpaid','3', 'Hybrid') RATING,
    d.offer_name, t.create_date
    FROM inf_subscriber_all g
    INNER JOIN (
    SELECT a.sub_id, a.cust_id, a.offer_id, a.create_date FROM (
    SELECT cust_id,MAX(create_date) AS maxdate FROM his_offers WHERE primary_flag ='1' GROUP BY cust_id) as tm
    INNER JOIN his_offers a ON a.create_date = tm.maxdate and a.cust_id = tm.cust_id) as a ON a.cust_id = g.cust_id
    INNER JOIN inf_customer_all c ON c.cust_id = a.cust_id
    INNER JOIN pdm_offer d ON d.offer_id = a.offer_id
    WHERE g.msisdn IN ('135018013','197745505','195154724')

Please help, i dont know why i am getting missing right parenthesis error for this sql script

A: You tagged your question MySQL but the error message indicates Oracle, as does the syntax (DECODE() is supported in Oracle but not in MySQL).
The parentheses in your query do balance. An issue that catches the eye is you are using the as keyword to alias the subqueries. Oracle does not support that (as is allowed for column alias only); you would need to remove these:
SELECT ...
FROM inf_subscriber_all g
INNER JOIN (
    SELECT ...
    FROM (
        ...
    ) as tm                         ---> here
    INNER JOIN his_offers a ON ...
) as a ON ...                       ---> and here
INNER JOIN inf_customer_all c ON ...
INNER JOIN pdm_offer d ON ...
WHERE ...

As for the query itself: it seems the subquery is meant to select the his_offer row that has the greatest create_date for each cust_id. This might be more efficiently expressed with window functions:
SELECT
    g.msisdn, c.name3, c.id_number,
    decode(g.sub_state, 'B01', 'Active', 'B02', 'Close', 'B03', 'Suspend','B02', 'Barring') STATUS,
    decode(g.prepaid_flag, '0', 'Prepaid', '1', 'Postpaid','3', 'Hybrid') RATING,
    d.offer_name, t.create_date
FROM inf_subscriber_all g
INNER JOIN (
    SELECT a.*, RANK() OVER(PARTIION BY cust_id ORDER BY create_date) rn
    FROM his_offers
) as a ON a.cust_id = g.cust_id AND a.rn = 1
INNER JOIN inf_customer_all c ON c.cust_id = a.cust_id
INNER JOIN pdm_offer d ON d.offer_id = a.offer_id
WHERE g.msisdn IN ('135018013','197745505','195154724')

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to make an rectangle with top and bottom shadow in android using layer-list?
I need an yellow rectangle with shadows on top and bottom as given in the image , how can i draw this using layer-list, i have no idea how to do this , especially the shadows how to achieve that shape?

A: Using a layer-list seems like the best option. You'll need two rectangles, the main yellow one, and another for the shadow. You can then rotate the shadow rectangle a little to get the effect you want.
For example:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:top="20dp" android:left="20dp" android:bottom="20dp" android:right="20dp">
        <rotate
            android:fromDegrees="-5"
            android:toDegrees="-5"
            android:pivotX="50%"
            android:pivotY="50%">
            <shape android:shape="rectangle">
                <size android:width="300dp"
                    android:height="150dp"/>
                <solid android:color="#999999"/>
            </shape>
        </rotate>
    </item>

    <item android:top="20dp" android:left="20dp" android:bottom="20dp" android:right="20dp">
        <shape android:shape="rectangle">
            <size android:width="300dp"
                android:height="150dp"/>
            <solid android:color="#FFDD66"/>
        </shape>
    </item>
</layer-list>

If you need to make the shadow smaller, as you said in a comment, you can scale down the rectangle. You can do this either by making it smaller to begin with (the width and height) or using <scale> ... </scale> tags. Here's a related SO question.


text:
Q: html/css review slider works on codepen, but not on actual website I built out a review slider to display various reviews from customers across all of our marketplaces, it works great on codepen, but not so much on the website. Im sure im missing something simple, but can't figure it out.
Platform: Magento 2.3.5 P2
How the slider appears on the website
https://codepen.io/hqqh/pen/VwpzGYV

.slider {

            background: linear-gradient(90deg, rgba(235, 235, 235, 1) 0%, rgba(255, 255, 255, 1) 50%, rgba(235, 235, 235, 1) 100%);
            box-shadow: 0 10px 20px -5px rgba(0, 0, 0, .125);
            height: 250px;
            margin: auto;
            overflow: hidden;
            position: relative;
            width: 1280px;
            padding-top: 30px;
            padding-bottom: 10px;
            border-radius: 5px;
        }

        .slider::before,
        .slider::after {
            background: linear-gradient(to right, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 50%);
            content: "";
            height: 290px;
            position: absolute;
            width: 200px;
            z-index: 2;

        }

        .slider::before {
            left: 0;
            top: 0;
        }

        .slider::after {
            right: 0;
            top: 0;
            transform: rotateZ(180deg);
        }

        @keyframes scroll {
            0% {
                transform: translateX(0);
            }

            100% {
                transform: translateX(calc(-250px * 7))
            }

        }

        .slide-track {
            animation: scroll 60s linear infinite;
            display: flex;
            width: calc(250px * 14);
        }

        .slide {
            height: 214px;
            width: 350px;

        }

        .review-card {
            background: white;
            margin: 10px;
            height: 195px;
            padding: 7px;
            box-shadow: 0 10px 20px -5px rgba(0, 0, 0, .125);
            border-radius: 10px;

        }

        .review-card-header {
            height: 80px;
        }

        .review-card p {
            font-family: 'Roboto Condensed', sans-serif;
        }

        .ebay-logo,
        .az-logo {
            position: relative;
            top: -40px;
            left: -40px;
            width: 150px;
            height: 150px;
        }

        .review-content {
            padding: 5px;
            height: 60px;
            position: relative;
            z-index: 2;
            margin-bottom: 0px;
            bottom: 18px;
        }

        .review-content::before,
        .review-content::after {
            font-family: FontAwesome;
            padding: 5px;
            color: #d3d3d3;
            margin: 5px;

        }

        .review-content::before {
            content: "\f10d";
        }

        .review-content::after {
            content: "\f10e";
        }
 <link rel="stylesheet" type="text/css" media="all"
        href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css" />
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto+Condensed:400" />
    <link rel="stylesheet" href="//use.fontawesome.com/releases/v5.0.7/css/all.css">
    <meta name="viewport" content="width=device-width, initial-scale=1 user-scalable=no">
    <link rel="preconnect" href="https://fonts.gstatic.com">
    <link href="https://fonts.googleapis.com/css2?family=Oswald:wght@600&display=swap" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">

Over
                    1,000,000 Happy Customers Served

These are just a handful of the reviews we have
                    received recently across all of our marketplaces

Arrived quicker than expected, was very very well
                                                packaged, paint was excellent. Would highly recommend. Thank You

-eBay Customer 2021

Couldn't be happier with the new front bumper cover!!! MBI auto got the paint matched perfectly, and the fit was FANTASTIC! We are thrilled! Last picture is the original bumper cover after my wreck

-Amazon Customer 2021

I received the bumper I ordered sooner than expected and was pleasantly surprised. It fit just right and paint matched perfectly. I would definitely recommend trying them out for a replacement bumper.

-Google Review 2021

Arrived quicker than expected, was very very well
                                                packaged, paint was excellent. Would highly recommend. Thank You

-eBay Customer 2021

Arrived quicker than expected, was very very well
                                                packaged, paint was excellent. Would highly recommend. Thank You

-Amazon Customer 2021

Click Here To View More Customer Reviews


text:
Q: I'm getting error of driver .exe not exist on the path given? I'm learning selenium and while running my 1st practice script which is pasted below i'm getting the error of driver exe not exist on the path though i have tried to paste exe file of chrome driver on different locations and then gave the path and re run the script. But all the same i'm getting this error over and over again please help me to figure it out:
Practice Script Is:
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;

public class PracticeSelenium {
    public static void main(String[] args){
        System.setProperty("webdriver.chrome.driver",
                "C:\\Downloads\\chromedriver.exe");
        WebDriver driver = new ChromeDriver();
        driver.get("http://demo.guru99.com/");
        WebElement element=driver.findElement(By.xpath("//input[@name='emailid']"));
        element.sendKeys("abc@gmail.com");

        WebElement button=driver.findElement(By.xpath("//input[@name='btnLogin']"));
        button.click();
    }
}

Error/Exception is:
"C:\Program Files\Java\jdk1.8.0_161\bin\java" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.1\lib\idea_rt.jar=49519:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.1\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_161\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\rt.jar;E:\Python\JavaSelenium\out\production\JavaSelenium;I:\selenium-java-3.14.0\client-combined-3.14.0.jar;I:\selenium-java-3.14.0\libs\byte-buddy-1.8.15.jar;I:\selenium-java-3.14.0\libs\commons-codec-1.10.jar;I:\selenium-java-3.14.0\libs\commons-logging-1.2.jar;I:\selenium-java-3.14.0\libs\commons-exec-1.3.jar;I:\selenium-java-3.14.0\libs\guava-25.0-jre.jar;I:\selenium-java-3.14.0\libs\httpclient-4.5.5.jar;I:\selenium-java-3.14.0\libs\httpcore-4.4.9.jar;I:\selenium-java-3.14.0\libs\okhttp-3.10.0.jar;I:\selenium-java-3.14.0\libs\okio-1.14.1.jar" PracticeSelenium
Exception in thread "main" java.lang.IllegalStateException: The driver executable does not exist: C:\Downloads\chromedriver.exe
    at com.google.common.base.Preconditions.checkState(Preconditions.java:585)
    at org.openqa.selenium.remote.service.DriverService.checkExecutable(DriverService.java:137)
    at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:132)
    at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:35)
    at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:156)
    at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:346)
    at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:91)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:123)
    at PracticeSelenium.main(PracticeSelenium.java:10)

Process finished with exit code 1

Thanks :)

A: public static WebDriver driver;

public class PracticeSelenium {
public static void main(String[] args){
System.setProperty("webdriver.chrome.driver", "C:\\Downloads\\chromedriver.exe");

driver = new ChromeDriver();

driver.get("http://demo.guru99.com/");
WebElement element=driver.findElement(By.xpath("//input[@name='emailid']"));
element.sendKeys("abc@gmail.com");

WebElement button=driver.findElement(By.xpath("//input[@name='btnLogin']"));
button.click();
    }
}


text:
Q: Directly accessing ColdFusion index.cfm on IIS results in 404 I have a virtual website running off of IIS (looks like version 6.1, SP 1) and ColdFusion 11.
When I access a page as http://something.example.org/ which uses a ColdFusion template (index.cfm), the page correctly displays. However, when I request http://something.example.org/index.cfm it results in a 404.
Another virtual website on the same server behaves correctly, returning successfully for both http://other.example.org and http://other.example.org/index.cfm
Since I just set up this new website, I'm wondering if there is an additional setting I'm just missing that prevents this error from occurring.
DefaultDocument is definitely not involved since, e.g. http://something.example.org/foo.cfm also results in a 404 even when foo.cfm exists in the root folder. Meanwhile, it finds foo.html in the same folder, so it's definitely not pointing to the wrong place.

A: Looks like the error was caused because my website's physical path was set to c:\path\to\directory\ instead of C:\path\to\directory. Once I took off the trailing backslash (pretty sure capitalization of the drive letter was a red herring but changed it just in case), the 404s stopped. My best guess is that when you include the backslash at the end, this changes the mapping sent to CF.
I also followed these instructions to add a virtual jakarta directory:

Right click on the website and add a mapped virtual directory named "jakarta" to C:\Coldfusion10\config\wsconfig{instance id} (in my case, it was \1 )

Not sure whether adding the jakarta directory is necessary or not, but it definitely wasn't sufficient: the problem was not fixed until I removed the trailing slash.


text:
Q: Silent Uninstall Intel Graphics We're currently planning to upgrade over 200 computers from Windows 7 to 10. Unfortunately all these machines don't have compatible Intel Graphic driver version for Windows 10 so the update fails (yes the drivers are fully up-to-date). The only way to bypass it is to uninstall the Intel Graphics driver/software, but I can't find a silent command method for this. We have a central tool that can push commands as an admin but I'm not sure what command to use. Any suggestions?
Note: Reinstalling the drivers back silently isn't a problem as one of our tools can do it.

A: You can use the devcon utility to remove the display driver silently via the command line. You can get the utility and more information -> https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/devcon
Once you have the devcon utility you can run --> devcon.exe remove
The Hardware ID for the display driver models that are failing the Windows 10 compatibility check were obtained by opening Device Manager then opening the properties of the display adapter causing the issue, clicking the details tab, within the Property section find the Hardware Ids entry, then copy the first ID listed .


text:
Q: Beth cardinals and inacceesible cardinals Since my last question here about the Alephs was too imprecise and thus went over like a lead balloon, I am trying a new and simpler question which asks what I probably should have asked before.
Under "Beth Numbers" in Wikipedia I read:
"In ZF, for any cardinals $\kappa$ and $\mu$, there is an ordinal $\alpha$ such that:
$\kappa \leq \beth_\alpha(\mu)$."
But under "Inaccessible Cardinals" I read:
"a cardinal $\kappa$ is strongly inaccessible if it is uncountable, it is not a sum of fewer than $\kappa$ cardinals that are less than $\kappa$, and $\alpha < \kappa$ implies $2^\alpha < \kappa$."
These two passages are troubling to me since they seem to be contradictory.  The first one seems to imply that for ANY cardinal one can always find a Beth number which exceeds it.  While the second one clearly seems to imply that the first inaccesible and any cardinal larger than it, of which there are uncountably many, of course, are all vastly larger than any Beth cardinal generated by even $\omega$ applications of the Power Set operation could ever be.
I assume that I am simply missing something important here, and that both statements from the Wikipedia are actually true.  But what exactly am I missing??

A: It seems like the issue you're having is with understanding what $\beth_\alpha$ means when $\alpha \geq \omega$.  The definition is by recursion: $\beth_0 = \aleph_0$, for any ordinal $\alpha$ we define $\beth_{\alpha+1} = 2^{\beth_\alpha}$, and when $\alpha$ is a limit ordinal we have $\beth_\alpha = \sup\{\beth_\beta : \beta < \alpha\}$.  This allows us to continue the powerset operation transfinitely.
Notice that, for every $\alpha$, $\aleph_\alpha \leq \beth_\alpha$.  Thus, if $\kappa = \aleph_\alpha$, then $\beth_\alpha \geq \aleph_\alpha = \kappa$, so it is indeed true that there is a $\beth$ number larger than $\kappa$ (if you want strictly larger, go for $\beth_{\alpha+1}$).
The reason the previous paragraph doesn't contradict the definition of $\kappa$ being inaccessible is that if $\kappa$ is inaccessible then the $\alpha$ for which $\kappa = \aleph_\alpha$ is $\kappa$ itself, i.e., $\kappa = \aleph_\kappa$.  Thus, unlike in the definition of inaccessibility, we're not in the position of calculating $2^{\alpha}$ with $\alpha < \kappa$.

A: Your comments indicate that you are dubious about iterating operations on ordinals more than finitely many times, and very dubious about iterating them uncountably many times. This is a fundamental point in set theory. The danger is in thinking of recursive definitions as processes which need to be carried out, in which case our "finitary biases" get in the way. Instead, you should think of a recursive definition as "happening all at once." Essentially, we can show that every recursive description corresponds to a unique function, and what lets us do this is transfinite induction. (It shouldn't be surprising that "we can do recursion for as long as we can do induction.")
Specifically, suppose that $F:Ord\rightarrow Ord$ is a function on ordinals (or rather, class function; for simplicity I'm assuming we're working in a theory like NBG that makes all this much simpler to say). For $\theta>0$ an ordinal, say that a function $G$ iterates $F$ along $\theta$ starting at $\alpha$ iff

*

*The domain of $G$ is $\theta$,

*$G(0)=\alpha$,

*for $\beta+1<\theta$ we have $G(\beta+1)=F(G(\beta))$, and

*for $\lambda<\theta$ a limit we have $G(\lambda)=\sup\{G(\beta): \beta<\lambda\}$.
Incidentally, this last condition is really only a natural thing to do if $F$ is nondecreasing, but strictly speaking this works for any $F$.
In principle, there could be many $G$ with this property, or none at all. However, it turns out that there is only ever exactly one:

For every $F:Ord\rightarrow Ord$ (= the function to be iterated), $\theta>0$ (= the iteration length), and $\alpha$ (= the starting value), there is exactly one $G$ which iterates $F$ along $\theta$ starting at $\alpha$.
Moreover, the $G$s "cohere" in the sense that if $G$ iterates $F$ along $\theta$ starting at $\alpha$ and $G'$ iterates $F$ along $\theta'$ starting at $\alpha$, with $\theta<\theta'$, then for each $\eta<\theta$ we have $G(\eta)=G'(\eta)$. So in some sense there is a unique way to iterate $F$ along $Ord$.

The proof is by transfinite induction: fixing an arbitrary $F$ and $\alpha$, consider some $\theta$ such that the claim holds for all iteration lengths $<\theta$. Intuitively, if $\theta=\gamma+1$ we just take the $G$ for $\gamma$ and "stick one more value onto it," and if $\theta$ is a limit we "glue the earlier $G$s together." It's a good exercise to turn this vague hint into an actual proof.
The sequence of $\beth$ numbers can be constructed in this way:

*

*$F$ is the map sending an ordinal $\alpha$ to the cardinality of the powerset of $\alpha$ (which, remember, is itself an ordinal - cardinals are just initial ordinals).

*The starting value $\alpha$ is $\omega$: this amounts to setting $\beth_0=\omega$.

*To determine what $\beth_\eta$ should be, we set $\theta=\eta+1$ - or really we pick any $\theta>\eta$, by the "coherence" point above it doesn't affect the answer.

A: Say that a natural number $n$ is "large" if for any number $k$ you'd think of in the next 24 hours, $n>10^k$. Let's go bigger, say $n>k\uparrow^k k$, using the Knuth notation.
Pretty much by definition, $n$ is unimaginably large. So large that for the next 24 hours there is no way you can even imagine it. But tomorrow evening, you'd be sitting with a beer and realize that you can imagine an even larger number. Why is that even possible? Because even though this $n$ is large, almost all the other natural numbers are larger.
Inaccessible cardinals are ordinals. They are incredibly large, yes. But at the end of the day, most ordinals are in fact larger. More cardinals are larger.
If $\kappa$ is inaccessible and $\mu<\kappa$, then we can prove that the smallest $\alpha$ for which $\kappa\leq\beth_\alpha(\mu)$ is in fact $\kappa$ itself. Namely, $\kappa\leq\beth_\kappa(\mu)$, and they are in fact equal, and if $\alpha<\kappa$, then $\beth_\alpha(\mu)<\kappa$ as well. But since $\kappa$ is an ordinal, taking $\alpha=\kappa$ is perfectly valid.
So there is no contradiction there. You can move to $\aleph$ fixed points, whose existence is provable in $\sf ZFC$, and replace the $\beth_\alpha(\mu)$ by $\mu^{+\alpha}$, the $\alpha$th successor of $\mu$. If $\kappa=\aleph_\kappa$, and $\mu,\alpha<\kappa$, then $\mu^{+\alpha}<\kappa$. Nevertheless, there is some $\beta$ such that $\mu^{+\beta}\geq\kappa$, in fact a proper class of those $\beta$s. And specifically, $\kappa$ itself works for that.


text:
Q: How to Hide Fragment Fields dynamically in fiori app I have a requirement to hide a fragment view field in one of my fiori apps, There are no extensions available to do this!
I tried to write a hook method 'onafterrendering' in a custom container of the main view but still not able to succeed!
Could any of one you guide me to hide fragment view field dynamically in the called app?
Thanks and Regards
Ranjith Rupireddy
Tried with the below code in custom control of main view ( In extension of Fiori app)
onAfterRendering : function(){

  var buttonToHide = this.getView().byId("changePictureBtn");

  buttonToHide.setVisible(false);

},

I should hide the fragment field as attached with this Question..

A: can you try the following:
var oPictureButton = sap.ui.getCore().byId("changePictureBtn");
oPictureButton.setVisible(false);


text:
Q: Only show posts with date of today or in the future (i.e don't show past posts)? Is it possible to only show posts that have todays date or in the future? I don't want to show any posts that are in the past.
Also, I want the list to show posts that have a date in the future as in the CMS it shows as scheduled.
Here's my loop:

<?php echo the_title(); ?>

    <?php $portfolioloop = new WP_Query(array(
    'paged'          => get_query_var('paged'),
    'post_type'      => 'news',
    'posts_per_page' => 4,
    'tax_query'      => array(
        array(
        'taxonomy' => 'news',
        'field'    => 'id',
        'terms'    => 51,
        ),
        ),
    )); ?>
    <?php while ( $portfolioloop->have_posts() ) : $portfolioloop->the_post(); ?>
    <div class="news-item" onClick="location.href='<?php echo the_permalink(); ?>'">

<a style="color:#F45B11!IMPORTANT;" href="<?php echo the_permalink(); ?>"><?php echo the_time('d.m.Y'); ?> / <?php echo the_title(); ?>

        <?php if (get_field('description') != "") { ?>
        <?php echo the_field('description'); ?>
        <?php } else {
        $newscontent = get_the_content();
        $newscontent_str = strip_tags($newscontent, '');
        echo substr($newscontent_str,0,250) . "…";
        } ?>

    <?php endwhile; // end of the loop. ?>

<?php echo $portfolioloop->post_count; ?> opportunities

    <?php if (function_exists('wp_pagenavi')) {
    wp_pagenavi( array( 'query' => $portfolioloop ) ); } ?>

A: Can't believe I didn't see this sooner, simply solved it with this in the query:
'post_status'   => 'future'
So once published it just disappears from the list.

A: As described here, you could add an additional filter to your query.
// Create a new filtering function that will add our where clause to the query
function filter_where( $where = '' ) {
    $where .= " AND DATE(post_date) >= DATE(NOW())";
    return $where;
}

add_filter( 'posts_where', 'filter_where' );
$query = new WP_Query( $query_string );
remove_filter( 'posts_where', 'filter_where' );

In your case that means the following:
<?php
 // Create a new filtering function that will add our where clause to the query
 function filter_where( $where = '' ) {
    $where .= " AND DATE(post_date) >= DATE(NOW())";
    return $where;
 }

 add_filter( 'posts_where', 'filter_where' );
 $portfolioloop = new WP_Query(array(
    'paged'          => get_query_var('paged'),
    'post_type'      => 'news',
    'posts_per_page' => 4,
    'tax_query'      => array(
        array(
        'taxonomy' => 'news',
        'field'    => 'id',
        'terms'    => 51,
        ),
        ),
    ));
 remove_filter( 'posts_where', 'filter_where' );
?>

A: $query = new WP_Query('m>='.time());
if($query->have_posts()):
while($query->have_posts()):
$query->the_post();
endwhile
endif;


text:
Q: lines in a plane. Let there be 'p' lines which are concurrent at a point A and 'q' other are concurrent at a point B. Oh, and no 2 lines are parallel.
Case 1: No line out of 'p' passes through B and similarly for 'q' and A.
What are the number of points of intersection in the plane?
Case 2: There is one line which passes through both A and B. (the number of lines is still p+q)
Now find number of points of intersection.
My doubt is, will the number of points of intersection still be the same?

A: Suppose there are $a$ lines that pass through $A$ and $b$ lines that pass through $B$ .We shall prove every intersection point except $A$ and $B$ is the intersection point of exactly two lines.  You can prove it by contradiction: Suppose there are $3$ concurrent lines, then two of those lines must pass either through $A$ or $B$.  but if two of those lines pass through $A$ they already intersected there, so they can't intersect twice. Therefore for every pair of lines, one crossing $A$ and one crossing $B$ there is a unique interection point.
In the other case the answer is $(a-1)(b-1)+2$ since we could just remove that line and we would be left with the previous case with $a-1$ lines thorugh $A$ and $b-1$ lines through $b$. Notice the line passing through $A$ and $B$ didn't add any intersection points.


text:
Q: Use of IS and WAS in reported speech Which one is more correct:

Melissa said she was going to the mall.

or

Melissa said she is going to the mall.

A: Both are correct.

Melissa said she WAS going to the mall.

This implies that at some point she had informed you that she was going to the mall. Whether she went there is ambiguous.

Melissa said she IS going to the mall.

This implies that she is on her way to the mall.
Depending on the situation, either could be right.
For example, you're in college and you're sitting in front of the TV and it's late and your roommate asks where Melissa is. Your response would most like be: "Melissa said she was going to the mall.
If you're sitting in front of the TV and Melissa has just stepped out the door after telling you where she was going and your roommate asks where she's heading off to, then your response would likely be: "Melissa said she is going to the mall.


text:
Q: how to use JsonConvert.DeserializeObject for values without name I have a json string like this:
{"status":false,"data":{"errors":{"":"error45"}}}
I cant make a class for this json string, because the last part has no name => ""
I test this class:
public class Result
{
    public bool status { set; get; }
    public ResultDetail data { set; get; }
}

public class ResultDetail
{
    public ErrorDetails errors { set; get; }
}

public class ErrorDetails
{
    public string abc { set; get; }
}

but abc returns null !!!!

A: You can use the Dictionary<string, string> for the errors.
public class Result
{
    public bool status { set; get; }
    public ResultDetail data { set; get; }
}

public class ResultDetail
{
    public Dictionary<string, string> errors { set; get; }
}

and use the following to deserialize and access the dictionary.
var result = JsonConvert.DeserializeObject<Result>(json);
Console.WriteLine(result.data.errors.Values.FirstOrDefault());

Or you can assign the value to a variable
obj.data.errors.TryGetValue("", out string error);
Console.WriteLine(error);

I will mention this as well that the property names should be Proper names (first letter Capital). To be able to deserialize properly, use the [JsonProperty("corresponding_json_key")] to each of your properties of your classes to conform to C# standards.
public class Result
{
    [JsonProperty("status")]
    public bool Status { set; get; }

    [JsonProperty("data")]
    public ResultDetail Data { set; get; }
}


text:
Q: jquery, post multiple variables I am brand new to jquery and trying to modify a basic script from php academy.
the jquery script is:
<script type="text/javascript">
function get() {
    $.post('getpeopleinjobs.php', {
        postvarfname: form.firstname.value,
        postvarlname: form.d = surname.value
    }, function(output) {
        $('#age').html(output).show();
    });
}
</script>

and my form code is:
    <form name="form">
    <input type="text" id="firstname">
    <input type="text" id="surname">
    <input type="button" value="get" onclick="get();">
    </form>

This worked perfectly when I was passing just one variable and my code snippet was:
$.post('getpeopleinjobs.php', {
    postvarfname: form.firstname.value
}

I then tried to add a second variable with
$.post('getpeopleinjobs.php', {
    postvarfname: form.firstname.value,
    postvarlname: form.d = surname.value
}

It does not work now in Internet Explorer but interestingly enough it does work in Chrome?
Any advice for the beginner?=

A: You have the concept down correctly but there appears to be a minor mistake
//Posted Code
$.post ('getpeopleinjobs.php',{postvarfname: form.firstname.value,postvarlname: form.d=surname.value}
// Fixed Code
$.post ('getpeopleinjobs.php',{postvarfname: form.firstname.value, postvarlname: form.surname.value}

A: You have a typo in your post code:
$.post('getpeopleinjobs.php',{
    postvarfname: form.firstname.value,
    postvarlname: form.surname.value
}, function () { /* ... */ });

Should work fine.

A: It looks like you have an issue in your script.  Remove the = sign:
$.post ('getpeopleinjobs.php',{postvarfname: form.firstname.value,postvarlname: form.surname.value});

You may also simply want to write the script as:
$.post ('getpeopleinjobs.php',$(form).serialize());

This way if you add additional fields to the form you don't have to modify the script.


text:
Q: Why is it necessary to imbue a stream with fixed length encoding? Also, how can I prevent leaking memory when imbuing? The other day, I was writing code similar to:
wchar_t buffer[1024];
std::wifstream input(L"input.txt");

while (input.good())
{
    input::getline(buffer, 1024);
    // ... do stuff...
}

input.close();

I found that, after the first call to getline, buffer contained the correct data (UTF-16 LE) bytes, but instead of buffer being seen as a wchar_t array, it had magically transformed into a byte array.  I reinterpret_cast<wchar_t *>(buffer) and obtained the result I wanted.
Then the next call to getline... this time, buffer was again seen as a byte array, but the bytes were skewed.  I expected to see 0x31 0x00 0x32 0x00 0x33 0x00, but instead I saw 0x00 0x31 0x00 0x32 0x00 0x33
Now, I can understand how things might get skewed if characters had variable length encodings...but ALL the characters in my input.txt file are ASCII and consequently can be encoded with 2 bytes each (using UTF16-LE).  Why the skew?
An answerer on SO informed me that I should imbue the stream as so:
std::wifstream fin("text.txt", std::ios::binary);
// apply facet
fin.imbue(std::locale(fin.getloc(),
          new std::codecvt_utf16<wchar_t, 0x10ffff, std::little_endian>));

Indeed, this resolved my issue completely.  I don't understand why imbuing is necessary if all the characters you are dealing with have a fixed length encoding?
Secondly, the second parameter to imbue seems to be leaking memory?!  If I allocate a std::codecvt_utf16<wchar_t, 0x10ffff, std::little_endian> object on the stack and pass its address to imbue, everything seems to work until my stack variable goes out of scope (right before main close brace).  The application crashes, complaining that some function is calling a pure virtual function.  I see the same behavior if I use the provided code and instead call delete on the memory before main returns.
Thank you in advance for your comments and answers.

A: Your file contains something like 31 00 32 00 33 00 0A 00 34 00 .... 0A is the line feed character.
With the default codecvt facet, each byte is individually converted to Unicode. So 31 becomes U+0031, 00 becomes U+0000 and so on. getline stops at 0A byte.
The next getline call continues where the previous one left off: 00 becomes U+0000 and so on.


text:
Q: Python: Simplest way to join two DataFrames by unique combinations? I have two DataFrames:
fuels = pd.DataFrame({'Fuel_Type':['Gasoline', 'Diesel', 'E85']})

years = pd.DataFrame()
years['Year_Model'] = range(2012, 2041)

My desired output is a single new DataFrame which combines these two dataframes as two columns, but for each value in 'years', have it repeated for every unique fuel type in 'fuels'.
In other words, there should be three repetitions for each distinct year, one for each type of fuel.
I can do this very simply in R with:
df <- merge(
         data.frame(years = c(2012:2040)),
         data.frame(fuels = c("Gasoline", "Diesel", "E85")),
         allow.cartesian = T)

I have looked at answers for similar questions such as:
Create all possible combinations of multiple columns in a Pandas DataFrame
Performant cartesian product (CROSS JOIN) with pandas
cartesian product in pandas
But, either I cannot seem to apply the answers' code to my own data, or the answers are too complex for me to understand (as I am very new to Python).
Is there a nice and 'easy to understand' way of doing this?

A: The second link you posted has a good solution, but it also has a lot of other stuff, so it might be hard to extract if you're new to python. You want:
df = fuels.assign(key=0).merge(years.assign(key=0), on = 'key').drop('key', 1)

This is kind of a slick one liner, because we're doing a few things at once. We're essentially adding a column of 0s to each dataframe, joining on that, and then getting rid of that column. Here is it broken down into steps:
fuels = fuels.assign(key=0) #add a 'key' column to fuels with all 0s for values
years = years.addign(key=0) #add a 'key' column to years with all 0s for values
df = fuels.merge(years, on = 'key') #sql-style join on the key column
df = df.drop('key', 1) #get rid of the key column in the final product

The merge method defaults to an inner join, so we don't need to specify since that's fine. We just have to tell it to join on the right column with on = 'key'. The 1 in the .drop('key', 1) is telling it to drop the column called key (the 1 axis), if we didn't specify (.drop('key')), or gave it a 0 (.drop('key', 0)), it would try to drop a row called key.

A: The below answer should help you:
import pandas as pd

fuels = pd.DataFrame({'Fuel_Type': ['Gasoline', 'Diesel', 'E85']})

years = pd.DataFrame()
years['Year_Model'] = range(2012, 2041)
fuels['key'] = 1
years['key'] = 1

print(pd.merge(fuels, years, on='key').drop("key", 1))

Output:
   Fuel_Type Year_Model
0   Gasoline       2012
1   Gasoline       2013
2   Gasoline       2014
3   Gasoline       2015
4   Gasoline       2016
..       ...        ...
82       E85       2036
83       E85       2037
84       E85       2038
85       E85       2039
86       E85       2040

[87 rows x 2 columns]


text:
Q: How to Construct HTML in form of a String for this I am trying to change the title of the marker style
This is the HTML i am constructing and passing
But its not applying style
Could you please let em know how to resolve this
function createMarker(latlng, html) {
      var  tooltiponclcik = 'Company Name :  1  ,
 ' + 'Sales Off Name :  2  ,
' + 'Warehouse Name :  3 ';
    var marker = new google.maps.Marker({
        position: latlng,
        map: map,
        zIndex: Math.round(latlng.lat() * -100000) << 5,
        title:tooltiponclcik
    });
}

The title can be only of a Straight text , so can i construct that ??
This is my fiddle
http://jsfiddle.net/6wp7enot/16/


text:
Q: ASP MVC controller method not being called properly via Ajax Below is an Ajax call I make to a controller whenever a user clicks on a certain icon on my ASP MVC3 View. It is supposed to call a method in the controller by the name ofPopDetails, however after setting a breakpoint in the controller I can see this is not happening. I tried using both URLs listed below, however neither has worked. Since this is the first time I've used Ajax, I'm not really sure what's going on. Any ideas or suggestions would be greatly appreciated!
Ajax code from View:

Method from BatchProgramsController:
    [HttpPost]
    public string PopDetails(string programName)
    {
        BatchPrograms batchprograms = db.BatchPrograms.Find(programName);
        if (batchprograms == null) return string.Empty;
        StringBuilder s = new StringBuilder();
        s.Append(batchprograms.ProgramName + " - " + batchprograms.ShortDescription);
        s.Append("
Job Names: " + batchprograms.PrdJobName + ", " + batchprograms.QuaJobName );
        s.Append("
 " + batchprograms.Description);
        return s.ToString();
    }

A: url: '~/BatchProgramsContoller/PopDetails',

should be changed to
url: '~/BatchPrograms/PopDetails',

or more likely
url: '/BatchPrograms/PopDetails',

A: It is generally considered bad practice in .net mvc to hard code urls as done in the answer above.
I would use
url: '@Url.Action("BatchPrograms", "PopDetails")',

This way if your routes change for any reason the mvc url helper takes care of it.


text:
Q: Determining if a page is a static .aspx page or does not exist in the sitecore pipeline I'm working in the Sitecore pipeline on a processor. I need to determine if a request being sent is for a static .aspx page that does not have a context item or if the page being requested does not exist.
This will happen right after the ItemResolver process fires so the database is set to master for both an .aspx running through the pipeline and a request for a page that doesn't exist.
I can't check if the Context.Item == null because the static page has no item associated with it and I'd like to keep it that way since the content on said page will not be changing.
Let me know if you have any ideas to differentiate between these!

A: You might be able to use Sitecore.Context.Page.FilePath. It will be set to your Layout on a Sitecore item (i.e. '/layouts/standard layout.aspx') while on a static page it'll be the path to your page.
If your static pages are all in a different location from your Sitecore layouts it might be as easy as just matching part of the FilePath.

A: I think you partially answered your own question.
If you put a component in the httpBeginRequest pipeline after ItemResolver, you should be able to check if Context.Item == null. If it is null, then you know the URL doesn't resolve to a Sitecore item. At that point you can use HttpContext.Current.Server.MapPath() to see if it resolves to a path. If it does, then you know it's a static .aspx file. Something like:
public class CheckPath : HttpRequestProcessor
{
    public override void Process(HttpRequestArgs args)
    {
        if (Sitecore.Context.Item == null)
        {
            if (args.Context.Server.MapPath(args.Context.Request.RawUrl) == null)
            {
                // 404
            }
            else
            {
                // Static
            }
        }
        else
        {
            // Sitecore item
        }
    }
}

Patch this into the httpBeginRequest Pipeline:
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
    <sitecore>
        <pipelines>
            <httpRequestBegin>
                <processor patch:after="*[@type='Sitecore.Pipelines.HttpRequest.ItemResolver, Sitecore.Kernel']" type="MyNamespace.CheckPath, MyAssemblyName" />
            </httpRequestBegin>
        </pipelines>
    </sitecore>
</configuration>


text:
Q: bzip2 - Bzipping all files inside folders (Windows) I have a bzipping tool on my computer, but it only bzips files that are inside the "compress" directory. How would I make it so files inside all directories inside the compress directory are zipped?
Example

compress/image.png goes to compress/image.png.bz2

however

compress/folder/image.png stays as compress/folder/image.png

My batch file is as follows:
    @echo off
title bzip

echo            bzip
echo All files within /compress will be compressed as a .bz2
echo.
echo Compressing file(s)...

bzip2.exe -z compress/*.*

echo.
echo Compression Completed!
pause

I hope somebody can help me!
Edit:
When running the process with directories inside the compress directory, it says "permission denied".

A: Use for /r compress %%i in (*) do bzip2.exe "%%i" in your batch file instead of the call to bzip2.exe directly.  bzip2 almost certainly doesn't know how to recurse through subfolders -- standard wildcard globbing libs on Windows generally don't.
Run for /? from a Command Prompt to see more about the syntax of the for command.  If you want to test the command from a prompt instead of a batch file, use 1 percent sign for the variable instead of 2.


text:
Q: Error Converting VB.NET to C# : obj' is a 'variable' but is used like a 'method' I try to convert vb.net code to c# like below
VB.NET
  Dim _obj As Object = _srv.GetData(_criteria)
            If _obj IsNot Nothing Then
                For Each Comp As ComponentItem In DirectCast(DirectCast(_obj("ComponentInformation"), Result).Output, List(Of ComponentItem))
                    _lstComp.Add(New Core.Component() With {.ComponentID = Comp.BusinessUnitID, .ComponentName = Comp.BusinessUnitName})
                Next
            End If

C#
   object obj = srv.GetData(criteria);
          if (obj != null)
          {
    foreach (ComponentItem comp in (List<ComponentItem>)((Result)obj("ComponentInformation")).Output)
                  {
                      lstComp.Add(new Component
                      {
                          ComponentId = comp.BusinessUnitID,
                          ComponentName = comp.BusinessUnitName
                      });
                  }
}

after converting the code i got an error obj' is a 'variable' but is used like a 'method' How to reslove this error?

A: obj is probably an array, in C# you have to access its members via square brackets []. So it should be:
obj["ComponentInformation"]

EDIT: (courtesy @Groo)
You have to change your line:
object obj = srv.GetData(criteria);

Instead of object you should specify the type which is being returned by the method. Or you can use var to have an implicitly typed variable.
var obj = srv.GetData(criteria);

A: Change object to var:
var obj = srv.GetData(criteria);

And ...
For Each Comp As ComponentItem In DirectCast(DirectCast(_obj["ComponentInformation"], Result).Output, List(Of ComponentItem))

A: C#, prior to v 4.0, where dynamics were introduced, doesn't support late binding, like VB does:
_obj("ComponentInformation")

So, you can't just write something like this for variable of object type:
_obj["ComponentInformation"]

in C# without dynamic or reflection API (e.g., if you working with COM object).
You either have to declare variable of appropriate type (which has indexer), or use dynamic, or use reflection API.


text:
Q: SpriteKit share button not working I am having a lot of difficulty with trying to make a share button which allows users to share my game on social media sites. I am developing a game using Sprite Kit. From what I have seen, I am under the impression that the actual code to initiate the share viewController must be under my GameViewController class. I therefore have a button which is initialized in the gameScene class and when it is pressed runs a method that creates an instance of the gameViewController class then runs the shareGame method. Here is my code, I appreciate any help as I am really lost.
In my gameScene class (this method is run when the button is pressed)
-(IBAction)runShareGame:(id)sender{
   GameViewController *myViewController = [[GameViewController alloc] init];
   [myViewController shareGame];
}

And this code is in the gameViewController.m class (note that the shareGame method is included in the interface)
-(void)shareGame{
   NSLog(@"shareGame!");
   NSString *message = @"Hello World!";
   UIImage *imageToShare = [UIImage imageNamed:@"blue"];
   NSArray *postItems = @[message, imageToShare];
   UIActivityViewController *activityVC = [[UIActivityViewController alloc]
                                        initWithActivityItems:postItems
                                        applicationActivities:nil];
   [self presentViewController:activityVC animated:YES completion:nil];
}

When I run the code, I get the following message in the console:
shareGame!
2015-06-06 17:01:27.626 Dodge[96002:3651805] -[UIView setShowsFPS:]: unrecognized selector sent to instance 0x7a8c88b0
2015-06-06 17:01:27.630 Dodge[96002:3651805] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView setShowsFPS:]: unrecognized selector sent to instance 0x7a8c88b0'
First throw call stack:
(
    0   CoreFoundation                      0x00966746 __exceptionPreprocess + 182
    1   libobjc.A.dylib                     0x005efa97 objc_exception_throw + 44
    2   CoreFoundation                      0x0096e705 -[NSObject(NSObject) doesNotRecognizeSelector:] + 277
    3   CoreFoundation                      0x008b5287 ___forwarding___ + 1047
    4   CoreFoundation                      0x008b4e4e _CF_forwarding_prep_0 + 14
    5   Dodge                               0x000fb48b -[GameViewController viewDidLoad] + 139
    6   UIKit                               0x0127cda4 -[UIViewController loadViewIfRequired] + 771
    7   UIKit                               0x0127d095 -[UIViewController view] + 35
    8   UIKit                               0x0125784d -[UIPresentationController __sizeClassPair] + 54
    9   UIKit                               0x0128a7a3 -[UIViewController _presentViewController:withAnimationController:completion:] + 2349
    10  UIKit                               0x0128d382 __62-[UIViewController presentViewController:animated:completion:]_block_invoke + 345
    11  UIKit                               0x0128d1d4 -[UIViewController presentViewController:animated:completion:] + 224
    12  Dodge                               0x000fb817 -[GameViewController shareGame] + 327
    13  Dodge                               0x00107871 -[GameScene runShareGame:] + 129
    14  libobjc.A.dylib                     0x006057cd -[NSObject performSelector:withObject:withObject:] + 84
    15  UIKit                               0x01119a90 -[UIApplication sendAction:to:from:forEvent:] + 99
    16  UIKit                               0x01119a22 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 64
    17  UIKit                               0x0125a18a -[UIControl sendAction:to:forEvent:] + 69
    18  UIKit                               0x0125a5a7 -[UIControl _sendActionsForEvents:withEvent:] + 598
    19  UIKit                               0x01259811 -[UIControl touchesEnded:withEvent:] + 660
    20  UIKit                               0x01171cfa -[UIWindow _sendTouchesForEvent:] + 874
    21  UIKit                               0x011727d6 -[UIWindow sendEvent:] + 792
    22  UIKit                               0x011306d1 -[UIApplication sendEvent:] + 242
    23  UIKit                               0x01140b08 _UIApplicationHandleEventFromQueueEvent + 21484
    24  UIKit                               0x01114337 _UIApplicationHandleEventQueue + 2300
    25  CoreFoundation                      0x0088806f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
    26  CoreFoundation                      0x0087db7d __CFRunLoopDoSources0 + 253
    27  CoreFoundation                      0x0087d0d8 __CFRunLoopRun + 952
    28  CoreFoundation                      0x0087ca5b CFRunLoopRunSpecific + 443
    29  CoreFoundation                      0x0087c88b CFRunLoopRunInMode + 123
    30  GraphicsServices                    0x03d3d2c9 GSEventRunModal + 192
    31  GraphicsServices                    0x03d3d106 GSEventRun + 104
    32  UIKit                               0x01118106 UIApplicationMain + 1526
    33  Dodge                               0x00107e7a main + 138
    34  libdyld.dylib                       0x030e5ac9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

A: I believe the issue is that you are creating a new GameViewController and because you are doing that it is crashing. Looks like it has something to do with the fact it can't find a SKView because it isn't being loaded from a storyboard.
With that being said you don't want a new GameViewController you want to use the current one. There are a couple of ways to go about this. The simplest could be this...
-(IBAction)runShareGame:(id)sender{

    UIViewController *vc = self.view.window.rootViewController;

    if ([vc isKindOfClass:[GameViewController class]])
    {
        GameViewController *myViewController = (GameViewController *)vc;
        [myViewController shareGame];
    }
}

However if you are using a navigation controller or something like that you may not get your GameViewController back and instead get a UINavigationController.
Best approach would be to create a delegate and assign it when you create your scene. This question has a bunch of different approaches to what you are trying to do. How do I present a UIViewController from SKScene? however your app is crashing because you are recreating the GameViewController which makes your question a bit different. One person does mention the delegate approach but you would be creating the protocol on Scene not the view controller.
Edit
https://stackoverflow.com/a/21917919/851041
Here is a good use of the delegate to comunicate back to your View Controller.
Hopefully that was helpful.


text:
Q: How to resolve the error occured while loading typo3 website url? How to resolve the error associated with the website while loading which is giving message "oops, an error occured!"

A: You should set the system context to "development". In the install tool you can find a configuration preset for it: https://docs.typo3.org/typo3cms/InstallationGuide/6.2/In-depth/TheInstallTool/Index.html
Additionally you could set
config.contentObjectExceptionHandler = 0

within your TypoScript root template, which will give you more verbose exceptions in case the error was thrown while rendering a content element.


text:
Q: How to compare LocalDateTime instances in kotlin so I'm having a little problem with kotlin LocalDateTime
val now = CurrentDateTime
val someDate = someService.someLocalDateTime

I have two dates as you can see and I want to know if now is bigger than someDate or not.
and also I need to know if it's bigger, how much is bigger.
i can do it by checking year, month, day, minute and second like this:
if (now.year().toString() == someDate.year.toString())

but it's not a good way
any suggesstions would be welcome.

A: You can simply convert both dates in seconds and:

*

*compare them to know which one is bigger

*subtract them to know how much one is bigger than the other

an example would be
val now = CurrentDateTime.toEpochSeconds()
val someDate = someService.someLocalDateTime.toEpochSeconds();

if(now > someDate)
//someDate is in the past
else
//someDate is in the future or both dates are equal

val distance = now-someDate

hope this helps

A: The standard solution to compare two Date objects is by using the compareTo() function. It returns a value
= 0, if both dates are equal.
< 0, if date is before the specified date.
> 0, if date is after the specified date.

The following program demonstrates it:
import java.text.SimpleDateFormat
import java.util.*

fun main() {

    val now = CurrentDateTime  // "01/21/2023"
    val someDate = someService.someLocalDateTime // "01/21/2020"

    val sdf = SimpleDateFormat("MM/dd/yyyy")

    val firstDate: Date = sdf.parse(now)
    val secondDate: Date = sdf.parse(someDate)

    val cmp = firstDate.compareTo(secondDate)
    when {
        cmp > 0 -> {
            System.out.printf("%s is after %s", d1, d2)
        }
        cmp < 0 -> {
            System.out.printf("%s is before %s", d1, d2)
        }
        else -> {
            print("Both dates are equal")
        }
    }
}

A: Convert Kotlin LocalDateTime to Java LocalDateTime
To convert Kotlin LocalDateTime to Java LocalDateTime, you can make use of this function:
fun LocalDateTime.toJavaLocalDateTime(): LocalDateTime

Converts this kotlinx.datetime.LocalDateTime value to a java.time.LocalDateTime value.

And then you can choose to use the following method or other suggested method to compare the converted java.time.LocalDateTime.
Compare Java LocalDateTime
To compare LocalDateTime, you can use LocalDateTime's isAfter(), isBefore(), isEqual().
import java.time.LocalDateTime

fun main() {
    val currentTime = LocalDateTime.now()
    val ytdTime = LocalDateTime.now().minusDays(1)
    println(currentTime.isAfter(ytdTime))
    println(currentTime.isBefore(ytdTime))
    println(currentTime.isEqual(ytdTime))
}

Output
true
false
false

To find the difference between LocalDateTime, you can use ChronoUnit:
import java.time.temporal.ChronoUnit

fun main() {
    val currentTime = LocalDateTime.now()
    val ytdTime = LocalDateTime.now().minusDays(1)
    val secondDifference = ChronoUnit.SECONDS.between(ytdTime, currentTime)
    val minutesDifference = ChronoUnit.MINUTES.between(ytdTime, currentTime)
    val hourDifference = ChronoUnit.HOURS.between(ytdTime, currentTime)
    println(secondDifference)
    println(minutesDifference)
    println(hourDifference)
}

Output
86399
1439
23


text:
Q: What happened to the original bodies in Invasion of the Body Snatchers? We all know the concept of Invasion of the Body Snatchers: alien cells reproducing  Earthling cells, plants and animals. In the movie, when Jeff Goldbloom's character closed his eyes, the copy opened his, so can we assume that they feed off our brain waves? What happens to the human's bodies after the copies develop?

A: The original film does NOT have the original bodies disappear when the process is successful. We know this from the cave where the doc and lady friend are on the run.
The doc leaves the human woman in the cave for a few minutes. When he returns and kisses her, he realizes she fell asleep as she is no longer human.
It's entirely unreasonable to assume that the developing pod somehow managed to track them down (when the entire alien population had no idea where they were) and switch places with the woman in those few minutes when the doc wasn't present. It would also assume the pod was animated and running around before the woman fell asleep. Aside from this feat requiring this particular pod to have some form of super GPS to track the human woman down, it would also have required a significant amount of time for the alien to run from town all the way to the hills and into the cave.
I have been baffled by this question for years. Would love to find a plausible explanation.

A: In the book by Jack Finney, the original bodies would decompose into their composite atoms as the pod duplicated the atomic bonds.
Chapter 16:

"Yes, Doctor Bennell, your body contains a pattern, all living matter
does—it is the very foundation of cellular life. Because it is
composed of the tiny electrical force-lines that hold together the
very atoms that constitute your being. And therefore it is a
pattern—infinitely more perfect and detailed than any blueprint could
be—of the precise atomic constitution of your body at exactly that
moment, altering with every breath you take, and with every second of
time in which your body infinitesimally changes. And it is during
sleep, incidentally, when that change occurs least; and during sleep
when the pattern can be taken from you, absorbed like static
electricity, from one body to another."
Again he nodded. "So it
can happen, Doctor Bennell, and rather easily; the intricate pattern
of electrical forcelines that knit together every atom of your body to
form and constitute every last cell of it—can be slowly transferred.
And then, since every kind of atom in the universe is identical—the
building blocks of the universe—you are precisely duplicated, atom for
atom, molecule for molecule, cell for cell, down to the tiniest scar
or hair on your wrist. And what happens to the original? The atoms
that formerly composed you are—static now, nothing, a pile of grey
fluff. It can happen, does happen, and you know that it has happened;
and yet you will not accept it." He watched me for a moment, then
smiled. "Though perhaps I'm wrong about that; I think maybe you have
accepted it."

The 1956 movie has the original bodies (or the duplicates, if the process was interrupted) just disappear. The 1978 movie shows the newly-created pod people cleaning up piles of dust, and the original bodies breaking down as the duplication is completed, but it isn't really explained.


text:
Q: How to Handle Domain name in MVC Routing I am trying to use routing to redirect my user to another URL, if he enters my website through the IP address.
Or if possible please tell me if it possible to handle domain name by routing. As I can use routing for Controller and for Action, but can I also handle Domain in there or not?
I am currently using it like following, but I am unable to handle Domain:
routes.MapRoute(
                "Controller",
                "Controller/{action}/{id}",
                new { controller = "Controller", action = "Index", id =     UrlParameter.Optional });

A: If you're using IIS 7, it may be better to implement this at web server level.
This way, the proper status code will be returned to the browser in the HTTP header and your MVC app can deal with its own routing without having to worry about domains and hostnames which, in most cases, is the web server's job.
To achieve this on IIS, open your website in the IIS console and select URL Rewrite and follow these steps:

*

*Create a new rule and set the match URL to wildcard and enter the pattern as the IP address as xxx.xxx.xxx.xxx*

*Add a condition where {HTTP_HOST} is equal to the site's IP address.

*Set the "action type" to redirect, and enter the pattern you wish to redirect to. "http://mysite.com{R:1}" in this case would map everything after the IP address to its domain equivilent, so xxx.xxx.xxx.xxx/mycontent would redirect to mysite.com/mycontent

This approach will ensure your subdirectories are mapped and your site remains search engine friendly, with proper response codes being generated.
The screenshot below shows how your rule might look in IIS:

Alternatively, this question on ASP.NET MVC Routing by Subdomain may be useful if you need to do this within the confines of your app.


text:
Q: trackJS XML Parsing Error: no element found in firefox I have implemented trackJS library for better debugging and logging. But whenever I send any error to trackJS it throws error only in Firefox. XML Parsing Error: no element found
Location: https://capture.trackjs.com/capture?token=<tokenid>
Line Number 1, Column 1:
here's the code I am using to push errors to trackJS.
trackJs.console.error('some error msg.');

please let me know if I am doing anything wrong here.

A: This is a old Firefox bug, there is no need to return a payload from the TrackJS error capture API, so we do not. The warning shown in the Firefox console is local-only. It can safely be ignored.


text:
Q: Buffering audio with the Web Audio API I have an incoming live stream from a desktop application over a websocket connection to my web page.
I'm converting the PCM stream to a float 32 array. When I start the track, I hear glitches, so I created a bufferArray to store a part of the stream, before playing it.
The problem I get is that after the buffer is created, I can't add any chunks to the array.
Here I receive the data from the socket connection and store it in the array. I wait for 100 chunks before I start the stream.
 sock.onmessage = function(e) {
        var samples = e.data;
        obj = JSON.parse(samples);

        stream = stream.concat(obj);

        if(j == 1000){
            console.log(stream);
            playPcm(stream);
        }

        console.log(j);
        j ++;
    }

This method handles the audio chunks
function playPcm(data){
    var audio = new Float32Array(data);
    var source = context.createBufferSource();
    var audioBuffer = context.createBuffer(1, audio.length, 44100);

    audioBuffer.getChannelData(0).set(audio);
    // console.log(audioBuffer);

    source.buffer = audioBuffer;

    source.connect(context.destination);

    source.start(AudioStart);
    AudioStart += audioBuffer.duration;
}

I read about the scriptProcessorNode, but couldn't figure out what to do with it. Now I'm pretty much stuck as I'm not very familiar with the Web Audio API.

A: Don't try to keep editing the same buffer - you will not be able to modify a playing buffer (it works sometimes in Chrome today, but that's a bug). You should buffer up the first set of chunks into one buffer, like you do now to get some latency room, and then when additional chunks come in you should schedule them as separate AudioBuffer/BufferSourceNode combinations.  (i.e. keep track of the time you started playing the first one, and the running count, and schedule each successive node to play at the end of the last one.)


text:
Q: How to retrieve data from postgres to textbox in c#.net I want to retrieve data from postgres db into textbox in C# without using grid.
Here is the running successful code by using grid which I had tried:
connection.Open();
NpgsqlCommand cmd = new NpgsqlCommand();
cmd.Connection = connection;
cmd.CommandText = "SELECT * FROM student_folio";
cmd.CommandType = CommandType.Text;
NpgsqlDataAdapter da = new NpgsqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
cmd.Dispose();
connection.Close();
GridView1.DataSource = dt;
GridView1.DataBind();

I get error when build when I want to retrieve it into textbox:
"cannot apply indexing with [] to an expression of type 'NpgsqlDataAdapter'"
Here is my block of code:
connection.Open();
NpgsqlCommand cmd = new NpgsqlCommand();
cmd.Connection = connection;
cmd.CommandText = ("SELECT f_name FROM student_folio WHERE id = 1");
cmd.CommandType = CommandType.Text;
NpgsqlDataAdapter da = new NpgsqlDataAdapter(cmd);

txtFname.Text = da["f_name"].ToString();
cmd.ExecuteNonQuery();
cmd.Dispose();
connection.Close();

A: A DataAdapter is not an array of rows you can loop into.
Look at your first code block : you must fill a DataTable from your adapter and then read through the Rows property of this DataTable.
NpgsqlDataAdapter da = new NpgsqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
if (dt.Rows.Count > 0)
{
  txtFname.Text = dt.Rows[0]["f_name"].ToString();
}

You could also do this  :
foreach (System.Data.DataRow row  in dt.Rows)
{
  txtFname.Text = row["f_name"].ToString();
}

And please, remove the cmd.ExecuteNonQuery(); line, it is useless here

A: try this . .
connection.Open();
NpgsqlCommand cmd = new NpgsqlCommand();
NpgsqlDataReader dr=null;
cmd.Connection = connection;
cmd.CommandText = ("SELECT f_name FROM student_folio WHERE id = 1");
cmd.CommandType = CommandType.Text;
dr=cmd.ExecuteReader();

while(dr.HasRows)
{
   while(dr.Read())
   {
       txtFname.Text = da["f_name"].ToString();
   }
}

connection.Close();


text:
Q: SAS - Update table variable with multiple where criteria Please excuse my lack of knowledge i'm very new to SAS.
I have two tables as exampled below:
T1

ID
Ill_No

1
1

1
1

1
2

1
2

1
3

1
3

2
1

2
1

2
2

2
2

2
3

2
3

T2

ID
Ill_No

1
1

2
3

I want to update the original table with a new variable (MATCH) where both ID and Ill_No match with the second table. Example below:
T1

ID
Ill_No
MATCH

1
1
Y

1
1
Y

1
2

1
2

1
3

1
3

2
1

2
1

2
2

2
2

2
3
Y

2
3
Y

What is the most efficient way to do this?

A: Perhaps use a simple merge statement
data want;
merge t1(in=one) t2(in=two);
by id III_No;
if one and two then match = 'Y';
run;

ID  III_No  match
1     1       Y
1     1       Y
1     2
1     2
1     3
1     3
2     1
2     1
2     2
2     2
2     3       Y
2     3       Y


text:
Q: Instagram login OAuth issue in Laravel5.4 I try to login by Instagram , and I refer to LaravelでInstagramに投稿された写真を全取得してみた
When I try to login,it have some problem,it redirect go to home page,can not show any user information,but I want to show user information on the page.

How can I fix this problem ? thanks.

Step by Step:
1.Install cosenary/instagram
composer require cosenary/instagram

2.Setting Instagram Developer

3.Setting 'client_id' ,'client_secret' and 'callback_url' on ../config/instagram.php:
<?php

return [

    'client_id'     => '0264df4679584XXXXXX313e5bd90',
    'client_secret' => '6eXXXXXXf369298c5433084ee21',
    'callback_url'  => 'http://localhost/',
    'scopes'        => 'basic public_content'

];

4.InstagramController
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Http\Requests;

use MetzWeb\Instagram\Instagram;

class InstagramController extends Controller
{
    private $instagram;

    function __construct() {

        $this->instagram = new Instagram(array(
            'apiKey' => config('instagram.client_id'),
            'apiSecret' => config('instagram.client_secret'),
            'apiCallback' => config('instagram.callback_url')
        ));
    }

    public function instagramLogin() {
        return redirect($this->instagram->getLoginUrl(array(
            'basic'
        )));
    }

    public function instagramCallback(Request $request) {
        $code = $request->code;

        $data = $this->instagram->getOAuthToken($code);
        $this->instagram->setAccessToken($data);

        $user_data = $this->instagram->getUser();
        dd($user_data);
        echo '<pre>';
        var_dump($user_data);
        echo '</pre>';
    }
}

5.Setting ../routes/web.php
Route::get('login/instagram/', 'InstagramController@instagramLogin');

# Instagram callback
    Route::get('login/instagram/callback/', 'InstagramController@instagramCallback');

A: You are being redirected to http://localhost which is just the Laravel main page.
You need to redirect to the Instagram callback route instead.
In config/instagram.php update your setting:
'callback_url' => 'http://localhost/login/instagram/callback',

Or if you have your .env set up:
'callback_url' => env('APP_URL') . '/login/instagram/callback',


text:
Q: Revealing SVG animation on HORIZONTAL scroll I'm a little perplexed as to how I can fix my problem.
Just to start off, here's the website page link I have the issue with: http://carrotcrunchpvp.comule.com/#horizontal/1
At first glance, there isn't any issues - however what I'm wanting to do is simply do what the Wow.js plugin does but horizontally, not vertically. This being to reveal content and do the (in this case) SVG animation when you enter that tab or 'viewport'. As you can see my website works similarly to a slideshow... However when I try implement plugins like Wow.js they won't work because they're not your standard vertical website.
The time may be somewhat of a factor, it's rather late at night so my brain is cloudy - but do any of you have any ideas as to how I can implement this idea?
Bear in mind, my knowledge of JS is limited - hence why I jumped for the plugin...
Chris

A: If you're able to understand javascript code, then you should consider forking wow.js plugin and change the source code as per your requirement but if you are not then there is another plugin which I used to build a site. The plugin is http://alvarotrigo.com/fullPage/. You can use this plugin and have vertical as well as horizontal animations in your website.


text:
Q: Rebase default router in Angular2 I try to rebase basic router on my own but I have provider error and I couldn't understand what's going on.
root ngmodule:
              imports     : [
                  ...
                  RouterModule.forRoot(routes)
              ],
              providers   : [
                  {
                      provide : Router,
                      useClass: GlobalRouter
                  },
              ]

Part of GlobalRouter:
export class GlobalRouter extends Router {

    constructor(rootComponentType: Type, resolver: ComponentResolver, urlSerializer: UrlSerializer, outletMap: RouterOutletMap, location: Location, injector: Injector, loader: NgModuleFactoryLoader, config: Routes) {
        super(rootComponentType, resolver, urlSerializer, outletMap, location, injector, loader, config);
    }

    navigate(commands: any[], extras?: NavigationExtras): Promise<boolean> {
        ...some logic
        super(commands, extras);
    }
}

The error:
ORIGINAL EXCEPTION: No provider for Function!


text:
Q: Rating the quality of string matches What would be the best way to compare a pattern with a set of strings, one by one, while rating the amount with which the pattern matches each string?  In my limited experience with regex, matching strings with patterns using regex seems to be a pretty binary operation...no matter how complicated the pattern is, in the end, it either matches or it doesn't.  I am looking for greater capabilities, beyond just matching.  Is there a good technique or algorithm that relates to this?
Here's an example:
Lets say I have a pattern foo bar and I want to find the string that most closely matches it out of the following strings:
foo for
foo bax
foo buo
fxx bar

Now, none of these actually match the pattern, but which non-match is the closest to being a match?  In this case, foo bax would be the best choice, since it matches 6 out of the 7 characters.
Apologies if this is a duplicate question, I didn't really know what exactly to search for when I looked to see if this question already exists.

A: This one works, I checked with Wikipedia example distance between "kitten" and "sitting" is 3
   public class LevenshteinDistance {

    public static final String TEST_STRING = "foo bar";

    public static void main(String ...args){
        LevenshteinDistance test = new LevenshteinDistance();
        List<String> testList = new ArrayList<String>();
        testList.add("foo for");
        testList.add("foo bax");
        testList.add("foo buo");
        testList.add("fxx bar");
        for (String string : testList) {
          System.out.println("Levenshtein Distance for " + string + " is " + test.getLevenshteinDistance(TEST_STRING, string));
        }
    }

    public int getLevenshteinDistance (String s, String t) {
          if (s == null || t == null) {
            throw new IllegalArgumentException("Strings must not be null");
          }

          int n = s.length(); // length of s
          int m = t.length(); // length of t

          if (n == 0) {
            return m;
          } else if (m == 0) {
            return n;
          }

          int p[] = new int[n+1]; //'previous' cost array, horizontally
          int d[] = new int[n+1]; // cost array, horizontally
          int _d[]; //placeholder to assist in swapping p and d

          // indexes into strings s and t
          int i; // iterates through s
          int j; // iterates through t

          char t_j; // jth character of t

          int cost; // cost

          for (i = 0; i<=n; i++) {
             p[i] = i;
          }

          for (j = 1; j<=m; j++) {
             t_j = t.charAt(j-1);
             d[0] = j;

             for (i=1; i<=n; i++) {
                cost = s.charAt(i-1)==t_j ? 0 : 1;
                // minimum of cell to the left+1, to the top+1, diagonally left and up +cost
                d[i] = Math.min(Math.min(d[i-1]+1, p[i]+1),  p[i-1]+cost);
             }

             // copy current distance counts to 'previous row' distance counts
             _d = p;
             p = d;
             d = _d;
          }

          // our last action in the above loop was to switch d and p, so p now
          // actually has the most recent cost counts
          return p[n];
        }

}

A: That's an interesting question! The first thing that came to mind is that the way regular expressions are matched is by building a DFA. If you had direct access to the DFA that was built for a given regex (or just built it yourself!) you could run the input measure the distance from the last state you transitioned to and an accept state, using a shortest path as a measure of how close it was to being accepted, but I'm not aware of any libraries that would let you do that easily and even this measure probably wouldn't exactly map onto your intuition in a number of cases.


text:
Q: Data and Index Storage in Voltdb Sorry for beginner question, but I was wondering how is data and indexes stored in voltdb? I've read a lot of documentation and papers from voltdb about how tables are partitioned and replicated and stored at the high level, but how does VoltDB handle the storage efficiently in code/backend and how is it stored in the memory?
I've read Which data structures are used in voltdb but was wondering if some one can point me in the direction of where this is handled in the voltdb codebase? Thanks alot.

A: I work at VoltDB. The data is stored in main memory (but not on the java heap. It is in data structures that are allocated and used independently by the C++ execution engines. The relevant code is in the src/ee subdirectory.


text:
Q: Where to find Paint.NET multithreading white paper? Like I wrote elsewhere, I seem to be sure that a white paper by Rick Brewster about multithreading used in
Paint.NET once existed. I am not able to find any reference to this white paper again however. Does it (still) exist? And if so, where?
EDIT: Found out in comments to an unrelated question that Paint.NET is still free, but code is no longer available? Is this related to the fact that I can't seem to find that white paper any more?
EDIT2: Went straight to the horses mouth on this and will return any answer that I get here. In the meantime any answer you guys might have is more than welcome!

A: Is it possible, that you found this whitepaper following a link on Coding Horror to Rick Brewster's Blog? Seems he has cleaned up his blog and there are no entries before 2006 anymore.
The only "very little" explanation about threading in Paint.Net i could find anymore was on CodeProject.

A: check for mono-paint (paint.net port for linux). it's source is available on google code

A: I just received a private message reply on the Paint.NET forum from Rick Brewster:

No such whitepaper has ever existed.

That would at least explain why there seems to be no trace of it on Google. I must be going crazy after all?


text:
Q: Virtual PC 2007 is not working with Windows 7 64-bit and Windows mobile I'm trying to get a connection to the internet with my Windows Mobile 6 device emulator but it won't connect.
I get this message every time I try to setup a network in the emulator:

Device Emulator
The required Virtual Machine Network Driver could not be found. Make sure that Virtual PC 2007 is installed. You can install Virtual PC 2007 from http://go.microsoft.com/fwlink/?linkid=46859

But I do have it installed. However, I get the following warning so I'm not sure if this is why it does not work:

Caution - Virtual PC
Virtual PC could not open the Virtual Machine Network Services driver.
Access to the external network and host will be unavailable to all virtual machines using virtual networking. Virtual machines using virtual networking will still be able to access other virtual machines using virtual networking.
To fix this this problem, re-enable the Virtual Machine Network Services driver on one more more ethernet adapters or reinstall Vitrual PC.

A: See Virtual PC Guy's Blog article Fixing broken virtual networking.
This article describes how to fix two common reasons for this problem:

*

*The Virtual Machine Network Services
driver is installed but not enabled

*The Virtual Machine Network Services
driver is installed and enabled, but
does not seem to be working.


text:
Q: How to start the Loop in second post of the blog I'm not an expert in PHP code but i need to fix this because it doesn't look good to have duplicate posts. Here's the link on my client website https://capitall.com.sg/blog/, As you can see we have a featured post and the list of post but the problem is the post is the same with featured post, We want to start into second post so there's no duplicated in post on the page. I hope you guys can help me

        <?php
          $load = 0;
          $total_post =wp_count_posts()->publish;
          if (null !== @$_GET['load']){
            $load = $_GET['load'];
          }
          $i = 6 + $load;
        ?>
        <?php
          // the query
          $wpb_all_query = new WP_Query(array(
            'post_type'=>'post',
            'post_status'=>'publish',
            'posts_per_page'=>$i,
            'ignore_sticky_posts' => 1,
            'category_name' => @$_GET['category_id']
          ));
          $count = $wpb_all_query->found_posts;
        ?>

        <?php if ( $wpb_all_query->have_posts() ) : ?>
          <?php while ( $wpb_all_query->have_posts() ) : $wpb_all_query->the_post(); ?>

                <a class="newsCard__image" href="<?php the_permalink(); ?>">
                  <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'single-post-thumbnail' ); ?>
                  <img class="lazyload" src="<?php echo get_template_directory_uri();?>/assets/images/img-placeholder.svg" data-src="<?php echo $image[0]; ?>" alt=""/>

                <?php
                  $categories="";
                  foreach((get_the_category()) as $category){
                    $categories = $category->name.",";
                  }
                  echo substr($categories, 0, -1);
                ?>
              <a class="newsCard__title" href="<?php the_permalink(); ?>"><?php the_title(); ?>

<?php the_excerpt(); ?>

          <?php endwhile; ?>
          <?php wp_reset_postdata(); ?>
        <?php else : ?>

<?php _e( 'Sorry, no posts matched your criteria.' ); ?>

        <?php endif; ?>

      <?php if( null == @$_GET['load'] && $count > 6 ) : ?>

          <?php the_field('load_more_button_label'); ?>

      <?php endif; ?>


text:
Q: Why is my C program not printing anything sometimes from the string inconsistantly? (using linked lists) I'm trying to use linked lists to store the data from the periodic table. Name, symbol and atomic weight. My code is printing correctly for some elements and but the element name is disappearing sometimes. running the same code multiple times, it's not printing different names at different times. (I messed up the order while giving the inputs, but please ignore that.)

#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
#include <string.h>

typedef struct list{char element[20]; char sym[20];float weight;struct list*next;}list;

int printlist(list *h, char *title){
    printf("%s\n", title);
    while(h!=NULL){
        printf("%s: %s: %f \n", h->element, h->sym, h->weight);
        h = h-> next;
    }
}

list* create_list(char e[], char s[], float w){
    list * head = malloc(sizeof(list));
    strcpy(head->element,e);
    strcpy(head -> sym,s);
    head -> weight = w;
    head -> next = NULL;
    return head;
}

void add_to_rear(char e[], char s[], float w, list*h){
    while(h->next != NULL){
        h= h-> next;
    }
    list *nn = create_list(e, s, w);
    h -> next = nn;
}

int main(){

    list list_of_atoms;
    list * head = NULL;
    for(int i=0; i<1;i++){
        printf("element %d", i+1);
        char el[20];
        char symbol[2];
        float atwt;
        scanf("%s", el);
        scanf("%s", symbol);
        scanf("%f", &atwt);
        head = create_list(el, symbol, atwt);
    }
    for(int i=1; i<10;i++){
        printf("element %d", i+1);
        char el[20];
        char symbol[2];
        float atwt;
        scanf("%s", el);
        scanf("%s", symbol);
        scanf("%f", &atwt);
        add_to_rear(el, symbol, atwt, head);
    }
    printlist(head, "First 10 elements");
    return 0;

}

A: You allocate and fill in a bunch of lists (which is a misnomer; each struct is actually info about an element) and then discard them ... head ends up pointing to the last element entered, and its next field is NULL. You then read in all the elements again (why?), scanning each time to the end of the list and appending the element--which is an O(N*N) operation. (I suspect that you actually entered an empty list for the first loop, and then entered your 10 elements for the second loop, but it's impossible to tell because you provided the input as a truncated screen shot. Please don't do that. Instead, copy the text from your CMD window.) Edit: Now I see that your first loop actually only runs one time. It's like you wrote it one way, then changed your mind and wrote it another way, but left the old code there.
The reason the output is wrong is that you are using scanf to read 2-character  symbols plus a terminating NUL into symbol[2], which isn't big enough. This is undefined behavior, but what it is probably doing is overwriting the first byte of the element name with a NUL. Notice that all the elements with 2-letter symbols are missing the element name and the ones with 1-letter symbols are not.