text:
Q: Query runs in the same time despite having 300 times as many rows I have two (almost) identical queries:
;with cteMasterCreateExecAsXml as (
    SELECT guid, CAST(ExecutionOrder AS xml) as x
    FROM (SELECT guid, ExecutionOrder
          FROM @StrategiesToCreate sc
          JOIN InFusion_Data.dbo.compare_FoxStrategy fs ON fs.Guid = sc.MasterGuid
          WHERE fs.LinkedToTemplate = 0) k
) -- selects ~45 rows

SELECT MasterBIV.StrategyTagname, MasterBIV.Tagname, MasterBIV.Name,
       b.blk.value('for $i in . return count(../*[. << $i]) + 1', 'int') as ExecOrder
       INTO #MasterCreateExecOrder
FROM cteMasterCreateExecAsXml
CROSS APPLY x.nodes('//ExecutionOrder/Block') as b(blk)
JOIN InFusion_Data.dbo.compare_BlockInfoView MasterBIV ON MasterBIV.BlockGuid = b.blk.value('@Id', 'uniqueidentifier')

And
;with cteMasterExecAsXml as (
    SELECT guid, CAST(ExecutionOrder AS xml) as x
    FROM (SELECT guid, ExecutionOrder FROM @StrategiesToCompare sc
    JOIN InFusion_Data.dbo.compare_FoxStrategy fs ON fs.Guid = sc.MasterGuid) k
) -- selects ~17000 rows

SELECT MasterBIV.StrategyTagname, MasterBIV.Tagname, MasterBIV.Name,
       b.blk.value('for $i in . return count(../*[. << $i]) + 1', 'int') as ExecOrder
       INTO #MasterExecOrder
FROM cteMasterExecAsXml
CROSS APPLY x.nodes('//ExecutionOrder/Block') as b(blk)
JOIN InFusion_Data.dbo.compare_BlockInfoView MasterBIV ON MasterBIV.BlockGuid = b.blk.value('@Id', 'uniqueidentifier')

According the SQL execution plan they both take the same amount of time. The first one deals with 45 rows and the second one deals with ~17000 rows. This makes me think that many rows are being selected and converted to xml in both queries.
Unfortunately because I need to do the query across servers I can't use an XML column in the schema.
Any idea what's going on here or how I can speed up my queries?

A: As I see, the diffence is at  "WHERE fs.LinkedToTemplate = 0" condition.

According the SQL execution plan they both take the same amount of time. The first one deals with 45 rows and the second one deals with ~17000 rows.  This makes me think that many rows are being selected and converted to xml in both queries.

It looks like you have no table index by LinkedToTemplate column, so for both queries full table scan is needed.
So to improve performance you should create index by LinkedToTemplate column.


text:
Q: Sed command to delete characters on specific location? I have this sed command which add's 3 zero's to an id (this occurs only if the id is 13 characters long):
sed 's/^\(.\{14\}\)\([0-9]\{13\}[^0-9]\)/\1000\2/' file

My input looks like this:
A:AAAA:AA: :A:**0123456789ABC   **:AAA:AAA       :          :AA:          :     :

And my output is this one:
A:AAAA:AA: :A:**0000123456789ABC   **:AAA:AAA       :          :AA:          :     :

I want to get rid off the 3 whitespaces after the id number. I can't delete the entire column because I have different data on other records so I want to delete the spaces just in the records/lines I expanded previously. So maybe I just need to add something to the existing command.
As you can see there are other whitespaces on the record, but I just want to delete the ones next to de ID(bold one).
I only found ways to delete entire columns, but I haven't been able to find a way to delete specific characters.

A: Just add three spaces after the closing \):
sed 's/^\(.\{14\}\)\([0-9]\{13\}[^0-9]\)   /\1000\2/'

To make it work for your example, you also need to extend [0-9] to [0-9A-C].

A: You can use
sed 's/^\(.\{14\}\)\([[:alnum:]]\{13\}\)[[:space:]]*:/\1000\2:/' file

See the online demo:
#!/bin/bash
s='A:AAAA:AA: :A:0123456789ABC   :AAA:AAA       :          :AA:          :     :'
sed 's/^\(.\{14\}\)\([[:alnum:]]\{13\}\)[[:space:]]*:/\1000\2:/' <<< "$s"

Output:
A:AAAA:AA: :A:0000123456789ABC:AAA:AAA       :          :AA:          :     :

Notes:

*

*[[:alnum:]]\{13\} - matches 13 alphanumeric chars, not just digits

*[[:space:]]*: matches zero or more whitespaces and a : (hence, the : must be added into the replacement pattern).

A: Since you are working with delimited fields, when one of the fields before the one you are working with inevitably changes in size just counting from the start a fixed length will break this.
Consider using awk instead and work solely with the 6th field.  First strip out spaces, then check the length.  If 13, add the leading 3 zeroes.  Lastly print out the line.
$ awk -F ':' 'BEGIN { OFS=":"}{ gsub(" ", "", $6) };{if(length($6) == 13)$6="000"$6;print $0}' file.txt
A:AAAA:AA: :A:0000123456789ABC:AAA:AAA       :          :AA:          :     :
$

redpajama_set_name: RedPajamaStackExchange


text:
Q: Bug in Integrate with Assumptions? I encountered behaviour I wasn't expecting with Integrate and thought I'd ask here before reporting a bug in case I'm just missing something obvious. A simple example is the following: Computing
Assuming[n >= 1 && n \[Element] Integers && p < \[Mu] && p > 0 && \[Mu] > 0,
  Integrate[1/((p0 - I*\[Mu])^2 + p^2)^n, {p0, -Infinity, Infinity}]]

gives a general answer, which eg. in the case $n=1$ reduces to $\pi/p$. However, this is the answer in the case $p>\mu$, which is the exact opposite of the assumption given to Mathematica. In the region $p<\mu$ the integral should vanish, which is easily confirmed by specifying the value of $n$ before integrating:
Assuming[p < \[Mu] && p > 0 && \[Mu] > 0,
 Integrate[1/((p0 - I*\[Mu])^2 + p^2), {p0, -Infinity, Infinity}]]

Which outputs zero, as it should.
Search gave some at least vaguely similar bugs, but all of those were supposed to have been fixed around version 10, whereas this is present in 11.3.


text:
Q: How to mock response error with axios-mock-adapter and jest I have set up axios-mock-adapter in order to facilitate unit tests for my axios requests and all works quite well when mocking successful responses, however I am unable to make a solid test to cover failures. I have an axios instance and I have this unit test to check for failures
 it('should throw error', async () => {
  mock.onGet(my_url).reply(401);

  const expectedError = async () => {
    await myFailingFunction();
  };

  return expect(expectedError()).rejects.toThrowError();
});
});

and that recognises that the request fails, which is fine but I'd like to be able to check the status code and make sure that the response returns exactly 401 status code along with error message, so that I can validate all failing cases (400, 401, 500, etc)


text:
Q: Width: 100%; give me a scrollbar I wanted to make a sticky header and a footer in the bottom of the page
both statements are driving me crazy, because it's giving me a scrollbar.

.header {
        opacity: 0.95;
        padding-left: 3.7%;
        list-style-type: none;
        margin: 0;
        background-color: #4b4b4b;
        font-family: 'Roboto', sans-serif;
        background-image: url('img/icon.png');
        background-repeat: no-repeat;
        background-position: 14px 7px;
        background-size: 40px;
        position: absolute;
        width: 100%;
        z-index: 100;
}

.footer {
        bottom: 0;
        opacity: 0.9;
        width: 100%;
        background-color: #4b4b4b;
        color: #878787;
        text-align: center;
        padding: 6px 16px;
        font-family: 'Roboto', sans-serif;
        margin-top: 4%;
        left: 10px;
        right: 10px;
    }

How can i avoid these scrollbars please ?
Thanks!

A: It's hard because you don't provide any html structure or much css. I would guess you don't have any padding reset or box-sizing. Try adding this line on top of your css. Not sure of your level but the asterix means apply to all elements.
* {
  box-sizing: border-box;
}

A: There is many way you can achieve this (below is one of that)

*, *:before, *:after {
  box-sizing: border-box;
}

body {
  margin:0;
  padding:0;
}
.header {
        opacity: 0.95;
        background-color: #4b4b4b;
        position: fixed;
        top:0;
        left:0;
        right:0;
        height:80px;
}
.main-content {
margin-top: 80px;
min-height: 100vh;
}

.footer {
      height:80px;
      background-color: #4b4b4b;
    }
<header class="header">
Header
</header>
<div class="main-content">
Content
</div>
<footer class="footer">
Footer
</footer>


text:
Q: Sending transactional SMS from rails app in India I'm developing a rails app in which sends an SMS to the user for some action done by the user.
Now I know that there is a restriction on the outgoing promotional SMS in India. But this message of mine if something like a transactional SMS which is triggered based on a user action and needs to be delivered without any time restriction (9am-9pm). I also want the SMS ID to be alphanumeric on the user side.
Right now I'm using Twilio.
  client = Twilio::REST::Client.new Rails.application.secrets.twilio_account_sid, Rails.application.secrets.twilio_auth_token
  message = client.messages.create from: 'XXXXXXXX', to: 'XXXXXXXX', body: 'Message body for the transaction.'

I went through their docs but couldn't get to what I wanted.
My question in short is that:

*

*Can I use twilio for my case in India? If yes, how? And if not, which service should I use?

A: I'm Megan from Twilio.
By default, all SMS messages sent from Twilio phone numbers in India are categorized as "Promotional". You can read a bit more about the resulting limitations in our FAQ. These are limitations and regulations set up by Indian government. Our support team can help determine whether we can get you set up on "Transactional" messaging if you email help@twilio.com.
Hope this helps!


text:
Q: $A_6 \simeq \mathrm{PSL}_2(\mathbb{F}_9) $ only simple group of order 360 How can one show, without the use of character theory, that $A_6 \simeq \mathrm{PSL}_2(\mathbb{F}_9) $ is, up to isomorphism, the only simple group of order 360?

