content
stringlengths
7
2.61M
Toward a Theology of Chaos : The New Scientific Paradigm and Some Implications for Ministry Scientific paradigms influence peoples approach to and understanding of faith and its relevance. The paradigm shift in science begun in the 1960s and accelerated in the 1980s has broad implications for theology and ministry. A brief, non-technical introduction to chaos theory and its related principles is offered. Glory be to God for dappled things For skies of couple-colour as a brinded cow; For rose-moles all in stipple upon trout that swim; Fresh-firecoal chestnut-falls; finches wings; Landscape plotted and piecedfold, fallow, and plough; And ll trdes, their gear and tackle and trim. All things counter, original, spare, strange; Whatever is fickle, freckled (who knows how?) With swift, slow; sweet, sour; adazzle, dim; He fathers-forth whose beauty is past change: Praise him. Gerard Manley Hopkins1 As far as the laws of mathematics refer to reality, they are not certain; and as far as they are certain, they do not refer to reality. Albert Einstein 1Gerard Manley Hopkins, Pied Beauty, written in 1918, from British & American Poets: Chaucer to the Present(NY: Harcourt Brace Jovanovich, 1986), p. 614.
/** * Read user input (expect array of strings) * * @param[out] list array of strings structure * @param[in] length max allowed array item length * @param[in] description whole array description * @param[in] example array item example */ static void readStringArray(stringArray_t *list, int length, const char* description, const char* example) { int i = 0; int count = 0; char hint[MAX_STRING_LENGTH] = { 0 }; snprintf(hint, sizeof(hint), "%s items count", description); readInteger(&count, hint, "2"); char **item = NULL; if (0 == count) { return; } item = OICCalloc(count, sizeof(char*)); if (NULL == item) { goto no_memory; } for (i = 0; i < count; i++) { item[i] = OICCalloc(length, sizeof(char)); if (NULL == item[i]) { goto no_memory; } snprintf(hint, sizeof(hint), "%s %d item", description, i + 1); readString(item[i], length, hint, example); } list->array = item; list->length = count; return; no_memory: for (int k = 0; k < i; k++) { OICFree(item[k]); } OICFree(item); }
/* * The partition fields are initialized one time based on userData provided * by the fragmenter. */ @Override void initTextPartitionFields(StringBuilder parts) { if (partitionKeys.equals(HiveDataFragmenter.HIVE_NO_PART_TBL)) { return; } String[] partitionLevels = partitionKeys.split(HiveDataFragmenter.HIVE_PARTITIONS_DELIM); for (String partLevel : partitionLevels) { String[] levelKey = partLevel.split(HiveDataFragmenter.HIVE_1_PART_DELIM); partitionColumnNames.put(StringUtils.lowerCase(levelKey[0]), levelKey); } }
. Truck drivers are a well recognized high risk population for sexually transmitted diseases. Prior to start-up of a health care program and an information/education campaign, a cross-sectional study using the unlinked, anonymous screening method was carried out to assess seroprevalence of HIV and syphilis infections in truck drivers in Bobo Dioulasso, Burkina Faso. During the month of November 1994, 236 truck drivers were recruited at a cotton-producing factory. The prevalence of HIV infection was 18.6% and the prevalence of syphilis was 9.3%. Multivariate logistic regression analysis showed a statistically significant association between HIV infection and the following factors: age under 30 years, claimed systematic use of condoms, and previous genital ulcers. These findings suggest that truck drivers are highly exposed to the risk of contracting and disseminating HIV infection due to their high mobility and the high incidence of sexually transmitted diseases among their ranks. Prevention of HIV infection in truck drivers in Burkina Faso will require education to promote systematic use of condoms at each sexual contact as well as screening and treatment of sexually transmitted diseases at truck stops.
Low systemic blood flow in the preterm infant. Low systemic blood flow in the first hours after birth of a preterm infant is an often unrecognized complication. Traditional measures of cardiovascular adequacy used in the neonatal intensive care unit such as capillary refill time and blood pressure may not identify this problem. Longitudinal measurement of systemic blood flow demonstrates a falling off of blood flow in the first 6-12 h after birth, often to less than half of normal, before a gradual return to normal values by 24-48 h of age. Identification and appropriate treatment of this reduction in flow may assist in preventing some of the complications of prematurity.
/** * <p>Implementation of array-list of long using {@link com.alexkasko.unsafe.offheap.OffHeapMemory}. * Memory area will be allocated another time and copied on elements adding. This class doesn't support elements removing. * {@link #get(long)} and {@link #set(long, long)} access operations indexes are checked using {@code assert} keyword * (indexes between size and capacity will be rejected). * * <p>Default implementation uses {@code sun.misc.Unsafe}, with all operations guarded with {@code assert} keyword. * With assertions enabled in runtime ({@code -ea} java switch) {@link AssertionError} * will be thrown on illegal index access. Without assertions illegal index will crash JVM. * * <p>Allocated memory may be freed manually using {@link #free()} (thread-safe * and may be called multiple times) or it will be freed after {@link OffHeapLongArray} * will be garbage collected. * * <p>Note: while class implements Iterable, iterator will create new autoboxed Long object * <b>on every</b> {@code next()} call, this behaviour is inevitable with iterators in java 6/7. * * @author alexkasko * Date: 3/1/13 */ public class OffHeapLongArrayList implements OffHeapLongAddressable, OffHeapDisposable, Iterable<Long> { private static final int MIN_CAPACITY_INCREMENT = 12; private static final int ELEMENT_LENGTH = 8; private OffHeapMemory ohm; private long size; private long capacity; /** * Constructor, {@code 12} is used as initial capacity */ public OffHeapLongArrayList() { this(MIN_CAPACITY_INCREMENT); } /** * Constructor * * @param capacity initial capacity */ public OffHeapLongArrayList(long capacity) { this.capacity = capacity; this.ohm = OffHeapMemory.allocateMemory(capacity * ELEMENT_LENGTH); } /** * Adds element to the end of this list. Memory area will be allocated another time and copied * on capacity exceed. * * @param value value to add */ public void add(long value) { OffHeapMemory oh = ohm; long s = size; if (s == capacity) { long len = s + (s < (MIN_CAPACITY_INCREMENT / 2) ? MIN_CAPACITY_INCREMENT : s >> 1); OffHeapMemory newOhm = OffHeapMemory.allocateMemory(len * ELEMENT_LENGTH); // maybe it's better to use Unsafe#reallocateMemory here oh.copy(0, newOhm, 0, oh.length()); oh.free(); ohm = newOhm; capacity = len; } size = s + 1; set(s, value); } /** * Whether unsafe implementation of {@link OffHeapMemory} is used * * @return whether unsafe implementation of {@link OffHeapMemory} is used */ public boolean isUnsafe() { return ohm.isUnsafe(); } /** * Gets the element at position {@code index} from {@code 0} to {@code size-1} * * @param index list index * @return long value */ @Override public long get(long index) { assert index < size : index; return ohm.getLong(index * ELEMENT_LENGTH); } /** * Sets the element at position {@code index} (from {@code 0} to {@code size-1}) to the given value * * @param index list index * @param value long value */ @Override public void set(long index, long value) { assert index < size : index; ohm.putLong(index * ELEMENT_LENGTH, value); } /** * Returns number of elements in list * * @return number of elements in list */ @Override public long size() { return size; } /** * Returns number of elements list may contain without additional memory allocation * * @return number of elements list may contain without additional memory allocation */ public long capacity() { return capacity; } /** * Frees allocated memory, may be called multiple times from any thread */ @Override public void free() { ohm.free(); } /** * {@inheritDoc} */ @Override public OffHeapDisposableIterator<Long> iterator() { return new OffHeapLongIterator(this); } /** * Resets the collection setting size to 0. * Actual memory contents stays untouched. */ public void reset() { this.size = 0; } /** * {@inheritDoc} */ @Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("OffHeapLongArrayList"); sb.append("{size=").append(size()); sb.append(", capacity=").append(capacity); sb.append(", unsafe=").append(isUnsafe()); sb.append('}'); return sb.toString(); } }
Pharmacology of Hallucinations: Several Mechanisms for One Single Symptom? Hallucinations are complex misperceptions, that principally occur in schizophrenia or after intoxication induced by three main classes of drugs: psychostimulants, psychedelics, and dissociative anesthetics. There are at least three different pharmacological ways to induce hallucinations: activation of dopamine D2 receptors (D2Rs) with psychostimulants, activation of serotonin 5HT2A receptors (HT2ARs) with psychedelics, and blockage of glutamate NMDA receptors (NMDARs) with dissociative anesthetics. In schizophrenia, the relative importance of NMDAR and D2R in the occurrence of hallucinations is still debated. Slight clinical differences are observed for each etiology. Thus, we investigated whether the concept of hallucination is homogenous, both clinically and neurobiologically. A narrative review of the literature is proposed to synthesize how the main contributors in the field have approached and tried to solve these outstanding questions. While some authors prefer one explanatory mechanism, others have proposed more integrated theories based on the different pharmacological psychosis models. In this review, such theories are discussed and faced with the clinical data. In addition, the nosological aspects of hallucinations and psychosis are addressed. We suggest that if there may be common neurobiological pathways between the different pharmacological systems that are responsible for the hallucinations, there may also be unique properties of each system, which explains the clinical differences observed. Introduction A hallucination is a type of misperception that can be defined as "the perception of an object without an object to perceive". While hallucinations may occasionally occur in diverse psychiatric and neurological pathologies, they are particularly characteristic of schizophrenia-related disorders, in which antipsychotic drugs are commonly used to treat them. However, hallucinations may also be triggered by at least three different kinds of drugs: psychostimulants (i.e., cocaine or amphetamine), the so-called "dissociative anesthetics" (i.e., phencyclidine (PCP) or ketamine), and psychedelics, (i.e., lysergic diethylamid (LSD) and psilocybin). Depending on which situation is considered, the pharmacological hypotheses underlying the symptoms are completely different. Psychostimulants-induced hallucinations result from increased dopamine transmission and hyperactivation of dopamine D2 receptor (D2R). Furthermore, "dissociative anesthetics" drugs induce complex schizophrenia-like clinical pictures, including hallucinations, that result from the blockade of glutamate NMDA receptors (NMDAR). Lastly, psychedelics act by stimulating the serotoninergic 5HT2A receptor (5HT2AR). In schizophrenia, although antipsychotic blocking studies suggest that hallucinations result from D2R hyperstimulation, there are also numerous arguments for NMDAR dysfunction, which may be a potential and specific hallucinatory mechanism. Initially, the existence of these different pharmacological systems underlying hallucinations appears incompatible with 2 BioMed Research International a unified conception hallucination. It is necessary to articulate these three mechanisms into an integrated model, or, alternatively, there may be different forms of hallucinations, that are mediated by different pharmacological supports and neurobiological circuits. The Three Main Pharmacological Models of Hallucinations Three different types of psychoactive drugs can induce hallucinations in humans. In each case, a specific pharmacological process is involved (. However, notable exceptions include early-onset forms in which visual and multisensory hallucinations are more frequent. Schizophrenic hallucinations combined with other psychotic symptoms are commonly classified within the "positive symptoms" of schizophrenia. It is these positive symptoms on which antipsychotic drugs have the most blatant therapeutic effects, and successive studies from the 1960's revealed that this effect could be due to antagonistic action on D2Rs, which is shared by all antipsychotic molecules. Consequently, the hypothesis that positive symptoms may be related to an excessive transmission of dopamine has become the main pharmacological model of positive symptoms in schizophrenia. This hypothesis has been reinforced by contemporaneous imaging techniques, which have confirmed that positive symptoms were associated with an increase of dopaminergic activity in the striatum. For a while, the other dopamine receptors, notably the D1 receptors, were suggested as other receptors possibly implicated in positive symptoms of schizophrenia, but it appeared that they were probably more involved in negative symptoms of schizophrenia, which consist of blunted effects and social withdrawal. D2Rs thus emerged as the primary dopaminergic modulators underlying positive symptoms. It has secondarily been hypothesized that all forms of D2R overstimulation in striatum could trigger psychosis, even beyond the scope of schizophrenia. The clinical picture of psychosis induced by psychostimulant drugs, which result from sustained dopamine action, appears relevant to this hypothesis. Psychotic symptoms can also result from the use of dopaminergic receptors agonists in Parkinson's disease. Thence, it has been suggested that striatal dopaminergic hyperfunction may better fit with psychosis than with schizophrenia, as nonpsychotic forms of schizophrenia are not linked with such striatumbased anomalies. Psychotic symptoms in schizophrenia may be related to a neurobiological pathological process, incentive salience, which is the cognitive consequence of dopaminergic-enhanced transmission, and may pave the way for the emergence of psychosis. It has thus been proposed that dopamine is the pharmacological keystone of all psychotic states, which is the expression of a process of dopamine supersensitivity, because of an increase in the high-affinity states of the D2Rs, or D2High receptors. According to this theory, the clinical activity of the hallucinogenic drugs may result from the property of these drugs to target D2High receptors, and this action may be the fundamental pharmacological mechanism underlying psychosis. This "all-dopamine" conception of psychosis will be discussed below. The Glutamate Model: Hallucinations, Dissociative Anesthetics, and Schizophrenia. Shortly after the synthesis of a new class of anesthetic drugs at the end of the 1950s, it was observed that these drugs could induce schizophrenia-like symptoms, with a combination of hallucinations, negative symptoms, and dissociative symptoms. These drugs were consequently known as "dissociative anesthetics". The main molecules of this class are phencyclidine (PCP) and ketamine. It has been demonstrated that PCP exhibits antagonistic effects on NMDARs. As a result, a new pharmacological model of hallucinations and other schizophrenic symptoms was introduced. Subsequently, a progressive amount of evidence indicated that many susceptibility genes for schizophrenia were related to the functioning of NMDARs and that glutamate may have a more central place in the pathophysiology of schizophrenia than dopamine. The role of NMDAR in schizophrenia was also highlighted by the effectiveness of several NMDAR regulators on both positive and negative symptoms of schizophrenia. All these arguments have progressively led to an increased interest in the role of NMDARs concerning the whole pathophysiology of schizophrenia. Currently, NMDAR hypofunction is considered by several leading researchers of the field to be a major neurobiological hypothesis for schizophrenia. Apart from the use of PCP or ketamine, other nonschizophrenic NMDAR-related psychoses have been reported. NDMAR-related psychosis is thus not confined to the spectrum of schizophrenia. Moreover, the sole blockade of NMDAR, without any relation with the dopaminergic system may be sufficient to induce psychosis. In these types of states, mixed positive and negative symptoms are observable, which is in contrast to what happens with the use of dopaminergic drugs. As these states also include hallucinations, it could be concluded that purely NMDAR-related hallucinations are conceivable, without any relation with the dopaminergic system. The Serotonin Model: Hallucinations, Psychedelics, and Schizophrenia. Psychedelics constitute a heterogeneous class of molecules, among which LSD and psilocybin are the two most well-known and best studied molecules. Psychedelics induce phenomenologically complex pictures, which can mix visual hallucinations, synesthesia, and peculiar altered states of consciousness with mystical feelings. Although there has been much debate regarding the psychedelics' exact pharmacological mechanism, the most commonly admitted mode of activity of this class of drugs is the stimulation of serotonin 5HT2AR on cortical neurons. Cortical 5HT2AR hyperactivation may affect the functioning of the cortico-striato-thalamo-cortical loops and triggers a disruption in the thalamic gating of sensory and cognitive information. It has been proposed that this process triggers a breakdown of cognitive integrity and results in the subsequent occurrence of aberrant feelings and perceptions. As soon as the serotoninergic-based mode of action of LSD was discovered, a serotoninergic hypothesis of schizophrenia was proposed, prior to being supplanted by the dopaminergic hypothesis. Today, several authors have proposed a reappraisal of the role of the 5HT2AR in both schizophrenia and psychosis. However, psychedelics-induced forms of psychosis sensibly differ from schizophrenia-like psychosis, in particular regarding the clinical aspect of hallucinations. Visual hallucinations are typical with psychedelics, whereas auditory hallucinations are much more rare. Furthermore, "pseudohallucinations" (i.e., misperceptions with intact reality testing and insightfulness) are very frequent, although insight into hallucinations in schizophrenia is quite poor. Despite these numerous clinical differences, there are some arguments that suggest a role of 5HT2AR in schizophrenia. The level of expression of 5TH2AR is upregulated in young and untreated patients with schizophrenia, and because visual hallucinations frequently occur in the early phases of schizophrenia, it has been proposed that psychedelic-induced pictures may be related to early forms of schizophrenia. Furthermore, many second-generation antipsychotics have an antagonistic action on the 5HT2AR, which highlights the role of 5HT2ARs in schizophrenia. However, the antipsychotic action of this antagonist effect remains questionable and will be discussed in the next chapter. Consequently, it appears that some specific forms of hallucinations may result from 5HT2AR activation, in addition to other specific clinical abnormalities. At first glance, these particular clinical pictures do not appear to be linked with the participation of NMDARs or D2Rs. Confrontations between Models and Attempts for Integration Because three different cerebral receptors contribute to the triggering of different hallucinatory processes, it is necessary to assess whether these three receptors are part of the same global neural circuitry, which would preserve the conceptual unity of hallucinations from a pharmacological perspective, of whether they belong to pathways that induce hallucinations separately, which would mean that there are several pharmacological forms of hallucinations, with each having specific clinical expressions. This has led scientists to question each model in front of the two other ones. We will first focus on discussions of two-system interactions (NMDAR-D2R, 5HT2AR-D2R, and 5HT2AR-NMDAR) and then move to theories that attempt to integrate all of the three receptors. Glutamate/Dopamine Interactions. Glutamate and dopamine hypotheses of schizophrenia may be considered as rival models, particularly in regards to the pathophysiology of positive symptoms in schizophrenia. Several experts believe that one of the models is more superior than the others. According to the supporters of the "all-dopamine" hypothesis, the role of dopamine is central, and the schizophrenia-like effects of ketamine and PCP may be at least partially explained by the affinity of the drugs to the D2High receptors. In this hypothesis, activation of D2Rs is indispensable to induce any form of psychosis and consequently any form of hallucinations. However, other authors note that psychostimulants (i.e., pure dopaminergic drugs) are far less hallucinogenic compared with dissociative anaesthetics and that many symptoms induced by NMDAR antagonists have been reported not to be linked with an increase of dopamine transmission in the striatum. Moreover, in animal models, only few antipsychotic drugs can reverse the effects of acute and chronic administration of PCP on prepulse inhibition, which is a cognitive parameter used as a model of positive symptoms. NMDAR blockade is thus considered as an independent mechanism for the induction of psychosis. Interconnections and reciprocal regulations between the two systems are also possible. The prefrontal cortex may trigger NMDAR-mediated decrease of the dopaminergic tone in striatum. Moreover, dopaminergic and glutamatergic systems may have opposite effects in the striatum, which may explain that both D2R activation and NMDAR blockade induces hallucinations in a similar manner. Animal studies appear to validate this hypothesis, as NMDAR modulation limits some behavioural effects induced by amphetamine. However, this may also indicate a two-way interaction, as recent studies have reported that activation of D2Rs induces a multimodal downregulation of NMDAR in the striatum, resulting in reciprocal regulations between the dopaminergic and glutamatergic systems. As discussed below, the role of 5HT2ARs has been suspected for its involvement within this complex neural circuitry. D2R-NMDAR interactions in the striatum still remain to be confirmed. However, recent studies question the potential influences of D2Rs on ketamine-induced abnormalities in the striatum. Whether the dopaminergic and the glutamatergic systems function jointly or separately in striatum remains a key issue toward understanding the ability of both NMDARs and D2Rs modulators in inducing or reducing hallucinations. Dopamine/Serotonin Interactions. The role of 5HT2ARs has been recently reintroduced in schizophrenia, since many second-generation antipsychotics are both D2R and 5HT2AR antagonists. This suggests that the blockade of 5HT2AR may underlie the antipsychotic effects of these drugs, in accordance with the 5HT2AR-mediated hallucinogenic properties of psychedelics. However, secondgeneration antipsychotics are characterized by the triggering of lesser side effects that result from the blockade of D2Rs in the non-limbic areas, such as extrapyramidal symptoms or galactorrhea. This observation has led to the hypothesis that 5HT2AR blockade reverses the effects of D2R blockade only in these areas, whereas the D2R antagonistic effects of second-generation antipsychotics are preserved in the limbic system, which preserves the therapeutic activity of these drugs on positive symptoms of schizophrenia. Consequently, it is not obvious that the blockade of 5HT2ARs is responsible for the effects of these drugs on positive symptoms. Furthermore, first generation antipsychotics, which have a lack or little activity on 5HT2ARs, exhibit the same level of efficacy on the positive symptoms compared with more recent drugs. However, several studies have investigated the D2Rrelated theory of positive symptoms in schizophrenia and the activity of psychedelics. As previously described, some researchers have justified this issue with the idea that psychedelics function because of their stimulating effect on D2Rs. Several studies have supported this notion. For example, LSD exhibits biphasic activity in mice; the first phase involves only 5HT2ARs, and the second phase, which is related to the psychotic symptoms observed in humans, involves only D2R. Nevertheless, according to other studies, psychedelic-induced stimulation of 5HT2ARs in the prefrontal cortex is responsible for a downstream activation of dopaminergic neurons that are located in the ventral tegmental area. Moreover, the formation of heteromers involving both 5HT2AR and D2R has been observed on the membranes of mouse striatal neurons, which may result in a functional crosstalk between the two neurotransmission systems. In this theory, however, the 5HT2ARs implicated in psychosis are located in the striatum and not in the prefrontal cortex, which suggests that they interact with D2Rs. Yet, other arguments support that psychedelic-induced hallucinations are not related to the modulation of D2Rs. Haloperidol was found unable to block the psychotomimetic effects of psilocybin, whereas the 5HT2AR antagonist ketanserin was able to do so, notably regarding VH. Consequently, it remains very unclear whether 5HT2ARs and D2Rs may interact in schizophrenia hallucinations if D2Rs are not involved in psychedelic-induced hallucinations. Glutamate/Serotonin Interactions. Both NMDAR antagonists and 5HT2AR agonists induce hallucinations and have been used in drug-induced experimental models of schizophrenia. In addition, some specific cognitive functions, such as the inhibition of return, are impaired in schizophrenia and are disrupted with both NDMAR antagonists and HT2AR agonists. However, other cognitive impairments involved in schizophrenia, including deficits in mismatch negativity, are only reported when administering NDMAR antagonists. Moreover, the prepulse inhibition of the acoustic startle reflex, which is reduced in schizophrenic patients, appears to be increased only by NMDAR antagonists and is unmodified following administration of 5HT2AR agonists in humans. Clinically, NDMAR antagonists also induce negative symptoms, and this class of drugs may present a more sustained face of validity with schizophrenia than psychedelics. Nevertheless, several attempts for integrating NMDAR and 5HT2AR into a common neurobiological framework for psychosis have been proposed. According to some of these theories, abnormalities in one of the two neurotransmission systems could trigger dysfunctions in the other. For example, noncompetitive antagonists NMDAR appear to potentiate the activation of serotoninergic receptors, while positive modulators of NMDARs could inhibit serotoninergic activation. Thus, psychosis may be at least partially the expression of mechanisms in series, in which NMDAR dysfunction leads to the enhanced activation of 5HT2ARs. Other models hypothesize that psychosis results from a final common pathway that is equally disrupted by both NMDAR hypoactivation or 5HT2AR hyperactivation. For example, it is thought that an impairment in the cognitive function of inhibition of return is responsible for the occurrence of psychosis and results from dysfunctions in several different psychopharmacological pathways, that is, NDMAR blockade or 5HT2AR stimulation. More recently, different types of interconnections between glutamatergic and serotoninergic neurotransmission systems have been proposed to explain psychosis. Recent work has shown that the action of psychedelic drugs on 5HT2ARs requires the indispensable formation of a complex between 5HT2AR and the metabotrop-ic glutamatergic mGlu2 receptor (mGlu2R). Furthermore, mGlu2R and mGlu3R agonists experimentally reverse the effects of NMDAR antagonist drugs and appear to have antipsychotic effects in human, notably on positive symptoms of schizophrenia. This suggests that a common pharmacological process involving mGlu2R and mGlu3R hypoactivation may be the missing link between the clinical activities of both NMDAR antagonists and 5HT2AR agonists. The role of dopamine and the mode of action of current antipsychotic drugs are still unclear in relation to this theory, and attempts at a more unified theory would require a multipharmacological model. NMDAR/DR2/5HT2AR Interactions. Because the three pharmacological systems described above that obviously have close interactions between each other, it could be assumed that they belong actually to a complex and integrated neurobiological circuit, whose impairment could occur at various levels in case of psychosis. Experimental studies have shown that the three different systems appear interdependent in inducing psychosis-like behavioral abnormalities in rodents. Recently, several leaders of the field have proposed an entirely integrated model that includes several different neurotransmission systems, most notably the three that are discussed here. This model is constructed around the hypothesis that psychotic symptoms could result from filtering disruptions within the cortico-striato-thalamo-cortical loops, which underlie the level of awareness and attention that is dedicated at any time in the brain to an external stimulus (Figure 1). By disorganizing the filtering processes, different kinds of drugs could trigger psychotic symptoms, and any of D2Rs, 5HT2ARs, and NMDARs may constitute unspecific vulnerability points in this circuitry. D2Rs and NMDARs act directly in the limbic striatum, whereas prefrontal 5HT2AR regulate the striatal activity via the modulation of cortical pyramidal neurons. Such a scheme allows the synthesis of many of the disparate data that have been previously enumerated between the different neurotransmission systems. Thus, an integrated explanation for the occurrence of psychosis is proposed, with respect to the implication of the different aforementioned pharmacological systems. Nevertheless, this theory struggles to properly explain the subtle clinical dissimilarities that are observed depending on the underlying disorder or the ingested drug. Discussion Whether hallucinations occur in schizophrenia or after drug intoxication, they are very often clinically associated with a collection of other symptoms, including delusions, thought disorders, and loss of insight. All these symptoms are usually pooled into the general concept of psychosis. A particular issue about hallucinations is whether such a symptom can be nosologically distinguished from psychosis, or whether it is intrinsically linked in its occurrence with other psychotic symptoms such as delusions. Hallucinations are phenomenologically different from delusions, as hallucinations are misperceptions, while delusions are false beliefs. Nevertheless, both frequently appear mixed together or, if, which supposes a disruption in the cortico-striato-thalamo-cortical loops. This model tries to connect 5HT2R, D2R, and NMDAR in a unified neurobiological system which could be impaired in psychosis. Abbreviations. mPFC: medial prefrontal cortex; VTA: ventral tegmental area; NMDAR: N-methyl-D-aspartate receptor; D2R: dopamine-2 receptor; 5HT2R: 5-hydroxytryptamine-2A receptor. separated, are met in identical types of pathological states. Moreover, it has been contested that misperceptions and false beliefs rely on radically separated cognitive processes. Dopaminergic theories suggest that both types of symptoms result from the increased dopaminergic transmission in the limbic striatum, even if there could be also subtle differences in their respective neural circuitry. In this perspective, delusions and hallucinations are not separate clinical entities but nondissociable components of psychosis. The first concern with that standpoint is that there are many definitions of what is psychosis (Figure 2). While thought disorders are sometimes considered to belong to psychotic symptoms, the most restrictive definition of psychosis is "delusions or prominent hallucinations in the absence of insight into their pathological nature". Moreover, whereas thought disorders are not always considered to be included in psychosis, situations in which hallucinations appear isolated from cognitive disorders are very rare. The state of consciousness is often clinically altered in some way. Even for hallucinations that occur in the general population, the state of consciousness appears to always be associated with infraclinical cognitive impairments in the executive functions and language abilities associated with the symptoms. Thus, it appears difficult to affirm that hallucinations exist outside the scope of psychosis. Furthermore, a distinction has been proposed in the literature, between "hallucinations, " which would refer to "psychotic" states (i.e.,. A second definition is delusions or hallucinations with a sole loss of insightfulness. At last, several authors consider isolated hallucinations to belong to psychosis. associated with anxiety, disorganization and loss of control, and insight upon the symptoms ), and "pseudohallucinations" or "nonpsychotic hallucinations", which refer to misperceptions with no anxiety and insightfulness that the misperceptions are not real. This distinction deserves full attention because "pseudohallucinations" are frequent with psychedelics. Additionally, they have not been reported with psychostimulants or dissociative anesthetics and are rare in acute schizophrenia either. It appears, however, that there could be a threshold effect with psychedelics, above which pseudohallucinations become vivid hallucinations, with loss of insight and increased anxiety. Future studies should precise whether "pseudohallucinations" occur exclusively with 5HT2AR-related drugs or whether there is a dose-effect mechanism that underlies all types of hallucinogenic drugs. If the former scenario was true, it would imply that only psychedelics could induce misperceptions without psychosis, which would restrict such clinical patterns to the sole activity of the HT2ARs. Increased insight does not appear to be the only feature of HT2AR-induced symptoms. The visual component of symptomatology appears to occupy a much larger place than in other hallucinatory pictures, particularly those observed in schizophrenic-related disorders. Furthermore, visual hallucinations occurring in Parkinson's disease have also been related to 5HT2ARs, and recent studies note that the serotoninergic system plays a central role in the visual processing. The occurrence of synesthesia, which is almost uniquely observed with psychedelics and with other hallucinogenic drugs, is relevant to this hypothesis. It appears that, compared with other hallucinogenic drugs, only psychedelics impair the integrity of visual functioning. Consequently, it could be presumed that psychedelics do not trigger strictly the same types of neurobiological processes that are triggered by NMDAR antagonists or even dopaminergic drugs. However, there could be some overlapping, since a recent neuroimaging study has found that psychedelic activity may be related to a disruption in the network relating the prefrontal cortex with the posterior cingulate cortex. Other investigations found that the same brain areas were similarly disrupted by NMDAR antagonist drugs. However, psilocybin-induced visual hallucinations and synesthesia have been repeatedly associated with occipitoparietal cortex activity, which has not been the case either for VH induced either by NDMAR antagonists, or for VH of schizophrenia or first psychosis episode. Nonperceptive symptoms induced by psychedelics are also very specific. These mystical feelings consist of a merging with the external world. This phenonenon, called "oceanic boundleness", is not commonly reported with other classes of hallucinogenic drugs. We assume that the origin of such feelings is derived from a cognitive reconstruction following preliminary visual disruptions. Indeed, serotonergic synesthesia is defined as projections of nonvisual percepts onto the visual field. If one hypothesizes that both acoustic and kinesthetic information can be projected onto the visual field during psychedelic intoxication, then the subject could pathologically overlap sensations of corporal identity with visual perception and thus experience a feeling of merging with the outside world. Of course, such a presumption would require additional experimental support. Even if all of the hallucinogenic drugs act by modulating the stimuli filtering and integrator system, it is also possible that each pharmacological system also specifically acts on other cerebral processes, which could confer quite a specific phenomenological pattern to the disruption of one system compared to the other. Thus, activation of 5HT2ARs could disrupt the information filtering system and induce at the same time a specific process of multisensory attraction by the visual system. On the other hand, NMDAR antagonists could disrupt the information filtering system, thereby enhancing the risk that hallucinations could appear, but at the same time cause interference in several cognitive processes and induce a loss of insight and social withdrawal. Lastly, dopaminergic stimulation may involve a specific dimension of excitement and motor agitation, as it is the main effect of psychostimulants drugs, which is not observed in other drug intoxications. In conclusion, all three hallucinatory mechanisms-D2R activation, 5HT2AR activation, and NMDAR blockageare proposed to trigger partial overlapping neurobiological processes whose hallucinations, among other psychotic symptoms, are the clinically expressed. In addition, the modulation of each of these three receptors induces characteristic cognitive impairments that give each class of hallucinatory drug a specific clinical tonality.
How Open and Distance Education Students use Technology? A Large Scale Study The purpose of this study was to determine the use of e-learning tools and ICTs by open and distance education students. From 40 different programs, 86,842 students in the school year 2013-2014 at Anadolu University participated to the study. A survey form were developed and used as data collecting tool. According to the results of the research, open and distance students own at least one of the tools out of computer, smart phone and tablet. Almost all of the students have a smart phone and internet access. It was determined that the majority of students use e-learning tools provided by University, no matter which ICT tools they have. Internet accessibility increases the e-learning tools usage. But, remarkably high e-learning tools usage level observed also for students with limited internet accessibility. These results show that the variety and richness of provided e-learning tools have critical importance for students with limitations and disabilities. Keywords: open and distance education; e-learning tools; ICT tools
Adaptive Shell Spherical Reflector Actuated with PVDF-TrFE Thin Film Strain Actuators : This paper discusses the design and manufacturing of a thin polymer spherical adaptive reflector of diameter D = 200 mm, controlled by an array of 25 independent electrodes arranged in a keystone configuration actuating a thin film of PVDF-TrFE in d 31 -mode. The 5 m layer of electrostrictive material is spray-coated. The results of the present study confirm that the active material can be modelled by a unidirectional quadratic model and that excellent properties can be achieved if the material is properly annealed. The experimental influence functions of the control electrodes are determined by a quasi-static harmonic technique; they are in good agreement with the numerical simulations and their better circular symmetry indicates a clear improvement in the manufacturing process, as compared to a previous study. The low order optical modes can be reconstructed by combining the 25 influence functions; a regularization technique is used to alleviate the ill-conditioning of the Jacobian and allow to approximate the optical modes with reasonable voltages. Introduction Large aperture deployable spherical reflectors have for long been identified as necessary for the future of telecommunication and monitoring the Earth environment. This brings numerous challenges associated with the launch: volume and weight constraints, harsh vibratory environment, and the in-orbit operation: deployment, surface figure accuracy after deployment, under thermal gradients and gravity gradients. Concepts with low areal density (< 3 kg/m 2 ) and high stowability are of particular interest. Lenticular, pressure stiffened membranes are discussed in Reference ; inflatable space antennas are prone to gas leakage due to micrometeorites, which hinders the application of long duration missions; besides, their wavefront error tends to be dominated by the spherical aberration. Doubly curved, form stiffened elastic shells are explored in References ; the reflector unfolds on its own strain energy once released to form its final shape. A combination of a proven lightweight deployable mesh antenna with a high precision polymer membrane reflector is considered in Reference ; the membrane is controlled actively by a set of electrostatic actuators. In all cases, a high figure accuracy will require some sort of active shape control. This can be realized in various methods depending on the configurations: with a group of thermal actuators for a truss antenna, with electrostatic actuators (acting out of plane) on a mesh supported antenna or with an array of piezoelectric orthotropic actuators (acting in plane) glued on the back of the reflector. The present work is a follow-up to Reference ; it is concerned with adding a thin film of electrostrictive copolymer material (PVDF-TrFE) on a polymer spherical shell substrate; an array of independent electrodes form a set of strain actuators (acting in plane). Two ways of application of copolymer have been investigated-spin-coating and spray-coating. PVDF-TrFE is electrostrictive and behaves quadratically; it is isotropic and, with an appropriate bias electric field, it allows to achieve an excellent piezoelectric constant up to d 31 15 pC/N. Strain actuators are very efficient for to deform flat plate structures and deformable mirrors with active layers of piezoelectric actuators are widely used in Adaptive Optics (AO), for example, Reference. However, the study on the strain actuation of an ultrathin spherical shell shows the morphing behavior is very different from that of a flat plate, because the rigidity of a spherical shell depends very much on the mode of solicitation (achieving a defocus with a given amplitude will be much more difficult than astigmatism). Besides, the accurate shape control with an array of independent electrodes requires that the electrode size (estimated by = 4A/L c, A is the electrode area and L C is the perimeter of the electrode profile) be such that where R c is the radius of curvature and t is the thickness of the shell. Significant departure from the condition of Equation will lead to a steep and wavy transition of the deformed shape between electrodes excited with different actuating strains (i.e., different voltages in the case of electrostrictive materials). According to the foregoing constraints, an adaptive reflector of diameter D = 10 m with a radius of curvature of R c = 200 m and a thickness of t = 175 m would require more than 2000 independent electrodes, and the same reflector with R c = 20 m requires 10 times more. Controlling the shape of structures with such a large number of actuators will require a sophisticated metrology and special control algorithms, because of the ill-conditioning of the Jacobian of the system. This paper reports on a small-scale technology demonstration project called "Multilayer Adaptive Thin Shell Reflectors for Future Space Telescopes" (MATS) developed on behalf of European Space Agency (ESA) in the framework of the General Support Technology Programme (GSTP) program. Preliminary results were published in Reference, with a demonstrator of diameter D = 100 mm, spin-coated, controlled with 7 independent electrodes. The present paper considers a reflector of D = 200 mm controlled with 25 independent electrodes. The PVDF-TrFE is spray-coated rather than spin-coated in the smaller one, because it is more representative of what can be used on a large reflector. Numerical simulations have been reported in Reference ; the present paper reports on the experiments; it is organized as follows-Section 2 recalls the basic equations describing the behavior of an electrostrictive material and summarizes the methods used in Reference to determine the main material properties of PVDF-TrFE thin films. Section 3 discusses the manufacture of the demonstrator. Section 4 reports experimental results on control authority, showing the various influence functions of individual electrodes; they can be combined to approximate low order optical modes. Section 5 concludes the paper. Material Model In the previous part of this study, it was found that the behavior of the thin film of PVDF-TrFE can be accounted for with a linear dielectric model: and the quadratic unidirectional material model: In these equations, D 3 is the electric displacement, P s is the remnant (spontaneous) polarization, 1 = 0 r is the dielectric constant ( 0 = 8.85 10 −12 F/m) and E 3 the electric field. S 3 is the strain along the polarization direction and Q 33 is the electrostrictive coefficient. Q 33 P 2 s is the poling strain which takes place during the polarization. Q 33 and P s are material properties that must be determined experimentally. The strain in the poling direction induces isotropic in-plane strains according to where is the Poisson's ratio. It follows that the piezoelectric coefficient d 31 is given by This equation indicates that a bias electric field increases the piezoelectric coefficient. Thus, any (electrostrictive) material can be made piezoelectric by applying a bias electric field. From the foregoing equation, Material Properties The method for determining the material properties ( 1, d 31, Q 33, P s ) has been described extensively in Reference for the spin-coated film. In the present study, it was decided to substitute the spin-coating of the PVDF-TrFE by spray-coating which can be easily scaled-up to reflectors of large size. The dielectric constant 1 was obtained from capacitance measurements; the piezoelectric constant d 31 was obtained for various bias electric field E 3 from modal analysis on small cantilever beams ( Figure 1). The electrostrictive constant Q 33 was deduced from the slope of the curve d 31 (E 3 ) according to Equation. Typical values obtained on small samples are given in Table 1. The remnant polarization was obtained in two different ways: (i) From Equation after determining d 31 and Q 33 and (ii) from the analysis of the structural response to a quasistatic harmonic excitation E 3 = E B + E 0 cos(2 f 0 t). Because of the quadratic behavior of the electrostrictive material, the structural response exhibits contributions at the excitation frequency f 0 and also at the harmonic 2 f 0. P s can be deduced from the relative amplitudes of these contributions. The two methods lead to consistent results as one can see in the last two lines of Table 1. Surprisingly, the values of the dielectric constant r have been found consistently smaller for the spray coated samples than for the spin coated ones. According to Equation, once Q 33 and P s are known, the poling strain is given by In Reference, a direct measurement was obtained by monitoring during the poling process the curvature of a thin sample of glass covered by PVDF-TrFE and comparing with a finite element simulation; the experiment led to a value of S p consistent with Equation. Manufacturing of the Demonstrator The flowchart of the manufacturing of the demonstrator and the stacking sequence are shown in Figure 2. The starting point is a flat amorphous PET film with a thickness of 175 m. The PET film is a commercial product (Luminor 4001) with a low roughness (R a = 9 nm; R z = 220 nm) which guarantees a good reflectivity of the mirror; it is also free of topcoat (acrylic) which induces significant stresses during the subsequent annealing process. The glass transition temperature and the melting temperature are respectively T g = 85.4 C and T f = 263 C. A 200 nm Aluminum (Al) layer of patterned electrode is deposited by Pulse DC Magnetron Sputtering (PDCMS). Figure 3 shows the keystone layout of the electrodes and the tracks allowing to place all the electrical connections on the edge of the reflector; the mask is obtained by lithography; all electrical connections have a width of 200 m with gaps of 200 m. After numerical simulations of the control performances, the radially uniform electrode size was selected. The second step is the shaping of the reflector; it is achieved by placing the PET substrate in a spherical mold with a radius of curvature R c = 2.5 m (Figure 2b), heating to a temperature of 140 C during 2 h with an external pressure of 2 bars, and cooling to room temperature before demolding. The next step (Figure 2d) consists of spray coating the film of PVDF-TrFE of 4-5 m (coating by spray is preferred to spin coating because it can be easily scaled-up to large areas). The electrostrictive copolymer is the PVDF-TrFE FC25 of Piezotech, already used with spin coating in the previous study ; however, in order to maximize the thickness homogeneity when applied by spray, the copolymer concentration and the solvent mixture (MEK-MIBK) had to be re-optimized; a solution of 6 g/L in MEK-MIBK 75:25 was adopted. Annealing is performed by placing again the reflector in the mold (Figure 2e); it is essential to develop the -phase which is piezoelectric. Annealing must be performed at a temperature T a such that T g < T a < T f ; various tests conducted on samples showed that annealing at T a = 140 C for 2 h leads to the best piezoelectric properties. The sample is cooled down to room temperature, taken out of the mold and a layer of 200 nm of Al is applied by PDCMS for the ground electrode (Figure 2f). Notice that placing the segmented electrode between the PET substrate and the electrostrictive film provides a good electrical insulation and prevents possible arcing between electrodes at different potentials. Next, a 100 nm Al reflecting layer is deposited on the front side. Finally, the reflector is clamped in its support frame and the PVDF-TrFE is polarized by applying a ramp of 1 V/min up to 250 V and then constant during 120 min, inducing the poling strain P s discussed above (Figure 2g). The reflector of 200 mm developed in this study is shown in Figure 4, together with the smaller one developed earlier. Influence Functions In absence of a dedicated system for the metrology of a spherical mirror of D = 200 mm, the influence functions were determined from dynamic measurements using a laser vibrometer Polytec PSV-400. The methodology and the experimental set-up are explained in detail in Reference. The principle consists of covering the reflector surface with a scattering powder (Ardrox developer spray) and exciting it harmonically in the quasi-static range with the segmented electrodes. The amplitude of the harmonic response will follow closely the static shape of the deformation for the selected electrode. The frequency of 15 Hz was selected, well below the first resonance at f 1 = 85 Hz. The harmonic amplitude is 50 V with a bias of 65 V; the shape reconstruction involves 1921 scanned nodes. Figure 5 shows the influence functions of one electrode of each row (E 1, E 2, E 8 and E 15 ) for a voltage normalized to 100 V. The figure shows also cross-sections at 45 of the reflector shape. Figure 6 compares the cross sections of the influence functions of the 6 electrodes of the same row (successively rotated by 60, together with a numerical simulation using a piezoelectric d 31 = 10 pC/N; this value gives the best fit between the experiments and the simulations (comparing with the values of Table 1 obtained on small samples suggests that the annealing of the demonstrator may be imperfect). We now examine how the influence functions can be used to construct the optical (Zernike) modes within a given pupil. Optical Modes Let i be the influence function of electrode i, that is the vector of the surface displacements at n points within the pupil, for a unit voltage applied to electrode i. An optical mode z can be reconstructed within the pupil by solving the equation or where z is the vector containing the amplitudes of the optical mode at the n points in the pupil and J is the Jacobian, a rectangular matrix of order (n, 25) in this case (the columns of J are the influence functions i ). x is the vector containing the voltages of the 25 controlled electrodes. The solution minimizing the fitting error is given by the Moore-Penrose pseudo inverse: However, the Jacobian tends to be ill-conditioned, leading to unnecessary voltages for some electrodes located outside the pupil. To alleviate this, we perform a Tikhonov regularization, also called Damped Least Squares (DLS). The pseudo inverse becomes The damping factor 2 handles the conflicting requirements of minimizing the fitting error and limiting the control actuator budget, that is the voltage range ∆V. The procedure is illustrated for the Trefoil mode in a pupil of 120 mm in Figure 7a. The L-curves express the trade-off between the voltage range and the RMS fitting error. For small values of 2, the voltage range decreases significantly without affecting significantly the fitting error. Figure 7b,c show the result based respectively on numerical and experimental influence functions, for = 2 10 −7. Figure 8 compares the mirror shape obtained with the experimental influence functions with the target for six optical modes: defocus (10 m), astigmatism, trefoil, and coma (5 m). Conclusions This paper discusses the design and manufacturing of a thin polymer spherical adaptive reflector of diameter D = 200 mm, controlled by a set of 25 independent electrodes arranged in a keystone configuration actuating a thin film of PVDF-TrFE in d 31 -mode. The electrostrictive material is spray coated. The results of the present study confirm that the active material can be modelled by a unidirectional quadratic model. The material has excellent properties if properly annealed; however, the dielectric constant r and the piezoelectric constant d 31 of the material obtained by spray coating appear to be slightly lower than those obtained earlier by spin coating. The experimental influence functions of the control electrodes are in good agreement with the numerical simulations and their better circular symmetry indicates a clear improvement in the manufacturing process, as compared to a previous study (comparing to Figure 15 of Reference ). Thanks to a special procedure to alleviate the ill-conditioning of the Jacobian, the reconstructed optical modes are achieved with reasonable voltages (∆V < 100 V, compliant with the ESA specifications). Overall, the performances of the demonstrator are well in line with the expectations and compliant with the requirements of the ESA-MATS project, showing that the technology is a good candidate for controlling the surface figure of large lightweight reflectors.
Duration of Viral Clearance in IDF Soldiers with Mild COVID-19 Policies determining the duration of quarantine and return to work for confirmed COVID-19 patients still lack evidence. We report our findings regarding viral RNA positivity duration among a cohort of young patients with mild disease. Between March 20th, 2020, and May 10th, 2020, 219 soldiers were admitted to the Israel Defense Forces Medical Corps (IDF-MC) COVID-19 rehabilitation center following a positive RT-PCR test for SARS-CoV-2. 119 of these patients, 84 (70.6%) males, 35 (29.4%) females with a median age of 21 (IQR 19-25) were classified as having mild disease and had two consecutive negative RT-PCR tests by May 10th, 2020. The median time for SARS-CoV-2 positivity in nasopharyngeal or oropharyngeal swabs in the study population was 21 days (IQR 15-27) from symptom onset, with a range of 4 to 45 days. The results of this study suggest that in young and healthy adult patients with COVID-19, the median duration of viral positivity is around three weeks. This duration is higher than previously reported in other populations. Young and healthy adults comprise much of the population workforce, and the results of this study may assist in determining the isolation period for symptomatic adults and confirmed COVID-19 patients with mild symptoms. Further studies on this topic should look to expand and determine the intervals of serial testing for confirmed patients and determine the duration of SARS-CoV-2 positivity in other populations.
<filename>main.c<gh_stars>1-10 /** * Blink example in ROS, DO NOT use any function in Arduino.h */ #include <avr/io.h> #include "ros.h" // include for simavr // #include "avr_mcu_section.h" // AVR_MCU(F_CPU, "atmega328p"); ROS_TCB task1; ROS_TCB task2; uint8_t task1_stack[ROS_DEFAULT_STACK_SIZE]; uint8_t task2_stack[ROS_DEFAULT_STACK_SIZE]; #define LED1 13 #define LED2 12 #define bitSet(value, bit) ((value) |= (1UL << (bit))) #define bitClear(value, bit) ((value) &= ~(1UL << (bit))) #define TASK1_PRIORITY 1 #define TASK2_PRIORITY 0 // max priority void t1() { while (1) { // set LED1 high bitSet(PORTB, 5); ros_delay(200); bitClear(PORTB, 5); ros_delay(200); } } void t2() { while (1) { bitSet(PORTB, 4); // delay a second ros_delay(100); bitClear(PORTB, 4); ros_delay(100); } } void setup() { // set LED 13 and LED 12 as output bitSet(DDRB, 5); bitSet(DDRB, 4); bool os_started = ros_init(); if (os_started) { ros_create_task(&task1, t1, TASK1_PRIORITY, task1_stack, ROS_DEFAULT_STACK_SIZE); ros_create_task(&task2, t2, TASK2_PRIORITY, task2_stack, ROS_DEFAULT_STACK_SIZE); ros_schedule(); } } void loop() { // nothing } int main() { setup(); // never call loop loop(); return 0; }
. Circadian rhythm of TSH was analyzed in patients with cold tumors of the thyroid before and after surgical removal of the tumors and in control subjects. By using special computer program BIOR based on harmonic and regression analysis, designed for verifying and comparing various biorhythms, significant differences were found between TSH biorhythms in patients with cold thyroid tumors before and after the operation.
PROJECT: Energy for the green village Osona West The Osona West project is the first in Namibia, which attempts to integrate various energy related components for a residential and business project. Based on experiences from several projects in Namibia, the paper will highlight features, such as a mini-grid and stand-alone units, as part of applying renewable energy principles and technologies to make the green village as energy self-sufficient as possible.
Design of Fucoidan Functionalized - Iron Oxide Nanoparticles for Biomedical Applications. This research aims to develop an iron oxide nanoparticle drug delivery system utilizing a recent material discovered from ocean, fucoidan. The material has drawn much interest due to many biomedical functions that have been proven for human health. One interesting point herein is that fucoidan is not only a sulfated polysaccharide, a polymer for stabilization of iron oxide nanoparticles, but plays a role of an anticancer agent also. Various approaches were investigated to optimize the high loading efficiency and explain the mechanism of nanoparticle formations. Fucoidan was functionalized on iron oxide nanoparticles by a direct coating or via amine groups. Also, a hydrophobic part of oleic acid was conjugated to the amine groups for a more favorable loading of poorly water-soluble anticancer drugs. This study proposed a novel system and an efficient method to functionalize fucoidan on iron oxide nanoparticle systems which will lead to a facilitation of a double strength treatment of cancer.
<reponame>agahkarakuzu/Biosignal-Emotions-BHS-2020<gh_stars>0 # import necessary libraries import scipy.io as sio import numpy as np import pandas as pd # load features extracted from preprocessed EEG and ECG data path_EEG='DREAMER_Extracted_EEG.csv' path_ECG='DREAMER_Extracted_ECG.csv' data_EEG=pd.read_csv(path_EEG).drop(['Unnamed: 0'],axis=1) data_ECG=pd.read_csv(path_ECG).drop(['Unnamed: 0'],axis=1) # load mat file containing raw biosignal, emotion, participant, and video data data=sio.loadmat('DREAMER.mat') # create new dataframe with emotion, participant, and video data a=np.zeros((23,18,9),dtype=object) for participant in range(0,23): for video in range(0,18): a[participant,video,0]=data['DREAMER'][0,0]['Data'][0,participant]['Age'][0][0][0] a[participant,video,1]=data['DREAMER'][0,0]['Data'][0,participant]['Gender'][0][0][0] a[participant,video,2]=participant+1 a[participant,video,3]=video+1 a[participant,video,4]=['Searching for B<NAME>','D.O.A.', 'The Hangover', 'The Ring', '300', 'National Lampoon\'s VanWilder', 'Wall-E', 'Crash', 'My Girl', 'The Fly', 'Pride and Prejudice', 'Modern Times', 'Remember the Titans', 'Gentlemans Agreement', 'Psycho', 'The Bourne Identitiy', 'The Shawshank Redemption', 'The Departed'][video] a[participant,video,5]=['calmness', 'surprise', 'amusement', 'fear', 'excitement', 'disgust', 'happiness', 'anger', 'sadness', 'disgust', 'calmness', 'amusement', 'happiness', 'anger', 'fear', 'excitement', 'sadness', 'surprise'][video] a[participant,video,6]=data['DREAMER'][0,0]['Data'][0,participant]['ScoreValence'][0,0][video,0] a[participant,video,7]=data['DREAMER'][0,0]['Data'][0,participant]['ScoreArousal'][0,0][video,0] a[participant,video,8]=data['DREAMER'][0,0]['Data'][0,participant]['ScoreDominance'][0,0][video,0] b=pd.DataFrame(a.reshape((23*18,a.shape[2])),columns=['Age','Gender','Participant','Video','Video_Name','Target_Emotion','Valence','Arousal','Dominance']) # combine feature extraction dataframes with the new dataframe all_data=pd.concat([data_EEG,data_ECG,b],axis=1) print(all_data.head()) all_data.to_csv('DREAMER_Preprocessed_NotTransformed_NotThresholded.csv')
Hollywood Star who read 90% of Bhagavad Gita Tue Dec 19 2017 15:14:42 GMT+0530 (IST) facebook twitter google plus whatsapp Will Smith is familiar to Indians with Hollywood blockbusters such as 'Hitch', 'I am Legend', 'The Pursuit of Happiness' and 'I Robot'. He is currently on his 4th visit to India and also been to Mumbai thrice so far. The Hollywood Star reveals Akshay Kumar hosted him dinner the last time he was in Mumbai. 'It's the best food I have ever had. Didn't felt right to call Akshay and ask him to send food as I won't be able to control myself. Food at Akshay's place is one thing I like about India,' says Smith. Could you believe Will Smith admires Indian history? What would be your reaction if he claims to have gone through 90 percent of Bhagwad Gita? But, It's true! Smith feels like his inner Arjuna is being channeled after reading Gita. He is even planning to visit Rishikesh soon & wishes to spend more time in India.
interface Config { name: string, entry: string, container: string, activeRule: string, props: { [key: string]: any } } import { registerMicroApps, start } from 'qiankun' export function startQiankun () : void { const apps: Config[] = [ { name: 'vue-app', entry: '//localhost:3030', container: '#container', activeRule: '/vue-app', props: {} }, { name: 'qiankun-react', entry: '//localhost:3000', container: '#container', activeRule: '/react', props: {} } ] registerMicroApps(apps, {}) start({ prefetch: 'all' }) }
Duke of Buckingham and Normanby Duke of Buckingham and Normanby was a title in the Peerage of England. The full title was Duke of the County of Buckingham and of Normanby but in practice only Duke of Buckingham and Normanby was used. The dukedom was created in 1703 for John Sheffield, 1st Marquess of Normanby KG, a notable Tory politician of the late Stuart period, who served under Queen Anne as Lord Privy Seal and Lord President of the Council. He had succeeded his father as 3rd Earl of Mulgrave in 1658 and been made Marquess of Normanby in 1694. The duke's family descended from Sir Edmund Sheffield, second cousin of Henry VIII, who in 1547 was raised to the Peerage of England as Baron Sheffield and in 1549 was murdered in the streets of Norwich during Kett's Rebellion. His grandson, the 3rd Baron, served as Lord Lieutenant of Yorkshire from 1603 to 1619 and was created Earl of Mulgrave in 1626, also in the Peerage of England. On the death of the 2nd Duke of Buckingham and Normanby in 1735, all these titles became extinct. The Sheffield family estates passed to the 2nd duke's half-brother Charles Herbert—the illegitimate son of the 1st Duke by Frances Stewart—who changed his surname to Sheffield as a condition of the 2nd duke's will, thereby becoming Charles Herbert Sheffield. Charles Herbert Sheffield was created a Baronet in 1755 and is the ancestor of the Sheffield Baronets, of Normanby. The Mulgrave title was used again in 1767 when Constantine Phipps was made Baron Mulgrave. He was the son of William Phipps and Lady Catherine Annesley (daughter and heiress of James Annesley, 3rd Earl of Anglesey and his wife Lady Catherine Darnley, illegitimate daughter of King James II by his mistress Catherine Sedley, Countess of Dorchester). Lady Catherine Darnley later married John Sheffield, 1st Duke of Buckingham and Normanby, and hence Constantine Phipps, 1st Baron Mulgrave was the step-grandson of the 1st Duke of Buckingham and Normanby. In 1838 also the Normanby title was used again when the 1st Baron Mulgrave's grandson Constantine was made Marquess of Normanby. These titles are still extant.
package org.kuali.coeus.propdev.api.budget.modular; import org.kuali.coeus.common.budget.api.core.IdentifiableBudget; import org.kuali.coeus.common.budget.api.rate.RateClassContract; import org.kuali.coeus.sys.api.model.Describable; import org.kuali.coeus.sys.api.model.ScaleTwoDecimal; public interface BudgetModularIdcContract extends Describable, IdentifiableBudget { Long getBudgetPeriodId(); Integer getBudgetPeriod(); Integer getRateNumber(); ScaleTwoDecimal getIdcRate(); ScaleTwoDecimal getIdcBase(); ScaleTwoDecimal getFundsRequested(); RateClassContract getRateClass(); }
Simply thinking that you got a good night's sleep can make your brain work better, according to new research. The phenomenon is thought to be a result of the placebo effect – which normally occurs in patients who are given inactive drugs they believe to be pharmaceuticals, leading to improvements in their health. Researchers at Colorado College found it is possible to also trick the brain into believing it has slept well and so produce the same effects as a real good nights sleep. Participants in their study were asked to rate how deeply they had slept the night before, on a scale of 1-10. Students were told that a new technique – which doesn’t actually exist – could measure their sleep quality from the night before using sensors which they were told would measure their pulse, heart rate, and brainwave frequency. This was, in fact, a lie. The participants were then randomly assigned to two groups. One group were informed that their deep, or REM, sleep had been above average the night before, at 28.7 per cent REM sleep. They were told that this was a sign that they were mentally alert. The other group were told their REM sleep from the night before had been below average, at 16.2 per cent REM sleep. Both groups were given a lecture on how getting more and better sleep improves cognitive function. Participants were informed that, on average, normal adults spend between 20% and 25% of their sleep time in REM sleep and that individuals who spend less than 20% of their time in REM sleep tend to perform worse on tests of learning and memory, whereas individuals who spend more than 25% of their time in REM sleep tend to perform better. The participants who were informed that they had experienced below average sleep quality, tended to perform worse on the test, regardless of how well they originally felt they had slept. According to the research, led by Christina Draganich and Kristi Erdal: "In these experiments, cognitive functioning appeared to be mediated by placebo information, as it was dependent on the assigned sleep quality told to the participants as opposed to their actual self-reported sleep quality".
Situated in a sort after location off popular Brock Hill set close to open farmland and nature reserve yet within easy access of town and mainline station is this spacious detached family home benefitting from a 270' plot. The property has been extended and much improved and provides well laid out accommodation including Sitting Room 14'10 x 10'10, feature Kitchen/Diner 20' x 15'10, Lounge 22'6 x 13' with garden aspect and log burner, Covered al-fresco Sitting Area 36' x 11'6 with 4 generous first floor Bedrooms including 2 en-suites and a Master Bedroom 17'8 x 12'4 with dressing room and fitted furniture. There is also a family Bathroom with 4 piece suite, ground floor cloakroom, large garage 16'10 x 10'4 with electric door, uitility room and superb garden approaching 190' in depth. SPACIOUS ENTRANCE HALL 19' x 6' 8 (5.79m x 2.03m) Double glazed opaque door and panelling to front, radiator in casement surround. CLOAKROOM with double galzed opaque window to side, suite comprising of low level W.C. and wash hand basin, radiator, tiling to floor and surround. LARGE INTEGRAL GARAGE 16' 10 x 10' 4 (5.13m x 3.15m) with internal door from hall, electric up and over door to front, power and light connected. Hot and cold water taps. SITTING ROOM 14' 10 x 10' 10 (4.52m x 3.3m) with double glazed bay window to front, radiator, coving to ceiling, fireplace. UTILITY ROOM 9' 8 x 7' (2.95m x 2.13m) with double glazed window and door to rear, range of base and wall units, roll top work surface with inset sink and cupboard beneath, space for washing machine, tumble dryer and fridge/freezer, recently updated Potterton boiler, tiling to floor and surround. FEATURE KITCHEN/DINER 20' x 15' 10 (6.1m x 4.83m) with extensive range of high gloss units refitted in recent years and work tops extending to incorporate inset sink and breakfast bar, down and level lighting to both base and wall units with space for fridge/freezer and range style cooker, integrated dish washer and further full height storage units, 2 upright radiators, double glazed windows to both sides and rear and double glazed door to side. SPACIOUS LOUNGE 22' 6 x 13' (6.86m x 3.96m) with double glazed French doors and windows overlooking lovely rear garden and 2 additional double glazed windows to side, radiator and fireplace with inset log burner, coving to ceiling. COVERED ALFRESCO AREA 36' x 11' 6 (10.97m x 3.51m) lovely covered family area accessed from kitchen with outside lights, power and tiled floor extending to rear garden. FIRST FLOOR LANDING with feature opaque window to side, access to loft which we understand is boarded with power and light connected. EN-SUITE NO. 1 with double glazed opaque window to side, suite comprising of low level W.C., wash hand basin and large shower cubicle, tiled floor and surround, radiator/rail. EN-SUITE NO. 2 with double glazed opaque window to side, suite comprising of low level W.C., wash hand basin and large shower cubicle, radiator/rail, extensive tiling to floor and walls. BEDROOM 3 14' 5 x 9' (4.39m x 2.74m) with double glazed window to rear, radiator, coving to ceiling. BEDROOM 4 11' 4 x 8' 3 (3.45m x 2.51m) with double glazed window to rear, radiator, coving to ceiling. LARGE FAMILY BATHROOM 10' x 6' 6 (3.05m x 1.98m) with double glazed opaque window to rear and 4 piece suite comprising of low level W.C., wash hand basin, corner bath and independent shower cubicle, radiator, extensive tiling to floor and walls. SUPERB 190' REAR GARDEN with superb wall retained patio to immediate rear with inset lighting and numerous power points. There are steps leading to large lawn with established shrubs and trees. There are a number of outbuildings to the rear of the garden and access via path and gate to side. The garden is fenced and the plot is approximately 270' in depth which is approaching a fifth of an acre. DRIVEWAY TO GARAGE The property has been block paved to front providing parking for at least 3 cars and large integral garage offering additional parking.
<gh_stars>0 /////////////////////////////////////////////////////////////////////////////// // Name: tests/strings/vsnprintf.cpp // Purpose: wxVsnprintf unit test // Author: <NAME> // (part of this file was taken from CMP.c of TRIO package // written by <NAME> and <NAME>) // Created: 2006-04-01 // Copyright: (c) 2006 <NAME>, <NAME> and <NAME> /////////////////////////////////////////////////////////////////////////////// // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- #include "testprec.h" #include "wx/crt.h" #if wxUSE_WXVSNPRINTF #ifndef WX_PRECOMP #include "wx/wx.h" #include "wx/wxchar.h" #endif // WX_PRECOMP // NOTE: for more info about the specification of wxVsnprintf() behaviour you can // refer to the following page of the GNU libc manual: // http://www.gnu.org/software/libc/manual/html_node/Formatted-Output.html // ---------------------------------------------------------------------------- // global utilities for testing // ---------------------------------------------------------------------------- #define MAX_TEST_LEN 1024 // temporary buffers static wxChar buf[MAX_TEST_LEN]; int r; // Helper macro verifying both the return value of wxSnprintf() and its output. // // NOTE: the expected string length with this macro must not exceed MAX_TEST_LEN #define CMP(expected, fmt, ...) \ r=wxSnprintf(buf, MAX_TEST_LEN, fmt, ##__VA_ARGS__); \ CHECK( r == (int)wxStrlen(buf) ); \ CHECK( buf == wxString(expected) ) // Another helper which takes the size explicitly instead of using MAX_TEST_LEN // // NOTE: this macro is used also with too-small buffers (see Miscellaneous()) // test function, thus the return value can be either -1 or > size and we // cannot check if r == (int)wxStrlen(buf) #define CMPTOSIZE(buffer, size, failuremsg, expected, fmt, ...) \ r=wxSnprintf(buffer, size, fmt, ##__VA_ARGS__); \ INFO(failuremsg); \ CHECK( buffer == wxString(expected).Left(size - 1) ) // this is the same as wxSnprintf() but it passes the format string to // wxVsnprintf() without using WX_ATTRIBUTE_PRINTF and thus suppresses the gcc // checks (and resulting warnings) for the format string // // use with extreme care and only when you're really sure the warnings must be // suppressed! template<typename T> static int wxUnsafeSnprintf(T *buf, size_t len, const wxChar *fmt, ...) { va_list args; va_start(args, fmt); int rc = wxVsnprintf(buf, len, fmt, args); va_end(args); return rc; } // ---------------------------------------------------------------------------- // test fixture // ---------------------------------------------------------------------------- // Explicitly set C locale to avoid check failures when running on machines // with a locale where the decimal point is not '.' class VsnprintfTestCase : CLocaleSetter { public: VsnprintfTestCase() : CLocaleSetter() { } protected: template<typename T> void DoBigToSmallBuffer(T *buffer, int size); // compares the expectedString and the result of wxVsnprintf() char by char // for all its length (not only for first expectedLen chars) and also // checks the return value void DoMisc(int expectedLen, const wxString& expectedString, size_t max, const wxChar *format, ...); wxDECLARE_NO_COPY_CLASS(VsnprintfTestCase); }; TEST_CASE_METHOD(VsnprintfTestCase, "Vsnprintf::C", "[vsnprintf]") { CMP("hi!", "%c%c%c", wxT('h'), wxT('i'), wxT('!')); // NOTE: // the NULL characters _can_ be passed to %c to e.g. create strings // with embedded NULs (because strings are not always supposed to be // NUL-terminated). DoMisc(14, wxT("Hello \0 World!"), 16, wxT("Hello %c World!"), wxT('\0')); } TEST_CASE_METHOD(VsnprintfTestCase, "Vsnprintf::D", "[vsnprintf]") { CMP("+123456", "%+d", 123456); CMP("-123456", "%d", -123456); CMP(" 123456", "% d", 123456); CMP(" 123456", "%10d", 123456); CMP("0000123456", "%010d", 123456); CMP("-123456 ", "%-10d", -123456); } TEST_CASE_METHOD(VsnprintfTestCase, "Vsnprintf::X", "[vsnprintf]") { CMP("ABCD", "%X", 0xABCD); CMP("0XABCD", "%#X", 0xABCD); CMP("0xabcd", "%#x", 0xABCD); } TEST_CASE_METHOD(VsnprintfTestCase, "Vsnprintf::O", "[vsnprintf]") { CMP("1234567", "%o", 01234567); CMP("01234567", "%#o", 01234567); } TEST_CASE_METHOD(VsnprintfTestCase, "Vsnprintf::P", "[vsnprintf]") { // The exact format used for "%p" is not specified by the standard and so // varies among different platforms, so we need to expect different results // here (remember that while we test our own wxPrintf() code here, it uses // the system sprintf() for actual formatting so the results are still // different under different systems). #if defined(__VISUALC__) || (defined(__MINGW32__) && \ (!defined(__USE_MINGW_ANSI_STDIO) || !__USE_MINGW_ANSI_STDIO)) #if SIZEOF_VOID_P == 4 CMP("00ABCDEF", "%p", (void*)0xABCDEF); CMP("00000000", "%p", (void*)NULL); #elif SIZEOF_VOID_P == 8 CMP("0000ABCDEFABCDEF", "%p", (void*)0xABCDEFABCDEF); CMP("0000000000000000", "%p", (void*)NULL); #endif #elif defined(__MINGW32__) #if SIZEOF_VOID_P == 4 CMP("00abcdef", "%p", (void*)0xABCDEF); CMP("00000000", "%p", (void*)NULL); #elif SIZEOF_VOID_P == 8 CMP("0000abcdefabcdef", "%p", (void*)0xABCDEFABCDEF); CMP("0000000000000000", "%p", (void*)NULL); #endif #elif defined(__GNUG__) // glibc prints pointers as %#x except for NULL pointers which are printed // as '(nil)'. CMP("0xabcdef", "%p", (void*)0xABCDEF); CMP("(nil)", "%p", (void*)NULL); #endif } TEST_CASE_METHOD(VsnprintfTestCase, "Vsnprintf::N", "[vsnprintf]") { int nchar; wxSnprintf(buf, MAX_TEST_LEN, wxT("%d %s%n\n"), 3, wxT("bears"), &nchar); CHECK( nchar == 7 ); } TEST_CASE_METHOD(VsnprintfTestCase, "Vsnprintf::E", "[vsnprintf]") { // NB: Use at least three digits for the exponent to workaround // differences between MSVC, MinGW and GNU libc. // See wxUSING_MANTISSA_SIZE_3 in testprec.h as well. // // Some examples: // printf("%e",2.342E+02); // -> under MSVC7.1 prints: 2.342000e+002 // -> under GNU libc 2.4 prints: 2.342000e+02 CMP("2.342000e+112", "%e",2.342E+112); CMP("-2.3420e-112", "%10.4e",-2.342E-112); CMP("-2.3420e-112", "%11.4e",-2.342E-112); CMP(" -2.3420e-112", "%15.4e",-2.342E-112); CMP("-0.02342", "%G",-2.342E-02); CMP("3.1415E-116", "%G",3.1415e-116); CMP("0003.141500e+103", "%016e", 3141.5e100); CMP(" 3.141500e+103", "%16e", 3141.5e100); CMP("3.141500e+103 ", "%-16e", 3141.5e100); CMP("3.142e+103", "%010.3e", 3141.5e100); } TEST_CASE_METHOD(VsnprintfTestCase, "Vsnprintf::F", "[vsnprintf]") { CMP("3.300000", "%5f", 3.3); CMP("3.000000", "%5f", 3.0); CMP("0.000100", "%5f", .999999E-4); CMP("0.000990", "%5f", .99E-3); CMP("3333.000000", "%5f", 3333.0); } TEST_CASE_METHOD(VsnprintfTestCase, "Vsnprintf::G", "[vsnprintf]") { // NOTE: the same about E() testcase applies here... CMP(" 3.3", "%5g", 3.3); CMP(" 3", "%5g", 3.0); CMP("9.99999e-115", "%5g", .999999E-114); CMP("0.00099", "%5g", .99E-3); CMP(" 3333", "%5g", 3333.0); CMP(" 0.01", "%5g", 0.01); CMP(" 3", "%5.g", 3.3); CMP(" 3", "%5.g", 3.0); CMP("1e-114", "%5.g", .999999E-114); CMP("0.0001", "%5.g", 1.0E-4); CMP("0.001", "%5.g", .99E-3); CMP("3e+103", "%5.g", 3333.0E100); CMP(" 0.01", "%5.g", 0.01); CMP(" 3.3", "%5.2g", 3.3); CMP(" 3", "%5.2g", 3.0); CMP("1e-114", "%5.2g", .999999E-114); CMP("0.00099", "%5.2g", .99E-3); CMP("3.3e+103", "%5.2g", 3333.0E100); CMP(" 0.01", "%5.2g", 0.01); } TEST_CASE_METHOD(VsnprintfTestCase, "Vsnprintf::S", "[vsnprintf]") { CMP(" abc", "%5s", wxT("abc")); CMP(" a", "%5s", wxT("a")); CMP("abcdefghi", "%5s", wxT("abcdefghi")); CMP("abc ", "%-5s", wxT("abc")); CMP("abcdefghi", "%-5s", wxT("abcdefghi")); CMP("abcde", "%.5s", wxT("abcdefghi")); // do the same tests but with Unicode characters: #if wxUSE_UNICODE // Unicode code points from U+03B1 to U+03B9 are the greek letters alpha-iota; // UTF8 encoding of such code points is 0xCEB1 to 0xCEB9 #define ALPHA "\xCE\xB1" // alpha #define ABC "\xCE\xB1\xCE\xB2\xCE\xB3" // alpha+beta+gamma #define ABCDE "\xCE\xB1\xCE\xB2\xCE\xB3\xCE\xB4\xCE\xB5" // alpha+beta+gamma+delta+epsilon #define ABCDEFGHI "\xCE\xB1\xCE\xB2\xCE\xB3\xCE\xB4\xCE\xB5\xCE\xB6\xCE\xB7\xCE\xB8\xCE\xB9" // alpha+beta+gamma+delta+epsilon+zeta+eta+theta+iota // the 'expected' and 'arg' parameters of this macro are supposed to be // UTF-8 strings #define CMP_UTF8(expected, fmt, arg) \ CHECK \ ( \ (int)wxString::FromUTF8(expected).length() == \ wxSnprintf(buf, MAX_TEST_LEN, fmt, wxString::FromUTF8(arg)) \ ); \ CHECK( wxString::FromUTF8(expected) == buf ) CMP_UTF8(" " ABC, "%5s", ABC); CMP_UTF8(" " ALPHA, "%5s", ALPHA); CMP_UTF8(ABCDEFGHI, "%5s", ABCDEFGHI); CMP_UTF8(ABC " ", "%-5s", ABC); CMP_UTF8(ABCDEFGHI, "%-5s", ABCDEFGHI); CMP_UTF8(ABCDE, "%.5s", ABCDEFGHI); #endif // wxUSE_UNICODE // test a string which has a NULL character after "ab"; // obviously it should be handled exactly like just as "ab" CMP(" ab", "%5s", wxT("ab\0cdefghi")); } TEST_CASE_METHOD(VsnprintfTestCase, "Vsnprintf::Asterisk", "[vsnprintf]") { CMP(" 0.1", "%*.*f", 10, 1, 0.123); CMP(" 0.1230", "%*.*f", 10, 4, 0.123); CMP("0.1", "%*.*f", 3, 1, 0.123); CMP("%0.002", "%%%.*f", 3, 0.0023456789); CMP(" a", "%*c", 8, 'a'); CMP(" four", "%*s", 8, "four"); CMP(" four four", "%*s %*s", 8, "four", 6, "four"); } TEST_CASE_METHOD(VsnprintfTestCase, "Vsnprintf::Percent", "[vsnprintf]") { // some tests without any argument passed through ... CMP("%", "%%"); CMP("%%%", "%%%%%%"); CMP("% abc", "%%%5s", wxT("abc")); CMP("% abc%", "%%%5s%%", wxT("abc")); // do not test odd number of '%' symbols as different implementations // of snprintf() give different outputs as this situation is not considered // by any standard (in fact, GCC will also warn you about a spurious % if // you write %%% as argument of some *printf function !) // Compare(wxT("%"), wxT("%%%")); } #ifdef wxLongLong_t TEST_CASE_METHOD(VsnprintfTestCase, "Vsnprintf::LongLong", "[vsnprintf]") { CMP("123456789", "%lld", (wxLongLong_t)123456789); CMP("-123456789", "%lld", (wxLongLong_t)-123456789); CMP("123456789", "%llu", (wxULongLong_t)123456789); #ifdef __WINDOWS__ CMP("123456789", "%I64d", (wxLongLong_t)123456789); CMP("123456789abcdef", "%I64x", wxLL(0x123456789abcdef)); #endif } #endif TEST_CASE_METHOD(VsnprintfTestCase, "Vsnprintf::WrongFormatStrings", "[vsnprintf]") { // test how wxVsnprintf() behaves with wrong format string: // a missing positional arg should result in an assert WX_ASSERT_FAILS_WITH_ASSERT( wxSnprintf(buf, MAX_TEST_LEN, wxT("%1$d %3$d"), 1, 2, 3) ); // positional and non-positionals in the same format string: errno = 0; r = wxSnprintf(buf, MAX_TEST_LEN, wxT("%1$d %d %3$d"), 1, 2, 3); CHECK( r == -1 ); CHECK( errno == EINVAL ); } // BigToSmallBuffer() test case helper: template<typename T> void VsnprintfTestCase::DoBigToSmallBuffer(T *buffer, int size) { // Remember that wx*printf could be mapped either to system // implementation or to wx implementation. // In the first case, when the output buffer is too small, the returned // value can be the number of characters required for the output buffer // (conforming to ISO C99; implemented in e.g. GNU libc >= 2.1), or // just a negative number, usually -1; (this is how e.g. MSVC's // *printf() behaves). Luckily, in all implementations, when the // output buffer is too small, it's nonetheless filled up to its max size. // // Note that in the second case (i.e. when we're using our own implementation), // wxVsnprintf() will return the number of characters written in the standard // output or // -1 if there was an error in the format string // maxSize+1 if the output buffer is too small wxString errStr; errStr << "The size of the buffer was " << size; std::string errMsg(errStr.mb_str()); // test without positionals CMPTOSIZE(buffer, size, errMsg, "123456789012 - test - 123 -4.567", "%i%li - test - %d %.3f", 123, (long int)456789012, 123, -4.567); #if wxUSE_PRINTF_POS_PARAMS // test with positional CMPTOSIZE(buffer, size, errMsg, "-4.567 123 - test - 456789012 123", "%4$.3f %1$i - test - %2$li %3$d", 123, (long int)456789012, 123, -4.567); #endif // test unicode/ansi conversion specifiers // // NB: we use wxUnsafeSnprintf() as %hs and %hc are invalid in printf // format and gcc would warn about this otherwise r = wxUnsafeSnprintf(buffer, size, wxT("unicode string/char: %ls/%lc -- ansi string/char: %hs/%hc"), L"unicode", L'U', "ansi", 'A'); wxString expected = wxString(wxT("unicode string/char: unicode/U -- ansi string/char: ansi/A")).Left(size - 1); CHECK( expected == buffer ); } TEST_CASE_METHOD(VsnprintfTestCase, "Vsnprintf::BigToSmallBuffer", "[vsnprintf]") { #if wxUSE_UNICODE wchar_t bufw[1024], bufw2[16], bufw3[4], bufw4; DoBigToSmallBuffer(bufw, 1024); DoBigToSmallBuffer(bufw2, 16); DoBigToSmallBuffer(bufw3, 4); DoBigToSmallBuffer(&bufw4, 1); #endif // wxUSE_UNICODE char bufa[1024], bufa2[16], bufa3[4], bufa4; DoBigToSmallBuffer(bufa, 1024); DoBigToSmallBuffer(bufa2, 16); DoBigToSmallBuffer(bufa3, 4); DoBigToSmallBuffer(&bufa4, 1); } // Miscellaneous() test case helper: void VsnprintfTestCase::DoMisc( int expectedLen, const wxString& expectedString, size_t max, const wxChar *format, ...) { const size_t BUFSIZE = MAX_TEST_LEN - 1; size_t i; static int count = 0; wxASSERT(max <= BUFSIZE); for (i = 0; i < BUFSIZE; i++) buf[i] = '*'; buf[BUFSIZE] = 0; va_list ap; va_start(ap, format); int n = wxVsnprintf(buf, max, format, ap); va_end(ap); // Prepare messages so that it is possible to see from the error which // test was running. wxString errStr, overflowStr; errStr << wxT("No.: ") << ++count << wxT(", expected: ") << expectedLen << wxT(" '") << expectedString << wxT("', result: "); overflowStr << errStr << wxT("buffer overflow"); errStr << n << wxT(" '") << buf << wxT("'"); // turn them into std::strings std::string errMsg(errStr.mb_str()); std::string overflowMsg(overflowStr.mb_str()); INFO(errMsg); if ( size_t(n) < max ) CHECK(expectedLen == n); else CHECK(expectedLen == -1); CHECK(expectedString == buf); for (i = max; i < BUFSIZE; i++) { INFO(overflowMsg); CHECK(buf[i] == '*'); } } TEST_CASE_METHOD(VsnprintfTestCase, "Vsnprintf::Miscellaneous", "[vsnprintf]") { // expectedLen, expectedString, max, format, ... DoMisc(5, wxT("-1234"), 8, wxT("%d"), -1234); DoMisc(7, wxT("1234567"), 8, wxT("%d"), 1234567); DoMisc(-1, wxT("1234567"), 8, wxT("%d"), 12345678); DoMisc(-1, wxT("-123456"), 8, wxT("%d"), -1234567890); DoMisc(6, wxT("123456"), 8, wxT("123456")); DoMisc(7, wxT("1234567"), 8, wxT("1234567")); DoMisc(-1, wxT("1234567"), 8, wxT("12345678")); DoMisc(6, wxT("123450"), 8, wxT("12345%d"), 0); DoMisc(7, wxT("1234560"), 8, wxT("123456%d"), 0); DoMisc(-1, wxT("1234567"), 8, wxT("1234567%d"), 0); DoMisc(-1, wxT("1234567"), 8, wxT("12345678%d"), 0); DoMisc(6, wxT("12%45%"), 8, wxT("12%%45%%")); DoMisc(7, wxT("12%45%7"), 8, wxT("12%%45%%7")); DoMisc(-1, wxT("12%45%7"), 8, wxT("12%%45%%78")); DoMisc(5, wxT("%%%%%"), 6, wxT("%%%%%%%%%%")); DoMisc(6, wxT("%%%%12"), 7, wxT("%%%%%%%%%d"), 12); } /* (C) Copyright <NAME> * * Feel free to copy, use and distribute this software provided: * * 1. you do not pretend that you wrote it * 2. you leave this copyright notice intact. */ TEST_CASE_METHOD(VsnprintfTestCase, "Vsnprintf::GlibcMisc1", "[vsnprintf]") { CMP(" ", "%5.s", "xyz"); CMP(" 33", "%5.f", 33.3); #if defined(wxDEFAULT_MANTISSA_SIZE_3) CMP(" 3e+008", "%8.e", 33.3e7); CMP(" 3E+008", "%8.E", 33.3e7); CMP("3e+001", "%.g", 33.3); CMP("3E+001", "%.G", 33.3); #else CMP(" 3e+08", "%8.e", 33.3e7); CMP(" 3E+08", "%8.E", 33.3e7); CMP("3e+01", "%.g", 33.3); CMP("3E+01", "%.G", 33.3); #endif } TEST_CASE_METHOD(VsnprintfTestCase, "Vsnprintf::GlibcMisc2", "[vsnprintf]") { int prec; wxString test_format; prec = 0; CMP("3", "%.*g", prec, 3.3); prec = 0; CMP("3", "%.*G", prec, 3.3); prec = 0; CMP(" 3", "%7.*G", prec, 3.33); prec = 3; CMP(" 041", "%04.*o", prec, 33); prec = 7; CMP(" 0000033", "%09.*u", prec, 33); prec = 3; CMP(" 021", "%04.*x", prec, 33); prec = 3; CMP(" 021", "%04.*X", prec, 33); } #endif // wxUSE_WXVSNPRINTF
<filename>scout/commands/delete/__init__.py<gh_stars>1-10 from .delete_command import delete
<reponame>BorvizRobi/atlassian-restclient-jiracloud /* * Copyright © 2011 <NAME>. (http://www.everit.org) * * 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. */ /* * The Jira Cloud platform REST API * Jira Cloud platform REST API documentation * * The version of the OpenAPI document: 1001.0.0-SNAPSHOT * Contact: <EMAIL> * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.everit.atlassian.restclient.jiracloud.v3.model; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; /** * A project&#39;s sender email address. */ @ApiModel(description = "A project's sender email address.") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2020-10-28T14:12:40.546+01:00[Europe/Prague]") public class ProjectEmailAddress { @JsonProperty("emailAddress") private String emailAddress; public ProjectEmailAddress emailAddress(String emailAddress) { this.emailAddress = emailAddress; return this; } /** * The email address. * @return emailAddress **/ @ApiModelProperty(value = "The email address.") public String getEmailAddress() { return emailAddress; } public void setEmailAddress(String emailAddress) { this.emailAddress = emailAddress; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ProjectEmailAddress projectEmailAddress = (ProjectEmailAddress) o; return Objects.equals(this.emailAddress, projectEmailAddress.emailAddress); } @Override public int hashCode() { return Objects.hash(emailAddress); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ProjectEmailAddress {\n"); sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
import { NextApiRequest, NextApiResponse } from 'next'; import Database, { getDatabaseInstance, } from '../../../../server/database/database'; import EmailClient, { getEmailInstance } from '../../../../server/email'; import { AuthError } from '../../../../types/auth'; const db: Database = getDatabaseInstance(); const emailClient: EmailClient = getEmailInstance(); export default async (req: NextApiRequest, res: NextApiResponse) => { const { method } = req; if (method != 'POST') { res.status(400).send('Invalid method.'); } else { try { const clientId = req.cookies.client_id as string; const data = req.headers.authorization || ''; if (!data || !clientId) { return res.status(401).json(AuthError.FAILED.toString()); } const auth = data.split(' ')[1]; const decoded = Buffer.from(auth, 'base64').toString('utf8'); const [email, username, password] = decoded.split(':'); return db.userClients .signUpUser(email, username, password) .then(async (confirmId: string) => { // Create email link from origin and id const host = req.headers.origin; const url = `${host}/api/users/signup/confirm?id=${confirmId}`; return emailClient .sendSignupConfirmEmail(email, url) .then(() => { return res.status(200).json('Success'); }) .catch((error) => { console.error(error); return res .status(500) .json(AuthError.EMAIL_NOT_SENT.toString()); }); }) .catch((error: AuthError) => { res.status(401).send(error.toString()); }); } catch (error) { console.error(error); res.status(500).json(error); } } };
Flow around a low-aspect-ratio wall-bounded 2D hydrofoil: a LES/PIV study We performed Large-eddy simulations (LES) of the flow around a low-aspect-ratio wall-bounded 2D hydrofoil at the zero angle of attack using spectral-element method (SEM). The flow was considered for several Reynolds numbers ReC = 500, 5.0 103, 5.0 104 and 1.2 106 based on the foil chord to reveal the influence of the test channel sidewalls and viscous effects. The laminar-turbulent transition of the boundary layer was registered. A comparison of the numerical results with experimental data for the highest Reynolds number was performed and showed an excellent agreement.
<reponame>senior-sigan/omsu_cpp_course #include <iostream> #include <string> class Array { private: int* memory_; int capacity_; int length_; public: // default constructor Array(int capacity = 2) { std::cout << "Construct" << std::endl; length_ = 0; capacity_ = capacity; memory_ = new int[capacity]; } ~Array() { std::cout << "Destroy" << std::endl; delete[] memory_; } void Push(int value) {} int Length() const { return length_; } int Capacity() const { return capacity_; } }; class Student { private: int age; std::string name; public: void Print() { std::cout << this->name << " " << this->age << "\n"; } }; int main() { { Array arr(42); // arr.length = 42; std::cout << arr.Capacity() << "\n"; arr.Push(1); } { Array* arr = new Array(13); std::cout << arr->Capacity() << "\n"; arr->Push(1); delete arr; } std::cout << "Exit" << std::endl; return 0; }
<filename>av1/common/thread_common.h /* * Copyright (c) 2016, Alliance for Open Media. All rights reserved * * This source code is subject to the terms of the BSD 2 Clause License and * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License * was not distributed with this source code in the LICENSE file, you can * obtain it at www.aomedia.org/license/software. If the Alliance for Open * Media Patent License 1.0 was not distributed with this source code in the * PATENTS file, you can obtain it at www.aomedia.org/license/patent. */ #ifndef AOM_AV1_COMMON_THREAD_COMMON_H_ #define AOM_AV1_COMMON_THREAD_COMMON_H_ #include "config/aom_config.h" #include "av1/common/av1_loopfilter.h" #include "aom_util/aom_thread.h" #ifdef __cplusplus extern "C" { #endif struct AV1Common; typedef struct AV1LfMTInfo { int mi_row; int plane; int dir; } AV1LfMTInfo; // Loopfilter row synchronization typedef struct AV1LfSyncData { #if CONFIG_MULTITHREAD pthread_mutex_t *mutex_[MAX_MB_PLANE]; pthread_cond_t *cond_[MAX_MB_PLANE]; #endif // Allocate memory to store the loop-filtered superblock index in each row. int *cur_sb_col[MAX_MB_PLANE]; // The optimal sync_range for different resolution and platform should be // determined by testing. Currently, it is chosen to be a power-of-2 number. int sync_range; int rows; // Row-based parallel loopfilter data LFWorkerData *lfdata; int num_workers; #if CONFIG_MULTITHREAD pthread_mutex_t *job_mutex; #endif AV1LfMTInfo *job_queue; int jobs_enqueued; int jobs_dequeued; } AV1LfSync; typedef struct AV1LrMTInfo { int v_start; int v_end; int lr_unit_row; int plane; int sync_mode; int v_copy_start; int v_copy_end; } AV1LrMTInfo; typedef struct LoopRestorationWorkerData { int32_t *rst_tmpbuf; void *rlbs; void *lr_ctxt; } LRWorkerData; // Looprestoration row synchronization typedef struct AV1LrSyncData { #if CONFIG_MULTITHREAD pthread_mutex_t *mutex_[MAX_MB_PLANE]; pthread_cond_t *cond_[MAX_MB_PLANE]; #endif // Allocate memory to store the loop-restoration block index in each row. int *cur_sb_col[MAX_MB_PLANE]; // The optimal sync_range for different resolution and platform should be // determined by testing. Currently, it is chosen to be a power-of-2 number. int sync_range; int rows; int num_planes; int num_workers; #if CONFIG_MULTITHREAD pthread_mutex_t *job_mutex; #endif // Row-based parallel loopfilter data LRWorkerData *lrworkerdata; AV1LrMTInfo *job_queue; int jobs_enqueued; int jobs_dequeued; } AV1LrSync; // Deallocate loopfilter synchronization related mutex and data. void av1_loop_filter_dealloc(AV1LfSync *lf_sync); void av1_loop_filter_frame_mt(YV12_BUFFER_CONFIG *frame, struct AV1Common *cm, struct macroblockd *mbd, int plane_start, int plane_end, int partial_frame, #if LOOP_FILTER_BITMASK int is_decoding, #endif AVxWorker *workers, int num_workers, AV1LfSync *lf_sync); void av1_loop_restoration_filter_frame_mt(YV12_BUFFER_CONFIG *frame, struct AV1Common *cm, int optimized_lr, AVxWorker *workers, int num_workers, AV1LrSync *lr_sync, void *lr_ctxt); void av1_loop_restoration_dealloc(AV1LrSync *lr_sync, int num_workers); #ifdef __cplusplus } // extern "C" #endif #endif // AOM_AV1_COMMON_THREAD_COMMON_H_
/* GSocket_Select: * Polls the socket to determine its status. This function will * check for the events specified in the 'flags' parameter, and * it will return a mask indicating which operations can be * performed. This function won't block, regardless of the * mode (blocking | nonblocking) of the socket. */ GSocketEventFlags GSocket::Select(GSocketEventFlags flags) { if (!gs_gui_functions->CanUseEventLoop()) { GSocketEventFlags result = 0; fd_set readfds; fd_set writefds; fd_set exceptfds; struct timeval tv; assert(this); if (m_fd == -1) return (GSOCK_LOST_FLAG & flags); tv.tv_sec = m_timeout / 1000; tv.tv_usec = (m_timeout % 1000) * 1000; FD_ZERO(&readfds); FD_ZERO(&writefds); FD_ZERO(&exceptfds); FD_SET(m_fd, &readfds); if (flags & GSOCK_OUTPUT_FLAG || flags & GSOCK_CONNECTION_FLAG) FD_SET(m_fd, &writefds); FD_SET(m_fd, &exceptfds); result |= (GSOCK_CONNECTION_FLAG & m_detected); if ((m_detected & GSOCK_LOST_FLAG) != 0) { m_establishing = false; return (GSOCK_LOST_FLAG & flags); } if (select(m_fd + 1, &readfds, &writefds, &exceptfds, &tv) <= 0) { return (result & flags); } if (FD_ISSET(m_fd, &exceptfds)) { m_establishing = false; m_detected = GSOCK_LOST_FLAG; return (GSOCK_LOST_FLAG & flags); } if (FD_ISSET(m_fd, &readfds)) { result |= GSOCK_INPUT_FLAG; if (m_server && m_stream) { result |= GSOCK_CONNECTION_FLAG; m_detected |= GSOCK_CONNECTION_FLAG; } } if (FD_ISSET(m_fd, &writefds)) { if (m_establishing && !m_server) { int error; SOCKOPTLEN_T len = sizeof(error); m_establishing = false; getsockopt(m_fd, SOL_SOCKET, SO_ERROR, (char*)&error, &len); if (error) { m_detected = GSOCK_LOST_FLAG; return (GSOCK_LOST_FLAG & flags); } else { result |= GSOCK_CONNECTION_FLAG; m_detected |= GSOCK_CONNECTION_FLAG; } } else { result |= GSOCK_OUTPUT_FLAG; } } return (result & flags); } else { assert(this); return flags & m_detected; } }
from .middleware import ( get_request, GlobalRequestMiddleware, CustomExceptionMiddleware, FullMediaUrlMiddleware, ExplicitSessionMiddleware, MethodOverrideMiddleware, )
package com.sinius15.pibot.pc; import java.io.IOException; import java.util.Arrays; import ch.aplu.xboxcontroller.XboxController; import ch.aplu.xboxcontroller.XboxControllerListener; import com.sinius15.graph.Graph; import com.sinius15.pibot.pc.event.PhoneEvent; import com.sinius15.pibot.pc.event.PiDataEvent; public class Controller implements PhoneEvent, PiDataEvent, XboxControllerListener{ PhoneDataConnection gyroReceiver; PiBotDataConnection piReceiver; ControlFrame frame; Setting roll = new Setting("Roll", "loading..."); Setting pich = new Setting("Pich", "loading..."); Setting yaw = new Setting("Yaw", "loading..."); Setting batteryPower = new Setting("Battery Power", "loading..."); Setting wheelSpeedLeft = new Setting("Wheel Speed Left", "loading..."); Setting wheelSpeedRight = new Setting("Wheel Speed Right", "loading..."); Setting phoneRotX = new Setting("Phone X rotation", "loading..."); Setting phoneRotY = new Setting("Phone Y rotation", "loading..."); Setting phoneRotZ = new Setting("Phone Z rotation", "loading..."); Graph wheelSpeed, piRotation, phoneRotationGraph; public Controller(){ phoneRotationGraph = new Graph(295, 241, 3, 200, 100, 100); frame = new ControlFrame(new Graph[]{wheelSpeed, piRotation, phoneRotationGraph, null},roll, pich, yaw, batteryPower, wheelSpeedLeft, wheelSpeedRight, phoneRotX, phoneRotY, phoneRotZ); frame.setVisible(true); XboxController controller = new XboxController(); controller.addXboxControllerListener(this); new Thread(phoneConnector, "phone connection therad").start(); new Thread(piConnector, "pi connection therad").start(); } Runnable piConnector = new Runnable() { @Override public void run() { connetToPi(); } }; Runnable phoneConnector = new Runnable() { @Override public void run() { connectToPhone(); } }; public void connetToPi(){ try { System.out.println("connecting to PiBot..."); piReceiver = new PiBotDataConnection(); piReceiver.setEvent(this); System.out.println("connection to PiBot establisched!"); } catch (IOException e) { System.out.println("connection to PiBot failed!"); batteryPower.setData("Could not connect."); wheelSpeedLeft.setData("Could not connect."); wheelSpeedRight.setData("Could not connect."); roll.setData("Could not connect."); pich.setData("Could not connect."); yaw.setData("Could not connect."); } } public void connectToPhone(){ try { System.out.println("connectiong to phone for gyro meter..."); gyroReceiver = new PhoneDataConnection(); gyroReceiver.setGyroEvent(this); System.out.println("connection to phone for gyro meter established!"); } catch (IOException e) { System.out.println("connection to phone failed!"); phoneRotX.setData("Could not connect."); phoneRotY.setData("Could not connect."); phoneRotZ.setData("Could not connect."); } } public static void main(String[] args) { //new Controller(); } @Override public void onGyroValueChange() { phoneRotX.setData(""+gyroReceiver.getRotationX()); phoneRotY.setData(""+gyroReceiver.getRotationY()); phoneRotZ.setData(""+gyroReceiver.getRotationZ()); phoneRotationGraph.lines[0].setData(addOnEnd(phoneRotationGraph.lines[0].data, (int)(gyroReceiver.getRotationX()*100 + 100))); phoneRotationGraph.lines[1].setData(addOnEnd(phoneRotationGraph.lines[1].data, (int)(gyroReceiver.getRotationY()*100 + 100))); phoneRotationGraph.lines[2].setData(addOnEnd(phoneRotationGraph.lines[2].data, (int)(gyroReceiver.getRotationZ()*100 + 100))); phoneRotationGraph.repaint(); } @Override public void onGyroDisconnect() { phoneRotX.setData("Not connected."); phoneRotY.setData("Not connected."); phoneRotZ.setData("Not connected."); } @Override public void onPiDisconnect() { batteryPower.setData("Not connected."); wheelSpeedLeft.setData("Not connected."); wheelSpeedRight.setData("Not connected."); roll.setData("Not connected."); pich.setData("Not connected."); yaw.setData("Not connected."); } @Override public void onLeftWheelSpeedChange(int newSpeed) { wheelSpeedLeft.setData(""+newSpeed); } @Override public void onRightWheelSpeedChange(int newSpeed) { wheelSpeedRight.setData(""+newSpeed); } @Override public void onBatteryPowerChange(int newPower) { batteryPower.setData(""+newPower); } public static int[] addOnEnd(int[] oldArray, int toAdd){ int[] newArr = Arrays.copyOfRange(oldArray, 1, oldArray.length+1); newArr[oldArray.length-1] = toAdd; return newArr; } @Override public void buttonA(boolean pressed) { piReceiver.setLeftWheelState( pressed ? WheelState.FORWARD : WheelState.OFF); } @Override public void buttonB(boolean pressed) { piReceiver.setLeftWheelState(pressed ? WheelState.BACKWARD : WheelState.OFF); } @Override public void buttonX(boolean pressed) { piReceiver.setRightWheelState(pressed ? WheelState.BACKWARD : WheelState.OFF); } @Override public void buttonY(boolean pressed) { piReceiver.setRightWheelState(pressed ? WheelState.FORWARD : WheelState.OFF); } @Override public void back(boolean pressed) { piReceiver.sendMessage("setNullPoint"); } @Override public void start(boolean pressed) { if(pressed) piReceiver.disconnect(); } @Override public void leftShoulder(boolean pressed) { } @Override public void rightShoulder(boolean pressed) { } @Override public void leftThumb(boolean pressed) { } @Override public void rightThumb(boolean pressed) { } @Override public void dpad(int direction, boolean pressed) { } @Override public void leftTrigger(double value) { } @Override public void rightTrigger(double value) { } @Override public void leftThumbMagnitude(double magnitude) { } @Override public void leftThumbDirection(double direction) { } @Override public void rightThumbMagnitude(double magnitude) { } @Override public void rightThumbDirection(double direction) { } @Override public void isConnected(boolean connected) { } @Override public void onRollChange(float newRoll) { roll.setData(""+newRoll); } @Override public void onPichChange(float newPich) { pich.setData(""+newPich); } @Override public void onYawChange(float newYaw) { yaw.setData(""+newYaw); } }
The mobile radio antennas provided for a base station normally have an antenna arrangement with a reflector in front of which a large number of antenna elements are provided, offset with respect to one another in the vertical direction. These antenna elements may, for example, transmit and receive in one polarization or in two mutually perpendicular polarizations. The antenna elements may be designed to receive in only one frequency band. The antenna arrangement may, however, also be in the form of a multiband antenna, for example for transmitting and receiving in two frequency bands with an offset with respect to one another. In principle, so-called triband antennas are also known. As is known, mobile radio networks have a cellular form, with each cell having a corresponding associated base station with at least one mobile radio antenna for transmitting and receiving. The antennas are in this case designed such that they generally transmit and receive at a specific angle to the horizontal with a component pointing downwards, thus defining a specific cell size. This depression angle is also referred to, as is known, as the down-tilt angle. In this context, a phase shifter arrangement has already been proposed in WO 01/13459 A1, in which the down-tilt angle can be adjusted in a continuously variable manner for a single-column antenna array with two or more antenna elements arranged one above the other. According to this prior publication, differential phase shifters are used for this purpose, and, when set differently, result in the delay time length and hence the phase shift at the two outputs of each phase shifter being set to a different direction, thus allowing the depression angle to be adjusted. In this case, the setting and adjustment of the phase shifter angle is carried out manually or by means of a remotely controllable retrofitted unit, as is known by way of example from DE 101 04 564 C1. When the so-called traffic density varies or, for example, a further base station adjacent to one cell is added to the antenna, then retrospective matching to changes in the characteristics can be carried out by preferably remotely controllable depression of a down-tilt angle, and by reducing the size of the cell. However, such a change to a down-tilt angle is not the only or adequate solution for all situations. Thus, for example, there are mobile radio antennas which have a fixed horizontal polar diagram, for example with a 3 dB beamwidth of 45°, 65°, 90° etc. In this case, matching to location-specific characteristics is impossible since it is not possible to change the polar diagram in the horizontal direction retrospectively. However, in principle, mobile radio base station antennas also exist with polar diagrams which can be varied by means of intelligent algorithms in the base station. This necessitates, for example, the use of a so-called Butler matrix (via which, for example, an antenna array can be operated with two or more individual antenna elements which, for example, are arranged with a vertical offset one above the other in four columns). Antenna arrangements such as these are, however, enormously complex in terms of the antenna supply lines between the base station on the one hand and the antenna or the antenna elements on the other hand, with a dedicated feed cable being required for each column, and with two high-quality antenna cables being required for each column for so-called dual-polarized antennas, which are polarized at +45° and −45°, with an X-shaped alignment. This leads to a high cost price and to expensive installation. Finally, the base station also needs to have very complex algorithm circuits, thus once again increasing the overall costs. An antenna arrangement with capabilities for power splitting and for setting different phase angles for the signals which can be supplied to the individual antenna elements has in principle also been disclosed in WO 02/05383 A1. The antenna comprises a two-dimensional antenna array with antenna elements and with a feed network. The feed network has a down-tilt phase adjusting device and an azimuth phase adjusting device with a device for setting the antenna element width (the width of the lobe). The beam width is varied by appropriately splitting the power differently between the antenna elements, which are offset with respect to one another in the horizontal direction. Phase shifter devices are provided in order to set a different azimuth beam direction, in order to set the emission direction appropriately. The present illustrative exemplary non-limiting implementation provides an antenna arrangement and a method for its operation, which allows shaping of the polar diagram, particularly in the horizontal direction, and especially also in the form of a polar diagram change which can also be carried out retrospectively. This is preferably intended to be possible with little complexity for the feed cables that are required. The solution according to the illustrative exemplary non-limiting implementation is thus based on the idea that the antenna has at least two antenna systems, each having at least one antenna element, that is to say, for example, at least in each case one antenna element, with the entire transmission energy now being supplied either to only one of the two antenna systems or else now being adjustable to achieve a different division of the power, as far as a 50:50 split of the power energy between the two antenna systems. Depending on the different components of the power that is supplied, this makes it possible to vary the polar diagram shape, particularly in the horizontal direction, and to vary the 3 dB beamwidth of an antenna from, for example 30° to 100°. In addition, the phase shifters which are provided allow the phase angle of the signals to be varied, in order to achieve a specific polar diagram shape. If, for example, the at least two antenna elements are arranged in a preferred manner with the horizontal offset alongside one another on a common reflector, that is to say they transmit and receive in a common polarization plane, then this allows the horizontal polar diagram of the antenna to be adjusted. If, by way of example, the signals are supplied to an antenna array having at least two columns and having two or more antenna elements which are each arranged one above the other, then different horizontal polar diagrams can be produced for this antenna array, depending on the intensity and phase splitting. The technology herein makes it possible, for example, to produce asymmetric horizontal polar diagrams, to be precise even when considered in the far field. It is also possible to produce horizontal polar diagrams for which, although they are symmetrical, that is to say they are arranged symmetrically with respect to a plane that runs vertically with respect to the reflector plane, the transmission signals are emitted with only a comparatively low power level in this vertical plane of symmetry. It is thus also possible to produce, for example, two, four etc. main lobes that are symmetrical with respect to this plane but which transmit more to the left and more to the right with an angled alignment position and, in between them preferably in the plane which is vertical with respect to the reflector plane, and which would intrinsically correspond to the main emission plane in the normal case, with the antenna arrangement transmitting with a considerably lower power level. However, it is equally possible to produce horizontal polar diagrams which, for example, have an odd number of main lobes and in this case, if required, are arranged symmetrically with respect to a plane which runs at right angles to the reflector plane. In this case, one main lobe direction may preferably be located in the vertical plane of symmetry, or in a plane at right angles to the reflector plane. At least one further main lobe is in each case located on the left-hand side and on the right-hand side of the plane that is at right angles to the reflector plane. The intensity minima which are located between them may, for example, be reduced only by less than 10 dB, in particular by 6 dB or less than 3 dB. The antenna arrangement according to the illustrative exemplary non-limiting implementation and its operation thus make it possible to illuminate specific zones with a higher transmission intensity, depending on the special features on site, and in the process effectively to “mask out” other areas, or to supply them with only reduced radiation intensity. This offers advantages particularly when the horizontal polar diagram is adapted in areas in which there are schools, kindergartens etc., such that these areas are illuminated only very much more weakly. In one illustrative exemplary non-limiting implementation, provision is even made for a different polar diagram shape to be produced for an antenna on the one hand for transmission and, in contrast to this, for reception. In other words, the horizontal polar diagrams for transmission and reception have different shapes. It is thus possible by means of a horizontal polar diagram which is optimally matched to the environment according to the illustrative exemplary non-limiting implementation to be used to take into account the fact, for transmission, that sensitive facilities such as kindergartens, schools, hospitals, etc. in the transmission zone are located in an area or zone which is supplied with only reduced intensity by a mobile radio antenna while, in contrast, the horizontal polar diagram for reception is designed such that the arriving signals can be received with correspondingly optimally designed horizontal polar diagrams throughout the entire coverage area of a corresponding mobile radio antenna in a cell. The intensity and phase splitting according to the illustrative exemplary non-limiting implementation are preferably achieved by using a phase shifter arrangement, that is to say at least one phase shifter and preferably a differential phase shifter, and downstream hybrid circuit, in particular a 90° hybrid. This results, for example, in a signal which is supplied to a phase shifter and has a predetermined intensity being split between the two outputs of the differential phase shifter such that the intensities of the signals at the two outputs are the same, but their phases are different. If these two signals are supplied to the two inputs of a downstream 90° hybrid, then this now results in the phases once again being the same at the output of the hybrid, although the intensities or amplitudes of the signals are different. The amount of power which is supplied to the at least two phase shifters can in this way be split from, for example 1:0 to 1:1 by different phase settings on the phase shifter. The phase angle can also be influenced and the direction of the polar diagram varied by a further optional phase shifter which can be connected downstream. In summary, the following advantages, by way of example, may be achieved by the system according to the illustrative exemplary non-limiting implementation: Allowing location-specific antenna polar diagrams to be produced on site. If required, the antenna polar diagram can be varied again and again at any time, for example when a new network plan is provided, without any need to replace the antenna itself. During commissioning, the antenna polar diagram can be adapted easily, for example by remote control in the base station. No manual changes to the antenna on the pylon, such as alignment of the antenna etc., are required for this purpose, thus drastically reducing the costs. Preset polar diagrams can easily be produced by means of fixed parameters, which can be preset, in the controller. It is also possible to use an automatic control system to produce different polar diagrams at different times (for example as a function of given differences in the supply for the respective location as a function of other times of day, for example in the morning and in the evening, etc.). The base stations can still be used even if the system according to the illustrative exemplary non-limiting implementation is upgraded. All that is required is simple replacement of the antenna on the base station. Different polar diagrams can be produced for transmission and reception. In particular, it is possible to supply sensitive areas with less power and other areas with more power. Asymmetric horizontal polar diagrams can be produced. Symmetrical horizontal polar diagrams can be produced, which have a number of superimposed main lobes such that the power in the first, second and for example, third lobes in three different azimuth directions in the horizontal polar diagram differ in terms of their power levels by less than 50%, in particular less than 40%, 30% or else less than 20% or even 10%.
Globalizing Local Neighborhood for Locally Linear Embedding Hessian locally linear embedding (HLLE) has good representational capacity and high computational efficiency, but it still fails to nicely deal with the sparsely sampled or noise contaminated datasets, where the local neighborhood structure is critically distorted. To solve this problem, this paper proposes a new approach that takes the general conceptual framework of HLLE so as to guarantee its correctness in the setting of local isometry, and then employs the geodesic distance instead of Euclidean distance to determine the local neighborhood so as to give the global representation to the local data. This approach can be regarded as the integration of both local approaches and global approaches, so that it have the better performance and stability. The conducted experiments on both synthetic and real datasets have validated the proposed approach.
Classification of breast cancer based on thermal image using support vector machine Advancement in computer aided diagnosis system enhances the detection competency of domain expert and reduces the time in decision making. The objective of this paper is to present the effectiveness of digital infrared thermal imaging (DITI) in the diagnosis and analysis of breast cancer and to develop an efficient method for generating nonlinear heat conduction. The proposed technique is based on the following computational methods; grey level co-occurrence matrix (GLCM) for feature extraction and support vector machine (SVM) to classify the input as cancerous or non-cancerous. Nonlinear heat conduction depends on temperature of skin surface above the tumour, and the temperature is used to investigate whether the tumour is malignant or benign. The experiments carried out on 83 images consist of 34 normal and 49 abnormal (malignant and benign tumour) from a real human breast thermal image. The classification accuracy shows 97.6 % which was significantly good.
<reponame>lechium/tvOS130Headers<gh_stars>10-100 /* * This header is generated by classdump-dyld 1.0 * on Tuesday, November 5, 2019 at 3:11:46 PM Mountain Standard Time * Operating System: Version 13.0 (Build 17J586) * Image Source: /usr/libexec/locationd * classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by <NAME>. */ #import <LocationSupport/CLIntersiloService.h> #import <locationd/CLWeatherServiceProtocol.h> @class NSMutableSet, NSString; @interface CLWeatherService : CLIntersiloService <CLWeatherServiceProtocol> { NSMutableSet* _clients; } @property (nonatomic,retain) NSMutableSet * clients; //@synthesize clients=_clients - In the implementation block @property (readonly) unsigned long long hash; @property (readonly) Class superclass; @property (copy,readonly) NSString * description; @property (copy,readonly) NSString * debugDescription; @property (assign,nonatomic) BOOL valid; +(BOOL)isSupported; +(void)becameFatallyBlocked:(id)arg1 index:(unsigned long long)arg2 ; +(id)getSilo; +(void)performSyncOnSilo:(id)arg1 invoker:(/*^block*/id)arg2 ; -(id)init; -(void)setClients:(NSMutableSet *)arg1 ; -(NSMutableSet *)clients; -(void)beginService; -(void)endService; -(void)weatherForecastUpdated:(id)arg1 airQualityConditions:(id)arg2 hourlyForecasts:(id)arg3 dailyForecasts:(id)arg4 location:(id)arg5 ; -(void)registerForWeatherUpdates:(R)arg1 :(id)arg2 ; -(void)unregisterForWeatherUpdates:(R)arg1 :(id)arg2 ; -(void)localLocationForecastUpdatedForConditions:(id)arg1 ; @end
Q: Misunderstanding how the "make code sample" button works It seems that some people don't understand how the "make code sample" button {} works. I encounter posts like this all the time: The problem appears to be that they first click {}, and then paste in their code, after the initial 4 spaces have been inserted: When this happens, only the first line is indented, causing the behavior above. This is the only way I can figure out for this to happen. Of course, selecting all of the code, then clicking {} yields the correct result, even adding the line after the closing }. I know you can't fix stupid, but is there anything that can be done here? Does anyone else see this often (1-2 edits per evening, I'd say)? A: There are a few ways you could try and "fix stupid" here. The best approach, in my opinion, would be to adopt some behaviour that tries to keep indentation consistent as the user enters data with newlines into the editor box. This includes just typing code into the box, which can be frustrating when you're 3 levels deep and you hit return, then have to type 12 space characters to get the caret where you need it. Arguably, this kind of thing would have been more difficult a few years ago, which might have made it seem like too much effort to add to the simple markdown input box on SE sites. Nowadays, it's not terribly difficult. The DOM oninput event can be used to detect all types of input, including space. When capturing the event, if you have a reference to the previous value, you can detect the data that's been entered and adjust it if necessary. I've thrown together a rudimentary example (I only tested in Chrome, it's not intended to be a complete solution). As an added bonus, the code will (crudely) detect if you paste multiple lines of code with varying levels of indentation and automatically indent it as a code block. A: I don't think that many people type code into the box, they copypasta. Actually, I would personally discourage writing code in there; normally you should have a testcase somewhere else prepared that you ran through a compiler. For good questions (and also answers) there should have been some thought about the code, which usually involves having it somewhere else first. Also the symptom you are seeing seems to be coming mostly from copypaste, otherwise it would only be the first line that is indented. Assuming you are right, there are probably two main ways people put in code. First button, then paste For this we should probably have a button "paste code". This button would open a popup, which then will be filled with your copypaste, and then is pasted into the edit field with 4 spaces indentation. Optionally there could be a "reformat indentation" tickbox that will try to guess proper indentation (depends on language used). First code, then button For this there should be a button that only is clickable when you have selected something (one char enough? at least three?), otherwise greyed out. It will indent by 4 spaces all the lines that are part of your selection. Since this will likely make the "paste code here" button useless in that situation, it could be greyed out while something is selected. Or to be extra fancy, the button at the current "code" position could change, depending on whether you have something selected or not. A: Suggestion Instead of inserting clicking the button should just insert ``` ``` Side note When this happens, only the first line is indented, causing the behavior above. This is the only way I can figure out for this to happen. I can also imagine that it happens as follows: User pastes code unindented: int main() { cout << "hello" << endl; } User sees: int main() { cout << "hello" << endl; } User wonders why code isn't rendered as code, has read somewhere about "indent by 4 spaces" and starts adding 4 spaces in the first line: int main() { cout << "hello" << endl; } User sees: int main() { cout << "hello" << endl; } User is happy that code is rendered as code, but doesn't care about missing indentation and doesn't notice that the last line isn't rendered as code, and consequently does not add 4 spaces to the remaining lines. I suspect this is especially the case with Python code, since there is no closing curly brace that isn't rendered properly, and the function body is hopefully already indented by 4 spaces due to strong convention.
import tifffile as tiff from multifiletiff import * from rainbow_tools import * from Threads import * im = MultiFileTiff('/Users/stevenban/Documents/Data/20190917/binned') im.set_frames([0,1,2,3,4,5,6,7,8,9,10,11]) im.numz = 20 im.t = 0 #s = Spool() t0 = time.time() peaks_total = [] for i in range(999): im1 = im.get_t() im1 = medFilter2d(im1) im1 = gaussian3d(im1,(25,3,3,1)) peaks1 = findpeaks3d(np.array(im1 * np.array(im1 > np.quantile(im1,.99)))) peaks1 = reg_peaks(im1, peaks1,thresh=40) peaks_total.append(peaks1) #s.reel(peaks1) print(i) print('total time:', time.time()-t0) markers = np.zeros(tuple([999]) + im.sizexy,dtype=np.uint16) mwidth = 3 for i in range(len(peaks_total)): peaks = peaks_total[i] for peak in peaks: try: x,y,z = peak markers[i,y-mwidth:y+mwidth,z-mwidth:z+mwidth] += 1 except: pass import pickle with open('20190917-markers-segonly.obj', 'wb') as file: pickle.dump(peaks_total, file) file_pi = open('20190917-markers-segonly.obj', 'wb') pickle.dump(peaks_total, file_pi) p = pickle.load( open( "20190917-markers-segonly.obj", "rb" ) ) tiff.imsave('20190917-markers-segonly.tif',markers.astype(np.uint16))
. This study was aimed to clarify whether valproic acid (VPA) induces apoptosis of leukemia HL-60 cell line and its possible mechanism. The effect of different concentrations and treatment time of VPA on HL-60 cell proliferation was assayed by cytotoxicity test (CCK-8 method) and fluorescence microscopy, and flow cytometry was used to detect cell apoptosis. The expressions of telomerase subunit h-tert mRNA and apoptosis-related protein as well as caspase-3 activity were detected by real time-quantitative PCR, Western blot and ELISA respectively. The results indicated that VPA inhibited proliferation of HL-60 cells and induced cell apoptosis in a dose dependent manner (r = -0.87). The expressions of anti-apoptotic protein BCL-2 and h-tert mRNA were significantly decreased while the pro-apoptotic protein BAX and caspase-3 activity increased after treatment with VPA. The apoptosis rate of HL-60 cell was negatively correlated with expression of h-tert mRNA. It is concluded that VPA can inhibit leukemia HL-60 cell proliferation and induce apoptosis. The VPA displays anti-leukemia activity possibly through reducing h-tert mRNA and BCL-2 protein expression, increasing BAX expression and activity of caspase-3.
<gh_stars>1-10 """AVL Tree DFS Tests.""" from typing import List, Any from random import shuffle from voronoi_diagrams.data_structures import AVLTree, IntNode from .test_insert import create_tree class TestInorder: """DFS Inorder in the AVL Tree.""" def test_range(self) -> None: """Test range.""" expected_list = [i for i in range(100)] random_list = expected_list.copy() shuffle(random_list) t = create_tree(random_list) assert t.dfs_inorder() == expected_list
Decrease in circulating hematopoietic progenitor cells by trapping in the pulmonary circulation. BACKGROUND When stem-cell grafts are infused into the venous circulation and stem/progenitor cells egress from BM, pulmonary capillary beds are the first microcirculation site that they encounter. This provides the potential for circulating progenitor cells to be trapped in the pulmonary circulation. METHODS We compared the number of progenitor cells and their expression of cell-adhesion molecules (CAM) in samples taken simultaneously from radial arteries and central veins of 21 patients following PBSC mobilization. RESULTS The mean (+/- SD) frequency of progenitor cells in the radial arteries was reduced to 79% +/- 25% for CD34(+) cells, 73% +/- 27% for CFU-GM, 77% +/- 25% for CD34(+) CD41(+) cells and 70% +/- 29% for CFU-meg of the number in the central veins. This suggests that some progenitor cells might be trapped in the lung. No association between progenitor-cell expression of CAM and pulmonary trapping was observed. DISCUSSION Our data demonstrate pulmonary trapping of PBSC during mobilization, suggesting a potential inhibitory effect on PBSC harvest and medullary trafficking following graft infusion. However, the impact associated with pulmonary PBSC trapping may be negligible in the clinical setting if sufficient cells are infused.
<reponame>diegoraguiar/ngx-brazilian-helpers import { TestBed, inject } from '@angular/core/testing'; import { TocantinsService } from './tocantins.service'; describe('Service: TocantinsService', () => { beforeEach(() => { TestBed.configureTestingModule({ providers: [TocantinsService] }); }); it('deve ter uma instancia criada', inject([TocantinsService], (service: TocantinsService) => { expect(service).toBeTruthy(); })); it('deve estar valido', inject([TocantinsService], (service: TocantinsService) => { expect(service.validar('29010227836')).toBe(true); expect(service.validar('95036526780')).toBe(true); })); it('deve possuir o codigo da empresa igual a 01, ou 02, ou 03, ou 99', inject([TocantinsService], (service: TocantinsService) => { expect(service.validar('29010227836')).toBe(true); expect(service.validar('35037221621')).toBe(true); expect(service.validar('35027221621')).toBe(true); expect(service.validar('35997221621')).toBe(true); expect(service.validar('35007221621')).toBe(false); })); it('deve possuir 11 digitos', inject([TocantinsService], (service: TocantinsService) => { expect(service.validar('35037221621')).toBe(true); expect(service.validar('3503722162')).toBe(false); expect(service.validar('350372216211')).toBe(false); })); it('deve estar valido mesmo com mascara', inject([TocantinsService], (service: TocantinsService) => { expect(service.validar('3503722162-1')).toBe(true); })); });
. In anesthetized cats, the increase in duration of the isometric tetanic contraction of the m. gastrocnemius from 7 to 30 sec elicited a 4-fold increase in the muscular mechanical performance. During the postcontraction hyperemia, a 5-6-fold increase in the rate of lactic acid and inorganic phosphates removal into venous blood were opposed to only a 1.5-2-fold increase in the blood supply and oxygen consumption by the muscle. The role of metabolic and metabolic factors in the mechanism of hyperemia in skeletal muscle after strong tetanic contractions is discussed.
Welcome to throwback Monday! Apple’s newest phone, the iPhone SE, is here and it's kinda but not entirely new. The cute little iPhone offers the components of the bigger iPhone 6S with a 4-inch screen and a form factor in line with the iPhone 5s. The round volume buttons and flatter edges also echo those of the 5s. Along with a size that jibes nicely with smaller hands and pockets is a price to match: It starts at just $400 without a two-year contract. Preorders begin Thursday, and it ships on March 31. Starting with the iPhone 6, Apple has adapted to the big big big phone craze with handset screen sizes starting at 4.7 inches on the diagonal. And ever since the iPhone 5c, the company has steered away from lower-priced “step-down” versions of its flagship phones. If you think this is just a smaller, cheaper iPhone 6S, you’re mostly right. It has the same A9 processor and M9 motion coprocessor that enables things like always-on listening for "Hey Siri" commands and fitness tracking. The main camera matches that of the iPhone 6S lineup, with a 12-megapixel shooter that also captures 4K video. Live Photos save a bit of action before and after you capture a shot. However, there was no mention of 3D Touch. Compared to the iPhone 5S, the new SE has longer battery life to go along with its updated features. Like other recent iPhones, its home button doubles as a Touch ID sensor, and it supports Apple Pay via NFC. For those of you hoping Apple would bust out of the 16GB minimum storage mode, it won’t happen with the iPhone SE: It’s only available in 16GB and 64GB versions. The latter will cost $500 off contract. It comes in the four standard colors, including gold and (yep!) rose gold. After years of using increasingly preposterously sized phones, it's hard to imagine going back to a device the size of the iPhone SE. Of course, that's not who the phone's for—it's for people who've never owned a phone before, or people who have so far clung resolutely to their smaller devices. For those people, the iPhone SE seems like a winner. Other than a couple of very small aesthetic changes, like the slightly less shiny sides and the SE logo on the back, this phone is a dead ringer for the iPhone 5S. Even with those changes, it's still hard to tell them apart. The biggest difference is in using the phones: the SE is fast and responsive in a way the 5S isn't. It easily keeps up with the newer phones, because internally, it is those newer phones. It's odd that the SE doesn't have 3D Touch, and odder still that all we got at the event was cagey answers about its absence. Otherwise, though, this is a thoroughly modern device. It's the same thing, only smaller. That's a hallmark Apple story. Many big phone users probably can't stomach the tradeoffs of going back to a screen this small. And for most people, there's probably nothing so compelling about it that many people will downsize, but at least now if you do it won't be a downgrade.
/** * Builds the Openfire Plugin for the specified project. * <p/> * Classes and libraries are copied to * <tt>openfirePluginDirectory</tt> during this phase. * * @param project the maven project * @param openfirePluginDirectory * @throws java.io.IOException if an error occured while building the webapp */ public void buildWebapp(MavenProject project, File openfirePluginDirectory) throws MojoExecutionException, IOException, MojoFailureException { getLog().info("Assembling webapp " + project.getArtifactId() + " in " + openfirePluginDirectory); File webinfDir = new File(openfirePluginDirectory, "web" + File.separator + WEB_INF); webinfDir.mkdirs(); File metainfDir = new File(openfirePluginDirectory, META_INF); metainfDir.mkdirs(); final Map filterProperties = getBuildFilterProperties(); final List<Resource> webResources = this.webResources != null ? Arrays.asList(this.webResources) : null; if (webResources != null && webResources.size() > 0) { for (Resource resource : webResources) { if (!(new File(resource.getDirectory())).isAbsolute()) { resource.setDirectory(project.getBasedir() + File.separator + resource.getDirectory()); } copyResources(resource, new File(openfirePluginDirectory, "web"), filterProperties); } } copyResources(warSourceDirectory, new File(openfirePluginDirectory, "web")); copyOpenfirePluginConfiguration(openfireSourceDirectory, openfirePluginDirectory, filterProperties); if (databaseSourceDirectory.exists()) { copyDirectoryStructureIfModified(databaseSourceDirectory, new File(openfirePluginDirectory, "database")); } if (i18nSourceDirectory.exists()) { copyDirectoryStructureIfModified(i18nSourceDirectory, new File(openfirePluginDirectory, "i18n")); } if (webXml != null && StringUtils.isNotEmpty(webXml.getName())) { if (webXml.exists()) { copyFileIfModified(webXml, new File(webinfDir, "/web.xml")); } else { getLog().info("The web.xml file '" + webXml + "' does not exist: creating empty web.xml"); BufferedWriter out = new BufferedWriter(new FileWriter(new File(webinfDir, "/web.xml"))); out.write("<web-app>\n</web-app>"); out.close(); } } File libDirectory = new File(openfirePluginDirectory, "lib"); File classesDirectory = new File(openfirePluginDirectory, "classes"); if (this.classesDirectory.exists() && !this.classesDirectory.equals(classesDirectory)) { copyDirectoryStructureIfModified(this.classesDirectory, classesDirectory); } Set<Artifact> artifacts = project.getArtifacts(); List<String> duplicates = findDuplicates(artifacts); for (Artifact artifact : artifacts) { String targetFileName = getFinalName(artifact); getLog().debug("Processing: " + targetFileName); if (duplicates.contains(targetFileName)) { getLog().debug("Duplicate found: " + targetFileName); targetFileName = artifact.getGroupId() + "-" + targetFileName; getLog().debug("Renamed to: " + targetFileName); } ScopeArtifactFilter filter = new ScopeArtifactFilter(Artifact.SCOPE_RUNTIME); if (!artifact.isOptional() && filter.include(artifact)) { String type = artifact.getType(); if ("jar".equals(type) || "test-jar".equals(type)) { copyFileIfModified(artifact.getFile(), new File(libDirectory, targetFileName)); } else { getLog().debug("Skipping artifact of type " + type + " for WEB-INF/lib"); } } } }
Mike Einziger of Incubus reveals details on new Avicii album, praises Skrillex in electronic music conversation Since forming in 1991 and releasing their first album in 1995, Incubus has been one of the few celebrated rock bands to span multiple eras of music. If popularity was solely based on record sales their numbers should speak for themselves, having sold over 8 million albums in the United States, and over 13 million worldwide. But their impressive sales doesn’t scratch the surface of their popularity and, even more impressively, the band continues to make music, following up 2011’s If Not Now, When? with a new album currently in the works. Amidst entering their third decade of working together, it is guitarist, Michael Einziger, who has expanded his presence far from the rock band he formed while attending High School in Calabasas. Off duty for Incubus, Einziger calls his latest chapter a time period that he “wanted to start branching out and writing music with other people,” and he’s certainly done so. On one end joining Hans Zimmer in scoring films and on the other inadvertently getting his hands on the steering wheel of EDM. Mike established that “EDM” (he too prefers quotations around the acronym) culture had been previously foreign to him, and still relatively is. As such, he chuckles when confirming that he’s been at the forefront of the movement. But where did it all begin? “I first got connected with Avicii about a year and a half ago,” he traces back the connection through his manager’s involvment with Interscope records, then to Tim’s A&R guy Neil Jacobson who pitched the idea. Unfamiliar with Avicii, it didn’t take long for Mike to find his answer. “I realized he produced that song “Levels” which I personally think is kind of a masterpiece production wise, I figured if he can do that he’d be someone I’d like to get together and work with.” His detailed description of linking up with Tim is surprisingly simple: “We spoke for a few hours and made a plan to write songs together, and the very first thing that happened when we worked together is we wrote ‘Wake Me Up.’ That was our first attempt at writing music together, which is crazy looking back on it.” Einziger attributes their chemistry to sharing very similar musical goals and seeing things the same way. “We were able to just sit down at talk about ideas that were exciting, things were flowing very easily. So the first time we got together it just seemed like the ideas came very quickly and easily.” Shaking hands, sitting down, going to work, and instantly producing hit sounds like a musician’s fairytale, and his humble account reveals it as such. “He sat down in front of a piano in my studio and I had my guitar, we just starting messing around with chords the same way I would with anyone else really. We got this chord progression going where we were both very happy with it.” Giving Avicii credit as someone with a first-hand account of his work ethic, Einziger describes him as “very specific about things he likes and doesn’t like,” something he admires in a collaborator. “Somebody’s who’s very opinionated and knows what they like and don’t like, that’s really important, a good thing right off the bat.” As one of the most revered guitarists on the planet who is just now managing his longevity in a world with technology redefining production and instrumentation, Mike speaks candidly on the changing times. He embraces technology’s impact on music rather than fighting it. “The fact that technology influences music making and art in general to me is very exciting. I just really love how music making tools are so powerful now.” Name dropping programs and tools to create music, and the power in which they each hold, he’s amazed at how accessible the power is to create and make impact. “I think that it’s completely amazing that any person who can get their hands on music making programs can change the world with music.” The parallel he draws between today’s musicians and those of decades past is as deep as creative ignition, as direct as being young and inspired. “I just know from my own experience that these musical ideas could end up connecting with an audience around the world. What millions and millions of people listen to start off as little ideas that we write in bedrooms and in living rooms and garages,” he explains, “anyone can create something that changes the world.” He refers to there still being the highest of production quality despite volume, and the ability for it to instantly be shared — something that didn’t happen when he was a kid. “That obviously presents its own set of new challenges and issues and new directions, I personally find it exciting.” Although he doesn’t listen to music that he says is generalized as “EDM” he speaks on what he does listen to, a lot of music that uses electronic music technologies. “It’s funny that I’ve been writing music that’s at the forefront of that movement, at least recently, but it’s something that’s totally alien to me in many other ways because of my background.” He says the electronic side of music he listened to growing up doesn’t sound anything like today’s electronic music, and laughs in reflection. Looking back, however, he pinpoints electronic influence for Incubus being the drum n’ bass he heard while touring Europe. “There were artists like Roni Size and Talvin Singh, a lot of drum n’ bass artists in England in Europe doing cool stuff. That was a lot of the musical influence that we brought back with us to the US when we started making, at the time with Incubus, an album that came out in 1999 called Make Yourself,” he recalls memories of 15 years go and entails some of Incubus’ most popular music. “There were elements of what we were trying to emulate, some live drum n’ bass music in certain spots. We have a song called “Pardon Me,” the verses in that song were totally lifted from us listening to those artists.” Talking his time away from Incubus and exploring new tasks, he breaks them down by way of each musical situation having its own unique set of circumstances. “Each time I throw myself into these situations that feel foreign to me, that’s when I learn the most about what I’m doing and how big music is,” he continues, “music is a really big place. It’s easy to get bogged down in a certain sound or formula for doing things, but I’m actually really enjoying this stage of my career where I’m able to work with all these people.” From working with Hans Zimmer to satisfy a director’s visuals in one world of music and songwriting with unexpected partners in another, Mike is certain these experiences will shine through new material he’s working on with Incubus. “I’m working with my band as well and we’re starting to write new music and make songs together, it’s interesting to be doing that after having all these experiences,” he says,”the music will definitely be influenced by that in someway, I don’t know if I can really pinpoint how or what it will sound like as result, but it definitely be influenced by it in some capacity.” Recently taking to Bonnaroo, Einziger played a key role in Skrillex’s Superjam experiment, he says “doing what we did at Bonaroo is what music making really is all about — getting together with different people of really varying backgrounds and actually just throwing it all together and making something exciting and different happen.” He calls it one of the most fun musical experiences of his life. Indescribably fun, in fact, and instantly offers praise to the host. “Skrillex is, in my opinion, one of the most important musicians of the last ten years. Very few people can change the way music sounds that dramatically.” Mike refers to Sonny Moore’s innovation, and the impact is truly had upon all of music, how “people started to emulate him in such a way, the things he was doing at the time sounds normal now but the time when he started doing it it was this thing that was shocking.” Recalling the first time he heard “Scary Monsters and Nice Sprites,” Einziger says it was something that would’ve had him pull his car over if he had been driving, something that doesn’t happen too often. “He offered me one of those moments in my life, and when that happens, I have a massive amount of respect for him and what he’s done.” Talking about their on-stage chemistry, the honor it was to share the stage and collaborate with different musicians live, he hones in on one moment: “At one point me, Robby from The Doors and Skrillex were kind of having a guitar battle on stage, it’s those moment that are so crazy, awesome.” Then there’s his work with David Guetta, the recently released “Lovers On The Sun.” He got together with Guetta and co-producer Giorgio Tuinfort in London with only the idea to write music, no specific agenda. David had a song he was working on, that he knew was almost finished but still missing something. “I took a few listens and it seemed like it needed that sort of identifiable guitar riff,” Mike illustrates their session, “he wanted it to be that Morticoni sort of vibe that’s very guitar driven in many respects. I just played the first thing that came to me and it ended up becoming the right thing.” Nothing more than a fun time bouncing ideas back and forth, his respect for Guetta’s workflow is obvious, and he wraps up the track’s tale: “When I just started playing what I was playing, David and Giorgio just started freaking out. It gave the song a different dynamic and aesthetic, it completed the vision of it.” What’s the come from his electronic hand before Incubus is back in full force? More music with David Guetta has been completed, but its fate is still undecided. The case is similar with Avicii, whom he’s reunited with on exciting new follow up material. “Tim, I believe is trying to get ready to put a new album out, probably later in the year. We wrote a few new songs together. We did one together with Billie Joe of Green Day, that one’s really exciting. We did a few with AlunaGeorge, some stuff with Wyclef and Matisyahu.” Mike doesn’t know what will make the final cut of the new album, since “Tim’s got so much stuff,” but confirms they’ve done a lot of writing together in recent months and is excited about the collaborators who’ve joined them and the potential for its 2014 release. Categories: Features, News
Glimpses of the advancement of medical science as depicted in the Mahbhrata. The Mahabharata of Vedavyasa is an encyclopaedic work, which has got some importance from the standpoint of Indian medical science also. According to it Ayurveda was a compulsory subject which was taught to everybody. Perhaps, Mahabharata is the first epic which presents the term Ayurveda. The fundamentals of Ayurveda are discussed in it very well. Circulations of blood described here reminds us the same of sushruta samhita. Three types of poisons and a number of metals and jewels have also been given in Mahabharata.
/** * An intersection type. * * <p>Intersection types in Java arise from intersection casts like {@code (A&B&C)} and type * variable upper bounds like {@code <T extends A&B>} */ @AutoValue @Visitable public abstract class IntersectionTypeDescriptor extends TypeDescriptor { public abstract ImmutableList<DeclaredTypeDescriptor> getIntersectionTypeDescriptors(); @Override @Memoized public boolean isNullable() { // TODO(b/68725640): remove nullability for parts where is not relevant like this one. return getIntersectionTypeDescriptors().stream().allMatch(TypeDescriptor::isNullable); } @Override @Memoized public DeclaredTypeDescriptor toRawTypeDescriptor() { return getFirstType().toRawTypeDescriptor(); } /** * Returns the first type in the intersection. * * <p>Following the approach Java uses regarding erasure of intersection types, variables and * expression of intersection types are seen as being typed at the first component. J2cl inserts * the necessary casts when accessing members the other types in the intersection type. */ @Memoized public DeclaredTypeDescriptor getFirstType() { return getIntersectionTypeDescriptors().get(0); } @Override public Node accept(Processor processor) { return Visitor_IntersectionTypeDescriptor.visit(processor, this); } @Override public boolean isIntersection() { return true; } @Override @Memoized public DeclaredTypeDescriptor getFunctionalInterface() { return getIntersectionTypeDescriptors() .stream() .filter(DeclaredTypeDescriptor::isFunctionalInterface) .findFirst() .orElse(null); } @Override @Nullable public TypeDeclaration getMetadataTypeDeclaration() { return toRawTypeDescriptor().getMetadataTypeDeclaration(); } @Override @Memoized public IntersectionTypeDescriptor toUnparameterizedTypeDescriptor() { return newBuilder() .setIntersectionTypeDescriptors( TypeDescriptors.toUnparameterizedTypeDescriptors(getIntersectionTypeDescriptors())) .build(); } @Override public boolean isAssignableTo(TypeDescriptor that) { return getIntersectionTypeDescriptors() .stream() .anyMatch(typeDescriptor -> typeDescriptor.isAssignableTo(that)); } @Override @Memoized public Set<TypeVariable> getAllTypeVariables() { return getIntersectionTypeDescriptors() .stream() .map(TypeDescriptor::getAllTypeVariables) .flatMap(set -> set.stream()) .collect(Collectors.toSet()); } @Override @Memoized public String getUniqueId() { return synthesizeIntersectionName(TypeDescriptor::getUniqueId); } @Override @Memoized public String getReadableDescription() { return synthesizeIntersectionName(TypeDescriptor::getReadableDescription); } private String synthesizeIntersectionName(Function<DeclaredTypeDescriptor, String> nameFunction) { return getIntersectionTypeDescriptors().stream() .map(nameFunction) .collect(joining("&", "(", ")")); } @Override public IntersectionTypeDescriptor toNullable() { return this; } @Override public IntersectionTypeDescriptor toNonNullable() { return this; } @Override public boolean canBeReferencedExternally() { return getIntersectionTypeDescriptors() .stream() .anyMatch(TypeDescriptor::canBeReferencedExternally); } @Memoized @Override public Map<TypeVariable, TypeDescriptor> getSpecializedTypeArgumentByTypeParameters() { ImmutableMap.Builder<TypeVariable, TypeDescriptor> mapBuilder = ImmutableMap.builder(); for (TypeDescriptor typeDescriptor : getIntersectionTypeDescriptors()) { mapBuilder.putAll(typeDescriptor.getSpecializedTypeArgumentByTypeParameters()); } return mapBuilder.build(); } @Override public IntersectionTypeDescriptor specializeTypeVariables( Function<TypeVariable, ? extends TypeDescriptor> replacementTypeArgumentByTypeVariable) { if (AstUtils.isIdentityFunction(replacementTypeArgumentByTypeVariable)) { return this; } return newBuilder() .setIntersectionTypeDescriptors( getIntersectionTypeDescriptors() .stream() .map( typeDescriptor -> (DeclaredTypeDescriptor) typeDescriptor.specializeTypeVariables( replacementTypeArgumentByTypeVariable)) .collect(ImmutableList.toImmutableList())) .build(); } public static Builder newBuilder() { return new AutoValue_IntersectionTypeDescriptor.Builder(); } /** Builder for an IntersectionTypeDescriptor. */ @AutoValue.Builder public abstract static class Builder { public abstract Builder setIntersectionTypeDescriptors( Iterable<DeclaredTypeDescriptor> components); abstract IntersectionTypeDescriptor autoBuild(); private static final ThreadLocalInterner<IntersectionTypeDescriptor> interner = new ThreadLocalInterner<>(); public IntersectionTypeDescriptor build() { IntersectionTypeDescriptor typeDescriptor = autoBuild(); checkState(typeDescriptor.getIntersectionTypeDescriptors().size() > 1); return interner.intern(typeDescriptor); } } }
<reponame>npmccallum/mbedtls-sys // Copyright 2016 Fortanix, Inc. // Copyright 2019 Red Hat, Inc. // // 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. // This list has been generated from a include/mbedtls/ directory as follows: // // 1. Find all occurences of #include "", but skip MBEDTLS macros and *_alt.h // 2. Add a list all files in the current directory // 3. Reverse topological sort // 4. Exclude certain files // 5. Show only files that exist in cmdline order // // ls -f1 $( \ // ( \ // grep '^#include' *|grep -v '<'|grep -v MBEDTLS_|sed 's/:#include//;s/"//g'|grep -v _alt.h; \ // ls *.h|awk '{print $1 " " $1}' \ // )|tsort|tac| \ // egrep -v '^(compat-1.3.h|certs.h|config.h|check_config.h)$' \ // ) #include <mbedtls/config.h> #include <mbedtls/bignum.h> #include <mbedtls/md.h> #ifdef MBEDTLS_THREADING_C #include <mbedtls/threading.h> #endif #include <mbedtls/ecp.h> #include <mbedtls/rsa.h> #include <mbedtls/ecdsa.h> #include <mbedtls/platform_time.h> #include <mbedtls/asn1.h> #include <mbedtls/pk.h> #if MBEDTLS_VERSION_MAJOR >= 2 && MBEDTLS_VERSION_MINOR >= 10 #include <mbedtls/platform_util.h> #endif #include <mbedtls/x509.h> #include <mbedtls/cipher.h> #include <mbedtls/x509_crl.h> #include <mbedtls/ssl_ciphersuites.h> #include <mbedtls/x509_crt.h> #include <mbedtls/dhm.h> #include <mbedtls/ecdh.h> #include <mbedtls/oid.h> #include <mbedtls/ssl.h> #include <mbedtls/md5.h> #include <mbedtls/sha1.h> #include <mbedtls/sha256.h> #include <mbedtls/sha512.h> #include <mbedtls/ecjpake.h> #ifdef MBEDTLS_USE_PSA_CRYPTO #include <mbedtls/psa_util.h> #endif #include <mbedtls/aes.h> #include <mbedtls/net_sockets.h> #include <mbedtls/havege.h> #if MBEDTLS_VERSION_MAJOR >= 2 && MBEDTLS_VERSION_MINOR >= 12 #include <mbedtls/poly1305.h> #include <mbedtls/chacha20.h> #endif #include <mbedtls/xtea.h> #include <mbedtls/x509_csr.h> #include <mbedtls/version.h> #include <mbedtls/timing.h> #include <mbedtls/ssl_ticket.h> #include <mbedtls/ssl_internal.h> #include <mbedtls/ssl_cookie.h> #include <mbedtls/ssl_cache.h> #include <mbedtls/rsa_internal.h> #include <mbedtls/ripemd160.h> #include <mbedtls/platform.h> #include <mbedtls/pkcs5.h> #include <mbedtls/pkcs12.h> #ifdef MBEDTLS_PKCS11_C #include <mbedtls/pkcs11.h> #endif #include <mbedtls/pk_internal.h> #include <mbedtls/pem.h> #include <mbedtls/padlock.h> #if MBEDTLS_VERSION_MAJOR >= 2 && MBEDTLS_VERSION_MINOR >= 12 #include <mbedtls/nist_kw.h> #endif #include <mbedtls/net.h> #include <mbedtls/memory_buffer_alloc.h> #include <mbedtls/md_internal.h> #include <mbedtls/md4.h> #include <mbedtls/md2.h> #include <mbedtls/hmac_drbg.h> #if MBEDTLS_VERSION_MAJOR >= 2 && MBEDTLS_VERSION_MINOR >= 11 #include <mbedtls/hkdf.h> #endif #include <mbedtls/gcm.h> #include <mbedtls/error.h> #include <mbedtls/entropy_poll.h> #include <mbedtls/entropy.h> #include <mbedtls/ecp_internal.h> #include <mbedtls/des.h> #include <mbedtls/debug.h> #include <mbedtls/ctr_drbg.h> #include <mbedtls/cmac.h> #include <mbedtls/cipher_internal.h> #if MBEDTLS_VERSION_MAJOR >= 2 && MBEDTLS_VERSION_MINOR >= 12 #include <mbedtls/chachapoly.h> #endif #include <mbedtls/ccm.h> #include <mbedtls/camellia.h> #include <mbedtls/bn_mul.h> #include <mbedtls/blowfish.h> #include <mbedtls/base64.h> #include <mbedtls/asn1write.h> #if MBEDTLS_VERSION_MAJOR >= 2 && MBEDTLS_VERSION_MINOR >= 10 #include <mbedtls/aria.h> #endif #include <mbedtls/arc4.h> #include <mbedtls/aesni.h>
import cv2 import numpy as np from typing import Dict, Tuple class ObjectDetectionVisualizer: def __init__( self, label_dict: Dict[int, str], pred_color: Tuple[int, int, int] = (0, 0, 255), teacher_color: Tuple[int, int, int] = (0, 255, 0), index_to_show: int = 0, transpose_to_numpy: bool = True, wait_time: int = 1): """ :param label_dict: :param pred_color: :param teacher_color: :param index_to_show: :param transpose_to_numpy: :param wait_time: """ self._label_dict = label_dict self._pred_color = pred_color self._teacher_color = teacher_color self._index_to_show = index_to_show self._transpose_to_numpy = transpose_to_numpy self._wait_time = wait_time def __call__(self, inputs, preds, teachers): img = inputs[self._index_to_show] if self._transpose_to_numpy: img = img.transpose(1, 2, 0) pred = preds[self._index_to_show] for class_id in range(len(pred)): bbox = pred[class_id] if bbox is None: continue if bbox.shape[0] < 0: continue detections = bbox.shape[0] for n_obj in range(detections): if class_id < 0: continue x_min, y_min, x_max, y_max = \ int(bbox[n_obj][0]), int(bbox[n_obj][1]), int(bbox[n_obj][2]), int(bbox[n_obj][3]) cv2.rectangle(img, (x_min, y_min), (x_max, y_max), self._pred_color, thickness=1) img = self._draw_text_with_background( img, self._label_dict[class_id], (x_min, y_min), self._pred_color ) if teachers is not None: teacher = teachers[self._index_to_show] for i in range(teacher.shape[0]): bbox = teacher[i] class_id = int(bbox[4]) if class_id < 0: continue x_min, y_min, x_max, y_max = \ int(bbox[0]), int(bbox[1]), int(bbox[2]), int(bbox[3]) cv2.rectangle(img, (x_min, y_min), (x_max, y_max), self._teacher_color, thickness=1) img = self._draw_text_with_background( img, self._label_dict[class_id], (x_min, y_min), self._teacher_color ) cv2.imshow('training image', img) cv2.waitKey(self._wait_time) @staticmethod def _draw_text_with_background( origin_img: np.ndarray, text: str, offsets: Tuple[int, int], background_color: Tuple[int, int, int], text_color=(0, 0, 0), margin_px=5, font_scale=0.5, alpha=0.6): img = origin_img.copy() overlay = img.copy() font = cv2.FONT_HERSHEY_DUPLEX text_width, text_height = cv2.getTextSize(text, font, font_scale, 1)[0] background_coors = (offsets, (int(offsets[0] + text_width + margin_px * 2), int(offsets[1] - text_height - margin_px * 2))) img = cv2.rectangle(img, background_coors[0], background_coors[1], background_color, cv2.FILLED) img = cv2.putText(img, text, (offsets[0] + margin_px, offsets[1] - margin_px), font, font_scale, text_color, 1, cv2.LINE_AA) return cv2.addWeighted(overlay, alpha, img, 1 - alpha, 0)
Consumers must have cut back on Halloween candy and scrounged for costumes at thrift stores this year, because Target released another month of scary bad sales results this morning. CEO Gregg Steinhafel calls the retailer’s 4.8 percent same-store sales decline “very disappointing.” The company is among a slew of retailers posting sales declines for October. However Wal-Mart bucked the trend, seeing a 2.4 percent increase. Evidence that the impact of the credit crisis may be exaggerated? U.S. Bank, one of the nation’s largest small-business lenders, said it’s provided a record $503 million in SBA loans during 2008. That’s up 3.6 percent from its total last year. Nationally, U.S. Bank ranks third among SBA lenders. Delta and Northwest passengers will be treated equally with a $15 fee for their first checked bag, the airlines said Wednesday. It wasn’t clear last week whether the merged airlines would keep Northwest’s first-bag fee, which didn’t exist for Delta customers. Delta also said it is eliminating its fuel surcharges to book tickets using frequent-flier miles. Wells Fargo plans to offer $10 billion in common stock to help it maintain capital as it absorbs Wachovia Corp. The announcement came after markets closed Wednesday. Fortune’s Daily Briefing blog notes that the timing could have been better. It announced the stock sale on a day when the Dow Jones plunged 500 points and financial institutions were among the biggest losers.
k2,k3,k5,k6=map(int,input().split()) table={2:k2,3:k3,5:k5,6:k6} tot=0 m_256=min(table[2],table[5],table[6]) tot+=(256*m_256) table[2]-=m_256;table[5]-=m_256;table[6]-=m_256; m_32=min(table[2],table[3]) tot+=(32*m_32) table[2]-=m_32;table[3]-=m_32; print(tot)
//***************************************************************************** //Load DivX filter from local directory //***************************************************************************** HRESULT loadDivX(IBaseFilter **pFilter) { HRESULT hr; HMODULE hInst = LoadLibrary("DivXEnc.ax"); if(!hInst) { return E_FAIL; } DLLGETCLASSFUNC *DllGetClassObject = (DLLGETCLASSFUNC *) GetProcAddress(hInst, "DllGetClassObject"); IClassFactory *pClassFactory = 0; hr = DllGetClassObject(CLSID_DivXEncFilter, IID_IClassFactory, (void **) &pClassFactory); hr = pClassFactory->CreateInstance(NULL, IID_IBaseFilter, (void **) &(*pFilter)); pClassFactory->Release(); return hr; }
A simple method to improve the handling of fingers during fracture fixation Dear Sir, Finger fracture reduction, percutaneous pin fixation and the efficient use of the mini C-arm by the operating surgeon concomitantly can be a difficult test of dexterity. We present a simple, cheap and safe technique with the use of Steri-Strips to allow traction of the injured digit and prevent the operators fingers receiving unnecessary radiation whilst aiding the accurate positioning of the digit under the C-arm. Three half-inch (12mm 100mm) Steri-Strips are required for this technique. Once the hand has been prepared, draped and, if necessary, dried, two SteriStrips are placed longitudinally on the palmar and dorsal aspect of the finger respectively and the third is place circumferentially around the two to hold them in place (Fig 1). We have found that this technique helps to produce views that are not rotated and can assist with holding fractures reduced at the same time. As a result when the image intensifier is needed the finger can be pulled into view and the image taken. Extra distance from the field can be gained by applying an artery clip to the end of the longitudinal Steri-Strips. For more distal fractures the technique improves grip of the fingertip. On completion of the procedure it is, of course, mandatory to remove the Steri-Strips to avoid any risk of compromising the distal circulation; it can be done easily without damage to the skin.
Adora2b Adenosine Receptor Engagement Enhances Regulatory T Cell Abundance during Endotoxin-Induced Pulmonary Inflammation Anti-inflammatory signals play an essential role in constraining the magnitude of an inflammatory response. Extracellular adenosine is a critical tissue-protective factor, limiting the extent of inflammation. Given the potent anti-inflammatory effects of extracellular adenosine, we sought to investigate how extracellular adenosine regulates T cell activation and differentiation. Adenosine receptor activation by a pan adenosine-receptor agonist enhanced the abundance of murine regulatory T cells (Tregs), a cell type critical in constraining inflammation. Gene expression studies in both nave CD4 T cells and Tregs revealed that these cells expressed multiple adenosine receptors. Based on recent studies implicating the Adora2b in endogenous anti-inflammatory responses during acute inflammation, we used a pharmacologic approach to specifically activate Adora2b. Indeed, these studies revealed robust enhancement of Treg differentiation in wild-type mice, but not in Adora2b −/− T cells. Finally, when we subjected Adora2b-deficient mice to endotoxin-induced pulmonary inflammation, we found that these mice experienced more severe inflammation, characterized by increased cell recruitment and increased fluid leakage into the airways. Notably, Adora2b-deficient mice failed to induce Tregs after endotoxin-induced inflammation and instead had an enhanced recruitment of pro-inflammatory effector T cells. In total, these data indicate that the Adora2b adenosine receptor serves a potent anti-inflammatory role, functioning at least in part through the enhancement of Tregs, to limit inflammation. Introduction Inflammation in response to tissue injury is a carefully orchestrated process, and insufficient or overexuberant inflammation can have catastrophic effects. One major pathway by which inflammation and tissue homeostasis is regulated is through the generation of extracellular adenosine, which can serve as a highly effective ''safety'' signal. In healthy individuals, extracellular adenosine levels are low. During tissue injury and inflammation, however, extracellular adenosine levels significantly increase due to: 1) ATP release from activated and dead/dying cells, followed by 2) generation of adenosine from ATP, ADP, and AMP, a process critically dependent on the enzyme CD73. The appropriate generation and clearance of extracellular adenosine are critical in limiting tissue pathology, with mice genetically deficient either in the generation (CD73-deficient mice) or clearance (adenosine deaminase, ADA-deficient mice) of extracellular adenosine displaying profound pathologies due to inappropriate control of inflammation. T cells are a major cell type of the adaptive immune system that orchestrate the immune response. Within the T cell compartment, regulatory T cells (Tregs) serve a critical function in restraining inappropriate immune responses and inhibiting inflammation. Tregs mediate these inhibitory effects by multiple mechanisms depending on the tissue and nature of injury/inflammation (e.g. production of the anti-inflammatory cytokines interleukin (IL)-10, IL-35 and transforming growth factor (TGF)-b, generation of extracellular adenosine, and cell-contact dependent mechanisms). Notably, Tregs can limit immune responses to a specific infection or insult (this specificity resulting from the unique T cell receptor expressed by the Tregs in question) or Tregs can have a more general, nonspecific inhibitory effect. While Tregs can achieve their fate either during development (natural Tregs, nTregs) or they can differentiate from a nave T cell into an induced Treg (iTreg), both cells express the transcription factor FoxP3, a critical molecular determinant essential for Treg function. Recent studies have shown that extracellular adenosine is one factor that can enhance the differentiation and function of Tregs, potentially through signaling through Adora2a. While many studies have focused on the role of Adora2a in regulating T cell function, much less is known about the contribution of Adora2b and its effects on T cell differentiation. In this study, we directly investigated the Adora2b receptor as a regulator of Treg differentiation. These studies reveal a previously unappreciated role for Adora2b in promoting Tregs both in vitro and in vivo, and identify a previously unappreciated mechanism by which Adora2b might limit inflammation. Results A pan-adenosine receptor agonist enhances the abundance of Tregs following in vitro stimulation of primary mouse T cells Given the potent anti-inflammatory effects mediated by extracellular adenosine, we tested the effect of a general adenosine receptor agonist (NECA) on the relative abundance of Tregs, an anti-inflammatory subset of T cells, after in vitro stimulation of primary murine T cells. Consistent with previous reports, NECA stimulation enhanced the relative abundance of FoxP3 expressing Tregs in stimulated splenocyte cultures ( Fig. 1A-B). TGF-b is a potent inducer of FoxP3 expression and an inducer of Tregs. Adenosine receptor stimulation further enhanced Tregs differentiation in the presence of TGF-b ( Fig. 1C-D). Tregs present following adenosine receptor stimulation had comparable expression relative to normal Tregs based on their cell surface expression of three proteins expressed on Tregs, CD25, CD39 and CD73 (Fig. 1E), indicating that adenosine receptor stimulation did not perturb the general phenotype of Tregs after in vitro culture. To define potential mechanisms by which adenosine receptor engagement might enhance Treg abundance, we measured relative expression levels of the four adenosine receptors in both nave CD4 T cells and Tregs. This analysis identified that both T cell subsets expressed all four of the adenosine receptors, with mRNA expression of Adora2a and FoxP3 upregulated in Tregs relative to nave CD4 T cells (Fig. 2). An Adora2b-specific agonist enhances Treg abundance in vitro following activation of murine T cells Previous studies have implicated the Adora2a adenosine receptor in promoting Treg abundance. Given the expression of the Adora2b receptor in both nave T cells and Tregs, and the accumulated evidence of an anti-inflammatory effect for Adora2b in vivo, we directly tested the consequence of an Adora2b-specific agonist (Bay60-6583) on in vitro cultures of activated primary murine T cells. While Bay60-6583 treatment of control Adora2b+/ + splenocytes resulted in an increased frequency of Tregs after three days of culture, this compound had no effect on Treg abundance in Adora2b2/2 cultures (Fig. 3). These data identify that an Adora2b-specific agonist is capable of enhancing Tregs in vitro. Adora2b-deficient mice fail to increase Tregs after endotoxin-induced pulmonary inflammation We next sought to investigate the in vivo consequence of Adora2b deficiency on T cell populations during pulmonary inflammation. Previous studies have revealed that Adora2bdeficient mice have enhanced pulmonary inflammation, marked by increased neutrophil infiltration, elevated levels of proinflammatory cytokines (e.g. IL-6, TNF-a), and decreased levels of the anti-inflammatory cytokine IL-10. Consistent with these earlier studies, we found that lipopolysaccharide (LPS) exposed Adora2b2/2 mice had increased cellularity in the airways after LPS exposure and increased protein leakage into the airways relative to wild-type controls ( Fig. 4A-B), with pronounced neutrophil infiltration (Fig. 4C). Given the ability of an Adora2b agonist to enhance Tregs, we tested the relative change in Treg abundance in Adora2b2/2 mice following LPS exposure. Notably, Adora2b2/2 mice failed to induce an increase in Tregs in the lung or the airway after LPS exposure (Fig. 4D, E). Conversely, Adora2b2/2 mice had an increased infiltration of CD4 effector T cells, such that the relative ratio of CD4 effector T cells to Tregs in Adora2b2/2 was elevated relative to Adora2b+/+ controls (Fig. 4F). The failure to increase Treg abundance, coupled with an enhanced recruitment of CD4 effector T cells identifies Adora2b as a critical regulator which influences the relative contribution of anti-inflammatory Tregs to pro-inflammatory effector T cells during inflammation. Discussion During acute inflammatory responses, the generation of extracellular adenosine is an important feedback mechanism that limits inflammation. The stepwise generation of extracellular adenosine by CD39 and CD73 from ATP is thought to limit inflammation by at least two ways: i) through the enzymatic degradation of extracellular ATP, which can promote inflammation and ii) by extracellular adenosine directly signaling through adenosine receptors. Notably, signaling through adenosine receptors triggers multiple anti-inflammatory pathways including the induction of IL-10, the impaired immunogenicity of dendritic cells, and the deneddylation of cullin-1 to limit NF-kB activation. In this manuscript, we present data for a new anti-inflammatory mechanism downstream of Adora2b: Adora2b-dependent induction of regulatory T cells. The potent anti-inflammatory effects of Adora2b during acute inflammation have been revealed in multiple studies of acute inflammatory insults including studies of localized or systemic microbial challenge. Adora2b also has a pronounced anti-inflammatory role in the context of ischemic tissue injury (i.e. transient tissue hypoxia) such that Adora2bdeficient mice have more severe acute ischemic injury in studies of both renal and myocardial ischemia. Notably, hypoxia elicits multiple adaptive responses within cells to deal with limited oxygen availability, including induction of the extracellular adenosine sensing pathway, induction of toll-like receptors TLR2 and TLR6, activation of the NF-kB machinery, and upregulation of integrins which modulate cell trafficking. Given the integration of hypoxic sensing machinery with Adora2b, future studies will focus on how hypoxia and extracellular adenosine signaling intersect in regulating the generation of Tregs. This work is especially relevant given our recent studies demonstrating that hypoxia can enhance the generation of Tregs, thereby restricting hypoxia-associated inflammation (Clambey et al, submitted). While Adora2b signaling can be tissue protective, Adora2b can also inappropriately restrict inflammation. This balance between tissue-protection versus host-defense has been nicely revealed by studies of cecal ligation and puncture, in which Adora2b-deficient mice were more resistant to sepsis and sepsis-associated mortality. Furthermore, Belikoff et al found that an Adora2b antagonist was capable of increasing survival in septic mice, even those, that based on increased levels of IL-6 in the blood, were predicted to succumb to mortality. In contrast to the potential beneficial effects of Adora2b in acute inflammatory contexts, this receptor can be detrimental in conditions of prolonged inflammation. For example, in elegant studies from the Blackburn laboratory, the pulmonary inflammation and fibrosis observed in adenosine deaminase (ADA) deficient mice is significantly improved upon treatment of these mice with an Adora2b-specific antagonist. Surprisingly, however, Adora2b genetic deficiency worsened ADA-deficient inflammation. This apparent discrepancy in the role of Adora2b is likely due to the kinetics of Adora2b loss-of-function, where pharmacological studies focused on the effects of blocking Adora2b after the onset of inflammation in contrast to genetic ablation of Adora2b that occurred prior to the induction of inflammation. Consistent with this idea, direct comparison of acute and chronic models of bleomycin-induced lung injury demonstrated that while Adora2b served a potent anti-inflammatory role during acute lung injury, Adora2b had little effect on inflammation and was instead pro-fibrotic during chronic pulmonary fibrosis. The pathogenic potential of Adora2b in chronic inflammation is not restricted to the lung. For example, Adora2b signaling was recently revealed to be detrimental in sickle cell anemia, a context in which elevated levels of extracellular adenosine-Adora2b signaling promotes red blood cell sickling, contributing to the pathogenesis of this disease. Based on our current observations that Adora2b enhances Tregs, it is interesting to speculate that some of the detrimental effects of Adora2b in chronic pathologies may be due to excessive generation or function of Tregs. A detrimental role for an adenosine-driven Treg pathway may be particularly relevant in the context of elevated extracellular adenosine levels (e.g. in pulmonary fibrosis, sickle cell anemia, fibrosis or solid tumors ). In fact, recent data indicate that Tregs may participate in the process of fibrosis, with a pro-fibrotic outcome occurring through increased Treg production of TGF-b1 and subsequent collagen production following immune activation. The divergent effects of Adora2b in acute and chronic inflammatory contexts indicate that Adora2b function is likely to be shaped by the cells and environments in which inflammation is occurring. Our data define a role for Adora2b in enhancing Tregs either in primary activated murine T cell cultures or after LPS exposure, a finding consistent with a recent report showing that antagonizing Adora2b signaling inhibits the generation of Tregs in vitro. In contrast to our findings, however, a recent paper reported that Adora2b promoted the generation of pro-inflam- 4). B) Protein content of BAL fluid was determined with BCA assay. Fold increase of protein concentration in LPS treated BAL samples over respective saline BAL samples is displayed (mean 6 SEM, n = 3-10). C) Analysis of cell infiltration into the lung airspace (BAL) of mice exposed to inhaled LPS. Mice (Adora2b+/+ or Adora2b2/2) were exposed to nebulized saline or lipopolysaccharide (LPS); 24 hours post-exposure, mice were euthanized, and BAL was harvested. Cells were then subjected to flow cytometric analysis to identify neutrophils (highly granular, Gr1+ cells). D) Analysis of FoxP3 gene expression in lungs of mice exposed to inhaled LPS. Mice (Adora2b+/+ or 2/2) were exposed to nebulized saline or lipopolysaccharide (LPS); 24 hours post-exposure, mice were euthanized, and perfused lungs were harvested. Total RNA was harvested from lungs, cDNA prepared and analyzed by real-time PCR. Data depict mean (6 SEM) fold changes in indicated genes. Fold change was calculated based on primer efficiencies, standardized to changes in actin, with Adora2b+/+ Saline mean value defined as 1. E) Fold change in cell number of either regulatory T cells (lymphocyte size, CD3+ CD4+ FoxP3+) in the lung airspace (BAL) of mice exposed to inhaled saline or LPS as above. Data are from 2-6 mice; 2 independent experiments. F) Relative abundance of CD4 effector T cells (Teffs, defined as lymphocyte size, CD3+ CD4+ CD44high cells) to Tregs based on cell counts from either Adora2b+/+ or Adora2b2/2 mice, with pie charts depicting mean cell count for the indicated cell populations from 2-6 mice; 2 independent expts. Analysis of total cellular infiltration into airways and protein leakage (panels A-B) was done in animals treated with intratracheal LPS. Analysis of neutrophil infiltration and Tregs (panels C-F) was done in animals treated with inhaled LPS. Statistically significant differences are indicated and were calculated either by one-way ANOVA (A) or by unpaired t test (B-E) with a focus on whether Adora2b2/2 LPS treated animals were statistically different from either saline treated or Adora2b+/+ LPS treated mice. doi:10.1371/journal.pone.0032416.g004 matory Th17 cells. While the explanation for this apparent discrepancy remains to be elucidated, it is notable that the Th17promoting effects of Adora2b in these studies were isolated to effects of Adora2b specifically on dendritic cells, and not on macrophages. This observation raises the possibility that the contribution of Adora2b to T cell differentiation depends on the type of antigen presenting cell (e.g. dendritic cell versus macrophage) and microenvironment. For example, while treatment of dendritic cells with NECA induces IL-6 expression in an Adora2b-dependent mechanism, Adora2b-deficient mice or macrophages had increased levels of IL-6 during acute inflammation, indicating that Adora2b can limit IL-6 in certain contexts. This cell-type specific regulation of IL-6 by Adora2b is particularly relevant to understanding how Adora2b could either induce anti-inflammatory Tregs, as we show here, or proinflammatory Th17 cells, given that Treg differentiation can be diverted to Th17 differentiation in the presence of IL-6. It will be important for future studies to elucidate the celltype specific contributions of Adora2b in controlling both acute and chronic inflammatory responses. The central role of Adora2b in determining the outcome of both acute and chronic pathologies identifies this molecule as a promising point of intervention. Since Adora2b serves as a receptor both for extracellular adenosine as well as for alternative ligands (e.g. Netrin-1, ), this receptor may function to integrate multiple extrinsic cues to promote Tregs to restrict the duration and magnitude of inflammation. Pharmacologic targeting of adenosine pathways such as Adora2b may also synergize with modalities that activate the hypoxic response and have been shown to be tissue-protective in models of colitis. Conversely, since both Adora2a and Adora2b signaling promote Tregs, transient depletion of extracellular adenosine through the administration of pegylated-ADA may be a potent method to transiently limit the generation or activity of Tregs. Based on the potential of Adora2b-targeted treatments to modulate regulatory T cells, future studies will interrogate the consequences and therapeutic benefits of manipulating the Adora2b-Treg axis in both acute and chronic states of inflammation. Mice Adora2b+/+ (C57BL/6J) and Adora2b2/2 mice were bred in house. B6.Cg-Foxp3 tm2Tch /J (here referred to as FoxP3GFP ) were obtained from Jax and DEREG mice were kindly provided by Dr. Tim Sparwasser. All mouse experiments were done using age-and sex-matched mice, with mice typically used between 8-12 weeks of age. The animal protocol was approved by the Institutional Animal Care and Use Committee of the University of Colorado Denver (under Animal Welfare Assurance Policy A3269-01, IACUC protocol B837081D) and is in accordance with the National Institutes of Health guidelines for use of live animals. The University of Colorado Denver, Anschutz Medical Campus is accredited by the American Association for Accreditation of Laboratory Animal Care (#00235). Tissue harvest At time of harvest, bronchoalveolar lavage (BAL) was harvested by performing three sequential lavages of the airways, using an icecold PBS solution containing 5 mM EDTA. Lungs were harvested from mice, following perfusion of the lungs using saline. For lungs subjected to flow cytometric analysis, lung tissue was mechanically disrupted by scissors, followed by a one-hour incubation of lung tissue with collagenase D at a final concentration of 1 mg/mL at 37 C. Following collagenase treatment, lung material was placed over a 100 micron mesh and cells were forced through using the plunger of a 3 mL syringe and multiple washes of disrupted material. T cell purification T cells were purified from the spleen of mice, mechanically disrupted over a 100 micron filter, subjected to magnetic bead enrichment for CD4 T cells using a CD4 T cell isolation kit (Miltenyi Biotec, Germany). Enriched CD4 T cells were then subjected to FACS purification on a FACSAria (BD), with nave CD4 T cells purified based on the cell surface phenotype CD4+ CD62L high CD44 low. FoxP3-expressing Tregs were purified from two different genetically engineered mice which express GFP specifically in Tregs, the FoxP3GFP (B6.Cg-Foxp3 tm2Tch /J from Jax ) and DEREG mice (kindly provided by Dr. Tim Sparwasser ). In both strains of mice, GFP expression is directly linked to the regulatory sequences from the FoxP3 locus, either using an internal ribosome entry site at the end of the endogenous FoxP3 gene (in FoxP3GFP mice) or using a bacterial artificial chromosome-based transgenic in which GFP was placed downstream of the FoxP3 promoter (in DEREG mice). FoxP3 expressing cells were purified for subsequent qPCR analysis, with Tregs identified and isolated by sorting as CD4+ GFP+. In vitro T cell cultures Bulk splenocytes or purified CD4 T cells were cultured in Iscove's modified Dulbeco's medium (IMDM, Gibco) containing 5% FBS, L-glutamine, penicillin/streptomycin and b-mercaptoethanol (50 mM). All cultures were done using cells at a concentration of 1610 6 cells/mL. For cultures subjected to T cell receptor stimulation, bulk splenocytes were stimulated with 1 mg/mL soluble anti-CD3e (clone 145-2C11, eBioscience), supplemented with 10 ng/mL of recombinant mouse IL-2 (eBioscience). In vitro Treg differentiation assays were done for 3 days. In certain assays, exogenous TGF-b was added to the culture, using recombinant human TGF-b1 (eBioscience). For assays in which cells were stimulated with a pan receptor agonist, cultures were treated with 10 mM NECA (59-N-Ethylcarboxamidoadenosine, Tocris Bioscience, MO, USA) for the duration of the culture. For cultures stimulated with the Adora2b-specific agonist Bay60-6583, cultures were treated with 4 nM Bay60-6583 (obtained from Bayer, Germany). RNA isolation and Real-time PCR Total RNA was extracted from cells or tissue by Trizol, followed by cDNA synthesis using iScript cDNA Synthesis Kit (Bio-Rad Laboratories, Inc, Munich, Germany) according to the manufacturer's instructions. Quantitative real-time reverse transcriptase PCR (qPCR) (iCycler; Bio-Rad Laboratories, Inc.) was performed to measure relative mRNA levels for various transcripts, with qPCR master mix contained 1 mM sense and 1 mM antisense primers with iQ TM SYBRH Green (Bio-Rad Laboratories, Inc.). For every assay, melt curve analysis was performed and samples with aberrant melt curves were discarded. All qPCR assays were standardized relative to b-actin levels. Antibodies and Flow cytometric analysis Antibodies were purchased from eBioscience unless otherwise noted. Anti-mouse antibodies included CD4 (GK1.5), CD25 (PC61.5), CD39 (24DMS1), CD73 (eBioTY/11.8 (TY/11.8)), FoxP3 (FJK-16s), Gr1 (RB6-8C5), and MHC class II (M5/ 114.15.2). Single cell suspensions of cultured cells or disrupted tissue were stained with a cocktail of antibodies for 30 minutes at room temperature in the dark, in staining buffer containing an anti-Fc receptor antibody (2.4G2). When cells were stained for FoxP3, staining was done using FoxP3 staining buffer according to manufacturer's instructions (eBioscience). Unless stated otherwise, all stains included a viability dye to identify viable cells (LIVE/ DEADH Fixable Aqua Dead Cell Stain Kit, Invitrogen), with Tregs routinely identified as lymphocytes (based on forward and side scatter profiles) that were viable, MHC class II negative cells, which expressed CD4 and FoxP3. FoxP3-expressing Tregs were identified by comparing fluorescent signal between samples stained with an isotype control antibody (background staining), relative to samples stained with a FoxP3-specific antibody. Isotype stained controls routinely had less than 0.5% positive events within the FoxP3+ gate. All flow cytometry was done on an LSRII (BD), with compensation done using FACSDiva software. All flow cytometry data is show on a log 10 scale. Murine LPS exposure models Male Adora2b+/+ (C57BL/6J mice, The Jackson Laboratory, ME) and Adora2b2/2 on a C57BL/6J background were randomly assigned to saline or LPS treatment groups at age 9-12 wk. LPS from Escherichia coli 0111:B4 (L4391, Sigma-Aldrich) was dissolved in 0.9% saline (2 mg/mL). Animals were anesthetized with pentobarbital (70 mg/kg i.p.). A volume of either 50 mL LPS (100 mg/animal) or saline was instilled intratracheally via a 22-gauge canule, followed by 0.1 mL of air. Animals were harvested 24 hours after instillation. For studies in which mice were exposed to aerosolized LPS, mice were exposed to aerosolized LPS in a cylindrical chamber connected to an air nebulizer (MicroAir; Omron Healthcare, Mannheim, Germany) as published previously. Measurement of BAL fluid protein content After collection samples were centrifuged for 1 min at 3,0006g, and supernatant was stored at 280uC. Colorimetric Pierce bicinchoninic acid (BCA) protein assay (Thermo Scientific) was performed according to the manufacturer's protocol to determine protein content of BAL supernatant. Leukocyte counts of BAL fluid BAL samples were mixed gently prior to diluting 50 mL of BAL fluid with 50 ml of Trypan blue (1:5 in 16 PBS) for viable cell counts. 20 ml of diluted cell sample were pipetted on a cellometer cell counting chamber. Leukocytes were automatically counted using a Cellometer Auto T4 (Nexcelom Bioscience, Lawrence, MA, USA). Software & statistical analysis Data analysis and plotting were done using Prism 4.0c (GraphPad Software, Inc, San Diego, CA). Flow cytometric data were analyzed using FlowJo (TreeStar, Inc, Ashland, OR), with data displayed as high-resolution zebra plots showing outliers, using log 10 scales. Statistical analyses were performed using Prism 4.0c, with unpaired t-tests or one-way ANOVA and Bonferroni's multiple comparison post-test correction for all other analyses.
. 72 patients with gastro-intestinal carcinomas were involved in a retrospective study in which 97 metabolic parameters were pre-operatively determined from each of them and subsequently tested by stepwise discriminant analysis for their bearings on clinical mortality. A discriminant function of seven parameters was obtained and can be used as a prognostic nutritional index for successful subdivision of patients into differentiated risk groups. Two prospective control studies were conducted into 605 patients consecutively operated on for benign and malignant diseases for the purpose of testing the nutritional index for its prognostic information potential. The discriminant function proved to be applicable to differentiation between patients with high, moderate, and low surgical risk. Findings were unambiguous. The nutritional index can thus be used as an aid for decision-making in cases in which alternatives exist between several surgical approaches. The importance of malnutrition as a possible causative factor of complications is likely to grow along with the invasiveness of the intervention.
GP-based optimisation of technical trading indicators and profitability in FX market Some empirical evidence have suggested that it is possible to reap profit with one well chosen trading indicator that possesses embedded market timing adaptability, to trade either stocks or foreign currencies over medium term of 3 to 5 years. The profit is however attained with risk-taking embedded in the determination of a buy decision. To achieve more consistent profitability with a moderate risk, we propose a modified GP-based optimised trading rule, which involves the dynamic use of two out a finite number of pre-specified indicators. In this respect, the proposed rule is neither too risk-averse nor too risk-taking biased in the determination of a buy decision. Based on the minimum cash draw-down criterion and adopting momentum trading strategy (i.e., following the trend) the statistical test results suggest that consistent profit after accounting for transaction cost is achievable through extrapolating the trend.
In the early ’80s, when the city tried to rebuild the Wollman skating rink, it was supposed to take two years. Six years later, a real-estate developer — his name was Donald Trump — shamed the city into letting him take over, completing it in four months. Now, the city and state have a new Wollman Rink: the Hudson River Park, under construction for 17 years. Time to get it done. In one way, the Hudson River Park is a “yuge” success. Forty years ago, the West Side Highway from Battery Park to 59th Street was a wasteland littered with burned-out cars and a rusted roadway above. Today, it’s a 550-acre green space with dog parks, playgrounds and grass to read on. The country’s busiest bike lane runs alongside it. That’s because previous governors and mayors thought ahead. Gov. Cuomo’s father, Mario, set aside the land. In the mid-90s, then-Gov. George Pataki and Mayor Rudy Giuliani committed money to build it — $363 million so far, split between the city and state. And it’s paid off. “The Hudson River Park is the most important physical transformation of Manhattan of the last 80 years,” says Adrian Benepe, who ran all of the rest of the city’s parks under Mayor Michael Bloomberg. This is not an exaggeration. Nobody would want to live isolated, with nothing for their kids to do. But the park has made the Far West Side a real neighborhood. The area has added 54 percent to its population over the past 15 years, including 4,300 little kids, even as the number of children elsewhere below 59th Street has fallen, says the Regional Plan Association, which has done some research for the Friends of Hudson River Park, a nonprofit. Its forthcoming study notes that the park has more than paid for itself, encouraging people (like me) to live and work near the waterfront, and encouraging developers to build for them. The problem? Construction work went quickly from 1999 until 2012 or so — so that most of the park is usable (and nice). But now, the work is only 70 percent complete — and it’s stalled. Walking and biking areas are still a patchwork. Some people have a patch of grass to suntan on, some don’t. Gov. Cuomo and Mayor de Blasio aren’t as interested in finishing their predecessors’ legacies. The Hudson park raises some money for day-to-day costs, from donations as well as commercial activity. But the commercial stuff always runs into activist opposition, adding to delays. As city and state money slowed, the ability to finish it is hindered, says Scott Lawin, of the Friends of Hudson River Park and a local resident. “You might start to lose that value with a lot of unfinished spots, like a downtown with a lot of vacant storefronts,” says Robert Freudenberg of the RPA. Unlike for Central Park, it’s hard to get private donors to pay for the remaining Hudson River stretches, about $150 million. “Central Park is surrounded on three sides by millionaires and billionaires,” Benepe said. But one side of the Hudson River Park is, well, a river. “There are no wealthy and philanthropic striped bass,” says Benepe. The West Side, too, is less dense and has more middle-class residents who enjoy the park but can’t give millions. “The Central Park Conservancy is a model Friends of Hudson Park aspires to,” says Lawin. But Central Park was complete, and had a century-old history, before people started donating. The solution: Cuomo and de Blasio should commit to splitting the cost — $25 million each over three more years — to finish it. We’ve got surpluses for the moment, and there could hardly be a less controversial way to spend taxpayer money. Taxpayers use the parks. Central Park, Governors Island and the Hudson River Park are packed with too many people in the summer. Many Far West Siders won’t go near the High Line anymore (too trendy), so the Hudson River Park is really their neighborhood park. Plus, it’s good to finish what you start. De Blasio wants to build a streetcar for Brooklyn waterfront neighborhoods similar to the Far West Side’s (the bike lane’s our streetcar). How would he feel if his successor left it with tracks missing? We would have to call in . . . President Trump. Nicole Gelinas is a contributing editor to the Manhattan Institute’s City Journal.
Wrist-bridging versus non-bridging external fixation for displaced distal radius fractures: a randomized assessor-blind clinical trial of 38 patients followed for 1 year. BackgroundNon-bridging external fixation has been introduced to achieve better fracture fixation and functional outcomes in distal radius fractures, but has not been specifically evaluated in a randomized study in the elderly. The purpose of this trial was to compare wrist-bridging and non-bridging external fixation for displaced distal radius fractures. MethodThe inclusion criteria were women ≥ 50 or men ≥ 60 years, acute extraarticular or intraarticular fracture, and dorsal angulation of ≥20° or ulnar variance ≥ 5mm. The patients completed the disabilities of the arm, shoulder and hand (DASH) questionnaire before and at 10, 26 and 52 weeks after surgery. Pain (visual analog scale), range of motion and grip strength were measured by a blinded assessor. Results38 patients (mean age 71 years, 31 women) were randomized at surgery (19 to each group). Mean operating time was shorter for wrist-bridging fixation by 10 (95% CI 317) min. There was no significant difference in DASH scores between the groups. No statistically significant differences in pain score, range of motion, grip strength, or patient satisfaction were found. The non-bridging group had a significantly better radial length at 52 weeks; mean difference in change in ulnar variance from baseline was 1.4 (95% CI 0.12.7) mm (p = 0.04). Volar tilt and radial inclination were similar in both groups. InterpretationFor moderately or severely displaced distal radius fractures in the elderly, non-bridging external fixation had no clinically relevant advantage over wrist-bridging fixation but was more effective in maintaining radial length. Background Non-bridging external fixation has been introduced to achieve better fracture fixation and functional outcomes in distal radius fractures, but has not been specifically evaluated in a randomized study in the elderly. The purpose of this trial was to compare wrist-bridging and non-bridging external fixation for displaced distal radius fractures. Method The inclusion criteria were women ≥ 50 or men ≥ 60 years, acute extraarticular or intraarticular fracture, and dorsal angulation of ≥ 20 or ulnar variance ≥ 5 mm. The patients completed the disabilities of the arm, shoulder and hand (DASH) questionnaire before and at 10, 26 and 52 weeks after surgery. Pain (visual analog scale), range of motion and grip strength were measured by a blinded assessor. Results 38 patients (mean age 71 years, 31 women) were randomized at surgery (19 to each group). Mean operating time was shorter for wrist-bridging fixation by 10 (95% CI 3-17) min. There was no significant difference in DASH scores between the groups. No statistically significant differences in pain score, range of motion, grip strength, or patient satisfaction were found. The non-bridging group had a significantly better radial length at 52 weeks; mean difference in change in ulnar variance from baseline was 1.4 (95% CI 0.1-2.7) mm (p = 0.04). Volar tilt and radial inclination were similar in both groups. Interpretation For moderately or severely displaced distal radius fractures in the elderly, non-bridging external fixation had no clinically relevant advantage over wrist-bridging fixation but was more effective in maintaining radial length. ■ Wrist-bridging external fixation has been a common treatment method for displaced distal radius fractures (, ) and is supported by evidence of efficacy (Handoll and Madhok 2003). Because of concern about possible adverse effects of wrist immobilization and distraction, the use of non-bridging external fixation, previously described in a small number of reports (Forgon and Mammel 1981,,, has increased and new fixators have been introduced (,, McQueen 1998,,. Non-bridging fixation may facilitate better fracture reduction and secure fixation, and may accelerate functional recovery and improve wrist motion. No randomized study has been performed previously to evaluate nonbridging external fixation for distal radius fracture in the elderly. In this randomized clinical trial, we compared wrist-bridging and non-bridging external fixation for moderately or severely displaced distal radius fractures using patient-reported outcomes as primary outcome measure, and clinical and radiographic variables as secondary outcome measures. Eligibility criteria The inclusion criteria were women 50 years or older or men 60 years or older, acute dorsally displaced distal radius fracture that is extraarticular or intraarticular with at least 2 large articular fragments, and dorsal angulation of ≥ 20 degrees (measured from neutral) and/or radial shortening (ulnar variance) of ≥ 5 mm. The exclusion criteria were articular stepoff > 2 mm, fracture of the ulna proximal to the styloid, additional fractures in the same or contralateral arm, nerve or tendon injuries, multiple injuries, high-energy trauma (such as motor vehicle accident or fall from a height), previous fracture in the injured radius, inflammatory joint disease, cerebrovascular disease or other severe medical illness, inability to give written informed consent or to complete questionnaires because of cognitive disorder or language problems, and abuse of drugs or alcohol. The regional ethics committee approved the study (LU53-98). Recruitment and randomization Patients were recruited among those who attended the emergency department because of distal radius fracture. Before enrollment all patients gave informed consent. In the operating room, the patients were assigned to a treatment group according to sequentially opened sealed envelopes based on a computer-generated randomization list. Interventions Regional or general anesthesia and intraoperative fluoroscopy was used. For wrist-bridging fixation, we used the Hoffmann external fixator (Stryker, Mahwah, NJ). Through small incisions, 2 longitudinally parallel 3-mm pins were inserted in the radius proximal to the fracture and 2 pins were similarly inserted in the second metacarpal. Closed fracture reduction was performed and the instrument was locked. No additional fixation was used. For the non-bridging external fixation we used the Hoffmann II Compact external fixator (Stryker, Mahwah, NJ) ( Figure 1). Through small incisions, 2 longitudinally parallel pins were inserted in the radius proximal to the fracture. For pin insertion in the distal fragment, a transverse incision was used in the first 10 patients and 2 longitudinal incisions (one on each side of Lister's tubercle) were used in the remaining patients. The extensor pollicis longus (EPL) tendon was identified. After drilling, 2 transversely parallel 3-mm pins were inserted in the distal fragment parallel to the joint surface. The aim was to place the pins in the subchondral bone. Manipulation of the distal fragment with the pins was done to reduce the fracture. The periarticular pin clamp was applied and the instrument was locked (Figure 2). No additional fixation was used. All patients received Flucloxacillin 750 mg twice daily for 10 days. Patients were instructed on early motion exercises of the fingers, wrist (nonbridging group), elbow and shoulder. The duration of external fixation was 6 weeks, after which the patients were referred to physiotherapists for range of motion and strengthening exercises aimed at restoring normal hand and wrist function. Therapy continued until the aim had been achieved or no further improvement was expected. Outcome measures In the emergency room, the patients completed the disabilities of the arm, shoulder and hand (DASH) questionnaire (inquired about arm disability and symptoms during the week before injury), the SF-12 health status and quality of life questionnaire, and a comorbidity questionnaire (American Academy of Orthopedic Surgeons 1998), which is a 14item questionnaire inquiring about limitation of activity caused by specific disorders (such as heart or lung disease, diabetes, and rheumatoid arthritis) and which gives a comorbidity score ranging from 0 (no comorbidity) to 100 (most severe comorbidity). Follow-up evaluations at 10, 26 and 52 weeks after surgery consisted of the DASH and SF-12 questionnaires, pain rating, and range of motion and grip strength measurements performed by the same physiotherapist. Radiographic examination was done at 2, 6 and 52 weeks postoperatively and once for the non-injured wrist. Primary outcome The primary outcome was the DASH 30-item disability/symptom scale (,, scored from 0 (no disability) to 100 (most severe disability). Secondary outcomes The secondary outcomes were the SF-12 physical health score, patient satisfaction, pain, motion, grip strength, radiographic variables and complications. SF-12. The physical health score is compared to norms that have a mean of 50 and standard deviation of 10 (). Patient satisfaction. The follow-up questionnaires included an item inquiring about patient satisfaction with the outcome (American Academy of Orthopedic Surgeons 1998). Pain. The patients rated the severity of wrist pain on a visual analog scale (VAS) ranging from 0 (no pain) to 100 (most severe pain). The VAS scores were recorded for pain at rest, motion-related pain and activity-related pain. Wrist motion and grip strength. Range of motion of both wrists and forearms were measured with a goniometer. Any flexion deficit in the fingers was measured. Grip strength was measured with a Jamar dynamometer (with 3 trials recorded for each hand). Radiography. A radiologist experienced in skeletal radiology, an orthopedic surgeon and a resident independently classified the type of fracture according to the AO classification. The type recorded by at least 2 of the observers was used in the analysis. The radiologist measured volar tilt of the articular surface of the radius (from neutral), radial inclination, ulnar variance, articular step-off, and fracture union. The measurements were double-checked by an resident in orthopedics. Blinding The therapist who performed the follow-up physical examinations was blinded to the surgical method, as the injured hand and forearm were covered with a thin stretchable tubular bandage. Sample size At the start of the trial we found no published distal radius fracture studies that had used the DASH. As variables. Mixed-model analysis was performed on repeated measures of the outcome variables to compare the 2 groups regarding the change over time for each variable. For the variables that were measured before surgery (DASH, SF-12, and radiographic variables) the mixed-model analysis provided the between-group difference and 95% confidence intervals in change from baseline to 10 weeks, 26 weeks and 52 weeks after surgery. For the variables that were first measured at 10 weeks postoperatively, the changes from 10 weeks to 26 weeks and 52 weeks were compared. Age, sex, comorbidity score, and fracture AO type were included in the model. The mixed-model analysis has the important advantage of including subjects with incomplete data. Responses to the patient satisfaction item were dichotomized into (very/rather satisfied vs. neutral or rather/very dissatisfied) and the 2 groups were compared with Fisher's exact test. All analyses were done on an intention-totreat basis. A p-value of less than 0.05 was used as an indicator of statistical significance. Study population From March 1998 through March 2002, 38 patients were enrolled and randomized, with 19 patients assigned to each group (Figure 3). No patients were excluded after enrollment. 2 patients (woman of 73 years, non-bridging group; woman of 81 years, bridging group) declined follow-up at 52 weeks because of illness. At enrollment, the 2 groups were similar in terms of patient characteristics and preoperative scores but there were fewer type C fractures in the non-bridging group (Table 1). Surgery and operating time All operations were done within 4 days of injury. The mean (SD) operating time for wrist-bridging fixation was 27 min, and for non-bridging fixation it was 37 min. The mean difference (95% CI) was 10 min (p < 0.01). an indicator of the adequacy of the sample size in detecting clinically important differences, we present the 95% confidence intervals for the DASH disability/symptom score differences between the 2 groups (). The minimal clinically important difference for the DASH score has been estimated to be 10 points (). Statistics The VAS scores for motionrelated pain and activityrelated pain were averaged because few patients had pain at rest. The independent t-test was used to compare the 2 groups regarding operating time, DASH, SF-12 and pain VAS scores, range of motion, grip strength and radiographic DASH No statistically significant differences in the mean DASH scores or in mean score changes over time were found between the 2 groups at any followup evaluation (Table 2). For both groups, the mean DASH score recorded at 10 weeks had improved at 52 weeks to almost pre-injury level. Pain No statistically significant differences in the mean pain VAS scores were found between the 2 groups at any follow-up evaluation (Table 2). At 10 weeks postoperatively, the mean pain score was worse for the wrist-bridging group than for the non-bridging group but the difference was not statistically significant. The wrist-bridging group had a signifi- For number of patients at each follow-up, see Figure 3 (pain was assessed at physical examination). a Mixed-model analysis comparing the 2 groups (adjusting for age, sex, comorbidity, and fracture type). b Score range 0 (no disability) to 100 (most severe disability). c Population norm, mean 50 and standard deviation 10. d Visual analog scale (VAS), range 0 (no pain) to 100 (most severe pain). SF-12 The wrist-bridging group had a significantly greater worsening of the mean SF-12 physical health score from baseline to 10 weeks (Table 2). No statistically significant differences were found between the 2 groups at any of the other follow-up evaluations, or in changes over time. Patient satisfaction No significant difference in patient satisfaction was found at any follow-up time. At 52 weeks, 16 patients in the wrist-bridging group were very/rather satisfied, 2 were neutral, and none were dissatisfied, as compared to 14, 2, and 2 patients, respectively, in the non-bridging group. cantly greater decrease in mean pain score from 10 weeks to 26 and 52 weeks. No pain at 52 weeks was reported by 11 patients in each group. Range of motion No statistically significant differences between the 2 groups were found in any range of motion variable on any of the follow-up occasions, or in changes over time (Table 3). Wrist flexion and extension and forearm pronation and supination improved significantly over time, mainly between the 10-week and the 26-week evaluations. Grip strength The differences in mean grip strength between the 2 groups (Table 3) and the differences in mean change in grip strength over time were not statistically significant (p > 0.1). For both groups, grip strength improved from 10 weeks to 26 weeks postoperatively by an average of 7 kg, and to 52 weeks postoperatively by an average of 10 kg (p < 0.001). Radiography Possible previous distal radius fracture of the injured wrist (not remembered by the patient) was reported by the radiologist in 3 patients in the wrist-bridging group. These patients were analyzed in their assigned group (intention-to-treat principle), but analysis excluding them gave similar results. None of the radiographic variables differed between the 2 groups before surgery (Table 4). At 52 weeks, the non-bridging group had significantly better radial length. In the mixed-model analysis, the mean difference between the groups in change in ulnar variance from baseline to 52 weeks was 1.4 (95% CI 0.1-2.7) mm (p = 0.04). No significant differences in volar tilt or radial inclination were found between the groups. All fractures healed, none of them with articular step-off exceeding 1 mm. Complications One patient (wrist-bridging) fell during the fixation period and sustained a hip fracture; no immediate radiographic examination of the arm was done but follow-up radiographic evaluation showed a healed fracture of the radius at a proximal pin site. Another patient (wrist-bridging) had a fracture of the second metacarpal after fixator removal; the fracture healed after splinting. A patient (wristbridging) whose radiographic examination 8 days postoperatively was judged by a surgeon (not involved in the trial) as fracture displacement, underwent a second closed reduction and addition of a percutaneous pin. Pin site infection (skin redness and discharge) was recorded in 6 patients in the wrist-bridging group and 9 patients in the non-bridging group (p = 0.3); all were diagnosed within 2 weeks of surgery and treated with antibiotics. No deep infections occurred. Numbness in the median nerve distribution was reported similarly in both groups, but no patient had surgery for carpal tunnel syndrome. 1 patient (wrist-bridging) had transient numbness in the radial sensory nerve distribution. No tendon rupture or complex regional pain syndrome was diagnosed. Discussion This randomized clinical trial compared wristbridging and non-bridging external fixation mainly in older patients with displaced distal radius fractures, and we found no significant differences in patient-reported symptom and disability outcomes. Although the sample size was relatively small with potential risk of type-2 error, the results of the DASH score (primary outcome variable) indicate that, except at 10 weeks postoperatively, a larger sample would likely not show a clinically important difference (10 points) in favor of non-bridging fixation. The limit of the 95% confidence interval for the difference in mean DASH score that may favor non-bridging fixation at 26 weeks was only 2 points, and 4 points at 52 weeks. The corresponding limits for the difference in change from baseline were 3 and 5 points, respectively. A larger sample might in fact show a clinically relevant difference in DASH score in favor of wrist-bridging fixation. The non-bridging group had significantly better SF-12 physical health score (change from baseline) and a somewhat lower pain score at 10 weeks postoperatively, which might suggest a possible advantage in the early postoperative period. The DASH score is a measure of disability, with only 2 pain items. Possibly, the difference in pain at this stage was not large enough to have an effect on arm-related disability. In the wrist-bridging group, 3 patients had early complications (metacarpal fracture, repeat surgery, and radius shaft and hip fracture) that might have affected the 10-week comparison. The range of motion in wrist and forearm was almost identical in both groups as early as 4 weeks after fixator removal. The motion obtained during non-bridging fixation did not accelerate recovery as compared to 6-week wrist immobilization. Grip strength was better in the non-bridging group, but the difference was not statistically significant and did not translate into less disability. Radial shortening was significantly less with non-bridging fixation at 52 weeks. Although the difference in radial shortening was not associated with any differences in symptoms or function in this patient population, its long-term clinical significance should be evaluated. Distal radio-ulnar joint disorders after radius fractures may cause residual ulnar wrist pain, and the ability of nonbridging fixation in maintaining radial length may prove to be more important in a younger patient population. Our study is the first randomized trial to compare bridging and non-bridging external fixation with the Hoffmann fixator in the elderly. The 2 previous randomized studies that compared bridging and non-bridging fixation used different fixators and included many younger patients (McQueen 1998,. Also, the first study involved mainly extraarticular fractures that had become displaced within 2 weeks after initial reduction and splinting, while the second involved almost only severe intraarticular fractures. The 2 previous studies did not use validated measures of patient-reported outcomes or blinded assessment. Based on the overall results of the 3 randomized studies, however, non-bridging fixation does not seem to give better results regarding disability and pain, or to result in clinically important differences in wrist motion. Rupture of the EPL tendon, an uncommon complication, occurred only with non-bridging fixation (McQueen 1998,. Other surgeons might choose methods other than external fixation to treat the fractures included in our study. Percutaneous pinning has yielded similar results when compared to non-bridging external fixation in extraarticular fractures (, and to wrist-bridging fixation in intraarticular fractures (). In patients with displaced intraarticular fractures (mean age 40, 109/179 males), external fixation gave better results than volar or dorsal plating 6 months postoperatively (musculoskeletal functional assessment questionnaire), but similar results at 1 year (). External fixation is a relatively simple procedure, and in our study it yielded good results regarding pain and arm function. Wrist-bridging fixation was effective in maintaining the volar tilt achieved after closed reduction, but failed to maintain radial length at 1 year. It is possible that closed reduction and splinting could have given similar results in this age group. Although only half of the fractures were intraarticular, all had a degree of initial displacement shown to be associated with a high probability of instability ()which is why primary external fixation was considered appropriate. The lack of a clear clinically relevant advantage does not support non-bridging fixation instead of bridging fixation for older patients with distal radius fracture. Contributions of authors IA contributed to study conception and design, analysis and interpretation of data and drafting of the manuscript; GUL and MH participated in design and conduction of the study, acquisition of data and critical revision of the manuscript; EB and AMB participated in acquisition of data; JK participated in study conduction.
<reponame>emilioschiavi/european-football<filename>app/src/main/java/nf/co/emilianku/europeanfootbal/gui/competitions/viewmodels/CompetitionViewModel.java package nf.co.emilianku.europeanfootbal.gui.competitions.viewmodels; import nf.co.emilianku.domain.model.Competition; /** * Created by emilio on 25.04.17. */ public class CompetitionViewModel { private final Competition competition; public CompetitionViewModel(Competition competition) { this.competition = competition; } public int getId() { return competition.getId(); } public String getCaption() { return competition.getCaption(); } }
Production and characterization of monoclonal antibodies against an avian group A rotavirus. Fifteen monoclonal antibodies (MAbs) against an avian group A rotavirus were cloned and characterized. Eight of the 15 MAbs had neutralizing activity (N-MAbs). Five of the N-MAbs (1G1, 5B8, 4E2, 3G1, 2E3) were VP4-specific by radioimmunoprecipitation assay (RIPA), and two N-MAbs (2D11, 6E8) were possibly VP7-specific (faint bands by RIPA). One N-MAb (4H12) of undefined protein specificity cross-reacted with serotype 3 simian rotaviruses. The other seven N-MAbs did not cross-react with any of the eight distinct serotypes of human and mammalian rotaviruses tested. Of the seven non-neutralizing MAbs, three were VP6-specific (3H10, 4B12, 5F6), two were VP8-specific (6C9, 1D1), one was VP4-specific (4E9), and one was of undefined protein specificity (1B11). Four non-neutralizing MAbs recognized only avian group A rotavirus in cell-culture immunofluorescence tests (6C9, 1D1, 4E9 and 5F6), whereas two MAbs (3H10 and 4B12) cross-reacted with all human and animal rotaviruses tested. The MAb 1B11 did not recognize any human rotavirus serotypes but cross-reacted with all nonhuman animal rotavirus serotypes. The MAbs produced in this study should be useful for the detection and further characterization of avian group A rotaviruses.
Plasma processing is commonly used for many semiconductor fabrication processes for manufacturing integrated circuits, flat-panel displays, magnetic media, and other devices. A plasma, or ionized gas, is generated inside a processing chamber by application of an electromagnetic field to a low-pressure gas in the chamber, and then applied to a workpiece to accomplish a process such as deposition, etching, or implantation. The plasma may also be generated outside the chamber and then directed into the chamber under pressure to increase the ratio of radicals to ions in the plasma for processes needing such treatments. Plasma may be generated by electric fields, by magnetic fields, or by electromagnetic fields. Plasma generated by an electric field normally uses spaced-apart electrodes to generate the electric field in the space occupied by the gas. The electric field ionizes the gas, and the resulting ions and electrons move toward one electrode or the other under the influence of the electric field. The electric field can impart very high energies to ions impinging on the workpiece, which can sputter material from the workpiece, damaging the workpiece and creating potentially contaminating particles in the chamber. Additionally, the high potentials accompanying such plasmas may create unwanted electrical discharges and parasitic currents. Inductively coupled plasmas are used in many circumstances to avoid some effects of capacitively coupled plasmas. An inductive coil is disposed adjacent to a plasma generating region of a processing chamber. The inductive coil projects a magnetic field into the chamber to ionize a gas inside the chamber. The inductive coil is frequently located outside the chamber, projecting the magnetic field into the chamber through a dielectric window. The inductive coil is frequently driven by high-frequency electromagnetic energy, which suffers power losses that rise faster than the voltage applied to the inductive coil. Thus, strong coupling of the plasma source with the plasma inside the chamber decreases power losses. Control of plasma uniformity is also improved by strong coupling between the plasma source and the plasma. As device geometry in the various semiconductor industries continues to decline, process uniformity in general and plasma uniformity in particular, becomes increasingly helpful for reliable manufacture of devices. Thus, there is a continuing need for inductive plasma processing apparatus and methods.
<filename>1014.py a=int(input()) x=float(input()) print("%.3f km/l" % (float(a)/x))
<reponame>jimjenkins5/lambda-express<gh_stars>0 // TODO: look at whether we can remove the dependency on underscore import _ from 'underscore'; import { IRouter, ProcessorOrProcessors, PathParams, RouterOptions, NextCallback, ErrorHandlingRequestProcessor, } from './interfaces'; import { IRequestMatchingProcessorChain } from './chains/ProcessorChain'; import { Request, Response } from '.'; import { wrapRequestProcessor, wrapRequestProcessors } from './utils/wrapRequestProcessor'; import { RouteMatchingProcessorChain } from './chains/RouteMatchingProcessorChain'; import { MatchAllRequestsProcessorChain } from './chains/MatchAllRequestsProcessorChain'; import { SubRouterProcessorChain } from './chains/SubRouterProcessorChain'; const DEFAULT_OPTS: RouterOptions = { caseSensitive: false, }; export default class Router implements IRouter { public readonly routerOptions: RouterOptions; private readonly _processors: IRequestMatchingProcessorChain[] = []; public constructor(options?: RouterOptions) { this.routerOptions = _.defaults(options, DEFAULT_OPTS); } // TODO: do we need `router.route`? // https://expressjs.com/en/guide/routing.html#app-route // https://expressjs.com/en/4x/api.html#router.route // If we do add it, we need to set the case-sensitivity of the sub-router it creates // using the case-sensitivity setting of this router. public handle(originalErr: unknown, req: Request, resp: Response, done: NextCallback): void { const processors = this._processors; let index = 0; const processRequest = (err: unknown, processorReq: Request, processorResp: Response, next: NextCallback): void => { let processor = processors[index]; index += 1; if (processor === undefined) { // We've looped through all available processors. return next(err); } else if (processor.matches(processorReq)) { // ^^^^ User-defined route handlers may change the request object's URL to // re-route the request to other route handlers. Therefore, we must re-check // whether the current processor matches the request object after every // processor is run. processor.run(err, processorReq, processorResp, (processorError) => { processRequest(processorError, processorReq, processorResp, next); }); } else { // Current processor does not match. Continue. processRequest(err, processorReq, processorResp, next); } }; processRequest(originalErr, req, resp, done); } /** * Mounts a sub-router to this router. In Express, this is part of the overloaded `use` * method, but we separated it out in Lambda Express to allow better type safety and * code hinting / auto-completion. */ public addSubRouter(path: PathParams, router: Router): this { // Note: this overriding of the case sensitivity of the passed-in router is likely // ineffective for most usecases because the user probably created their router and // added a bunch of routes to it before adding that router to this one. When the // routes are created (technically the `IRequestMatchingProcessorChain` objects, in // particular `RouteMatchingProcessorChain`), the case sensitivity is already set // (inherited from the router that created the chain). router.routerOptions.caseSensitive = this.routerOptions.caseSensitive; this._processors.push(new SubRouterProcessorChain(path, router)); return this; } /** * Mounts middleware, error handlers, or route handlers to a specific HTTP method and * route. Not included in standard Express, this is specific to Lambda Express. * * Note that this method creates a route-chain of all the handlers passed to it so that * they are treated as a single handler. That allows any of the handlers passed to this * method to call `next('route')` to skip to the next route handler (or route handler * chain) for this route. */ public mount(method: string | undefined, path: PathParams, ...processors: ProcessorOrProcessors[]): this { const wrapped: ErrorHandlingRequestProcessor[] = wrapRequestProcessors(_.flatten(processors)), isCaseSensitive = this.routerOptions.caseSensitive; this._processors.push(new RouteMatchingProcessorChain(wrapped, path, isCaseSensitive, method)); return this; } /** * Express-standard routing method for adding middleware and handlers that get invoked * for all routes handled by this router. */ public use(...processors: ProcessorOrProcessors[]): this { _.each(_.flatten(processors), (rp: ErrorHandlingRequestProcessor) => { this._processors.push(new MatchAllRequestsProcessorChain([ wrapRequestProcessor(rp) ])); }); return this; } /** * Express-standard routing method for adding handlers that get invoked regardless of * the request method (e.g. `OPTIONS`, `GET`, `POST`, etc) for a specific path (or set * of paths). */ public all(path: PathParams, ...processors: ProcessorOrProcessors[]): this { return this.mount(undefined, path, ...processors); } /** * Express-standard routing method for `HEAD` requests. */ public head(path: PathParams, ...processors: ProcessorOrProcessors[]): this { return this.mount('HEAD', path, ...processors); } /** * Express-standard routing method for `GET` requests. */ public get(path: PathParams, ...processors: ProcessorOrProcessors[]): this { return this.mount('GET', path, ...processors); } /** * Express-standard routing method for `POST` requests. */ public post(path: PathParams, ...processors: ProcessorOrProcessors[]): this { return this.mount('POST', path, ...processors); } /** * Express-standard routing method for `PUT` requests. */ public put(path: PathParams, ...processors: ProcessorOrProcessors[]): this { return this.mount('PUT', path, ...processors); } /** * Express-standard routing method for `DELETE` requests. */ public delete(path: PathParams, ...processors: ProcessorOrProcessors[]): this { return this.mount('DELETE', path, ...processors); } /** * Express-standard routing method for `PATCH` requests. */ public patch(path: PathParams, ...processors: ProcessorOrProcessors[]): this { return this.mount('PATCH', path, ...processors); } /** * Express-standard routing method for `OPTIONS` requests. */ public options(path: PathParams, ...processors: ProcessorOrProcessors[]): this { return this.mount('OPTIONS', path, ...processors); } }
Pneumatosis Cystoides Intestinalis after Cetuximab Chemotherapy for Squamous Cell Carcinoma of Parotid Gland Pneumatosis intestinalis, defined as gas in the bowel wall, is often first identified on abdominal radiographs or computed tomography (CT) scans. It is a radiographic finding and not a diagnosis, as the etiology varies from benign conditions to fulminant gastrointestinal disease. We report here a case of pneumatosis intestinalis associated with cetuximab therapy for squamous cell carcinoma of head and neck. The patient underwent laparotomy based on the CT scan and the result was pneumatosis intestinalis without any signs of necrotizing enterocolitis. Introduction Cetuximab is a chemotherapeutic agent that belongs to the group of chimeric monoclonal antibodies of epidermal growth factor receptor (EGFR) and has a significant role in clinical oncology regimens. Its action involves binding with high affinity to the extracellular domain of human EGFR and blocking ligand binding, resulting in the inhibition of the receptor function. Its action includes furthermore the targeting of EGFR-expressing tumor cells for cytotoxic immune cells. With regard to head and neck cancer, the sixth most common cancer worldwide (5% of all malignancies), cetuximab has a major role since EGFR is almost invariably expressed in squamous cell cancers of head and neck (SCCHN) and this overexpression is associated with more aggressive disease and poorer prognosis. Cetuximab has been evaluated in combination with radiotherapy, chemoradiotherapy, and induction chemotherapies and was found to be superior without significantly raising the toxicity level of the combined treatment. More specifically cetuximab was found to improve overall survival, progression-free survival, and time to local recurrence when compared to radiotherapy alone in cases of locally advanced squamous cell carcinoma of head and neck (LA SCCHN). It can be used in combination with radiation therapy for the initial treatment of locally or regionally advanced squamous cell carcinoma of head and neck or in combination with platinum-based therapy with 5-FU for the first-line treatment of patients with recurrent locoregional disease or metastatic squamous cell carcinoma of head and neck. As a single agent, is indicated for the treatment of patients with recurrent or metastatic squamous cell carcinoma of head and neck for whom prior platinum-based therapy has failed. We report a case of pneumatosis cystoides intestinalis (PCI) in a patient who received first-line adjuvant chemotherapy with 5-FU and cisplatin followed by second line chemotherapy with Methotrexate after undergoing an extensive regional R1-resection of a SCC lesion on his right ear followed by parotidectomy and level II lymph node resection due to relapse of SCC to the right parotid gland. The patient during this period receives only cetuximab therapy and there are only three more cases of cetuximabinduced or cetuximab-related PCI (in combination with other chemotherapeutic agents) that have been reported in the literature, during chemotherapy for advanced colorectal cancer. Case Report An 83-year-old male underwent an extensive regional R1resection for a SCC lesion on his right ear and reconstruction with removable skin flap in 2012, followed by parotidectomy six months later and level II lymph node resection due to relapse of the SCC to the right parotid gland. He received an adjuvant first-line chemotherapy and radiotherapy (9 cycles) with 5-FU, cisplatin and second line chemotherapy with Methotrexate 8 mg weekly, with initial good response to treatment. Unfortunately, a few months later his disease started to progress. The patient is now on chemotherapy with cetuximab (last dose 36 hours ago), without any distal metastases but with regional outspread of the disease to his right ear and mandible. The patient presented to the Emergency Department of Nicosia General Hospital with epigastric pain and vomiting during the last five days, without bloody stools. The patient was afebrile, with mild abdominal distention and without peritoneal signs. Leukocytes, amylase, and lactic acid were all within the normal ranges. Abdominal radiograph revealed free air intraperitoneally and abdominal/pelvic computed tomography revealed findings of small bowel ischemic necrosis in the presence of free intraperitoneal air and air in the intestinal wall (Figure 1). The clinical suspicion of bowel perforation was part of the differential diagnosis and the decision of an emergency surgical operation was made. Emergency exploratory laparotomy revealed a part of small intestine (2 m) with ischemic signs, including air bubbles and bowel edema but the bowel was considered to be viable and no resection was performed. Thorough exploration of peritoneal cavity did not reveal any other pathological signs or intestinal leak. We concluded that the findings could only be associated with the pathogenesis of pneumatosis intestinalis. Two drainage tubes were placed and the patient was sent to ICU for postsurgery follow-up and weaning. After 24 hours the patient was transferred to surgical ward for further treatment. After six days of hospitalization and complete resolution of symptoms the patient was discharged. Discussion The pathogenesis of pneumatosis intestinalis remains unclear, but the process may involve loss of mucosal integrity, increased intraluminal pressure, and finally increased intraluminal gas production as a result of bacterial overgrowth. Various predisposing factors have been reported associated with pneumatosis intestinalis, including trauma, inflammatory diseases, autoimmune diseases, pulmonary causes, celiac disease, leukemia, amyloidosis, and last drugs. Our patient had no known risk factors other than administration of chemotherapy with cetuximab. Pneumatosis intestinalis occurs in two forms. Primary pneumatosis intestinalis (15% of cases) is a benign idiopathic condition in which multiple thin-walled cysts develop in the submucosa or subserosa of the colon. Usually, this form has no associated symptoms, and the cysts may be found incidentally through radiography or endoscopy. When the cysts protrude into the lumen, they may mimic polyps or carcinomas, as shown on barium enema studies. This primary form is often termed pneumatosis cystoides intestinalis. The secondary form is associated with obstructive pulmonary disease, as well as with obstructive and necrotic gastrointestinal disease. Microvesicular gas collections, defined as 10-100 mm cysts or bubbles within the lamina propria, are predominantly associated with primary (benign) pneumatosis intestinalis, whereas linear or curvilinear gas collections seen parallel to the bowel wall are found in secondary pneumatosis. Therefore, linear gas collections are usually an ominous sign ( Figure 2). Our patient had no signs of peritonitis symptoms and pneumatosis intestinalis was found during CT scan. This finding suggests the need for careful clinical follow-up and a high level of suspicion of pneumatosis intestinalis for these patients and a less aggressive approach as concern of surgery. The possibility of bowel perforation and the resulting sepsis was the significant factor that worried us and led to the decision of operation. Surgery should only be performed in patients who are not responding to nonoperative treatment, especially those with signs of perforation, peritonitis, or abdominal sepsis. Some authors suggest that metabolic acidosis, elevated lactic acid, elevated amylase, and portal vein gas should be considered as indications for surgery. Conclusion We experienced a rare case of pneumatosis intestinalis following chemotherapy with cetuximab agent. Although this emergency condition leads us to surgery, a more conservative approach could be the initial treatment for these patients.
#pragma GCC push_options #pragma GCC optimize ("Os") #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" /****************************************************************************/ /* */ /* Module: jbimain.c */ /* */ /* Copyright (C) Altera Corporation 1998-2001 */ /* */ /* Description: Jam STAPL ByteCode Player (Interpreter) */ /* */ /* Revisions: 2.2 fixed /W4 warnings */ /* 2.0 added support for STAPL ByteCode format */ /* */ /****************************************************************************/ #include "jbiport.h" #include "jbiexprt.h" #include "jbijtag.h" #include "jbicomp.h" /****************************************************************************/ /* */ /* MACROS */ /* */ /****************************************************************************/ #define NULL 0 #define JBI_STACK_SIZE 128 #define JBIC_MESSAGE_LENGTH 1024 /* * This macro checks if enough parameters are available on the stack. The * argument is the number of parameters needed. */ #define IF_CHECK_STACK(x) \ if (stack_ptr < (int) (x)) \ { \ status = JBIC_STACK_OVERFLOW; \ } \ else /* * This macro checks if a code address is inside the code section */ #define CHECK_PC \ if ((pc < code_section) || (pc >= debug_section)) \ { \ status = JBIC_BOUNDS_ERROR; \ } /****************************************************************************/ /* */ /* GLOBAL VARIABLES */ /* */ /****************************************************************************/ #if PORT==DOS /* * jbi_program is a global pointer used by macros GET_BYTE, GET_WORD, and * GET_DWORD to read data from the JBC file */ PROGRAM_PTR jbi_program; #endif /****************************************************************************/ /* */ /* UTILITY FUNCTIONS */ /* */ /****************************************************************************/ int jbi_strlen(char *string) { int len = 0; while (string[len] != '\0') ++len; return (len); } long jbi_atol(char *buffer) { long result = 0L; int index = 0; while ((buffer[index] >= '0') && (buffer[index] <= '9')) { result = (result * 10) + (buffer[index] - '0'); ++index; } return (result); } void jbi_ltoa(char *buffer, long number) { int index = 0; int rev_index = 0; char reverse[32]; if (number < 0L) { buffer[index++] = '-'; number = 0 - number; } else if (number == 0) { buffer[index++] = '0'; } while (number != 0) { reverse[rev_index++] = (char) ((number % 10) + '0'); number /= 10; } while (rev_index > 0) { buffer[index++] = reverse[--rev_index]; } buffer[index] = '\0'; } char jbi_toupper(char ch) { return ((char) (((ch >= 'a') && (ch <= 'z')) ? (ch + 'A' - 'a') : ch)); } int jbi_stricmp(char *left, char *right) { int result = 0; char l, r; do { l = jbi_toupper(*left); r = jbi_toupper(*right); result = l - r; ++left; ++right; } while ((result == 0) && (l != '\0') && (r != '\0')); return (result); } void jbi_strncpy(char *left, char *right, int count) { char ch; do { *left = *right; ch = *right; ++left; ++right; --count; } while ((ch != '\0') && (count != 0)); } void jbi_make_dword(unsigned char *buf, unsigned long num) { buf[0] = (unsigned char) num; buf[1] = (unsigned char) (num >> 8L); buf[2] = (unsigned char) (num >> 16L); buf[3] = (unsigned char) (num >> 24L); } unsigned long jbi_get_dword(unsigned char *buf) { return (((unsigned long) buf[0]) | (((unsigned long) buf[1]) << 8L) | (((unsigned long) buf[2]) << 16L) | (((unsigned long) buf[3]) << 24L)); } /****************************************************************************/ /* */ JBI_RETURN_TYPE jbi_execute ( PROGRAM_PTR program, long program_size, char *workspace, long workspace_size, char *action, char **init_list, int reset_jtag, long *error_address, int *exit_code, int *format_version ) /* */ /* Description: */ /* */ /* Returns: */ /* */ /****************************************************************************/ { JBI_RETURN_TYPE status = JBIC_SUCCESS; unsigned long first_word = 0L; unsigned long action_table = 0L; unsigned long proc_table = 0L; unsigned long string_table = 0L; unsigned long symbol_table = 0L; unsigned long data_section = 0L; unsigned long code_section = 0L; unsigned long debug_section = 0L; unsigned long action_count = 0L; unsigned long proc_count = 0L; unsigned long symbol_count = 0L; char message_buffer[JBIC_MESSAGE_LENGTH + 1]; long *variables = NULL; long *variable_size = NULL; char *attributes = NULL; unsigned char *proc_attributes = NULL; unsigned long pc; unsigned long opcode_address; unsigned long args[3]; unsigned int opcode; unsigned long name_id; long stack[JBI_STACK_SIZE] = {0}; unsigned char charbuf[4]; long long_temp; unsigned int variable_id; unsigned char *charptr_temp; unsigned char *charptr_temp2; long *longptr_temp; int version = 0; int delta = 0; int stack_ptr = 0; unsigned int arg_count; int done = 0; int bad_opcode = 0; unsigned int count; unsigned int index; unsigned int index2; long long_count; long long_index; long long_index2; unsigned int i; unsigned int j; unsigned long uncompressed_size; unsigned int offset; unsigned long value; int current_proc = 0; char *equal_ptr; int length; int reverse; #if PORT==DOS char name[33]; #else char *name; #endif jbi_workspace = workspace; jbi_workspace_size = workspace_size; #if PORT==DOS jbi_program = program; #endif /* * Read header information */ if (program_size > 52L) { first_word = GET_DWORD(0); version = (int) (first_word & 1L); *format_version = version + 1; delta = version * 8; action_table = GET_DWORD(4); proc_table = GET_DWORD(8); string_table = GET_DWORD(4 + delta); symbol_table = GET_DWORD(16 + delta); data_section = GET_DWORD(20 + delta); code_section = GET_DWORD(24 + delta); debug_section = GET_DWORD(28 + delta); action_count = GET_DWORD(40 + delta); proc_count = GET_DWORD(44 + delta); symbol_count = GET_DWORD(48 + (2 * delta)); } if ((first_word != 0x4A414D00L) && (first_word != 0x4A414D01L)) { done = 1; status = JBIC_IO_ERROR; } if ((status == JBIC_SUCCESS) && (symbol_count > 0)) { variables = (long *) jbi_malloc( (unsigned int) symbol_count * sizeof(long)); if (variables == NULL) status = JBIC_OUT_OF_MEMORY; if (status == JBIC_SUCCESS) { variable_size = (long *) jbi_malloc( (unsigned int) symbol_count * sizeof(long)); if (variable_size == NULL) status = JBIC_OUT_OF_MEMORY; } if (status == JBIC_SUCCESS) { attributes = (char *) jbi_malloc((unsigned int) symbol_count); if (attributes == NULL) status = JBIC_OUT_OF_MEMORY; } if ((status == JBIC_SUCCESS) && (version > 0)) { proc_attributes = (unsigned char *) jbi_malloc((unsigned int) proc_count); if (proc_attributes == NULL) status = JBIC_OUT_OF_MEMORY; } if (status == JBIC_SUCCESS) { delta = version * 2; for (i = 0; i < (unsigned int) symbol_count; ++i) { offset = (unsigned int) (symbol_table + ((11 + delta) * i)); value = GET_DWORD(offset + 3 + delta); attributes[i] = GET_BYTE(offset); /* use bit 7 of attribute byte to indicate that this buffer */ /* was dynamically allocated and should be freed later */ attributes[i] &= 0x7f; variable_size[i] = GET_DWORD(offset + 7 + delta); /* * Attribute bits: * bit 0: 0 = read-only, 1 = read-write * bit 1: 0 = not compressed, 1 = compressed * bit 2: 0 = not initialized, 1 = initialized * bit 3: 0 = scalar, 1 = array * bit 4: 0 = Boolean, 1 = integer * bit 5: 0 = declared variable, * 1 = compiler created temporary variable */ if ((attributes[i] & 0x0c) == 0x04) { /* initialized scalar variable */ variables[i] = value; } else if ((attributes[i] & 0x1e) == 0x0e) { /* initialized compressed Boolean array */ #if PORT==DOS /* for DOS port, get the size but do not uncompress */ long_index = data_section + value; uncompressed_size = (((unsigned long) GET_BYTE(long_index)) | (((unsigned long) GET_BYTE(long_index + 1L)) << 8L) | (((unsigned long) GET_BYTE(long_index + 2L)) << 16L) | (((unsigned long) GET_BYTE(long_index + 3L)) << 24L)); variable_size[i] = uncompressed_size; #else uncompressed_size = jbi_get_dword( &program[data_section + value]); /* allocate a buffer for the uncompressed data */ variables[i] = (long) jbi_malloc(uncompressed_size); if (variables[i] == 0L) { status = JBIC_OUT_OF_MEMORY; } else { /* set flag so buffer will be freed later */ attributes[i] |= 0x80; /* uncompress the data */ if (jbi_uncompress( &program[data_section + value], variable_size[i], (unsigned char *) variables[i], uncompressed_size, version) != uncompressed_size) { /* decompression failed */ status = JBIC_IO_ERROR; } else { variable_size[i] = uncompressed_size * 8L; } } #endif } else if ((attributes[i] & 0x1e) == 0x0c) { /* initialized Boolean array */ #if PORT==DOS /* flag attributes so that memory is freed */ attributes[i] |= 0x80; if (variable_size[i] > 0) { unsigned int size = (unsigned int) ((variable_size[i] + 7L) / 8L); variables[i] = (long) jbi_malloc(size); if (variables[i] == NULL) { status = JBIC_OUT_OF_MEMORY; } else { unsigned char *p = (unsigned char *) variables[i]; /* copy array values into buffer */ for (j = 0; j < size; ++j) { p[j] = GET_BYTE(data_section + value + j); } } } else { variables[i] = 0; } #else variables[i] = value + data_section + (long) program; #endif } else if ((attributes[i] & 0x1c) == 0x1c) { /* initialized integer array */ variables[i] = value + data_section; } else if ((attributes[i] & 0x0c) == 0x08) { /* uninitialized array */ /* flag attributes so that memory is freed */ attributes[i] |= 0x80; if (variable_size[i] > 0) { unsigned int size; if (attributes[i] & 0x10) { /* integer array */ size = (unsigned int) (variable_size[i] * sizeof(long)); } else { /* Boolean array */ size = (unsigned int) ((variable_size[i] + 7L) / 8L); } variables[i] = (long) jbi_malloc(size); if (variables[i] == NULL) { status = JBIC_OUT_OF_MEMORY; } else { /* zero out memory */ for (j = 0; j < size; ++j) { ((unsigned char *)(variables[i]))[j] = 0; } } } else { variables[i] = 0; } } else { variables[i] = 0; } } } } /* * Initialize variables listed in init_list */ if ((status == JBIC_SUCCESS) && (init_list != NULL) && (version == 0)) { delta = version * 2; count = 0; while (init_list[count] != NULL) { equal_ptr = init_list[count]; length = 0; while ((*equal_ptr != '=') && (*equal_ptr != '\0')) { ++equal_ptr; ++length; } if (*equal_ptr == '=') { ++equal_ptr; value = jbi_atol(equal_ptr); jbi_strncpy(message_buffer, init_list[count], length); message_buffer[length] = '\0'; for (i = 0; i < (unsigned int) symbol_count; ++i) { offset = (unsigned int) (symbol_table + ((11 + delta) * i)); name_id = (version == 0) ? GET_WORD(offset + 1) : GET_DWORD(offset + 1); #if PORT==DOS for (j = 0; j < 32; ++j) { name[j] = GET_BYTE(string_table + name_id + j); } name[32] = '\0'; #else name = (char *) &program[string_table + name_id]; #endif if (jbi_stricmp(message_buffer, name) == 0) { variables[i] = value; } } } ++count; } } if (status != JBIC_SUCCESS) done = 1; jbi_init_jtag(); pc = code_section; message_buffer[0] = '\0'; /* * For JBC version 2, we will execute the procedures corresponding to * the selected ACTION */ if (version > 0) { if (action == NULL) { status = JBIC_ACTION_NOT_FOUND; done = 1; } else { int action_found = 0; for (i = 0; (i < action_count) && !action_found; ++i) { name_id = GET_DWORD(action_table + (12 * i)); #if PORT==DOS for (j = 0; j < 32; ++j) { name[j] = GET_BYTE(string_table + name_id + j); } name[32] = '\0'; #else name = (char *) &program[string_table + name_id]; #endif if (jbi_stricmp(action, name) == 0) { action_found = 1; current_proc = (int) GET_DWORD(action_table + (12 * i) + 8); } } if (!action_found) { status = JBIC_ACTION_NOT_FOUND; done = 1; } } if (status == JBIC_SUCCESS) { int first_time = 1; i = current_proc; while ((i != 0) || first_time) { first_time = 0; /* check procedure attribute byte */ proc_attributes[i] = (unsigned char) (GET_BYTE(proc_table + (13 * i) + 8) & 0x03); if (proc_attributes[i] != 0) { /* * BIT0 - OPTIONAL * BIT1 - RECOMMENDED * BIT6 - FORCED OFF * BIT7 - FORCED ON */ if (init_list != NULL) { name_id = GET_DWORD(proc_table + (13 * i)); #if PORT==DOS for (j = 0; j < 32; ++j) { name[j] = GET_BYTE(string_table + name_id + j); } name[32] = '\0'; #else name = (char *) &program[string_table + name_id]; #endif count = 0; while (init_list[count] != NULL) { equal_ptr = init_list[count]; length = 0; while ((*equal_ptr != '=') && (*equal_ptr != '\0')) { ++equal_ptr; ++length; } if (*equal_ptr == '=') { ++equal_ptr; jbi_strncpy(message_buffer, init_list[count], length); message_buffer[length] = '\0'; if (jbi_stricmp(message_buffer, name) == 0) { if (jbi_atol(equal_ptr) == 0) { proc_attributes[i] |= 0x40; } else { proc_attributes[i] |= 0x80; } } } ++count; } } } i = (unsigned int) GET_DWORD(proc_table + (13 * i) + 4); } /* * Set current_proc to the first procedure to be executed */ i = current_proc; while ((i != 0) && ((proc_attributes[i] == 1) || ((proc_attributes[i] & 0xc0) == 0x40))) { i = (unsigned int) GET_DWORD(proc_table + (13 * i) + 4); } if ((i != 0) || ((i == 0) && (current_proc == 0) && ((proc_attributes[0] != 1) && ((proc_attributes[0] & 0xc0) != 0x40)))) { current_proc = i; pc = code_section + GET_DWORD(proc_table + (13 * i) + 9); CHECK_PC; } else { /* there are no procedures to execute! */ done = 1; } } } message_buffer[0] = '\0'; while (!done) { opcode = (unsigned int) (GET_BYTE(pc) & 0xff); opcode_address = pc; ++pc; arg_count = (opcode >> 6) & 3; for (i = 0; i < arg_count; ++i) { args[i] = GET_DWORD(pc); pc += 4; } switch (opcode) { case 0x00: /* NOP */ /* do nothing */ break; case 0x01: /* DUP */ IF_CHECK_STACK(1) { stack[stack_ptr] = stack[stack_ptr - 1]; ++stack_ptr; } break; case 0x02: /* SWP */ IF_CHECK_STACK(2) { long_temp = stack[stack_ptr - 2]; stack[stack_ptr - 2] = stack[stack_ptr - 1]; stack[stack_ptr - 1] = long_temp; } break; case 0x03: /* ADD */ IF_CHECK_STACK(2) { --stack_ptr; stack[stack_ptr - 1] += stack[stack_ptr]; } break; case 0x04: /* SUB */ IF_CHECK_STACK(2) { --stack_ptr; stack[stack_ptr - 1] -= stack[stack_ptr]; } break; case 0x05: /* MULT */ IF_CHECK_STACK(2) { --stack_ptr; stack[stack_ptr - 1] *= stack[stack_ptr]; } break; case 0x06: /* DIV */ IF_CHECK_STACK(2) { --stack_ptr; stack[stack_ptr - 1] /= stack[stack_ptr]; } break; case 0x07: /* MOD */ IF_CHECK_STACK(2) { --stack_ptr; stack[stack_ptr - 1] %= stack[stack_ptr]; } break; case 0x08: /* SHL */ IF_CHECK_STACK(2) { --stack_ptr; stack[stack_ptr - 1] <<= stack[stack_ptr]; } break; case 0x09: /* SHR */ IF_CHECK_STACK(2) { --stack_ptr; stack[stack_ptr - 1] >>= stack[stack_ptr]; } break; case 0x0A: /* NOT */ IF_CHECK_STACK(1) { stack[stack_ptr - 1] ^= (-1L); } break; case 0x0B: /* AND */ IF_CHECK_STACK(2) { --stack_ptr; stack[stack_ptr - 1] &= stack[stack_ptr]; } break; case 0x0C: /* OR */ IF_CHECK_STACK(2) { --stack_ptr; stack[stack_ptr - 1] |= stack[stack_ptr]; } break; case 0x0D: /* XOR */ IF_CHECK_STACK(2) { --stack_ptr; stack[stack_ptr - 1] ^= stack[stack_ptr]; } break; case 0x0E: /* INV */ IF_CHECK_STACK(1) { stack[stack_ptr - 1] = stack[stack_ptr - 1] ? 0L : 1L; } break; case 0x0F: /* GT */ IF_CHECK_STACK(2) { --stack_ptr; stack[stack_ptr - 1] = (stack[stack_ptr - 1] > stack[stack_ptr]) ? 1L : 0L; } break; case 0x10: /* LT */ IF_CHECK_STACK(2) { --stack_ptr; stack[stack_ptr - 1] = (stack[stack_ptr - 1] < stack[stack_ptr]) ? 1L : 0L; } break; case 0x11: /* RET */ if ((version > 0) && (stack_ptr == 0)) { /* * We completed one of the main procedures of an ACTION. * Find the next procedure to be executed and jump to it. * If there are no more procedures, then EXIT. */ i = (unsigned int) GET_DWORD(proc_table + (13 * current_proc) + 4); while ((i != 0) && ((proc_attributes[i] == 1) || ((proc_attributes[i] & 0xc0) == 0x40))) { i = (unsigned int) GET_DWORD(proc_table + (13 * i) + 4); } if (i == 0) { /* there are no procedures to execute! */ done = 1; *exit_code = 0; /* success */ } else { current_proc = i; pc = code_section + GET_DWORD(proc_table + (13 * i) + 9); CHECK_PC; } } else IF_CHECK_STACK(1) { pc = stack[--stack_ptr] + code_section; CHECK_PC; if (pc == code_section) { status = JBIC_BOUNDS_ERROR; } } break; case 0x12: /* CMPS */ /* * Array short compare * ...stack 0 is source 1 value * ...stack 1 is source 2 value * ...stack 2 is mask value * ...stack 3 is count */ IF_CHECK_STACK(4) { long a = stack[--stack_ptr]; long b = stack[--stack_ptr]; long_temp = stack[--stack_ptr]; count = (unsigned int) stack[stack_ptr - 1]; if ((count < 1) || (count > 32)) { status = JBIC_BOUNDS_ERROR; } else { long_temp &= ((-1L) >> (32 - count)); stack[stack_ptr - 1] = ((a & long_temp) == (b & long_temp)) ? 1L : 0L; } } break; case 0x13: /* PINT */ /* * PRINT add integer * ...stack 0 is integer value */ IF_CHECK_STACK(1) { jbi_ltoa(&message_buffer[jbi_strlen(message_buffer)], stack[--stack_ptr]); } break; case 0x14: /* PRNT */ /* * PRINT finish */ jbi_message(message_buffer); message_buffer[0] = '\0'; break; case 0x15: /* DSS */ /* * DRSCAN short * ...stack 0 is scan data * ...stack 1 is count */ IF_CHECK_STACK(2) { long_temp = stack[--stack_ptr]; count = (unsigned int) stack[--stack_ptr]; jbi_make_dword(charbuf, long_temp); status = jbi_do_drscan(count, charbuf, 0); } break; case 0x16: /* DSSC */ /* * DRSCAN short with capture * ...stack 0 is scan data * ...stack 1 is count */ IF_CHECK_STACK(2) { long_temp = stack[--stack_ptr]; count = (unsigned int) stack[stack_ptr - 1]; jbi_make_dword(charbuf, long_temp); status = jbi_swap_dr(count, charbuf, 0, charbuf, 0); stack[stack_ptr - 1] = jbi_get_dword(charbuf); } break; case 0x17: /* ISS */ /* * IRSCAN short * ...stack 0 is scan data * ...stack 1 is count */ IF_CHECK_STACK(2) { long_temp = stack[--stack_ptr]; count = (unsigned int) stack[--stack_ptr]; jbi_make_dword(charbuf, long_temp); status = jbi_do_irscan(count, charbuf, 0); } break; case 0x18: /* ISSC */ /* * IRSCAN short with capture * ...stack 0 is scan data * ...stack 1 is count */ IF_CHECK_STACK(2) { long_temp = stack[--stack_ptr]; count = (unsigned int) stack[stack_ptr - 1]; jbi_make_dword(charbuf, long_temp); status = jbi_swap_ir(count, charbuf, 0, charbuf, 0); stack[stack_ptr - 1] = jbi_get_dword(charbuf); } break; case 0x19: /* VSS */ /* * VECTOR short * ...stack 0 is scan data * ...stack 1 is count */ bad_opcode = 1; break; case 0x1A: /* VSSC */ /* * VECTOR short with capture * ...stack 0 is scan data * ...stack 1 is count */ bad_opcode = 1; break; case 0x1B: /* VMPF */ /* * VMAP finish */ bad_opcode = 1; break; case 0x1C: /* DPR */ IF_CHECK_STACK(1) { count = (unsigned int) stack[--stack_ptr]; status = jbi_set_dr_preamble(count, 0, NULL); } break; case 0x1D: /* DPRL */ /* * DRPRE with literal data * ...stack 0 is count * ...stack 1 is literal data */ IF_CHECK_STACK(2) { count = (unsigned int) stack[--stack_ptr]; long_temp = stack[--stack_ptr]; jbi_make_dword(charbuf, long_temp); status = jbi_set_dr_preamble(count, 0, charbuf); } break; case 0x1E: /* DPO */ /* * DRPOST * ...stack 0 is count */ IF_CHECK_STACK(1) { count = (unsigned int) stack[--stack_ptr]; status = jbi_set_dr_postamble(count, 0, NULL); } break; case 0x1F: /* DPOL */ /* * DRPOST with literal data * ...stack 0 is count * ...stack 1 is literal data */ IF_CHECK_STACK(2) { count = (unsigned int) stack[--stack_ptr]; long_temp = stack[--stack_ptr]; jbi_make_dword(charbuf, long_temp); status = jbi_set_dr_postamble(count, 0, charbuf); } break; case 0x20: /* IPR */ IF_CHECK_STACK(1) { count = (unsigned int) stack[--stack_ptr]; status = jbi_set_ir_preamble(count, 0, NULL); } break; case 0x21: /* IPRL */ /* * IRPRE with literal data * ...stack 0 is count * ...stack 1 is literal data */ IF_CHECK_STACK(2) { count = (unsigned int) stack[--stack_ptr]; long_temp = stack[--stack_ptr]; jbi_make_dword(charbuf, long_temp); status = jbi_set_ir_preamble(count, 0, charbuf); } break; case 0x22: /* IPO */ /* * IRPOST * ...stack 0 is count */ IF_CHECK_STACK(1) { count = (unsigned int) stack[--stack_ptr]; status = jbi_set_ir_postamble(count, 0, NULL); } break; case 0x23: /* IPOL */ /* * IRPOST with literal data * ...stack 0 is count * ...stack 1 is literal data */ IF_CHECK_STACK(2) { count = (unsigned int) stack[--stack_ptr]; long_temp = stack[--stack_ptr]; jbi_make_dword(charbuf, long_temp); status = jbi_set_ir_postamble(count, 0, charbuf); } break; case 0x24: /* PCHR */ IF_CHECK_STACK(1) { unsigned char ch; count = jbi_strlen(message_buffer); ch = (char) stack[--stack_ptr]; if ((ch < 1) || (ch > 127)) { /* character code out of range */ /* instead of flagging an error, force the value to 127 */ ch = 127; } message_buffer[count] = ch; message_buffer[count + 1] = '\0'; } break; case 0x25: /* EXIT */ IF_CHECK_STACK(1) { *exit_code = (int) stack[--stack_ptr]; } done = 1; break; case 0x26: /* EQU */ IF_CHECK_STACK(2) { --stack_ptr; stack[stack_ptr - 1] = (stack[stack_ptr - 1] == stack[stack_ptr]) ? 1L : 0L; } break; case 0x27: /* POPT */ IF_CHECK_STACK(1) { --stack_ptr; } break; case 0x28: /* TRST */ bad_opcode = 1; break; case 0x29: /* FRQ */ bad_opcode = 1; break; case 0x2A: /* FRQU */ bad_opcode = 1; break; case 0x2B: /* PD32 */ bad_opcode = 1; break; case 0x2C: /* ABS */ IF_CHECK_STACK(1) { if (stack[stack_ptr - 1] < 0) { stack[stack_ptr - 1] = 0 - stack[stack_ptr - 1]; } } break; case 0x2D: /* BCH0 */ /* * Batch operation 0 * SWP * SWPN 7 * SWP * SWPN 6 * DUPN 8 * SWPN 2 * SWP * DUPN 6 * DUPN 6 */ /* SWP */ IF_CHECK_STACK(2) { long_temp = stack[stack_ptr - 2]; stack[stack_ptr - 2] = stack[stack_ptr - 1]; stack[stack_ptr - 1] = long_temp; } /* SWPN 7 */ index = 7 + 1; IF_CHECK_STACK(index) { long_temp = stack[stack_ptr - index]; stack[stack_ptr - index] = stack[stack_ptr - 1]; stack[stack_ptr - 1] = long_temp; } /* SWP */ IF_CHECK_STACK(2) { long_temp = stack[stack_ptr - 2]; stack[stack_ptr - 2] = stack[stack_ptr - 1]; stack[stack_ptr - 1] = long_temp; } /* SWPN 6 */ index = 6 + 1; IF_CHECK_STACK(index) { long_temp = stack[stack_ptr - index]; stack[stack_ptr - index] = stack[stack_ptr - 1]; stack[stack_ptr - 1] = long_temp; } /* DUPN 8 */ index = 8 + 1; IF_CHECK_STACK(index) { stack[stack_ptr] = stack[stack_ptr - index]; ++stack_ptr; } /* SWPN 2 */ index = 2 + 1; IF_CHECK_STACK(index) { long_temp = stack[stack_ptr - index]; stack[stack_ptr - index] = stack[stack_ptr - 1]; stack[stack_ptr - 1] = long_temp; } /* SWP */ IF_CHECK_STACK(2) { long_temp = stack[stack_ptr - 2]; stack[stack_ptr - 2] = stack[stack_ptr - 1]; stack[stack_ptr - 1] = long_temp; } /* DUPN 6 */ index = 6 + 1; IF_CHECK_STACK(index) { stack[stack_ptr] = stack[stack_ptr - index]; ++stack_ptr; } /* DUPN 6 */ index = 6 + 1; IF_CHECK_STACK(index) { stack[stack_ptr] = stack[stack_ptr - index]; ++stack_ptr; } break; case 0x2E: /* BCH1 */ /* * Batch operation 1 * SWPN 8 * SWP * SWPN 9 * SWPN 3 * SWP * SWPN 2 * SWP * SWPN 7 * SWP * SWPN 6 * DUPN 5 * DUPN 5 */ bad_opcode = 1; break; case 0x2F: /* PSH0 */ stack[stack_ptr++] = 0; break; case 0x40: /* PSHL */ stack[stack_ptr++] = (long) args[0]; break; case 0x41: /* PSHV */ stack[stack_ptr++] = variables[args[0]]; break; case 0x42: /* JMP */ pc = args[0] + code_section; CHECK_PC; break; case 0x43: /* CALL */ stack[stack_ptr++] = pc; pc = args[0] + code_section; CHECK_PC; break; case 0x44: /* NEXT */ /* * Process FOR / NEXT loop * ...argument 0 is variable ID * ...stack 0 is step value * ...stack 1 is end value * ...stack 2 is top address */ IF_CHECK_STACK(3) { long step = stack[stack_ptr - 1]; long end = stack[stack_ptr - 2]; long top = stack[stack_ptr - 3]; long iterator = variables[args[0]]; int break_out = 0; if (step < 0) { if (iterator <= end) break_out = 1; } else { if (iterator >= end) break_out = 1; } if (break_out) { stack_ptr -= 3; } else { variables[args[0]] = iterator + step; pc = top + code_section; CHECK_PC; } } break; case 0x45: /* PSTR */ /* * PRINT add string * ...argument 0 is string ID */ #if PORT==DOS long_index = string_table + args[0]; index2 = jbi_strlen(message_buffer); do { i = GET_BYTE(long_index); message_buffer[index2] = (char) i; ++long_index; ++index2; } while ((i != '\0') && (index2 < JBIC_MESSAGE_LENGTH)); #else count = jbi_strlen(message_buffer); jbi_strncpy(&message_buffer[count], (char *) &program[string_table + args[0]], JBIC_MESSAGE_LENGTH - count); #endif message_buffer[JBIC_MESSAGE_LENGTH] = '\0'; break; case 0x46: /* VMAP */ /* * VMAP add signal name * ...argument 0 is string ID */ bad_opcode = 1; break; case 0x47: /* SINT */ /* * STATE intermediate state * ...argument 0 is state code */ status = jbi_goto_jtag_state((int) args[0]); break; case 0x48: /* ST */ /* * STATE final state * ...argument 0 is state code */ status = jbi_goto_jtag_state((int) args[0]); break; case 0x49: /* ISTP */ /* * IRSTOP state * ...argument 0 is state code */ status = jbi_set_irstop_state((int) args[0]); break; case 0x4A: /* DSTP */ /* * DRSTOP state * ...argument 0 is state code */ status = jbi_set_drstop_state((int) args[0]); break; case 0x4B: /* SWPN */ /* * Exchange top with Nth stack value * ...argument 0 is 0-based stack entry to swap with top element */ index = ((int) args[0]) + 1; IF_CHECK_STACK(index) { long_temp = stack[stack_ptr - index]; stack[stack_ptr - index] = stack[stack_ptr - 1]; stack[stack_ptr - 1] = long_temp; } break; case 0x4C: /* DUPN */ /* * Duplicate Nth stack value * ...argument 0 is 0-based stack entry to duplicate */ index = ((int) args[0]) + 1; IF_CHECK_STACK(index) { stack[stack_ptr] = stack[stack_ptr - index]; ++stack_ptr; } break; case 0x4D: /* POPV */ /* * Pop stack into scalar variable * ...argument 0 is variable ID * ...stack 0 is value */ IF_CHECK_STACK(1) { variables[args[0]] = stack[--stack_ptr]; } break; case 0x4E: /* POPE */ /* * Pop stack into integer array element * ...argument 0 is variable ID * ...stack 0 is array index * ...stack 1 is value */ IF_CHECK_STACK(2) { variable_id = (unsigned int) args[0]; /* * If variable is read-only, convert to writable array */ if ((version > 0) && ((attributes[variable_id] & 0x9c) == 0x1c)) { /* * Allocate a writable buffer for this array */ count = (unsigned int) variable_size[variable_id]; long_temp = variables[variable_id]; longptr_temp = (long *) jbi_malloc(count * sizeof(long)); variables[variable_id] = (long) longptr_temp; if (variables[variable_id] == NULL) { status = JBIC_OUT_OF_MEMORY; break; } else { /* copy previous contents into buffer */ for (i = 0; i < count; ++i) { longptr_temp[i] = GET_DWORD(long_temp); long_temp += 4L; } /* set bit 7 - buffer was dynamically allocated */ attributes[variable_id] |= 0x80; /* clear bit 2 - variable is writable */ attributes[variable_id] &= ~0x04; attributes[variable_id] |= 0x01; } } #if PORT==DOS /* for 16-bit version, allow writing in allocated buffers */ if ((version > 0) && ((attributes[variable_id] & 0x9c) == 0x9c)) { attributes[variable_id] &= ~0x04; attributes[variable_id] |= 0x01; } #endif /* check that variable is a writable integer array */ if ((attributes[variable_id] & 0x1c) != 0x18) { status = JBIC_BOUNDS_ERROR; } else { longptr_temp = (long *) variables[variable_id]; /* pop the array index */ index = (unsigned int) stack[--stack_ptr]; /* pop the value and store it into the array */ longptr_temp[index] = stack[--stack_ptr]; } } break; case 0x4F: /* POPA */ /* * Pop stack into Boolean array * ...argument 0 is variable ID * ...stack 0 is count * ...stack 1 is array index * ...stack 2 is value */ IF_CHECK_STACK(3) { variable_id = (unsigned int) args[0]; /* * If variable is read-only, convert to writable array */ if ((version > 0) && ((attributes[variable_id] & 0x9c) == 0x0c)) { /* * Allocate a writable buffer for this array */ long_temp = (variable_size[variable_id] + 7L) >> 3L; charptr_temp2 = (unsigned char *) variables[variable_id]; charptr_temp = jbi_malloc((unsigned int) long_temp); variables[variable_id] = (long) charptr_temp; if (variables[variable_id] == NULL) { status = JBIC_OUT_OF_MEMORY; } else { /* zero the buffer */ for (long_index = 0L; long_index < long_temp; ++long_index) { charptr_temp[long_index] = 0; } /* copy previous contents into buffer */ for (long_index = 0L; long_index < variable_size[variable_id]; ++long_index) { #if PORT==DOS if ((attributes[variable_id] & 0x02) && ((long_index & 0x0000FFFF) == 0L)) { /* initialized compressed Boolean array */ jbi_uncompress_page(variable_id, (int) (long_index >> 16), version); charptr_temp = jbi_aca_out_buffer; long_index2 = long_index & 0xFFFF; } #else long_index2 = long_index; #endif if (charptr_temp2[long_index2 >> 3] & (1 << (long_index2 & 7))) { charptr_temp[long_index >> 3] |= (1 << (long_index & 7)); } } /* set bit 7 - buffer was dynamically allocated */ attributes[variable_id] |= 0x80; /* clear bit 2 - variable is writable */ attributes[variable_id] &= ~0x04; attributes[variable_id] |= 0x01; } } #if PORT==DOS /* for 16-bit version, allow writing in allocated buffers */ if ((version > 0) && ((attributes[variable_id] & 0x9c) == 0x8c)) { attributes[variable_id] &= ~0x04; attributes[variable_id] |= 0x01; } #endif /* check that variable is a writable Boolean array */ if ((attributes[variable_id] & 0x1c) != 0x08) { status = JBIC_BOUNDS_ERROR; } else { charptr_temp = (unsigned char *) variables[variable_id]; /* pop the count (number of bits to copy) */ long_count = stack[--stack_ptr]; /* pop the array index */ long_index = stack[--stack_ptr]; reverse = 0; if (version > 0) { /* stack 0 = array right index */ /* stack 1 = array left index */ if (long_index > long_count) { reverse = 1; long_temp = long_count; long_count = 1 + long_index - long_count; long_index = long_temp; /* reverse POPA is not supported */ status = JBIC_BOUNDS_ERROR; break; } else { long_count = 1 + long_count - long_index; } } /* pop the data */ long_temp = stack[--stack_ptr]; if (long_count < 1) { status = JBIC_BOUNDS_ERROR; } else { for (i = 0; i < (unsigned int) long_count; ++i) { if (long_temp & (1L << (long) i)) { charptr_temp[long_index >> 3L] |= (1L << (long_index & 7L)); } else { charptr_temp[long_index >> 3L] &= ~ (unsigned int) (1L << (long_index & 7L)); } ++long_index; } } } } break; case 0x50: /* JMPZ */ /* * Pop stack and branch if zero * ...argument 0 is address * ...stack 0 is condition value */ IF_CHECK_STACK(1) { if (stack[--stack_ptr] == 0) { pc = args[0] + code_section; CHECK_PC; } } break; case 0x51: /* DS */ case 0x52: /* IS */ /* * DRSCAN * IRSCAN * ...argument 0 is scan data variable ID * ...stack 0 is array index * ...stack 1 is count */ IF_CHECK_STACK(2) { long_index = stack[--stack_ptr]; long_count = stack[--stack_ptr]; reverse = 0; if (version > 0) { /* stack 0 = array right index */ /* stack 1 = array left index */ /* stack 2 = count */ long_temp = long_count; long_count = stack[--stack_ptr]; if (long_index > long_temp) { reverse = 1; long_index = long_temp; } } #if PORT==DOS if (((long_index & 0xFFFF0000) == 0) && ((long_count & 0xFFFF0000) == 0)) { variable_id = (unsigned int) args[0]; if ((attributes[variable_id] & 0x1e) == 0x0e) { /* initialized compressed Boolean array */ jbi_uncompress_page(variable_id, (int) (long_index >> 16), version); long_index &= 0x0000ffff; charptr_temp = jbi_aca_out_buffer; } else { charptr_temp = (unsigned char *) variables[variable_id]; } if (reverse) { /* allocate a buffer and reverse the data order */ charptr_temp2 = charptr_temp; charptr_temp = jbi_malloc((unsigned int) ((long_count >> 3L) + 1L)); if (charptr_temp == NULL) { status = JBIC_OUT_OF_MEMORY; break; } else { long_temp = long_index + long_count - 1; long_index2 = 0; while (long_index2 < long_count) { if (charptr_temp2[long_temp >> 3] & (1 << (long_temp & 7))) { charptr_temp[long_index2 >> 3] |= (1 << (long_index2 & 7)); } else { charptr_temp[long_index2 >> 3] &= ~(1 << (long_index2 & 7)); } --long_temp; ++long_index2; } } } if (opcode == 0x51) /* DS */ { status = jbi_do_drscan((unsigned int) long_count, charptr_temp, (unsigned long) long_index); } else /* IS */ { status = jbi_do_irscan((unsigned int) long_count, charptr_temp, (unsigned int) long_index); } if (reverse) jbi_free(charptr_temp); } else if ((opcode == 0x51) && !reverse) { status = jbi_do_drscan_multi_page( (unsigned int) args[0], (unsigned long) long_count, (unsigned long) long_index, version); } else { /* reverse multi-page scans are not supported */ /* multi-page IR scans are not supported */ status = JBIC_BOUNDS_ERROR; } #else charptr_temp = (unsigned char *) variables[args[0]]; if (reverse) { /* allocate a buffer and reverse the data order */ charptr_temp2 = charptr_temp; charptr_temp = jbi_malloc((long_count >> 3) + 1); if (charptr_temp == NULL) { status = JBIC_OUT_OF_MEMORY; break; } else { long_temp = long_index + long_count - 1; long_index2 = 0; while (long_index2 < long_count) { if (charptr_temp2[long_temp >> 3] & (1 << (long_temp & 7))) { charptr_temp[long_index2 >> 3] |= (1 << (long_index2 & 7)); } else { charptr_temp[long_index2 >> 3] &= ~(1 << (long_index2 & 7)); } --long_temp; ++long_index2; } } } if (opcode == 0x51) /* DS */ { status = jbi_do_drscan((unsigned int) long_count, charptr_temp, (unsigned long) long_index); } else /* IS */ { status = jbi_do_irscan((unsigned int) long_count, charptr_temp, (unsigned int) long_index); } #endif if (reverse && (charptr_temp != NULL)) { jbi_free(charptr_temp); } } break; case 0x53: /* DPRA */ /* * DRPRE with array data * ...argument 0 is variable ID * ...stack 0 is array index * ...stack 1 is count */ IF_CHECK_STACK(2) { index = (unsigned int) stack[--stack_ptr]; count = (unsigned int) stack[--stack_ptr]; if (version > 0) { /* stack 0 = array right index */ /* stack 1 = array left index */ count = 1 + count - index; } charptr_temp = (unsigned char *) variables[args[0]]; status = jbi_set_dr_preamble(count, index, charptr_temp); } break; case 0x54: /* DPOA */ /* * DRPOST with array data * ...argument 0 is variable ID * ...stack 0 is array index * ...stack 1 is count */ IF_CHECK_STACK(2) { index = (unsigned int) stack[--stack_ptr]; count = (unsigned int) stack[--stack_ptr]; if (version > 0) { /* stack 0 = array right index */ /* stack 1 = array left index */ count = 1 + count - index; } charptr_temp = (unsigned char *) variables[args[0]]; status = jbi_set_dr_postamble(count, index, charptr_temp); } break; case 0x55: /* IPRA */ /* * IRPRE with array data * ...argument 0 is variable ID * ...stack 0 is array index * ...stack 1 is count */ IF_CHECK_STACK(2) { index = (unsigned int) stack[--stack_ptr]; count = (unsigned int) stack[--stack_ptr]; if (version > 0) { /* stack 0 = array right index */ /* stack 1 = array left index */ count = 1 + count - index; } charptr_temp = (unsigned char *) variables[args[0]]; status = jbi_set_ir_preamble(count, index, charptr_temp); } break; case 0x56: /* IPOA */ /* * IRPOST with array data * ...argument 0 is variable ID * ...stack 0 is array index * ...stack 1 is count */ IF_CHECK_STACK(2) { index = (unsigned int) stack[--stack_ptr]; count = (unsigned int) stack[--stack_ptr]; if (version > 0) { /* stack 0 = array right index */ /* stack 1 = array left index */ count = 1 + count - index; } charptr_temp = (unsigned char *) variables[args[0]]; status = jbi_set_ir_postamble(count, index, charptr_temp); } break; case 0x57: /* EXPT */ /* * EXPORT * ...argument 0 is string ID * ...stack 0 is integer expression */ IF_CHECK_STACK(1) { #if PORT==DOS name_id = args[0]; for (j = 0; j < 32; ++j) { name[j] = GET_BYTE(string_table + name_id + j); } name[32] = '\0'; #else name = (char *) &program[string_table + args[0]]; #endif long_temp = stack[--stack_ptr]; jbi_export_integer(name, long_temp); } break; case 0x58: /* PSHE */ /* * Push integer array element * ...argument 0 is variable ID * ...stack 0 is array index */ IF_CHECK_STACK(1) { variable_id = (unsigned int) args[0]; index = (unsigned int) stack[stack_ptr - 1]; /* check variable type */ if ((attributes[variable_id] & 0x1f) == 0x19) { /* writable integer array */ longptr_temp = (long *) variables[variable_id]; stack[stack_ptr - 1] = longptr_temp[index]; } else if ((attributes[variable_id] & 0x1f) == 0x1c) { /* read-only integer array */ long_temp = variables[variable_id] + (4L * index); stack[stack_ptr - 1] = GET_DWORD(long_temp); } else { status = JBIC_BOUNDS_ERROR; } } break; case 0x59: /* PSHA */ /* * Push Boolean array * ...argument 0 is variable ID * ...stack 0 is count * ...stack 1 is array index */ IF_CHECK_STACK(2) { variable_id = (unsigned int) args[0]; /* check that variable is a Boolean array */ if ((attributes[variable_id] & 0x18) != 0x08) { status = JBIC_BOUNDS_ERROR; } else { charptr_temp = (unsigned char *) variables[variable_id]; /* pop the count (number of bits to copy) */ count = (unsigned int) stack[--stack_ptr]; /* pop the array index */ index = (unsigned int) stack[stack_ptr - 1]; if (version > 0) { /* stack 0 = array right index */ /* stack 1 = array left index */ count = 1 + count - index; } if ((count < 1) || (count > 32)) { status = JBIC_BOUNDS_ERROR; } else { #if PORT==DOS if ((attributes[variable_id] & 0x1e) == 0x0e) { /* initialized compressed Boolean array */ jbi_uncompress_page(variable_id, (int) (stack[stack_ptr - 1] >> 16), version); charptr_temp = jbi_aca_out_buffer; } #endif long_temp = 0L; for (i = 0; i < count; ++i) { if (charptr_temp[(i + index) >> 3] & (1 << ((i + index) & 7))) { long_temp |= (1L << i); } } stack[stack_ptr - 1] = long_temp; } } } break; case 0x5A: /* DYNA */ /* * Dynamically change size of array * ...argument 0 is variable ID * ...stack 0 is new size */ IF_CHECK_STACK(1) { variable_id = (unsigned int) args[0]; long_temp = stack[--stack_ptr]; if (long_temp > variable_size[variable_id]) { variable_size[variable_id] = long_temp; if (attributes[variable_id] & 0x10) { /* allocate integer array */ long_temp *= 4; } else { /* allocate Boolean array */ long_temp = (long_temp + 7) >> 3; } /* * If the buffer was previously allocated, free it */ if ((attributes[variable_id] & 0x80) && (variables[variable_id] != NULL)) { jbi_free((void *) variables[variable_id]); variables[variable_id] = NULL; } /* * Allocate a new buffer of the requested size */ variables[variable_id] = (long) jbi_malloc((unsigned int) long_temp); if (variables[variable_id] == NULL) { status = JBIC_OUT_OF_MEMORY; } else { /* * Set the attribute bit to indicate that this buffer * was dynamically allocated and should be freed later */ attributes[variable_id] |= 0x80; /* zero out memory */ count = (unsigned int) ((variable_size[variable_id] + 7L) / 8L); charptr_temp = (unsigned char *) (variables[variable_id]); for (index = 0; index < count; ++index) { charptr_temp[index] = 0; } } } } break; case 0x5B: /* EXPR */ bad_opcode = 1; break; case 0x5C: /* EXPV */ /* * Export Boolean array * ...argument 0 is string ID * ...stack 0 is variable ID * ...stack 1 is array right index * ...stack 2 is array left index */ IF_CHECK_STACK(3) { if (version == 0) { /* EXPV is not supported in JBC 1.0 */ bad_opcode = 1; break; } #if PORT==DOS name_id = args[0]; for (j = 0; j < 32; ++j) { name[j] = GET_BYTE(string_table + name_id + j); } name[32] = '\0'; #else name = (char *) &program[string_table + args[0]]; #endif variable_id = (unsigned int) stack[--stack_ptr]; long_index = stack[--stack_ptr]; /* right index */ long_index2 = stack[--stack_ptr]; /* left index */ if (long_index > long_index2) { /* reverse indices not supported */ status = JBIC_BOUNDS_ERROR; break; } long_count = 1 + long_index2 - long_index; charptr_temp = (unsigned char *) variables[variable_id]; charptr_temp2 = NULL; #if PORT==DOS if ((attributes[variable_id] & 0x1e) == 0x0e) { /* initialized compressed Boolean array */ jbi_uncompress_page(variable_id, (int) (long_index >> 16), version); charptr_temp = jbi_aca_out_buffer; long_index &= 0x0000FFFF; } #endif if ((long_index & 7L) != 0) { charptr_temp2 = jbi_malloc((unsigned int) ((long_count + 7L) / 8L)); if (charptr_temp2 == NULL) { status = JBIC_OUT_OF_MEMORY; break; } else { long k = long_index; for (i = 0; i < (unsigned int) long_count; ++i) { if (charptr_temp[k >> 3] & (1 << (k & 7))) { charptr_temp2[i >> 3] |= (1 << (i & 7)); } else { charptr_temp2[i >> 3] &= ~(1 << (i & 7)); } ++k; } charptr_temp = charptr_temp2; } } else if (long_index != 0) { charptr_temp = &charptr_temp[long_index >> 3]; } jbi_export_boolean_array(name, charptr_temp, long_count); /* free allocated buffer */ if (((long_index & 7L) != 0) && (charptr_temp2 != NULL)) { jbi_free(charptr_temp2); } } break; case 0x80: /* COPY */ /* * Array copy * ...argument 0 is dest ID * ...argument 1 is source ID * ...stack 0 is count * ...stack 1 is dest index * ...stack 2 is source index */ IF_CHECK_STACK(3) { long copy_count = stack[--stack_ptr]; long copy_index = stack[--stack_ptr]; long copy_index2 = stack[--stack_ptr]; long destleft; long src_count; long dest_count; int src_reverse = 0; int dest_reverse = 0; reverse = 0; if (version > 0) { /* stack 0 = source right index */ /* stack 1 = source left index */ /* stack 2 = destination right index */ /* stack 3 = destination left index */ destleft = stack[--stack_ptr]; if (copy_count > copy_index) { src_reverse = 1; reverse = 1; src_count = 1 + copy_count - copy_index; /* copy_index = source start index */ } else { src_count = 1 + copy_index - copy_count; copy_index = copy_count; /* source start index */ } if (copy_index2 > destleft) { dest_reverse = 1; reverse = !reverse; dest_count = 1 + copy_index2 - destleft; copy_index2 = destleft; /* destination start index */ } else { dest_count = 1 + destleft - copy_index2; /* copy_index2 = destination start index */ } copy_count = (src_count < dest_count) ? src_count : dest_count; if ((src_reverse || dest_reverse) && (src_count != dest_count)) { /* If either the source or destination is reversed, */ /* we can't tolerate a length mismatch, because we */ /* "left justify" the arrays when copying. This */ /* won't work correctly with reversed arrays. */ status = JBIC_BOUNDS_ERROR; } } count = (unsigned int) copy_count; index = (unsigned int) copy_index; index2 = (unsigned int) copy_index2; /* * If destination is a read-only array, allocate a buffer * and convert it to a writable array */ variable_id = (unsigned int) args[1]; if ((version > 0) && ((attributes[variable_id] & 0x9c) == 0x0c)) { /* * Allocate a writable buffer for this array */ long_temp = (variable_size[variable_id] + 7L) >> 3L; charptr_temp2 = (unsigned char *) variables[variable_id]; charptr_temp = jbi_malloc((unsigned int) long_temp); variables[variable_id] = (long) charptr_temp; if (variables[variable_id] == NULL) { status = JBIC_OUT_OF_MEMORY; break; } else { /* zero the buffer */ for (long_index = 0L; long_index < long_temp; ++long_index) { charptr_temp[long_index] = 0; } /* copy previous contents into buffer */ for (long_index = 0L; long_index < variable_size[variable_id]; ++long_index) { #if PORT==DOS if ((attributes[variable_id] & 0x02) && ((long_index & 0x0000FFFF) == 0L)) { /* initialized compressed Boolean array */ jbi_uncompress_page(variable_id, (int) (long_index >> 16), version); charptr_temp = jbi_aca_out_buffer; long_index2 = long_index & 0xFFFF; } #else long_index2 = long_index; #endif if (charptr_temp2[long_index2 >> 3] & (1 << (long_index2 & 7))) { charptr_temp[long_index >> 3] |= (1 << (long_index & 7)); } } /* set bit 7 - buffer was dynamically allocated */ attributes[variable_id] |= 0x80; /* clear bit 2 - variable is writable */ attributes[variable_id] &= ~0x04; attributes[variable_id] |= 0x01; } } #if PORT==DOS /* for 16-bit version, allow writing in allocated buffers */ if ((version > 0) && ((attributes[variable_id] & 0x9c) == 0x8c)) { attributes[variable_id] &= ~0x04; attributes[variable_id] |= 0x01; } #endif charptr_temp = (unsigned char *) variables[args[1]]; charptr_temp2 = (unsigned char *) variables[args[0]]; #if PORT==DOS variable_id = (unsigned int) args[0]; if ((attributes[variable_id] & 0x1e) == 0x0e) { /* initialized compressed Boolean array */ jbi_uncompress_page(variable_id, (int) (copy_index >> 16), version); charptr_temp2 = jbi_aca_out_buffer; } #endif /* check that destination is a writable Boolean array */ if ((attributes[args[1]] & 0x1c) != 0x08) { status = JBIC_BOUNDS_ERROR; break; } if (count < 1) { status = JBIC_BOUNDS_ERROR; } else { if (reverse) { index2 += (count - 1); } for (i = 0; i < count; ++i) { if (charptr_temp2[index >> 3] & (1 << (index & 7))) { charptr_temp[index2 >> 3] |= (1 << (index2 & 7)); } else { charptr_temp[index2 >> 3] &= ~(unsigned int) (1 << (index2 & 7)); } ++index; if (reverse) --index2; else ++index2; } } } break; case 0x81: /* REVA */ /* * ARRAY COPY reversing bit order * ...argument 0 is dest ID * ...argument 1 is source ID * ...stack 0 is dest index * ...stack 1 is source index * ...stack 2 is count */ bad_opcode = 1; break; case 0x82: /* DSC */ case 0x83: /* ISC */ /* * DRSCAN with capture * IRSCAN with capture * ...argument 0 is scan data variable ID * ...argument 1 is capture variable ID * ...stack 0 is capture index * ...stack 1 is scan data index * ...stack 2 is count */ IF_CHECK_STACK(3) { long scan_right, scan_left; long capture_count = 0; long scan_count = 0; long capture_index = stack[--stack_ptr]; long scan_index = stack[--stack_ptr]; if (version > 0) { /* stack 0 = capture right index */ /* stack 1 = capture left index */ /* stack 2 = scan right index */ /* stack 3 = scan left index */ /* stack 4 = count */ scan_right = stack[--stack_ptr]; scan_left = stack[--stack_ptr]; capture_count = 1 + scan_index - capture_index; scan_count = 1 + scan_left - scan_right; scan_index = scan_right; } long_count = stack[--stack_ptr]; /* * If capture array is read-only, allocate a buffer * and convert it to a writable array */ variable_id = (unsigned int) args[1]; if ((version > 0) && ((attributes[variable_id] & 0x9c) == 0x0c)) { /* * Allocate a writable buffer for this array */ long_temp = (variable_size[variable_id] + 7L) >> 3L; charptr_temp2 = (unsigned char *) variables[variable_id]; charptr_temp = jbi_malloc((unsigned int) long_temp); variables[variable_id] = (long) charptr_temp; if (variables[variable_id] == NULL) { status = JBIC_OUT_OF_MEMORY; break; } else { /* zero the buffer */ for (long_index = 0L; long_index < long_temp; ++long_index) { charptr_temp[long_index] = 0; } /* copy previous contents into buffer */ for (long_index = 0L; long_index < variable_size[variable_id]; ++long_index) { #if PORT==DOS if ((attributes[variable_id] & 0x02) && ((long_index & 0x0000FFFF) == 0L)) { /* initialized compressed Boolean array */ jbi_uncompress_page(variable_id, (int) (long_index >> 16), version); charptr_temp = jbi_aca_out_buffer; long_index2 = long_index & 0xFFFF; } #else long_index2 = long_index; #endif if (charptr_temp2[long_index2 >> 3] & (1 << (long_index2 & 7))) { charptr_temp[long_index >> 3] |= (1 << (long_index & 7)); } } /* set bit 7 - buffer was dynamically allocated */ attributes[variable_id] |= 0x80; /* clear bit 2 - variable is writable */ attributes[variable_id] &= ~0x04; attributes[variable_id] |= 0x01; } } #if PORT==DOS /* for 16-bit version, allow writing in allocated buffers */ if ((version > 0) && ((attributes[variable_id] & 0x9c) == 0x8c)) { attributes[variable_id] &= ~0x04; attributes[variable_id] |= 0x01; } #endif charptr_temp = (unsigned char *) variables[args[0]]; charptr_temp2 = (unsigned char *) variables[args[1]]; #if PORT==DOS variable_id = (unsigned int) args[0]; if ((attributes[variable_id] & 0x1e) == 0x0e) { /* initialized compressed Boolean array */ jbi_uncompress_page(variable_id, (int) (scan_index >> 16), version); scan_index &= 0x0000ffff; charptr_temp = jbi_aca_out_buffer; } #endif if ((version > 0) && ((long_count > capture_count) || (long_count > scan_count))) { status = JBIC_BOUNDS_ERROR; } /* check that capture array is a writable Boolean array */ if ((attributes[args[1]] & 0x1c) != 0x08) { status = JBIC_BOUNDS_ERROR; } if (status == JBIC_SUCCESS) { if (opcode == 0x82) /* DSC */ { status = jbi_swap_dr((unsigned int) long_count, charptr_temp, (unsigned long) scan_index, charptr_temp2, (unsigned int) capture_index); } else /* ISC */ { status = jbi_swap_ir((unsigned int) long_count, charptr_temp, (unsigned int) scan_index, charptr_temp2, (unsigned int) capture_index); } } } break; case 0x84: /* WAIT */ /* * WAIT * ...argument 0 is wait state * ...argument 1 is end state * ...stack 0 is cycles * ...stack 1 is microseconds */ IF_CHECK_STACK(2) { long_temp = stack[--stack_ptr]; if (long_temp != 0L) { status = jbi_do_wait_cycles(long_temp, (unsigned int) args[0]); } long_temp = stack[--stack_ptr]; if ((status == JBIC_SUCCESS) && (long_temp != 0L)) { status = jbi_do_wait_microseconds(long_temp, (unsigned int) args[0]); } if ((status == JBIC_SUCCESS) && (args[1] != args[0])) { status = jbi_goto_jtag_state((unsigned int) args[1]); } if (version > 0) { --stack_ptr; /* throw away MAX cycles */ --stack_ptr; /* throw away MAX microseconds */ } } break; case 0x85: /* VS */ /* * VECTOR * ...argument 0 is dir data variable ID * ...argument 1 is scan data variable ID * ...stack 0 is dir array index * ...stack 1 is scan array index * ...stack 2 is count */ bad_opcode = 1; break; case 0xC0: /* CMPA */ /* * Array compare * ...argument 0 is source 1 ID * ...argument 1 is source 2 ID * ...argument 2 is mask ID * ...stack 0 is source 1 index * ...stack 1 is source 2 index * ...stack 2 is mask index * ...stack 3 is count */ IF_CHECK_STACK(4) { long a, b; unsigned char *source1 = (unsigned char *) variables[args[0]]; unsigned char *source2 = (unsigned char *) variables[args[1]]; unsigned char *mask = (unsigned char *) variables[args[2]]; unsigned long index1 = stack[--stack_ptr]; unsigned long index2 = stack[--stack_ptr]; unsigned long mask_index = stack[--stack_ptr]; long_count = stack[--stack_ptr]; if (version > 0) { /* stack 0 = source 1 right index */ /* stack 1 = source 1 left index */ /* stack 2 = source 2 right index */ /* stack 3 = source 2 left index */ /* stack 4 = mask right index */ /* stack 5 = mask left index */ long mask_right = stack[--stack_ptr]; long mask_left = stack[--stack_ptr]; a = 1 + index2 - index1; /* source 1 count */ b = 1 + long_count - mask_index; /* source 2 count */ a = (a < b) ? a : b; b = 1 + mask_left - mask_right; /* mask count */ a = (a < b) ? a : b; index2 = mask_index; /* source 2 start index */ mask_index = mask_right; /* mask start index */ long_count = a; } long_temp = 1L; if (long_count < 1) { status = JBIC_BOUNDS_ERROR; } else { #if PORT==DOS variable_id = (unsigned int) args[0]; if ((attributes[variable_id] & 0x1e) == 0x0e) { jbi_uncompress_page(variable_id, (int) (index1 >> 16), version); index1 &= 0x0000ffff; source1 = jbi_aca_out_buffer; } variable_id = (unsigned int) args[1]; if ((attributes[variable_id] & 0x1e) == 0x0e) { jbi_uncompress_page(variable_id, (int) (index2 >> 16), version); index2 &= 0x0000ffff; source2 = jbi_aca_out_buffer; } #endif count = (unsigned int) long_count; for (i = 0; i < count; ++i) { if (mask[mask_index >> 3] & (1 << (mask_index & 7))) { a = source1[index1 >> 3] & (1 << (index1 & 7)) ? 1 : 0; b = source2[index2 >> 3] & (1 << (index2 & 7)) ? 1 : 0; if (a != b) long_temp = 0L; /* failure */ } ++index1; ++index2; ++mask_index; } } stack[stack_ptr++] = long_temp; } break; case 0xC1: /* VSC */ /* * VECTOR with capture * ...argument 0 is dir data variable ID * ...argument 1 is scan data variable ID * ...argument 2 is capture variable ID * ...stack 0 is capture index * ...stack 1 is scan data index * ...stack 2 is dir data index * ...stack 3 is count */ bad_opcode = 1; break; default: /* * Unrecognized opcode -- ERROR! */ bad_opcode = 1; break; } if (bad_opcode) { status = JBIC_ILLEGAL_OPCODE; } if ((stack_ptr < 0) || (stack_ptr >= JBI_STACK_SIZE)) { status = JBIC_STACK_OVERFLOW; } if (status != JBIC_SUCCESS) { done = 1; *error_address = (long) (opcode_address - code_section); } } jbi_free_jtag_padding_buffers(reset_jtag); /* * Free all dynamically allocated arrays */ if ((attributes != NULL) && (variables != NULL)) { for (i = 0; i < (unsigned int) symbol_count; ++i) { if ((attributes[i] & 0x80) && (variables[i] != NULL)) { jbi_free((void *) variables[i]); } } } if (variables != NULL) jbi_free(variables); if (variable_size != NULL) jbi_free(variable_size); if (attributes != NULL) jbi_free(attributes); if (proc_attributes != NULL) jbi_free(proc_attributes); return (status); } /****************************************************************************/ /* */ JBI_RETURN_TYPE jbi_get_note ( PROGRAM_PTR program, long program_size, long *offset, char *key, char *value, int length ) /* */ /* Description: Gets key and value of NOTE fields in the JBC file. */ /* Can be called in two modes: if offset pointer is NULL, */ /* then the function searches for note fields which match */ /* the key string provided. If offset is not NULL, then */ /* the function finds the next note field of any key, */ /* starting at the offset specified by the offset pointer. */ /* */ /* Returns: JBIC_SUCCESS for success, else appropriate error code */ /* */ /****************************************************************************/ { JBI_RETURN_TYPE status = JBIC_UNEXPECTED_END; unsigned long note_strings = 0L; unsigned long note_table = 0L; unsigned long note_count = 0L; unsigned long first_word = 0L; int version = 0; int delta = 0; char *key_ptr; char *value_ptr; int i; #if PORT==DOS int count = 0; int done = 0; long long_index = 0; char key_buffer[256]; char value_buffer[256]; jbi_program = program; #endif /* * Read header information */ if (program_size > 52L) { first_word = GET_DWORD(0); version = (int) (first_word & 1L); delta = version * 8; note_strings = GET_DWORD(8 + delta); note_table = GET_DWORD(12 + delta); note_count = GET_DWORD(44 + (2 * delta)); } if ((first_word != 0x4A414D00L) && (first_word != 0x4A414D01L)) { status = JBIC_IO_ERROR; } else if (note_count > 0L) { if (offset == NULL) { /* * We will search for the first note with a specific key, and * return only the value */ for (i = 0; (i < (int) note_count) && (status != JBIC_SUCCESS); ++i) { #if PORT==DOS done = 0; count = 0; long_index = note_strings + GET_DWORD(note_table + (8 * i)); while ((count < 255) && !done) { key_buffer[count] = GET_BYTE(long_index); if (key_buffer[count] == '\0') done = 1; ++long_index; ++count; } key_buffer[255] = '\0'; key_ptr = key_buffer; #else key_ptr = (char *) &program[note_strings + GET_DWORD(note_table + (8 * i))]; #endif if ((key != NULL) && (jbi_stricmp(key, key_ptr) == 0)) { status = JBIC_SUCCESS; #if PORT==DOS done = 0; count = 0; long_index = note_strings + GET_DWORD(note_table + (8 * i) + 4); while ((count < 255) && !done) { value_buffer[count] = GET_BYTE(long_index); if (value_buffer[count] == '\0') done = 1; ++long_index; ++count; } value_buffer[255] = '\0'; value_ptr = value_buffer; #else value_ptr = (char *) &program[note_strings + GET_DWORD(note_table + (8 * i) + 4)]; #endif if (value != NULL) { jbi_strncpy(value, value_ptr, length); } } } } else { /* * We will search for the next note, regardless of the key, and * return both the value and the key */ i = (int) *offset; if ((i >= 0) && (i < (int) note_count)) { status = JBIC_SUCCESS; if (key != NULL) { #if PORT==DOS done = 0; count = 0; long_index = note_strings + GET_DWORD(note_table + (8 * i)); while ((count < length) && !done) { key[count] = GET_BYTE(long_index); if (key[count] == '\0') done = 1; ++long_index; ++count; } #else jbi_strncpy(key, (char *) &program[note_strings + GET_DWORD(note_table + (8 * i))], length); #endif } if (value != NULL) { #if PORT==DOS done = 0; count = 0; long_index = note_strings + GET_DWORD(note_table + (8 * i) + 4); while ((count < length) && !done) { value[count] = GET_BYTE(long_index); if (value[count] == '\0') done = 1; ++long_index; ++count; } #else jbi_strncpy(value, (char *) &program[note_strings + GET_DWORD(note_table + (8 * i) + 4)], length); #endif } *offset = i + 1; } } } return (status); } /****************************************************************************/ /* */ JBI_RETURN_TYPE jbi_check_crc ( PROGRAM_PTR program, long program_size, unsigned short *expected_crc, unsigned short *actual_crc ) /* */ /* Description: This function reads the entire input file and computes */ /* the CRC of everything up to the CRC field. */ /* */ /* Returns: JBIC_SUCCESS for success, JBIC_CRC_ERROR for failure */ /* */ /****************************************************************************/ { JBI_RETURN_TYPE status = JBIC_SUCCESS; unsigned short local_expected, local_actual, shift_reg = 0xffff; int bit, feedback; unsigned char databyte; unsigned long i; unsigned long crc_section = 0L; unsigned long first_word = 0L; int version = 0; int delta = 0; #if PORT==DOS jbi_program = program; #endif if (program_size > 52L) { first_word = GET_DWORD(0); version = (int) (first_word & 1L); delta = version * 8; crc_section = GET_DWORD(32 + delta); } if ((first_word != 0x4A414D00L) && (first_word != 0x4A414D01L)) { status = JBIC_IO_ERROR; } if (crc_section >= (unsigned long) program_size) { status = JBIC_IO_ERROR; } if (status == JBIC_SUCCESS) { local_expected = (unsigned short) GET_WORD(crc_section); if (expected_crc != NULL) *expected_crc = local_expected; for (i = 0; i < crc_section; ++i) { databyte = GET_BYTE(i); for (bit = 0; bit < 8; bit++) /* compute for each bit */ { feedback = (databyte ^ shift_reg) & 0x01; shift_reg >>= 1; /* shift the shift register */ if (feedback) shift_reg ^= 0x8408; /* invert selected bits */ databyte >>= 1; /* get the next bit of input_byte */ } } local_actual = (unsigned short) ~shift_reg; if (actual_crc != NULL) *actual_crc = local_actual; if (local_expected != local_actual) { status = JBIC_CRC_ERROR; } } return (status); } JBI_RETURN_TYPE jbi_get_file_info ( PROGRAM_PTR program, long program_size, int *format_version, int *action_count, int *procedure_count ) { JBI_RETURN_TYPE status = JBIC_IO_ERROR; unsigned long first_word = 0; int version = 0; #if PORT==DOS jbi_program = program; #endif /* * Read header information */ if (program_size > 52L) { first_word = GET_DWORD(0); if ((first_word == 0x4A414D00L) || (first_word == 0x4A414D01L)) { status = JBIC_SUCCESS; version = (int) (first_word & 1L); *format_version = version + 1; if (version > 0) { *action_count = (int) GET_DWORD(48); *procedure_count = (int) GET_DWORD(52); } } } return (status); } JBI_RETURN_TYPE jbi_get_action_info ( PROGRAM_PTR program, long program_size, int index, char **name, char **description, JBI_PROCINFO **procedure_list ) { JBI_RETURN_TYPE status = JBIC_IO_ERROR; JBI_PROCINFO *procptr = NULL; JBI_PROCINFO *tmpptr = NULL; unsigned long first_word = 0L; unsigned long action_table = 0L; unsigned long proc_table = 0L; unsigned long string_table = 0L; unsigned long note_strings = 0L; unsigned long action_count = 0L; unsigned long proc_count = 0L; unsigned long act_name_id = 0L; unsigned long act_desc_id = 0L; unsigned long act_proc_id = 0L; unsigned long act_proc_name = 0L; unsigned char act_proc_attribute = 0; #if PORT==DOS int i, length; jbi_program = program; #endif /* * Read header information */ if (program_size > 52L) { first_word = GET_DWORD(0); if (first_word == 0x4A414D01L) { action_table = GET_DWORD(4); proc_table = GET_DWORD(8); string_table = GET_DWORD(12); note_strings = GET_DWORD(16); action_count = GET_DWORD(48); proc_count = GET_DWORD(52); if (index < (int) action_count) { act_name_id = GET_DWORD(action_table + (12 * index)); act_desc_id = GET_DWORD(action_table + (12 * index) + 4); act_proc_id = GET_DWORD(action_table + (12 * index) + 8); #if PORT==DOS length = 0; while (GET_BYTE(string_table + act_name_id + length) != 0) ++length; *name = jbi_malloc(length + 1); if (*name == NULL) { status = JBIC_OUT_OF_MEMORY; } else { for (i = 0; i < length; ++i) { (*name)[i] = GET_BYTE(string_table + act_name_id + i); } (*name)[length] = '\0'; } #else *name = (char *) &program[string_table + act_name_id]; #endif if (act_desc_id < (note_strings - string_table)) { #if PORT==DOS length = 0; while (GET_BYTE(string_table + act_desc_id + length) != 0) ++length; *description = jbi_malloc(length + 1); if (*description == NULL) { status = JBIC_OUT_OF_MEMORY; } else { for (i = 0; i < length; ++i) { (*description)[i] = GET_BYTE(string_table + act_desc_id + i); } (*description)[length] = '\0'; } #else *description = (char *) &program[string_table + act_desc_id]; #endif } do { act_proc_name = GET_DWORD(proc_table + (13 * act_proc_id)); act_proc_attribute = (unsigned char) (GET_BYTE(proc_table + (13 * act_proc_id) + 8) & 0x03); procptr = (JBI_PROCINFO *) jbi_malloc(sizeof(JBI_PROCINFO)); if (procptr == NULL) { status = JBIC_OUT_OF_MEMORY; } else { #if PORT==DOS length = 0; while (GET_BYTE(string_table + act_proc_name + length) != 0) ++length; procptr->name = jbi_malloc(length + 1); if (procptr->name == NULL) { status = JBIC_OUT_OF_MEMORY; } else { for (i = 0; i < length; ++i) { procptr->name[i] = GET_BYTE(string_table + act_proc_name + i); } procptr->name[length] = '\0'; } #else procptr->name = (char *) &program[string_table + act_proc_name]; #endif procptr->attributes = act_proc_attribute; procptr->next = NULL; /* add record to end of linked list */ if (*procedure_list == NULL) { *procedure_list = procptr; } else { tmpptr = *procedure_list; while (tmpptr->next != NULL) tmpptr = tmpptr->next; tmpptr->next = procptr; } } act_proc_id = GET_DWORD(proc_table + (13 * act_proc_id) + 4); } while ((act_proc_id != 0) && (act_proc_id < proc_count)); } } } return (status); }
Aristagoras and Histiaios: The Leadership Struggle In The Ionian Revolt In the early years of the fifth century, the Greek cities of Asia Minor attempted to free themselves from Persian rule. Our primary evidence for the unsuccessful Ionian Revolt is literary, a patchwork from the narrative of Herodotus ivvi. The main events of the Revolt need not be doubted: the Ionian cities were ruled by Greek puppet tyrants until the outbreak of the rebellion (Hdt. 4.1367); Aristagoras was the early leader of the movement which began after the failure of the Persian-Milesian expedition against Naxos (5.305); Athens, petitioned by Aristagoras, and Eretria supplied limited support for-the Revolt (5.38; 55; 65; 97; 99);
. OBJECTIVE To compare the results of the natural cycle and ovulation induction cycle in intrauterine insemination (IUI) for infertile couples of different ages. METHODS We retrospectively analyzed 746 IUI cycles for 363 infertile couples, who were divided into a natural cycle (NC) and an ovulation induction cycle (OIC) group. The two groups were respectively subdivided into a < 35 yr and a > or = 35 yr age group, and, according to the drugs used, the OIC group was again divided into subgroups of clomiphene citrate + Progynova (CC + P), menopausal gonadotropin (HMG) and CC + HMG. The rates of clinical pregnancy, abortion and delivery were compared among different groups. RESULTS The pregnancy rate was significantly lower in the NC than in the OIC group (11.35% versus 19.61%, P < 0.01), but the rates of abortion and delivery had no significant differences between the two groups (P > 0.05), nor did the rate of clinical pregnancy among the subgroups of CC + P, HMG and CC + HMG (18.00%, 25.00% and 19.35%, P > 0.05). The < 35-year-old patients showed statistically lower rates of pregnancy and delivery in the NC than in the OIC group (P < 0.01 and P < 0.05), while the > or = 35-year-olds exhibited no significant differences in the rates of clinical pregnancy, abortion and delivery between the two groups. CONCLUSION The ovulation induction cycle could achieve a higher pregnancy rate than the natural cycle in IUI, whether with CC + P, HMG or CC + HMG, particularly for the infertile patients under 35 years. But the natural cycle is preferable for the > or = 35-year-olds.
Rapid Implementation of High-Frequency Wastewater Surveillance of SARS-CoV-2 There have been over 507 million cases of COVID-19, the disease caused by the severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2), resulting in 6 million deaths globally. Wastewater surveillance has emerged as a valuable tool in understanding SARS-CoV-2 burden in communities. The National Wastewater Surveillance System (NWSS) partnered with the United States Geological Survey (USGS) to implement a high-frequency sampling program. This report describes basic surveillance and sampling statistics as well as a comparison of SARS-CoV-2 trends between high-frequency sampling 35 times per week, referred to as USGS samples, and routine sampling 12 times per week, referred to as NWSS samples. USGS samples provided a more nuanced impression of the changes in wastewater trends, which could be important in emergency response situations. Despite the rapid implementation time frame, USGS samples had similar data quality and testing turnaround times as NWSS samples. Ensuring there is a reliable sample collection and testing plan before an emergency arises will aid in the rapid implementation of a high-frequency sampling approach. High-frequency sampling requires a constant flow of information and supplies throughout sample collection, testing, analysis, and data sharing. High-frequency sampling may be a useful approach for increased resolution of disease trends in emergency response. ■ INTRODUCTION COVID-19, the disease caused by the severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2), was declared a pandemic by the World Health Organization (WHO) in March 2020 and has resulted in over 507 million cases and 6 million deaths globally. 1 COVID-19 symptoms include fever, cough, and shortness of breath, but almost 30% of infected individuals are asymptomatic. 2,3 Asymptomatic infections pose a challenge for public health control because the affected individuals often do not seek care or testing. As a result, the presence of asymptomatic infections leads to under-ascertainment of SARS-CoV-2 in a community. Other challenges to accurate ascertainment of cases include a lack of capacity and funding for large-scale clinical testing and healthcare. Public health agencies continue to face many challenges identifying and tracking the burden of COVID-19 in a community, but new methods to monitor the outbreak, such as wastewater surveillance, are emerging. 4 SARS-CoV-2 is a respiratory pathogen; however, viral ribonucleic acid (RNA) may be detected in stool of infected individuals. 4−6 A meta-analysis from Zhang et. al found that the pooled prevalence of SARS-CoV-2 RNA in stool samples from COVID-19 cases was 43%. 7,8 Some research indicates that viral RNA can be detected in stools before symptom onset; however, it has also been noted that positive nasal swabs precede the detection of viral RNA in stool samples. 6,7,9 Research continues to develop to refine the timeline of respiratory and fecal positivity in infected individuals. 8 Because SARS-CoV-2 can be detected in stool, wastewater surveillance is a valuable tool in understanding the presence of SARS-CoV-2 in communities. 4 With a single sample, wastewater surveillance can provide information on SARS-CoV-2 infections in communities. Importantly, both symptomatic and asymptomatic cases are reflected in wastewater data. Wastewater surveillance also enables public health agencies to monitor SARS-CoV-2 community trends, independent of clinical testing access and availability, and healthcare-seeking behaviors. 10 Given the benefits of wastewater surveillance, countries around the world have implemented wastewater surveillance to detect SARS-CoV-2 in communities. 11−13 Programs for SARS-CoV-2 wastewater surveillance have shown great success globally. 14−17 Wastewater surveillance for SARS-CoV-2 can help local health departments target mitigation efforts to control the spread of the virus. 18 The Centers for Disease Control and Prevention (CDC) established the National Wastewater Surveillance System (NWSS) in September 2020 to better understand trends in SARS-CoV-2 infections and provide an early warning of increasing infections in communities throughout the United States. 18 State, tribal, local, and territorial health departments report wastewater testing data to NWSS 1−2 times per week for summarizing and interpreting data for public health action. These sampling efforts are considered routine wastewater surveillance because they are embedded into existing heath department programmatic activities and focus on the longevity of data collection and use as a disease surveillance tool. In August 2021, NWSS partnered with the United States Geological Survey (USGS) Environmental Health Program, which has long studied wastewater contaminants and impacts, to assess the feasibility and value of rapid scale-up of routine wastewater surveillance sampling to provide localized highfrequency testing of SARS-CoV-2 in wastewater. 19,20 Highfrequency sampling may provide more value than routine sampling by more accurately monitoring outbreak onset, estimating more timely disease trends, and understanding disease re-emergence. In particular, the ability to rapidly scaleup wastewater surveillance may be an effective surveillance tool in emergency response situations. USGS high-frequency sampling occurred 3−5 times per week at each wastewater treatment plant (WWTP). The purposes of this study were to understand the logistical challenges and solutions for rapid scale-up of wastewater sampling and to assess the added value of high-frequency data compared with routine samples by evaluating surveillance and sampling metrics as well as SARS-CoV-2 concentration trends. ■ METHODS Data Set. Between September 7 and 29, 2021, the USGS collected 354 wastewater samples (referred to as USGS samples), conducted quantitative analysis for the presence of SARS-CoV-2, and reported the data to the CDC. The USGS sampling sites included 25 WWTPs in Colorado, Missouri, North Carolina, Ohio, Utah, and Wisconsin. The USGS samples were collected 3−5 times per week for high-frequency sampling, and the NWSS wastewater samples (referred to as NWSS samples) were collected 1−2 times per week for routine sampling. Between September 7 and 29th, 2021, 10 state and local health departments collected 1758 wastewater samples at 368 WWTPs as part of routine NWSS surveillance. The NWSS samples and sampling locations that were not part of the USGS sampling efforts were excluded from the analysis (excluded number of samples = 1602; excluded number of WWTPs = 345). One WWTP included in USGS sampling was not part of the NWSS samples and was excluded from the analysis (excluded number of samples = 10). The NWSS samples were collected from 24 WWTPs also sampled by the USGS. The comprehensive data set consisted of 500 samples combined from the USGS and NWSS (344 and 156, respectively). Quality control checks were applied to the NWSS and USGS data sets in the CDC DCIPHER data platform, which included required variables that were either missing or improperly formatted. Data reporters were able to view their quality control report at any time. Quality control issues were categorized as required or attention. Attention fields are not as critical but may indicate a problem with the quality of the data. Examples of attention issues include indicating a microbial human fecal marker was measured but not providing a concentration for this marker or improper formatting of the solids separation method. Required issues denote problems with fields that must be included in the data file; otherwise, the sample might be excluded from analysis. Data fields required for inclusion of sample results include sample collection date, testing methods, flow rate, and population served. Some samples from the USGS comprehensive data set were excluded from the final data sets due to missing or invalid required variables. The final data set consisted of 452 samples combined from the USGS and NWSS (296 and 156, respectively). 21 Surveillance metrics included the WWTP state, population served (estimated number of persons whose sewage was captured by the sampling site as reported by the WWTP), and days from sample collection to sample testing (to assess timeliness). Sampling metrics included sample location (centralized WWTP or upstream) and sample type (grab or composite ). The volumetric flow at the sampling location was reported as million gallons per day (MGD). Also, the PCR type (reverse transcriptase quantitative polymerase chain reaction or reverse transcriptase droplet digital polymerase chain reaction ) and gene target (N1, N2, or N1 and N2 combined) used to detect the presence of SARS-CoV-2 were reported. The SARS-CoV-2 concentration was reported as copies per liter (copies/L) of wastewater and was also dichotomized to identify whether SARS-CoV-2 was detected in the sample. Detection is defined as the SARS-CoV-2 concentration being above the assay and instrumentation limit of detection (LOD). All surveillance and sampling metrics were required to accompany each sample and were flagged by a quality control check if they were not present upon data submission. USGS Sample Collection and Testing. Untreated influent wastewater samples were collected by USGS and WWTP personnel. Initial planning was conducted by the USGS in collaboration with each participating WWTP to establish facility-specific logistics, including safety and sampling protocols, access limitations, and personnel points of contact. Facility-specific sampling protocols based on modifications of the USGS national field manual methods for the collection and processing of water samples were employed along with personal protective equipment (PPE) and use protocols based on CDC guidance for protection against dermal and inhalation exposures to infectious diseases. 19,22−24 For high-frequency sampling, 24 h flow-based composite samples (250 mL) were collected by a refrigerated autosampler at grate or spigot access points. Composite samples and a tap water-filled temperature control (250 mL amber glass) were double bagged, bubble wrapped, encased in frozen gel packs (4°C ), and shipped after collection overnight for analysis. At the ACS ES&T Water pubs.acs.org/estwater Article USGS Eastern Ecology Science Center Biosafety Level 3 laboratory, samples were extracted using the kit-free "Sewage, Salt, Silica and SARS-CoV-2" (4S) method 25 of the recent interlaboratory SARS-CoV-2 wastewater monitoring assessment. 26 The 4S extraction method employs affordable and readily available sodium chloride (NaCl), ethanol, and silica RNA-capture matrices, thus minimizing supply chain constraints that may arise during pandemic and other emergencyresponse conditions. Mouse Hepatitis Virus (MHV) and the N2 and E genes of SARS-CoV-2 were quantified by RT-ddPCR using a multiplex assay kit. A single-plex RT-ddPCR quantification assay for pepper mild mottle virus (PMMoV) was conducted for normalization of human fecal load. 27−29 See the Supporting Information for further details (Table S1). NWSS Sample Collection and Testing. As part of the NWSS routine wastewater surveillance, WWTPs collected raw wastewater samples approximately twice a week at WWTPs or upstream in the wastewater network. WWTPs collected 22−25 h time-based or flow-based composite samples according to facility capacity and available resources. Samples were stored and transported at 4°C and, where possible, refrigerated during the collection process. If samples could not be processed within 24 h, a matrix recovery control was spiked into the sample before refrigerating at 4°C or freezing at −20 or −70°C. State health departments identified testing laboratories, which included state-and federal-owned, public health, academic, or commercial laboratories, to quantify SARS-CoV-2 in wastewater from the NWSS samples. Samples were concentrated using concentrating pipet ultrafiltration, membrane filtration, or polyethylene glycol (PEG) precipitation. RNA or total nucleic acid extraction kits were used to extract and isolate SARS-CoV-2 RNA from the samples. SARS-CoV-2 RNA concentrations were quantified using RT-qPCR or RT-ddPCR with N1 and/or N2 gene targets with a standard curve (if using RT-qPCR). 30−33 To enable normalization of wastewater concentrations and to ensure the quality of each result, testing laboratories included recovery efficiency controls and endogenous human fecal markers including pepper mild mottle virus (PMMoV) and crAssphage (Table S1). 34 Statistical Analysis. Descriptive statistics were calculated for all surveillance and sampling metrics. Flow-population normalized SARS-CoV-2 concentrations were plotted by state, which provide an estimate of the total amount of SARS-CoV-2 RNA in the wastewater sample relative to a static population estimate for the sewershed. This normalization approach indicates whether the total number of individuals in the sewershed who are shedding SARS-CoV-2 RNA has changed. Statistical trends were calculated using SparkR and PySpark in the DCIPHER platform (DCIPHER Foundry, Palantir Inc., Denver, CO, United States) using every third and fifth sample per sampling site. Trends were classified into five categories (sustained increase, increase, plateau, decrease, or sustained decrease). A trend was classified as "increasing" if the slope was statistically significantly positive or was classified as "decreasing" if the slope was statistically significantly negative over three samples (p < 0.05, two-tailed test). If the slope was statistically significantly positive or negative over five samples, it was considered a "sustained increase" or "sustained decrease", respectively (p < 0.05, two-tailed test). If no statistically significant change at the = 0.05 level was found over either number of samples, the trend is classified as a "plateau". If fewer than three samples were available to calculate a trend, it is classified as "unknown". Statistical trends were compared by WWTP and sample collection date to identify trends that agreed. For example, if a USGS and NWSS sample both reported a plateau for the same WWTP and sample collection date, the trend agreed. If a USGS and NWSS sample reported a different trend for the same WWTP and sample collection date, the trend did not agree. The percent of time the trends agreed between the USGS and the NWSS is provided as support to the SARS-CoV-2 flow-population normalized concentrations. ■ RESULTS Quality Control Review. Most quality control issues for the USGS and NWSS samples were for required fields (66.1%, n = 773 and 83.7%, n = 166, respectively) compared to attention fields (33.9%, n = 396 and 16.3%, n = 27, respectively). The most common required field issues for USGS samples included recovery-control spike concentration, PCR target, or WWTP name information. For NWSS sample variables, the most common required field issues included concentration method, extraction method, or sample-type information. The most common attention field issues for the USGS and NWSS samples were microbial target information and SARS-CoV-2 concentration 95% confidence intervals. Surveillance Metrics. The final data set consisted of 452 samples collected from 24 WWTPs. The USGS collected an average of 13.1 (10.0−15.0) (mean (range)); Table 1) samples per week, and the 6 NWSS states collected an average of 6.7 (6.0−7.0) (mean (range)) samples per week.The average population served by the WWTPs was 138 947 (11 883− 488 000) (mean (range)) persons for USGS sites and 161 747 (11 883−488 000) (mean (range)) persons for NWSS sites. On average, there were 3.4 (2.0−7.0) (mean (range)) days between the beginning of sample collection and the completion of sample testing for USGS samples and 3.8 (0.0−15.0) (mean (range)) days for NWSS samples. Other surveillance metric characteristics of the wastewater samples are described in Table 1 and Table S1. SARS-CoV-2 Flow-Population Normalized Concentrations. We compared the average SARS-CoV-2 flow-population normalized concentrations from USGS high-frequency sampling and NWSS routine sampling to understand the differences between the two data sources (Figure 1). We also compared statistical trends for USGS and NWSS samples by sample collection date and WWTP. Matched trends between the USGS and the NWSS samples agreed 58% (193/330) of the time (Table S2). Overall, high-frequency sampling provided a more nuanced indication of average SARS-CoV-2 flow-population normalized concentration changes in each state. Colorado, Missouri, Ohio, Utah, and Wisconsin showed similar trajectories of average SARS-CoV-2 flow-population normalized concentrations between USGS and NWSS sampling. However, the USGS results may more accurately capture fluctuations in average SARS-CoV-2 flowpopulation normalized concentrations better than the NWSS results. North Carolina was the only state with a slightly different trajectory between the USGS and the NWSS sampling. The USGS sampling in North Carolina demonstrated decreasing average SARS-CoV-2 flow-population normalized concentrations, whereas the NWSS sampling showed a slight increase, which could be due to the large number of nondetects. ■ DISCUSSION This study evaluated the rapid scale-up of wastewater sampling frequency and the utility of such efforts for community SARS-CoV-2 monitoring but also compared respective surveillance and sampling metrics and SARS-CoV-2 flow-population normalized concentrations and trends between the USGS and the NWSS. Sampling and testing methods for the USGS and NWSS varied; however, both programs successfully estimated SARS-CoV-2 concentrations in the same communities. Our data suggest that high-frequency sampling may benefit communities using wastewater surveillance for SARS-CoV-2 emergency response and provide more accurate fluctuations in SARS-CoV-2 flow-population normalized concentrations compared to routine sampling. Being able to understand subtle differences in SARS-CoV-2 flow-population normalized concentrations over time could be important in identifying emerging issues, particularly in emergency response settings where wastewater sampling can be used. 35 Highfrequency sampling can be supported by a variety of sampling and testing methods but requires careful planning and prepared staff to rapidly implement. Sampling methods differed between the USGS and the NWSS. Both sampling approaches produced quality data and successfully estimated SARS-CoV-2 flow-population normalized concentrations in communities. Despite the rapid scale-up of sampling by the USGS, data quality issues were minimal and similar to those for routine sampling. Most quality control issues for the USGS and NWSS were missing required fields. The attention fields for the USGS and NWSS were related to The high-quality data produced by both approaches are in part due to the standardization of data collection, which defines variables, allowed values, and proper formats before sample collection to ensure comparable results. Likewise, the delivery of highfrequency sampling data with minimal data quality issues, despite the increased logistical challenges, was attributable in large part to leveraging the existing network of well-trained USGS personnel around the country to quickly support sample collection and testing. In addition to high-quality data, the time from sample collection to sample testing was comparable for USGS highfrequency and routine NWSS sampling approaches, differing by less than 1 day. This further exemplifies that rapid scaling of wastewater testing can also produce data equally as timely as routine surveillance. It has been shown that compared to clinical SARS-CoV-2 testing of individuals suspected to have COVID-19, wastewater surveillance can provide a beneficial lead time to identify an increase in SARS-CoV-2 in a community. 36,37 Clinical testing for SARS-CoV-2 produces results around 3−9 days after symptom onset and is dependent on the availability of resources; wastewater sample results can be delivered on average 2−4 days quicker than clinical testing results. 37 The USGS and NWSS tested samples within 4 days of collection, on average, which may provide results days before clinical testing results. Because of the potentially expedited results, wastewater surveillance may provide an earlier indication of increases in cases than clinical testing. In addition, there are barriers to clinical testing including the availability and funding of testing resources and the need for individuals to seek out testing. Despite different sample collection and testing methods, the sample turnaround time between the USGS and the NWSS was roughly the same, illustrating that high-frequency sampling approaches can be implemented with no reduction in timeliness of results. High-frequency sampling provided a more nuanced impression of the trajectory of average SARS-CoV-2 flowpopulation normalized concentrations, which could be helpful in emergency response situations. Having an earlier indication of changing trends could be useful in emergency response settings to be able to take quick action on public health measures and better understand changes in disease occurrence. 35 Pandemic influenza plans from the WHO and CDC include plans for disease surveillance, which often rely on clinical testing and data from hospitals, and emphasize reducing expenses and increasing effectiveness. 38,39 Wastewater surveillance can be a valuable tool in natural disaster by providing an estimate of disease in a population based on a single wastewater sample. A natural disaster may disrupt travel, electrical, and communications systems, whereas sewage systems are underground and are less likely to incur damage. Residents in a community affected by a natural disaster will continue to use their sewage system but may be unable or less likely to travel to clinical testing facilities. In addition, a natural disaster may force residents in emergency shelters which provides an environment for diseases to spread. Although the focus of this study was on community-level wastewater sampling, institution-or building-level wastewater surveillance is possible. As a result, a single sample could represent the entire population housed in the shelters. The ability to identify a pathogen or observe an increase in pathogen levels is important to avoid an outbreak in these shelters. Our data suggest that a high-frequency sampling approach would be beneficial in emergency response and natural disaster settings to understand disease trends and enable quick public health action. High-frequency sampling requires a strategic approach while maximizing the utilization of resources to understand disease trends in communities. ACS ES&T Water pubs.acs.org/estwater Article A high-frequency sampling approach requires a constant flow of information and supplies throughout sample collection, testing, analysis, and data sharing. The goal of high-frequency sampling was to report results within 3 days of sample collection. Developing and piloting a high-frequency sampling approach before an emergency can help execute the sampling campaign under emergency conditions. As part of the emergency preparedness plan, it is important to establish a list of WWTPs in the area, along with plant operator contact information, to quickly contact the facility to communicate the sample collection and shipping plan. The plan for collecting and shipping samples may include how to distribute resources (e.g., PPE and sampling kits), identification and allocation of staffing to collect samples, and coordination of overnight shipping logistics ( Figure 2). As with any emergency or disaster response, advanced preparation is critical for success. Therefore, a sample collection and testing plan will ensure the success and rapid implementation of a high-frequency sampling plan in emergency situations. Challenges of wastewater surveillance include the lack of a standard method for testing samples in the United States, which makes direct comparisons of SARS-CoV-2 wastewater concentrations difficult and produces barriers to analysis between different WWTPs and wastewater surveillance programs. Therefore, much of our analysis is descriptive and not inferential in nature. However, research continues to support the variety of sampling methods used to detect SARS-CoV-2 in wastewater. 34,40−42 It is important when analyzing and interpreting data to directly compare only concentration data obtained using the same laboratory methods due to confounding differences in sensitivity between methods. 42−44 Differences in sample testing methods should be accounted for when constructing a surveillance plan, and the same laboratory methods and testing laboratory should be used when feasible. It is worth noting that wastewater surveillance is not a practicable outbreak monitoring approach for septic-systemdependent communities, which comprise approximately 25% of all U.S. households. 18 Finally, wastewater surveillance might not be feasible in disaster settings if the disaster disrupts the wastewater network or WWTP. ■ CONCLUSIONS Nationwide programs for SARS-CoV-2 wastewater surveillance have proven to be a cost-effective approach to monitor trends of SARS-CoV-2 in communities. 45 Wastewater surveillance can be used to allocate resources, assess the spread of emerging threats such as SARS-CoV-2, and understand disease trends in communities. This study demonstrates that high-frequency sampling can be conducted in emergency response and natural disaster settings to deliver more nuanced SARS-CoV-2 community assessment. Rapidly scaling up high-frequency wastewater surveillance requires a coordination and logistics preparedness plan paired with available capacity in trained staff and established testing laboratories. High-frequency sampling may be a useful approach for increased resolution of disease trends and enable emergency responders to act more quickly to avert disease spread.
11C-Methionine Uptake in the Lactating Human Breast. ABSTRACT A 33-year-old nursing mother who underwent resection of a glioblastoma of the right hemisphere was referred for a 11C-methionine PET/MR scan to exclude cancer recurrence. In whole-body PET imaging, a slight radiotracer uptake could be observed in the mammary glands, reflecting lactation status. In this case report, we initially describe 11C-methionine uptake in the human breast and discuss any consequences arising from this special situation.
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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 com.aliyun.odps.mapred.bridge; import java.io.Closeable; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.Iterator; import java.util.List; import java.util.Map.Entry; import java.util.PriorityQueue; import java.util.TreeMap; import com.aliyun.odps.OdpsType; import com.aliyun.odps.mapred.bridge.utils.VersionUtils; import com.aliyun.odps.mapred.utils.SchemaUtils; import com.aliyun.odps.type.TypeInfo; import org.apache.commons.lang.ArrayUtils; import com.aliyun.odps.Column; import com.aliyun.odps.counter.Counter; import com.aliyun.odps.data.Record; import com.aliyun.odps.data.TableInfo; import com.aliyun.odps.data.TableInfo.TableInfoBuilder; import com.aliyun.odps.io.LongWritable; import com.aliyun.odps.data.RecordComparator; import com.aliyun.odps.io.Writable; import com.aliyun.odps.mapred.Mapper; import com.aliyun.odps.mapred.Mapper.TaskContext; import com.aliyun.odps.mapred.Partitioner; import com.aliyun.odps.mapred.Reducer; import com.aliyun.odps.mapred.bridge.type.ColumnBasedRecordComparator; import com.aliyun.odps.mapred.bridge.utils.MapReduceUtils; import com.aliyun.odps.mapred.conf.BridgeJobConf; import com.aliyun.odps.mapred.conf.JobConf; import com.aliyun.odps.mapred.utils.InputUtils; import com.aliyun.odps.udf.ExecutionContext; import com.aliyun.odps.udf.annotation.NotReuseArgumentObject; import com.aliyun.odps.udf.annotation.PreferWritable; import com.aliyun.odps.utils.ReflectionUtils; @PreferWritable @NotReuseArgumentObject public class LotMapperUDTF extends LotTaskUDTF { public LotMapperUDTF() { super(); } public LotMapperUDTF(String functionName) { super(functionName); } class DirectMapContextImpl extends UDTFTaskContextImpl implements TaskContext { Record record; TableInfo inputTableInfo; Partitioner partitioner; public DirectMapContextImpl(BridgeJobConf conf, TableInfo tableInfo, ExecutionContext context) { super(conf); inputTableInfo = tableInfo; record = new WritableRecord(inputSchema); // only map stage need column access info now if (!conf.getBoolean("odps.mapred.mark.input.columns.all.used", false)) { ((WritableRecord)record).setEnableColumnAccessStat(true); } configure(context); } @Override boolean isMapper() { return true; } @SuppressWarnings({"unchecked"}) public void configure(ExecutionContext ctx) { super.configure(ctx); Class<? extends Partitioner> partitionerClass; if (pipeMode) { conf.setMapperClass(pipeNode.getTransformClass()); partitionerClass = pipeNode.getPartitionerClass(); } else { partitionerClass = getJobConf().getPartitionerClass(); } // support for different mapper-class of multiple input tables if (inputTableInfo != null && inputTableInfo.getMapperClass() != null) { conf.setMapperClass((Class<? extends Mapper>) (inputTableInfo.getMapperClass())); } if (partitionerClass != null) { partitioner = ReflectionUtils.newInstance(partitionerClass, getJobConf()); partitioner.configure(conf); } // for inner output if (innerOutput && reducerNum > 0) { Column[] keyCols = new Column[0]; Column[] valCols = new Column[0]; if (pipeMode && pipeNode != null && pipeNode.getType().equals("map")) { keyCols = pipeNode.getOutputKeySchema(); valCols = pipeNode.getOutputValueSchema(); } else { keyCols = conf.getMapOutputKeySchema(); valCols = conf.getMapOutputValueSchema(); } Column[] outputFields = new Column[keyCols.length + valCols.length + packagedOutputSchema.length]; int len = 0; for (Column col : keyCols) { outputFields[len++] = col; } for (Column col : valCols) { outputFields[len++] = col; } innerOutputIndex = len; for (Column col : packagedOutputSchema) { outputFields[len++] = col; } packagedOutputSchema = outputFields; } } @Override public void write(Record r) throws IOException { write(r, TableInfo.DEFAULT_LABEL); } @Override public void write(Record r, String label) throws IOException { if (!innerOutput && getNumReduceTasks() > 0) { throw new UnsupportedOperationException(ErrorCode.UNEXPECTED_MAP_WRITE_OUTPUT.toString()); } if (!hasLabel(label)) { throw new IOException(ErrorCode.NO_SUCH_LABEL.toString() + " " + label); } if (innerOutput) { write(createInnerOutputRow(((WritableRecord)r).toWritableArray(), true, TableInfo.INNER_OUTPUT_LABEL, label)); } else { write(createOutputRow(r, label)); } } @Override public void write(Record key, Record value) { if (getNumReduceTasks() == 0) { throw new UnsupportedOperationException(ErrorCode.UNEXPECTED_MAP_WRITE_INTER.toString()); } Writable[] keyArray = ((WritableRecord) key).toWritableArray(); Writable[] valueArray = ((WritableRecord) value).toWritableArray(); Writable[] result; int idx = 0; if (partitioner != null) { int part = partitioner.getPartition(key, value, getNumReduceTasks()); if (part < 0 || part >= getNumReduceTasks()) { throw new RuntimeException("partitioner return invalid partition value:" + part); } result = new Writable[1 + keyArray.length + valueArray.length]; result[idx++] = new LongWritable(part); } else { result = new Writable[keyArray.length + valueArray.length]; } for (Writable obj : keyArray) { result[idx++] = obj; } for (Writable obj : valueArray) { result[idx++] = obj; } if (innerOutput) { write(createInnerOutputRow(result, false, TableInfo.DEFAULT_LABEL, TableInfo.DEFAULT_LABEL)); } else { write(result); } } protected void write(Object[] record) { collect(record); } @Override public long getCurrentRecordNum() { return rowNum; } @Override public Record getCurrentRecord() { return record; } @Override public boolean nextRecord() { Object[] values = getNextRowWapper(); if (values == null) { return false; } rowNum++; if (rowNum == nextCntr) { StateInfo.updateMemStat(); nextCntr = getNextCntr(rowNum, true); } if (rowNum == nextRecordCntr) { StateInfo.updateMemStat("processed " + rowNum + " records"); nextRecordCntr = getNextCntr(rowNum, false); } record.set(values); return true; } @Override public TableInfo getInputTableInfo() { return inputTableInfo; } void AddFrameworkCounters() { // not to break counters number limit try { ctx.getCounter("ODPS_SDK_FRAMEWORK_COUNTER_GROUP", "input_col_total_num").setValue(record.getColumnCount()); ctx.getCounter("ODPS_SDK_FRAMEWORK_COUNTER_GROUP", "input_col_used_num").setValue(((WritableRecord) record).getColumnAccessedNum()); } catch (IllegalArgumentException e) { // ignore it } } } interface CombineContext { public void offerKeyValue(Record key, Record value) throws InterruptedException; public void spill(); } /** * A proxied map context implementation. */ class ProxiedMapContextImpl extends DirectMapContextImpl implements Closeable { class NonGroupingCombineContextImpl extends DirectMapContextImpl implements com.aliyun.odps.mapred.Reducer.TaskContext, CombineContext { private class CombinerBuffer extends TreeMap<Object[], List<Object[]>> { private static final long serialVersionUID = 1L; public CombinerBuffer(Comparator<Object[]> comparator) { super(comparator); } public boolean offerKeyValue(Record key, Record value) throws InterruptedException { boolean rt = false; Object[] objKey = Arrays.copyOf(((WritableRecord) key).toWritableArray(), key.getColumnCount()); List<Object[]> objValue; if (super.containsKey(objKey)) { objValue = super.get(objKey); } else { objValue = new ArrayList<Object[]>(); super.put(objKey, objValue); } rt = objValue.add(Arrays.copyOf(((WritableRecord) value).toWritableArray(), value.getColumnCount())); return rt; } } private Record key; private Record value; private Iterator<Entry<Object[], List<Object[]>>> itr; private List<Object[]> curValuelist; private int velocity = 0; private int threshold = 0; private int size = 0; private CombinerBuffer combinerBuffer; private CombinerBuffer backupCombinerBuffer; private NonGroupingRecordIterator recordsItr; public NonGroupingCombineContextImpl(BridgeJobConf conf, int velocity, float spillPercent, Comparator<Object[]> keyComparator, ExecutionContext context) { super(conf, null, context); if (pipeMode) { key = new WritableRecord(pipeNode.getOutputKeySchema()); value = new WritableRecord(pipeNode.getOutputValueSchema()); } else { key = new WritableRecord(conf.getMapOutputKeySchema()); value = new WritableRecord(conf.getMapOutputValueSchema()); } this.velocity = velocity; threshold = (int) (velocity * spillPercent); if (threshold < 0) { threshold = 0; } else if (threshold > velocity) { threshold = velocity; } combinerBuffer = new CombinerBuffer(keyComparator); backupCombinerBuffer = new CombinerBuffer(keyComparator); } @Override public void write(Record r) throws IOException { ProxiedMapContextImpl.this.write(r); } @Override public void write(Record r, String label) throws IOException { ProxiedMapContextImpl.this.write(r, label); } @Override public Record getCurrentKey() { return key; } @Override public boolean nextKeyValue() { if (itr.hasNext()) { Entry<Object[], List<Object[]>> entry = itr.next(); curValuelist = entry.getValue(); recordsItr = new NonGroupingRecordIterator(curValuelist, (WritableRecord) value); key.set(Arrays.copyOf(entry.getKey(), key.getColumnCount())); return true; } return false; } @Override public Iterator<Record> getValues() { return recordsItr; } @Override public void write(Record key, Record value) { try { backupCombinerBuffer.offerKeyValue(key, value); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public void offerKeyValue(Record key, Record value) throws InterruptedException { combinerBuffer.offerKeyValue(key, value); if (++size >= velocity) { combine(); // after combine, check backupCombinerBuffer's size, whether need to spill if (backupCombinerBuffer.size() >= threshold) { spill(); } else { // just swap the two buffers CombinerBuffer tmp = null; tmp = combinerBuffer; combinerBuffer = backupCombinerBuffer; backupCombinerBuffer = tmp; size = combinerBuffer.size(); } } } @Override public void spill() { if (combinerBuffer.size() > 0) { combine(); } for (Entry<Object[], List<Object[]>> it : backupCombinerBuffer.entrySet()) { List<Object[]> objList = it.getValue(); ((WritableRecord)key).set(it.getKey()); ((WritableRecord)value).set(objList.get(0)); ProxiedMapContextImpl.this.writeDirect(key, value); } backupCombinerBuffer.clear(); } private void combine() { this.itr = combinerBuffer.entrySet().iterator(); try { MapReduceUtils.runReducer((Class<Reducer>) this.getCombinerClass(), this); } catch (IOException e) { throw new RuntimeException(e); } finally { combinerBuffer.clear(); size = 0; } } } class GroupingCombineContextImpl extends DirectMapContextImpl implements com.aliyun.odps.mapred.Reducer.TaskContext, CombineContext { private class CombinerBuffer extends PriorityQueue<Object[]> { private static final long serialVersionUID = 1L; public CombinerBuffer(int velocity, Comparator<Object[]> comparator) { super(velocity, comparator); } public boolean offerKeyValue(Record key, Record value) throws InterruptedException { return super.offer(ArrayUtils.addAll(((WritableRecord) key).toWritableArray(), ((WritableRecord) value).toWritableArray())); } } private int velocity = 0; private Record key, value; private GroupingRecordIterator itr; private CombinerBuffer combinerBuffer; private Comparator<Object[]> keyComparator = null; private Comparator<Object[]> keyGroupingComparator = null; public GroupingCombineContextImpl(BridgeJobConf conf, int bufferSize, Comparator<Object[]> comparator, ExecutionContext context) { super(conf, null, context); configure(context, comparator); velocity = bufferSize; combinerBuffer = new CombinerBuffer(bufferSize, keyComparator); } public void configure(ExecutionContext ctx, Comparator<Object[]> comparator) { super.configure(ctx); keyComparator = comparator; String[] keyGrpColumns; Column[] keyRS; JobConf.SortOrder[] keySortOrder; Class< ? extends RecordComparator> keyComparatorClass = null; Class< ? extends RecordComparator> keyGroupingComparatorClass = null; if (pipeMode) { key = new WritableRecord(pipeNode.getOutputKeySchema()); value = new WritableRecord(pipeNode.getOutputValueSchema()); keyGrpColumns = pipeNode.getOutputGroupingColumns(); keyRS = pipeNode.getOutputKeySchema(); keySortOrder = pipeNode.getOutputKeySortOrder(); keyComparatorClass = pipeNode.getInputKeyComparatorClass(); keyGroupingComparatorClass = pipeNode.getInputKeyGroupingComparatorClass(); } else { key = new WritableRecord(conf.getMapOutputKeySchema()); value = new WritableRecord(conf.getMapOutputValueSchema()); keyGrpColumns = conf.getOutputGroupingColumns(); keyRS = conf.getMapOutputKeySchema(); keySortOrder = conf.getOutputKeySortOrder(); keyComparatorClass = conf.getOutputKeyComparatorClass(); keyGroupingComparatorClass = conf.getOutputKeyGroupingComparatorClass(); } if (keyGroupingComparatorClass != null) { keyGroupingComparator = ReflectionUtils.newInstance(keyGroupingComparatorClass, getJobConf()); } else if (keyComparatorClass != null) { keyGroupingComparator = keyComparator; } else { keyGroupingComparator = new ColumnBasedRecordComparator(keyGrpColumns, keyRS, keySortOrder); } } @Override public void write(Record r) throws IOException { ProxiedMapContextImpl.this.write(r); } @Override public void write(Record r, String label) throws IOException { ProxiedMapContextImpl.this.write(r, label); } @Override public Record getCurrentKey() { return key; } @Override public boolean nextKeyValue() { if (itr == null) { Object[] init = combinerBuffer.peek(); if (init == null) { return false; } itr = new GroupingRecordIterator(combinerBuffer, (WritableRecord) key, (WritableRecord) value, keyGroupingComparator); key.set(Arrays.copyOf(init, key.getColumnCount())); } else { while (itr.hasNext()) { itr.remove(); } if (!itr.reset()) { return false; } } return true; } @Override public Iterator<Record> getValues() { return itr; } @Override public void write(Record key, Record value) { ProxiedMapContextImpl.this.writeDirect(key, value); } @Override public void spill() { combine(); } @Override public void offerKeyValue(Record key, Record value) throws InterruptedException { combinerBuffer.offerKeyValue(key, value); if (combinerBuffer.size() >= velocity) { combine(); } } private void combine() { itr = null; try { MapReduceUtils.runReducer((Class<Reducer>) this.getCombinerClass(), this); } catch (IOException e) { throw new RuntimeException(e); } } } CombineContext combineCtx; @SuppressWarnings({"unchecked", "rawtypes"}) public ProxiedMapContextImpl(BridgeJobConf conf, TableInfo tableInfo, ExecutionContext context) { super(conf, tableInfo, context); int bufferSize = conf.getCombinerCacheItems(); float combineBufferSpillPercent = conf.getCombinerCacheSpillPercent(); Comparator<Object[]> keyComparator; Column[] keyRS; String[] keySortColumns; String[] keyGrpColumns; JobConf.SortOrder[] keySortOrder; Class< ? extends RecordComparator> keyComparatorClass = null; Class< ? extends RecordComparator> keyGroupingComparatorClass = null; if (pipeMode) { keyRS = pipeNode.getOutputKeySchema(); keySortColumns = pipeNode.getOutputKeySortColumns(); keyGrpColumns = pipeNode.getOutputGroupingColumns(); keySortOrder = pipeNode.getOutputKeySortOrder(); // hotfix for sprint21, should remove in sprint23 // keyComparatorClass = pipeNode.getOutputKeyComparatorClass(); // keyGroupingComparatorClass = pipeNode.getOutputKeyGroupingComparatorClass(); keyComparatorClass = conf.getPipelineOutputKeyComparatorClass(pipeIndex); keyGroupingComparatorClass = conf.getPipelineOutputKeyGroupingComparatorClass(pipeIndex); } else { keyRS = conf.getMapOutputKeySchema(); keySortColumns = conf.getOutputKeySortColumns(); keyGrpColumns = conf.getOutputGroupingColumns(); keySortOrder = conf.getOutputKeySortOrder(); keyComparatorClass = conf.getOutputKeyComparatorClass(); keyGroupingComparatorClass = conf.getOutputKeyGroupingComparatorClass(); } if (keyComparatorClass != null) { keyComparator = ReflectionUtils.newInstance(keyComparatorClass, getJobConf()); } else { keyComparator = new ColumnBasedRecordComparator(keySortColumns, keyRS, keySortOrder); } if (conf.getCombinerOptimizeEnable() && Arrays.deepEquals(keySortColumns, keyGrpColumns) && keyComparatorClass == keyGroupingComparatorClass) { combineCtx = new NonGroupingCombineContextImpl(conf, bufferSize, combineBufferSpillPercent, keyComparator, context); } else { combineCtx = new GroupingCombineContextImpl(conf, bufferSize, keyComparator, context); } } @Override public void write(Record key, Record value) { try { combineCtx.offerKeyValue(key, value); } catch (InterruptedException e) { throw new RuntimeException(e); } } public void writeDirect(Record key, Record value) { super.write(key, value); } @Override public void close() throws IOException { combineCtx.spill(); } } private TaskContext ctx; private long rowNum; private long nextCntr = 1; private long nextRecordCntr = 1; private Column[] inputSchema; @SuppressWarnings("deprecation") @Override public com.aliyun.odps.udf.OdpsType[] resolve(com.aliyun.odps.udf.OdpsType[] sig) { String funtionName = conf.get("odps.mr.sql.functionName"); if (funtionName == null ){ try { return super.resolve(sig); } catch (com.aliyun.odps.udf.UDFException e) { e.printStackTrace(); } } OdpsType[] resolved = null; UDTFTaskContextImpl ctx = new UDTFTaskContextImpl(conf) { @Override public void write(Record record) throws IOException { } @Override public void write(Record record, String label) throws IOException { } @Override public void write(Record key, Record value) throws IOException { } }; boolean hasReduce; if (((UDTFTaskContextImpl) ctx).isPipelineMode()) { hasReduce = ((UDTFTaskContextImpl) ctx).getPipeline().getNodeNum() > 1; } else { int numReduceTasks = conf.getInt("odps.stage.reducer.num", -1); if (numReduceTasks == -1) { numReduceTasks = conf.getInt("odps.mapred.reduce.tasks", -1); } if (numReduceTasks == -1) { numReduceTasks = 1; } hasReduce = numReduceTasks > 0; } if (hasReduce) { resolved = SchemaUtils.getTypes(ctx.getIntermediateOutputSchema()); if (((UDTFTaskContextImpl) ctx).isPipelineMode()) { resolved = SchemaUtils.getTypes(ctx.getPipelineOutputSchema(0)); } } else { resolved = SchemaUtils.getTypes(ctx.getPackagedOutputSchema()); } return VersionUtils.getOdpsTypes(resolved); } @SuppressWarnings("deprecation") @Override public com.aliyun.odps.type.TypeInfo[] resolve(com.aliyun.odps.type.TypeInfo[] sig) { String funtionName = conf.get("odps.mr.sql.functionName"); if (funtionName == null ){ try { return super.resolve(sig); } catch (com.aliyun.odps.udf.UDFException e) { e.printStackTrace(); } } TypeInfo[] resolved = null; UDTFTaskContextImpl ctx = new UDTFTaskContextImpl(conf) { @Override public void write(Record record) throws IOException { } @Override public void write(Record record, String label) throws IOException { } @Override public void write(Record key, Record value) throws IOException { } }; boolean hasReduce; if (((UDTFTaskContextImpl) ctx).isPipelineMode()) { hasReduce = ((UDTFTaskContextImpl) ctx).getPipeline().getNodeNum() > 1; } else { int numReduceTasks = conf.getInt("odps.stage.reducer.num", -1); if (numReduceTasks == -1) { numReduceTasks = conf.getInt("odps.mapred.reduce.tasks", -1); } if (numReduceTasks == -1) { numReduceTasks = 1; } hasReduce = numReduceTasks > 0; } if (hasReduce) { resolved = SchemaUtils.getTypeInfos(ctx.getIntermediateOutputSchema()); if (((UDTFTaskContextImpl) ctx).isPipelineMode()) { resolved = SchemaUtils.getTypeInfos(ctx.getPipelineOutputSchema(0)); } } else { resolved = SchemaUtils.getTypeInfos(ctx.getPackagedOutputSchema()); } return resolved; } TableInfo getTableInfoFromDesc(String inputSpec) { if (inputSpec == null || inputSpec.isEmpty()) { throw new RuntimeException(ErrorCode.INTERNAL_ERROR.toString() + ": Input table spec not found"); } if (inputSpec.indexOf(";") > 0) { // Not supporting extreme storage, we simply skipping the partition spec // in that case. int sepIdx = inputSpec.indexOf(";"); int divIdx = inputSpec.indexOf("/"); divIdx = divIdx < 0 ? Integer.MAX_VALUE : divIdx; sepIdx = Math.min(sepIdx, divIdx); inputSpec = inputSpec.substring(0, sepIdx); } TableInfoBuilder builder = TableInfo.builder(); String[] kv = inputSpec.split("/", 2); String tableSpec = kv[0]; String[] prjtbl = tableSpec.split("\\.", 2); builder.projectName(prjtbl[0]).tableName(prjtbl[1]); if (kv.length == 2) { builder.partSpec(kv[1]); } return builder.build(); } TableInfo getTableInfo(TableInfo[] inputs, String inputSpec) { TableInfo info = getTableInfoFromDesc(inputSpec); // Set additional info for (TableInfo input : inputs) { if (MapReduceUtils.partSpecInclusive(input, info)) { TableInfo tmpInfo = new TableInfo(input); tmpInfo.setPartSpec(info.getPartSpec()); info = tmpInfo; } } return info; } @Override public void setup(ExecutionContext context) { TableInfo tableInfo = null; TableInfo[] inputs = InputUtils.getTables(conf); if (inputs != null && inputs.length > 0) { try { String inputSpec = context.getTableInfo(); tableInfo = getTableInfo(inputs, inputSpec); } catch (com.aliyun.odps.udf.InvalidInvocationException e) { tableInfo = inputs[0]; } if (inputs.length == 1 && !tableInfo.getTableName().equalsIgnoreCase(inputs[0].getTableName())) { tableInfo = inputs[0]; } } if (tableInfo != null) { inputSchema = conf.getInputSchema(tableInfo); } else { inputSchema = new Column[]{}; } if (conf.getCombinerClass() != null && conf.getNumReduceTasks() > 0) { ctx = new ProxiedMapContextImpl(conf, tableInfo, context); } else { ctx = new DirectMapContextImpl(conf, tableInfo, context); } } @Override public void close() { try { if (ctx instanceof ProxiedMapContextImpl) { ((ProxiedMapContextImpl) ctx).close(); } } catch (IOException e) { throw new RuntimeException(e); } } public void run() throws IOException { StateInfo.init(); MapReduceUtils.runMapper((Class<Mapper>) conf.getMapperClass(), ctx); // add column access info counters here, now all the user code finished if (!conf.getBoolean("odps.mapred.mark.input.columns.all.used", false)) { if (ctx instanceof DirectMapContextImpl) { ((DirectMapContextImpl) ctx).AddFrameworkCounters(); } } StateInfo.updateMemStat("mapper end"); StateInfo.printMaxMemo(); } public Object[] getNextRowWapper() { Object[] data = getNextRow(); if (data != null) { return data.clone(); } else { return null; } } }
Achievable Performance in Product-Form Networks We characterize the achievable range of performance measures in product-form networks where one or more system parameters can be freely set by a network operator. Given a product-form network and a set of configurable parameters, we identify which performance measures can be controlled and which target values can be attained. We also discuss an online optimization algorithm, which allows a network operator to set the system parameters so as to achieve target performance metrics. In some cases, the algorithm can be implemented in a distributed fashion, of which we give several examples. Finally, we give conditions that guarantee convergence of the algorithm, under the assumption that the target performance metrics are within the achievable range. I. INTRODUCTION Many stochastic systems are modelled using Markov processes. Models range from communication systems, computer networks and data center applications to content dissemination systems and physical or social interactions processes,. In particular, the framework of reversible Markov processes, allows for an extensive analysis of such systems, often geared towards optimizing performance measures such as sojourn times, queue lengths and holding costs,,. Instead of optimizing performance measures, we are interested in identifying which performance measures can be achieved. Any performance measure for which there exist finite parameters r opt such that the performance of the system equals, is called an achievable target. The collection of achievable targets is called the achievable region. A parameter is anything that changes a transition rate, such as processing speeds, number of servers and job sizes. In this paper, we describe which performance measures can be influenced in product-form networks,,,, given a list of configurable parameters. Our work makes explicit that the more configurable parameters one has, the more control one can exert on a system. We also identify the achievable region of these performance measures by assuming that parameters are unbounded, and that in this case the achievable region is a convex hull of a set of vectors. Which vectors there are in this set depends on which parameters there are, as well as which states there are in the state space. Using our analysis of the achievable region, operators can know which performance measures the operator influences when changing parameters. By examining the achievable region of a system, an operator can furthermore know which performance measures are achievable. Supposing that an operator wants its system's performance measures to equal a certain achievable target, we then proceed to show how the (distributed) online algorithm in can be used to find r opt. Related ideas on using online algorithms to optimize networks can be found in,,. The online algorithm in is a stochastic gradient algorithm,,, known to converge when operators can set parameters in a compact set and when operators choose appropriate step sizes and observation periods. We note however, that the conditions that guarantee convergence as described in are insufficient when parameters are unbounded. The conditions need to be more stringent in order to avoid extreme parameter growth. We shall capitalize on the proof methodology presented in in order to derive sufficient conditions to guarantee convergence with probability one for the application we have in mind here. In related work, Jiang and Walrand, developed a distributed online algorithm that tells nodes in CSMA/CA networks (transmitter-receiver pairs) how to set their activation rates so that their throughput equals a given target. They also identified the achievable region of the throughput under the assumption that activation rates can be unbounded. This paper generalizes and extends their results to the broad class of product-form networks. This paper discusses two topics and is organized as follows. The first topic is the achievable region. We describe our model in §II-A and identify the achievable region in §II-B for several examples in §II-C. We also provide an in-depth discussion as to how we identified the achievable region in §II-D. The second topic is finding parameters such that the performance measure of the system attains some target value from within the achievable region. We describe how to use an online algorithm to find these parameters in §III-A, and we provide sufficient conditions to guarantee convergence in §III-B. A proof that these conditions are sufficient is then given in §III-C. II. ACHIEVABLE REGION Throughout this paper, we denote by b i the i-th element of vector b. When taking a scalar function of an ndimensional vector b, we do this element-wise, i.e. exp (b) = (exp b 1,..., exp b n ) T. If we have a ||-dimensional vector b in which each element corresponds to some state x ∈, we write b x for that element of b that corresponds to state x. Similarly, we denote by A i,j the element in row i, column j of matrix A. If rows and/or columns correspond to states in, we write A x,y instead. Finally, we denote by 1 n the n-dimensional vector of which all elements equal one and by e n,i the n-dimensional vector with all of its element equalling zero except for a one in the i-th position. A. Model description Consider an irreducible, reversible Markov process {X(t)} t≥0 on a finite state space with generator matrix Q ∈ R ||||. We consider cases where the Markov process models a system in which an operator can change one or more transition rates. We assume that an operator only changes transition rates in such a way that the process remains irreducible and reversible, and to avoid trivialities, we assume that there are d > 0 configurable transition rates. We call the logarithm of such a configurable transition rate a parameter r i, where i = 1,..., d, and collect all parameters in the vector r = (r 1, r 2,..., r d ) T. In other words for i = 1,..., d, there exist x, y ∈ such that r i = ln Q x,y. Under these assumptions, the process has a steady-state distribution (r) that can be written in the product form where A ∈ R ||d is a matrix, r ∈ R d, b ∈ R || are vectors and Z(r) = 1 || T exp (Ar + b) is the normalization constant. The matrix A tells us not only which, but also by how much parameters influence steady-state probabilities, while the vector b contains all kinds of other constants such as logarithms of rates that are no parameters of the systems. When operators change parameters, the steady-state probability distribution changes. In particular, A T (r) changes, because the elements are aggregates of steady-state probabilities. These aggregates typically have a physical interpretation. For example, if the service rates i of queues i = 1,..., d in a closed Jackson network can be controlled and one defines r i = ln i, the right-hand side of reduces to the (negative) mean number of customers in queue i. We come back to this and other examples later, and we then make the analysis explicit. B. Achievable aggregrate probabilities Given some vector ∈ R d, we are interested in finding finite parameter values r opt such that A T (r opt ) =. We call our target. It is not a priori clear whether such values exist, but if they exist and if they are finite, we call the target achievable. In this paper, we identify a collection of target vectors that are achievable, which we call the achievable region A. Note that A is the interior of the convex hull of all transposed row vectors of A. This can be seen by writing where A x, denotes the row vector in matrix A corresponding to state x. In the special case of modelling a CSMA/CA network,, found that the achievable region of the throughput is the interior of the convex hull of all independent sets of an interference graph. We note that if we capture their system in our notation, A would have all independent sets of the interference graph as row vectors. Before we prove Theorem 1, which is the topic of §II-D, we discuss several examples to which Theorem 1 can be applied. 1) Finite-state birth-and-death process: Consider a birthand-death process on = {0, 1, 2,..., n}. When the system is in state x ∈ {0, 1,..., n − 1}, it goes to state x + 1 after an exponentially distributed time with mean 1/ x+1. Similarly, when the system is in state x ∈ {1,..., n}, it goes to state x−1 after an exponentially distributed time with mean 1/ x. The steady-state probability of observing the system in state x ∈ is given by which corresponds to for.., n, the right-hand side of expresses the steady-state probability P and using Theorem 1, we can characterize its achievable region. While the achievable region of P and control thereof is interesting, we want to instead determine the achievable region of each steady-state probability P. For this, we define a matrix B ∈ R nn element-wise by setting B r,c = 1 − 1 for r, c = 1,..., n. We can then use Theorem 1 to conclude that for any ∈ n such that.., n. Note that in this example, one has enough (and appropriate) parameters to control the entire steady-state distribution. 2) Closed Jackson network: Consider a closed Jackson network with d ∈ N queues and n ∈ N permanent customers. A customer that leaves queue i ∈ {1,..., d}, joins queue j ∈ {1,..., d} with probability P i,j. Customers are served at queue i with rate i. The state space is given by Suppose now that we can change i for i = 1,..., d. Define we see that the right-hand side of can be interpreted as the negative steady-state expectation of the number of customers in queue i. Using Theorem 1 with B = −I, we conclude that for any there exists ∈ (0, ∞) d so that the mean stationary queue lengths are given by 1,..., d. 3) CSMA network on a partite graph: Consider the following stylized model for a CSMA network. Suppose there are n k class-k nodes, with k = 1,..., K. If a node is active (transmitting) of say class-c, all nodes of classes k = c cannot activate (begin transmitting). Class-c nodes, however, can activate. Nodes of class-k, k = 1,..., K, try to activate after an exponentially distributed time with mean 1/ k. After successfully activating, a node deactivates after an exponentially distributed time with mean 1. We will keep track of the number of active nodes and which class they belong to. Specifically, let (k, l) denote the state in which l class-k nodes are active, l ∈ {0, 1,..., n k } and k ∈ {1,..., K}. The equilibrium distribution of this Markov process is given by (k,l) = Z −1 n k l l k. Now consider the following two control schemes: (i) the operator can choose any ∈ (0, ∞) and set k = for k = 1,..., K, and (ii) the operator can set any ∈ (0, ∞) K. Intuitively, the operator has less control over the network with scheme (i) than with scheme (ii). In practice, however, there could be compelling reasons to use scheme (i) instead of scheme (ii), such as reduced complexity and/or lower operation costs. In such situations, it is worthwhile to examine and compare the achievable regions of all available schemes. For scheme (i), we identify r = ln and write which is equivalent to when A (k,l) = l and b (k,l) = ln n k l. The right-hand side of can then be interpreted as the steady-state average number of active nodes. Using Theorem 1, we conclude that for every ∈ (0, max k=1,...,K n k ), there exists a ∈ (0, ∞) such that K k=1 n k l=1 l (k,l) =. In other words, by using control scheme (i) and setting appropriately, the average number of active nodes can be made to equal anything between 0 and max k=1,...,K n k. In the case of scheme (ii), identify r i = ln i for i = 1,..., K, so that Again if we compare to, we see that A (k,l),i = l1 and b (k,l) = ln n k l. Furthermore, is to be interpreted as the steady-state average number of active class-i nodes, where i = 1,..., k. Using Theorem 1, we conclude that for every there exists a ∈ (0, ∞) K such that ni l=1 l (i,l) = i for i = 1,..., K. We see that by choosing appropriately, the average number of active nodes of every class can be controlled. As expected, more control can be exerted on the network with scheme (ii) than with scheme (i). The achievable region given in can intuitively be understood as follows. When precisely one element of becomes extremely large, say k → ∞, all class-k nodes are active almost always and the average number of active nodes would be n k e k. If two or more elements become extremely large, say k1, k2 → ∞, a large number of class-k 1 and class-k 2 nodes would be active for a large fraction of time (but never simultaneously). The average number of active nodes is then a weighted average of n k1 e k1 and n k2 e k2. D. Proof of Theorem 1 In this section, we prove Theorem 1. Our method is based on,, where the achievable region of the throughput of nodes (transmitter-receiver pairs) in a CSMA/CA network has been determined. We apply the approach to the broader class of product-form networks and provide all necessary adaptations, which leads to Theorem 1. A proof sketch is as follows. First, we construct a convex minimization problem in r for every vector ∈ || such that 1 T = 1. This minimization problem is constructed such that in the minimum located at r opt, A T (r opt ) = A T. Next, we show that strong duality holds and that the dual problem of our minimization problem attains its optimal value. This then implies that the target = A T is achievable. We now proceed with the proof. Let ln x = (ln x 1,..., ln x n ) T for x ∈ R n and define the log-likelihood function u(r) = − T ln (r), with ∈ || and 1 T = 1. After substituting, we find that Let g(r) = ∇ r u(r) with ∇ r = (∂/∂r 1,..., ∂/∂r d ) T, so that The log-likelihood function in has the aforementioned properties that we are interested in. Proposition 1. The function u(r) = − T ln (r) has the properties that (i) inf r∈R d u(r) ≥ 0, (ii) u(r) is continuous in r, (iii) u(r) is convex in r and (iv) at the critical point r opt for which g(r opt ) = 0, A T (r opt ) = A T. Proof. (i) By irreducibility, we have that x > 0 for all We next prove that there exists a finite r opt for which g(r opt ) = 0. Using Proposition 1, we conclude that if such a vector exists, then A T (r opt ) = A T. In other words, the target vector A T is attained by setting r = r opt. Consider the following optimization problem, which we call the primal problem. It has been constructed in such a way that its dual is the minimization of u(r) over r. This is by design, and we will use and prove this throughout the remainder of this section. We note first that differs from the minimization problem considered in,, in that there is a second term ( − ) T b necessary to capture the broader class of product-form networks and to allow for the selection of parameters. Before we can prove that the minimization of u(r) over r is indeed the dual to, we need to verify that strong duality holds. Lemma 1. Strong duality holds. Proof. Slater's condition tells us that strong duality holds if there exists a such that all constraints hold. Considering = completes the proof. Strong duality implies that the optimality gap is zero, specifically implying that if has a finite optimum, its dual also attains a finite optimum. Proposition 2. The optimal value of the dual problem is attained. Proof. Assume that the optimal solution of is such that x = 0 for all x in I. Being the optimal solution, must be feasible. Recall that is feasible by assumption. Any distribution on the line that connects and is therefore also feasible. When moving from towards, thus along the direction −, the change of the objective function in is proportional to. This means that the objective function increases when moving away from towards. It is therefore not possible that is the optimal solution, contradicting our assumption. The optimal solution must be such that x > 0 for all x ∈. This implies that − T ln + ( − ) T b < ∞ and using Slater's condition, we find that the optimal value of the dual problem is attained. Strong duality also implies that there exist finite dual variables so that the Lagrangian is maximized. These dual variables turn out to be precisely r opt. So what remains is to show that the dual problem to is indeed the minimization of u(r) over r and that the finite dual variables for which the Lagrangian is maximized are indeed r opt. is Proposition 3. The dual problem to Proof. By strong duality, we know that there exist finite dual variables r opt ∈ R d, w opt ∈ [0, ∞) || and z opt ∈ R such that the Lagrangian is maximized by the optimal solution opt. By complementary slackness, w opt = 0. Because opt maximizes the Lagrangian, This equation can be solved for opt, resulting in opt = exp (z opt − 1)1 + Ar opt + b. The constant z opt follows from the normalizing condition 1 T = 1, implying that where Z(r opt ) = 1 T exp Ar opt + b. Because opt is the optimal solution, we have that max ∈ || L(; r opt, w opt, z opt ) = L( opt ; r opt, w opt, z opt ) Because opt and r opt solve the primal problem, r opt is the solution of min r∈R d u(r). This concludes the proof of Theorem 1. III. ALGORITHM Having identified the achievable region in §II, we now turn to developing an algorithm that finds r opt. For this, we modify a (distributed) online algorithm developed and discussed in. A. Description We apply the algorithm to the objective function u(r) = − T ln (r), where ∈ || is such that 1 T = 1 and A T =. When is achievable, we know that such a distribution exists by Theorem 1. From Proposition 1, we see that u(r) is convex in r and that the gradient ∇ r u(r) = A T (r) −. In its unique critical point r opt where ∇ r u(r opt ) = 0, we indeed have that A T (r opt ) =. The algorithm will find this critical point. The algorithm is as follows. Let 0 = t < t <... and take initial parameters r = R. At time t , marking the end of observation period n + 1, calculat Here, a denotes the step size and the truncation R is component-wise defined as can be found in, but only when Determining the achievable region for this set of available parameters requires solving a potentially NP-hard inversion problem. Instead, we would like to use Theorem 1, but Theorem 1 only holds under the assumption that [R min We therefore need to establish new conditions on a and f that ensure convergence for the case that R = R d. Such conditions can be found by modifying the proof in , which is the topic of the remainder of this section. B. Conditions for convergence When R = R d, we write For the algorithm in, we will prove following result. In Proposition 4, we give two sets of sequences a , e and f , labelled (a) and (b), such that conditions (i) and (ii) in Theorem 2 hold. The proofs that these sequences indeed satisfy the conditions are deferred to Appendix A. The choices made for the step sizes and observation periods in (a) are based on similar ideas as in,. Note however that conditions (i) and (ii) differ from the conditions in,, and the verification that (i) and (ii) hold is therefore different. C. Convergence proof We start by defining the error bias B or converges to the optimal solution r opt with probability one, if the summation 1] ] is finite with probability one and if also, for any > 0, there exists m 0 ∈ N so that for any n ≥ m ≥ m 0, Proving Theorem 2 thus boils down to verifying the conditions in Lemma 2 for. This is however more complicated than for, which has been done in [ i | ≤ |R This completes the proof. We now turn to verifying Lemma 2. To do so, we consider the error bias and zero-mean noise separately, similar to . 1) Error bias: Using Lemma 3, we find that This expression is similar to , but applies to algorithm instead of algorithm (20 and still holds in the present case, because. When using algorithm, however, we cannot proceed and apply . Instead, we will use Lemma 4, the proof of which can be found in Appendix B. We derive Lemma 4 using a large deviations result in, and we note that it is related to the mixing time of the underlying stochastic process, see also . IV. CONCLUSION We have identified the achievable region for Markov processes with product-form distributions when an operator can control one or more parameters (transition rates) of the system. The shape and size of the achievable region was shown to be intimately related with the state space and the parameters that can be controlled. Loosely speaking, the larger the state space is, the more configurable parameters there are, the more performance measures there are that can be achieved. Future work may be aimed at relating the achievable region to parameter domains. In the present work we assumed that parameters can be arbitrarily set, while in practice operators can only choose parameters from a compact set. We also described how to use a (distributed) online algorithm from to find parameters such that the performance measure of the system equals any target performance measure taken from the achievable region. This required broadening the scope of applicability of the online algorithm in, because the shape of the achievable region is only known to us when transition rates are unbounded. By capitalizing on and generalizing an existing proof methodology, we have provided sufficient conditions that guarantee convergence of the algorithm when an operator can arbitrarily set parameters. Because parameter values were now assumed unbounded, the conditions on the step sizes a and observation frequencies f had to be more stringent in order to lessen the risk of extreme parameter growth. Further research on the algorithm may be aimed at studying the necessity of such stringent conditions. Less stringent conditions possibly allow for increased convergence speeds. To further substantiate this, a better understanding is required of the delicate interplay between the mixing times and the convergence properties of the algorithm.
William Kristol, among his many duties, hosts Conversations with Bill Kristol, which feature in-depth conversations with leading figures in American public life. (The interviews are sponsored by the Foundation for Constitutional Government, a not-for-profit organization devoted to supporting the serious study of politics and political philosophy.) Among those interviewed by Kristol are Elliott Abrams, Leon and Amy Kass, Charles Murray, and Harvey Mansfield. My intention is to eventually focus on each of the conversations, which are fascinating. But I want to start with the discussion Kristol had with his former teacher, Dr. Mansfield, a longtime professor of political philosophy at Harvard. political science was not enough by itself because it doesn’t judge. When you study facts, facts ask to be judged. A fact presents itself as something, which is either good or bad – and people who deal with facts either deserve to be praised or blamed. It doesn’t seem really possible to stop and say, “I’m not going to be concerned with evaluation.” Political philosophy is concerned with evaluation because political facts aren’t sufficient by themselves and they ask to be judged. One of the distinctions between the ancients and the moderns–with Machiavelli being considered the founder of modern political philosophy–is that the former, most especially Plato and Aristotle, were more concerned with “the invisible standing behind the visible and necessary to it,” in Mansfield’s words. In Book VII of Aristotle’s Politics, for example, we’re told about the primacy of the good of the soul and that “the best way of life, both for states and for individuals, is the life of goodness.” Moderns, on the other hand, begin from what is visible and are never really able to transcend it. To be sure, in politics, as in life, facts matter. We can’t operate in our own universe; we have to lead our lives within the four corners of reality. Politics, then, is about respecting facts and being empirically minded. But politics rightly understood is also about ascertaining what the good life and the proper end of the state are. Political philosophy should not aim for the “transvaluation of values”; its aim should be promoting virtue (arête) and human flourishing (eudaimonia). he much more criticizes Plato than, I think, is necessary for him to do. And this too is perhaps a kind of stance on Aristotle’s part to show that Plato had this failing – or maybe it isn’t altogether a failing – of giving too low a view of politics. Politics deserves – there’s a certain nobility to it, in fact, a terrific nobility to it. And, so Aristotle wanted to bring to our attention the splendor of politics and of the moral virtue that people show in politics. And he thought that Plato had not done this sufficiently. And, so on every page, so to speak, there is a kind of critique of Plato and then Aristotle’s Ethics – there’s an, actually, statement of disagreement with his revered teacher, which he says that he loves his friend, but he loves the truth more, the most beautiful kind of criticism you could give or get. The nobility and splendor of politics is often obscured; that is the product of being broken people, often passionately holding competing points of view, imperfectly trying to order our lives together. Yet at its deepest level, beneath all the conflict and noise and triviality, there is–there has been, there can be–an ennoblement to politics. From time to time it can bend the arc of the moral universe a bit closer toward justice, make life a little more decent, treat people somewhat more humanely. And that’s actually something worth reminding ourselves about now and then, as Professor Mansfield and his former student Bill Kristol do in their splendid conversation.
class participant: """Participant is a single participant, containing the timecourses of all voxels, and multiple runs """ def __init__(self, subject, derivatives_dir): self.subject = subject self.derivatives_dir = derivatives_dir self.prep_dir = os.path.join(self.derivatives_dir, 'fmriprep', self.subject) self.preproc_dir = os.path.join(self.derivatives_dir, 'pybest', self.subject) ses = [] for root,dirs,files in os.walk(self.prep_dir+'/'): for a_dir in dirs: if ("ses" in a_dir): ses.append(a_dir) self.sessions = ses def get_scalars(self, scalar_dir): for sessions in self.sessions: for runs in range(len(glob.glob(self.prep_dir + f'/{sessions}/func/*.dtseries.nii'))): runs = runs+1 datvol = nb.load(self.prep_dir + f'/{sessions}/func/{self.subject}_{sessions}_task-prf_run-{runs}_space-fsLR_den-170k_bold.dtseries.nii') dat = np.asanyarray(datvol.dataobj) write_newcifti(os.path.join(scalar_dir, self.subject, f'{self.subject}_{sessions}_task-prf_run-{runs}_mean.scalar.nii'), datvol, dat.mean(axis=0))
// AddPeer adds a new peer key to the Identity's peer list. func (id *Identity) AddPeer(peerID *[ed25519.PublicKeySize]byte) { for i := range id.peers { if bytes.Equal(id.peers[i][:], peerID[:]) { return } } id.peers = append(id.peers, peerID) }
/** * An argument for parsing URLs. * * @author Luke Tonon */ @ThreadSafe public final class URLArgument implements Argument<URL> { private static final URLArgument DEFAULT = new URLArgument(); private URLArgument() { } /** * @return The default instance. */ public static URLArgument get() { return DEFAULT; } @Nonnull @Override public ParsedArgument<URL> parse(MessageReader reader) throws CommandException { String next = reader.nextArgument(); if (next.startsWith("<") && next.endsWith(">")) { next = next.substring(1, next.length() - 1); } try { return ParsedArgument.parse(new URL(next)); } catch (MalformedURLException e) { throw reader.getExceptionProvider().getInvalidURLException().create(next); } } @Override public String toString() { return "URLArgument{}"; } }
Effects of solid acellular type-I/III collagen biomaterials on in vitro and in vivo chondrogenesis of mesenchymal stem cells ABSTRACT Introduction: Type-I/III collagen membranes are advocated for clinical use in articular cartilage repair as being able of inducing chondrogenesis, a technique termed autologous matrix-induced chondrogenesis (AMIC). Area covered: The current in vitro and translational in vivo evidence for chondrogenic effects of solid acellular type-I/III collagen biomaterials. Expert commentary: In vitro, mesenchymal stem cells (MSCs) adhere to the fibers of the type-I/III collagen membrane. No in vitro study provides evidence that a type-I/III collagen matrix alone may induce chondrogenesis. Few in vitro studies compare the effects of type-I and type-II collagen scaffolds on chondrogenesis. Recent investigations suggest better chondrogenesis with type-II collagen scaffolds. A systematic review of the translational in vivo data identified one long-term study showing that covering of cartilage defects treated by microfracture with a type-I/III collagen membrane significantly enhanced the repair tissue volume compared with microfracture alone. Other in vivo evidence is lacking to suggest either improved histological structure or biomechanical function of the repair tissue. Taken together, there is a paucity of in vitro and preclinical in vivo evidence supporting the concept that solid acellular type-I/III collagen scaffolds may be superior to classical approaches to induce in vitro or in vivo chondrogenesis of MSCs.
1. Field of the Invention The present invention generally relates to a printer, such as a printer for printing labels, such as self adhesive labels carried on a backing material. Such a printer can have a spring-loaded print head which can be pressed against a counterpressure roller, wherein an active strand of a printing ribbon and the medium to be printed can pass between the print head and the counterpressure roller. In such printers, the printing ribbon can typically be supplied by, and unwound from a first spool, and can be wound, or taken up by a second spool. In addition, between a drive and the take-up spool, and/or between a drive and a drive roller in contact with the medium to be printed, there can also be a slip clutch which can be located in a wheel with a concentric shaft, to which shaft a torque is transmitted. Such a friction clutch can typically have at least one pair of axially spring-loaded friction discs interposed between the shaft and the wheel. 2. Background Information On printers, e.g. on thermal transfer printers, it has been found to be necessary to use a slip clutch to limit the torque which is exerted on the spool on which the used ink ribbon (thermal transfer ribbon) is wound up. The slip clutch can thereby prevent an unacceptably high tensile stress on the ribbon. Such an unacceptably high tensile stress could occur, for example, if the spool from which the ribbon is unwound is stopped for any reason, in which case the ribbon can stop moving suddenly. In such a case, one manner for preventing the ribbon from tearing is to use a slip clutch. To achieve the correct feed, it may also prove necessary to transport the medium being printed, e.g. for printing individual labels, with a separate drive roller instead of, or in addition to the counterpressure roller. Here again, in particular in the case of a malfunction, it can generally be necessary to limit the drive moment exerted by the drive roller, to prevent damage to the drive motor or to other mechanical elements. Known slip clutches are very common, and, for example, have been configured in the form of multiple-disc clutches. When the torque exceeds a predetermined value which can be defined by the selection of both the friction pair and the force of the spring or springs used, the adhesive friction can be overcome and the clutch can slip. In the extreme case, for example, only the drive shaft continues to rotate, while the wheel remains stationary, or vice-versa. One such known clutch must be assembled on the shaft piece-by-piece. If the slip clutch in question is very small, and its components are consequently also very small, the assembly becomes a tedious and time-consuming operation. Further, if this shaft with the clutch is to be used in a machine where there is not much space available, the operations of servicing and repairing this clutch, e.g. replacing the friction discs, can be particularly time-consuming and consequently expensive. During these service and repair operations, moreover, it is possible for one of the small friction discs or other pieces to fall into the machine, thereby possibly causing a disruption of operation of the entire machine.
Around him, symbols of a Japanese Zen garden swirl; the pattern of a traditional rake on gravel, the peaked roof of a tea house, the deep red of the floor runner and flowing waves of magnolias. The monk watches over all of Olya Chudnovsky’s paintings at the Rails End Gallery, each representing an aspect of a Zen garden, also known as a Japanese rock garden. There are the irises – contours of reds and oranges, looking both floral and otherworldly – the Queen Anne’s lace against a deep blue Haliburton sky and the Japanese maple canvas, painted almost entirely in a rich red. It’s Chudnovsky’s own garden of sorts, pulled together for an exhibition at the gallery on until April 19. “I’m realizing that I’m still researching the subject matter, I mean, the zen garden experience. It could be in colours, it could be in forms, it could be some symbols. It just very organically came together,” said the artist, who is a financial planner living just outside Minden. Chudnovsky and her husband Boris travelled to Kyoto about four years ago, exclusively touring the city’s Zen gardens for two weeks. The experience has informed her work ever since. “I’m very surprised how it grows. The aftertaste is much more powerful than the trip itself,” she said. The calm of nature is reflected throughout the collection: a cool winter tree, a painterly pear, a larger-than-life vase of flowers. Beyond the literal subject matter, Chudnovsky is interested in conveying emotion through colour. Take the Japanese maple painting. “In the fall, there is a lot of red colour … but among this red sometimes is a small piece of such a red that you just stop and you’re mesmerized by this. It’s an attempt to get these feelings,” she said. Zen Garden is Chudnovsky’s first exhibition. She started painting about 10 years ago as a hobby, which she said has taken over her life. Originally from St. Petersburg, Russia, the Chudnovskys lived in Toronto for many years before heading north to their favourite vacation spot in the Haliburton Highlands. They bought their place nine years ago and settled in fulltime four years ago. “We love it here. It’s a beautiful spot of the land,” she said. The Rails End Gallery is open Wednesday through Saturday from 11 a.m. to 5 p.m., 23 York St., Haliburton, 705-457-2330.
package com.alibaba.alink.operator.stream.feature; import org.apache.flink.types.Row; import com.alibaba.alink.operator.stream.StreamOperator; import com.alibaba.alink.operator.stream.source.MemSourceStreamOp; import com.alibaba.alink.testutil.AlinkTestBase; import org.junit.Test; import java.sql.Timestamp; import java.util.Arrays; import java.util.List; public class OverCountWindowStreamOpTest extends AlinkTestBase { @Test public void test() throws Exception { List <Row> sourceFrame = Arrays.asList( Row.of("Mary", Timestamp.valueOf("2021-11-11 12:00:00"), 10.0), Row.of("Bob", Timestamp.valueOf("2021-11-11 12:00:00"), 20.0), Row.of("Mary", Timestamp.valueOf("2021-11-11 12:00:11"), 30.0), Row.of("Mary", Timestamp.valueOf("2021-11-11 12:00:15"), 40.0), Row.of("Bob", Timestamp.valueOf("2021-11-11 12:01:00"), 50.0), Row.of("Liz", Timestamp.valueOf("2021-11-11 12:01:00"), 60.0), Row.of("Liz", Timestamp.valueOf("2021-11-11 12:01:23"), 70.0), Row.of("Mary", Timestamp.valueOf("2021-11-11 12:02:00"), 80.0), Row.of("Liz", Timestamp.valueOf("2021-11-11 12:02:10"), 90.0), Row.of("Bob", Timestamp.valueOf("2021-11-11 12:02:20"), 100.0), Row.of("Bob", Timestamp.valueOf("2021-11-11 12:02:25"), 110.0) ); StreamOperator <?> streamSource = new MemSourceStreamOp( sourceFrame, new String[] {"user", "time1", "money"}); StreamOperator <?> op = new OverCountWindowStreamOp() .setGroupCols("user") .setTimeCol("time1") .setPrecedingRows(3) .setClause("avg_preceding(money) as avg_money") .setReservedCols("user", "time1", "money"); streamSource.link(op).print(); StreamOperator.execute(); } }
Q: Fixing security issues without boss/client's authorisation I have a fair number of security concerns with a client's operation and it made me think about all the security concerns I've observed and noticed throughout the years with different clients/jobs. Raising concerns with management was met with "too much time/money/resource" unless the security issue in question was exploited and, in those cases, was met with "why didn't you fix that!?". Over time employees/contractors end up not mentioning security issues due to the responses from management and these security concerns are left behind. Of course this doesn't happen everywhere but certainly the majority. The flip side to this is management/decision makers who are paranoid about security and spend millions on worthless stuff because it says "secure" on the box/in the name. My question therefore is this- is it ethically correct to ignore a security issue because a boss/ client has told you not to fix it due of time/money concerns? Is it ethically correct TO fix it after an express order not to fix it. Part of the biggest problems I've experienced in spotting security issues isn't always the response but more the time taken during the decision making process. During that time we could be leaking a lot of data or even worse - a lot of user data that's almost always sensitive. Sort of a side note but how on earth can we train staff, decision makers and users (yes there's a difference!) that these issues exist and should be fixed but without them jumping too far in the deep end. Edit Just to clarify - this isn't about going against management decisions or not realising you're creating a bigger security issue than what was previously there. I'm talking about a definite security flaw that you've spotted, can fix and don't have client authorisation. A: Every fix is a business decision. The business needs to make the call. You, as the one with the knowledge, need to properly inform and guide the business through the matrix of needs and costs. Optimally, there are policies and procedures in place to identify and incorporate fixes over time based on cost and priority, but unfortunately, not all do. As for fixing a problem without oversight, what happens if you cause an even greater security problem? What if you expose the business to costs and damage as a result of unintended consequences? Oversight exists for a reason, to protect both you and the business. As for ethical concerns, there is open debate of the ethics of information. In a situation where life and health are threatened, there are clearer and more defined ethical lines. Threats against information are more difficult to understand ethically. I have had discussions with some in the health care industry who have proposed the idea that a human's information is worth more even than a human's life (because it can effect the life and health of untold numbers of other humans). Educate, inform, guide, encourage, and talk in terms that make sense to the business. These things you must do ethically and with passion.
This international business competition is designed to bring entrepreneurs from later stage companies and investors together. This year, the competition will be held at multiple locations throughout Detroit, including the Guardian Building, Orchestra Hall, and the Westin Book Cadillac Hotel. For details and registration, click here.
Resolution of complex feline leukocyte antigen DRB loci by reference strand-mediated conformational analysis (RSCA). The DRB genes of the domestic cat are highly polymorphic. Studies based on clonal sequence analysis have suggested the existence of two distinct loci within individual animals and good evidence for 24 distinct FLA-DRB alleles. This variability, the complexity of clonal sequence analysis and its susceptibility to PCR-induced artefacts has represented a bottleneck to further progress. In this study we have applied reference strand-mediated conformational analysis (RSCA) to FLA-DRB. This protocol has been shown to be highly reproducible. Using five reference strands including two derived from non-domestic felines, we could distinguish 23 FLA-DRB alleles. We used RSCA to explore genetic polymorphism of FLA-DRB in 71 cats including 31 for which clonal sequence analysis was also available. On average, RSCA identified 0.9 more alleles within cats than clonal sequence analysis. Reference strand-mediated conformational analysis was also able to identify animals containing new alleles that could be targeted for sequence analysis. Analysis of allele patterns showed clear evidence for different allele distributions between breeds of cats, and suggested the Burmese breed may have highly restricted FLA-DRB polymorphism. Results from two families provided clear evidence for variation in the number of DRB genes on different haplotypes, with some haplotypes carrying two genes and some containing three. This study highlights the utility of RSCA for the resolution of complex amplicons containing up to six distinct alleles. A simple, rapid method for characterizing FLA-DRB makes possible studies on vaccine response and susceptibility/resistance to viral infections, which are a significant clinical problem in cats.
// // DateAndTimeView.h // sensible // // Copyright (c) 2013 Sensirion AG. All rights reserved. // #import <UIKit/UIKit.h> @interface DateAndTimeView : UIView @end
Practicing entertainment for social change in the United States: comparing the influences of U.S.-based documentary storytelling and print campaign resources in a univision prosocial media campaign ABSTRACT In the United States, Hispanic children experience dramatically different educational outcomes compared to other racial and ethnic groups. Educational disparities begin at the earliest phases of formal education; left unaddressed, challenges can persist. To address this, Univision, the most-watched Spanish-language network in the United States, launched Camino al xito (Road to Success), a multimedia prosocial storytelling campaign designed to reach parents with helpful messages about key risk transitions through the K-12 education life cycle. Following narrative engagement theory, this study sought to understand the role of narrative-based information utilized in this entertainment-based prosocial campaign by examining U.S. Hispanic parents (N=153) responses to a short TV documentary and a printed campaign resource document. Those exposed to the documentary showed significantly higher posttest mean levels of knowledge than the print condition. Results suggest that documentary storytelling can be effectively employed in prosocial entertainment media campaigns for social change.
/* This file is part of Magnum. Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 <NAME> <<EMAIL>> 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. */ #include <Corrade/Containers/ArrayViewStl.h> #include <Corrade/Containers/Optional.h> #include <Corrade/PluginManager/Manager.h> #include <Corrade/Utility/Directory.h> #ifdef CORRADE_TARGET_APPLE #include <Magnum/Platform/WindowlessCglApplication.h> #elif defined(CORRADE_TARGET_UNIX) #include <Magnum/Platform/WindowlessGlxApplication.h> #elif defined(CORRADE_TARGET_WINDOWS) #include <Magnum/Platform/WindowlessWglApplication.h> #else #error no windowless application available on this platform #endif #include <Magnum/Image.h> #include <Magnum/ImageView.h> #include <Magnum/PixelFormat.h> #include <Magnum/GL/Buffer.h> #include <Magnum/GL/Framebuffer.h> #include <Magnum/GL/Mesh.h> #include <Magnum/GL/Renderbuffer.h> #include <Magnum/GL/RenderbufferFormat.h> #include <Magnum/GL/Renderer.h> #include <Magnum/GL/Texture.h> #include <Magnum/GL/TextureFormat.h> #include <Magnum/Math/Color.h> #include <Magnum/Math/Matrix3.h> #include <Magnum/Math/Matrix4.h> #include <Magnum/MeshTools/Compile.h> #include <Magnum/MeshTools/Interleave.h> #include <Magnum/Primitives/Square.h> #include <Magnum/Primitives/Circle.h> #include <Magnum/Primitives/Icosphere.h> #include <Magnum/Primitives/UVSphere.h> #include <Magnum/Shaders/Flat.h> #include <Magnum/Shaders/MeshVisualizer.h> #include <Magnum/Shaders/Phong.h> #include <Magnum/Shaders/VertexColor.h> #include <Magnum/Shaders/Vector.h> #include <Magnum/Shaders/DistanceFieldVector.h> #include <Magnum/Trade/AbstractImageConverter.h> #include <Magnum/Trade/ImageData.h> #include <Magnum/Trade/MeshData2D.h> #include <Magnum/Trade/MeshData3D.h> #include <Magnum/Trade/AbstractImporter.h> using namespace Magnum; using namespace Magnum::Math::Literals; struct ShaderVisualizer: Platform::WindowlessApplication { explicit ShaderVisualizer(const Arguments& arguments): Platform::WindowlessApplication{arguments} {} int exec() override; std::string phong(); std::string meshVisualizer(); std::string flat(); std::string vertexColor(); std::string vector(); std::string distanceFieldVector(); Containers::Pointer<Trade::AbstractImporter> _importer; }; namespace { constexpr const Vector2i ImageSize{512}; } int ShaderVisualizer::exec() { PluginManager::Manager<Trade::AbstractImageConverter> converterManager; Containers::Pointer<Trade::AbstractImageConverter> converter = converterManager.loadAndInstantiate("PngImageConverter"); if(!converter) { Error() << "Cannot load image converter plugin"; std::exit(1); } PluginManager::Manager<Trade::AbstractImporter> importerManager; _importer = importerManager.loadAndInstantiate("PngImporter"); if(!_importer) { Error() << "Cannot load image importer plugin"; std::exit(1); } GL::Renderbuffer multisampleColor, multisampleDepth; multisampleColor.setStorageMultisample(16, GL::RenderbufferFormat::SRGB8Alpha8, ImageSize); multisampleDepth.setStorageMultisample(16, GL::RenderbufferFormat::DepthComponent24, ImageSize); GL::Framebuffer multisampleFramebuffer{{{}, ImageSize}}; multisampleFramebuffer.attachRenderbuffer(GL::Framebuffer::ColorAttachment{0}, multisampleColor) .attachRenderbuffer(GL::Framebuffer::BufferAttachment::Depth, multisampleDepth) .bind(); CORRADE_INTERNAL_ASSERT(multisampleFramebuffer.checkStatus(GL::FramebufferTarget::Draw) == GL::Framebuffer::Status::Complete); GL::Renderbuffer color; color.setStorage(GL::RenderbufferFormat::SRGB8Alpha8, ImageSize); GL::Framebuffer framebuffer{{{}, ImageSize}}; framebuffer.attachRenderbuffer(GL::Framebuffer::ColorAttachment{0}, color); GL::Renderer::enable(GL::Renderer::Feature::DepthTest); GL::Renderer::enable(GL::Renderer::Feature::FramebufferSrgb); GL::Renderer::setClearColor(0x000000_srgbaf); for(auto fun: {&ShaderVisualizer::phong, &ShaderVisualizer::meshVisualizer, &ShaderVisualizer::flat, &ShaderVisualizer::vertexColor, &ShaderVisualizer::vector, &ShaderVisualizer::distanceFieldVector}) { multisampleFramebuffer.clear(GL::FramebufferClear::Color|GL::FramebufferClear::Depth); std::string filename = (this->*fun)(); GL::AbstractFramebuffer::blit(multisampleFramebuffer, framebuffer, framebuffer.viewport(), GL::FramebufferBlit::Color); Image2D result = framebuffer.read(framebuffer.viewport(), {PixelFormat::RGBA8Unorm}); converter->exportToFile(result, Utility::Directory::join("../", "shaders-" + filename)); } _importer.reset(); return 0; } namespace { const auto Projection = Matrix4::perspectiveProjection(35.0_degf, 1.0f, 0.001f, 100.0f); const auto Transformation = Matrix4::translation(Vector3::zAxis(-5.0f)); const auto BaseColor = 0x2f83cc_srgbf; const auto OutlineColor = 0xdcdcdc_srgbf; } std::string ShaderVisualizer::phong() { MeshTools::compile(Primitives::uvSphereSolid(16, 32)).draw(Shaders::Phong{} .setAmbientColor(0x22272e_srgbf) .setDiffuseColor(BaseColor) .setShininess(200.0f) .setLightPosition({5.0f, 5.0f, 7.0f}) .setProjectionMatrix(Projection) .setTransformationMatrix(Transformation) .setNormalMatrix(Transformation.normalMatrix())); return "phong.png"; } std::string ShaderVisualizer::meshVisualizer() { const Matrix4 projection = Projection*Transformation* Matrix4::rotationZ(13.7_degf)* Matrix4::rotationX(-12.6_degf); MeshTools::compile(Primitives::icosphereSolid(1)) .draw(Shaders::MeshVisualizer{Shaders::MeshVisualizer::Flag::Wireframe} .setColor(BaseColor) .setWireframeColor(OutlineColor) .setWireframeWidth(2.0f) .setViewportSize(Vector2{ImageSize}) .setTransformationProjectionMatrix(projection)); return "meshvisualizer.png"; } std::string ShaderVisualizer::flat() { MeshTools::compile(Primitives::uvSphereSolid(16, 32)).draw(Shaders::Flat3D{} .setColor(BaseColor) .setTransformationProjectionMatrix(Projection*Transformation)); return "flat.png"; } std::string ShaderVisualizer::vertexColor() { Trade::MeshData3D sphere = Primitives::uvSphereSolid(32, 64); /* Color vertices nearest to given position */ auto target = Vector3{2.0f, 2.0f, 7.0f}.normalized(); std::vector<Color3> colors; colors.reserve(sphere.positions(0).size()); for(Vector3 position: sphere.positions(0)) colors.push_back(Color3::fromHsv({Math::lerp(240.0_degf, 420.0_degf, Math::max(1.0f - (position - target).length(), 0.0f)), 0.85f, 0.666f})); GL::Buffer vertices, indices; vertices.setData(MeshTools::interleave(sphere.positions(0), colors), GL::BufferUsage::StaticDraw); indices.setData(sphere.indices(), GL::BufferUsage::StaticDraw); GL::Mesh mesh; mesh.setPrimitive(GL::MeshPrimitive::Triangles) .setCount(sphere.indices().size()) .addVertexBuffer(vertices, 0, Shaders::VertexColor3D::Position{}, Shaders::VertexColor3D::Color3{}) .setIndexBuffer(indices, 0, GL::MeshIndexType::UnsignedInt); Shaders::VertexColor3D shader; shader.setTransformationProjectionMatrix(Projection*Transformation); mesh.draw(shader); return "vertexcolor.png"; } std::string ShaderVisualizer::vector() { Containers::Optional<Trade::ImageData2D> image; if(!_importer->openFile("vector.png") || !(image = _importer->image2D(0))) { Error() << "Cannot open vector.png"; return "vector.png"; } GL::Texture2D texture; texture.setMinificationFilter(GL::SamplerFilter::Linear) .setMagnificationFilter(GL::SamplerFilter::Linear) .setWrapping(GL::SamplerWrapping::ClampToEdge) .setStorage(1, GL::TextureFormat::RGBA8, image->size()) .setSubImage(0, {}, *image); GL::Renderer::enable(GL::Renderer::Feature::Blending); GL::Renderer::setBlendFunction(GL::Renderer::BlendFunction::One, GL::Renderer::BlendFunction::OneMinusSourceAlpha); GL::Renderer::setBlendEquation(GL::Renderer::BlendEquation::Add, GL::Renderer::BlendEquation::Add); MeshTools::compile(Primitives::squareSolid(Primitives::SquareTextureCoords::Generate)) .draw(Shaders::Vector2D{} .setColor(BaseColor) .bindVectorTexture(texture) .setTransformationProjectionMatrix({})); GL::Renderer::disable(GL::Renderer::Feature::Blending); return "vector.png"; } std::string ShaderVisualizer::distanceFieldVector() { Containers::Optional<Trade::ImageData2D> image; if(!_importer->openFile("vector-distancefield.png") || !(image = _importer->image2D(0))) { Error() << "Cannot open vector-distancefield.png"; return "distancefieldvector.png"; } GL::Texture2D texture; texture.setMinificationFilter(GL::SamplerFilter::Linear) .setMagnificationFilter(GL::SamplerFilter::Linear) .setWrapping(GL::SamplerWrapping::ClampToEdge) .setStorage(1, GL::TextureFormat::RGBA8, image->size()) .setSubImage(0, {}, *image); GL::Renderer::enable(GL::Renderer::Feature::Blending); GL::Renderer::setBlendFunction(GL::Renderer::BlendFunction::One, GL::Renderer::BlendFunction::OneMinusSourceAlpha); GL::Renderer::setBlendEquation(GL::Renderer::BlendEquation::Add, GL::Renderer::BlendEquation::Add); MeshTools::compile(Primitives::squareSolid(Primitives::SquareTextureCoords::Generate)) .draw(Shaders::DistanceFieldVector2D{} .setColor(BaseColor) .setOutlineColor(OutlineColor) .setOutlineRange(0.6f, 0.4f) .bindVectorTexture(texture) .setTransformationProjectionMatrix({})); GL::Renderer::disable(GL::Renderer::Feature::Blending); return "distancefieldvector.png"; } MAGNUM_WINDOWLESSAPPLICATION_MAIN(ShaderVisualizer)
Bidirectional DC-AC converter for isolated microgrids with voltage unbalance reduction capabilities This paper presents a three-phase bidirectional DC-AC converter suitable for operating as an interface between an energy storage system (ESS) based on a battery bank and an isolated microgrid with distributed generation. The converter consists of two stages: a DC-DC stage implemented with a bidirectional half-bridge converter that operates on buck or boost mode (during charge or discharge of the ESS, respectively), and a DC-AC full-bridge three-phase bidirectional inverter. The two stages are connected through a DC link, which also works as a power-decoupling element. Isolation from the microgrid is obtained with a -Y low frequency transformer. A control strategy is proposed where the DC-DC stage regulates the DC link voltage level while the DC-AC controls the three-phase output voltage and frequency, therefore acting as a grid-forming converter (GFC). A modified droop strategy is implemented to control the power generated inside the microgrid to avoid overcharging the ESS. Voltage unbalance reduction capabilities were implemented in order to deal with unbalanced loads. A 15kW prototype was successfully built and tested in different situations and the experimental results are shown.
Circulating nerve growth factor receptor positive cells are associated with severity and prognosis of pulmonary arterial hypertension Pulmonary arterial hypertension (PAH) remains a disease with a poor prognosis, so early detection and treatment are very important. Sensitive and non-invasive markers for PAH are urgently required. This study was performed to identify sensitive markers of the clinical severity and prognosis of PAH. Patients diagnosed with PAH (n=30) and control participants (n=15) were enrolled in this observational study. Major EPC and MSC markers (including CD34, CD133, VEGFR2, CD90, PDGFR, and NGFR) in peripheral blood mononuclear cells (PBMNCs) were assessed by flow cytometry. Associations of these markers with hemodynamic parameters (e.g. mean pulmonary arterial pressure, pulmonary vascular resistance, and cardiac index) were assessed. Patients with PAH were followed up for 12 months to assess the incidence of major adverse events, defined as death or lung transplantation. Levels of circulating EPC and MSC markers in PBMNCs were higher in patients with PAH than in control participants. Among the studied markers, nerve growth factor receptor (NGFR) was significantly positively correlated with hemodynamic parameters. During the 12-month follow-up period, major-event-free survival was significantly higher in patients with PAH who had relatively low frequencies of NGFR positive cells than patients who had higher frequencies. These results suggested that the presence of circulating NGFR positive cells among PBMNCs may be a novel biomarker for the severity and prognosis of PAH. Introduction Pulmonary arterial hypertension (PAH) is a rare progressive disease in which pulmonary vascular remodeling leads to intimal hypertrophy of small arteries, resulting in elevated pulmonary vascular resistance (PVR) and pressure; these factors are pivotal in the progression of PAH. 1 Despite advances in PAH-specific therapies, the prognosis remains poor for patients with PAH. At present, the most reliable diagnostic tool for PAH is right heart catheterization (RHC) to evaluate hemodynamic parameters such as mean pulmonary arterial pressure (mPAP), PVR, and cardiac index (CI). However, RHC is an invasive test; moreover, early diagnosis of PAH based solely on hemodynamic parameters obtained from RHC is problematic, because approximately two-thirds of the pulmonary vascular bed has already irreversibly deteriorated by the time of PAH diagnosis. 2 Therefore, identification of biomarkers for the diagnosis of PAH and assessment of its severity at an early stage are important priorities in the field of pulmonary vascular medicine. Vascular remodeling is caused by the proliferation and abnormal signal transduction of vascular endothelium and smooth muscle cells. Recently, several studies have implied that the process of vascular remodeling is driven in part by bone marrow-derived proangiogenic cells, 3,4 and that endothelial progenitor cells (EPCs) and mesenchymal stem cells (MSCs) contribute to pulmonary vascular remodeling. 5,6 Furthermore, circulating mesenchymal precursor cells accumulate in the walls of remodeled vessels in patients with PAH, thereby contributing to vessel wall thickening. 7 The progression of vascular remodeling leads to the development and aggravation of PAH 8 ; therefore, circulating mesenchymal precursor cells, which play an important role in the initiation of vascular remodeling, may better reflect the pathophysiology of PAH. 9 A low-affinity receptor, nerve growth factor receptor (NGFR), has emerged as a marker for the isolation of highly primitive and proliferative stem cells. 10 NGFR gene expression in peripheral blood mononuclear cells (PBMNCs) is reportedly associated with the progression of vascular remodeling in patients with acute coronary syndrome, 11 suggesting that circulating NGFR positive cells in PBMNC may play important roles in the pathologic mechanisms underlying PAH. We hypothesized that the frequency of circulating EPCs and MSCs including NGFR positive cells in PBMNCs increases in patients with PAH and is associated with hemodynamic measurements that indicate the severity and prognosis of PAH. Study design This observational study was designed to investigate cellsurface antigens in PBMNCs from patients with PAH and was registered in the UMIN Clinical Trials Registry (UMIN 000032832). The study protocol complied with the Declaration of Helsinki and was approved by the local ethics committee. This study included patients from Kanazawa University Hospital in Japan, from July 2016 to March 2020, and informed consent was obtained from each patient prior to enrollment in the study. Patient population Patients diagnosed with PAH were selected; a healthy control group was also selected, based on an absence of right heart overload as assessed by echocardiography. In patients with PAH, RHC showed that mPAP was !25 mmHg and pulmonary arterial wedge pressure (PAWP) was 15 mmHg at rest. Respiratory functional tests revealed forced vital capacity >70% and forced expiratory volume in 1 s (FEV1) >60% of the predicted values, indicating no significant respiratory dysfunction. No abnormalities were observed in pulmonary ventilation blood flow scintigraphy. Blood tests showed no findings of blood, systemic inflammatory, or metabolic disorders. Patients with acute coronary syndrome, pregnancy, malignancy, and infectious diseases were excluded from this study. Clinical examinations Patients with PAH underwent RHC at rest to examine hemodynamic parameters, including mean right atrial pressure, mPAP, and PAWP. Cardiac output was determined by the thermodilution method. The CI was calculated by dividing cardiac output by body surface area. PVR was calculated by dividing mPAP by cardiac output. Six-minute walk distance (6MWD) measurements were performed in patients with PAH. Blood samples were obtained and brain natriuretic peptide (BNP) level was measured in all patients. The fluorescence intensity of cells labeled with fluorochromes was examined using an Accuri C6 flow cytometer (BD Pharmingen). The data were analyzed using FlowJo software v10 (BD Pharmingen). Outcome assessments Surface antigens of PBMNCs were compared between patients with PAH and control participants. In patients with PAH, these markers were compared with 6MWD and hemodynamic parameters (mPAP, PVR, and CI) obtained from RHC examinations. In addition, patients with PAH were followed up for 12 months to assess the occurrence of adverse events, such as death or lung transplantation. Statistical analysis Statistical analysis and graphs were prepared using Graph Pad Prism 7.0 (Graph Pad Software, La Jolla, CA, USA). All variables are presented as medians with interquartile ranges (IQRs). Statistical significance was defined as P < 0.05 (two-tailed). The Mann-Whitney U test was used to compare quantitative variables between groups. Chisquared tests were used to compare differences in other variables between the groups. Correlations were analyzed using Spearman's correlation coefficient. Multiple regression analysis was performed using SPSS for Windows (version 17.0; SPSS Japan Inc., Tokyo, Japan). Kaplan-Meier curves were plotted based on cut-off points for composite endpoints of major adverse events. Comparisons of eventfree survival curves were performed using the log-rank test. Patient characteristics Thirty patients with PAH were enrolled in the study, along with 15 healthy control participants without findings of right heart overload on echocardiography. The characteristics of enrolled patients are shown in Table 1. Frequencies of EPC and MSC marker positive cells in PBMNCs The gating strategy to identify EPC and MSC marker positive cells in PBMNCs using flow cytometry is shown in Fig. 1. Comparisons of EPC and MSC marker positive cells in the PAH and control groups are shown in Fig. 2. The frequencies of EPC and MSC marker positive cells were significantly higher in patients with PAH than in the control participants. The median (interquartile range) frequencies of each marker in patients with PAH and in the control participants were as follows: VEGFR2, 0.098% Frequencies of EPC and MSC marker positive cells in PBMNCs correlated with hemodynamic severity of PAH The relationships between the frequencies of EPC and MSC marker positive cells or BNP level and hemodynamic parameters (mPAP, PVR, and CI) or 6MWD are shown in Table 2. The frequencies of NGFR positive cells in patients with different subtypes of PAH are also shown in the Supplemental Figure. The frequencies were significantly higher in patients with idiopathic or heritable PAH, connective tissue disease, and atypical PAH than in controls. However, we found no difference in the frequency of NGFR between patients with different PAH subtypes. Regression analysis of hemodynamic parameters Regression analysis with multiple variables was performed on the frequencies of NGFR and CD90 positive cells, which were correlated with hemodynamic parameters based on univariate analysis. Table 3 shows the results of regression analysis of these parameters. The results indicated that the correlation between NGFR and mPAP was significantly stronger than that between CD90 and mPAP (P < 0.001). Correlations of the frequencies of NGFR positive cells in PBMNCs with major adverse events Patients with PAH were followed up for 12 months to determine the incidence of major adverse events, defined as death or lung transplant. The baseline characteristics of patients with PAH with and without major adverse events are shown in Table 4. Major adverse events occurred in five patients (16.7%): death in five (100%) and lung transplant in none (0%). The cause of death in all cases was heart failure. Receiver operating characteristic (ROC) curves predicting major adverse events based on the frequencies of NGFR positive cells are shown in Fig. 4a. The AUC was 0.88 (95% CI 0.76-1.0). The cut-off point was 0.067 (specificity 100%, sensitivity 72%). The frequencies of NGFR-positive cells were <0.067 in 18 PAH patients and >0.067 in the other 12. Kaplan-Meier curves for patients with PAH with and without major adverse events were constructed based on a cut-off frequency of 0.067 for NGFR positive cells (Fig. 4b). During the 12-month follow-up period, major-event-free survival was significantly better in patients with PAH who had frequencies of NGFR positive cells <0.067 than in patients who had frequencies of NGFR positive cells >0.067 (cut-off point, 0.067%; hazard ratio, 8.7; 95% confidence interval, 1.49-50.56; P 0.016). Discussion In this study, we demonstrated that the frequencies of EPC and MSC marker positive cells among PBMNCs were higher in patients with PAH than in control participants. Among the EPC and MSC markers, NGFR was significantly more abundant in patients with PAH than in control participants, and this cell subset had the strongest correlation with hemodynamic parameters and clinical severity. The BNP level was reported to be correlated with PVR, CI, and mPAP in patients with primary pulmonary hypertension (PH). 14 In the present study, the frequency of NGFR positive cells was more strongly associated with mPAP than the BNP level. Moreover, in patients with PAH, the incidence of major adverse events was correlated with the frequency of NGFR positive cells. These results indicate that NGFR positive cells may be a useful marker for severity and prognosis in patients with PAH. The pathophysiology of PAH, including environmental and genetic factors that promote vascular remodeling, is not completely understood. Risk assessment using multiple parameters has been recommended in clinical settings. 19 However, several parameters proposed for risk stratification in patients with PAH do not clearly reflect vascular remodeling. A non-invasive biomarker reflecting the pathophysiology of PAH may play an important role in treatment. Recently, MSCs with pluripotency have been reported to be involved in vascular remodeling, and showed associations with pathological changes and therapeutic effects. 7 In response to tissue injury, circulating MSCs are recruited Mean pulmonary arterial pressure, mmHg; Pulmonary vascular resistance, Wood units; Cardiac index, L/min/m 2. 6MWD: 6-minute walk distance, m; BNP: brain natriuretic peptide; EPC: endothelial progenitor cell; MSC: mesenchymal stem cell; NGFR: nerve growth factor receptor; PDGFR: platelet-derived growth factor receptor; VEGFR: vascular endothelial growth factor receptor. to the injury site and contribute to the tissue remodeling process. In animal models, circulating MSCs are essential for maintenance of vascular homeostasis in cardiovascular disorders 4 ; administration of MSCs is also reportedly beneficial for PH. 20,21 These results suggest that the frequency of circulating MSCs may be an excellent biomarker reflecting vascular remodeling in patients with PAH. Therefore, we focused on the main markers of MSCs and showed that levels of circulating MSCs were significantly elevated in patients with PAH compared to control participants. Among these MSC markers, we found that NGFR positive cells were significantly positively correlated with parameters indicating the severity of PAH, including mPAP. In this study, we identified NGFR as one of the major markers of MSC, but it is remains controversial whether NGFR positive cells in PBMNCs are MSCs. NGFR is involved in several pathological and physiological processes, 22,23 such as cell development, survival, and differentiation. It was initially reported to be expressed on cells of the central and peripheral nervous systems. 24 NGFR was also reported to be expressed in various tissues in the immune system, and in peripheral blood, and plays a role in inflammatory reactions and repair processes in damaged tissue. 25 Recently, NGFR has been employed as a surface marker for mesenchymal progenitor cells with proliferative and multipotential differentiation abilities. 10 To our knowledge, circulating NGFR positive MSCs have not yet been reported to be associated with PAH pathogenesis or progression. However, Iso et al. reported that circulating NGFR positive MSCs increased in abundance and promoted angiogenesis after acute myocardial infarction. 26 Some studies have reported that MSCs are induced in peripheral blood in response to hypoxia; subsequently, they promote vascular remodeling and lead to PAH pathogenesis. 7 The results of the present study support the suggestion that NGFR, as an MSC marker, may be related to pathological states in PAH. Fig. 3. Correlations between frequency of nerve growth factor receptor positive cells in patients with pulmonary arterial hypertension and hemodynamic parameters or 6-minute walk distance. The frequency of NGFR positive cells in patients with PAH was significantly associated with hemodynamic parameters (mPAP (a), PVR (b), and CI (c)) and 6MWD (d). 6MWD: 6-minute walk distance (m); % NGFR: frequency of nerve growth factor receptor positive cells in peripheral blood mononuclear cells; CI: cardiac index (L/min/m 2 ); mPAP: mean pulmonary arterial pressure (mmHg); NGFR: nerve growth factor receptor; PVR: pulmonary vascular resistance (Wood units). Chronic hypoxia has emerged as a well-established independent cause of vascular remodeling in PAH. 27 HIF-1a functions as a master regulator of oxygen homeostasis and hypoxic adaptation in the lung. Early studies demonstrated that the activation of HIF-1a plays a key role in vascular remodeling by promoting enhanced arterial wall thickness under hypoxia in experimental animals. 3 Previous findings showed that an interaction between NGFR and Sah2 regulates the expression of HIF-1a under hypoxic conditions. 28 On the basis of these observations, we speculate that the NGFR-HIF-1a axis might constitute a promising marker and therapeutic target for PAH. Circulating EPCs have also been reported to be associated with PAH, so we evaluated major EPC markers in this study. 29,30 In the present study, although the EPC marker positive cells were elevated in patients with PAH compared with control participants, they were not correlated with the severity of PAH. Asosingh et al. reported that circulating CD34 CD133 bone marrow-derived proangiogenic precursors were more abundant in patients with PAH than in healthy control participants, and were correlated with pulmonary artery pressure. 29 Another study reported that circulating EPCs, defined as CD34 CD133 VEGFR2 cells, were induced to a greater extent in patients with PAH than in healthy controls. 30 These reports support the present findings and suggest that circulating EPCs may play an important role in PAH. Endothelial cell apoptosis is an important factor in the initiation of PH following a reduction of monolayer integrity and disruption of barrier function. 31 NGFR is rarely expressed in healthy endothelial cells, and is strongly induced in capillary endothelial cells under conditions of ischemia and diabetes. 32 NGFR signaling in pathological endothelial cells promotes apoptosis through inhibition of the VEGF-A/Akt/eNOS/NO pathway. The increase in the number of NGFR positive cells in PAH patients may reflect endothelial cell apoptosis. Dysregulated endothelial cell proliferation and complex vascular lesions also play critical roles in the progression of PH. 33 Occlusive vascular lesions contain proliferating endothelial cells, smooth muscle cells, and inflammatory cells, including T and B lymphocytes and macrophages. Recent studies indicated that resident stem/progenitor cells also accumulate and contribute to blood vessel remodeling, leading to occlusive vascular lesion formation. 34 The expression of NGFR has been shown to be associated with a proliferative state, and increased migration/invasion in several primary and metastatic human cancers. NGFR controls cell survival via the recruitment of receptor-interacting serine/threonine-protein kinase 2-mediated activation of nuclear factor kappa-light-chainenhancer of activated B cells (NF-jB). 35 NGFR also triggers the mitogen-activated protein kinase pathway, leading to signaling processes mediated by extracellular-regulated kinases or phosphatidylinositol 3-kinases promoting cell proliferation and survival. 36 Here, we showed that circulating NGFR positive cell expression was positively correlated with the severity of PAH. These cells may be sources of proliferating endothelial cells, and show crosstalk with local cells involved in occlusive vascular lesions. NGFR has been reported to regulate neuronal survival and apoptosis. 37 The contrasting effects are due to the dependence of NGFR signaling on co-receptors and intracellular ligand availability. Further basic studies are needed to clarify the roles of circulating NGFR positive cells in the pathogenesis of PH. This study had several limitations. First, because PAH is a rare disease, only 30 patients with PAH participated in the study. The small number of patients in this study is not uncommon; other studies have each included approximately 20 patients with PAH. 29,30 Although our sample size was sufficient to identify crude trends among patients with PAH, the number of cases was not sufficient to allow assessment of the differences in PAH subcategories. We found that the frequencies of NGFR positive cells, mPAP, and major adverse events tended to be higher in the atypical PAH group, perhaps because these patients were older and had more complications such as heart and respiratory diseases. Further studies including greater numbers of patients are also required to identify factors that affect NGFR positive cell expression, such as subtypes and treatments of PAH. Furthermore, our subjects had mildto-moderate PAH; studies including patients with severe PAH are required to facilitate more accurate prediction of survival and adverse events. Second, only major markers of EPCs (CD34, VEGFR2, and CD133) and MSCs (NGFR, PDGFRa, and CD90) were investigated in this study. Recently, CD146, an MSC marker, has been shown to be involved with vascular remodeling and the progression of PAH in animal models. 38 In addition, the changes in single marker positive EPCs and MSCs did not directly reflect changes in EPC and MSC expression in PBMNCs. Further study is required regarding other representative markers of EPCs and MSCs, and the functions of marker positive cells in PAH. Furthermore, this study compared only the BNP level with EPC and MSC markers. However, various other biomarkers (e.g. IL-6, osteopontin, and N-terminal propeptide of procollagen III) are also reportedly correlated with PAH. 2 Therefore, the abilities of EPC and MSC markers to predict the severity and prognosis of PAH should also be compared with the biomarkers mentioned above. Finally, although NGFR is reportedly expressed on the surface of MSCs, the present study did not demonstrate that circulating NGFR positive cells have properties of MSCs. Further studies are needed to investigate how circulating NGFR positive cells are involved in vascular remodeling in patients with PAH. Conclusion In conclusion, levels of circulating EPC and MSC markers in PBMNCs were elevated in patients with PAH. Among these markers, NGFR was the most strongly correlated with disease severity, and may be a prognostic factor for PAH. These results imply that circulating NGFR positive cells in PBMNCs may be a useful novel biomarker for severity and prognosis in patients with PAH.
An East Anglian mental health charity has launched a national directory of support groups aiming to help people struggling with the strains of farming and isolated rural life. The YANA (You Are Not Alone) project provides confidential counselling for those in farming and rural industries across Norfolk and Suffolk. But in response to frequent questions about whether there are similar organisations in other parts of the country, YANA has researched, funded and compiled a national directory of support groups and key national charities which can specifically help people in countryside communities. The booklet also provides advice on how to recognise symptoms of stress and depression and how best to help a client, colleague, friend or family. The first 1,000 copies are being distributed to relevant businesses, charities and organisations across the UK, and it is also available online at www.yanahelp.org. Jo Hoey from YANA said there is no cost for this first edition, as the charity had received “sizable donations” following the tragic death of a Norfolk farmer. “We wanted to make good use of the income and do something tangible in his memory,” she said. “We hope that this directory will mean that many more people will be aware of the help that is available, how to access it and, importantly, how to be supportive to others. “We are so grateful to The Worshipful Company of Farmers and Farm Safety Foundation who have enthusiastically supported our work. • For copies of the directory, email johoey@yanahelp.org or download it from www.yanahelp.org.
def update_mentions(mentions,report1,language,user,mode,topic): json_response = {'message':'Mentions and Ground truth saved'} var_link = False var_conc = False topic = UseCase.objects.get(name = topic) user_annot = Annotate.objects.filter(username = user,ns_id=mode, language = language, id_report=report1,name = topic) for single_ann in user_annot: ann_cur = AnnotationLabel.objects.get(label=single_ann.label_id) mention_cur = Mention.objects.get(start = int(single_ann.start_id),stop = int(single_ann.stop),id_report = report1,language = language) ment_deleted = True for mention in mentions: if single_ann.start_id == int(mention['start']) and single_ann.stop == int(mention['stop']) and str(mention['label']) == single_ann.label_id: Annotate.objects.filter(username=user, ns_id=mode, start=mention_cur,name = topic,label = ann_cur,seq_number = ann_cur.seq_number, stop=mention_cur.stop, language=language, id_report=report1).delete() Annotate.objects.create(username=user, ns_id=mode, start=mention_cur,name = topic,label = ann_cur,seq_number = ann_cur.seq_number, stop=mention_cur.stop, language=language, id_report=report1,insertion_time=Now()) ment_deleted = False if ment_deleted: annotation = Annotate.objects.filter(label = ann_cur,seq_number = ann_cur.seq_number,username = user,name = topic,ns_id=mode,start = mention_cur,stop = mention_cur.stop, language = language, id_report = report1) if annotation.exists(): annotation.delete() link = Linked.objects.filter(username = user,topic_name = topic.name,ns_id=mode,start = mention_cur,stop = mention_cur.stop, language = language, id_report = report1) for elem in link: conc = Concept.objects.get(concept_url = elem.concept_url_id) area = SemanticArea.objects.get(name = elem.name_id) conc_obj = Contains.objects.filter(username = user,ns_id=mode, language = language, id_report=report1,concept_url = conc, name = area,topic_name = topic) if conc_obj.exists(): conc_obj.delete() var_conc = True if link.exists(): link.delete() var_link = True if var_link: obj1 = GroundTruthLogFile.objects.filter(username=user,ns_id=mode,id_report=report1,language = language,name = topic, gt_type='concept-mention') if obj1.exists(): obj1.delete() if Linked.objects.filter(username = user,ns_id=mode, language = language, id_report = report1,topic_name = topic).exists(): jsonDict = serialize_gt('concept-mention', user.username, report1.id_report, language,mode,topic) c = GroundTruthLogFile.objects.create(username=user,ns_id=mode, id_report=report1, language=language, gt_json=jsonDict,name = topic, gt_type='concept-mention', insertion_time=Now()) if var_conc: obj1 = GroundTruthLogFile.objects.filter(username=user, ns_id=mode,id_report=report1, language=language,name = topic, gt_type='concepts') if obj1.exists(): obj1.delete() if Contains.objects.filter(username = user,ns_id=mode, language = language,topic_name = topic, id_report = report1).exists(): jsonDict = serialize_gt('concepts', user.username, report1.id_report, language,mode,topic) c = GroundTruthLogFile.objects.create(username=user,ns_id=mode, id_report=report1, language=language, gt_json=jsonDict, gt_type='concepts',topic_name = topic, insertion_time=Now()) for mention in mentions: start_char = int(mention['start']) end_char = int(mention['stop']) mention_text = mention['mention_text'] label = mention['label'] if not Mention.objects.filter(start=start_char, stop=end_char,id_report=report1,language = language).exists(): Mention.objects.create(language = language,start=start_char, stop=end_char, mention_text=mention_text, id_report=report1) obj = Mention.objects.get(start=start_char, stop=end_char,id_report=report1, language=language) ann = AnnotationLabel.objects.get(label = label) if not Annotate.objects.filter(label = ann,seq_number = ann.seq_number, username=user,ns_id=mode,language = language, id_report=report1,start=obj, stop=obj.stop,name = topic).exists() : Annotate.objects.create(label = ann,seq_number = ann.seq_number,username=user,ns_id=mode,language = language, id_report=report1,start=obj, stop=obj.stop, name = topic,insertion_time=Now()) else: json_response = {'message':'You tried to save the same element twice. This is not allowed. We saved only once.'} return json_response
/******************************************************************************* * Copyright (c) 2018 IBM Corp. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v2.0 * and Eclipse Distribution License v1.0 which accompany this distribution. * * The Eclipse Public License is available at * https://www.eclipse.org/legal/epl-2.0/ * and the Eclipse Distribution License is available at * http://www.eclipse.org/org/documents/edl-v10.php. * * Contributors: * <NAME> - initial API and implementation and/or initial documentation *******************************************************************************/ #if !defined(SUBOPTS_H) #define SUBOPTS_H /** The MQTT V5 subscribe options, apart from QoS which existed before V5. */ typedef struct MQTTSubscribe_options { /** The eyecatcher for this structure. Must be MQSO. */ char struct_id[4]; /** The version number of this structure. Must be 0. */ int struct_version; /** To not receive our own publications, set to 1. * 0 is the original MQTT behaviour - all messages matching the subscription are received. */ unsigned char noLocal; /** To keep the retain flag as on the original publish message, set to 1. * If 0, defaults to the original MQTT behaviour where the retain flag is only set on * publications sent by a broker if in response to a subscribe request. */ unsigned char retainAsPublished; /** 0 - send retained messages at the time of the subscribe (original MQTT behaviour) * 1 - send retained messages on subscribe only if the subscription is new * 2 - do not send retained messages at all */ unsigned char retainHandling; } MQTTSubscribe_options; #define MQTTSubscribe_options_initializer { {'M', 'Q', 'S', 'O'}, 0, 0, 0, 0 } #endif
package rollingreader import ( "bytes" cryptoRand "crypto/rand" . "github.com/smartystreets/goconvey/convey" "io/ioutil" mathRand "math/rand" "testing" "time" ) func randomBytes() []byte { buf := make([]byte, mathRand.Intn(100)) cryptoRand.Read(buf) return buf } func TestRollingReader(t *testing.T) { Convey("Given a RollingReader initialized with one reader", t, func() { in := randomBytes() rr := New(bytes.NewReader(in)) Convey("Multiple arbitrarily timed readers' data should pass through correctly", func() { // Add delayed readers in the background go func() { for i := 0; i < 10; i += 1 { b := randomBytes() in = append(in, b...) rr.Add(bytes.NewReader(b)) delay := time.Duration(mathRand.Intn(50)) time.Sleep(delay * time.Millisecond) } rr.Close() }() // Read until EOF while readers are being added out, _ := ioutil.ReadAll(rr) So(out, ShouldResemble, in) }) }) }
Development of a Porcine Slaughterhouse Kidney Perfusion Model Machine perfusion techniques are becoming standard care in the clinical donation and transplantation setting. However, more research is needed to understand the mechanisms of the protective effects of machine perfusion. For preservation related experiments, porcine kidneys are acceptable alternatives to human kidneys, because of their size and similar physiology. In this experiment, the use of slaughterhouse kidneys was evaluated with normothermic kidney perfusion (NKP), thereby avoiding the use of laboratory animals. Porcine kidneys were derived from two local abattoirs. To induce different degrees of injury, different warm ischemic times and preservation techniques were used. After preservation, kidneys were reperfused for 4 h with two different NKP solutions to test renal function and damage. The effect of the preservation technique or a short warm ischemic time was clearly seen in functional markers, such as creatinine clearance and fractional sodium excretion levels, as well as in the generic damage marker lactate dehydrogenase (LDH). Porcine slaughterhouse kidneys are a useful alternative to laboratory animals for transplantation- and preservation-related research questions. To maintain kidney function during NKP, a short warm ischemic time or hypothermic machine perfusion during the preservation phase are mandatory. Introduction According to the World Health Organization, global organ shortage is a major public health problem, since only 10% of the worldwide need of organs for transplantation is being met. This organ shortage forces the transplant community to accept organs that are of poor or doubtable quality. Significant attention is also given to improving organ preservation possibilities. One major breakthrough was the introduction of hypothermic machine perfusion as a widely used preservation technique. Machine preservation is usually performed at hypothermic temperatures (<10 C), following the idea that metabolism is suppressed due to hypothermia. Hypothermic machine perfusion (HMP), as a preservation modality, has already proven to reduce the duration and incidence of delayed graft function (DGF) in deceased donors in comparison with the historical standard preservation technique, static cold storage (SCS). In addition to the use of MP as a preservation method, it is also used as a platform to assess organ quality by measuring biological functions or as a treatment option. Machine perfusion to test kidney function is conducted at subnormothermic (±21 C) or normothermic (±37 C) temperatures, since higher metabolic rates are necessary to assess function. The feasibility of normothermic machine perfusion (NMP) to test kidney function is currently being investigated in the clinical setting, revealing positive outcomes. Although increased use of machine perfusion modalities has been seen over the last decade, in depth research on the mechanisms behind how machine perfusion influences quality is needed-especially since the majority of research to date has focused on clinical applications and the effects on patient and/or graft survival, not on fundamentals of mechanisms. For preservation-related experiments, rodent models are less useful, due to their aberrant size and physiology compared to humans. Apart from nonhuman primates, pigs show the closest resemblance to humans and could be used. However, the laboratory pig model is both expensive and labor intensive. In addition, the use of laboratory animals for research is actively discouraged by several societal organizations and governments. Additionally, in the Netherlands, public acceptance for the use of laboratory animals is declining and regulations are increasing. In 1959, Russell and Burch proposed the principle of the three Rs; Replacement, Reduction and Refinement. This implies the search for replacement for the use of animals for scientific experiments, as well as efforts to minimize the number of animals necessary for experiments, minimize suffering, and increase the wellbeing of the animals used in experiments. In this context, we aimed to develop a relevant model in which machine perfusion-related experiments could be performed without the use of laboratory animals. Every year, more than 15 million pigs are slaughtered for human consumption in the Netherlands. We considered the kidneys of freshly slaughtered pigs as a potential alternative source for transplantation research. Aside from the ethical considerations of moving from laboratory animals to slaughterhouse material, it is a cost-effective method to acquire materials for scientific research. Laboratory animals need housing, food and medical attention, which is expensive. In this exploratory study, we described which technological and logistic hurdles were considered in the development of the porcine slaughterhouse kidney. Major considerations were: the impact of warm ischemia time, the type of preservation and the type of perfusion solution on kidney function. Animal Model Porcine kidneys were obtained from two local abattoirs (Hilbrants/Kroon Vlees, Groningen, The Netherlands) where domestic Dutch landrace pigs (Boar: Tempo Sow: Topigs 20) bred for meat consumption were slaughtered at the age of 6 months, at an average weight of 90 kg. Animals were terminated with the standardized procedure of sedative electric shock, followed by exsanguination. For the pigs intended to be used as source for kidneys, approximately 1 L of blood was collected in a container with 25.000 IU of heparin (LEO Pharma A/S, Ballerup, Denmark). Both kidneys were retrieved and, based on appearance and anatomy, one kidney was chosen for inclusion. No animal ethics committee approval was necessary since slaughterhouse waste material was used. Experimental Design Different warm ischemic times (WIT) were applied to have the opportunity to assess different levels of ischemic injury. Three preservation modalities were chosen: static cold storage (CS), non-oxygenated hypothermic machine perfusion (HMP 0% ) and oxygenated hypothermic machine perfusion (HMP 100% ). These were chosen to assess different levels of kidney quality as a result of the applied preservation techniques. All kidneys were subsequently reperfused in an ex vivo normothermic kidney perfusion (NKP) setup for a duration of 4 h using two different NKP strategies ( Table 1). The rationale for choosing two different NKP solutions was to see whether renal function would change during normothermic perfusion due to the addition of different nutrients. It is known that amino acids are used in clinical practice to test renal functional reserve and to improve renal function in isolated perfused kidneys. Details on the composition of perfusion solutions used are shown in Table 2. Cold Storage and Hypothermic Machine Perfusion After kidney retrieval, the renal artery and ureter were localized and perirenal fat was removed at the slaughterhouse. The kidneys were flushed after a set period of warm ischemia through the renal artery with 0.9% sodium chloride solution at 4 Celsius (Baxter BV, Utrecht, The Netherlands) until a clear effluent appeared from the renal vein. In the CS groups, kidneys were stored in an organ preservation bag, submerged in 0.9% sodium chloride solution at 4 Celsius (Baxter BV, Utrecht, The Netherlands) and stored on melting ice for several hours. In the HMP groups the kidneys were cannulated to connect the renal artery to the hypothermic machine perfusion device (Kidney Assist Transport, Organ Assist, Groningen, The Netherlands). The aorta was used to create a patch (Figure 1a), mounted to the patch holder ( Figure 1b) and placed in the kidney holder (Figure 1c) in the kidney assist machine (Figure 1d). A total of 330 mL University of Wisconsin machine perfusion solution (Belzers MP, Bridge to Life Ltd., London, United Kingdom) was used as perfusion solution. Preservation was performed at 4 C with pulsatile pressure-controlled perfusion set at a mean arterial pressure of 25 mmHg (30/20 mmHg). In case of oxygen delivery, 100% oxygen was supplied to the oxygenator (Hilite LT 1000, Medos Medizintechnik AG, Stolberg, Germany) at a fixed flow rate of 100 mL/min. Perfusion pressure, flow rate and temperature of the perfusion solution was monitored continuously. After start of the preservation, kidneys were transported to the lab for further experimentation and analysis. Transplantology 2022, 2, FOR PEER REVIEW 4 Ex Vivo Normothermic Machine Perfusion to Assess Renal Function The normothermic perfusion setup consisted of a centrifugal pump motor (Deltastream DP2, Medos Medizintechnik AG, Stolberg, Germany) integrated into the Kidney Assist Transporter (Organ Assist, Groningen, The Netherlands). The software of the pump was adjusted to allow higher perfusion pressures. The disposable perfusion circuit included a centrifugal pump head (Deltastream DP2, Medos Medizintechnik AG, Stolberg, Germany), an oxygenator with integrated heat exchanger (Hilite LT 1000, Medos Medizintechnik AG, Stolberg, Germany), a pressure probe (TrueWave disposable pressure transducer, Edwards Lifesciences, Irvine, CA, USA) and disposable inch tubing (Rehau Rauclai-E, Rehau N.V., Nijkerk, The Netherlands) to connect the separate parts. For flow monitoring, an ultrasonic clamp-on flow probe (ME7PXL clamp inch flow meter, Transonic Systems Inc., Ithaca, NY, USA) was attached. Temperature of the solution was measured with a temperature probe. The kidneys were placed in a specially designed organ chamber during perfusion. The NMP setup was surrounded by an insulated heating cabinet with a feedback system, to maintain the ambient temperature at 37 °C. An overview of the total setup is shown in Figure 2. Ex Vivo Normothermic Machine Perfusion to Assess Renal Function The normothermic perfusion setup consisted of a centrifugal pump motor (Deltastream DP2, Medos Medizintechnik AG, Stolberg, Germany) integrated into the Kidney Assist Transporter (Organ Assist, Groningen, The Netherlands). The software of the pump was adjusted to allow higher perfusion pressures. The disposable perfusion circuit included a centrifugal pump head (Deltastream DP2, Medos Medizintechnik AG, Stolberg, Germany), an oxygenator with integrated heat exchanger (Hilite LT 1000, Medos Medizintechnik AG, Stolberg, Germany), a pressure probe (TrueWave disposable pressure transducer, Edwards Lifesciences, Irvine, CA, USA) and disposable 1 4 inch tubing (Rehau Rauclai-E, Rehau N.V., Nijkerk, The Netherlands) to connect the separate parts. For flow monitoring, an ultrasonic clamp-on flow probe (ME7PXL clamp 1 4 inch flow meter, Transonic Systems Inc., Ithaca, NY, USA) was attached. Temperature of the solution was measured with a temperature probe. The kidneys were placed in a specially designed organ chamber during perfusion. The NMP setup was surrounded by an insulated heating cabinet with a feedback system, to maintain the ambient temperature at 37 C. An overview of the total setup is shown in Figure 2. The perfusion solution was prepared pre-perfusion, as mentioned in Table 2. First, the collected blood was depleted from leukocytes by means of passing the blood through a leukocyte filter (Bio R O 2 plus, Fresenius Kabi, Zeist, The Netherlands). After this, 500 mL of the depleted fraction was mixed with 300 mL Ringers Lactate and supplemented with supporting agents. After both the setup and solution were prepared and equilibrated, the kidney was taken out of the icebox or the hypothermic machine perfusion machine and placed on an ice-cold working station. The renal artery and ureter were cannulated with a 12 and 8 French cannula, respectively. Prior to the start of NKP, the kidney was weighed. NKP was started by placing the kidney in the organ chamber, connected to arterial cannula and perfused for four hours at a mean arterial pressure of 75 mmHg (90/60 mmHg) at 37 Celsius. Throughout the perfusion period, the solution was oxygenated with carbogen, a mixture of 95% O 2 and 5% CO 2, at a fixed flow rate of 0.5 L/min. Transplantology 2022, 2, FOR PEER REVIEW 5 Figure 2. The normothermic perfusion circuit. The perfusion solution was prepared pre-perfusion, as mentioned in Table 2. First, the collected blood was depleted from leukocytes by means of passing the blood through a leukocyte filter (Bio R O2 plus, Fresenius Kabi, Zeist, The Netherlands). After this, 500 mL of the depleted fraction was mixed with 300 mL Ringers Lactate and supplemented with supporting agents. After both the setup and solution were prepared and equilibrated, the kidney was taken out of the icebox or the hypothermic machine perfusion machine and placed on an ice-cold working station. The renal artery and ureter were cannulated with a 12 and 8 French cannula, respectively. Prior to the start of NKP, the kidney was weighed. NKP was started by placing the kidney in the organ chamber, connected to arterial cannula and perfused for four hours at a mean arterial pressure of 75 mmHg (90/60 mmHg) at 37° Celsius. Throughout the perfusion period, the solution was oxygenated with carbogen, a mixture of 95% O2 and 5% CO2, at a fixed flow rate of 0.5 L/min. Evaluation of Renal Function The main readout in the development of the model was the assessment of kidney function. Renal flow rates were recorded in ten minute intervals to review the flow pattern. Urine production was measured after 15, 30, 60, 90, 120, 150, 180, 210 and 240 min. Blood and urine samples were collected at these same time points. Furthermore, arterial and venous blood was drawn for blood gas analysis (ABL90 FLEX, Radiometer, Zoetermeer, The Netherlands) to measure partial oxygen pressures, saturation and glucose levels. Concentrations of creatinine and sodium were determined in blood and urine samples by the clinical chemistry lab of the University Medical Center Groningen. With these measurements, creatinine clearance and fractional sodium excretion (FeNa) were calculated with the formulas stated in Table 3. Renal oxygen consumption QO2 was used as an indicator for metabolic activity of the kidneys and was calculated with the formula found in Table 3. Evaluation of Renal Function The main readout in the development of the model was the assessment of kidney function. Renal flow rates were recorded in ten minute intervals to review the flow pattern. Urine production was measured after 15, 30, 60, 90, 120, 150, 180, 210 and 240 min. Blood and urine samples were collected at these same time points. Furthermore, arterial and venous blood was drawn for blood gas analysis (ABL90 FLEX, Radiometer, Zoetermeer, The Netherlands) to measure partial oxygen pressures, saturation and glucose levels. Concentrations of creatinine and sodium were determined in blood and urine samples by the clinical chemistry lab of the University Medical Center Groningen. With these measurements, creatinine clearance and fractional sodium excretion (FeNa) were calculated with the formulas stated in Table 3. Renal oxygen consumption QO 2 was used as an indicator for metabolic activity of the kidneys and was calculated with the formula found in Table 3. Total sodium reabsorption (TNa) and metabolic coupling of sodium transport by ATPase in tubular epithelial cells were calculated by dividing TNa with renal oxygen QO 2 as described in the formula in Table 3. Enzymatic activities of lactate dehydrogenase (LDH) were determined in the perfusion solution at the clinical chemistry lab according to standard procedures. In short, the international federation of clinical chemistry method was used, meaning that the lactateto-pyruvate conversion was measured at a temperature of 37 C at a pH between 8.8-9.8. Plasma was separated by centrifuging the samples for 5 min at 1800 g and the samples were subsequently analyzed in the photo spectrometer at 340 nm. Table 3. Equations for calculating renal metabolic and functional parameters. Statistics Results were reported as means with standard deviation. All graphs were made with Graphpad Prism 7.02 (San Diego, CA, USA). Hypothermic and Normothermic Perfusion Parameters No differences were seen in HMP flows between the three groups that were HMPpreserved. All groups showed a similar flow pattern, with a steep and fast increase for the first 20 min and a slowly increasing flow rate thereafter ( Figure 3A). During the four-hour normothermic perfusion, renal blood flow increased in every group in the first hour. The steepness of the slopes and trends were variable between the groups (Figure 3B,C). The highest flow rates were found for the CS S-WIT group, comparable lower flow rates for the CS S-WIT, HMP 100% and HMP 100% + AA groups, and the lowest flow rates for the HMP 0% group. preserved. All groups showed a similar flow pattern, with a steep and fast increase for the first 20 min and a slowly increasing flow rate thereafter ( Figure 3A). During the four-hour normothermic perfusion, renal blood flow increased in every group in the first hour. The steepness of the slopes and trends were variable between the groups ( Figure 3B,C). The highest flow rates were found for the CS S-WIT group, comparable lower flow rates for the CS S-WIT, HMP100% and HMP100% + AA groups, and the lowest flow rates for the HMP0% group. Renal Function during Normothermic Perfusion Large differences in urine output were seen between the groups. Group CS L-WIT had almost no urine production (total output: <50 mL), while the CS S-WIT kidneys showed a very high output (>500 mL). (Figure 4A,B) All HMP-preserved kidneys consistently produced urine, with the highest urine production (total output: >600 mL) in the HMP100% + AA group ( Figure 4E,F). In both high urine output groups, a high output during the first 120 min and a decrease in the last 120 min was observed. Creatinine clearance from the circuit was highest in the CS S-WIT and HMP100% + AA groups, with the highest clearance rate during the first 120 min, followed by a slow decrease. Kidneys in group HMP0% and HMP100% had a stable clearance over time. The kidneys in group CS L-WIT had a very low creatinine clearance rate (<0.25 mL/min/100g (Figure 4C,G). As a consequence of creatinine clearance, the plasmacreatinine levels decreased. The decrease over the total duration of four hours of NKP was comparable for the kidneys in group CS S-WIT (±650 mol), HMP100% (±600 mol) and HMP100% + AA (±650 mol). Renal Function during Normothermic Perfusion Large differences in urine output were seen between the groups. Group CS L-WIT had almost no urine production (total output: <50 mL), while the CS S-WIT kidneys showed a very high output (>500 mL). (Figure 4A,B) All HMP-preserved kidneys consistently produced urine, with the highest urine production (total output: >600 mL) in the HMP 100% + AA group ( Figure 4E,F). In both high urine output groups, a high output during the first 120 min and a decrease in the last 120 min was observed. Creatinine clearance from the circuit was highest in the CS S-WIT and HMP 100% + AA groups, with the highest clearance rate during the first 120 min, followed by a slow decrease. Kidneys in group HMP 0% and HMP 100% had a stable clearance over time. The kidneys in group CS L-WIT had a very low creatinine clearance rate (<0.25 mL/min/100g ( Figure 4C,G). As a consequence of creatinine clearance, the plasma creatinine levels decreased. The decrease over the total duration of four hours of NKP was comparable for the kidneys in group CS S-WIT (±650 mol), HMP 100% (±600 mol) and HMP 100% + AA (±650 mol). Relative to these groups, the kidneys from group HMP 0% had a decreased ∆plasma creatinine (±500 mol). The CS L-WIT group has the lowest ∆plasma creatinine (100 mol) ( Figure 4D,H). Metabolic Processes during Normothermic Perfusion All kidneys were consuming oxygen during NKP with a slight increase in consumption rates during 4 h NKP for group CS L-WIT, CS S-WIT, HMP 0% and HMP 100%. Kidneys in group HMP 100% + AA used more oxygen during NKP, and a clear difference was obseved between the beginning and end of NKP in terms of oxygen consumption rates ( Figure 5A,E). Sodium reabsorption rates in the CS L-WIT group were absent and, in line w fractional sodium excretion rates, all other groups showed improved TNa levels parison with this group. Kidneys in the HMP100% + AA group showed the highest reabsorbtion rates. Metabolic coupling ratios were highest in the two oxygenated HMP (HMP100%/HMP100% + AA). Lower coupling ratios were found for the HMP0% and CS groups and metabolic coupling ratios of approximately 0 were found for the CS group ( Figure 5D,H). Fractional sodium excretion rates were high for group CS L-WIT (±100%). All other groups showed improved fractional sodium excretion rates in comparison with this group. All groups, except for CS S-WIT, had a decrease in excretion levels between 15 and 60 min. The kidneys from group CS S-WIT immediately had a fractional sodium excretion rate of approximately 30-40% ( Figure 5B,F). Sodium reabsorption rates in the CS L-WIT group were absent and, in line with the fractional sodium excretion rates, all other groups showed improved T Na levels in comparison with this group. Kidneys in the HMP 100% + AA group showed the highest sodium reabsorbtion rates. Metabolic coupling ratios were highest in the two oxygenated HMP groups (HMP 100% / HMP 100% + AA). Lower coupling ratios were found for the HMP 0% and CS S-WIT groups and metabolic coupling ratios of approximately 0 were found for the CS L-WIT group ( Figure 5D,H). Renal Damage The group CS L-WIT showed an increasing LDH concentration during 4 h of NKP. This resulted in a ∆LDH increase for this group that was approximately threefold higher than in all other groups ( Figure 6A,D). Renal Damage The group CS L-WIT showed an increasing LDH concentration during 4 h of NKP. This resulted in a LDH increase for this group that was approximately threefold higher than in all other groups ( Figure 6A,D). Discussion The aim of these experiments was to find out whether porcine slaughterhouse kidneys were useful as a kidney source for transplantation related purposes, especially for kidney preservation research. For this purpose, it was important that quality differences due to preservation techniques or ischemia duration become visible when testing kidney function during normothermic reperfusion. These differences were clearly seen in functional parameters such as creatinine clearance, as well in tubular functions, represented by fractional sodium excretion and metabolic coupling. In terms of renal damage, we found plasma LDH values that were in line with all other parameters. The impact of warm ischemia on function was tested in porcine kidneys with a comparable NMP protocol by Hosgood and colleagues. The perfusion solution used by Hosgood was, to a large extent, comparable to our protocol. Therefore, comparisons can be made on functional outcome. Nearly identical results were presented for serum Discussion The aim of these experiments was to find out whether porcine slaughterhouse kidneys were useful as a kidney source for transplantation related purposes, especially for kidney preservation research. For this purpose, it was important that quality differences due to preservation techniques or ischemia duration become visible when testing kidney function during normothermic reperfusion. These differences were clearly seen in functional parameters such as creatinine clearance, as well in tubular functions, represented by fractional sodium excretion and metabolic coupling. In terms of renal damage, we found plasma LDH values that were in line with all other parameters. The impact of warm ischemia on function was tested in porcine kidneys with a comparable NMP protocol by Hosgood and colleagues. The perfusion solution used by Hosgood was, to a large extent, comparable to our protocol. Therefore, comparisons can be made on functional outcome. Nearly identical results were presented for serum creatinine levels and urine output for kidneys that had a very short warm ischemic time of 7 min. Extended warm ischemic times, however, showed better renal function in the study of Harper, in comparison with our kidneys that were exposed to longer WIT in combination with CS. This could be due to the use of a dedicated hypothermic cold storage solution in contrast to the saline solution used in our experiment. Another study describing the development of a hemoperfused porcine slaughterhouse kidney model showed creatinine clearances 4 times higher than our findings. The use of a simultaneous dialysis module in combination with the perfusion setup resulted in very tight control of electrolytes, metabolites and pH, and could be the explanation for the superior function that they found. However, it also resulted in higher costs and increased complexity of the protocol. In addition to the impact of warm ischemia, we found that preservation by HMP instead of CS improved renal function. Clinically, it has been established that HMP results in superior early kidney function in donation after cardiac death donor (DCD) kidneys, represented by glomerular filtration rates (GFR) in the period after transplantation. Although the GFR found in healthy individuals is approximately 25 times higher than in our experimental situation, the fact that we observed these expected differences in GFR resulting from a superior preservation technique provided confidence in the predictability of this model. In addition, in humans, it is unknown what the exact GFR of a transplanted kidney is during the first hours of reperfusion, which makes a direct comparison with the GFR measurements in our model difficult. This information, however, would be very valuable for a better interpretation of ex vivo kidney perfusion parameters. In our experiments, we tested two different NKP strategies-with and without the addition of amino acids. The amino acid mixture added during reperfusion contained all 9 essential plus 8 additional amino acids. The choice for these amino acids was based on earlier findings in our lab in which the effect of amino acids on normothermic perfused isolated rat kidneys showed improvements in renal function. Although not tested for significance because of the limited number of kidneys in each group, we observed that the addition of this mixture during normothermic reperfusion resulted in improved function and metabolic processes. To our knowledge, this effect has not been described before in porcine kidneys. Further research could be useful to establish which amino acids are resulting in improved renal function and quality during normothermic machine perfusion of pig kidneys. An important feature of a slaughterhouse model is that it provides an endless source of kidneys without the high costs that are inevitable with (large) laboratory animal research. Furthermore, it has considerable ethical benefits. The use of laboratory animals for scientific purposes is constrained because animal experiments do not always provide necessary information or because better alternatives, with improved predictive values, become available. Furthermore, ethical and societal concerns regarding the use and wellbeing of laboratory animals is increasing. The Dutch ministry of agriculture, nature and food quality has announced that The Netherlands hopes to lead the field in the international transition towards laboratory animal-free research, making the development of our model timely and relevant. However, the slaughterhouse model also has its weaknesses. Due to the procedures and regulations at commercial slaughterhouses that produce meat for human consumption, material (blood, specimens and organs) can only be acquired after the death of the animal. Preexisting injury cannot be assessed because it is not permitted to take any baseline samples prior to death; as such, the exact conditions of the kidneys or blood at start of the experiment can vary. Furthermore, the conditions of an experiment with slaughterhouse organs are less controlled than in a laboratory setting. Many reports describe variability in bacterial load and underlying deceases. The work environment is obviously different from a laboratory setting, since part of the preparation and retrieval of the kidneys takes place in a food processing plant. A prerequisite for success with such a model is excellent collaboration with all employees to standardize essential issues such as warm ischemic time and handling of organs and blood without undue interference in their work. We invested in this collaboration by inviting them to our laboratory, offering insight into clinical procedures and explaining the importance of the use of standardized protocols. This resulted in a fruitful collaboration that has already lasted for 6 years. This collaboration has involved experiments with kidneys, livers and lungs and has resulted in several scientific papers in high ranked (transplantation) journals. Publishing data from slaughterhouse models is hampered by the dogmatic view of many reviewers and editors that transplantation research needs to be conducted in laboratory animal models. We do acknowledge the need for transplantation models since an isolated ex situ organ lacks the neuronal and humoral interaction that is part of the transplantation process. However, many research questions can be answered in the slaughterhouse model before moving on to in vivo experiment in live animals. The timeframe of the model described here was 4 h, which enabled us to assess short-term function and injury. However, longer reperfusion times are possible, although maintaining physiological electrolyte content and pH is challenging. Perfusion solutions play a pivotal role in supporting organs during ex situ perfusion and improving them will result in the possibility of longer perfusion durations. Fortunately, our model is very suitable for testing of different perfusion solutions. A limitation of the work described here is that we included too low numbers of kidneys in every group for statistical analysis. Furthermore, we did not collect extra perfusate, urine samples or biopsies. The studies described were our first pilot experiments to see whether it would be possible to preserve and normothermically perfuse porcine kidneys derived from an abattoir. We first focused on basal renal function and injury to finalize protocols that we subsequently used for different research questions that we wanted to address. We have published several papers with the model. We have concluded that this model could provide valuable data for kidney preservation and transplantation research. Results obtained indicated that slaughterhouse kidneys could be used to study quality differences in terms of functionality and injury during normothermic perfusion.
package br.com.rogersdk.pontointeligente.api.services; import java.util.Optional; import br.com.rogersdk.pontointeligente.api.entities.Funcionario; public interface FuncionarioService { /** * Persiste um funcionário * * @param funcionario * @return */ Funcionario persistir(Funcionario funcionario); /** * Busca e retorna um funcionário pelo cpf * * @param cpf * @return */ Optional<Funcionario> buscarPorCpf(String cpf); /** * Busca e retorna um funcionário pelo email * * @param email * @return */ Optional<Funcionario> buscarPorEmail(String email); /** * Busca e retorna um funcionário pelo id * * @param id * @return */ Optional<Funcionario> buscarPorid(Long id); }
import numpy as np from numpy import diag, inf from numpy import copy, dot from numpy.linalg import norm class ExceededMaxIterationsError(Exception): def __init__(self, msg, matrix=[], iteration=[], ds=[]): self.msg = msg self.matrix = matrix self.iteration = iteration self.ds = ds def __str__(self): return repr(self.msg) def nearcorr(A, tol=[], flag=0, max_iterations=100, n_pos_eig=0, weights=None, verbose=False, except_on_too_many_iterations=True): """ X = nearcorr(A, tol=[], flag=0, max_iterations=100, n_pos_eig=0, weights=None, print=0) Finds the nearest correlation matrix to the symmetric matrix A. ARGUMENTS ~~~~~~~~~ A is a symmetric numpy array or a ExceededMaxIterationsError object tol is a convergence tolerance, which defaults to 16*EPS. If using flag == 1, tol must be a size 2 tuple, with first component the convergence tolerance and second component a tolerance for defining "sufficiently positive" eigenvalues. flag = 0: solve using full eigendecomposition (EIG). flag = 1: treat as "highly non-positive definite A" and solve using partial eigendecomposition (EIGS). CURRENTLY NOT IMPLEMENTED max_iterations is the maximum number of iterations (default 100, but may need to be increased). n_pos_eig (optional) is the known number of positive eigenvalues of A. CURRENTLY NOT IMPLEMENTED weights is an optional vector defining a diagonal weight matrix diag(W). verbose = True for display of intermediate output. CURRENTLY NOT IMPLEMENTED except_on_too_many_iterations = True to raise an exeption when number of iterations exceeds max_iterations except_on_too_many_iterations = False to silently return the best result found after max_iterations number of iterations ABOUT ~~~~~~ This is a Python port by <NAME>, November 2014 Thanks to <NAME> for many useful comments and suggestions. Original MATLAB code by <NAME>, 13/6/01, updated 30/1/13. Reference: <NAME>, Computing the nearest correlation matrix---A problem from finance. IMA J. Numer. Anal., 22(3):329-343, 2002. """ # If input is an ExceededMaxIterationsError object this # is a restart computation if (isinstance(A, ExceededMaxIterationsError)): ds = copy(A.ds) A = copy(A.matrix) else: ds = np.zeros(np.shape(A)) eps = np.spacing(1) if not np.all((np.transpose(A) == A)): raise ValueError('Input Matrix is not symmetric') if not tol: tol = eps * np.shape(A)[0] * np.array([1, 1]) if weights is None: weights = np.ones(np.shape(A)[0]) X = copy(A) Y = copy(A) rel_diffY = inf rel_diffX = inf rel_diffXY = inf Whalf = np.sqrt(np.outer(weights, weights)) iteration = 0 while max(rel_diffX, rel_diffY, rel_diffXY) > tol[0]: iteration += 1 if iteration > max_iterations: if except_on_too_many_iterations: if max_iterations == 1: message = "No solution found in "\ + str(max_iterations) + " iteration" else: message = "No solution found in "\ + str(max_iterations) + " iterations" raise ExceededMaxIterationsError(message, X, iteration, ds) else: # exceptOnTooManyIterations is false so just silently # return the result even though it has not converged return X Xold = copy(X) R = X - ds R_wtd = Whalf*R if flag == 0: X = proj_spd(R_wtd) elif flag == 1: raise NotImplementedError("Setting 'flag' to 1 is currently\ not implemented.") X = X / Whalf ds = X - R Yold = copy(Y) Y = copy(X) np.fill_diagonal(Y, 1) normY = norm(Y, 'fro') rel_diffX = norm(X - Xold, 'fro') / norm(X, 'fro') rel_diffY = norm(Y - Yold, 'fro') / normY rel_diffXY = norm(Y - X, 'fro') / normY X = copy(Y) return X def proj_spd(A): # NOTE: the input matrix is assumed to be symmetric d, v = np.linalg.eigh(A) A = (v * np.maximum(d, 0)).dot(v.T) A = (A + A.T) / 2 return(A)
<filename>scramble.cpp #include "common.h" int memsearch(const unsigned char *buf_where, const unsigned char *buf_search, int buf_where_len, int buf_search_len) { for (int i = 0; i <= buf_where_len-buf_search_len; i++) { for (int j = 0; j < buf_search_len; j++) { if (buf_where[i+j] != buf_search[j]) break; if (j + 1 == buf_search_len) return i; } } return -1; } int __main(int argc, char *argv[]) { if (argc < 2 || argc > 3) { printf("Syntax: px_p8 [-t] filename\n"); exit(1); } int sectors; if (argc == 3 && !strcmp(argv[1], "-t")) { argv[1] = argv[2]; sectors = 2352; } else sectors = 4704; FILE *sector_file; unsigned char *sector = new unsigned char[sectors]; const unsigned char sync[12] = {0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00}; sector_file = fopen(argv[1], "rb"); if (sector_file == NULL) { perror(argv[1]); exit(1); } if (argc == 3) { unsigned int hex; for (int i = 0; fscanf(sector_file, "%02x", &hex) != EOF && i < 3252; i++) { sector[i] = (unsigned char)hex; } } else { fread(sector, 1, sectors, sector_file); } int offset = memsearch(sector, sync, sectors, 12); if (offset == -1) { printf("Error searching for sync!\n"); exit(1); } int ShiftRegister = 0x1; //printf("MSF: %02x:%02x:%02x\n", sector[offset+12], sector[offset+12+1], sector[offset+12+2]); for (int i = 0; i < 3; i++) { sector[offset+12+i] ^= (ShiftRegister&0xFF); for (int j = 0; j < 8; j++) { int hibit = ((ShiftRegister & 1)^((ShiftRegister & 2)>>1)) << 15; ShiftRegister = (hibit | ShiftRegister) >> 1; } } int start_sector = (btoi(sector[offset+12])*60 + btoi(sector[offset+13]))*75 + btoi(sector[offset+14]) - 150; printf("MSF: %02x:%02x:%02x\n", sector[offset+12], sector[offset+12+1], sector[offset+12+2]); offset -= start_sector * 2352; printf("Combined offset: %+d bytes / %+d samples\n", offset, offset / 4); return 0; }
The woman spent six weeks in hospital following the attack in August 2017. A mum who has been left scarred and terrified to leave her home after an horrific dog attack has thanked those who saved her life. The 38-year-old was mauled by a Japanese Akita at a house in Julian Street, South Shields in August last year. The woman was left with bite marks around her neck. Her injuries - which have left her with a ‘pocket’ of space inside her throat - may never fully heal and are so severe she can only eat mashed food or strained soup and in need of a dietician’s help to build up her strength. Doctors who carried out more than 10 hours surgery on her said the dog’s bites were just millimetres away from a carotid artery in her neck. The woman, who does not wish to be named, was taken to the Royal Victoria Infirmary in Newcastle she was transferred to the city’s Freeman Hospital where specialists continued to treat her as she fought for life - at one stage calling in her family because they feared she would not make it. She was in hospital for six weeks before she was able to return home, with Northumbria Police saying she was lucky to be alive following the ordeal. But the mental scaring has left her struggling to leave the house without company, with a fear of dogs. I want to thank my family and my partner, but I also want to thank the Freeman Hospital because if it wasn’t for them, I might not be here. The attack saw Scott Sehem, 32, of no fixed abode, jailed for being in charge of a dog which caused injury while dangerously out of control. She has blocked up much of what happened to her. Today, she has thanked everyone who has helped save her life. While her fear of dogs brought about by the attack remains, she says she realises their behaviour is a result of a lack of training and hopes one day she will feel comfortable in the company of the pets once again. Scott Sehman has been jailed for 16 months as a result of the attack. She said: “I can’t go out now, I have to be with someone from my family. I feel like I have no life because of that. The woman has lost five stones in weight because of her problems eating. She said: “I still have to be around people in case I collapse because I struggle to eat. Scott Sehman outside Newcastle Crown Court. “I joke with my dietician and say a lot of lasses would love to be able to diet like I have. She says I’m funny, but I really have to start to get more weight on. “I’m still terrified and it’s going to take a long time. I feel stupid when I go outside in case I see a dog.
High availability wireless temperature sensors for harsh environments The recent improvements in RF devices transformed wireless sensor networking into a reality. Advantages deriving from the cable removal are well known, especially in industrial applications where large part of the cost is due to wire routing and related maintenance. A lot of studies have been proposed in the past to analyze and anticipate obtainable performance in harsh environments, but only few reports real world experiments. In this work, a wireless system for temperature measurement is proposed. Specifically, a distributed coordinator approach allows implementing a redundant star network topology ensuring high availability and reliability also in harsh environments. The realized system is designed to operate into a vessel subject to very extreme conditions, including an extended temperature and pressure range (from -5 to +140 °C and up to 5 bar) with the presence of humidity (RH 100% condensing). In particular, the RF signal quality has been experimentally verified also in such a critical environment.
<reponame>fugeritaetas/morozko-lib package org.morozko.java.mod.web.servlet.filter; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletInputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; import javax.servlet.http.HttpServletResponse; import org.morozko.java.core.ent.servlet.filter.HttpFilter; import org.morozko.java.core.io.StreamIO; import org.morozko.java.mod.web.servlet.response.HttpServletResponseByteData; public class RequestLogFilter extends HttpFilter { public void destroy() { } public void doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequestBuffer req = new HttpServletRequestBuffer( request ); HttpServletResponseByteData resp = new HttpServletResponseByteData( response ); chain.doFilter( req, resp ); ByteArrayOutputStream buffer = resp.getBaos(); this.getLog().info( ">>>>> request start" ); this.getLog().info( new String( req.getData() ) ); this.getLog().info( ">>>>> request end" ); this.getLog().info( ">>>>> response start" ); this.getLog().info( new String( buffer.toByteArray() ) ); this.getLog().info( ">>>>> response end" ); buffer.writeTo( resp.getOriginalOutputStream() ); } public void init(FilterConfig config) throws ServletException { } } class HttpServletRequestBuffer extends HttpServletRequestWrapper { private byte[] data; public HttpServletRequestBuffer( HttpServletRequest req ) throws IOException { super(req); ByteArrayOutputStream input = new ByteArrayOutputStream(); StreamIO.pipeStream( req.getInputStream() , input ); this.data = input.toByteArray(); } public ServletInputStream getInputStream() throws IOException { return new ServletInputStreamWrapper( new ByteArrayInputStream( this.data ) ); } public BufferedReader getReader() throws IOException { return new BufferedReader( new InputStreamReader( this.getInputStream() ) ); } public byte[] getData() { return data; } } class ServletInputStreamWrapper extends ServletInputStream { private InputStream wrapped; public int read() throws IOException { return this.wrapped.read(); } public ServletInputStreamWrapper(InputStream wrapped) { super(); this.wrapped = wrapped; } }
<gh_stars>100-1000 package eu.the5zig.mod.chat.party; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import eu.the5zig.mod.I18n; import eu.the5zig.mod.The5zigMod; import eu.the5zig.mod.chat.entity.Conversation; import eu.the5zig.mod.chat.entity.Message; import eu.the5zig.mod.chat.entity.User; import eu.the5zig.mod.chat.gui.ChatLine; import eu.the5zig.mod.chat.party.handler.*; import eu.the5zig.mod.event.EventHandler; import eu.the5zig.mod.event.ServerJoinEvent; import eu.the5zig.mod.event.ServerQuitEvent; import eu.the5zig.mod.gui.GuiParty; import eu.the5zig.util.Utils; import eu.the5zig.util.minecraft.ChatColor; import java.util.Collections; import java.util.List; import java.util.UUID; public class PartyManager { private Party party; private final List<PartyOwner> partyInvitations = Lists.newArrayList(); private final List<PartyServerHandler> serverHandlers = ImmutableList.of(new BadLionHandler(), new BergwerglabsHandler(), new CytooxienHandler(), new DustMCHandler(), new GommeHDHandler(), new HiveMCHandler(), new HypixelHandler(), new MineplexHandler(), new PlayMinityHandler(), new RewinsideHandler(), new TimoliaHandler()); private PartyServerHandler currentServerHandler; public PartyManager() { The5zigMod.getListener().registerListener(this); } public Party getParty() { return party; } public void setParty(Party party) { this.party = party; if(party != null) { Collections.sort(party.getMembers()); } } public boolean addPartyInvitation(User user) { final PartyOwner partyOwner = new PartyOwner(user.getUsername(), user.getUniqueId()); if (partyInvitations.contains(partyOwner)) { partyInvitations.get(partyInvitations.indexOf(partyOwner)).time = System.currentTimeMillis(); return false; } else { partyInvitations.add(partyOwner); return true; } } public List<PartyOwner> getPartyInvitations() { return partyInvitations; } @EventHandler public void onJoin(ServerJoinEvent event) { for (PartyServerHandler serverHandler : serverHandlers) { if (serverHandler.match(event.getHost(), event.getPort())) { currentServerHandler = serverHandler; break; } } } @EventHandler public void onQuit(ServerQuitEvent event) { currentServerHandler = null; } public PartyServerHandler getCurrentServerHandler() { return currentServerHandler; } public void addBroadcast(String key, Object... values) { if (party == null) { return; } if (I18n.has(key + ".broadcast")) { addMessage(new Message(party.getPartyConversation(), 0, "", I18n.translate(key + ".broadcast", values), System.currentTimeMillis(), Message.MessageType.CENTERED)); } if (I18n.has(key + ".overlay")) { The5zigMod.getOverlayMessage().displayMessageAndSplit(ChatColor.YELLOW + I18n.translate(key + ".overlay", values)); } } public void addMessage(Message message) { if (party == null) { return; } checkNewDay(party.getPartyConversation(), message); party.getPartyConversation().addMessage(message); addChatLineToGui(message); if (The5zigMod.getConfig().getBool("playMessageSounds")) { The5zigMod.getVars().playSound("the5zigmod", message.getMessageType() == Message.MessageType.RIGHT ? "chat.message.send" : "chat.message.receive", 1); } } private void checkNewDay(final Conversation conversation, final Message newMessage) { if (!conversation.getMessages().isEmpty() && Utils.isSameDay(newMessage.getTime(), conversation.getMessages().get(conversation.getMessages().size() - 1).getTime())) return; final long time = newMessage.getTime() - 1; final Message dateMessage = new Message(conversation, 0, "", "", time, Message.MessageType.DATE); conversation.addMessage(dateMessage); addChatLineToGui(dateMessage); } private void addChatLineToGui(Message message) { if (The5zigMod.getVars().getCurrentScreen() instanceof GuiParty) { GuiParty gui = (GuiParty) The5zigMod.getVars().getCurrentScreen(); gui.chatLines.add(ChatLine.fromMessage(message)); gui.chatList.scrollToBottom(); } } public class PartyOwner extends User { private long time; public PartyOwner(String username, UUID uuid) { super(username, uuid); this.time = System.currentTimeMillis(); } } }
<gh_stars>10-100 package android.support.v7.widget; import android.annotation.TargetApi; import android.content.Context; import android.content.res.ColorStateList; import android.content.res.Resources; import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.Rect; import android.graphics.Region.Op; import android.graphics.Typeface; import android.graphics.drawable.Drawable; import android.os.Build.VERSION; import android.support.v4.graphics.drawable.DrawableCompat; import android.support.v4.view.MotionEventCompat; import android.support.v4.view.ViewCompat; import android.support.v4.widget.AutoScrollHelper; import android.support.v7.appcompat.R; import android.text.Layout; import android.text.Layout.Alignment; import android.text.StaticLayout; import android.text.TextPaint; import android.text.TextUtils; import android.text.method.TransformationMethod; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.VelocityTracker; import android.view.ViewConfiguration; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityNodeInfo; import android.view.animation.Animation; import android.view.animation.Transformation; import android.widget.CompoundButton; import com.xunlei.tdlive.sdk.IHost; import com.xunlei.xiazaibao.sdk.XZBDevice; import org.android.spdy.SpdyAgent; public class SwitchCompat extends CompoundButton { private static final int[] F; private Layout A; private TransformationMethod B; private a C; private final Rect D; private final r E; private Drawable a; private Drawable b; private int c; private int d; private int e; private boolean f; private CharSequence g; private CharSequence h; private boolean i; private int j; private int k; private float l; private float m; private VelocityTracker n; private int o; private float p; private int q; private int r; private int s; private int t; private int u; private int v; private int w; private TextPaint x; private ColorStateList y; private Layout z; private class a extends Animation { final float a; final float b; final float c; private a(float f, float f2) { this.a = f; this.b = f2; this.c = f2 - f; } protected final void applyTransformation(float f, Transformation transformation) { SwitchCompat.this.setThumbPosition(this.a + (this.c * f)); } } static { F = new int[]{16842912}; } public SwitchCompat(Context context, AttributeSet attributeSet) { this(context, attributeSet, R.attr.switchStyle); } public SwitchCompat(Context context, AttributeSet attributeSet, int i) { super(context, attributeSet, i); this.n = VelocityTracker.obtain(); this.D = new Rect(); this.x = new TextPaint(1); Resources resources = getResources(); this.x.density = resources.getDisplayMetrics().density; cm a = cm.a(context, attributeSet, R.styleable.SwitchCompat, i); this.a = a.a(R.styleable.SwitchCompat_android_thumb); if (this.a != null) { this.a.setCallback(this); } this.b = a.a(R.styleable.SwitchCompat_track); if (this.b != null) { this.b.setCallback(this); } this.g = a.c(R.styleable.SwitchCompat_android_textOn); this.h = a.c(R.styleable.SwitchCompat_android_textOff); this.i = a.a(R.styleable.SwitchCompat_showText, true); this.c = a.c(R.styleable.SwitchCompat_thumbTextPadding, 0); this.d = a.c(R.styleable.SwitchCompat_switchMinWidth, 0); this.e = a.c(R.styleable.SwitchCompat_switchPadding, 0); this.f = a.a(R.styleable.SwitchCompat_splitTrack, false); int e = a.e(R.styleable.SwitchCompat_switchTextAppearance, 0); if (e != 0) { Typeface typeface; TypedArray obtainStyledAttributes = context.obtainStyledAttributes(e, R.styleable.TextAppearance); ColorStateList colorStateList = obtainStyledAttributes.getColorStateList(R.styleable.TextAppearance_android_textColor); if (colorStateList != null) { this.y = colorStateList; } else { this.y = getTextColors(); } e = obtainStyledAttributes.getDimensionPixelSize(R.styleable.TextAppearance_android_textSize, 0); if (!(e == 0 || ((float) e) == this.x.getTextSize())) { this.x.setTextSize((float) e); requestLayout(); } e = obtainStyledAttributes.getInt(R.styleable.TextAppearance_android_typeface, -1); int i2 = obtainStyledAttributes.getInt(R.styleable.TextAppearance_android_textStyle, -1); switch (e) { case SpdyAgent.ACCS_ONLINE_SERVER: typeface = Typeface.SANS_SERIF; break; case XZBDevice.DOWNLOAD_LIST_RECYCLE: typeface = Typeface.SERIF; break; case XZBDevice.DOWNLOAD_LIST_FAILED: typeface = Typeface.MONOSPACE; break; default: typeface = null; break; } if (i2 > 0) { boolean z; float f; if (typeface == null) { typeface = Typeface.defaultFromStyle(i2); } else { typeface = Typeface.create(typeface, i2); } setSwitchTypeface(typeface); if (typeface != null) { e = typeface.getStyle(); } else { e = 0; } i2 &= e ^ -1; TextPaint textPaint = this.x; if ((i2 & 1) != 0) { z = true; } else { z = false; } textPaint.setFakeBoldText(z); TextPaint textPaint2 = this.x; if ((i2 & 2) != 0) { f = -0.25f; } else { f = 0.0f; } textPaint2.setTextSkewX(f); } else { this.x.setFakeBoldText(false); this.x.setTextSkewX(AutoScrollHelper.RELATIVE_UNSPECIFIED); setSwitchTypeface(typeface); } if (obtainStyledAttributes.getBoolean(R.styleable.TextAppearance_textAllCaps, false)) { this.B = new android.support.v7.b.a(getContext()); } else { this.B = null; } obtainStyledAttributes.recycle(); } this.E = r.a(); a.a.recycle(); ViewConfiguration viewConfiguration = ViewConfiguration.get(context); this.k = viewConfiguration.getScaledTouchSlop(); this.o = viewConfiguration.getScaledMinimumFlingVelocity(); refreshDrawableState(); setChecked(isChecked()); } public void setSwitchTypeface(Typeface typeface) { if (this.x.getTypeface() != typeface) { this.x.setTypeface(typeface); requestLayout(); invalidate(); } } public void setSwitchPadding(int i) { this.e = i; requestLayout(); } public int getSwitchPadding() { return this.e; } public void setSwitchMinWidth(int i) { this.d = i; requestLayout(); } public int getSwitchMinWidth() { return this.d; } public void setThumbTextPadding(int i) { this.c = i; requestLayout(); } public int getThumbTextPadding() { return this.c; } public void setTrackDrawable(Drawable drawable) { this.b = drawable; requestLayout(); } public void setTrackResource(int i) { setTrackDrawable(this.E.a(getContext(), i, false)); } public Drawable getTrackDrawable() { return this.b; } public void setThumbDrawable(Drawable drawable) { this.a = drawable; requestLayout(); } public void setThumbResource(int i) { setThumbDrawable(this.E.a(getContext(), i, false)); } public Drawable getThumbDrawable() { return this.a; } public void setSplitTrack(boolean z) { this.f = z; invalidate(); } public boolean getSplitTrack() { return this.f; } public CharSequence getTextOn() { return this.g; } public void setTextOn(CharSequence charSequence) { this.g = charSequence; requestLayout(); } public CharSequence getTextOff() { return this.h; } public void setTextOff(CharSequence charSequence) { this.h = charSequence; requestLayout(); } public void setShowText(boolean z) { if (this.i != z) { this.i = z; requestLayout(); } } public boolean getShowText() { return this.i; } public void onMeasure(int i, int i2) { int intrinsicWidth; int intrinsicHeight; int max; int i3 = 0; if (this.i) { if (this.z == null) { this.z = a(this.g); } if (this.A == null) { this.A = a(this.h); } } Rect rect = this.D; if (this.a != null) { this.a.getPadding(rect); intrinsicWidth = (this.a.getIntrinsicWidth() - rect.left) - rect.right; intrinsicHeight = this.a.getIntrinsicHeight(); } else { intrinsicHeight = 0; intrinsicWidth = 0; } if (this.i) { max = Math.max(this.z.getWidth(), this.A.getWidth()) + (this.c * 2); } else { max = 0; } this.s = Math.max(max, intrinsicWidth); if (this.b != null) { this.b.getPadding(rect); i3 = this.b.getIntrinsicHeight(); } else { rect.setEmpty(); } intrinsicWidth = rect.left; max = rect.right; if (this.a != null) { rect = ao.a(this.a); intrinsicWidth = Math.max(intrinsicWidth, rect.left); max = Math.max(max, rect.right); } intrinsicWidth = Math.max(this.d, (intrinsicWidth + (this.s * 2)) + max); intrinsicHeight = Math.max(i3, intrinsicHeight); this.q = intrinsicWidth; this.r = intrinsicHeight; super.onMeasure(i, i2); if (getMeasuredHeight() < intrinsicHeight) { setMeasuredDimension(ViewCompat.getMeasuredWidthAndState(this), intrinsicHeight); } } @TargetApi(14) public void onPopulateAccessibilityEvent(AccessibilityEvent accessibilityEvent) { super.onPopulateAccessibilityEvent(accessibilityEvent); Object obj = isChecked() ? this.g : this.h; if (obj != null) { accessibilityEvent.getText().add(obj); } } private Layout a(CharSequence charSequence) { CharSequence transformation; if (this.B != null) { transformation = this.B.getTransformation(charSequence, this); } else { transformation = charSequence; } return new StaticLayout(transformation, this.x, transformation != null ? (int) Math.ceil((double) Layout.getDesiredWidth(transformation, this.x)) : 0, Alignment.ALIGN_NORMAL, 1.0f, 0.0f, true); } public boolean onTouchEvent(MotionEvent motionEvent) { float f = 1.0f; int i = 0; this.n.addMovement(motionEvent); float x; int i2; switch (MotionEventCompat.getActionMasked(motionEvent)) { case SpdyAgent.ACCS_TEST_SERVER: x = motionEvent.getX(); f = motionEvent.getY(); if (isEnabled()) { if (this.a != null) { int thumbOffset = getThumbOffset(); this.a.getPadding(this.D); int i3 = this.u - this.k; thumbOffset = (thumbOffset + this.t) - this.k; int i4 = (((this.s + thumbOffset) + this.D.left) + this.D.right) + this.k; int i5 = this.w + this.k; if (x > ((float) thumbOffset) && x < ((float) i4) && f > ((float) i3) && f < ((float) i5)) { i = 1; } } if (i != 0) { this.j = 1; this.l = x; this.m = f; } } break; case SpdyAgent.ACCS_ONLINE_SERVER: case XZBDevice.DOWNLOAD_LIST_FAILED: if (this.j == 2) { boolean z; this.j = 0; if (motionEvent.getAction() == 1 && isEnabled()) { z = true; } else { i2 = 0; } boolean isChecked = isChecked(); if (z) { this.n.computeCurrentVelocity(IHost.HOST_NOFITY_REFRESH_LIST); x = this.n.getXVelocity(); z = Math.abs(x) > ((float) this.o) ? cw.a(this) ? x < 0.0f : x > 0.0f : getTargetCheckedState(); } else { z = isChecked; } if (z != isChecked) { playSoundEffect(0); } setChecked(z); MotionEvent obtain = MotionEvent.obtain(motionEvent); obtain.setAction(XZBDevice.DOWNLOAD_LIST_FAILED); super.onTouchEvent(obtain); obtain.recycle(); super.onTouchEvent(motionEvent); return true; } this.j = 0; this.n.clear(); break; case XZBDevice.DOWNLOAD_LIST_RECYCLE: switch (this.j) { case SpdyAgent.ACCS_TEST_SERVER: break; case SpdyAgent.ACCS_ONLINE_SERVER: x = motionEvent.getX(); f = motionEvent.getY(); if (Math.abs(x - this.l) > ((float) this.k) || Math.abs(f - this.m) > ((float) this.k)) { this.j = 2; getParent().requestDisallowInterceptTouchEvent(true); this.l = x; this.m = f; return true; } case XZBDevice.DOWNLOAD_LIST_RECYCLE: float x2 = motionEvent.getX(); i2 = getThumbScrollRange(); float f2 = x2 - this.l; x = i2 != 0 ? f2 / ((float) i2) : f2 > 0.0f ? 1.0f : -1.0f; if (cw.a(this)) { x = -x; } x += this.p; if (x < 0.0f) { f = 0.0f; } else if (x <= 1.0f) { f = x; } if (f == this.p) { return true; } this.l = x2; setThumbPosition(f); return true; default: break; } } return super.onTouchEvent(motionEvent); } private void a() { if (this.C != null) { clearAnimation(); this.C = null; } } private boolean getTargetCheckedState() { return this.p > 0.5f; } private void setThumbPosition(float f) { this.p = f; invalidate(); } public void toggle() { setChecked(!isChecked()); } public void setChecked(boolean z) { float f = 1.0f; super.setChecked(z); boolean isChecked = isChecked(); if (getWindowToken() != null && ViewCompat.isLaidOut(this) && isShown()) { if (this.C != null) { a(); } float f2 = this.p; if (!isChecked) { f = 0.0f; } this.C = new a(f2, f, (byte) 0); this.C.setDuration(250); this.C.setAnimationListener(new ch(this, isChecked)); startAnimation(this.C); return; } a(); if (!isChecked) { f = 0.0f; } setThumbPosition(f); } protected void onLayout(boolean z, int i, int i2, int i3, int i4) { int max; int paddingLeft; int paddingTop; int i5 = 0; super.onLayout(z, i, i2, i3, i4); if (this.a != null) { Rect rect = this.D; if (this.b != null) { this.b.getPadding(rect); } else { rect.setEmpty(); } Rect a = ao.a(this.a); max = Math.max(0, a.left - rect.left); i5 = Math.max(0, a.right - rect.right); } else { max = 0; } if (cw.a(this)) { paddingLeft = getPaddingLeft() + max; max = ((this.q + paddingLeft) - max) - i5; i5 = paddingLeft; } else { paddingLeft = (getWidth() - getPaddingRight()) - i5; i5 += max + (paddingLeft - this.q); max = paddingLeft; } switch (getGravity() & 112) { case com.xunlei.tdlive.R.styleable.Toolbar_titleMarginBottom: paddingTop = (((getPaddingTop() + getHeight()) - getPaddingBottom()) / 2) - (this.r / 2); paddingLeft = this.r + paddingTop; break; case com.xunlei.tdlive.R.styleable.AppCompatTheme_panelMenuListTheme: paddingLeft = getHeight() - getPaddingBottom(); paddingTop = paddingLeft - this.r; break; default: paddingTop = getPaddingTop(); paddingLeft = this.r + paddingTop; break; } this.t = i5; this.u = paddingTop; this.w = paddingLeft; this.v = max; } public void draw(Canvas canvas) { Rect a; int i; Rect rect = this.D; int i2 = this.t; int i3 = this.u; int i4 = this.v; int i5 = this.w; int thumbOffset = i2 + getThumbOffset(); if (this.a != null) { a = ao.a(this.a); } else { a = ao.a; } if (this.b != null) { this.b.getPadding(rect); int i6 = rect.left + thumbOffset; if (a != null) { if (a.left > rect.left) { i2 += a.left - rect.left; } if (a.top > rect.top) { thumbOffset = (a.top - rect.top) + i3; } else { thumbOffset = i3; } if (a.right > rect.right) { i4 -= a.right - rect.right; } i = a.bottom > rect.bottom ? i5 - (a.bottom - rect.bottom) : i5; } else { i = i5; thumbOffset = i3; } this.b.setBounds(i2, thumbOffset, i4, i); i = i6; } else { i = thumbOffset; } if (this.a != null) { this.a.getPadding(rect); i2 = i - rect.left; i = (i + this.s) + rect.right; this.a.setBounds(i2, i3, i, i5); Drawable background = getBackground(); if (background != null) { DrawableCompat.setHotspotBounds(background, i2, i3, i, i5); } } super.draw(canvas); } protected void onDraw(Canvas canvas) { int save; Layout layout; super.onDraw(canvas); Rect rect = this.D; Drawable drawable = this.b; if (drawable != null) { drawable.getPadding(rect); } else { rect.setEmpty(); } int i = this.u; i += rect.top; int i2 = this.w - rect.bottom; Drawable drawable2 = this.a; if (drawable != null) { if (!this.f || drawable2 == null) { drawable.draw(canvas); } else { Rect a = ao.a(drawable2); drawable2.copyBounds(rect); rect.left += a.left; rect.right -= a.right; save = canvas.save(); canvas.clipRect(rect, Op.DIFFERENCE); drawable.draw(canvas); canvas.restoreToCount(save); } } save = canvas.save(); if (drawable2 != null) { drawable2.draw(canvas); } if (getTargetCheckedState()) { layout = this.z; } else { layout = this.A; } if (layout != null) { int i3; int[] drawableState = getDrawableState(); if (this.y != null) { this.x.setColor(this.y.getColorForState(drawableState, 0)); } this.x.drawableState = drawableState; if (drawable2 != null) { rect = drawable2.getBounds(); i3 = rect.right + rect.left; } else { i3 = getWidth(); } canvas.translate((float) ((i3 / 2) - (layout.getWidth() / 2)), (float) (((i + i2) / 2) - (layout.getHeight() / 2))); layout.draw(canvas); } canvas.restoreToCount(save); } public int getCompoundPaddingLeft() { if (!cw.a(this)) { return super.getCompoundPaddingLeft(); } int compoundPaddingLeft = super.getCompoundPaddingLeft() + this.q; return !TextUtils.isEmpty(getText()) ? compoundPaddingLeft + this.e : compoundPaddingLeft; } public int getCompoundPaddingRight() { if (cw.a(this)) { return super.getCompoundPaddingRight(); } int compoundPaddingRight = super.getCompoundPaddingRight() + this.q; return !TextUtils.isEmpty(getText()) ? compoundPaddingRight + this.e : compoundPaddingRight; } private int getThumbOffset() { float f; if (cw.a(this)) { f = 1.0f - this.p; } else { f = this.p; } return (int) ((f * ((float) getThumbScrollRange())) + 0.5f); } private int getThumbScrollRange() { if (this.b == null) { return 0; } Rect a; Rect rect = this.D; this.b.getPadding(rect); if (this.a != null) { a = ao.a(this.a); } else { a = ao.a; } return ((((this.q - this.s) - rect.left) - rect.right) - a.left) - a.right; } protected int[] onCreateDrawableState(int i) { int[] onCreateDrawableState = super.onCreateDrawableState(i + 1); if (isChecked()) { mergeDrawableStates(onCreateDrawableState, F); } return onCreateDrawableState; } protected void drawableStateChanged() { super.drawableStateChanged(); int[] drawableState = getDrawableState(); if (this.a != null) { this.a.setState(drawableState); } if (this.b != null) { this.b.setState(drawableState); } invalidate(); } public void drawableHotspotChanged(float f, float f2) { if (VERSION.SDK_INT >= 21) { super.drawableHotspotChanged(f, f2); } if (this.a != null) { DrawableCompat.setHotspot(this.a, f, f2); } if (this.b != null) { DrawableCompat.setHotspot(this.b, f, f2); } } protected boolean verifyDrawable(Drawable drawable) { return super.verifyDrawable(drawable) || drawable == this.a || drawable == this.b; } public void jumpDrawablesToCurrentState() { if (VERSION.SDK_INT >= 11) { super.jumpDrawablesToCurrentState(); if (this.a != null) { this.a.jumpToCurrentState(); } if (this.b != null) { this.b.jumpToCurrentState(); } a(); setThumbPosition(isChecked() ? 1.0f : AutoScrollHelper.RELATIVE_UNSPECIFIED); } } @TargetApi(14) public void onInitializeAccessibilityEvent(AccessibilityEvent accessibilityEvent) { super.onInitializeAccessibilityEvent(accessibilityEvent); accessibilityEvent.setClassName("android.widget.Switch"); } public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo accessibilityNodeInfo) { if (VERSION.SDK_INT >= 14) { super.onInitializeAccessibilityNodeInfo(accessibilityNodeInfo); accessibilityNodeInfo.setClassName("android.widget.Switch"); CharSequence charSequence = isChecked() ? this.g : this.h; if (!TextUtils.isEmpty(charSequence)) { CharSequence text = accessibilityNodeInfo.getText(); if (TextUtils.isEmpty(text)) { accessibilityNodeInfo.setText(charSequence); return; } CharSequence stringBuilder = new StringBuilder(); stringBuilder.append(text).append(' ').append(charSequence); accessibilityNodeInfo.setText(stringBuilder); } } } }