text
stringlengths 3
1.74M
| label
class label 2
classes | source
stringclasses 3
values |
---|---|---|
LPT: Add a security freeze to your credit score to end junk mail and fraud.2. All 3 of the credit bureau have a way. Cheers | 0non-cybersec
| Reddit |
How can I filter packets from a port monitor?. <p>I have some data going from Point A to Point B. I have a SPAN monitor set up to a monitoring device C.</p>
<p>To recreate some real world scenarios, I want to filter out all traffic which is a certain type (H.323 VoIP Signaling Packets) so that C sees a subset of the information that is flowing from A to B.</p>
<p>What would the easiest way to do this be? I assume I would need a computer with 2 NIC cards and some software to examine each packet and chuck out the H.323 VoIP packets?</p>
| 0non-cybersec
| Stackexchange |
Can you help me fix an unsightly tabletop design?. My friend gave me a piece of tempered glass so I decided to build a table around it and put it on my porch. My problem is that the tabletop design is bothering me.
Here is a [picture of the completed table](http://imgur.com/ejXRAW8) (pre-paint). The bottom of the table is just 4 "post" legs with an apron around it. Then, the top is a picture frame type deal with a rabbet to hold the glass. The top sits on the base and all was supposed to be happy.
However, I don't like the way the top looks once it's on top of the base. [This is what bothers me](http://imgur.com/6W6VKC5) - it's what you see through the glass when you look down from above. The apron piece is [morticed into the outside of the leg](http://imgur.com/cTTnQJI) so I end up with an unsightly square of leg showing in each corner.
Considering I designed this on the fly and it's made out of scrap 2x6 pieces I had in a pile, I'm willing to toss the top and make another one. My problem is that I can't figure out what to do to make it better.
Anyone care to opine? Any ideas would be appreciated. | 0non-cybersec
| Reddit |
Disabling bluetooth on start not working. <p>My question is related to <a href="https://askubuntu.com/questions/67758/how-can-i-deactivate-bluetooth-on-system-startup/2568#2568">this question</a>.</p>
<p>I would like to deactivate bluetooth on start up, unfortunately the proposed solution to add:</p>
<pre><code>rfkill block bluetooth
</code></pre>
<p>to <code>/etc/rc.local</code> before <code>exit 0</code> does not work on my Acer aspire 1810TZ running Ubuntu 13.10 with an Intel advanced wifilink N-6235.</p>
<p>Neither does the suggested solution for Thinkpad laptops.</p>
<p>What does work is to add:</p>
<pre><code>/etc/init.d/bluetooth stop
</code></pre>
<p>to <code>/etc/rc.local</code>, but this disables the bluetooth applet, which I need to enable the bluetooth easily when I want to use bluetooth.</p>
<p>So the question is why doesn't <code>rfkill block bluetooth</code> work and how do I make it work again?</p>
<p>Thanks!</p>
| 0non-cybersec
| Stackexchange |
Why does the Riemann zeta function have non-trivial zeros?. <p>This is a very basic question of course, and exposes my serious ignorance of analytic number theory, but what I am looking for is a good intuitive explanation rather than a formal proof (though a sufficiently short formal proof could count as an intuitive explanation). So, for instance, a proof that estimated a contour integral and thereby showed that the number of zeros inside the contour was greater than zero would not count as a reason. A brief glance at Wikipedia suggests that the Hadamard product formula could give a proof: if there are no non-trivial zeros then you get a suspiciously nice formula for ζ(s) itself. But that would feel to me like formal magic. A better bet would probably be Riemann's explicit formula, but that seems to require one to know something about the distribution of primes. Perhaps a combination of the explicit formula and the functional equation would do the trick, but that again leaves me feeling as though something magic has happened. Perhaps magic is needed.</p>
<p>A very closely related question is this. Does the existence of non-trivial zeros on the critical strip imply anything about the distribution of prime numbers? I know that it implies that the partial sums of the Möbius and Liouville functions cannot grow too slowly, and it's really this that I want to understand. </p>
| 0non-cybersec
| Stackexchange |
arXiv:math/9809077v1 [math.CO] 15 Sep 1998
ar
X
iv
:m
at
h/
98
09
07
7v
1
[
m
at
h.
C
O
]
1
5
S
ep
1
99
8 Infinite cyclic impartial games
Aviezri S. Fraenkel1 and Ofer Rahat2
Department of Applied Mathematics and Computer Science
Weizmann Institute of Science
Rehovot 76100, Israel
Abstract. We define the family of locally path-bounded digraphs, which is a class
of infinite digraphs, and show that on this class it is relatively easy to compute an
optimal strategy (winning or nonlosing); and realize a win, when possible, in a finite
number of moves. This is done by proving that the Generalized Sprague-Grundy
function exists uniquely and has finite values on this class.
1. Introduction
We are concerned with combinatorial games , which, for our purposes here, com-
prise 2-player games with perfect information, no chance moves and outcome re-
stricted to (lose, win), (draw, draw) for the two players. A draw position is a
position in the game such that no win is possible from it, but there exists a next
move which guarantees, for the player making it, not to lose. You win a game
by making a last move in it. A game is impartial if for every position in it, both
players have the same set of next moves; otherwise it’s partizan. Nim is impartial,
chess partizan. A game is cyclic if it contains cycles (the possibility of returning to
the same position), or loops (pass-positions). These notions, slightly changed here,
can be found in [BCG82]. It is clear that a necessary (yet not sufficient) condition
for the existence of draw positions is that the game be cyclic.
For Partizan cyclic games, see [Con78], [Sha79], [Fla81], [FrTa82], [Fla83]; finite
impartial cyclic games are discussed only briefly in [BCG82], [Con76]. Particular
finite impartial cyclic games are analysed in [FrTa75], [FrKo87]. Infinite impar-
tial games are treated briefly at the end of [Smi66], where both the “generalized
Sprague-Grundy function” γ, defined below, and its associated “counter function”
were permitted to be transfinite ordinals.
Our purpose here is to define a certain class of infinite digraphs on which γ as-
sumes only finite values, but the counter function may contain transfinite ordinal
[email protected] http://www.wisdom.weizmann.ac.il/~fraenkel
[email protected]
c©1997 American Mathematical Society
1
http://arxiv.org/abs/math/9809077v1
http://www.wisdom.weizmann.ac.il/~fraenkel
2
values. The motivation for doing this is based, in part, on the following consid-
erations. It is easier to compute with finite than with transfinite ordinals. Often
the structure of the digraph is such that the γ-function itself suffices to provide a
winning strategy, without the need of an additional counter function (§4). The γ-
function always provides at least a nonlosing strategy; it’s for consummating a win
that the counter function may be needed. For consummating a win the “general-
ized Nim-sum” of a finite set of γ-values is required (§4). The generalized Nim-sum
is based on the binary expansion of ordinals. It’s easy to see that every ordinal,
finite or transfinite, has a unique expansion as a finite sum of powers of ordinals
(based on the greedy algorithm and the fact that the ordinals are well-ordered —
see [Sie58 XIV, §19]). For example, ω = 2ω. We do not wish to enter here into
the question of the computational complexity of computing with transfinite ordi-
nals. But it seems possible that it’s easier to compare the size of ordinals with each
other, which suffices for counter function values, than to compute and work with
their binary expansions, as needed for the γ-values.
The connection between games and digraphs is simple: with any impartial game
Γ we associate a digraph G = (V,E) where V is the set of positions of Γ and
(a, b) ∈ E if and only if there is a move from position a to position b. It is called
the game-graph of Γ. We identify games with their corresponding game-graphs,
game positions with digraph vertices and game moves with digraph edges, using
them interchangeably. It is thus natural to define a cyclic digraph as a digraph,
finite or infinite, which may contain cycles or loops.
In §2 we provide basic tools needed for the statement and proof of the result
(Theorem 1), and §3 contains the proof. An example demonstrating Theorem 1 is
given in the final §4.
2. Preliminaries
The subset of nonnegative integers is denoted by Z0, and the subset of positive
integers by Z+.
Given a digraph G = (V,E). For any vertex u ∈ V , the set of followers of
u is F (u) = {v ∈ V : (u, v) ∈ E}. A vertex u with F (u) = ∅ is a leaf. The
set of predecessors of u is F−1(u) = {w ∈ V : (w, u) ∈ E}. A walk in G is any
sequence of vertices u1, u2, . . . , not necessarily distinct, such that (ui, ui+1) ∈ E,
i.e., ui+1 ∈ F (ui) (i ∈ Z
+). Edges may be repeated. A path is a walk with all
vertices distinct. In particular, there’s no repeated edge in a path. The length of
a path is the number of its edges. If every path in G has finite length, then G is
called path-finite. If there exists b ∈ Z0 such that every path in G has length ≤ b,
then G is path-bounded.
Definition 1. A cyclic digraph is locally path-bounded if for every vertex ui there
is a bound bi(ui) = bi ∈ Z
0 such that the length of every (directed) path emanating
from ui doesn’t exceed bi. The integer bi is the local path bound of ui.
Note that every path-bounded digraph is locally path-bounded, and every locally
path-bounded digraph is path-finite. But neither of the two inverse relationships
needs to hold. Our main result is concerned with locally path-bounded digraphs.
Given a digraph G = (V,E). The Generalized Sprague-Grundy function, also
called γ-function, is a mapping γ:V → Z0 ∪ {∞}, where the symbol ∞ indicates a
value larger than any natural number. If γ(u) = ∞, we say that γ(u) is infinite. We
wish to define γ also on certain subsets of vertices. Specifically: γ
(
F (u)
)
=
{
γ(v) <
3
∞: v ∈ F (u)
}
. If γ(u) = ∞ and γ
(
F (u)
)
= K, we also write γ(u) = ∞(K). Next
we define equality of γ(u) and γ(v): if γ(u) = k and γ(v) = ℓ then γ(u) = γ(v) if
one of the following holds: (a) k = ℓ < ∞; (b) k = ∞(K), ℓ = ∞(L) and K = L.
We also use the notations
V f =
{
u ∈ V : γ(u) < ∞
}
, V∞ = V \ V f ,
where for any finite subset S ⊂ Z0, the Minimum EXcluded value mex is defined
by
mexS = min(Z0 \ S) = minimum term in Z0 not in S.
It is also convenient to introduce the notation
(1) γ′(u) = mex γ
(
F (u)
)
= mex{γ(v) < ∞ : v ∈ F (u)}.
We need some device to tell the winner where to go when we use the γ-function.
For example, suppose that there is a token on vertex u (Fig. 1). It turns out that
it’s best for the player moving now to go to a position with γ-value 0. There are two
such values: one (the leaf) is an immediate win, and the other (v) is only a nonlosing
move. This digraph may be embedded in a large digraph where it’s not clear which
option leads to a win. The device which overcomes this problem is a counter
function, as used in the following definition. For realizing an optimal strategy, we
will normally select a follower of least counter function value with specified γ-value.
The counter function also enables us to prove assertions by induction.
Definition 2. Given a cyclic digraph G = (V,E). A function γ:V → Z0 ∪ {∞} is
a γ-function with counter function c:V f → J , where J is any infinite well-ordered
set, if the following three conditions hold:
A. If γ(u) < ∞, then γ(u) = γ′(u).
B. If there exists v ∈ F (u) with γ(v) > γ(u), then there exists w ∈ F (v)
satisfying γ(w) = γ(u) and c(w) < c(u).
C. If γ(u) = ∞, then there is v ∈ F (u) with γ(v) = ∞(K) such that γ′(u) /∈ K.
Remarks.
• In B we have necessarily u ∈ V f ; and we may have γ(v) = ∞ as in C.
• To make condition C more accessible, we state it also in the following equiv-
alent form:
C’. If for every v ∈ F (u) with γ(v) = ∞ there is w ∈ F (v) with γ(w) =
γ′(u), then γ(u) < ∞.
• If conditionC’ is satisfied, then γ(u) < ∞, and so byA, γ(w) = γ′(u) = γ(u).
• To keep the notation simple, we write ∞(0), ∞(1), ∞(0, 1) etc., for ∞({0}),
∞({1}), ∞({0, 1}), etc.
The γ-function was first defined in [Smi66]. It was found independently in
[FrPe75]. The simplified version given above, and two other versions, appear in
[FrYe86]. Since this function is not well-known, we repeated its definition above.
The γ-function exists uniquely on any finite cyclic digraph, but its associated
counter function exists nonuniquely. Here and below, when we discuss the exis-
tence of γ, we mean its existence as a finite ordinal (besides the special value ∞).
We are now ready to state our main result.
4
Theorem 1. Every locally path-bounded digraph G = (V,E) has a unique γ-
function with an associated counter function; and for every u ∈ V f , γ(u) doesn’t
exceed the length of a longest path emanating from u.
3. The Proof
We wish to examine some properties of path-finite and locally path-bounded
digraphs. To begin with, is it clear that for a path-finite digraph, if v ∈ F (u), then
every path emanating from v is not longer than any path emanating from u?
Perhaps it is clear, but it’s also wrong: in a path-finite graph, every path origi-
nating at some vertex u and continuing to its ultimate end, terminates at a vertex
v, where v is either a leaf or a predecessor of some w on the path. Thus a path
of minimum length emanating from u in Fig. 1 terminates at the leaf, whereas a
path of maximum length beginning at u terminates at y. It has length 3. But a
maximal-length path emanating from v ∈ F (u) clearly has length 4.
u
y
v
0
1
0
1
0
Figure 1. The numbers are γ-values.
However, having embarked on a path u0, u1, . . . , un of maximum length n, the
maximum path length from any vertex ui encountered on it is n− i (0 ≤ i ≤ n).
If a digraph G = (V,E), possibly with infinite paths, has no leaf, then the label
∞ on all the vertices is evidently a γ-function: A and B are satisfied vacuously, and
C is satisfied with γ′(u) = 0 for all u ∈ V . If G has a leaf, then some of the vertices
have a γ-function, such as the leaf and its predecessors, but possibly γ doesn’t exist
on some of the vertices. For the case where γ exists on a subset V ′ ⊆ V , we define
γ′(u) = mex{γ(F (u)) : F (u) ⊆ V ′}. Since F (u) may, nevertheless, be infinite for
any vertex u in a locally path-bounded digraph, it is not clear a priori that γ′(u)
exists. The following lemma takes care of this point.
Lemma 1. Let u be any vertex with local path bound b in a locally path-bounded
digraph G = (V,E). Then γ′(u) exists (i.e., it is a nonnegative integer), and in
fact, γ′(u) ≤ b.
Proof. We consider two cases.
(i) Suppose that u has finite γ-value m. Then γ′(u) exists, and in fact, γ′(u) =
γ(u) = m by A. Moreover, there exists u1 ∈ F (u) with γ(u1) = m− 1, there exists
u2 ∈ F (u1) with γ(u2) = m− 2, . . . , there exists um ∈ F (um−1) with γ(um) = 0.
Then u, u1, . . . , um is a path of length m, so m ≤ b. (The path may continue
beyond um, but in any case γ
′(u) = m ≤ b.)
5
(ii) Suppose that u has either no γ-value or value ∞. It suffices to show that if
v ∈ F (u)∩V f , then γ(v) < b. Indeed, |F (u)| may be infinite, and F (u) may contain
vertices with no γ-value. But if γ(v) < b for all v ∈ F (u) ∩ V f , then clearly γ′(u)
exists and γ′(u) ≤ b. Note that we cannot use the argument of case (i) directly
on v, since a path from v may be longer than a path from u, as we just saw. So
suppose there is v0 ∈ F (u) ∩ V
f with γ(v0) = n ≥ b. As in case (i), there is a path
v0, v1, . . . , vn of length n with γ(vi) = n− i (i ∈ {0, . . . , n}). Then u, v0, v1, . . . , vn
is a walk of length n + 1 > b emanating from u. Hence it cannot be a path. But
vi 6= vj for all i 6= j, since γ(vi) 6= γ(vj). Hence vj = u for some j ∈ {0, . . . , n}.
The contradiction is that vj does and u doesn’t have a finite γ-value. Thus γ(v) < b
for all v ∈ F (u) ∩ V f , hence γ′(u) exists, and in fact, γ′(u) ≤ b. �
Proof of Theorem 1. Let V ′ ⊆ V be a maximal subset of vertices on which
γ exists, together with an associated counter function c, subject to the following
additions to B and C of Definition 2:
(2) If γ(u) < ∞ and there is v ∈ F (u) ∩ Vν ,
then there is w ∈ F (v) with γ(w) = γ(u), c(w) < c(u),
(3) if γ(u) = ∞, then there is v ∈ F (u) with γ(v) = ∞
such that w ∈ F (v) ∩ Vν =⇒ γ
′(w) 6= γ′(u),
where Vν = V \ V
′. (In (3) we have γ′(w) 6= γ′(u), instead of w ∈ F (v) and
γ(w) 6= γ′(u) in C.) In addition we require:
(4) If γ(u) = ∞ with γ′(u) = l, then γ′(v) ≥ l for all v ∈ Vν .
The subset V ′ is maximal in the sense that adjoining any u ∈ Vν into V
′ violates
either Definition 2, or (2) or (3) or (4). If Vν 6= ∅, let u ∈ Vν . By Lemma 1, γ
′(u) = k
exists for some k ∈ Z0. It follows that there is a minimum value m = min{k ∈ Z0 :
u ∈ Vν , γ
′(u) = k}. Let K = {u ∈ Vν : γ
′(u) = m}. Then Vν 6= ∅ =⇒ K 6= ∅. We
consider four cases.
Case 1. For every u ∈ K we have m ∈ γ′(F (u)), where, consistent with (1),
γ′(F (u)) = {γ′(v) : v ∈ F (u)} = {mex γ(F (v)) : v ∈ F (u)}
= {mex{γ(w) < ∞ : w ∈ F (v), v ∈ F (u)}}.
Note that u ∈ K, v ∈ F (u) =⇒ γ(v) 6= m by the definition of mex, so v ∈ F (u),
γ′(v) = m =⇒ v ∈ Vν , in fact, v ∈ K. Thus putting γ(u) = ∞ for all u ∈ K
satisfies C, and is also consistent with (3); and with (4) by the minimality of m.
Furthermore, it doesn’t violate A, and is consistent with B by (2). This contradicts
the maximality of V ′.
We may thus assume henceforth that there exists u ∈ K such that
(5) m /∈ γ′(F (u)).
Case 2. There exist u ∈ K and v ∈ F (u) with γ(v) = ∞, such that for every
w ∈ F (v), either γ(w) 6= m, or w ∈ Vν with γ
′(w) 6= m. Putting γ(u) = ∞ is
6
clearly consistent with C, and (3); and it doesn’t violate A. In view of (2), also B
is satisfied. This contradicts the maximality of V ′. So we may assume that
∀u ∈ K and ∀v ∈ F (u) with γ(v) = ∞,
∃w ∈ F (v) (with γ(w) = m or w ∈ Vν with γ
′(w) = m).
We subdivide this into the following two cases:
(6) ∃u ∈ K such that ∀v ∈ F (u) with γ(v) = ∞,
∃w ∈ F (v) with γ(w) = m,
or
(7) ∀u ∈ K and ∀v ∈ F (u) with γ(v) = ∞,
∃ no w ∈ F (v) ∩ V ′, but ∃w ∈ F (v) ∩ Vν with γ
′(w) = m.
Case 3. (6) holds. We repeat that for any u ∈ K, since γ′(u) = m, u has no
follower with γ-value m. Suppose that there exists y ∈ F−1(u) with γ(y) = m.
Then by (2), there exists v ∈ F (u) with γ(v) = m, contradicting γ′(u) = m. Thus
putting γ(u) = m is consistent with A. It is also consistent with (3): putting
γ(u) = m could presumably increase γ′(y) for some y ∈ F−1(u) ∩ Vν , and thus
upset (3) for the value γ(z) = ∞ of some grandparent z = F−1(F−1(y)) of y. Now
by (4), γ′(u) ≥ γ′(z). If indeed γ′(y) increased, then for the new value we have
γ′(y) > γ′(u), so γ′(y) > γ′(z) and γ(z) = ∞ remains unaffected. Consistency
with C thus follows from (3) which becomes C when u is labeled m. Since y ∈
F−1(u) =⇒ γ(y) 6= m, as we saw at the beginning of this case, the potential
adverse effect on any grandparent z of y considered above, cannot happen.
We now show that also B holds. Suppose first that F (u) ⊆ V ′. For every
v ∈ F (u) for which γ(v) > m, there exists w ∈ F (v) with γ(w) = m. This follows
from A if γ(v) < ∞, and from (6) if γ(v) = ∞. It remains to define c(u) sufficiently
large so that c(w) < c(u). This will be done below.
In view of the minimality of m and by (5), the second possibility is that for
every v ∈ F (u) for which v ∈ Vν , we have γ
′(v) > m. For every such v there exists
w ∈ F (v) with γ(w) = m by the definition of mex. Again we have to define c(u)
sufficiently large to satisfy c(w) < c(u).
Let S = {v ∈ F (u) : γ(v) > m} ∪ {v ∈ F (u) : v ∈ Vν , γ
′(v) > m}. We
have just seen that for every v ∈ S there is w ∈ F (v) with γ(w) = m. Put
T = {w ∈ F (v) : v ∈ S, γ(w) = m}. Let c(u) be the smallest ordinal > c(w) for all
w ∈ T . Then also B is satisfied. This contradicts the presumed maximality of V ′.
Note that the case F (u) ⊆ V \V∞ satisfies (6) vacuously, and so is also included
in the present case.
Case 4. (7) holds. If (7) holds nonvacuously, then as in Case 1, putting γ(u) =
∞ for all u ∈ K is consistent with C, (3) and the other conditions. This contradicts
again the maximality of V ′. Hence K = ∅, and so also Vν = ∅.
Whenever γ exists on a digraph, finite or infinite, it exists there uniquely. See
[Fra≥99]. Finally, if b is the local bound of u ∈ V , then γ′(u) ≤ b by Lemma 2.
Hence if u ∈ V f , then γ(u) ≤ b by A. �
7
4. An Example
We specify below a locally path-bounded digraph G = (V,E) on some of whose
vertices we place a finite number of tokens. A move consists of selecting a token and
moving it to a follower. Multiple occupancy of vertices is permitted. The player
first unable to move loses, and the opponent wins. If there is no last move, the
outcome is a draw.
For any r ∈ Z0, a Nim-heap of size r is a digraph with vertices u0, . . . , ur and
edges (uj, ui) for all 0 ≤ i < j ≤ r. In depicting G (Fig. 2), we use the convention
that bold lines and the vertices they connect constitute a Nim-heap, of which only
adjacent (bold) edges are shown, to avoid cluttering the drawing. Thin lines denote
ordinary edges.
All the horizontal lines are thin, and each vertex ui on this horizontal line
connects via a vertical thin edge to a Nim-heap Gi pointing downwards, of size
⌊(4i + 8)/3⌋, i ∈ Z0. From ui there also emanates a Nim-heap Hj of size j =
⌊(i + 2)/3⌋ pointing upward. Each Gi has a back edge to its top vertex forming a
cycle of length i + 1. Thus G0 has a loop at the top of its Nim-heap (of size 2).
There is an additional back edge to the vertex ui on the horizontal line, forming a
cycle of length i + 3.
From any vertex u on the horizontal line there is a longest path, via Gi, of length
⌊(4i+11)/3⌋, and the other vertices have shorter maximal length. Thus G is locally
path-bounded. But it is not path-bounded, since i can be arbitrarily large.
Sample Problem. Compute an optimal strategy for the 5-token game placed
on the 5 starred vertices of G.
To solve this problem, we introduce the generalized Nim-sum ([Smi66], [FrYe86],
[Fra≥99]). For any nonnegative integer h we write h =
∑
i≥0
hi2i for the binary
encoding of h (hi ∈ {0, 1}). If a and b are nonnegative integers, then their Nim-
sum a⊕ b = c, also called exclusive or, XOR, or addition over GF(2), is defined by
ci ≡ ai + bi (mod 2), ci ∈ {0, 1} (i ≥ 0).
The Generalized Nim-sum of a nonnegative integer a and ∞(L), for any finite
subset L ⊂ Z0, is defined by a ⊕ ∞(L) = ∞(L) ⊕ a = ∞(L ⊕ a), where L ⊕ a =
{ℓ ⊕ a: ℓ ∈ L}. The Generalized Nim-sum of ∞(L1) and ∞(L2), for any finite
subsets L1, L2, is defined by ∞(L1) ⊕∞(L2) = ∞(L2) ⊕∞(L1) = ∞(∅). Clearly
the Generalized Nim-sum is associative and a⊕ a = 0 for every a.
Given any finite or infinite game Γ, we say informally that a P -position is any
position u from which the Previous player can force a win, that is, the opponent of
the player moving from u. An N -position is any position v from which the Next
player can force a win, that is, the player who moves from v. A D-position is any
position u from which neither player can force a win, but has a nonlosing next move.
The set of all P -, N - and D-positions is denoted by P , N and D respectively.
For any finite multiset u = (u1, . . . , un) of vertices of G on which tokens reside,
one token on each ui, we then have the result [Fra≥99]:
Proposition. The P -, N - and D-labels of u = (u1, . . . , un) in any locally path-
bounded digraph G are given by
P = {u ∈ V :σ(u) = 0}, D = {u ∈ V :σ(u) = ∞(K), 0 /∈ K}
N = {u ∈ V : 0 < σ(u) < ∞} ∪ {u ∈ V :σ(u) = ∞(K), 0 ∈ K}. �
8
0
0 0 0
0 0 0
0
0
0
0
0
0
0
0
0
1
1 1 1
1
1
1
1
1
1
1
1
11
2
2
2
2
2
2
2 23
3
4
∞
∞
∞
∞
∞ ∞
∞
3
3
∞
∞
∞
∞
∞
∞
∞
∞
∞
∞
∞
∞
∞ ∞
∞
∞
∞
∞
∞
∞
∞
∞
∞
∞
∞
∞
∞
∞
∞
∞ ∞
∞∞
G0
G1
G2
G3
G4
G5
G6
H2 H2 H2
H1 H1 H1
G7
H3
*
*
*
*
*
Figure 2. The tail-end of a locally path-bounded digraph.
We are now ready to solve the above problem, by observing that the symbols
appearing on Fig. 2 are the γ-values of G. Simply check that they satisfy the
conditions of Definition 2. In particular, B of Definition 2 is satisfied if every
vertex on the horizontal line with γ-value < ∞ gets a counter-value between ω and
ω2, and every vertex in the Nim-heaps with γ-value < ∞ is assigned a counter
value < ω, which is clearly feasible.
For the 5 starred vertices we then have 1 ⊕ 3 ⊕ 2 ⊕ 4 ⊕ ∞(0, 1, 2, 3, 4) = 4 ⊕
∞(0, 1, 2, 3, 4) = ∞(4, 5, 6, 7, 0), which contains 0, hence the position is in N . Thus
the player moving from this position can win by going to a position of Nim-sum 0,
namely, pushing the token on the infinity label to 4. Indeed the resulting Nim-sum
is 1⊕ 3⊕ 2⊕ 4⊕ 4 = 0.
We remark that any tokens on two vertices with γ-value ∞ is a draw position,
no matter where the other tokens are, if any. Also note that for realizing a win in
this game we do not really need a counter function.
9
Epilogue
We have defined locally path-bounded digraphs, and shown that the generalized
Sprague-Grundy function γ exists on such digraphs with finite, though not necessar-
ily bounded, values. Of course local path-boundedness is only a sufficient condition
for the existence of γ. Any finite or infinite digraph without a leaf, satisfies trivially
γ(u) = ∞ for all its vertices u.
A large part of combinatorial game theory is concerned, however, with digraphs
which do have leaves. If we exclude digraphs without leaves, then Theorem 1 is, in
a sense, best possible.
Consider the digraph G which consists of a vertex u, and F (u) = {u0, u1, . . . },
where, for all i ∈ Z0, ui is the top vertex of a Nim-heap of size i, so γ(ui) = i. Any
path emanating from u has the form u, ui, . . . for some i; its length is i+ 1. Paths
not emanating from u are shorter. Thus G is path-finite. But γ(F (u)) = {0, 1, . . .},
so γ(u) cannot assume any finite value.
References
1. [BCG82] E. R. Berlekamp, J. H. Conway and R. K. Guy [1982], Winning
Ways (two volumes), Academic Press, London.
2. [Con76] J. H. Conway [1976], On Numbers and Games , Academic Press,
London.
3. [Con78] J. H. Conway [1978], Loopy Games, Ann. Discrete Math. 3: Proc.
Symp. Advances in Graph Theory, Cambridge Combinatorial Conf. (B. Bollobás,
ed.), Cambridge, May 1977, pp. 55–74.
4. [Fla81] J. A. Flanigan [1981], Selective sums of loopy partizan graph games,
Internat. J. Game Theory 10, 1–10.
5. [Fla83] J. A. Flanigan [1983], Slow joins of loopy games, J. Combin. Theory
(Ser. A) 34, 46–59.
6. [Fra≥99] A. S. Fraenkel [≥1999], Adventures in Games and Computational
Complexity, to appear in Graduate Studies in Mathematics, Amer. Math. Soc.,
Providence, RI.
7. [FrKo87] A. S. Fraenkel and A. Kotzig [1987], Partizan octal games: partizan
subtraction games, Internat. J. Game Theory 16, 145–154.
8. [FrPe75] A. S. Fraenkel and Y. Perl [1975], Constructions in combinatorial
games with cycles, Coll. Math. Soc. János Bolyai , 10: Proc. Internat. Colloq. on
Infinite and Finite Sets, Vol. 2 (A. Hajnal, R. Rado and V. T. Sós, eds.) Keszthely,
Hungary, 1973, North-Holland, pp. 667–699.
9. [FrTa75] A. S. Fraenkel and U. Tassa [1975], Strategy for a class of games
with dynamic ties, Comput. Math. Appl. 1, 237–254.
10. [FrTa82] A. S. Fraenkel and U. Tassa [1982], Strategies for compounds of
partizan games, Math. Proc. Camb. Phil. Soc. 92, 193–204.
11. [FrYe86] A. S. Fraenkel and Y. Yesha [1986], The generalized Sprague-
Grundy function and its invariance under certain mappings, J. Combin. Theory
(Ser. A) 43, 165–177.
12. [Sha79] A. S. Shaki [1979], Algebraic solutions of partizan games with cycles,
Math. Proc. Camb. Phil. Soc. 85, 227–246.
13. [Sie58] W. Sierpiński [1958], Cardinal and Ordinal Numbers , Hafner, New
York.
10
14. [Smi66] C. A. B. Smith [1966], Graphs and composite games, J. Combin.
Theory 1, 51–81. Reprinted in slightly modified form in: A Seminar on Graph
Theory (F. Harary, ed.), Holt, Rinehart and Winston, New York, NY, 1967.
| 0non-cybersec
| arXiv |
This is the proper way to pickup a Cat. Watch and Learn everyone.. | 0non-cybersec
| Reddit |
Out of mind: philosopher Patricia Churchland’s radical approach to the study of human consciousness. | 0non-cybersec
| Reddit |
Swift NSCoding Not working. <p>I'm having trouble using <code>NSCoding</code> in Swift. I have attempted to implement the protocol but I get a crash whenever I call my <code>save()</code> method. Xcode pulls me up on the line in <code>encodeWithCoder</code>. Here's my code, any suggestions would go along way.</p>
<pre><code>class CourseList: NSObject, NSCoding {
...
init(coder aDecoder: NSCoder!){
super.init()
if aDecoder != nil {
self.courses = aDecoder.decodeObjectForKey("courses") as Dictionary<String,course>
}
}
func encodeWithCoder(aCoder: NSCoder!) {
aCoder!.encodeObject(self.courses, forKey: "courses") // EXC_BAD_INSTRUCTOIN
}
}
</code></pre>
<p>I wrote <code>save()</code> and <code>load()</code> to call in a <code>ViewController</code>.</p>
<pre><code>func save() {
var archivedObject = NSKeyedArchiver.archivedDataWithRootObject(History) //NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
var defaults = NSUserDefaults.standardUserDefaults() //[defaults setObject:archivedObject forKey:<key_for_archived_object>];
defaults.setObject(History.courses, forKey: "courses")
defaults.synchronize()
}
func load() {
var defaults = NSUserDefaults.standardUserDefaults() // NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
var archivedObject = defaults.objectForKey("courses") as NSData // NSData *archivedObject = [defaults objectForKey:<key_for_archived_object>];
History = NSKeyedUnarchiver.unarchiveObjectWithData(archivedObject) as Dictionary<String,course> //<your_class> *obj = (<your_class> *)[NSKeyedUnarchiver unarchiveObjectWithData:archivedObject];
}
</code></pre>
| 0non-cybersec
| Stackexchange |
Functions with $\mathrm s(x)^n+ \mathrm c(x)^n \equiv 1$. <p>I came across a very nice <a href="https://www.admissionstesting.org/for-test-takers/step/preparing-for-step/" rel="noreferrer">STEP question</a> - Q8, STEP 1, 2018.</p>
<p>It assumed the existence of function <span class="math-container">$\mathrm s(x)$</span> and <span class="math-container">$\mathrm c(x)$</span> with the properties that <span class="math-container">$\mathrm s(0)=0$</span>, <span class="math-container">$\mathrm c(0)=1$</span>, <span class="math-container">$\mathrm s'(x) = \mathrm c(x)^2$</span> and <span class="math-container">$\mathrm c'(x)=-\mathrm s(x)^2$</span>. </p>
<p>This leads immediately to familiar formulae like <span class="math-container">$\mathrm s(x)^3+\mathrm c(x)^3 \equiv 1$</span>.</p>
<p>These hypothetical functions can then be used, for example, to show that
<span class="math-container">$$ \int \frac{\mathrm du}{(1-u^3)^{4/3}} = \frac{u}{(1-u^3)^{1/3}}+K$$</span></p>
<p>These hypothetical functions can also be used, for example, to show that
<span class="math-container">$$\int (1-u^3)^{1/3}~\mathrm du = \frac{1}{2}\mathrm s^{-1}(u)+\frac{1}{2}u(1-u^3)^{1/3} + K$$</span></p>
<p>I have a few questions:</p>
<ul>
<li><p>Are their names for these functions <span class="math-container">$\mathrm s$</span> and <span class="math-container">$\mathrm c$</span>?</p></li>
<li><p>How do we prove the existence/continuity/differentiability of such functions?</p></li>
<li><p>Are their function with <span class="math-container">$\mathrm s'(x) = \mathrm c(x)^{n-1}$</span>, <span class="math-container">$\mathrm c'(x) = -\mathrm s(x)^{n-1}$</span></p></li>
<li><p>Do they have names?</p></li>
<li><p>How effective can it be to posit the existence of hypothetical functions which help to simplify integration?</p></li>
</ul>
| 0non-cybersec
| Stackexchange |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange |
Happened to a friend of a friend, drunk driver hit her and left her for dead. She's still alive but a fair bit of damage has been done.. | 0non-cybersec
| Reddit |
MySQL query very slow on Amazon RDS but really fast on my laptop?. <p>I would love to know if anybody knows why this is happening. i've just migrated over to Amazon RDS for our website and our biggest query which takes .2 seconds to execute on my macbook takes 1.3 seconds to execute on the most expensive RDS instance.</p>
<p>Obviously i've disabled query cache (and tested this) on my local computer and both databases are exactly the same. InnoDB, both have the same indexes etc. It's costing us a fortune ($2000 per month) for the fastest RDS instance and i'm losing faith quickly. any ideas?</p>
| 0non-cybersec
| Stackexchange |
Why is my Backbone.js error callback being called even though Rails is supposedly returning a success response?. <p>I am using Backbone.js (version 0.5.3) and am having some trouble with a success callback when <a href="http://documentcloud.github.com/backbone/#Model-save" rel="nofollow noreferrer">saving a model</a>. It isn't being run, even though the model is successfully saved on the server.</p>
<p>CoffeeScript:</p>
<pre><code>console.log 'in switch_private'
console.log "private_entry attribute is currently #{@model.get('private_entry')}"
@model.save {'private_entry': true},
success: ->
console.log 'in success'
</code></pre>
<p>Compiled Javascript:</p>
<pre><code>console.log('in switch_private');
console.log("private_entry attribute is currently " + (this.model.get('private_entry')));
return this.model.save({
'private_entry': true
}, {
success: function() {
return console.log('in success');
}
});
</code></pre>
<p>Console output:</p>
<pre><code>in switch_private
private_entry attribute is currently false
XHR finished loading: "http://localhost:3000/entries/235".
</code></pre>
<p>I am returning <code>head :ok</code> from the update action in Ruby on Rails.</p>
<p>Adding the model and response arguments, so that it's <code>success: (model, response) -></code>, doesn't make a difference. What is going wrong?</p>
<p>EDIT:
As per Trevor Burnham's suggestion, I added an error callback, and it is being run. So what should I be returning from the Ruby on Rails action in order for Backbone to consider the save a success? At the moment I have <code>head :ok</code></p>
<p>EDIT 2: Here is my updated compiled Javascript:</p>
<pre><code>var this_view;
this_view = this;
return this.model.save({
'private_entry': !(this.model.get('private_entry'))
}, {
success: function(model, response) {
return console.log('in success');
},
error: function(model, response) {
return console.log('in error');
}
});
</code></pre>
<p>Here is the PUT request:</p>
<p><img src="https://i.stack.imgur.com/gfkcF.png" alt="enter image description here"></p>
| 0non-cybersec
| Stackexchange |
Calling a port after view is updated in Elm. <p>Is there a straightforward way to have a <code>Cmd</code> execute after the view is updated? In particular, I’m trying to reposition the cursor in a <code>textarea</code> upon specific keys (like the enter key) being pressed. In my <code>update</code> function I have:</p>
<pre><code>case keyboardEvent.key of
"Enter" ->
( modelAfterEnterPressed model keyboardEvent.selectionStart, setCursor model.cursor )
"Tab" ->
....
</code></pre>
<p>My <code>setCursor</code> port is called and the corresponding JavaScript code calls the <code>textarea</code>‘s <code>setSelectionRange</code> function properly. And <em>then</em> Elm calls my <code>view</code> function which updates the <code>textarea</code>‘s content. Unfortunately, that wipes out my cursor position.</p>
<p>I need for the <code>textarea</code>‘s content to be updated <em>before</em> calling <code>textarea.setSelectionRange()</code> in my JavaScript port. Any way to do this without resorting to <code>setTimeout</code> which might not always work and can cause flashes within the timeout?</p>
| 0non-cybersec
| Stackexchange |
Rare endangered parrot mates with photographer's head. (x post r/animalsbeingjerks). | 0non-cybersec
| Reddit |
Childish Gambino just released the whole "Awaken, My Love!" on his youtube channel!!!!. | 0non-cybersec
| Reddit |
Not Key Value Coding Compliant (Monotouch and iOS 6). <p>I just upgraded my Monotouch to 6 and now my app won't start. It was working formerly without any issues. Now it throws an exception (listed below) in the Main.cs file. I've looked through the troubleshooting tips on Xamarin, but it didn't resolve the issue. I've re-layed out the nib file, removed and re-configured my outlets, and have create an entirely new nib to see if that would remedy the problem. Does anybody else have any thoughts?</p>
<pre><code>MonoTouch.Foundation.MonoTouchException: Objective-C exception thrown. Name: NSUnknownKeyException Reason: [<UIApplication 0xc84bb10> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key btnNewAccount.
at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0004c] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:38
at Pokr.Application.Main (System.String[] args) [0x00000] in /Users/James/Projects/App/Main.cs:17
</code></pre>
<p>Code from the LoginView.designer.cs:</p>
<pre><code>[Register ("LoginView")]
partial class LoginView
{
[Outlet]
MonoTouch.UIKit.UIImageView imgLogo { get; set; }
[Outlet]
MonoTouch.UIKit.UITextField txtEmail { get; set; }
[Outlet]
MonoTouch.UIKit.UITextField txtPassword { get; set; }
[Outlet]
MonoTouch.UIKit.UIButton btnLogin { get; set; }
[Outlet]
MonoTouch.UIKit.UIButton btnNewAccount { get; set; }
[Outlet]
MonoTouch.UIKit.UILabel lblSecurityNotice { get; set; }
[Outlet]
MonoTouch.UIKit.UIImageView imgKeyboardBorder { get; set; }
void ReleaseDesignerOutlets ()
{
if (imgLogo != null) {
imgLogo.Dispose ();
imgLogo = null;
}
if (txtEmail != null) {
txtEmail.Dispose ();
txtEmail = null;
}
if (txtPassword != null) {
txtPassword.Dispose ();
txtPassword = null;
}
if (btnLogin != null) {
btnLogin.Dispose ();
btnLogin = null;
}
if (btnNewAccount != null) {
btnNewAccount.Dispose ();
btnNewAccount = null;
}
if (lblSecurityNotice != null) {
lblSecurityNotice.Dispose ();
lblSecurityNotice = null;
}
if (imgKeyboardBorder != null) {
imgKeyboardBorder.Dispose ();
imgKeyboardBorder = null;
}
}
</code></pre>
<p>Code from Main.cs (where the code breaks):</p>
<pre><code> static void Main (string[] args)
{
UIApplication.Main (args, null, "AppDelegate");
}
</code></pre>
<p>Here is the snippet from my AppDelegate where I call the ViewController:</p>
<pre><code> var rootNavigationController = new UINavigationController();
LoginView loginScreen = new LoginView();
rootNavigationController.PushViewController(loginScreen, false);
this.window.RootViewController = rootNavigationController;
//blank function fires so the getter will init the singleton.
Singleton.Instance.Initialize();
// make the window visible
window.MakeKeyAndVisible ();
return true;
</code></pre>
| 0non-cybersec
| Stackexchange |
Skydiver lands in man’s car like he’s in a movie (pt2). | 0non-cybersec
| Reddit |
Mixed Reality | Augmented Reality | Virtual Reality | Animations | Sensoring. | 0non-cybersec
| Reddit |
NullAuth: A proposal for decentralizing authentication. An updated spec is now on https://www.nullauth.org
NullAuth
Authentication mechanisms today have multiple weaknesses and shortcomings. To name a few:
1. You have to trust a third-party with safe-keeping your password.
2. Google and FaceBook are gatekeepers (via Google/Facebook Login) to apps we use everyday.
3. You have to remember multiple passwords.
4. Humans are not good at remembering good passwords.
NullAuth is an authentication scheme which uses Public Key Cryptography to alleviate some of these problems. In the first phase, NullAuth with target apps with technically proficient users, and eventually we hope tooling will make it accessible to non-technical users as well. NullAuth is designed to be simple to understand and implement from scratch, and is based on existing, proven methods. The approach outlined here has been previously discussed on the internet, and the main intent is to turn those conversations into a formal spec.
The name NullAuth was chosen to highlight not needing to store credentials on the server.
Pre-requisites for using NullAuth to authenticate users
- Generate a key pair for your domain.
- [1] The domain's public key should be available at www.example.com/.well-known/nullauth/public.key
Creating an account for a user
- User creates an RSA key pair (or uses an existing one) locally
- Saving the key pair is the user's responsibility. Eventually, we'll have tools for this.
- Create a form that takes the username, public key and other details needed for creating the account
- Server creates an account with the specified username and stores the public key against it
Login
- The login challenge text takes this form:
"Login as (username@website) at (utcmilliseconds)"
eg: Login as [email protected] at 1513348513265
- The domain (or website) must hash the above challenge with SHA2 and encrypt the hash with the domain's private key.
- The challenge now looks like
"Login as (username@website) at (utcmilliseconds);(encrypted sha2 hash)"
- User signs challenge with private key and sends it to the server.
- Server verifies the username, and if the utcmilliseconds is recent enough returns a session token.
- The session token is used for subsequent access.
Updating a public key
- Just provide a UI to logged in users for submitting a new public key.
Access Delegation (like OAuth)
This addresses usecases currently handled by OAuth.
Eg: User has an account on docs.example.com (aka provider domain), and some data stored there.
User wants to allow another app publisher.example.com (aka consumer domain) to access (read and modify) his or her data on docs.example.com.
- An access delegation challenge text takes the form:
"Grant (comma-separated-permissions) of (username@provider-domain) to (consumer-domain) at (utcmilliseconds)"
eg: Grant read,write,friends_list of [email protected] to publisher.example.com at 1513348513265
- publisher.example.com must now hash the above message with SHA2 and encrypt it with a private key
- The challenge now looks like
"Grant (comma-separated-permissions) of (username@provider-domain) to (consumer-domain) at (utcmilliseconds);(encrypted sha2 hash)"
- publisher.example.com requests the user to sign the above challenge
- User signs the above message, and sends it to publisher.example.com
- publisher.example.com sends signed message to docs.example.com and receives a token.
- The token can be used to access data until an expiry decided by the provider app.
- The url to be invoked to receive a token is left to the provider app. NullAuth does not mandate a specific url.
Tools for End Users
- In phase 1, we'll create CLI tools to benefit technically proficient users.
- In Phase 2, we'll create browser extensions for non-technical users to try NullAuth.
- In Phase 3, let's hope Android, iOS and Browsers can integrate NullAuth well enough that tooling is redundant.
Tools and extensions should refuse to sign if the challenge's signature cannot be verified by the requesting domain's public key.
Consider the following challenge:
- Grant (comma-separated-permissions) of (username@provider-domain) to (consumer-domain) at (utcmilliseconds);(encrypted sha2 hash)
If the consumer-domain's public key cannot verify the above challege, the tool should refuse to sign it.
Notes:
[1] - With input from dchestnykh in comments | 1cybersec
| Reddit |
1,000-Year-Old Tomb of Maya King Discovered in Guatemala. | 0non-cybersec
| Reddit |
VB6 Don't Auto-Activate Child Form on Form-Resize Windows 10. <p>A window in this VB6 legacy system that I'm supporting hosts a Word 2007 instance as a <a href="https://i.stack.imgur.com/l9vsF.png" rel="nofollow noreferrer">child window</a>. On Windows 7, the parent window can be resized without any issues: the window doesn't update <a href="https://i.stack.imgur.com/CYqmC.png" rel="nofollow noreferrer">until the mouse is released after resizing</a>. On Windows 10, however, the window updates dynamically while being resized.</p>
<p>The issue I'm encountering in Windows 10 is that the child Word window is getting activated/focused upon the first update: you can only drag to resize the parent window by a couple pixels at a time, before the child window gets focused and the resize event on the parent window is canceled (the cursor is still on the resize icon, but continued dragging has no effect). Maximizing, minimizing, and restoring the parent window all work normally. Once the child Word window is closed (through the file menu in Word), the parent window can be resized normally, because there's no child window to activate/focus. The same automatic-child-window-activation-after-parent-window-resizing occurs in Windows 7, but because the resize event doesn't fire until after the parent window has actually updated, it's not an issue there.</p>
<p>My conundrum is that I don't see anything in the code that suggests why the child window is getting automatically activated/focused, unless that's just default Windows behavior. In either case, I'm pretty sure I need a way to make that not happen.</p>
<p>All that this code is <em>explicitly</em> doing (primarily the ResizeControls() sub; the rest is here mostly for context) is resizing/positioning the Word window to correspond to the new size of the container in the parent window, which is consistent with the behavior in Windows 7.</p>
<p>From what I can tell, I don't <em>believe</em> that GetWindow() actually <em>activates</em> the window it gets a handle to, but if it does, then that's likely the cause of the issue, in which case I need to be able to get a handle to the window without activating it.</p>
<p><em>PDFView.frm</em>:</p>
<pre><code>Begin VB.Form frmPDFView
Caption = "Untitled"
ClientHeight = 8655
ClientLeft = 1320
ClientTop = 1665
ClientWidth = 9270
' ...
Begin VB.PictureBox picContainer
BackColor = &H00FFFFFF&
Height = 4215
Left = 1080
ScaleHeight = 4155
ScaleWidth = 4995
TabIndex = 0
Top = 120
Width = 5055
End
End
Private Sub ResizeControls()
On Error Resume Next
Dim pWndChild As Long
Dim r As RECT
Dim rtn As Long
picContainer.Left = 100
picContainer.Height = Me.Height - 1300
picContainer.Width = Me.Width - 350
picContainer.Top = 300
pWndChild = GetWindow(picContainer.hWnd, GW_CHILD)
rtn = GetLastError
If (pWndChild) Then
rtn = GetClientRect(picContainer.hWnd, r)
rtn = SetWindowPos(pWndChild, 0, 0, 0, r.Right - r.Left, r.Bottom - r.Top, SWP_NOZORDER Or SWP_NOMOVE)
Else
rtn = GetLastError
End If
End Sub
Private Sub Form_Resize()
On Error GoTo ERROR_HANDLER
Call ResizeControls
Exit Sub
ERROR_HANDLER:
Err.Clear
Resume Next
End Sub
</code></pre>
| 0non-cybersec
| Stackexchange |
getting the X/Y coordinates of a mouse click on an image with jQuery. <p>I would like to use jQuery to get the X/Y coordinates of a click event on an image. The coordinates should be relative to the image, not relative to the whole page</p>
| 0non-cybersec
| Stackexchange |
Do you like it when ladies make a lot of noise during sex?. Because I make a *ton* of noise. I just worry that it will be awkward or my new boyfriend will think I'm faking it. We're both 16. He's a virgin and I'm not. In the past, I've always stifled my noises out of embarrassment, but I want to be able to let loose with my new guy. | 0non-cybersec
| Reddit |
Why does np.all return the wrong value when I use "is" compared to "=="?. <p>So I tracked down a bug in my code and can reproduce is with the following. Basically I need to check if all elements in an <code>np.ndarray</code> are not 0.</p>
<pre><code>>>> a = np.ones((3,3))
>>> np.all(a == 0) == False
True
</code></pre>
<p>Okay perfect, all values within <code>a</code> are non-zero. I know I can also do <code>np.all((a == 0) == False)</code> instead to explicitly ask to be compared to 0 but I didn't at first and this is made me realize there is a difference when comparing <code>is</code> to <code>==</code> in the <code>False</code> case.</p>
<pre><code>>>> np.all(a == 0) is False
False
</code></pre>
<p>I know that <code>is</code> should compare if the objects point to the same object. But does this mean that my two values that returned <code>False</code> don't actually point to the same <code>False</code>? I may just be overthinking this though...</p>
| 0non-cybersec
| Stackexchange |
Daler Mehndi - Tunak Tunak Tun [Indian]. | 0non-cybersec
| Reddit |
Exercise $17$ $(e)$ on Marcus' Number Fields, Chapter $4$. <p>Exercise <span class="math-container">$17$</span> on Marcus' Number Fields, Chapter <span class="math-container">$4$</span>, has <span class="math-container">$9$</span> items (from <span class="math-container">$a$</span> to <span class="math-container">$i$</span>). I got stuck at item <span class="math-container">$e$</span>.</p>
<p><a href="https://i.stack.imgur.com/R8YuI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R8YuI.png" alt="enter image description here"></a></p>
<p><a href="https://i.stack.imgur.com/s6blW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/s6blW.png" alt="enter image description here"></a></p>
<p>(The notation is the following: Whenever <span class="math-container">$L$</span> is a normal extension of <span class="math-container">$K$</span> and <span class="math-container">$H$</span> is a subgroup of <span class="math-container">$\text{Gal}\left (L/K\right )$</span>, for every subset <span class="math-container">$X\subset L$</span> the set <span class="math-container">$X_H$</span> is the set of elements of <span class="math-container">$X$</span> fixed pointwise by <span class="math-container">$H$</span>).</p>
<p>The second and the third part of the exercise are easy, because we are supposing that <span class="math-container">$Q$</span> is unramified, therefore if <span class="math-container">$PS=QI$</span> then <span class="math-container">$Q$</span> is coprime to <span class="math-container">$I$</span> and hence <span class="math-container">$Q+I=S$</span>. If the first part were true, the third part follows immediately, so we only have to prove the first part.</p>
<p>I tried to use that <span class="math-container">$\sigma \left (t\right )\equiv t\pmod U$</span> for every <span class="math-container">$\sigma \in \text{Gal}\left (M/L\right )=E$</span> and then use the trace <span class="math-container">$T_{L}^M$</span>, but this only leads to <span class="math-container">$\left | E\right | T\subseteq S+U$</span>.</p>
<p>I also tried to use the fact that <span class="math-container">$U$</span> is a maximal ideal of <span class="math-container">$T$</span> and <span class="math-container">$S$</span> is not included in <span class="math-container">$U$</span>, but then I could not prove that <span class="math-container">$S+U$</span> is an ideal of <span class="math-container">$T$</span>.</p>
<p>Any help?</p>
| 0non-cybersec
| Stackexchange |
Are animals ticklish?. | 0non-cybersec
| Reddit |
How to fix: "Unresolved reference: buffer" or "Using 'buffer(Source): BufferedSource' is an error. moved to extension function"?. <p>I had 3 line code to get body from OkHttp3 source:</p>
<pre><code>val responseBody = response.peekBody(response.body()!!.contentLength())
val source = GzipSource(responseBody.source())
val body = Okio.buffer(source).readUtf8() //issue is that line
</code></pre>
<p>on another computer I get error: "Using 'buffer(Source): BufferedSource' is an error. moved to extension function"</p>
<p>So fix it by replacing last line by:</p>
<pre><code>val body = source.buffer().readUtf8()
</code></pre>
<p>bun now on the fist computer I have error: "Unresolved reference: buffer" so I need to revert that change.</p>
<p>What is wrong? base on error message I cannot figure out. It seems that it's issue with gradle configuration. But what? How to have compiling code on both computers.</p>
| 0non-cybersec
| Stackexchange |
When a joke turns into a burn. | 0non-cybersec
| Reddit |
Matt and Kim strip down in Times Square. | 0non-cybersec
| Reddit |
Is ring automorphism of the field of formal Laurent series over a finite field continuous?. <p>Consider the formal Laurent series over a finite field $F=\mathbb{F}_q((T))$. $F$ is a field and there is a valuation $v$ of $F$:
$$v\left(\sum_{i=n}a_iT^i\right)=n$$
where $n\in\mathbb{Z},a_i\in\mathbb{F}_q,a_n\neq0$.</p>
<p>$\phi$ is a ring automorphism of $\mathbb{F}_q((T))$. Is $\phi$ continuous? Or there exists a ring automorphism $\phi$ which is not a continuous mapping?</p>
| 0non-cybersec
| Stackexchange |
Lipschitz function and uniform boundedness principle. <p>Let <span class="math-container">$(S,d)$</span> be a metric space and <span class="math-container">$X$</span> be a normed space. Show that if <span class="math-container">$f:S\to X$</span> is a function such that for all <span class="math-container">$L\in X^*$</span>, <span class="math-container">$L\circ f:S\to {\Bbb F}$</span> is lipschitz(there is a constant <span class="math-container">$M>0$</span> such that for all <span class="math-container">$s,t\in S$</span>, <span class="math-container">$||f(t)-f(s)||\leq Md(s,t)$</span> ) , then <span class="math-container">$f:S\to X$</span> is a lipschitz function.</p>
<p>My effort is in this way: for every <span class="math-container">$s\in S$</span>, define <span class="math-container">$T_s:X^*\to {\Bbb C}$</span> such that <span class="math-container">$T_s(L):=L(f(s))$</span>. clearly <span class="math-container">$T_s\in X^{**}$</span> and also <span class="math-container">$||T_s||=||f(s)||$</span>. Now
<span class="math-container">$$\begin{align*}||f(s)-f(t)||=||T_s-T_t||&=\sup_{L\in X^*_{||.||\leq 1}}|T_s(L)-T_t(L)|\\&= \sup_{L\in X^*_{||.||\leq 1}}|L(f(s))-L(f(t))|\leq Md(s,t)\end{align*}$$</span>
While I donot use PUB in this proof, I think my proof is not correct. Please help me.
Thanks so much. </p>
| 0non-cybersec
| Stackexchange |
Linux port forwarding using another port. <p>i have a server that uses linux (centos) without root access, i want to know if i can forward a port 10000 to localhost:3306 using ssh or without installing any software?</p>
<p>so that when i access that server on port 10000, it will connect to that computer's localhost port 3306.. </p>
<p>normally i would use Pound, but on that server i don't have root access.. how to do this using ssh?</p>
| 0non-cybersec
| Stackexchange |
Fate Zero Ep 18 Preview Images. . | 0non-cybersec
| Reddit |
Active status sum like scd in SQL Server 2012. <p>I have this data:</p>
<pre><code>CREATE TABLE #student
(
student_id INT,
status VARCHAR(50),
created_dt DATE
)
CREATE TABLE #student_status_history
(
student_id INT,
from_status VARCHAR(50),
to_status VARCHAR(50),
status_changed_dt DATE
)
INSERT INTO #student (student_id, status, created_dt)
VALUES (1, 'Active', '2016-10-02'),
(2, 'Active', '2016-10-02'),
(3, 'Active', '2016-10-02')
SELECT *
FROM #student
</code></pre>
<p>On 5th october <code>student2</code> status is updated to <code>inactive</code></p>
<pre><code>UPDATE #student
SET status = 'Inactive'
WHERE student_id = 2
INSERT INTO #student_status_history (student_id, from_status, to_status, status_changed_dt)
VALUES (2, 'Active', 'Inactive', '2016-10-05')
SELECT *
FROM #student
SELECT *
FROM #student_status_history
</code></pre>
<p>On 8th october <code>student2</code> status is updated to <code>active</code>:</p>
<pre><code>UPDATE #student
SET status = 'Active'
WHERE student_id = 2
INSERT INTO #student_status_history (student_id, from_status, to_status, status_changed_dt)
VALUES (2, 'InActive', 'Active', '2016-10-08')
</code></pre>
<p>On 9th Oct I created another student:</p>
<pre><code>INSERT INTO #student (student_id, status, created_dt)
VALUES (4, 'Active', '2016-10-09')
</code></pre>
<p>On 10th october I have this data in tables.</p>
<pre><code> select * from #student
select * from #student_status_history
</code></pre>
<p>Using the above tables </p>
<p>I should generate a report on 10th october as from Oct 1st to Oct 10th active students as of on that day</p>
<p>Output should be as below </p>
<pre><code> Date ActiveCount
----------- -----------
2016-10-01 0
2016-10-02 3
2016-10-04 3
2016-10-05 2
2016-10-06 2
2016-10-07 2
2016-10-08 3
2016-10-09 4
2016-10-10 4
</code></pre>
| 0non-cybersec
| Stackexchange |
House of Wolves DLC.. Is there an estimated date for the release of the 2nd expansion?
I don't know if buying the season pass or just the dark below dlc, might be a waste of money if the 2nd dlc is planned for like august 2015.. | 0non-cybersec
| Reddit |
C++: Need help understanding operator-overloading error. <p>I got this code:</p>
<pre><code>1 #include <iostream>
2 using namespace std;
3
4 class B {
5 private:
6 int n;
7 public:
8 B(int x) : n(x) {}
9 B operator +(B& b) {
10 return B(n+b.n);
11 }
12 friend ostream& operator <<(ostream &out, const B& b) {
13 out << "B: " << b.n;
14 return out;
15 }
16 bool operator <(const B& rhs) const{
17 return n < rhs.n;
18 }
19 };
20
21 B smaller (const B& b1, const B& b2) {
22 if(b1 < b2)
23 return b1;
24 else
25 return b2;
26 }
27
28 int main() {
29 B b1(1), b2(2), b3(3);
30 const B b4 = b1 + (b2 + b3);
31 cout << smaller(b1,b2) << endl;
32 return 0;
33 }
</code></pre>
<p>I was asked to point out the errors (explain them) and supply a fix, after finding two and fixing them I got the above code.</p>
<p>When trying to compile it on Visual Code I noticed that line 30 is giving out an error without me understanding why.
The error I got was :</p>
<p>no match for 'operator+' (operand types are 'B' and 'B')</p>
<p>and</p>
<p>cannot bind non-const lvalue reference of type 'B&' to an rvalue of type 'B'</p>
<p>After searching on google and finding nothing I tried varius things including adding a const to the parameter in line 9 (operator +) which fixed the problem.
I still dont understand what was the problem and I would like to get an explanation.</p>
<p>thank you.</p>
| 0non-cybersec
| Stackexchange |
[50/50] small girl eating nutella | skin pulled back on a dead body (NSFW). | 0non-cybersec
| Reddit |
Ricky Gervais cracks up at "one of the weirdest fucking scenarios [he's] ever heard". | 0non-cybersec
| Reddit |
Can I change max_allowed_packet for a MySQL database, but not others in the same instance?. <p>We have a MySQL server with multiple databases in the same instance. Can I change the max_allowed_packet value for just one of the database?</p>
<p>From looking at <a href="http://dev.mysql.com/doc/refman/5.1/en/set-statement.html" rel="nofollow">this</a>, it seems <code>SET GLOBAL max_allowed_packet=xx</code> will affect the entire server while <code>SET max_allowed_packet=xx</code> will only affect the current session</p>
| 0non-cybersec
| Stackexchange |
Cannot install packages properly with pip. <p>100% noob here. Second day using Linux.<br>
Using Ubuntu 16.04. When executing</p>
<pre><code>sudo pip install numexpr
</code></pre>
<p>I got the message as follows:</p>
<pre><code>The directory '/home/ark/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/ark/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: numexpr in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied: numpy>=1.6 in /usr/lib/python2.7/dist-packages (from numexpr)
</code></pre>
<p>It appears to me though the package is not correctly installed.</p>
| 0non-cybersec
| Stackexchange |
How do you convert ansible ini inventory into json or yaml. <p>Ansible AWX requires inventories to be entered in yaml or json format.</p>
<p>When you start learning ansible, you may take the choice to start off with your inventory in ini format.</p>
<p><a href="https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html" rel="nofollow noreferrer">https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html</a></p>
<p>Is it possible to convert between formats?</p>
| 0non-cybersec
| Stackexchange |
Just a regular day in Russia. | 0non-cybersec
| Reddit |
When I tell myself I'm going to spend 5 mins on Reddit. | 0non-cybersec
| Reddit |
Undo Dual Boot to use Ubuntu Exclusively. <p>I am getting rid of Windows. I was looking at instructions found here:
<a href="https://lifehacker.com/how-to-uninstall-windows-or-linux-after-dual-booting-508710422" rel="nofollow noreferrer">https://lifehacker.com/how-to-uninstall-windows-or-linux-after-dual-booting-508710422</a>
and here:
<a href="https://www.lifewire.com/remove-windows-linux-dual-boot-4177415" rel="nofollow noreferrer">https://www.lifewire.com/remove-windows-linux-dual-boot-4177415</a></p>
<p>I did see this question <a href="https://askubuntu.com/questions/320221/removing-win8-ubuntu-dual-boot-and-using-just-ubuntu">Removing win8 ubuntu dual-boot and using just ubuntu</a> here on Ask Ubuntu just now when I came to post. I can certainly try PartedMagic if it is better than gparted.</p>
<p>I still have my old live usb. I started to do this last night, but the machine did not recognize it. I came back this morning expecting to start with fixing the usb stick and/or port, but this time when I put it in, it came right up like nothing was ever wrong. That's probably not worth worrying about now, but I mention it just in case it means anything to you.</p>
<p>I opened the gparted gui, and deleted the Windows partition. However, when I went to re-size the Ubuntu partition, it was only giving me 26.9 GB of new space, which is way wrong, because the old Windows partition was over 600 GB. There is a way to create a new partition in, or out of, the old, now unallocated Windows space, and I can do that if that's my best solution, but I thought I would be able to just re-size my existing Ubuntu and that would be that. </p>
<p>Questions:</p>
<ol>
<li><p>Is it possible to simply make my existing Ubuntu partition take up the now unallocated former Windows space or not?</p></li>
<li><p>There was also an option to 'Extend Partition', but that was greyed out. What would be the difference between 'extending' and 're-sizing'? If that is a good choice, how would I access the 'Extend' option?</p></li>
</ol>
<p>UPDATE 1: I might have found the answer. If so I will come back and delete or point to my solution, but I have to reboot to test it...</p>
<p>UPDATE 2: These two answers, <a href="https://askubuntu.com/questions/126153/how-to-resize-partitions">How to resize partitions?</a> and <a href="https://askubuntu.com/questions/730200/extending-partitions">Extending partitions</a> which came up late in the 'similar questions' display, helped me. </p>
<p>It turns out that when the gparted dialog refers to 'space before' and 'space after', it is NOT, as I assumed, talking about <em>chronologically</em>, or <em>temporally</em>, but actual, physical space on the disk in front of or behind the partition you want to re-size. </p>
<p>In my case, that's a problem, as you can see from the picture I am posting. But there is sda7, which apparently could be extended into all the former Windows spaces. gparted says sda7 is mounted, but I can't see it when I look in files under 'other locations' where Windows used to be. I am sure there is a reason I created this separate Ubuntu partition, following whatever instructions I had at the time, but I don't remember why now. Any guesses?</p>
<p>So, now the goal is just to make as much space as possible available to Ubuntu, and be able to access it easily. Any thoughts on the best way to go about this greatly appreciated.</p>
<p><a href="https://i.stack.imgur.com/ESkbG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ESkbG.png" alt="enter image description here"></a></p>
| 0non-cybersec
| Stackexchange |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange |
1Keyboard to rule them all! -- type on your iPhone/iPad from your Mac. | 0non-cybersec
| Reddit |
Teacher who screened 'The ABCs of Death' to a group of High Schoolers Jailed for 30 Days. | 0non-cybersec
| Reddit |
Wet Street (18''x24'' Acrylic Painting). | 0non-cybersec
| Reddit |
Made myself lunch. Bacon infused mozzerella cheeseburger, bloomin' baked potato, and mango salsa.. | 0non-cybersec
| Reddit |
Proof that for every $X$ $\exists !$ one initial ordinal. <p>The following is an exercise in Just/Weese:</p>
<p>Prove that for every set $X$ there exists exactly one initial ordinal $\kappa$ such that $X \approx \kappa$.</p>
<p>An ordinal is called initial ordinal if it is not equipotent with any smaller ordinal. </p>
<p>Can you tell me if my proof is correct? Thank you. </p>
<p>Assume there are two initial ordinals, $\kappa \neq \kappa'$ with $\kappa \approx X \approx \kappa'$. Wlog let $\kappa < \kappa' $. Then this is a contradiction to $\kappa'$ being the smallest ordinal in bijection with $X$. </p>
<p>To show existence assume AC so that $X$ can be well-ordered. Let $o$ be the order type of $X$. Define $S = \{o' \mid o' \in \mathbf{ON}, o' \approx o \} \subseteq \mathbf{ON}$. Since $\mathbf{ON}$ is a well-order, $S$ has a minimal element $s_0$. This is the initial ordinal of $X$.</p>
<p>The exercise is rated difficult so I expect this proof to be flawed but I can't seem to spot the mistake. </p>
| 0non-cybersec
| Stackexchange |
Can I Put Vinyl Tile On A Cement Floor?. We live in Delaware and as you may know a few weeks ago we got hit by a small quake followed quickly by a hurricane/flood. Our basement flooded with about three inches of water when the power went out (sump pump) and we discovered water leaking down the wall as well (turned out the front door was faulty).
We're renters in a particularly odd situation. Our friends own this house but for various reasons had to move back to their country of origin. We needed a better place to live and they needed renters fast so we decided to help each other out. Due to some confusion regarding the homeowners insurance and the high number of complaints filed after the flood our basement didn't get evaluated for several weeks. Did I mention the basement was carpeted and where our pets lived? I think you can imagine the smell a waterlogged carpet produces over the course of several weeks.
After a week we couldn't take the smell any longer and cleared out the remaining water ourselves, pulled up all the carpet and cleaned every inch of the place. While it's a lot better than it was, the smell is still noticeable and the basement is uninhabitable for us or our pets. The best part? It turns out the insurance doesn't cover floods and our friends are in the same desperate situation we're all in because of the economy and can't afford to repair it either.
So, we need to replace the flooring. There's a good chance it will flood again so carpet is out. We considered tile but it's expensive and the basement floor has some cracks in it that indicate the foundation may have shifted at some point so we're concerned the tiles would crack if it shifted more. We considered laminate wood but if it floods again the wood could warp and mold. So we're interested in vinyl tile. We priced some peel and stick tile (about $350 total) and are willing to attempt to install it ourselves but we have a few issues: we've never done anything like this before, we have no idea if vinyl tile on concrete is a good idea and we both have bad backs so it's going to be a pain.
[Here is a gallery with some pictures of the basement in case that helps.](http://blessedblogger.imgur.com/basement__post_flood)
Can we put vinyl tile on a cement floor? Do we need to do anything special to the floor to prepare it before we place them? We have to tile the basement bathroom as well, is moving the sink and toilet a big deal or can we handle it ourselves? I really want to do this right, not just for us but because I want to take care of our friends home. Any advice would be appreciated! | 0non-cybersec
| Reddit |
About the diagonal entries of an inverse matrix. <p>Suppose that $\bf{A}$ is a full-rank $N \times N$ matrix, ${\bf{a}}_n$ is the $n$-th column of $\bf{A}$ and ${\bf{A}}_n$ is the submatrix obtained by deleting ${\bf{a}}_n$ out of $\bf{A}$. </p>
<p>How to prove
$${\left[ {{{\left( {{\bf{A}}^H{{\bf{A}}}} \right)}^{ - 1}}} \right]_{nn}} = \frac{1}{{{\bf{a}}_n^H{{\bf{a}}_n} - {\bf{a}}_n^H{{\bf{A}}_n}{{\left( {{\bf{A}}_n^H{{\bf{A}}_n}} \right)}^{ - 1}}{\bf{A}}_n^H{{\bf{a}}_n}}}$$
where ${\left( \cdot \right)^H}$ stands for Hermitian transpose, ${\left[ \cdot \right]_{nn}}$ denotes the $n$-th diagonal element.</p>
<p>Thanks a lot.</p>
| 0non-cybersec
| Stackexchange |
how to install xorg-fonts-75dpi properly for xboard?. <p>I am trying to compile xboard but when I tried to run it I got the error </p>
<pre><code>xboard: no fonts match pattern -*-helvetica-bold-r-normal--*-*-*-*-*-*-*-*
</code></pre>
<p>I googled a bit and found out that xorg-fonts-75dpi or xorg-fonts-100dpi is needed according to this <a href="https://bugs.archlinux.org/task/5333" rel="nofollow noreferrer">website</a>. However, when I moved xorg-fronts-75dpi files from <a href="http://www.archlinux.org/packages/extra/any/xorg-fonts-75dpi/" rel="nofollow noreferrer">here</a> to /usr/share/fonts/75dpi xboard still gives the same error. Is there a way I could install from apt-get? If not how should I solve this problem?</p>
<p>btw I am using ubuntu 11.04</p>
<p><strong>UPDATE</strong>: I just found out that xorg-fonts-75dpi is already installed in /etc/X11/fonts. So according to the link I provided I shouldn't be getting the error. Does anyone know what I should do?</p>
| 0non-cybersec
| Stackexchange |
Parmesan Parker House Rolls. | 0non-cybersec
| Reddit |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange |
Our cat has been missing for over a month and has just turned up on a friend of a friend's Facebook page!. | 0non-cybersec
| Reddit |
[UPDATE] I [29M] found my girlfriend [32F] has a soft strap-on dildo that she's been hiding from me. I think she knows I found it. What do I do?. Last post: https://old.reddit.com/r/relationship_advice/comments/cu9h99/i_29m_found_my_girlfriend_32f_has_a_soft_strapon/
A lot went down in the last few hours. Less dick jokes this time round, because now I'm over the "surprise floppy dong!" aspect of it, it's turned out a lot more serious than I expected.
(for what it's worth, my girlfriend told me to still call her "she" at all times except when dressing male, so I'm still going with that for this update post)
I fell asleep not long after the post I made last night. Got up around 2. Headed downstairs to get my 2pm "breakfast", and GF was down there in her pyjamas, with a cup of tea and her phone. Good a time as any to address the elephant in the room, I thought.
It was awkward as hell. I started off with "hey", got a dead silence, and followed it up with something like "sorry, I was looking for my uniform shirt yesterday, but that drawer's really none of my business, you can keep whatever you want in there, it's all good".
Tried to keep it as non-specific as I could. If she didn't know I'd found it before, she definitely knew now.
She just sort of nodded in response to me. Then she apologised for not being in a talkative mood last night, and started telling me about her day. But it came off really strained. I could tell it was on her mind, and she kinda trailed off after a bit.
Eventually she told me to come upstairs with her. I thought she just wanted to talk somewhere more private (it's a shared kitchen, we're living in a family's spare room). But no, she went into our room and showed me everything.
She crossdresses. That's specifically how she referred to it, not trans or drag king or anything. She wears the dick (the packer, as the comments informed me last night), and the crop top she'd had it wrapped in flattens down her boobs. And it turns out she's been going through my drawers for a lot longer than I've been going through hers, because she got a shirt and some comfy tracksuit pants from my drawers and put them on. She has long hair, so she ties it up and hides it under a flat cap that she had in another drawer.
After she'd shown me all of this, basically in silence, she looked at herself in her mirror for a bit. Different angles and stuff. To me she still basically looked like herself, with a flatter chest and different clothes, but she seemed fascinated with how she looked now.
She kept glancing over at me to see my approval, and I smiled back. Tried to look as reassuring as possible. I noticed she'd been pretty shaky putting things on. When she was looking at herself in the mirror, I went over and put a hand on her shoulder supportively, which basically seemed like it was what pushed her over into starting to cry.
Then she broke the silence and just couldn't stop talking. She's been crossdressing secretly for the past couple of months, she was so worried about what I'd think. She insists she's not transgender, she just likes to crossdress sometimes, it makes her feel good and confident. Also insists it's not a sex thing. Just for fun.
I kept saying "it's okay, it's okay, don't worry", mostly because I didn't really know what to say. I ended up hugging her as she sobbed on the bed. She calmed down eventually, and told me "thank you", because she said she had no idea how I'd react.
She asked me how she looked (while still all red-eyed from crying). I just said "you look great" and smiled, and she hugged me again. "You don't mind me wearing your clothes?" "Yeah, no worries!" I guess she was always a lot more careful with my stuff than I was with hers in my rush yesterday. We didn't really talk much about it, I just asked a few simple questions like if she wanted me to refer to her with different pronouns when she was dressed like this (I know that's usually a trans thing but I thought I'd check anyway).
We didn't do much else after that. She eventually got on her phone again, I got on my laptop. The two of us hanging out together doing our own thing, just as we usually do, only with her in different clothes. I basically got my mind off it for a bit, and then I had to go to work again not long later. Wrote most of this on the bus to work.
I've been thinking back to when I said she looked great. She basically just looked like herself still. A few different clothing choices didn't transform her into a different person for me, and they definitely didn't transform her into a man. It was basically just the same as she always is, for me. But I realise it was a lot more significant for her, and I respect that. But also I don't want to pretend it's a mindblowing shift in appearance for me, too.
Also I was thinking... I think I'm glad she's not trans. Is that bad of me to say? I love and respect her but I realised when thinking about it last night, if I ever did see her as a man, things would be really different for me. I know I was going on about pegging in the last post, but "girl with strapon" and "someone who straight-up looks like a man" are really two different things for me, and I don't think I really have the wiring to have feelings for her as a man. But I'd do my best to be supportive anyway, because I don't want to stop her being the person she is. I'm really hoping the situation stays where it is and never comes between us. If it did... I'd have to let go of her as a girlfriend. Let her find somebody right for her.
TL;DR: I don't have a problem with her crossdressing, but mainly because she still just looks like a woman to me and I barely even register it as crossdressing. Should I tell her this? I think she'd take it badly after the emotional moments earlier.
I have to go into work now, so I won't be responding for a bit. Thank you for everyone who's offered support, in public or private. | 0non-cybersec
| Reddit |
[Java] Polymorphism questions. I'm creating a game right now and I'm not exactly sure how this works
Right now, in my program, I have this Player class which has a Weapon object in it
And I have a Sword class, which extends the Weapon class. Now, if I do something like this in the player class:
Weapon weapon = new Sword();
Can it access the methods from the Sword class?
If it can't then I have one more question... If I have a method in the Weapon class called Attack(), and I have a method in the Sword class called Attack(), and I use the above code, will it use the overwritten method from the Sword class or the original method from the Weapon class?
Thanks! | 0non-cybersec
| Reddit |
Is there anything in ~/.cache that is not really cache?. <p>My machine has lots of memory, so I moved <code>~/.cache/google-chrome</code> into <code>/tmp</code>, which is a tmpfs RAM disk.
This makes the browser run faster and reduces SSD usage.
When I reboot, it all goes away, but it gets recreated again.
All is fine.</p>
<p>In theory, I could move all of <code>~/.cache</code> there too.</p>
<p>But in practice, how likely is it that some packages (ab)use <code>~/.cache</code> for something other than temporary reproducible data?</p>
<h2>UPDATE:</h2>
<p>I decided to try it out and did this:</p>
<pre><code>$ mv ~/.cache ~/.cache.old
$ ln -s /tmp/home/ray/.cache ~/.
</code></pre>
<p>and then added this to my <code>~/.profile</code>:</p>
<pre><code>mkdir -p /tmp/home/ray/.cache
</code></pre>
<p>and so far everything is working okay across reboots. Removing .cache.old will free up about 2G of mostly ancient files.</p>
<p>If I ever <em>do</em> run into any packages that misuse .cache, I can teach <code>.profile</code> to add a symlink back to a real directory for that specific case.</p>
| 0non-cybersec
| Stackexchange |
I think this counts as history. | 0non-cybersec
| Reddit |
Never tell me the odds. | 0non-cybersec
| Reddit |
How to install Cydia on ISO without PC.. | 1cybersec
| Reddit |
Why do I have to turn on optimization in g++ for simple array access?. <p>I have written a simple Gaussian elimination algorithm using a <code>std::vector</code> of <code>double</code>s in C++ (gcc / Linux). Now I have seen that the runtime depends on the optimization level of the compiler (up to 5-times faster with <code>-O3</code>). I wrote a small test program and received similar results. The problem is not the allocation of the vector nor any resizing etc.</p>
<p>It's the simple fact that the statement:</p>
<pre><code>v[i] = x + y / z;
</code></pre>
<p>(or something like that) is much slower without optimization. I think the problem is the index operator. Without compiler optimization, the <code>std::vector</code> is slower than a raw <code>double *v</code>, but when I turn on optimization, the performance is equal and, to my surprise, even the access to the raw <code>double *v</code> is faster.</p>
<p>Is there an explanation for this behaviour? I'm really not a professional developer, but I thought the compiler should be able to transfer statements like the above one rather directly to hardware instructions. Why is there a need to turn on an optimization and, more importantly, what is the disadvantage of the optimization? (If there is none, I wonder why the optimization is not the standard.)</p>
<p>Here is my vector test code:</p>
<pre><code>const long int count = 100000;
const double pi = 3.1416;
void C_array (long int size)
{
long int start = time(0);
double *x = (double*) malloc (size * sizeof(double));
for (long int n = 0; n < count; n++)
for (long int i = 0; i < size; i++)
x[i] = i;
//x[i] = pi * (i-n);
printf ("C array : %li s\n", time(0) - start);
free (x);
}
void CPP_vector (long int size)
{
long int start = time(0);
std::vector<double> x(size);
for (long int n = 0; n < count; n++)
for (long int i = 0; i < size; i++)
x[i] = i;
//x[i] = pi * (i-n);
printf ("C++ vector: %li s\n", time(0) - start);
}
int main ()
{
printf ("Size of vector: ");
long int size;
scanf ("%li", &size);
C_array (size);
CPP_vector (size);
return 0;
}
</code></pre>
<p>I received some weird results. A standard g++ compile produces a runtime 8 s (C array) or 18 s (<code>std::vector</code>) for a vector size of 20 000. If I use the more complex line behind the <code>//..</code>, the runtime is 8 / 15 s (yes, faster). If I turn on <code>-O3</code> then, the runtime is 5 / 5 s for a 40,000 vector size.</p>
| 0non-cybersec
| Stackexchange |
Parse ISO timestamp using Java 8 java.time api (standard edition only). <p>I'm having trouble getting milliseconds from the epoch out of the string in the example. I have tried this three different ways so far, and the example shows the latest attempt. It always seems to come down to that the <a href="http://docs.oracle.com/javase/8/docs/api/java/time/temporal/TemporalAccessor.html" rel="noreferrer">TemporalAccessor</a> does not support <a href="http://docs.oracle.com/javase/8/docs/api/java/time/temporal/ChronoField.html" rel="noreferrer">ChronoField</a>. If I could successfully construct an instance of Instant, I could use <a href="http://docs.oracle.com/javase/8/docs/api/java/time/Instant.html#toEpochMilli--" rel="noreferrer">toEpochMilli()</a>.</p>
<pre><code>String dateStr = "2014-08-16T05:03:45-05:00"
TemporalAccessor creationAccessor = DateTimeFormatter.ISO_OFFSET_DATE_TIME.parse(dateStr);
Instant creationDate = Instant.from(creationAccessor);
</code></pre>
<p>Please give concise answers (don't construct a formatter from scratch) and use only the java 8 standard distribution (I can do it with Joda, but want to avoid dependencies).</p>
<p><strong>Edit:</strong> Instant.from in the code above throws: <code>java.time.DateTimeException: Unable to obtain Instant from TemporalAccessor: {OffsetSeconds=-18000},ISO resolved to 2014-08-16T05:03:45 of type java.time.format.Parsed</code></p>
| 0non-cybersec
| Stackexchange |
How to find a solution to a particular Bottcher equation. <p>Functional equations of the form $f(g(x))=(f(x))^p$, where $g(x)$ is known, is called <a href="https://en.wikipedia.org/wiki/B%C3%B6ttcher%27s_equation" rel="nofollow noreferrer">Bottcher equation</a>. Generally, we have only asymptotic formula for the solution $f(x)$ under certain conditions. In one of my study, I come across the following problem, </p>
<p>How to find a nontrivial (i.e., nonconstant) function $f(x)\in C^\infty(0 ,+\infty)$ satisfying the following functional equation $$f(\frac{2x^3+a}{3x^2})=f(x)^2,$$ where $a>0$ is a constant.</p>
<p>Or can you tell me finding a explicit form for $f(x)$ is impossible?</p>
| 0non-cybersec
| Stackexchange |
Black Mambas get their name because the inside of their mouth is black. They are born with fully developed venom glands, strong enough to kill a person just minutes after birth.. | 0non-cybersec
| Reddit |
Please, respect peoples LFG posts and requirements. When I make a post asking for experienced players only, its not because I dislike new guardians, or would never help anyone through the raid, its that I genuinely do not have the time to help teach people the raid. When I first started running WoTM heroic, I always knew I had an excess of 4+ hours to run, because I knew I would die, mess up, and all of that is ok! It comes with learning, and thats one of the most fun aspects of the raid for sure. That being said, its not fun to spend 5 hours on something that i've done 100+ times and that takes an hour at most. I work 55+ hours a week, and get MAYBE two hours of playing time if im not exhausted at the end of the day. Just as us veterans should respect the new players to the game, and welcome them to our community, the new players have to understand where we're coming from too. If you're truly struggling to find a group to help you run, and teach you, please head over to r/destinysherpa .There are plenty of people who will help you, and be happy and kind whilst doing it. Holding back a team, and not telling them your inexperienced, ruins the entire raid experience for the whole team.
Sincerely,
A guardian who has had an aksis phase 2 checkpoint since Tuesday, and still hasn't gotten to a single damage phase for challenge mode.
EDIT: Thank you to the kind guardian that gave me gold, I hardly think this post deserves it, but regardless, thank you.
A few more things I have to say
A lot of guardians are missing the point of my post. Simply put: join a group that fits your caliber. If someone posts for an experienced run, and you have NOT done whatever activity is being asked, don't attempt to join that group. It goes both ways. New guardians who are looking to be carried/taught the raid, should not be attempting to join an experienced group looking to blast through it in an hour. I don't care how good you are at the game, you will die, a lot, or mess up mechanics, and ruin it for the rest of the team. If you are a super experienced player looking to speed run, don't join a "chill group looking for a chill run" because I promise you it wont be that. BE HONEST about your skill level and patience, and find a group accordingly.
There is entirely too many people trying to sneak their way into a veteran group hoping to get carried the whole way through. This is a six man raid, and every encounter depends on ALL SIX GUARDIANS. One cog in the machine not working, will cause the rest to fall apart as well.
I've run this countless times, and anyone is welcome to shoot me a PM to set up a possible sherpa run, or to get my GT for a quick run. I am on xbox one
Have a great day guardians. | 0non-cybersec
| Reddit |
Wi-fi turns off randomly. <p>Wi-Fi in my laptop (intel wireless3945 abg) turns off randomly (hardware turn off) it disappear from hardware list and its light is going off. I think that it is going down when my computer starts to save power and turning it off for a moment, then it cannot bring it back again.</p>
<p>When I click on button that turn off / on wi fi. I can turn off but then I can not turn on. Sometimes option find new hardware in Hardware View helps and wi fi is being reinitialized (but it is rarely thing).</p>
<p>Do you have and Idea what should I do I have drivers from 15/09/09. Version 13.0.0.107. </p>
<p>I unchecked option that lets turning off wi fi in Hardware View under Power Management (Allow the computer to turn off this device to save power).</p>
<p>The same on windows xp and windows 7</p>
<p>I think that it might be some problem with drivers because when I restart my computer wifi sometime is working and sometime not. But when I hibernate / dehibernate it always works.</p>
<p>Laptop model hp 6710s</p>
| 0non-cybersec
| Stackexchange |
[FOTD] Love this lipstick! Rimmel's Coral Queen. | 0non-cybersec
| Reddit |
Rate/Critique my Proposed Build. I’m really new to the build scene but I’ve been researching and this is the build I came up with, my main goals are that it runs games reasonably with mid to high graphics and will be able to play Half-Life: Alyx. If you could help me fine tune or add anything important I missed that would be great! Whole build costs about $1,500 (includes shipping) Also if you don’t want to read the parts list here’s the pcpartpicker link: (ignore monitor)
https://pcpartpicker.com/list/kjyYCL
Core i7-8700K 3.7 GHz 6-Core Processor ($349.99 @ Newegg)
CPU Cooler: Cooler Master Hyper 212 RGB Black Edition 57.3 CFM CPU Cooler ($41.68 @ Amazon)
Motherboard: Asus TUF Z390-PLUS GAMING (WI-FI) ATX LGA1151 Motherboard ($169.99 @ Best Buy)
Memory: Team T-Force Delta RGB 16 GB (2 x 8 GB) DDR4-3200 CL16 Memory ($79.98 @ Amazon)
Storage: Samsung 860 Evo 500 GB M.2-2280 Solid State Drive ($97.99 @ Amazon)
Storage: Seagate Barracuda Compute 2 TB 3.5" 7200RPM Internal Hard Drive ($54.99 @ Newegg)
Video Card: Zotac GeForce RTX 2060 6 GB GAMING Video Card ($299.99 @ Newegg)
Case: be quiet! Pure Base 600 ATX Mid Tower Case ($94.90 @ B&H)
Power Supply: Corsair CV 550 W 80+ Bronze Certified ATX Power Supply ($99.99 @ Amazon)
Optical Drive: Asus DRW-24F1ST DVD/CD Writer ($18.98 @ Amazon)
Operating System: Microsoft Windows 10 Home OEM 64-bit ($108.78 @ Other World Computing)
Case Fan: Cooler Master MF120R ARGB 3in1 59 CFM 120 mm Fans ($54.99 @ Amazon) | 0non-cybersec
| Reddit |
NGINX Reverse proxy with HTTPS. <p>Follow up of a previous <a href="https://unix.stackexchange.com/questions/568034/letsencrypt-wildcard-certficate-with-nfs-u-18-04/568224#568224">question</a> of mine.</p>
<h2>What I want to do?</h2>
<p>I want to have my reverse proxy [NGINX] to redirect incoming webtraffic (HTTP and HTTPS) to the correct server based on the sub-domain.</p>
<p>The traffic towards the reverseproxy (RP) from the internet should be with HTTPS while inside my network I don't mind http traffic.</p>
<h2>What is my current situation?</h2>
<p>I got my webservices running, as of now only 2, iRedMail and Kanboard.
Both can be reached via http without a problem.
I was able to share my wildcard certificate from my RP with my other servers (I learned later, this isn't necessary).</p>
<p>However, when I try to reach my Servers domain-name via https over Firefox I get <code>PR_END_OF_FILE_ERROR</code> and via Chrome <code>ERR:CONNECTION_CLOSED</code>. In this case it doesn't matter if I try to reach the webserver on the RP itself or the other 2.</p>
<p>Meaning I understood the NGINX with http proxy but failed when it came to certificates and https proxy.</p>
<p>For my configurations please check out the following pastebins, I don't want this post to be to long. All pasts will be <strong>available for 6 Months</strong>, and I will edit this post to add my failed configuration, if there is any.</p>
<ul>
<li><a href="https://pastebin.com/dqD1JW5i" rel="nofollow noreferrer">Reverse-Proxy</a></li>
<li><a href="https://pastebin.com/KurAMdJ9" rel="nofollow noreferrer">Kanboard</a></li>
<li><a href="https://pastebin.com/kb6y2hFf" rel="nofollow noreferrer">iRedMail</a></li>
<li><a href="https://pastebin.com/g3ECBLZC" rel="nofollow noreferrer">DNS-Provider</a></li>
</ul>
<p>And finally the output of logs I thought about:</p>
<pre><code> (Reverse-Proxy)> sudo nano /var/log/nginx/error.log
2020/02/21 07:07:46 [error] 9213#9213: *1 no "ssl_certificate" is defined in server listening on SSL port while SSL handshaking, client: XXX.XXX.XXX.XXX, server: 0.0.0.0:443
2020/02/21 07:08:27 [error] 9213#9213: *2 no "ssl_certificate" is defined in server listening on SSL port while SSL handshaking, client: XXX.XXX.XXX.XXX, server: 0.0.0.0:443
2020/02/21 07:11:46 [error] 9320#9320: *1 no "ssl_certificate" is defined in server listening on SSL port while SSL handshaking, client: XXX.XXX.XXX.XXX, server: 0.0.0.0:443
2020/02/21 07:12:03 [error] 9320#9320: *2 open() "/usr/share/nginx/html/favicon.ico" failed (2: No such file or directory), client: XXX.XXX.XXX.XXX, server: www.domain.net, request: "GET /favic$
2020/02/21 07:12:07 [error] 9320#9320: *3 no "ssl_certificate" is defined in server listening on SSL port while SSL handshaking, client: XXX.XXX.XXX.XXX, server: 0.0.0.0:443
2020/02/21 07:23:12 [error] 9320#9320: *4 no "ssl_certificate" is defined in server listening on SSL port while SSL handshaking, client: XXX.XXX.XXX.XXX, server: 0.0.0.0:443
2020/02/21 07:23:12 [error] 9320#9320: *5 no "ssl_certificate" is defined in server listening on SSL port while SSL handshaking, client: XXX.XXX.XXX.XXX, server: 0.0.0.0:443
2020/02/21 07:23:17 [error] 9320#9320: *6 no "ssl_certificate" is defined in server listening on SSL port while SSL handshaking, client: XXX.XXX.XXX.XXX, server: 0.0.0.0:443
2020/02/21 07:23:47 [error] 9320#9320: *7 no "ssl_certificate" is defined in server listening on SSL port while SSL handshaking, client: XXX.XXX.XXX.XXX, server: 0.0.0.0:443
2020/02/21 07:24:47 [error] 9320#9320: *8 no "ssl_certificate" is defined in server listening on SSL port while SSL handshaking, client: XXX.XXX.XXX.XXX, server: 0.0.0.0:443
2020/02/21 07:29:47 [error] 9320#9320: *10 no "ssl_certificate" is defined in server listening on SSL port while SSL handshaking, client: XXX.XXX.XXX.XXX, server: 0.0.0.0:443
2020/02/21 07:39:48 [error] 9320#9320: *11 no "ssl_certificate" is defined in server listening on SSL port while SSL handshaking, client: XXX.XXX.XXX.XXX, server: 0.0.0.0:443
2020/02/21 07:53:21 [error] 9320#9320: *12 no "ssl_certificate" is defined in server listening on SSL port while SSL handshaking, client: XXX.XXX.XXX.XXX, server: 0.0.0.0:443
</code></pre>
<p>I tried this from 7 am to 9 am, but the log stopped with errors around 8 am. I also checked the logs of the Kanboard server, but nothing was reported, neither for access nor error.</p>
<h2>What I have checked so far:</h2>
<ol>
<li>If I change the portforward for https directly to my mailserver I can access it without a problem</li>
<li>I checked my RP-config for path errors regarding the certificate</li>
</ol>
<h2>Stacks I went through so far:</h2>
<p><a href="https://serverfault.com/questions/706694/use-nginx-as-reverse-proxy-for-multiple-servers">NGINX RP for multiple Server</a>,<a href="https://serverfault.com/questions/273679/redirecting-to-other-internal-servers-based-on-sub-domain/273694#273694">Redirect via Subdomain</a>,<a href="https://superuser.com/questions/1335598/setup-home-network-with-multiple-ssl-devices-on-one-ip/1335800#1335800">NGINX SSL in Home Network</a></p>
<p>Please tell me if you need anymore information.<br>
PS: All IPs and Domains have been altered by me.<br>
PPS: The pastebins have also been used for my certificate question.</p>
<h2>EDITS:</h2>
<ul>
<li>Pastebin - Reverseproxy has been tweaked regarding the SSL config. (look for the ## in the pastebin). New error message <code>ERR_TOO_MANY_REDIRECTS</code> for access on subdomains. Domain itselfs works partly.</li>
<li>Pastebin - Reverseproxy has been tweaked again, to a solution I found. Each change has been commented with ## again</li>
</ul>
| 0non-cybersec
| Stackexchange |
Is my example of non equivalent maps correct?. <p>We define two smooth maps $f: (\mathbb R, 0) \to (\mathbb R^2, 0)$ and $g: (\mathbb R, 0) \to (\mathbb R^2, 0)$ to be equivalent if there exist diffeomorphisms $\tau : \mathbb R \to \mathbb R$ and $\mu: \mathbb R^2 \to \mathbb R^2$ such that</p>
<p>$$ \mu \circ f = g \circ \tau$$</p>
<p>I wanted to provide an example of non equivalent maps. </p>
<blockquote>
<p>Please could someone tell me if my example is correct?</p>
</blockquote>
<p>Let $f(x) = (0,0)$ be the constant zero map and $g(x) = (x,x)$ the ''diagonal inclusion''. </p>
<p>To see that $f$ and $g$ are not equivalent assume they were. Then there are diffeomorphisms $\tau, \mu$ such that</p>
<p>$$ \mu \circ f = g \circ \tau$$</p>
<p>Then taking the derivative we get</p>
<p>$$ (D\mu) (Df) = (Dg)(D\tau)$$</p>
<p>where $D$ denotes the Jacobian. Since $\tau, \mu$ are diffeomorphisms, $D\tau$ and $D\mu$ are invertible. But because $Df=0$ the LHS is zero while the RHS is not. A contradiction. </p>
| 0non-cybersec
| Stackexchange |
I made the momofuku milk bar crack pie this weekend. It was the most amazing thing ever. Recipe posted in comments.. | 0non-cybersec
| Reddit |
Throwback: that time when /r/wow reacted to Blizzard announcing Worgen's new racial mount. | 0non-cybersec
| Reddit |
Record button disabled in Xcode UI Test Target. <p>I know similar questions have been posted, but from my investigating, there has not been a solution posted, at least not one that works. I have successfully run UI tests only from sample projects in both Swift and Obj-C.</p>
<p>I am trying (unsuccessfully) to integrate UI tests into an existing Xcode Obj-C project, which seems to be another issue altogether. Here are the steps I have taken:</p>
<ol>
<li>Created a new UI Test target within my project</li>
<li>Ensured that 'Enable Testability' has been set to YES for the target I am testing</li>
<li>Cleaned, cleaned build folder, rebuilt the app, restarted Xcode and everything else I could think of.</li>
</ol>
<p>When I do this, the test target is available but the record button is greyed out (disabled) and there are no play buttons in the gutter to execute the tests. There is nothing visual about the test class that would indicate that it is a test class. When I place my cursor in the test method, the record button remains disabled.</p>
<p>Is there anything I've left out? Anything else to check that might be preventing UI tests?</p>
| 0non-cybersec
| Stackexchange |
Stating a linear program - problems with its caption. <p>I found <a href="https://tex.stackexchange.com/questions/222953/stating-linear-program">here</a> a possibility for stating linear programs. But if I have several LPs and change for example one of the constraints, the positions of the captions get lost - only the last of them is correct. Is it possible to fix it? Or even better: how can I write the caption next to the LP (just like for the first LP in the picture)?</p>
<p>Here's my code:</p>
<pre><code>\documentclass{scrbook}
\usepackage{mathtools,zref-savepos}
\parindent0mm
\begin{document}
\zsavepos{text-left-margin}%
Heres is some text.
\begin{alignat*}{4}
& \zsavepos{top-lp}\text{min} \quad \mathrlap{\sum_{a \in A} k_a u_a + \sum_{r \in R} \sum_{a \in A} f_a^r y_a^r} \\
& \text{s.t.} \quad & \smashoperator{\sum_{a \in \delta_i^+}} y_a^r - \smashoperator{\sum_{a \in \delta_i^-}} y_a^r
&= t & \quad & (\forall r \in R)(\forall i \in V) \\
& & y_a^r &\leq u_a && (\forall r \in R)(\forall a \in A) \\
& & u_a &\in \{0,1\} && (\forall a \in A) \\
& & y_a^r &\in [0,1] && (\forall r \in R)(\forall a \in A)\zsavepos{bottom-lp}
\raisebox{0.5\dimexpr\zposy{top-lp}sp-\zposy{bottom-lp}sp}[0pt][0pt]{%
\makebox[0pt][r]{\rlap{(LP)}\hspace*{\dimexpr\zposx{bottom-lp}sp-\zposx{text-left-margin}sp}}}
\end{alignat*}
Text...
\begin{alignat*}{4}
& \zsavepos{top-lp}\text{min} \quad \mathrlap{\sum_{a \in A} k_a u_a + \sum_{r \in R} \sum_{a \in A} f_a^r y_a^r} \\
& \text{s.t.} \quad & \smashoperator{\sum_{a \in \delta_i^+}} y_a^r - \smashoperator{\sum_{a \in \delta_i^-}} y_a^r
&= t & \quad & (\forall r \in R) \\
& & y_a^r &\leq u_a && (\forall r \in R) \\
& & u_a &\in \{0,1\} && (\forall a \in A) \\
& & y_a^r &\in [0,1] && (\forall r \in R)\zsavepos{bottom-lp}
\raisebox{0.5\dimexpr\zposy{top-lp}sp-\zposy{bottom-lp}sp}[0pt][0pt]{%
\makebox[0pt][r]{\rlap{(LP)}\hspace*{\dimexpr\zposx{bottom-lp}sp-\zposx{text-left-margin}sp}}}
\end{alignat*}
Text...
\begin{alignat*}{4}
& \zsavepos{top-lp}\text{min} \quad \mathrlap{\sum_{a \in A} k_a u_a + \sum_{r \in R} \sum_{a \in A} f_a^r y_a^r} \\
& \text{s.t.} \quad & \smashoperator{\sum_{a \in \delta_i^+}} y_a^r - \smashoperator{\sum_{a \in \delta_i^-}} y_a^r
&= abc & \quad & \\
& & y_a^r &\leq u_a && a \in A\\
& & u_a &\in \{0,1\} && \\
& & y_a^r &\in [0,1] && \zsavepos{bottom-lp}
\raisebox{0.5\dimexpr\zposy{top-lp}sp-\zposy{bottom-lp}sp}[0pt][0pt]{%
\makebox[0pt][r]{\rlap{(LP)}\hspace*{\dimexpr\zposx{bottom-lp}sp-\zposx{text-left-margin}sp}}}
\end{alignat*}
\end{document}
</code></pre>
<p>And this is the result:</p>
<p><a href="https://i.stack.imgur.com/KlAmP.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KlAmP.jpg" alt="incorrectLPs"></a></p>
| 0non-cybersec
| Stackexchange |
Overwatch styled as an anime intro. | 0non-cybersec
| Reddit |
... Wow. Such a deal!. | 0non-cybersec
| Reddit |
NSFW Little girl holding big scissors. . | 0non-cybersec
| Reddit |
Moral Muteness: Being a whistle-blower without blowing the whistle. | 0non-cybersec
| Reddit |
How will you see TFA?. Will you be going to see it in standard 2D? 3D? IMAX 2D? IMAX 3D? When will you be seeing it? Personally, I'm going for IMAX 2D release night. | 0non-cybersec
| Reddit |
Horror tattoo by Steve Butcher from New Zealand. | 0non-cybersec
| Reddit |
how to get value of type="color" input using javascript. <p>I used this above html code for my project..but i don't know how to get value of above input using javascript</p>
<pre><code><form>
<input type="color" id="favcolor">
</form>
</code></pre>
<p>can someone help me ?</p>
<p>Thanks </p>
| 0non-cybersec
| Stackexchange |
Yay! Free nose job!. | 0non-cybersec
| Reddit |
jQuery, how to use multiple cached elements. <p>For my project I'm using cached selectors to speed up, and see improvements:
(to reduce searches inside the document)</p>
<pre><code>var sel1 = $('#selector1');
var sel2 = $('#selector2');
</code></pre>
<p>how can I use cached selectors in this situation? for ex:</p>
<pre><code>$('#selector1, #selector2').fadeTo(300, 1, 'linear');
</code></pre>
<p>It's just to polish up my code</p>
<p>Ty :)</p>
| 0non-cybersec
| Stackexchange |
ITAP of The Tower of London with the Poppies. | 0non-cybersec
| Reddit |
My favorite sign I saw at the Stand with Texas Woman events today. | 0non-cybersec
| Reddit |
How to connect to `tcp://192.168.202.112:11053` by command line?. <pre><code>tcp://192.168.202.112:11053
</code></pre>
<p>I've ensured the service is on,but when <code>telnet 192.168.202.112 11053</code>,connection fails,why?</p>
| 0non-cybersec
| Stackexchange |
Android Emulator hang up and impossible to quit. <p>I've installed the Android plugin on Eclipse 3.6 in a regular way (aka i followed step by step the google installation page). </p>
<p>When I launch any sample application, everything works fine, but if I try to quit the emulator (by clicking the exit cross button of the emulator), the emulator seems to hang completly.</p>
<p>What is very bothering is that I can't even kill the process, launch another emulator or even reboot my pc, since the process seems to be impossible to stop or kill.</p>
<p>Does anyone have similar problem, and a solution to give?</p>
| 0non-cybersec
| Stackexchange |
Can't show clock in OSX menu bar. <p>Recently the clock on my OSX menu bar has disappeared for no apparent reason. I'm using OSX 10.10.5</p>
<p>I try to add it again by going to System Preferences --> Date & Time --> Clock --> Show date and time in menu bar.</p>
<p>When I click on the option box, after about a second it seems to just uncheck itself. No error or warning is provided.</p>
<p>How can I make the clock appear in my menu bar again?</p>
| 0non-cybersec
| Stackexchange |
How can I insert an image with zenity?. <p>I have tried <code>--window-icon</code> in zenity by giving the image path, but it is not working... The code I tried is:</p>
<pre><code>zenity --window-icon "/home/pavan/Downloads/badge.png" --title "Search Box" --text "Type to search.." --entry --width 2000
</code></pre>
<p>I also tried <code>--window-icon=/home/pavan/Downloads/badge.png</code>, but that didn't work either.</p>
| 0non-cybersec
| Stackexchange |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange |
Relation between divisible R-module and Frac(R). <p>In the proof of the following lemma taken from Enochs's book: "Relative Homological Algebra", I don't figure out two things:</p>
<p>1) Why can <span class="math-container">$G$</span> be embedded as a submodule of a torsion-free and divisible module <span class="math-container">$G'$</span>?</p>
<p>2) Why is a torsion-free and divisible <span class="math-container">$R$</span>-module necessarily isomorphic to a direct sum of copies of <span class="math-container">$\operatorname{Frac}(R)$</span>?</p>
<p><a href="https://i.stack.imgur.com/VrFCo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VrFCo.png" alt="enter image description here"></a> </p>
| 0non-cybersec
| Stackexchange |
ELI5:Sooooo... is a tumor edible? Is it meat? Will it kill you if you eat it? (sorry for grossness). | 0non-cybersec
| Reddit |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange |
TIL that the last words of President James K. Polk, to his wife, were: "I love you Sarah. For all eternity, I love you.". | 0non-cybersec
| Reddit |
Wrong time on Docker debian container despite NTP. <p>I am creating a simple debian-based docker (<code>php:7-apache</code>). To create it I use:</p>
<pre><code>docker run -d -p 80:80 --name myname -v "$PWD":/var/www/html php:7-apache
</code></pre>
<p>I noticed that my docker is possibly suffering from <a href="https://forums.docker.com/t/time-in-container-is-out-of-sync/16566/6" rel="nofollow noreferrer">this</a> issue, therefore now, each time I run the container, I also run:</p>
<pre><code>docker run -it --rm --privileged --pid=host php:7-apache nsenter -t 1 -m -u -n -i date -u $(date -u +%m%d%H%M%Y)
</code></pre>
<p>This fixed my issue. The clock is now ok. However, before trying this, I simply tried to install ntp on the docker and set it up:</p>
<pre><code># apt-get install ntp
# vi /etc/ntp.conf # commented pools and added these servers http://www.pool.ntp.org/zone/europe
# /etc/init.d/ntp start
# /usr/bin/ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
v.bsod.fr 193.190.230.66 2 u 24 64 1 32.924 -117284 0.004
tomia.ordimatic 62.210.36.58 3 u 23 64 1 26.158 -117286 0.004
pacifica.ufp.ne 162.23.41.10 2 u 25 64 1 27.922 -117281 0.004
aquila.init7.ne 189.247.1.117 2 u 24 64 1 34.736 -117291 0.004
# date
...WRONG DATE!!!
</code></pre>
<p>So, why isn't ntp working?
I would assume it's better to get NTP to work so that if drifts occur they are correct automatically, instead of setting by hand once the clock from my host system.</p>
<p>Thanks</p>
<p><strong>EDIT: Second Try</strong></p>
<pre><code>apt-get install ntp
# setting time
sed 's/pool /#pool /g' /etc/ntp.conf > /tmp/ntp.conf.tmp
echo "server 0.europe.pool.ntp.org" >> /tmp/ntp.conf.tmp
echo "server 1.europe.pool.ntp.org" >> /tmp/ntp.conf.tmp
echo "server 2.europe.pool.ntp.org" >> /tmp/ntp.conf.tmp
echo "server 3.europe.pool.ntp.org" >> /tmp/ntp.conf.tmp
mv /tmp/ntp.conf.tmp /etc/ntp.conf
ntpd -qxg | grep "ntpd:"
/etc/init.d/ntp start
echo "Date on ws container: `date` - correct: `(curl time.correct.com?iso)2>/dev/null`"
</code></pre>
<p>Gives me:</p>
<pre><code>13 Apr 11:40:47 ntpd[922]: ntpd: time slew +14.502687 s
ntpd: time slew +14.502687s
[ ok ] Starting NTP server: ntpd.
Date on ws container: Fri Apr 13 11:40:47 UTC 2018 - correct: 2018-04-13T11:41:02Z
</code></pre>
<p>So, despite trying to set the time manually with ntpd (ntpdate is deprecated as per <a href="http://doc.ntp.org/4.1.0/ntpd.htm" rel="nofollow noreferrer">http://doc.ntp.org/4.1.0/ntpd.htm</a>), and do getting that I'm 14 seconds behind, the container doesn't get the time set. Any idea on my mistake?
The script above is run with a <code>docker exec</code> (with or without --privilege doesn't make a difference).</p>
<p>The full output of <code>ntpd -qxg</code> is as follows:</p>
<pre><code>13 Apr 12:52:43 ntpd[922]: ntpd [email protected] Sun Feb 25 21:22:55 UTC 2018 (1): Starting
13 Apr 12:52:43 ntpd[922]: Command line: ntpd -qxg
13 Apr 12:52:43 ntpd[922]: proto: precision = 3.398 usec (-18)
13 Apr 12:52:43 ntpd[922]: Listen and drop on 0 v6wildcard [::]:123
13 Apr 12:52:43 ntpd[922]: Listen and drop on 1 v4wildcard 0.0.0.0:123
13 Apr 12:52:43 ntpd[922]: Listen normally on 2 lo 127.0.0.1:123
13 Apr 12:52:43 ntpd[922]: Listen normally on 3 eth0 172.17.0.3:123
13 Apr 12:52:43 ntpd[922]: Listening on routing socket on fd #21 for interface updates
13 Apr 12:52:50 ntpd[922]: ntpd: time slew -2.923397 s
ntpd: time slew -2.923397s
</code></pre>
<p><strong>EDIT2: Found solution!</strong></p>
<p>Solution follows. The answer by @kubanczyk is correct, but in the specifics of Docker we need to super-power the manual time update:</p>
<pre><code># apt-get install ntp
# nsenter -t 1 -m -u -n -i ntpd -qxg
# /etc/init.d/ntp start
</code></pre>
| 0non-cybersec
| Stackexchange |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.