A: Thanks to user641 for this concise proof. If I'm not wrong, it is a variant of Cole's proof (1893), which can be found here :
http://www.jstor.org/stable/2369516?seq=1#page_scan_tab_contents
Perhaps the average student can find some difficulties in the proof given by user641, so I take leave to write a second answer, only to make things more explicit.
"Then the conjugation action of $G$ on these ten Sylows gives an embedding of $G$ into $A_{10}$."
Perhaps it should be stressed that $G$ embeds in $A_{10}$ not only as a group, but as an operating group. I don't know if this fact is mentioned in many textbooks, so I will give a proof. If this proof is too complicate, please say it.
Lemma 1. Let $G$ be a group, let $N$ be a normal subgroup of $G$ and $S$ a simple subgroup of $G$. Then $S$ is contained in $N$ or isomorphic to a subgroup of $G/N$.
Proof. $N \cap S$ is normal in $S$. Since $S$ is simple, $N \cap S$ is thus equal to $S$ or to $1$. In the first case, $S$ is contained in $N$ and the statement is true. In the second case, $S$ is isomorphic to $SN/N$ (second isomorphism theorem), which is a subgroup of $G/N$, so the statement is also true in the second case.
Lemma 2. Let $E$ a finite set. If $G$ is a simple subgroup of the symmetric group $S_{E}$, if $\vert G \vert > 2$, then $G$ is contained in the alternating group $A_{E}$.
Proof. $A_{E}$ is normal in $S_{E}$. Thus, in view of lemma 1, $G$ is contained in $A_{E}$ or isomorphic to a subgroup of $S_{E}/A_{E}$. But the latter is impossible, since $S_{E}/A_{E}$ has order $\leq 2$ and $\vert G \vert > 2$ by hypothesis.
Definition. If $\cdot : G \times X \rightarrow X$  denotes an action of a group $G$ on a set $X$, if $\star$ denotes an action of a group $H$ on a set $Y$, let us define an isomorphism from the first action onto the second action as an ordered pair $(f, \sigma)$, where $f$ is a bijection from $X$ onto $Y$ and $\sigma$ a group isomorphism from $G$ onto $H$ such that, for each $x$ in $X$ and for each $g$ in $G$,
$f(g \cdot x) = (\sigma (g) ) \star f(x)$.
Lemma 3. Let $\cdot$ denote an action of a group $G$ on a set $X$, let $\star$ denote an action of a group $H$ on a set $Y$, let $(f, \sigma)$ be an isomorphism from the first action onto the second action. Then an element $g$ of $G$ fixes a point $x$ of $X$ (for the action $\cdot$) if and only $\sigma(g)$ fixes $f(x)$ (for the action $\star$).
Proof. Easy.
Definition. Let $\cdot$ denote an action of a group $G$ on a set $X$, let $\star$ denote an action of a group $H$ on a set $Y$. If there exists an isomorphism from  $\cdot$ onto $\star$, we say that these actions are isomorphic. (Some authors say "equivalent". Aschbacher, Finite Group Theory, 2d edition, p. 9, says "quasiequivalent".)
Lemma 4. Let $G$ be a simple group, let $\cdot$ be a nontrivial action of $G$ on a set $E$, let $\varphi$ denote the homomorphism from $G$ to $S_{E}$ corresponding to this action. Then $\varphi$ is injective (in other words, the action is truthful) and the action $\cdot$ of $G$ on $E$ is isomorphic to the natural action of the permutation group $\varphi (G)$. If $E$ is finite and $\vert G \vert > 2$, then $\varphi$ takes its values in $A_{E}$.
Proof. For the injectivity of $\varphi$, note that the kernel of $\varphi$ is a normal subgroup of the simple group $G$ and this kernel is not the whole $G$, since $G$ acts nontrivially. For an isomorphism from the action $\cdot$ onto the natural action of $\varphi (G)$, take the ordered pair $(f, \psi)$, where $f$ is the identity bijection from $E$ onto itself and where $\psi$ is the group isomorphism $G \rightarrow \varphi(G) : g \mapsto \varphi(g)$ from $G$ onto $\varphi (G)$. For the last statement, use lemma 2.
Lemma 5. Let $G$ be a finite nonabelian simple group. (This amounts to say : let $G$ be a finite simple group whose order is not a prime number.) Let $p$ be a prime factor of $\vert G \vert$. Let $E$ denote the set of all Sylow $p$-subgroups of $G$, let $n$ denote the number $\vert E \vert $ of Sylow $p$-subgroups of $G$. Then the action of $G$ on $E$ by conjugation is isomorphic to the natural operation of a subgroup of $A_{n}$.
Proof. Since $G$ is a finite nonabelian simple group, it has more than one Sylow $p$-subgroup, thus the (transitive) action of $G$ on $E$ is nontrivial. In view of the preceding lemmas, the action of $G$ on $E$ by conjugation is isomorphic to the natural operation of a subgroup of $A_{E}$. Now, if $X$ and $Y$ are equipotent finite sets, the natural action of a subgroup of $A_{X}$ is isomorphic to the natural action of a subgroup of $A_{Y}$.
Lemma 6. Let $G$ be a finite group, let $p$ be a prime number. If $P$ is a Sylow $p$-subgroup of $G$, if $g$ is an element of $G$ whose order is a power of $p$ and which normalizes $P$, then $g$ is in $P$. If $P$ and $Q$ are Sylow $p$-subgroups of $G$, if $P$ normalizes $Q$, then $P = Q$.
Proof. Classical. (Since $g$ normalizes $P$, the order of the subgroup  $<P, g>$ generated by $P$ and $g$ is a power of $p$, thus $<P, g>$ is equal to $P$ by maximality of Sylow $p$-subgroups.)
Lemma 7. Let $G$ be a finite group, let $p$ be a prime number. Let $E$ denote the set of all Sylow $p$-subgroups of $G$. The action of $G$ by conjugation on $E$ has the following properties :
1° for each Sylow $p$-subgroup $P$ of the operating group, there is one and only one point in the set $E$ that is fixed by every element of $P$;
2° for every point in the set $E$, there is one and only one Sylow $p$-subgroup $P$ of the operating group such that every  element of $P$ fixes this point;
3° if $P$ is a Sylow $p$-subgroup of the operating group, if $x$ denotes the only point in $E$ that is fixed by each element of $P$, then the stabilizer of $x$ in $G$ is $N_{G}(P)$;
4° if it is moreover assumed that two different Sylow $p$-subgroups of $G$ always intersect trivially,  then every nontrivial $p$-element of the operating group (I mean by "$p$- element" an element whose order is a power of $p$) fixes one and only one point of $E$.
Proof. Use Lemma 6. (In the statement of Lemma 7, I made a distinction between a Sylow $p$-subgroup of $G$ as a point of $E$ and as a subgroup of $G$, in order to forget what is not essential.)
Definition (nonstandard). Let us define a Cole group as a simple subgroup $G$ of order 360 of $A_{10}$ with the following properties :
1° for each Sylow $3$-subgroup $P$ of $G$, there is one and only one point in $\{1, \ldots , 10 \}$ that is fixed (for the natural operation) by every element of P$;
2° for every point in the set $\{1, \ldots , 10 \}$, there is one and only one Sylow $3$-subgroup $P$ of $G$ such that every  element of $P$ fixes this point;
3° if $P$ is a Sylow $3$-subgroup of $G$, if $x$ denotes the only point in $E$ that is fixed by each element of $P$, then the stabilizer of $x$ in $G$ is $N_{G}(P)$;
4° every nontrivial $3$-element of the operating group (I mean by "$3$- element" an element whose order is a power of $3$) fixes one and only one point of $\{1, \ldots , 10 \}$ .
Lemma 8. Every simple group of order 360 is isomorphic to a Cole group.
Proof. Use Lemmas 3, 5 and 7. (Recall that  user641 has proved that a simple group $G$ of order 360 has exactly $10$ Sylow $3$-subgroups and that two distinct Sylow $3$-subgroups of $G$ interset always trivially.)
Now, I think that user641' statement : "Note that $N_G(P)$ (...) is a point stabilizer in $G$" should be clear for the average student. (Again, if this proof is too complicated, please say it.)
If nobody has objections, I will write other answers in order to make other arguments from the proof more explicit.

A: Here is a proof that any simple group $G$ of order $360$ is isomorphic to a specific subgroup of $A_{10}$ (and hence there can be only one [insert Highlander pun]).
Let $G$ be a simple group of order $360$, and let's ask how many Sylow 3-subgroups there can be.  A quick check shows the possibilities are : $1,4,10,40$.  $1$ and $4$ can easily be ruled out, and $40$ is ruled out because then the Sylow 3-group is self-normalizing.  But a group of order $9$ is abelian, and hence by Burnside's Transfer Theorem, $G$ can't be simple. [You can avoid BTT by showing a subgroup of order 3 has normalizer of size at least 72, and getting a contradiction that way.]
Thus, there are 10 Sylow 3-groups; let's pick one and call it $P$.  Then the conjugation action of $G$ on these ten Sylows gives an embedding of $G$ into $A_{10}$.  So let's assume for the rest of this post that $G$ actually lives inside $A_{10}$.  Note that $N_G(P)$ has order $36$, and is a point stabilizer in $G$ (let's say the point stabilizer of $10$).
Now if $P$ was cyclic, then elements of $N_G(P)$ would basically be elements of $A_9$ normalizing a 9-cycle.  9-cycles in $A_9$ are self-centralizing however (count conjugates), and thus $N_G(P)/P$ would embed in $\operatorname{Aut}(P)$; this is a contradiction because the former group has order $4$ and the latter order $6$.
So $P$ is non-cyclic of order $9$, generated by two elements $a$ and $b$ of order $3$. Each of these is a product of 3 3-cycles in $\{1,2,\ldots,9\}$.  We can assume that
$$ a = (1,2,3)(4,5,6)(7,8,9); $$
$$ b = (1,4,7)(2,5,8)(3,6,9). $$
This is because we can renumber the points so $a$ looks has the required form, and take an appropriate element of the form $a^ib^j$ to give us the form for $b$.
Now consider the point-stabilizer of $1$ in $N_G(P)$.  since $P$ acts transitively on $\{1,2,\ldots,9\}$, the orbit-stabilizer theorem shows this point stabilizer has order $4$. It is thus a Sylow 2-subgroup $Q$ of $N_G(P)$, and $N_G(P)=PQ$. Again, the centralizer of $P$ in $A_9$ is a 3-group, and hence $Q\cong N_G(P)/P$ embeds in $\operatorname{Aut}(P)$; this implies $Q$ is cyclic of order $4$. Let $Q$ be generated by a permuation $c$ of order $4$.  We know $c$ fixes both $10$ and $1$, so for $c$ to be an even permutation it must be the product of two 4-cycles.
Note also that $c$ is almost completely determined by where it sends $2$; this is because every element of $P$ is determined by where it sends $1$ [if $x,y\in P$ both sent $1$ to the same point, then $xy^{-1}$ would fix $1$, hence be in $Q$, so we would have $xy^{-1}=1$.]. So for example, if $c$ sends $2$ to $3$, then it must send $a$ to $a^2$, and there are only two ways to do this (basically it sends $4$ to either $6$ or $9$).  One can easily check that permutations sending $2$ to one of $\{2,3,5,6,8,9\}$ don't have order $4$, and thus $c$ sends $2$ to either $4$ or $7$. One will simply give the inverse of the other, and so we can assume that
$$ c=(2,4,3,7)(5,6,9,8). $$
It's important to note that no non-trivial power of $c$ fixes any point of $\{2,3,4,5,6,7,8,9\}$; that is, no element of $G$ fixes more than $2$ points.
Now let $S$ be a Sylow 2-subgroup of $G$ containing $Q$; note that this means there's an element $d$ such that $S=\langle c,d\rangle$. It is an easy exercise to show the Sylow 2-subgroup of a simple group can't be cyclic, so that $d$ has order either $4$ or $2$. Also since $d\notin N_G(P)$, it cannot fix the point $10$.  Now suppose that $d$ sends the point $1$ to the point $p\notin\{1,10\}$; then $c^d$ would not fix $1$, and yet $c^d\in Q$. Similarly, if $d$ sent $10$ to a point $q\notin\{1,10\}$, $c^d$ would not fix $10$.  Thus $d$ must permute $1$ and $10$ amongst each other, and since it can't fix $10$, it contains the 2-cycle $(1,10)$ [it's a 2-cycle because $d^2\in Q$].
But if $d$ had order $4$, then - ignoring that $(1,10)$ cycle - it would be an odd permutation on $8$ points fixing $c$. Since it can fix at most $2$ points, it would be a 4-cycle $m$ multiplied by a 2-cycle $n$.  Now if it sent $2$ to one of $\{5,6,8,9\}$, it could fix no points at all; thus $m$ must normalize one of $(2,4,3,7)$ and $(5,6,9,8)$. But 4-cycles are only normalized by their own powers (at least restricting to other 4-cycles on the same 4 points), and thus $m$ centralizes its 4-cycle.  However, $n$, a 2-cycle, must then centralize its 4-cycle, which is impossible.  Thus $d$ can't have order $4$.
So $d$ must be order $2$, and in fact, every element of $S-Q$ has order $2$ [so $S$ is dihedral].  The same analysis above shows - ignoring once again the $(1,10)$ cycle - $d$ is the product of 3 2-cycles.  Thus it is the product of $m$ and $n$, except this time $m$ looks like $(\cdot,\cdot)(\cdot,\cdot)$ and $n$ is a 2-cycle.  Again, $m$ must invert one of the two 4-cycles making up $c$, and $n$ inverts the other. So the 8 possibilities for $d$ [ignoring $(1,10)$] are a product of one of $(2,3)$,$(4,7)$, $(2,4)(3,7)$, and $(2,7)(3,4)$, together with one of $(5,9)$, $(6,8)$, $(5,6)(9,8)$, and $(5,8)(6,9)$.  [There are not 16 possibilities, because for example (2,3)(5,9) is not of the required $mn$ form.]
Now if $d=(1,10)(2,3)(5,6)(8,9)$, then it's routine to check that $cd$, $c^2d$, and $c^3d$ give three other acceptable products from the above 8.  If we set $\hat{d}=(1,10)(4,7)(5,8)(6,9)$, then we can check that the other four are given by $\hat{d}$, $c\hat{d}$, $c^2\hat{d}$, and $c^3\hat{d}$.  However, a direct computation shows $ab\hat{d}$ has order $21$. Thus, up to factors of $c$ (which we can safely ignore), we have
$$ d = (1,10)(2,3)(5,6)(8,9).$$
Now we are done: the subgroup $\langle a,b,c,d\rangle\le G$ has order at least $72$; but $G$ is simple, and so we must have $\langle a,b,c,d\rangle=G$.
EDIT - Here is the argument to avoid Burnside's Transfer Theorem:
Assume $G$ has $40$ Sylow 3-groups.  Since $40\not\equiv 1\pmod{9}$, there are two Sylow 3-groups $A$ and $B$ such that $D=A\cap B$ in non-trivial (and hence order 3).  Now the normalizer $N_G(D)$ has more than one Sylow 3-group, and thus has order at least $36$.  If $|N_G(D)|>36$, we would have $|N_G(D)|\ge72$, and that gives a subgroup of index $5$ in $G$, which implies (via the right coset action) that $G$ embeds in $A_5$, contradiction.  Thus we can assume $N_G(D)$ has order 36, and since it does not have a normal Sylow 3-group (remember they were self-normalizing), it must have a normal Sylow 2-group (for this implication see the proof here). Thus this subgroup $T$ of order $4$ is normalized by a Sylow 3-group, and since "normalizers grow" in p-groups, its normalizer also has order divisible by $8$.  That is, $|N_G(T)|\ge72$, and once again we have a contradiction.  Thus there cannot be $40$ Sylow 3-groups.

