content
stringlengths 7
2.61M
|
---|
On the hyperbolicity of random graphs Let $G=(V,E)$ be a connected graph with the usual (graph) distance metric $d:V \times V \to N \cup \{0 \}$. Introduced by Gromov, $G$ is $\delta$-hyperbolic if for every four vertices $u,v,x,y \in V$, the two largest values of the three sums $d(u,v)+d(x,y), d(u,x)+d(v,y), d(u,y)+d(v,x)$ differ by at most $2\delta$. In this paper, we determinate the value of this hyperbolicity for most binomial random graphs. Introduction Hyperbolicity is a property of metric spaces that generalizes the idea of negatively curved spaces like the classical hyperbolic space or Riemannian manifolds of negative sectional curvature (see, for example, ). Moreover, this concept can be applied to discrete structures such as trees and Cayley graphs of many finitely generated groups. The study of properties of Gromov's hyperbolic spaces from a theoretical point of view is a topic of recent and increasing interest in graph theory and computer science. Informally, in graph theory hyperbolicity measures how similar a given graph is to a tree-trees have hyperbolicity zero and graphs that are "tree-like" have "small" hyperbolicity. Formally, a connected graph G = (V, E) is -hyperbolic, if for every four vertices u, v, x, y ∈ V, the two largest values in the set {d(u, v) + d(x, y), d(u, x) + d(v, y), d(u, y) + d(v, x)} differ by at most 2. The hyperbolicity of G, denoted by H (G), is the smallest for which this property holds. In several equivalent conditions for a graph to be 0-hyperbolic are given, and in the authors characterize 1/2-hyperbolic graphs in terms of forbidden subgraphs. On the algorithmic side, by the conditions investigated in, 0-hyperbolic graphs can be recognized in linear time, and in it is shown that recognizing 1/2-hyperbolic graphs is equivalent to finding an induced cycle of length 4 in a graph. Fast algorithms for computing the hyperbolicity of large-scale graphs are given in. The study of this parameter is motivated by the following observations: on the algorithmic side, in fast algorithms for computing properties related to the diameter of graphs with small hyperbolicity are given. In the authors give a simple construction how to approximate with small error the distances in graphs with small hyperbolicity by trees, and in, the authors give a polynomial algorithm which allows for such graphs to find the minimum number of edges needed such that the augmented graph has still small diameter. Finally, in it is shown that all cop-win graphs in which the cop and the robber move at different speeds have small hyperbolicity. Moreover, the concept of hyperbolicity turns out to be useful for many applied problems such as visualization of the Internet, the Web graph, and other complex networks, routing, navigation, and decentralized search in these networks. In particular, the hyperbolicity plays an important role in investigating the spread of viruses through the network. Let us recall a classic model of random graphs that we study in this paper. The binomial random graph G(n, p) is defined as a random graph with vertex set = {1, 2,..., n} in which a pair of vertices appears as an edge with probability p, independently for each such a pair. As typical in random graph theory, we shall consider only asymptotic properties of G(n, p) as n → ∞, where p = p(n) may and usually does depend on n. We say that an event in a probability space holds asymptotically almost surely (a.a.s.) if its probability tends to one as n goes to infinity. In this paper, we investigate hyperbolicity for binomial random graphs. Surprisingly, this important graph parameter is not well investigated for random graphs which is an important and active research area with numerous applications. In, sparse random graphs (p = p(n) = c/n for some real number c > 1) are analyzed. It was shown that G(n, p) is, with positive probability, not -hyperbolic for any positive. Nothing seems to be known for p n −1. On the other hand, it is known that for a random d-regular graph G, for d ≥ 3, we have that a.a.s. where (n) is any function tending to infinity together with n. (In fact, almost geodesic cycles are investigated in, and this is an easy consequence of this result.) The hyperbolicity of the class of Kleinberg's small-world random graphs is investigated in. Let j ≥ 2 be the smallest integer such that d j /n − 2 log n → ∞. Then, the following properties hold a.a.s. (i) If j is even and d j−1 ≤ 1 16 n log n, then H (G) = j/2. (ii) If j is even and d j−1 > 1 16 n log n (but still d j−1 ≤ (2 + o)n log n), then (iii) If j is odd, then H (G) = (j − 1)/2. Furthermore, the following complementary results hold. Remark. It seems that with quite a bit more work, we could slightly push the lower bound required for d and require only that d log 3 n or perhaps even only d log 2 n. Unfortunately, it seems it is more difficult to investigate sparser graphs (that is, assuming only d log n or even closer to the connectivity threshold). Therefore, we aim for an easier (and cleaner) argument in this paper, leaving the investigation of sparser graphs as an open problem. Let us also mention that the hyperbolicity is not determined precisely for dense graphs right before the diameter decreases from even j to j − 1 (case (ii) in Theorem 1.1). Again, the constant 1 16 could be slightly improved with a more delicate argument but the gap cannot be closed with the current approach. This is also worth investigating and (unfortunately) left open at the moment. Preliminaries In this section, we introduce a few useful lemmas. The following result is well-known but we include the proof for completeness. Proof. Consider any four vertices u, v, x, y with their three sums of distances Clearly, d 1 ≤ 2D. First observe that by applying the triangle inequality four times, Hence, if d 3 ≤ D, the required condition holds and we are done. Otherwise, d 3 > D and so also d 2 > D. As a consequence, d 1 − d 2 < 2D − D = D, and we are done as well. We can slightly improve the upper bound for graphs with odd diameter. Proof. As in the previous proof, we consider four vertices u, v, x, y with their three sums of distances Arguing as in the previous proof, we get that So the only case to analyze is when and D is odd, we may assume (without loss of generality) that d(u, y) < D/2. Then, since and D = d(x, y) ≤ d(x, u) + d(u, y), we have d(y, v) > D/2, d(x, u) > D/2, and we have that d 2 = d(u, x) + d(v, y) > D, contradicting our assumption on d 2. Therefore, d 1 − d 2 ≤ D − 1, and the lemma follows. In order to bound the hyperbolicity from above, we will make use of the following result for random graphs, see . Then the diameter of G ∈ G(n, p) is equal to i a.a.s. From the proof of this result, we have the following corollary. Corollary 2.4. Suppose that d = p(n − 1) log n and that Then the diameter of G ∈ G(n, p) is at most i a.a.s. In order to obtain a lower bound on the hyperbolicity, we will need the following expansion lemma investigating the shape of typical neighbourhoods of vertices. Before we state the lemma we need a few definitions. For any j ≥ 0, let us denote by N (v, j) the set of vertices at distance at most j from v, and by S(v, j) the set of vertices at distance exactly j from v. Also, for a set of vertices F ⊆ V, and x ∈ V \ F, denote by N V \F (x, j) the set of vertices in V \ F at distance at most j from x in the graph induced by V \ F, and similarly let S V \F (x, j) be the set of vertices in V \ F at distance exactly j from x in the graph induced by V \ F. Let G = (V, E) ∈ G(n, p) and let i ≥ 4 be the largest even integer such that d i−1 ≤ 1 16 n log n. there is no edge from v to F. In particular, it follows that a.a.s. the following properties hold: (iii) for all j = 1, 2,..., i/2 − 1,, (vii) for any fixed partition of the neighbours of v into two sets, V L and V R, such that ||V L | − |V R || ≤ 1, let S L denote the set of vertices of S(v, i/2 − 1) that are at distance i/2 − 2 from V L, and let S R = S(v, i/2 − 1) \ S L ; then,, and v ∈ V \ F. Consider the random variable X = X(F, v) = |S V \F (v, 1)|. We will bound X in a stochastic sense. There are two things that need to be estimated: the expected value of X, and the concentration of X around its expectation. Since X ∈ Bin(n − f − 1, p), it is clear that A consequence of Chernoff's bound (see e.g. ) is that for 0 < < 3/2. Hence, after taking = 2 log n/d, we get that with probability 1 + o(n −1 ) we have This proves part (i) of the lemma. Part (ii) is straightforward since the probability that there is no edge from v to F is equal to Part (iii) is a straightforward implication of (i). In order to have good bounds on the ratios of the cardinalities of N (v, 1), N (v, 2), and so on, we consider the Breadth First Search (BFS) algorithm that explores vertices one by one (instead of the whole j-th neighbourhood). Formally, the process is initiated by putting v into the queue Q. In each step of the algorithm, one vertex w is taken from Q and edges from w to all vertices that are not in F and have not yet been discovered are examined. All new neighbours of w that are found are put into the queue Q. The process continues until the queue Q is empty or vertices of are in the queue Q; that is, no vertex from this sphere is processed and, in particular, edges in the graph induced by S V \F (v, i/2 − 1) are not exposed yet.) Suppose that N V \F (v, j − 1) is discovered and we continue investigating vertices of the sphere S V \F (v, j − 1), one by one, that are in the queue Q. Provided O(d i/2−1 ) vertices have been discovered so far, it follows from part (i) that we may assume that when each vertex of After that we update F by adding all newly discovered vertices to it, adding the vertex processed at this step, and removing the next vertex to be processed-see Figure 1. We consider this up to the j'th iterated neighbourhood, where j = i/2 − 1 and d i−1 ≤ n log n/16 and thus j = O(log n/ log log n). Then the cumulative multiplicative error term is Figure 1. Two consecutive steeps of BFS started from vertex v. The black vertex is the vertex currently exposed. Grey vertices form the set F that is updated each time. White vertices are newly discovered ones. This establishes (iii). For parts (iv), (v), and (vi) we note that in each step of the BFS algorithm the probability that there is no edge from w (the vertex that is processed at this point) to vertices that have been already discovered is, by part (ii), 1 − O(d i/2 /n). Hence, by the union bound, a.a.s. this never happens since the number of vertices processed is The claim follows. Part (vii) follows immediately (and deterministically) from (iv), (v), and (vi). The proof of the lemma is finished. We first give the proof of the result for very dense graphs. Proof of Theorem 1.1(iv)-(v). For p = 1 − o(1/n 2 ), note that the expected number of edges in the complement of G is n 2 (1 − p) = o, and thus by Markov's inequality, a.a.s., G is the complete graph on n vertices. If this is the case, then d(u, v) = 1 for any pair of vertices u and v, and thus for any four vertices u, v, x, y, clearly, For p = 1 − 2c/n 2 and c > 0, note that a.a.s. there is no component of size 3 or more in the complement of G. Thus, a.a.s., for all four-tuples of vertices in the original graph, either all edges are present, only one edge is missing, or two disjoint edges are missing. In all of these cases, the non-adjacent vertices are at distance 2, and thus a.a.s. H (G) ≤ 1. The expected number of edges in the complement of G equals n 2 (1 − p) = (1 + o)c. Also, for any fixed r, the r-th moment of the number of edges in the complement of G equals c r (1 + o), and thus, by the method of moments (see, for example, Theorem 1.22 of ) the number of edges converges to a random variable with a Poisson distribution with parameter c. In particular, with probability (1+o)e −c, the complement of G is empty, and by the argument in the first case, we have H (G) = 0. Also, with probability (1 + o)ce −c, the complement of G contains exactly one edge, say {u, v}. For the four-tuples not containing both u and v, the analysis is as before. For a four-tuple u, v, x, y we now have for the distances in the original graph x) = 2, and thus H (G) ≥ 1, and part (iv) follows. The main challenge of this paper is to prove the following result and the whole next section is dedicated to it. Here, we show how Theorem 1.1(i)-(iii) can be derived from it. Let i ≥ 2 be the largest even integer such that d i−1 ≤ 1 16 n log n. Let G ∈ G(n, p). Then, a.a.s., Proof of Theorem 1.1(i)-(iii). Fix j to be the smallest integer such that d j /n − 2 log n → ∞. In particular, d j+1 /n = (log n). Moreover, it follows from Corollary 2.4 that the diameter of G is at most j a.a.s. Hence, by Lemma 2.1, a.a.s. H (G) ≤ j/2. This establishes upper bounds in parts (i) and (ii). Suppose first that j is even and that d j−1 ≤ 1 16 n log n. Then j is the largest even integer such that d j−1 ≤ 1 16 n log n. By Theorem 2.6, a.a.s. H (G) ≥ j/2 and part (i) holds. Suppose next that j is even and that d j−1 > 1 16 n log n (note that it follows from the definition of j that d j−1 ≤ (2 + o)n log n). Then j − 2 is the largest even integer such that d j−3 ≤ 1 16 n log n, and by Theorem 2.6, a.a.s. H (G) ≥ j/2 − 1. This finishes part (ii). Finally, suppose that j is odd. Since d j−1 /n = O(log n), d j−2 /n = o(log n), and thus j −1 is the largest even integer such that d j−2 ≤ 1 16 n log n. By Theorem 2.6, a.a.s., H (G) ≥ (j −1)/2. Since a.a.s. the diameter of G is at most j, and j is odd, by Lemma 2.2 we have that a.a.s. H (G) ≤ (j − 1)/2. Part (iii) and so the whole proof is finished. Proof of Theorem 2.6 Let G = (V, E) ∈ G(n, p) and suppose that d = p(n − 1) log 5 n (log log n) 2 and p = 1 − (1/n 2 ). Let i ≥ 2 be the largest even integer such that d i−1 ≤ 1 16 n log n. Assume first that d > ( 1 16 n log n) 1/3 which implies that i = 2. In this case, we have to prove that a.a.s. H (G) ≥ 1. It therefore suffices to find four vertices u, v, x, y such that the subgraph induced by them is a 4-cycle. Since p > n −2/3 ( 1 16 log n) 1/3 and 1 − p = (n −2 ), the expected number of induced cycles of length 4 is n It is a straightforward application of the second moment method to show that a.a.s. there is at least one induced cycle in G and the statement follows in this case. Hence, from now on we may assume that which implies that i ≥ 4. We need one more definition: for a given u ∈ V, k ≥ 1, and A ⊆ V, we say that N V \A (u, k) expands well if for all j = 1, 2,..., k, Figure 2. left: Hyperbolicity(u, v, x, y), the big picture; right: the neighbourhood exposure around a in more detail and for all j = 1, 2,..., k − 1, every vertex of S V \A (u, j) has d(1 + o(log log n/ log 2 n)) neighbours in S V \A (u, j + 1). Finally, fix a four-tuple of different vertices u, v, x, y and consider the following process (see Figure 2):. Make sure that the following properties hold (otherwise stop the process): The reason that here we restrict ourselves to the induced graph is to make sure no edge in this graph is already exposed and so, as typical, we perform BFS by exposing edges one by one, as required.) Make sure that the following properties hold (otherwise stop): There is no edge from N V \D (v, i/2 − 1) to S(u, i/2 − 1) (note that edges from vertices of N (u, i/2 − 2) are already exposed, so that the only chance for the intersection of N V \D (v, i/2 − 1) and N (u, i/2 − 1) to be non-empty is when we reach vertices of S(u, i/2 − 1)). In this step, the neighbourhood of a is investigated. Unfortunately, this is slightly more complicated since some part of the neighbourhood of a is already "buried" in N (u, i/2 − 1). In order to accomplish our goal, we need to perform BFS not only from a (up to level i/2 − 2), but also from some other vertices of S(u, i/2 − 1) (this time going not as deep as i/2 − 2; the level until which the neighborhood is explored depends on the distance from a)-see Figure 2 (right side). Formally, for 1 ≤ k ≤ i/2 − 2, let S k be the set of vertices of S(u, i/2 − 1) that are at distance k from a in the tree induced by N (u, i/2 − 1). (In fact, k has to be even in order for S k to be non-empty, but we consider all values of k for simplicity.) Let We perform BFS from a and from vertices of i/2−2 k=1 S k in the graph induced by V \ F ; we reach vertices at distance i/2 − 2 from a and at distance i/2 − 2 − k from S k. Make sure that the following properties hold (otherwise stop). (n): N V \F (a, i/2 − 2) expands well. Moreover, for all 1 ≤ k ≤ i/2 − 2 and all ∈ S k we have that N (, i/2 − 2 − k) expands well. In particular, (o): There is no edge from N V \F (a, i/2−2)\{a} to F and for every k = 1, 2,..., i/2− 2 and every vertex ∈ S k, there is no edge from N V \F (, i/2 − 2 − k) \ { } to F. (p): All graphs exposed in this step are disjoint trees. Note that this implies that N (a, i/2 − 2) is a tree. (q): For 1 ≤ k ≤ i/2 − 2, let S k be the set of vertices of S(v, i/2 − 1) that are at distance k from b in the tree induced by N (v, i/2 − 1) and let Perform BFS from b and from vertices of i/2−2 k=1 S k in the graph induced by V \F ; Properties (n), (o), and (p) hold when a is replaced by b, F is replaced by F, and the sets S k are replaced by S k. (r): For 1 ≤ k ≤ i/2 − 2, let S k be the set of vertices of S(u, i/2 − 1) that are at distance k from c in the tree induced by N (u, i/2 − 1) and let Perform BFS from c and from vertices of Perform BFS from d and from vertices of i/2−2 k=1 S k in the graph induced by V \ F ; Properties (n), (o), and (p) hold when a is replaced by d, F is replaced by F, and the sets S k are replaced by S k. Let We perform BFS from x in the graph induced by V \ Q to expose N V \Q (x, i/2 − 1). Make sure that the following properties hold (otherwise stop): replaced by y and Q is replaced by R. It is the end of this tedious process so it is time for a short break-perform a fireworks show (fireworks are explosive pyrotechnic devices typically used for aesthetic, cultural, and religious purposes; here the main purpose is to celebrate finding an object with the desired properties). We say that the process Hyperbolicity(u,v,x,y) terminates successfully if all the required conditions are satisfied, that is, the process does not stop prematurely before reaching the end. For the distance between x and y observe the following: first, by Properties (j) and (l) there is an x − y path of length i going from x to a, then through u to c, and then to y. We will show that N (x, i/2 − 1) ∩ N (y, i/2 − 1) = ∅ and that there is no edge between S(x, i/2 − 1) and S(y, i/2 − 1). Indeed, if a shortest x − y-path first goes from x to a, by Properties (o), (r), (s) and (x), it has to go until S(a, i/2 − 2), and then it has to pass through at least two more edges before entering S(y, i/2 − 1), including S(c, i/2 − 2) and S(d, i/2 − 2), and in each case the length is at least i. By properties (q), (r), (s) and (x), the same holds if the path starts from x to b. If the path from x neither goes through a nor through b, it has to go through N V \Q (x, i/2 − 1). By Properties (u) and (x), it has to arrive at S(x, i/2 − 1), and then it has to go through at least two edges before entering S(y, i/2 − 1), including S(c, i/2 − 2) and S(d, i/2 − 2), and in each case the length is also at least i. Thus, by Claim 3.1, in order to show that a.a.s. H (G) ≥ i/2, it suffices to show that a.a.s. Hyperbolicity(u, v, x, y) succeeds for at least one four-tuple of vertices u, v, x, y. Let X u,v,x,y be the indicator random variable defined as follows: where the sum is taken over all n 4 4-tuples of all disjoint vertices. In order to prove that a.a.s. H (G) ≥ i/2, we will apply the second moment method to X. Define q = exp(−d i−1 /(2n)) and note that from the assumption that d i−1 ≤ 1 16 n log n we have q ≥ n −1/32. Proof. Fix a four-tuple of vertices u, v, x, y. First, we will calculate Pr (X u,v,x,y = 1). We will estimate for each of the five steps of Hyperbolicity(u,v,x,y) the probability that it fails at that step. For z ∈ {a, b,..., x}, let P z be the indicator random variable for the event that Property (z) succeeds provided that all previous Properties have succeeded as well. Similarly, for step z ∈ {1, 2,..., 5}, let T z be the indicator random variable for the event that step z succeeds provided that all previous steps have succeeded as well. By Lemma 2.5(iii) and (iv), P(P a = 1) = 1 + o. Let E be the event that there is no edge within the last sphere S V \B (u, i/2 − 1). By Lemma 2.5(v) and (vi), in order to calculate the probability that Property (b) holds, it remains to estimate the probability that E holds. We have where the last equality follows from Property (a) that is assumed to hold deterministically now. Hence, where the last line follows from the assumption that d i−1 ≤ 1 16 n log n. Hence, the probability that N V \B (u, i/2 − 1) is a tree is asymptotically equal to the probability that the event E holds, and thus ). Now, let us move to Property (c). By Lemma 2.5(ii) together with a union bound over all vertices in N V \B (u, i/2 − 2), we see that with probability there is no edge from N V \B (u, i/2 − 2) to B, and thus P(P c = 1) = 1 + o. Hence, ). Next, for Property (d), by Lemma 2.5(iii) and (iv), we obtain P(P d = 1) = 1 + o. For Property (e), since Property (d) is assumed to hold deterministically at this point, we have and hence, by the same calculations following we obtain P(P e = 1) = q 2 (1 + o ). The probability of having Property (f ) is calculated as before for Property (b), and of having Property (g) as before for Property (c). Thus, ). For Property (h) we immediately have by Lemma 2.5(vii) that P(P h = 1) = 1 + o, and the same applies to Property (i). For Property (j), since Property (h) is assumed to hold deterministically, we have where the last line follows from the fact that (d i−1 ) 1/2 = O( √ n log n) (by definition of i), and by, which implies that (d i−1 ) 1/2 √ d/n = O( d log n/n) = o. Note then that Properties (j), (k), (l) and (m) are symmetric and mutually independent, and thus calculated the same way. Therefore Let us move to investigating Properties (n), (o), and (p). First, we perform BFS from a in V \ F. It follows immediately from Lemma 2.5(iii) that N V \F (a, i/2 − 2) expands well and so the bound on |N V \F (a, i/2 − 2)| in Property (n) holds a.a.s. For the vertices in S k, since Properties (a) and (b) are assumed to hold deterministically, for every even value of k such that 2 ≤ k ≤ i/2 − 2, the number of vertices in S k is (1 + o)d k/2. In order to deal with the second bound of Property (n) (and to investigate Properties (o) and (p) at the same time), we mimic the proof of Lemma 2.5(iii). We perform BFS from some other vertex in some S k in V \ F, updating the set F every time a vertex is processed. As shown in Figure 1, the vertex that was processed before, together with all its neighbours, will be added to F, and the next vertex in the queue to be processed will be taken out of F. Once we are done, we take the next vertex in some S k and continue in this way until all neighbourhoods under consideration are discovered. Arguing as in the proof of Lemma 2.5(iii), by Lemma 2.5(i) together with a union bound over all vertices processed, we obtain the desired bounds for the sizes of neighbourhoods. Moreover, by Lemma 2.5(ii) together with a union bound over all vertices that are discovered during this step (at most O(d i/2−2 ) vertices), we get that a.a.s. at the time when a given vertex was processed there was no edge to already discovered vertices (neither within the same tree where we started BFS from, nor to other trees, nor to the initial set F ). This deals with Properties (o) and (p). Finally, it follows that a.a.s. where the last equality follows from the fact that d log 5 n/(log log n) 2. Thus, P(P n = 1 and P o = 1 and P p = 1) = 1 + o. The probabilities for Properties (q), (r) and (s) to hold are calculated in exactly the same way as for Properties (n), (o) and (p), and hence P(T 4 = 1) = 1 + o. Finally, for T 5, when exposing x, Property (t) is investigated as before. Also, by analogous calculations as for T 1, the probability of having no edge to Q (Property (u)) and the one of being a tree (Property (v)), altogether yield q 5 (1 + o); note that the exponent of 5 comes from the fact that N V \Q (x, i/2 − 1) is a tree (giving one q), and that there is no edge to S(u, i/2 − 1) (giving 2 additional factors of q), and no edge to S(v, i/2 − 1) (giving another 2 additional factors of q). Property (w) clearly also holds with probability 1 + o. Similarly, when exposing y, we also have to consider the condition of having no edge to N V \R (x, i/2 − 1) (Property (x)), giving us another factor of q 2, and thus yielding a probability of q 7 (1 + o). Thus, P(T 5 = 1) = q 12 (1 + o). Combining the events T 1, T 2,..., T 5, we obtain P(X u,v,x,y = 1) = (d i/2 /(2n)) 4 q 16 (1 + o), yielding the first part of the lemma. Observing that i is such that d i+1 > 1 16 n log n, and therefore d i > 1 16 n log n/d, and also using, we obtain ( 1 16 n log n) 2 384d 2 q 16 (1 + o) = (n 3/2 (log n/d) 2 ) = (n 5/6 (log n) 4/3 ), which finishes the proof of the lemma. We now move to the second moment method. Proof. In order to analyze the expected value of X 2 we will consider a number of different cases. Note that where both sums range over all 4-tuples of different vertices. For a fixed 4-tuple of vertices u, v, x, y, it follows from the first part of Lemma 3.2 that P(X u,v,x,y = 1) = (d i/2 /(2n)) 4 q 16 (1 + o). Conditioning on X u,v,x,y = 1, our goal is to investigate P(X u,v,x,y = 1|X u,v,x,y = 1). Note that the lower bound for E X 2 trivially holds and so we aim for an upper bound. Therefore, we focus on properties that hold with probability o in the unconditional case (such as Property (b) that holds with probability asymptotic to q). We ignore properties that hold with probability 1 + o in the unconditional case (such as Property (a)) although it might happen that the probability that they hold in the conditional space is smaller (which clearly helps). Assume that X u,v,x,y = 1, and let U be the set of vertices exposed to certify this, that is, x, y, a, b, c, d}, we always denote by z the vertex in Hyperbolicity(u, v, x, y ) corresponding to vertex z in Hyperbolicity(u, v, x, y). Before we move to investigating cases, let us note that we may assume the following useful properties. Claim 1: For a vertex z / ∈ U, the number of edges between N (z, i/2 − 1) \ U and U is O(log n). Proof. Indeed, we may assume that |N (z, i/2 − 1) \ U | = O(d i/2−1 ) and so the expected number of edges between N (z, i/2 − 1) \ U and U is O(pd i−2 ) = O(d i−1 /n) = O(log n). It follows from Chernoff's bound that there exists some constant C > 0 such that the probability to have at least C log n edges of this type is o(n −4 ). The contribution of all such four-tuples u, v, x, y to X 2 is o and so can be safely ignored. Proof. Indeed, suppose that there is an edge from N (z, i/2 − 1) \ U to U. In fact, since U is exposed during the BFS process, this edge has to be adjacent to a leaf of the graph induced by U. We need to estimate the size of N (, i/2 − 2) ∩ U, since vertices in N (z, i/2 − 1) ∩ U due to the existence of this edge form a subset of N (, i/2 − 2) ∩ U. From the fact that U induces an almost regular tree, it follows that |N (, i/2 − 2) ∩ U | = O(d i/4−1 ). The claim follows now from Claim 1. Now, we are ready for a case analysis. It follows from Claim 2 above that the part of the graph that needs to be exposed in order to check whether X u,v,x,y = 1 intersects with U only in a negligible way. It is straightforward to show that Properties (b), (e), (f ), (u), (v) and (x), as well as Properties (j), (k), (l) and (m) are up to a 1 + o factor independent of conditioning on X u,v,x,y = 1, and their calculations are as in Lemma 3.2. We obtain P(X u,v,x,y = 1|X u,v,x,y = 1) ≤ (d i/2 /(2n)) 4 q 16 (1 + o) = P(X u,v,x,y = 1)(1 + o). Clearly, the number of choices of four-tuples u, v, x, y and u, v, x, y is at most the square of the number of choices for u, v, x, y, so the contribution of this case is at most (1 + o)E X 2. (We will show that the contribution of all other cases is o(E X 2 ) and so the contribution of this case is indeed (1 + o)E X 2.) Since {x, y } ∩ U = ∅, edges emanating from x and y are not exposed yet. Hence, the probabilities that Properties (j), (k), (l) and (m) hold are as in the unconditional case. Ignoring all other properties we get On the other hand, since at least one of u, v is in U, only a fraction of four-tuples is considered here. Hence, the contribution of this case to X 2 is negligible. From now on we may assume that at least one of x, y has to be in U. Case 3: {u, v } ∩ U = ∅, and |{x, y } ∩ U | = 1. By symmetry, we may assume that x ∈ U and y / ∈ U. Since y / ∈ U, arguing as in the previous case, we get that Properties (l) and (m) hold with probability up to a 1 + o factor as in the unconditional case. However, it might happen that, say, N (u, i/2 − 1) ∩ U = ∅ and Property (j) holds "for free". But for this to happen, an edge joining N V \U (u, i/2 − 1) and U must occur at the right place, which happens with small probability. Moreover, only a small fraction of four-tuples satisfies x ∈ U. More precisely, for Property (j) to hold "for free", we must have that d(u, x ) = i/2, and so there must be an edge between S U (x, k) and S V \U (u, i/2−1−k) for some k = 0, 1,..., i/2−1. By the union bound, this happens with probability since i = O(log n/ log log n). (In fact, with a slightly more delicate argument one can remove the log n/ log log n factor but this is not needed.) The same argument applies to Property (k). (Recall, that we may assume that N (u, i/2 − 1) and N (v, i/2 − 1) are disjoint.) Hence, by considering only these four properties we get that On the other hand, since x ∈ U, only a O(|U |/n) = O(n −1/2 (log −2 n)(log log n)) = o(q 16 (log n/ log log n) −2 ) fraction of four-tuples is considered here. Hence, the contribution of this case to X 2 is negligible. Note that if X u,v,x,y = 1 then, in particular, d(x, y ) = i and so the distance between x and y in the graph induced by U is at least i. It follows that, for example, an edge between s ∈ S U (x, k) and t ∈ S V \U (u, i/2 − 1 − k) (for some k = 0, 1,..., i/2 − 1) cannot make both Property (j) and Property (l) to hold, since that would imply that d(x, y ) ≤ d(x, s) + d(s, y ) ≤ i − 2. Hence the calculations dealing with y (related to Properties (l) and (m)) are independent of calculations dealing with x (related to Properties (j) and (k)). Arguing as in the previous case, we get that P(X u,v,x,y = 1|X u,v,x,y = 1) = O P(X u,v,x,y = 1)q −16 (log n/ log log n) 4. From now on we may assume that at least one of u, v has to be in U (and still at least one of x, y ). By symmetry, suppose that u ∈ U, v / ∈ U, x ∈ U, y / ∈ U. Since y / ∈ U, as before, we get that Properties (l) and (m) hold with probability up to a 1 + o factor as in the unconditional case. Now, since v / ∈ U, by the same calculations as in Case 3, the probability that Property (k) holds is at most O (d i/2 /n) log n/ log log n. Property (j), however, might hold deterministically now, so we lose an additional factor of O(d i/2 /n). By considering only the three properties we have an upper bound on we get that log n log log n. On the other hand, since u, x ∈ U, only a O((|U |/n) 2 ) = O((d i/2−1 /n)n −1/2 (log −2 n)(log log n)) = o((d i/2 /n)q 16 (log log n/ log n)) fraction of four-tuples is considered here, and so the contribution of this case to X 2 is negligible. Case 6: |{u, v } ∩ U | = 1, and |{x, y } ∩ U | = 2. By symmetry, suppose that u ∈ U and v / ∈ U. By the same argument as in Case 4, the calculations involving Properties related to x are independent of those related to y. Since v / ∈ U, by the same calculations as in Case 3, the probability that Properties (k) and (m) both hold is at most O (d i/2 /n) 2 (log n/ log log n) 2. This time, Properties (j) and (l) might hold deterministically, so we lose an additional factor of O((d i/2 /n) 2 ). By considering only the two properties we have a bound on we get that P(X u,v,x,y = 1|X u,v,x,y = 1) = O P(X u,v,x,y = 1)q −16 n d i/2 2 log n log log n 2. By symmetry, suppose that x ∈ U and y / ∈ U. Since y / ∈ U, as before, we get that Properties (l) and (m) hold with probability up to a 1 + o factor as in the unconditional case. By considering only these two properties we get that P(X u,v,x,y = 1|X u,v,x,y = 1) = O P(X u,v,x,y = 1)q −16 n d i fraction of four-tuples is considered here, and the contribution of this case to X 2 is negligible. Case 8: |{u, v } ∩ U | = 2, and |{x, y } ∩ U | = 2. First, let us observe that in order to have X u,v,x,y = 1 the vertices u, v, x, y have to lie on an induced cycle of length 2i (of course, this is a necessary condition only). Moreover, note that there is only one such cycle in the graph induced by U (namely, the one going through u, v, x, y). Hence, in order for this necessary condition to hold "for free," all four vertices of u, v, x, y have to be on this cycle. Thus, there are only (2i) 4 = O((log n/ log log n) 4 ) = o(E ) such 4-tuples of vertices, and this contribution is negligible. Otherwise, we observe that at least one edge of the cycle u, v, x, y is not yet present in the graph induced by U, say an edge on the path between u and x. For this to happen, there must be an edge between S(u, k) and S(x, i/2 − 1 − k) for some k ∈ {0, 1,..., i/2 − 1} that is not yet exposed. By the same calculations as in Case 3, this happens with probability at most O d i/2 n log n log log n. Using Lemma 3.2 and Lemma 3.3, Theorem 2.6 follows now easily by Chebyshev's inequality. Concluding remarks and open questions We have shown that in G(n, p) for p log 5 n n(log log n) 2 the hyperbolicity is (up to a possible difference of 1) a monotone decreasing graph parameter. In general, since trees as well as cliques have hyperbolicity 0, the hyperbolicity is not monotone, but we conjecture that in G(n, p) with p above the threshold of connectivity, the same behavior holds. Intuitively, if p is close to the threshold of connectivity, then G(n, p) a.s.s. contains a lot of long cycles, and there will not be many shortcuts, making the hyperbolicity of the graph large. After extending the definition of hyperbolicity to non-connected graphs by defining it as the maximum over all connected components, the situation is quite different. For p < (1 − )/n for some > 0, the hyperbolicity is 0 a.a.s., but for p > (1 + )/n for some > 0, the appearance of the giant component makes the hyperbolicity to tend to infinity a.a.s. (see also ). It would be interesting to investigate for which values of p the hyperbolicity of G(n, p) is maximized, and what this value is. We also would like to know whether the hyperbolicity is monotone increasing up to its maximal value and then decreasing, or whether there are several "peaks." |
from qiskit.providers.aer import QasmSimulator
from QAOA import QAOA
from scipy.optimize import minimize
#ising example with 2 qubits coupling constant is 0.5 and the constant is -0.5 and h=0 for both qubits => min energy is -1.0
isingdict ={(0,1):0.5,():-0.5}
test = QAOA(isingdict,p=1,qubits=2,us)
test.backend = QasmSimulator()
amplitudes = [0.0,0.0,0.0,0.0]
opt_result = minimize(
test.objectiveFunction,
amplitudes,
method="Powell",
options={'disp':True})
opt_energy, opt_amplitudes = opt_result.fun, opt_result.x |
<gh_stars>1-10
package js.lang.external.vaadin.crud;
import com.github.fluorumlabs.disconnect.core.annotations.Import;
import com.github.fluorumlabs.disconnect.core.annotations.NpmPackage;
import js.web.dom.HTMLElement;
/**
* <code><vaadin-crud-edit></code> is a helper element for <code><vaadin-grid-column></code> that provides an easily themable button that fires an <code>edit</code> event with the row item as detail when clicked.
*
* Typical usage is in a <code><vaadin-grid-column></code> of a custom <code><vaadin-grid></code> inside a <code><vaadin-crud></code> to enable editing.
*
* <strong>Mixins:</strong> ThemableMixin, ElementMixin
*/
@NpmPackage(name = "@vaadin/vaadin-crud", version = "^1.3.0-alpha2")
@Import(module = "@vaadin/vaadin-crud/src/vaadin-crud-edit.js")
public interface CrudEditElement extends HTMLElement {
// !wca! get theme: string | null | undefined
}
|
// called when a command has been received from the drone
void commandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
ARCONTROLLER_Device_t *deviceController = (ARCONTROLLER_Device_t*)customData;
eARCONTROLLER_ERROR error = ARCONTROLLER_OK;
if (deviceController != NULL)
{
if (commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_BATTERYSTATECHANGED)
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *singleElement = NULL;
if (elementDictionary != NULL)
{
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, singleElement);
if (singleElement != NULL)
{
HASH_FIND_STR (singleElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_BATTERYSTATECHANGED_PERCENT, arg);
if (arg != NULL)
{
batteryStateChanged (arg->value.U8);
}
else
{
ARSAL_PRINT(ARSAL_PRINT_ERROR, TAG, "arg is NULL");
}
}
else
{
ARSAL_PRINT(ARSAL_PRINT_ERROR, TAG, "singleElement is NULL");
}
}
else
{
ARSAL_PRINT(ARSAL_PRINT_ERROR, TAG, "elements is NULL");
}
}
}
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ATTITUDECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
float roll = 0, pitch = 0, yaw = 0;
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ATTITUDECHANGED_ROLL, arg);
if (arg != NULL)
{
roll = arg->value.Float;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ATTITUDECHANGED_PITCH, arg);
if (arg != NULL)
{
pitch = arg->value.Float;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ATTITUDECHANGED_YAW, arg);
if (arg != NULL)
{
yaw = arg->value.Float;
}
attitudeStateChanged(roll, pitch, yaw);
}
}
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_SPEEDCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
float speedX = 0, speedY = 0, speedZ = 0;
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_SPEEDCHANGED_SPEEDX, arg);
if (arg != NULL)
{
speedX = arg->value.Float;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_SPEEDCHANGED_SPEEDY, arg);
if (arg != NULL)
{
speedY = arg->value.Float;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_SPEEDCHANGED_SPEEDZ, arg);
if (arg != NULL)
{
speedZ = arg->value.Float;
}
speedStateChanged(speedX, speedY, speedZ);
}
}
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_POSITIONCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
double latitude = 0, longitude = 0, altitude = 0;
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_POSITIONCHANGED_LATITUDE, arg);
if (arg != NULL)
{
latitude = arg->value.Double;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_POSITIONCHANGED_LONGITUDE, arg);
if (arg != NULL)
{
longitude = arg->value.Double;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_POSITIONCHANGED_ALTITUDE, arg);
if (arg != NULL)
{
altitude = arg->value.Double;
}
positionStateChanged(latitude, longitude, altitude);
}
}
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ALTITUDECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
double altitude = 0;
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ALTITUDECHANGED_ALTITUDE, arg);
if (arg != NULL)
{
altitude = arg->value.Double;
altitudeStateChanged(altitude);
}
}
}
} |
<filename>src/main/java/com/example/designpattern/codeSimplified/adapterPattern/Bird.java<gh_stars>0
package com.example.designpattern.codeSimplified.adapterPattern;
public interface Bird {
void fly();
void makeSound();
}
|
. This is a report of a patient with paroxysmal nocturnal hemoglobinuria (PNH) undergoing laparoscopic colon surgery. Preoperative examination showed pancytopenia, paroxysmal atrial fibrillation and slight renal function disorder. Heparin calcium was used to prevent venous thrombosis, because this case had several risk factors; advanced age, major surgery for cancer, PNH and long term medication with steroid. Washed red blood cells were transfused preoperatively. During the operation, total intravenous anesthesia was used. We prevented acidosis and other factors of thrombosis, and transfused washed red blood cells to correct anemia. During the postoperative course, red blood cells transfusion was required, but this case showed no obvious hemolysis, bleeding or venous thrombosis. |
Arterial blood pressure measurements provide valuable information about a patient's condition. The heart's cyclical action produces a blood pressure maximum at systole, called systolic pressure, and a minimum pressure at diastole, called diastolic pressure. While the systolic and diastolic pressures are themselves important in gauging the patient's condition, other useful parameters are the mean (average) blood pressure during a heart cycle, and the pulse pressure, which is the arithmetic difference between the systolic and diastolic pressures.
The importance of arterial blood pressure has spurred the development of numerous methods of determining it. The most widely used method is probably the familiar blood pressure cuff, which consists of an expandable ring (1) inflated to stop arterial blood flow and (2) then gradually contracted. Using a stethoscope, medical personnel listen to the artery to determine at what pressure blood flow begins, establishing the systolic pressure, and at what pressure flow is unrestricted, establishing the diastolic pressure. More advanced blood pressure monitoring systems plot the arterial blood pressure through a complete heart cycle. Typically, these systems use catheters having piezoelectric pressure transducers that produce output signals dependent upon the instantaneous blood pressure. The output signals are monitored and used to determine the arterial blood pressures over a complete heart cycle. These systems are advantageous in that the blood pressure is continuously measured and displayed.
While prior art methods are useful, they have disadvantages. Cuff-type systems require restricting arterial blood flow and are not suitable for continuous use. The piezoelectric-type systems generally require undesirable invasive techniques, costly disposable materials, and time and skill to set-up. However, during certain critical periods, such as surgery, continuous arterial blood pressure monitoring is highly desirable. Therefore, it would be beneficial to have a method of continuously and non-invasively measuring a patient's blood pressure.
Photoplethysmographs are well-known instruments which use light for determining and registering variations in a patient's blood volume. They can instantaneously track arterial blood volume changes during the cardiac cycle. Since photoplethysmographs operate non-invasively, much work has gone into using them to determine blood pressure. In 1983, inventor Warner was issued U.S. Pat. No. 4,418,700 on a method of determining circulatory parameters, wherein signals from a photoplethysmograph were used to determine arterial blood pressure.
Significant problems were found when investigating the Warner method. Therefore, it is clear that the need for a practical method of continuously and non-invasively monitoring arterial blood pressure has remained. |
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package fr.insee.sugoi.core.store;
import fr.insee.sugoi.core.exceptions.InvalidPasswordException;
import fr.insee.sugoi.core.model.ProviderRequest;
import fr.insee.sugoi.core.model.ProviderResponse;
import fr.insee.sugoi.model.Application;
import fr.insee.sugoi.model.Group;
import fr.insee.sugoi.model.Organization;
import fr.insee.sugoi.model.User;
import java.util.Map;
/** Writer stores are responsible for all operations modifying the underlying store. */
public interface WriterStore {
/**
* Create the user in the store.
*
* @param user
* @return the user as it has been passed (address location migth have been added).
*/
ProviderResponse createUser(User user, ProviderRequest providerRequest);
/**
* Replace the user with the same id by the updatedUser in the store.
*
* @param updatedUser
* @return A provider response
*/
ProviderResponse updateUser(User updatedUser, ProviderRequest providerRequest);
/**
* Delete the user id in the store.
*
* @param organizationId
*/
ProviderResponse deleteUser(String id, ProviderRequest providerRequest);
/**
* Create the organization in the store.
*
* @param organization
* @throws UnsupportedOperationException if the configuration for organizations is not set on the
* UserStorage.
* @return the organization as it has been passed (address location migth have been added).
*/
ProviderResponse createOrganization(Organization organization, ProviderRequest providerRequest);
/**
* Replace the organization with the same id by the updatedOrganization in the store.
*
* @param updatedOrganization
* @throws UnsupportedOperationException if the configuration for organizations is not set on the
* UserStorage.
* @return the updatedOrganization as it has been passed (address location migth have been added).
*/
ProviderResponse updateOrganization(
Organization updatedOrganization, ProviderRequest providerRequest);
/**
* Delete the organization id in the store.
*
* @param organizationId
* @throws UnsupportedOperationException if the configuration for organizations is not set on the
* UserStorage.
*/
ProviderResponse deleteOrganization(String organizationId, ProviderRequest providerRequest);
/**
* Create the application in the store. If the application contains groups, add it but do not add
* the group members.
*
* @param application
* @throws UnsupportedOperationException if the configuration for applications is not set for the
* Realm.
* @return the application as it has been passed
*/
ProviderResponse createApplication(Application application, ProviderRequest providerRequest);
/**
* Replace the application with the same id by the updatedApplication in the store. Groups that do
* not exist are removed, groups for which something changes but without changing the name are
* modified but with users unchanged and groups which id doesn't exist yet are created without
* users.
*
* @param updatedApplication
* @throws UnsupportedOperationException if the configuration for applications is not set for the
* Realm.
* @return the updateApplication as it has been passed
*/
ProviderResponse updateApplication(
Application updatedApplication, ProviderRequest providerRequest);
/**
* Delete the application applicationName in the store.
*
* @throws UnsupportedOperationException if the configuration for applications is not set on the
* Realm.
* @param applicationName
*/
ProviderResponse deleteApplication(String applicationName, ProviderRequest providerRequest);
/**
* Create the group in the application appName. Users are not added.
*
* @param appName
* @param group
* @throws UnsupportedOperationException if the configuration for applications or groups are not
* set.
* @return the group as it has been passed
*/
ProviderResponse createGroup(String appName, Group group, ProviderRequest providerRequest);
/**
* Replace the group of same name in the application appName by updatedGroup. Users are unchanged.
*
* @param appName
* @param updatedGroup
* @throws UnsupportedOperationException if the configuration for applications or groups are not
* set.
* @return the group as it has been passed.
*/
ProviderResponse updateGroup(String appName, Group updatedGroup, ProviderRequest providerRequest);
/**
* Delete the group groupName of the application appName in the store. Users remain unchanged.
*
* @param appName
* @param groupName
* @throws UnsupportedOperationException if the configuration for applications or groups are not
* set.
*/
ProviderResponse deleteGroup(String appName, String groupName, ProviderRequest providerRequest);
/**
* Add a user to the group groupName in the application appName. The user might not exist on the
* realm.
*
* @param appName
* @param groupName
* @param userId
* @throws UnsupportedOperationException if the configuration for applications or groups is not
* set.
*/
ProviderResponse addUserToGroup(
String appName, String groupName, String userId, ProviderRequest providerRequest);
/**
* Delete the user userId from the group groupName in the application appName.
*
* @param appName
* @param groupName
* @param userId
* @throws UnsupportedOperationException if the configuration for applications or groups is not
* set.
*/
ProviderResponse deleteUserFromGroup(
String appName, String groupName, String userId, ProviderRequest providerRequest);
/**
* Set the password of user to initPassword. If password already exist, changes it.
*
* @param user
* @param initPassword, password to set to the user, cannot be null
* @param changePasswordResetStatus
*/
ProviderResponse initPassword(
String user,
String initPassword,
boolean changePasswordResetStatus,
ProviderRequest providerRequest);
/**
* Set the password of user to generatedPassword. Same behaviour than initPassword.
*
* @param user
* @param generatedPassword password to set to the user, cannot be null
* @param changePasswordResetStatus
* @param templateProperties properties that are injected in template for use of webhook
* @param webhookTag define the webhook that will be call
*/
ProviderResponse reinitPassword(
String userId,
String generatedPassword,
boolean changePasswordResetStatus,
Map<String, String> templateProperties,
String webhookTag,
ProviderRequest providerRequest);
/**
* Change the user password from oldPassword to newPassword. If user do not have password
* oldPassword should be set to null to be changed.
*
* @param user
* @param oldPassword
* @param newPassword
* @throws InvalidPasswordException if oldPassword doesn't match the actual password.
*/
ProviderResponse changePassword(
String user,
String oldPassword,
String newPassword,
String webhookTag,
Map<String, String> templateProperties,
ProviderRequest providerRequest);
/**
* Add the attribute to the app-managed-attribute-key in the store
*
* @param userId
* @param attribute
*/
ProviderResponse addAppManagedAttribute(
String userId, String attributeKey, String attributeValue, ProviderRequest providerRequest);
/**
* Delete the attribute value from the app-managed-attribute-key in the store
*
* @param userId
* @param attribute
*/
ProviderResponse deleteAppManagedAttribute(
String userId, String attributeKey, String attributeValue, ProviderRequest providerRequest);
ProviderResponse updateUserCertificate(
User user, byte[] certificate, ProviderRequest providerRequest);
ProviderResponse deleteUserCertificate(User user, ProviderRequest providerRequest);
ProviderResponse updateOrganizationGpgKey(
Organization organization, byte[] bytes, ProviderRequest providerRequest);
ProviderResponse deleteOrganizationGpgKey(
Organization organization, ProviderRequest providerRequest);
ProviderResponse addUserToGroupManager(
String applicationName, String userId, ProviderRequest providerRequest);
ProviderResponse deleteUserFromManagerGroup(
String applicationName, String userId, ProviderRequest providerRequest);
}
|
<reponame>sumitww3kumar/website-2
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { DashboardComponent } from './components/dashboard/dashboard.component';
import { CityComponent } from './components/city/city.component';
import { TrailListComponent } from './components/trail/trail-list.component';
import { TrailDetailComponent } from './components/trail/trail-detail.component';
import { NewTrailComponent } from './components/trail/new-trail.component';
import { AuthGuard } from './services/auth-guard.service';
const routes: Routes = [
{ path: '', redirectTo: '/dashboard', pathMatch: 'full' },
{ path: 'dashboard', component: DashboardComponent },
{ path: 'area/:id/:title', component: CityComponent },
{ path: 'area/:id/trails', component: TrailListComponent },
{ path: 'trail/:id/:title', component: TrailDetailComponent },
{ path: 'trail/new', component: NewTrailComponent, canActivate: [AuthGuard] }
];
@NgModule({
imports: [ RouterModule.forRoot(routes) ],
exports: [ RouterModule ]
})
export class AppRoutingModule {} |
<reponame>benrad/carputer<gh_stars>0
import signal
import sys
from Model.Carputer import Carputer
from Model.DriveDatabase import DriveDatabase
from Model.OBDController import OBDController
from Model.GPSController import GPSController
from Model.OLEDController import OLEDController
def signal_handler(signal, frame):
carputer.stop()
sys.exit(0)
# Todo: Use config file instead of hard-coded paths
carputer = Carputer(OBDController('/dev/ttyUSB0'),
GPSController(),
OLEDController(),
DriveDatabase('/home/pi/databases/drive_data.db'))
signal.signal(signal.SIGUSR1, signal_handler)
carputer.start()
# I could handle some of the issues with shutdown by modifying the switch script to simply send the signal to carputer
# and then have carputer itself handle shutting down the machine
|
Clinical profile and outcome in children with dengue fever The severity of dengue viral infection ranges from mild subclinical infection which mimics any other viral episode to severe life-threatening dengue shock syndrome. Malaria is one of the major vector borne diseases in Mangalore, a major cause of morbidity in children and cause for hospital admission, now dengue viral infection is emerging as one of the major challenge for pediatricians to diagnose and treat the disease. INTRODUCTION The severity of dengue viral infection ranges from mild subclinical infection which mimics any other viral episode to severe life-threatening dengue shock syndrome. Malaria is one of the major vector borne diseases in Mangalore, a major cause of morbidity in children and cause for hospital admission, now dengue viral infection is emerging as one of the major challenge for pediatricians to diagnose and treat the disease. NS-1 antigen, IgM and IgG levels are the major laboratory tools used commonly to diagnose dengue viral infection, however clinical signs and symptoms play an important role in the diagnosis of dengue viral infection. 1 NS-1 antigen appears with febrile episode and may persist for 9 days and helps in early diagnosis of dengue fever, however the false positive tests may be present in other viral infections like Flaviviridae group. In primary infection of dengue, IgM is positive by 5-7 days in 80%, titre peaks by 2 weeks and disappears by 2 months. But in secondary infection, it is slower and lower. Whereas, in primary infection, IgG appears by 14 days, peaks by 3 weeks and remain high for 2-3 months and later declines and remains life time. 2 In secondary infection, IgG response is quick, and levels are higher. This appears by 5th day, peaks by 2 weeks and remains high for 2-3 months. Later declines and remains for life time. Unfortunately, there is no single lab test available which gives accurate diagnosis at the onset of illness. By the time lab reports confirm the diagnosis, the clinical picture is more evident. However, NS-1Ag remains an important tool for the diagnosis in the first few days of fever with suspicion of dengue fever. Majority of dengue infections are self-limiting, but complications may cause high morbidity and mortality. 3 Aedes albopictus and Aedes aegypti are the most common types of mosquitoes and DENV-2 is the common serotype. 4 METHODS Diagnosed cases of dengue fever admitted from December 2009 to November 2014 were included in this study and analyzed. Data from their case records, examination findings and lab findings were obtained. Clinical features, blood pressure, platelet count, packed RBC, NS1 Ag, dengue IgM and IgG were the important parameters used to diagnose the DF. Age group was subdivided in to less than 1 year, 1-4 years, 4-12 years, and more than 12 years. Blood Pressure was defined according to the age and sex dependent normogram, platelet count categorized as less than 50000, 50000-100000, 100000-150000 and more than 150000. PCV variations, Bleeding parameters and liver functions were noted. IV fluid management, admission to ICU, need of ventilation were recorded. Data was recorded in SPSS 16.0 and statistical results were obtained. Males and Females are almost equally affected. Figure 2: Clinical manifestations of dengue fever. Fever was main presenting complaint in all the 52 cases. Petechiae was present in 63.5% cases, however bleeding manifestations were observed in the form of GI bleed in 9.6% of the cases. Poor intake was present in all the 52 cases and abdominal pain was seen in 96.2% of the cases. Maculopapular rash in 50%, respiratory distress in 15.4%, retro-orbital pain in 41%, vomiting in 100% and convulsion was seen in one case. Elevated haematocrit was seen in 49 cases (94.2%), hypotension seen in 86.5%, hepatomegaly seen in 65.4%, packed cell volume raised in 94.2%, low platelet count observed in 55%, abnormal LFT seen in 61.5%, abnormal amylase seen in 3.8% of the cases. Renal function test was normal in 100% whereas 7 cases had platelet count less than 50000. Dengue NS-1Ag was positive in 15 cases, out of which 10 cases were associated with positive IgM and 5 cases were associated with negative IgM and IgG. Whereas IgM and IgG were positive in 37 cases (71.2%), NS1 negative in all the 37 cases, IgM positive and IgG negative in 10 cases (19.2%) and all the 10 cases NS-1 antigen were positive. Both IgM and IgG were negative in 5 cases (9.6%). PICU admission was done for 41 cases (78.8%) and ventilation was required for 1 case (1.9%). DISCUSSION In present study, maximum number of cases (59.6%) were between 4-12 years, whereas study done by Dhooria et al showed 59% cases were 10-15 years and 3.7% cases were infants. Faridi et al showed more than 76% of the cases were above 6 years. According to the study done by Aneja et al, predominant age group affected was 6 years and less, 9% of the cases were infants. 5 Majority of the patients were males in many studies, maybe they are outdoors for more time compare to females; study done by Shubhakar Mishra et al depicts 77.3% are male and 22.7% are female children are affected. However, present study showed almost equal distribution with 25 males and 27 females. Fever was the commonest symptom according to present study and similar results seen in study done by Maimoona M, Aisha Sajid et al. 6,7 Present study showed petechiae in 33 cases (63.5%), in which 5 (9.6%) cases were associated with gastric bleed as evidenced by brownish GI aspirate and malena, which is comparable to study done by Dhooria et al where in petechiae was in 85% cases and GI bleed was in 6 % cases. In another study, done by Ratgiri et al showed petechiae in 18% of cases and GI bleed in 22% cases. 8 Study done by Vijay Gupta et al showed spontaneous bleeding manifestation seen in 43 (55.1%) cases with DSS and 158 (39.6%) cases with DHF. 9 Study done by Ahamed et al and Rachel et al depicts GI bleed was the main manifestation compared to petechiae. 10,11 Study done by Sivabalan et al depicts a combination of biphasic fever, heamoconcentration, platelet count less than 50000/mm 3 and elevated ALT had a sensitivity of 79.2%,specificity of 64.7%, with a positive predictive value of 70% and negative predictive value of 75% in predicting spontaneous bleeding in dengue. 12 According to present study the key findings are fever (100%), poor intake (100%), vomiting (100%), abdominal pain (96.2%), hypotension (86.5%), retroorbital pain (78.8%) and hepatomegaly in (65.4%). Whereas study done by Kamala Kannan et al showed fever in 94.6%, retroorbital pain 51.3%, palmar erythema 62.8%. 13 Dhooria et al reported fever in 91%, vomiting 34%, poor intake 21%, abdominal pain 16%, Ratgeri reported fever in 100%, vomiting in 82%, abdominal pain61%, headache 22%, and hepatomegaly in 87 %. Amrita Roy et al done a study showed, Hepatomegaly (80.8%), Jaundice (68%), Raised Aspartate transaminase, Alanine trasaminase and prolonged Prothrombin time (41.7%) and reduced serum albumin in (56%). 14 Skin rash in the form of dengue flush was seen in 50% of cases in present study. Whereas maculopapular rash was seen in 80% of cases in a study conducted by Waterman S. H et al. 15 Respiratory distress is seen in 15.4% cases in present study, mainly due to associated bilateral pleural effusion, however none of the cases met the criteria of Acute Respiratory Distress Syndrome (ARDS Normal liver function was observed in 61.5% of the cases, 20 (38.5%) cases had abnormal LFT, Elevated ALT, AST seen in 9 (17.3%) cases, Elevated TB, DB, ALT and AST seen in 1 (1.9%) case, isolated rise in AST and ALP seen in 1 (9.6%) case each. Normal PT and APTT seen in 49 cases (94.2%), abnormal PT and normal APTT were seen in 2 (3.8%) cases and abnormal PT, APTT seen in 1 (1.9%) case each. The study done by Sri Ram showed raised AST in 93%, raised ALT in 78%, raised ALP in 57% and prolonged prothrombin time (PT) is seen in 20% of the cases. May be this disparity in result is due to serum sample obtained at the early stages of the disease. Total number of admission in Pediatric ICU were 41 (78.8%), though they all did not meet the criteria of PICU admission, admitted for better monitoring and early detection of deterioration of the patient. One child was ventilated due to severe respiratory distress; however, this child did not meet the criteria of diagnosing ARDS and child was extubated within 72 hours. CONCLUSION Dengue viral fever during its initial presentation mimics any of the viral illness, so it is important to keep high index of suspicion when characteristic features like fever, headache vomiting, abdominal pain and one should look carefully for petechial rashes. It is also important to know whether child is coming from an endemic area or any other family member suffering from dengue fever. Early diagnosis and initiation of supportive treatment should be |
Military Spending, the Peace Dividend, and Fiscal Adjustment This paper decomposes the sources of the peace dividend into global, regional, and country-specific factors, and analyzes their relative importance. It finds that the easing of international and regional tensions and the existence of IMF-supported adjustment programs are systematically related to lower military spending and a higher share of nonmilitary spending in total government outlays. The easing of international tensions and of regional tensions since the end of the Cold War and the existence of IMF-supported adjustment programs account for 66 percent, 26 percent, and 11 percent of the decline in military spending, respectively. Furthermore, fiscal adjustment has implied a larger cut in military spending of countries with IMF-supported programs. |
package com.ruoyi.dbbase.scheduled;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StrKit;
import com.ruoyi.dbbase.domain.BdStudentGread;
import com.ruoyi.dbbase.domain.BdXgxtXgxtBjfdyxxQywx;
import com.ruoyi.dbbase.service.IBdStudentGreadService;
import com.ruoyi.dbbase.service.impl.BdXgxtXgxtBjfdyxxQywxServiceImpl;
import com.ruoyi.offline.service.impl.XgxtXgxtBjfdyxxQywxServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 辅导员信息同步 新增电话号码 相关任务定时器类
* <p>
* 查询出辅导员列表,包含学工系统的电话号码
* SELECT b.lxdh,a.* FROM xgxt_xgxt_bjfdyxx_qywx as a LEFT JOIN ztsj_ryjbxx_qywx b on a.FDYJZGH = b.XGH where a.FDYJZGH in(SELECT xgh FROM ztsj_ryjbxx_qywx)
*/
@Component("teachInfoTask")
public class TeachInfoTask {
//班级辅导员
@Autowired
XgxtXgxtBjfdyxxQywxServiceImpl xgxtXgxtBjfdyxxQywxServiceImpl;
//班级辅导员
@Autowired
BdXgxtXgxtBjfdyxxQywxServiceImpl bdXgxtXgxtBjfdyxxQywxServiceImpl;
/**
* 同步老师信息
*/
public void synchTeachInfoTask() {
System.out.println("启动辅导员信息同步,并且将门禁中的电话信息也加入表中====> ");
getTeachInfo();
}
/**
* 将在辅导员信息表同步过来
*/
private void getTeachInfo() {
HashMap<String, Object> searchMap = new HashMap<>();
List<Map<String, Object>> mList = xgxtXgxtBjfdyxxQywxServiceImpl.getMapList(searchMap);
if (null == mList) {
return;
}
//删除数据
bdXgxtXgxtBjfdyxxQywxServiceImpl.deleteBdXgxtXgxtBjfdyxxQywxByLocal("0");
for (Map<String, Object> oneMap : mList) {
BdXgxtXgxtBjfdyxxQywx baseModel = getBdXgxtXgxtBjfdyxxQywxModel(oneMap);
addOrUpdateModel(baseModel);
}
}
private BdXgxtXgxtBjfdyxxQywx getBdXgxtXgxtBjfdyxxQywxModel(Map<String, Object> oneMap) {
BdXgxtXgxtBjfdyxxQywx bdXgxtXgxtBjfdyxxQywx = new BdXgxtXgxtBjfdyxxQywx();
if (!StrKit.isEmpty(oneMap.get("lxdh"))) {
bdXgxtXgxtBjfdyxxQywx.setLxdh(oneMap.get("lxdh").toString());
}
if (!StrKit.isEmpty(oneMap.get("bjxxbh"))) {
bdXgxtXgxtBjfdyxxQywx.setBjxxbh(oneMap.get("bjxxbh").toString());
}
if (!StrKit.isEmpty(oneMap.get("bjdm"))) {
bdXgxtXgxtBjfdyxxQywx.setBjdm(oneMap.get("bjdm").toString());
}
if (!StrKit.isEmpty(oneMap.get("bjmc"))) {
bdXgxtXgxtBjfdyxxQywx.setBjmc(oneMap.get("bjmc").toString());
}
if (!StrKit.isEmpty(oneMap.get("fdy"))) {
bdXgxtXgxtBjfdyxxQywx.setFdy(oneMap.get("fdy").toString());
}
if (!StrKit.isEmpty(oneMap.get("fdyjzgh"))) {
bdXgxtXgxtBjfdyxxQywx.setFdyjzgh(oneMap.get("fdyjzgh").toString());
}
if (!StrKit.isEmpty(oneMap.get("dcDcfieldaud"))) {
bdXgxtXgxtBjfdyxxQywx.setDcDcfieldaud(oneMap.get("dcDcfieldaud").toString());
}
if (!StrKit.isEmpty(oneMap.get("dcDcdatadate"))) {
bdXgxtXgxtBjfdyxxQywx.setDcDcdatadate(oneMap.get("dcDcdatadate").toString());
}
if (!StrKit.isEmpty(oneMap.get("dcDctimestamp"))) {
bdXgxtXgxtBjfdyxxQywx.setDcDctimestamp(DateUtils.parseDate(oneMap.get("dcDctimestamp").toString()));
}
bdXgxtXgxtBjfdyxxQywx = addDqnjAndQwmc(bdXgxtXgxtBjfdyxxQywx);
return bdXgxtXgxtBjfdyxxQywx;
}
//教务在校生信息
@Autowired
private IBdStudentGreadService iBdStudentGreadService;
private BdXgxtXgxtBjfdyxxQywx addDqnjAndQwmc(BdXgxtXgxtBjfdyxxQywx bdXgxtXgxtBjfdyxxQywx){
//得到年级和单位名称
BdStudentGread searchBdStudentGread = new BdStudentGread();
searchBdStudentGread.setBjdm(bdXgxtXgxtBjfdyxxQywx.getBjdm());
List<BdStudentGread> mlistBdStudentGread = iBdStudentGreadService.selectBdStudentGreadList(searchBdStudentGread);
BdStudentGread bdStudentGread = null;
if(mlistBdStudentGread.size()>0){
bdStudentGread = mlistBdStudentGread.get(0);
}
if(bdStudentGread != null){
bdXgxtXgxtBjfdyxxQywx.setDqnj(bdStudentGread.getDqnj());
bdXgxtXgxtBjfdyxxQywx.setDwmc(bdStudentGread.getDwmc());
}
return bdXgxtXgxtBjfdyxxQywx;
}
/**
* 添加或者修改
*/
private void addOrUpdateModel(BdXgxtXgxtBjfdyxxQywx baseModel) {
baseModel.setCreateTime(new Date());
bdXgxtXgxtBjfdyxxQywxServiceImpl.insertBdXgxtXgxtBjfdyxxQywx(baseModel);
}
}
|
/** \file
* \brief PDF Canvas Lua 5 Binding
*
* See Copyright Notice in cd.h
*/
#include <stdlib.h>
#include <stdio.h>
#include "cd.h"
#include "cdpdf.h"
#include <lua.h>
#include <lauxlib.h>
#include "cdlua.h"
#include "cdluapdf.h"
#include "cdlua5_private.h"
static void *cdpdf_checkdata(lua_State *L, int param)
{
return (void *)luaL_checkstring(L, param);
}
static cdluaContext cdluapdfctx =
{
0,
"PDF",
cdContextPDF,
cdpdf_checkdata,
NULL,
0
};
static const luaL_Reg funcs[] = {
{ NULL, NULL },
};
int cdluapdf_open (lua_State *L)
{
cdluaLuaState* cdL = cdlua_getstate(L);
cdlua_register_lib(L, funcs); /* leave cd table at the top of the stack */
cdlua_addcontext(L, cdL, &cdluapdfctx);
return 1;
}
int luaopen_cdluapdf(lua_State* L)
{
return cdluapdf_open(L);
}
|
<filename>sourceCode/tests/tools_noQt_createTestImages/tool_noQt_generateTestImages/makeTestImageStackProfil_withrandom_usingCache.cpp<gh_stars>1-10
#include <math.h>
#include <cstdlib> //from srand
#include <ctime> //for srand init
#include <vector>
#include <string>
using namespace std;
#include <OpenImageIO/typedesc.h>
#include <OpenImageIO/imagebuf.h>
#include <OpenImageIO/imagebufalgo.h>
using namespace OIIO;
template<typename T>
bool writeImage(const string& strPathAndFilename, vector<T> vectData, unsigned int width, unsigned int height, TypeDesc::BASETYPE typeDescBaseType) {
cout << __FUNCTION__ << " entering" << endl;
if ((width * height) != vectData.size()) {
cout << __FUNCTION__ << "if ((width * height) != vectData.size()) {" << endl;
return(false);
}
cout << __FUNCTION__ << "typeDescBaseType = " << typeDescBaseType << endl;
ImageSpec ImageSpecOut(width, height, 1, TypeDesc(typeDescBaseType));
int bitsPerSample = (int)(8*ImageSpecOut.format.size());
cout << __FUNCTION__ << "set iio::BitsPerSample to: " << bitsPerSample << endl;
ImageSpecOut.attribute("oiio::BitsPerSample", bitsPerSample);
ImageSpecOut.attribute("compression", "none");
ImageSpecOut.attribute("tiff:write exif", int(1));
ImageSpecOut.attribute("tiff:Compression", (int)1);
ImageBuf IBufDest(strPathAndFilename, ImageSpecOut);
T zero { static_cast<T>(.0) };
ROI ROIFullImage {
0, (int)width,
0, (int)height,
0, 1,
0, 1
};
bool bFill = ImageBufAlgo::fill(IBufDest, zero, ROIFullImage);
if (!bFill) {
cout << __FUNCTION__ << "ImageBufAlgo::fill failed(...)" << endl;
return(false);
}
cout << __FUNCTION__ << "fill done " << endl;
cout << "will write this content:" << endl;
long int offset = 0l;
for (unsigned int y = 0; y < height; y++) {
for (unsigned int x = 0; x < width; x++) {
switch (typeDescBaseType) {
case TypeDesc::FLOAT: cout << static_cast<float> (vectData[offset]) << " ";break;
case TypeDesc::INT16: cout << static_cast<signed short int> (vectData[offset]) << " ";break;
case TypeDesc::UINT8: cout << static_cast<unsigned short int>(vectData[offset]) << " ";break;
default: cout << "invalid typeDescBaseType" << endl; break;
}
offset++;
}
cout << endl;
}
cout << __FUNCTION__ << endl;
cout << __FUNCTION__ << "IBufDest.pixeltype() = " << IBufDest.pixeltype() << endl;
bool bSetPixel = IBufDest.set_pixels(ROIFullImage, IBufDest.pixeltype(), vectData.data(), AutoStride, AutoStride, AutoStride);
if (!bSetPixel) {
cout << __FUNCTION__ << "ImageBufAlgo::set_pixels(...) failed" << endl;
return(false);
}
bool bSuccessWrite = IBufDest.write(strPathAndFilename, TypeUnknown);
if (!bSuccessWrite) {
cout << __FUNCTION__ << "failed to write " << strPathAndFilename << endl;
cout << __FUNCTION__ << "geterror():" << geterror() << endl;
return(false);
}
cout << __FUNCTION__ << "write(...) done" << endl;
cout << __FUNCTION__ << "_______________" << endl;
return(true);
}
bool stdout_displayImageContent_float__first_in_last_values(const string& strPathAndFilename, unsigned int width, unsigned int height/*, TypeDesc::BASETYPE typeDescBaseType*/) {
if ((width<=0)||(height<=0)) {
cout << "if ((width<=0)||(height<=0)) {" << endl;
return(false);
}
ImageBuf IBufSrc(strPathAndFilename);
cout << "IBufSrc.image_pixels() = " << IBufSrc.spec().image_pixels() << endl;
cout << "IBufSrc.spec().width = " << IBufSrc.spec().width << endl;
cout << "IBufSrc.spec().height = " << IBufSrc.spec().height << endl;
float zero { .0 };
ROI ROIFullImage {
0, (int)width,
0, (int)height,
0, 1,
0, 1
};
vector<float> vectImageContent(width * height);
fill(vectImageContent.begin(), vectImageContent.end(), zero);
bool bGetPixel = IBufSrc.get_pixels(ROIFullImage, TypeDesc(TypeDesc::FLOAT), vectImageContent.data(), AutoStride, AutoStride, AutoStride);
if (!bGetPixel) {
cout << "ImageBufAlgo::get_pixels(...) failed" << endl;
return(false);
}
cout << "content of " << strPathAndFilename << ":" << endl;
long int offset = 0l;
cout << "first: " << static_cast<float>(vectImageContent[offset]) << endl;
offset = (width*height)/2;
cout << "in:: " << static_cast<float>(vectImageContent[offset]) << endl;
offset = (width*height)-1;
cout << "last: " << static_cast<float>(vectImageContent[offset]) << endl;
cout << endl;
return(true);
}
bool stdout_displayImageContent_s16__first_in_last_values(const string& strPathAndFilename, unsigned int width, unsigned int height/*, TypeDesc::BASETYPE typeDescBaseType*/) {
if ((width<=0)||(height<=0)) {
cout << "if ((width<=0)||(height<=0)) {" << endl;
return(false);
}
ImageBuf IBufSrc(strPathAndFilename);
cout << "IBufSrc.image_pixels() = " << IBufSrc.spec().image_pixels() << endl;
cout << "IBufSrc.spec().width = " << IBufSrc.spec().width << endl;
cout << "IBufSrc.spec().height = " << IBufSrc.spec().height << endl;
signed short int zero { 0 };
ROI ROIFullImage {
0, (int)width,
0, (int)height,
0, 1,
0, 1
};
vector<signed short int> vectImageContent(width * height);
fill(vectImageContent.begin(), vectImageContent.end(), zero);
bool bGetPixel = IBufSrc.get_pixels(ROIFullImage, TypeDesc(TypeDesc::INT16), vectImageContent.data(), AutoStride, AutoStride, AutoStride);
if (!bGetPixel) {
cout << "ImageBufAlgo::get_pixels(...) failed" << endl;
return(false);
}
cout << "content of " << strPathAndFilename << ":" << endl;
long int offset = 0l;
cout << "first: " << static_cast<signed short int>(vectImageContent[offset]) << endl;
offset = (width*height)/2;
cout << "in: " << static_cast<signed short int>(vectImageContent[offset]) << endl;
offset = (width*height)-1;
cout << "last: " << static_cast<signed short int>(vectImageContent[offset]) << endl;
cout << endl;
return(true);
}
bool stdout_displayImageContent_uint8__first_in_last_values(const string& strPathAndFilename, unsigned int width, unsigned int height/*, TypeDesc::BASETYPE typeDescBaseType*/) {
if ((width<=0)||(height<=0)) {
cout << "if ((width<=0)||(height<=0)) {" << endl;
return(false);
}
ImageBuf IBufSrc(strPathAndFilename);
cout << "IBufSrc.image_pixels() = " << IBufSrc.spec().image_pixels() << endl;
cout << "IBufSrc.spec().width = " << IBufSrc.spec().width << endl;
cout << "IBufSrc.spec().height = " << IBufSrc.spec().height << endl;
//signed short int zero { 0 };
ROI ROIFullImage {
0, (int)width,
0, (int)height,
0, 1,
0, 1
};
vector<unsigned char> vectImageContent(width * height);
fill(vectImageContent.begin(), vectImageContent.end(), .0);
bool bGetPixel = IBufSrc.get_pixels(ROIFullImage, TypeDesc(TypeDesc::UINT8), /*IBufSrc.pixeltype(),*/ vectImageContent.data(), AutoStride, AutoStride, AutoStride);
if (!bGetPixel) {
cout << "ImageBufAlgo::get_pixels(...) failed" << endl;
return(false);
}
cout << "content of " << strPathAndFilename << ":" << endl;
unsigned long int offset = 0l;
cout << "first: " << vectImageContent[offset] << endl;
offset = (width*height)/2;
cout << "in: " << vectImageContent[offset] << endl;
offset = (width*height)-1;
cout << "last: " << vectImageContent[offset] << endl;
cout << endl;
return(true);
}
bool stdout_displayImageContent_float(const string& strPathAndFilename, unsigned int width, unsigned int height/*, TypeDesc::BASETYPE typeDescBaseType*/) {
if ((width<=0)||(height<=0)) {
cout << "if ((width<=0)||(height<=0)) {" << endl;
return(false);
}
ImageBuf IBufSrc(strPathAndFilename);
float zero { .0 };
ROI ROIFullImage {
0, (int)width,
0, (int)height,
0, 1,
0, 1
};
vector<float> vectImageContent(width * height);
fill(vectImageContent.begin(), vectImageContent.end(), zero);
bool bGetPixel = IBufSrc.get_pixels(ROIFullImage, TypeDesc(TypeDesc::FLOAT), vectImageContent.data(), AutoStride, AutoStride, AutoStride);
if (!bGetPixel) {
cout << "ImageBufAlgo::get_pixels(...) failed" << endl;
return(false);
}
cout << "content of " << strPathAndFilename << ":" << endl;
unsigned long int offset = 0l;
for (unsigned int y = 0; y < height; y++) {
for (unsigned int x = 0; x < width; x++) {
cout << static_cast<float>(vectImageContent[offset]) << " ";
offset++;
}
cout << endl;
}
cout << endl;
return(true);
}
bool stdout_displayImageContent_signed16(const string& strPathAndFilename, unsigned int width, unsigned int height/*, TypeDesc::BASETYPE typeDescBaseType*/) {
if ((width<=0)||(height<=0)) {
cout << "if ((width<=0)||(height<=0)) {" << endl;
return(false);
}
ImageBuf IBufSrc(strPathAndFilename);
//signed short int zero { 0 };
ROI ROIFullImage {
0, (int)width,
0, (int)height,
0, 1,
0, 1
};
vector<float> vectImageContent(width * height);
fill(vectImageContent.begin(), vectImageContent.end(), 0);
bool bGetPixel = IBufSrc.get_pixels(ROIFullImage, TypeDesc(TypeDesc::FLOAT), vectImageContent.data(), AutoStride, AutoStride, AutoStride);
if (!bGetPixel) {
cout << "ImageBufAlgo::get_pixels(...) failed" << endl;
return(false);
}
cout << "content of " << strPathAndFilename << ":" << endl;
unsigned long int offset = 0l;
for (unsigned int y = 0; y < height; y++) {
for (unsigned int x = 0; x < width; x++) {
cout << static_cast<signed short int>(vectImageContent[offset]*SHRT_MAX) << " ";
offset++;
}
cout << endl;
}
cout << endl;
return(true);
}
bool stdout_displayImageContent_uint8(const string& strPathAndFilename, unsigned int width, unsigned int height) {
if ((width<=0)||(height<=0)) {
cout << "if ((width<=0)||(height<=0)) {" << endl;
return(false);
}
ImageBuf IBufSrc(strPathAndFilename);
//signed short int zero { 0 };
ROI ROIFullImage {
0, (int)width,
0, (int)height,
0, 1,
0, 1
};
vector<unsigned char> vectImageContent(width * height);
fill(vectImageContent.begin(), vectImageContent.end(), .0);
bool bGetPixel = IBufSrc.get_pixels(ROIFullImage, TypeDesc(TypeDesc::UINT8), vectImageContent.data(), AutoStride, AutoStride, AutoStride);
if (!bGetPixel) {
cout << "ImageBufAlgo::get_pixels(...) failed" << endl;
return(false);
}
cout << "content of " << strPathAndFilename << ":" << endl;
unsigned long int offset = 0l;
for (unsigned int y = 0; y < height; y++) {
for (unsigned int x = 0; x < width; x++) {
cout << static_cast<unsigned short int>(vectImageContent[offset]) << " ";
offset++;
}
cout << endl;
}
cout << endl;
return(true);
}
bool stdout_displayImageContent_signed16_tryWay2(const string& strPathAndFilename, unsigned int width, unsigned int height) {
if ((width<=0)||(height<=0)) {
cout << "if ((width<=0)||(height<=0)) {" << endl;
return(false);
}
ImageBuf IBufSrc(strPathAndFilename);
//signed short int zero { 0 };
ROI ROIFullImage {
0, (int)width,
0, (int)height,
0, 1,
0, 1
};
vector<signed short int> vectImageContent(width * height);
fill(vectImageContent.begin(), vectImageContent.end(), 0);
bool bGetPixel = IBufSrc.get_pixels(ROIFullImage, TypeDesc(TypeDesc::INT16), vectImageContent.data(), AutoStride, AutoStride, AutoStride);
if (!bGetPixel) {
cout << "ImageBufAlgo::get_pixels(...) failed" << endl;
return(false);
}
cout << "content of " << strPathAndFilename << ":" << endl;
unsigned long int offset = 0l;
for (unsigned int y = 0; y < height; y++) {
for (unsigned int x = 0; x < width; x++) {
cout << static_cast<signed short int>(vectImageContent[offset]) << " ";
offset++;
}
cout << endl;
}
cout << endl;
return(true);
}
float frandomValueMinus5toPlus5_oneDec() {
int i_randomValue0to100 = rand()%100;
float f_randomValueMinus50to50 = static_cast<float>(i_randomValue0to100) - 50.0;
return(f_randomValueMinus50to50/10.0);
}
signed short int s16randomValueMinus5toPlus5_oneDec() {
int i_randomValue0to100 = rand()%100;
signed short int s16_randomValueMinus50to50 = static_cast<signed short int>(i_randomValue0to100) - 50.0;
return(s16_randomValueMinus50to50/10);
}
int main_smallImages(int argc, char*argv[]) {
std::srand(std::time(nullptr)); // use current time as seed for random generator
int w = 15;
int h = 15;
int nbchannel = 1;
// width * height * nchannel = 15*15*1
// type: float:
vector<float> vect_f_1 {
.0, 0., 0.01, 0., -10.11 , -5.10 , -3.09, 0.99, +2.0 , +4.0 , +10., .0, 0., 0., .0,
.0, 0., 0.02, 0., -10.22 , -5.20 , -3.08, 0.89, +2.1 , +4.1 , +11., .0, 0., 0., .0,
.0, 0., 0.03, 0., -10.33 , -5.30 , -3.07, 0.79, +2.2 , +4.2 , +12., .0, 0., 0., .0,
.0, 0., 0.04, 0., -10.44 , -5.40 , -3.06, 0.69, +2.3 , +4.3 , +13., .0, 0., 0., .0,
.0, 0., 0.05, 0., -10.55 , -5.50 , -3.05, 0.59, +2.4 , +4.4 , +14., .0, 0., 0., .0,
.0, 0., 0.06, 0., -10.66 , -5.60 , -3.04, 0.49, +2.5 , +4.5 , +15., .0, 0., 0., .0,
.0, 0., 0.07, 0., -10.77 , -5.70 , -3.03, 0.39, +2.6 , +4.6 , +16., .0, 0., 0., .0,
.0, 0., 0.08, 0., -10.88 , -5.80 , -3.02, 0.29, +2.7 , +4.7 , +17., .0, 0., 0., .0,
.0, 0., 0.09, 0., -10.99 , -5.90 , -3.01, 0.19, +2.8 , +4.8 , +18., .0, 0., 0., .0,
.0, 0., 0.10, 0., -10.001, -5.00 , -3.00, 0.09, +2.9 , +4.9 , +19., .0, 0., 0., .0,
.0, 0., 0.20, 0., -10.002, -5.012, -3.10, 0.00, +2.10, +4.10, +20., .0, 0., 0., .0,
.0, 0., 0.30, 0., -10.003, -5.023, -3.11, 0.01, +2.11, +4.11, +21., .0, 0., 0., .0,
.0, 0., 0.40, 0., -10.004, -5.034, -3.12, 0.02, +2.12, +4.12, +22., .0, 0., 0., .0,
.0, 0., 0.50, 0., -10.005, -5.045, -3.13, 0.03, +2.13, +4.13, +23., .0, 0., 0., .0,
.0, 0., 0.60, 0., -10.006, -5.056, -3.14, 0.04, +2.14, +4.14, +24., .0, 0., 0., .0
};
//add now nan in row 1,3,11,13
for (unsigned int y = 0; y < h; y++) {
for (unsigned int x = 0; x < w; x++) {
if ( (x == 1)
||(x == 3)
||(x == 11)
||(x == 13)) {
vect_f_1[(y*w)+x] = NAN;
} else {
//vect_f_1[(y*w)+x] = fabs(vect_f_1[(y*w)+x]);
}
}
}
//add now nan in columns 5,9,
/*for (unsigned int y = 0; y < h; y++) {
for (unsigned int x = 0; x < w; x++) {
if ( (y == 5)
||(y == 9)) {
vect_f_1[(y*w)+x] = NAN;
}
}
}*/
if (w == h) {
//add now a 'thick' '/' diagonal of nan
/*for (unsigned int y = 0; y < h; y++) {
for (unsigned int x = 0; x < w; x++) {
if ( (x == y)
||(y == x-1)
||(y == x+1)) {
vect_f_1[(y*w)+x] = NAN;
}
}
}*/
//add now a 'thick' '\' diagonal of nan
/*for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++) {
if ( (x+y == h-1)
||(x+y == h )
||(x+y == h+1)) {
vect_f_1[(y*w)+x] = NAN;
}
}
}*/
}
//float
bool bImageWrote = true;
unsigned long int loc = 0l;
bImageWrote &= writeImage("./output/float_px1_wr.tiff", vect_f_1 , w, h, TypeDesc::FLOAT);
if (!bImageWrote) {
cout << " if (!bImageWrote) float_px1_wr" << endl;
return(1);
}
loc = 0l;
for (unsigned int y = 0; y < h; y++) {
for (unsigned int x = 0; x < w; x++) {
float frand = frandomValueMinus5toPlus5_oneDec();
//cout << "frand = " << frand << endl;
vect_f_1[loc] = vect_f_1[loc] + frand; //+12.0
loc++;
}
}
bImageWrote &= writeImage("./output/float_px2_wr.tiff", vect_f_1 , w, h, TypeDesc::FLOAT);
if (!bImageWrote) {
cout << " if (!bImageWrote) float_px2_wr" << endl;
return(1);
}
//display content for checking
stdout_displayImageContent_float("./output/float_px1_wr.tiff", w, h);
stdout_displayImageContent_float("./output/float_px2_wr.tiff", w, h);
cout << "signed 16:" << endl;
//signed 16
//type: signed 16 bit:
vector<signed short int> vect_s16_1 {
0, 0, 0, 0, -10, -45, -3, 0, +2, +4, +10, 0, 0, 0, 0,
0, 0, 0, 0, -11, -44, -3, 0, +2, +4, +10, 0, 0, 0, 0,
0, 0, 0, 0, -12, -43, -3, 0, +2, +4, +10, 0, 0, 0, 0,
0, 0, 0, 0, -13, -42, -3, 0, +2, +4, +10, 0, 0, 0, 0,
0, 0, 0, 0, -14, -41, -3, 0, +2, +4, +10, 0, 0, 0, 0,
0, 0, 0, 0, -15, -40, -3, 0, +2, +4, +10, 0, 0, 0, 0,
0, 0, 0, 0, -16, -39, -3, 0, +2, +4, +10, 0, 0, 0, 0,
0, 0, 0, 0, -17, -38, -3, 0, +2, +4, +10, 0, 0, 0, 0,
0, 0, 0, 0, -18, -37, -3, 0, +2, +4, +10, 0, 0, 0, 0,
0, 0, 0, 0, -19, -36, -3, 0, +2, +4, +10, 0, 0, 0, 0,
0, 0, 0, 0, -20, -35, -3, 0, +2, +4, +10, 0, 0, 0, 0,
0, 0, 0, 0, -21, -34, -3, 0, +2, +4, +10, 0, 0, 0, 0,
0, 0, 0, 0, -22, -33, -3, 0, +2, +4, +10, 0, 0, 0, 0,
0, 0, 0, 0, -23, -32, -3, 0, +2, +4, +10, 0, 0, 0, 0,
0, 0, 0, 0, -24, -31, -3, 0, +2, +4, +10, 0, 0, 0, 0
};
/*loc = 0l;
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++) {
if ((y*h+x)%2) {
vect_s16_1[loc] = -32768;
} else {
vect_s16_1[loc] = +32767;
}
loc++;
}
}*/
bImageWrote &= writeImage("./output/s16_px1_wr.tiff" , vect_s16_1, w, h, TypeDesc::INT16);
if (!bImageWrote) {
cout << " if (!bImageWrote) s16_px1_wr" << endl;
return(1);
}
loc = 0l;
for (unsigned int y = 0; y < h; y++) {
for (unsigned int x = 0; x < w; x++) {
signed int sirand = static_cast<signed int>(frandomValueMinus5toPlus5_oneDec());
//cout << "sirand = " << sirand << endl;
vect_s16_1[loc] = vect_s16_1[loc] + sirand; //+12
loc++;
}
}
bImageWrote &= writeImage("./output/s16_px2_wr.tiff", vect_s16_1, w, h, TypeDesc::INT16);
if (!bImageWrote) {
cout << " if (!bImageWrote) s16_px2_wr" << endl;
return(1);
}
//display content for checking
stdout_displayImageContent_signed16("./output/s16_px1_wr.tiff", w, h);
stdout_displayImageContent_signed16("./output/s16_px2_wr.tiff", w, h);
/*
cout << "---- stdout_displayImageContent_signed16_tryWay2:" << endl;
stdout_displayImageContent_signed16_tryWay2("./output/s16_px1.tiff", w, h);
stdout_displayImageContent_signed16_tryWay2("./output/s16_px2.tiff", w, h);
cout << "stdout_displayImageContent_signed16_tryWay2 ----" << endl;
*/
//type: unsigned 8 bit:
vector<unsigned char> vect_byte_1 {
0, 1, 0, 0, 120, 135, 3, 0, 200, 4, 255, 0, 0, 0, 0,
0, 2, 0, 0, 121, 136, 3, 0, 202, 4, 254, 0, 0, 0, 0,
0, 3, 0, 0, 122, 137, 3, 0, 204, 4, 253, 0, 0, 0, 0,
0, 4, 0, 0, 123, 138, 3, 0, 206, 4, 252, 0, 0, 0, 0,
0, 5, 0, 0, 124, 139, 3, 0, 208, 4, 251, 0, 0, 0, 0,
0, 6, 0, 0, 125, 140, 3, 0, 210, 4, 180, 0, 0, 0, 0,
0, 7, 0, 0, 126, 141, 3, 0, 211, 4, 181, 0, 0, 0, 0,
0, 9, 0, 0, 127, 142, 3, 0, 213, 4, 182, 0, 0, 0, 0,
0, 9, 0, 0, 128, 143, 3, 0, 215, 4, 183, 0, 0, 0, 0,
0, 10, 0, 0, 129, 144, 3, 0, 217, 4, 184, 0, 0, 0, 0,
0, 11, 0, 0, 130, 145, 3, 0, 219, 4, 185, 0, 0, 0, 0,
0, 12, 0, 0, 131, 146, 3, 0, 220, 4, 186, 0, 0, 0, 0,
0, 13, 0, 0, 132, 147, 3, 0, 230, 4, 187, 0, 0, 0, 0,
0, 14, 0, 0, 133, 148, 3, 0, 240, 4, 188, 0, 0, 0, 0,
0, 15, 0, 0, 134, 149, 3, 0, 250, 4, 189, 0, 0, 0, 0
};
bImageWrote &= writeImage ("./output/byte_correlScore_wr.tiff", vect_byte_1, w, h, TypeDesc::UINT8);
if (!bImageWrote) {
cout << " if (!bImageWrote) byte_correlScore_wr" << endl;
return(1);
}
stdout_displayImageContent_uint8("./output/byte_correlScore_wr.tiff", w, h);
return(0);
}
int main_bigImages(int argc, char*argv[]) {
std::srand(std::time(nullptr)); // use current time as seed for random generator
unsigned int w = 1250;//1500;
unsigned int h = 1250;//1500;
unsigned int nbchannel = 1;
unsigned long int offset = 0l;
// width * height * nchannel = 15*15*1
// type: float:
vector<float> vect_f_1(w*h);
offset = 0l;
for (unsigned int y = 0; y < h; y++) {
for (unsigned int x = 0; x < w; x++) {
/*if (!(x%17)) {
vect_f_1[offset] = NAN;
} else {*/
vect_f_1[offset]=static_cast<float>(x*y)/static_cast<float>((w-1)*(h-1));
//}
offset++;
}
}
bool bImageWrote = true;
bImageWrote &= writeImage("./output/float_px1_wr_1500.tiff", vect_f_1, w, h, TypeDesc::FLOAT);
if (!bImageWrote) {
cout << " if (!bImageWrote) float_px1_wr_1500" << endl;
return(1);
}
unsigned long int loc = 0l;
for (unsigned int y = 0; y < h; y++) {
for (unsigned int x = 0; x < w; x++) {
float frand = frandomValueMinus5toPlus5_oneDec();
//cout << "frand = " << frand << endl;
vect_f_1[loc] = vect_f_1[loc] + frand; //+12.0
loc++;
}
}
bImageWrote &= writeImage("./output/float_px2_wr_1500.tiff", vect_f_1, w, h, TypeDesc::FLOAT);
if (!bImageWrote) {
cout << " if (!bImageWrote) float_px2_wr_1500" << endl;
return(1);
}
// type: signed 16 bit:
vector<signed short int> vect_s16_1(w*h);
offset = 0l;
for (unsigned int y = 0; y < h; y++) {
for (unsigned int x = 0; x < w; x++) {
/*if (!(x%17)) {
vect_f_1[offset] = NAN;
} else {*/
vect_s16_1[offset]=-2 + static_cast<float>(x*y)/static_cast<float>((w-1)*(h-1));
//}
offset++;
}
}
bImageWrote = true;
bImageWrote &= writeImage("./output/s16_1_px1_wr_1500.tiff", vect_s16_1, w, h, TypeDesc::INT16);
if (!bImageWrote) {
cout << " if (!bImageWrote) s16_1_px1_wr_1500" << endl;
return(1);
}
loc = 0l;
for (unsigned int y = 0; y < h; y++) {
for (unsigned int x = 0; x < w; x++) {
float frand = frandomValueMinus5toPlus5_oneDec();
//cout << "frand = " << frand << endl;
vect_s16_1[loc] = vect_s16_1[loc] + frand; //+12.0
loc++;
}
}
bImageWrote &= writeImage("./output/s16_px2_wr_1500.tiff", vect_s16_1, w, h, TypeDesc::INT16);
if (!bImageWrote) {
cout << " if (!bImageWrote) s16_px2_wr_1500" << endl;
return(1);
}
//type: unsigned 8 bit:
vector<unsigned char> vect_byte_1(w*h);
offset = 0l;
for (unsigned int y = 0; y < h; y++) {
for (unsigned int x = 0; x < w; x++) {
/*if (!(x%17)) {
vect_byte_1[offset] = NAN;
} else {*/
vect_byte_1[offset]=static_cast<int>( (static_cast<float>(x*y)) / (static_cast<float>((w-1)*(h-1))/255.0) );
//} cout << " if (!bImageWrote) byte_correlScore_wr_1500" << endl;
offset++;
}
}
bImageWrote &= writeImage("./output/byte_correlScore_wr_1500.tiff", vect_byte_1, w, h, TypeDesc::UINT8);
if (!bImageWrote) {
cout << " if (!bImageWrote) byte_correlScore_wr_1500" << endl;
return(1);
}
//display content for checking
stdout_displayImageContent_float__first_in_last_values("./output/float_px1_wr_1500.tiff", w, h);
stdout_displayImageContent_float__first_in_last_values("./output/float_px2_wr_1500.tiff", w, h);
stdout_displayImageContent_s16__first_in_last_values("./output/s16_px1_wr_1500.tiff", w, h);
stdout_displayImageContent_s16__first_in_last_values("./output/s16_px2_wr_1500.tiff", w, h);
stdout_displayImageContent_uint8__first_in_last_values("./output/byte_correlScore_wr_1500.tiff", w, h);
return(0);
}
int main_hugeImages(int argc, char*argv[]) {
std::srand(std::time(nullptr)); // use current time as seed for random generator
unsigned int w = 5000;
unsigned int h = 5000;
unsigned int nbchannel = 1;
unsigned long int offset = 0l;
cout << "w*h*nbchannel= " << w*h*nbchannel << endl;
// width * height * nchannel = 50000*50000*1
//----------------------------------------
// type: float:
vector<float> vect_f_1(w*h*nbchannel);
cout << "vector<float> ( " << w*h*nbchannel << ") allocated" << endl;
offset = 0l;
for (unsigned int y = 0; y < h; y++) {
for (unsigned int x = 0; x < w; x++) {
/*if (!(x%17)) {
vect_f_1[offset] = NAN;
} else {*/
float x1 = x;// / 1000.0;
float y1 = y;// / 1000.0;
vect_f_1[offset]=static_cast<float>(x1*y1)/static_cast<float>((w-1)*(h-1));
//}
offset++;
//cout << offset << "\r";
}
}
cout << "float " << w*h*nbchannel << " feed " << endl;
cout << "float first: " << vect_f_1[0] << endl;
cout << "float in : " << vect_f_1[(w*h)/2] << endl;
cout << "float last : " << vect_f_1[(w*h)-1] << endl;
//float
bool bImageWrote = true;
bImageWrote &= writeImage("./output/float_px1_wr_50000.tiff", vect_f_1, w, h, TypeDesc::FLOAT);
if (!bImageWrote) {
cout << " if (!bImageWrote) float_px1_wr_50000" << endl;
return(1);
}
unsigned long int loc = 0l;
for (unsigned int y = 0; y < h; y++) {
for (unsigned int x = 0; x < w; x++) {
float frand = frandomValueMinus5toPlus5_oneDec();
//cout << "frand = " << frand << endl;
vect_f_1[loc] = vect_f_1[loc] + frand; //+12.0
loc++;
}
}
cout << "float first: " << vect_f_1[0] << endl;
cout << "float in : " << vect_f_1[(w*h)/2] << endl;
cout << "float last : " << vect_f_1[(w*h)-1] << endl;
bImageWrote &= writeImage("./output/float_px2_wr_50000.tiff", vect_f_1, w, h, TypeDesc::FLOAT);
if (!bImageWrote) {
cout << " if (!bImageWrote) float_px2_wr_50000" << endl;
return(1);
}
//----------------------------------------
// type: signed 16 bit:
vector<signed short int> vect_s16_1(w*h*nbchannel);
offset = 0l;
for (unsigned int y = 0; y < h; y++) {
for (unsigned int x = 0; x < w; x++) {
//if (!(x%17)) {
// vect_f_1[offset] = NAN;
//} else {
// signed short int x1 = x/2;// / 1000;
// signed short int y1 = y/2;// / 1000;
//vect_s16_1[offset]= -1 + static_cast<signed short int>(x1*y1)/static_cast<signed short int>((w-1)/2*(h-1)/2);
if (offset%2) {
vect_s16_1[offset] = +10;
} else {
vect_s16_1[offset] = -71;
}
//}
offset++;
}
}
cout << "signed 16 first: " << vect_s16_1[0] << endl;
cout << "signed 16 in : " << vect_s16_1[(w*h)/2] << endl;
cout << "signed 16 last : " << vect_s16_1[(w*h)-1] << endl;
//signed short int
bImageWrote = true;
bImageWrote &= writeImage("./output/s16_px1_wr_50000.tiff", vect_s16_1, w, h, TypeDesc::INT16);
if (!bImageWrote) {
cout << " if (!bImageWrote) s16_px1_wr_50000" << endl;
return(1);
}
loc = 0l;
for (unsigned int y = 0; y < h; y++) {
for (unsigned int x = 0; x < w; x++) {
signed short int s16rand = s16randomValueMinus5toPlus5_oneDec();
//cout << "frand = " << frand << endl;
vect_s16_1[loc] = vect_s16_1[loc] + 2*s16rand; //+12.0
loc++;
}
}
cout << "signed 16 first: " << vect_s16_1[0] << endl;
cout << "signed 16 in : " << vect_s16_1[(w*h)/2] << endl;
cout << "signed 16 last : " << vect_s16_1[(w*h)-1] << endl;
bImageWrote &= writeImage("./output/s16_px2_wr_50000.tiff", vect_s16_1, w, h, TypeDesc::INT16);
if (!bImageWrote) {
cout << " if (!bImageWrote) s16_px2_wr_50000" << endl;
return(1);
}
/*
//type: unsigned 8 bit:
vector<unsigned char> vect_byte_1(w*h*nbchannel);
offset = 0l;
for (unsigned int y = 0; y < h; y++) {
for (unsigned int x = 0; x < w; x++) {
//if (!(x%17)) {
// vect_byte_1[offset] = NAN;
//} else {
vect_byte_1[offset]=static_cast<int>( (static_cast<float>(x*y)) / (static_cast<float>((w-1)*(h-1))/255.0) );
//}
offset++;
}
}
bImageWrote &= writeImage("./output/byte_correlScore_wr_50000.tiff", vect_byte_1, w, h, TypeDesc::UINT8);
if (!bImageWrote) {
cout << " if (!bImageWrote) byte_correlScore_wr_50000" << endl;
return(1);
}
*/
//display content for checking
stdout_displayImageContent_float__first_in_last_values("./output/float_px1_wr_50000.tiff", w, h);
stdout_displayImageContent_float__first_in_last_values("./output/float_px2_wr_50000.tiff", w, h);
stdout_displayImageContent_s16__first_in_last_values("./output/s16_px1_wr_50000.tiff", w, h);
stdout_displayImageContent_s16__first_in_last_values("./output/s16_px2_wr_50000.tiff", w, h);
stdout_displayImageContent_uint8__first_in_last_values("./output/byte_correlScore_wr_50000.tiff", w, h);
return(0);
}
int main(int argc, char*argv[]) {
main_smallImages(argc, argv);
//main_bigImages(argc, argv);
//main_hugeImages(argc, argv);
return(0);
}
|
/**
* Copyright 2019-2021 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MINDSPORE_CCSRC_MINDDATA_DATASET_ENGINE_DATASETOPS_SHUFFLE_OP_H_
#define MINDSPORE_CCSRC_MINDDATA_DATASET_ENGINE_DATASETOPS_SHUFFLE_OP_H_
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <string>
#include <unordered_map>
#include <vector>
#include "minddata/dataset/core/tensor.h"
#include "minddata/dataset/core/tensor_shape.h"
#include "minddata/dataset/engine/dataset_iterator.h"
#include "minddata/dataset/engine/datasetops/pipeline_op.h"
#include "minddata/dataset/util/status.h"
namespace mindspore {
namespace dataset {
class ShuffleOp : public PipelineOp {
// Shuffle buffer state flags
//
// Shuffle buffer is in a state of being initialized
static constexpr int32_t kShuffleStateInit = 0;
// Shuffle buffer is in a state of being actively drained from, but refilling as well
static constexpr int32_t kShuffleStateActive = 1;
// Shuffle buffer is in a state of being drained
static constexpr int32_t kShuffleStateDrain = 2;
public:
// Constructor of the ShuffleOp
// @note The builder class should be used to call it
// @param shuffle_size - The size for the shuffle buffer
// @param shuffle_seed - The seed to use for random number generation
// @param op_connector_size - The output connector queue size
ShuffleOp(int32_t shuffle_size, uint32_t shuffle_seed, int32_t op_connector_size, bool reset_every_epoch);
// Destructor
~ShuffleOp() = default;
// A print method typically used for debugging
// @param out - The output stream to write output to
// @param show_all - A bool to control if you want to show all info or just a summary
void Print(std::ostream &out, bool show_all) const override;
// << Stream output operator overload
// @notes This allows you to write the debug print info using stream operators
// @param out - reference to the output stream being overloaded
// @param so - reference to the ShuffleOp to display
// @return - the output stream must be returned
friend std::ostream &operator<<(std::ostream &out, const ShuffleOp &so) {
so.Print(out, false);
return out;
}
// Class functor operator () override.
// All dataset ops operate by launching a thread (see ExecutionTree). This class functor will
// provide the master loop that drives the logic for performing the work
// @return Status The status code returned
Status operator()() override;
// Base-class override for special eoe handler.
// ShuffleOp must override this because it shall not perform default handling of eoe. Instead
// the ShuffleOp needs to manage actions related to the end of the epoch itself.
// @return Status The status code returned
Status EoeReceived(int32_t worker_id) override;
// Op name getter
// @return Name of the current Op
std::string Name() const override { return kShuffleOp; }
private:
// Private function to add a new row to the shuffle buffer.
// @return Status The status code returned
Status AddRowToShuffleBuffer(TensorRow new_shuffle_row);
// Private function to populate the shuffle buffer initially by fetching from the child output
// connector until the shuffle buffer is full (or there is no more data coming).
// @return Status The status code returned
Status InitShuffleBuffer();
// Private function to re-init the shuffle op for another epoch. Shuffle op calls this by
// itself rather than waiting for the reset driven from operators above it in the pipeline.
// @return Status The status code returned
Status SelfReset();
int32_t shuffle_size_; // User config for the size of the shuffle buffer (number of rows)
uint32_t shuffle_seed_;
bool reshuffle_each_epoch_;
// rng_ is seeded initially with shuffle_seed_. mt19937 is used for its large period.
// specifically mt19937_64 is used to generate larger random numbers to reduce bias when
// modding to fit within our desired range. we dont use a distribution
// (ie uniform_int_distribution) because we will need to create up to |dataset| instances
// of the distribution object in the common case of a perfect shuffle
std::mt19937_64 rng_;
// A single (potentially large) buffer of tensor rows for performing shuffling.
std::unique_ptr<TensorTable> shuffle_buffer_;
int32_t shuffle_last_row_idx_; // Internal tracking of the last slot of our shuffle buffer
int32_t shuffle_buffer_state_; // State tracking for the shuffle buffer phases of work
std::unique_ptr<ChildIterator> child_iterator_; // An iterator for fetching.
};
} // namespace dataset
} // namespace mindspore
#endif // MINDSPORE_CCSRC_MINDDATA_DATASET_ENGINE_DATASETOPS_SHUFFLE_OP_H_
|
William C. Weldon
William C. Weldon (born November 26, 1948) is a former chairman of Johnson & Johnson, He was the eighth chairman in Johnson & Johnson's history of more than one hundred years.
Early life and education
He was born in Brooklyn, New York. His parents were a Broadway stagehand and a costume designer. He received a Bachelor of Arts degree in biology from Quinnipiac University in 1971.
Career
He spent his entire working life at Johnson & Johnson. He joined the company as a sales representative for the McNeil Pharameutical division in 1971 and eventually became the head of Johnson & Johnson's Ethicon Endo-Surgery business in 1992. He became the head of Johnson & Johnson's pharmaceutical operations in 1998 and then became the company's chief executive officer (CEO) in 2002. As CEO, Weldon engineered some of the largest acquisitions in the company's history including the purchase of Alza and Pfizer's consumer-health product line.
In 2009, he earned a total compensation of $22,830,834, which included a base salary of $1,802,500, a cash bonus of $12,831,146, stock awards of $2,762,532, option awards of $5,238,069, and other compensation of $196,587. In 2011, The New York Times named him on its list of "The Worst C.E.O.'s of 2011" for the increased number of Johnson & Johnson product recalls under his leadership. Additionally, as of 2013, his story was a case study at the Leadership & Corporate Accountability course at Harvard Business School.
In Weldon's first full year as the company's CEO, total revenues increased from $32.3 billion to $36.3 billion and net earnings from $5.7 billion to $6.6 billion. In 2011, his last full year as CEO, revenues were $44.7 billion and net earnings were $9.7 billion.
Weldon retired as chairman of Johnson & Johnson on December 28, 2012, and was reported to receive $143.5 million in retirement pay.
Board memberships
He also sits on the JPMorgan Chase & Co. board of directors, the HeartFlow board of directors, the ExxonMobil board of directors and the Quinnipiac University board of trustees. |
Successful treatment of rheumatoid meningitis with cyclophosphamide but not infliximab Rheumatoid meningitis is a rare but lethal disorder that occurs in an elderly population with longstanding rheumatoid arthritis (RA).1 Although the majority of patients experience neurological symptoms, up to 26% of the patients were asymptomatic in a case series study as identified by necropsy.1 There is poor correlation between the severity of synovitis and neurological symptoms, which therefore imposes a challenge in the diagnosis of this condition.1 To date there are no established treatment regimens for rheumatoid meningitis, although most patients receive immunosuppressive agents. Although the anti-tumour necrosis factor (TNF) agents have been proved to provide significant relief for the articular manifestations of RA, their effectiveness for rheumatoid meningitis has not been reported.2 A 58 year old woman with previous diagnoses of fibromyalgia and osteoarthritis was referred to the rheumatology clinic of the Massachusetts General Hospital (MGH) with worsening polyarthritis of both hands, wrists, knees, and ankles while receiving daily rofecoxib, 25 mg. Before the visit she had undergone extensive investigation for a 6 |
An event-based geo-social user profile for a personalized information retrieval The user of a social website is often interested by information about events that have interested other users, especially his friends, and that appear remarkably in their researches, exchanges and sharing. In this paper, for a better description of the user and his interests, we propose: (i) a geosocial user profile that takes into account the event aspect of user information needs, (ii) a search process integrating the user profile for a better personalization and adaptation of the search results. |
Google’s fourth Android O beta is here and it’s a tempting upgrade for Pixel and Pixel XL users. While there are certainly some new features and reasons to try it today, there are also reasons to avoid trying the Android 8.0 preview on the Google Pixel.
The latest official software for Pixel phones is Android 7.1.2 Nougat. However, in an effort to test and improve what’s coming next, the developer preview and Android O beta is another option. On July 24th Google released the fourth and final beta, its most stable version yet.
Users with any of Google’s recent devices are eligible for the Android O beta. Here we’ll be sharing details on the Pixel update and if it’s worth installing. If you’re considering trying Android O read on for some of the benefits and downsides.
While Android 7.1.1 and even 7.1.2 were small maintenance releases for Nougat, Android O is a much bigger update. It’s the next big software release and Google confirmed the version is Android 8.0, with the name likely being Oreo.
With each new release, we learn more about what’s coming in Android O. The first beta was very bare-bones, a second preview was released on May 17th, and the third preview fixed over 100 bugs and problems. This week the fourth and final beta arrived, the release candidate to fix any outstanding bugs before releasing it to the public. Google states to expect its arrival around the end of summer. So late August or September.
Today though, Android O is still pretty promising. Some new features include dynamic icons, bundled notifications, limiting background processes to improve battery life and other small tweaks. Google redesigned the settings menu, added picture-in-picture mode, and introduced auto-fill to apps. How Google Chrome remembers forms, login details and your address, something similar happens inside Android apps. There’s a lot to like, and this is just the beginning of a large update.
Pixel owners will also enjoy the new Notification Dots on icons, which ties into the app shortcuts. Long-press an app icon on for tons of new options, quick access to aspects inside of the app, or see notifications at a glance. Not to mention potential fixes for a wide array of Pixel problems, like Bluetooth drops.
Considering this is an early developer preview and new software, it is not the most stable version of Android available. In fact, Google themselves warned users about bugs and states it is not ready for daily use. The beta is for developers and to gather feedback, not to use on your primary device. Even if this is the last beta and considered fairly stable.
Installing the Android 8.0 O beta has its benefits but there are also downsides to using early software and we want to discuss those here. This list of reasons should help you decide if it is worth trying the Google Pixel Android O beta.
Google's developer preview betas are exactly that, an early developer preview. They aren't intended for anyone and everyone. Even though anyone that wants to try it can.
Pixel owners will run into bugs, there's no question about that. Google themselves confirmed more than a few are present in the software. I have it on my Pixel XL and Pixel C tablet, and it seems pretty stable. The first beta had some crashes, but each release made things better. Now on the 4th, I'm not experiencing any issues on the Pixel XL.
You should still only install it if you like living on the edge and can deal with these issues. Yes, it has some benefits, but also a few cons. So far the software runs pretty smooth, and battery life seems decent. Don't say we didn't warn you though. |
Paul Ryan’s proposals in relation to Medicare are the most open threat by the ruling elite to privatize the social insurance program enacted in 1965. As always, it is being set as a new milestone as part of an ever further shift of the entire political establishment to the right.
The president’s comments continue the phony sparring between the White House and Congressional Republicans over the budget. This cynical dance is aimed at concealing the policies of both big business parties as they conspire to make the working class pay for the continuing economic slump triggered by the 2008 Wall Street crash. Central to this is the slashing of government spending on vital social programs, including Medicare, Medicaid and food stamps.
Ryan’s budget plan follows the release of a budget last month by the White House. Neither proposal will have any real impact on spending during the fiscal year that begins October 1, 2014, as the overall spending for fiscal years 2015 and 2016 was set in a bipartisan agreement last December. Instead, the dueling plans set the tone for the two parties in the upcoming mid-term Congressional elections.
On Wednesday, the Democratic Congressional Campaign Committee launched a new ad campaign called “Battleground: Middle Class,” attacking Republican proposals to revamp Medicare, replace the Medicaid program for the poor with state block grants, and make other cuts to domestic social spending.
The White House is falsely promoting the Affordable Care Act (ACA), its signature domestic initiative, as a progressive reform that will expand the availability and quality of health care for millions of American workers and their families. The ACA is held up as the opposite of Republican proposals, including the plan to privatize Medicare. In fact, the legislation commonly known as Obamacare, which went into effect January 1, 2014, serves as a model for Ryan’s reactionary proposals.
While Ryan’s budget calls for the repeal of ACA, it conveniently incorporates the roughly $700 billion in cuts to Medicare over a decade planned through Obamacare, as well as $1 trillion in revenues projected to be generated by the legislation. These massive cuts to Medicare, which the White House has cynically claimed will result in better health care for seniors, are embraced in the Ryan’s “Path to Prosperity” budget.
Ryan was brought forward by Democrats and Republicans during budget negotiations last year. The Republican congressman worked with Democratic Party negotiators to pass a deal that makes permanent over a trillion dollars in “sequester” budget cuts, while attacking pensions for federal workers and implementing other right-wing measures. Obama praised the deal and the bipartisan character of the negotiations.
Despite the claims of the Tea Party and other right-wing opponents of Obamacare, the legislation has nothing in common with socialized medicine. The key provision of the ACA, the “individual mandate,” requires individuals and families who are not insured through their employer or a government program such as Medicare or Medicaid to purchase insurance from private insurance companies or pay a penalty. Businesses, on the other hand, have been granted waiver upon waiver to the toothless “employer mandate” under the law.
Uninsured individuals shopping for coverage on the insurance exchanges, or “marketplaces,” set up under the ACA, have been shocked to find that the majority of cheaper “bronze” policies for sale come with deductibles in excess of $5,000, as well as other high out-of-pocket costs. Choices of doctors and hospitals are also restricted. The legislation that Obama pledged would provide “near universal” health care is in reality a scheme to funnel millions of new cash-paying customers to the private insurers.
From the start, the aim of the US health care overhaul has been to create an even more heavily class-based system than that which already exists. Both the White House and Congressional Republicans are in general agreement on this agenda, differing only on the methods and pace for carrying it out.
In particular, both parties are eyeing Social Security, Medicare and Medicaid—programs won through mass social struggles of the working class—for not only sweeping funding cuts, but ultimately for destruction through privatization and other means. |
Mechanism of fracture in sheet metal cutting processes and its effect on sheared edge stretchability In recent years, implementation of aluminum alloys, the advanced high strength steels and ultra high strength steels (UHSS) is quickly increasing in automotive industry. However, these materials are often sensitive to sheared edge cracking if stretching along the sheared edge occurs in such processes as drawing of panels with blanked windows, stretch flanging and stretch hemming of edges of the panel. This study is dedicated to development of experimental techniques necessary to account for sheared edge condition on material formability as well as reporting the experimental results and general trends. Analysis of the hole punching process indicated that uniformity of the cutting clearance is rather difficult to maintain, especially for UHSS material where cutting forces are substantially higher than for mild steels or aluminum alloys, and stiffness of the tool starts playing critical role. Therefore, the majority of experimental studies were performed as tensile tests of samples sheared along a straight line in a dedicated trim tool where special measures were taken to achieve consistency of the die clearance. Experimental results on sheared edge stretchability of aluminum alloys similar to 6111-T4 and UHSS steel DP980 are reported. The mechanism of fracture propagation in trimming and hole punching processes is discussed in conjunction with sheared edge stretchability. The rather unique mechanism of fracture observed for trimming of UHSS DP980 steel leads to burr breaking at the final stage of the shearing process. Introduction Advanced and ultra-high strength steels (AHSS and UHSS) as well as aluminum alloys (AA) offer impressive combinations of strength and ductility that can reduce the mass and improve the crashworthiness of sheet-formed automotive parts. The process of stamping parts from sheet metal frequently includes blanking, punching, and trimming operations. A substantial number of research efforts have been dedicated to the analysis of these operations. The common knowledge today is that the clearance between the cutting edges should be maintained at approximately 10% of the sheet metal thickness t, and the cutting edges themselves should be kept sharp. The typical sheared edge on sheet metal has four basic features termed rollover, burnish, fracture, and burr. It should be indicated that for large automotive panels satisfying, optimum cutting condition is often problematic if not impossible due to high cost of accurate alignment of the cutting edges along the perimeter of the trimmed part which can be several meters long. Initially knife-sharp cutting edges usually become duller during the life of the die due to tool wear which requires periodic resharpening of the cutting edges. For AHSS and UHSS steels, wear of cutting edges becomes more critical due to substantially higher overall strength of the material being sheared and also due to the presence of very hard martensitic particles. In order to avoid slivering problems in trimming of aluminum alloys, the moving cutting edges often belonging to the upper tool are dulled to the radius of approximately 0.1mm as recommended in. Tool wear and dulling of the cutting edges both potentially lead to reduced formability of the sheared edge resulting in splits originating from the sheared edges if the sheared edge undergoes some stretching. It was already observed in stamping practice of mild steels that loss of formability of the blanks stretched along the sheared edge is associated with the growth of the burr on the sheared edge often reported as a percentage of the thickness of the sheet. For AA6111-T4, which loss of formability was reported by Le et al. with increase of the cutting clearance as well as a function of the cutting angle and sheet metal prestrain in forming operations preceding sheet metal trimming. Some loss of formability was observed at even 10% of thickness cutting clearances. AHSS and UHSS are usually less sensitive to the cutting clearance. As reported in, DP500 and DP600 steel are usually rather forgiving to variation of cutting clearance up 20% of thickness. More recently Nasheralahkami et al. studied the effect of clearance and tool wear on generation of burrs. One of the current issues in stamping of light weight panels is designing the cutting process and shearing tools in a way that material formability is still available for further stretching operations after the sheet metal was sheared, blanked, punched or trimmed. From broadly used concepts of material damage during plastic deformation, it can be assumed that if more damage to the metal is done during shearing, then less formability is available for further forming operations. The amount of damage done to the blank in the shearing process can be measured by the distribution of microhardness in the crosssections perpendicular to the cutting line. Such studies were performed by numerous researchers: a typical distribution of microhardness for blanking of 5mm thick mild steel was provided by Lange for 1% and 10% cutting clearances. No major difference was observed at maximum hardness level between these two cases. The area of plastic deformation was propagated inside the sheared blank for 0.3-0.58 of sheet metal thickness. The maximum increase in hardness compared to the hardness of the as-received material was approximately a factor of 2.0-2.2. Assuming that the microhardness variation is linear, as described by Pavlina and VanTyne, the maximum work hardening can be estimated as the ratio of the flow stress in the deformed zone to the yield stress of the sheet. No major difference was observed for these two conditions in shear resistance calculated as a ratio of maximum cutting force and area of sheared cross-section: the shear resistance was slightly higher for a smaller clearance. A small difference in shear resistance for a variety of clearances was also observed by multiple other researchers for a variety of other materials. In general, it indicates that the average level of plastic deformation in sheet metal along the sheared surface is approximately the same assuming that the area of the sheared surface does not change significantly. Johnson and Slater also used similar methodology comparing microhardness distribution in blanked 9.5mm thick plate samples for sharp and dull shearing edges of the blanking die. The maximum hardness observed in both cases was similar. However, the depth of plastic deformation for the dull tool was larger. Hilditch and Hodgson performed microhardness measurement for AA6111 and mild steel for different levels of tool penetration for 5% cutting clearance. It was observed that the overall trends of hardness was similar for both materials. The hardness of central line between the cutting edges was increasing with the growth of penetration of the cutting edges into the blank. A number of analytical models of the cutting processes were developed based upon the simplifying assumption that the shear strain is constant within the cutting clearance and equal to the ratio of penetration and cutting clearance. A review of these models is discussed by Klingenberg and Singh. The major assumption was that the strains can be estimated based upon the shear angle which could be 3 estimated as a ratio of the burnish zone and the cutting clearance. The displacement of the points of the blank was considered vertical. This model confirms that the strains increase with increasing of the cutting edges penetration. However, if one imagines that the cutting clearance is reduced factor of 10 (as described by Lange ), the strain level should increase factor of ten and be reflected in the material work hardening. Experimental studies of the shear strains based upon microstructural observations was performed by Wu et al for variety of steels. 1234567890''"" Material flow characterization in shearing processes using square grids was performed by Swift for a variety of materials using shearing bars of rectangular cross-section for various cutting clearances. Using gridding technology, Golovashchenko analyzed the strain distribution in AA6111-T4 plate sheared with 2% and 10% clearances. Based upon grid analysis as well as by reviewing the hardness distribution, it could be indicated that plastic deformations propagate substantially outside the cutting clearance. However, the increase of measured strains with increased penetration of the cutting edges can be interpreted as an increase of sheared surface damage with the increase of burnished area of the sheared edge. In this study, the emphasis will be made on the mechanism of sheet metal fracture during trimming and its effect on sheared edge stretchability. Since the trimming process more often is followed by sheared edge stretching in stretch flanging and stretch hemming, compared to blanking and hole punching, the major emphasis in this paper is made on sheared edge stretchabilty after trimming. Mechanism of fracture The schematic of the trimming process is illustrated in Figure 1a. Unlike in blanking or hole punching processes (illustrated in Figure 1b), in trimming, the scrap can freely rotate driven by the upper shearing edge of the die. An ideal separation mechanism described in a number of early publications on shearing and blanking reviewed in as well as in more recent reference literature is in propagation of two cracks moving from steady and moving cutting edges of the die. If both cracks meet, a fairly smooth sheared surface is formed from the sharp cutting edges indenting into the blank. This mechanism is possible for blanking operations when the sheared portion of metal has a closed perimeter for cutting with rather small clearance and when no bending of the sheared material takes place. As was indicated by Golovashchenko in, such a cutting mechanism is possible for automotive sheet if the clearance is about 2%. Such cutting conditions are unrealistic for large automotive panels because of the risk of damaging the die if the clearance becomes negative. In the automotive industry, bending of scrap is often the factor which shifts fracture from the "classic two-crack meet each other" mechanism to a mechanism of single crack propagation from the moving cutting edge of the tool. In this study, the mechanism of fracture during trimming was analyzed by using a partial trimming process where the stroke of the press was interrupted before the final separation of the scrap and part sides. Typically, the smallest acceptable cutting clearance in trimming operation can be 5%. The development of fracture in aluminum sheet belonging to 6111-T4 family is illustrated in Figure 2a where the process was stopped before the major crack propagated from the upper cutting edge to the lower. Looking at the cross-sections of the part side ( Figure 2b This asymmetric behavior is the result of bending down of the scrap during trimming process. Reviewing the grain structure of the partially sheared sample in Figure 2a, it could be observed that the shear angle varies substantially along the height of the sample. Fairly deep indentation of the upper cutting edge of the trim die into the blank at the moment of separation (Figure 2b) of approximately 48% of the thickness leads to large strain of the sheared edge. Reducing the indentation to 30%, as shown in Figure 2a leads to visibly smaller strains. From this perspective, increasing the height of burnish zone is the factor contributing to the overall increase of the strain on the sheared edge. However, the trajectory of the crack is also highly critical: if the crack would propagate vertically, heavily deformed material adjacent to the lower shearing edge would be retained on the part side. Experimental results on trimming the sample with 20% cutting clearance from the same material is illustrated in Figure 3. In this case, fracture propagates almost vertically from the upper cutting edge to the free surface at the bottom of the sample rather than to the area of indentation of the lower cutting edge. It should be noted that fracture does not propagate instantly. At the end of the separation process the burr has additional stretching until it fractures. Even though material undergoes rather substantial plastic deformation in the area of upper cutting edge indentation, the deformation process at this stage occurs with rather substantial contact pressure applied to the tool. The area of the tip of the burr undergoes plastic deformation on the free surface of the blank. Towards the end of the separation process, it is deformed as in a plane strain tensile test. Therefore, the material has very substantial damage at the tip of the burr. The results of sheared edge stretchability study measured by the tensile test of the sheared strip according to the methodology described by Le et al. are illustrated in Figure 4. Formation of the burr on the sheared edge leads to a substantial drop in sheared edge stretchability. Illustrated cross-sections of aluminum samples are very convenient for study of the areas of plastic deformation and evolution of strains during the trimming process due to fairly large size of grains which are typically an order of magnitude larger than steel grains. Very similar trends occur in steels. For example Smith illustrated the drastic loss in sheared edge formability as a function of the burr height for mild steel. Since mild steels are very formable, stretching of the tip of the burr at the final stage of the process is very likely the reason for this phenomenon. Similar trend was observed by the authors for DP500 and DP600 steels as well as for three aluminum alloys. Two major mechanisms of fracture are observed during sheared edge stretchability study: a) for trimming conditions resulting in no-burr on the sheared edge, fracture initiates in the form of multiple cross-hatched lines throughout the fracture surface of the sheared edge ( Figure 5a) and b) for trimming conditions leading to formation of burrs, the typical fracture mechanism is through multiple crack initiation from the tip of the burr (Figure 5b) which was subjected to substantial stretching in plane strain conditions. a) b) c) Figure 3. Cross-sections of 1mm thick aluminum sample (a) during trimming process with 20% cutting clearance; b) part side and c) scrap side after the trimming process was completed. The role of the burrs in initiation of fracture during stretching was further analyzed in order to clarify what feature of the burr plays the most substantial role in fracture initiation. On one hand, the burrs have rather substantial deformation due to material extrusion into the cutting clearance followed by additional stretching during the final separation stage. On the other hand, burrs have variable heights and crosssections; therefore, areas with smaller cross-section might create concentration of stresses during a tensile test. In order to distinguish between these two mechanisms, aluminum sheared strips were subjected to heat treatment, as described in detail by Wang and Golovashchenko, which removed the effect of cold work, but left the geometry of the burr with variable cross-section in place. The results of the tensile testing of as-sheared compared to sheared and heat treated samples provided substantial increase in elongation of the sample up to the failure mode of necking which clarified that cold work is the most important reason why fracture originates on the tip of the burr. Analysis of mechanisms of fracture of the sheared edge was also performed for Ultra High Strength Steel (UHSS) DP980. In general, this steel showed less tendency to form burrs. For small cutting clearances, the fracture mechanism during trimming was very similar to the mechanism observed for the aluminum samples in Figure 2. However, as rather unusual mechanism of separation was observed for large cutting clearances. It should be admitted that cutting forces as well as loads applied to the cutting edges are much larger for UHSS than for aluminum and mild steel and tend to open the cutting clearance. Therefore, special measures should be undertaken to prevent cutting tools from deflecting. The unusual mechanism of fracture during trimming observed for 40% cutting clearance for DP980 steel sheet 1.4mm thick is shown in Figure 6b. The overall mechanism of blank deformation before initiation of fracture (Figure 6a) was very similar to the mechanisms observed for aluminum, mild steel, DP500 and DP600 steels. However, instead of propagating vertically from the upper shearing edge to the free surface at the bottom of the blank, the crack turned near the lower surface of the deformed blank and resulted in separation mechanism, leaving the burr on the scrap side. In general, this mechanism of fracture is more favorable from a sheared edge stretchability: it removes the area of the blank which was subjected to large plastic deformation and forms a cavity at the bottom of the sheared surface. Even though the bur is broken off on the sheared edge, the failure mode of the sample during stretching is very similar to the case illustrated in Figure 5b: the crack initiates from the area at the bottom of the sheared edge where typically the burr would be. Capturing the exact mechanism of crack propagation has not been possible yet. It should be noted that the crack propagates very quickly, and capturing fracture propagation is rather difficult. Even though in many publications, hole expansion is considered to be the major sheared edge stretchability test due to its acceptance in International standard, analysis of mechanism of fracture of DP980 sheet in punching 10 mm in diameter hole has revealed a totally different mechanism of burr formation compared to trimming operation, opposite to the trends previously observed for variety of steels in and for dual phase steels by Golovashchenko and Ilinich for trimming of dual phase 7 1234567890''"". In previous studies, trimming processes showed much more tendency to form burrs due to the scrap rotation rather than punching process of small diameter hole where the slug is very stiff against bending. It should be indicated that for punching of DP980, the burrs were observed even for 5% average radial cutting clearance. Emphasizing the average clearance is important because in punching processes the tendency for non-uniform clearances is much more pronounced than for trimming. The diagram in Figure 7a illustrates the map of burr height along the perimeter of the punched hole. The height of the burnish zone was also rather non-uniform which is very likely due to rather substantial differences in actual cutting clearance even though the experimental tool was built on a die shoe with four guiding columns. During the hole expansion process using the conical die illustrated in Figure 7b, the fracture of sheared edge was rather non-uniform. There was some correlation between the location of burrs and the location of initial cracks on North and East sides of the sample illustrated in Figure 7c. It should be admitted that for such rather small clearances, the crack initiation occurred from the burr side. However, the geometric specifics of the hole expansion test might also play a certain role: the circumferential strain of the burr side of the sample during hole expansion is visibly larger than for the burnish side of the sample, since the burr side is required to be at the top based upon International Standard. The tendency to form the burrs in punching is also continued for a broad range of cutting clearances. Therefore, considering the hole expansion process as a test for trimmed edge stretchabilty may lead to rather substantial inaccuracies. Overall the major outcome of this study is an understanding that it is necessary to have a good correlation between testing and production conditions in order to make predictions regarding edge stretchability in production conditions. Conclusions The current experimental study has revealed that the mechanism of shearing and possible burr formation plays very important role for sheared edge stretchability; Cutting clearance is certainly not the only parameter which is critical for sheared edge condition; Shearing of higher strength dual phase materials may have rather different fracture behaviour, as it was illustrated for DP980. For these materials the absence of burrs does not guarantee good edge stretchability. |
#ifndef UNIT_TEST_EXEC_H
#define UNIT_TEST_EXEC_H
#include <stdio.h>
// Declares and initializes a unit test struct
#define MAKE_UNIT_TEST(var, id, name, func) struct UnitTest var = {id, name, func}
typedef int(*TestRun)(void);
struct UnitTest
{
int id;
const char* name;
TestRun test;
};
// Executes a single unit test
int UnitTest_exec_one(struct UnitTest* utest);
// Executes a unit test without requiring a UnitTest struct
int UnitTest_exec_raw(int id, const char* name, TestRun test);
/** Executes an entire suite or array of unit tests
* count: The number of tests in the suite
* Returns: how many cases passed.
*/
int UnitTest_exec_suite(struct UnitTest* suite, int count);
#endif // UNIT_TEXT_EXEC_H |
<reponame>lucaspouzac/algoliasearch-client-java-2
package com.algolia.search.recommendation;
import com.algolia.search.DefaultRecommendationClient;
import com.algolia.search.IntegrationTestExtension;
import com.algolia.search.RecommendationClient;
import com.algolia.search.integration.TestHelpers;
import java.io.IOException;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.extension.ExtendWith;
@ExtendWith({IntegrationTestExtension.class})
class RecommendationTest extends com.algolia.search.integration.recommendation.RecommendationTest {
private static RecommendationClient recommendationClient =
DefaultRecommendationClient.create(
TestHelpers.ALGOLIA_APPLICATION_ID_1, TestHelpers.ALGOLIA_ADMIN_KEY_1, "eu");
RecommendationTest() {
super(recommendationClient);
}
@AfterAll
static void close() throws IOException {
recommendationClient.close();
}
}
|
<filename>TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/MecanumTele.java
package org.firstinspires.ftc.teamcode.opmodes;
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
import com.qualcomm.robotcore.exception.RobotCoreException;
import com.qualcomm.robotcore.hardware.DcMotor;
import com.qualcomm.robotcore.hardware.Gamepad;
import org.firstinspires.ftc.teamcode.blackbox.MatchPhase;
import org.firstinspires.ftc.teamcode.Robot;
import org.firstinspires.ftc.teamcode.utils.RobotFeature;
@TeleOp(name="Mechanum Tele-op")
public class MecanumTele extends LinearOpMode {
@Override
public void runOpMode() throws InterruptedException {
try (Robot robot = new Robot(MatchPhase.TELEOP, this, new RobotFeature[] {})) {
telemetry.addData("Status", "Ready to go");
telemetry.addData("Heading offset", robot.imu.headingOffset);
telemetry.update();
waitForStart();
robot.handleMatchStart();
telemetry.addData("Status", "Running");
telemetry.update();
Gamepad lastGamepad1 = new Gamepad();
Gamepad lastGamepad2 = new Gamepad();
while (opModeIsActive()) {
double slowMode = gamepad1.left_bumper ? .5 : 1.0;
//Square values for finer slow control.
double drivePower = 0.1572 * Math.pow(6.3594, Math.abs(gamepad1.left_stick_y)) * Math.signum(gamepad1.left_stick_y);
double strafePower = -1 * 0.1572 * Math.pow(6.3594, Math.abs(gamepad1.left_stick_x)) * Math.signum(gamepad1.left_stick_x);
double turnPower = .5 * 0.1572 * Math.pow(6.3594, Math.abs(gamepad1.right_stick_x)) * Math.signum(gamepad1.right_stick_x);
//Controller doesn't report center as exactly 0.
//This is NOT stall correction, see robot.setClippedMotorPower
double deadZone = 0.13; // (Probably wrong value)
//Complete Directional Mecanum Driving
if (Math.abs(gamepad1.left_stick_y) > deadZone || Math.abs(gamepad1.left_stick_x) > deadZone || Math.abs(gamepad1.right_stick_x) > deadZone) {
//Sets up variables
double robotAngle = Math.atan2(drivePower, strafePower) - Math.PI / 4;
telemetry.addData("Input drive angle", Math.toDegrees(robotAngle));
double biggerStick = Math.max(Math.abs(turnPower), Math.max(Math.abs(strafePower), Math.abs(drivePower)));
double biggerDrive = Math.max(Math.abs(strafePower), Math.abs(drivePower));
double biggerValue = Math.max(Math.abs(Math.cos(robotAngle)), Math.abs(Math.sin(robotAngle)));
double stickMax = biggerDrive + Math.abs(turnPower);
// Calculates motor powers
double FL = biggerStick * ((Math.cos(robotAngle) / biggerValue * (biggerDrive / stickMax)) + (turnPower / stickMax));
double FR = biggerStick * ((Math.sin(robotAngle) / biggerValue * (biggerDrive / stickMax)) - (turnPower / stickMax));
double BL = biggerStick * ((Math.sin(robotAngle) / biggerValue * (biggerDrive / stickMax)) + (turnPower / stickMax));
double BR = biggerStick * ((Math.cos(robotAngle) / biggerValue * (biggerDrive / stickMax)) - (turnPower / stickMax));
//Powers Motors
robot.driveMotorsClipped(FL * slowMode, FR * slowMode, BL * slowMode, BR * slowMode);
} else {
robot.driveMotors(0, 0, 0, 0);
}
robot.setDriveMotorZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);
telemetry.addData("Zero power", robot.driveMotorZeroPowerBehavior.toString());
telemetry.addData("Heading offset", robot.imu.headingOffset);
telemetry.addData("Heading", robot.getHeading());
telemetry.update();
try {
lastGamepad1.copy(gamepad1);
lastGamepad2.copy(gamepad2);
} catch (RobotCoreException e) {
e.printStackTrace();
}
}
}
}
} |
Decrease in 111Cd Knight Shift in Superconducting Cd2Re2O7: Evidence for Spin-Singlet Pairing 111 Cd NMR measurements have been performed in the superconducting (SC) state of the pyrochlore Cd 2 Re 2 O 7 at T c ∼1 K, and in a field of less than 3 kOe below T c. The upper critical field at 0.1 K has been determined to be 4 kOe from in situ measurements of the ac susceptibility. A reduction of the Knight shift in the SC state is confirmed. The present results provide strong evidence that this compound has a singlet SC pairing symmetry. |
# coding:utf-8
'''
Created on 2014-4-9
@author: tong
'''
|
Invariant Buda-Lund Particle Interferometry The invariant Buda-Lund parameterization of the two-particle Bose-Einstein correlation functions is presented, its derivation is summarized. In its particular multi-variate Gaussian limiting case, the invariant Buda - Lund parameterization is compared to the Bertsch-Pratt and Yano-Koonin-Podgoretskii parameterizations, advantages and shortcomings are discussed. The invariant Buda-Lund parameterizations are given also for non-Gaussian multi-variate distributions, including damped oscillations in the like-particle correlation function, that are similar to the oscillating intensity correlations of binary stars in stellar interferometry. A separation between the pion and the proton source is also estimated in the Buda - Lund hydro framework, the result is utilized to extract the mean proper time of particle emission with the help of fits to E877 data on non-identical particle correlations by Miskowiec. Introduction Presently there is an increasing interest both in high energy heavy ion and in high energy particle physics to describe in greater details the space-time picture of particle emission with the help of particle interferometry: the space-time geometry of the freeze-out hypersurface carries information on the existence of a transient Quark-Gluon Plasma phase to be created in heavy ion collisions. Overlapping regions of (qq) + (qq) jets from a decaying W +, W − pair at LEP-II may result in unwanted systematic errors in precision determination of W mass in particle physics, and the magnitude of this effect can be estimated with precision only if the space-time picture of these reactions is reconstructed and the magnitude of Bose-Einstein correlations between pions from different W -s is calculated correspondingly. An invariant formulation of Bose-Einstein correlation functions was found by the Budapest-Lund collaboration in refs. 1,2. This parameterization is referred as the Buda-Lund parameterization of the correlation function, or BL in short. Although the BL results are rather generic, they contain in particular limiting cases the power-law, the exponential, the double-Gaussian, the Gaus-sian or other parameterizations. The BL parameterization of the correlation function yields not only a boost-invariant description, but also a rather simple functional form. We consider high energy heavy ion reactions or single jets in high energy particle physics coming from a fragmentation of an energetic leading quark. In these physical situations, a dominant direction of expansion of the particle source is identified. We denote space-time coordinates by x = (t, r) = (t, r x, r y, r z ) and momentum variables as k = (E, k) = (E, k x, k y, k z ). We choose the direction labelled with subscript z to coincide with the dominant direction of the expansion. The single-particle spectra and the two-particle correlations are determined in the Wigner-function formalism. As this formalism is fairly well-known now, we move the summary of the derivation to section 3, and jump to the results immediately, as given in the next section. We then compare the BL form of the correlation function to the Bertsch -Pratt (BP) and the Yano-Koonin -Podgoretskii (YKP) 3-dimensional parameterizations in a particular, Gaussian limiting case of the BL correlation function, as the BP and the YKP parameterizations are defined at the moment only for Gaussian correlation functions, as far as we know. We also consider effective separation of sources in the BL hydro model, also described in ref. 1. The effective separation of like-particle sources is shown to result in small, damped oscillations in the invariant longitudinal component of the two-pion intensity correlation function. The effective separation of unlike-particle sources in the BL hydro parameterization is larger. Such a separation was recently determined experimentally by D. Miskowiec et al in the analysis of E877 data on Au + Au collisions at BNL AGS, based on their estimated L = 10 fm/c separation scale and the BL hydro picture we estimate the mean freeze-out time in Au + Au collisions. The Buda-Lund parameterization for Bose-Einstein correlations The two-particle correlation function is defined as a ratio of the two-particle invariant momentum distribution to the product of the single-particle invariant momentum distributions. Hence the correlation function is invariant by definition, see ref. 3 for an exploration of its properties based on its Lorentz invariance. We assume, that with the help of certain experimental methods all non-Bose-Einstein related correlations can be removed from this function, and we focus on the Bose-Einstein correlations only, as these correlations carry information about the space-time distribution of particle emission. The mean and the relative four-momentum are introduced as In the following, the relative momentum four-vector shall be denoted also as ∆k = Q = (Q 0, Q x, Q y, Q z ) = (Q 0, Q), and in general a shall denote the vector part of a four-vector a = (a 0, a). A simple invariant formulation of Bose-Einstein correlation functions was given for cylindrically symmetric, longitudinally expanding particle sources in refs. 1,2. Such sources may be characterized not only with longitudinal but also by transversal and temporal inhomogeneities. In a Gaussian approximation, the Buda-Lund form of the Bose-Einstein correlation function reads as follows: where the fit parameter measures a strength of the correlation function. The fit parameter R = reads as R-timelike, and this variable measures a width of the proper-time distribution. The fit parameter R reads as R-parallel, it measures an invariant length parallel to the direction of the expansion. The fit parameter R ⊥ reads as R-perpedicular or R-perp. For cylindrically symmetric sources, R ⊥ measures a transversal rms radius of the particle emitting source. The invariant time-like, longitudinal and transverse relative momenta are defined with the help of another, to this point suppressed fit parameter,, which characterizes the direction of the center of particle emission, x = (t, r z ) in the (t, r z ) longitudinal coordinate space. Such a direction can be characterized by a normalized four -vector n(x) = x/, where n n = +1, and = t 2 − r 2 z is the mean longitudinal proper-time of particle emission. The such a directionpointing normal vector n can be parameterized as n = (cosh, 0, 0, sinh), where = 0.5 log (t + r z )/(t − r z ) is the space-time rapidity of the center of particle emission, see Fig. 1. Space-time rapidity is a space-time coordinate, that transforms additively in case of longitudinal Lorentz-boosts, similary to the the rapidity variable in momentum space. A boost -invariant decomposition of the relative momenta can be defined, as follows. The invariant time-like, parallel and perp relative momentum components read as In the above, ab = a b = a 0 b 0 −ab = a 0 b 0 −a x b x −a y b y −a z b z stands for the inner product of four-vectors. As n n = +1, this direction is time-like, hence Q n = Q = is an invariant time-like component of the relative momentum. Q is an invariant relative momentum component in the longitudinal direction (parallel to the beam or to the thrust axis), and Q ⊥ is the remaining perp or transverse component of the relative momentum, also invariant for longitudinal boosts. In short, we have the following 5 free parameters for cylindrically symmetric, longitudinally expanding sources:, R =, R, R ⊥ and. In principle, each of these parameters may depend on the mean momentum K. At any fixed value of the mean momentum K, the 5 free parameters of the invariant Buda-Lund correlation function can be fitted to data; alternalively they can be theoretically evaluated from an assumed shape of the emission function S(x, k), for example see ref 1. In the Buda-Lund parameterization, the explicit mean momentum dependence of the parameters can be written as follows: Note that the mean momentum dependence of the relative momentum components Q = (K) = Q = (n(K)) and Q (K) = Q (n(K)) is induced by the mean momentum dependence of the direction pointing normal vector n(K), similarly to the dependence of the side and the out components of the relative momentum on the direction of the mean momentum in the Bertsch -Pratt parameterization. Physically, R =, R and R ⊥ are longitudinally boost-invariant lengths of homogeneity 4 in the time-like, the longitudinal and the transverse directions. Hence, R (K) is in general less than the total longitudinal extension of the source. Similar statements hold for the other, invariant lengths of homogeneity in the transverse and in the temporal directions, R ⊥ (K) and R = (K). Symbolic notation for the side and out components Up to this point, we assumed a cylindrically symmetric source, where the spatial information about the source distribution in (r x, r y ) was combined to a single perp radius parameter R ⊥. In order to distinquish easily the zero-th component of the relative momentum Q 0 from the out component of the relative momentum Q o = Q out, Q 0 = Q o, we introduce the following symbolic notation in transverse directions: The idea behind this notation is similar to that of symbolizing the perp direction by index "⊥", standing for a direction that is transverse to the longitudinal direction. The longitudinal components of the relative momenta are symbolized by index " ", i.e. two vertical parallel lines, imagining that the z axis is in the plane of the paper, pointing upwards, and the considered component is parallel to that direction. The invariant time-like components are indexed by " = ", not to be confused by the equality sign =. This symbol " = " is obtained by a 90 o rotation of the symbol " ". The remaining two orthogonal directions are the "side" and the "out", we symbolize them by parallel lines as well. But the two possible orientations of parallel lines in the plane are used up by the symbols = and, hence these two lines are thought to be orthogonal to the plane of the paper, thus they are symbolized by two dots. The side component is described by putting the dots side-by-side, which yields index ".. ". The remaining out direction is orthogonal to all the above directions, we rotate side by 90 o to obtain the symbol " : ". This symbolic notation stands for the longitudinally boost-invariant decomposition of the relative momenta. Similarly, the side and the out radii can be denoted as Cross-terms, if any, can be denoted by straightforward mixing of the symbols, e.g. a possible side-out cross-term may be denoted by ". :", an out-long crossterm by ": |" and a side-long cross-term by "..|" etc. In a general Gaussian form, suitable for studying opacity effects, the Buda-Lund invariant BECF can be denoted as Note, that this equation is identical to eq. of ref. 1, rewritten into the new, symbolic notation of the Lorentz-invariant directional decomposition. The above equation may be relevant for a study of expanding shells as well as opacity effects as recently suggested by H. Heiselberg 9. The lack of transparency in the source may result in an effective source function, that looks like a crescent in the side-out reference frame 9. The overall cylindrical symmetry of particle production is maintained for simultaneous rotations in the x and the k space, but the emission function S(x, K) at a given fixed direction of the mean transverse momentum K ⊥ = (0, K x, K y, 0) has different width in the out direction and another, possibly larger width in the side direction 1. General derivation of Buda-Lund shape -not only for Gaussians First we define the correlation function with the help of the Wigner-function formalism, then we introduce the intercept parameter * in the core-halo picture. Then we evaluate the correlation function in terms of longitudinally boost-invariant variables and we end up with a general Buda-Lund form of the correlation function. Wigner Function Formalism The two-particle inclusive correlation function is defined and approximately expressed in the Wigner function formalism as In the above line, the Wigner-function formalism 10,11,12 is utilized assuming fully chaotic (thermalized) particle emission. The covariant Wigner-transform of the source density matrix, S(x, k) is a quantum-mechanical analogue of the classical probability that a boson is produced at a given x = (t, r) = (t, r x, r y, r z ) with k = (E, k) = (E, k x, k y, k z ). The auxiliary quantit appears in the definition of the BECF, with ∆k = k 1 −k 2 and K = (k 1 + k 2 )/2. The single-and two-particle inclusive momentum distributions (IMD-s) are defined in terms of the cross-section, they can be evaluated as where t is the total inelastic cross-section. Note that in this work we utilize the absolute normalization of the emission function: It has been shown recently in refs. 13,16,15,17 that for explicitely symmetrized n-particle system of bosons with variable number of bosons, the two-particle Bose-Einstein correlation function is properly defined by eq.. Effects from Large Halo of Long-Lived Resonances If the bosons originate from a core which is surrounded by a halo of long-lived resonances, the IMD and the BECF can be calculated in a straightforward manner. The detailed description is given in refs. 18,19, here we recapitulate only the basic idea along the lines of ref. 18. If the emission function can be approximately divided into two parts, representing the core and the halo, and if the halo is characterized by large lengthscales so thatS h (Q min ; K) <<S c (Q min ; K) at a finite experimental resolution of Q min ≥ 10 MeV, then where N 1,i (k) stands for the IMD of the halo or core for i = h, c and The phenomenological * parameter has been introduced to the literature by Deutschmann long time ago 20. In the core/halo picture, this effective intercept parameter (k) can be interpreted as the momentum dependent square of the ratio of the IMD of the core to the IMD of all particles emitted, assuming completely incoherent emission from the source. The validity of the core/halo picture to any given reaction is not guaranteed, hence systematic checks of the applicability of this simplifying picture has to be performed, similarly to the ones done in ref. 22. Invariant, generic decomposition of the Bose-Einstein correlation function to a Buda -Lund form For systems expanding relativistically in one direction (r z ), it is advantageous to introduce the longitudinally boost invariant variable and the space-time rapidity that transforms additively under longitudinal boosts, Similarly, in momentum space one introduces the transverse mass m t and the rapidity y as _ __ t z Fig. 1. Space-time picture particle emission for a given fixed mean momentum of the pair. The mean value of the proper-time and the space-time rapidity distributions is denoted by and. As the rapidity of the produced particles changes from the target rapidity to the projectile rapidity the ( (y), (y) variables scan the surface of mean particle production in the (t, r z ) plane. In order to obtain (at least approximately) a boost-invariant picture, we characterize the source of particles in the boost invariant variables, m t and − y. For systems that are only approximately boost-invariant, the emission function may also depend on the deviation from mid-rapidity y 0. The scale on which the approximate boost-invariance breaks down is denoted by ∆, a parameter is related to the width of the rapidity distribution. A simple generalization to non-Gaussian correlators in the Buda-Lund picture is obtained if we assume that the emission function factorizes as a product of an effective proper-time distribution, a space-time rapidity distribution and a transverse coordinate distribution 14,1 as In the above, subscript * stands for a dependence on the mean momentum, the mid-rapidity and the scale of violation boost-invariance (K, y 0, ∆). The function H * ( ) stands for an effective proper-time distribution (that includes an extra factor from the Jacobian d 4 x = d d, dr x dr y, in order to simplify the results). The effective (K dependent) space-time rapidity distribution is denoted by G * (), while the effective transverse distribution is denoted by I * (r x, r y ). In the above equation, the mean proper-time is factored out to keep the dimensionless nature of the distribution functions. Such a pattern of particle production is visualized on Fig. 1. In case of hydrodynamical models, as well as in case of a decaying Lund strings 14,2, production of particles with a given momentum rapidity y is limited to a narrow region in space-time around and. If the sizes of such an effective source are sufficiently small (or with other words if the Bose-Einstein correlation function is sufficiently broad), the plane-waves that induce the Fouriertransformation in the correlation function can be decomposed in the shaded region on Fig. 1 as follows: With the help of this small source size (or large relative momentum) expansion, the two-particle Bose-Einstein correlation function can be written into the following Buda-Lund form: This is the factorized Buda-Lund invariant decomposition of the BE correlation function; the resulting Fourier-transformed proper-time, space-time rapidity and transversal coordinate distributions can be of power-law, exponential, Gaussian or other types, corresponding to the underlying space-time structure of the particle emitting source: What are the fit parameters in eq. ? It is clear that apart from the shape parameters of the proper-time, space-time rapidity and the transverse distribution of the production points two additional space-time parameters enter the fit: the mean proper-time of the particle production, in eq. and the angular direction that enters the definition of Q = and Q in eqs.,6). In turn, the parameters (, ) are measurable from the detailed analysis of the multidimensional Bose-Einstein correlation functions for any value of the rapidity and m t of the particle pair. The total longitudinal region corresponds to the region in (t, r z ) where particles of arbitrary momenta are emitted from. This region can be reconstructed in the Buda-Lund formalism, by determining (, ) and the widths of H * ( ) and G * () at various fixed values of the momentum of the particles, reproducing the shaded region of Fig. 1 for each fixed value of the mean momentum of the pair. Such shaded regions are the same as local maps in cartography. If the momentum distribution of the produced particles is integrated over, the overlapping shaded regions are combined to a global picture of particle emission in space-time, similarly the way how local maps can be combined to an atlas in cartography by gradually displacing the centers of the local maps but keeping an overlap region between the neighbouring local pictures. Space-time picture of particle emission as reconstructed from a combined analysis 5,6,1 of particle correlations and spectra in h + p reactions at CERN SPS in (t, r z ) plane. The momentum of the emitted particles is integrated over, from ref. 30. This programme has been carried out first by the NA22 collaboration in a Gaussian approximation, keeping the means and the variances only of the proper-time distribution, the space-time rapidity distribution and the transverse distribution coordinates of particle production. A locally thermalized, longitudinally expanding medium ( possibly corresponding to the vacuum filled by the sea of virtual quarks, anti-quarks and gluons) was found to be in a good agreement with the NA22 particle spectra and correlations, despite the fact that the mean multiplicity of the produced charged particles is only n = 8. See R. Hakobyan's contribution to this conference proceedings for the reconstructed space-time picture as well as for greater details. A similar reconstruction of the longitudinal space-time structure of particle production in 200 AGeV S + P b reactions is reported in the contribution of Ster to this volume. For even further general possibilities about the structure of particle emission, see refs. 1,14,2. Earlier, Gaussian parameterizations of BE Correlations We briefly summarize here the Bersch-Pratt and the Yano-Koonin parameterization of the Bose -Einstein correlation functions, to point out some of their advantages as well as draw-backs and to form a basis for comparision. The Bertsch-Pratt parameterization The Bertsch-Pratt (BP) parameterization of Bose-Einstein correlation functions is one of the oldest, widely used parameterization called also as side-outlongitudinal decomposition 23,24 of the correlation function. This directional decomposition was originally devised for extracting the contribution of the long duration of particles from a decaying Quark-Gluon Plasma, as happens in the mixture of a hadronic and a QGP phase if the rehadronization phase transition is a strong first order transition. The BP parameterization in a compact form reads as Here index o stands for out (and not the temporal direction), s for side and l for longitudinal. In a more detailed form, the mean momentum dependence of the various components are explicitly shown: where the mean and the relative momenta are defined as It is emphasized that the BP radius parameters are measuring lengths of homogeneity, and in general characterize that region of space-time that emits particles with a given mean momentum K. Not only the radius parameters but also the decomposition of the relative momentum to the side and the out components depends on the mean momentum K. In arbitrary frame, Gaussian radius parameters can be defined, and sometimes they are also referred to BP radii, when the spatial components of the relative momentum vector are taken as independent variables. It should be emphasized, that the BP radii that contain a well-defined mixture of the longitudinal, temporal and transverse invariant radii. However, the BP radius parameters themselves are not invariant, they depend on the frame where they are evaluated 1, reflecting space-time variances 7,8 of the core 22 of the particle emission. where S c (x, k) is the emission function that characterizes the central core. Note, that the tails of the emission function are dominated by the halo of long-lived resonancess S h (x, k) and even a small admixture of e.g. and mesons increases drastically the space-time variances of particle production, and makes the interpretation of the BP radii in terms of the total emission function S = S c + S h unreliable, as pointed out in ref. 22. It was shown already in ref. 14 that the duration of the particle emission contributes predominantly to the out direction, if the Longitudinal Center of Mass System (LCMS, ref. 14 ) is selected for the determination of the radius parameters. In LCMS, the mean momentum of the pair has no longitudinal component. In this frame, the BP radii have a particularly simple form, if the coupling between the r x and the t coordinates is also negligible, r xt = r x t : wherex = x − x. From the above, the advantage of the LCMS frame is clear: In this LCMS frame, information on the temporal scale couples only to the out direction and it enters both the out radius component and the out-long cross-term. Note that for cylindrically symmetric sources other possible crossterms, e.g. the side-out or the side-long cross terms were shown to vanish in a Gaussian approximation, due to symmetry reasons 7,8. An advantage of the BP parameterization is that there are no kinematic constraints between the side, out and long components of the relative momenta, hence the BP radii are not too difficult to determine experimentally. The Yano-Koonin-Podgoretskii parameterization A covariant parameterization has been worked out for non-expanding sources by Yano, Koonin and Podgoretskii (YKP) 25,26. This parameterization was recently applied to expanding sources by the Regensburg group 27,28, by allowing the YKP radius and velocity parameters be momentum dependent. This parameterization reads as (Note that in YKP index 0 refers to the time-like components). When the momentum dependence of the YKP radii is explicitly shown, this reads as where the fit parameter U (K) is interpreted 27,28 as a four-velocity of a fluidelement 32. This YKP parameterization is introduced to create a diagonal Gaussian expression in the "rest frame of the fluid-element". This form has an advantage as compared to the BP parameterization, namely that the three extracted YKP radius parameters, R ⊥, R and R 0 are invariant, independent of the frame where the analysis is performed, while U transforms as a four-vector. The practical price one has to pay for this advantage is that the kinematic region in the Q 0, Q l, Q ⊥ space, where the parameters can be fitted may become rather small. This follows from the unequalities Q 2 inv ≥ 0 and Q 2 0 ≥ 0, which yields and the narrowing of the regions in Q 2 0 − Q 2 z with decreasing Q ⊥ makes the experimental determination of the YKP parameters difficult, especially when the analysis is performed far away from the LCMS rapidities . Hence in practice the YKP parameters can be well determined in the LCMS frame, where the longitudinal component of the U is generally small. But in the LCMS, the interpretation of the BP radii is also simple, similarly to that of the YKP radii. Theoretical problems with the YKP parameterization are explained below. a) The YKP radii contain components proportional to 1 t, that lead to divergent terms for particles with very low p t 27,28. b) The YKP radii are not even defined for all Gaussian sources 27,28. Especially, for opaque sources or for expaning shells with r 2 x < r 2 y the algebraic relations defining the YKP "velocity" parameter become ill-defined and result in imaginary values of the YKP "velocity", 27,28. c) The YKP "velocity" is defined in terms of space-time variances at fixed mean momentum of the particle pairs 27,28. Thus, for expanding systems, the proper interpretation of the parameter U is not a flow velocity of a source element, as thought before, but a combination of spacetime variances of the source at a fixed mean momentum K. (Note, however, that for static, non-expanding sources the interpretation of U as the velocity of a Gaussian source can be preserved corresponding to refs. 25,26 ). In kinetic theory that provides the basis for hydrodynamics, the flow velocity can be locally defined as a weighted average of particle momenta, all particles being in the same cell in coordinate space. The local flow velocity u (x) hence becomes a function of the position x but the momentum of the particles was averaged out, hence u (x) is formally independent of the momentum. The four-current is defined 29 as an average over the local momentum distribution where f (x, k) stands for the phase-space distribution function. The local flow velocity can be defined with this current as the unit vector proportional to the current: On the other hand, the YKP parameter U corresponds to a weighted average of particle coordinates, all particles being characterized with the momentum K. Hence in general U (K) = u(x). The local velocity of particles at a fixed momentum is independent of the density distribution of particle production in coordinate-space. In fact, the only four-velocity that can be uniquely assigned to a set of particles each with momentum K is simply u K = (E K /m, K/m), where m stands for the mass of the particles. Hence the YKP parameter U (K) should not be interpreted as a mean flow velocity of a fluid element that emits particles with momentum K, at least not in the well-defined sense of kinetic theory. Comments on the hydro model parameterization The Buda-Lund hydro parameterization is recapitulated in the contributions of Ster and Hakobyan 31,30. The main idea behind the Buda-Lund parameterization is to characterize the hydro fields (temperature profile, transversal flow, density distribution) with their means and variances only. Similar models are studied by the Regensburg 7,8,28 as well as the Kiev groups 33. Note that n (K) normal-vector rests in the (t, r z ) plane for the Buda-Lund parameterization. On the other hand, the U (K) YKP velocity was thought to be some sort of flow velocity, that characterizes some local momentum distribution. Hence, n and U (K) are defined in different spaces: in the coordinate space and in the momentum space, respectively. In case of the Buda-Lund form, the coordinate-space interpretation of n is needed to obtain the expansion of the plane-wave exp(i∆k ∆x) in eq., which is essential in expressing the correlation function in terms of Fourier-transformed propertime distributions and space-time rapidity distributions in eq.. If the space-time interpretation of the Buda-Lund direction n(K) is lost, it becomes impossible to reconstruct the space-time picture of particle emission for systems with strong longitudinal expansion. That could be the reason why such a reconstruction was not yet achieved by the NA49 experiment, that applied the YKP parameterization. However, the space-time picture of longitudinally expanding particle emitting sources was reconstructed from the detailed fitting to NA22 and NA44 particle correlations and spectra with the help of the Buda-Lund parameterization, properly preserving the interpetation of of n(K) as a spatial direction. See Fig. 2, and the contributions of Hakobyan, Ster and Seyboth to this conference proceedings 30,31,32. Separation of particle sources in Buda-Lund type hydro models We discuss some results relating the separation of effective sources for identical and non-identical particles, even if both kind of particles appear from the same system that is assumed to be in local thermal equilibrium. Separation of effective sources for non-identical particles Recently, Lednicky and collaborators suggested to study non-identical particlecorrelations, to learn which particles are emitted earlier and which particles were emitted later 34. The analysis of E877 data resulted in an effective separation of pion and proton sources at forward rapidities at the AGS 35. Such separation of pion and proton source in space-time occurs as a natural result in the Buda-Lund hydro models and its various re-incarnations and improved modifications, because heavier particles are more frozen to the flow than the lighter ones. In the Buda-Lund parameterization, we have a K dependent normalvector, pointing towards the center of the particle production. In the LCMS, ref 14, we find n = n(x(K)) = (cosh, 0, 0, sinh) where T 0 is the central freeze-out temperature at the mean freeze-out time, and ∆ characterizes the finite longitudinal size of the expanding hydro source in space-time rapidities. For non-identical particle correlations 34, e.g. and p, the velocities of the particles must be similar. If v = v p, then we have m t << m p t. For pions and protons with the same velocity, using m = 140 MeV, m p = 1 GeV, T = 140 MeV and ∆ 2 = 2 the Buda-Lund model yields: where y 0 is the mid-rapidity, y is the rapidity of the pion and the proton, and 3 is the numerically estimated coefficient. The spatial separation between protons and pions is about L ≃ 10 fm/c at y − y 0 ≃ 2 35. This can be used to estimate the mean freeze-out proper-time of particle production as s = L/( p s − s ) ≃ 15 fm/c. 5.2 Example for a non-Gaussian Buda-Lund correlation function: separation of the effective source for identical pions In the Buda-Lund type hydro models, the emission function S(x, k) is written as a product of the local phase-space density f (x, k) and a Cooper-Frye pre-factor d 4 (x)k that yields the flux of particles through the freeze-out hypersurface, or through a distribution of freeze-out hypersurfaces 1 : where g stands for the degeneracy factor, and s = −1, 0, +1 for Bose, Boltzmann or Fermi statistics, and an approximate boost-invariant shape of the freeze-out hypersurface distribution is assumed. Using the exponential form of the cosh factor, the effective emission function S * (x, k) = S(x, k) can be written as a sum of two components: These effective emission function components are subject to Fourier -transformation in the Buda-Lund approach. In an improved saddle-point approximation, the two components S + (x, k) and S − (x, k) can be Fourier -transformed independently, finding the separate maxima (saddle point) x + and x − of S + (x, k) and S − (x, k), and repeating the saddle-point calculation for the two components separately. As a result, one gains the following non -Gaussian correlation function from the Buda-Lund hydro model specified in ref. 1 C(Q =, Q, Q.., Q : ) = 1 + * (Q ) exp(−Q 2 R 2 − Q 2 = R 2 = − Q 2 ⊥ R 2 ⊥ ), (Q ) = , This result goes beyond the single Gaussian version of the saddle-point calculations of ref. 7,8. This results goes also beyond the results obtainable in the YKP or the BP parameterizations. In principle, the improved saddle-point calculation gives more accurate analytic results than the numerical evaluation of space-time variances, as it keeps more information on the shape of the correlation function. Although the above result is non-Gaussian, because the factor (Q ) results in oscillations of the correlator, the result is still explicitely boostinvariant. Note that the oscillations are typically small and the Gaussian remains a good approximation to eq., but with modified radius parameters. The oscillations are due to a possible separation of the pion source to two components, due to an identical splitting of the Cooper-Frye pre-factor or the flux term in the emission function. We obtain two separate effective sources that create oscillations in the intensity correlation function, similarly to the oscillations in the intensity correlations of photons from binary stars in stellar astronomy. However, these oscillations in high energy physics are much smaller, as the effective separation between the particle sources for identical pions, + − − smaller, than ∆, the width of the G * + ( + ) and the G * − ( − ) distributions. In stellar astronomy, the separation between the binary stars is much larger than the diameter of the stars, hence the intensity oscillations in the two-photon correlation function are stronger then in the Buda-Lund type hydro models. Highlights: The invariant Buda-Lund notation is introduced to describe Bose-Einstein correlation functions. This invariant notation scheme yields simple expressions not only for Gaussian but also for non-Gaussian expanding sources as well. It seems that the Buda-Lund form is the simplest and the most compact characterization of the two-particle Bose-Einstein correlation functions for relativistic, expaning systems. With the help of the Buda-Lund formulation, and a combined analysis of particle correlations and spectra 1, the space-time picture of the particle production in the longitudinal (t, r z ) plane can be reconstructed. Examples for such a reconstruction are shown in refs. 31,30. We pointed out how to estimate the mean freeze-out time using nonidentical particle correlations data, the Buda-Lund hydro model and the natural separation of forward moving protons and pions in Buda-Lund type hydro models. Finally we have shown how Buda-Lund type hydro models can be rewritten to an effective, two-components sources, by splitting the flux terms. We found small damped oscillations in the intensity correlation function, reminiscent to the intensity correlations of photons from binary stars. |
package uk.gov.hmcts.reform.cmc.submit.converter;
import org.springframework.stereotype.Component;
import uk.gov.hmcts.reform.cmc.submit.ccd.domain.CcdCase;
import uk.gov.hmcts.reform.cmc.submit.domain.models.payment.AccountPayment;
import uk.gov.hmcts.reform.cmc.submit.domain.models.payment.Payment;
import uk.gov.hmcts.reform.cmc.submit.domain.models.payment.ReferencePayment;
import java.math.BigDecimal;
import static org.apache.commons.lang3.StringUtils.isBlank;
@Component
class PaymentConverter {
public Payment from(CcdCase ccdCase) {
Payment payment;
if (isBlank(ccdCase.getFeeAccountNumber())) {
payment = referencePayment(ccdCase);
} else {
payment = accountPayment(ccdCase);
}
return payment;
}
private AccountPayment accountPayment(CcdCase ccdCase) {
AccountPayment payment = new AccountPayment();
payment.setFeeAccountNumber(ccdCase.getFeeAccountNumber());
return payment;
}
private ReferencePayment referencePayment(CcdCase ccdCase) {
ReferencePayment payment = new ReferencePayment();
payment.setId(ccdCase.getPaymentId());
payment.setAmount(new BigDecimal(ccdCase.getPaymentAmount(), 2));
payment.setReference(ccdCase.getPaymentReference());
payment.setDateCreated(ccdCase.getPaymentDateCreated());
payment.setStatus(ccdCase.getPaymentStatus());
return payment;
}
}
|
The world was taken by storm yesterday by the news of the tragic death of 25-year-old English journalist, television presenter and model Peaches Honeyblossom Geldof. Second daughter of Bob Geldof and Paula Yates and the granddaughter of Hughie Green. Geldof was found dead at her home in Wrotham, Kent, England.
Geldof’s death is called “sudden and unexplained” and is currently under “investigation”. But authorities have already stated that there was no evidence of foul play, which should be the first reason to be suspicious.
So the first place I look is VigilantCitizen. Gotta give these guys props for always being on top of these situations. They said this:
“There is however one important element that needs to be considered while investigating her fate : She died about a year after announcing the her fans her initiation into the occult secret society Ordo Templi Orientis (O.T.O). On March 11th 2013, Peaches tweeted:”
“#93 #Thelema #o.t.o for all my fellow Thelemites on instagram!”
“Thelema is the name of the philosophy taught in the O.T.O. It was written by occultist Aleister Crowley.”
The O.T.O is a secret society based on Aleister Crowley’s Thelema which employs the concept of sex magick to attain spiritual illumination.
Crowley claimed that in 1904 in Cairo he was contacted by a supernatural entity named Aiwass, who was the messenger of Horus, who provided him with The Book of the Law, a religious text that served as the basis for Thelema. The book proclaimed that humanity was entering a new Age–an age that would be ruled by the motto “Do what thy will”.
In 1920 Crowley moved to Sicily, to run a commune known as the Abbey of Thelema. The O.T.O emphasized sex magic to invoke God’s and god-like power.
Being admitted to each degree of O.T.O. involves an initiation and the swearing of an oath. So did Peaches swear an oath?
The O.T.O is also allegedly the true heir of the Knight Templars and the Bavarian Illuminati.
Interesting in light of the fact that father, Bob Geldof was granted an honorary knighthood by Queen Elizabeth II.
Peaches was also involved in Scientology and Judaism, the religion of her husband Thomas Cohen. Here is a video of her talking about her belief in Scientology.
Do you ever notice how many of these very powerful and well connected people lose children or family members tragically?
Family Statements
Here are the statements regarding Peaches death thus far:
The initial Kent Police statement reads:
“At this stage, the death is being treated as unexplained and sudden.”
Bob Geldof said in a statement:
“We are beyond pain. She was the wildest, funniest, cleverest, wittiest and the most bonkers of all of us. We loved her and will cherish her forever.”
Her husband Thomas Cohen said in a statement:
“My beloved wife Peaches was adored by myself and her two sons Astala and Phaedra and I shall bring them up with their mother in their hearts every day.”
Who is Bob Geldof?
We also need to know who her father was.
Her father is Bob Geldof, lead singer of the Irish rock band the Boomtown Rats in the late 1970s and early 1980s. The band had hits like “Rat Trap” and “I Don’t Like Mondays”. He co-wrote “Do They Know It’s Christmas?”, and starred in Pink Floyd’s 1982 film Pink Floyd – The Wall as “Pink”.
Bob Geldof’s work for Luciferian Global Non-profits
Geldof is ALSO widely recognised for his activism although it seems that all these rock stars end up activists. Why?
Perhaps because all these big global do-gooder non-profits are Luciferian posing as social justice which is why they are all connected to the Lucis Trust.
Bob was connected to a lot of these groups mentioned on the Lucis Trust website including Bill Gates. BTW (Lucis as in Luciferian):
“Through the philanthropic and humanitarian work of such people as George Soros, Bill Gates, Kofi Annan and Bono, to name just a few, people are beginning to recognize the needs of the world’s destitute people and acting to do something about them. There is talk by Soros and another thinker, James Tobin, about the creation of some type of tax upon financial transactions that would be used to support domestic programs in the developing world. Humanity surely has the ability to institute these and similar changes; it just needs the will to do so.”
Bob Geldof founded the charity supergroup Band Aid in 1984 to raise money for famine relief in Ethiopia. He also organized Live Aid in 1985 and the Live 8 concerts in 2005.
Geldof currently serves as an adviser to the ONE Campaign, founded by U2 front-man Bono–ding, ding, ding.
The ONE Campaign was founded by a coalition of 11 non-profit organizations, including DATA, World Vision, Oxfam America, and Bread for the World, with funding from the Bill & Melinda Gates Foundation. In 2007, ONE announced that it would be merging with DATA.
DATA stands for Debt, AIDS, Trade, Africa.
Ok, sounds good, right? How could all of this global philanthropy be ”Luciferian”? Well, who benefits from global debt relief and who loses? See this humanitarian effort to ‘forgive’ ALL debt is not all it appears to be. If all debt is forgiven what is money in the bank worth? See you can not forgive debt without erasing credit.
Peaches Geldof occult tattoos
I know its confusing but what does this mean? It means the goal of these would-be-global dictators posing as ‘do-gooders’ like Bill and Melinda Gates is to erase all debt (sounds great right?) IN ORDER to ERASE ALL credit. Because what happens if all credit disappears? Everyone’s life savings aka their entitlement to labor is gone. In other words we all become slaves to whomever grabbed the RESOURCES. And a global tax on financial transactions would hurt everyone with a 401k!
Ok, sorry to digress. What does this have to do with Peaches Geldoff. Well she was on the team of this cabal (perhaps unknowingly) and she likely had to be offered as a blood sacrifice.
The price for the success and the fame is that you will be a servant to this evil cabal that seeks global domination and seeks to eliminate free will.
The blood sacrifice is key.
Crowley’s texts also suggest the importance of human ritual sacrifice to attain power. In fact the blood sacrifice has been considered the most important part of Magick. The blood is the life.
Peaches Geldof’s mother’s death
Geldof also lost her mother (loved ones have to be sacrificed for success) in 2000 from a heroin overdose. Peaches explained how difficult the process of coming to terms with her mother’s death was in a 2013 interview with Elle:
“I remember the day my mother died, and it’s still hard to talk about it. I just blocked it out. I went to school the next day because my father’s mentality was ‘keep calm and carry on’. So we all went to school and tried to act as if nothing had happened. But it had happened. I didn’t grieve. I didn’t cry at her funeral. I couldn’t express anything because I was just numb to it all. I didn’t start grieving for my mother properly until I was maybe 16.”
The final post to Geldof’s Twitter account, on April 6th, included a photograph of her as a baby in her mother’s arms. Her final Instagram post showed the same photograph.
Jodi Arias conspiracies….
More dark conspiracies
Related articles |
// A complete working C program to demonstrate deletion in singly
// linked list gien the key to delete
#include <stdio.h>
#include <stdlib.h>
// A linked list node
struct Node
{
int data;
struct Node *next;
};
/* Given a reference (pointer to pointer) to the head of a list
and an int, inserts a new node on the front of the list. */
void push(struct Node** head_ref, int new_data)
{
struct Node* new_node = (struct Node*) malloc(sizeof(struct Node));
new_node->data = new_data;
new_node->next = (*head_ref);
(*head_ref) = new_node;
}
/* Given a reference (pointer to pointer) to the head of a list
and a key, deletes the first occurrence of key in linked list */
void deleteNode(struct Node **head_ref, int key)
{
// Store head node
struct Node* temp = *head_ref, *prev;
// If head node itself holds the key to be deleted
if (temp != NULL && temp->data == key)
{
*head_ref = temp->next; // Changed head
free(temp); // free old head
return;
}
// Search for the key to be deleted, keep track of the
// previous node as we need to change 'prev->next'
while (temp != NULL && temp->data != key)
{
prev = temp;
temp = temp->next;
}
// If key was not present in linked list
if (temp == NULL) return;
// Unlink the node from linked list
prev->next = temp->next;
free(temp); // Free memory
}
// This function prints contents of linked list starting from
// the given node
void printList(struct Node *node)
{
while (node != NULL)
{
printf(" %d ", node->data);
node = node->next;
}
}
/* Drier program to test above functions*/
int main()
{
/* Start with the empty list */
struct Node* head = NULL;
push(&head, 7);
push(&head, 1);
push(&head, 3);
push(&head, 2);
puts("Created Linked List: ");
printList(head);
deleteNode(&head, 1);
puts("\nLinked List after Deletion of 1: ");
printList(head);
return 0;
}
|
<reponame>lemire/BitMagic<gh_stars>1-10
#ifndef BMSPARSEVEC_ALGO__H__INCLUDED__
#define BMSPARSEVEC_ALGO__H__INCLUDED__
/*
Copyright(c) 2002-2005 <NAME>(anatoliy_kuznetsov at yahoo.com)
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information please visit: http://bmagic.sourceforge.net
*/
#include "bmdef.h"
#include "bmsparsevec.h"
namespace bm
{
/*!
\brief Clip dynamic range for signal higher than specified
\param svect - sparse vector to do clipping
\param high_bit - max bit (inclusive) allowed for this signal vector
*/
template<class SV>
void dynamic_range_clip_high(SV& svect, unsigned high_bit)
{
unsigned sv_plains = svect.plains();
BM_ASSERT(sv_plains > high_bit && high_bit > 0);
typename SV::bvector_type bv_acc;
unsigned i;
// combine all the high bits into accumulator vector
for (i = high_bit+1; i < sv_plains; ++i)
{
typename SV::bvector_type* bv_plain = svect.plain(i);
if (bv_plain)
{
bv_acc.bit_or(*bv_plain);
svect.free_plain(i);
}
} // for i
// set all bits ON for all low vectors, which happen to be clipped
for (i = high_bit; true; --i)
{
typename SV::bvector_type* bv_plain = svect.get_plain(i);
bv_plain->bit_or(bv_acc);
if (i == 0)
break;
} // for i
}
/*!
\brief Clip dynamic range for signal lower than specified (boost)
\param svect - sparse vector to do clipping
\param low_bit - low bit (inclusive) allowed for this signal vector
*/
template<class SV>
void dynamic_range_clip_low(SV& svect, unsigned low_bit)
{
if (low_bit == 0) return; // nothing to do
BM_ASSERT(svect.plains() > low_bit);
unsigned sv_plains = svect.plains();
typename SV::bvector_type bv_acc1;
unsigned i;
// combine all the high bits into accumulator vector
for (i = low_bit+1; i < sv_plains; ++i)
{
typename SV::bvector_type* bv_plain = svect.plain(i);
if (bv_plain)
bv_acc1.bit_or(*bv_plain);
} // for i
// accumulate all vectors below the clipping point
typename SV::bvector_type bv_acc2;
typename SV::bvector_type* bv_low_plain = svect.get_plain(low_bit);
for (unsigned i = low_bit-1; true; --i)
{
typename SV::bvector_type* bv_plain = svect.plain(i);
if (bv_plain)
{
bv_acc2.bit_or(*bv_plain);
svect.free_plain(i);
if (i == 0)
break;
}
} // for i
// now we want to set 1 in the clipping low plain based on
// exclusive or (XOR) between upper and lower parts)
// as a result high signal (any bits in the upper plains) gets
// slightly lower value (due to clipping) low signal gets amplified
// (lower contrast algorithm)
bv_acc1.bit_xor(bv_acc2);
bv_low_plain->bit_or(bv_acc1);
}
} // namespace bm
#include "bmundef.h"
#endif
|
The only way to begin is by joining in sorrow with those bereaved in Christchurch on 15 March and remembering and respecting the fellow humanity of those who, so painfully recently, were also living. Of course, we must find a way to comfort those made fearful by this terror: especially since such fear-making was its major purpose.
There are some crimes of such moment that we always remember where we were and what we were doing when we heard. The assassination of John F. Kennedy is one such that is often named; September 11th is another. The latter was a terrorist attack that was made for showing on television; I heard it on the radio and obstinately refused to watch TV for two days. The Christchurch massacres were made for propagating the terror and ideology via the internet. I am not yet clear about what this means, but it is obvious that it is significant, and that the jumbled ravings of the killer were put together with gleanings from the Web. He says so, in his pre-murder ‘manifesto’. Police and politicians cautioned us not to watch the video footage. Indeed I had no stomach to do so. Yet I spent the night reading the weird manifesto, which was easy enough to get hold of early on.
When I heard the appalling news — somewhat late — I was sitting at my desk, trying to write about Islamophobia. Ironically, the last sentence that I had written, was: ‘There is nothing intrinsically Islamic about these ‘old enemies’ vanquished (eventually, for a time) by the empire; Islam was just part of the package of the otherness, along with non-Whiteness / non-Europeanness, of these brown or black non-Christians who stood in opposition to the empire.’ I was harking back to how the crazed jingoists of the white settlement colony of New South Wales had sent troops to Sudan in 1885 to avenge General Gordon’s ill fate in Khartoum — and it was an immensely popular gesture — invoking, in their recruitment and fundraising campaign, ‘England’s and all Christendom’s old enemies, the Saracens’. The anti-Muslim racism was bound up in empire, I was arguing.
It is a sort of white (European) supremacism, anti-immigration and ethnic cleansing that pervade the 74 incoherent pages of Christchurch murderer’s diatribe. Islam is almost incidental to him, though a mish-mash of obsessions alludes to Saracens, crusader imagery, Knights Templar, ‘the Turk’, the siege of Vienna and so on and on. Yet also Valhalla, just to emphasise that it’s about ‘race’: the killer proudly owns to fascism and racism and does not baulk at neo-nazism, though he regrets that there are no real nazis any more. The ‘vipers’ nests’ must be burned, and non-European children who are in ‘our lands’ must be killed, without hindrance of sentiment. The killer is fixated upon the non-white others out-breeding ‘us’, and effecting ‘white genocide’ — a by now standard Islamophobic trope and one similarly colouring the ‘manifesto’ of that other mass killer, Anders Breivik, to whose motivations and crimes the Christchurch mass murderer’s have already been widely compared.
The nonsense of this irruption of irrationality should not lead us to the error of believing that individual madness is the cause, or that the motivations are unshared. In the immediate aftermath of the 2011 Oslo massacres, when ‘we were all Norwegians’, George Morgan and I wrote (in Global Islamophobia, 2012: 1) that the mass murder displayed ‘the clear imprint of a revanchist nationalist politics that has gained popularity in many parts of the contemporary West. … While rightwing political organisations have scurried to denounce Breivik and the murders … it is clear that he drew on their (tortured) political logic to rationalise his actions’. Australia’s right-wing racist Senator, Fraser Anning, who has remarked that migration was behind the Christchurch massacre, and recently called even more despicably for a ‘final solution’ to the ‘Muslim Question’, is in the same camp. Breivik credited the likes of Dutch anti-Muslim politician Geert Wilders and the English Defence Leaguefor his inspiration. This perpetrator’s ‘manifesto’ played on exactly the same sorts of themes: mass immigration, Muslim birth rates, ‘white genocide’, and all the rest. It is not only his insignias that are fascist. It is exterminist, and we have seen it before.
New Zealand rightwing extremist blogger Cameron Slater, having in 2015 just quoted Golda Meir as condemning Arabs as not loving their children, wrote of Islam: ‘… religion of peace? No way, it is a death cult and we should kill them before they kill us’. Well, the message got across on 15 Marchin Christchurch. Slater,Fraser Anning and their ilk all sell the samesort ofproduct. Will they own it now?
What hate crime and terrorism have in common — and this crime was both — is that they victimise communities beyond those directly targeted, in order to ‘send a message’. A bright young academic, and our recent co-author on Islamophobia, exclaimed to our collaborator in her grief, ‘They keep killing us!’. The perpetrator’s warped and wicked testimonial, The Great Replacement, with its obsession about ethnic cleansing, makes clear that the armies of his allies (yes, he sees himself as a courageous ‘soldier’, repelling ‘invaders’ by killing unarmed civilians including children) will keep doing so until ‘they’ go back to ‘their own lands’. He wants to reinforce a ‘they’ and ‘us’ — and we must not let him.
Others will have commented more than enough about the irony of this (white Australian) immigrant railing against immigration and appointing himself as the defender of ‘our land’ — which he conceives of as a little finger of Europe. While obsessed with ‘race’, he does not mention, in 74 pages, Indigenous people in either the land of his birth or the land of his recent residence. His white supremacism harks ‘back’ mythically to a racially pure/purified Europe. It is different from the US white supremacism excused (embraced!) by Trump, which disparages Black Americans or Hispanic peoples; rather it regards the United States (and indeed Brazil) as hopelessly degenerate and irredeemable. (The manifesto looks forward to guns and war sorting all that decadence out, with the white race emerging victorious.) This racist gunman is no more concerned with the ‘race’ legacy in the Americas of chattel slavery than he is with that of settler colonialism and the dispossession of indigenous peoples. It’s a strangely Europe-centred racism, cobbled together with memes from the internet: no less effective, for all that.
I feel strangely soiled, having immersed myself in this excrement. And deeply disturbed. But I am committed to the methodological principle of taking this sort of testimonial seriously, for explanations of the crime. Also, to finding ways of countering this sort of ideology. There are many such violent racists out there on the internet, and recruiting and proselytising in our communities — and he boasts of this. He addresses them, instructs them.
One of the first public comments that I read about the massacre was Pakistan Prime Minister Imran Khan’s observation that terrorism does not belong to any religion. He has a global political point to make, and he is correct in doing so. Before his election to political office, when people in Pakistan’s north-west were systematically terrorised by murderous US-alliance drones in the name of western counter-terrorism, Imran Khan campaigned in a principled way against this. He has to deal with Indian nationalist terrorism on the other side, along with plenty of the ‘home-grown’ terrorism. Empire and nationalism may be inflected by religion, but they are by no means reducible to it.
I later watched with unexpected admiration as New Zealand Prime Minister Jacinda Ardern spoke, movingly and with dignity, of compassion and indeed the duty to give shelter to those in need of it, as crucial, unifying New Zealand values. How different from bullying ‘mateship’ purveyed as ‘national values’ on the other (my) side of the Tasman. She did seem to have trouble mentioning the M-word, but then the murderer declared that he selected his victims as immigrants and non-‘Europeans’ rather than as Muslims. In two mosques, at Friday prayer time, mind you.
Some of the media commentary noted the Kiwi ‘black humour’ bandied for comfort among the traumatised people anxiously gathering outside the mosques (these ‘others’ are capable of such Kiwiness!). In that vein, and as we will all be New Zealanders for the while, I might observe that the killer began his legacy rant with a complete rendition of Dylan Thomas’s ‘Do Not Go Gentle into that Good Night’. One dear literature-loving Muslim colleague of mine commented that the man had added one more (minor) crime — of plagiarism — to his record. Yes, the rant is pretentious and pseudo-erudite, with sprinklings from literature and worldly-travelled posturing as well as potty-mouthed locker room macho menace.
In laying claim to inheriting — and safeguarding — all of European civilisation, Tarrant declares his English, Scots and Irish heritage. No Welsh: some small comfort for Dylan Thomas. As the epigraph at the top of this present piece suggests, perhaps ‘we’ should take Dylan Thomas back.
This essay originally appeared on the Criminology Collective site.
Scott Poynting is a visiting fellow at the Centre for Islamic Studies and Civilisation, Charles Sturt University. He is Adjunct Professor in the School of Justice at Queensland University of Technology and in Criminology at Western Sydney University. He co-edited, with George Morgan, Global Islamophobia (Routledge 2016) and, with Monish Bhatia and Waqas Tufail, Media, Crime and Racism (Palgrave, 2018). |
<filename>Interaction/Widgets/vtkOrientedGlyphContourRepresentation.cxx
/*=========================================================================
Program: Visualization Toolkit
Module: vtkOrientedGlyphContourRepresentation.cxx
Copyright (c) <NAME>, <NAME>, <NAME>
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkOrientedGlyphContourRepresentation.h"
#include "vtkActor.h"
#include "vtkAssemblyPath.h"
#include "vtkBezierContourLineInterpolator.h"
#include "vtkCamera.h"
#include "vtkCellArray.h"
#include "vtkCleanPolyData.h"
#include "vtkCoordinate.h"
#include "vtkCursor2D.h"
#include "vtkCylinderSource.h"
#include "vtkDoubleArray.h"
#include "vtkFocalPlanePointPlacer.h"
#include "vtkGlyph3D.h"
#include "vtkInteractorObserver.h"
#include "vtkLine.h"
#include "vtkMath.h"
#include "vtkObjectFactory.h"
#include "vtkPointData.h"
#include "vtkPoints.h"
#include "vtkPolyData.h"
#include "vtkPolyDataMapper.h"
#include "vtkProperty.h"
#include "vtkRenderWindow.h"
#include "vtkRenderer.h"
#include "vtkSphereSource.h"
#include "vtkTransform.h"
#include "vtkTransformPolyDataFilter.h"
vtkStandardNewMacro(vtkOrientedGlyphContourRepresentation);
//----------------------------------------------------------------------
vtkOrientedGlyphContourRepresentation::vtkOrientedGlyphContourRepresentation()
{
// Initialize state
this->InteractionState = vtkContourRepresentation::Outside;
this->CursorShape = nullptr;
this->ActiveCursorShape = nullptr;
this->HandleSize = 0.01;
this->PointPlacer = vtkFocalPlanePointPlacer::New();
this->LineInterpolator = vtkBezierContourLineInterpolator::New();
// Represent the position of the cursor
this->FocalPoint = vtkPoints::New();
this->FocalPoint->SetNumberOfPoints(100);
this->FocalPoint->SetNumberOfPoints(1);
this->FocalPoint->SetPoint(0, 0.0, 0.0, 0.0);
vtkDoubleArray* normals = vtkDoubleArray::New();
normals->SetNumberOfComponents(3);
normals->SetNumberOfTuples(100);
normals->SetNumberOfTuples(1);
double n[3] = { 0, 0, 0 };
normals->SetTuple(0, n);
// Represent the position of the cursor
this->ActiveFocalPoint = vtkPoints::New();
this->ActiveFocalPoint->SetNumberOfPoints(100);
this->ActiveFocalPoint->SetNumberOfPoints(1);
this->ActiveFocalPoint->SetPoint(0, 0.0, 0.0, 0.0);
vtkDoubleArray* activeNormals = vtkDoubleArray::New();
activeNormals->SetNumberOfComponents(3);
activeNormals->SetNumberOfTuples(100);
activeNormals->SetNumberOfTuples(1);
activeNormals->SetTuple(0, n);
this->FocalData = vtkPolyData::New();
this->FocalData->SetPoints(this->FocalPoint);
this->FocalData->GetPointData()->SetNormals(normals);
normals->Delete();
this->ActiveFocalData = vtkPolyData::New();
this->ActiveFocalData->SetPoints(this->ActiveFocalPoint);
this->ActiveFocalData->GetPointData()->SetNormals(activeNormals);
activeNormals->Delete();
this->Glypher = vtkGlyph3D::New();
this->Glypher->SetInputData(this->FocalData);
this->Glypher->SetVectorModeToUseNormal();
this->Glypher->OrientOn();
this->Glypher->ScalingOn();
this->Glypher->SetScaleModeToDataScalingOff();
this->Glypher->SetScaleFactor(1.0);
this->ActiveGlypher = vtkGlyph3D::New();
this->ActiveGlypher->SetInputData(this->ActiveFocalData);
this->ActiveGlypher->SetVectorModeToUseNormal();
this->ActiveGlypher->OrientOn();
this->ActiveGlypher->ScalingOn();
this->ActiveGlypher->SetScaleModeToDataScalingOff();
this->ActiveGlypher->SetScaleFactor(1.0);
// The transformation of the cursor will be done via vtkGlyph3D
// By default a vtkCursor2D will be used to define the cursor shape
vtkCursor2D* cursor2D = vtkCursor2D::New();
cursor2D->AllOff();
cursor2D->PointOn();
cursor2D->Update();
this->SetCursorShape(cursor2D->GetOutput());
cursor2D->Delete();
vtkCylinderSource* cylinder = vtkCylinderSource::New();
cylinder->SetResolution(64);
cylinder->SetRadius(0.5);
cylinder->SetHeight(0.0);
cylinder->CappingOff();
cylinder->SetCenter(0, 0, 0);
vtkCleanPolyData* clean = vtkCleanPolyData::New();
clean->PointMergingOn();
clean->CreateDefaultLocator();
clean->SetInputConnection(cylinder->GetOutputPort());
vtkTransform* t = vtkTransform::New();
t->RotateZ(90.0);
vtkTransformPolyDataFilter* tpd = vtkTransformPolyDataFilter::New();
tpd->SetInputConnection(clean->GetOutputPort());
tpd->SetTransform(t);
clean->Delete();
cylinder->Delete();
tpd->Update();
this->SetActiveCursorShape(tpd->GetOutput());
tpd->Delete();
t->Delete();
this->Glypher->SetSourceData(this->CursorShape);
this->ActiveGlypher->SetSourceData(this->ActiveCursorShape);
this->Mapper = vtkPolyDataMapper::New();
this->Mapper->SetInputConnection(this->Glypher->GetOutputPort());
// This turns on resolve coincident topology for everything
// as it is a class static on the mapper
this->Mapper->SetResolveCoincidentTopologyToPolygonOffset();
this->Mapper->ScalarVisibilityOff();
// Put this on top of other objects
this->Mapper->SetRelativeCoincidentTopologyLineOffsetParameters(-1, -1);
this->Mapper->SetRelativeCoincidentTopologyPolygonOffsetParameters(-1, -1);
this->Mapper->SetRelativeCoincidentTopologyPointOffsetParameter(-1);
this->ActiveMapper = vtkPolyDataMapper::New();
this->ActiveMapper->SetInputConnection(this->ActiveGlypher->GetOutputPort());
this->ActiveMapper->ScalarVisibilityOff();
this->ActiveMapper->SetRelativeCoincidentTopologyLineOffsetParameters(-1, -1);
this->ActiveMapper->SetRelativeCoincidentTopologyPolygonOffsetParameters(-1, -1);
this->ActiveMapper->SetRelativeCoincidentTopologyPointOffsetParameter(-1);
// Set up the initial properties
this->CreateDefaultProperties();
this->Actor = vtkActor::New();
this->Actor->SetMapper(this->Mapper);
this->Actor->SetProperty(this->Property);
this->ActiveActor = vtkActor::New();
this->ActiveActor->SetMapper(this->ActiveMapper);
this->ActiveActor->SetProperty(this->ActiveProperty);
this->Lines = vtkPolyData::New();
this->LinesMapper = vtkPolyDataMapper::New();
this->LinesMapper->SetInputData(this->Lines);
this->LinesMapper->SetResolveCoincidentTopologyToPolygonOffset();
this->LinesMapper->SetRelativeCoincidentTopologyLineOffsetParameters(-1, -1);
this->LinesMapper->SetRelativeCoincidentTopologyPolygonOffsetParameters(-1, -1);
this->LinesMapper->SetRelativeCoincidentTopologyPointOffsetParameter(-1);
this->LinesActor = vtkActor::New();
this->LinesActor->SetMapper(this->LinesMapper);
this->LinesActor->SetProperty(this->LinesProperty);
this->InteractionOffset[0] = 0.0;
this->InteractionOffset[1] = 0.0;
this->AlwaysOnTop = 0;
this->SelectedNodesPoints = nullptr;
this->SelectedNodesData = nullptr;
this->SelectedNodesCursorShape = nullptr;
this->SelectedNodesGlypher = nullptr;
this->SelectedNodesMapper = nullptr;
this->SelectedNodesActor = nullptr;
}
//----------------------------------------------------------------------
vtkOrientedGlyphContourRepresentation::~vtkOrientedGlyphContourRepresentation()
{
this->FocalPoint->Delete();
this->FocalData->Delete();
this->ActiveFocalPoint->Delete();
this->ActiveFocalData->Delete();
this->SetCursorShape(nullptr);
this->SetActiveCursorShape(nullptr);
this->Glypher->Delete();
this->Mapper->Delete();
this->Actor->Delete();
this->ActiveGlypher->Delete();
this->ActiveMapper->Delete();
this->ActiveActor->Delete();
this->Lines->Delete();
this->LinesMapper->Delete();
this->LinesActor->Delete();
this->Property->Delete();
this->ActiveProperty->Delete();
this->LinesProperty->Delete();
// Clear the selected nodes representation
if (this->SelectedNodesPoints)
{
this->SelectedNodesPoints->Delete();
}
if (this->SelectedNodesData)
{
this->SelectedNodesData->Delete();
}
if (this->SelectedNodesCursorShape)
{
this->SelectedNodesCursorShape->Delete();
}
if (this->SelectedNodesGlypher)
{
this->SelectedNodesGlypher->Delete();
}
if (this->SelectedNodesMapper)
{
this->SelectedNodesMapper->Delete();
}
if (this->SelectedNodesActor)
{
this->SelectedNodesActor->Delete();
}
}
//----------------------------------------------------------------------
void vtkOrientedGlyphContourRepresentation::SetCursorShape(vtkPolyData* shape)
{
if (shape != this->CursorShape)
{
if (this->CursorShape)
{
this->CursorShape->Delete();
}
this->CursorShape = shape;
if (this->CursorShape)
{
this->CursorShape->Register(this);
}
if (this->CursorShape)
{
this->Glypher->SetSourceData(this->CursorShape);
}
this->Modified();
}
}
//----------------------------------------------------------------------
vtkPolyData* vtkOrientedGlyphContourRepresentation::GetCursorShape()
{
return this->CursorShape;
}
//----------------------------------------------------------------------
void vtkOrientedGlyphContourRepresentation::SetActiveCursorShape(vtkPolyData* shape)
{
if (shape != this->ActiveCursorShape)
{
if (this->ActiveCursorShape)
{
this->ActiveCursorShape->Delete();
}
this->ActiveCursorShape = shape;
if (this->ActiveCursorShape)
{
this->ActiveCursorShape->Register(this);
}
if (this->ActiveCursorShape)
{
this->ActiveGlypher->SetSourceData(this->ActiveCursorShape);
}
this->Modified();
}
}
//----------------------------------------------------------------------
vtkPolyData* vtkOrientedGlyphContourRepresentation::GetActiveCursorShape()
{
return this->ActiveCursorShape;
}
//----------------------------------------------------------------------
void vtkOrientedGlyphContourRepresentation::SetRenderer(vtkRenderer* ren)
{
// this->WorldPosition->SetViewport(ren);
this->Superclass::SetRenderer(ren);
}
//-------------------------------------------------------------------------
int vtkOrientedGlyphContourRepresentation::ComputeInteractionState(
int X, int Y, int vtkNotUsed(modified))
{
double pos[4], xyz[3];
this->FocalPoint->GetPoint(0, pos);
pos[3] = 1.0;
this->Renderer->SetWorldPoint(pos);
this->Renderer->WorldToDisplay();
this->Renderer->GetDisplayPoint(pos);
xyz[0] = static_cast<double>(X);
xyz[1] = static_cast<double>(Y);
xyz[2] = pos[2];
this->VisibilityOn();
double tol2 = this->PixelTolerance * this->PixelTolerance;
if (vtkMath::Distance2BetweenPoints(xyz, pos) <= tol2)
{
this->InteractionState = vtkContourRepresentation::Nearby;
if (!this->ActiveCursorShape)
{
this->VisibilityOff();
}
}
else
{
this->InteractionState = vtkContourRepresentation::Outside;
if (!this->CursorShape)
{
this->VisibilityOff();
}
}
return this->InteractionState;
}
//----------------------------------------------------------------------
// Record the current event position, and the rectilinear wipe position.
void vtkOrientedGlyphContourRepresentation::StartWidgetInteraction(double startEventPos[2])
{
this->StartEventPosition[0] = startEventPos[0];
this->StartEventPosition[1] = startEventPos[1];
this->StartEventPosition[2] = 0.0;
this->LastEventPosition[0] = startEventPos[0];
this->LastEventPosition[1] = startEventPos[1];
// How far is this in pixels from the position of this widget?
// Maintain this during interaction such as translating (don't
// force center of widget to snap to mouse position)
// convert position to display coordinates
double pos[2];
this->GetNthNodeDisplayPosition(this->ActiveNode, pos);
this->InteractionOffset[0] = pos[0] - startEventPos[0];
this->InteractionOffset[1] = pos[1] - startEventPos[1];
}
//----------------------------------------------------------------------
// Based on the displacement vector (computed in display coordinates) and
// the cursor state (which corresponds to which part of the widget has been
// selected), the widget points are modified.
// First construct a local coordinate system based on the display coordinates
// of the widget.
void vtkOrientedGlyphContourRepresentation::WidgetInteraction(double eventPos[2])
{
// Process the motion
if (this->CurrentOperation == vtkContourRepresentation::Translate)
{
this->Translate(eventPos);
}
if (this->CurrentOperation == vtkContourRepresentation::Shift)
{
this->ShiftContour(eventPos);
}
if (this->CurrentOperation == vtkContourRepresentation::Scale)
{
this->ScaleContour(eventPos);
}
// Book keeping
this->LastEventPosition[0] = eventPos[0];
this->LastEventPosition[1] = eventPos[1];
}
//----------------------------------------------------------------------
// Translate everything
void vtkOrientedGlyphContourRepresentation::Translate(double eventPos[2])
{
double ref[3];
if (!this->GetActiveNodeWorldPosition(ref))
{
return;
}
double displayPos[2];
displayPos[0] = eventPos[0] + this->InteractionOffset[0];
displayPos[1] = eventPos[1] + this->InteractionOffset[1];
double worldPos[3];
double worldOrient[9] = { 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0 };
if (this->PointPlacer->ComputeWorldPosition(
this->Renderer, displayPos, ref, worldPos, worldOrient))
{
this->SetActiveNodeToWorldPosition(worldPos, worldOrient);
}
else
{
// I really want to track the closest point here,
// but I am postponing this at the moment....
}
}
//----------------------------------------------------------------------
void vtkOrientedGlyphContourRepresentation::ShiftContour(double eventPos[2])
{
double ref[3];
if (!this->GetActiveNodeWorldPosition(ref))
{
return;
}
double displayPos[2];
displayPos[0] = eventPos[0] + this->InteractionOffset[0];
displayPos[1] = eventPos[1] + this->InteractionOffset[1];
double worldPos[3];
double worldOrient[9] = { 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0 };
if (this->PointPlacer->ComputeWorldPosition(
this->Renderer, displayPos, ref, worldPos, worldOrient))
{
this->SetActiveNodeToWorldPosition(worldPos, worldOrient);
double vector[3];
vector[0] = worldPos[0] - ref[0];
vector[1] = worldPos[1] - ref[1];
vector[2] = worldPos[2] - ref[2];
for (int i = 0; i < this->GetNumberOfNodes(); i++)
{
if (i != this->ActiveNode)
{
this->GetNthNodeWorldPosition(i, ref);
worldPos[0] = ref[0] + vector[0];
worldPos[1] = ref[1] + vector[1];
worldPos[2] = ref[2] + vector[2];
this->SetNthNodeWorldPosition(i, worldPos, worldOrient);
}
}
}
}
//----------------------------------------------------------------------
void vtkOrientedGlyphContourRepresentation::ScaleContour(double eventPos[2])
{
double ref[3];
if (!this->GetActiveNodeWorldPosition(ref))
{
return;
}
double centroid[3];
ComputeCentroid(centroid);
double r2 = vtkMath::Distance2BetweenPoints(ref, centroid);
double displayPos[2];
displayPos[0] = eventPos[0] + this->InteractionOffset[0];
displayPos[1] = eventPos[1] + this->InteractionOffset[1];
double worldPos[3];
double worldOrient[9] = { 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0 };
if (this->PointPlacer->ComputeWorldPosition(
this->Renderer, displayPos, ref, worldPos, worldOrient))
{
double d2 = vtkMath::Distance2BetweenPoints(worldPos, centroid);
if (d2 != 0.0)
{
double ratio = sqrt(d2 / r2);
// this->SetActiveNodeToWorldPosition(worldPos, worldOrient);
for (int i = 0; i < this->GetNumberOfNodes(); i++)
{
// if (i != this->ActiveNode)
{
this->GetNthNodeWorldPosition(i, ref);
worldPos[0] = centroid[0] + ratio * (ref[0] - centroid[0]);
worldPos[1] = centroid[1] + ratio * (ref[1] - centroid[1]);
worldPos[2] = centroid[2] + ratio * (ref[2] - centroid[2]);
this->SetNthNodeWorldPosition(i, worldPos, worldOrient);
}
}
}
}
}
//----------------------------------------------------------------------
void vtkOrientedGlyphContourRepresentation::ComputeCentroid(double* ioCentroid)
{
double p[3];
ioCentroid[0] = 0.;
ioCentroid[1] = 0.;
ioCentroid[2] = 0.;
for (int i = 0; i < this->GetNumberOfNodes(); i++)
{
this->GetNthNodeWorldPosition(i, p);
ioCentroid[0] += p[0];
ioCentroid[1] += p[1];
ioCentroid[2] += p[2];
}
double inv_N = 1. / static_cast<double>(this->GetNumberOfNodes());
ioCentroid[0] *= inv_N;
ioCentroid[1] *= inv_N;
ioCentroid[2] *= inv_N;
}
//----------------------------------------------------------------------
void vtkOrientedGlyphContourRepresentation::Scale(double eventPos[2])
{
// Get the current scale factor
double sf = this->Glypher->GetScaleFactor();
// Compute the scale factor
int* size = this->Renderer->GetSize();
double dPos = static_cast<double>(eventPos[1] - this->LastEventPosition[1]);
sf *= (1.0 + 2.0 * (dPos / size[1])); // scale factor of 2.0 is arbitrary
// Scale the handle
this->Glypher->SetScaleFactor(sf);
if (this->ShowSelectedNodes && this->SelectedNodesGlypher)
{
this->SelectedNodesGlypher->SetScaleFactor(sf);
}
}
//----------------------------------------------------------------------
void vtkOrientedGlyphContourRepresentation::CreateDefaultProperties()
{
this->Property = vtkProperty::New();
this->Property->SetColor(1.0, 1.0, 1.0);
this->Property->SetLineWidth(0.5);
this->Property->SetPointSize(3);
this->ActiveProperty = vtkProperty::New();
this->ActiveProperty->SetColor(0.0, 1.0, 0.0);
this->ActiveProperty->SetRepresentationToWireframe();
this->ActiveProperty->SetAmbient(1.0);
this->ActiveProperty->SetDiffuse(0.0);
this->ActiveProperty->SetSpecular(0.0);
this->ActiveProperty->SetLineWidth(1.0);
this->LinesProperty = vtkProperty::New();
this->LinesProperty->SetAmbient(1.0);
this->LinesProperty->SetDiffuse(0.0);
this->LinesProperty->SetSpecular(0.0);
this->LinesProperty->SetColor(1, 1, 1);
this->LinesProperty->SetLineWidth(1);
}
//----------------------------------------------------------------------
void vtkOrientedGlyphContourRepresentation::BuildLines()
{
vtkPoints* points = vtkPoints::New();
vtkCellArray* lines = vtkCellArray::New();
int i, j;
vtkIdType index = 0;
int count = this->GetNumberOfNodes();
for (i = 0; i < this->GetNumberOfNodes(); i++)
{
count += this->GetNumberOfIntermediatePoints(i);
}
points->SetNumberOfPoints(count);
vtkIdType numLines;
if (this->ClosedLoop && count > 0)
{
numLines = count + 1;
}
else
{
numLines = count;
}
if (numLines > 0)
{
vtkIdType* lineIndices = new vtkIdType[numLines];
double pos[3];
for (i = 0; i < this->GetNumberOfNodes(); i++)
{
// Add the node
this->GetNthNodeWorldPosition(i, pos);
points->InsertPoint(index, pos);
lineIndices[index] = index;
index++;
int numIntermediatePoints = this->GetNumberOfIntermediatePoints(i);
for (j = 0; j < numIntermediatePoints; j++)
{
this->GetIntermediatePointWorldPosition(i, j, pos);
points->InsertPoint(index, pos);
lineIndices[index] = index;
index++;
}
}
if (this->ClosedLoop)
{
lineIndices[index] = 0;
}
lines->InsertNextCell(numLines, lineIndices);
delete[] lineIndices;
}
this->Lines->SetPoints(points);
this->Lines->SetLines(lines);
points->Delete();
lines->Delete();
}
//----------------------------------------------------------------------
vtkPolyData* vtkOrientedGlyphContourRepresentation::GetContourRepresentationAsPolyData()
{
// Get the points in this contour as a vtkPolyData.
return this->Lines;
}
//----------------------------------------------------------------------
void vtkOrientedGlyphContourRepresentation::BuildRepresentation()
{
// Make sure we are up to date with any changes made in the placer
this->UpdateContour();
if (this->AlwaysOnTop)
{
// max value 65536 so we subtract 66000 to make sure we are
// zero or negative
this->LinesMapper->SetRelativeCoincidentTopologyLineOffsetParameters(0, -66000);
this->LinesMapper->SetRelativeCoincidentTopologyPolygonOffsetParameters(0, -66000);
this->LinesMapper->SetRelativeCoincidentTopologyPointOffsetParameter(-66000);
this->Mapper->SetRelativeCoincidentTopologyLineOffsetParameters(0, -66000);
this->Mapper->SetRelativeCoincidentTopologyPolygonOffsetParameters(0, -66000);
this->Mapper->SetRelativeCoincidentTopologyPointOffsetParameter(-66000);
this->ActiveMapper->SetRelativeCoincidentTopologyLineOffsetParameters(0, -66000);
this->ActiveMapper->SetRelativeCoincidentTopologyPolygonOffsetParameters(0, -66000);
this->ActiveMapper->SetRelativeCoincidentTopologyPointOffsetParameter(-66000);
}
else
{
this->LinesMapper->SetRelativeCoincidentTopologyLineOffsetParameters(-1, -1);
this->LinesMapper->SetRelativeCoincidentTopologyPolygonOffsetParameters(-1, -1);
this->LinesMapper->SetRelativeCoincidentTopologyPointOffsetParameter(-1);
this->Mapper->SetRelativeCoincidentTopologyLineOffsetParameters(-1, -1);
this->Mapper->SetRelativeCoincidentTopologyPolygonOffsetParameters(-1, -1);
this->Mapper->SetRelativeCoincidentTopologyPointOffsetParameter(-1);
this->ActiveMapper->SetRelativeCoincidentTopologyLineOffsetParameters(-1, -1);
this->ActiveMapper->SetRelativeCoincidentTopologyPolygonOffsetParameters(-1, -1);
this->ActiveMapper->SetRelativeCoincidentTopologyPointOffsetParameter(-1);
}
double p1[4], p2[4];
this->Renderer->GetActiveCamera()->GetFocalPoint(p1);
p1[3] = 1.0;
this->Renderer->SetWorldPoint(p1);
this->Renderer->WorldToView();
this->Renderer->GetViewPoint(p1);
double depth = p1[2];
double aspect[2];
this->Renderer->ComputeAspect();
this->Renderer->GetAspect(aspect);
p1[0] = -aspect[0];
p1[1] = -aspect[1];
this->Renderer->SetViewPoint(p1);
this->Renderer->ViewToWorld();
this->Renderer->GetWorldPoint(p1);
p2[0] = aspect[0];
p2[1] = aspect[1];
p2[2] = depth;
p2[3] = 1.0;
this->Renderer->SetViewPoint(p2);
this->Renderer->ViewToWorld();
this->Renderer->GetWorldPoint(p2);
double distance = sqrt(vtkMath::Distance2BetweenPoints(p1, p2));
int* size = this->Renderer->GetRenderWindow()->GetSize();
double viewport[4];
this->Renderer->GetViewport(viewport);
double x, y, scale;
x = size[0] * (viewport[2] - viewport[0]);
y = size[1] * (viewport[3] - viewport[1]);
scale = sqrt(x * x + y * y);
distance = 1000 * distance / scale;
this->Glypher->SetScaleFactor(distance * this->HandleSize);
this->ActiveGlypher->SetScaleFactor(distance * this->HandleSize);
int numPoints = this->GetNumberOfNodes();
int i;
if (this->ShowSelectedNodes && this->SelectedNodesGlypher)
{
this->SelectedNodesGlypher->SetScaleFactor(distance * this->HandleSize);
this->FocalPoint->Reset();
this->FocalPoint->SetNumberOfPoints(0);
this->FocalData->GetPointData()->GetNormals()->SetNumberOfTuples(0);
this->SelectedNodesPoints->Reset();
this->SelectedNodesPoints->SetNumberOfPoints(0);
this->SelectedNodesData->GetPointData()->GetNormals()->SetNumberOfTuples(0);
for (i = 0; i < numPoints; i++)
{
if (i != this->ActiveNode)
{
double worldPos[3];
double worldOrient[9];
this->GetNthNodeWorldPosition(i, worldPos);
this->GetNthNodeWorldOrientation(i, worldOrient);
if (this->GetNthNodeSelected(i))
{
this->SelectedNodesPoints->InsertNextPoint(worldPos);
this->SelectedNodesData->GetPointData()->GetNormals()->InsertNextTuple(worldOrient + 6);
}
else
{
this->FocalPoint->InsertNextPoint(worldPos);
this->FocalData->GetPointData()->GetNormals()->InsertNextTuple(worldOrient + 6);
}
}
}
this->SelectedNodesPoints->Modified();
this->SelectedNodesData->GetPointData()->GetNormals()->Modified();
this->SelectedNodesData->Modified();
}
else
{
if (this->ActiveNode >= 0 && this->ActiveNode < this->GetNumberOfNodes())
{
this->FocalPoint->SetNumberOfPoints(numPoints - 1);
this->FocalData->GetPointData()->GetNormals()->SetNumberOfTuples(numPoints - 1);
}
else
{
this->FocalPoint->SetNumberOfPoints(numPoints);
this->FocalData->GetPointData()->GetNormals()->SetNumberOfTuples(numPoints);
}
int idx = 0;
for (i = 0; i < numPoints; i++)
{
if (i != this->ActiveNode)
{
double worldPos[3];
double worldOrient[9];
this->GetNthNodeWorldPosition(i, worldPos);
this->GetNthNodeWorldOrientation(i, worldOrient);
this->FocalPoint->SetPoint(idx, worldPos);
this->FocalData->GetPointData()->GetNormals()->SetTuple(idx, worldOrient + 6);
idx++;
}
}
}
this->FocalPoint->Modified();
this->FocalData->GetPointData()->GetNormals()->Modified();
this->FocalData->Modified();
if (this->ActiveNode >= 0 && this->ActiveNode < this->GetNumberOfNodes())
{
double worldPos[3];
double worldOrient[9];
this->GetNthNodeWorldPosition(this->ActiveNode, worldPos);
this->GetNthNodeWorldOrientation(this->ActiveNode, worldOrient);
this->ActiveFocalPoint->SetPoint(0, worldPos);
this->ActiveFocalData->GetPointData()->GetNormals()->SetTuple(0, worldOrient + 6);
this->ActiveFocalPoint->Modified();
this->ActiveFocalData->GetPointData()->GetNormals()->Modified();
this->ActiveFocalData->Modified();
this->ActiveActor->VisibilityOn();
}
else
{
this->ActiveActor->VisibilityOff();
}
}
//----------------------------------------------------------------------
void vtkOrientedGlyphContourRepresentation::GetActors(vtkPropCollection* pc)
{
this->Actor->GetActors(pc);
this->ActiveActor->GetActors(pc);
this->LinesActor->GetActors(pc);
if (this->ShowSelectedNodes && this->SelectedNodesActor)
{
this->SelectedNodesActor->GetActors(pc);
}
}
//----------------------------------------------------------------------
void vtkOrientedGlyphContourRepresentation::ReleaseGraphicsResources(vtkWindow* win)
{
this->Actor->ReleaseGraphicsResources(win);
this->ActiveActor->ReleaseGraphicsResources(win);
this->LinesActor->ReleaseGraphicsResources(win);
}
//----------------------------------------------------------------------
int vtkOrientedGlyphContourRepresentation::RenderOverlay(vtkViewport* viewport)
{
int count = 0;
count += this->LinesActor->RenderOverlay(viewport);
if (this->Actor->GetVisibility())
{
count += this->Actor->RenderOverlay(viewport);
}
if (this->ActiveActor->GetVisibility())
{
count += this->ActiveActor->RenderOverlay(viewport);
}
return count;
}
//-----------------------------------------------------------------------------
int vtkOrientedGlyphContourRepresentation::RenderOpaqueGeometry(vtkViewport* viewport)
{
// Since we know RenderOpaqueGeometry gets called first, will do the
// build here
this->BuildRepresentation();
int count = 0;
count += this->LinesActor->RenderOpaqueGeometry(viewport);
if (this->Actor->GetVisibility())
{
count += this->Actor->RenderOpaqueGeometry(viewport);
}
if (this->ActiveActor->GetVisibility())
{
count += this->ActiveActor->RenderOpaqueGeometry(viewport);
}
if (this->ShowSelectedNodes && this->SelectedNodesActor &&
this->SelectedNodesActor->GetVisibility())
{
count += this->SelectedNodesActor->RenderOpaqueGeometry(viewport);
}
return count;
}
//-----------------------------------------------------------------------------
int vtkOrientedGlyphContourRepresentation::RenderTranslucentPolygonalGeometry(vtkViewport* viewport)
{
int count = 0;
count += this->LinesActor->RenderTranslucentPolygonalGeometry(viewport);
if (this->Actor->GetVisibility())
{
count += this->Actor->RenderTranslucentPolygonalGeometry(viewport);
}
if (this->ActiveActor->GetVisibility())
{
count += this->ActiveActor->RenderTranslucentPolygonalGeometry(viewport);
}
return count;
}
//-----------------------------------------------------------------------------
vtkTypeBool vtkOrientedGlyphContourRepresentation::HasTranslucentPolygonalGeometry()
{
int result = 0;
result |= this->LinesActor->HasTranslucentPolygonalGeometry();
if (this->Actor->GetVisibility())
{
result |= this->Actor->HasTranslucentPolygonalGeometry();
}
if (this->ActiveActor->GetVisibility())
{
result |= this->ActiveActor->HasTranslucentPolygonalGeometry();
}
return result;
}
//----------------------------------------------------------------------------
void vtkOrientedGlyphContourRepresentation::SetLineColor(double r, double g, double b)
{
if (this->GetLinesProperty())
{
this->GetLinesProperty()->SetColor(r, g, b);
}
}
//----------------------------------------------------------------------
void vtkOrientedGlyphContourRepresentation::SetShowSelectedNodes(vtkTypeBool flag)
{
vtkDebugMacro(<< this->GetClassName() << " (" << this << "): setting ShowSelectedNodes to "
<< flag);
if (this->ShowSelectedNodes != flag)
{
this->ShowSelectedNodes = flag;
this->Modified();
if (this->ShowSelectedNodes)
{
if (!this->SelectedNodesActor)
{
this->CreateSelectedNodesRepresentation();
}
else
{
this->SelectedNodesActor->SetVisibility(1);
}
}
else
{
if (this->SelectedNodesActor)
{
this->SelectedNodesActor->SetVisibility(0);
}
}
}
}
//----------------------------------------------------------------------
double* vtkOrientedGlyphContourRepresentation::GetBounds()
{
return this->Lines->GetPoints() ? this->Lines->GetPoints()->GetBounds() : nullptr;
}
//-----------------------------------------------------------------------------
void vtkOrientedGlyphContourRepresentation::CreateSelectedNodesRepresentation()
{
vtkSphereSource* sphere = vtkSphereSource::New();
sphere->SetThetaResolution(12);
sphere->SetRadius(0.3);
this->SelectedNodesCursorShape = sphere->GetOutput();
this->SelectedNodesCursorShape->Register(this);
sphere->Delete();
// Represent the position of the cursor
this->SelectedNodesPoints = vtkPoints::New();
this->SelectedNodesPoints->SetNumberOfPoints(100);
// this->SelectedNodesPoints->SetNumberOfPoints(1);
// this->SelectedNodesPoints->SetPoint(0, 0.0, 0.0, 0.0);
vtkDoubleArray* normals = vtkDoubleArray::New();
normals->SetNumberOfComponents(3);
normals->SetNumberOfTuples(100);
normals->SetNumberOfTuples(1);
double n[3] = { 0, 0, 0 };
normals->SetTuple(0, n);
this->SelectedNodesData = vtkPolyData::New();
this->SelectedNodesData->SetPoints(this->SelectedNodesPoints);
this->SelectedNodesData->GetPointData()->SetNormals(normals);
normals->Delete();
this->SelectedNodesGlypher = vtkGlyph3D::New();
this->SelectedNodesGlypher->SetInputData(this->SelectedNodesData);
this->SelectedNodesGlypher->SetVectorModeToUseNormal();
this->SelectedNodesGlypher->OrientOn();
this->SelectedNodesGlypher->ScalingOn();
this->SelectedNodesGlypher->SetScaleModeToDataScalingOff();
this->SelectedNodesGlypher->SetScaleFactor(1.0);
this->SelectedNodesGlypher->SetSourceData(this->SelectedNodesCursorShape);
this->SelectedNodesMapper = vtkPolyDataMapper::New();
this->SelectedNodesMapper->SetInputData(this->SelectedNodesGlypher->GetOutput());
this->SelectedNodesMapper->SetResolveCoincidentTopologyToPolygonOffset();
this->SelectedNodesMapper->ScalarVisibilityOff();
vtkProperty* selProperty = vtkProperty::New();
selProperty->SetColor(0.0, 1.0, 0.0);
selProperty->SetLineWidth(0.5);
selProperty->SetPointSize(3);
this->SelectedNodesActor = vtkActor::New();
this->SelectedNodesActor->SetMapper(this->SelectedNodesMapper);
this->SelectedNodesActor->SetProperty(selProperty);
selProperty->Delete();
}
//-----------------------------------------------------------------------------
void vtkOrientedGlyphContourRepresentation::PrintSelf(ostream& os, vtkIndent indent)
{
// Superclass typedef defined in vtkTypeMacro() found in vtkSetGet.h
this->Superclass::PrintSelf(os, indent);
os << indent << "Always On Top: " << (this->AlwaysOnTop ? "On\n" : "Off\n");
os << indent << "ShowSelectedNodes: " << this->ShowSelectedNodes << endl;
if (this->Property)
{
os << indent << "Property: " << this->Property << "\n";
}
else
{
os << indent << "Property: (none)\n";
}
if (this->ActiveProperty)
{
os << indent << "Active Property: " << this->ActiveProperty << "\n";
}
else
{
os << indent << "Active Property: (none)\n";
}
if (this->LinesProperty)
{
os << indent << "Lines Property: " << this->LinesProperty << "\n";
}
else
{
os << indent << "Lines Property: (none)\n";
}
}
|
Frequency of biocide resistance genes, antibiotic resistance and the effect of chlorhexidine exposure on clinical methicillin-resistant Staphylococcus aureus isolates. OBJECTIVES To detect genes conferring resistance to biguanides, quaternary ammonium compounds, beta-lactams and fluoroquinolones in clinical methicillin-resistant Staphylococcus aureus (MRSA) and to demonstrate whether reduced susceptibility is spread clonally and if the presence of any of the detected genes links to a specific epidemic MRSA. Finally, to identify if exposure to chlorhexidine may cause reduced susceptibility to antibiotics and chlorhexidine. METHODS In total, 120 clinical MRSA isolates were isolated. qacA/B, qacG, qacH, norA, smr and blaZ genes were amplified by PCR. MICs of eight antibiotics were determined and PFGE was used for typing. Surface disinfection and residue tests were performed for chlorhexidine and a selection of isolates. RESULTS qacA/B (8.3%), qacH (3.3%), norA (36.7%), smr (44.2%) and blaZ (97.5%) were prevalent within the population but qacG was not detected. EMRSA-15 (19.2%), EMRSA-16 (15%), P3 (15%) and H (12.5%) were the most common PFGE types. Clinical isolates demonstrated various degrees of susceptibility to chlorhexidine in the surface disinfection and biocide residue (mean ME = 0.29-3.74) tests. Increases in post-exposure MICs were observed in both EMRSA-16 and the susceptible S. aureus control. CONCLUSIONS In our study, isolates resembling PFGE type EMRSA-16 harboured more biocide resistance genes than other types. The observed reduction in susceptibility of clinical isolates to chlorhexidine may mean that a selective pressure is being exerted by residues in the clinical environment, and highlights the importance of efficacy testing on clinical strains and good infection control practices. The development of reduced microbial susceptibility to biocides represents a serious cause for concern in the clinical environment. |
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strjoin_rev.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mtan <<EMAIL>> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/02/21 17:41:00 by mtan #+# #+# */
/* Updated: 2018/02/21 17:41:09 by mtan ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/*
** ft_strjoin_rev is modified to free the address pointed by param s1.
*/
char *ft_strjoin_rev(char const *s1, char **s2)
{
char *str;
char *tmp;
size_t i;
size_t j;
tmp = *s2;
if (!s1 || !tmp || !(str = ft_strnew(ft_strlen(s1) + ft_strlen(tmp))))
return (NULL);
i = -1;
j = -1;
while (tmp[++i])
str[i] = tmp[i];
while (s1[++j])
str[i++] = s1[j];
str[++i] = '\0';
free(tmp);
return (str);
}
|
Tailored star poly (-caprolactone) wet-spun scaffolds for in vivo regeneration of long bone critical size defects One of the most challenging requirements of a successful bone tissue engineering approach is the development of scaffolds specifically tailored to individual tissue defects. Besides materials chemistry, well-defined scaffolds structural features at the micro- and macro-levels are needed for optimal bone in-growth. In this study, polymeric fibrous scaffolds with a controlled internal network of pores and modelled on the anatomical shape and dimensions of a critical size bone defect in a rabbits radius model were developed by employing a computer-aided wet-spinning technique. The tailored scaffolds made of star poly(-caprolactone) or star poly(-caprolactone)hydroxyapatite composite material were implanted into 20-mm segmental defects created in radial diaphysis of New Zealand white rabbits. Bone regeneration and tissue response were assessed by X-rays and histological analysis at 4, 8 and 12weeks after surgery. No signs of macroscopic and microscopic inflammatory reactions were detected, and the developed scaffolds showed a good ability to support and promote the bone regeneration process. However, no significant differences in osteoconductivity were observed between star poly(-caprolactone) and star poly(-caprolactone)hydroxyapatite scaffolds. Long-term study on implanted star poly(-caprolactone) scaffolds confirmed the presence of signs of bone regeneration and remodelling, particularly evident at 24weeks. |
What's the REAL unemployment rate?
The Labor Department said Friday that the unemployment rate was unchanged at 5 percent in December. But what does that number really mean?
Economists look past the "main" unemployment number (also known as the "U-3 rate") to other indicators in the report that give a more nuanced view of the employment situation. On jobs days, the Bureau of Labor Statistics puts out a slew of figures, each of which measures a different part of the economy.
One of those data points is the U-6 rate. Many experts prefer the U-6 rate to the U-3 rate because it captures those employees who work part time but would like to be working full time.
The BLS defines U-6 as "total unemployed, plus all persons marginally attached to the labor force, plus total employed part time for economic reasons, as a percent of the civilian labor force," plus all marginally attached workers.
In other words, the unemployed, the underemployed and the discouraged -- a rate that remains stubbornly above precession levels.
The U-6 rate also stayed level in December at 9.9 percent. Overall, the U-6 has been more volatile than the unemployment rate since the recession. It's down 130 basis points over the past year, versus a 60-basis-point drop in the U-3.
This month's release is of particular interest as it's the first jobs report since the Federal Reserve raised its federal funds interest rate target in December.
The Fed had waited months to see evidence of a sustained recovery, including in the form of lower unemployment and increasing labor market participation, before raising rates. The interest rate hike is not expected to affect the job market significantly, and the Fed isn't expected to consider raising rates again until March.
The nation added 292,000 jobs in December, soundly beating estimates of 200,000.
The report is a welcome indicator of economic health in the face of the recent market upheavals amid concern about an expected slowdown in China and weak commodity prices.
Another measure of the employment situation economists often use is the ratio of vacancies post to the number of unemployed persons. This v/u ratio measures labor market tightness: A rising indicator means mores businesses are looking to fill positions relative to the number of job seekers.
In a robust economy, we would expect to see that number rising and indeed, it reached prerecession levels this year. |
Small-cap stocks are one of the best ways to create a steady stream of income while tapping into a company's growth potential. That's why we're bringing you the best small-cap stock to buy today.
You see, unlike risky penny stock investments, some small-cap stocks have the strong financials that can generate spectacular returns for investors.
With a market capitalization between $300 million to $2 billion, small-cap stocks have the growth potential to generate strong returns that established companies rarely generate.
The key to being profitable and minimizing risk is to be able to identify small-cap stocks that have the makings of a solid investment.
To find the best small-cap stock to buy now, we use the Money Morning Stock VQScore™ system to identify small-cap stocks that have real growth potential.
Developed from our proprietary valuation system, the VQScore finds small-cap stocks with the highest profit potential through a blended analysis of a company's earnings potential, growth rate, earnings-per-share acceleration, and market volume.
By using crucial factors to find stocks that are poised to outperform typical returns, investors like you stand a great chance of riding the wave and capitalizing on some serious profits.
And we've identified one small-cap stock that is on the cusp of significant growth.
It's a Brazilian steel company reaping serious returns from the shifting international trade landscape. And it's trading at a ridiculously low price.
This steel company has already jumped 25% over the last month – and it's expected to jump another 60% in the next year….
Thank you. What do you think about AMNF. |
Author response to: Why was selective histopathological examination after cholecystectomy implemented suboptimally? Editor We appreciate the opportunity to submit a reply to a letter from Ma and Zhou regarding our recently published article1. We thank the authors for their interest in our study. The authors state that the fraction of incidentally detected gallbladder cancer (GBC) suspected by the surgeon during surgery is too low to consider selective histopathological examination safe. Indeed, GBC was not recognized in at least one-quarter of patients, despite systematic assessment of the gallbladder mucosa. However, oncological safety of a selective approach mainly depends on the clinical consequences of these missed GBC. At least 50 per cent of missed GBC in our review were early stage cancer (≤T1a) and therefore inconsequential. For patients with ≥T1b stage GBC, revisional surgery or systemic treatment may be indicated. These patients might be considered undertreated, if their gallbladder is refrained from histopathological examination. However, as mentioned in our discussion, additional treatment of incidental GBM is not necessarily beneficial for patients and might even be harmful. Based on the results of our systematic review, we can only conclude that selective histopathological examination of cholecystectomy specimens seems safe. Results of the FANCY study, which are currently analysed by our research group, have to be awaited for definitive conclusions. The second concern raised by the authors is that routine histopathological examination may also benefit patients without GBC, as the reassurance of a benign disease might provide peace of mind. In our opinion, confirmation of a benign diagnosis in preand intraoperative unsuspected patients with a risk of truly incidental GBC of less than 0⋅1 per cent does not justify the substantial costs associated with routine histopathological examination. Instead, appropriate counselling must be provided, by informing patients that the diagnosis of incidental GBC is very rare, and if diagnosed, further treatment with unknown benefit is only initiated in less than half of patients. |
<gh_stars>1-10
export default function loading () {
return (
<span className="loadingBarLong" > </span>
)
} |
Observation of the Rabi-resonance spectrum. By use of a double-resonance technique, a spectrum of Rabi resonances has been observed. These resonances are enhancements in the dynamic response of a quantum system's population to rapid changes in the phase of a perturbing electromagnetic field. Theoretically, it is shown that the appearance of a spectrum, as opposed to a single Rabi resonance, is due to the fact that the phase of the field changes discretely by..pi.. radians, rather than sinusoidally. In the presence of..pi..-radian phase changes, the quantum system's dynamic response is found to be similar to a damped harmonic oscillator driven by a deltafunction force term. In this harmonic-oscillator approximation the Rabi-resonance spectrum arises naturally, resulting from a resonant enhancement of the atomic coherence. |
If you’ve been on the fence about attending this year’s EGX conference at the National Exhibition Centre in Birmingham then Bethesda and Arkane Studios might just sweeten the deal for you. The publisher has announced that Dishonored 2 will be playable for the public on the show floor.
If you’re neither willing nor able (or a combination of the two) to travel to the UK for EGX, Arkane Studios have you covered as well! The devs will hold a developer session at EGX where Arkane Studios art director Sebastien Mitton will go into detail about the studio’s artistic approach to the stylized world of Dishonored 2. This session is open to the public attending EGX but will also be live streamed via the EGX Twitch channel. The developer session will be held on the 22nd of this month at 4 pm BST (time zone converter can be found over here).
We’re thrilled that Bethesda has chosen EGX as the venue to bring Dishonored 2 to consumers for the very first time. It’s a further demonstration of the growing importance of EGX on the global stage. David Lilley, EGX Managing Director
Dishonored 2 will continue the story set in motion in the first game, and follows the exploits of Corvo Attano (Dishonored‘s protagonist) and Emily Kaldwin, the former empress of Dunwall. Set 15 years after the events of the first game Dishonored 2 sees the two protagonists attempt to restore Emily to the throne after an “otherworldly” usurper dethrones Emily. Players will once again be given free reign over how they want to complete the missions and gives the player a choice of sneakily completing objectives, killing everyone who stands in your way or via a combination of the 2. The mysterious Outlander, who gave Corvo his powers in the first game, will also be returning as a support character who grants Corvo and Emily a variety of supernatural powers to use during their mission.
If you want to go to EGX you’ll have to be quick. Saturday tickets are already sold out at the time of writing this but there are still tickets available for Friday and Sunday. You can book your tickets by going here.
Dishonored 2 is scheduled to release on PC, Xbox One and PlayStation 4 on November 11.
What do you think of this news? If you were on the fence about going to EGX, has this changed your mind?
Share Have a tip for us? Awesome! Shoot us an email at [email protected] and we'll take a look! |
Alternative splicing increases the diversity of the human protein kinase C family. Isolation of two protein kinase C (PKC) cDNA clones containing divergent carboxy-terminal sequences suggested a common genetic origin for these cDNAs. Partial characterization of the hPKC beta chromosomal gene provided direct evidence for the existence of two adjacent carboxy-terminal exons (beta 1 and beta 2) that are alternatively spliced to generate two types of hPKC beta sequences. PKC beta 1 and beta 2 mRNAs are expressed in a selective manner in both human hematopoietic cells and bovine brain tissues. |
from collections import deque
class Vector(object):
def __init__(self, x=0, y=0):
self.x = x
self.y = y
def __str__(self):
return "Vector [{}, {}]".format(self.x, self.y)
def __iter__(self):
return tuple([self.x, self.y]).__iter__()
def __mul__(self, other):
if isinstance(other, int) or isinstance(other, float):
return Vector(x=self.x*other, y=self.y*other)
elif isinstance(other, Vector):
return Vector(x=self.x*other.x, y=self.y*other.y)
def pair(self):
return self.x, self.y
class Pose(object):
def __init__(self, x, y, theta):
self.position = Vector(x, y)
self.orientation = theta
def __str__(self):
return "Pose {{position: {0!s}, orientation: {1!s}}}".format(
self.position, self.orientation)
class Path(object):
def __init__(self, poses=[]):
self._poses = deque(poses)
def __str__(self):
return "Path {}".format(self._poses)
def length(self):
return len(self._poses)
def append_pose(self, pose):
if pose is not None:
self._poses.append(pose)
def next_pose(self):
return self._poses.popleft()
class Twist(object):
"""2D motion described by velocity components
:ivar roboticsintro.common.Vector linear: linear component of twist
:ivar float angular: angular component of twist (z-axis rotation)
"""
def __init__(self, x=0., y=0., theta=0.):
self.linear = Vector(x, y)
self.angular = theta
def __str__(self):
return "Twist {{linear: {}, angular: {}}}".format(
self.linear, self.angular)
|
/*
* Copyright (c) 2017 RnDity Sp. z o.o.
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef _STM32F0X_FLASH_REGISTERS_H_
#define _STM32F0X_FLASH_REGISTERS_H_
#include <zephyr/types.h>
/**
* @brief
*
* Based on reference manual:
* STM32F030x4/x6/x8/xC,
* STM32F070x6/xB advanced ARM ® -based MCUs
*
* Chapter 3.3.5: Embedded Flash Memory
*/
enum {
STM32_FLASH_LATENCY_0 = 0x0,
STM32_FLASH_LATENCY_1 = 0x1
};
/* 3.3.5.1 FLASH_ACR */
union ef_acr {
u32_t val;
struct {
u32_t latency :3 __packed;
u32_t rsvd__3 :1 __packed;
u32_t prftbe :1 __packed;
u32_t prftbs :1 __packed;
u32_t rsvd__6_31 :26 __packed;
} bit;
};
/* 3.3.5 Embedded flash registers */
struct stm32f0x_flash {
volatile union ef_acr acr;
volatile u32_t keyr;
volatile u32_t optkeyr;
volatile u32_t sr;
volatile u32_t cr;
volatile u32_t ar;
volatile u32_t rsvd;
volatile u32_t obr;
volatile u32_t wrpr;
};
#endif /* _STM32F0X_FLASH_REGISTERS_H_ */
|
<filename>src/frontend/explorer2/src/app/services/miscellaneous.classes.ts
export class Patient
{
public ID: string;
public IsStable: boolean;
public LastUpdate: Date;
public MainDicomTags;
public Studies: string[];
public Type: string;
constructor(pPatient: Patient)
{
this.ID = pPatient.ID;
this.IsStable = pPatient.IsStable;
this.LastUpdate = pPatient.LastUpdate;
this.MainDicomTags = pPatient.MainDicomTags;
this.Studies = pPatient.Studies;
this.Type = pPatient.Type;
}
}
export class Study
{
public ID: string;
public IsStable: boolean;
public LastUpdate: Date;
public MainDicomTags;
public tags: string[];
public Series: string[];
public ParentPatient: string;
public Type: string;
constructor(pStudy: Study)
{
this.ID = pStudy.ID ;
this.IsStable = pStudy.IsStable;
this.LastUpdate = pStudy.LastUpdate;
this.MainDicomTags = pStudy.MainDicomTags;
this.Series = pStudy.Series;
this.ParentPatient = pStudy.ParentPatient;
this.Type=pStudy.Type;
this.tags = [];
}
}
export class Serie
{
public ID: string;
public IsStable: boolean;
public LastUpdate: Date;
public ExpectedNumberOfInstances: number;
public Instances: string[];
public MainDicomTags;
public ParentStudy: string;
public Type: string;
constructor(pSeries: Serie)
{
this.ID = pSeries.ID;
this.IsStable = pSeries.IsStable;
this.LastUpdate = pSeries.LastUpdate;
this.ExpectedNumberOfInstances = pSeries.ExpectedNumberOfInstances;
this.Instances = pSeries.Instances;
this.MainDicomTags = pSeries.MainDicomTags;
this.ParentStudy = pSeries.ParentStudy;
this.Type=pSeries.Type;
}
}
export class Instance
{
public ID: string;
public FileSize: number;
public FileUuid: string;
public IndexInSeries: number;
public ParentSeries: string;
public MainDicomTags;
public Type:string;
constructor(pInstance: Instance)
{
this.ID = pInstance.ID;
this.FileSize = pInstance.FileSize;
this.FileUuid = pInstance.FileUuid;
this.IndexInSeries = pInstance.IndexInSeries;
this.ParentSeries = pInstance.ParentSeries;
this.MainDicomTags = pInstance.MainDicomTags;
this.Type=pInstance.Type;
}
}
export class InstanceTags
{
public tags;
constructor(pInstance: Object)
{
this.tags=pInstance;
}
}
export class Plugin
{
public ID: string;
public RootUri: string;
public Description: string;
public Version: string;
public ExtendsOrthancExplorer: boolean;
constructor(input, type: string)
{
if(type == 'Plugin') {
this.ID = input.ID;
this.RootUri = input.RootUri;
this.Description = input.Description;
this.Version = input.Version;
this.ExtendsOrthancExplorer = input.ExtendsOrthancExplorer;
}
else if(type == 'string') {
this.ID = input;
this.RootUri = undefined;
this.Description = undefined;
this.Version = undefined;
this.ExtendsOrthancExplorer = false;
}
else {
console.error('Unable to create Plugin object. The given type is unknown.');
}
}
}
export class RemainingAncestor
{
public ID: string;
public Path: string;
public Type: string;
constructor(pRemainingAncestor :RemainingAncestor)
{
this.ID = pRemainingAncestor.ID;
this.Path = pRemainingAncestor.Path;
this.Type = pRemainingAncestor.Type;
}
}
export class Statistics
{
public CountInstances: number;
public CountPatients: number;
public CountSeries: number;
public CountStudies: number;
public TotalDiskSize: string;
public TotalDiskSizeMB: number;
public TotalUncompressedSize: string;
public TotalUncompressedSizeMB: number;
constructor (pStatistics: Statistics)
{
this.CountInstances = pStatistics.CountInstances;
this.CountPatients = pStatistics.CountPatients;
this.CountSeries = pStatistics.CountSeries;
this.CountStudies = pStatistics.CountStudies;
this.TotalDiskSize = pStatistics.TotalDiskSize;
this.TotalDiskSizeMB = pStatistics.TotalDiskSizeMB;
this.TotalUncompressedSize = pStatistics.TotalUncompressedSize;
this.TotalUncompressedSizeMB = pStatistics.TotalUncompressedSizeMB;
}
}
export class UploadInfo {
public ID: string;
public Path: string;
public Status: string
constructor(pUploadInfo: UploadInfo)
{
this.ID = pUploadInfo.ID;
this.Path = pUploadInfo.Path;
this.Status = pUploadInfo.Status;
}
}
export class System
{
public DatabaseBackendPlugin;
public DatabaseVersion: number;
public DicomAet: string;
public DicomPort: number;
public HttpPort: number;
public Name: string;
public PluginsEnabled: boolean;
public StorageAreaPlugin;
public Version: string;
constructor(pSystem: System)
{
this.DatabaseBackendPlugin = pSystem.DatabaseBackendPlugin;
this.DatabaseVersion = pSystem.DatabaseVersion;
this.DicomAet = pSystem.DicomAet;
this.DicomPort = pSystem.DicomPort;
this.HttpPort = pSystem.HttpPort;
this.Name = pSystem.Name;
this.PluginsEnabled = pSystem.PluginsEnabled;
this.StorageAreaPlugin = pSystem.StorageAreaPlugin;
this.Version = pSystem.Version;
}
}
export class Answer
{
public AccessionNumber: string;
public PatientBirthDate: string;
public PatientID: string;
public PatientName: string;
public PatientSex: string;
public QueryRetrieveLevel: string;
public SpecificCharacterSet: string;
public StudyDate: string;
public StudyDescription: string;
public StudyInstanceUID: string;
constructor(pAnswer: Answer)
{
this.AccessionNumber = pAnswer.AccessionNumber;
this.PatientBirthDate = pAnswer.PatientBirthDate;
this.PatientID = pAnswer.PatientID;
this.PatientName = pAnswer.PatientName;
this.PatientSex = pAnswer.PatientSex;
this.QueryRetrieveLevel = pAnswer.QueryRetrieveLevel;
this.SpecificCharacterSet = pAnswer.SpecificCharacterSet;
this.StudyDate = pAnswer.StudyDate;
this.StudyDescription = pAnswer.StudyDescription;
this.StudyInstanceUID = pAnswer.StudyInstanceUID;
}
}
export class Modality {
public name: string;
public aet: string;
public ip: string;
public port: number;
public patch: string;
constructor(name: string, aet: string, ip: string, port: number, patch: string) {
this.name = name;
this.aet = aet;
this.ip = ip;
this.port = port;
this.patch = patch;
}
}
export class User {
public name: string;
public password: string;
public permissions: string[];
constructor(name: string, permissions: string[]) {
this.name = name;
this.permissions = permissions;
}
}
|
<gh_stars>0
package cz.habarta.typescript.generator;
import com.fasterxml.jackson.annotation.*;
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.*;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import cz.habarta.typescript.generator.parser.*;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Consumer;
import javax.xml.bind.annotation.XmlElement;
import org.junit.Assert;
import org.junit.Test;
public class Jackson2ParserTest {
@Test
public void test() {
final Jackson2Parser jacksonParser = getJackson2Parser();
final Class<?> bean = DummyBean.class;
final Model model = jacksonParser.parseModel(bean);
Assert.assertTrue(model.getBeans().size() > 0);
final BeanModel beanModel = model.getBeans().get(0);
Assert.assertEquals("DummyBean", beanModel.getOrigin().getSimpleName());
Assert.assertTrue(beanModel.getProperties().size() > 0);
Assert.assertEquals("firstProperty", beanModel.getProperties().get(0).getName());
}
@Test
public void testChangedNameProperty() {
final Jackson2Parser jacksonParser = getJackson2Parser();
final Model model = jacksonParser.parseModel(DummyBeanJackson2.class);
Assert.assertTrue(model.getBeans().size() > 0);
final BeanModel beanModel = model.getBeans().get(0);
Assert.assertEquals("DummyBeanJackson2", beanModel.getOrigin().getSimpleName());
Assert.assertTrue(beanModel.getProperties().size() > 0);
Assert.assertEquals("changedNameProperty", beanModel.getProperties().get(0).getName());
}
@Test
public void testConflictingJsonTypeInfoProperty() {
final Jackson2Parser jacksonParser = getJackson2Parser();
final Model model = jacksonParser.parseModel(InheritedClass.class);
Assert.assertTrue(model.getBeans().size() > 0);
final BeanModel beanModel = model.getBeans().get(0);
Assert.assertEquals(1, beanModel.getProperties().size());
}
@Test
public void testTaggedUnion() {
final Jackson2Parser jacksonParser = getJackson2Parser();
final Model model = jacksonParser.parseModel(SubTypeDiscriminatedByName1.class);
Assert.assertEquals(5, model.getBeans().size());
final BeanModel bean0 = model.getBean(ParentWithNameDiscriminant.class);
final BeanModel bean1 = model.getBean(SubTypeDiscriminatedByName1.class);
final BeanModel bean2 = model.getBean(SubTypeDiscriminatedByName2.class);
final BeanModel bean3 = model.getBean(SubTypeDiscriminatedByName3.class);
final BeanModel bean4 = model.getBean(SubTypeDiscriminatedByName4.class);
Assert.assertEquals(4, bean0.getTaggedUnionClasses().size());
Assert.assertNull(bean1.getTaggedUnionClasses());
Assert.assertNull(bean2.getTaggedUnionClasses());
Assert.assertNull(bean3.getTaggedUnionClasses());
Assert.assertEquals("kind", bean0.getDiscriminantProperty());
Assert.assertEquals("explicit-name1", bean1.getDiscriminantLiteral());
Assert.assertEquals("SubType2", bean2.getDiscriminantLiteral());
Assert.assertEquals("Jackson2ParserTest$SubTypeDiscriminatedByName3", bean3.getDiscriminantLiteral());
Assert.assertEquals("Jackson2ParserTest$SubTypeDiscriminatedByName4", bean4.getDiscriminantLiteral());
}
@Test
public void testMethodsInInterface() {
final Jackson2Parser jacksonParser = getJackson2Parser(settings -> settings.emitAbstractMethodsInBeans = true);
final Model model = jacksonParser.parseModel(InterfaceWithMethodsAndBeanProperties.class);
assertMethodsInInterface(model);
// Now let's test w/ the setting disabled
final Jackson2Parser parserNoMethods = getJackson2Parser(settings -> settings.emitAbstractMethodsInBeans = false);
final Model modelNoMethods = parserNoMethods.parseModel(InterfaceWithMethodsAndBeanProperties.class);
Assert.assertEquals(0, modelNoMethods.getBeans().get(0).getMethods().size());
}
static void assertMethodsInInterface(Model model) {
Assert.assertEquals(1, model.getBeans().size());
BeanModel beanModel = model.getBeans().get(0);
// Expect "enabled" and "name"
Assert.assertEquals(2, beanModel.getProperties().size());
// Non-deterministic order
for (PropertyModel propertyModel : beanModel.getProperties()) {
Assert.assertTrue("enabled".equals(propertyModel.getName()) || "name".equals(propertyModel.getName()));
}
Assert.assertEquals(1, beanModel.getMethods().size());
MethodModel methodModel = beanModel.getMethods().get(0);
Assert.assertEquals("callMeMaybe", methodModel.getName());
Assert.assertEquals(2, methodModel.getParameters().size());
Assert.assertEquals("java.util.List<java.lang.String>", methodModel.getParameters().get(0).getType().getTypeName());
Assert.assertEquals("arg0", methodModel.getParameters().get(0).getName());
Assert.assertEquals("arg1", methodModel.getParameters().get(1).getName());
}
static Jackson2Parser getJackson2Parser() {
return getJackson2Parser(settings -> {});
}
static Jackson2Parser getJackson2Parser(Consumer<Settings> settingsModifier) {
final Settings settings = new Settings();
settingsModifier.accept(settings);
return new Jackson2Parser(settings, new DefaultTypeProcessor());
}
public static class DummyBeanJackson2 {
@JsonProperty("changedNameProperty")
public String _changed_name_property;
}
public interface InterfaceWithMethodsAndBeanProperties {
boolean isEnabled();
String getName();
void setName(String name);
DummyBeanJackson2 callMeMaybe(List<String> sources, Map<String, Object> metadata);
}
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
public class InheritedClass {
public String type;
}
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind")
@JsonSubTypes({
@JsonSubTypes.Type(value = SubTypeDiscriminatedByName1.class, name = "SubType1"), // value from @JsonTypeName is used
@JsonSubTypes.Type(value = SubTypeDiscriminatedByName2.class, name = "SubType2"),
@JsonSubTypes.Type(value = SubTypeDiscriminatedByName3.class),
@JsonSubTypes.Type(value = SubTypeDiscriminatedByName4.class),
})
private static interface ParentWithNameDiscriminant {
}
@JsonTypeName("explicit-name1")
private static class SubTypeDiscriminatedByName1 implements ParentWithNameDiscriminant {
}
private static class SubTypeDiscriminatedByName2 implements ParentWithNameDiscriminant {
}
@JsonTypeName(/* Default should be the simplename of the class */)
private static class SubTypeDiscriminatedByName3 implements ParentWithNameDiscriminant {
}
private static class SubTypeDiscriminatedByName4 implements ParentWithNameDiscriminant {
}
public static void main(String[] args) throws JsonProcessingException {
System.out.println(new ObjectMapper().writeValueAsString(new SubTypeDiscriminatedByName1()));
System.out.println(new ObjectMapper().writeValueAsString(new SubTypeDiscriminatedByName2()));
System.out.println(new ObjectMapper().writeValueAsString(new SubTypeDiscriminatedByName3()));
System.out.println(new ObjectMapper().writeValueAsString(new SubTypeDiscriminatedByName4()));
}
@Test
public void testOptionalJsonProperty() {
final Settings settings = TestUtils.settings();
settings.optionalProperties = OptionalProperties.useLibraryDefinition;
final String output = new TypeScriptGenerator(settings).generateTypeScript(Input.from(ClassWithOptionals.class));
Assert.assertTrue(output.contains("oname1?: string"));
Assert.assertTrue(output.contains("oname2?: string"));
Assert.assertTrue(output.contains("jname1?: string"));
Assert.assertTrue(output.contains("jname2?: string"));
Assert.assertTrue(output.contains("jname3: string"));
Assert.assertTrue(output.contains("jname4: string"));
Assert.assertTrue(output.contains("xname1?: string"));
Assert.assertTrue(output.contains("xname2?: string"));
Assert.assertTrue(output.contains("xname3?: string"));
Assert.assertTrue(output.contains("xname4?: string"));
}
@Test
public void testOptionalXmlElement() {
final Settings settings = TestUtils.settings();
settings.jsonLibrary = JsonLibrary.jaxb;
settings.optionalProperties = OptionalProperties.useLibraryDefinition;
final String output = new TypeScriptGenerator(settings).generateTypeScript(Input.from(ClassWithOptionals.class));
Assert.assertTrue(output.contains("oname1?: string"));
Assert.assertTrue(output.contains("oname2?: string"));
Assert.assertTrue(output.contains("jname1?: string"));
Assert.assertTrue(output.contains("jname2?: string"));
Assert.assertTrue(output.contains("jname3?: string"));
Assert.assertTrue(output.contains("jname4?: string"));
Assert.assertTrue(output.contains("xname1?: string"));
Assert.assertTrue(output.contains("xname2?: string"));
Assert.assertTrue(output.contains("xname3: string"));
Assert.assertTrue(output.contains("xname4: string"));
}
public static class ClassWithOptionals {
public String oname1;
public Optional<String> oname2;
@JsonProperty
public String jname1;
@JsonProperty(required = false)
public String jname2;
@JsonProperty(required = true)
public String jname3;
private String jname4;
@JsonProperty(required = true)
public String getJname4() {
return jname4;
}
@XmlElement
public String xname1;
@XmlElement(required = false)
public String xname2;
@XmlElement(required = true)
public String xname3;
private String xname4;
@XmlElement(required = true)
public String getXname4() {
return xname4;
}
}
@Test
public void testStandardEnumValue() {
testEnumByType(TestEnums.StandardEnum.class, "A", "B", "C");
}
@Test
public void testStringPropertyEnumValue() {
testEnumByType(TestEnums.StringPropertyValuedEnum.class, "_A", "_B", "_C");
}
@Test
public void testNumberPropertyEnumValue() {
testEnumByType(TestEnums.NumberPropertyValuedEnum.class, 0, 1, 2);
}
@Test
public void testJsonNumberFieldValuedEnum() {
testEnumByType(TestEnums.NumberFieldValuedEnum.class, 1, 2, 3);
}
@Test
public void testJsonNumberMethodValuedEnum() {
testEnumByType(TestEnums.NumberMethodValuedEnum.class, 1, 2, 3);
}
@Test
public void testMethodEnumValue() {
testEnumByType(TestEnums.GeneralMethodValuedEnum.class, "_A", "_B", "_C");
}
@Test
public void testToStringEnumValue() {
testEnumByType(TestEnums.ToStringValuedEnum.class, "_A", "_B", "_C");
}
@Test
public void testJsonPropertyEnumValue() {
testEnumByType(TestEnums.JsonPropertyValuedEnum.class, "_A", "_B", "_C");
}
private void testEnumByType(Class<? extends Enum<?>> type, Object... expectedValues) {
final Jackson2Parser jacksonParser = getJackson2Parser();
final Model model = jacksonParser.parseModel(type);
Assert.assertEquals(1, model.getEnums().size());
final EnumModel enumModel = model.getEnums().get(0);
Assert.assertEquals(expectedValues.length, enumModel.getMembers().size());
for (int i = 0; i < expectedValues.length; i++) {
Assert.assertEquals(expectedValues[i], enumModel.getMembers().get(i).getEnumValue());
}
}
@Test
public void testIgnoredProperty() {
final Settings settings = TestUtils.settings();
final String output = new TypeScriptGenerator(settings).generateTypeScript(Input.from(ClassWithIgnoredProperty.class));
Assert.assertTrue(output.contains("name1: string"));
Assert.assertTrue(!output.contains("name2: string"));
}
private static class ClassWithIgnoredProperty {
public String name1;
@JsonIgnore
public String name2;
}
// public static void main(String[] args) throws JsonProcessingException {
// final ObjectMapper objectMapper = new ObjectMapper();
// final ClassWithIgnoredProperty instance = new ClassWithIgnoredProperty();
// instance.name1 = "xxx";
// instance.name2 = "xxx";
// System.out.println(objectMapper.writeValueAsString(instance));
// }
@Test
public void testVisibilityConfiguration() {
{
final Settings settings = TestUtils.settings();
final String output = new TypeScriptGenerator(settings).generateTypeScript(Input.from(ClassWithDifferentMemberVisibilities.class));
Assert.assertTrue(!output.contains("property1: string"));
Assert.assertTrue(output.contains("property2: string"));
}
{
final Settings settings = TestUtils.settings();
settings.jackson2Configuration = new Jackson2ConfigurationResolved();
settings.jackson2Configuration.setVisibility(ANY, NONE, NONE, NONE, NONE);
final String output = new TypeScriptGenerator(settings).generateTypeScript(Input.from(ClassWithDifferentMemberVisibilities.class));
Assert.assertTrue(output.contains("property1: string"));
Assert.assertTrue(!output.contains("property2: string"));
}
}
private static class ClassWithDifferentMemberVisibilities {
private String property1;
public String getProperty2() {
return null;
}
}
@Test
public void testJsonNode() {
final Settings settings = TestUtils.settings();
final String output = new TypeScriptGenerator(settings).generateTypeScript(Input.from(ClassWithJsonNode.class));
Assert.assertTrue(output.contains("node: any"));
Assert.assertTrue(output.contains("nodes: any[]"));
}
private static class ClassWithJsonNode {
public JsonNode node;
public List<JsonNode> nodes;
}
@Test
public void testDescriptions() {
final Settings settings = TestUtils.settings();
settings.mapEnum = EnumMapping.asEnum;
final String output = new TypeScriptGenerator(settings).generateTypeScript(Input.from(ClassWithDescriptions.class, EnumWithDescriptions.class));
Assert.assertTrue(output.contains("Class description"));
Assert.assertTrue(output.contains("Property description"));
Assert.assertTrue(output.contains("second line"));
Assert.assertTrue(output.contains("Enum description"));
Assert.assertTrue(output.contains("Enum constant description"));
}
@JsonClassDescription("Class description\nsecond line")
private static class ClassWithDescriptions {
@JsonPropertyDescription("Property description\nsecond line")
public String value;
}
@JsonClassDescription("Enum description")
private static enum EnumWithDescriptions {
@JsonPropertyDescription("Enum constant description")
Empty
}
}
|
Increase in receptor-like protein tyrosine phosphatase activity and expression level on density-dependent growth arrest of endothelial cells. Protein tyrosine phosphatase (PTPase) activity was examined in two cell lines: human umbilical vein endothelial (HUVE) cells, which display contact inhibition of cell growth, and A427 human adenocarcinoma cells, which have lost this ability. HUVE cells harvested at high density displayed a 10-fold increase in membrane-associated PTPase activity. A427 cells exhibited no such phenomenon. Moreover, modification of HUVE cell growth rate by a stimulating agent such as basic fibroblast growth factor or by blocking compounds such as thymidine or suramin resulted in no change in PTPase activity, suggesting that the observed increase in membrane-associated activity at confluency was specific for cell-cell-contact-directed growth arrest. The expression of various PTPase mRNAs was examined in HUVE and A427 cells. Of the receptor-like PTPases tested, two were exclusively expressed in HUVE cells (PTP gamma and HPTP beta). Only HPTP beta, which is structurally similar in its extracellular region to cell-adhesion receptors of the immunoglobulin superfamily, displayed a pattern of expression related to the increase in PTPase activity. Competitive PCR was used to quantify its expression during cell culture. A 12-fold increase in HPTP beta mRNA expression was detected and it parallelled the time course of PTPase activity. This observation strongly implicates receptor-like PTPases in density-dependent growth arrest. |
Effects of loxiglumide on pancreatic exocrine secretion stimulated by meal in conscious dogs. The effects of loxiglumide (CAS 107097-80-3, CR 1505), a novel cholecystokinin-A(CCK-A) receptor antagonist, on pancreatic exocrine secretion stimulated by meal were examined in conscious dogs with chronic pancreatic fistula. Pancreatic exocrine secretion was stimulated by intraduodenal infusion of a liquid test meal and postprandial plasma CCK levels were apparently elevated. Loxiglumide inhibited the meal-stimulated outputs of pancreatic protein, amylase and bicarbonate at an intravenous dose of 10 mg/kg/h (p < 0.05). However, loxiglumide did not show apparent inhibition of pancreatic juice volume and trypsin output. These results show that the selective CCK-A antagonist loxiglumide may inhibit the increase of pancreatic exocrine secretion based on selective blockade of receptor binding of CCK endogenously induced by meal in dogs. |
// NewDecoder creates a new Decoder instance based on an io.Reader.
func NewDecoder(rd io.Reader, decoder func() transform.Transformer) *Decoder {
return &Decoder{
rd: rd,
b: make([]byte, readScratchSize),
tr: decoder(),
}
} |
<reponame>Crupette/Gewirrenth
#ifndef FONTRENDERER_H
#define FONTRENDERER_H
#include <SDL2/SDL_ttf.h>
#include <GL/glew.h>
#include <string>
#include <unordered_map>
#include "SpriteBatch.h"
class FontRenderer
{
public:
struct Glyph {
Glyph() : minx(0), maxx(0), miny(0), maxy(0), texture(0) {}
~Glyph() {}
int minx, maxx, miny, maxy, advance;
int width, height;
GLuint texture;
};
FontRenderer();
~FontRenderer();
void init(const std::string& path, unsigned int size);
void destroy();
void setText(const std::string& text, const glm::vec2& position, const glm::vec2& scale);
void render();
private:
TTF_Font* m_font;
SpriteBatch m_batch;
unsigned int m_size;
std::unordered_map<char, Glyph> m_allGlyphs;
};
#endif
|
"""Pauli operators and states"""
from sympy import I, Mul, Add, Pow, exp, Integer
from sympy.physics.quantum import Operator, Ket, Bra
from sympy.physics.quantum import ComplexSpace
from sympy.matrices import Matrix
from sympy.functions.special.tensor_functions import KroneckerDelta
__all__ = [
'SigmaX', 'SigmaY', 'SigmaZ', 'SigmaMinus', 'SigmaPlus', 'SigmaZKet',
'SigmaZBra', 'qsimplify_pauli'
]
class SigmaOpBase(Operator):
"""Pauli sigma operator, base class"""
@property
def name(self):
return self.args[0]
@property
def use_name(self):
return bool(self.args[0]) is not False
@classmethod
def default_args(self):
return (False,)
def __new__(cls, *args, **hints):
return Operator.__new__(cls, *args, **hints)
def _eval_commutator_BosonOp(self, other, **hints):
return Integer(0)
class SigmaX(SigmaOpBase):
"""Pauli sigma x operator
Parameters
==========
name : str
An optional string that labels the operator. Pauli operators with
different names commute.
Examples
========
>>> from sympy.physics.quantum import represent
>>> from sympy.physics.quantum.pauli import SigmaX
>>> sx = SigmaX()
>>> sx
SigmaX()
>>> represent(sx)
Matrix([
[0, 1],
[1, 0]])
"""
def __new__(cls, *args, **hints):
return SigmaOpBase.__new__(cls, *args, **hints)
def _eval_commutator_SigmaY(self, other, **hints):
if self.name != other.name:
return Integer(0)
else:
return 2 * I * SigmaZ(self.name)
def _eval_commutator_SigmaZ(self, other, **hints):
if self.name != other.name:
return Integer(0)
else:
return - 2 * I * SigmaY(self.name)
def _eval_commutator_BosonOp(self, other, **hints):
return Integer(0)
def _eval_anticommutator_SigmaY(self, other, **hints):
return Integer(0)
def _eval_anticommutator_SigmaZ(self, other, **hints):
return Integer(0)
def _eval_adjoint(self):
return self
def _print_contents_latex(self, printer, *args):
if self.use_name:
return r'{\sigma_x^{(%s)}}' % str(self.name)
else:
return r'{\sigma_x}'
def _print_contents(self, printer, *args):
return 'SigmaX()'
def _eval_power(self, e):
if e.is_Integer and e.is_positive:
return SigmaX(self.name).__pow__(int(e) % 2)
def _represent_default_basis(self, **options):
format = options.get('format', 'sympy')
if format == 'sympy':
return Matrix([[0, 1], [1, 0]])
else:
raise NotImplementedError('Representation in format ' +
format + ' not implemented.')
class SigmaY(SigmaOpBase):
"""Pauli sigma y operator
Parameters
==========
name : str
An optional string that labels the operator. Pauli operators with
different names commute.
Examples
========
>>> from sympy.physics.quantum import represent
>>> from sympy.physics.quantum.pauli import SigmaY
>>> sy = SigmaY()
>>> sy
SigmaY()
>>> represent(sy)
Matrix([
[0, -I],
[I, 0]])
"""
def __new__(cls, *args, **hints):
return SigmaOpBase.__new__(cls, *args)
def _eval_commutator_SigmaZ(self, other, **hints):
if self.name != other.name:
return Integer(0)
else:
return 2 * I * SigmaX(self.name)
def _eval_commutator_SigmaX(self, other, **hints):
if self.name != other.name:
return Integer(0)
else:
return - 2 * I * SigmaZ(self.name)
def _eval_anticommutator_SigmaX(self, other, **hints):
return Integer(0)
def _eval_anticommutator_SigmaZ(self, other, **hints):
return Integer(0)
def _eval_adjoint(self):
return self
def _print_contents_latex(self, printer, *args):
if self.use_name:
return r'{\sigma_y^{(%s)}}' % str(self.name)
else:
return r'{\sigma_y}'
def _print_contents(self, printer, *args):
return 'SigmaY()'
def _eval_power(self, e):
if e.is_Integer and e.is_positive:
return SigmaY(self.name).__pow__(int(e) % 2)
def _represent_default_basis(self, **options):
format = options.get('format', 'sympy')
if format == 'sympy':
return Matrix([[0, -I], [I, 0]])
else:
raise NotImplementedError('Representation in format ' +
format + ' not implemented.')
class SigmaZ(SigmaOpBase):
"""Pauli sigma z operator
Parameters
==========
name : str
An optional string that labels the operator. Pauli operators with
different names commute.
Examples
========
>>> from sympy.physics.quantum import represent
>>> from sympy.physics.quantum.pauli import SigmaZ
>>> sz = SigmaZ()
>>> sz ** 3
SigmaZ()
>>> represent(sz)
Matrix([
[1, 0],
[0, -1]])
"""
def __new__(cls, *args, **hints):
return SigmaOpBase.__new__(cls, *args)
def _eval_commutator_SigmaX(self, other, **hints):
if self.name != other.name:
return Integer(0)
else:
return 2 * I * SigmaY(self.name)
def _eval_commutator_SigmaY(self, other, **hints):
if self.name != other.name:
return Integer(0)
else:
return - 2 * I * SigmaX(self.name)
def _eval_anticommutator_SigmaX(self, other, **hints):
return Integer(0)
def _eval_anticommutator_SigmaY(self, other, **hints):
return Integer(0)
def _eval_adjoint(self):
return self
def _print_contents_latex(self, printer, *args):
if self.use_name:
return r'{\sigma_z^{(%s)}}' % str(self.name)
else:
return r'{\sigma_z}'
def _print_contents(self, printer, *args):
return 'SigmaZ()'
def _eval_power(self, e):
if e.is_Integer and e.is_positive:
return SigmaZ(self.name).__pow__(int(e) % 2)
def _represent_default_basis(self, **options):
format = options.get('format', 'sympy')
if format == 'sympy':
return Matrix([[1, 0], [0, -1]])
else:
raise NotImplementedError('Representation in format ' +
format + ' not implemented.')
class SigmaMinus(SigmaOpBase):
"""Pauli sigma minus operator
Parameters
==========
name : str
An optional string that labels the operator. Pauli operators with
different names commute.
Examples
========
>>> from sympy.physics.quantum import represent, Dagger
>>> from sympy.physics.quantum.pauli import SigmaMinus
>>> sm = SigmaMinus()
>>> sm
SigmaMinus()
>>> Dagger(sm)
SigmaPlus()
>>> represent(sm)
Matrix([
[0, 0],
[1, 0]])
"""
def __new__(cls, *args, **hints):
return SigmaOpBase.__new__(cls, *args)
def _eval_commutator_SigmaX(self, other, **hints):
if self.name != other.name:
return Integer(0)
else:
return -SigmaZ(self.name)
def _eval_commutator_SigmaY(self, other, **hints):
if self.name != other.name:
return Integer(0)
else:
return I * SigmaZ(self.name)
def _eval_commutator_SigmaZ(self, other, **hints):
return 2 * self
def _eval_commutator_SigmaMinus(self, other, **hints):
return SigmaZ(self.name)
def _eval_anticommutator_SigmaZ(self, other, **hints):
return Integer(0)
def _eval_anticommutator_SigmaX(self, other, **hints):
return Integer(1)
def _eval_anticommutator_SigmaY(self, other, **hints):
return - I * Integer(1)
def _eval_anticommutator_SigmaPlus(self, other, **hints):
return Integer(1)
def _eval_adjoint(self):
return SigmaPlus(self.name)
def _eval_power(self, e):
if e.is_Integer and e.is_positive:
return Integer(0)
def _print_contents_latex(self, printer, *args):
if self.use_name:
return r'{\sigma_-^{(%s)}}' % str(self.name)
else:
return r'{\sigma_-}'
def _print_contents(self, printer, *args):
return 'SigmaMinus()'
def _represent_default_basis(self, **options):
format = options.get('format', 'sympy')
if format == 'sympy':
return Matrix([[0, 0], [1, 0]])
else:
raise NotImplementedError('Representation in format ' +
format + ' not implemented.')
class SigmaPlus(SigmaOpBase):
"""Pauli sigma plus operator
Parameters
==========
name : str
An optional string that labels the operator. Pauli operators with
different names commute.
Examples
========
>>> from sympy.physics.quantum import represent, Dagger
>>> from sympy.physics.quantum.pauli import SigmaPlus
>>> sp = SigmaPlus()
>>> sp
SigmaPlus()
>>> Dagger(sp)
SigmaMinus()
>>> represent(sp)
Matrix([
[0, 1],
[0, 0]])
"""
def __new__(cls, *args, **hints):
return SigmaOpBase.__new__(cls, *args)
def _eval_commutator_SigmaX(self, other, **hints):
if self.name != other.name:
return Integer(0)
else:
return SigmaZ(self.name)
def _eval_commutator_SigmaY(self, other, **hints):
if self.name != other.name:
return Integer(0)
else:
return I * SigmaZ(self.name)
def _eval_commutator_SigmaZ(self, other, **hints):
if self.name != other.name:
return Integer(0)
else:
return -2 * self
def _eval_commutator_SigmaMinus(self, other, **hints):
return SigmaZ(self.name)
def _eval_anticommutator_SigmaZ(self, other, **hints):
return Integer(0)
def _eval_anticommutator_SigmaX(self, other, **hints):
return Integer(1)
def _eval_anticommutator_SigmaY(self, other, **hints):
return I * Integer(1)
def _eval_anticommutator_SigmaMinus(self, other, **hints):
return Integer(1)
def _eval_adjoint(self):
return SigmaMinus(self.name)
def _eval_mul(self, other):
return self * other
def _eval_power(self, e):
if e.is_Integer and e.is_positive:
return Integer(0)
def _print_contents_latex(self, printer, *args):
if self.use_name:
return r'{\sigma_+^{(%s)}}' % str(self.name)
else:
return r'{\sigma_+}'
def _print_contents(self, printer, *args):
return 'SigmaPlus()'
def _represent_default_basis(self, **options):
format = options.get('format', 'sympy')
if format == 'sympy':
return Matrix([[0, 1], [0, 0]])
else:
raise NotImplementedError('Representation in format ' +
format + ' not implemented.')
class SigmaZKet(Ket):
"""Ket for a two-level system quantum system.
Parameters
==========
n : Number
The state number (0 or 1).
"""
def __new__(cls, n):
if n not in [0, 1]:
raise ValueError("n must be 0 or 1")
return Ket.__new__(cls, n)
@property
def n(self):
return self.label[0]
@classmethod
def dual_class(self):
return SigmaZBra
@classmethod
def _eval_hilbert_space(cls, label):
return ComplexSpace(2)
def _eval_innerproduct_SigmaZBra(self, bra, **hints):
return KroneckerDelta(self.n, bra.n)
def _apply_operator_SigmaZ(self, op, **options):
if self.n == 0:
return self
else:
return Integer(-1) * self
def _apply_operator_SigmaX(self, op, **options):
return SigmaZKet(1) if self.n == 0 else SigmaZKet(0)
def _apply_operator_SigmaY(self, op, **options):
return I * SigmaZKet(1) if self.n == 0 else (-I) * SigmaZKet(0)
def _apply_operator_SigmaMinus(self, op, **options):
if self.n == 0:
return SigmaZKet(1)
else:
return Integer(0)
def _apply_operator_SigmaPlus(self, op, **options):
if self.n == 0:
return Integer(0)
else:
return SigmaZKet(0)
def _represent_default_basis(self, **options):
format = options.get('format', 'sympy')
if format == 'sympy':
return Matrix([[1], [0]]) if self.n == 0 else Matrix([[0], [1]])
else:
raise NotImplementedError('Representation in format ' +
format + ' not implemented.')
class SigmaZBra(Bra):
"""Bra for a two-level quantum system.
Parameters
==========
n : Number
The state number (0 or 1).
"""
def __new__(cls, n):
if n not in [0, 1]:
raise ValueError("n must be 0 or 1")
return Bra.__new__(cls, n)
@property
def n(self):
return self.label[0]
@classmethod
def dual_class(self):
return SigmaZKet
def _qsimplify_pauli_product(a, b):
"""
Internal helper function for simplifying products of Pauli operators.
"""
if not (isinstance(a, SigmaOpBase) and isinstance(b, SigmaOpBase)):
return Mul(a, b)
if a.name != b.name:
# Pauli matrices with different labels commute; sort by name
if a.name < b.name:
return Mul(a, b)
else:
return Mul(b, a)
elif isinstance(a, SigmaX):
if isinstance(b, SigmaX):
return Integer(1)
if isinstance(b, SigmaY):
return I * SigmaZ(a.name)
if isinstance(b, SigmaZ):
return - I * SigmaY(a.name)
if isinstance(b, SigmaMinus):
return (Integer(1)/2 + SigmaZ(a.name)/2)
if isinstance(b, SigmaPlus):
return (Integer(1)/2 - SigmaZ(a.name)/2)
elif isinstance(a, SigmaY):
if isinstance(b, SigmaX):
return - I * SigmaZ(a.name)
if isinstance(b, SigmaY):
return Integer(1)
if isinstance(b, SigmaZ):
return I * SigmaX(a.name)
if isinstance(b, SigmaMinus):
return -I * (Integer(1) + SigmaZ(a.name))/2
if isinstance(b, SigmaPlus):
return I * (Integer(1) - SigmaZ(a.name))/2
elif isinstance(a, SigmaZ):
if isinstance(b, SigmaX):
return I * SigmaY(a.name)
if isinstance(b, SigmaY):
return - I * SigmaX(a.name)
if isinstance(b, SigmaZ):
return Integer(1)
if isinstance(b, SigmaMinus):
return - SigmaMinus(a.name)
if isinstance(b, SigmaPlus):
return SigmaPlus(a.name)
elif isinstance(a, SigmaMinus):
if isinstance(b, SigmaX):
return (Integer(1) - SigmaZ(a.name))/2
if isinstance(b, SigmaY):
return - I * (Integer(1) - SigmaZ(a.name))/2
if isinstance(b, SigmaZ):
# (SigmaX(a.name) - I * SigmaY(a.name))/2
return SigmaMinus(b.name)
if isinstance(b, SigmaMinus):
return Integer(0)
if isinstance(b, SigmaPlus):
return Integer(1)/2 - SigmaZ(a.name)/2
elif isinstance(a, SigmaPlus):
if isinstance(b, SigmaX):
return (Integer(1) + SigmaZ(a.name))/2
if isinstance(b, SigmaY):
return I * (Integer(1) + SigmaZ(a.name))/2
if isinstance(b, SigmaZ):
#-(SigmaX(a.name) + I * SigmaY(a.name))/2
return -SigmaPlus(a.name)
if isinstance(b, SigmaMinus):
return (Integer(1) + SigmaZ(a.name))/2
if isinstance(b, SigmaPlus):
return Integer(0)
else:
return a * b
def qsimplify_pauli(e):
"""
Simplify an expression that includes products of pauli operators.
Parameters
==========
e : expression
An expression that contains products of Pauli operators that is
to be simplified.
Examples
========
>>> from sympy.physics.quantum.pauli import SigmaX, SigmaY
>>> from sympy.physics.quantum.pauli import qsimplify_pauli
>>> sx, sy = SigmaX(), SigmaY()
>>> sx * sy
SigmaX()*SigmaY()
>>> qsimplify_pauli(sx * sy)
I*SigmaZ()
"""
if isinstance(e, Operator):
return e
if isinstance(e, (Add, Pow, exp)):
t = type(e)
return t(*(qsimplify_pauli(arg) for arg in e.args))
if isinstance(e, Mul):
c, nc = e.args_cnc()
nc_s = []
while nc:
curr = nc.pop(0)
while (len(nc) and
isinstance(curr, SigmaOpBase) and
isinstance(nc[0], SigmaOpBase) and
curr.name == nc[0].name):
x = nc.pop(0)
y = _qsimplify_pauli_product(curr, x)
c1, nc1 = y.args_cnc()
curr = Mul(*nc1)
c = c + c1
nc_s.append(curr)
return Mul(*c) * Mul(*nc_s)
return e
|
# -*- coding: utf-8 -*-
import unittest.mock
import pytest
import pycamunda.processdef
import pycamunda.incident
from tests.mock import raise_requests_exception_mock, not_ok_response_mock, response_mock
def test_delete_params(engine_url):
delete_definition = pycamunda.processdef.Delete(
url=engine_url, id_='anId', cascade=True, skip_custom_listeners=True, skip_io_mappings=True
)
assert delete_definition.url == engine_url + '/process-definition/anId'
assert delete_definition.query_parameters() == {
'cascade': 'true', 'skipCustomListeners': 'true', 'skipIoMappings': 'true'
}
assert delete_definition.body_parameters() == {}
def test_delete_path(engine_url):
delete_definition_id = pycamunda.processdef.Delete(url=engine_url, id_='anId')
delete_definition_key = pycamunda.processdef.Delete(url=engine_url, key='aKey')
delete_definition_tenant = pycamunda.processdef.Delete(
url=engine_url, key='aKey', tenant_id='aTenantId'
)
assert delete_definition_id.url == engine_url + '/process-definition/anId'
assert delete_definition_key.url == engine_url + '/process-definition/key/aKey'
assert delete_definition_tenant.url == engine_url + '/process-definition/key/aKey' \
'/tenant-id/aTenantId'
@unittest.mock.patch('requests.Session.request')
def test_delete_calls_requests(mock, engine_url):
delete_definition = pycamunda.processdef.Delete(url=engine_url, id_='anId')
delete_definition()
assert mock.called
assert mock.call_args[1]['method'].upper() == 'DELETE'
@unittest.mock.patch('requests.Session.request', raise_requests_exception_mock)
def test_delete_raises_pycamunda_exception(engine_url):
delete_definition = pycamunda.processdef.Delete(url=engine_url, id_='anId')
with pytest.raises(pycamunda.PyCamundaException):
delete_definition()
@unittest.mock.patch('requests.Session.request', not_ok_response_mock)
@unittest.mock.patch('pycamunda.base._raise_for_status')
def test_delete_raises_for_status(mock, engine_url):
delete_definition = pycamunda.processdef.Delete(url=engine_url, id_='anId')
delete_definition()
assert mock.called
@unittest.mock.patch('requests.Session.request', response_mock)
def test_delete_returns_none(engine_url):
delete_definition = pycamunda.processdef.Delete(url=engine_url, id_='anId')
result = delete_definition()
assert result is None
|
Insights From Molecular Dynamics Simulations of a Number of G-Protein Coupled Receptor Targets for the Treatment of Pain and Opioid Use Disorders Effective treatments for pain management remain elusive due to the dangerous side-effects of current gold-standard opioid analgesics, including the respiratory depression that has led to skyrocketing death rates from opioid overdoses over the past decade. In an attempt to address the horrific opioid crisis worldwide, the National Institute on Drug Abuse has recently proposed boosting research on specific pharmacological mechanisms mediated by a number of G protein-coupled receptors (GPCRs). This research is expected to expedite the discovery of medications for opioid overdose and opioid use disorders, leading toward a safer and more effective treatment of pain. Here, we review mechanistic insights from recent all-atom molecular dynamics simulations of a specific subset of GPCRs for which high-resolution experimental structures are available, including opioid, cannabinoid, orexin, metabotropic glutamate, and dopamine receptor subtypes. INTRODUCTION Pain is a vital, albeit unpleasant, physiological response to tissue damage, but it can become a disease if it strikes in the absence of tissue injury, or continues long after appropriate tissue healing (). As a disease, pain poses an enormous socioeconomic burden on the people who suffer from it, as well as a huge financial strain worldwide. There are several different ways to categorize pain (e.g., chronic, nociceptive, neuropathic, etc.) and treatment decisions depend on the specific type of pain (). For severe and chronic pain, the gold-standard painkillers remain opioid drugs, despite their dangerous side effects and abuse liability. Overprescription of opioid analgesics in the nineties led to drug misuse, and the consequent "opioid epidemic" or "opioid crisis" in the United States, which has most recently expanded to heroin and other illicit synthetic opioids such as fentanyl and its analogs (). With an average of 130 Americans dying every day (Centers for Disease Control and Prevention , 2017), new scientific solutions are desperately needed to effectively manage pain while preventing or treating overdose and opioid use disorder (OUD) manifestations. This recognition recently led the leadership of the National Institutes of Health (NIH) and the National Institutes on Drug Abuse (NIDA) to launch initiatives aimed at accelerating the pace of scientific inquiry that is necessary to address the opioid crisis. One of these initiatives enabled the prioritization of specific mechanisms and pharmacological targets whose study is expected to boost the development of novel drugs that have the highest probability of approval by the Food and Drug Administration (FDA) for the treatment of opioid overdose and OUD (). These "most wanted" mechanisms and targets (), which include several G protein-coupled receptors (GPCRs), were established based on published data and internal studies that the NIDA leadership deemed most promising for the development of improved therapeutics for OUDs. In the classical view of GPCR-mediated downstream cellular signaling, the receptor transitions into active conformational states which are capable of recruiting and ultimately activating intracellular protein transducers such a G-proteins and arrestins. These active states are characterized by specific conformational changes at the intracellular end of the receptor, most notably exemplified by a different extent of outward movement of transmembrane helix 6 (TM6) away from TM3 (e.g., see experimentally determined inactive and active structures of a prototypic GPCR compared to intermediate states in Figure 1). Typically, GPCR activation is mediated by the binding of agonist ligands at the so-called orthosteric binding site, which is the same site where endogenous ligands bind. Antagonist and inverse agonist ligands, on the other hand, shift the conformational equilibrium toward inactive conformations of the receptor while partial agonists are expected to stabilize intermediate conformations between inactive and active states of the receptor. For years, drug design at GPCRs has mostly been focused on optimizing ligands for the receptor orthosteric site. However, by binding non-conserved regions of the receptor and directly affecting the binding and/or efficacy of orthosteric ligands, so-called positive and negative allosteric modulators (PAMs and NAMs, respectively) are receiving more and more attention for the development of improved therapeutics targeting GPCRs. Similarly, so-called biased agonists hold a great potential for drug discovery since they would stabilize receptor conformations that selectively recruit an intracellular protein instead of another, thereby triggering specific biological effects. Figure 2 provides a cartoon depiction of the expected effect of the different types of ligands on the receptor. One of the main obstacles to the development of new therapeutics for pain management or to treat or prevent opioid overdose or OUDs is the limited understanding of the relevant signal transduction mechanisms at the atomic level notwithstanding the recognized role of a number of GPCRs in the regulation of pain transmission and OUD manifestations, as well as the availability of high-resolution experimental structures for several of these GPCRs. Molecular dynamics (MD) simulations can provide a complementary perspective (Ribeiro and Filizola, 2019) on the molecular determinants underlying GPCRmediated signaling mechanisms involved in pain transmission, respiratory depression, or clinical manifestations of OUD. Availability of more powerful hardware and software has made the use of MD simulations more affordable and available to a larger number of scientists. It is now straightforward for numerous groups to simulate timescales in the microsecond (s) regime using high-performance computing resources accessible to a large number of academic institutions. Using either standard or enhanced MD simulations, the latter to access even longer timescales or a more extensive sampling, GPCRs are studied in terms of an ensemble of conformations between fully active and inactive states, with a number of factors, such as binding of ligands, lipids, ions, receptors, or intracellular proteins, shifting the equilibrium toward different states. While we refer the reader elsewhere for an overview of strengths and limitations of MD simulations in their application to GPCRs (e.g., Ribeiro and Filizola, 2019), we review here atomically detailed mechanistic insights from MD simulations of high-resolution experimental structures of a number of GPCR subtypes whose study might lead to faster development of medications for the treatment of pain or OUDs (see Table 1 for a summary of all the MD studies reported herein). These GPCRs include opioid, cannabinoid, orexin, metabotropic glutamate, and dopamine receptor subtypes regulating distinctive pharmacological mechanisms. The position of the co-crystallized ligands in the respective high-resolution experimental structures used as a starting point for the MD simulations referenced herein is shown in Figure 3. SYNOPSIS OF MD SIMULATION METHODS CITED HEREIN The goal of this section is not to describe in detail the MD simulation methods and tools cited in this review, but rather provide a lay summary for the general audience. Interested readers are referred to the appropriate reviews, cited below, where the methods are described more thoroughly. The aim of an MD simulation is to provide the time-evolution of a system by solving the appropriate equation(s) of motion. In these equations, the energy interactions between the particles of the system under study must be described. In principle, atomiclevel interactions should be handled using quantum mechanics; however, due to the size of typical biological systems, it is often unfeasible to use the fully quantum description, and classical mechanics is used instead (). The typical approach to modeling these interactions is to describe bonded and non-bonded atomic interactions by simple expressions, with different parameters in these expressions representing different atom types (;Ponder and Case, 2003;;Nerenberg and Head-Gordon, 2018). The determination of an accurate set of parameters for use in these expressions purple, relative to the experimentally determined MOP receptor inactive and active states (light and dark gray, respectively). Note that the most dramatic differences between these conformations stem from the extent of outward movement of TM6 away from TM3, which is one of the most notable conformational changes that has been associated with receptor activation. Images on the right correspond to a 90 rotation of the receptor helical bundle, and represent the view from the intracellular domain. (the so-called force field) is key to properly describe atomic interactions within biological systems, and it is therefore an intensive area of research. In the following sections, we will mention several different force fields that are currently available to the MD practitioner and have been used in the studies reported here, including those corresponding to the names of Assisted Model Building and Energy Refinement (AMBER) (), Chemistry at Harvard Macromolecular Mechanics (CHARMM) (), General Amber force field (GAFF) (), CHARMM General Force Field (CGenFF) (), etc. In addition, tools such as General Automated Atomic Model Parametrization (GAAMP) (Huang and Roux, 2013) have been developed to automatically generate force field parameters for small molecules not accurately described by the aforementioned force fields. One of the major obstacles in using MD simulations for investigating biological problems is that the timescale for sampling the event of interest is often larger than the times that can be simulated (). While the microsecond (s) regime is nowadays accessible to a large number of MD practitioners, most biological events fall above that threshold (;. Enhanced sampling methods are designed to provide a faster exploration of the conformational space of the system under study. In this review, we report on studies carried out using two classes of enhanced sampling MD methods. One of these classes, exemplified by metadynamics and Gaussian accelerated molecular dynamics (GaMD) simulations, uses an artificial biasing force to speed up the rate at which the process of interest is sampled, and so long as this is done in a careful manner, the effect of the "bias" can be "reweighed" to recover "unbiased" information. The other class of enhanced sampling MD simulations is exemplified by adaptive sampling protocols, in which successive batches of simulations are started from regions of conformational space FIGURE 2 | A cartoon representation of the effects of different ligands on a GPCR. The cooperativity between allosteric and orthosteric ligands can shift their affinities for the receptor, and/or bias the GPCR coupling to a particular intracellular partner. that have been undersampled, thus accelerating the sampling of important, but slow, events (Husic and Pande, 2018;. Throughout the remainder of this review we refer to unbiased MD as simulations in which trajectories are propagated without the help of enhanced sampling techniques, although adaptive sampling techniques are, in principle, not biased (Husic and Pande, 2018). OPIOID RECEPTORS Overdose deaths by prescription, illegal, or synthetic opioids have mostly been attributed to the activation of the MOP receptor, a rhodopsin-like (class A) GPCR located, in part, on brainstem neurons that control respiration. In an attempt to develop improved opioid therapeutics with limited respiratory depression and other unwanted side effects (), attention has recently shifted to G protein-biased agonists of the MOP receptor. These MOP receptor ligands are believed to produce anti-nociceptive action by stabilizing a receptor conformation that preferentially activates G-protein over -arrestin, the latter shown to be linked to unwanted side effects (;). Recent MD simulations have been leveraged to reveal the molecular details behind G-protein biased agonism at the MOP receptor (;;). In particular, oliceridine, also known as TRV-130, a G protein-biased MOP receptor ligand that reached phase III clinical trials for management of moderate to severe pain (), has been the subject of a number of MD simulations (;;). Our group, for instance, investigated the binding of TRV-130 from the bulk solvent to the MOP receptor, as well as its preferred mode of interaction at the crystallographically identified orthosteric binding site, using ∼44 s of unbiased all-atom MD simulations (). These MD simulations had the MOP receptor placed in a 1-palmitoyl-2-oleoyl-sn-glycero-3-phosphocholine (POPC)/cholesterol lipid membrane environment and used the CHARMM36 force-field to represent the protein and lipid molecules, and CGenFF for the TRV-130 ligand. The results of these simulations suggested that intermediate binding states of TRV-130 at the so-called vestibule region of the MOP receptor directed ligand access to the orthosteric site, and that two energetically indistinguishable conformations could be adopted in the orthosteric binding pocket. Additional microsecond-scale, unbiased simulations of the MOP receptor bound to TRV-130 or the classical orthosteric opioid drug morphine () suggested differences in the allosteric coupling between the MOP receptor orthosteric site and the receptor intracellular region induced by the two different ligands. Notably, we found that residues in direct or water-mediated contact with either ligand did not exhibit a main role in the communication between the orthosteric binding site and the intracellular region of the MOP receptor, notwithstanding their contribution to stable ligand binding at the orthosteric pocket. In addition, unlike the morphinebound receptor, in which the most contributing residues to the allosteric coupling between the orthosteric binding site and the intracellular region of the MOP receptor resided in both transmembrane (TM) helices TM3 and TM6, the TRV-130 complex did not have strong contributors to the co-information in TM6 (). To obtain a more thorough investigation of the molecular details of ligand-induced MOP receptor activation, we recently built a Markov state model (MSM) using over 400 s of MD simulations of the MOP receptor embedded in a POPC/cholesterol membrane mimetic environment with either morphine or TRV-130 bound at the orthosteric binding site (). Here, the CHARMM36 and CGenFF forcefields were also used. The MSM revealed that the conformational landscape of the MOP receptor in complex with either ligand contained several kinetic macrostates (i.e., metastable states) in addition to those corresponding to crystal-like active or inactive conformations of the receptor, defining two different intermediate regions of the conformational space for each ligand-MOP complex. These regions contained different conformational states stabilized by morphine or TRV-130, which may or may not get ever resolved experimentally and yet be useful for the rational design of improved opioids with reduced side effects. Shown as an example in Figure 1 are representative conformations of the most probable metastable states within the intermediate regions available to the simulated morphine-bound and TRV130-bound MOP complexes compared to active or inactive crystallographic states of MOP, which are characterized by a different extent of TM6 outward movement. Another important observation of this MSM analysis was the existence of different activation/deactivation pathways induced by the classical or G protein-biased opioid ligand, which confirmed the substantial difference in the receptor dynamics induced by the two different ligands. In a recent investigation, unbiased MD simulations were used to study the MOP receptor in a ligand-free form, as well as in complex with TRV-130, the agonist BU72, the antagonist naltrexone (NTX), or the antagonist -FNA. These simulations were each run for 300 ns with the MOP receptor embedded in a POPC membrane environment, the ligands parameters derived from CGenFF, and both the lipid and receptor molecules described by CHARMM36 force field parameters. Notably, simulations of the TRV-130-MOP receptor complex drew attention to two residues in TM6 and TM7, specifically, Y326 7.43 and W293 6.48, which had been shown to be important for MOP receptor biased signaling by mutagenesis studies. Superscript residue numbers here and throughout the text refer to the Ballesteros-Weinstein generic numbering scheme (Ballesteros and Weinstein, 1995) wherein the first digit corresponds to the transmembrane helix number and the second digit is a sequence number relative to the most conserved residue in a helix, which is assigned a value of 50. However, corrections to this numbering scheme incorporating structural information have been proposed () and will be reported in parenthesis for those residues whose numbering may diverge from Ballesteros-Weinstein's, such as Y326 7.43 (renumbered Y326 7.42 by ). Similar to MOP receptor agonists, centrally acting KOP receptor agonists can be effective in the treatment of pain, but their dysphoric and hallucinogenic side effects have limited their clinical usefulness (), shifting focus to the development of peripherally restricted KOP agonists as analgesics with reduced abuse liability () or KOP antagonists for the treatment of substance use disorders (Carlezon and Krystal, 2016). The structural basis of agonism or antagonism at the MOP and KOP receptors has recently been studied using unbiased all-atom MD simulations (). A total of four ligand-opioid receptor complexes embedded in a POPC membrane environment were simulated, including the KOP receptor in complex with the JDTic antagonist, the MOP receptor complexed with the agonist morphine, and either the MOP or KOP receptor in complex with levallorphan, a morphinan ligand acting as an antagonist at the MOP receptor and an agonist at the KOP receptor (). The simulations -each 3 s in lengthmade use of CGenFF in their description of the ligands, and the CHARMM36 force field for all remaining molecules. In these simulations, the authors found that the amount of water penetration into the interior of the receptors, which is a known characteristic of GPCR activation, was higher when the receptor was complexed with an agonist as opposed to an antagonist (). In particular, the levallorphan-MOP and JDTic-KOP complexes formed a stacking interaction with the Y320 7.43 (Y320 7.42 as per ) residue, which tended to block water penetration into the interior. Solvent accessible surface area calculations on subsequent short MD simulations of several other agonists or antagonists in complex with either the KOP or MOP receptors showed these values were higher for receptors in complex with agonists as opposed to antagonists (). The conformational changes induced by 6 -Guanidinonaltrindole (6 -GNTI), a G-protein biased agonist that is selective for the KOP receptor, or the antagonist 5 -Guanidinonaltrindole (5 -GNTI) have recently been studied using unbiased all-atom MD simulations (). In this work, ∼600 ns MD simulations were performed on the ligand-free KOP receptor, as well as the receptor in complex with either 5 -GNTI or 6 -GNTI, with each system embedded in an explicit POPC membrane environment (). The MD simulations of the KOP receptor bound to the antagonist 5 -GNTI drew attention to the hydrogen bond between S324 7.47 and V69 1.42 as the basis for the stabilization of the kink angle on TM7 at about 150, and possibly deriving antagonistic activity. In contrast, the MD simulation of the G-protein biased agonist 6 -GNTI bound to the KOP receptor showed a different value for this kink angle, and highlighted an interaction of the ligand guanidinium group with the E297 6.58 residue, together with the steric effect from I294 6.55, as key contributors to the rotation of TM6, a known hallmark of GPCR activation (). The possible absence of guanidinium-E297 6.58 interaction in the MOP or the -opioid receptor (DOP) receptor due to this residue replacement by a lysine or tryptophan, respectively, was interpreted as the basis for the lack of 6 -GNTI agonism in those opioid receptor subtypes. More recently, the KOP receptor conformational changes induced by the agonist MP1104 or the antagonist JDTic were investigated using enhanced sampling MD simulations. Specifically, using the generalized AMBER force field for the ligands and the AMBER ff14SB force field for the protein, the GaMD method was used to enhance the sampling of longtime, large-scale conformational rearrangements associated with KOP receptor activation by introducing a biasing harmonic potential on certain dihedral angles. The following systems were all simulated in an explicit POPC membrane environment: the ligand-free KOP receptor in an inactive or active conformation, the latter with or without an intracellular protein, the JDTicinactive KOP receptor complex, and the MP1104-active KOP receptor complex with or without a stabilizing intracellular partner. Taken together, the results of these simulations showed that while the agonist stabilized specific functional domains in an active-like conformation, the antagonist shifted the conformational equilibrium toward an inactive conformation. Notably, the inactive ligand-free state of the KOP receptor was the most stable one, in contrast to the ligand-free active form of the receptor, which readily transitioned to an intermediate state characterized by a reduced TM6 outward movement. Finally, the results revealed a hydrophobic interaction between Y246 5.58 and TM6 in the intermediate metastable state that hindered the transition between the inactive and active conformations of the KOP receptor. The NOP receptor is another opioid target of interest for powerful pain relief with reduced side effects. MD simulations using the AMBER ff99sb force field were recently used to investigate the molecular effect of the novel analgesic cebranopadol (CBP) -which acts as an agonist at both NOP and MOP receptors -on the NOP receptor (Della Longa and Arcovito, 2019). These simulations, run in an explicit POPC membrane environment, used the high-resolution structure of the NOP receptor in complex with the antagonist C24 as a starting point for 1 s-long simulations of the ligand-free NOP receptor, the C24-NOP receptor complex, and the CBP-NOP receptor complex (Della Longa and Arcovito, 2019). In all cases, the simulations did not sample the large amplitude motions of the transmembrane helices associated with receptor activation even in the presence of the agonist CBP (Della Longa and Arcovito, 2019). The CBP ligand did, however, destabilize the inactive NOP receptor conformation relative to both the ligandfree NOP receptor and the C24-NOP receptor complex such that the NOP receptor bound to CBP could sample a much wider region of the local conformational space (Della Longa and Arcovito, 2019). The authors used these MD simulations to determine some of the earliest microswitches that lead to destabilizing the initial inactive conformation. A histogram of the conformational space of the M134 3.36 and W276 6.48 residues located in the orthosteric site revealed that a conformational switch to their active-like positions was accessible to the agonistreceptor complex (Della Longa and Arcovito, 2019). In addition, the time evolution of the conformation of these residues showed that in the agonist-receptor complex these active-like states were "locked" in place for the remainder of the simulation (Della Longa and Arcovito, 2019). Allosteric modulators of opioid receptors () constitute another priority area of research with expected higher probability of success in the development of medications in response to the opioid crisis (). NIDA's "most wanted" allosteric modulators of opioid receptors include MOP PAMs (). One of the reasons why MOP PAMs are of potential interest is that by increasing the potency and/or efficacy of classical opioid drugs, they are expected to produce the same analgesic response achieved by higher doses of opioid drug while simultaneously presenting fewer on-target overdosing risks. Most importantly, these compounds may not be subject to the compensatory mechanisms deriving from chronic MOP activation (e.g., tolerance, dependence, and increased toxicity) because they preserve the temporal and spatial fidelity of signaling in vivo by acting only in the presence of endogenous or other orthosteric ligands (). Since experimental high-resolution structures of opioid receptors in complex with allosteric modulators are yet to be published, and automated docking protocols do not yield single binding poses that can be clearly distinguished from the rest, MD simulations can make valuable contributions toward locating allosteric binding sites in opioid receptors, as well as revealing the molecular basis for their binding modes, as we recently demonstrated in an application to the DOP receptor. Specifically, we used metadynamics to simulate the binding of a recently discovered allosteric modulator BMS-986187 of opioid receptors (;) to the DOP receptor in complex with the orthosteric ligand SNC-80 (). The simulations identified the two most stable binding modes with near-degenerate energies that were discriminated experimentally based on functional studies of normal and mutant receptors (). Figure 4 summarizes the essence of this integrated computational-experimental work, which gave support to the BMS-986187 binding pose in cyan color as the most likely to occur based on the impact of specific mutations (e.g., L/W300 7.35 ) on either the intrinsic binding affinity of the PAM or the affinity/efficacy of the orthosteric ligand. The structural basis for the effect that another allosteric modulator, BMS-986122, has on MOP in complex with either the partial agonist buprenorphine or the agonist methadone, was recently investigated using s-scale unbiased MD simulations in an explicit membrane mimetic environment (). The results suggested that specific dynamic movements that are characteristic of full receptor activation, such as for instance the bending and rotation of TM7, can be induced by the allosteric modulator even in the presence of a partial agonist at the orthosteric binding site (). CANNABINOID RECEPTORS The cannabinoid receptor 1 (CB1) is another important class A GPCR drug target for the development of new analgesics with reduced side effects. For instance, PAMs of this receptor have been shown to suppress pathological pain without producing tolerance or dependence (). These properties, alongside their potentially reduced psychoactive side effects due to their lack of intrinsic activity and inherent ceiling efficacy, make CB1 PAMs potentially better therapeutics for inflammation and chronic pain compared to CB1 orthosteric agonists (). CB1 antagonists have also been reported to exert analgesia in animal models of inflammatory arthritis and hyperalgesia with reduced side effects (Croci and Zarini, 2007;). Based on these insights, the CB1 receptor is a target of interest for the development of improved therapeutics to combat the opioid crisis (). Luckily, a number of high-resolution experimental structures for either inactive or active CB1 receptors have been made available ((Hua et al.,, 2017;Krishna ) and can be used to study CB1-mediated functional mechanisms at a molecular level for the purpose of guiding rational drug discovery. A recent unbiased MD simulation-based investigation used these structures in order to gain insight into the features that could explain the different efficacy profiles of partial agonists, antagonists, and inverse agonists bound to the CB1 receptor, and could eventually be used for the design of novel therapeutics targeting the CB1 (). Specifically, analysis of these MD simulations made it possible to discriminate the dynamic tendencies of inactive and active CB1 structures in the presence of ligands with different efficacies while the molecular mechanics Poisson-Boltzmann surface area (MM-PBSA) method was used to assess the contribution of individual ligand-receptor interactions to the binding of the partial agonist 9 -tetrahydrocannabinol (THC), the antagonist 9 -tetrahydrocannabivarin (THCV), and the inverse agonist taranabant from ligand binding free energy decompositions of the CB1-ligand complexes. These MD simulations revealed that binding of the inverse agonist to the active CB1 receptor structure made TM1 less rigid, leading to larger root-meansquare deviations of the possible contacts between TM1 and 2, FIGURE 4 | The two energetically most favorable binding modes of the allosteric modulator BMS-986187 -colored yellow and cyan -at the DOP receptor in complex with the orthosteric ligand SNC-80, which is colored in gray. In sticks are the DOP receptor residues in the putative DOP allosteric site used in mutagenesis experiments to help validate the most likely binding mode. The plots to the right show the effect of mutations on the affinity of the allosteric ligand (top right), the induced changes in affinity of the orthosteric ligand (middle plot), and the changes in orthosteric ligand efficacy when the allosteric ligand is bound (bottom right). The experimental data support the predicted BMS-986187 binding mode in cyan color as the most favorable one. Astars indicate the statistical significance levels as given by Dunnet's test p values ( * p < 0.05, * * p < 0.01, and * * * p < 0.001). as well as TM1 and TM7, compared to either the partial agonistbound or the antagonist-bound active CB1 receptor complex. In addition, the simulations drew attention to large conformational changes involving residues Phe200 3.36 and Trp356 6.48 in the orthosteric binding site. In the inactive CB1 receptor, the inverse agonist taranabant -through a direct interaction with Trp356 6.48 -stabilized the conformation of Trp356 6.48 and Phe200 3.36 with respect to one another while the partial agonist THC and antagonist THCV did not. In contrast, in the CB1 active conformation, taranabant induced a different dynamic behavior for the interaction of Trp356 6.48 and Phe200 3.36 compared to the partial agonist THC. Furthermore, changes in the binding free energies showed that the partial agonist THC preferred the CB1 active conformation, whereas the simulated inverse agonist taranabant remained more favorably bound to the CB1 inactive conformation via a stable interaction with residue Trp356 6.48 () during the afforded simulation timescale. In another recent investigation, biased MD simulations were used to probe the binding sites and modes of the CP 55,940 agonist and the GAT228 mixed agonist/PAM (so-called Ago-PAM) to the CB1 receptor (). Ligand binding events to the CB1 receptor were enhanced using the multiplewalker metadynamics biasing protocol () and a funnel-shaped restraint applied to the ligand in the bulk, both for the purpose of aiding convergence (). The simulation of CP 55,940 binding to the ligand-free CB1 receptor -run for 2 s to achieve convergence -showed a single, deep minimum along the binding potential of mean force (PMF) (). The location of this deep minimum corresponded to the orthosteric binding site in the high-resolution structure of the CB1 receptor (). The binding mode of CP 55,940 was found to reproduce all of the interactions observed in the high-resolution structure of the THC agonist AM11542 bound to the CB1 receptor, except for the interaction with F174 2.61, which was replaced by an interaction with residue F102 in the N-terminal region of the receptor (). In contrast, the binding simulations of the GAT228 Ago-PAM to the ligand-free CB1 receptor, showed two PMF minima corresponding to binding at different sites of the receptor. These two minima had similar affinities (), which suggests an equilibrium between binding at the two different receptor sites, thus providing structural context to the experimentally observed partial agonistic effect of GAT228 (). While the PMF global minimum corresponded to GAT228 bound to the orthosteric site via a cluster of hydrophobic interactions with Val196 3.32, Leu193 3.29, and seven additional Phe residues (), the other PMF minimum defined a putative CB1 receptor allosteric site (). Notably, simulations of the binding of GAT228 to the CP 55,940-CB1 receptor complex revealed a 3 RMSD displacement of the CP 55,940 binding mode induced by GAT228 binding preferentially at an allosteric site defined by residues W279 5.43, Y275 5.39, W356 6.48, and the N-terminus F268 (), through a hydrogen bond between the indole hydrogen atom of GAT228 and T197 3.33 (). OREXIN RECEPTORS The orexin (OX) 1 and 2 receptors, expressed throughout the CNS, are neuropeptide receptors that belong to the -branch of the rhodopsin-like GPCRs. Although these receptors are known to be important in regulating mammalian sleep patterns (Wacker and Roth, 2016), they have recently received attention in the development of therapeutics to address the opioid crisis (). Although high-resolution experimental structures exist for both the OX1 and OX2 receptors bound to antagonists (), recent MD-based studies have focused on the OX2 receptor ). The earliest of these studies used 200 ns of unbiased MD simulations of the antagonist suvorexant bound to the OX2 wild-type and N324 6.55 A mutant receptors embedded in a POPC lipid environment to understand the dynamic interplay between the horseshoe shape pocket of the receptor revealed by crystallography () and the boat conformation of the ligand at an atomic level of detail. In line with the notion of a loss of antagonist binding ability and signaling response in the N324 6.55 A mutant, the results of these simulations showed a distorted horseshoe shape pocket of the N324 6.55 A mutant of the OX2 receptor compared to wild-type receptor, suggesting that an intact horseshoe shape pocket is required for optimal suvorexant binding and antagonistic activity. Molecular determinants of OX2 receptor binding and activation were further investigated in a recent MD-based work () focused on comparing the receptor dynamic behavior induced by the agonist Nag26 or the antagonist suvorexant, in addition to predicting the mode of binding of the endogenous ligand orexin-A at the OX2 receptor (). The microsecond-long unbiased MD simulations of Nag26 or suvorexant bound to the OX2 receptor revealed very different dynamic behaviors between the agonist and antagonist, with the agonist exhibiting much increased flexibility and completely different interaction patterns (). In particular, while suvorexant induced stabilization of the Q134 3.32 -Y354 7.43 (renumbered Y354 7.42 according to ) hydrogen bond, Nag26 promoted counterclockwise rotation of the TM5 extracellular end, influencing the interactions among TM4, 5, and 6 (). DOPAMINE RECEPTORS The dopamine D3 receptor has also received attention as a drug target for mitigating the opioid crisis () in large part because of its potential for opioid dependence treatment (). Recent work on this receptor highlighted the importance of using MD simulations to predict ligand binding at the D3 receptor in agreement with inferences from site-directed mutagenesis (). In particular, binding of the antagonist PF-4363467 from the bulk to the dopamine D3 receptor was simulated with ACEMD () directed sampling and MSMs generated using High-Throughput Molecular Dynamics (HTMD), using the CHARMM36 force field for the protein and POPC lipid, and ligand force field parameters generated with the GAAMP tool within HTMD. An adaptive sampling protocol was used for these simulations, according to which MSMs were built from successive batches of simulations to identify starting conformations for the next batch, thus affording thorough exploration of the conformational landscape without biasing the potential. A total of over 680 s of simulation was carried out, resulting in the sampling of two binding paths, which differed in the presence of a second intermediate state in the minor binding path. This intermediate state corresponded to PF-4363467 bound to the D3 receptor at a position between the extracellular vestibule and the orthosteric site. The main structural difference between the predicted PF-4363467-D3 receptor complex and the crystallographically determined eticlopride-D3 receptor complex () was the formation of an aromatic cryptic pocket between TM5 and TM6 involving residues F338 6.44, W342 6.48, L343 6.49, F345 6.51, and F346 6.52 deriving from the displacement of residues F197 5.47 and F346 6.52 (). The SB269652 ligand is a bitopic D2 and D3 receptor ligand with negative allosteric modulation activity () that has received research attention for the treatment of drug abuse (). By nature of being bitopic, SB269652 binds to both the orthosteric binding site and an allosteric binding site in the receptor. Previous molecular modeling studies suggested that the tetrahydroisoquinoline (THIQ) moiety of SB269652 binds to the orthosteric binding site via an ionic interaction with D 3.32 whereas the indole-2-carboxamide moiety of SB269652 protruded into a putative allosteric site between TM2 and TM7, forming a hydrogen bond with the E 2.65 (renumbered E 2.64 according to ) residue (;). However, mutagenesis and structure activity relationship studies of SB269652 questioned that this hydrogen bond alone could determine the compound allosteric properties (;;), calling for an in depth dynamics study. Thus, adaptive sampling MD simulations using MSMs were recently used to obtain mechanistic insights into the role of the E 2.65 residue in the binding and allosteric properties of SB269652 at both the D2 and D3 receptors (). Specifically, simulations were carried out for the ligand bound to the wild-type D2 receptor, the E 2.65 A D2 receptor mutant, the wild-type D3 receptor, or the E 2.65 A D3 receptorall of which were embedded in a POPC lipid environmentfor a total of 76.5 s, with the simulation time of each complex ranging between 15.9 and 21.3 s (). The THIQ moiety of SB269652 bound at the orthosteric site was shown to be quite stable in both the D2 and D3 receptors, although subtle differences in its binding poses were observed, due in large part to different interactions between the ligand and the extracellular loop 2 (). This is in agreement with previous chimera mutagenesis results that showed the affinities for the D2 and D3 receptors were different in large part due to the extracellular loop 2 (ECL2) (). In contrast, the indole-2-carboxamide moiety of SB269652 bound at the allosteric site was shown to undergo significant fluctuations, with the MSM analysis revealing two equiprobable metastable states in the wild-type D2 and D3 receptors, but three different metastable states in both the E 2.65 A D2 and D3 receptor mutants (). Furthermore, the results suggested that the E 2.65 residue mediated the allosteric properties of SB269652 by not only forming a direct hydrogen bond with SB269652, but also by impacting the overall shape and size of the allosteric binding site. Another recent joint experimental-computational publication also made use of MD simulations to help explain the molecular basis for the binding of bitopic arylamide phenylpiperazine ligands selective for the D3 receptor over D2 (). Specifically, studies were focused on the prototypic arylamide phenylpiperazine LS-3-134 ligand, which has been found to act as a D3 receptor partial agonist and has also been shown to be 150-fold more selective for the D3 receptor relative to the D2 receptor (). Radioligand binding studies showed that the greatest contribution to the binding energy of the LS-3-134 ligand to the D3 receptor was the phenylpiperazine moiety, but that the arylamide moiety heavily influenced ligand selectivity for the D3 receptor (). The MD simulations were used to explain the effect that analogs of the piperazine moiety had on the binding affinity. In particular, three different 300 ns unbiased MD simulations were run for LS-3-134 as well as four of its analogs bound to the D3 receptor, revealing that the number of contacts between the protonated nitrogen of piperazine and the D 3.32 residue tended to decrease as the size of the piperazine increased, with the exception of only one compound. Calculation of their respective binding energies using MM-PBSA showed that the strength of the electrostatic interaction with the D 3.32 residue generally decreased as the size of the piperazine substituent increased. Umbrella sampling simulations were used to generate a PMF aimed at mimicking the unbinding of the ligand protonated nitrogen from the D 3.32 residue, and the depth of the bound state in the PMF also agreed with the experimental trend except for one of the analogs (). METABOTROPIC GLUTAMATE RECEPTORS Metabotropic glutamate receptors (mGluRs) belong to the glutamate (Class C) subfamily of GPCRs given that their endogenous ligand is the neurotransmitter glutamate. Owing to the demonstrated important role of glutamate in pain sensation and transmission, these receptors have been suggested to be promising potential targets for novel pain relieving medications (Pereira and Goudet, 2018). There are eight different subtypes of mGluRs, which are divided into group I (mGluR1 and 5), group II (mGluR2 and 3), and group III (mGluR4, 6, 7, and 8) receptors. While group I mGluRs signal via G q, groups II and III signal via G i. Several articles suggest opposing effects of the group I vs. group II and III receptors in reference to antinociception, with group I antagonists or group II/III agonists in the spotlight from a drug discovery perspective. In particular, mGluR2/3 agonists or PAMs have been listed among NIDA's "most wanted" medications in response to the opioid epidemics (). Like other class C GPCRs, mGluRs are structurally different from rhodopsin-like (class A) GPCRs in that they have a large extracellular domain, also known as Venus Flytrap Domain (VFD), in addition to the 7 transmembrane helical domain (7TMD). Unlike class A GPCRs, the endogenous ligand binding site of mGluRs is located in the extracellular VFD, whereas the transmembrane helical bundle is the primary site for allosteric modulators. Another significant uniqueness is that these receptors are obligate dimers by virtue of a disulfide bond between their VFDs. Experimental high-resolution structures exist for the 7TMD of mGluR 1 () and the 7TMD and VFT of mGluR 5 (;Christopher et al.,, 2018). There are not, however, published high-resolution structures of the 7TMD of mGluR 2 and mGluR 3, although their VFT domain has been determined by X-ray crystallography (). Thus, we report here two recent MDbased studies, one for mGluR 1 and another for mGluR 5, both using their high-resolution experimental structures as starting conformations. To investigate mGluR 1 allosteric modulation mechanism at an atomic level of detail appropriate for designing potent NAMs of this receptor, Bai and Yao carried out both biased and unbiased MD simulations on wild-type mGluR 1 dimer, as well as its T815M and Y805A mutants, in complex with a NAM known as FITM (4-fluoro-N-(4-(6-(isopropylamino)pyrimidin-4-yl)thiazol-2-yl)-N-methylbenzamide), and embedded in a POPC lipid membrane environment (Bai and Yao, 2016). The simulations used the CHARMM27 force field for the protein and lipid, and the CGenFF force field for FITM. The unbinding PMF, calculated using an adaptive biasing force, revealed an intermediate ligand-binding state along the NAM-mGluR1 dissociation path, stabilized by interactions with residues S735, T748 ECL2, C746 ECL2, K811 7.28 (renumbered K811 7.29 according to ) (Bai and Yao, 2016). While hydrogen bonding between FITM and Y805 was identified as a major contributor to stable ligand binding at the crystallographically determined allosteric site, ligand hydrogen bonding to T748 was found to be a crucial factor in stabilizing FITM in an intermediate binding site (Bai and Yao, 2016). Finally, weak interaction analysis of the stabilizing and destabilizing non-covalent interactions using unbiased MD simulations corroborated the importance of van der Waals and hydrogen bond interactions between Y805 and T815 residues in stabilizing the ligand at the binding site. In another recent unbiased MD investigation, the structural basis for the binding of several NAMs in preclinical or clinical development (mavoglurant, dipraglurant, basimglurant, STX107, and fenobam), as well as three additional NAMs (MPEP, 51D, and 51E) at mGluR5, was elucidated (). The simulations used an explicit POPC membrane in which to embed the ligand-mGluR5 complexes. The force field parameters of the protein atoms were based on the AMBER ff14SB force field, while the force field parameters of the lipid atoms used the Lipid14 force field and ligands were parametrized with the GAFF force field using the Antechamber program. To begin, five NAMs (dipraglurant, basimglurant, STX107, fenobam, and MPEP) were docked to the mGluR5 receptor allosteric site and short 100 ns MD simulations were used to assess the stabilities of the predicted docked poses. Using the final 50 ns of these trajectories, MM/GBSA calculations were carried out to rank the ligands according to their binding free energies. Using the per-residue free energies, eleven residues -I625 2.46, I651 3.36, S654 3.39, P655 3.40, L744 5.44, W785 6.50, F788 6.53, M802 7.32 (renumbered M802 7.33 according to ), V806 7.36 (V806 7.37 as per ), S809 7.39 (S809 7.40 as per ), and A810 7.40 (A810 7.41 as per ) -were identified as the main contributors to the stable binding of all studied NAMs to mGluR 5. The apolar nature of most of these eleven residues further suggested that ligands with hydrophobic scaffolds might be better mGluR5 binders. CONCLUDING REMARKS In this work, we have reviewed recent MD-based investigations of a number of GPCRs that are currently in the spotlight for pain management or to treat or prevent OUD clinical manifestations. With the continued advancements in both computer hardware and MD simulation software, as well as sophisticated tools for analysis of increasingly larger datasets generated by MD simulations, atomic-level insights into the dynamical behavior of GPCRs involved in important pharmacological mechanisms are expected to contribute more and more to the rapid development of therapeutics in response to the opioid crisis. AUTHOR CONTRIBUTIONS JR and MF wrote the manuscript. FUNDING The MF's lab is funded by National Institutes of Health grants DA045473 and DA038882 for work on opioid receptors. Computations are run on resources available through the Scientific Computing Facility at Mount Sinai and the Extreme Science and Engineering Discovery Environment under MCB080077, which is supported by the National Science Foundation grant number ACI-1053575. |
COLUMBIA, SC (WIS) - Crews made their way to Riverwalk Vista Apartments to repair a gas leak Saturday night.
Officials with the Columbia Fire Department received the call around 7:30 p.m. regarding the gas leak. Workers with SCE&G were called to the scene to turn the gas off.
In total, two units were impacted and four tenants were displaced.
Officials said the rest of the building was okay and no other evacuation was necessary as the situation appeared to be an isolated incident. |
<filename>sequential_search.c
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
void array_show(int [], int, int, int);
int sequential_search(int [], int, int);
int
main(void) {
// random seed.
srand((unsigned)time(NULL));
const int num = 10;
int array[num];
int key, index;
/* Create a random integer array */
for (int i = 0; i < num; i++)
array[i] = rand() % 100;
/* Print the previously generated array */
for (int i = 0; i < num; i++)
printf("[%d] ", array[i]);
printf("\n");
printf("Enter an integer to be searched: ");
scanf("%d", &key);
if ((index = sequential_search(array, key, num)) < 0) {
printf("Cannot find this number\n");
return -1;
}
printf("key = %d, index = %d, value = %d\n",
key, index, array[index]);
return 0;
}
int sequential_search(int nums[], int key, int size) {
for (int i = 0; i < size; i++) {
array_show(nums, size, i, 1);
if (nums[i] == key) return i;
}
return -1;
}
void array_show(int nums[], int size, int index, int sec) {
for (int i = 0; i < size; i++)
if (i == index)
printf("\033[1;32m[%d] \033[0m", nums[i]);
else
printf("[%d] ", nums[i]);
printf("\n");
sleep(sec);
} |
def g(self, q ):
[c1,s1,c2,s2,c12,s12] = self.trig( q )
g1 = (self.m1 * self.lc1 + self.m2 * self.l1 ) * self.gravity
g2 = self.m2 * self.lc2 * self.gravity
G = np.zeros(2)
G[0] = - g1 * s1 - g2 * s12
G[1] = - g2 * s12
return G |
def _format_parameterArray_ascii(self):
art = ascii_art(*sum(zip([ascii_art(x)
for l in self.parameterArray() for x in l],
([", "] * (self.classes()-1) + ["; "]) * 2),
())[:-1])
return ascii_left_curly_brace.character_art(art.height()) + art \
+ ascii_right_curly_brace.character_art(art.height()) |
/* Unlink the session from its parent */
void session_unlink(struct session *s)
{
struct session_link *sl = rcu_dereference(s->se_link);
struct session *parent;
if (sl) {
parent = sl->sl_parent;
if (parent) {
rte_spinlock_lock(&parent->se_link->sl_lock);
sl = rcu_dereference(s->se_link);
if (sl->sl_parent)
sl_unlink(sl);
rte_spinlock_unlock(&parent->se_link->sl_lock);
}
}
} |
The UConn board of trustees approved the financial plan and details of the on-campus hockey arena on Wednesday. The arena is expected to be built and be ready for fall 2021.
The arena is estimated to cost $45 million. The funds are expected to be comprised of UConn’s reserve money ($12.5 million), the profit from recent property sales ($10 million) and the rest ($22.5 million) from a developer with tax-exempt bonds, with UConn paying the developer an annual fee as repayment. University officials have said a donor has expressed interest in giving up to $6 million toward the project.
Hockey East requires each of its members to have an on-campus arena seating at least 4,000 because “the lack of a campus facility compromises the league’s ability to schedule with flexibility,” according to commissioner Joe Bertagna. Bertagna noted that the XL Center frequently hosts other events, which could create scheduling conflicts. But with UConn planning to still use the XL Center frequently, UConn was able to receive a waiver for a smaller, 2,500-seat arena to be built.
UConn averaged 4,291 at the XL Center last season and the university has received criticism from fans for building a much smaller facility on campus, although UConn officials say the arena could later expand to 3,500.
UConn athletic director David Benedict spoke with The Courant on Wednesday about the project, the finances, and the future of the men’s and women’s hockey programs.
“First of all, demand is good. When you can’t get a ticket, that’s not a bad thing. It creates some energy and excitement around things. Look, there’s a lot of places that probably wish they would have reduced the size of their buildings, whether it would be football or basketball arenas. We’re going to take a phased approach to this. But listen, we’ll make the right decisions as far as what games we play. We had a game last week on Friday night against Maine that we most likely could have fit everybody in a 2,500-seat facility with our students. We’ll be smart about it. We want to build our fan base, and hopefully we continued to build the average numbers while we’re playing at XL.
“The other thing that I think is really going to be beneficial is that this is not a facility that’s just going to be utilized by athletics. The fact that this is going to be a second sheet is going to really free up ice time for our students to use it, which they use our current facility a lot. But this is going to give them more time from a club and intramural and a free skate standpoint. It’s going to give us an opportunity to engage our community, and the surrounding areas with youth hockey, and much more because there’s more ice time available. And we’re going to have the opportunity to attract a lot of events and youth tournaments now, which we couldn’t previously, either, because of time or because we only had one sheet.
“How are we supposed to compete and be competitive from a recruitment standpoint with local and regional type prospective student-athletes that are being recruited by BU, and Northeastern, and Boston College and Quinnipiac and Yale, and all of those types of programs, when we don’t have close to the type of facilities that they have? |
#include "accimage.h"
#include <stdlib.h>
#include <ippi.h>
void image_copy_deinterleave(ImageObject* self, unsigned char* output_buffer) {
unsigned char* channel_buffers[3] = {
output_buffer,
output_buffer + self->height * self->width,
output_buffer + 2 * self->height * self->width
};
IppiSize roi = { self->width, self->height };
IppStatus ipp_status = ippiCopy_8u_C3P3R(
self->buffer + (self->y_offset * self->row_stride + self->x_offset) * self->channels,
self->row_stride * self->channels,
channel_buffers, self->width, roi);
if (ipp_status != ippStsNoErr) {
PyErr_Format(PyExc_SystemError, "ippiCopy_8u_C3P3R failed with status %d", ipp_status);
}
}
void image_copy_deinterleave_float(ImageObject* self, float* output_buffer) {
unsigned char* tmp_buffer = NULL;
IppiSize roi = { self->width, self->height };
tmp_buffer = malloc(self->height * self->width * self->channels);
if (!tmp_buffer) {
PyErr_NoMemory();
goto cleanup;
}
image_copy_deinterleave(self, tmp_buffer);
if (PyErr_Occurred()) {
goto cleanup;
}
IppStatus ipp_status = ippiConvert_8u32f_C3R(
tmp_buffer, self->width * self->channels,
output_buffer, self->width * self->channels * sizeof(float),
roi);
if (ipp_status != ippStsNoErr) {
PyErr_Format(PyExc_SystemError, "ippiConvert_8u32f_C3R failed with status %d", ipp_status);
}
Ipp32f value[3] = {255.0f, 255.0f, 255.0f};
ipp_status = ippiDivC_32f_C3IR(
value, output_buffer, self->width * self->channels * sizeof(float),
roi);
if (ipp_status != ippStsNoErr) {
PyErr_Format(PyExc_SystemError, "ippiDivC_32f_C3IR failed with status %d", ipp_status);
}
cleanup:
free(tmp_buffer);
}
void image_resize(ImageObject* self, int new_height, int new_width, int antialiasing) {
IppStatus ipp_status;
unsigned char* new_buffer = NULL;
IppiSize old_size = { self->width, self->height };
IppiSize new_size = { new_width, new_height };
IppiPoint new_offset = { 0, 0 };
int specification_size = 0, initialization_buffer_size = 0, scratch_buffer_size = 0;
IppiResizeSpec_32f* specification = NULL;
Ipp8u* scratch_buffer = NULL;
Ipp8u* initialization_buffer = NULL;
new_buffer = malloc(new_height * new_width * self->channels);
if (new_buffer == NULL) {
PyErr_NoMemory();
goto cleanup;
}
ipp_status = ippiResizeGetSize_8u(old_size, new_size, ippLinear, antialiasing,
&specification_size, &initialization_buffer_size);
if (ipp_status != ippStsNoErr) {
PyErr_Format(PyExc_SystemError,
"ippiResizeGetSize_8u failed with status %d", ipp_status);
goto cleanup;
}
initialization_buffer = malloc(initialization_buffer_size);
if (initialization_buffer == NULL) {
PyErr_NoMemory();
goto cleanup;
}
specification = malloc(specification_size);
if (specification == NULL) {
PyErr_NoMemory();
goto cleanup;
}
if (antialiasing) {
ipp_status = ippiResizeAntialiasingLinearInit(
old_size, new_size, specification, initialization_buffer);
} else {
ipp_status = ippiResizeLinearInit_8u(old_size, new_size, specification);
}
if (ipp_status != ippStsNoErr) {
PyErr_Format(PyExc_SystemError,
"ippiResizeLinearInit_8u failed with status %d", ipp_status);
goto cleanup;
}
ipp_status = ippiResizeGetBufferSize_8u(specification, new_size, self->channels, &scratch_buffer_size);
if (ipp_status != ippStsNoErr) {
PyErr_Format(PyExc_SystemError,
"ippiResizeGetBufferSize_8u failed with status %d", ipp_status);
goto cleanup;
}
scratch_buffer = malloc(scratch_buffer_size);
if (scratch_buffer == NULL) {
PyErr_NoMemory();
goto cleanup;
}
if (antialiasing) {
ipp_status = ippiResizeAntialiasing_8u_C3R(
self->buffer + (self->y_offset * self->row_stride + self->x_offset) * self->channels,
self->row_stride * self->channels,
new_buffer, new_width * self->channels, new_offset, new_size,
ippBorderRepl, NULL, specification, scratch_buffer);
} else {
ipp_status = ippiResizeLinear_8u_C3R(
self->buffer + (self->y_offset * self->row_stride + self->x_offset) * self->channels,
self->row_stride * self->channels,
new_buffer, new_width * self->channels, new_offset, new_size,
ippBorderRepl, NULL, specification, scratch_buffer);
}
if (ipp_status != ippStsNoErr) {
PyErr_Format(PyExc_SystemError,
"ippiResizeLinear_8u_C3R failed with status %d", ipp_status);
goto cleanup;
}
free(self->buffer);
self->buffer = new_buffer;
new_buffer = NULL;
self->height = new_height;
self->width = new_width;
self->row_stride = new_width;
self->x_offset = 0;
self->y_offset = 0;
cleanup:
free(new_buffer);
free(specification);
free(initialization_buffer);
free(scratch_buffer);
}
void image_flip_left_right(ImageObject* self) {
IppiSize roi = { self->width, self->height };
IppStatus ipp_status = ippiMirror_8u_C3IR(
self->buffer + (self->y_offset * self->row_stride + self->x_offset) * self->channels,
self->row_stride * self->channels,
roi, ippAxsVertical);
if (ipp_status != ippStsNoErr)
PyErr_Format(PyExc_SystemError, "ippiMirror_8u_C3IR failed with status %d", ipp_status);
}
|
Armored Cars: OFB Mine Protected Vehicle Aditya
The Mine Protected Vehicle made by India’s Ordnance Factory Board (OFB) is one of the least known armored cars in use today. Its design is based on the proven South African Casspir, the forerunner of current generation MRAPs. On the other hand, the MPV, which is also called the Aditya, was tailored for South Asia’s terrain and the needs of India’s security forces.
After initial prototyping by the DRDO at the turn of the century MPV production commenced for domestic use. The armed forces joined the clientele in 2007 with an initial order for 250 trucks. All assembly took place in OFB Medak, a state-owned vehicle plant launched in 1986 to assemble licensed copies of the Soviet BMP-2 called the Sarath.
The MPV Aditya was originally used for local trouble spots like the Naxal infested “Red Corridor” across Southeastern India. The Naxals are a Maoist insurgency that began as a grassroots land reform movement. The MPV proved its mettle in this difficult theater and there used to be some hope it would find international customers.
The MPV follows a conventional MRAP design and is recognizable for its square grille and high ground clearance. Another familiar characteristic is the spare tire attached to the hulls’ left side, which slopes downward because of the V-shape above the chassis. The MPV scales 11 tons unloaded and offers seating for two crew and and 10 passengers. When configured as a 6×6 it can fit 12 passengers. Jawans have the choice to fight inside their vehicle, since each MPV has multiple firing ports, four rooftop hatches, and a large circular turret hatch for a main armament.
When it comes to mobility the MPV offers a top speed of 85 kilometers per hour with a range of 1,000 km. There isn’t any information on its engine but it won’t be surprising if it runs on a Cummins turbo diesel in the 250 horsepower range.
The OFB aren’t forthcoming about the MPV’s protection level and claim it can deflect 7.62x51mm rounds from all sides at a 10 meter distance. As for its blast resistance, the OFB’s product literature reveals the shock wave from 10 kilograms of explosive can be absorbed by its hull while the wheels can survive 21 kg bomb. The vehicle itself has been subject to upgrades over the years but the OFB remains mum on these.
The MPV’s reputation began to suffer in the years after it entered service. Like insurgencies elsewhere, Naxal rebels soon found out the vehicle had a tendency to topple over when struck by a powerful explosion. Worse, merely enlarging the improvised bomb or mine knocked it out for good, which is what happened in 2005 when 24 paramilitaries were killed in an MPV during an ambush. No wonder the Central Reserve Police Force (CRPF) tasked with suppressing the Naxals have stopped deploying the MPV on unpaved roads and countryside.
While the MPV’s use has dwindled recently the vehicle is nowhere near the end of its usefulness. The threat posed by militants in Jammu and Kashmir has seen the Indian Army adopt MPVs for convoy protection and patrol missions. The MPVs are ideal for the job since they offer better mobility and armor compared to a Toyota pickup or a locally made jeep.
The MPV’s production is ongoing and 250 new builds were ordered in 2016 for the Indian Army’s domestic use. As its numbers balloon the MPV faces competition from a new generation of locally made armored vehicles that could still find customers somewhere outside India. It’s true there’s no shortage of MRAPs to choose from globally and the MPV in its current form does have its drawbacks. If the OFB Medak emphasizes new features, however, the MPV might enjoy a resurgence of sorts. This is already possible with a remote weapon station for an FN MAG on the MPV’s roof.
A few crucial systems can do a lot to make the MPV more competitive as a potential export. These should include a sniper detection system, an optional CBRNe suite for detecting hazardous chemicals or radiation, smoke grenade dischargers, a remote day and night sight, and optional armor packages–whether additional panels for the hull or robust standoff slats for its windows.
It would be interesting to see if the MPV is capable of supporting either a 12.7mm machine gun or a 30mm grenade launcher on a remote controlled turret. Rolling out variants such as a command vehicle, a UAV carrier, an ambulance, and a self-propelled mortar, even a short-range air defense vehicle armed with missiles, would put it on equal footing with some of the more ambitious wheeled platforms made in Asia.
The world still hasn’t recognized the value of Indian military products. Concerns over quality issues are one reason why but if the market demands an affordable and battle-tested truck for infantry transport, the MPV is worth considering.
Advertisements |
package me.pryter.tracks.mixin;
import net.minecraft.client.gui.screen.TitleScreen;
import me.pryter.tracks.Tracks;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(TitleScreen.class)
public class TracksMixin {
@Inject(at = @At("HEAD"), method = "init()V")
private void init(CallbackInfo info) {
Tracks.LOGGER.info("This line is printed by an example mod mixin!");
}
}
|
World Federation of Teachers Unions
The World Federation of Teachers Unions known by its French initials FISE (Federation Internationale Syndicale de L'Enseignement) is an international trade union of educators affiliated with the World Federation of Trade Unions.
History
The FISE was founded in Paris in July 1946 as a merger of the International Professional Secretariat of Education and l’Internationale des Travailleurs de l’Enseignement (ITE), with the participation of the American Education Association. In 1951 a group of unions split off and founded the International Federation of Free Teachers Unions.
During the 1980s it cooperated with the International Federation of Teachers Unions (then affiliated with the International Confederation of Free Trade Unions), the World Federation of Educators (affiliated with the World Confederation of Labour) and the World Federation of Organizations of the Teaching Profession.
FISE is an organization with consultative status with United Nations Educational, Scientific and Cultural Organization (UNESCO) and United Nations Economic and Social Council (ECOSOC). It has had its position within UNESCO since at least 1985.
Action
FISE takes actively part in the Worker’s Group of the International Labour Organisation (ILO), as well as in conferences of all of the above international organisations.
During the previous period it actively participated in most activities of the WFTU and took initiatives which strengthened the renown and the strength of the organisation.
In 2013 it organized an international conference in Brussels on “the role of teachers today, today’s school, public education, democracy in education” and published a book with the proceedings.
It held meetings with trade unionists teachers from different countries and unions: Cuba, Germany, Egypt, Palestine, Greece, Italy, Mexico, etc.
FISE publishes every year announcements and posters useful for every trade union, concerning the International Workers’ May Day (May 1), the International Teachers Day, the International Women's Day (March 8), the Day of the Anti-fascist Victory of Peoples (May 9), the day against violence towards women, against child labour, for the refugees, the xenophobia and racism, and other relevant topics or subjects of commemoration.
It particularly focuses on the expression of concrete solidarity.
It denounced the killings and police attacks against the Mexican teachers.
One of the most important actions that FISE undertook in Greece was the solidarity campaign for the children of Palestine, entitled "a notebook for GAZA". Many students, parents, parents' associations, cultural associations, women's associations, responded to the invitation of FISE and gathered materials. They organized theatrical performances in which the ticket was two notebooks or other school supplies. Discussions have been held by teachers to students on the situation in Palestine. Painting exhibitions on the Palestinian matter were organised, as well as other initiatives, too.
In 2017 FISE also launched a support campaign for Yemeni children and protests against the war in Yemen.
Organization
The organizations highest organ is the Statutory Conference, formerly called the World Conference of Teachers. Originally annual events, they were held at irregular intervals in the 1950s and now are constitutionally mandated to be held every four years. Between meetings of this conference the organization is headed by an Administrative Committee which meets at least once a year. Day to operations are directed by a Bureau which consists of the General Secretary, President, Vice-President and Secretariat, who are ex-officio members of the Administrative Committee.
FISE was originally headquartered in Paris but was expelled in 1952 for "fifth column activities". It then moved to the Soviet sector of Vienna, but was expelled, again, in February 1956. The location of the headquarters immediately after the expulsion from Vienna is unclear, though FISEs' journal Teachers of the World was published from 10 Rue de Solférino, Paris 7ème. In 1978 its headquarters is reported at Wilhelm Wolff Strasse 21, East Berlin 111. It was at the same address in 1985. Its current headquarters is at 6/6 Kalicharan Ghosh Road, 700 050, Kolkata, India. After the 18th Congress of FISE is currently located in Mexico.
Membership
In August 1956 FISE was reported to have seven million members in 34 countries. By the 1978 this had grown to over 16 million in 74 organizations in 50 countries. In 1985 the group claimed 20 million members in 121 organizations in 82 countries. As of 2009 FISE claimed over 26 million members within 156 trade unions in 40 countries including France, Greece, Burkina Faso, Cape Verde, Congo, Ethiopia, Libyan Arab Jamahiriya, Morocco, Mozambique, Senegal, Togo, Argentina, Bolivia (Plurinational State of), Brazil, Chile, Colombia, Cuba, Ecuador, Jamaica, Mexico, Nicaragua, Peru, Bangladesh, China, India, Iraq, Kazakhstan, Democratic People's Republic of Korea, Kuwait, Lao People's Democratic Republic, Lebanon, Nepal, Pakistan, Palestinian territories, Philippines, Sri Lanka, Syrian Arab Republic, United Arab Emirates, Vietnam, and Yemen.
Regional federations
By 1978 the FISE had two regional federations, the Confederation of American Teachers and the Federal of Arab Teachers Syndicates. As of 2009 there are four regional affiliates - Confederation of American Educators, Federation of Teachers Organizations of Central America, Federation of Arab Teachers and the Federation of University Workers Unions of Central America, the Caribbean and Mexico
Since 2012 one Vice-president of FISE is elected for each continent. On the basis of the Vice-President, there is one Regional Office per continent.
Publications
The FISE published a quarterly Teachers of the World in English, French and German with "separate" Latin American Spanish and Japanese editions. By the 1980s this publication carried a "pedagogical supplement" financed by UNESCO. Another bulletin was published 8 times a year and was variously called Educators International Courier or International Teachers News. It was published in English, French, Spanish, German, Russian, Portuguese and Arabic.
FISE still publishes Teachers of the World quarterly in English as well as the FISE Information Letter eight times a year in French, English, Spanish, Russian, German, Portuguese, Arabic.
FISE also submitted a nomination for the 2018 edition of the UNESCO Prize for Girls’ and Women’s Education (GWE) to UNESCO. |
Every week on the CBC Radio 2, The Strombo Show keeps the spirit of radio alive by delivering the best records in the best order. It's a show for music lovers by music lovers, ranging over three hours of commercial-free music to honour both old and new.
To listen to the latest episode of the show each week, and get playlists and exclusive video extras, head on over to the Strombo Show page on CBC Music.
Lock it. Crank it. Join the collective! |
The transformation of normal cells within the body into cancerous and non-malignant neoplasms may be induced by viral infections, chemical carcinogens, radiation, physical agents or spontaneous tumorigenic growth. As a result of such transformation, normal cell surface antigen expression may be altered. New antigens--tumor specific antigens or antigens characteristic of premature cell types--or antigen expression pattern changes may be demonstrated on many tumor types. These antigenic changes are targets for the body's immune response.
In some instances, the extent or rate of cell transformation may exceed the capabilities of the body's immune response. Alternatively, the immune response may itself be ineffective or deficient. Supplemental methods have, therefore, been used in the treatment of transformed cells. These methods include non-surgical treatments, such as chemotherapy and radiation, and surgical treatments. Typically, these treatments are characterized by a range of undesirable side effects. Non-surgical treatments having immunosuppressant effects may increase the patient's susceptibility to secondary infections. Surgical treatments to excise transformed cells involve risks attendant with invasive procedures and may not effectively remove or eliminate the entire transformed cell population.
An alternative method of treatment for cancers and non-malignant tumors has involved the use of monoclonal antibodies to tumor specific antigens on the surface of transformed cells. The effectiveness of such treatments, typically involving murine monoclonal antibodies, is often limited by a variety of factors. For example, human patients treated with murine monoclonal antibodies may develop an anti-murine immunoglobulin response which severely reduces the effectiveness of further administration of murine monoclonal antibodies (G. E. Goodman et al., "Pilot Trial of Murine Monoclonal Antibodies In Patients With Advanced Melanoma", Journal Of Clinical Oncology, 3, pp. 340-51 (1985)). Other reported side effects of monoclonal antibody treatments include anaphylaxis, fever and chills.
Monoclonal antibodies are also ineffective in the treatment of those tumor specific surface antigens which modulate upon exposure to specific antibodies. Such antigens include, for example, the common acute lymphocytic leukemia antigen ("CALLA"), which appears on the surface of transformed cells of a majority of patients suffering from acute lymphocytic leukemia (J. Ritz et al., "Serotherapy Of Acute Lymphoblastic Leukemia With Monoclonal Antibody", Blood, 58, pp. 141-52 (1981)). When the CALLA antigen on the surface of a tumor cell is exposed to its specific antibody, the antigen migrates and the cell may internalize the antigen and antibody, preventing recognition of the tumor cell as a target by immune response effector cells such as leukocytes, lymphocytes, macrophages, killer ("K") cells or natural killer ("NK") cells.
In view of the disadvantages of such supplemental treatments, various therapies have been directed to augmenting the body's natural immune response to transformed cells. It is known that in the presence of antibodies, certain effector cells, such as lymphoid cells having surface bound receptors for the Fc regions of antibodies, mediate an antibody dependent cellular cytoxicity ("ADCC") reaction against target cells. By means of ADCC, these effector cells exert cytolytic activity against such target cells.
Two types of ADCC reactions have been demonstrated in vitro. In classical ADCC reactions, effector cells attach to antibody-coated target cells and subsequently cause cytolysis of the target cells (A. H. Greenberg et al., "Characteristics Of The Effector Cells Mediating Cytotoxicity Against Antibody-Coated Target Cells. I., Immunology, 21, p. 719 (1975)). This attachment between effector and target cell results from the interaction of the Fc region of the antibody coating the target cell and the Fc receptor of the effector cell. One disadvantage of this type of ADCC reaction is that it may be hampered by circulating antigen-antibody complexes, often associated with various diseases, which compete with the target-cell bound antibody for the Fc receptors of the effector cells (I. C. M. MacLennan, "Competition For Receptors For Immunoglobulin On Cytotoxic Lymphocytes", Clin. Exp. Immunol., 10, p. 275 (1972)). Due to this drawback of classical ADCC, a second type of ADCC reaction--antibody-directed ADCC--has been proposed. In antibody-directed ADCC, the target-specific antibody is first attached to the effector cell and the resulting complex is then "directed", via the antibody, to its specific antigen on the target cell surface. Advantageously, antibody-directed ADCC may not be affected by the presence of antigen-antibody complexes circulating in the host system.
The interaction between antibodies and effector cells via Fc region/Fc receptor attachment is normally weak. And, in some instances, antibodies do not remain associated with effector cells for a period of time sufficient to permit lysis of target cells. In view of this potential problem, antibodies have been attached to the effector cells using pretreatment with polyethylene glycol and a mixture of phthalate oils (J. F. Jones and D. M. Segal, "Antibody-Dependent Cell Mediated Cytolysis (ADCC) With Antibody-Coated Effectors: New Methods For Enhancing Antibody Binding And Cytolysis", J. Immunol., 125, pp. 926-33 (1980)). The applicability of this method for in vivo treatments, however, may be diminished by the toxic effects that any polyethylene glycol and phthalate oil residues on the antibody-effector cell complex may have on the body.
Alternatively, a method has been proposed for enhancing antibody-directed ADCC by adjuvant chemotherapy with cytotoxic drugs (I. R. Mackay et al., "Effect On Natural Killer And Antibody-Dependent Cellular Cytotoxicity Of Adjuvant Cytotoxic Chemotherapy Including Melphalan In Breast Cancer", Cancer Immunol. Immunother., 16, pp. 98-100 (1983)). Such a method, however, risks undesirable side effects resulting from the use of cytotoxic drugs.
Therefore, conventional means for treating cancer and non-malignant tumors by either supplementing or enhancing the body's immune response are characterized by various disadvantages. The need, thus, exists for an effective process and composition which avoid those disadvantages while providing effective treatment for cancers and non-malignant tumors. |
Topical cyclosporine a 0.05% eyedrops in the treatment of vernal keratoconjunctivitis - randomized placebo-controlled trial. BACKGROUND Vernal keratoconjunctivitis (VKC) is a chronic, bilateral inflammation of the conjunctiva that mostly affects children and young adult males. Management of VKC is primarily aimed at reducing symptoms and preventing serious vision threatening sequelae. OBJECTIVES To assess the efficacy of topical cyclosporine A (CsA) 0.05% on the signs and symtomps in the management of VKC. MATERIAL AND METHODS This is a placebo-controlled, randomized prospective study. Sixty-two patients with VKC were included in this study. Patients were randomly assigned (1 : 1) to treatment with topical 0.05% CsA eyedrops or a placebo (artificial tears) for a period of 4 weeks, 4 times daily. Ocular signs and symptoms were in all patients scored at entry and at the end of 4 weeks. RESULTS When pre-treatment mean signs and symptoms scores were compared in both groups, there was no significant difference (p > 0.05). However, mean post-treatment scores as regards signs and symptoms were found to be lower in cyclosporine group than those in placebo group (p < 0.001). No side effects of the treatment with CsA 0.05% eyedrops were observed. CONCLUSIONS It was found that topical CsA 0.05% eyedrops were safe and effective in the treatment of patients with VKC. |
<reponame>ekovegeance/ComputerScience<filename>UAS ( Ujian Akhir Semester 1 )/Praktikum Pemrograman/UAS.py
# EKO SAPUTRA / 201420001 / IF1A
angka = input('Masukan angka: ')
if angka % 2 == 0:
print angka, 'adalah bilangan genap'
else:
print angka, 'adalah bilangan ganjil'
|
<gh_stars>1000+
import React from 'react'
import { ClickHandler } from '../types'
const styles = require('./close-button.css')
interface Props {
clickHandler: ClickHandler<HTMLElement>
title: string
}
/* tslint:disable-next-line variable-name */
const CloseButton = ({ clickHandler, title }: Props) => (
<button className={styles.close} onClick={clickHandler} title={title}>
<span className={styles.closeIcon} />
</button>
)
export default CloseButton
|
?�A Midland man faces drug charges after he was stopped by borough police in April.
Harris Pritchett Jr., 46, of 224 Midland Ave. was arrested around 4:20 p.m. April 28 after an officer found what he believed was crack cocaine in Pritchett�s pants pocket during a search. Police said they were acting on a tip that Pritchett was trying to hire someone to deliver drugs.
Pritchett was charged with possession with intent to deliver and solicitation.
?�Midland police have charged a Potter Township man with possession of marijuana and possession of drug paraphernalia.
Police said marijuana was found in the car of Sean Bishop, 27, of 158 Mowry Road around midnight May 9 during a traffic stop in the 800 block of Beaver Avenue in Midland.
?�A Midland man resisted officers and had to be shot twice with stun guns May 21, Midland police reported.
1:40 a.m. and refused to obey an officer�s orders to stop walking away.
Finger then tried to enter a row house on Fourth Street. He scuffled with two officers trying to handcuff him, police said, and each officer shot Finger with a stun gun before he was taken into custody.
?�A fight over children led to assault charges being filed against a Midland man.
Midland police reported that Jason Cottrill, 34, of 382 Ohio Ave. and John Sambol, no age or address given, got into a fight over their children at the Roadhouse 19 Bar at 805 Midland Ave. around 2:45 a.m. March 6.
Police said Cottrill head-butted Sambol above his right eye and punched a friend of Sambol�s. Sambol fell off a curb, injuring his face and shoulder.
Cottrill has been charged with simple assault and harassment.
?�An Ohioville woman has been charged after she choked a woman in Midland, borough police reported.
April Richards, 35, of 138 Valleyview Drive is accused of walking up behind Judy Coe, no age or address given, and choking Coe at the Midland Veterans of Foreign Wars post.
Richards has been charged with simple assault and harassment. |
<reponame>KelwinPF/orange-talents-03-template-ecommerce<gh_stars>0
package com.api.mercadolivre.dto;
import java.math.BigDecimal;
import java.util.List;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import javax.validation.constraints.Size;
import com.api.mercadolivre.configuration.Exists;
import com.api.mercadolivre.configuration.Repeated;
import com.api.mercadolivre.entity.Produto;
import com.api.mercadolivre.repository.CategoriaRepository;
import com.api.mercadolivre.repository.UsuarioRepository;
public class ProdutoDTO {
@NotBlank(message="insira um nome")
private String nome;
@NotNull
@Positive
private BigDecimal valor;
@NotNull
@Positive
private Integer quantidade;
@NotBlank(message="insira uma categoria")
@Size(max=1000)
private String descricao;
@NotNull
@Exists(table = "categorias")
private Long categoria;
@Size(min=3,message="a quantidade de caracteristicas tem que ser maior que 3")
@Valid
@Repeated(message="exitem caracteristicas repetidas")
private List<CaracteristicaDTO> caracteristicas;
@Deprecated
public void Produto() {
}
public ProdutoDTO(@NotBlank(message = "insira um nome") String nome, @NotNull @Positive BigDecimal valor,
@NotNull @Positive Integer quantidade, @Size(max = 1000) String descricao, @NotNull Long categoria,
@Size(min=3) @Valid List<CaracteristicaDTO> caracteristicas) {
super();
this.nome = nome;
this.valor = valor;
this.quantidade = quantidade;
this.descricao = descricao;
this.categoria = categoria;
this.caracteristicas = caracteristicas;
}
public List<CaracteristicaDTO> getCaracteristicas() {
return caracteristicas;
}
public Produto converter(CategoriaRepository categoriaRepository,
UsuarioRepository usuarioRepository, Long user) {
return new Produto(descricao, valor, quantidade, descricao
,categoriaRepository.getOne(categoria),usuarioRepository.getOne(user));
}
}
|
A Cascade Architecture for On-line Predictive Echo State Networks Isostearic acid, a liquid isomer of stearic acid, is used as an agent in a froth flotation process to concentrate the iron oxide in iron ores. By use of this flotation agent, the iron oxide in the ground ore is directly floated away from the remainder of the ore. The process enables a high amount of iron oxide to be concentrated from low grade ores. |
A deep neural network approach to investigate tone space in languages Phonological contrasts are usually signaled by multiple cues, and tonal languages typically involve multiple dimensions to distinguish between tones (e.g., duration, pitch contour, and voice quality, etc.). While the topic has been extensively studied, research has mostly used small datasets. This study employs a deep neural network (DNN) based speech recognizer trained on the AISHELL-1 () speech corpus (178 hours of read speech) to explore the tone space in Mandarin Chinese. A recent study shows that DNN models learn linguistically-interpretable information to distinguish between vowels (). Specifically, from a low-dimensional Bottleneck layer, the model learns features comparable to F1 and F2. In the current study, we propose a more complicated Long Short-Term Memory (LSTM) modelwith a Bottleneck layer implemented in the hidden layersto account for variable duration, an important cue for tone discrimination. By interpreting the features learned in the Bottleneck layer, we explore what acoustic dimensions are involved in distinguishing tones. The large amount of data from the speech corpus also renders the results more convincing and provides additional insights not possible from studies with more limited data sets.Phonological contrasts are usually signaled by multiple cues, and tonal languages typically involve multiple dimensions to distinguish between tones (e.g., duration, pitch contour, and voice quality, etc.). While the topic has been extensively studied, research has mostly used small datasets. This study employs a deep neural network (DNN) based speech recognizer trained on the AISHELL-1 () speech corpus (178 hours of read speech) to explore the tone space in Mandarin Chinese. A recent study shows that DNN models learn linguistically-interpretable information to distinguish between vowels (). Specifically, from a low-dimensional Bottleneck layer, the model learns features comparable to F1 and F2. In the current study, we propose a more complicated Long Short-Term Memory (LSTM) modelwith a Bottleneck layer implemented in the hidden layersto account for variable duration, an important cue for tone discrimination. By interpreting the features learned in the Bottleneck layer,... |
<gh_stars>100-1000
package com.haxademic.core.draw.textures.pgraphics;
import com.haxademic.core.app.P;
import com.haxademic.core.draw.context.PG;
import com.haxademic.core.draw.textures.pgraphics.shared.BaseTexture;
import com.haxademic.core.math.MathUtil;
import com.haxademic.core.math.easing.EasingFloat;
import com.haxademic.core.media.audio.analysis.AudioIn;
import processing.core.PVector;
public class TextureAudioTube
extends BaseTexture {
protected PVector _rotation = new PVector( 0, 0, 0 );
protected PVector _rotationTarget = new PVector( 0, 0, 0 );
protected EasingFloat _radius = new EasingFloat(0, 10);
protected EasingFloat _spacing = new EasingFloat(10, 6);
public TextureAudioTube( int width, int height ) {
super(width, height);
}
public void newLineMode() {
}
public void newRotation() {
float circleSegments = 8f;
float circleSegment = (float) ( Math.PI * 2f ) / circleSegments;
_rotationTarget.x = circleSegment * P.round( MathUtil.randRangeDecimal( 0, circleSegments ) );
_rotationTarget.y = (MathUtil.randBoolean() == true) ? 0 : circleSegment;
if(MathUtil.randBoolean() == true) _rotationTarget.y = P.PI/2f;
if(MathUtil.randBoolean() == true) _rotationTarget.y *= -1;
_rotationTarget.z = (MathUtil.randBoolean() == true) ? 0 : circleSegment;
if(MathUtil.randBoolean() == true) _rotationTarget.z *= -1;
// override for now:
// _rotationTarget.x = P.PI/2f;
_rotationTarget.y = P.PI/2f;
}
protected void updateRotation() {
_rotation.lerp(_rotationTarget, 0.2f );
_texture.rotateY( _rotation.y );
// _texture.rotateZ( _rotation.z );
_texture.rotateX( _rotation.x );
}
public void updateTiming() {
if(P.abs(_rotationTarget.y % P.PI/2f) < 0.01f) {
_radius.setTarget(MathUtil.randRangeDecimal(width/25f, width/15f));
} else {
_radius.setTarget(MathUtil.randRangeDecimal(width, width * 2));
}
_spacing.setTarget(MathUtil.randRangeDecimal(width/10f, width/5f));
}
public void updateDraw() {
// _texture.clear();
_texture.background(0);
_texture.ambientLight(102, 102, 102);
_texture.lightSpecular(204, 204, 204);
_texture.directionalLight(102, 102, 102, 0, 0, -1);
_texture.specular(255, 255, 255);
_texture.emissive(51, 51, 51);
_texture.ambient(50, 50, 50);
_texture.shininess(20.0f);
// PG.resetGlobalProps( _texture );
PG.setCenterScreen( _texture );
_texture.pushMatrix();
_radius.update();
_spacing.update();
updateRotation();
// drawEQ(100,8,height/3f,width/100f,2);
drawEQSmoothed(50,8,_radius.value(),_spacing.value(),8,2,2);
_texture.popMatrix();
}
protected void drawEQ(int numBands, int discReso, float radius, float spacing, float amp) {
float startX = -spacing * numBands/2f;
_texture.noStroke();
_texture.fill(200, 200, 200);
// _texture.rotateY(P.p.mouseX/100f);
// _texture.rotateX(P.p.mouseY/100f);
// draw EQ
float radSegment = P.TWO_PI / discReso;
for (int i = 1; i < numBands; i++) {
float lastEqVal = radius + radius * amp * AudioIn.audioFreq(i-1);
float eqVal = radius + radius * amp * AudioIn.audioFreq(i);
float curX = startX + i * spacing;
float lastX = startX + (i-1) * spacing;
_texture.beginShape(P.TRIANGLE_STRIP);
for (int j = 0; j <= discReso; j++) {
float curRads = j * radSegment + (i/10f); // last bit for a twist
_texture.vertex(lastX, P.sin(curRads) * lastEqVal, P.cos(curRads) * lastEqVal);
_texture.vertex(curX, P.sin(curRads) * eqVal, P.cos(curRads) * eqVal);
}
_texture.endShape();
}
}
protected void drawEQSmoothed(int numBands, int discReso, float radius, float spacing, float smoothsteps, float amp, float smoothEasing) {
float startX = -spacing * numBands/2f;
_texture.noStroke();
_texture.fill(255, 255, 255);
int from = _texture.color(0);
int to = _color; //_texture.color(255);
// _texture.stroke(200, 200, 200);
// _texture.fill(0, 0, 0);
// _texture.noFill();
// _texture.rotateY(P.p.mouseX/100f);
// _texture.rotateX(P.p.mouseY/100f);
// draw EQ
float spacingSubDiv = spacing / (smoothsteps);
float radSegment = P.TWO_PI / discReso;
for (int i = 1; i < numBands; i++) {
float lastEqVal = radius + radius * amp * AudioIn.audioFreq(i-1);
float eqVal = radius + radius * amp * AudioIn.audioFreq(i);
float curX = startX + i * spacing;
float lastX = startX + (i-1) * spacing;
float ampDiff = eqVal - lastEqVal;
_texture.fill( _texture.lerpColor(from, to, (float)i/numBands) );
// P.println("lastEqVal",lastEqVal);
// P.println("eqVal",eqVal);
// P.println("ampDiff",lastEqVal+ampDiff);
for (float subDivision = 1; subDivision <= smoothsteps; subDivision++) {
// interpolate the amplitude
float lastEqSubDiv = lastEqVal + ampDiff * MathUtil.easePowPercent((subDivision-1f)/smoothsteps, smoothEasing);
float curEqSubDiv = lastEqVal + ampDiff * MathUtil.easePowPercent((subDivision)/smoothsteps, smoothEasing);
// break up subdivision spacing
float subDivLastX = lastX + spacingSubDiv * (subDivision-1);
float subDivCurX = lastX + spacingSubDiv * subDivision;
// P.println("% ",(subDivision-1f)/smoothsteps);
// P.println("% ",(subDivision)/smoothsteps);
// if(subDivision == smoothsteps) P.println("curEqSubDiv",curEqSubDiv);
// P.println("subDivLastX ",subDivLastX);
// P.println("subDivCurX ",subDivCurX);
// _texture.noFill();
// if(subDivision == smoothsteps) _texture.fill(255, 255, 255);
_texture.beginShape(P.TRIANGLE_STRIP);
for (int j = 0; j <= discReso; j++) {
float curRads = j * radSegment;
_texture.vertex(subDivLastX, P.sin(curRads) * lastEqSubDiv, P.cos(curRads) * lastEqSubDiv);
_texture.vertex(subDivCurX, P.sin(curRads) * curEqSubDiv, P.cos(curRads) * curEqSubDiv);
}
_texture.endShape();
}
}
}
}
|
Roughly 1.4 million adults who live in the United States are transgender, according a new report released Thursday by the country’s leading researcher on LGBT demographics.
The figure doubles previous population estimates released in 2011 by the Williams Institute, a division of the UCLA School of Law. The revision, based on new federal data, comes amid an escalating national debate over transgender rights in which conservatives have often downplayed the need for nondiscrimination laws by citing the relatively low number of transgender people.
The report, titled "How Many Adults Identify as Transgender in the United States,” states that transgender people make up 0.6% of the country’s total population. That population is equivalent to that of a metropolis.
The report finds that the number of adults who identify as transgender range from state to state — with the lowest estimates in North Dakota and Iowa, at 0.3%, and the highest in Hawaii and California, at 0.8% of the population.
The figures are based on survey responses in 19 states collected by the Center for Disease Control’s Behavioral Risk Factor Surveillance System. In states where the CDC did not collect data on transgender people, researchers say they used statistical models to find ranges of likely population figures to establish credible estimates.
Younger people were more likely to report being transgender, the researchers reported.
“An estimated 0.7% of adults between the ages of 18 and 24 identify as transgender,” write Andrew Flores, Jody Herman, Gary Gates, and Taylor Brown. “Lower percentages of older adults identify as transgender, with 0.6% of adults age 25 to 64 and 0.5% of adults age 65 or older identifying as transgender."
Previous estimates, released by the institution in 2011, pegged the transgender population at 700,000. Researchers speculate that lower figure was due in part to fewer states reporting information and because transgender people may have been less willing to report their gender identity.
The report says more robust estimates are possible now due to better survey data, adding, “As new data collection efforts emerge at the state and national levels, estimates can continue to be refined to improve our understanding of the size and characteristics of the transgender population.” |
<reponame>baituo-china/baituo-ui
import React, { ReactNode } from 'react';
import PropTypes from 'prop-types';
import { FormField, FormFieldProps } from '../field/FormField';
import { ValidationMessages } from '../validator/Validator';
import { ViewMode } from './enum';
export interface RadioProps extends FormFieldProps {
/**
* <受控>是否选中
*/
checked?: boolean;
/**
* 初始是否选中
*/
defaultChecked?: boolean;
/**
* 显示模式
* 可选值: button | box
* @default box
*/
mode?: ViewMode;
}
export declare class Radio<T extends RadioProps> extends FormField<T & RadioProps> {
static displayName: string;
static propTypes: {
id: PropTypes.Requireable<string>;
size: PropTypes.Requireable<import("../core/enum").Size>;
suffixCls: PropTypes.Requireable<string>;
prefixCls: PropTypes.Requireable<string>;
title: PropTypes.Requireable<string>;
disabled: PropTypes.Requireable<boolean>;
hidden: PropTypes.Requireable<boolean>;
autoFocus: PropTypes.Requireable<boolean>;
style: PropTypes.Requireable<object>;
className: PropTypes.Requireable<string>;
tabIndex: PropTypes.Requireable<number>;
lang: PropTypes.Requireable<string>;
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
onBlur: PropTypes.Requireable<(...args: any[]) => any>;
onClick: PropTypes.Requireable<(...args: any[]) => any>;
onDoubleClick: PropTypes.Requireable<(...args: any[]) => any>;
onMouseUp: PropTypes.Requireable<(...args: any[]) => any>;
onMouseDown: PropTypes.Requireable<(...args: any[]) => any>;
onMouseMove: PropTypes.Requireable<(...args: any[]) => any>;
onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
onMouseOver: PropTypes.Requireable<(...args: any[]) => any>;
onMouseOut: PropTypes.Requireable<(...args: any[]) => any>;
onContextMenu: PropTypes.Requireable<(...args: any[]) => any>;
onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
onKeyUp: PropTypes.Requireable<(...args: any[]) => any>;
onKeyPress: PropTypes.Requireable<(...args: any[]) => any>;
dataSet: PropTypes.Requireable<object>;
type: PropTypes.Requireable<string>;
name: PropTypes.Requireable<string>;
value: PropTypes.Requireable<any>;
defaultValue: PropTypes.Requireable<any>;
required: PropTypes.Requireable<boolean>;
readOnly: PropTypes.Requireable<boolean>;
form: PropTypes.Requireable<string>;
dataIndex: PropTypes.Requireable<number>;
multiple: PropTypes.Requireable<boolean>;
rowSpan: PropTypes.Requireable<number>;
colSpan: PropTypes.Requireable<number>;
validator: PropTypes.Requireable<(...args: any[]) => any>;
validationRenderer: PropTypes.Requireable<(...args: any[]) => any>;
onInvalid: PropTypes.Requireable<(...args: any[]) => any>;
help: PropTypes.Requireable<string>;
showHelp: PropTypes.Requireable<import("../field/enum").ShowHelp>;
renderer: PropTypes.Requireable<(...args: any[]) => any>;
onChange: PropTypes.Requireable<(...args: any[]) => any>;
onInput: PropTypes.Requireable<(...args: any[]) => any>;
onEnterDown: PropTypes.Requireable<(...args: any[]) => any>;
/**
* <受控>是否选中
*/
checked: PropTypes.Requireable<boolean>;
/**
* 初始是否选中
*/
defaultChecked: PropTypes.Requireable<boolean>;
/**
* 显示模式
* 可选值: button | box
* @default box
*/
mode: PropTypes.Requireable<ViewMode>;
};
static defaultProps: {
suffixCls: string;
readOnly: boolean;
noValidate: boolean;
showHelp: string;
};
type: string;
readonly defaultValidationMessages: ValidationMessages | null;
readonly checkedValue: (T & RadioProps)["value"];
readonly isControlled: boolean;
getOtherProps(): Pick<Pick<Pick<any, string | number | symbol>, string | number | symbol>, string | number | symbol>;
renderWrapper(): ReactNode;
renderInner(): ReactNode;
/**
* 当使用label代替children时,不需要展示float label
*
* @readonly
* @memberof Radio
*/
readonly hasFloatLabel: boolean;
/**
* 没有children时,使用label替代children
*
* @returns {ReactNode} label
* @memberof Radio
*/
getLabelChildren(): ReactNode;
getChildrenText(): React.ReactNode;
getText(): JSX.Element | undefined;
getWrapperClassNames(...args: any[]): string;
isChecked(): (T & RadioProps)["checked"];
handleMouseDown(e: any): void;
handleChange(e: any): void;
setChecked(checked: boolean): void;
getOldValue(): any;
}
export default class ObserverRadio extends Radio<RadioProps> {
static defaultProps: {
suffixCls: string;
readOnly: boolean;
noValidate: boolean;
showHelp: string;
};
}
|
p38 Mitogen-activated Protein Kinase Activation by Ultraviolet A Radiation in Human Dermal Fibroblasts Abstract UVA radiation penetrates deeply into the skin reaching both the epidermis and the dermis. We thus investigated the effects of naturally occurring doses of UVA radiation on mitogen-activated protein kinase (MAPK) activities in human dermal fibroblasts. We demonstrated that UVA selectively activates p38 MAPK with no effect on extracellular-regulated kinases (ERK1ERK2) or JNKSAPK (cJun NH2-terminal kinasestress-activated protein kinase) activities. We then investigated the signaling pathway used by UVA to activate p38 MAPK. l-Histidine and sodium azide had an inhibitory effect on UVA activation of p38 MAPK, pointing to a role of singlet oxygen in transduction of the UVA effect. Afterward, using prolonged cell treatments with growth factors to desensitize their signaling pathways or suramin to block growth factor receptors, we demonstrated that UVA signaling pathways shared elements with growth factor signaling pathways. In addition, using emetine (a translation inhibitor altering ribosome functioning) we detected the involvement of ribotoxic stress in p38 MAPK activation by UVA. Our observations suggest that p38 activation by UVA in dermal fibroblasts involves singlet oxygendependent activation of ligandreceptor signaling pathways or ribotoxic stress mechanism (or both). Despite the activation of these two distinct signaling mechanisms, the selective activation of p38 MAPK suggests a critical role of this kinase in the effects of UVA radiation. |
package cn.zull.lpc.practice.spring.cache.dto;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* @author zurun
* @date 2020/3/25 14:27:41
*/
@Data
@Accessors(chain = true)
public class CacheRespDTO {
private Integer code;
private String traceId;
private Data data;
@lombok.Data
@Accessors(chain = true)
public static class Data {
private String name;
private Integer age;
}
}
|
package shop.main.controller.admin;
import static shop.main.controller.admin.AdminController.ADMIN_PREFIX;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.stream.Collectors;
import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import shop.main.data.entity.StaticPage;
import shop.main.data.service.StaticPageService;
@Controller
@RequestMapping(value = { ADMIN_PREFIX })
public class AdminStaticPageController extends AdminController {
static final String FOLDER_PREFIX = "";
@Autowired
private StaticPageService service;
@RequestMapping(value = "pages")
public String pagesList(Model model) {
loadTableData("", null, 1, PAGE_SIZE, model);
return "../admin/staticPages/pages";
}
@RequestMapping(value = "/findStaticPages", method = RequestMethod.POST)
public String findPages(@RequestParam String name, @RequestParam String status,
@RequestParam(value = "current", required = false) Integer current,
@RequestParam(value = "pageSize", required = false) Integer pageSize, Model model) {
loadTableData(name, status, current, pageSize, model);
return "../admin/staticPages/_table";
}
private void loadTableData(String name, String status, Integer current, Integer pageSize, Model model) {
Pageable pageable = new PageRequest(current - 1, pageSize);
model.addAttribute("pagesList", service.findByNameAndStatus(name, status, pageable));
model.addAttribute("current", current);
model.addAttribute("pageSize", pageSize);
addPaginator(model, current, pageSize, service.countByNameAndStatus(name, status));
}
@RequestMapping(value = "page", method = RequestMethod.POST)
public String savePage(@ModelAttribute("page") @Valid StaticPage page, BindingResult result, Model model,
final RedirectAttributes redirectAttributes) {
if (result.hasErrors()) {
model.addAttribute("errorSummary", result.getFieldErrors().stream()
.map(e -> e.getField() + " error - " + e.getDefaultMessage() + " ").collect(Collectors.toList()));
redirectAttributes.addFlashAttribute("errorMessage", "URL is not unique!");
return "../admin/staticPages/edit_page";
} else if (page.isNew() && !service.checkUniqueURL(page)) {
model.addAttribute("errorSummary", new ArrayList<String>(Arrays.asList("URL is not unique!")));
model.addAttribute("urlError", "has-error");
return "../admin/staticPages/edit_page";
} else {
if (page.isNew()) {
redirectAttributes.addFlashAttribute("flashMessage", "Category added successfully!");
} else {
redirectAttributes.addFlashAttribute("flashMessage", "Category updated successfully!");
}
service.save(page);
return "redirect:" + ADMIN_PREFIX + "pages";
}
}
@RequestMapping(value = "page/add", method = RequestMethod.GET)
public String addPage(Model model) {
model.addAttribute("page", new StaticPage());
model.addAttribute("urlError", "");
return "../admin/staticPages/edit_page";
}
@RequestMapping(value = "page/{id}/update", method = RequestMethod.GET)
public String editPage(@PathVariable("id") long id, Model model) {
model.addAttribute("page", service.findById(id));
model.addAttribute("urlError", "");
return "../admin/staticPages/edit_page";
}
@RequestMapping(value = "page/{id}/delete", method = RequestMethod.GET)
public String deletePage(@PathVariable("id") long id, Model model, final RedirectAttributes redirectAttributes) {
service.deleteById(id);
redirectAttributes.addFlashAttribute("flashMessage", "Category deleted successfully!");
return "redirect:" + ADMIN_PREFIX + "pages";
}
}
|
//
// EVServerRequest.h
//
// Library: evnet
// Package: HTTPServer
// Module: EVServerRequest
//
// Definition of the EVServerRequest class.
//
#ifndef EVNet_EVServerRequest_INCLUDED
#define EVNet_EVServerRequest_INCLUDED
#include "Poco/Net/Net.h"
namespace Poco {
namespace evnet {
class Net_API EVServerRequest
/// This is a marker class for any server reuqest
/// representing server-side requests.
///
{
public:
EVServerRequest();
/// Creates the EVServerRequest, using the
/// given EVServerSession.
~EVServerRequest();
/// Destroys the EVServerRequest.
};
} } // namespace Poco::evnet
#endif // EVNet_EVServerRequest_INCLUDED
|
<gh_stars>0
package main
import (
"bufio"
"fmt"
"os"
"strconv"
)
func parseEntries(scanner *bufio.Scanner) ([]int, error) {
frequencyChanges := []int{}
for scanner.Scan() {
change, err := strconv.Atoi(scanner.Text())
if err != nil {
return frequencyChanges, err
}
frequencyChanges = append(frequencyChanges, change)
}
return frequencyChanges, nil
}
func partOne(frequencyChanges []int) (int, error) {
resultingFrequency := 0
for _, change := range frequencyChanges {
resultingFrequency += change
}
return resultingFrequency, nil
}
func partTwo(frequencyChanges []int) (int, error) {
resultingFrequency := 0
frequencies := map[int]bool{resultingFrequency: true}
for {
for _, change := range frequencyChanges {
resultingFrequency += change
if frequencies[resultingFrequency] {
return resultingFrequency, nil
}
frequencies[resultingFrequency] = true
}
}
}
func main() {
input, err := os.Open("input")
if err != nil {
panic(err)
}
scanner := bufio.NewScanner(input)
frequencyChanges, err := parseEntries(scanner)
if err != nil {
panic(err)
}
result, err := partOne(frequencyChanges)
fmt.Println("[Part one] Result is:", result)
result, err = partTwo(frequencyChanges)
fmt.Println("[Part two] Result is:", result)
}
|
package org.northcoder.luceneanalyzertester.analyzers;
import java.io.IOException;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.List;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.Tokenizer;
import org.apache.lucene.analysis.Analyzer;
import org.northcoder.luceneanalyzertester.tokenizers.DemoCustomTokenizer;
public class DemoCustomAnalyzerWithCustomTokenizer extends Analyzer {
@Override
protected Analyzer.TokenStreamComponents createComponents(String fieldName) {
final Tokenizer source = new DemoCustomTokenizer();
TokenStream tokenStream = source;
return new TokenStreamComponents(source, tokenStream);
}
public List<TestHelper> getTests() throws IOException {
List<TestHelper> testCases = new ArrayList();
testCases.add(new TestHelper(
"number found",
"123", 1,
Arrays.asList("123 #456"),
this));
testCases.add(new TestHelper(
"number following hash not found",
"456", 0,
new ArrayList<>(),
this));
testCases.add(new TestHelper(
"number following hash found",
"#456", 1,
Arrays.asList("123 #456"),
this));
return testCases;
}
}
|
A website with the main purpose of having people read content would best serve its readers with almost nothing else but what’s needed for the reading experience.
Strip a site of all its distraction, cruft, gimmicks, promotions, advertising, social sharing and more … and all you have is the pure reading experience.
A minimalist website. Perfect for the readers, which is perfect for the writer. Not so perfect for advertisers and marketers, perhaps, but we’re not creating sites for them. We’re creating sites for us.
What’s necessary for a pure, perfect reading experience?
Nothing else.Here’s what a minimalist website should leave out:
ads
cookies
tracking
popups
sharing buttons
comments
multiple pages/slides per article
Facebook or other social widgets
a widget showing recent comments or tweets
tags or related posts
syndicated content widgets taking them to other sites so you’ll get money
something screaming for the reader to sign up for your newsletter
In addition, a minimal site might also feature:
minimal images (none, or only the most necessary)
the logo of the site in CSS-styled text, not an image
small page weight
short urls (without .php, .asp, .aspx, .html, dates, categories or other items in the url) — see the url of the posts on this site as an example
Are there examples of this on the web? Sure, there are plenty. My sites, mnmlist.com, Zen Habits, and leobabauta.com are three examples, but there are many others that come close. Recent networks svtle and mediumand feathe.rs come to mind. And there’s also obtvse. I admire Paul Graham, and Sam Stephenson has only published a couple of articles, but they look great.
why minimal?
Bloggers and website creators get so caught up in things that they lose sight of what’s the most important thing: creating a great experience for the reader. The person coming to your site isn’t a customer, a potential mailing list subscriber, a consumer of advertising, a person who wants to be marketed to, a buyer of your affiliate products, a Facebook or Twitter follower … he’s a person who simply wants some information or entertainment from what you’ve written.
The person (I affectionately call her “my dear reader” but really she’s a person) just wants to read what you have to offer, and perhaps at that point might want to read more or even subscribe. All the other things you might put on your site are not for the reader.
When you create an amazing reading experience for the reader, he or she will appreciate it. The reader will love your great content (I hope), and then decide whether to bookmark it, email it, share it, subscribe, whatever. But without the reading experience, all the rest isn’t happening.
All the other stuff is distracting. It detracts from the experience. Sure, maybe it’ll help you reach your goals as a writer/site creator, but it doesn’t help the reader reach her goals. So if you put the distractions in to meet your goals, what message are you sending? That your goals are more important than those of the person who has graciously consented to come to your site and give you the gift of her attention.
but what about …
Comments: The comments in most cases detract from the reading experience. They’re not necessary for reading. Good discussion of the post can be continued elsewhere, such as on Twitter or Facebook or other people’s blogs, if they find the post worth talking about. For a few years, I had comments on my site, and they weren’t the worst thing, but I’ve come to the conclusion that they’re unnecessary.
Subscriptions: Don’t popups and big subscription boxes and other such things that ask the reader to subscribe to your mailing list get much better conversion numbers? Sure, in the short term, your numbers will go up. But those are unimportant numbers. Much more important: How much did you delight the reader? How many readers did you lose because you disrespected them with a popup or screaming in the sidebar asking them to subscribe? How much trust did you lose? Who did you help with this popup? Try measuring those numbers with your analytics.
Sharing: Don’t you need sharing buttons to succeed in social media and get a million followers? No, and anyway, that’s not very important. I’ve succeeded in large part without sharing buttons (I had them for awhile but removed them) because what I focus on is what I think the reader wants most — the article. If they want to share, they know how to do that. And for those who just care about the article, and not sharing, having a million sharing buttons in their face just ruins the reading experience.
Analytics: How do I know if I’m growing without analytics? You don’t really, and honestly, it doesn’t matter as much as people think. I used to track my blog’s statistics, and when you track something like that, it becomes your world. You care so much about growing it that you do things aimed directly at growing the numbers. And that’s crazy — the numbers don’t matter that much. What matters is helping your readers, delighting them, changing their lives. You don’t do those things by worrying about the numbers — you do them by worry about the readers. And when you do that, the growth comes as a byproduct of being great.
Making money: I am a strong believer in making a living doing what you love, but does it really feel good to force your readers to look at crappy ads or see a “Sponsored By” post in their inbox, so you can make a few bucks? I used to do it, and it grated on me, because I personally detest advertising. It’s a daily annoyance that we put up with in order to get what we want (watch the news, be entertained, ride the bus, read good articles) but why put your readers through this annoyance? You can make money as a writer or website creator without ads, without being a slimy marketer. Just build an audience by being useful and trustworthy, then help them with books, courses, software, a service, or whatever you can create that helps them even more deeply. Making money by helping people? Now that feels good. |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import os.path
from shutil import copyfile
from docx2html import convert
import docx
import re
import codecs
import MySQLdb
import sys
import os
import shutil
import zipfile
import sys
reload(sys);
sys.setdefaultencoding("utf8")
f = open('sample.html', 'w')
html = convert(sys.argv[1])
print >> f,html
f.close()
print "50%"
shutil.copyfile(sys.argv[1],'undergo.ZIP')
f=zipfile.ZipFile('undergo.zip','r') #进行解压
for file in f.namelist():
f.extract(file)
#file=open(word\embeddings\oleObject1.bin','rb').read() #进入文件路径,读取二进制文件。
#for f in file:
# print f
shutil.move('word/media/','image/')
print "100%" |
Propagation of signal quality in the distributed control system Describes a generic approach to quality propagation which does not depend on specific function blocks and can be easily customized to the specific application. Every signal in the DCS will include quality as an integral part, and the quality will travel with the signal. Quality is defined as a set of bits which allows quality from several inputs to be merged without losing information. User definable bits are provided to support application specific quality propagation. |
package firenoo.sim.env;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import firenoo.lib.misc.BiIntFunction;
import firenoo.lib.structs.MinPriorityQueue;
import firenoo.lib.data.SaveHelper;
import firenoo.sim.log.Logger;
public class Environment implements IEnvironment {
public static final Logger LOGGER;
static {
File file = new File("log.txt");
OutputStream fileOut = System.out;
try {
file.createNewFile();
fileOut = new FileOutputStream(file, true);
} catch(IOException e) {
e.printStackTrace();
} finally {
LOGGER = new Logger(fileOut);
}
}
//update rate in updates per second
public static final int UPS = 1;
public static final int MAJOR_VERSION = 0;
public static final int MINOR_VERSION = 1;
private int globalTime;
private int ups;
private ITile[][] tiles;
private int width, height;
private MinPriorityQueue<Runnable> process;
private CellMoveHandler moveHandler;
public Environment(int width, int height) {
this(width, height, (x, y) -> {
if(x == 0 || y == 0 || x == width - 1 || y == height - 1) {
return 1;
} else {
return 2;
}
});
}
public Environment(int width, int height, BiIntFunction func) {
this.globalTime = 0;
this.width = width;
this.height = height;
//Row-major order
this.tiles = new ITile[height][width];
this.moveHandler = new CellMoveHandler();
this.process = new MinPriorityQueue<>((width * height - (2 * (width + height - 2))) * 2);
init(func);
}
private void init(BiIntFunction func) {
for(int i = 0; i < height; i++) {
for(int j = 0; j < width; j++) {
int t = func.apply(j, i);
if(t == 1) {
this.tiles[i][j] = Tile.createBlockTile(j, i);
} else if(t == 2) {
this.tiles[i][j] = new Tile(0, j, i);
}
}
}
}
@Override
public void beginLoop() {
Thread thread = new Thread(() -> {
while(true) {
try {
onCycleUpdate(globalTime++);
System.out.println(this);
Thread.sleep(1000 / UPS);
} catch(InterruptedException e) {
e.printStackTrace();
}
}
}, "game_thread");
thread.start();
}
@Override
public ITile[][] getTiles() {
return tiles;
}
@Override
public ITile getTile(int x, int y) {
if(x < 0 || y < 0 || x >= width || y >= height) {
return null;
} else {
return tiles[y][x];
}
}
@Override
public ITile getTile(int x, int y, int neighbor) {
//nswe
switch(neighbor) {
case 0:
return getTile(x, y - 1);
case 1:
return getTile(x - 1, y);
case 2:
return getTile(x, y - 1);
case 3:
return getTile(x + 1, y);
}
return null;
}
@Override
public ITile[] getNeighbors(int x, int y) {
return new ITile[]{
getTile(x, y, 0),
getTile(x, y, 1),
getTile(x, y, 2),
getTile(x, y, 3)
};
}
/**
* Every cycle, this is called.
* @param globalTime
*/
@Override
public void onCycleUpdate(int globalTime) {
for(int i = 0; i < tiles.length; i++) {
for(int j = 0; j < tiles[i].length; j++) {
ITile tile = tiles[i][j];
if(tile.getCell() != null) {
if(tile.getCell().getBehavior() != null) {
ITile[][] vision = getTilesInRange(j, i, tile.getCell().getBehavior().getVisionRange());
process.enqueue(() -> tile.getCell().getBehavior().eatEvent(vision, globalTime), tile.getX() + tile.getY() * width);
process.enqueue(() -> tile.getCell().getBehavior().moveEvent(vision, moveHandler, globalTime), (width * height) + (tile.getX() + tile.getY() * width));
}
}
}
}
while(!process.isEmpty()) {
process.dequeue().run();
}
moveHandler.resolveAll(tiles);
}
@Override
public int getGlobalTime() {
return globalTime;
}
@Override
public ITile[][] getTilesInRange(int x, int y, int r) {
if(r > width) r = width;
if(r > height) r = height;
int diameter = r * 2 + 1;
ITile[][] result = new ITile[diameter][diameter];
for(int i = 0; i < diameter; i++) {
for(int j = 0; j < diameter; j++) {
if(IEnvironment.taxicabDist(x - r + j, y - r + i, x, y) <= r) {
result[i][j] = getTile(x - r + j, y - r + i);
}
}
}
return result;
}
@Override
public String toString() {
StringBuilder b = new StringBuilder();
b.append(super.toString()).append('\n');
for(int i = 0; i < tiles.length; i++) {
for(int j = 0; j < tiles[i].length; j++) {
b.append(tiles[i][j].toString());
}
b.append('\n');
}
return b.toString();
}
@Override
public void serialize(String fileName) {
try(FileOutputStream stream = new FileOutputStream(fileName)) {
LOGGER.logf("Serializing instance to %s", fileName);
SaveHelper.writeInt(MAJOR_VERSION, stream);
SaveHelper.writeInt(MINOR_VERSION, stream);
SaveHelper.writeInt(width, stream);
SaveHelper.writeInt(height, stream);
SaveHelper.writeInt(ups, stream);
SaveHelper.writeInt(globalTime, stream);
for(ITile[] row : tiles) {
for(ITile tile : row) {
tile.serialize(stream);
}
}
SaveHelper.writeInt(process.elementCt(), stream);
while(!process.isEmpty()) {
int currentTileIndex = process.peekPriority();
int processPhase = currentTileIndex >= width * height ? 1 : 0;
int x = currentTileIndex / width;
int y = currentTileIndex % width;
if(processPhase == 0) {
SaveHelper.writeByte((byte) 1, stream);
} else {
SaveHelper.writeByte((byte) 2, stream);
}
SaveHelper.writeInt(x, stream);
SaveHelper.writeInt(y, stream);
process.dequeue();
}
LOGGER.logf("Serialization successful.");
} catch(IOException e) {
LOGGER.errorf("Serialization failed, error printed below");
LOGGER.errorf(e.getLocalizedMessage());
for(StackTraceElement ste : e.getStackTrace()) {
LOGGER.errorf(ste.toString());
}
}
}
public static Environment deserialize(String fileName) throws IOException {
FileInputStream stream = new FileInputStream(fileName);
int majVer = SaveHelper.readInt(stream);
int minVer = SaveHelper.readInt(stream);
int width = SaveHelper.readInt(stream);
int height = SaveHelper.readInt(stream);
Environment env = new Environment(width, height);
LOGGER.logf("Deserializing from %s", fileName);
if(majVer != MAJOR_VERSION) {
//warning for wrong version
LOGGER.warn("Major version is not the same, may cause unexpected behavior.");
}
if(minVer != MINOR_VERSION) {
//warning for minor version
LOGGER.warn("Minor version is not the same, may cause unexpected behavior.");
}
env.ups = SaveHelper.readInt(stream);
env.globalTime = SaveHelper.readInt(stream);
for(int i = 0; i < height; i++) {
for(int j = 0; j < width; j++) {
env.tiles[i][j] = Tile.deserialize(j, i, stream);
//env.logger.logf("Loaded position %d, %d", j, i);
}
}
int nextUpdate = SaveHelper.readInt(stream);
for(int i = 0; i < nextUpdate; i++) {
int type = stream.read();
int x = SaveHelper.readInt(stream);
int y = SaveHelper.readInt(stream);
if(type == 1) {
ITile tile = env.getTile(x, y);
ITile[][] vision = env.getTilesInRange(x, y, tile.getCell().getBehavior().getVisionRange());
env.process.enqueue(() -> tile.getCell().getBehavior().eatEvent(vision, env.globalTime), x + (y * width));
} else if(type == 2) {
ITile tile = env.getTile(x, y);
ITile[][] vision = env.getTilesInRange(x, y, tile.getCell().getBehavior().getVisionRange());
env.process.enqueue(() -> tile.getCell().getBehavior().moveEvent(vision, env.moveHandler, env.globalTime), x + (y * width) + (width * height));
} else {
LOGGER.errorf("Move process %d: Type cannot be discerned.", i);
throw new IOException("Type cannot be discerned.");
}
}
LOGGER.logf("Deserialization successful.");
return env;
}
} |
About methods for visualizing network monitoring Today effective management of computer networks becomes extremely important task which is based on network data monitoring. However, a rapid growth of the network traffic volume is lead to the accumulation of large amounts of data in monitoring systems and the resulting becomes difficultly it processing and analysis. Therefore, there is a need in use of more effective visualization methods of network data that will allow network administrators to carry out virtually instant visual monitoring of the network. The paper discusses and analyzes some of the existent visualization methods of networks data, which are used for monitoring and management of computer networks. |
Paying a toll to get around traffic and how to pay for Metro are the major issues for the next year in the transportation world. News4's Adam Tuss reports.
Paying a toll to get around traffic and how to pay for Metro are the major issues for the next year in the transportation world.
From Interstate 66 in northern Virginia to Interstate 270 and the Baltimore Washington Parkway in Maryland to the Capital Beltway surrounding Washington, D.C., 2018 is going to be a year filled with huge transportation projects. The District will also content with finding funding for Metro.
Along I-66, expect to see major construction from Gainesville, Virginia to the Capital Beltway as new express toll lanes are added. Two new lanes in each direction will run alongside three regular lanes.
It is a massive project that will create big construction headaches, and the construction will last four more years.
In Maryland, Gov. Larry Hogan wants to get several major transportation projects off the ground.
He has proposed express toll lanes along the I-270 corridor, the Maryland side of the Beltway and the B-W Parkway, with two new toll lanes in each direction of those roads. It's still not clear exactly how long it would take to build these projects, but the state is confident they will be done.
For Metro, the general manager has unveiled a budget that calls for no fare hikes and no service cuts but required $165 million more from jurisdictions to help fund the system. Metro said other than maintenance, most of the new funding it gets in 2018 will go toward buying more of those new 7000-series rail cars, which are also supposed to provide a safer ride. |
In our working and living environments in modern times, fire hazard exists everywhere in limited spaces, such as machines, electrical devices, automobiles, electric cabinets, all kinds of household electric appliances, computers, TV sets, kitchens, etc., and spontaneous ignition of wires or engines often occur due to extremely high temperature. Usually, using a hand-held fire suppression apparatus to suppress such small-scale fire timely can get twice the result with half the effort.
In the prior art, the research on miniaturization of aerosol fire suppression apparatuses and including introduction of them into fire suppression applications in small spaces (e.g., household electrical appliances) has been made actively in foreign countries, and much progress has been achieved. For example, the products introduced by Firecom (Italy) mainly for kitchens don't have cooling and heat insulation parts. However, the fire extinguisher has the following major drawbacks: 1. The aerosol spurts out directly after the medical is ignited, the temperature at the jet orifice is as high as 1200° C. or above, and the flame length is up to 100 mm, and therefore may cause scalding. 2. The handle doesn't have enough strength, and may deform when force is applied on it. In addition, the battery is not convenient to install, and there is no way to judge whether the battery has to be replaced or not after long-time use. Up to now, no hand-held aerosol fire suppression apparatus product is available in the domestic market yet. |
OP0017The impact of the duration of bisphosphonate drug holidays on hip fracture rates Background Given FDA warnings, drug holidays (temporary or permanent discontinuation) of bisphosphonates (BPs) after long-term (35 years) continuous therapy is becoming increasingly common in the United States (US). However, the benefits and risks of stopping BPs, and the optimal timing to restart, remain unclear. Objectives We conducted a population-based cohort study of women on long term BP therapy to evaluate the rate of hip fracture following a drug holiday. Methods We used Medicare data (20062014) to identify all women with medical and pharmacy coverage who initiated a BP and were at least 80% adherent for ≥3 years (baseline), at which follow-up time began. Patients using other bone therapies (e.g. denosumab, oestrogen, teriparatide, calcitonin) were excluded or censored if they started after follow-up began. We calculated crude rates of hip fracture for continuing BP therapy and among those who discontinued, for categories of time since discontinuing (i.e., length of drug holiday), extending up to 3 years. We used Cox proportional hazards models to evaluate the risk of discontinuing per the length of the drug holiday, using age as the time axis and controlling for potentially confounding factors, with and without adjusting for death as a competing risk. Results We identified 156236 women who were highly adherent, long-term BP users. The mean (SD) age was 78.5 (7.5) years. The most commonly used BPs were alendronate (71.7% ever use, 52% exclusive use) and zoledronic acid (16.2% ever use, 8.9% exclusive use). During a median (IQR) followup of 2.1 (1.0, 3.3) years, 62676 (40.1%) of women stopped BP therapy for at least 6 months or more. Among these women, 7947 (12.7%) subsequently restarted any BP. Overall, 16904 (10.8%) died. A total of 3745 hip fractures occurred during follow-up. Hip fracture rates were lowest among women who were current users, and gradually increased as the length of the drug holiday increased, achieving their maximum with a drug holiday >2 years (table 1).Abstract OP0017 Table 1 Hip fracture rate by duration of BP drug holiday, adjusting for competing risk of death Time since Bisphosphonate Discontinuation (yrs) Number of hip fractures, n Crude Incidence Rate per 1000 person-years Adjusted* Hazard Ratio(95%CI) 0 (i.e. current use) 1958 9.6 (9.210.1) 1.0 (reference) >0to≤3months 530 13.1 (12.014.3) 1.29 (1.171.42) >3months≤1year 539 12.0 (11.013.1) 1.12 (1.021.24) >1to≤2years 422 13.3 (12.014.6) 1.21 (1.091.35) >2to≤3years 235 15.7 (13.717.8) 1.39 (1.211.59) *adjusted for age, region, race, rural or urban, median income, calendar year, comorbidity(fragility fracture, charlson comorbidity index score), DXA, number of physician visits, care by a rheumatologist or endocrinologist, long term care residence, vitamin D deficiency, glucocorticoids, and proton pump inhibitors Conclusions In a large cohort of U.S. women, a BP drug holiday greater than 2 years was associated with a significantly increased risk for hip fracture of up to 39% compared to continued BP use. Disclosure of Interest J. Curtis Grant/research support from: AbbVie, Amgen, BMS, Corrona, Janssen, Lilly, Myriad, Pfizer, Roche/Genentech, UCB, Consultant for: AbbVie, Amgen, BMS, Corrona, Janssen, Lilly, Myriad, Pfizer, Roche/Genentech, UCB, R. Chen Grant/research support from: Amgen, Z. Li Grant/research support from: Amgen, T. Arora Grant/research support from: Amgen, K. Saag Grant/research support from: Amgen, Merck, Consultant for: Amgen, Merck, Radius, N. Wright: None declared, S. Daigle: None declared, M. Kilgore Grant/research support from: Amgen, E. Delzell: None declared |
/**
* **** BEGIN LICENSE BLOCK *****
* Version: EPL 2.0/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Eclipse Public
* License Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.eclipse.org/legal/epl-v10.html
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* Copyright (C) 2009-2012 <NAME> <<EMAIL>>
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the EPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the EPL, the GPL or the LGPL.
* **** END LICENSE BLOCK *****
*/
package org.jruby.embed;
import org.jruby.RubyObjectAdapter;
import org.jruby.runtime.Block;
/**
* Wrapper interface of RubyObjectAdapter for embedding. Methods' arguments can have
* simple Java objects for easiness. Each methods converts returned object
* to a Java type specified in the argument.
*
* @author <NAME> <<EMAIL>>
*/
public interface EmbedRubyObjectAdapter extends RubyObjectAdapter {
/**
* Executes a method defined in Ruby script.
*
* @param receiver is an instance that will receive this method call
* @param methodName is a method name to be called
* @param args are method arguments.
* @return an instance automatically converted from Ruby to Java
*/
Object callMethod(Object receiver, String methodName, Object... args);
/**
* Executes a method defined in Ruby script. This method is used when a Ruby
* method has a block in its arguments.
*
* @param receiver is an instance that will receive this method call
* @param methodName is a method name to be called
* @param args is an array of method arguments except a block
* @param block is a block to be executed in this method
* @return an instance of automatically converted Java type
*/
Object callMethod(Object receiver, String methodName, Block block, Object... args);
/**
* Executes a method defined in Ruby script. This method is used when a Ruby
* method does not have any argument.
*
* @param receiver is an instance that will receive this method call
* @param methodName is a method name to be called
* @param returnType is the type we want it to convert to
* @return an instance of requested Java type
*/
<T> T callMethod(Object receiver, String methodName, Class<T> returnType);
/**
* Executes a method defined in Ruby script. This method is used when a Ruby
* method have only one argument.
*
* @param receiver is an instance that will receive this method call
* @param methodName is a method name to be called
* @param singleArg is an method argument
* @param returnType returnType is the type we want it to convert to
* @return an instance of requested Java type
*/
<T> T callMethod(Object receiver, String methodName, Object singleArg, Class<T> returnType);
/**
* Executes a method defined in Ruby script. This method is used when a Ruby
* method have multiple arguments.
*
* @param receiver is an instance that will receive this method call
* @param methodName is a method name to be called
* @param args is an array of method arguments
* @param returnType is the type we want it to convert to
* @return an instance of requested Java type
*/
<T> T callMethod(Object receiver, String methodName, Object[] args, Class<T> returnType);
/**
* Executes a method defined in Ruby script. This method is used when a Ruby
* method have multiple arguments, one of which is a block.
*
* @param receiver is an instance that will receive this method call
* @param methodName is a method name to be called
* @param args is an array of method arguments except a block
* @param block is a block to be executed in this method
* @param returnType is the type we want it to convert to
* @return an instance of requested Java type
*/
<T> T callMethod(Object receiver, String methodName, Object[] args, Block block, Class<T> returnType);
/**
* Executes a method defined in Ruby script. This method is used when a Ruby
* method does not have any argument, and users want to inject Ruby's local
* variables' values from Java.
*
* @param receiver is an instance that will receive this method call
* @param methodName is a method name to be called
* @param returnType is the type we want it to convert to
* @param unit is parsed unit
* @return an instance of requested Java type
*/
<T> T callMethod(Object receiver, String methodName, Class<T> returnType, EmbedEvalUnit unit);
/**
* Executes a method defined in Ruby script. This method is used when a Ruby
* method have multiple arguments, and users want to inject Ruby's local
* variables' values from Java.
*
* @param receiver is an instance that will receive this method call
* @param methodName is a method name to be called
* @param args is an array of method arguments
* @param returnType is the type we want it to convert to
* @param unit is parsed unit
* @return an instance of requested Java type
*/
<T> T callMethod(Object receiver, String methodName, Object[] args, Class<T> returnType, EmbedEvalUnit unit);
/**
* Executes a method defined in Ruby script. This method is used when a Ruby
* method have multiple arguments, one of which is a block, and users want to
* inject Ruby's local variables' values from Java.
*
* @param receiver is an instance that will receive this method call
* @param methodName is a method name to be called
* @param args is an array of method arguments except a block
* @param block is a block to be executed in this method
* @param returnType is the type we want it to convert to
* @param unit is parsed unit
* @return is the type we want it to convert to
*/
<T> T callMethod(Object receiver, String methodName, Object[] args, Block block, Class<T> returnType, EmbedEvalUnit unit);
/**
*
* @param receiver is an instance that will receive this method call
* @param args is an array of method arguments
* @param returnType is the type we want it to convert to
* @return is the type we want it to convert to
*/
<T> T callSuper(Object receiver, Object[] args, Class<T> returnType);
/**
*
* @param receiver is an instance that will receive this method call
* @param args is an array of method arguments except a block
* @param block is a block to be executed in this method
* @param returnType is the type we want it to convert to
* @return is the type we want it to convert to
*/
<T> T callSuper(Object receiver, Object[] args, Block block, Class<T> returnType);
/**
* Executes a method defined in Ruby script.
*
* @param returnType is the type we want it to convert to
* @param receiver is an instance that will receive this method call. The receiver
* can be null or other Java objects. The null will be converted to
* RubyNil or wrapped in RubyObject.
* @param methodName is a method name to be called
* @param block is an optional Block object. Send null for no block.
* @param args is an array of method arguments
* @return an instance of requested Java type
*/
<T> T runRubyMethod(Class<T> returnType, Object receiver, String methodName, Block block, Object... args);
}
|
/*
* Copyright 2020 <NAME>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package interfaces
import (
"io"
)
type ApiPlaybackEvent string
const (
// Internal events
EventStart ApiPlaybackEvent = "start"
EventStop ApiPlaybackEvent = "stop"
// Outgoing events
EventTimeUpdate ApiPlaybackEvent = "TimeUpdate"
EventPause ApiPlaybackEvent = "Pause"
EventUnpause ApiPlaybackEvent = "Unnpause"
EventVolumeChange ApiPlaybackEvent = "VolumeChange"
EventRepeatModeChange ApiPlaybackEvent = "RepeatModeChange"
EventAudioTrackChange ApiPlaybackEvent = "AudioTrackChange"
EventSubtitleTrackChange ApiPlaybackEvent = "SubtitleTrackChange"
EventPlaylistItemMove ApiPlaybackEvent = "PlaylistItemMove"
EventPlaylistItemRemove ApiPlaybackEvent = "PlaylistItemRemove"
EventPlaylistItemAdd ApiPlaybackEvent = "PlaylistItemAdd"
EventQualityChange ApiPlaybackEvent = "QualityChange"
)
type Api interface {
ReportProgress(state *ApiPlaybackState) error
GetSongDirect(id string, codec string) (io.ReadCloser, error)
}
//Playbackstate reports playback back to server
type ApiPlaybackState struct {
Event ApiPlaybackEvent
ItemId string
IsPaused bool
IsMuted bool
// Total length of current playlist in seconds
PlaylistLength int
// Position in seconds
Position int
// Volume in 0-100
Volume int
}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include "grap.h"
#include "y.tab.h"
double margin = MARGIN; /* extra space around edges */
extern double frame_ht, frame_wid, ticklen;
extern int just, sizeop, tick_dir;
extern double sizexpr, lab_up, lab_rt;
char graphname[50] = "Graph";
char graphpos[200] = "";
void print(void) /* arrange final output */
{
FILE *fd;
Obj *p, *dfp;
int c;
double dx, dy, xfac, yfac;
if (tfd != NULL) {
fclose(tfd); /* end the temp file */
tfd = stdout;
}
if ((p=lookup("margin",0)) != NULL)
margin = p->fval;
if (frame_ht < 0) /* wasn't set explicitly, so use default */
frame_ht = getvar(lookup("frameht", 0));
if (frame_wid < 0)
frame_wid = getvar(lookup("framewid", 0));
dfp = NULL;
for (p = objlist; p; p = p->next) {
dprintf("print: name = <%s>, type = %d\n", p->name, p->type);
if (p->type == NAME) {
Point pt, pt1;
pt = p->pt;
pt1 = p->pt1;
fprintf(tfd, "\t# %s %g .. %g, %g .. %g\n",
p->name, pt.x, pt1.x, pt.y, pt1.y);
if (p->log & XFLAG) {
if (pt.x <= 0.0)
ERROR "can't take log of x coord %g", pt.x FATAL;
logit(pt.x);
logit(pt1.x);
}
if (p->log & YFLAG) {
if (pt.y <= 0.0)
ERROR "can't take log of y coord %g", pt.y FATAL;
logit(pt.y);
logit(pt1.y);
}
if (!(p->coord & XFLAG)) {
dx = pt1.x - pt.x;
pt.x -= margin * dx;
pt1.x += margin * dx;
}
if (!(p->coord & YFLAG)) {
dy = pt1.y - pt.y;
pt.y -= margin * dy;
pt1.y += margin * dy;
}
if (autoticks && strcmp(p->name, dflt_coord) == 0) {
p->pt = pt;
p->pt1 = pt1;
if (p->log & XFLAG) {
p->pt.x = pow(10.0, pt.x);
p->pt1.x = pow(10.0, pt1.x);
}
if (p->log & YFLAG) {
p->pt.y = pow(10.0, pt.y);
p->pt1.y = pow(10.0, pt1.y);
}
dfp = setauto();
}
dx = pt1.x - pt.x;
dy = pt1.y - pt.y;
xfac = dx > 0 ? frame_wid/dx : frame_wid/2;
yfac = dy > 0 ? frame_ht/dy : frame_ht/2;
fprintf(tfd, "define xy_%s @ ", p->name);
if (dx > 0)
fprintf(tfd, "\t(($1)-(%g))*%g", pt.x, xfac);
else
fprintf(tfd, "\t%g", xfac);
if (dy > 0)
fprintf(tfd, ", (($2)-(%g))*%g @\n", pt.y, yfac);
else
fprintf(tfd, ", %g @\n", yfac);
fprintf(tfd, "define x_%s @ ", p->name);
if (dx > 0)
fprintf(tfd, "\t(($1)-(%g))*%g @\n", pt.x, xfac);
else
fprintf(tfd, "\t%g @\n", xfac);
fprintf(tfd, "define y_%s @ ", p->name);
if (dy > 0)
fprintf(tfd, "\t(($1)-(%g))*%g @\n", pt.y, yfac);
else
fprintf(tfd, "\t%g @\n", yfac);
}
}
if (codegen)
frame();
if (codegen && autoticks && dfp)
do_autoticks(dfp);
if ((fd = fopen(tempfile, "r")) != NULL) {
while ((c = getc(fd)) != EOF)
putc(c, tfd);
fclose(fd);
}
tfd = NULL;
}
void endstat(void) /* clean up after each statement */
{
just = sizeop = 0;
lab_up = lab_rt = 0.0;
sizexpr = 0.0;
nnum = 0;
ntick = 0;
tside = 0;
tick_dir = OUT;
ticklen = TICKLEN;
}
void graph(char *s) /* graph statement */
{
char *p, *os;
int c;
if (codegen) {
fprintf(stdout, "%s: [\n", graphname);
print(); /* pump out previous graph */
fprintf(stdout, "\n] %s\n", graphpos);
reset();
}
if (s) {
dprintf("into graph with <%s>\n", s);
opentemp();
os = s;
while ((c = *s) == ' ' || c == '\t')
s++;
if (c == '\0')
ERROR "no name on graph statement" WARNING;
if (!isupper(s[0]))
ERROR "graph name %s must be capitalized", s WARNING;
for (p=graphname; (c = *s) != ' ' && c != '\t' && c != '\0'; )
*p++ = *s++;
*p = '\0';
strcpy(graphpos, s);
dprintf("graphname = <%s>, graphpos = <%s>\n", graphname, graphpos);
free(os);
}
}
void setup(void) /* done at each .G1 */
{
static int firstG1 = 0;
reset();
opentemp();
frame_ht = frame_wid = -1; /* reset in frame() */
ticklen = getvar(lookup("ticklen", 0));
if (firstG1++ == 0)
do_first();
codegen = synerr = 0;
strcpy(graphname, "Graph");
strcpy(graphpos, "");
}
void do_first(void) /* done at first .G1: definitions, etc. */
{
extern int lib;
extern char *lib_defines;
static char buf[50], buf1[50]; /* static because pbstr uses them */
FILE *fp;
extern int getpid(void);
sprintf(buf, "define pid /%d/\n", getpid());
pbstr(buf);
if (lib != 0) {
if ((fp = fopen(lib_defines, "r")) != NULL) {
sprintf(buf1, "copy \"%s\"\n", lib_defines);
pbstr(buf1);
fclose(fp);
} else {
fprintf(stderr, "grap warning: can't open %s\n", lib_defines);
}
}
}
void reset(void) /* done at each "graph ..." statement */
{
Obj *p, *np, *deflist;
extern int tlist, toffside, autodir;
curr_coord = dflt_coord;
ncoord = auto_x = 0;
autoticks = LEFT|BOT;
autodir = 0;
tside = tlist = toffside = 0;
tick_dir = OUT;
margin = MARGIN;
deflist = NULL;
for (p = objlist; p; p = np) {
np = p->next;
if (p->type == DEFNAME || p->type == VARNAME) {
p->next = deflist;
deflist = p;
} else {
free(p->name);
freeattr(p->attr);
free((char *) p);
}
}
objlist = deflist;
}
void opentemp(void)
{
if (tfd != stdout) {
if (tfd != NULL)
fclose(tfd);
if ((tfd = fopen(tempfile, "w")) == NULL) {
fprintf(stderr, "grap: can't open %s\n", tempfile);
exit(1);
}
}
}
|
/**
* Tests the cross product function
* @throws Exception
*/
@Test
public void testCrossProduct() throws Exception {
Vector3D v = new Vector3D(new Point3D(1,0,0));
Vector3D v2 = new Vector3D(new Point3D(0,1,0));
assertEquals(0, v.cross(v2).getX(),0.0000001);
assertEquals(0, v.cross(v2).getY(),0.0000001);
assertEquals(1, v.cross(v2).getZ(),0.0000001);
v = new Vector3D(new Point3D(-4,5,7));
v2 = new Vector3D(new Point3D(2,5,6));
assertEquals(-5, v.cross(v2).getX(),0.0000001);
assertEquals(38, v.cross(v2).getY(),0.0000001);
assertEquals(-30, v.cross(v2).getZ(),0.0000001);
v = new Vector3D(new Point3D(1.45,5.23,0.5));
v2 = new Vector3D(new Point3D(-4.3,0.2,5));
assertEquals(26.05, v.cross(v2).getX(),0.0000001);
assertEquals(-9.4, v.cross(v2).getY(),0.0000001);
assertEquals(22.779, v.cross(v2).getZ(),0.0000001);
v = new Vector3D(new Point3D(1,2,3));
assertEquals(0, v.cross(v).getX(),0.0000001);
assertEquals(0, v.cross(v).getY(),0.0000001);
assertEquals(0, v.cross(v).getZ(),0.0000001);
} |
Forensic Analysis of Private Mode Browsing Artifacts in Portable Web Browsers Using Memory Forensics The popularity of portable web browsers is increasing due to its convenient and compact nature along with the benefit of the data being stored and transferred easily using a USB drive. As technology gets updated frequently, developers are working on web browsers that can be portable in nature with additional security features like private mode browsing, built in ad blockers etc. The increased probability of using portable web browsers for carrying out nefarious activities is a result of cybercriminals with the thought that if they use portable web browsers in private mode it won't leave a digital footprint. Hence, the research paper aims at performing a comparative study of four portable web browsers namely Brave, TOR, Vivaldi, and Maxthon along with various memory acquisition tools to understand the quantity and quality of the data that can be recovered from the memory dump in two different conditions that is when the browser tabs were open and when the browser tabs were closed in a system to aid the forensic investigators. |
After 10 seasons in Green Bay, linebacker Clay Matthews is returning home to Southern California.
The six-time Pro Bowl selection and Packers franchise leader in career sacks is joining the Los Angeles Rams as a free agent. Matthews made the news public with a new profile picture on his Twitter profile: him sporting the No. 52 in a Rams uniform.
The Rams then tweeted that they have indeed agreed on a two-year deal with Matthews. NFL Network’s Mike Garafolo reported the deal is worth a maximum of $16.75 million — less than other offers for Matthews, per Garafolo, but family considerations and a shot at a championship outweighed the increased money from other clubs.
A Southern California native born in Northridge, Matthews starred in college at USC before the Packers selected him with the 26th overall pick of the 2009 NFL Draft. He quickly made a name for himself with both his level of play and his famed sack celebrations.
He had 10 sacks as a rookie, making the 2009 All-Rookie Team. He had a career-high 13.5 the following year, a season which ended with the Packers defeating the Pittsburgh Steelers in Super Bowl XLV.
In all, Matthews has 83.5 sacks in his career, though his production has slowed in recent seasons. He has not had double-digit sacks since registering 11 in 2014, the fifth of his six Pro Bowl seasons.
The Rams, the NFC champions last season, aren’t exactly hurting for pass rushers. Reigning two-time NFL Defensive Player of the Year Aaron Donald led the NFL with 20.5 sacks last season. The team also re-signed edge rusher Dante Fowler to a one-year contract earlier this month. The team acquired him in a trade-deadline deal with the Jacksonville Jaguars last season. |
Communication in a globalized multicultural society: ethnic mentality aspect The purpose of the article is to set out the peculiarities of the forms of communication in a multicultural society in the context of globalization through the lenses of ethnic mentality component of intercultural interaction. The problem of intercultural interaction, mutual understanding and consent in the communication of different peoples living together in a single society, is under review by the world and domestic scientific and philosophical public. The article argues that in ontological terms, interethnic communication is a complex multidimensional sociocultural phenomenon, which is studied within interdisciplinary approach by philosophy, political science, sociology, psychology, communication theory and other socio-humanitarian sciences. In the era of globalization, integration processes are intensifying. As a result, there are new political, economic, social and cultural conditions for the coexistence of different ethnic groups in a multicultural society. Since ethnic mentality characteristics have a significant impact on the communication processes, one can not underestimate their place and role in the intercultural communication of people. This factor contributes into new communicative forms of representatives of various ethnic groups, which shape the multicultural space of social being in the conditions of globalization. Introduction Globalization processes that have embraced all spheres of world society being, give rise to mostly new phenomena of civilization development. Among them there is the phenomenon of multiculturalism, which arose at the intersection of economic, sociopolitical, religious and other relations of countries, peoples, ethnic groups within one society. The essence of this socio-cultural phenomenon is studied and ambiguously evaluated in various fields of social and human sciences, which reveal both its positive trends and hidden threats. In particular, F. Fukuyama raises the question of survival of universalist forms of cultural identity under the attacks of the fundamental faith in multiculturalism, which goes beyond the boundaries of cultural diversity and requires the promotion of cultural differences . The main threat is based on moral relativism, which does not promote dominance of any particular set of values in the society. The dangers implied in the multiculturalism for a nation state are being studied by a Russian scientist N. Polyakova. In particular, she points out to two of them. Relying on human rights, primarily on the right to travel, different ethnic groups require transparent borders and the right to be present and to live within any national-state formations. In addition, multiculturalism both as a principle and a practice may have a negative impact on the socio-cultural space of the national state. Immigrant ethnic and religious minorities protect their culture and identity, which prevent and sometimes encourage them for an active protest against assimilation. Predictably, this state of affairs result in artificial gaps and disruptions of the homogeneous cultural and normative space of the national-state , and ultimatelyto political conflicts on the ethnic-cultural and religious grounds. A multicultural society, therefore, is not a simple coexistence of individuals with different ethnic origins, but a social system within which ethnic social structures are viewed as a part of the social structures of a society. A multicultural society is not harmonious by definition. It quickly becomes controversial if it encounters different cultural groups, whose position is aggravated by social inequality. In this regard, the problem of the balance between class, ethnic, national and state interests, taking into account the factor of ethnic mentality is debatable. Materials and methods The multidimensionality of the ethnic mentality revealed in the process of communication requires a wide set of methodological settings and principles of the analysis of sociocultural phenomena: -the principle of ideological and theoretical continuity, which allows exploring the the socio-genesis of ethnic groups and nations and the communicative forms of their interactions that are correlated with it; -the principle of concreteness, orienting towards the identification of the ontological foundations of the forms of communications among ethnic groups and nations; -the principle of historicism, aimed at the analysis of communicative phenomena in the context of their ethnic mental changes. A variety of methods used in this socio-philosophical study include: -the method of comparative philosophical analysis, regarding the correlation of the results of genesis of ethnic groups and nations and communicative forms appropriate to it; -the method of synthesis, which allows to generalize the material obtained in the study with the factors of communication caused by globalization;-the method of historical and philosophical reconstruction, within which scientific scientific concepts of the results of the genesis of mentality of ethnic groups and nations, change the very nature of communication among them. The Since ethnic culture is inseparable from its language, the methodology of philological and semiotic analysis has been required (. Bakhtin,. Wierzbicka, Yu. Lotman, R. Bart, G. Hofstede). Results A long-standing debate of the concepts of "ethnic group" and "nation", features and the mechanism of their formation reveals the exceptional complexity of these phenomena. The main and, to a certain extent, polar views on this problem are the following ones: the nation as a co-citizenship (political, territorial or civilian) and the nation as a form of ethnic existence (ethnonation). The supporters of the former modelconstructivists (. Gellner, B. nderson)believe that the nation is a community of people, united not so much by the past (the origin and language of community), but by the futurea project of its own existence and the will to its implementation. In this sense, a nation is always a process, not a result of it. The joint plan for the future contributes into the consolidation of people of different origins, races, denominations, alleviates the original ethno-cultural differences, moulds the relative homogeneity of the language. That is, the constructivist model deals with a nation as a result of the implementation of a certain national project developed by a small group of intellectuals. Initially, supporters of this concept state, the idea of the nation arises as a reflection of the needs and conditions of the time. At the same time, the ethnic identity of the population is just a starting point, the foundation and it does not guarantee or determines the emergence of a nation on its basis. If the ethnos is a predominantly culturalspiritual formation, the nation is a political one. The main components of the nation are the historical territory, the political and legal equality of members, the common civil culture and ideology. The transformation of an ethnic group into a nation requires focused efforts. Ethnicity is considered as a concomitant cultural phenomenon that is arranged by the nation's dominant group or set of groups. Subordination of ethnic civilians has been reflected in a number of Western European languages, in which the word "nationality" is derived from the term "nation" referring citizenship (for example, in French -nationalite"). In the "ethnic" or primordialist conception (C. Geertz, A. Smith, Yu. Bromley, L. Gumilyov), the ethnic factor plays the formative role for the nation. A nation is viewed as a community of people, united primarily by their common origin, culture and the mother tongue. Thus, the primary basis of the nation is the ethnos at that stage of sociocivilizational maturity, when it acts as a self-sufficient socio-cultural system and manifests the aspiration for political self-determination. Everything that remains beyond the borders of the nation in the process of its forming turns to be perceived as alien and potentially hostile. The nation withdraws into itself, its own national interests. The ideology of nationbuildingnationalism emerges. It is understood as a principle that requires the coincidence of political and national (cultural) units. Thus, the supporters of the "ethnic" model view the nation as an ethno-social community, which is characterized by the formed consciousness of its identity and the only unified, national culture. At the same time, the nation is relatively independent, stable and at the same time a dynamic ethnic-social organism, capable for self-reproduction, even if it has not created its own state. However, in this case, the nation has an unfinished structure, since it lacks a political superstructure. At the same time, the formation of a nation is inextricably linked with its sovereignty, the transformation of the nation-ethnos into an independent subject of its own political history. The supporters of the "ethnic" model regard all nations as objectively existing ones which created their own states in their continuous existence (so-called historical nations), and those who survived or endure a break in their development. The latter, having lost their national consciousness, are in a state of peculiar sleep. Substantial (primordialist) approach to the study of ethnic phenomena and their linguocommunicative component seems to be preferable to constructivist (situational, relativistic, instrumental) one because in the case of the absolutism of constructivist approaches, that is, when ethnicity is seen only as an unsubstantiated grouped constructed function, the subject of the study disappears. At the same time, it must be recognized that, despite all the apparent opposition, the mentioned approaches need to have common grounds, since they deal with the same social phenomenon, but manifesting in various historical and cultural realities. With the support of the historical approach, let us study the ethnos not as a static state, arbitrarily pulled out of the stream of ethnic history, but as a substantive prerequisite of concrete historical sociality, primary in relation to the social forms embodying it. In the light of the discussing ethnic and national interests, the ambivalent nature of ethnicity and nation should be mentioned. Ethnicity, on the one hand, divides nations and humanity into individuals, but, on the other hand, unites all the people of the same origin (real or imagined) into ethnic communities with common and specific values and interests. The formation of ethnic interests as a set of specific interests inherent to a particular ethnicity and/or ethnic group is carried out due to its inequality and/or dissimilar place and role in social and political life. Ethnic interests are a real cause of the behaviour and activities of ethnic communities. They are aimed either at preserving and strengthening the existing status or improving it. Ethnic interests in mono-ethnic democratic societies coincide with national interests, whereas in multiethnic and especially multinational states, they may contradict or conflict with. Nations split the ethnicity and humanity into individuals, and, on the other hand, they unite people, regardless of their ethnic origin, social status and religious beliefs, in ethnosocial political communities at a time. Naturally, there may be certain contradictions and rivalries between the ethnos and the nation, as well as between the ethnicity, the nation, and the state. National interests are not only the sum of interests of different individuals, social or ethnic communities, which constitute the society, rather a generalized reflection of their essential needs and natural set. In democratic mono-ethnic and one-nation states, where political nations have been formed, national interests are considered to be higher than class, ethnic and state interests. They are aimed at achieving the unity and territorial integrity of the state, creating favourable conditions for the development of economic, political and spiritual fields of society's life. In multinational (multiethnic) states, which, moreover, are multiethnic, the intricacies of different interests, and a lot of contradictions and conflicts arise due to the dual position of ethnic groups and nations, which, on the one hand, are subjects of political processes, and on the other hand, are objects of state policy. The method and the ability to regulate ethnocultural contradictions that cause centripetal and centrifugal tendencies in social development, above all, depend on the type of world order. The well-known statement of S. Huntington declares that the modern world order is based on civilizations: societies that have cultural similarities co-operate with each other; attempts to shift the society from the conditions of one civilization to the context of others are infertile; countries are grouping around the leading or core countries of their civilizations. Consequently, the main thing in intercultural relations, in his opinion, is the awareness of different cultural identities, which coincides with the identity of civilization . And if earlier civilizations were separated by time and space, nowadays in the conditions of globalization these obstacles are eliminated. In the XX c. the relationships of civilizations changed. The phase of the unidirectional influence of one civilization on the others was changed with the stage characterized by intense, continuous and diverse relationships among all the civilizations . In addition, the author highlights another tendency in the communication of various cultures, which relates to the presence of representatives of non-Western cultures in the West. In this case, the challenge to Western culture comes from emigrants of other civilizations who refuse to assimilate and continue to remain faithful to the spiritual values, customs and culture of their native countries and pass them from generation to generation . Such type of a conflict is observed now in the USA, EU countries, as well as in the territories of the former Soviet republics. Analysing this tendency, J. Habermas distinguishes between "national identity" and "nationalism". He writes that the form of national identity makes it necessary for each nation to be shaped in the state for the sake of gaining its independence. However, there are few states with a nationally homogeneous population. And conquering of national minorities by a national state is a manifestation of nationalism that gives rise to the struggle of these minorities for their rights to national self-determination . In our opinion, the author mistakenly identifies the "nation" and "ethnos", because the nation is a sociopolitical entity irrespective of the ethnic composition of citizens, and the ethnos is the bearer of a particular culture (languages, traditions, customs, etc.). But in another work, Y. Habermas notes that the political mobilization of subjects also requires cultural integration of the population hastily summoned for the first time . That is, it is already about the need to create a nation of a common culture, which forms the cultural symbols of the people. Speaking about the cultural identity of an ethnic group, it is important to understand what is consciously accepted by the ethnic community, and what belongs to the unconscious elements of ethnic culture and is lost in the depths of the ages as archetypes of culture discovered for the scientific community by K. Jung. Cultural identity is based on a certain type of mentality that contains both conscious and unconscious cultural codes, defining the integrity of the life of an individual and the community with which the individual identifies himself. The concept of mentality was developed and continues to be studied in psychology, anthropology, ethnology, philosophy, structural linguistics, etc. Researchers find different content in it, but for all of them it is indispensable that mentality must be derived from the cultural and historical development of each ethnic group: the natural and geographical conditions of its existence, home life, myths, language, beliefs, etc. In modern philosophical literature, mentality is defined as the deep level of collective and individual consciousness, which contains the unconscious; relatively stable set of attitudes and tendencies of an individual or social group to perceive the world in a certain way. Mentality is formed depending on the traditions of culture, social structures and the entire environment of human life, and in its turn forms them, acting as a generative beginning . This kind of understanding points to the dialectic nature of the ethnic culture and mentality, since the cultural forms of life of a certain ethnic group arise as a result of quite certain conscious and unconscious components of the mental activity of people in their interaction, and at the same time, cultural forms transform the mentality of this ethnic community. As follows from the nature of the mental phenomenon, rapid social changes have to turn into archetypes, into unconscious automatisms, to become the content of ethnic mentality. Hence, there is the difference in the pace and rhythm of changes in ideology and mentality: the ideology quickly responds to the slightest changes in the society, affecting the interests of an ethnic or a social group; ethnic mentality is more stable, inactive and conservative due to its genetic conditionality. Therefore, it should be concluded that there is a certain praxeological limitation of its use in the process of social reformation. So, the adoption and sustainable entry of foreign influences into the culture of the ethnos, even in a fundamentally revised form, or their rejection and oblivion, are the subject to certain laws. And the criterion used here, first of all, is compliance with the "spirit of the people", its ethno-cultural values. In the body of the culture of an ethnos there is always a certain core of stable, inherently unique phenomena, structures and values that are ethnically specific. It is this core that performs the differentiating function (with the help of the antithesis "wethey", the creation of ethnic stereotypes, in a word, by opposing the native community to all the others). But it also plays an ethno-integrating role, uniting the members of the ethnos, even if due to their historical destiny they are scattered throughout the world. In this regard, the mentality is not a property inherent in the individual initially, but the ways of relationships that are formed are fixed only in the course of social interaction both in the environment and the condition of its existence. Here we should especially emphasize the role of historical / mythological knowledge and experience as a system-forming part of social memory (traditions, customs, etc.). Once crystallized, the mentality is maintained, mutated by social relations. At the same time, the social processes associated with the formation and maintenance of mentality are determined by the social structure. Conversely, the mentality, born due to the interaction of individual consciousness and social structure, reacts to the social system, supporting, optimizing and modifying its main features and characteristics. Since a language is the most important mode of transmission and way of being mentality, let's find out in which way the mentality of people affects the nature of their communication in multicultural societies. V. von Humboldt, reflecting the cultural and historical origins of the language of a certain people, showed its place in the culture. In particular, he noted that language is the body of inner being and even this being itself, so step by step it reaches internal clarity and external incarnation. With all the subtleties of its roots, it has grown up with the force of the national spirit, and the stronger the influence of the spirit on the language, the more regular and richer the development of the latter is. In all its interweaving, it is a product of the language consciousness of the nation, and therefore the basic questions of the origin and inner life of the language could be answered by appealing to the spiritual force and national force and national identity . And despite the fact that von Humboldt does not use the word "mentality," in fact, he means it when he speaks of "the spirit of the people", "the linguistic consciousness of the people," their "spiritual strength and national identity." It follows from the above passage that the thinker considered the language of the people (and in his writings, the words "people" and "nation" are used synonymously) by the quintessence of its identity, and in our terms, the mentality of the people. However, ethnic identity, mentality imposes a certain framework on language connected with that aspects of mentality, in particular, with the mental composition, the temperament of the people, the symbols underlying the system of his spiritual values, in particular myths and religious beliefs, traditions, etc., to which the imprint of the naturalgeographical and living conditions of his life is imposed. Mentality forms a specific type of ethnic culture. As Ukrainian philosophers S. Krymskiy and Yu. Pavlenko state, culture is primarily a worldview self-expression of the ethno-historical community of people, which reflects the specific conditions of the existence of this collective in the form of traditions, persistent value orientations and normative patterns of thinking and behaviour of people . And all these components of mentality to a certain extent are expressed by the linguistic means of an ethnic group. Every language community uses certain means of communication: languages, their dialects, jargons, and stylistic varieties of a language. Any such tool can be called a code. In the most general sense, a code is a means of communication: natural languages and artificial languages (Esperanto, machine language, Morse code, marine flag signalling, etc.). Along with the term code the term subcode (territorial dialect, urban koine, pidgin, lingua franca, etc.) is used. The term subcode denotes a variety, a subsystem of some common code, a communication tool of a smaller size, a narrower scope of use, and a smaller set of functions than the code. The totality of codes and subcodes, historically developed and used in this ethno-linguistic community and located with each other in the relationship of functional complementarity, is called the lingo-communicative system of this community. Each of the codes and subcodes that make up a social-communicative system has its functions that do not overlap with the functions of other codes and subcodes, thus they all complement each other in functions. In a multilingual society, a linguistic-communicative system is formed by different languages, and communicative functions are distributed among them. The main subsystems of communicative ethnocultural space, understood as a historically formed ethno-socio-linguistic community, characterized by relatively stable and regular internal communication links and territorial localization, are the regulated as well as non-regulated areas of communication. The first subsystem (language policy) satisfies ideological needs with auto-censorship (control) and serves as the "censored" communicative sphere. To propagate the concept of "a single statea single nationthe only national language", one of the autochthonous languages is cultivated to suppress the sprouts of ethnonationalism and regionalism, with the help of which cultural and political unity and metaethnopolitical community are created. The history of Western European culture shows that most countries have chosen the languages of the former metropolises as the language of official communication and as an ideal means of communication both within the country and in communication with the whole world, since they are more universal in comparison with their domestic languages. Therefore, nowadays many scientists pay much attention to the problems of the development of these languages, not only within countries, but also beyond their borders. It is known that functioning and developing in new conditions very different from the original sociocultural ones, they differ a bit from metropolitan standards and develop in the former colonies along a slightly different path than at home. Sometimes the language of any minority is recognized as the second state language, but more often it is used only at home, in the church and in private schools. The nomination of the autochthonous language for dominant positions is hampered by its "unpreparedness" for the role of the official language, the language of school instruction, science and technology. The linguistic unpreparedness of these language is largely due to their direct suppression or relegation to the role of everyday colloquial languages in the period of colonialism as a result of the wide use of the languages of metropolitan countries, and requires the adoption of linguistic measures for their accelerated development and enrichment. The second subsystem of everyday communication is marked by the lack of autocensorship, that is, linguistic self-control and it serves the usual "spoken language". It forms a sphere of everyday communication, which includes a personal or personally oriented discourse, which implies that the speaker acts as a personality, with all his/ her personal characteristics and peculiarities. As it has been already mentioned, the codes (languages) and subcodes (dialects, styles) that make up the social and communicative system are functionally distributed. This means that the same contingent of speakers who make up a given language community, owning a common set of communication tools, uses them depending on the conditions of communication. In other words, according to the sphere of communication, the speaker switches from one language medium to another. A similar picture is observed in those societies that use two or more languages. The most typical situation is the usage of two or more languages by communicators within the administrative-political region (country), i.e. the situation of bilingualism (polylinguism). Bilingual people are those who speak two or more languages depending on the conditions of communication. For example, one language is used in an official setting in the presence of the authorities, while another one is used in everyday life contact with family members and neighbours. And in this case, you can talk about switching from one language (code) to another (code). Switching codes in the speech of bilinguals is motivated; although there is a mixture of codes that is not motivated. The boundary of codes can be traced within a word combination. Switching of codes is the transition of a communicant in the process of communication from one language (dialect, style) to another, depending on the communication conditions. The mechanisms of code switching provide mutual understanding between people and the relative comfort of the process of speech communication. On the contrary, the inability of an individual to vary his communication depending on his conditions, adherence to only one code (or subcode) is perceived as an anomaly and can lead to communicative conflicts. The problem of integration of ethnic cultures is substantially updated in the migration processes of a significant part of ethnic groups in a different cultural environment. On the one hand, in search of a better fate, migrants seek to adapt to the cultural realities of their new social settings, and, on the other hand, almost at a subconscious level, migrants tend to keep the cultural forms of their ethnic group (language, customs, traditions, ceremonies, beliefs, clothing, etc.) to maintain spiritual unity with their community. This dichotomy of adapting migrants to new environments causes many obstacles of both objective and subjective nature, which causes confrontation between migrants and the local population of a given country. The collision of irreconcilable mentalities, whose roots are in the difference in the ways of life of their carriers lies at the heart of almost all types of confrontation -political, religious, linguistic, social and everyday . Conflicts on the interethnic, intercultural grounds, in our opinion, lie in the plane of inequality of the value-semantic fields of ethnic cultures, and hence, the inability to perceive the values of another culture on the emotional level of mentality and to accept them at a rational level. Most often, ethnic stereotypes, produced during a long period of vital activity of a certain people, become ethnically sterile on the way of understanding between representatives of different ethnic groups. They are the standardization of representations of the majority of a certain ethnic group about representatives of another or their own ethnic group, in which generalization and hyperbolization of certain elements of the mentality of the corresponding ethnic groups takes place. As L. Krysin rightly states, in such cases the objects of evaluation may be national customs and traditions, models of everyday behaviour, features of a national character, peculiarities of anatomy, speech, etc. . The most vividly ethno-stereotypes are manifested in intercultural communication through everyday speech in which language expressions are deliberately or unconsciously used, in which both a positive or a negative attitude are expressed towards representatives of certain ethnic groups. As it has been already noted above, globalization intensifies the migration processes in the world, which complicates everyday life in multicultural societies. As a rule, Western countries become polycultural. On the one hand, the inhabitants of the former colonies of these countries migrate here because they can communicate in English, French, Italian and other Indo-European languages learned during the rather long colonization of their countries. On the other hand, representatives of Eastern European countries after the collapse of the Soviet Union and the socialist camp migrate here, often illegally, in search of higher earnings and better living conditions. The migrants carry not only ethnic stereotypes with them, but also the desire to preserve their ethnic identity, often associated with a particular religion. In such multicultural societies, the problem of mutual tolerance is rather acute, because in one place or another, with the slightest misunderstanding, there are interethnic, intercultural encounters with the perspective of the usage of weapons. And since the basis of ethnostereotypes is, as K. Jung notes correctly, "archetypal forms that are based on instincts and express them" , they are rarely perceived by their carriers, because they have the very "psychic" (K. Jung) representatives of each ethnic group. That is why they are least exposed in everyday intercultural communication, and therefore -in preventing social conflicts on an ethnic basis. However, many researchers of language and intercultural communication point out not only the difference between ethnic languages and cultures, but also the commonality of language and cultural forms of different peoples. The first includes categories declaring the most common, attributive characteristics of objects included in human activity. They act as the basic structures of human consciousness and are universal in nature, since any objects (natural and social), including symbolic objects of thought, can become objects of activity. But apart from them, special types of categories are formed and they function in the historical development of culture, through which the definitions of a person as the subject of an activity, the structure of his/ her communication, his/ her relation to other people and society as a whole, the goals and values of social life are expressed. They form the second block of universals of culture. Between these blocks of universal culture there is a mutual correlation, which expresses the relationship between subject-object and subject-subject relationships of human life activity. Interethnic communication requires the use of a single language common to communicants. Otherwise, there is a high probability of communicative misunderstanding. The earliest mention of a single language refers to an ancient society. Thus, the Stoic philosophers dreamed of a utopian city-state of Ouranopolis, where all the inhabitants would speak in a special artificial language. While considering the choice of the principle of linguo-cultural acculturation, attention should be paid to the law of the competition of languages: the development of language depends on the political, demographic, military and economic power of the people who speak it. The current position of languages in the world system is also determined by the relationship of power. Domination of a specific language is never established on its own, because of its special merits, but is the result of political will at different levels: global, regional and national-state. Today, it is not the territorial position that is important for the interaction of languages, but the access to information technologies, as well as the level of information and technology competence of communicants. There are more and more opportunities to overcome the language barriers. Modern culture is often called "screen culture", which replaced oral and written one. A new stage of development of civilization, becoming "civilization of vision ", "screen civilization", linked with the latest discoveries in the field of communication technologies that most directly affect the nature of the reproduction of culture, methods of its transition. For example, one of the features of electronic communication, which is possible due to the increase in the productivity of communication devices, is "multimodality". Multimodality implies the simultaneous use in communication of means of different semiotic systems. The multimodal communicative process includes two components: verbal (natural language, speech) and non-verbal (other sign systemsauditory, visual, etc.) codes. The combination of the verbal code with codes of other semiotic systems speeds up and increases the effectiveness of communication, since the information and pragmatic capacity of non-verbal means is higher than that of verbal ones. Multimodality is especially important in the context of multilingual communication, allowing it is much easier to overcome the language barriers, because a variety of paralinguistic elements, visual and audio images provide a better understanding of interlocutors from different countries. The impact of modern Information-Communication Technologies on communicative practice is expressed as the reduction of the lexical fund, the simplification of grammar and the increase in the share of emotional content of the statements compared to the proportion of rational content, as well as the vulgarization of speech. At the same time, in the cultural space of the Network artificial words and expressions are created, which seem to have a basis in natural languages. On the one hand, these artificially created means are used with metaphorical meanings, and on the other, they deliberately transform the form of these words and expressions by breaking the spelling. Sometimes this leads to the emergence of new genre-stylistic hybrids such as "infotehnament", "infomerization", or educatainment. The use of artificial machine language, which requires the unification of linguistic units and the content of the words of the computer language, leads to the transformation of not only speech, but also its functions in the process of using the computer as a means of communication. M. Derry in this context rightly notes that in cyberculture the computer managed to destroy the traditional distance between a word and a deed, because words read on the computer screen not only inform but rather provoke actions . In the conditions of globalization of almost all spheres of social life, the common principles of the cultures of the peoples contribute to the mutual understanding of people belonging to different ethnic groups. But at the same time in these processes it is important to understand not only the "constellation of opportunities of ethnic unity, but also the situation of impossibility. After all, if ethnic conflicts affect the archetypal level of mentality of certain peoples, then, in any case, they should not be reduced, but to breed (that is, to seek their autonomy). And, conversely, in political or social conflicts of ethnic groups with solid experience of coexistence, one can hope to overcome any differences on the road to their integration" . Discussion In the context of mobility increase of the population from economically depressed countries there is growing cultural differentiation of people within most modern urbanized multicultural communities. Both lead to a constant transformation of models and concepts of the policy of managing cultural diversity, as well as taking into account the interests of many of its subjects. These circumstances require an active search by the world scientific community for scientific approaches to conceptualization of new processes of linguistic and cultural diversity. That will allow them to work out the concept of maintaining a balance between the imperatives of openness, development and security, taking into account the specifics of the ethno-mental features of various socio-cultural entities. Conclusion Ethnic mentality as the nucleus of stable, inherently unique phenomena, structures and values consolidate ethnophores into one social integrity at all stages of the development of communities of socio-ethnic series. Since the language is the most important mode of transmission and way of being of mentality, language tools play a significant role in intercultural interaction. It contributes into the processes of ethno-differentiation and ethnointegration. The realities of the globalized world are encouraging both representatives of the dominant ethnic groups, and immigrants, representatives of other ethnic groups, to produce new forms of intercultural communication in the common space of life. These forms, on the one hand, promote the preservation of ethno-linguistic identity and, on the other, ethnolinguistic unification. Bi / polylingvism plays a special role in the formation of new forms of interethnic interaction. Although it does not narrow the distance between different ethno- |
def _plotting_dict(self):
plotting_dict = {
"r2": self.r2_,
"ev": self.ev_,
"mae": self.mae_,
"mse": self.mse_,
"y_pred": self.y_pred,
"y_true": self.y_true,
"y_residual": self.y_residual_,
"y_residual_normsq": self.y_residual_normsq_,
"auc_rec": self.auc_rec_,
"y_ratio": self.y_ratio_,
"cv_y_ratio": self.cv_y_ratio_,
"std_y_ratio": self.std_y_ratio_,
"mean_y_ratio": self.mean_y_ratio_,
"msle": self.msle_,
"mape": self.mape_,
"deviation": self.deviation_,
"accuracy": self.accuracy_,
}
return plotting_dict |
// This code is part of the Super Play Library (http://www.superplay.info),
// and may only be used under the terms contained in the LICENSE file,
// included with the Super Play Library.
//
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
#pragma once
#include <TinySTL/stdint.h>
#include <TinySTL/vector.h>
#include "Macros.h"
NAMESPACE(SPlay)
enum DMAType
{
BGDMA = 0,
OAMDMA,
DMATypes
};
class ITexture;
class DMA
{
public:
struct DMATransfer
{
uint32_t* pSource;
int iStartTile;
int iWidth;
int iHeight;
int iBG;
};
// Constructor
DMA();
// Destructor
~DMA();
// Create
static DMA* create();
// Initialize
bool initialize();
// Close
void close();
// Update
bool update(int _iElapsedTime);
// Setup DMA transfer
void setupDMATransfer(DMAType _eDMAType, uint32_t* _pSource, int _iStartTile, int _iWidth, int _iHeight, int _iBG);
void setupDMATransfer(DMAType _eDMAType, uint32_t* _pSource, int _iStartTile, int _iTileCount, int _iBG);
// clear VRAM
void clearVRAM();
// Do OAM transfer
bool doOAMTransfer();
// Do BG transfer
bool doBGTransfer();
// DMA sort
static int dmaSort(const void* _pTransfer1, const void* _pTransfer2);
private:
// DMA transfers
tinystl::vector<DMATransfer> m_vecDMATransfers[DMATypes];
// Do DMA transfer
void doDMATransfer(ITexture* _pTexture, uint32_t* _pSource, uint32_t* _pDest, int _iStride, int _iStartTile, int _iWidth, int _iHeight,
DMAType _eDMAType);
// Do DMA transfer
void doDMATransfer(ITexture* _pTexture, uint32_t* _pSource, uint32_t* _pDest, int _iStride, int _iStartTile, int _iTileCount, DMAType _eDMAType);
// Do VRAM Clear
void doVRAMClear(uint32_t* _pDest, int _iStride, int _iStartTile, int _iWidth, int _iHeight, DMAType _eDMAType);
// Get texture
ITexture* getTexture(DMAType _eDMAType, int _iBG);
};
ENDNAMESPACE
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.