A: There is a nice geometric proof:  using only Sylow theorems one can show that G has 30 subgroups isomorphic to Z_2 x Z_2 which break into classes of 15 each. Denote by P one class and by L the other.  Refer to elements of P as points and elements of L as lines.  Say a "point", E, is on the "line", F, E and F intersect in a subgroup of order 2.  This is a generalized quadrangle of order 2 which is easily shown to be unique and have isomorphic group S_6.  In this way one gets an injective how of G into S_6 which has a unique subgroup of index 2 (since A_6) is simple.
A similar geometric proof can be used to prove a simple group of 168 is the automorphism of a Fano plane (projective plane of order 2)


text:
Q: How to create acknowledgements in the report class? I'm using LaTeX and like to create an acknowledgement section using the report class such that is looks like the abstract and comes after it.

A: I went with:
\begin{abstract}
 This is cool paper about vuvuzelas.
\end{abstract}

\renewcommand{\abstractname}{Acknowledgements}
\begin{abstract}
 Thanks Mum!
\end{abstract}

This way both look similar and good.

A:
\section*{Acknowledgements}
Thanks Mum.


text:
Q: How to use existing data from the database in Codeception FactoryMuffin? I'm trying to set up easy test data in my Acceptance tests:
  public function shouldUseAFakeAccountHolder(AcceptanceTester $I) {
    $I->have(AccountHolder::class);
    // ...
  }

I've copied the example code from the Codeception documentation and modified it with my entity names (as well as fixing the bugs).
<?php
public function _beforeSuite()
{
     $factory = $this->getModule('DataFactory');
     // let us get EntityManager from Doctrine
     $em = $this->getModule('Doctrine2')->_getEntityManager();

     $factory->_define(AccountHolder::class, [
         'firstName' => Faker::firstName(),

         // Comment out one of the below 'accountRole' lines before running:

         // get existing data from the database
         'accountRole' => $em->getRepository(AccountRole::class)->find(1),

         // create a new row in the database
         'accountRole' => 'entity|' . AccountRole::class,
     ]);
}

The relationship using existing data 'accountRole' => $em->getRepository(AccountRole::class)->find(1) always fails:
 [Doctrine\ORM\ORMInvalidArgumentException] A new entity was found through the relationship 'HMRX\CoreBundle\Entity\AccountHolder#accountRole' that was not configured to cascade persist operations for entity: HMRX\CoreBundle\Entity\AccountRole@0000000062481e3f000000009cd58cbd. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity or configure cascade persist  this association in the mapping for example @ManyToOne(..,cascade={"persist"}). If you cannot find out which entity causes the problem implement 'HMRX\CoreBundle\Entity\AccountRole#__toString()' to get a clue.

If I tell it to create a new entry in the related table 'accountRole' => 'entity|' . AccountRole::class, it works, but then it adds rows to the table when it should be using an existing row. All the role types are known beforehand, and a new random role type makes no sense because there's nothing in the code it could match to. Creating a duplicate role works, but again it makes so sense to have a separate role type for each user since roles should be shared by users.
I've had this error before in Unit tests, not Acceptance tests, when not using Faker / FactoryMuffin, and it's been to do with accessing each entity of the relationship with a different instance of EntityManager. As soon as I got both parts using the same instance, it worked. I don't see how to override the native behaviour here though.

A: It works (at least in Codeception 4.x) by using a callback for the existing relation:
<?php
public function _beforeSuite()
{
     $factory = $this->getModule('DataFactory');
     $em = $this->getModule('Doctrine2')->_getEntityManager();

     $factory->_define(AccountHolder::class, [
         'firstName' => Faker::firstName(),

         'accountRole' => function($entity) use ($em) {
             $em->getReference(AccountRole::class)->find(1);
         },
     ]);
}

I've found it here: https://github.com/Codeception/Codeception/issues/5134#issuecomment-417453633


text:
Q: javascript variables not getting passed to function For some reason on line 54(which is starred out************) an error is popping up saying cannot call 'push' of undefined.  My 'randUsers' array which is supposed to initially be empty is not getting passed properly. Why isn't randUsers getting passed properly?
This cloud code on Parse.com is getting triggered by an afterSave function.  I declared the variables so they would be global variables, but idk if the fact that this is cloud code and not a regular implementation file affects that.
  var leanBody = "";
  var leanSenderName = "";
  var leanSenderId = "";
  var randUsers = [];

function varReset(leanBody, leanSenderName, leanSenderId, randUsers){
   leanBody = "";
   leanSenderName = "";
   leanSenderId = "";
   randUsers = [];
   console.log("The variables were set");
}

Parse.Cloud.afterSave("Lean", function(request, leanBody, leanSenderName, leanSenderId, randUsers) {
  varReset(leanBody, leanSenderName, leanSenderId, randUsers);

  var leanQuery = new Parse.Query("Lean");
  leanQuery.first({
    success: function(results){
      console.log("The first object was retrieved");
      leanBody = (results.get("messageBody"));
      leanSenderName = (results.get("senderName"));
      leanSenderId = (results.get("senderId"));
      getUsers(leanBody, leanSenderId, leanSenderName, randUsers);
      results.destroy({
        success: function(results){
          console.log("deleted");
        }, error: function(results, error){
        }
      });
    }, error: function(error){
    }

  });
});

  function getUsers(randUsers, response, leanBody, leanSenderName, leanSenderId, randUsers){
    var query = new Parse.Query(Parse.User);
    query.find({
        success: function(results, leanBody, leanSenderName, leanSenderId, randUsers){
            var users = [];
            console.log("results = " + results);
            //extract out user names from results
            for(var i = 0; i < results.length; ++i){
                users.push(results[i].id);
            }
            for(var i = 0; i < 3; ++i){
                var rand = users[Math.floor(Math.random() * users.length)];
                var index = users.indexOf(rand);
                users.splice(index, 1);
                randUsers.push(rand);**********************************************
                }
            console.log("rand = " + rand);
            console.log("The random users are " + randUsers);
            response.success(sendLean(leanBody, leanSenderId, leanSenderName));
        }, error: function(error){
            response.error("Error");
        }
    });
  }

  function sendLean(randUsers, leanBody, leanSenderName, leanSenderId){
    var Mission = Parse.Object.extend("Mission");
    var mission = new Mission();
    for(var i = 0; i < 3; ++i){
      mission.set("messageBody", leanBody);
      mission.set("recipientId", randUsers[i]);
      mission.set("senderName",  leanSenderName);
      mission.set("senderId", leanSenderId);
      mission.save(null, {
        success: function(mission) {
          // Execute any logic that should take place after the object is saved.
          alert('New object created with objectId: ' + mission.id);
        },
        error: function(mission, error) {
          // Execute any logic that should take place if the save fails.
          // error is a Parse.Error with an error code and message.
          alert('Failed to create new object, with error code: ' + error.message);
        }
      });
    }
  }

A: You define randUsers locally in the getUsers function by making it an argument:
function getUsers(randUsers, response, leanBody, leanSenderName, leanSenderId, randUsers){
    //blabla
    randUsers.push(rand); //randUsers in this context is the argument passed to the function
    //blabla
}

You call getUsers with these arguments:
getUsers(leanBody, leanSenderId, leanSenderName, randUsers);
so leanBody is randUsers in the getUsers function, you need to either remove it from the arguments or pass it when calling getUsers.


text:
Q: Sharepoint Designer crashing when trying to add new External Content Type Sharepoint Designer is crashing when trying to add new External Content Type with below error message:
Description:
  Stopped working

Problem signature:
  Problem Event Name:   CLR20r3
  Problem Signature 01: spdesign.exe
  Problem Signature 02: 14.0.4750.1000
  Problem Signature 03: 4b8baffb
  Problem Signature 04: mscorlib
  Problem Signature 05: 2.0.0.0
  Problem Signature 06: 4ca2b851
  Problem Signature 07: 4212
  Problem Signature 08: a9
  Problem Signature 09: System.TypeInitialization
  OS Version:   6.1.7601.2.1.0.256.48
  Locale ID:    1033

A: I have never experience it, but probably these two things helps you:

*

*Close SPD and clear its cache. It is located here:
%APPDATA%\Microsoft\Web Server Extensions\Cache
%USERPROFILE%\AppData\Local\Microsoft\WebsiteCache

*If it doesn't help, try to uninstall SPD and install the latest version of it.
Clear the cache by pasting the following in cmd:
    cd "%APPDATA%\Microsoft\Web Server Extensions\Cache"
    del *.web /S /Q "%APPDATA%\Microsoft\Web Server Extensions\Cache"
    cd "%USERPROFILE%\AppData\Local\Microsoft\WebsiteCache\"
    rmdir /S /Q "%USERPROFILE%\AppData\Local\Microsoft\WebsiteCache\."
    mkdir "%USERPROFILE%\AppData\Local\Microsoft\WebsiteCache"
    dir "%APPDATA%\Microsoft\Web Server Extensions\Cache"
    dir "%USERPROFILE%\AppData\Local\Microsoft\WebsiteCache"
    pause


text:
Q: Architectural advice for Apache Camel and C I'm experimenting a bit with Apache Camel to propose it to my boss as an "ESB solution" which he is pushing for. Camel looks like a nice project, and a good way to keep away from more heavyweight stuff.
We've got a low-level layer implemented in C which listens to network events and is supposed to trigger some demo Camel route. Which is the best way to do such integration? I was thinking of JMS and STOMP protocol, unfortunately its C client library looks funny (you have to compile it on XCode, for one).
Have you got any alternatives to suggest?

A: there are several components that allow Camel to interface with other (non-Java) applications.  off the top, camel-jetty, camel-jms, camel-file and camel-amqp all provide this easily.  that being said, I'm not a C guy, so I'm not sure the best choice from that perspective...
If you are just preparing a demo, just use define an HTTP endpoint (using camel-jetty) to kick off your demo route.  As you progress, you can switch to something more robust (JMS, etc) for messaging between the two...

A: Camel has some components (camel-netty, camel-mina) which can provide lower level socket interaction. You may consider to use them to talk to your system.

A: Finally I resorted to using a Java Gateway which receives internal IPC calls using a native library provided by our vendor (HP Tandem NonStop mainframes) and translates them to JMS messages towards a demo broker running on my PC.
(My first step was actually to use HttpEndpoint).
Good advice also about low-level socket libraries in Java, we need some tuning to avoid weird behavior by standard network libraries on NonStop.


text:
Q: fromCharCode equivalent in Power Query I have a list of values which I would like to convert in Power Query using an equivalent of JavaScript's String.fromCharCode.
Any help appreciated!

A: Powerquery:
let Source = {189, 43, 190, 61},
convert = Text.Combine(List.Transform (Source, each Character.FromNumber(_)))
in convert

https://learn.microsoft.com/en-us/powerquery-m/character-fromnumber


text:
Q: PHP Determined HTML Classes I'm trying to determine the best way of using PHP to assign the classes of my tabbed menu items.
What I've read so far on the subject here and elsewhere seems to only determine very simplistic cases.  I need to have an active class for the tab when you're on it's page and I also need a disabled class for the tab on accounts without access to that feature (based on a session flag).
Originally, I just echoed out everything like this:
 <?php
    echo '
Link';}
   ?>

But then code shame set in and I'm trying to really start using PHP like templating engine.  That said, I do not want to use an actual templating engine.
For any other part of the HTML, hopping in and out of PHP is easy and relatively elegant, but when it comes to getting classes to work, it's feels clunky.  It completely pollutes the markup and leaves me with way too much logic in my template.
Like so:
<li class="some-tab <? if($pageName === "somepage.php"){echo'active';} ?>

Not terrible but add a few more rules and it becomes a mess.
My first thought is creating an associative array and just echoing it's contents:
<?  if(some condition){
       $class = array("sometab" => "sometab active disabled");
    }
    else{
       $class = array("sometab" => "sometab");
    }
 ?>
<li class="<?= $class['sometab'] ?>">

But I feel like it may be too clever.
I want to avoid storing information in the body class or as Javascript cookies as suggested by some because I'm not just fetching the URL.
Is there an option I'm missing?
Is a class array appropriate in the slightest?  I don't have the experience to know if it's a horrible idea or not.

A: I think you answered this yourself.
You need a templating engine if you want it to run like a templating engine
With that said, something you might find neat though, is shorthand logic statements:
if($x > 10){echo 'BlahBlah';}else{ echo 'NahNah';}

turns into:
echo ($x>10?'BlahBlah':'NahNah');

these can come in handy in logic gates like the ones you are mentioning

A: Your last option would be the most elegant for me. Anyway, if you can use a MVC pattern with some Framework, I would strongly recommend it to you.
In any case, it is very probable you will have to deal with this stuff at some point inside the template if you dont want to create variables for each CSS style.


text:
Q: In Rails 3, how does one render HTML within a JSON response? I'm porting an application from Merb 1.1 / 1.8.7 to Rails 3 (beta) / 1.9.1 that uses JSON responses containing HTML fragments, e.g., a JSON container specifying an update, on a user record, and the updated user row looks like . In Merb, since whatever a controller method returns is given to the client, one can put together a Hash, assign a rendered partial to one of the keys and return hash.to_json (though that certainly may not be the best way.) In Rails, it seems that to get data back to the client one must use render and render can only be called once, so rendering the hash to json won't work because of the partial render.
From reading around, it seems one could put that data into a JSON .erb view file, with <%= render partial %> in and render that. Is there a Rails-way of solving this problem (return JSON containing one or more HTML fragments) other than that?
In Merb:
controller:
only_provides :json
...
self.status = 204 # or appropriate if not async
return {
    'action' => 'update',
      'type' => 'user',
        'id' => @user.id,
      'html' => partial('user_row', format: :html, user: @user)
}.to_json

In Rails:
controller:
respond_to do |format|
  format.json do
    render template: '/json/message-1',
      locals: {
        action: 'update',
        type: 'user',
        id: @user.id,
        partial: 'user_row.html.erb',
        locals: { user: @user }
      }
  end
end

view: json/message-1.json.erb
{
  "action": <%= raw action.to_json %>,
  "type": <%= raw type.to_json %>,
  "id": <%= raw id.to_json %>,
  "html": <%= raw render(partial: partial, locals: locals).to_json %>
}

A: There's another question that has more solutions for json.erb files. See json erb template cannot find other html partial

A: The closest to the original from Merb approach I could find in Rails is to use #render_to_string
render json: {
  'action' => 'update',
    'type' => 'user',
      'id' => @user.id,
    'html' => render_to_string(partial: 'user_row.html.erb', locals: { user: @user })
}

This gets around a fair bit of complexity that comes in from adding a layer of json.erb templates into the mix, whether it's Rails Purist approach I couldn't say; possibly something with RJS would typically be used.

A: class UsersController < ApplicationController
  respond_to :json

  def show
    @user = User.find(params[:id])
    respond_with(@user) do |format|
      if @user.save
        format.json { render :json => @user }
      else
        format.json { render :json => @user.errors, :status => :unprocessable_entity }
      end
    end
  end
end


text:
Q: _count method returning 0, reduce=false returning docs I want to query a CouchDB server (in this case Couchbase Sync Gateway) in order to count the number of documents matching a given key.
My view is below
{
  "views":  {
    "wordlist_count": {
      "map": "function(doc) {
        if (doc.wordlist)
          emit(doc.wordlist, null) }",
      "reduce" : "_count"
    }
  }
}

Calling it with 'reduce=false' gives me all the keyed documents as expected, however without this I get {"total_rows":0,"rows":[],"Collator":{}}#
I've looked at lots of examples, not sure what could be going wrong.

A: Solved: I needed specify "reduce=true" in the query!


text:
Q: Casting a DataTable into a dynamically created entity model? I have created a instance of an entity model called MyModel but I need to use this instance as a type in my helper class so that I can convert a datatable to whatever model that was dynamically created. Everything works if I explicitly pass the actual model to the helper class for example:
var data = Helper.DataTableToList<MyActualEntity>(datatable);

but I need to do this dynamically.
This is my helper class
 public static class Helper
    {
        /// <summary>
        /// Converts a DataTable to a list with generic objects
        /// </summary>
        /// <typeparam name="T">Generic object</typeparam>
        /// <param name="table">DataTable</param>
        /// <returns>List with generic objects</returns>
        public static List<T> DataTableToList<T>(this DataTable table) where T : class, new()
        {
            try
            {
                List<T> list = new List<T>();

                foreach (var row in table.AsEnumerable())
                {
                    T obj = new T();

                    foreach (var prop in obj.GetType().GetProperties())
                    {
                        try
                        {
                            PropertyInfo propertyInfo = obj.GetType().GetProperty(prop.Name);
                            propertyInfo.SetValue(obj, Convert.ChangeType(row[prop.Name], propertyInfo.PropertyType), null);
                        }
                        catch
                        {
                            continue;
                        }
                    }

                    list.Add(obj);
                }

                return list;
            }
            catch
            {
                return null;
            }
        }
    }

This is me creating the entity dynamically by tablename. It works fine until I need to pass they type to the Helper Class and I get the error "MyModel is a variable but is used like a type"
var assembly = AppDomain.CurrentDomain.GetAssemblies()
    .Where(x => x.FullName.Contains("MyNameSpace.Model")).FirstOrDefault();
var type = assembly.GetTypes()
    .FirstOrDefault(t => t.Name == tableName);

if (type != null)
{
    System.Data.Entity.DbSet myDbSet = ctx.Set(type);
   var MyModel = myDbSet.Create(); <--Entity is created

    var data = Helper.DataTableToList<MyModel>(dt);  <--Errors here
}

A: System.Reflection.MethodInfo MI = typeof(Helper).GetMethod("DataTableToList");
System.Reflection.MethodInfo generic = MI.MakeGenericMethod(MyModel.GetType());
var data = generic.Invoke(null, new object[] { //YourDataTableHere });

You have to use reflection as @dbc stated above. Then you have to invoke the generic method and cast a new object as your datatable. If you are not using static methods then reverse the arguments

A: AS per your description, Helper method is extension method on DataTable so you should use below line of code:
var data = dt.DataTableToList<MyModel>();

you can use same code for any type of model as it is generic method.
Example code I executed at my end.
Helper Class Extension:
public static List<T> DataTableToList<T>(this DataTable table) where T : class, new()
        {
            try
            {
                List<T> list = new List<T>();

                foreach (DataRow row in table.Rows)
                {
                    T obj = new T();
//change made at this line
                    foreach (var prop in obj.GetType().GetProperties())
                    {
                        try
                        {
                            PropertyInfo propertyInfo = obj.GetType().GetProperty(prop.Name);
                            propertyInfo.SetValue(obj, Convert.ChangeType(row[prop.Name], propertyInfo.PropertyType), null);
                        }
                        catch
                        {
                            continue;
                        }
                    }

                    list.Add(obj);
                }

                return list;
            }
            catch
            {
                return null;
            }
        }

Model Class:
 public class Data
        {
            public string Client_Description { get; set; }
            public string Client_Code { get; set; }
            public string Brand_Description { get; set; }
            public string Brand_Code { get; set; }
        }

Calling method:
DataTable inputData = null; // Get the DataTable

Call extension method:
var dataList = inputData.DataTableToList<Helper.Data>();

Or
var data = Helper.DataTableToList<Helper.Data>(inputData);

Please share your source code with me if you still face issue.


text:
Q: How to insert value from state into a function? I have an array that is generated from a firebase database query.
I want to save that in state so that as the data changes, it will re-render the screen.
I can't seem to get the value from state into my function.  If I put the value from the array, it works, but then it won't automatically re-render when data changes.
Screen shot of it using the array... note the console log is printing that the state is set correctly.

and here it is with the error

It's gotta be right around line 101, but I cannot figure out the right syntax to make thsi work.
UPDATE: I was not initializing state, that was one part of the error.
import React, { Component } from 'react';
import Flexbox from 'flexbox-react';

import firebaseApp from '../api/firebase';
import GeoFire from 'geofire';

var geoRef = firebaseApp.database().ref('shiftgeo');
var geoFire = new GeoFire(geoRef);
var ref = geoFire.ref();  // ref === firebaseRef
var shiftKeys = []; // this array will hold the keys from the geoFire results
var shifts = []; // this array will hold the actual shift data of shifts in the geo, then we will filter it later

console.log(firebaseApp);

export class App extends React.Component {
  constructor() {
    super();
    this.state = {
      fname: 'Chris',
      lname: 'Chong',
      cellphone: '503 830 4313',
      email: 'chris@ehotleads.com',
      dataSource: ''
    };
  }
  componentWillMount() {
    let email = 'chris@ehotleads.com';
    let password = '123456789';
    firebaseApp.auth().signInWithEmailAndPassword(email, password)
          .then((data) => {
            //this.setState({ error: 'Account already exists. Logging you in...', loading: false });
            console.log('success data', data);
            this.setState({
              user: data,
            });
          })
          .catch((data) => {
            //this.setState({ error: 'Authentication failed.', loading: false });
            console.log('error data', data);
          });
  }

  componentDidMount() {
    var geoQuery = geoFire.query({
      center: [45.616422, -122.580453],
      radius: 1000,
      });
    geoQuery.on("key_entered", function(key, location, distance) {
      // dont forget that as shifts are added that match the geo, this will automatically add to the shiftKeys array
      //shiftKeys = [];
      shiftKeys.push(key)
      console.log("Found shift " + key + " at " + location + " (" + distance + " km away)");
    });

    geoQuery.on("ready", () => {
      shifts = []; // we need to blow out the array every time this function runs or it will throw errors
      shiftKeys.forEach((shiftKey) => {
        //console.log(shiftKey);
        let shiftsRef = firebaseApp.database().ref('shifts').child(shiftKey);
        shiftsRef.on("value", (snapshot) => {
          //console.log(snapshot.val())
          //if (snapshot.val().state == "WA" && (snapshot.val().licenseRequired == "CNA" || snapshot.val().licenseRequired == "RN")) {
          //if (snapshot.val().licenseType == this.state.licenseType || snapshot.val().licenseRequired == "TEST") {
          shifts.push({
            key: snapshot.key,
            fname: snapshot.val().fname,
            lname: snapshot.val().lname,
            company: snapshot.val().company,
            address1: snapshot.val().address1,
            address2: snapshot.val().address2,
            city: snapshot.val().city,
            state: snapshot.val().state,
            zip: snapshot.val().zip,
            shiftDate: snapshot.val().shiftDate,
            shiftStart: snapshot.val().shiftStart,
            shiftLength: snapshot.val().shiftLength,
            shiftDescription: snapshot.val().shiftDescription,
            licenseType: snapshot.val().licenseType,
            logo: snapshot.val().logo,
            building: snapshot.val().building,
          }) // end shifts.push
          var date_sort_asc = function (date1, date2) {
            if (date1.shiftDate > date2.shiftDate) return 1;
            if (date1.shiftDate < date2.shiftDate) return -1;
            return 0;
          };
        //}
          //console.log(this.state.distancePref)
          this.setState({
            dataSource: shifts,
            resultCount: shifts.length,
          })
        }); // end shiftsRef.on
      }); // end shiftKeys map
    }); // end geoQuery.on
    console.log('ShiftArray: ', shifts)
    console.log('StateArray: ', this.state.dataSource)
  }

  render() {
    const listItems = this.state.dataSource.map((shift) =>

        {shift.address1}

    );
    console.log('ShiftArray: ', shifts)
    console.log('StateArray: ', this.state.dataSource)

    return (
  <Flexbox flexDirection="column" minHeight="100vh">
    <Flexbox element="header" height="60px">
      Header link one
    </Flexbox>

    <Flexbox flexGrow={1}>
      <Flexbox
        width="20%"
        minWidth="200px"
        maxWidth="300px"
        style={{ backgroundColor: '#ba0000' }}>
          Sidebar Menu Goes Here
      </Flexbox>
      <Flexbox width="80%" flexDirection="row" style={{ backgroundColor: '#FFF' }}>

List of Shifts Addresses

{listItems}

      </Flexbox>
    </Flexbox>

  <Flexbox element="footer" height="60px">
    Footer
  </Flexbox>
</Flexbox>
    );
  }
}

Now Im getting Uncaught TypeError: this.state.dataSource.map is not a function

A: The problem was that I failed to initialize dataSource in the state, and then after that, I initialized it with a string instead of an empty array.
Was missing: dataSource: [] in this.setstate in the constructor.


text:
Q: $f(x)=0$ for $x\in X$, then $f(x) = 0$ for $x\in\overline{X}$ I'm trying to prove:
$f(x)=0$ for $x\in X$, then $f(x) = 0$ for $x\in\overline{X}$
where $f$ is a function from $\mathbb{R}$ to $\mathbb{R}$ and is continuous.
I know that the set $\overline{X}$ is the set of all points $a$ such that if $a\in I$, being $I$ open, then $I\cap X\neq \emptyset$.
I tried to assume that, since $f(x)=0$ for all $x\in X$, then I just need to find a sequence that approximates to $a\in\overline{X}$ such that $a\notin X$. Then I can use some property that will help me. However, I couldn't do it. Could you guys help me with something?

A: We have that $f$ is continuous and $\{0\}$ is closed, so $f^{-1}(\{0\})$ is closed, so it is equal to its closure. Now,
$$X \subseteq f^{-1}(\{0\}) \implies \overline X \subseteq \overline{f^{-1}(\{0\})} = f^{-1}(\{0\})$$
thus, for all $x \in \overline X$, $f(x) = 0$.

A: A slick proof: a function $f$ is continuous iff the preimage under $f$ of any closed set is closed. Thus $f^{-1}(\{0\})$ is closed. And since $X \subset f^{-1}(\{0\})$, we have $\overline{X} \subset \overline{f^{-1}(0)} = f^{-1}(0)$.
Your sequence argument also works. The topology of the real numbers is determined by its convergent sequences, and $f$ is continuous iff for every convergent sequence $(x_n) \to x$, $f(x_n) \to f(x)$. (Or, to write it neatly, $f(\lim x_n) = \lim f(x_n)$, i.e., $f$ commutes with limits.) By definition of $\overline{X}$, any point $x \in \overline{X}$ is the limit of a sequence $(x_n)$ of elements in $X$. But then $f(x) = f(\lim x_n) = \lim f(x_n) = \lim 0 = 0$.

A: For any $a\in \overline X$ and any open set $I$ such that $a\in I$, $I\cap\overline X\ne \emptyset$. Since it is true for any such $I$, how can you choose a sequence $I_n$ so that $x_n\in I_n\cap\overline X$ approximates $a$?
Hint: Try $I_n:=(a-\frac 1n,a+\frac 1n)$.


text:
Q: Where is the error in my attempted derivation of the result $i^{(p)} = p[(1+i)^\frac{1}{p}-1]$? Suppose $i^{(p)}$ denotes the nominal interest rate, payable as $\frac{i^{(p)}}{p}$, at a rate of $p$ times per period, and assume that $i$ is the effective interest rate (payable once per period) that is equivalent.
Then, by considering the accumulated value of the interest payments made under the nominal rate, we deduce that
$$
\frac{i^{(p)}}{p} + \frac{i^{(p)}}{p}(1+i) + \frac{i^{(p)}}{p}(1+i)^2 + \dots + \frac{i^{(p)}}{p}(1+i)^\frac{p-1}{p} = i \hspace{10mm} (*)
$$
Then, by using the rule
$$
\sum_{k=0}^{n-1}ar^k = a \cdot \frac{(1-r^n)}{1-r}
$$
and taking
$$
a = \frac{i^{(p)}}{p}, \hspace{10mm} r = (1+i)^\frac{1}{p}, \hspace{10mm} n = p
$$
we can express $(*)$ as
$$
\frac{i^{(p)}}{p} \cdot \frac{1 - \left( (1+i)^\frac{1}{p} \right)^p}{1 - (1+i)^\frac{1}{p}} = \frac{i^{(p)}}{p} \cdot \frac{i}{1 - (1+i)^\frac{1}{p}} = i
$$
Thus, by dividing through by $i$ we have
$$
\frac{i^{(p)}}{p[1 - (1+i)^\frac{1}{p}]} = 1
$$
Giving the result
$$
i^{(p)} = p[1 - (1+i)^\frac{1}{p}]
$$
This result is incorrect, since the correct result should be
$$
i^{(p)} = p[(1+i)^\frac{1}{p}-1]
$$
Where in my attempted derivation did I go wrong?

A: You've forgotten a minus sign:
$$
\frac{i^{(p)}}{p} \cdot \frac{1 - \left( (1+i)^\frac{1}{p} \right)^p}{1 - (1+i)^\frac{1}{p}} = \frac{i^{(p)}}{p} \cdot \frac{-i}{1 - (1+i)^\frac{1}{p}} = i
$$


text:
Q: How do I move the reticle to Ryder's left side? In this diagram, the -s are tall cover (i.e. cover tall enough that Ryder cannot shoot over it), the R is Ryder, and the xs are enemies:
x  x  x  x  x

  ------
  R

(For people with screen readers: Ryder is behind the left side of a tall bank of cover, with enemies in front.)
I want to peek around the left side of the cover and shoot at the enemies.  But Ryder always looks to my right, and the reticle is also on my right, so I can't shoot at anything from this position.  How do I make Ryder look left instead of right?

A: The button you're after is ALT, at least on the PC version. This button is bound to "Camera Swap/Recenter" and is the same binding as used to allow the game to use its cinematic camera angle when you're driving around in the Nomad.
On both console versions the equivalent action/binding appears to be clicking the right thumb stick.


text:
Q: exibição de conteúdo de arquivo txt em php Olá, estou tentando ler um arquivo txt criado com dados inseridos pelos usuários de um site (nome, email, empresa e telefone) e quero exibir as informações dentro do arquivo txt utilizando php.
Meu código até o momento está assim:
<?
                    $arquivo = fopen('Log_Cadastro_de_ident.txt', 'r');

                    $dados = array();

                    while(!feof($arquivo)){

                        $dados[] = explode('*', $arquivo);

                                          };

                    //fechamento do arquivo
                    fclose($arquivo);
                ?>

 <?= $dados[0] ?>

 <?= $dados[1] ?>

 <?= $dados[2] ?>

 <?= $dados[3] ?>

O problema é que quando executo o código ele me passa as seguintes informações na tela:

A: Está faltando o "fgets" para pegar o conteudo da linha, tenta assim:
<?php

$dados = array();

$arquivo = fopen('Log_Cadastro_de_ident.txt', 'r');
while (!feof($arquivo)) {
   $line = fgets($file_handle);
   $dados[] = explode('*', $line );
}
fclose($file_handle);

Obs: Se você mandar o arquivo de texto, fica mais facil de propor uma solução


text:
Q: Cascading Dropdown Validation: Second dropdown always validates after first is selected I have a simple set of cascading dropdowns which use jquery to validate.  They are both required.
If you leave them both un-selected and try to submit the form, they will both show as red and the form will not submit.
But, if you select a value in the first while leaving the second dropdown un-selected, and then submit the form, the form will submit and throw a server-side error because the second dropdown value, which is required, has not been selected.
Here's the (stripped down) HTML with both un-selected:
<form action="/Project/ProjectDocumentUpload" class="form-horizontal" enctype="multipart/form-data" method="post" onsubmit="return Validate('UploadFormModal');">

        Phase

            <select id="PhaseDD" data-val="true" data-val-required="Select a Phase.">
                <option value="">-Select-</option>
                <option value="1">Planning</option>
                <option value="2">Procurement</option>
                <option value="3">Installation</option>
                <option value="4">Closure</option>
            </select> *

        Process

            <select id="ProjectProcessTypeId" name="ProjectProcessTypeId" data-val="true" data-val-required="Select a Process">
               <option value="">-Select-</option>
           </select> *

        <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
        <input type="submit" value="Save changes" class="btn btn-primary disable-button-upon-submit">

And when I select a value in the first, the only thing that changes is the second dropdown now has values:
<select id="ProjectProcessTypeId" name="ProjectProcessTypeId" data-val="true" data-val-required="Select a Process">
    <option>-Select-</option>
    <option value="1">Kickoff</option>
    <option value="2">Project Team Selection</option>
    <option value="3">Define the Work</option>
</select>

What am I missing here?  How can I get the second dropdown to validate?
Thanks!

A: Found it.  When the second dropdown is populated, this:
<option>-Select-</option>

Needed to be this:
<option value=''>-Select-</option>


text:
Q: Circular motion at constant speed I have a question. I have an algorithm that computes the trajectory of a body moving in a circle. The program repeats the following at short intervals to update the body's X and Z positions:
$$x = \mathrm{X_c} + R\cos\left(\frac{2\pi}{T}t\right)$$
$$z = \mathrm{Z_c} + R\sin\left(\frac{2\pi}{T}t\right)$$
$X_c$ and $Z_c$ are the x and z positions of the rotation axis, respectively. The $t$ value is increased by $1$ with each update. In turn, $T$ means the time it takes the body to complete one circle. The problem is that changing the radius $R$ value changes the speed of the body. I want a constant speed, independent of the radius. How can I get rid of the $T$? Ideally, the speed should be predefined. This means that regardless of the radius of the circle, the body should always move at a fixed speed. Is there a way? I will be grateful for your help.

A: For an object undergoing circular motion (wlog - around the origin) with uniform angular frequency $\omega$ and radius $R$, a 'time' dependent parameterization via $t$ would be:
$$ (x,y) = (R\cos(\omega t), R\sin(\omega t))$$
The angular speed is $v=\omega R$ which can be verified by taking the derivative w.r.t $t$. So if you want to preserve $v$ while changing $R$ you need to compensate for that change by an inverse change in $\omega$.
Example: Suppose we begin from initial angular frequency $\omega_1$ and initial radius $R_1$. We now change the radius to $R_2$ but want to keep the previous angular speed $v_1=\omega_1 R_1$. If you set the new angular frequency in the following way: $\omega_2 = \omega_1\frac{R_1}{R_2}$ then you can see that it will compensate for the change in the radius appropriately:
$$ v_2 = \omega_2 R_2 = \omega_1\frac{R_1}{R_2}R_2=\omega_1R_1 = v_1$$
So the angular speed did not change, as required.
Note also that since the above gives $\omega_1 = \frac{v_1}{R_1}$ and
$\omega_2 = \frac{v_2}{R_2}$ we can read off a general expression for a "$v$ preserving" $\omega$ as a function of a variable radius $R$ that you may want to use:
$$ \omega(R) = \frac{v}{R}$$
In your case the angular frequency is currently fixed at $\omega = \frac{2\pi}{T}$ which means that a complete revolution always takes $T$ time units. But since you care about the speed $\omega R$ being constant, you can't keep the $T$ fixed as well. So you will have to adjust your code in some way to use an $\omega$ that is variable rather than fixed in order to achieve that. You may still initialize it to the same value $\frac{2\pi}{T}$ but it will have to change when the radius changes, as explained earlier.

A: Suppose you want the speed of the body to be $v$.
The amount of time that passes while the body travels once around the circumference of a circle of radius $R$ will then be
$$ T = \frac{2\pi R}{v}. $$
Plug this into your formulas:
$$ \frac{2\pi}{T} = \frac{2\pi}{\left(\frac{2\pi R}{v}\right)} = \frac vR , $$
$$x = \mathrm{X_c} + R\cos\left(\frac vR t\right),$$
$$z = \mathrm{Z_c} + R\sin\left(\frac vR t\right).$$


text:
Q: CS50 Week5 Speller compiles but is incorrect. Also takes no time on size and unload I started working on this yesterday. It compiles but whenever I run it with

./speller texts/lalaland.txt

I get this result:
WORDS MISSPELLED:     17134
WORDS IN DICTIONARY:  143091
WORDS IN TEXT:        17756
TIME IN load:         0.04
TIME IN check:        8.41
TIME IN size:         0.00
TIME IN unload:       0.00
TIME IN TOTAL:        8.45

As you can see it takes a stupid amount of time in "check" and no time in "size" or "unload". I'm almost certain there's nothing wrong with my check function though. Any assistance would be appreciated.
    // Implements a dictionary's functionality
    #include <stdlib.h>
    #include <ctype.h>
    #include <string.h>
    #include <stdbool.h>
    #include <cs50.h>
    #include <stdio.h>
    #include "dictionary.h"
    #include <strings.h>
    unsigned int counter;
    unsigned int i;
    // Represents a node in a hash table
    typedef struct node
    {
        char word[LENGTH + 1];
        struct node *next;
    }
    node;

    // TODO: Choose number of buckets in hash table
    const unsigned int N = 26;

    // Hash table
    node *table[N];

    // Returns true if word is in dictionary, else false
    bool check(const char *word)
    {
        i = hash(word);

        node *cursor = table[i];

        while (cursor != 0)
        {
            if (strcasecmp(cursor->word, word) == 0)
            {
                return true;
            }
            cursor = cursor->next;
        }
        return false;
    }

    // Hashes word to a number
    unsigned int hash(const char *word)
    {
        int value;
        for (int j = 0; j< strlen(word); j++)
        {
            value = value + tolower(word[j]);
        }
        return (value % N);
    }

    // Loads dictionary into memory, returning true if successful, else false
    bool load(const char *dictionary)
    {
        // TODO
        FILE* file = fopen(dictionary, "r");

        if (file == NULL)
        {
            return false;
        }
        char word[LENGTH + 1];

        while (fscanf(file, "%s", word) != EOF)
        {
            node *new = malloc(sizeof(node));

            if (new == NULL)
            {
                return false;
            }

            strcpy(new->word, word);
            new->next = NULL;

            i = hash(word);
            new->next = table[i];
            table[i] = new;
            counter++;
        }
        fclose(file);
        return true;
    }

    // Returns number of words in a dictionary if loaded, else 0 if not yet loaded
    unsigned int size(void)
    {
        if (counter != 0)
        {
            return counter;
        }
        return 0;
    }

    // Unloads dictionary from memory, returning true if successful, else false
    bool unload(void)
    {
        for (int j = 0; j < N; j++)
        {
            node *head = table[j];
            node *cursor = head;
            node *temp = head;

            while(cursor != NULL)
            {
                cursor = cursor->next;
                free(temp);
                temp = cursor;
            }
            if (cursor == NULL)
            {
                return true;
            }
        }
        return false;
    }

A: There is a problem with the hash function. valgrind will complain about an unitialised value in hash; specifically value. Because value is not initialized, it will have the value that is stored in the memory that is assigned to it. Unpredictable results ensue.
There is also a problem with unload. Once the first node is freed, program will return true from the unload function. However, it hasn't freed any other nodes.


text:
Q: Full background image; content not scrolling I have implemented a full, non scrolling background image with CSS. However, when the content itself overflows the page no scrollbars appear and the content cannot be seen. I have tried using various variations of "overflow: scroll" in a few of my divs but to no avail; scroll bars appear but they do not scroll, or do not scroll properly. I think there may be a structural problem with my divs but I'm not particularly experienced with CSS and couldn't find a thread similar to this on StackOverflow.
http://jsfiddle.net/YXp5p/

        thread #6bUp0

                Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec erat ante, placerat accumsan aliquam at, rhoncus eget nunc.

body{
    margin: 0px;
    color: #000;
    font-family: helvetica, times;
    font-size: 16px;
}

#bg {
    position:fixed;
    top:-50%;
    left:-50%;
    width:200%;
    height:200%;
}
#bg img {
    position:absolute;
    top:0;
    left:0;
    right:0;
    bottom:0;
    margin:auto;
    min-width:50%;
    min-height:50%;
}

#wrapper {
    position: fixed;
    top:0%;
    left:18%;
    width: 59%;
    height:200%;
    padding: 0%;
}

#header {
    background: url(images/header.gif) repeat-x;
    border: 1px solid black;
    width: 100%;
    height:29px;
    padding-left: 3%;
    padding-right: 3%;
    padding-top: 6px;
    font-family: "Lucida Console", "Courier New", sans-serif;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
}

#sidebar {
    background-color: #EEEEEE;
    width: 100%;
    height: 100%;
    padding-left: 3%;
    padding-right: 3%;
    right: 3%;
    border-left: 1px solid #000;
    border-right: 1px solid #000;
}

#content {
    background-color: #FFFFFF;
    width: 100%;
    height: 100%;
    border-left: 1px solid #000;
    border-right: 1px solid #000;
    opacity: 1;
    padding-top: 8px;
}

#post{
    margin-left: 8px;
    margin-right: 8px;
    margin-bottom: 5px;
    background-color: #FFF;
    opacity: 1;
}

A: You are looking for background-attachment:fixed not position:fixed you can achieve what you want like this:

body{
    background-image:url('images/background.jpg');
    background-position:center top;
    background-attachment:fixed;
    margin: 0px;
    color: #000;
    font-family: helvetica, times;
    font-size: 16px;
}

Oh, and remove the:

part of your document.


text:
Q: C# callback on new process created? I want for my callbackMethod() to run whenever a certain new external process is created.
I was looking at the WMI apis, I have read to some extent I can attach an event handler whenever a process is started.
I have looked at this answer: Is there a System event when processes are created?
And Created this code:
public static void setupMonitor()
{
    ManagementEventWatcher startWatch = new ManagementEventWatcher(new
          WqlEventQuery("SELECT * FROM Win32_ProcessStartTrace"));
    startWatch.EventArrived += new EventArrivedEventHandler(callBack);
    startWatch.Start();
}

public static void callBack(object sender, EventArrivedEventArgs e)
{
    int id = Convert.ToInt32(e.NewEvent.Properties["ProcessID"].Value);
    Process started = Process.GetProcessById(id);
}

How can I get the new process and assign it to a c# Process object?
What I want to know is does this method also send an event if a process created as 'suspended'?
Or do i have to use a different query
Thanks everyone


text:
Q: How to toggle pagination of a jquery datatable on button click? I have tried with the following ideas, but it all has few issues:
Idea #1:
var $oTable = $('#table').DataTable();
$oTable .settings()[0].oFeatures.bPaginate = !($oTable .settings()[0].oFeatures.bPaginate);
$oTable.draw('page');

Issue: It toggles the pagination but page-numbers at the bottom remains as it is. For example, if the datatable has pages with pagination, and we toggled the pagination it toggles fine but the div at the bottom of datatable that contains all the 5 page-numbers of the table, doesn't hide. I need to write extra code to hide the div that contains page-numbers.
Idea #2:
var $oTable = $('#table').DataTable();
if ($oTable.page.len() == -1) {
      $oTable.page.len(10).draw('page');}
else {
      $oTable.page.len(-1).draw('page');}

Issue: It toggles the pagination but page-numbers at the bottom of the table doesn't hide. Considering the example of last scenario, in this scenario it becomes one page instead of 5 pages. But the problem is the div containing page-numbers remains visible. Again, I need to write extra code to hide the div that contains page-numbers.
Please help me out so that I can toggle the pagination of the datatable and at the same time the div containing page-numbers gets hide.

A: The developer says that

There is no option to enable and disable features in DataTables on-the-fly at this time

here: https://datatables.net/forums/discussion/35146/on-the-fly-change-of-option so I guess that settles that.


text:
Q: Trigger an Auto launch flow when a record is deleted I want to trigger an auto launch flow when any record is deleted. It works fine when a record is edited and created which is invoked from the process builder. My auto launch contains a pause element so I cannot invoke from a record triggered flow. I simply want to trigger auto launch when any record is deleted. Can anyone please share the best approach ?
Thanks

A: Given that the flow can't be refactored to avoid the Pause element, you'll need to delegate the delete operation to something else that can execute delete operations

*

*Invocable Apex

*Invocable Apex that in turn delegates to an @future or Queueable (async)

*Publish a Platform Event whose subscriber trigger/flow does the delete (this will be async)


text:
Q: Why isn't magento finding my adminhtml grid block? I'm trying to build my first admin grid.
The tutorial I'm following is http://inchoo.net/magento/how-to-create-a-custom-grid-from-scratch/
The routing-to-the-controller part is working. When I open my URL, I see the title set using $this->title().
controllers/Adminhtml/Shipments/ReportController.php
    $block = $this->getLayout()
        ->createBlock('ebuynow_ebnreports/adminhtml_shipments_report');
    $this->_addContent($block);

Block/Adminhtml/Shipments/Report.php, Ebuynow_Ebnreports_Adminhtml_Shipments_Report::__construct()
    $this->_blockGroup = 'ebuynow_ebnreports';
    $this->_controller = 'adminhtml_shipments_report';
    $this->_headerText = Mage::helper('ebuynow_ebnreports')
        ->__('sum headertext');
    parent::__construct();
    $this->removeButton('add');

And the grid file is located Block/Adminhtml/Shipments/Report/Grid.php and has class Ebuynow_Ebnreports_Block_Adminhtml_Shipments_Report_Grid. I've been looking at this for a while, and it all looks like it matches up with the inchoo tutorial code.
When I open the page with developer mode turned on, I get this error

Recoverable Error: Argument 1 passed to Mage_Adminhtml_Controller_Action::_addContent()
  must be an instance of Mage_Core_Block_Abstract, boolean given

The createBlock() call is not able to find the block using that string and I don't see why.
If more information is needed I can add more code, I just figured this was where the error was.
Possibly relevant: I followed the execution path of createBlock() to see what it was looking for given the string ebuynow_ebnreports/adminhtml_shipments_report. In Mage/Core/Model/Config.php ::getGroupedClassName(), I echoed $className at the end, before the return and for this: Mage_Ebuynow_Ebnreports_Block_Adminhtml_Shipments_Report
It seems to be prefixing my block class name with Mage_. Not sure if that's normal or not but seems odd. I tried adding Mage_ to my actual block's class name and it didn't help.

A: The solution was to add the following block in config.xml:
    <blocks>
        <ebuynow_ebnreports>
            <class>Ebuynow_Ebnreports_Block</class>
        </ebuynow_ebnreports>
    </blocks>


text:
Q: Android + Eclipse How to import Enhanced ListView project into mine? I'm a little newbie on Android programming and the Eclipse IDE.
And I'm having some difficulties to import this lib/project (how do I call it?) into my currently project.
The link to the GitHub repo:
https://github.com/timroes/EnhancedListView/wiki
There the author wrote a "How to include", but I tried the last one (by my one), since I use Eclipse.

"How to include
You need to include the library into your project, by one of the
  following ways:
Include it from Maven Central (recommended)

Just enter the following line to your build.gradle file in the dependencies section:

compile 'de.timroes.android:EnhancedListView:X.Z.Y@aar'

Where X.Y.Z is a valid release. You can find all releases on the release page or directly in Maven Central.

If you use Maven to build, just use the above coordinates in your pom.xml.

Download the aar file from the release page and reference it in the dependencies section of your build.gradle:

compile files('libs/EnhancedListView-X.Y.Z.aar')

If you are using Eclipse or Ant, you are on your own. You most likely want to download the sources and import them in your build system."

I tried to include it to the build path, but didn't work. Nothing found on internet. Do I have to include something besides adding project into build path? Do I import it like a lib or project?
Do any of the others options to include would work for me? How do I do it?
Thank you very much!

A: There is no one click method for Eclipse users. You have to copy the EnhancedListView.java into one of your src packages, the content of the resource directories into your project's resource directories and the annotations.jar from the libs directory to your libs directory.


text:
Q: Why can't I change contract state in Solidity? I'm running into problems with a test that seems to indicate that Solidity can't change the value of a contract storage variable.
Here's the test in JavaScript:
const Mystery = artifacts.require ("Mystery");

contract ("Mystery", async accounts => {

    it ("Incrementing performs as intended", async () => {
        const subject = await Mystery.deployed ();

        const firstValue = (await subject.returnAndIncrement.call ()).toNumber ();
        const secondValue = (await subject.returnAndIncrement.call ()).toNumber ();
        const thirdValue = (await subject.returnAndIncrement.call ()).toNumber ();

        assert.equal (
            [firstValue, secondValue, thirdValue],
            [100, 101, 102]
        );
    });
});

Here's the Solidity code:
pragma solidity >=0.4.22 <0.9.0;

contract Mystery {

  uint32 private currentValue = 100;

  function returnAndIncrement () public returns (uint32 value) {
    value = currentValue;
    currentValue = currentValue + 1;
    return value;
  }
}

And here are the relevant portions of the output from the test runner:
  Contract: Mystery
    1) Incrementing performs as intended
    > No events were emitted

  0 passing (993ms)
  1 failing

  1) Contract: Mystery
       Incrementing performs as intended:

      AssertionError: expected [ 100, 100, 100 ] to equal [ 100, 101, 102 ]
      + expected - actual

       [
         100
      -  100
      -  100
      +  101
      +  102
       ]

      at Context.it (test/TestMystery.js:12:16)
      at process._tickCallback (internal/process/next_tick.js:68:7)

My first thought was that there was some kind of race condition: that all three invocations were grabbing the initial value before any of them had a chance to increment it. But my reading indicates that Ethereum serializes operations so that you can't get races inside a single contract. Also, I tried inserting five-second pauses between the calls to returnAndIncrement() in an attempt to break any existing races, but there was no effect on the results.
My second thought was that there was something fundamental wrong with the configuration of my test, so that I was just getting zeros back regardless of what was actually happening. So I started the currentValue at 100 instead of 0, as you see above; that's not the issue.
My third thought was that when I think I'm copying the value of currentValue into value, what I'm actually doing is making value a reference to the value of currentValue, so that when I increment currentValue I'm also incrementing value. But if that were the case, I'd be getting [101, 102, 103] back instead of [100, 100, 100].

A: To change the state of a smart contract you need to send a transaction instead of call.
Change:
subject.returnAndIncrement.call ()

To:
  subject.returnAndIncrement.send({..}) // you can pass options such gas, account ..

For more details look at the web3js doc
But the return of send transaction is not the value you are looking for, you may need to look in the logs to get the value;

A: Your value assigning is a bit mixed up, read the code comments:
uint32 private currentValue = 100;

function returnAndIncrement () public returns (uint32 value) {
    // 1. memory variable `value` is now 100
    value = currentValue;

    // 2. storage variable `currentValue` is now 101
    currentValue = currentValue + 1;

    // 3. you're returning the `value` from memory (which has value 100)
    return value;
}

Guessing by the context, you probably wanted to return the incremented value from storage.
So easiest way to do that, is:
uint32 private currentValue = 100;

function returnAndIncrement () public returns (uint32) {
    currentValue++;
    return currentValue;
}

Edit: Or a bit of Solidity magic. :) This actually has a slightly cheaper gas cost (28432 opposed to 29284 in the example above) because there's less access to the (expensive) storage.
uint32 private currentValue = 100;

function returnAndIncrement () public returns (uint32 value) {
    value = ++currentValue;
}


text:
Q: Error while trying to delete a personalized domain on GCP I have some DNS records configured on my project, and now im tryng to delete some of them, but i received an error about dont have permission to remove my domains. What im make wrong?
Error print

A: uhmmm this error sometimes is related to the lack of permissions over this mapped domain on App engine, I'd suggest you to verify the ownership of this domain by changing the settings on the URL described below and then open it in your browser

https://console.cloud/.google.com/logs/viewer?project=[YOUR-PROJECT-ID-HERE]&interval=NO_LIMIT&resource=gae_app&advancedFilter=resource.type%3D"gae_app"%0AprotoPayload.methodName%3D"google.appengine.v1beta.DomainMappings.CreateDomainMapping"

Once you confirm the ownership of this domain, you could proceed to run the gcloud command for this matter with the account identified as domain's owner
(I know it could be a little bit tedious using the gcloud command but it could give us a better description of this error)

gcloud app domain-mappings delete "DOMAIN" verbosity=debug

the last flag will let you know what is going on with the operation, so if there's still an error you can share the outcome of this error here or directly with the Google Cloud Platform Support Team.
Here's a link to the command's doc if you want to learn more about its usage


text:
Q: No root filesystem during 16.04 install from USB I made a bootable USB on my Mac from which I am now trying to make an installation on a windows laptop.  It will boot linux fine, but if I try an install I run into trouble, and from the available documentation/help threads I'm not seeing this case covered.  My intent is to wipe out the windows installation, which has never been used.
I get as far as the "Installation type" window.  Instead of a selection of options, I get an empty region, headlined with "Device Type Mount point...", and some nonfunctional buttons ("New Partition Table", "Revert", etc).  Clicking "Install Now" gets the complaint about no root filesystem, and a directive to use the partitioning menu.  I presume this menu is the one that I expected to appear at "Installation type," but I see no way to get to it.
UPDATE--------------------------------------------------
I'm not certain exactly what I changed in BIOS, but the install is now working.  It is now in legacy boot mode, but I booted the USB via UEFI. I thought I did this before, but perhaps not.

A: The two most common issues I run into with booting or installing Ubuntu from USB are:

*

*UEFI versus Legacy BIOS.  If your MAC boots UEFI, and makes a UEFI bootable USB, it probably won't work on Legacy BIOS.  And vice versa.

*Some BIOS configure disks in "raid mode".  Then Ubuntu can't see the disk.  Go into bios and drop disk to AHCI mode.
Also,  if you reach the partition screen during install, select "erase disk" instead of installing into an existing partition.  This will clean up the boot/uefi partition for you.


text:
Q: Building a Battery Charger with an LM317 I was told that i could make a simple battery charger from a LM317 and a resistor to charge some Ni-MH Batteries. Can someone just expand on this a little such as how it works as I don't really understand it. Some more information is that there are 12 AAA batteries that hold a charge of 1000mAh and 1.2v per cell.

A: This page apparently describes a LM317-based charger with auto-shutoff, though it has a few more parts than a resistor.
At the most crude, you can use an LM317 and resistor to form a regulated current source, which is how NiMH/NiCd's should be charged.  See "Precision Current Limiter" (p. 19) on the LM317 datasheet.  The regulator functions as a current source by attempting to supply as much current as possible to have Vout - Vadj be 1.25 V.
Note that there is nothing inherent in the LM317 to shut off a charge, so if the batteries are fast-charged (~C/2 or higher), they will fail if you do not terminate the charge at the appropriate time.  With a trickle-charge (C/20), you "can" leave them alone with no ill-effect.
So in your specific case, the 2-part charger would be a LM317 and a resistor to charge the pack at C/20.

*

*Charge rate: 1000 mA·h @ C/20 => 50 mA

*Resistor value: 1.25 V / 50 mA = 25 Ω
You need to provide a voltage to Vin at least 2.0 V (dropout voltage) + 1.25 V (reference voltage) = 3.25 V greater than the maximum charging voltage.  The resistor would be connected between Vout and Adj, and your load is connected to Adj (not Vout)

A: A good tutorial using a microcontroler to automatically disconnect the charger when the battery is full is available on http://www.shapely.asia/charge1.html

A: You can use this for simple trickle charge. Use the resistor to ensure that the charge delivered to the battery is less then C/10 (capacity of battery divided by ten, ie. 1200mAH batter gets 120mA or less). Most NiMH batteries can handle this for quite a while.
There are some pretty cool designs out there for this. As long as you keep your charge current low you can accidentally leave the battery on the charger for many hours past the point of full charge without having to worry about overcharge damage, the downside being that they will take 12 or 15 hours to charge in general.

NiMH have very interesting charge characteristics. They need to be changed very intelligently to stop from possibly shortening their life. If you want something that charges in a time like 4 or 5 hours from fully dead you need an intelligent controller.

A: Quoting Russell from the PIClist: "AA cells of over 2000 or so mAh from reputable manufacturers recommend NO trickle charge or low AND extremely short duration trickle charge." Low capacity cells (e.g, 800 mAh AA) are OK with trickle charge.
You are definitely into high-capacity cells with 1000 mAh AAAs.  Check the manufacturer's datasheet before charging them with the indefinite-trickle method. However reputable manufacturers place a catalyst that will handle small amounts of excess trickle charging and will be able to handle a few extra hours of C/40 or less charge rate after charged.
The most dependable smart chargers(in relation to ensuring full charge) must use overcharge heating to detect overheating. It is almost unavoidable.


text:
Q: How to Mock window.System.NonGridPageBrowserScroll in Angular spec ts I have a method
this.window.System.NonGridPageBrowserScroll();

I need to Mock this one in the spec.ts file.
I am not finding any good resources online
I did tried Stubwindow etc

TypeError: Cannot read properties of undefined (reading 'NonGridPageBrowserScroll')


text:
Q: Swift SearchBar inTableView doesn't show the correct Data in the filtered rows My app is using Firebase Realtime Database to store information of each user. The tableView works fine. I added a searchBar and when I type letters in the searchBar, I can see that the amount of rows presented in the tableView is equal to the amount of users which contain these letters in their names. The problem is that the rows presented in the tableview (after typing letters in the search bar), contain the information of the first user till x user (x = amount of users which contain these letters in their names).
import UIKit
import FirebaseDatabase
import Firebase

class VideoListScreen: UIViewController {

    @IBOutlet weak var tableView: UITableView!
    var blogPost: [BlogPost] = []
    var searchBlogPost = [BlogPost]()
    var searching = false

    override func viewDidLoad() {
        super.viewDidLoad()

        blogPost = []
        createArray()
        tableView.delegate = self
        tableView.dataSource = self

    }

    func createArray() {
        let ref = Database.database().reference().child("Users")

        ref.observe(.childAdded, with: { (snapshot) in
            if let postDict = snapshot.value as? [String : String] {
                let post = BlogPost(name:postDict["name"] ?? "" , gaf: postDict["gaf"] ?? "", place: postDict["place"] ?? "", phone: postDict["phone"] ?? "", notes: postDict["notes"] ?? "", elsertext: postDict["elsertext"] ?? "")

                self.blogPost.append(post)
                self.tableView.reloadData()
            }
        })
    }
}

extension VideoListScreen: UITableViewDataSource, UITableViewDelegate {

    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        if searching{
            return searchBlogPost.count
        }else{
           return blogPost.count
        }
    }

    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let blogp = blogPost[indexPath.row]
        let cell = tableView.dequeueReusableCell(withIdentifier: "Tavla") as! Tavla
        if searching{
            cell.setBLogPost(blogPost: searchBlogPost[indexPath.row])
        }
        else{
            cell.setBLogPost(blogPost: blogPost[indexPath.row])
        }
        cell.setBLogPost(blogPost: blogp)
        return cell
    }
}

extension VideoListScreen: UISearchBarDelegate {
    func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) {
        searchBlogPost = blogPost.filter({$0.name.prefix(searchText.count) == searchText})
        searching = true
        tableView.reloadData()
    }
}

I Believe the problem is in the if and else statments in this function:
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    let blogp = blogPost[indexPath.row]
    let cell = tableView.dequeueReusableCell(withIdentifier: "Tavla") as! Tavla
    if searching{
        cell.setBLogPost(blogPost: searchBlogPost[indexPath.row])
    }
    else{
        cell.setBLogPost(blogPost: blogPost[indexPath.row])
    }
    cell.setBLogPost(blogPost: blogp)
    return cell
}

A: You have extra cell.setBLogPost(blogPost: blogp) in your delegate methode
  func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
      let blogp = blogPost[indexPath.row]
      let cell = tableView.dequeueReusableCell(withIdentifier: "Tavla") as! Tavla
      if searching{
          cell.setBLogPost(blogPost: searchBlogPost[indexPath.row])
      }
      else{
          cell.setBLogPost(blogPost: blogPost[indexPath.row])
      }

      return cell
  }

I think this will solve your problem and you can use
    import UIKit
import FirebaseDatabase
import Firebase

class VideoListScreen: UIViewController {

    @IBOutlet weak var tableView: UITableView!
    var blogPost: [BlogPost] = []
    var searchBlogPost = [BlogPost]()

    override func viewDidLoad() {
        super.viewDidLoad()

        blogPost = []
        createArray()
        tableView.delegate = self
        tableView.dataSource = self

    }

    func createArray() {
        let ref = Database.database().reference().child("Users")

        ref.observe(.childAdded, with: { (snapshot) in
            if let postDict = snapshot.value as? [String : String] {
                let post = BlogPost(name:postDict["name"] ?? "" , gaf: postDict["gaf"] ?? "", place: postDict["place"] ?? "", phone: postDict["phone"] ?? "", notes: postDict["notes"] ?? "", elsertext: postDict["elsertext"] ?? "")

                self.blogPost.append(post)

                self.searchBlogPost = self.blogPost
                self.tableView.reloadData()
            }
        })
    }
}

extension VideoListScreen: UITableViewDataSource, UITableViewDelegate {

    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
      return searchBlogPost.count
    }

    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let blogp = searchBlogPost[indexPath.row]
        let cell = tableView.dequeueReusableCell(withIdentifier: "Tavla") as! Tavla
        cell.setBLogPost(blogPost: blogp)
        return cell
    }
}

extension VideoListScreen: UISearchBarDelegate {
    func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) {

        if ((searchText.trimmingCharacters(in: .whitespaces).isEmpty) {
          searchBlogPost = blogPost
        } else {
          searchBlogPost = blogPost.filter({$0.name.prefix(searchText.count) == searchText})
        }

        tableView.reloadData()
    }
}

I hope this will helps.


text:
Q: CSS animation not cycling through all images My application allows the user to select any number of images for the home page hero. I'm using CSS keyframe animation to cycle through these images. My animation works great  but once it gets to the end of the animation, instead of starting over with image 1 it only shows the last 4 images over and over.
Can anyone help?

.banner-gallery img {
  position: absolute;
  animation: slideShow 24s linear infinite 0s;
  opacity: 0;
  object-fit: cover;
  width: 100vw;
  height: 100vh;
  transform: scale(1.2);
}

@keyframes slideShow {
    0% {
        opacity: 0;
        transform: scale(1);
    }
    5% {
        opacity: 1;
    }
    25% {
        opacity: 1;
    }
    30% {
        opacity: 0;
        transform: scale(1.1);
    }
    100% {
        opacity: 0;
        transform: scale(1);
  }
}

.banner-gallery img:nth-child(1) {
  animation-delay: 0s;
}
.banner-gallery img:nth-child(2) {
  animation-delay: 6s;
}
.banner-gallery img:nth-child(3) {
  animation-delay: 12s;
}
.banner-gallery img:nth-child(4) {
  animation-delay: 18s;
}
.banner-gallery img:nth-child(5) {
  animation-delay: 24s;
}
.banner-gallery img:nth-child(6) {
  animation-delay: 30s;
}
.banner-gallery img:nth-child(7) {
  animation-delay: 36s;
}
.banner-gallery img:nth-child(8) {
  animation-delay: 42s;
}
.banner-gallery img:nth-child(9) {
  animation-delay: 48s;
}
.banner-gallery img:nth-child(10) {
  animation-delay: 54s;
}

A: First of all you apply in your css more images as you have in your div container. Maybe a mistake?
Then you expect that the slideshow animation: slideShow (n)s long. But it takes longer. You have to calculate the animation-delays.  In the example below you have 8 images. every img has a animation-duration of 3 sec.  (8*3 = 24)
working example for only three images

.banner-gallery img {
  position: absolute;
  animation: slideShow 24s linear infinite 0s;
  opacity: 0;
  object-fit: cover;
  width: 100vw;
  height: 100vh;
  transform: scale(1.2);
}

@keyframes slideShow {
    0% {
        opacity: 0;
        transform: scale(1);
    }
    5% {
        opacity: 1;
    }
    25% {
        opacity: 1;
    }
    30% {
        opacity: 0;
        transform: scale(1.1);
    }
    100% {
        opacity: 0;
        transform: scale(1);
  }
}

.banner-gallery img:nth-child(1) {
  animation-delay: 0s;
}
.banner-gallery img:nth-child(2) {
  animation-delay: 3s;
}
.banner-gallery img:nth-child(3) {
  animation-delay: 6s;
}
.banner-gallery img:nth-child(4) {
  animation-delay: 9s;
}
.banner-gallery img:nth-child(5) {
  animation-delay: 12s;
}
.banner-gallery img:nth-child(6) {
  animation-delay: 15s;
}
.banner-gallery img:nth-child(7) {
  animation-delay: 18s;
}
.banner-gallery img:nth-child(8) {
  animation-delay: 21s;
}