content
stringlengths 7
2.61M
|
---|
Dance Marathon 25 hopes to push forth sustainability at the Big Event in February.
Dancers stay hydrated during UI Dance Marathon 24 at the IMU on Saturday, Feb. 3, 2018.
As Dance Marathon 25’s Big Event quickly approaches, the crew members have taken it upon themselves to push new efforts to increase sustainability.
Oliver also noted that Dance Marathon 25 is working with the Sustainability Office and the IMU to get the information of energy use at the Big Event, emissions from the transportation the UI and Dance Marathon has provided, and waste.
This year, the organization will also create the first-ever five-year sustainability plan for Dance Marathon 26-30, Oliver said.
Erika Renkes, a member of the sustainability subcommittee, said a lot of the emphasis on sustainability will be pushed in other committees to ensure they are all improving their efforts in the area.
Audrey Felderman, also a sustainability subcommittee member, said, Shape Your Impact, Dance Marathon’s first-ever campaign that was launched a few weeks ago, will have a lot of participants feeling as though they can make a difference in areas such as sustainability efforts.
She emphasized the importance of the support from the organization to carry out the group’s efforts and have an effect.
|
A Multi-agent Framework for Enterprise Information Integration In this paper, we first study the three problems facing with enterprise information integration. Next we introduce the concepts of Multi-agent technology, and then look at some related research on Multi-agent technology. Multi-agent technology has been regarded as one of the promising technologies for establishing complex enterprise software systems. In particular, the features of Multi-agent technology such as autonomy, distributed collaboration, and intelligence naturally fit with the characteristics of enterprise information integration. Finally, we combine the verdicts from different sections of this paper, propose a general framework that utilizes Multi-agent technology for enterprise information integration, and choose the most suitable development platform JADE. The framework could better support foe enterprise information integration at various levels, include heterogeneous enterprise data integration, application systems integration and business processes integration. Besides it also could support workflow management.
|
<reponame>liyp1120/code_bak
#include <mpi.h>
#include <stdio.h>
#include <math.h>
int main(int argc,char *argv[])
{
int rank ,size;
int namelen;
int version, subversion;
char processor_name[MPI_MAX_PROCESSOR_NAME];
MPI_Init(&argc,&argv);
MPI_Comm_rank(MPI_COMM_WORLD,&rank);
MPI_Comm_size(MPI_COMM_WORLD,&size);
MPI_Get_processor_name(processor_name,&namelen);
MPI_Get_version(&version, &subversion);
printf("Process %d of %d on %s\n",rank, size, processor_name);
printf("Process %d of %d on %s\n",rank, size, processor_name);
printf("version %d.%d \n",version, subversion);
MPI_Finalize();
}
|
from tensorflow.keras import Model
from tensorflow.keras.layers import Conv2D, MaxPooling2D, BatchNormalization, Flatten, Dense, Dropout, Softmax
class FMNISTModel(Model):
# Create the different layers used by the model
def __init__(self):
super(FMNISTModel, self).__init__(name='fmnist_model')
self.conv2d_1 = Conv2D(64, 3, padding='same', activation='relu',input_shape=(28,28))
self.conv2d_2 = Conv2D(64, 3, padding='same', activation='relu')
self.max_pool2d = MaxPooling2D((2, 2), padding='same')
#self.batch_norm = BatchNormalization()
self.flatten = Flatten()
self.dense1 = Dense(512, activation='relu')
self.dense2 = Dense(10)
self.dropout = Dropout(0.3)
self.softmax = Softmax()
# Chain the layers for forward propagation
def call(self, x):
# 1st convolution block
x = self.conv2d_1(x)
x = self.max_pool2d(x)
#x = self.batch_norm(x)
# 2nd convolution block
x = self.conv2d_2(x)
x = self.max_pool2d(x)
#x = self.batch_norm(x)
# Flatten and classify
x = self.flatten(x)
x = self.dense1(x)
x = self.dropout(x)
x = self.dense2(x)
return self.softmax(x)
|
EGb761 attenuates depressive-like behaviours induced by long-term light deprivation in C57BL/6J mice through inhibition of NF-B-IL-6 signalling pathway Our previous investigation found that Ginkgo extract EGb761 could attenuate the depressive-like behaviours induced by a single injection of lipopolysaccharide in mice. However, it has not been investigated whether EGb761 is effective on depressive-like behaviours induced by long-term light deprivation and whether its effects are associated with the inhibition of NF-B-IL-6 signalling pathway. In this study, three groups (vehicle group, EGb761 low-dose group, and EGb761 high-dose group) of C57BL/6J male mice were exposed to constant darkness for four weeks. The control mice remained on a 12 : 12 light-dark cycle. Depressive-like behaviours were evaluated by tail suspension test (TST), forced swim test (FST), and sucrose preference test (SPT). Spontaneous locomotor activity was evaluated by open field test (OFT). Levels of IL-6, IL-6 mRNA, NF-B p65, phospho-NF-B p65, IB, and phospho-IB were measured using Elisa, western blotting, or PCR assays. NF-B p65 DNA binding activity was evaluated using Chemi Transcription Factor Assay Kit. Results showed long-term light deprivation prolonged the immobile time in TST and FST, shortened the latency to immobility in FST, reduced spontaneous locomotor activity in OFT, decreased sucrose preference in SPT, and increased levels of IL-6, IL-6 mRNA, NF-B p65, phospho-NF-B p65, and phospho-IB in hippocampal tissue. EGb761 dose-dependently reversed the changes of the above parameters induced by long-term light deprivation, without affecting spontaneous locomotor activity. We conclude that EGb761 could attenuate the depressive-like behaviours and inhibit the NF-B-IL-6 signalling pathway in a light-deprivation-induced mouse model of depression. Introduction Depression was the third leading cause of global burden of disease in 2004 and will move into first place by 2030, affecting about 20% of the population worldwide. Efforts have been made to find novel pharmacological agents with effective antidepressant-like efficacy, which target various pathogeneses of depression. The pathogenesis of depression is complex. Besides the genetic abnormality, environmental factors are believed to contribute to depression. Seasonal affective disorder is a specific form of recurrent depressive disorder that can be induced by shortened light period. Recently it has been reported that long-term exposure to constant darkness could induce depressive-like behaviour and change the expression of inflammatory cytokines in rodent animals. Inflammatory cytokines have been well demonstrated to play a role in depression. Increased levels of IL-1, TNF-, and IL-6 have been found in patients with depression. Preclinical studies also showed that some depression animal models (repeated stress-induced depression, lipopolysaccharide-induced depression, and so on) had increased levels of IL-1, TNF-, and IL-6. Treatments targeted at controlling these cytokines have ex-hibited therapeutic effects on depressive behaviours. Anti-inflammation has been regarded as a new strategy in management of depression. Interestingly, different from the other types of depression animal models, a recent study revealed that long-term light-deprivation-induced depression model had increased serum levels of IL-6, but comparable levels IL-1 and TNF- compared to the control animals. As is known, the production of IL-6 can be regulated by various pathways. In that study the authors also found that circulating and hippocampal IL-6 levels were dependent on the nuclear factor kappaB (NF-B) signalling pathway. NF-B is a transcription factor that induces expression of cytokines that regulate the inflammatory cascade. NF-B signalling pathways are involved in neurological and psychotic disorders that are associated with inflammation. Koo et al. reported that NF-B was a critical mediator of stress-impaired depressive behaviour. Regulating the expression of NF-B and inhibitory kappaB alpha (IB) by some agents could attenuate the depression-like behaviours induced by chronic unpredictable stress. Monje et al. also found blockage of NF-B ameliorated constant darkness-induced depression-like behaviour in mice. Inactive NF-B in the cytoplasm is combined with IB. The activation of NF-B is initiated by the signal-induced degradation of IB proteins. The activated NF-B is rapidly translocated to the nucleus. In the nucleus, NF-B activates the transcription of target genes, leading to more production of some cytokines, such as IL-6, which is involved in the pathogenesis of depression. Considering of the role of NF-B-IL-6 signalling pathway in depression, inhibition of the NF-B-IL-6 signalling pathway might be a potential strategy in depression treatment. Ginkgo extract EGb761 has exhibited anti-inflammatory, anti-oxidative, and neuroprotective activities in a number of preclinical studies. Some of its effects result from the inhibition of NF-B activity. Moreover, our previous study revealed that EGb761 attenuated depressive-like behaviours induced by LPS injection in C57BL/6J male mice, and in parallel, inhibited the expression of TNF-, IL-1, IL-6, and IL-17A in the C57BL/6J mice with lipopolysaccharide injection. However, as mentioned above, the long-term light deprivation-induced depression animal model has different immunological characteristics from the other depression models. For example, it has normal levels of TNF- and IL-1. To our knowledge, it is not clear whether EGb761 also has antidepressant-like activities in the long-term light deprivation-induced depression model. Furthermore, it has not been investigated whether its effects are associated with inhibition of the NF-B-IL-6 signalling pathway. Thus, this study aimed to investigate the effects of EGb761 on the depressive-like behaviours and NF-B-IL-6 signalling pathway in the long-term light deprivation-induced mouse model of depression. Animals All experiments were performed using C57BL/6J male mice, which were housed in a temperature-controlled room (22 ±1°C). Mice were either maintained on a 12 : 12 lightdark cycle or in 24 hours of constant darkness with ad libitum access to food and water unless stated otherwise. The research protocols were performed with the approval of the Committee on the Ethics of Animal Experiments of Shandong University. Animals were cared in compliance with the Guide for the Care and Use of Laboratory Animals of the National Institute of Health. Constant darkness procedure Mice were divided into: control group, vehicle group, EGb761 low-dose group, and EGb761 high-dose group (n = 16 per group). Following a week of acclimatisation to the new environment under light-dark cycle conditions, mice in the vehicle group, the low-dose group, and the high-dose group were exposed to four weeks of constant darkness, while mice in the control group remained under light-dark cycle conditions. EGb761 administration EGb761 (Dr. Willmar Schwabe Gmbh and Co. KG) was orally administrated to the EGb761 low-dose group (100 mg/kg/day) and the EGb761 high-dose group (150 mg/kg/day) for four weeks, starting from day 1 of the constant darkness procedure. Mice in the control group and the vehicle group received equal volumes of vehicle saline only. Forced swim test (FST) Testing was performed as we described previously. During the test, mice were put in a cylinder (20 cm in diameter 25 cm tall) filled with 24 ±1°C water (10 cm deep) for six minutes. Each mouse's FST behaviour in the container was digitally recorded for later analysis. The container was cleaned and the water was changed after every swim session. The FST behaviour of the last four minutes was analysed by two trained investigators blinded to treatment. Immobility was defined as no movement other than that necessary to keep the animal's head above water. Tail suspension test In the tail suspension test, the tail of the mouse was taped to a horizontal bar 50 cm above the floor. The sixminute suspension was videotaped using a camera. Immobility time in the final five minutes was measured by two trained investigators blinded to treatment. Sucrose preference test To quantify constant darkness-induced anhedonia, a common symptom of major depression, we subjected mice to a two-bottle sucrose preference test, which measures the preference for a sweetened solution over tap water. Prior to the test, mice were trained to consume sweetened solution by simultaneous presentation with a bottle of 1% sucrose solution and a bottle of tap water. Following the training, sucrose preference testing was conducted for 24 hours. The mice were allowed free access to the two bottles. Preference was calculated as sucrose solution consumed compared to the total fluid intake (sucrose intake/ total fluid intake 100). Open field test Open field test was performed to evaluate the spontaneous locomotor activity of the experimental mice. The open field was a square arena (100 100 50 cm) divided into 25 equal squares. The mice were put in the central square of the clean arena and were permitted to freely explore the novel open arena for five minutes. Locomotor activity was digitally recorded for the rearing and crossing analysis. Elisa assays The left hippocampus was used to make tissue homogenate using a homogeniser (n = 8). Levels of IL-6 (Cusabio Company, Wuhan, China), NF-B p65 (Cusabio Company, Wuhan, China), and IB (Jining Company, Shanghai, China) were measured using commercially available ELISA kits following the manufacturer's instructions. Samples were analysed in duplicate. Western blot The right hippocampus was lysed in RIPA lysis buffer containing 1 mM PMSF (n = 8). Protein samples (40 g) extracted from the hippocampus were separated by 12% SDS-PAGE and transferred onto PVDF membranes. Membranes were blocked with 3% bovine serum albumin at room temperature for one hour and incubated in primary antibody solutions (1 : 1000) (rabbit anti-mouse phospho-NF-B p65 and phospho-IB: Santa Cruz Biotechnology, Inc., Santa Cruz, CA, USA) overnight at 4°C. Then the membranes were washed three times and incubated in HRP-conjugated secondary antibody solution (1 : 1000) (donkey anti-rabbit IgG: Santa Cruz Biotechnology, Inc., Santa Cruz, CA, USA) for two hours at room temperature. Enhanced chemiluminescence was used to visualise the protein bands. NF-B p65 DNA Binding Activity Assay TranAM™ NF-B p65 Chemi transcription factor assay kit was used (Active Motif, Carlsbad, CA, USA) to detect NF-B p65 DNA-binding activity, following the in-structions of the manufacturer (n = 8). Briefly, nuclear protein was extracted from the hippocampus using a nuclear extraction kit (Active Motif, Carlsbad, CA, USA). Nuclear protein (10 g) was incubated in plates that were coated with oligonucleotides containing a consensus binding site for p65. Following incubations with primary antibody against NF-B p65 and horseradish peroxidase-conjugated secondary antibody, the substrate solution was added to the wells in the dark. After the chromogenic reaction with substrate solution, stop solution was added to the wells to stop the reaction. The absorbance at 450 nm was measured to determine the NF-B p65 DNA-binding activity. Statistical analysis All results of the investigations were presented as mean ± SEM. Differences in mean values between groups were assessed by one-way analysis of variance (ANOVA) followed by Students-Newman-Keuls (SNK) test. P < 0.05 was considered to be statistically significant. Forced swim test Forced swim test (FST) was performed to evaluate the depressive-like behaviour of the mice. Mice from the vehicle group performed poorly in the cylinder, with more immobility time and shorter latency to immobility than the mice from the control group (both p < 0.05). Compared to the vehicle group, both the low-dose group and the highdose group spent less immobility time and had longer latency to immobility in the cylinder (all p < 0.05), and the high-dose group showed even less immobility time and longer latency to immobility than the low-dose group (both p < 0.05) (Figs. 1 and 2). Tail suspension test The depressive-like behaviour of the mice was also evaluated by tail suspension test (TST). Mice from the vehicle group had longer immobility time than the mice from the control group (p < 0.05). Both the low-dose group and the high-dose group showed shorter immobility time than the vehicle group (both p < 0.05); the immobility time of the high-dose group was even shorter than that of the lowdose group (p < 0.05) (Fig. 3). Locomotor activity in the open field test Locomotor activity of the mice was evaluated by open field test (OPT). Light deprivation reduced the number of rearings and crossings of the vehicle group compared to the control group (both p < 0.05). The low-dose group and the high-dose group had comparable rearings and crossings with the vehicle group (both p > 0.05) (Fig. 4). Sucrose preference test The anhedonia of the mice was evaluated by sucrose preference test (SPT). During the test, mice from the vehicle group consumed much lower volume of sweetened Rearing Crossing solution than the control mice (p < 0.05). Mice from the low-dose group and the high-dose group consumed a higher volume of sweetened solution than mice from the vehicle group (both p < 0.05). The high-dose group consumed even more sweetened solution than the low-dose group (p < 0.05) (Fig. 5). Levels of NF-B p65, phospho-NF-B p65, IB, and phospho-IB Elisa or western assays showed that the vehicle group had higher levels of NF-B p65, phospho-NF-B p65, and phospho-IB than the control group, the low-dose group, and the high-dose group (all p < 0.05). The highdose group had lower levels of those parameters than the low-dose group (all p < 0.05). All the groups had comparable levels of IB (p > 0.05) (Figs. 6-9). NF-B p65 DNA binding activity Light deprivation increased the NF-B p65 DNA binding activity of the vehicle group compared to the control group (p < 0.05). The low-dose group and the high-dose group had lower NF-B p65 DNA binding activity than the vehicle group (both p < 0.05). The activity of the high-dose group was even lower than the low-dose group (p < 0.05) (Fig. 10). Levels of IL-6 and IL-6 mRNA Levels of IL-6 and IL-6 mRNA of the vehicle group were higher than the control group, the low-dose group, and the high-dose group (all p < 0.05). Their levels in the high-dose group were lower than in the low-dose group (both p < 0.05) (Figs. 11 and 12). Discussion Our main findings of this work are that EGb761 can attenuate the depressive-like behaviours and inhibit the NF-B-IL-6 signalling pathway in C57BL/6J mice with light deprivation. Various factors including environmental stimuli contribute to the development and progression of depression. Some species present physiological and behavioural changes in response to seasonal changes in day length. Although human beings are less affected by the changes in day length than the other species, some people still have seasonal affective disorder characterised by major depression episodes in the autumn and winter. Preclinical studies have demonstrated that long-term exposure to constant darkness could induce depression-like behaviour in rodent animals and such a depression animal model had different immunological characteristics from other stimuli-induced depression, which might result in different response to some specific medications. In order to obtain optimal therapeutic effect, people are trying to find novel antidepressant agents specific to the different pathogenesis of depression. Some traditional Chinese medicine and compounds extracted from them have been used to manage depression in preclinical and clinical studies. Ginkgo extract EGb761 has anti-inflammatory, anti-oxidative, and neuroprotective activities. A recent study showed that EGb761 could decrease the immobility time of BALB/c mice in the forced swimming test. Our previous study and Yeh et al. study found that EGb761 attenuated the depressive-like behaviours induced by lipopolysaccharide injection. However, it has not been studied whether EGb761 has antidepressant-like activities in the light deprivation-induced animal model of depression, which has unique immunological features. In order to observe EGb761's effects on light deprivation-induced depression, we exposed mice to constant darkness conditions for four weeks and evaluated the animal's behaviours. FST is widely used to screen the depressive-like behaviour and evaluate the antidepressant efficacy in animals. In our FST, mice from the vehicle group performed poorly in the cylinder, with more immobility time and shorter latency to immobility than the mice from the control group, indicating that light deprivation induced depressive-like behaviour in mice. In the EGb761 treated groups, EGb761 dose-dependently reduced the immobility time and prolonged the latency to immobility compared to the vehicle group, indicating that EGb761 could dose-dependently attenuate the depressive-like behaviour induced by light deprivation. The TST evaluation also showed that light deprivation induced depressive-like behaviour in mice, and EGb761 could dose-dependently attenuate the depressive-like behaviour. However, locomotor activity can influence the performance of the animals in behavioural tests, which may lead to false positive results in the FST and TST. We introduced OPT to evaluate the locomotor activity of the mice. The result showed that light deprivation reduced the locomotor activity of the mice, but each of the three groups exposed to constant darkness had comparable locomotor activity. The results meant that there were no false positive results resulting from the loco motor activity in the FST and TST. Besides, we also evaluated the anhedonia of the mice by SPT. Light deprivation induced significant anhedonia in mice, and EGb761 dose-dependently attenuated the light-deprivation-induced anhedonia. All the behavioural evaluations demonstrated that light deprivation could induce depressive-like behaviours in mice and EGb761 could attenuate the depressive-like behaviours induced by light deprivation. There is a great deal of evidence from preclinical and clinical studies demonstrating that NF-B signalling pathways are involved in the pathogenesis of depression. Depression animal models induced by unpredictable chronic mild stress, lipopolysaccharide injection, or other stimuli have been found to exhibit increased NF-B activity, and some agents that inhibit NF-B activity have exhibited antidepressant activity in such animal models. A recent study found that mice exposed to constant darkness also have higher NF-B DNA binding activity, and pharmacological blockers of the NF-B pathway attenuated the depressive-like behaviours induced by light deprivation. Similarly, we also found that the mice in the vehicle group had increased NF-B p65 DNA binding activity in hippocampal tissue in the present study. Inactive NF-B dimers are retained into the cytoplasm by interaction with IB. The phosphorylation of IB leads to the activation of NF-B. Following activation, NF-B p65/p50 heterodimer is translocated to the nucleus, where it promotes the transcription of target genes. Besides determining the NF-B p65 DNA binding activity of the mice, we also measured levels of NF-B p65, phospho-NF-B p65, IB, and phospho-IB in this study. Our results showed the mice in the vehicle group had increased levels of NF-B p65, phospho-NF-B p65, and phospho-IB, as well as comparable level of IB, if compared to the control groups. The data suggest that light deprivation promoted the production of NF-B p65 and induced the activation of NF-B p65 by accelerating the degradation of IB through phosphorylation. However, EGb761 dose-dependently reversed the light deprivation-induced changes of NF-B p65, phospho-NF-B p65, phospho-IB, and NF-B p65 DNA binding activity, suggesting that EGb761 could inhibit the NF-B signalling in hippocampal tissue of the mice. The inhibition of NF-B signalling should contribute to the attenuation of the depressive-like behaviours. As is known, the activated NF-B in the nucleus can promote the transcription of genes of some cytokines including IL-6. IL-6 has been well demonstrated to have a role in depression, and a targeted approach to selectively inhibit IL-6 trans-signalling may offer putative antidepressant effects. In the present study, we found that light deprivation induced increased production of IL-6 and IL-6 mRNA. The result was in line with the recent study reporting that mice exposed to constant darkness had higher levels of IL-6, but comparable levels of TNF- and IL-1 than the control animals. However, in contrast to the light deprivation mouse model of depression, some studies, including our previous work, found some other depression animal models had increased levels of TNF-, IL-1, and IL-6. Our present study also found that EGb761 could dose-dependently decrease IL-6 and IL-6 mRNA levels in the light-deprived mice. The reduction in production of IL-6 might contribute to the attenuation of the depressive-like behaviours. Taken together, EGb761 could attenuate the depressive-like behaviours in mice exposed to light deprivation. The antidepressant-like activities might be associated with the inhibition of the NF-B-IL-6 signalling pathway. The authors declare no conflict of interest.
|
import { h } from 'preact';
import getImage from '../../../utils/get-image';
import useCoreContext from '../../../core/Context/useCoreContext';
import Voucher from '../../internal/Voucher';
import '../../internal/Voucher/Voucher.scss';
import './BacsResult.scss';
const BacsResult = props => {
const { i18n, loadingContext } = useCoreContext();
const { url, paymentMethodType } = props;
return (
<Voucher
paymentMethodType={paymentMethodType}
introduction={i18n.get('bacs.result.introduction')}
imageUrl={getImage({ loadingContext })(paymentMethodType)}
downloadUrl={url}
downloadButtonText={i18n.get('download.pdf')}
/>
);
};
export default BacsResult;
|
Itō Chūta
Biography
Second son of a doctor in Yonezawa, present-day Yamagata Prefecture, Itō was educated in Tokyo. From 1889 to 1892 he studied under Tatsuno Kingo in the Department of Architecture at the Imperial University. Josiah Conder was still teaching in the department, while Ernest Fenollosa and Okakura Kakuzō were also influential in the formation of Itō's ideas. For graduation he designed a Gothic cathedral and wrote a dissertation on architectural theory. His doctoral thesis was on the architecture of Hōryū-ji. He was professor of architecture at the Imperial University from 1905, then of Waseda University from 1928.
Itō travelled widely, to the Forbidden City with photographer Ogawa Kazumasa in 1901 and subsequently, after fourteen months in China, to Burma, India, Sri Lanka, Turkey, Europe and the United States. Later he was involved in the planning of Chōsen Jingū in Seoul and a survey of the monuments of Jehol in Manchukuo. He incorporated elements of the diverse architectural styles he encountered in his many writings and approximately one hundred design projects. He was also a leading proponent of the Imperial Crown style of architecture, which had been developed for the Japanese Empire by architect Shimoda Kikutaro.
Itō helped formulate the Ancient Temples and Shrines Preservation Law of 1897, an early measure to protect the Cultural Properties of Japan. He is also credited with coining the Japanese term for architecture, namely kenchiku (建築) (lit. 'erection of buildings') in place of the former zōkagaku (造家学) (lit. 'study of making houses'). A member of the Japan Academy, in 1943 he was awarded the Order of Culture. Itō has more recently been criticised, with specific reference to his writings on Ise Grand Shrine, for having 'blurred a religio-political discourse with an architectural discourse'.
|
def stack_torch_tensors(input_tensors, reshape=False):
if reshape:
unrolled = [input_tensors[k].reshape(-1, 1) for k in range(len(input_tensors))]
else:
unrolled = [input_tensors[k].view(-1, 1) for k in range(len(input_tensors))]
return torch.cat(unrolled)
|
The Z170 chipset has been available for some time now, but due to Intel's staggered launch of Skylake-S the other chipsets from this generation have just recently become available.
Editor’s Note:
Matt Bach is the head of Puget Labs and has been part of Puget Systems, a boutique builder of gaming and workstation PCs, since the early days. This article was originally published on the Puget blog.
In addition to the Z170 chipset, there are now five other consumer chipsets available: the H170 and H110 for consumers and the B150, Q150, and Q170 for business. With the move to the new Skylake-S CPUs, all of these chipsets have some large changes over their predecessors, such as the move the DDR4 and many other things we covered in our Z170 vs Z97: What is the Difference? article, but they also have a couple of key ways in which they differ from each other.
Consumer Chipsets (Z170, H170, H110)
Specifications Z170 H170 H110 Processor support Skylake-S LGA 1151 CPU overclocking Yes No No Processor PCIe configuration 1x16 or 2x8 or 1x8+2x4 1x16 1x16 Chipset PCI-E lanes (Gen)* 20 (3.0) 16 (3.0) 6 (2.0) Max PCIe storage
(x4 M.2 or x2 SATA Express) 3 2 0 DMI version DMI3 (8GT/s) DMI3 (8GT/s) DMI2 (5GT/s) Independent display ports/pipes 3/3 3/3 3/2 Mem/DIMMs per channel 2/2 2/2 2/1 USB total (USB 3.0) 14 (10) 14 (8) 10 (4) Total SATA 6Gb/s 6 6 4 Maximum HSIO lanes** 26 22 14
There are a large number of differences between the three consumer chipsets, but we have marked what should be the most important for the average consumer in red. The first and most commonly known difference is the fact that the Z170 chipset fully supports CPU overclocking, while the H-series chipsets do not.
The second major difference is in regards to the PCIe lanes. Modern Intel-based systems actually have two sets of PCIe lanes: one from the CPU and one from the chipset. The CPU PCIe lanes are used primarily for graphics cards and other add-on PCIe devices. For the 16 PCIe 3.0 lanes that are available from all Skylake-S CPUs, the Z170 chipset has the ability to split up the lanes two or three ways which allows for the use of multiple video cards or simply more PCIe devices to be directly connected to the CPU as long as they do not need to run at full x16 speeds.
The chipset lanes are a bit different - while a few may be used for add-on devices, they are mostly there for additional features the manufacturer has built into the motherboard that are not native to the chipset like WiFi, more USB ports, additional LAN ports, etc. The number and speed of these lanes changes based on the chipset: Z170 has 20 PCIe 3.0 lanes, H170 has 16 PCIe 3.0 lanes, and H110 has just 6 lanes that run at the slower PCIe 2.0 speeds. The biggest impact of having fewer lanes is that there is less opportunity for manufacturers to add additional features to the board, although another factor is the number of x4 M.2 or SATA Express devices that can be used on the chipset: Z170 can have 3 such devices, H170 can have 2 and H110 can have none. In addition to having fewer and slower PCIe lanes, H110 also still uses the older DMI 2.0 revision which means the connection between the chipset and the CPU is a bit slower than it is on the other chipsets.
As far as connectivity goes, Z170 and H170 can both power 6 SATA drives and have the same total number of USB ports (14) - although Z170 can have two more USB 3.0 ports than H170 (10 versus 8). H110, being the more budget-oriented chipset, can only power 4 SATA drives and can have only 10 USB ports (4 of which can be USB 3.0)
For the additional feature sets, both Z170 and H170 support Smart Sound Technology, Rapid Storage Technology, and Smart Response Technology (otherwise known as SSD Caching). For business-based customers who do not wish to use the business chipsets for whatever reason, both H170 and H110 support Small Business Basics while only the H110 chipset supports Small Business Advantage.
Business Chipsets (Q170, Q150, B150)
Specifications Q170 Q150 B150 Processor support Skylake-S LGA 1151 CPU overclocking No No No Processor PCIe configuration 1x16 or 2x8 or 1x8+2x4 1x16 1x16 Chipset PCI-E lanes (Gen)* 20 (3.0) 10 (3.0) 8 (3.0) Max PCIe storage
(x4 M.2 or x2 SATA Express) 3 0 0 DMI version DMI3 (8GT/s) DMI3 (8GT/s) DMI3 (8GT/s) Independent display ports/pipes 3/3 3/3 3/3 Mem/DIMMs per channel 2/2 2/2 2/2 USB total (USB 3.0) 14 (10) 14 (8) 12 (6) Total SATA 6Gb/s 6 6 6 Maximum HSIO lanes** 26 20 18
Unlike the consumer chipsets, there is actually not a huge amount that is different between the three business chipsets, but we have marked what we consider to be the most important ones in red.
Like the consumer chipsets, one of the key differences between these chipsets is in regards to the PCIe lanes. As we stated in the previous section, modern Intel-based systems actually have two sets of PCIe lanes: one from the CPU and one from the chipset. The CPU PCIe lanes are used primarily for graphics cards and other add-on PCIe devices. For the 16 PCIe 3.0 lanes that are available from all Skylake-S CPUs, the Q170 chipset has the ability to split up the lanes two or three ways which allows for the use of multiple video cards or simply more PCIe devices to be directly connected to the CPU as long as they do not need to run at full x16 speeds.
The chipset lanes are a bit different - while a few may be used for add-on devices, they are mostly there for additional features the manufacturer has built into the motherboard that are not native to the chipset like WiFi, more USB ports, additional LAN ports, etc. The number and speed of these lanes changes based on the chipset: Q170 has 20 PCIe 3.0 lanes, Q150 has 10 PCIe 3.0 lanes, and B150 has just 8 PCIe 3.0 lanes. The biggest impact of having fewer lanes is that there is less opportunity for manufacturers to add additional features to the board, although another factor is the number of x4 M.2 or SATA Express devices that can be used on the chipset: Q170 can have 3 such devices, while Q150 and B150 can have none.
As far as connectivity goes, all of the chipsets are able to power 6 SATA drives. Q170 and Q150 have the same total number of USB ports (14) although Q170 can have two more USB 3.0 ports than Q150 (10 versus 8). B150, being the more budget-oriented chipset, can only have 12 USB ports (6 of which can be USB 3.0)
For the additional feature sets, all of the business chipsets support Small Business Basics and Small Business Advantage. The key difference in terms of features is that only the Q170 supports vPro and only the Q170 and Q150 chipsets support SIPP (Stable Image Platform Model).
Conclusion
Keep in mind that the chipset is only one of the may factors you should take into consideration when choosing a motherboard. If there is a specific feature you need like CPU overclocking or M.2 support, knowing what each chipset offers gives you a great starting place. But even from there, you still have to sort through the large number of motherboards that use that chipset. If you don't find a motherboard that fits your needs in terms of rear or internal ports, layout, or other functionality, you may even need to look at a "higher" chipset instead.
For example, while the H170 chipset may sound like the ideal choice for the majority of people, the Z170 motherboards are often a better fit even if you don't need all the features present in the Z170 chipset. The main reason is that motherboard manufactures tend to add more additional ports, headers, and features on their Z170 motherboards since that is what is considered the "premium" chipset. Often times, just a couple of additional ports can make the difference between a motherboard working for someone out of the box or needing to use add-on PCIe cards to get the proper functionality.
In general, we tend to recommend the Z170 chipset for users who want to be sure they are getting all the features they may possibly need. However, H170 can be great in small form factor systems (such as Puget's Echo systems) since things like additional PCIe lanes is not a big deal for mini-ITX motherboards that have only a single PCIe slot.
Even for business customers, we favor either Z170 or H170 motherboards. In fact, the only time we would recommend using a business-class chipset is if that is the only way you can get a feature that you specifically need such as vPro, SIPP, or Small Business Advantage. In most other cases, a consumer chipset is going to give you a wider range of options (so you can use a board that has the appropriate ports and layout that you need) and will generally be easier to source and maintain.
|
<gh_stars>0
package uk.ac.ebi.biosamples.mongo.service;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.BasicQuery;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service;
import uk.ac.ebi.biosamples.mongo.model.MongoRelationship;
import uk.ac.ebi.biosamples.mongo.model.MongoSample;
import java.util.ArrayList;
import java.util.List;
@Service
public class MongoInverseRelationshipService {
private final MongoTemplate mongoTemplate;
public MongoInverseRelationshipService(MongoTemplate mongoTemplate) {
this.mongoTemplate = mongoTemplate;
}
public MongoSample addInverseRelationships(MongoSample mongoSample) {
String accession = mongoSample.getAccession();
if (accession == null) {
return mongoSample;
}
Query query = new BasicQuery("{'relationships.target':'"+accession+"'}","{'relationships.$':1}");
for (MongoSample other : mongoTemplate.find(query, MongoSample.class)) {
for (MongoRelationship relationship : other.getRelationships()) {
if (relationship.getTarget().equals(accession)) {
mongoSample.getRelationships().add(relationship);
}
}
}
return mongoSample;
}
public List<String> getInverseRelationshipsTargets(String accession) {
List<String> relTargetAccessionList = new ArrayList<>();
Query query = new BasicQuery("{'relationships.target':'"+accession+"'}","{'relationships.$':1}");
for (MongoSample other : mongoTemplate.find(query, MongoSample.class)) {
for (MongoRelationship relationship : other.getRelationships()) {
if (relationship.getTarget().equals(accession)) {
relTargetAccessionList.add(relationship.getSource());
}
}
}
return relTargetAccessionList;
}
}
|
package event_implementation;
import event_implementation.interfaces.NameChangeListener;
public class Handler implements NameChangeListener {
@Override
public void handleChangedName(NameChange event) {
System.out.println("Dispatcher's name changed to " + event.getChangedName() + ".");
}
}
|
#pragma once
unsigned InsideOutsideDiscChart::offset_labeled(const int i, const int j, const int label) const noexcept
{
return i * _size * _n_labels + j * _n_labels + label;
}
unsigned InsideOutsideDiscChart::offset_unlabeled(const int i, const int j) const noexcept
{
return i * _size + j;
}
unsigned InsideOutsideDiscChart::offset_labeled(const int i, const int k, const int l, const int j, const int label) const noexcept
{
return i * _size * _size * _size * _n_labels + j * _size * _size * _n_labels + k * _size * _n_labels + l * _n_labels + label;
}
unsigned InsideOutsideDiscChart::offset_unlabeled(const int i, const int k, const int l, const int j) const noexcept
{
return i * _size * _size * _size + j * _size * _size + k * _size + l;
}
LogSemiring& InsideOutsideDiscChart::forward_labeled(const int i, const int j, const int label) noexcept
{
return _data_forward_labels_cont[offset_labeled(i, j, label)];
}
LogSemiring& InsideOutsideDiscChart::backward_labeled(const int i, const int j, const int label) noexcept
{
return _data_backward_labels_cont[offset_labeled(i, j, label)];
}
LogSemiring& InsideOutsideDiscChart::forward_unlabeled(const int i, const int j) noexcept
{
return _data_forward_spans_cont[offset_unlabeled(i, j)];
}
LogSemiring& InsideOutsideDiscChart::backward_unlabeled(const int i, const int j) noexcept
{
return _data_backward_spans_cont[offset_unlabeled(i, j)];
}
LogSemiring& InsideOutsideDiscChart::forward_labeled(const int i, const int k, const int l, const int j, const int label) noexcept
{
return _data_forward_labels_disc[offset_labeled(i, k, l, j, label)];
}
LogSemiring& InsideOutsideDiscChart::backward_labeled(const int i, const int k, const int l, const int j, const int label) noexcept
{
return _data_backward_labels_disc[offset_labeled(i, k, l, j, label)];
}
LogSemiring& InsideOutsideDiscChart::forward_unlabeled(const int i, const int k, const int l, const int j) noexcept
{
return _data_forward_spans_disc[offset_unlabeled(i, k, l, j)];
}
LogSemiring& InsideOutsideDiscChart::backward_unlabeled(const int i, const int k, const int l, const int j) noexcept
{
return _data_backward_spans_disc[offset_unlabeled(i, k, l, j)];
}
|
from setuptools import setup, find_packages
import re
def get_version():
"""
Extract the version from the module's root __init__.py file
"""
root_init_file = open("syntaviz/__init__.py").read()
match = re.search("__version__[ ]+=[ ]+[\"'](.+)[\"']", root_init_file)
return match.group(1) if match is not None else "unknown"
setup(
name="syntaviz",
version=get_version(),
description="SyntaViz",
packages=find_packages(),
package_data={},
python_requires='>=2.7, <3',
install_requires=["flask==0.12.3",
"matplotlib==2.0.2",
"numpy==1.8.2",
"scikit-learn==0.18.2",
"scipy==0.19.1",
"ipython==5.1.0",
"bokeh==0.12.5",
"nltk==3.2.3",
"pandas==0.20.2",
"torch"],
setup_requires=['pytest-runner'],
tests_require=['pytest', 'pytest-cov'],
)
|
/**
* (C) 2011-2012 Alibaba Group Holding Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
*/
package com.taobao.common.tedis.replicator.extractor.mysql;
import com.taobao.common.tedis.replicator.ReplicatorException;
import com.taobao.common.tedis.replicator.data.OneRowChange;
import com.taobao.common.tedis.replicator.data.RowChangeData;
public class UpdateRowsLogEvent extends RowsLogEvent {
public UpdateRowsLogEvent(byte[] buffer, int eventLength, FormatDescriptionLogEvent descriptionEvent, boolean useBytesForString) throws ReplicatorException {
super(buffer, eventLength, descriptionEvent, MysqlBinlog.UPDATE_ROWS_EVENT, useBytesForString);
}
@Override
public void processExtractedEvent(RowChangeData rowChanges, TableMapLogEvent map) throws ReplicatorException {
/**
* For UPDATE_ROWS_LOG_EVENT, a row matching the first row-image is
* removed, and the row described by the second row-image is inserted.
*/
if (map == null) {
throw new MySQLExtractException("Update row event for unknown table");
}
OneRowChange oneRowChange = new OneRowChange();
oneRowChange.setSchemaName(map.getDatabaseName());
oneRowChange.setTableName(map.getTableName());
oneRowChange.setTableId(map.getTableId());
oneRowChange.setAction(RowChangeData.ActionType.UPDATE);
int rowIndex = 0; /* index of the row in value arrays */
int bufferIndex = 0;
while (bufferIndex < bufferSize) {
int length = 0;
try {
/*
* Removed row
*/
length = processExtractedEventRow(oneRowChange, rowIndex, usedColumns, bufferIndex, packedRowsBuffer, map, true);
if (length == 0)
break;
bufferIndex += length;
/*
* Inserted row
*/
length = processExtractedEventRow(oneRowChange, rowIndex, usedColumnsForUpdate, bufferIndex, packedRowsBuffer, map, false);
} catch (ReplicatorException e) {
throw (e);
}
rowIndex++;
if (length == 0)
break;
bufferIndex += length;
}
rowChanges.appendOneRowChange(oneRowChange);
}
}
|
N-acetylcysteine protects against motor, optomotor and morphological deficits induced by 6-OHDA in zebrafish larvae Background Parkinsons disease (PD) is the second most common neurodegenerative disorder. In addition to its highly debilitating motor symptoms, non-motor symptoms may precede their motor counterparts by many years, which may characterize a prodromal phase of PD. A potential pharmacological strategy is to introduce neuroprotective agents at an earlier stage in order to prevent further neuronal death. N-acetylcysteine (NAC) has been used against paracetamol overdose hepatotoxicity by restoring hepatic concentrations of glutathione (GSH), and as a mucolytic in chronic obstructive pulmonary disease by reducing disulfide bonds in mucoproteins. It has been shown to be safe for humans at high doses. More recently, several studies have evidenced that NAC has a multifaceted mechanism of action, presenting indirect antioxidant effect by acting as a GSH precursor, besides its anti-inflammatory and neurotrophic effects. Moreover, NAC modulates glutamate release through activation of the cystine-glutamate antiporter in extra-synaptic astrocytes. Its therapeutic benefits have been demonstrated in clinical trials for several neuropsychiatric conditions but has not been tested in PD models yet. Methods In this study, we evaluated the potential of NAC to prevent the damage induced by 6-hydroxydopamine (6-OHDA) on motor, optomotor and morphological parameters in a PD model in larval zebrafish. Results NAC was able to prevent the motor deficits (total distance, mean speed, maximum acceleration, absolute turn angle and immobility time), optomotor response impairment and morphological alterations (total length and head length) caused by exposure to 6-OHDA, which reinforce and broaden the relevance of its neuroprotective effects. Discussion NAC acts in different targets relevant to PD pathophysiology. Further studies and clinical trials are needed to assess this agent as a candidate for prevention and adjunctive treatment of PD. INTRODUCTION Parkinson's disease (PD) is the second most common neurodegenerative disorder in the world, affecting on average 2-3% of the individuals older than 65 years (). This condition originates from progressive death of dopamine (DA) neurons in the substantia nigra pars compacta of the midbrain and is characterized by motor and non-motor symptoms (Kalia & Lang, 2015). Although the etiology of this multifactorial disease remains unknown, studies demonstrate a key role of oxidative stress in the development of PD in addition to mitochondrial dysfunction, neuroinflammation, dysfunction of the ubiquitin-proteasome system and Lewy body formation (;). 6-Hydroxydopamine (6-OHDA) is a neurotoxin that has been widely used in animal models to mimic pathogenic events and behavioral features observed in PD (;Blandini & Armentero, 2012;;). 6-OHDA is a reactive structural analogue of DA, uptaken into the neuron by the DA transporter once it crosses the blood-brain barrier. 6-OHDA inhibits the mitochondrial complex I, resulting in an increase of reactive oxygen species production and impairment of the ATP generation, which leads to dopaminergic neuron death (Jackson-Lewis, Blesa & Przedborski, 2012). The available drugs for the treatment of PD, such as L-DOPA, are focused on increasing dopaminergic neurotransmission. However, besides inducing several adverse effects and lacking efficacy in the treatment of non-motor symptoms, none of these drugs are able to cure the disease or even slow the progression of neuronal loss (). A possible explanation for the relative inefficacy of such treatments is related to the tardiness of their onset, which usually begins upon the appearance of motor symptoms, when neuronal death is already at an advanced stage (). Therefore, a potential pharmacological strategy would be to identify individuals in the prodromal phase and to introduce neuroprotective agents at an earlier stage in order to prevent further neuronal death (Dexter & Jenner, 2013). Drug repurposing is a term used to describe the repositioning of known compounds, which are already marketed, to target novel therapeutic purposes. It is an attractive strategy for drug development due to the savings in research, funding and time (;;Klug, Gelb & Pollastri, 2016). In this context, N-acetylcysteine (NAC) may be a potential candidate for drug repurposing. NAC has been used against paracetamol overdose hepatotoxicity by restoring hepatic concentrations of glutathione (gamma-glutamylcysteinylglycine; GSH), and as a mucolytic in chronic obstructive pulmonary disease by reducing disulfide bonds in mucoproteins. Moreover, even at high doses, NAC appears to be safe in humans (Whyte, Francis & Dawson, 2007). More recently, several studies have evidenced that NAC has a multifaceted mechanism of action, acting as an indirect antioxidant for being a GSH precursor, and showing anti-inflammatory and neurotrophic activities. Both animal and human studies have demonstrated that NAC is able to increase neuronal levels of GSH (;;). Moreover, NAC modulates glutamate release through activation of the cystine-glutamate antiporter in extra-synaptic astrocytes (). Furthermore, NAC indirectly regulates NMDA receptor activity, since GSH binds to a redox sensitive site on NMDA receptor and modulates its activity (). Therapeutic benefits of NAC have been demonstrated in clinical trials for several neuropsychiatric conditions (Dean, Giorlando & Berk, 2011). In recent years, the zebrafish has become a powerful tool to investigate and develop new drugs in neurological and neuropsychiatric research (MacRae & Peterson, 2015;). Despite its reduced size and complexity, zebrafish brains have neuroanatomical areas homologous to mammals, including the striatum, therefore it has also been used and standardized in PD studies as a model for drug screening and investigation of pathophysiology (Rink & Wullimann, 2004;Xi, Noble & Ekker, 2011). In addition to the models based on genetic manipulation, several studies have used neurotoxins such as 1-methyl-4-phenyl-1,2,3,6-tetrahydropyridine (MPTP) and 6-OHDA to model PD in zebrafish (;Zhang et al.,, 2017;). A remarkable advantage of the zebrafish PD model is that the blood-brain barrier in the larval stage is more permeable to neurotoxins such as MPTP and 6-OHDA as compared to rodents () (Jackson-Lewis, Blesa & Przedborski, 2012. Because of its multifaceted mechanism of action, we hypothesized that NAC may have a neuroprotective effect and prevent or minimize motor signs related to PD. To address this question, we evaluated the potential of NAC to prevent the injury caused by 6-OHDA exposure on motor, optomotor response and morphological parameters in zebrafish larvae. Animals Embryos and larvae (0 and 7 days post-fertilization (dpf)) of AB strain zebrafish (Danio rerio) were used. The animals were obtained from our breeding colony, which was maintained in recirculating systems (Zebtec, Tecniplast, Italy) with reverse osmosis filtered water equilibrated to reach the species standard parameters including temperature (28 ± 2 C), pH (7 ± 0.5), conductivity and ammonia, nitrite, nitrate and chloride levels. Water used in the experiments was obtained from a reverse osmosis apparatus (18 MOhm/cm) and was reconstituted with marine salt (Crystal Sea TM, Marinemix, Baltimore, MD, USA) at 0.4 ppt. The total organic carbon concentration was 0.33 mg/L. The total alkalinity (as carbonate ion) was 0.030 mEq/L. The animals were kept with a light/dark cycle of 14/10 h. Larvae from the developmental stages used in this study rely on the yolk sac for nutrition and feeding the animals is not necessary. At the end of the experiment, the larvae were euthanized by hypothermia. All protocols were approved by the Animal Care Committee of Pontifcia Universidade Cat lica do Rio Grande do Sul (#7994/17). Experimental design The experiments were performed according to Fig. 1. In a breeding tank, females and males (1:2) were separated overnight by a transparent barrier, which was removed after the lights went on in the following morning. The fertilized eggs that were retained in the bottom of the fitted tank were collected, washed and gently placed in a 6-well plate (15 animals per well) or 24-well plate (four animals per well), according to the treatment groups and experiment (6-well plate for behavioral tests and 24-well plate for morphological analysis). We chose not to use 96-well plates to avoid the bias of isolating the larvae, solution evaporation and skeletal malformations due to decreased swimming space (see review by ). The volume used in the 6-well and 24-well plates was 5 and 2 ml per well, respectively. A set of animals (n = 8-11) was used for the behavioral tests (locomotor activity first, followed by optomotor response test) and another set was used for the morphological analyses (n = 11-12). Animals were randomly assigned to the experimental groups following simple randomization procedures without stratification (computerized random numbers). All experimenters who analyzed the images and videos were blind to treatment-each experimental group was given a code that was revealed only after the analyses were performed (codification was carried out by a researcher who did not participate in the analyses). Total distance traveled in the locomotor activity test was considered our primary outcome, while the remaining measures were secondary outcomes. At 4 hours post-fertilization (hpf) () the embryos were exposed to 1 mg/L NAC or system water. The medium was not changed until 3 dpf. NAC concentration was determined in a pilot study as well as in our previous studies ((Mocelin et al.,, 2017. At 3, 4, 5 and 6 dpf the animal medium was changed for 250 mM 6-OHDA solution or system water (). The NAC and 6-OHDA solutions were diluted in system water in a light-protected environment immediately before use. To avoid interference in the solution pH, we did not use ascorbic acid as a 6-OHDA conservator. For this reason, we opted to replace 6-OHDA solution daily. At 7 dpf, the motor and morphological parameters of the larvae were analyzed. Embryos and larvae had their mortality and morphology observed daily under the stereomicroscope. There was no difference in the mortality rate between the experimental groups. When applicable, dead animals and the corium were removed (death events occurred before 6-OHDA exposure and were not associated with NAC treatment). The experiments were run twice to confirm the data (no differences were observed between the cohorts). Locomotor behavior At 7 dpf the larvae were transferred to the experimental room within the animal facility and individually placed in a 24-well plate filled with 2 ml of system water. The locomotor activity was recorded and analyzed during 5 min, following 1 min of acclimation, using Noldus Ethovision XT system (Wageningen, Netherlands). Total distance, mean speed, maximum acceleration, absolute turn angle and immobility time were considered the main parameters of locomotor activity (;). The experiments were performed in a temperature-controlled room (27 ± 2 C) between 9:00 and 14:00 h. Optomotor response The optomotor response test allows the assessment of an innate response behavior, indirectly related to cognition (), described as the swimming of zebrafish larvae in the same direction of a moving pattern of stripes (Fleisch & Neuhauss, 2006). We performed this test adapted from Creton. The apparatus consists of a Petri dish positioned over a LCD screen. After being tested for locomotor behavior, the larvae were placed in groups of 10 on the Petri dish filled with 5 ml of system water. After 2 min of acclimation in which the screen was white, the larvae were exposed to a visual stimulus consisting of a moving pattern of red and white stripes (24.5 cm wide and 1.5 cm high). First, the stripes move up at 1 cm/s for 1 min, and then move down at 1 cm/s for 1 min. This pattern repeated four times, with a 5 s interval between each 1 min show, in which the screen went white. The entire experiment was recorded and then analyzed by investigators who were blind to the experimental groups. For the data analysis, the Petri dish was virtually divided into two halves (upper and lower) and the number of animals in the stimulus zone (the region towards which the pattern moved) was counted during the 5 s interval of white screen. Morphological analysis At 7 dpf the larvae were individually placed in a Petri plate containing 200 mL of 3% methylcellulose with 0.1 g/L ethyl 3-aminobenzoate methanesulfonate (MS-222) solution and each larva was photographed using an inverted stereomicroscope (Nikon, Melville, NY, USA) connected to NIS-Elements Viewer software. Total length, head length, forebrain width, midbrain width and eyes distance were considered the main morphological parameters () and measured by investigators who were blind to the experimental groups using Image J software. The experiments were performed in a temperature-controlled room (27 ± 2 C) between 13:00 and 15:00 h. Statistical analysis Data were analyzed after normality and homogeneity of variance (D'Agostino-Person and Levene tests, respectively) confirmation using two-way ANOVA (type III sums of squares) to identify the main motor and morphological effects of pretreatment (NAC exposure or not) and treatment (6-OHDA exposure or not) and their interaction, followed by Bonferroni post hoc test. Sample sizes were calculate a priori based on data from the literature and pilot experiments and the observed power for our primary endpoint (total distance traveled) was 75% for NAC factor, 65% for 6-OHDA factor, and 92% for the interaction. Outliers were removed according to Tukey's boxplot method. Data were expressed as the mean ± S.E.M. For all comparisons, the significance level was set at p < 0.05. Figure 2 shows the effect of NAC (1 mg/L) on locomotor behavior in 7 dpf larvae exposed to 6-OHDA (250 mM). 6-OHDA caused a decrease in total distance ( Fig. 2A), mean speed (Fig. 2B) and maximum acceleration (Fig. 2C), while it increased absolute turn angle (Fig. 2D) and immobility time (Fig. 2E). In all locomotor parameters, NAC was able to prevent the locomotor deficits induced by 6-OHDA. NAC per se did not present statistical differences when compared to the control group. Table 1 summarizes the two-way ANOVA analysis. Figure 3 shows the effect of NAC (1 mg/L) on the optomotor response test in 7 dpf larvae exposed to 6-OHDA. Larvae exposed to 6-OHDA spent less time in the stimulus zone, and NAC was able to prevent this optomotor deficit. NAC per se did not alter this parameter. Figure 4 shows the effect of NAC (1 mg/L) on morphological parameters in 7 dpf larvae exposed to 6-OHDA (250 mM). 6-OHDA decreased the total length (Fig. 4A) and head length (Fig. 4B), whereas treatment with NAC prevented this effect. NAC per se did not induce morphological alterations. There was no statistical difference in any experimental groups regarding forebrain width (Fig. 4C), midbrain width (Fig. 4D) and eyes distance (Fig. 4E). Table 2 summarizes the two-way ANOVA analysis. DISCUSSION Our results demonstrated that 6-OHDA at 250 mM is able to induce motor and optomotor deficits and morphological alterations in zebrafish larvae at 7 dpf. Interestingly, NAC (1 mg/L) prevented these effects when administered at the very onset of zebrafish embryos development (4 hpf), showing a clear neuroprotective effect against the neurotoxin. In the field of animal models of PD induced by neurotoxins such 6-OHDA, the use of zebrafish has increased, probably due to its various benefits when compared to mammal. We did not evaluate the 6-OHDA-induced damage to dopaminergic neurons ourselves, however we followed the protocol described by Zhang et al. who evaluated the DA neuron system of zebrafish larvae by immunofluorescent staining with a specific antibody against anti-TH and found that treatment with 6-OHDA decreased the number of DA neurons markedly in the diencephalon of larvae zebrafish. By causing the death of dopaminergic neurons from important pathways associated with movement regulation, it has been shown in several studies that 6-OHDA is able to cause locomotor deficits in zebrafish larvae (;) and adults (). According to what is shown in the literature, our results demonstrate that 6-OHDA caused locomotor deficit in all analyzed parameters, causing decrease in distance, mean speed and maximum acceleration and increase in absolute turn angle and immobility time. Our findings show, for the first time, that pre-treatment with NAC is capable of preventing the locomotor deficits induced by 6-OHDA. In another study, NAC improved the behavioral damages and dopaminergic neurons loss induced by rotenone in an animal model of PD in rats, which is in accordance with our results, further suggesting the neuroprotective effects of NAC in behavioral and neurochemical parameters (). The optomotor response test evaluates zebrafish's sensory performance, in addition to its responsiveness to the environment (Maaswinkel & Li, 2003;Creton, 2009). Several PD patients demonstrate sensory dysfunctions, such as changes in visual perception, including color perception and contrast sensitivity (). These patients have difficulty performing complex visual tasks such as mental rotation and emotion recognition (). As sensory impairment is a non-motor PD symptom, it is important to evaluate the effects of NAC on optomotor parameters. Thus, our data demonstrated for the first time that larvae exposed to 6-OHDA spent less time in the stimulus zone, presenting an optomotor damage. NAC was able to prevent the deficit in optomotor response in larvae exposed to 6-OHDA, demonstrating the neuroprotective role of NAC in pathways related to sensory functions of zebrafish larvae. Although there is a motor component to this test, we believe the deficits on locomotor activity alone would not explain the poor performance in this test, and sensory impairment is likely to be involved as well. Studies using tyrosine hydroxylase (TH) and DA transporter staining showed that after 24 hpf the zebrafish larvae already have functional dopaminergic neurons in areas such as posterior tuberculum in the midbrain and within 4 dpf all dopaminergic pathways are present (Nellore & Nandita, 2015). Our study also shows that 6-OHDA caused morphological changes in zebrafish larvae, producing apparent body curvature and decrease of total length and head length. Thereby, we can assume that the pathways that suffered neuronal death play a key role in regulating the development of the zebrafish larvae. Similar morphological observations were seen in zebrafish larvae exposed to pesticides such as paraquat and rotenone (Bretaud, Lee & Guo, 2004). In the treatment groups that received NAC, no morphological changes were observed, even when exposed to 6-OHDA. Because of its mechanism of action, NAC is likely to have protected these pathways, preventing the morphological changes caused by 6-OHDA. NAC (100 mg/kg) was able to increase the levels of the dopaminergic marker TH in the striatum of mice exposed to 6-OHDA, reinforcing the important effect of NAC in the preservation of the dopaminergic system (). We observed main effects of NAC in the direction of increased forebrain width and (consequently) eye distance (Table 2)-this is very different from the damaging effects of 6-OHDA and other toxins, which are expected to decrease such values. We speculate that the antioxidant and neurotrophic properties of NAC may have boosted larvae development. Several studies have shown that NAC has an indirect antioxidant effect through its ability to provide cysteine for the synthesis of GSH, which leads to an increase of neuronal levels of GSH, both in animal models (;) and in humans (). However, as demonstrated by Misra, thiols can undergo autoxidation in solution forming superoxide free radical and thyl, so it is possible that over the course of days, a portion of NAC can undergo autoxidation, generating these oxygen radicals. These oxygen radicals, in turn, would be sources of damage and would stimulate transcription factors like Nuclear factor (erythroid-derived 2)-like 2 to regulate the expression of antioxidant defenses such as GSH. We believe that the neuroprotective effect of NAC found in this study may be a result of these two events. In addition, NAC has anti-inflammatory properties by reducing pro-inflammatory cytokine levels, including interleukin (IL)-6, IL-1b and tumor necrosis factor alpha (Dean, Giorlando & Berk, 2011). Considering that neuroinflammation mediates an important key role in neurodegeneration associated with PD, studies have shown the preventive potential of non-steroidal anti-inflammatory drugs in modifying some pathophysiological aspects of PD, indicating drugs with an anti-inflammatory profile could act as neuroprotectors (). NAC also shows glutamatergic modulator activities by regulating neuronal exchange of glutamate through the cystine-glutamate antiporter, in addition to regulating the dopaminergic transmission (Dean, Giorlando & Berk, 2011;). NAC also reduces oxidative damage markers (), increases the number of brain synapses () and activates the mitochondrial complex I (). Although there is limited research about NAC in Parkinson's disease, some studies have demonstrated that NAC has potential as a therapeutic strategy for PD prevention and treatment in humans and PD animal models (;Martnez-Banaclocha, 2012;;;). Studies have indicated NAC effects as an anxiolytic (;) and antidepressant drug (;;;). Therefore, NAC has advantages over the existing therapies since, besides having a potential preventive effect, it may be able to treat the non-motor aspects of PD, which include depression, anxiety, cognitive impairment and sleep disturbances. It is increasingly necessary to develop drugs with a multifaceted mechanism capable of acting on several targets that are altered in neurodegenerative diseases, such as PD, more effectively and with fewer adverse effects. Translational research aims to serve as a powerful tool in the development of pharmacological interventions that fulfill this goal (Pickart & Klee, 2014). Our results propose the investigation of the effect of NAC in the prevention and treatment of PD, showing a protective effect of NAC in behavioral and morphological parameters in a translational model of PD in zebrafish. However, further research is needed to evaluate the action of NAC in other important PD markers. Therefore, we intend to perform additional studies to analyze the role of NAC in markers of oxidative stress, apoptosis and TH in the present model of PD in zebrafish. CONCLUSION This study demonstrated that NAC was able to prevent the behavioral deficits and morphological alterations induced by 6-OHDA, which supports its neuroprotective effect. For having differentiated profile and mechanism of action, NAC is a candidate for the prevention and treatment of PD, acting in different aspects of the disease. ADDITIONAL INFORMATION AND DECLARATIONS Funding This work was supported by Fundao de Amparo Pesquisa do Estado do Rio Grande do Sul (FAPERGS) and by the Conselho Nacional de Desenvolvimento Cientfico e Tecnol gico (CNPq, #401162/2016-8 and #302800/2017-4). The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript. Competing Interests Angelo Piato is an Academic Editor for PeerJ. Author Contributions Radharani Benvenutti conceived and designed the experiments, performed the experiments, analyzed the data, prepared figures and/or tables, authored or reviewed drafts of the paper, approved the final draft. Matheus Marcon performed the experiments, prepared figures and/or tables, authored or reviewed drafts of the paper, approved the final draft. Carlos G. Reis performed the experiments, authored or reviewed drafts of the paper, approved the final draft. Laura R. Nery performed the experiments, authored or reviewed drafts of the paper, approved the final draft. Camila Miguel performed the experiments, authored or reviewed drafts of the paper, approved the final draft. Ana P. Herrmann conceived and designed the experiments, analyzed the data, prepared figures and/or tables, authored or reviewed drafts of the paper, approved the final draft. Monica R.M. Vianna conceived and designed the experiments, analyzed the data, contributed reagents/materials/analysis tools, authored or reviewed drafts of the paper, approved the final draft. Angelo Piato conceived and designed the experiments, analyzed the data, contributed reagents/materials/analysis tools, prepared figures and/or tables, authored or reviewed drafts of the paper, approved the final draft. Animal Ethics The following information was supplied relating to ethical approvals (i.e., approving body and any reference numbers): All protocols were approved by the Animal Care Committee of Pontifcia Universidade Cat lica do Rio Grande do Sul (#7994/17).
|
AB0306The influence of the definition of patient global assessment in assessment of ACR/eular remission and minimal disease activity in rheumatoid arthritis: A 3-month cohort study in patients starting etanercept Background The wording and form of the patient global assessment (PGA) question may influence the response and thus whether or not a patient meets the ACR/EULAR criteria for remission. Objectives To assess the effect of the definition of PGA on the classification of ACR/EULAR remission and minimal diseae activity in RA patients after starting etanercept. Methods We recently found a low impact of 3 different definitions of PGA on the evaluation of disease activity based on the DAS28 (Disease activity Score) in 108 active RA patients treated with etanercept for 12 weeks. One definition focused on general health over the last 2-3 weeks, one on disease activity over the last 48 hours, and the final definition comprised the result of the RA Impact of Disease questionnaire (RAID), a weighted mean of 7 questions, one on each of the domains pain, function, fatigue, physical and psychological well being, sleep disturbance and coping. All were assessed on 0-10 numerical rating scales. The current analysis focuses on ACR/EULAR remission. We also studied the effects on patients with a DAS28 <2.6. This was previously termed remission but is better defined as minimal disease activity. Results Overall, depending on the chosen definition the number of patients in remission was between 9 and 12 (i.e., about 10%)for ACR/EULAR remission and about 26-27 patients (25%) for minimal disease activity. The definition of PGA had little impact on the cases classified in the Boolean or SDAI (Simple Disease Activity Index) definition, with 2-3 discrepant cases per comparison, and kappa coefficients ranging between 0.82 and 0.89. Keeping the PGA definition stable, the impact of using the Boolean or SDAI definition was larger: 4-6 discrepant cases, kappa 0.67-0.80. For minimal disease activity, there were 2-3 discrepant cases between PGA definitions (kappa 0.92-0.95). Conclusions In this dataset the definition of PGA had little impact on the classification of patients in ACR/EULAR remission or in minimal disease activity state. References Dougados M, Ripert M, Hilliquin P, et al. The influence of the definition of patient global assessment in assessment of Disease Activity According to the Disease Activity Score (DAS28) in rheumatoid arthritis. J Rheumatol 2011;38:2326-8. Wells GA, Boers M, Shea B, et al. Minimal disease activity for rheumatoid arthritis: a preliminary definition. J Rheumatol 2005;32:2016-24. Disclosure of Interest M. Boers: None Declared, Y. Brault Employee of: Pfizer SAS, France, I. Logeart Employee of: Pfizer SAS, France, M. Dougados Grant/Research support from: Pfizer SAS, France
|
DOES ART HAVE A TASK? STATE PROCUREMENT VS CREATIVE FREEDOM This article outlines several trajectories in art sociology in respect of the issue of the artist and a piece of art. What is the status of an artist and self-awareness within the relations of social context: in the realisation of the social life of a piece of art? Applied theories have been chosen to discuss the public space in search of an answer to the question: whether art represents the state procurement or the artist is a free and creative personality in a democratic society? Another question is as follows: Does art have a task? During the last decade several pieces of art depicting harsh reality have been created in Latvia in the manner of social criticism. In the new social system society is not only searching for criticism, but is also longing for art that represents social integrity and identity.
|
Do we really need family medicine research? amily medicine research has a low profile in Canadian medical schools and among community-based family doctors. Some family practitioners believe that all research should be done only by specialists, as they know more about conditions within their specialties. Most community practitioners are unaware of any family medicine research that has infl uenced the way they practise. Ninety-three percent of medical students completing an exit survey after the Canadian Resident Matching Service matches in 2002 and 2003 said they would never consider family medicine if they were interested in an academic career; 97% said they would never consider family medicine if they were interested in a research career. Many family medicine residents complain about their programs requirement to complete an academic project during their residency. Some applicants for family medicine residencies go as far as avoiding programs that require a project. The quality of resident academic research projects assessed by the College of Family Physicians of Canadas (CFPCs) Section of Researchers to determine the two best Canadian resident projects each year is quite exceptional. Th e projects are publishable and make important contributions to family medicine. Every year, many residents career choices are infl uenced by the work they did on their projects.
|
Reference architecture of technological demonstrators for enhanced maritime situational awareness In multinational defence operations, either EU or NATO driven, the exchange of surveillance and reconnaissance data and information is an essential aspect to provide to the commander the needed situational awareness. This improvement of situational awareness, especially in a maritime environment, may be achieved amongst others by extending the ISTAR performance through using unmanned systems (UxS) and integrating them into the combat management system (CMS), ensuring interoperability between the deployed forces and building the overall system based on a solid architecture. Within this frame, the OCEAN2020 (Open Cooperation for European mAritime awareNess) project, funded by the European Union's Preparatory Action on Defence Research and implemented by the European Defence Agency, sees 42 partners from 15 EU countries working together to build future maritime surveillance by integrating drones, unmanned vessels and unmanned submarines into fleet operations. Data and information will be integrated in a comprehensive (maritime) picture of developing situations, enhancing the situational awareness, and thus supporting military commanders on different unit levels in their decision making. This paper focuses on the challenge to define flexible architectures for maritime operations. The reference architecture for a system-of-systems that aims to provide enhanced situational awareness in a naval environment will be presented. The reference architecture provides reusable structures and rules, helping to reduce development and system realization time and costs. This Reference Architecture will establish strategic decisions regarding system technologies to be used and will serve as baseline for the development of two Target Architectures for the two planned demonstrations.
|
#include <stl/vector>
#include <stl/algorithm>
#include <stdio.h>
using namespace stl;
bool values_squared (int a,int b)
{
return a*a == b;
}
int main ()
{
printf ("Results of equal2_test:\n");
vector<int> v1 (10), v2 (10);
for (int i=0;i<(int)v1.size ();i++)
{
v1 [i] = i;
v2 [i] = i*i;
}
printf ("v2[i] %s v1[i] * v1[i]\n",equal (v1.begin (),v1.end (),v2.begin (),values_squared)?"==":"!=");
return 0;
}
|
Cinnamon Extract Ameliorates Liver Damage And Oxidative Stress Induced By Paracetamol In Male Rats Paracetamol is a harmless antipyretic and analgesic at the therapeutic dose, but when used by overdose cause hepatic damage. The study was planned to evaluate the effect of cinnamon extract on paracetamol-induced liver injury in rats. Thirty male rats were allocated into six equal groups, control group, silymarin group cinnamon group, paracetamol group, cinnamon + paracetamol group and silymarin + paracetamol group. At the end of experiment, blood and liver tissue samples were collected. Paracetamol caused rise in liver enzymes including alanine amino transaminase (ALT), aspartate amino transaminase (AST) and alkaline phosphatase (ALP), with changes in protein and lipid profiles. It also caused hepatic lipid peroxidation with decreasing the activities of antioxidant enzymes catalase (CAT) and superoxide dismutase (SOD). Pretreatment with cinnamon extract for 30 days improves the adverse effects of paracetamol evidenced by biochemical and histopathological findings. In conclusion, cinnamon extract can serve as a hepatoprotective agent against paracetamol-induced liver damage.
|
#ifndef DataFormats_ScoutingTrack_h
#define DataFormats_ScoutingTrack_h
#include <vector>
//class for holding track information, for use in data scouting
class ScoutingTrack {
public:
//constructor with values for all data fields
ScoutingTrack(float tk_pt,
float tk_eta,
float tk_phi,
float tk_chi2,
float tk_ndof,
int tk_charge,
float tk_dxy,
float tk_dz,
int tk_nValidPixelHits,
int tk_nTrackerLayersWithMeasurement,
int tk_nValidStripHits,
float tk_qoverp,
float tk_lambda,
float tk_dxy_Error,
float tk_dz_Error,
float tk_qoverp_Error,
float tk_lambda_Error,
float tk_phi_Error,
float tk_dsz,
float tk_dsz_Error)
: tk_pt_(tk_pt),
tk_eta_(tk_eta),
tk_phi_(tk_phi),
tk_chi2_(tk_chi2),
tk_ndof_(tk_ndof),
tk_charge_(tk_charge),
tk_dxy_(tk_dxy),
tk_dz_(tk_dz),
tk_nValidPixelHits_(tk_nValidPixelHits),
tk_nTrackerLayersWithMeasurement_(tk_nTrackerLayersWithMeasurement),
tk_nValidStripHits_(tk_nValidStripHits),
tk_qoverp_(tk_qoverp),
tk_lambda_(tk_lambda),
tk_dxy_Error_(tk_dxy_Error),
tk_dz_Error_(tk_dz_Error),
tk_qoverp_Error_(tk_qoverp_Error),
tk_lambda_Error_(tk_lambda_Error),
tk_phi_Error_(tk_phi_Error),
tk_dsz_(tk_dsz),
tk_dsz_Error_(tk_dsz_Error) {}
//default constructor
ScoutingTrack()
: tk_pt_(0),
tk_eta_(0),
tk_phi_(0),
tk_chi2_(0),
tk_ndof_(0),
tk_charge_(0),
tk_dxy_(0),
tk_dz_(0),
tk_nValidPixelHits_(0),
tk_nTrackerLayersWithMeasurement_(0),
tk_nValidStripHits_(0),
tk_qoverp_(0),
tk_lambda_(0),
tk_dxy_Error_(0),
tk_dz_Error_(0),
tk_qoverp_Error_(0),
tk_lambda_Error_(0),
tk_phi_Error_(0),
tk_dsz_(0),
tk_dsz_Error_(0) {}
//accessor functions
float tk_pt() const { return tk_pt_; }
float tk_eta() const { return tk_eta_; }
float tk_phi() const { return tk_phi_; }
float tk_chi2() const { return tk_chi2_; }
float tk_ndof() const { return tk_ndof_; }
int tk_charge() const { return tk_charge_; }
float tk_dxy() const { return tk_dxy_; }
float tk_dz() const { return tk_dz_; }
int tk_nValidPixelHits() const { return tk_nValidPixelHits_; }
int tk_nTrackerLayersWithMeasurement() const { return tk_nTrackerLayersWithMeasurement_; }
int tk_nValidStripHits() const { return tk_nValidStripHits_; }
float tk_qoverp() const { return tk_qoverp_; }
float tk_lambda() const { return tk_lambda_; }
float tk_dxy_Error() const { return tk_dxy_Error_; }
float tk_dz_Error() const { return tk_dz_Error_; }
float tk_qoverp_Error() const { return tk_qoverp_Error_; }
float tk_lambda_Error() const { return tk_lambda_Error_; }
float tk_phi_Error() const { return tk_phi_Error_; }
float tk_dsz() const { return tk_dsz_; }
float tk_dsz_Error() const { return tk_dsz_Error_; }
private:
float tk_pt_;
float tk_eta_;
float tk_phi_;
float tk_chi2_;
float tk_ndof_;
int tk_charge_;
float tk_dxy_;
float tk_dz_;
int tk_nValidPixelHits_;
int tk_nTrackerLayersWithMeasurement_;
int tk_nValidStripHits_;
float tk_qoverp_;
float tk_lambda_;
float tk_dxy_Error_;
float tk_dz_Error_;
float tk_qoverp_Error_;
float tk_lambda_Error_;
float tk_phi_Error_;
float tk_dsz_;
float tk_dsz_Error_;
};
typedef std::vector<ScoutingTrack> ScoutingTrackCollection;
#endif
|
//***************************************************************************
//
// Copyright (c) 1999 - 2006 Intel Corporation
//
// 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.
//
//***************************************************************************
/**
@file IFXKeyTrack.cpp
*/
#include "IFXKeyTrack.h"
#define IFXKT_REPLACE_SAMETIME TRUE //* replace near keyframe on insert
#define IFXKT_REPLACE_DELTA 0.01f //* how near in time to replace
/******************************************************************************
void IFXKeyTrack::CalcInstantConst(F32 time,IFXInstant *instant,
IFXListContext *context) const
FUTURE perhaps something better than linear interpolation on locations
******************************************************************************/
void IFXKeyTrack::CalcInstantConst(
F32 time,
IFXInstant *instant,
IFXListContext *context) const
{
if(context==NULL)
context=(IFXListContext *)&m_current;
Sync(time,context);
IFXKeyFrame *after=GetCurrent(*context);
IFXKeyFrame *before=PreDecrement(*context);
PreIncrement(*context); // put back
if(!before && !after)
{
if(GetHead())
{
*instant= *GetHead();
return;
}
else
instant->Reset();
}
else if(!before)
{
*instant= *after;
return;
}
else if(!after)
{
*instant= *before;
return;
}
else
{
F32 fraction= (time-before->Time()) /
(after->Time()-before->Time());
instant->Location().Interpolate(fraction,
before->LocationConst(),after->LocationConst());
instant->Rotation().Interpolate(fraction,
before->RotationConst(),after->RotationConst());
instant->Scale().Interpolate(fraction,
before->ScaleConst(),after->ScaleConst());
}
}
void IFXKeyTrack::InsertNewKeyFrame(F32 time,const IFXInstant &instant,
IFXListContext *context)
{
IFXKeyFrame *newframe=NULL;
if(context==NULL)
context=&m_current;
Sync(time,context);
#if IFXKT_REPLACE_SAMETIME
IFXListContext *context2=context;
IFXKeyFrame *prior=PreDecrement(*context2);
context2=context;
IFXKeyFrame *next=PreIncrement(*context2);
if(prior && (time-prior->Time() < IFXKT_REPLACE_DELTA) )
{
IFXTRACE_GENERIC(L"InsertNewKeyFrame(time=%.6G) replacing adjacent time %.6G\n",
time,prior->Time());
newframe=prior;
}
else if(next && (next->Time()-time < IFXKT_REPLACE_DELTA) )
{
IFXTRACE_GENERIC(L"InsertNewKeyFrame(time=%.6G) replacing adjacent time %.6G\n",
time,next->Time());
newframe=next;
}
else
#endif
InsertBefore(*context,newframe=new IFXKeyFrame);
newframe->IFXInstant::operator=(instant);
newframe->SetTime(time);
}
/**
move context to node just after time
*/
void IFXKeyTrack::Sync(F32 time, IFXListContext* context) const
{
IFXKeyFrame *frame=GetCurrent(*context);
if(!frame)
{
if(IsAtTail(*context))
frame=ToTail(*context);
else
frame=ToHead(*context);
}
while(frame && frame->Time()>time)
frame=PreDecrement(*context);
while(frame && frame->Time()<time)
frame=PreIncrement(*context);
}
/******************************************************************************
void IFXKeyTrack::Filter(F32 deltatime)
remove track entries too close in time
******************************************************************************/
void IFXKeyTrack::Filter(F32 deltatime)
{
//I32 original=GetNumberElements();
IFXListContext basecontext,nextcontext;
IFXKeyFrame *base,*next;
ToHead(basecontext);
while((base=GetCurrent(basecontext)) != NULL)
{
nextcontext=basecontext;
PostIncrement(nextcontext);
if(IsAtTail(nextcontext))
break;
next=GetCurrent(nextcontext);
if( (next->Time()-base->Time()) < deltatime )
{
Delete(next);
}
else
{
PostIncrement(basecontext);
}
}
}
void IFXKeyTrack::Compress(F32 deltaposition,F32 deltarotation,F32 deltascale)
{
//I32 original=GetNumberElements();
IFXListContext basecontext,midcontext,leapcontext;
IFXKeyFrame *base,*mid,*leap;
ToHead(basecontext);
while((base=GetCurrent(basecontext)) != NULL)
{
midcontext=basecontext;
PostIncrement(midcontext);
leapcontext=midcontext;
PostIncrement(leapcontext);
if(IsAtTail(leapcontext))
break;
mid=GetCurrent(midcontext);
leap=GetCurrent(leapcontext);
F32 fraction=(mid->Time()-base->Time())/(leap->Time()-base->Time());
IFXVector3 intervector;
intervector.Interpolate(fraction,base->LocationConst(),
leap->LocationConst());
IFXQuaternion interquat;
interquat.Interpolate(fraction,base->RotationConst(),
leap->RotationConst());
IFXVector3 interscale;
interscale.Interpolate(fraction,base->ScaleConst(),
leap->ScaleConst());
if(mid->LocationConst().IsApproximately(intervector,deltaposition) &&
mid->RotationConst().IsApproximately(interquat,deltarotation) &&
mid->ScaleConst().IsApproximately(interscale,deltascale) )
{
//* watch out for spans close to 180 degrees
F32 radians;
IFXVector3 axis;
IFXQuaternion inverse,span;
inverse.Invert(base->RotationConst());
span.Multiply(inverse,leap->RotationConst());
span.ComputeAngleAxis(radians,axis);
if(radians<170.0*IFXTO_RAD)
Delete(mid);
else
PostIncrement(basecontext);
}
else
{
PostIncrement(basecontext);
}
}
}
|
Online physically active academic lessons in COVID-19 times: A pilot study Schools play an important role in promoting physical activity among students. This paper studies the perception of educators, students, and parents about the use of online physically active academic lessons during COVID-19 in the north of Chile. Starting the first week of November 2020, and for a period of five weeks, 323 students, alongside 11 educators, practiced a geometry-based dance routine online. The qualitative analysis results reveal a positive perception of the experience and an increase in physical activity without reducing the amount of time spent on academic activities. There were also improvements in learning, social relationships, and enjoyment. This situation exasperated the current problems in public healthcare stemming from low levels of physical activity and high levels of sedentarism among young people (King, Burke, Halson, & Hawley, 2020;). Taking action to combat the negative impact of physical inactivity during the pandemic is therefore essential (). This undoubtedly includes promoting physical activity while respecting wider COVID-19 measures. One way of promoting physical activity during the pandemic is to use physically active academic lessons during online classes (). This is a way of mitigating the effects of inactivity and sedentarism among children, which, according to Hall, Laddu, Phillips, Lavie, and Arena, can be both serious and long-lasting. The aim of this study is to explore the acceptability and feasibility of using online physically active academic lessons, considering the perspective of the parents, teachers, and students. We are particularly interested in these three parties as school closures have significantly changed what it means to be a teacher, student, and even parent (). The research questions guiding this study therefore are: What were the teachers', students', and parents' perceptions of the use of online physically active academic lessons during the pandemic? What difficulties or barriers were identified by teachers, students, and parents throughout the use of online physically active academic lessons during the pandemic? The importance of staying physically active during the pandemic Physical activity can combat the negative impact that fear of COVID-19 has on mental health and wellbeing among adolescents (Wright, Williams, & Veldhuijzen van Zanten, 2021). Lesser and Nienhuis suggested that adults who did more physical activity during lockdown reported lower levels of anxiety than those who were less active. Even before COVID-19, there was already ample evidence showing that physical activity among young people has multiple benefits. This includes improved cognitive function (Biddle, Ciaccioni, Thomas, & Vergeer, 2019), better physical health (Janssen & Leblanc, 2010; US Department of Health and Human Services, 2018), better mental health (;), a more positive self-image and improved selfesteem (;McPhie & Rawana, 2012). In addition to this, other more specific benefits include reduced levels of aggressiveness (Basch, 2011;), depression (Bailey, Hetrick, Rosenbaum, Purcell, & Parker, 2018;Rosenbaum, Tiedemann, Sherrington, Curtis, & Ward, 2014) and anxiety (Str€ ohle, 2009). In fact, the importance of physical activity was acknowledged by a number of countries during the pandemic as it was one of the few exceptions for people to leave their homes (). Nevertheless, Jakobsson et al. suggest there is need for resources and solutions to allow young people to continue doing physical activity at home, despite restrictions. Measures must be taken and alternatives found in order to allow for physical activity and to combat the negative effects associated with COVID-19 restrictions (Amatriain-Fern andez, Murillo-Rodrguez, Gronwald, Machado, & Budde, 2020;). In this sense, Roe et al. suggest that teachers should support such initiatives by assigning tasks that require students to routinely participate in physical activity, even when at home. Opportunities for doing physical activity in educational establishments Physical activity is present in schools in a number of ways (World Health Organization, 2010), both structured and unstructured (Calvert, Mahar, Flay, & Turner, 2018). Typically, this often includes recess and Physical Education classes (). Recess, which is usually unstructured, gives students time to play freely and develop their social skills. Physical Education, on the other hand, is structured and based on a series of learning objectives and curriculum standards (MINEDUC, 2018. These look to ensure that students are taught the cognitive or mental skills they need to understand movement, as well as the affective skills needed for developing feelings or attitudes (SHAPE America, 2014). Finally, Physical Education is also a space for psychomotor learning, where students are taught physical skills related to movement (SHAPE America, 2014). Worryingly, even before the pandemic, many schools had already decreased or removed Physical Education classes (Drollette, Shishido, Pontifex, & Hillman, 2012;Hardman, 2011;Institute of Medicine, 2013;Stylianou, Kulinna, & Naiman, 2016). This sort of marginalization has only increased during the pandemic (;). In this sense, Physical Education was not given the same level of priority as other subjects (Cruickshank, Hyndman, Patterson, & Kebble, 2021), with administrators, parents and students all giving more attention to other areas of the curriculum (Kim, Yu, Park, Ha, & Baek, 2021). Physical Education was reduced to simply offering the students the opportunity to do physical activity (Cruickshank, Pill, & Mainsbridge, 2021), without taking into consideration the curricular content and objectives of the subject itself. During the pandemic, Physical Education teachers reported a reduction in the number of classes they were required to teach, sometimes having no requirement whatsoever to teach (Cruickshank, Pill, & Mainsbridge, 2021;) or assess their students (), despite being a curricular and administrative obligation (Baena-Morales, L opez-Morales, & Garca-Taibo, 2020). However, schools must provide as many opportunities as possible for physical activity, including in the classroom (;World Health Organization, 2010). In this sense, before COVID-19, there were three main approaches to promoting physical activity in schools (). 1) Physically active academic lessons, which integrate physical activity with curricular content (Dyrstad, Kval, Alstveit, & Skage, 2018). Examples include having students jump a certain number of times in order to answer an addition problem or use their bodies to represent geometric shapes and study their properties. 2) Physical activity breaks introduce short bursts of physical activity during class (Turner & Chaloupka, 2017). This might include having students do sit-ups or burpees. 3) Active transitions, which introduce physical activity when moving from one topic (or task) to another (;), such as having students jump around the classroom before lining up for lunch or changing classrooms. Participants This study involved 11 educators, including nine females and two males. This gender distribution is typical within the Chilean school system (see Table 1). Six of these educators were Primary School Teachers (PST), two were Physical Education Teachers (PET), and three were Educational Psychologists (EP). The average age of the educators was 36.6 years, with a standard deviation of 5.6 (Max 47; Min 28). On average, they had been working as educators for 11.6 years (SD 5.9; Min 3; Max 18). During the study, the 11 educators worked at four different educational establishments located in the same district in the north of Chile. Two of the establishments were vouchers schools (S1 and S2), while the other two were state schools (S3 and S4), one of which was a rural school (S4). Although not random, this sample roughly represents the wider distribution of schools within the district. In this sense, 52.3% of schools within the district are voucher schools, while 14.3% are rural (JUNAEB, 2020a). It is worth noting that voucher schools are privately managed establishments that receive public funding via student-based vouchers (Giaconi, Bressoux, & Felmer, 2021). The School Vulnerability Index (SVI) expresses the level of poverty associated with the students at a given school, with 100% representing the maximum level of poverty. The SVI at the schools included in this study ranged between 52.52% and 92.28% (JUNAEB, 2020a). Only School 2 (S2) was below the district-wide average of 85.16% (JUNAEB, 2020a). Similarly, the Multidimensional Vulnerability Index (MVI) represents the most important dimensions of vulnerability that cannot be detected by the students' academic history, e.g., health, family, protection of human rights, stimulation, and support (JUNAEB, 2020b). In this case, the scores ranged between 34.06 and 41.40 points (JUNAEB, 2020b) with 100 points representing the highest level of vulnerability. Again, School 2 (S2) had the lowest score (34.06 points), while the other schools had scores that were similar to the districtwide average of 41.29 points. All classes taught by the participating educators were invited to take part in the study. A total of 323 students (135 girls and 188 boys) participated (Table 1). The number of students and gender distribution in each class can be seen in Table 1. It is worth noting that at School 1 (S1), all of the teachers for each class participated in the study (i.e., the Primary School Teacher, the Educational Psychologist, and the Physical Education Teacher). At Schools 2 and 4 (S2 and S4), the Physical Education Teachers chose not to participate in the activity, while the Educational Psychologists were not available (S2 did not have an Educational Psychologist, while at S4 they were on sick leave). Finally, at School 3 (S3), only the Physical Education teacher took part in the study, indicating that her colleagues prioritized curricular content over physical activity. It is worth noting that the negative perception of physically active academic lessons is one of the barriers that is systematically highlighted in the literature (Bedard, St John, Bremer, Graham, & Cairney, 2019;Quarmby, Daly-Smith, & Kime, 2019). Procedure The aim of this study was to evaluate the acceptability and feasibility of using physically active academic lessons during online classes in times of COVID-19. During the second semester of 2020, with schools closed, the 11 participating educators met virtually to plan how to include physically active academic lessons in their online classes. The topic of the lessons was geometry, specifically 2D shapes and their properties. This topic was chosen by the educators as it could be covered at all of the grade levels of primary school in which they taught classes and with different levels of motor skills (Oate Navarrete, Aranela Castro, Navarrete Cerda, & Seplveda Urra, 2021). Also, because of positive evidence regarding the use of physically active academic lessons in mathematics (Mavilidi, Okely, Chandler, Louise Domazet, & Paas, 2018;), and particularly with geometry (Hraste, de Giorgio, Jelaska, Padulo, & Grani c, 2018;Moore & Linder, 2012), and no studies reporting a negative impact of physically active academic lessons on learning in mathematics (Vetter, Orr, O'Dwyer, & O'Connor, 2020). The planning process began with the Primary School Teachers outlining the content for geometry from 1st to 5th grade. To do so, they used the National Curriculum for Mathematics and official guidelines for prioritizing curricular content issued during the first few months of the pandemic (MINEDUC, 2020f, MINEDUC, 2020g). Following this, the Primary School Teachers and Educational Psychologists worked together to determine the ways in which to use the body to represent said content. The Physical Education Teachers then chose which shapes were easiest for the students to represent, taking into account their level of motor development and the Physical Education objectives to be covered (MINEDUC, 2018. They also suggested using a stick so as to make it easier to represent certain shapes (Appendix A, Fig. 4). To promote student interest and participation, the educators then chose to set the activity to music from the popular and recently-released children's movie, Sponge Bob. Finally, the Physical Education Teachers integrated the representations of the shapes to the music, creating a simple dance routine based on the curricular content for geometry and Physical Education from 1st to 5th grade. Once the dance routine had been created it was recorded (https://www.youtube.com/watch?vhFulkLraaSY). Here, one of the Physical Education Teachers dressed up as different children's characters to attract the attention of the younger students, which, according to the teachers, was one of the hardest things to do in online teaching, and hiding the teacher's identity, since recognizing the teacher may have had some effect on student engagement. Afterwards, the recordings were arranged in a grid to simulate an online class (Appendix A, Fig. 5). Certain graphical elements were then added to the video to facilitate understanding of the curricular content and improve the overall aesthetics (Appendix A, Fig. 6). For five weeks, starting the first week of November 2020, each Primary School Teacher and Physical Education Teacher practiced the routine with their students during the periods allocated to them in the school timetable (see Fig. 1). Whenever possible, the schools' Educational Psychologists would work with both teachers by practicing the dance routine with the students and reinforcing the topics being covered. Each teacher was able to decide the duration and timing of the practice. During the practice sessions, the teachers used the appropriate terminology, both in Mathematics and Physical Education, to guide the students. As further curricular content and skills were added, the teachers of both subjects taught or reviewed each topic based on the grade level of each class. When necessary, the teachers reinforced the curricular content and skills after the practice. Additionally, and on request of the school authorities to provide evidence of student participation, the teachers record three of the sessions: at the beginning, middle, and end of the five-week period. Furthermore, during the final week, the students sent a video of themselves dancing the routine outside of school time (individual video). Once the five weeks were over, the parents, students, and educators were invited to participate in a series of online focus groups (see Assessing the Experience). Finally, the students and parents were also sent a video showing the evolution of the activity at each establishment ( Fig. 2). A compilation of the students' own videos was also shared ( Fig. 3). At each of the schools, the teachers who did not participated teached the same topics and skills as their peers. The primary school teachers taught geometry without using physical activity. For instance, the teachers used the geometry activities included in the school textbooks (MINEDUC, 2020a; 2020b), as to describe 2D shapes with their own words; build 2D shapes using physical materials; and identify vertices, edges, faces and angles in 2D shapes from their surroundings. While the Physical Education teachers developed the students' motor skills and promoted an active, healthy lifestyle, without relating this to geometry. For example, to develop students' basic motor skills such as movement, handling and stability (MINEDUC, 2020c), asking the students to walk in a straight line, jump on one foot and land with two feet together, and balance a ball on their hand as they walked in a straight line. Additionally, all of the teachers looked to strengthen the students' social skills, which are cross-cutting and present throughout the curriculum. For example, the teachers encouraged the students to help their classmates whenever possible; to ask for help when needed; to listen and communicate clearly and constructively when faced with a conflict; and to cooperate, among others. Finally, it is worth noting that during other subjects, such as Language Arts and History, all of the teachers (both participating and non-participating) followed the curriculum for each subject (MINEDUC, 2020d) using the school textbooks and activity books. Table 2 shows that the intervention was mostly carried during mathematics classes and, on average, took up 47 min per week (SD 24.17). In addition, according to the educators, attendance to their online classes improved during the intervention, even though it remained lower than the number of students enrolled (Table 1). It is worth noting that at School 1 (S1), the students from 1st and 3rd grade practiced with the Educational Psychologist on a voluntary basis outside of school time for 30 min per session, twice a week for three weeks. In 1st and 2nd grade, the students practiced the routine both at the start of each class as well as at the end. According to the teachers, this was viewed by the students as being a reward. Furthermore, during the final week, the students in 1st grade extended their practice sessions to 30 min, while in 2nd and 3rd grade they went from practicing three days a week to five, with some of these sessions lasting for 30 min. At School 2 (S2), the sessions were also extended to 45 min during the final week. According to the teacher, the students requested this in order to ensure that their final presentation of the routine was as good as possible. Furthermore, they also practiced with the Physical Education Teacher during that same week, even though the teacher had not participated previously. The participating teachers were recruited by sending an email invite to the 36 individuals who participated in a previous study on how to plan a physically active academic lesson conducted by Beserra, Nussbaum, Navarrete, and Alvares a few months before the start of the pandemic. Five teachers showed an interest and shared the invite with their colleagues, accepting 6 teachers who had not participated in the previous activity (). It is worth noting that, thanks to the collaboration and knowledge of the five previous participants, all of the teachers in Finally, it is also important to consider that COVID-19 restrictions and school closures were in place for the entire 2020 school year for the district in which this study took place. However, restrictions were relaxed during the final week, allowing people to leave their homes without higher restrictions. This allowed the students to be more active as they were outdoors (). Assessing the experience The parents, students, and educators were invited to participate in a series of online focus groups after the experience. The aim was to understand the participants' perception about the use of physically active academic lessons in online learning during the pandemic, as well as the obstacles they faced. Seven of the ten participating classes took part in the focus groups, with two focus groups held for each class (one with parents and the other with students). Only the teacher at School 3 (S3) was unable to participate with her three 1st grade classes due to personal reasons. Furthermore, an additional focus group was held with all of the educators, giving a total of 15 focus groups. The student focus groups were conducted with three students to ensure the participation of each of them. According to the participating educators, three was the ideal number for carrying out reflection and evaluation activities remotely during the pandemic. It is also worth noting that the students participated voluntarily, answering the call for representatives from each class. Seven people participated in each of the parent focus groups. Participation was also voluntary, with parents signing up when providing their informed consent. In this sense, informed consent was provided before the first practice session, during the (online) parent-teacher meeting of the term. Although the recommended number of participants for a focus group is up to 12 (Turney & Pocknee, 2005), we took into consideration the recommendations made by Lobe, Morgan, and Hoffman and Menary et al. for online meetings and reduced this number to seven. Finally, a special focus group was held with the 11 educators, maintaining the same structure as the meetings that were held during the planning process (see Procedure). The focus groups with the students and parents lasted for between 45 and 70 min, while the focus group with the educators lasted for 90 min. All of the groups were led by the same psychologist so as to ensure consistency, and by one of the researchers. At the start of each focus group, the participants were told that the questions were related to the use of online physically active academic lessons during the pandemic, that there were no right or wrong answers, that any additional information would be welcome, and that the aim was the analysis of the proposal so criticism would be well received as it would help improve the process. Finally, the participants were also asked if the focus group could be recorded for subsequent analysis as part of the research. Regarding the questions asked to each type of participant (i.e., parents, students, and educators), these were ordered according the two research questions (Appendix B); participants were always asked to justify their responses and the best moment was chosen to ask each question based on the flow of the conversation. For the first research question, the parents and students were asked whether they would like the initiative to repeated again in the future, while the educators were asked if they would repeat it with their students. The students and educators were also asked whether they would recommend the initiative to a peer. Finally, all participants were asked about the highlights of the proposal. For the second research question, all of the participants were asked to name any difficulties or barriers that they faced when doing online physically active academic lessons. Data analysis The qualitative data from the focus groups was analyzed in order to understand the participants' perception of the use of online physically active academic lessons during the pandemic, and identify the difficulties and barriers faced during the activity. To do so, the psychologist and accompanying researcher shared their detailed notes at the end of each focus group so as to reduce any interpretation bias (Elliott, Fischer, & Rennie, 1999). Following this, the recording from each focus group was transcribed word for word, together with the notes from the psychologist and accompanying researcher. The transcripts were read several times by two of the researchers so as to have a general understanding of the data. Following this, they were then independently () and thematically (Braun & Clarke, 2006) analyzed by the two researchers. Once any patterns had been identified, the results were organized by theme based on the research questions. After this, the researchers then met to share and discuss their analysis so as to consolidate their work. Any disagreement was resolved by discussing and reaching a consensus. Furthermore, in order to ensure that the themes were strongly linked to the data, the researchers also searched for any contrary evidence in the collected data but failed to find any. The reliability of the analysis is supported by the peer-review process and the constant dialogue between the researchers ; as well as by the use of extracts from the data to show how the information has been interpreted (Braun & Clarke, 2006). This serves to reinforce the reliability and transparency of the study. Finally, it is worth noting that, following analysis of the data, the extracts were then translated from Spanish to English. Ethical considerations The procedures followed during this study adhere to the guidelines set out by the Declaration of Helsinki and were approved by University of Tarapac a Ethics Board. Results and discussion The results are organized around the two research questions. With regards to the first research question (What were the teachers', students', and parents' perceptions of the use of online physically active academic lessons during the pandemic?), five themes emerged from the representative comments collected during the focus groups (for further comments see Appendix C). These themes were the following: Mathematics Learning Outcomes, Student Satisfaction, Increased Physical Activity, Student Participation and Collaborative Work. A description of each theme is provided below, interweaving the comments from the focus groups with references from the literature. Mathematics Learning Outcomes The activity managed to develop the expected knowledge of mathematics, i.e., the ability to identify geometric shapes in their environment and describe them using mathematical terminology. One of the parents shared the following: "My daughter was going around looking at everything. She'd see the dining table and say 'it's oval', see a window and say 'it's a rectangle', see the door and so on". Similar experiences were also described by the students. One of them said that "The end of the dance was the most fun part when we made the squares and rectangles, but had to jump and then crouch down quickly". This is consistent with the work of An et al., who described how dance routines can be used to develop mathematical concepts using different representations and communication strategies. Furthermore, linking mathematical knowledge with sensorimotor metaphors based on the human body and its movements can help transform such knowledge into something more tangible and accessible for the students (). Similarly, the teachers also described the how the students developed the expected knowledge of mathematics. One of them claimed that "We had no idea of the potential of this activity. It met the revised objectives of the new prioritized curriculum and also promoted increased student participation in physical activity". Indeed, learning gains of this kind are a common outcome when incorporating physically active academic lessons into the regular (face-to-face) school routine (see the systematic reviews by ;Martin & Murtagh, 2017b; and the metaanalysis by ). This is especially true in the case of mathematics (;). Student satisfaction The positive feelings experienced during the activity were predominant. One parent suggested that "He laughed so much, he really enjoyed it! The laughter, the giggling, that's what got my attention the most, unlike in other classes, he had a good time", while another claimed that "I could see my son and the other kids were really motivated. Like they'd be eager for it to be that class". Similarly, the teachers suggested that the students were much happier, more interested and more motivated than usual. One teacher said "I think everything we did was really positive. The students were more motivated during the classes; for them, it was gratifying". Accordingly, the students also described how satisfying it was to participate in the activity. One of them said "It was really fun using our bodies and making shapes with them. Also, learning about new, fun shapes". From these comments, we can see that the parents and teachers were surprised at the level of satisfaction among the students (for more comments, see Appendix C). This finding is consistent with previous studies, where teachers mention that the use of physically active academic lessons increase students' motivation for learning (;). Increased physical activity The participants suggested that there had been an increase in the amount of physical activity done by the students during class, thus reducing sedentarism during the pandemic. One parent shared "We've been so sedentary this year, they have been able to exercise quite a bit during the sessions. They jumped, danced around, and weren't just sat in front of the computer the whole time". The students also appreciated the increased level of physical activity. One of them said "I really liked it because it helped us learn about the topic and also do a bit more exercise". In line with the above, the teachers acknowledged an increase in the opportunities given to the students to do physical activity which is one of the curricular objectives of Physical Education (MINEDUC, 2020e). Indeed, the increase in levels of physical activity is a direct and frequently-documented consequence of integrating physically active academic lessons into the school routine Martin & Murtagh, 2017b;) This is particularly important if we consider that, for many families, it was difficult to motivate their children to stay physically active during lockdown (). The teachers also showed an interest in conducting similar interventions since they indicated the importance to promote both learning and physical activity, especially during the pandemic. One of them said "Articulating these two subjects allowed us to increase the time dedicated to physical activity and learning math. We'll have to do it again with other subjects". The benefits to students of using physically active academic lessons, as perceived by their teachers, is one of the reasons that lead teachers to continue to use them (). This is consistent with Mercier et al. who suggest that while online classes continue, we need to find ways to meet the objectives of the Physical Education curriculum. Student participation Student participation changed over the course of study. One of the teachers suggested that "The activity helped the students change their attitude towards online classes. As the activity went on, started to turn their cameras on and participate more in the class". Students are more likely to participate in activities that are interesting, fun and enjoyable (). Such characteristics are particularly important during a pandemic (Yates, Starkey, Egerton, & Flueggen, 2021), and in this study, students found the intrinsic motivation necessary to drive their participation in online physically active academic lessons. Another teacher highlighted that "We practiced at the start of every math class, and I could see how the classes were much more productive. The children were much more interested in learning. The students really did have a different attitude towards participating in class". Starting classes with physically active academic lessons helps achieve the expected learning outcomes as it fosters student participation, motivation and interest (). Accordingly, the parents also described an increase in levels of attention, and participating in class, which was not common before this experience. One parent said "My son doesn't really like math, but he seemed excited about this Project and participated during class, asking questions and paying attention to the teacher". Physically active academic lessons promote and maintain student attention (Routen, Johnston, Glazebrook, & Sherar, 2018), participation (;), and reduce off-task behavior (). Collaborative work The students and parents agreed on how gratifying it was to be participating in collaborative group activities again. One parent shared "For my son, it was really gratifying being able to practice with his classmates, not in the same place, but at least in the same virtual space, which got him engaged and motivated, so he enjoyed it more and learned". The physically active academic lessons provided the students with opportunities to talk and cooperate, thus strengthening their collaborative skills (;;ien & Solheim, 2019). As one of the teachers suggested, "The activity was good for encouraging collaborative work, leaving competition to one side. For me, this is the hardest skill to work on with the children". Similarly, the activity encouraged an emotional bond between the participants, improving the classroom environment. One student said "I liked it because we were dancing and learning. And we were also spending time together, dancing as a whole class". Having opportunities to collaborate is an important aspect of the students learning experience during homeschooling (). Together with the physically active academic lessons, such opportunities helped improve the social climate and group cohesion (). Finally, it is important to note that, there is a certain belief about how the collaborative work (i.e., having a shared goal, learning, laughing, and having fun with peers and teachers) also fostered student participation and satisfaction. One parent said "I am grateful that the school proposes an activity that allows group participation; it is much more bearable for the children", while another said "They missed each other, and, finally, seeing each other there, dancing together, was entertaining". Other findings One finding that would appear to be unique in the literature is that some parents suggested that the level of burden and responsibility with regards to their child's learning actually decreased during the intervention. One of the parents highlighted how "She (her daughter) was really worried about making her video, about having to practice. She'd close herself in her room because she said she had to learn the steps, that it had to be coordinated, that she had to do it all really well. I didn't have to tell her anything!". Accordingly, the parents attributed this change to the improved levels of student satisfaction and participation during the activity. This is particularly relevant given that education at home requires parental support (Pokhrel & Chhetri, 2021). In this sense, one parent commented that "Before, I'd spend all my time helping my son do his work, build models, things like that. But with this activity he did it all by himself. He practiced, attended class, learned what the shapes were like, all by himself". During the pandemic, parents had to juggle working from home with supporting their children (). Reducing this burden may therefore have helped parents overcome this challenge. This reduced burden is reflected in different comments made by the students, including the following "I also did it all by myself, my mum just gave me the broomstick". Finally, the parents' perceptions were in line with the teachers', who suggested that the students were more punctual and that attendance improved during the activity. One of the teachers said "In my class, attendance improved. There were a few kids who were inconsistent, whose parents would say 'they have trouble getting out of bed early'. But we started practicing and they'd come every day". Another relevant finding was the level of parental and family involvement during the intervention. The participants described how family members would practice the dance routine with the children and highlighted how fun and emotionally significant this was. One parents commented how "It was more fun and dynamic than other classes. For my daughter is was just learning while playing. We practiced every day. And, of course, we had get it wrong and laughed. It was a nice experience because we could do it together". Meanwhile, one of the students claimed that "The best part was the dancing because I'd practice with my brother and my mum and when we didn't get it right we'd laugh". Facing and overcoming the challenges of online learning during times of COVID-19 can reinforce a sense of community and cohesion among family members (Fegert, Vitiello, Plener, & Clemens, 2020). One of the teachers highlighted the fact that " It was more fun for the families, because they didn't have to reinforce what we'd studied in class by sitting and talking, or going over notes. Instead they had to move about. That brought the families closer to the school, and closer to each other, too". Ultimately, physical activity can help families better tolerate the pandemic, both mentally as well as physically (Amatriain-Fern ). Parental support of student learning during the pandemic has varied in both its scope and degree. This depends on several factors, including the family (). For example, when there was less family participation than in the cases described above. One student said "My mum helped me; I mean, she'd watch as I danced and reminded me what I had to do", while another said "My mum helped me cover things to record ". This is an important factor as physically active academic lessons allow for shared experiences between educators, parents, and students in a collaborative space (ien & Solheim, 2019). In summary, we can see that the participants were able to identify the main benefits of integrating physical activity with curricular content, as described in the literature. The success of a physically active academic lesson depends primarily on their actions (). Furthermore, the parents' positive perception is also relevant as this has been considered a potential barrier (;;;). Future research should look to determine whether or not the parents' positive perception is related exclusively to the use of online active academic lessons or some other characteristic of the intervention. With regards to the second research question (What difficulties or barriers were identified by teachers, students, and parents throughout the use of online physically active academic lessons during the pandemic?), barriers (themes) emerged from the comments taken from the focus groups, which are analyzed next. Digital divide (internet access) Problems with connectivity became more evident during the activity. The digital divide in terms of Internet access, is a key barrier when it comes to successfully implementing educational technology strategies (Gil-Flores, Rodrguez-Santero, & Torres-Gordillo, 2017) and was a difficulty that was faced when implementing physically active academic lessons during online teaching. One of the parents suggested that "The only bad thing is that where we live the signal is terrible. I'm lucky to be connected now. That was really frustrating for my son! There were days when he couldn't follow the class". This is consistent with the poor quality of group video calls experienced by users in Chile during 2020 due to problems with bandwidth. Additionally, the participating teachers expressed that, sometimes, the audio, the instructions, or the video were intermittent, or simply could not be heard/seen. One of them shared that "I found that the children would hear the instructions cut off. I had to repeat them and we'd waste a lot of time". This is consistent with the connectivity issues that were experienced during the pandemic, which were a challenge for teachers and students in Ireland (Scully, Lehane, & Scully, 2021), Spain (Palau, Fuentes, Mogas, & Cebri an, 2021), Chile, and other countries (Burgess & Sievertsen, 2020). The teachers also described how, many times, due to unstable internet speeds, it was difficult for the students to be synchronized during the dance routines. "For me, the main difficulty was the Internet. It'd happen a lot that a child's screen would freeze, or ours would. And then we couldn't see what we were doing". Lack of access to a quality Internet connection and suitable technological equipment are a barrier that has been repeatedly documented in the literature (Cabello, Claro, Rojas, & Trucco, 2021;;). Even though Chile has some of the most affordable access to internet in the region (International Telecommunication Union, 2021), there is still significant inequality when it comes to access (;Le on & Meza, 2018). This is especially worrying when considering that educational alternatives without Internet access at home are somewhat limited (). Suitable physical space The lack of enough physical space for doing the activity meant that some students were not able to move freely during the dance, which may have affected their satisfaction. One of the teachers said "I have students who live in apartments, so in order to not bump into anything or anyone, some of the students wouldn't do the dance as enthusiastically as they'd have liked". Similarly, one of the parents suggested that "My daughter didn't have any more space than her room. She'd start to do the dance and bash into things to practice and record the video we had to make some space". The teachers described how the lack of physical space meant that some parts of the students' bodies could not be seen, while with students in larger spaces it was hard to accurately distinguish their movements. One of them described how " students with lots of space would go really far back and you couldn't see what they were doing". Having a suitable environment for learning at home was not a reality for students of all levels of socioeconomic status (Pokhrel & Chhetri, 2021). Finally, it is worth noting that the students did not explicitly highlight problems relating to physical space as being a barrier. However, they did describe some situations in which a lack of space may have been an inconvenience. One of them said "My mum helped me do literally everything. She gave me the stick, she helped me move the bed and the bedside table every day". Having limited physical space reduces the likelihood of students being physically active during quarantine (Amatriain-Fern ). Unsuitable physical space has also been systematically described in the literature on physically active academic lessons (;;) as well as in the literature on Physical Education classes (online: ;;;and face-toface: Lawson, 2019). Given the heterogeneity of students' homes, it is important to consider alternative spaces to carry out such activities online; as in schools, this consideration might include the corridors, staircases and green spaces for physically active academic lessons (). Developing motor skills The participants suggested that, initially, some students were not able to follow the dance routine and had to repeat it a number of times in order to get it right. One parent shared that "What was hard for us , I mean, hard for my son, was coordinating his hands, feet and the stick". Similarly, one student commented that "At the beginning it was a little hard to learn the dance. I found it really difficult, but really it was quite easy once I'd learned". While a classmate suggested the difficulty " was coordinating the steps and the hands with the music, but my mom helped me". Developing motor skills is one of the curricular objectives during the first years of school (Oate ). This was an objective that was prioritized within Physical Education during the pandemic (MINEDUC, 2020e). However, school closures probably affected students' development of such skills (;Pombo, Luz, de S a, Rodrigues, & Cordovil, 2021). In this sense, one of the teachers shared that "We found motor coordination quite difficult, not all of them are the same, but that was to be expected, given their age and that they're all 'trapped' in their houses". This is particularly concerning as the development of motor skills during early childhood is an important part of the preventative measures that can be taken to combat sedentarism (Greier & Drenowatz, 2018). Digital divide (skills and use) Some parents mentioned that they did not have the necessary skills for recording or sending the video. They suggested that their children were the ones who had the necessary skills and, therefore, were responsible for said process. One of the parents shared that "My daughter is better with technology than me. She makes TikTok videos, so she had a ring light to record herself. So she did it all". Similarly, one of the teachers described how "Some parents found it difficult to record or send the video. They didn't know how to do it, they had a lot of trouble doing it". This is consistent with the digital divide in Chile, where 24.5% of the adult population are at the lowest level in terms of Internet skills and use (Cort ). It is therefore unsurprising that this should emerge as a barrier. However, the teachers suggested that said difficulties could be seen throughout the whole academic year, not just during this activity. It is important to note that Internet use varies among countries. While 87% of the population in developed countries were using the Internet in 2019, this figure was just 19% in less developed countries (International Telecommunication Union, 2021). Similarly, almost 3.7 billion people across the world are still not connected (International Telecommunication Union, 2021). Here, it is worth noting that there are several sociodemographic factors that affect Internet use. This includes level of income, education, gender, geographical location (urban vs. rural), and the presence of schoolaged children in the home. Student embarrassment Some students felt embarrassed. One of the students shared how "Some of my classmates said they didn't know how to dance, that they didn't like to dance or that they were embarrassed. But I like it". Embarrassment has previously affected student motivation during Physical Education classes, as well as their intentions to be physically active (Trigueros, Aguilar-Parra, Cangas, L opez-Liria, & Alvarez, 2019). Although expected, this did not stop them from participating in the group recording or during the online practice sessions. Instead, it affected the recording of the students' own videos. One of the parents mentioned that "Getting her to do the individual video was difficult. She was really embarrassed, but it wasn't like that when she was dancing with the rest of the class , because when she saw her classmates doing it she was more enthusiastic". Embarrassment of being in front of a camera has also been previously identified as being a barrier to successful learning in non-face-to-face settings (Estela ;;Kozar, 2016). Faced with this challenge, the parents suggested changing this from an individual video to a video in which other members of the family could participate. One parent suggested that "It would have been more spontaneous if I'd have danced with her, and as my sisters (i.e. the student's aunts) were there too, they could dance as well. We could all have danced with her, maybe it would've been easier and less embarrassing for her". Similarly, another said "I think it would have been better, or more spontaneous, if, for example, I'd have danced with her and left the phone recording on its own. Then she wouldn't have been so worried about 'me recording her', maybe that would have been better". According to the parents, this would help the students feel less embarrassed. One parents suggested that "When it came to recording him on his own it was difficult, my youngest son wanted to participate and the older brother was embarrassed. We had to record it together and then separately, it was twice the work". Other barriers One barrier that would appear to be a finding that has not previously been reported in the literature was the students' devices reflecting the image like a mirror. According to the educators, certain devices showed a mirror image of the students' video, known in optics as a virtual image (Ting, Tai, Tseng, & Tsai, 2018). This caused confusion among the participants during the practice sessions. Indeed, when a certain group of students moved in one direction, their classmates would see them moving in the opposite direction. One of the teachers described how "We could tell clearly who had a tablet, a computer or a smartphone. The phones and tablets reflected the student's image, and we'd see all their movements going to the other side". Although this issue provided an opportunity to talk about symmetry, it may also have impacted negatively on student satisfaction as it interrupted the activity. This is reflected in the following comment by one of the students: "Some of us used our left hand instead of our right for drawing the circumference with the stick, some turned to the right , while others turned to the left ; it was really difficult to coordinate everyone". Teachers are not free from the influence of their surroundings. One of the teachers suggested that "The exchanging of experiences was fantastic. Those stories saved me more than one problem. They helped keep me motivated, I wasn't the only one with these difficulties, and how I solved them might help others". Accordingly, another teacher commented that "We've learned to work as a multidisciplinary team, to overcome obstacles as a team, to learn from each other's difficulties". For the teachers, this sort of teamwork allowed them to acknowledge different barriers when it comes to teaching physically active academic lessons. By acknowledging such barriers, they were then able overcome the challenges, increasing the probability of success (). In this sense, we can highlight the following teacher comment "As a group, we were able to anticipate different challenges of introducing this into the classroom. We all saw how we're able to work collaboratively and that it doesn't matter whether it's face-toface or online, we'll adapt to the context and overcome any difficulties". Surprisingly, some of the barriers described systematically in the literature were not identified by the participants. First, the additional time required for planning (;;ien & Solheim, 2019); it is important to remember that the activity was planned and carried out by a group of teachers, which probably reduced the amount of time each teacher spent planning individually. Second, student performance on standardized tests (;); no national tests were administered during the pandemic MINEDUC, 2020h and the amount of curricular content and number of learning objectives were reduced (MINEDUC, 2020f, 2020e). Surprisingly, the parents were also not concerned about their children's performance. Third, the difficulty of getting students to concentrate at the end of the activity (;Martin & Murtagh, 2017a;); this was probably countered somewhat by the support and presence of the parents during the activity, as well as by the students' own satisfaction. Conclusions This article provides a view of how teachers, students, and parents positively perceived the use of online physically active academic lessons during the pandemic. The results show that the participants were able to identify the main benefits of such lessons that have been previously described in the literature. They were also able to identify a number of barriers. This included certain widely-acknowledged barriers relating to online learning, as well as others linked more directly to doing physical activity at home. The findings in this study reinforce the idea that, regardless of their format (i.e., face-to-face or online), physically active academic lessons are a valid strategy for increasing levels of physical activity without sacrificing time spent on learning. Furthermore, they also reinforce the idea that physically active academic lessons improve learning, relationships, and enjoyment, not just among students, but among teachers, parents, and other family members, too. It is worth noting that this study is the first to describe such results of using physically active academic lessons within the context of online learning. Finally, despite the promising results reported here, it is worth considering certain limitations of this study. This includes the small sample size, as well as the ethnic and gender distribution of the participants, all of which are key characteristics when it comes to generalizing the results. Another limitation is the lack of a control group, as well as any assessment of student knowledge. Including these would help accurately determine the pedagogical impact of this study. It is worth noting that a control group was not included as the aim was to assess the feasibility of using physically active academic lessons in online teaching. Furthermore, no student assessments were included on the request of the teachers, who did not want to expose the students to any additional stress or anxiety while in lockdown. Another limitation is the use of a single topic that is not directly related to Physical Education for these physically active academic lessons (i.e., geometry). This may have affected learning outcomes, student satisfaction, increased physical activity, and participants' perception. Including additional topics (from Mathematics, Physical Education or other sciences), and incorporating them into one or more dance routines, would be one way of overcoming this limitation. A further limitation was the short duration of the intervention. Extending the duration would probably allow students to identify additional benefits and barriers when it comes to the use of online physically active academic lessons. Similarly, it is important to increase the number of students and parents who are interviewed as this would also allow us to unearth more findings. Furthermore, it is important to consider the inherent limitation of the data that was analyzed. All data was reported by the parents, students, and teachers, with social convenience and/or memory bias possibly impacting the results. It remains as future work to develop a proposal to determine whether or not there is an exclusive relationship between the results reported here, the collaborative work carried out by the educators, and the conditions in which the study took place (i.e., a global pandemic). To do so would require a large sample, with a more diverse range of teachers and schools, a reliable assessment of student knowledge, control groups and larger focus groups. Finally, future studies should also consider determining the optimum duration and intensity of physically active academic lessons to accomplish proposed objectives during online teaching.
|
Handling Contraceptive Acceptors Complaints by Using Android-Based Application INTRODUCTION: Contraception is a method which used to prevent pregnancy and to reduce the maternal mortality, particularly in 4T condition; too young to give birth, too often to give birth, too close in spacing between births, and too old to give birth. However, the number of Drop Out from contraceptive in Indonesia is still high due to the concern of contraceptive acceptors about the side effects of contraception and the inaccuracy of re-injection schedule causing the acceptors to stop using contraception. Conventional method has been used by publics to manage the contraception for a long time. In this case, conventional method has been used to deal with the side effects of contraceptive use. By using the conventional method, the acceptor must visit the public health to consult their complaints to a midwife. Moreover, midwife will give the family planning control card to the acceptor which involves re-injections schedule. However, many acceptors do not come to do re-injection as the schedule because they do not have an automatic reminder to remind them. Thus, the researcher interested to create a contraceptives application in order to help the acceptors managing their schedule. MATERIAL & METHODS: This study employed comparative method to find out the comparison on the attitude of contraceptive acceptors in solving the problems by using the Smart Contraception application and conventional method. By using purposive sampling technique, 44 respondents were chosen in this study. The respondents were divided into two groups involving 22 respondents who used Smart Contraception application and 22 respondents who used conventional method. Then, the data were analyzed by using Chi-square test. RESULTS: The result of the study showed that the use of Smart Contraception application was better than conventional method in handling the problems experienced by contraceptive acceptors. The statistical result on the attitude of contraceptive acceptors in handling the problems of contraception shows p-value 0.026 (<0.05) and p-value 0.023 (<0.05) on the accuracy of re-injection schedule, which means that there was difference between the use of Smart Contraception application and conventional method. CONCLUSION: There was difference between the use of Smart Contraception application and conventional method. Furthermore, the use of Smart Contraception was better than conventional method in handling the problems experienced by contraceptive acceptors.
|
import matplotlib.pyplot as plt
import numpy as np
import random
import mplcyberpunk
data = np.linspace(0, np.pi, 1000)
def heartbeat(data, life = True):
alive = [i + random.uniform(-0.01, 0.01)
if -0.1 < i < 0.1 and k % 10 == 0 else i for k, i in
enumerate(8*np.sin(data + 1.5) * np.sin(data)**63)]
dead = [0] * len(data)
return alive if life else dead
def draw(data, response, color):
plt.style.use("cyberpunk")
fig = plt.figure(frameon=False)
ax = plt.Axes(fig, [0., 0., 1., 1.])
ax.set_axis_off()
fig.add_axes(ax)
ax.plot(data, response, c=color)
ax.scatter(data[-1], response[-1], s=40 ,c=color)
mplcyberpunk.make_lines_glow()
plt.show()
draw(data, heartbeat(data), "lightblue")
draw(data, heartbeat(data, life=False), "lightblue")
|
/**
* Switches between different instances of {@link Fotoapparat}. Convenient when you want to allow
* user to switch between different cameras or configurations.
* <p>
* This class is not thread safe. Consider using it from a single thread.
*/
public class FotoapparatSwitcher {
@NonNull
private Fotoapparat fotoapparat;
private boolean started = false;
private FotoapparatSwitcher(@NonNull Fotoapparat fotoapparat) {
this.fotoapparat = fotoapparat;
}
/**
* @return {@link FotoapparatSwitcher} with given {@link Fotoapparat} used by default.
*/
public static FotoapparatSwitcher withDefault(@NonNull Fotoapparat fotoapparat) {
return new FotoapparatSwitcher(fotoapparat);
}
/**
* Starts {@link Fotoapparat} associated with this switcher. Every new {@link Fotoapparat} will
* be started automatically until {@link #stop()} is called.
*
* @throws IllegalStateException if switcher is already started.
*/
public void start() {
fotoapparat.start();
started = true;
}
/**
* Stops currently used {@link Fotoapparat}.
*
* @throws IllegalStateException if switcher is already stopped.
*/
public void stop() {
fotoapparat.stop();
started = false;
}
/**
* Switches to another {@link Fotoapparat}. If switcher is already started then previously used
* {@link Fotoapparat} will be stopped automatically and new {@link Fotoapparat} will be
* started.
*
* @param fotoapparat new {@link Fotoapparat} to use.
* @throws NullPointerException if given {@link Fotoapparat} is {@code null}.
*/
public void switchTo(@NonNull Fotoapparat fotoapparat) {
if (started) {
this.fotoapparat.stop();
fotoapparat.start();
}
this.fotoapparat = fotoapparat;
}
/**
* @return currently used instance of {@link Fotoapparat}.
*/
@NonNull
public Fotoapparat getCurrentFotoapparat() {
return fotoapparat;
}
}
|
import pytest
from list_utils import *
from oracle import ColumnRecommendation, ColumnClassification
def test_find_one():
needle = 1
none = [0, 0, 5, 's']
beginning = [1, None, 9, 6, 0, 0]
end = ['x', '0', 1]
several = [0, 0, 3, 4, 1, 3, 2, 1, 3, 4]
assert find_one(none, needle) == False
assert find_one(beginning, needle)
assert find_one(end, needle)
assert find_one(several, needle)
def test_find_n():
assert find_n([2, 3, 4, 5, 6], 2, -1) == False
assert find_n([1, 2, 3, 4, 5], 42, 2) == False
assert find_n([1, 2, 3, 4, 5], 1, 2) == False
assert find_n([1, 2, 3, 2, 4, 5], 2, 2)
assert find_n([1, 2, 3, 4, 5, 4, 6, 4, 7, 4, 6], 4, 2)
assert find_n([1, 2, 3, 4], 'x', 0) == True
def test_find_streak():
assert find_streak([1, 2, 3, 4, 5], 4, -1) == False
assert find_streak([1, 2, 3, 4, 5], 42, 2) == False
assert find_streak([1, 2, 3, 4], 4, 1)
assert find_streak([1, 2, 3, 1, 2], 2, 2) == False
assert find_streak([1, 2, 3, 4, 5, 5, 5], 5, 3)
assert find_streak([5, 5, 5, 1, 2, 3, 4], 5, 3)
assert find_streak([1, 2, 5, 5, 5, 3, 4], 5, 3)
assert find_streak([1, 2, 3, 4, 5, 5, 5], 5, 4) == False
def test_first_elements():
original = [[0, 7, 3], [4, 0, 1]]
assert first_elements(original) == [0, 4]
def test_transpose():
original = [[0, 7, 3], [4, 0, 1]]
transposed = [[0, 4], [7, 0], [3, 1]]
assert transpose(original) == transposed
assert transpose(transpose(original)) == original
def test_zero_distance_displace():
l1 = [1, 2, 3, 4, 5, 6]
l2 = [1]
l3 = [[4, 5], ['x', 'o', 'c']]
assert displace([], 0) == []
assert displace(l1, 0) == l1
assert displace(l2, 0) == l2
assert displace(l3, 0) == l3
def test_positive_distance_displace():
l1 = [1, 2, 3, 4, 5, 6]
l2 = [1]
l3 = [[4, 5], ['x', 'o', 'c']]
l4 = [9, 6, 5]
assert displace([], 2) == []
assert displace(l1, 2) == [None, None, 1, 2, 3, 4]
assert displace(l2, 3, '-') == ['-']
assert displace(l3, 1, '#') == ['#', [4, 5]]
assert displace(l4, 3, 0) == [0, 0, 0]
def test_negative_distance_displace():
l1 = [1, 2, 3, 4, 5, 6]
l2 = [1]
l3 = [[4, 5], ['x', 'o', 'c']]
l4 = [9, 6, 5]
assert displace([], -2) == []
assert displace(l1, -2) == [3, 4, 5, 6, None, None]
assert displace(l2, -3, '-') == ['-']
assert displace(l3, -1, '#') == [['x', 'o', 'c'], '#']
assert displace(l4, -3, 0) == [0, 0, 0]
def test_reverse_list():
assert reverse_list([]) == []
assert reverse_list([1, 2, 3, 4, 5, 6]) == [6, 5, 4, 3, 2, 1]
def test_reverse_matrix():
assert reverse_matrix([]) == []
assert reverse_matrix([[0, 1, 2, 3], [0, 1, 2, 3]]) == [
[3, 2, 1, 0], [3, 2, 1, 0]]
def test_all_same():
assert all_same([9, 1, 2, 3, 4]) == False
assert all_same([[], [], []])
assert all_same([])
assert all_same([ColumnRecommendation(0, ColumnClassification.WIN),
ColumnRecommendation(2, ColumnClassification.WIN)])
assert all_same([ColumnRecommendation(0, ColumnClassification.MAYBE),
ColumnRecommendation(0, ColumnClassification.WIN)]) == False
def test_collapse_list():
assert collapse_list([]) == ''
assert collapse_list(['o', 'x', 'x', 'o']) == 'oxxo'
assert collapse_list(['x', 'x', None, None, None]) == 'xx...'
def test_collapse_matrix():
assert collapse_matrix([]) == ''
assert collapse_matrix([['x', 'x', None],
['o', 'x', 'x'],
['o', None, None]]) == 'xx.|oxx|o..'
def test_replace_all_in_list():
assert replace_all_in_list([None, 3, '546', 33, None], None, '#') == [
'#', 3, '546', 33, '#']
assert replace_all_in_list([1, 2, 3, 4, 5], 'e', 42) == [1, 2, 3, 4, 5]
assert replace_all_in_list([], 34, 43) == []
def test_replace_all_in_matrix():
# caso normal: tiene lo viejo
assert replace_all_in_matrix([[1, 2, 3, 'n', 'n', None],
[4, 5, 'n']], 'n', '#') == [[1, 2, 3, '#', '#', None], [4, 5, '#']]
# caso raro: no tiene lo viejo
assert replace_all_in_matrix([[None, None, 2, True], [4, 5, '#']], 'k', 42) == [[
None, None, 2, True], [4, 5, '#']]
# caso más raro: lista de listas vacías
assert replace_all_in_matrix([], None, 7) == []
assert replace_all_in_matrix([[], []], None, 7) == [[], []]
|
Inhibitory effects of Vitamin E on UVBinduced apoptosis of chicken embryonic fibroblasts Apoptosis research has been focused on several model species in the past decades, whereas studies concerned with nonmammalian vertebrate, particularly birds, have rarely been involved. In accord with requirements to expand the biodiversity of apoptotic research, a chicken embryonic fibroblasts model involving UVB (ultraviolet B) as the death stimulus was established through primary explantation and serial passage. Myriads of antioxidants can inhibit UVBinduced apoptosis by virtue of scavenging reactive oxygen species. To improve our understanding of the possible antiapoptotic effects and mechanisms of Vitamin E against UVBinduced apoptosis in chicken embryonic fibroblasts, cells treated with Vitamin E after UVB irradiation were stained with AO/EB and Fluo3/AM to visualize chromatin distribution and calcium homoeostasis, respectively. They were also analysed by flow cytometry to detect mitochondrial transmembrane potential, and cell cycle progression and apoptotic rates were recorded. RTPCR was used to analyse the expression of some apoptosisrelated genes. Typical apoptotic events, including cell shrinkage, blebbing and nuclear condensation, occurred after radiation. In the presence of Vitamin E following irradiation, apoptotic cells were reduced. Ca2+ release was temporarily prevented, and cell cycle arrest at S/G2 checkpoint had almost completely reverted to normal. fas decreased, while procaspase3 remained nearly unchanged with and without Vitamin E, and bcl2/bax ratio was upregulated, indicating possible antiapoptotic mechanisms through the mitochondrial pathway. This new investigation of an apoptosis model involving chicken embryonic fibroblasts expands the database of knowledge across a wider spectrum of vertebrate species.
|
APPLICATION OF THE MODEL INQUIRY LEARNING FOR EFFORTS TO IMPROVE ENGLISH LEARNING ACHIEVEMENT (A Case Study in Class XII IPA-3 MAN 2 Students in Odd Semester Academic Year 2019/2020) This research is intended to describe the Inquiry Learning (IL) Model in order to improve students' English learning achievement. The purpose of this study was to determine whether there was an increase in the English learning achievement of students in class XII IPA-3 Madrasah Aliyah Negeri 2 Pati, in the Odd Semester of the 2019/2020 Academic Year. The research subjects were 36 students of class XII IPA-3 Madrasah Aliyah Negeri 2 Pati. The research variables consisted of student variables (students' ability to solve questions) and teacher variables (planning and implementing learning by teachers in the classroom). The research was conducted in two cycles and each cycle consisted of four stages, namely: planning, implementing, observing and reflecting. Success indicators are determined when at least 75% of students achieve learning completeness after the Inquiry Learning (IL) Model is applied. From the research results, it was found that there was an increase in students' English learning achievement as indicated by: the average student achievement in cycle I was 7.29, cycle II was 7.49 and cycle III cycle III was 8.81 ; in the first cycle there were 22 students or 61.11% who completed the study; and those who did not complete were 14 students or 38.89%; in cycle II there were 26 students or 72.22% complete learning; and students who did not complete there were 10 students or 27.78%; and in cycle III there are 36 students or 100% complete learning; and there are no students who do not complete; and completeness of classical learning in the first cycle is 61.11%; in cycle II classical completeness became 72.22%; while in cycle III it reached 100.00%. This means that the competency test / evaluation results in cycle I, cycle II and cycle III always increase. There is an increase in student activity during the learning process, both individually and in groups. Student response to the implementation of the Inquiry Learning (IL) Model is 85.22% (strongly agree or in the very high category.
|
package models;
/**
* Created by wora on 3/6/16.
*/
public class Person implements Cloneable{
int id;
String name;
String surname;
String gender;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSurname() {
return surname;
}
public void setSurname(String surname) {
this.surname = surname;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
@Override
public String toString() {
return "Person{" +
"id='" + id + '\'' +
", name='" + name + '\'' +
", surname='" + surname + '\'' +
", gender='" + gender + '\'' +
'}';
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj == this) return true;
if (!(obj instanceof Person)) return false;
Person o = (Person) obj;
return o.id == this.id;
}
@Override
public Object clone() throws CloneNotSupportedException {
return super.clone();
}
}
|
Predicting User Acceptance and Continuance Behaviour Towards Location-based Services: The Moderating Effect of Facilitating Conditions on Behavioural Intention and Actual Use The purpose of this study is to establish and examine the significance of a consumer acceptance and continuance model for location-based services (LBSs) through the integration of perceived entertainment gratification (PEG) and perceived application quality (PAQ) with the technology acceptance model (TAM). By arguing that behavioural intention (BI) does not automatically lead to actual use (AU), we investigated the moderating effect of facilitating conditions (FC) on the relationship between BI and AU. A quantitative study was conducted in Australia and Bangladesh; data were obtained from multiple sources by systematic sampling of the distribution of questionnaires. For data analysis we applied the partial least square (PLS) method. The results indicate that, in both Australia and Bangladesh, perceived usefulness (PU), PEG and PAQ have significant influence on user attitude (UA), which has a subsequent effect on BI. Interestingly, perceived ease of use (PEoU) does not have a direct effect on UA but indirectly influences it through PUconfirming the mediating effect of PU. Further, FC has a moderating effect between BI and AU. The implications of these findings and directions for future research directions are also discussed.
|
import random
# Jogo de Craps. Faca um programa de implemente um jogo de Craps. O jogador
# lanca um par de dados, obtendo um valor entre 2 e 12. Se, na primeira jogada,
# voce tirar 7 ou 11, voce tirou um "natural" e ganhou. Se voce tirar 2, 3 ou
# 12 na primeira jogada, isto e chamado de "craps" e voce perdeu. Se, na
# primeira jogada, voce fez um 4, 5, 6, 8, 9 ou 10,este e seu "Ponto". Seu
# objetivo agora e continuar jogando os dados ate tirar este numero novamente.
# Voce perde, no entanto, se tirar um 7 antes de tirar este Ponto novamente.
# Dica: para simular o lancamento do dado, utilize o metodos Random do Python.!
def lancar_dados():
return random.randint(2, 12)
entrada = ""
jogada = 0
ponto = 0
print "digite \"sair\" para sair (sem aspas)\naperte <enter> para rolar os dados: "
while (entrada!="sair"):
jogada += 1
print "Jogada {}".format(jogada)
entrada = raw_input("Esperando acao: ")
if entrada == "sair":
print "Saindo do jogo... Tchau"
else:
if jogada>1:
print "Seu ponto e {}".format(ponto)
valor = lancar_dados()
print "O valor do dado e {}\n\n".format(valor)
if jogada == 1:
if valor == 7 or valor == 11:
print "Voce tirou um natural e ganhou, PARABENS"
exit()
elif valor == 2 or valor == 3 or valor == 12:
print "Voce tirou um craps e perdeu, melhor sorte da proxima vez"
exit()
else:
ponto = valor
else:
if valor == 7:
print "Voce tirou um 7 antes de repetir seu ponto, voce perdeu"
exit()
elif ponto == valor:
print "Voce conseguiu repetir seu ponto e ganhou, Parabens"
exit()
|
import { Reducer } from 'redux';
import ACTIONS from './actionList';
interface AppState {
isSenderAccountValid: {
success: any;
error: any;
};
isReceiverAccountValid: {
success: any;
error: any;
};
sendTransactionStatus: {
success: any;
error: any;
};
}
const APP_INITIAL_STATE: AppState = {
isSenderAccountValid: null as any,
isReceiverAccountValid: null as any,
sendTransactionStatus: null as any,
};
const appReducer: Reducer<AppState> = (
state = APP_INITIAL_STATE,
action = { type: '', payload: null as any }
) => {
switch (action.type) {
case ACTIONS.VALIDATE_SENDER_ACCOUNT_ERROR:
return {
...state,
isSenderAccountValid: {
success: null,
error: action.payload,
},
};
case ACTIONS.VALIDATE_SENDER_ACCOUNT_SUCCESS:
return {
...state,
isSenderAccountValid: {
success: action.payload,
error: null,
},
};
case ACTIONS.VALIDATE_RECEIVER_ACCOUNT_ERROR:
return {
...state,
isReceiverAccountValid: {
success: null,
error: action.payload,
},
};
case ACTIONS.VALIDATE_RECEIVER_ACCOUNT_SUCCESS:
return {
...state,
isReceiverAccountValid: {
success: action.payload,
error: null,
},
};
case ACTIONS.SEND_TRANSACTION_ERROR:
return {
...state,
sendTransactionStatus: {
success: null,
error: action.payload,
},
};
case ACTIONS.SEND_TRANSACTION_SUCCESS:
return {
...state,
sendTransactionSuccess: {
success: action.payload,
error: null,
},
};
default:
return state;
}
};
export { AppState, appReducer };
|
Tight (n lg n) lower bound for finding a longest increasing subsequence The longest increasing subsequence problem is as follows: Given a sequence of n real numbers, find a longest increasing subsequence of. There is a well-known O(n lg n)-time comparison tree algorithm for solving this problem. Also, a tight (n lg n) lower bound in the comparison tree model is known. We prove a tight (n lg n) lower bound in the more powerful algebraic decision tree model. The above lower bounds also apply to the apparently simpler problem of finding the length of a longest increasing subsequence.
|
def testMisc(self):
m = self.PatchObject(run_tests, 'RunTests', return_value=True)
run_tests.main(['--network'])
m.assert_called_with(mock.ANY, jobs=mock.ANY, chroot_available=mock.ANY,
network=True, dryrun=False, failfast=False)
run_tests.main(['--dry-run'])
m.assert_called_with(mock.ANY, jobs=mock.ANY, chroot_available=mock.ANY,
network=False, dryrun=True, failfast=False)
run_tests.main(['--jobs', '1000'])
m.assert_called_with(mock.ANY, jobs=1000, chroot_available=mock.ANY,
network=False, dryrun=False, failfast=False)
run_tests.main(['--failfast'])
m.assert_called_with(mock.ANY, jobs=mock.ANY, chroot_available=mock.ANY,
network=False, dryrun=False, failfast=True)
|
/**
* Probably the best way to test the encoding is by converting it back to format specified in
* the file, that way we can ensure data has been migrated properly.
*
* @throws IOException if an I/O error occurs
*/
@Test
public void testCorrectEncoding() throws IOException {
for (AdobeStandardEncoding encoding : AdobeStandardEncoding.values()) {
String expectedLine = getLine();
String hexUnicode = toHexString(encoding.getUnicodeIndex(), 4);
String hexAdobe = toHexString(encoding.getAdobeCodePoint(), 2);
String actualLine = hexUnicode + "\t"
+ hexAdobe + "\t# "
+ encoding.getUnicodeName() + "\t# "
+ encoding.getAdobeName();
assertEquals(expectedLine, actualLine);
}
}
|
Maladies imaginaires: some common misconceptions about the ICIDH. This paper attempts to temper unrealistic expectations by clarifying what the ICIDH is, particularly through a review of what it is not. Recognizing that the approach is intended to be applied for a variety of purposes, a summary of the key properties of the information required for different tasks is also presented.
|
<reponame>Probot9/BASElineFlightComputer
package com.platypii.baseline.location;
import com.platypii.baseline.BaseService;
import com.platypii.baseline.measurements.MLocation;
import com.platypii.baseline.util.Numbers;
import android.content.Context;
import android.os.AsyncTask;
import android.support.annotation.NonNull;
import android.util.Log;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
public abstract class LocationProvider implements BaseService {
// Duration until location considered stale, in milliseconds
private static final long LOCATION_TTL = 10000;
// Listeners
private final List<MyLocationListener> listeners = new CopyOnWriteArrayList<>();
// GPS status
// TODO: Include time from last sample until now if > refreshTime
public float refreshRate = 0; // Moving average of refresh rate in Hz
// History
public MLocation lastLoc; // last location received
private MLocation prevLoc; // 2nd to last
/**
* Give a useful name to the inherited provider
*/
protected abstract String providerName();
/**
* Start location updates
* @param context The Application context
*/
@Override
public abstract void start(@NonNull Context context);
/**
* Returns the number of milliseconds since the last fix
*/
public long lastFixDuration() {
if (lastLoc != null && lastLoc.millis > 0) {
final long duration = System.currentTimeMillis() - (lastLoc.millis + TimeOffset.phoneOffsetMillis);
if (duration < 0) {
Log.w(providerName(), "Time since last fix should never be negative");
}
return duration;
} else {
return -1;
}
}
/**
* Returns whether the last location fix is recent
*/
public boolean isFresh() {
return lastLoc != null && lastFixDuration() < LOCATION_TTL;
}
/**
* Add a new listener to be notified of location updates
*/
public void addListener(MyLocationListener listener) {
listeners.add(listener);
}
/**
* Remove a listener from location updates
*/
public void removeListener(MyLocationListener listener) {
listeners.remove(listener);
}
/**
* Children should call updateLocation() when they have new location information
*/
void updateLocation(MLocation loc) {
// Log.v(providerName(), "MyLocationManager.updateLocation(" + loc + ")");
// Store location
prevLoc = lastLoc;
lastLoc = loc;
// Update gps time offset
final long clockOffset = System.currentTimeMillis() - lastLoc.millis;
if (Math.abs(TimeOffset.phoneOffsetMillis - clockOffset) > 1000) {
if (clockOffset < 0) {
Log.w(providerName(), "Adjusting clock: phone behind gps by " + (-clockOffset) + "ms");
} else {
Log.w(providerName(), "Adjusting clock: phone ahead of gps by " + clockOffset + "ms");
}
}
TimeOffset.phoneOffsetMillis = clockOffset;
if (prevLoc != null) {
final long deltaTime = lastLoc.millis - prevLoc.millis; // time since last refresh
// GPS sample refresh rate
if (deltaTime > 0) {
final float newRefreshRate = 1000f / deltaTime; // Refresh rate based on last 2 samples
if (refreshRate == 0) {
refreshRate = newRefreshRate;
} else {
refreshRate += (newRefreshRate - refreshRate) * 0.5f; // Moving average
}
if (Double.isNaN(refreshRate)) {
Log.e(providerName(), "Refresh rate is NaN, deltaTime = " + deltaTime + " refreshTime = " + newRefreshRate);
refreshRate = 0;
}
}
}
// Notify listeners (using AsyncTask so the manager never blocks!)
AsyncTask.execute(() -> {
for (MyLocationListener listener : listeners) {
listener.onLocationChanged(lastLoc);
}
});
}
/**
* Helper method for getting latest speed in m/s
* If GPS is not giving us speed natively, fallback to computing from v = dist/time.
* This should be used for display of the latest groundspeed, but not for logging.
*/
public double groundSpeed() {
if (isFresh()) {
final double lastGroundSpeed = lastLoc.groundSpeed();
if (Numbers.isReal(lastGroundSpeed)) {
return lastGroundSpeed;
} else {
// Compute ground speed from previous location
if (prevLoc != null) {
final double dist = prevLoc.distanceTo(lastLoc);
final double dt = (lastLoc.millis - prevLoc.millis) * 0.001;
if (dt > 0) {
return dist / dt;
}
}
}
}
return Double.NaN;
}
/**
* Helper method for getting latest speed in m/s
* If GPS is not giving us speed natively, fallback to computing from v = dist/time.
* This should be used for display of the latest total speed, but not for logging.
*/
public double totalSpeed() {
if (isFresh()) {
return lastLoc.totalSpeed();
} else {
return Double.NaN;
}
}
/**
* Helper method for getting latest bearing in degrees
* If GPS is not giving us speed natively, fallback to computing from v = dist/time.
* This should be used for display of the latest groundspeed, but not for logging.
*/
public double bearing() {
if (isFresh()) {
final double lastBearing = lastLoc.bearing();
if (Numbers.isReal(lastBearing)) {
return lastBearing;
} else {
// Compute ground speed from previous location
if (prevLoc != null) {
return prevLoc.bearingTo(lastLoc);
}
}
}
return Double.NaN;
}
/**
* Helper method for getting latest speed in m/s
* If GPS is not giving us speed natively, fallback to computing from v = dist/time.
* This should be used for display of the latest total speed, but not for logging.
*/
public double glideRatio() {
if (isFresh()) {
return lastLoc.glideRatio();
}
return Double.NaN;
}
@Override
public void stop() {
if (!listeners.isEmpty()) {
Log.w(providerName(), "Stopping location service, but listeners are still listening");
}
}
}
|
<gh_stars>10-100
import { expect } from "chai";
import * as dom from "dts-dom";
import * as fs from "fs";
import * as path from "path";
import { parse } from "querystring";
import { JSDocTsdParser } from "../../src/core/jsdoc-tsd-parser";
describe("JSDocTsdParser.parse.member", () => {
const classData: TDoclet[] = JSON.parse(fs.readFileSync(path.resolve(__dirname, "data/classMember.json"), { encoding: "utf-8" }));
expect(classData.length).to.eq(3);
it("should create a class with a number member", () => {
const parser = new JSDocTsdParser();
parser.parse(classData);
const result = parser.resolveMembershipAndExtends();
result.should.include.keys("myTestClass");
const myClass: dom.ClassDeclaration = result.get("myTestClass") as dom.ClassDeclaration;
expect(myClass.members.length).to.equal(2);
const myPropertyMember: dom.PropertyDeclaration = myClass.members[1] as dom.PropertyDeclaration;
expect(myPropertyMember.name).to.eq("myNumberMember");
expect(myPropertyMember.jsDocComment).to.eq("A simple number member");
const unionType = myPropertyMember.type as dom.UnionType;
expect(unionType.members.length).to.eq(1);
expect(unionType.members[0]).to.eq(dom.type.number);
});
});
|
package Classes;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
public class Pessoa {
private Nome nome;
private String cpf;
private String email1;
private String email2;
private List fone = new ArrayList();
private Endereco endereco;
public Nome getNome() {
return nome;
}
public void setNome(Nome nome) {
this.nome = nome;
}
public String getCpf() {
return cpf;
}
public void setCpf(String cpf) {
this.cpf = cpf;
}
public String getEmail1() {
return email1;
}
public void setEmail1(String email1) {
this.email1 = email1;
}
public String getEmail2() {
return email2;
}
public void setEmail2(String email2) {
this.email2 = email2;
}
public List<Fone> getFone() {
return fone;
}
public void setFone(Fone fone) {
this.fone.add(fone);
}
public void setFone(List<Fone> fone){
this.fone.clear();
this.fone=fone;
}
public Endereco getEndereco() {
return endereco;
}
public void setEndereco(Endereco endereco) {
this.endereco = endereco;
}
}
|
<gh_stars>1-10
# ***************************************************************
# Copyright (c) 2020 Jittor. Authors: <NAME> <<EMAIL>>. All Rights Reserved.
# This file is subject to the terms and conditions defined in
# file 'LICENSE.txt', which is part of this source code package.
# ***************************************************************
import unittest
import jittor as jt
import os
import numpy as np
class TestMiscIssue(unittest.TestCase):
def test_issue4(self):
try:
jt.dirty_fix_pytorch_runtime_error()
import torch
except:
return
# import with pytorch cause segfault
src = """N = 100
import jittor as jt
a = jt.random([N, N])
b = a.broadcast([N,N,N], dims=[0]) * a.broadcast([N,N,N], dims=[2])
b = b.sum(1)
b.sync()
import torch
A = torch.rand(N, N)
torch.matmul(A, A)
"""
assert os.system(f"python3.7 -c '{src}'")==0
src = """N = 100
import torch
A = torch.rand(N, N)
torch.matmul(A, A)
import jittor as jt
a = jt.random([N, N])
b = a.broadcast([N,N,N], dims=[0]) * a.broadcast([N,N,N], dims=[2])
b = b.sum(1)
b.sync()
"""
assert os.system(f"python3.7 -c '{src}'")==0
def test_mkl_conflict1(self):
try:
jt.dirty_fix_pytorch_runtime_error()
import torch
except:
return
if jt.mkl_ops is None:
return
# import with pytorch cause segfault
src = """
nchw = [2, 3, 100, 100]
oihw = [4, 3, 5, 5]
import jittor as jt
x = jt.random(nchw)
w = jt.random(oihw)
jt.mkl_ops.mkl_conv(x, w, 1, 2).sync()
jt.dirty_fix_pytorch_runtime_error()
import torch
m = torch.nn.Conv2d(3, 4, 5, 1, 2)
m(torch.rand(*nchw))
"""
assert os.system(f"python3.7 -c '{src}'")==0
def test_mkl_conflict2(self):
try:
jt.dirty_fix_pytorch_runtime_error()
import torch
except:
return
if jt.mkl_ops is None:
return
# import with pytorch cause segfault
src = """
nchw = [2, 3, 100, 100]
oihw = [4, 3, 5, 5]
import torch
m = torch.nn.Conv2d(3, 4, 5, 1, 2)
m(torch.rand(*nchw))
import jittor as jt
x = jt.random(nchw)
w = jt.random(oihw)
jt.mkl_ops.mkl_conv(x, w, 1, 2).sync()
"""
assert os.system(f"python3.7 -c '{src}'")==0
def test_parallel(self):
a = jt.code([4], "int", cpu_src="""
#pragma omp parallel num_threads(4)
@out(omp_get_thread_num()) = 456;
""", cpu_header='#include <omp.h>').data
assert (a==[456]*4).all(), a
@unittest.skipIf(not jt.compiler.has_cuda, "No CUDA found")
@jt.flag_scope(use_cuda=1)
def test_reduce_opt(self):
a = jt.random((16,512,38,38))
b = jt.random((16,512,38,38))
jt.sync([a, b])
with jt.profile_scope(rerun=10, warmup=10) as rep:
norm = a.sqr().sum(1, keepdims=True).sqrt()
c = a / norm
da = jt.grad(c*b, a)
jt.sync([c, da])
gpu_c = c.numpy()
gpu_da = da.numpy()
with jt.flag_scope(use_cuda=0):
norm = a.sqr().sum(1, keepdims=True).sqrt()
c = a / norm
da = jt.grad(c*b, a)
assert np.allclose(gpu_c, c.data, 1e-3)
assert (np.abs(gpu_da-da.data).max() < 1e-6)
assert float(rep[1][3]) < 15e6, float(rep[1][3]) # 15ms(about 8ms)
@unittest.skipIf(not jt.compiler.has_cuda, "No CUDA found")
@jt.flag_scope(use_cuda=1)
def test_cuda_min_max(self):
a = jt.random((10,)) - 2
assert a.min().data == a.data.min(), (a.min(), a.data.min())
assert a.max().data == a.data.max(), (a.max(), a.data.max())
@unittest.skipIf(not jt.compiler.has_cuda, "No CUDA found")
@jt.flag_scope(use_cuda=1)
def test_cuda_pow_grad_nan(self):
a = jt.float32([1,-1, -1000.1])
da = jt.grad(a**2, a)
assert np.isnan(da.data).sum()==0, da.data
def test_tanh_nan(self):
m=jt.nn.Tanh()
a = m(jt.array([1000]))
assert np.isnan(a.data).sum()==0, a
def test_sigmoid_nan(self):
a = jt.float32([1,-1, -1000.1])
da = jt.grad(a.sigmoid(), a)
assert np.isnan(da.data).sum()==0, da.data
if __name__ == "__main__":
unittest.main()
|
Real-time performance comparison of tuning frequency estimation algorithms In this paper, a comparison of the real-time performances of different algorithms for the estimation of the concert pitch (tuning frequency or reference frequency) of music recordings is presented and discussed. The unavailability of ground-truth datasets makes this kind of evaluation on real music recordings less trivial than what it may initially appear. Hence, in this paper we investigate the algorithms best-case performances using simple generated sounds and than we study the estimation reliability and the real-time performances using real world recordings. In particular, we focus on the standard deviation of the estimation for various length of the signal, the reliability of the on-line estimation and the computational complexity.
|
Moving to Smart Cities Through the Standard Indicators ISO 37120 In this article the current and most important standards focusing on smart city sector and organizations issuing them were presented. The standard-setting family for smart cities consists of four basic standards: ISO 37101, ISO 37120, ISO 37122 and ISO 37123. The paper also presents the indicators on the basis of which a city can apply for a certificate of ISO 37120 standard and presents the possibilities of a register of different cities from all over the world in the Global Cities RegistryTM, developed by WCCD (World Council on City Data). Thanks to the data contained in the database, city authorities can answer the question: How prosperous is my city? and compare with other cities from around the world. As an example of the use of WCCD data, a comparison of 21 European cities in terms of the amount of renewable energy consumption in relation to the size of population living in the city has been presented. INTRODUCTION As calculated half of the world's population lived in the cities, In Europe 73.6 % of the European Union's inhabitants live in the urban areas. It is expected that this 58.2 % of the world and 75.8 % of the European population will be living in urban areas by 2025, and sustainable urbanization has become a key policy point to administrations across the world (). One of the challenges faced by the cities is to ensure good living conditions for the people and at the same time achieve appropriate economic results. To effectively provide better services and increase quality of life of citizens smart cities operate on the basis of integrated and interconnected systems. Currently, cities all over the world introduce a holistic "smart city" approach to make them sustainable, efficient, and more attractive to people's live and business initiative development to support economic growth. The "smart city" concept is now evolving in major cities of the world. The international standards bodies proposed the standards relevant to smart cities. However, the standards should have some structure to be able to connect different areas of live and identify the interactions between them in the smart city. To aid in this search the standards are needed, which can be mapped and linked various properties of "smart city" model (Allam and Newman, 2018;). There are many definitions for smart cities focusing on various aspects ranging from infrastructure to the living conditions of citizens (). International Telecommunication Union established useful definition : "A smart sustainable city is an innovative city that uses information and communication technologies (ICTs) and other means to improve quality of life, efficiency of urban operation and services, and competitiveness, while ensuring that it meets the needs of present and future generations with respect to economic, social, environmental as well as cultural aspects". According to this definition smart city is not just a city that introducing or using the new technologies but it is a complex ecosystem containing many stakeholders including citizens, city authorities, local companies and industry, community groups, etc. Recently established the ISO standards for smart cities aim to help them measure their sustainability and answer for the question: how can cities adapt and establish to provide adequate resources and a sustainable future. The aim of this paper is to present international standards for smart cities and to show how obtaining ISO 37120 certification helps in the achievement of assumptions of smart city. In this article the current and most important standards focusing on smart city sector and organizations issuing them are presented. KEY INTERNATIONAL STANDARDS ON SMART CITIES International standards enable cities to achieve appropriate technical, environmental and social indicators that have a significant impact on the infrastructure, safety, and life of residents. International Electrotechnical Commission (IEC), International Organization for Standardization (ISO) and International Telecommunication Union (ITU) established the World Smart City partnership. This partnership organizes each year World Smart City Forum (WSCF). The Forum aims to create uniform rules, standards of good practices, and intensify cooperation for development of "smart city" approach. The International Organization for Standardization (ISO) is an instrumental body supporting and developing for smart cities. The definition of "smart city" according to ISO Smart Cities Strategic Advisory Group is as follow: "Smart City is one that dramatically increases the pace at which it improves its social, economic and environmental (sustainability) outcomes, responding to challenges such as climate change, rapid population growth, and political and economic instability by fundamentally improving how it engages society, how it applies collaborative leadership methods, how it works across disciplines and city systems, and how it uses data information and modern technologies in order to transform services and quality of life for those in and involved with the city (residents, businesses, visitors), now and for the foreseeable future, without unfair disadvantage of other or degradation of the natural environment" (ISO/TMB, 2015). The ISO Technical Committee 268 (Sustainable cities and communities) was established the work on standardization in the field of sustainable development of cities and communities. The role of this technical committee is: development of requirements, frameworks, guidance and supporting techniques and tools related to the achievement of sustainable development considering sustainability, smartness and resilience, to help all cities and communities from both rural and urban areas become more sustainable. The committee comprises of 3 working groups but only two are strictly related to idea of smart cities, e.g. working group 1system management ISO 37101 and working group 2city indicators which are the keys smart cities standards developed by ISO TC268. The standards should be used in the evaluation of smart cities because (ISO/TMB, 2015): Standards facilitate the connection of structures from different suppliers. Interconnection in cities (both physically and virtually) can only be achieved by standardized interfaces using the same harmonized technical rules that are described in standards. The use of international standards also facilitates the maintenance and repair of city infrastructure. Spare parts can be bought from anywhere at more competitive prices. Standards give many solutionscompanies use Standards to build the electrical and electronic components, devices or systems which support smooth and integrated smart city development. Standards facilitate the development of strictly defined solutions that are adapted to specific conditions of the city. Standards describe good practice and clearly and exactly explain what needs to be used and applied. They also highlight what needs to be specified in procurement processes to ensure goods and services supplied are fit for purpose. There are three main levels of standards relating to smart cities: strategic, process and technical with each playing an important role in evaluation of smart cities (Figure 1 and 2). Level 1 -Strategic level: standards provide guidance to government leadership and other bodies how to establish and develop smart cities strategy. They include guidance of identifying priorities, how to develop and implement of roadmap and how to monitor and evaluate progress along the roadmap. Level 2 -Process level: standards cover good practice in procuring and managing of projects realized in smart cities, including guidance with the appropriate financing packages. The standards offer best practices and associated guidelines. Level 3 -Technical level: standards describe the practical requirements for products and services to ensure that they achieve the results and they meet the objectives. Strategic-level standards (level 1) are dedicated to government leadership, while process-level standards (level 2) and technical specifications are related to management. The selection of smart cities standards to three groups is listed in the ITU page (ITU). The ISO standards on sustainable cities were developed by the working group "City indicators" of the committee "Sustainable cities and communities". The family of standards for smart cities is shown in Figure and total costing; support synergies between several entities through a holistic approach; increase the efficiency and attractiveness of communities. ISO 37120: Sustainable cities and communities -Indicators for city services and quality of life. They are key measurements for evaluating a city's service delivery and quality of life. This document defines and establishes methodologies for a set of indicators to monitor and measure the performance of city services and quality of life. It can be applied in conjunction with ISO 37101 and ISO 37123 as presented in Figure 3. Any city, municipality or local government can applicable this document independently from size and location. ISO 37122: Sustainable cities and communities -Indicators for smart cities provides indicators for smart cities. This document was published in 2018. ISO 37122 defines not only indicators but also presents methods and practices that can change significant cities to their social, economic and environmental sustainability. In this document definitions and methodologies for a set of indicators for smart cities are specified and established. In the opinion of Bernard Gindroz, Chair of ISO/TC 268, Sustainable cities and communities the ISO technical committee, when ISO 37122 will be used in conjunction with ISO 37101 and ISO 37120, this standard helps cities implement and develop smart city projects (ISO/TC 268). ISO 37122 is complemented by ISO 37123, Sustainable cities and communities -Indicators for resilient cities This standard on resilient cities was published in 2019. In this document definitions and methodologies for a set of indicators on resilience in cities are defined and established. This document is also applicable to any city, municipality or local government independently from size and location and can be implemented in combined with ISO 37120. Also this document follows the principles described in ISO 37101 and can be used in conjunction with this and other strategic frameworks. Together, the ISO standards form a set of standardized indicators that provide a uniform approach to develop and monitor the progress of cities towards "smart city" concept. The standards also provide guidance to cities on how to assess their performance towards the global roadmap for a more sustainable world. These standards have been developed with sustainability as a guiding principle and therefore can be used in conjunction to provide a holistic approach to urban sustainability (). PRACTICAL APPLICATION OF THE INDICATORS IN ISO 37120:2014 STANDARD -WCCD ORGANIZATION ISO 37120 standard was published for the first time in 2014 and it specified 17 heads, 46 standardized Core, 54 Supporting and 35 profile indicators that provide a uniform approach to what is measured, and how that measurement is to be undertaken - Figure 4. Table 1 presents detailed indicators from ISO 37120 standard divided into groups as well as basic and auxiliary indicators. In 2018, 28 new indicators were updated and added, removal of 24 old ones and slight modification to 10 indicators. WCCD (World Council on City Data) has developed the first and so far the only international Global Cities RegistryTM (WCCD) for ISO 37120 in 2014, on which cities from all over the world can compare based on the indicators contained in Table 1. WCCD is a world leader in collecting standardized data, helping to create smart, sustainable and thriving cities. The WCCD hosts a network of innovative cities committed to improving services and quality of life with open city data and provides a consistent and comprehensive platform for standardized urban metrics. The WCCD is a global hub for creative learning partnerships across cities, international organizations, corporate partners, and academia to further innovation, envision alternative futures, and build better and more liveable cities (WCCD). With the data contained in database, city authorities can answer the question: How prosperous is my city? by comparing with other cities around the world. Any city that holds an ISO 37120 certificate obtained by WCCD can use this virtual open data platform to report its achievements on the basis of indicators and compare with other cities in different areas. This provides an opportunity for self-assessment and development towards a smart city. The WCCD portal registers cities from all over the world. These are not only wealthy cities but also those that are in the development stage. Figure 5 shows the number of cities from individual countries. As can be seen Canada has 28 cities that hold ISO 37120 certification, while the UK has only 1 such city. It is worth noting that Poland has 3 such cities. These are Gdynia, Kielce and Warsaw. AN EXAMPLE OF USING DATA FROM THE WCCD PORTAL TO COMPARE EUROPEAN CITIES ASPIRING TO BE SMART CITY On the WCCD portal, it is possible to verify at what level individual cities from all over the world implement the indicators contained in ISO 37120:2014 standard. Since 2014, every year, the portal collects data of all cities that have obtained a certificate of the standard. Everyone interested can analyze the development trends of individual cities, as well as make a comparative analysis of different cities in terms of the indicators of their interest. Currently there are more than 1.2 million data combinations. Therefore, it is a source of extremely important information needed to verify the development of individual cities, but also different regions of the world or individual countries. Figure 6 shows an exemplary comparison of 21 European cities in terms of renewable energy consumption (this is the primary indicator in the Energy Indicator group) against the size of population living in the individual city. The size of the point next to individual city indicates the share of renewable sources in energy generation within the city. It can be seen that cities such as Oslo or Copenhagen have the largest share in the use of renewable energy. However, the size of city population is shown on a diagram on the axis of ordinates. It can be seen that the largest city in Europe in this comparison -London, which is the furthest right point on the chart, has a very small point, which indicates that energy in this city is obtained from renewable sources to a small extent. It is worthwhile to take a look at the Polish cities here. Figure 7 shows a comparison of the basic indicator from the Energy 7.4 Percentage of total energy derived from renewable sources, as a share of the city's total energy consumption between the cities of Warsaw, Kielce and Gdynia. The rectangle shows how this indicator is shaped for individual cities. It can be seen that the size of the dark bar is the largest in the city of Kielce and is almost invisible for Warsaw. This means that Kielce obtains energy for its households to a much greater extent from renewable sources (it is 19th out of 57 cities in the ranking) than Gdynia (27/57) or Warsaw (49/57). The WCCD portal offers a wide range of comparison possibilities. As more and more cities become members of the group on the WCCD portal, thus providing data on their sustainability levels, there will be an increased possibility to set trends, relationships between individual indicators or predict future performance values. This will give those who govern cities an instrument that will support them in making decisions about the directions of their cities to be smart cities. CONCLUSION Standards can provide a range of benefits to cities and the industries that support them. Diverse standards are available to support smart cities activities. By enabling systems to work together, standards stimulate innovation, making it easier for cities to procure reliable and cost-effective systems to meet their needs. WCCD organization through its portal has given city authorities certified to ISO 37120 a tool that allows them to verify their goals in the pursuit of a smart city and the possibility to compare in many aspects and in different areas with cities from all over the world in order to improve and promote themselves.
|
<reponame>briand787b/rfs
package models
import (
"fmt"
"reflect"
"testing"
"time"
)
// CreateMedia creates a Media. If the passed
// Media pointer is nil, then the default Media is
// created. Otherwise, the provided Media is created
// in the database. The returned Media pointer should
// only be used if the provided Media pointer is nil.
func CreateMedia(ts *TestStruct, m *Media) *Media {
if m == nil {
m = &Media{}
}
if err := mediaStore.Save(m); err != nil {
defer (*ts.CF)()
ts.Fatal("could not create media: ", err)
}
fmt.Println("created media with ID: ", m.ID)
ts.CF.Add(func() {
if err := mediaStore.Delete(m.ID); err != nil {
ts.T.Fatal("could not delete created media: ", err)
}
})
ts.ParentIDs[MEDIA] = m.ID
return m
}
func TestSaveGetByIDDeleteParentlessChildlessMedia(t *testing.T) {
m := &Media{
Name: t.Name(),
ReleaseYear: time.Now().Year(),
}
if mediaStore == nil {
t.Fatal("MEDIA STORE IS NIL")
}
if err := mediaStore.Save(m); err != nil {
t.Fatal(err)
}
retM, err := mediaStore.GetByID(m.ID)
if err != nil {
t.Fatal(err)
}
if !reflect.DeepEqual(retM, m) {
t.Fatalf("returned Media %+v does not equal saved media %+v\n",
retM, m,
)
}
if err := mediaStore.Delete(m.ID); err != nil {
t.Fatal(err)
}
if _, err := mediaStore.GetByID(m.ID); err == nil {
t.Fatalf("deleted media is still found by id %v\n", m.ID)
}
}
|
John Michael Phillips
Early life and education
Phillips was born and raised in Mobile, Alabama, before moving to Jacksonville, Florida in 2001. He received a BA from the University of Alabama in Political Science and Criminal Justice in 1997. He attended the University of Alabama School of Law, receiving a JD in 2000. He subsequently became licensed to practice law in Florida, Georgia and Alabama and before the United States Supreme Court.
Political life and civic career
In 2015, Phillips was nominated by the Mayor of Jacksonville to the City's Human Rights Commission. Not without controversy, a Brunswick, Georgia pastor once asked the Mayor to force Phillips to resign his position, claiming he was biased, saying Phillips "has shown he cannot be a fair person and serve on the city's Human Rights Commission." Incidentally, the person who claimed that is serving time in prison. The mayor's office sided with Phillips and he remained on the Commission. On November 14, 2017, Phillips resigned from the Commission in order to relieve any perceived conflict before filing multiple civil rights lawsuits against the City of Jacksonville.
Phillips name has been discussed in regards to political office. In 2016, he was named one of the 29 most influential people in Jacksonville, Florida by Folio Weekly. He is very active in community outreach.
Legal career
Phillips started his career as a civil litigation defense attorney, defending companies like Coca-Cola, Hertz and State Farm from injury claims. After over 8 years with his firm, he worked beside John Morgan and represented victims of traumatic injuries. In 2011, Phillips founded his own law office. It has since expanded to a multi-state practice.
Jordan Davis shooting
In 2012, Phillips was hired by Ron Davis and Lucy McBath after the shooting of Jordan Davis by Michael Dunn which stemmed from an argument over loud music on November 23, 2012. Police say 45-year-old Michael Dunn fired 10 times at a vehicle in which 17-year-old Jordan Davis was a passenger just after 7:30 p.m. in Jacksonville, Florida. Michael Dunn was convicted of Jordan Davis's murder after two trials and remains behind bars. Jordan's death made news around the nation much like the murder case of Trayvon Martin. Phillips' perspective and a photo with the family appeared in Rolling Stone magazine in 2013.
Although Joy Reid described Phillips as "a white, lifelong Republican with an Alabama drawl, who like 1.5 million Floridians, has a concealed carry permit," he is frequently praised for his fight for equal rights. Phillips's experiences led to a TEDx speech, which has amassed over 300,000 views. Additionally, he received a feature by BET online, spotlighting Phillips as a civil rights advocate.
Abigail Disney Documentary: Armor of Light
Phillips still works with the Davis family both in aspects of the wrongful death of Jordan, but also to assist the discussion over changing controversial gun laws across the country and encourages people to be more civil with each other. His family was featured in the Emmy award winning documentary by Abigail Disney, the daughter of Roy O. Disney and niece of Walt Disney. The movie is called Armor of Light and features Phillips' story alongside his client Lucy McBath and Reverend Rob Schenck. The film premiered at Tribeca and went on to receive much acclaim. In 2017, it won an Emmy Award for best "Outstanding Social Interest Documentary."
Howard Schneider
Phillips handled was the nationally reported case of Jacksonville pediatric dentist Howard S. Schneider. Howard Schneider was charged in a scheme to defraud Medicaid, but the allegations against him also included abuse and performing unnecessary dentistry on children, telling parents that he needed to work on one tooth and extracting several. Parents also allege that he unnecessarily restrained children with the controversial papoose board. Although he was found incompetent to stand trial, he lost his license to practice and much of his status in the community and a confidential settlement was reached.
Phillips was interviewed on Nancy Grace, Anderson Cooper, Nightline, Crime Watch Daily, and others about the case.
Other cases
Another notable case includes Gregory Hill v. Ft. Pierce Police Department (where a man was shot by police through his closed garage door), It resulted in a controversial $4 jury verdict.
On January 15, 2019, Phillips and his firm received a jury verdict of $495,123,680.00, the largest known jury verdict in northeast Florida and one of the largest wrongful death verdicts in the country. Kalil McCoy, of Jacksonville, Florida, was shot in the head by Frederick Lee Wade, 19, while they rode in a car with four other friends, after an argument about opening a window. McCoy’s friends then dumped her body in a wooded area and lied about what happened. Fox News reported the victim's mother mother, Lynette Roebuck, saying, "that while the judgment won’t bring her daughter back, it acknowledges the pain her family has suffered for seven years." This was on top of another prior settlement in the case.
Additionally, Phillips has handled several other nationally reported cases, including a woman was run over while sunbathing on Daytona Beach, for which he was interviewed on Today Show. Good Morning America also filmed and broadcast portions of this trial in 2014, where Phillips can be seen hugging his client after a $2.6 million verdict. See also Aviana Bailey v. Daytona Beach Police (where Bailey was shot by Daytona Beach Police while a passenger in a vehicle).
Speeches and presentations
Since 2009, Phillips has spoken hundreds of times on various legal topics. He gave a TEDx talk which has been viewed over 300,000 times. He also has spoken internationally in Ghana and on the BBC and to groups at Howard University and before the NAACP.
Television and radio personality
Phillips has appeared on NBC's the Today Show, MSNBC, HLN, BBC, Al Jazeera, RT TV, TV ONE and regularly appears on other national media outlets as a legal correspondent. He is a recurring guest and legal analyst on HLN (CNN's Headline News program). Phillips covered the George Zimmerman verdict live from Sanford, Florida for HLN and has covered other high profile cases such as Jodi Arias and Casey Anthony for national media.
From 2011 to 2013, Phillips hosted a podcast, which was aired regionally in Jacksonville, Florida called Courts & Sports. He still regularly appears on the morning radio show Lex and Terry. He represented the duo in 2012 and frequently has a call in segment where listeners ask Phillips for legal advice.
Personal life
Phillips resides in Jacksonville, Florida, is married and has three sons.
|
/// Get the P2TR address for this contract
pub fn address<C: Verification>(&self, secp: &Secp256k1<C>) -> Option<Address> {
if let Some(c) = self.spend_info.as_ref() {
Some(Address::p2tr(
secp,
c.internal_key(),
c.merkle_root(),
Self::network(),
))
} else {
None
}
}
|
Canada faces a slowly intensifying crisis. Demand for the essential services provided by charities and non-profits will rise dramatically over the next decade, but the sector’s revenue streams are not likely to keep up with demand.
By 2026, Imagine Canada, a national organization working on behalf of charities, projects the sector will need an additional $25 billion to meet spiking demand for services. This calculation is based on projected increases being driven by current demographic trends and average annual GDP growth of 1.8 per cent between now and 2026 (based on Parliamentary Budget Office and Conference Board estimates).
We call this the emerging “social deficit” and, if systemic action is not taken, it will manifest itself in an ever-increasing litany of unmet needs.
The cost of inaction to taxpayers will be high when you factor in the enormous financial pressure governments will face within a decade to maintain social services Canadians want and have come to rely upon.
What should be done? The answers lie in understanding the demographic, cultural and economic trends driving demand; the social and economic value of giving charities a voice in macroeconomic policy and the need to reform regulations governing charities.
Demand-side drivers include: our rapidly aging population which is necessitating a major increase in support services; rising transitional needs among a more diverse population of immigrants and refugees; the impacts of climate change on the environment and communities and increasing demand for poverty-related services as the benefits of economic growth is concentrated in fewer hands.
Solving the social deficit largely depends on the deployment of inclusive, equitable and environmentally friendly economic policies. Canada needs income growth that benefits more people, particularly those in marginalized groups who are more likely to rely on services currently provided by charities.
From the perspective of addressing the social deficit, economic policies aimed at raising income levels more broadly would simultaneously slow demand for charitable services and increase the capacity of Canadians to give.
There are serious discussions going on today about the future of our economy. Canadians want the higher standard of living that inclusive economic growth brings. Charities are uniquely qualified to work with policymakers to create economic policies that do more than just trickle down to most Canadians.
Canada’s 170,000 charities and non-profits excel at inclusiveness and creating social value across areas ranging from health care to social services, education, international development and the environment. With a seat at the policy table, charities and non-profits could make a creative contribution to the government’s development of smart policies that would maximize the synergistic relationship between the sector and the broader economy.
Our sector is also relevant to policymakers because it’s an important engine of jobs and growth, accounting for 8.1 per cent of GDP and a workforce topping two million. The sector also represents 13 million volunteers who give their time and talent to help others.
Charities offer government a deep reservoir of ideas and capabilities to advance social good. As things stand, however, charities and non-profits have virtually no voice in economic policy. This must change if we are going to address the social deficit and protect our quality of life, which is the envy of much of the world and a mainstay of Canada’s competitiveness in the global economy.
Fighting the social deficit also requires reforming the regulatory framework governing charities and non-profits. Regulatory change to modernize the relationship between government and charities is long overdue and is needed to spur the innovation and agility the sector needs to continuously advance efficiencies and service quality.
Of importance is providing charities and non-profits with new ways to finance their activities. Priority should be given to creating new social investment or social equity instruments that would ease restrictions on earned income to enhance service capacity.
How we support each other and our communities all contributes to our country’s wealth. Actions to fight the social deficit will benefit millions of Canadians. Inclusive economic growth coupled with regulatory reform is essential to maintaining Canada’s position as the best country in the world in which to live and raise a family.
Brian Emmett is chief economist for Canada’s Charities and Non-profits.
|
//{{BLOCK(WaterfallStream2x28)
//======================================================================
//
// WaterfallStream2x28, 16x896@2,
// + 224 tiles not compressed
// + regular map (flat), not compressed, 2x112
// Total size: 3600 + 448 = 4048
//
// Exported by Cearn's GBA Image Transmogrifier, v0.8.6
// ( http://www.coranac.com/projects/#grit )
//
//======================================================================
const unsigned int WaterfallStream2x28Tiles[900] __attribute__((aligned(4)))=
{
0xA55FAA97,0x555F555F,0x555F555F,0x555F555F,
0xD55AF6AA,0xD555D555,0xF555D555,0xF555F555,0x5AAB556F,0xAAABAAAB,0xAAAFAAAB,0xAAABAAAF,
0xFAA5F955,0xFAAAFAAA,0xEAAAFAAA,0xFAAAEAAA,0xA55FAA97,0x555F555F,0x555F555F,0x555F555F,
0xD55AF6AA,0xD555D555,0xF555D555,0xF555F555,0x5AAB556F,0xAAABAAAB,0xAAAFAAAB,0xAAABAAAF,
0xFAA5F955,0xFAAAFAAA,0xEAAAFAAA,0xFAAAEAAA,0xA55FAA97,0x555F555F,0x555F555F,0x555F555F,
0xD55AF6AA,0xD555D555,0xF555D555,0xF555F555,0x5AAB556F,0xAAABAAAB,0xAAAFAAAB,0xAAABAAAF,
0xFAA5F955,0xFAAAFAAA,0xEAAAFAAA,0xFAAAEAAA,0xA55FAA97,0x555F555F,0x555F555F,0x555F555F,
0xD55AF6AA,0xD555D555,0xF555D555,0xF555F555,0x5AAB556F,0xAAABAAAB,0xAAAFAAAB,0xAAABAAAF,
0xFAA5F955,0xFAAAFAAA,0xEAAAFAAA,0xFAAAEAAA,0xA55FAA97,0x555F555F,0x555F555F,0x555F555F,
0xD55AF6AA,0xD555D555,0xF555D555,0xF555F555,0x5AAB556F,0xAAABAAAB,0xAAAFAAAB,0xAAABAAAF,
0xFAA5F955,0xFAAAFAAA,0xEAAAFAAA,0xFAAAEAAA,0xA55FAA97,0x555F555F,0x555F555F,0x555F555F,
0xD55AF6AA,0xD555D555,0xF555D555,0xF555F555,0x5AAB556F,0xAAABAAAB,0xAAAFAAAB,0xAAABAAAF,
0xFAA5F955,0xFAAAFAAA,0xEAAAFAAA,0xFAAAEAAA,0xA55FAA97,0x555F555F,0x555F555F,0x555F555F,
0xD55AF6AA,0xD555D555,0xF555D555,0xF555F555,0x5AAB556F,0xAAABAAAB,0xAAAFAAAB,0xAAABAAAF,
0xFAA5F955,0xFAAAFAAA,0xEAAAFAAA,0xFAAAEAAA,0xA55FAA97,0x555F555F,0x555F555F,0x555F555F,
0xD55AF6AA,0xD555D555,0xF555D555,0xF555F555,0x5AAB556F,0xAAABAAAB,0xAAAFAAAB,0xAAABAAAF,
0xFAA5F955,0xFAAAFAAA,0xEAAAFAAA,0xFAAAEAAA,0xA55FAA97,0x555F555F,0x555F555F,0x555F555F,
0xD55AF6AA,0xD555D555,0xF555D555,0xF555F555,0x5AAB556F,0xAAABAAAB,0xAAAFAAAB,0xAAABAAAF,
0xFAA5F955,0xFAAAFAAA,0xEAAAFAAA,0xFAAAEAAA,0xA55FAA97,0x555F555F,0x555F555F,0x555F555F,
0xD55AF6AA,0xD555D555,0xF555D555,0xF555F555,0x5AAB556F,0xAAABAAAB,0xAAAFAAAB,0xAAABAAAF,
0xFAA5F955,0xFAAAFAAA,0xEAAAFAAA,0xFAAAEAAA,0xA55FAA97,0x555F555F,0x555F555F,0x555F555F,
0xD55AF6AA,0xD555D555,0xF555D555,0xF555F555,0x5AAB556F,0xAAABAAAB,0xAAAFAAAB,0xAAABAAAF,
0xFAA5F955,0xFAAAFAAA,0xEAAAFAAA,0xFAAAEAAA,0xA55FAA97,0x555F555F,0x555F555F,0x555F555F,
0xD55AF6AA,0xD555D555,0xF555D555,0xF555F555,0x5AAB556F,0xAAABAAAB,0xAAAFAAAB,0xAAABAAAF,
0xFAA5F955,0xFAAAFAAA,0xEAAAFAAA,0xFAAAEAAA,0xA55FAA97,0x555F555F,0x555F555F,0x555F555F,
0xD55AF6AA,0xD555D555,0xF555D555,0xF555F555,0x5AAB556F,0xAAABAAAB,0xAAAFAAAB,0xAAABAAAF,
0xFAA5F955,0xFAAAFAAA,0xEAAAFAAA,0xFAAAEAAA,0xA55FAA97,0x555F555F,0x555F555F,0x555F555F,
0xD55AF6AA,0xD555D555,0xF555D555,0xF555F555,0x5AAB556F,0xAAABAAAB,0xAAAFAAAB,0xAAABAAAF,
0xFAA5F955,0xFAAAFAAA,0xEAAAFAAA,0xFAAAEAAA,0xAAAFAAAB,0xAAAFAAAF,0xA557AA97,0x555F555F,
0xEAAAFAAA,0xFAAAEAAA,0xF55AF6AA,0xD555D555,0x555F555F,0x555F555F,0x5AAB556F,0xAAABAAAB,
0xF555D555,0xF555F555,0xFAA5F955,0xFAAAFAAA,0xAAAFAAAB,0xAAAFAAAF,0xA557AA97,0x555F555F,
0xEAAAFAAA,0xFAAAEAAA,0xF55AF6AA,0xD555D555,0x555F555F,0x555F555F,0x5AAB556F,0xAAABAAAB,
0xF555D555,0xF555F555,0xFAA5F955,0xFAAAFAAA,0xAAAFAAAB,0xAAAFAAAF,0xA557AA97,0x555F555F,
0xEAAAFAAA,0xFAAAEAAA,0xF55AF6AA,0xD555D555,0x555F555F,0x555F555F,0x5AAB556F,0xAAABAAAB,
0xF555D555,0xF555F555,0xFAA5F955,0xFAAAFAAA,0xAAAFAAAB,0xAAAFAAAF,0xA557AA97,0x555F555F,
0xEAAAFAAA,0xFAAAEAAA,0xF55AF6AA,0xD555D555,0x555F555F,0x555F555F,0x5AAB556F,0xAAABAAAB,
0xF555D555,0xF555F555,0xFAA5F955,0xFAAAFAAA,0xAAAFAAAB,0xAAAFAAAF,0xA557AA97,0x555F555F,
0xEAAAFAAA,0xFAAAEAAA,0xF55AF6AA,0xD555D555,0x555F555F,0x555F555F,0x5AAB556F,0xAAABAAAB,
0xF555D555,0xF555F555,0xFAA5F955,0xFAAAFAAA,0xAAAFAAAB,0xAAAFAAAF,0xA557AA97,0x555F555F,
0xEAAAFAAA,0xFAAAEAAA,0xF55AF6AA,0xD555D555,0x555F555F,0x555F555F,0x5AAB556F,0xAAABAAAB,
0xF555D555,0xF555F555,0xFAA5F955,0xFAAAFAAA,0xAAAFAAAB,0xAAAFAAAF,0xA557AA97,0x555F555F,
0xEAAAFAAA,0xFAAAEAAA,0xF55AF6AA,0xD555D555,0x555F555F,0x555F555F,0x5AAB556F,0xAAABAAAB,
0xF555D555,0xF555F555,0xFAA5F955,0xFAAAFAAA,0xAAAFAAAB,0xAAAFAAAF,0xA557AA97,0x555F555F,
0xEAAAFAAA,0xFAAAEAAA,0xF55AF6AA,0xD555D555,0x555F555F,0x555F555F,0x5AAB556F,0xAAABAAAB,
0xF555D555,0xF555F555,0xFAA5F955,0xFAAAFAAA,0xAAAFAAAB,0xAAAFAAAF,0xA557AA97,0x555F555F,
0xEAAAFAAA,0xFAAAEAAA,0xF55AF6AA,0xD555D555,0x555F555F,0x555F555F,0x5AAB556F,0xAAABAAAB,
0xF555D555,0xF555F555,0xFAA5F955,0xFAAAFAAA,0xAAAFAAAB,0xAAAFAAAF,0xA557AA97,0x555F555F,
0xEAAAFAAA,0xFAAAEAAA,0xF55AF6AA,0xD555D555,0x555F555F,0x555F555F,0x5AAB556F,0xAAABAAAB,
0xF555D555,0xF555F555,0xFAA5F955,0xFAAAFAAA,0xAAAFAAAB,0xAAAFAAAF,0xA557AA97,0x555F555F,
0xEAAAFAAA,0xFAAAEAAA,0xF55AF6AA,0xD555D555,0x555F555F,0x555F555F,0x5AAB556F,0xAAABAAAB,
0xF555D555,0xF555F555,0xFAA5F955,0xFAAAFAAA,0xAAAFAAAB,0xAAAFAAAF,0xA557AA97,0x555F555F,
0xEAAAFAAA,0xFAAAEAAA,0xF55AF6AA,0xD555D555,0x555F555F,0x555F555F,0x5AAB556F,0xAAABAAAB,
0xF555D555,0xF555F555,0xFAA5F955,0xFAAAFAAA,0xAAAFAAAB,0xAAAFAAAF,0xA557AA97,0x555F555F,
0xEAAAFAAA,0xFAAAEAAA,0xF55AF6AA,0xD555D555,0x555F555F,0x555F555F,0x5AAB556F,0xAAABAAAB,
0xF555D555,0xF555F555,0xFAA5F955,0xFAAAFAAA,0xAAAFAAAB,0xAAAFAAAF,0xA557AA97,0x555F555F,
0xEAAAFAAA,0xFAAAEAAA,0xF55AF6AA,0xD555D555,0x555F555F,0x555F555F,0x5AAB556F,0xAAABAAAB,
0xF555D555,0xF555F555,0xFAA5F955,0xFAAAFAAA,0x5AAB556F,0xAAABAAAB,0xAAAFAAAB,0xAAABAAAF,
0xFAA5F955,0xFAAAFAAA,0xEAAAFAAA,0xFAAAEAAA,0xA55FAA97,0x555F555F,0x555F555F,0x555F555F,
0xD55AF6AA,0xD555D555,0xF555D555,0xF555F555,0x5AAB556F,0xAAABAAAB,0xAAAFAAAB,0xAAABAAAF,
0xFAA5F955,0xFAAAFAAA,0xEAAAFAAA,0xFAAAEAAA,0xA55FAA97,0x555F555F,0x555F555F,0x555F555F,
0xD55AF6AA,0xD555D555,0xF555D555,0xF555F555,0x5AAB556F,0xAAABAAAB,0xAAAFAAAB,0xAAABAAAF,
0xFAA5F955,0xFAAAFAAA,0xEAAAFAAA,0xFAAAEAAA,0xA55FAA97,0x555F555F,0x555F555F,0x555F555F,
0xD55AF6AA,0xD555D555,0xF555D555,0xF555F555,0x5AAB556F,0xAAABAAAB,0xAAAFAAAB,0xAAABAAAF,
0xFAA5F955,0xFAAAFAAA,0xEAAAFAAA,0xFAAAEAAA,0xA55FAA97,0x555F555F,0x555F555F,0x555F555F,
0xD55AF6AA,0xD555D555,0xF555D555,0xF555F555,0x5AAB556F,0xAAABAAAB,0xAAAFAAAB,0xAAABAAAF,
0xFAA5F955,0xFAAAFAAA,0xEAAAFAAA,0xFAAAEAAA,0xA55FAA97,0x555F555F,0x555F555F,0x555F555F,
0xD55AF6AA,0xD555D555,0xF555D555,0xF555F555,0x5AAB556F,0xAAABAAAB,0xAAAFAAAB,0xAAABAAAF,
0xFAA5F955,0xFAAAFAAA,0xEAAAFAAA,0xFAAAEAAA,0xA55FAA97,0x555F555F,0x555F555F,0x555F555F,
0xD55AF6AA,0xD555D555,0xF555D555,0xF555F555,0x5AAB556F,0xAAABAAAB,0xAAAFAAAB,0xAAABAAAF,
0xFAA5F955,0xFAAAFAAA,0xEAAAFAAA,0xFAAAEAAA,0xA55FAA97,0x555F555F,0x555F555F,0x555F555F,
0xD55AF6AA,0xD555D555,0xF555D555,0xF555F555,0x5AAB556F,0xAAABAAAB,0xAAAFAAAB,0xAAABAAAF,
0xFAA5F955,0xFAAAFAAA,0xEAAAFAAA,0xFAAAEAAA,0xA55FAA97,0x555F555F,0x555F555F,0x555F555F,
0xD55AF6AA,0xD555D555,0xF555D555,0xF555F555,0x5AAB556F,0xAAABAAAB,0xAAAFAAAB,0xAAABAAAF,
0xFAA5F955,0xFAAAFAAA,0xEAAAFAAA,0xFAAAEAAA,0xA55FAA97,0x555F555F,0x555F555F,0x555F555F,
0xD55AF6AA,0xD555D555,0xF555D555,0xF555F555,0x5AAB556F,0xAAABAAAB,0xAAAFAAAB,0xAAABAAAF,
0xFAA5F955,0xFAAAFAAA,0xEAAAFAAA,0xFAAAEAAA,0xA55FAA97,0x555F555F,0x555F555F,0x555F555F,
0xD55AF6AA,0xD555D555,0xF555D555,0xF555F555,0x5AAB556F,0xAAABAAAB,0xAAAFAAAB,0xAAABAAAF,
0xFAA5F955,0xFAAAFAAA,0xEAAAFAAA,0xFAAAEAAA,0xA55FAA97,0x555F555F,0x555F555F,0x555F555F,
0xD55AF6AA,0xD555D555,0xF555D555,0xF555F555,0x5AAB556F,0xAAABAAAB,0xAAAFAAAB,0xAAABAAAF,
0xFAA5F955,0xFAAAFAAA,0xEAAAFAAA,0xFAAAEAAA,0xA55FAA97,0x555F555F,0x555F555F,0x555F555F,
0xD55AF6AA,0xD555D555,0xF555D555,0xF555F555,0x5AAB556F,0xAAABAAAB,0xAAAFAAAB,0xAAABAAAF,
0xFAA5F955,0xFAAAFAAA,0xEAAAFAAA,0xFAAAEAAA,0xA55FAA97,0x555F555F,0x555F555F,0x555F555F,
0xD55AF6AA,0xD555D555,0xF555D555,0xF555F555,0x5AAB556F,0xAAABAAAB,0xAAAFAAAB,0xAAABAAAF,
0xFAA5F955,0xFAAAFAAA,0xEAAAFAAA,0xFAAAEAAA,0xA55FAA97,0x555F555F,0x555F555F,0x555F555F,
0xD55AF6AA,0xD555D555,0xF555D555,0xF555F555,0x555F555F,0x555F555F,0x5AAF556F,0xAAABAAAB,
0xD555D555,0xF555F555,0xFAA5F955,0xFAAAFAAA,0xAAAFAAAF,0xAAABAAAF,0xA55FAA97,0x555F555F,
0xEAAAFAAA,0xFAAAEAAA,0xF55AF6AA,0xD555D555,0x555F555F,0x555F555F,0x5AAF556F,0xAAABAAAB,
0xD555D555,0xF555F555,0xFAA5F955,0xFAAAFAAA,0xAAAFAAAF,0xAAABAAAF,0xA55FAA97,0x555F555F,
0xEAAAFAAA,0xFAAAEAAA,0xF55AF6AA,0xD555D555,0x555F555F,0x555F555F,0x5AAF556F,0xAAABAAAB,
0xD555D555,0xF555F555,0xFAA5F955,0xFAAAFAAA,0xAAAFAAAF,0xAAABAAAF,0xA55FAA97,0x555F555F,
0xEAAAFAAA,0xFAAAEAAA,0xF55AF6AA,0xD555D555,0x555F555F,0x555F555F,0x5AAF556F,0xAAABAAAB,
0xD555D555,0xF555F555,0xFAA5F955,0xFAAAFAAA,0xAAAFAAAF,0xAAABAAAF,0xA55FAA97,0x555F555F,
0xEAAAFAAA,0xFAAAEAAA,0xF55AF6AA,0xD555D555,0x555F555F,0x555F555F,0x5AAF556F,0xAAABAAAB,
0xD555D555,0xF555F555,0xFAA5F955,0xFAAAFAAA,0xAAAFAAAF,0xAAABAAAF,0xA55FAA97,0x555F555F,
0xEAAAFAAA,0xFAAAEAAA,0xF55AF6AA,0xD555D555,0x555F555F,0x555F555F,0x5AAF556F,0xAAABAAAB,
0xD555D555,0xF555F555,0xFAA5F955,0xFAAAFAAA,0xAAAFAAAF,0xAAABAAAF,0xA55FAA97,0x555F555F,
0xEAAAFAAA,0xFAAAEAAA,0xF55AF6AA,0xD555D555,0x555F555F,0x555F555F,0x5AAF556F,0xAAABAAAB,
0xD555D555,0xF555F555,0xFAA5F955,0xFAAAFAAA,0xAAAFAAAF,0xAAABAAAF,0xA55FAA97,0x555F555F,
0xEAAAFAAA,0xFAAAEAAA,0xF55AF6AA,0xD555D555,0x555F555F,0x555F555F,0x5AAF556F,0xAAABAAAB,
0xD555D555,0xF555F555,0xFAA5F955,0xFAAAFAAA,0xAAAFAAAF,0xAAABAAAF,0xA55FAA97,0x555F555F,
0xEAAAFAAA,0xFAAAEAAA,0xF55AF6AA,0xD555D555,0x555F555F,0x555F555F,0x5AAF556F,0xAAABAAAB,
0xD555D555,0xF555F555,0xFAA5F955,0xFAAAFAAA,0xAAAFAAAF,0xAAABAAAF,0xA55FAA97,0x555F555F,
0xEAAAFAAA,0xFAAAEAAA,0xF55AF6AA,0xD555D555,0x555F555F,0x555F555F,0x5AAF556F,0xAAABAAAB,
0xD555D555,0xF555F555,0xFAA5F955,0xFAAAFAAA,0xAAAFAAAF,0xAAABAAAF,0xA55FAA97,0x555F555F,
0xEAAAFAAA,0xFAAAEAAA,0xF55AF6AA,0xD555D555,0x555F555F,0x555F555F,0x5AAF556F,0xAAABAAAB,
0xD555D555,0xF555F555,0xFAA5F955,0xFAAAFAAA,0xAAAFAAAF,0xAAABAAAF,0xA55FAA97,0x555F555F,
0xEAAAFAAA,0xFAAAEAAA,0xF55AF6AA,0xD555D555,0x555F555F,0x555F555F,0x5AAF556F,0xAAABAAAB,
0xD555D555,0xF555F555,0xFAA5F955,0xFAAAFAAA,0xAAAFAAAF,0xAAABAAAF,0xA55FAA97,0x555F555F,
0xEAAAFAAA,0xFAAAEAAA,0xF55AF6AA,0xD555D555,0x555F555F,0x555F555F,0x5AAF556F,0xAAABAAAB,
0xD555D555,0xF555F555,0xFAA5F955,0xFAAAFAAA,0xAAAFAAAF,0xAAABAAAF,0xA55FAA97,0x555F555F,
0xEAAAFAAA,0xFAAAEAAA,0xF55AF6AA,0xD555D555,0x555F555F,0x555F555F,0x5AAF556F,0xAAABAAAB,
0xD555D555,0xF555F555,0xFAA5F955,0xFAAAFAAA,0xAAAFAAAF,0xAAABAAAF,0xA55FAA97,0x555F555F,
0xEAAAFAAA,0xFAAAEAAA,0xF55AF6AA,0xD555D555,
};
const unsigned short WaterfallStream2x28Map[224] __attribute__((aligned(4)))=
{
0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
0x0008,0x0009,0x000a,0x000b,0x000c,0x000d,0x000e,0x000f,
0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
0x0018,0x0019,0x001a,0x001b,0x001c,0x001d,0x001e,0x001f,
0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
0x0028,0x0029,0x002a,0x002b,0x002c,0x002d,0x002e,0x002f,
0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
0x0038,0x0039,0x003a,0x003b,0x003c,0x003d,0x003e,0x003f,
0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
0x0048,0x0049,0x004a,0x004b,0x004c,0x004d,0x004e,0x004f,
0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
0x0058,0x0059,0x005a,0x005b,0x005c,0x005d,0x005e,0x005f,
0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
0x0068,0x0069,0x006a,0x006b,0x006c,0x006d,0x006e,0x006f,
0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
0x0078,0x0079,0x007a,0x007b,0x007c,0x007d,0x007e,0x007f,
0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,
0x0088,0x0089,0x008a,0x008b,0x008c,0x008d,0x008e,0x008f,
0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,
0x0098,0x0099,0x009a,0x009b,0x009c,0x009d,0x009e,0x009f,
0x00a0,0x00a1,0x00a2,0x00a3,0x00a4,0x00a5,0x00a6,0x00a7,
0x00a8,0x00a9,0x00aa,0x00ab,0x00ac,0x00ad,0x00ae,0x00af,
0x00b0,0x00b1,0x00b2,0x00b3,0x00b4,0x00b5,0x00b6,0x00b7,
0x00b8,0x00b9,0x00ba,0x00bb,0x00bc,0x00bd,0x00be,0x00bf,
0x00c0,0x00c1,0x00c2,0x00c3,0x00c4,0x00c5,0x00c6,0x00c7,
0x00c8,0x00c9,0x00ca,0x00cb,0x00cc,0x00cd,0x00ce,0x00cf,
0x00d0,0x00d1,0x00d2,0x00d3,0x00d4,0x00d5,0x00d6,0x00d7,
0x00d8,0x00d9,0x00da,0x00db,0x00dc,0x00dd,0x00de,0x00df,
};
//}}BLOCK(WaterfallStream2x28)
|
PROPHETIC NGO-GOVERNMENT RELATIONSHIPS: WHAT WOULD DANIEL DO? Abstract The Bible provides three models for effective faith-based action in public life: Jeremiah, Obadiah, and Daniel. These biblical characters exemplify varying approaches to NGO-government relations. Like Jeremiah, some actors and organizations speak totheir own government as a representative of the victims of repression. Others, like Amnesty International, are free from the control of the offending government and canpublicly condemn malfeasance as Obadiah did. Those following Daniels example earn the trust and respect of the government by obeying God first and foremost. As a result, actors like Daniel are able to affect change from the inside even at the highest levels.
|
The venture investment arm of massive meat manufacturer Tyson Foods is continuing its push into potential alternative methods of poultry production with a new investment in the Israeli startup Future Meat Technologies.
The backer of companies like the plant-based protein-maker Beyond Meat, and cultured-meat company Memphis Meats, Tyson Ventures’ latest investment is also tackling technology development to create mass-produced meat in a lab — instead of on the farm.
Future Meat Technologies is working to commercialize a manufacturing technology for fat and muscle cells that was first developed in the laboratories of the Hebrew University of Jerusalem.
The deal marks Tyson’s first investment in an Israeli startup and gives the company another potential horse in the race to develop substitutes for the factory slaughterhouses that provide most of America’s meat.
“This is definitely in the Memphis Meats… in the lab-based meat world,” says Justin Whitmore, executive vice president of corporate strategy and chief sustainability officer of Tyson Foods.
Whitmore takes pains to emphasize that Tyson is continuing to invest in its traditional business lines, but acknowledges that the company believes “in exploring additional opportunities for growth that give consumers more choices,” according to a statement.
While startups like Impossible Foods are focused on developing plant-based alternatives to the proteins that give meat its flavor, Future Meat Technologies and Memphis Meats are trying to use animal cells themselves to grow meat, rather than basically harvesting it from dead animals.
According to Nahmias, animal fat produces the flavors and aromas that stimulate taste buds, and he says that his company can produce the fat without harvesting animals and without genetic modification.
For Whitmore, what separates Future Meat Technologies and Memphis Meats is the scale of the bioreactors that the companies are using to make their meat. Both companies — indeed all companies on the hunt for a meat replacement — are looking for a way around relying on fetal bovine serum, which is now a crucial component for any lab-cultured meats.
The breadth of backgrounds among the investors that have come together to finance the $2.2 million seed round for Future Meat Technologies speak to the market opportunity that exists for getting a meat manufacturing replacement right.
“Global demand for protein and meat is growing at a rapid pace, with an estimated worldwide market of more than a trillion dollars, including explosive growth in China. We believe that making a healthy, non-GMO product that can meet this demand is an essential part of our mission,” said Rom Kshuk, the chief executive of Future Meat Technologies, in a statement.
One of the company’s first pilot products is lab-grown chicken meat that chefs have already used in some recipes.
“Hebrew University, home to Israel’s only Faculty of Agriculture, specializes in incubating applied research in such fields as animal-free meat sources. Future Meat Technologies’ innovations are revolutionizing the sector and leading the way in creating sustainable alternative protein sources,” said Dr. Yaron Daniely, president and CEO of Yissum.
|
from sklearn.dummy import DummyClassifier
import numpy as np
class DummyPredictor:
def __init__(self):
self.train_size = 807
self.test_size = 203
self.features = 3
def get_evaluation_score(self, y_train):
# Compare with benchmark model
dummy_x_train = np.random.random((self.train_size, self.features))
reshaped_y_train = self.__reshape_y_train(y_train)
# Build dummy model and predict
dummy_model = DummyClassifier(strategy="stratified", random_state=0)
dummy_model.fit(dummy_x_train, reshaped_y_train)
dummy_x_test = np.array(np.random.random((self.test_size, self.features)))
return dummy_model.predict(dummy_x_test)
def __reshape_y_train(self, y_train):
reshaped_y_train = []
for i in range(len(y_train)):
reshaped_y_train.append(y_train[i][0])
return reshaped_y_train
|
Simulation of Friction Stir Processing with Internally Cooled Tool Friction stir processing (FSP) is considered to be a promising sustainable technique for grain refinement of metallic alloys. The heat generated during FSP promotes dynamic recrystallization in processed material which is essential for grain sub-division process. However, excessive heat generation can lead to high temperatures of >300°C that may cause abnormal grain growth in the processed material. On the other hand, repetitive high temperature heating cycles can reduce the lifetime of the FSP tool. Therefore, it is essential to manage the process heat not only to achieve homogeneity and finer grain sizes in the processed material but also to reduce tool wear. In this work, friction stir processing of AZ31B Mg with an internally cooled FSP tool is simulated by a three-dimensional CFD model. We have studied the effect of rapid tool cooling on temperature and flow stress distribution in processed material. Additionally, the grain size and hardness of the processed material is estimated by using Zener-Holloman and Hall-Petch based relationships. It was found that FSP with internally cooled tool is a promising approach that effectively controls temperature levels during processing. Therefore it enables the achievement of better mechanical properties by effective grain refinement and has a positive effect on tool life.
|
Cervical assessment in women with hysteroscopic uterine septum resection: a retrospective cohort study Abstract Objective: To estimate whether cervical length measured by transvaginal ultrasonography in women with a history of hysteroscopic uterine septum resection predicts spontaneous preterm birth <35 weeks gestation. Methods: This retrospective cohort study compared women who had undergone hysteroscopic metroplasty, and were subsequently pregnant with singleton gestations delivered January 2003 to December 2012, to a low-risk control group. Transvaginal ultrasonographic cervical lengths were measured 1630 weeks gestation. The primary outcome was spontaneous preterm birth <35 weeks gestation and the primary exposure variable of interest was cervical length. Results: Women with a uterine septum resected (N=24) had a shorter cervical length (2.90cm) than the low-risk control group (N=141, 4.31cm, p<0.0001); and were more likely to have a cervical length <3.0cm (41.7% versus 1.4%, p<0.0001), <2.5cm (33.3% versus 0%, p<0.0001), <2.0cm (16.7% versus 0%, p<0.0001) and <1.5cm (12.5% versus 0%, p=0.003). Women with septum resected were more likely to receive corticosteroids (33.3% versus 11.3%, p=0.010), but were not more likely to have a spontaneous preterm birth <35 weeks (4.2% versus 0.7%, p=0.27). There were no differences noted in secondary outcomes including neonatal morbidity. Conclusion: Pregnant women with a history of a hysteroscopic uterine septum resection have shorter cervical lengths than low-risk controls but may not be at a higher risk of spontaneous preterm birth <35 weeks gestation. Further research with a larger sample size is needed to evaluate this group of women to determine if transvaginal ultrasonographic cervical length assessment is of benefit.
|
Power System Tracking State Estimator for Smart Grid Under Unreliable PMU Data Communication Network This paper presents a power system tracking state estimation (PSTSE) using cubature Kalman filter (CKF). The proposed approach utilizes synchronized phasor measurements from the phasor measurement units (PMUs) for the execution of the PSTSE. A state forecasting technique has been utilized to forecast the states for the period when PMU measurements are missing due to temporary failure of communication link or data packet loss. This helps in estimating the states of the power system during the period when the field measurements from PMU are not available. The effectiveness of the application of the CKF to the PSTSE has been demonstrated using two test systems.
|
Antiracist approaches to increase access to general and oral health care during a pandemic in the Pacific Islander community Abstract Limited data exists on Pacific Islander (PI) health, but a growing body of literature reports the existence of racial discrimination and inequities and mistrust of the healthcare system, leading to poor health outcomes. When COVID19 restricted health services, such inequities and mistrust due to historical trauma were magnified. This report describes one federally qualified health center's dental department's response utilizing culturebased approaches, community relationships, and the social determinants of health (SDOH) to dispel the stigma of COVID and restrictions on inperson care in order to lower barriers to accessing care. When the dental department transitioned to emergencyonly care, staff were redeployed to address significant inequities facing the PI community. Redeployment activities included building relationships with the most vulnerable patients, delivering healthy foods, supplies, oral hygiene kits to households, and canvasing neighborhood businesses with public health education. The mobile dental clinic, a trusted symbol in the community, also brought public health education to community testing events and food distributions. From March 2020 to July 2020, staff conducted over 800 outreach calls for health and food security, delivered over 2000 care packages and oral hygiene kits. Also, frequent community outreach by the mobile dental clinic led to a 10fold increase in COVID testing. Investing in relationship building can maintain access to health care and build trust in the health care system for PI communities. This approach may be relevant to others serving other communities experiencing racism. Pacific Island immigrants (PI) are a rapidly growing ethnic group in Hawaii and also the continental United States (US). In addition to those from Polynesia (and Melanesia to some extent), many PIs in Hawaii and the US come from the Federated States of Micronesia, one of the three nations with Compacts of Free Association (COFA) with the US. These compacts were a result of the United States' involvement in Micronesia during the post-World War II period and allows COFA citizens free ability to enter and work in the US, and access education and health services. 1 Until 2021, COFA citizens were not able to fully participate in Medicaid, despite a history of nuclear testing and militarization by the US, 2-4 resulting in a high prevalence of chronic diseases as well as generational trauma and distrust of the US and western systems of care. 5 Limited data on the general and oral health of PIs suggests high levels of chronic diseases and low utilization of preventive health services. 2,3 Health inequalities for PIs exist 5 and with the introduction of western diets and the increased use of processed sugar and manufactured foods both in their homeland and in the US, there has been an increase in morbidity and mortality from infectious and chronic diseases, including dental caries. 2, Conventional strategies to reduce these changes have been unsuccessful. 11,12 Studies have suggested that PIs experience racism on all levels-personally mediated, internalized, and institutional-and that it leads to increasing stress and mistrust, leading to decreased access to services. 13,14 Studies have suggested that PIs experience several layers of barriers to health care. Two key barriers include racial discrimination and cultural differences from their home countries. A study conducted with healthcare providers, interpreters, and community members revealed that PIs experience racial discrimination on a regular basis from their healthcare service providers, in their local community and from other institutions such as public schools and the police department. 15 The widespread racial discrimination currently faced by PIs, and the extensive history of war and exploitative treatment toward their home counties by the US, can cause PI patients to fear possible consequences of sharing health information with Western healthcare providers. Other barriers include difficulty communicating with providers, inadequate insurance coverage, and confusion about the healthcare system. For example, in several of the Pacific regions where patients migrate from, healthcare services are provided for free and there are no appointments needed because patients are taken on a walk-in basis. 5 STATE-LEVEL EFFORTS Due to the significant lack of state-level prevention and public health infrastructure in Hawaii to address health disparities that disproportionately affect PIs, the initiatives developed thus far have been led by community organizations such as non-profits, churches, and social service providers. 16,17 In a summary report 18 that outlines 20 years of work by the Healthy Hawaii Initiative, a multi-sector, state-wide public health collaborative, the following strategies were identified as integral in the successful targeting of health disparities among Native Hawaiian, Pacific Islander (PI), and Asian American populations: population-based prevention focus, culturally based approaches, community-clinical linkages, and the integration of prevention and treatment. The many barriers these patients face in accessing health care extends to dental care and there is a significant lack in prevention and public health infrastructure in Hawaii to address oral health disparities that disproportionately affect PIs. 16,19 Unlike other US states, Hawaii has only one centralized Department of Health with satellite district health offices and no department focused on oral health. Hawai'is state Dental Health Division was eliminated in the late 2000s along with the state dental director position, ending school-based screenings and any system for routine assessment of residents' oral health. There are currently no state-wide oral health programs. In 2009 the state's Medicaid program also moved from comprehensive care to emergency-only care for adults and has since remained at this level. Moreover, there is no community water fluoridation in Hawaii except on military bases, with only 8.8% of the Hawaii population served by community water systems receiving fluoridated water. 20 COMMUNITY-LEVEL EFFORTS: K OKUA KALIHI VALLEY COMPREHENSIVE FAMILY SERVICES K okua Kalihi Valley Comprehensive Family Services (KKV) is a federally qualified health center (FQHC) in Honolulu, Hawaii that serves the Kalihi Valley area. KKV was founded by community leaders in 1972, in response to inadequate healthcare services for Kalihi's population of primarily Asian and PIs (e.g., Filipino, Micronesian, Laotian, and Samoan), new-immigrant and low-income residents. Many are non-English or limited English speakers and most live in the two largest public housing complexes in Hawaii. There is a strong focus on KKV's motto, "neighbors being neighborly to neighbors," with the organizational approach to clinical services centering around patientprovider relationships by implementing the social determinants of health (SODH) and culture-based approaches. Since its founding, KKV has leveraged several strategies to develop culturally competent clinical services. These strategies include: collecting expertise from community members and empowering them as health educators and advocates, utilizing patient navigators and community health workers, and training KKV employees in cultural competence. That direct involvement of community members continues today. There has also been an intentional effort to hire individuals who live in the community and grow the organization's patient navigator and community health worker program. The latter has been considered one of the most successful strategies for improving healthcare access for patients of color and narrowing racial health disparities. Cultural competence is woven into various trainings for clinical and administrative staff and there are regular cross-department meetings. Cultural immersion has also been an effective form of cultural competence training. Many of KKV's dental staff have engaged in cultural activities at the organization's 100-acre nature preserve, Hooulu Aina, that provides land-based and PI cultural programming. Staff have shared the experience improved their understanding of the community and their relationships with cultural workers at the organization. Other culturally competent strategies have included extensive language accessibility through all communications materials for the main dialects of the community, including 26 different languages for all patient interactions (from front desk to provider), and increasing access through mobile clinics and school-based programming. Previous studies have suggested that cultural competence trainings and programming have proven effective not only in strengthening patient relationships, but also in reducing racial and ethnic health disparities and improving overall quality of care. 17,21,22 Dental care was the first service provided by KKV, primarily because community members went door-todoor asking Kalihi residents about their most significant health needs. Today the dental department has grown from used military trailers to a 12-operatory main clinic that includes dental residency programs * that help to bring specialist-level care to the community. It also includes a school-based sealant program using mobile clinics, also known as the "Dental Bus", that brings preventive oral health services to area local schools and ensures that all Kalihi youth have a dental home. 23 The dental buses are a familiar and trusted symbol of KKV in the community, and frequently are requested by many children, schools, and events. COVID-19 IMPACT AND PROGRAM ACTIVITIES The COVID-19 pandemic highlighted the inequities in the PI community in Kalihi. 24 On March 16, 2020 the dental department followed national guidance and moved to emergency-only dental care. In compliance, the department faced critical issues and needs in addressing the pandemic including the loss of jobs and income for the population and staff, ensuring access to food and supplies, and the immediate need to educate the community about preventing the spread of COVID-19. In response to these needs, the dental department followed the lead of KKV's Elder Care program and designed a COVID-19 outreach program with other KKV departments to stand in solidarity with a community that has experienced the impact of institutional racism and racial discrimination for generations. It was important for KKV to stand in solidarity with the community for multiple reasons including: COVID-19 would spread rapidly through close quarters in public housing units where many did not have space to quarantine or isolate; many in the community did not understand concepts of quarantine, mask wearing, or other aspects of the virus; many in the community feared testing because of generations of mistrust of the health system, as well as fear of testing positive and not having adequate space for quarantine, missing work, or getting evicted; for years the community had looked to KKV for guidance; KKV knew it needed to ensure equity of testing, care, and services that allowed people to weather the pandemic. Dental staff joined other health center employees to focus on patients who were seniors, had mental or physical disabilities, or had comorbidities that qualified them as "high-risk" for COVID-19 symptoms. Staff called these patients to check-in with them and screen for health status factors, emergency needs for food, medication, health care, socialization, and other supports for maintaining health and quality of life. These calls were opportunities to listen deeply to patients and an opportunity to build relationships, rather than cycling through a list of questions. This method of data collection is more familiar to the PI community and builds trust, rather than feeling extracted from-a common feeling from generations of mistrust of western health systems. Based on their status, dental staff made deliveries to the homes of patients and asked how they were feeling, while adhering to strict PPE protocol. Deliveries included oral hygiene supplies, medications, fresh produce, prepared healthy meals from KKV's cafe, technology support, 25 and COVID-19 kits that included informational materials, masks, soap, and hand sanitizer. The community's network of relationships helped KKV identify which families needed support, as community members would connect neighbors to the services. These deliveries and phone calls were more than just sharing resources; they were about building community, improving mental health, and helping people connect to the community. Recognizing that many of the local mom and pop shops were frequent stops for the community, the dental staff also visited local businesses to check-in with them and distribute public health messaging on COVID-19. The Dental Bus, which is normally used for the schoolsealant program, was repurposed to distribute COVID-19 kits and information at local public housing, and health center-led COVID-19 testing events. The familiarity of the Dental Bus in the community helped to attract community members to get tested, since there was great fear of being tested and the subsequent ramifications should they test positive (fear of being evicted, lack of space to isolate). At the main clinic, dental staff continued to provide emergency-only dental care and patients were given a survey asking if they considered going to the emergency departments to stop the pain in their mouth or face if the dental clinic were not open. The entire FQHC achieved the following results from March 2020 to July 2020: conducted over 800 outreach calls for health and food security, delivered over 2000 care packages and oral hygiene kits, visited 14 local businesses to support KKV's public health messaging campaign, community outreach increased COVID-testing by 10-fold, 796 unduplicated patients received emergency dental care, and of the 796 patients who received emergency care, over 47% of patients reported that if not seen, they considered going to the Emergency Room to stop the pain in their mouth or face. *Today there is only an Advanced Education in General Dentistry (AEGD) program. Previously, there were also residencies in pediatric dentistry and dental public health. LESSONS LEARNED AND FUTURE DIRECTIONS The pandemic allowed the dental department to expand beyond its traditional methods of providing culturally competent care to the PI community and enhance its SODH approach through more community engagement. The department also learned methods for data collection to better serve the needs of the community. More importantly, the dental department learned about the role it plays in potentially diverting costly dental-related emergency room visits, as reflected by the 47% of patients who reported considering going to the emergency room to stop the pain in their mouth or face if not seen at KKV. The dental department conducted seven teledentistry visits and learned that such visits are difficult without specialized intraoral camera equipment. However, tele-dentistry may be useful for some post-op visits and possibly preventive motivational interviewing check-ins. The community's responsiveness to KKV's COVID education and outreach efforts may reflect its value on social connections and strong relationships, a core value in PI culture, 26 which the organization and dental staff have developed with patients, as well as the power of culturally appropriate services. This suggests that KKV's best strategy for countering racial prejudice, systemic racism, and the oppression of minority groups, in particular the PI immigrants who make up a majority of KKV's patient population, may be through prioritizing meaningful relationship building in every patient interaction. 27 Examples include capitalizing on relationships built with community and religious leaders, as well as community members who are revered and known as elders or "super aunties" who provide guidance to the community, and getting these respected individuals to spread the message on the importance and value of oral health and bridge the oral health literacy gap, to seek routine care and not only seeking care when they are in pain; designing a health system that is accommodating to PI culture of walk-in appointments; using mobile clinics to bring care to them. This improves racial inequities in community health, and supports the larger movement toward improved quality of care, oral health outcomes, and patient satisfaction and retention. 28 Future work for the dental department includes identifying opportunities to incorporate these lessons in its school-based sealant program, coordination with other KKV programs, oral health education and prevention, and data collection and evaluation regarding community oral health disparities. This includes identifying opportunities to check-in with patients since this pandemic outreach program has revealed the need for social connections, a core value in many PI cultures. For example, screening questions for COVID-19 can be transformed to ask about the general well-being of individuals in ways that deepen the dentist-patient relationship and build trust which could increase patient adherence and loyalty, and lead to better therapeutic results and anxiety management. 29 Moreover, checking in with individuals and building relationships can be incorporated to oral health education and prevention and follow-ups with high-risk individuals identified in the school-based programs, young children in WIC programs, and those receiving well-child checks. 30 Strong relationships could make such oral health education and prevention a powerful strategy to prevent oral diseases from a young age. ACKNOWLEDGMENTS The authors would like to thank the Hawaii Dental Service (HDS) Foundation for their generous support to fund this COVID-19 outreach program. The authors would also like to thank the dental and other KKV staff from its larger COVID-19 outreach program-Hui Hoaka-and the Elder Care Program for their efforts with data collection, maintenance, and continued support of the Kalihi community throughout the pandemic.
|
THE RESPONSE OF SECTOR INDEX OPTIONS ON TREASURY SECURITIES TO MACRO-ECONOMIC ANNOUNCEMENTS The flow of new information into a market changes prices as participants adjust their expectations in light of their new knowledge. This paper links two strands of existing micro-structure research by integrating recent findings on how macroeconomic announcements move markets with well-known theoretical relationships between asset prices and the value of their derivatives. This allows us to develop testable hypotheses about how sector index options on Treasury securities should behave before and after scheduled macroeconomic announcements. To our knowledge, this paper is the first attempt to use transactions data on index options to investigate the timing of pre-and post-announcement option price responses and volatility in the underlying cash market. Empirical results support our hypotheses in that we are able to identify a priori which announcements should lead to price movements in the options market; when, in which direction and for how long these price reactions should occur, and which announcements should generate the strongest option price response. We use transactions data to confirm each of our hypotheses and to demonstrate that the relationship between pre-announcement option prices and expected cash market volatility due to scheduled events is much more intricate and precise than has been documented in previous research.
|
Assessment of an experimental rodent model of pediatric mild traumatic brain injury. Childhood is one the highest risk periods for experiencing a mild traumatic brain injury (mTBI) from sports-related concussions, motor vehicle accidents, and falls. In addition, many children experience lingering symptomology (post-concussion syndrome) from these closed head injuries. Although the negative sequel of mTBI has been described, a clinically reliable animal model of mild pediatric brain injury has not. The purpose of this study was to examine the validity of a modified weight-drop technique as a model for the induction of mTBI/concussion in juvenile rats following a single impact. Male and female rats (P30) were exposed to a single mTBI or a sham injury followed by a behavioral test battery. Juvenile rats who experienced a single mTBI displayed significant motor/balance impairments when tested on the beam walking task and in the open field, as well as deficits of executive functioning as measured with the novel context mismatch task and the probe trial of the Morris water task. In addition, both male and female rats showed depression-like behavior in the forced swim task, with male rats also exhibiting decreased anxiety-related behaviors in the elevated plus maze. The results from this study suggest that the modified weight-drop technique induces a clinically relevant behavioral phenotype in juvenile rats, and may provide researchers with a reliable animal model of mTBI/concussion from which clinical therapeutic strategies could be developed.
|
/* ===========================================================================
* Copyright (C) 2018 CapsicoHealth 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.
*/
package tilda.utils.concurrent;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import tilda.utils.DurationUtil;
public abstract class SimpleRunnable implements Runnable
{
protected static final Logger LOG = LogManager.getLogger(SimpleRunnable.class);
public SimpleRunnable(String Name)
{
_Name = Name;
}
String _Name;
Executor _Executor;
long _taskTimeNano = 0;
@Override
public void run()
{
long T0 = System.nanoTime();
try
{
doRun();
_taskTimeNano = System.nanoTime() - T0;
LOG.debug("\n\n*******************************************************************************************\n"
+ "** Task " + _Name + " ran in " + DurationUtil.printDuration(_taskTimeNano) + ".\n"
+ "*******************************************************************************************\n\n");
}
catch (Exception E)
{
LOG.error("An error occurred in the thread\n", E);
_Executor.addException(E);
_taskTimeNano = System.nanoTime() - T0;
}
}
public abstract void doRun()
throws Exception;
}
|
package model
import (
"fmt"
"strings"
. "go.knocknote.io/eevee/code"
"go.knocknote.io/eevee/types"
)
func (g *Generator) Constructor(h *types.ModelMethodHelper) Code {
decl := &types.ConstructorDeclare{
Class: h.Class,
MethodName: fmt.Sprintf("New%s", h.Class.Name.CamelName()),
Args: types.ValueDeclares{
{
Name: "value",
Type: &types.TypeDeclare{
Type: &types.Type{
PackageName: h.Package("entity"),
Name: h.Class.Name.CamelName(),
},
IsPointer: true,
},
},
{
Name: fmt.Sprintf("%sDAO", h.Class.Name.CamelLowerName()),
Type: &types.TypeDeclare{
Type: &types.Type{
PackageName: h.Package("dao"),
Name: h.Class.Name.CamelName(),
},
},
},
},
Return: types.ValueDeclares{
{
Type: h.ModelType(),
},
},
}
properties := Dict{
Id(h.Class.Name.CamelName()): Id("value"),
Id(fmt.Sprintf("%sDAO", h.Class.Name.CamelLowerName())): Id(fmt.Sprintf("%sDAO", h.Class.Name.CamelLowerName())),
}
return decl.MethodInterface(h.ImportList).Block(
Return(Op("&").Id(h.Class.Name.CamelName()).Values(properties)),
)
}
func (g *Generator) CollectionConstructor(h *types.ModelMethodHelper) Code {
decl := &types.ConstructorDeclare{
Class: h.Class,
MethodName: fmt.Sprintf("New%s", h.Class.Name.PluralCamelName()),
Args: types.ValueDeclares{
{
Name: "entities",
Type: &types.TypeDeclare{
Type: &types.Type{
PackageName: h.Package("entity"),
Name: h.Class.Name.PluralCamelName(),
},
},
},
},
Return: types.ValueDeclares{
{
Type: h.ModelCollectionType(),
},
},
}
properties := Dict{
Id("values"): Make(Index().Id(fmt.Sprintf("*%s", h.Class.Name.CamelName())), Lit(0), Len(Id("entities"))),
}
definedPropertyMap := map[string]struct{}{}
for _, member := range h.Class.RelationMembers() {
relation := member.Relation
if relation.Custom {
continue
}
if relation.All {
continue
}
internalMember := h.Class.MemberByName(relation.Internal.SnakeName())
propertyName := internalMember.Name.PluralCamelLowerName()
if _, exists := definedPropertyMap[propertyName]; exists {
continue
}
properties[Id(propertyName)] = Id("entities").Dot(internalMember.Name.PluralCamelName()).Call()
definedPropertyMap[propertyName] = struct{}{}
}
return decl.MethodInterface(h.ImportList).Block(
Return(Op("&").Id(h.Class.Name.PluralCamelName()).Values(properties)),
)
}
func (g *Generator) Create(h *types.ModelMethodHelper) *types.Method {
decl := h.CreateMethodDeclare()
decl.MethodName = "Create"
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: "ctx",
Type: &types.TypeDeclare{
Type: &types.Type{
PackageName: "context",
Name: "Context",
},
},
})
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: types.TypeDeclareWithType(types.ErrorType),
})
return &types.Method{
Decl: decl,
Body: []Code{
If(h.DAO().Op("==").Nil()).Block(
Comment("for testing"),
Return(Nil()),
),
If(h.Receiver().Dot("isAlreadyCreated")).Block(
Return(Qual(h.Package("xerrors"), "New").Call(Lit("this instance has already created"))),
),
If(
Err().Op(":=").Add(h.DAO().Dot("Create").Call(Id("ctx"), h.Receiver().Dot(h.Class.Name.CamelName()))),
Err().Op("!=").Nil(),
).Block(
Return(Qual(h.Package("xerrors"), "Errorf").Call(Lit("failed to Create: %w"), Err())),
),
h.Receiver().Dot("savedValue").Op("=").Op("*").Add(h.Receiver().Dot(h.Class.Name.CamelName())),
h.Receiver().Dot("isAlreadyCreated").Op("=").True(),
Return(Nil()),
},
}
}
func (g *Generator) Update(h *types.ModelMethodHelper) *types.Method {
decl := h.CreateMethodDeclare()
decl.MethodName = "Update"
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: "ctx",
Type: &types.TypeDeclare{
Type: &types.Type{
PackageName: "context",
Name: "Context",
},
},
})
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: types.TypeDeclareWithType(types.ErrorType),
})
conditions := []Code{}
for _, member := range h.Class.Members {
if member.Relation != nil || member.Extend {
continue
}
conditions = append(conditions, If(h.Receiver().Dot("savedValue").Dot(member.Name.CamelName()).
Op("!=").Add(h.Receiver().Dot(member.Name.CamelName()))).Block(
Id("isRequiredUpdate").Op("=").True(),
))
}
body := []Code{
If(h.DAO().Op("==").Nil()).Block(
Comment("for testing"),
Return(Nil()),
),
Id("isRequiredUpdate").Op(":=").False(),
}
body = append(body, conditions...)
body = append(body, []Code{
If(Op("!").Id("isRequiredUpdate")).Block(Return(Nil())),
If(Err().Op(":=").Add(
h.DAO().Dot("Update").Call(Id("ctx"), h.Receiver().Dot(h.Class.Name.CamelName())),
), Err().Op("!=").Nil()).Block(
Return(Qual(h.Package("xerrors"), "Errorf").Call(Lit("failed to Update: %w"), Err())),
),
h.Receiver().Dot("savedValue").Op("=").Op("*").Add(h.Receiver().Dot(h.Class.Name.CamelName())),
Return(Nil()),
}...)
return &types.Method{
Decl: decl,
Body: body,
}
}
func (g *Generator) Delete(h *types.ModelMethodHelper) *types.Method {
decl := h.CreateMethodDeclare()
decl.MethodName = "Delete"
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: "ctx",
Type: &types.TypeDeclare{
Type: &types.Type{
PackageName: "context",
Name: "Context",
},
},
})
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: types.TypeDeclareWithType(types.ErrorType),
})
return &types.Method{
Decl: decl,
Body: []Code{
If(h.DAO().Op("==").Nil()).Block(
Comment("for testing"),
Return(Nil()),
),
If(Err().Op(":=").Add(h.DAO().Dot("DeleteByID").Call(Id("ctx"), h.Receiver().Dot("ID"))), Err().Op("!=").Nil()).Block(
Return(Qual(h.Package("xerrors"), "Errorf").Call(Lit("failed to Delete: %w"), Err())),
),
Return(Nil()),
},
}
}
func (g *Generator) SetAlreadyCreated(h *types.ModelMethodHelper) *types.Method {
decl := h.CreateMethodDeclare()
decl.MethodName = "SetAlreadyCreated"
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: "isAlreadyCreated",
Type: types.TypeDeclareWithType(types.BoolType),
})
return &types.Method{
Decl: decl,
Body: []Code{
h.Receiver().Dot("isAlreadyCreated").Op("=").Id("isAlreadyCreated"),
},
}
}
func (g *Generator) SetSavedValue(h *types.ModelMethodHelper) *types.Method {
decl := h.CreateMethodDeclare()
decl.MethodName = "SetSavedValue"
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: "savedValue",
Type: &types.TypeDeclare{
Type: &types.Type{
PackageName: h.Package("entity"),
Name: h.Class.Name.CamelName(),
},
IsPointer: true,
},
})
return &types.Method{
Decl: decl,
Body: []Code{
h.Receiver().Dot("savedValue").Op("=").Op("*").Id("savedValue"),
},
}
}
func (g *Generator) SetConverter(h *types.ModelMethodHelper) *types.Method {
decl := h.CreateMethodDeclare()
decl.MethodName = "SetConverter"
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: "conv",
Type: types.TypeDeclareWithName("ModelConverter"),
})
return &types.Method{
Decl: decl,
Body: []Code{
h.Receiver().Dot("conv").Op("=").Id("conv"),
},
}
}
func (g *Generator) Save(h *types.ModelMethodHelper) *types.Method {
decl := h.CreateMethodDeclare()
decl.MethodName = "Save"
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: "ctx",
Type: &types.TypeDeclare{
Type: &types.Type{
PackageName: "context",
Name: "Context",
},
},
})
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: types.TypeDeclareWithType(types.ErrorType),
})
return &types.Method{
Decl: decl,
Body: []Code{
If(h.Receiver().Dot("isAlreadyCreated")).Block(
If(Err().Op(":=").Add(h.Receiver().Dot("Update").Call(Id("ctx"))), Err().Op("!=").Nil()).Block(
Return(Qual(h.Package("xerrors"), "Errorf").Call(Lit("failed to Update: %w"), Err())),
),
Return(Nil()),
),
If(Err().Op(":=").Add(h.Receiver().Dot("Create").Call(Id("ctx"))), Err().Op("!=").Nil()).Block(
Return(Qual(h.Package("xerrors"), "Errorf").Call(Lit("failed to Create: %w"), Err())),
),
Return(Nil()),
},
}
}
func (g *Generator) CreateForCollection(h *types.ModelMethodHelper) *types.Method {
decl := h.CreateCollectionMethodDeclare()
decl.MethodName = "Create"
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: "ctx",
Type: &types.TypeDeclare{
Type: &types.Type{
PackageName: "context",
Name: "Context",
},
},
})
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: types.TypeDeclareWithType(types.ErrorType),
})
return &types.Method{
Decl: decl,
Body: []Code{
If(
Err().Op(":=").Add(h.Receiver().Dot("EachWithError").Call(
Func().Params(Id("v").Op("*").Id(h.Class.Name.CamelName())).Id("error").Block(
If(Err().Op(":=").Id("v").Dot("Create").Call(Id("ctx")), Err().Op("!=").Nil()).Block(
Return(Qual(h.Package("xerrors"), "Errorf").Call(Lit("failed to Create: %w"), Err())),
),
Return(Nil()),
),
)),
Err().Op("!=").Nil(),
).Block(
Return(Qual(h.Package("xerrors"), "Errorf").Call(
Lit(fmt.Sprintf("interrupt iteration for %s: %%w", h.Class.Name.PluralCamelName())),
Err(),
)),
),
Return(Nil()),
},
}
}
func (g *Generator) UpdateForCollection(h *types.ModelMethodHelper) *types.Method {
decl := h.CreateCollectionMethodDeclare()
decl.MethodName = "Update"
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: "ctx",
Type: &types.TypeDeclare{
Type: &types.Type{
PackageName: "context",
Name: "Context",
},
},
})
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: types.TypeDeclareWithType(types.ErrorType),
})
return &types.Method{
Decl: decl,
Body: []Code{
If(
Err().Op(":=").Add(h.Receiver().Dot("EachWithError").Call(
Func().Params(Id("v").Op("*").Id(h.Class.Name.CamelName())).Id("error").Block(
If(Err().Op(":=").Id("v").Dot("Update").Call(Id("ctx")), Err().Op("!=").Nil()).Block(
Return(Qual(h.Package("xerrors"), "Errorf").Call(Lit("failed to Update: %w"), Err())),
),
Return(Nil()),
),
)),
Err().Op("!=").Nil(),
).Block(
Return(Qual(h.Package("xerrors"), "Errorf").Call(
Lit(fmt.Sprintf("interrupt iteration for %s: %%w", h.Class.Name.PluralCamelName())),
Err(),
)),
),
Return(Nil()),
},
}
}
func (g *Generator) SaveForCollection(h *types.ModelMethodHelper) *types.Method {
decl := h.CreateCollectionMethodDeclare()
decl.MethodName = "Save"
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: "ctx",
Type: &types.TypeDeclare{
Type: &types.Type{
PackageName: "context",
Name: "Context",
},
},
})
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: types.TypeDeclareWithType(types.ErrorType),
})
return &types.Method{
Decl: decl,
Body: []Code{
If(
Err().Op(":=").Add(h.Receiver().Dot("EachWithError").Call(
Func().Params(Id("v").Op("*").Id(h.Class.Name.CamelName())).Id("error").Block(
If(Err().Op(":=").Id("v").Dot("Save").Call(Id("ctx")), Err().Op("!=").Nil()).Block(
Return(Qual(h.Package("xerrors"), "Errorf").Call(Lit("failed to Save: %w"), Err())),
),
Return(Nil()),
),
)),
Err().Op("!=").Nil(),
).Block(
Return(Qual(h.Package("xerrors"), "Errorf").Call(
Lit(fmt.Sprintf("interrupt iteration for %s: %%w", h.Class.Name.PluralCamelName())),
Err(),
)),
),
Return(Nil()),
},
}
}
func (g *Generator) NewCollection(h *types.ModelMethodHelper) *types.Method {
decl := h.CreateCollectionMethodDeclare()
decl.MethodName = fmt.Sprintf("new%s", h.Class.Name.PluralCamelName())
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: "values",
Type: types.TypeDeclareWithName(fmt.Sprintf("[]*%s", h.Class.Name.CamelName())),
})
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: h.ModelCollectionType(),
})
dict := Dict{
Id("values"): Id("values"),
}
for _, property := range h.CollectionProperties() {
dict[Id(property.Name)] = h.Receiver().Dot(property.Name)
}
return &types.Method{
Decl: decl,
Body: []Code{
Return(Op("&").Id(h.ModelCollectionName()).Values(dict)),
},
}
}
func (g *Generator) Each(h *types.ModelMethodHelper) *types.Method {
decl := h.CreateCollectionMethodDeclare()
decl.MethodName = "Each"
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: "iter",
Type: types.TypeDeclareWithName(fmt.Sprintf("func(*%s)", h.Class.Name.CamelName())),
})
return &types.Method{
Decl: decl,
Body: []Code{
If(h.Receiver().Op("==").Nil()).Block(Return()),
For(List(Id("_"), Id("value")).Op(":=").Range().Add(h.Field("values"))).Block(
Id("iter").Call(Id("value")),
),
},
}
}
func (g *Generator) EachIndex(h *types.ModelMethodHelper) *types.Method {
decl := h.CreateCollectionMethodDeclare()
decl.MethodName = "EachIndex"
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: "iter",
Type: types.TypeDeclareWithName(fmt.Sprintf("func(int, *%s)", h.Class.Name.CamelName())),
})
return &types.Method{
Decl: decl,
Body: []Code{
If(h.Receiver().Op("==").Nil()).Block(Return()),
For(List(Id("idx"), Id("value")).Op(":=").Range().Add(h.Field("values"))).Block(
Id("iter").Call(Id("idx"), Id("value")),
),
},
}
}
func (g *Generator) EachWithError(h *types.ModelMethodHelper) *types.Method {
decl := h.CreateCollectionMethodDeclare()
decl.MethodName = "EachWithError"
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: "iter",
Type: types.TypeDeclareWithName(fmt.Sprintf("func(*%s) error", h.Class.Name.CamelName())),
})
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: types.TypeDeclareWithType(types.ErrorType),
})
return &types.Method{
Decl: decl,
Body: []Code{
If(h.Receiver().Op("==").Nil()).Block(Return(Nil())),
For(List(Id("_"), Id("value")).Op(":=").Range().Add(h.Field("values"))).Block(
If(Err().Op(":=").Id("iter").Call(Id("value")), Err().Op("!=").Nil()).Block(
Return(Qual(h.Package("xerrors"), "Errorf").Call(Lit("failed to iteration: %w"), Err())),
),
),
Return(Nil()),
},
}
}
func (g *Generator) EachIndexWithError(h *types.ModelMethodHelper) *types.Method {
decl := h.CreateCollectionMethodDeclare()
decl.MethodName = "EachIndexWithError"
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: "iter",
Type: types.TypeDeclareWithName(fmt.Sprintf("func(int, *%s) error", h.Class.Name.CamelName())),
})
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: types.TypeDeclareWithType(types.ErrorType),
})
return &types.Method{
Decl: decl,
Body: []Code{
If(h.Receiver().Op("==").Nil()).Block(Return(Nil())),
For(List(Id("idx"), Id("value")).Op(":=").Range().Add(h.Field("values"))).Block(
If(Err().Op(":=").Id("iter").Call(Id("idx"), Id("value")), Err().Op("!=").Nil()).Block(
Return(Qual(h.Package("xerrors"), "Errorf").Call(Lit("failed to iteration: %w"), Err())),
),
),
Return(Nil()),
},
}
}
func (g *Generator) Map(h *types.ModelMethodHelper) *types.Method {
decl := h.CreateCollectionMethodDeclare()
decl.MethodName = "Map"
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: "mapFunc",
Type: types.TypeDeclareWithName(fmt.Sprintf("func(*%s) *%s", h.ModelName(), h.ModelName())),
})
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: h.ModelCollectionType(),
})
return &types.Method{
Decl: decl,
Body: []Code{
If(h.Receiver().Op("==").Nil()).Block(Return(Nil())),
Id("mappedValues").Op(":=").Index().Op("*").Id(h.ModelName()).Values(),
For(List(Id("_"), Id("value")).Op(":=").Range().Add(h.Field("values"))).Block(
Id("mappedValue").Op(":=").Id("mapFunc").Call(Id("value")),
If(Id("mappedValue").Op("!=").Nil()).Block(
Id("mappedValues").Op("=").Append(Id("mappedValues"), Id("mappedValue")),
),
),
Return(h.Receiver().Dot(fmt.Sprintf("new%s", h.Class.Name.PluralCamelName())).Call(Id("mappedValues"))),
},
}
}
func (g *Generator) Any(h *types.ModelMethodHelper) *types.Method {
decl := h.CreateCollectionMethodDeclare()
decl.MethodName = "Any"
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: "cond",
Type: types.TypeDeclareWithName(fmt.Sprintf("func(*%s) bool", h.ModelName())),
})
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: types.TypeDeclareWithType(types.BoolType),
})
return &types.Method{
Decl: decl,
Body: []Code{
If(h.Receiver().Op("==").Nil()).Block(Return(False())),
For(List(Id("_"), Id("value")).Op(":=").Range().Add(h.Field("values"))).Block(
If(Id("cond").Call(Id("value"))).Block(
Return(True()),
),
),
Return(False()),
},
}
}
func (g *Generator) Some(h *types.ModelMethodHelper) *types.Method {
decl := h.CreateCollectionMethodDeclare()
decl.MethodName = "Some"
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: "cond",
Type: types.TypeDeclareWithName(fmt.Sprintf("func(*%s) bool", h.ModelName())),
})
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: types.TypeDeclareWithType(types.BoolType),
})
return &types.Method{
Decl: decl,
Body: []Code{
Return(h.Receiver().Dot("Any").Call(Id("cond"))),
},
}
}
func (g *Generator) IsIncluded(h *types.ModelMethodHelper) *types.Method {
decl := h.CreateCollectionMethodDeclare()
decl.MethodName = "IsIncluded"
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: "cond",
Type: types.TypeDeclareWithName(fmt.Sprintf("func(*%s) bool", h.ModelName())),
})
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: types.TypeDeclareWithType(types.BoolType),
})
return &types.Method{
Decl: decl,
Body: []Code{
Return(h.Receiver().Dot("Any").Call(Id("cond"))),
},
}
}
func (g *Generator) All(h *types.ModelMethodHelper) *types.Method {
decl := h.CreateCollectionMethodDeclare()
decl.MethodName = "All"
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: "cond",
Type: types.TypeDeclareWithName(fmt.Sprintf("func(*%s) bool", h.ModelName())),
})
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: types.TypeDeclareWithType(types.BoolType),
})
return &types.Method{
Decl: decl,
Body: []Code{
If(Id("m").Op("==").Nil()).Block(Return(False())),
For(List(Id("_"), Id("value")).Op(":=").Range().Add(h.Field("values"))).Block(
If(Op("!").Id("cond").Call(Id("value"))).Block(
Return(False()),
),
),
Return(True()),
},
}
}
func (g *Generator) Sort(h *types.ModelMethodHelper) *types.Method {
decl := h.CreateCollectionMethodDeclare()
decl.MethodName = "Sort"
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: "compare",
Type: types.TypeDeclareWithName(fmt.Sprintf("func(*%s, *%s) bool", h.ModelName(), h.ModelName())),
})
return &types.Method{
Decl: decl,
Body: []Code{
If(Id("m").Op("==").Nil()).Block(Return()),
Qual("sort", "Slice").Call(
h.Field("values"), Func().Params(List(Id("i"), Id("j").Id("int"))).Id("bool").Block(
Return(
Id("compare").Call(h.Field("values").Index(Id("i")), h.Field("values").Index(Id("j"))),
),
),
),
},
}
}
func (g *Generator) SortStable(h *types.ModelMethodHelper) *types.Method {
decl := h.CreateCollectionMethodDeclare()
decl.MethodName = "SortStable"
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: "compare",
Type: types.TypeDeclareWithName(fmt.Sprintf("func(*%s, *%s) bool", h.ModelName(), h.ModelName())),
})
return &types.Method{
Decl: decl,
Body: []Code{
If(Id("m").Op("==").Nil()).Block(Return()),
Qual("sort", "SliceStable").Call(
h.Field("values"), Func().Params(List(Id("i"), Id("j").Id("int"))).Id("bool").Block(
Return(
Id("compare").Call(h.Field("values").Index(Id("i")), h.Field("values").Index(Id("j"))),
),
),
),
},
}
}
func (g *Generator) Find(h *types.ModelMethodHelper) *types.Method {
decl := h.CreateCollectionMethodDeclare()
decl.MethodName = "Find"
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: "cond",
Type: types.TypeDeclareWithName(fmt.Sprintf("func(*%s) bool", h.ModelName())),
})
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: h.ModelType(),
})
return &types.Method{
Decl: decl,
Body: []Code{
If(Id("m").Op("==").Nil()).Block(Return(Nil())),
For(List(Id("_"), Id("value")).Op(":=").Range().Add(h.Field("values"))).Block(
If(Id("cond").Call(Id("value"))).Block(
Return(Id("value")),
),
),
Return(Nil()),
},
}
}
func (g *Generator) Filter(h *types.ModelMethodHelper) *types.Method {
decl := h.CreateCollectionMethodDeclare()
decl.MethodName = "Filter"
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: "filter",
Type: types.TypeDeclareWithName(fmt.Sprintf("func(*%s) bool", h.ModelName())),
})
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: h.ModelCollectionType(),
})
return &types.Method{
Decl: decl,
Body: []Code{
If(Id("m").Op("==").Nil()).Block(Return(Nil())),
Id("filteredValues").Op(":=").Index().Op("*").Id(h.ModelName()).Values(),
For(List(Id("_"), Id("value")).Op(":=").Range().Add(h.Field("values"))).Block(
If(Id("filter").Call(Id("value"))).Block(
Id("filteredValues").Op("=").Append(Id("filteredValues"), Id("value")),
),
),
Return(h.Receiver().Dot(fmt.Sprintf("new%s", h.Class.Name.PluralCamelName())).Call(Id("filteredValues"))),
},
}
}
func (g *Generator) IsEmpty(h *types.ModelMethodHelper) *types.Method {
decl := h.CreateCollectionMethodDeclare()
decl.MethodName = "IsEmpty"
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: types.TypeDeclareWithType(types.BoolType),
})
return &types.Method{
Decl: decl,
Body: []Code{
If(Id("m").Op("==").Nil()).Block(Return(True())),
If(Len(h.Field("values")).Op("==").Lit(0)).Block(Return(True())),
Return(False()),
},
}
}
func (g *Generator) At(h *types.ModelMethodHelper) *types.Method {
decl := h.CreateCollectionMethodDeclare()
decl.MethodName = "At"
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: "idx",
Type: types.TypeDeclareWithType(types.IntType),
})
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: h.ModelType(),
})
return &types.Method{
Decl: decl,
Body: []Code{
If(Id("m").Op("==").Nil()).Block(Return(Nil())),
If(Id("idx").Op("<").Lit(0)).Block(Return(Nil())),
If(Len(h.Field("values")).Op(">").Id("idx")).Block(
Return(h.Field("values").Index(Id("idx"))),
),
Return(Nil()),
},
}
}
func (g *Generator) First(h *types.ModelMethodHelper) *types.Method {
decl := h.CreateCollectionMethodDeclare()
decl.MethodName = "First"
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: h.ModelType(),
})
return &types.Method{
Decl: decl,
Body: []Code{
If(Id("m").Op("==").Nil()).Block(Return(Nil())),
If(Len(h.Field("values")).Op(">").Lit(0)).Block(
Return(h.Field("values").Index(Lit(0))),
),
Return(Nil()),
},
}
}
func (g *Generator) Last(h *types.ModelMethodHelper) *types.Method {
decl := h.CreateCollectionMethodDeclare()
decl.MethodName = "Last"
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: h.ModelType(),
})
return &types.Method{
Decl: decl,
Body: []Code{
If(Id("m").Op("==").Nil()).Block(Return(Nil())),
If(Len(h.Field("values")).Op(">").Lit(0)).Block(
Return(h.Field("values").Index(Len(h.Field("values")).Op("-").Lit(1))),
),
Return(Nil()),
},
}
}
func (g *Generator) Compact(h *types.ModelMethodHelper) *types.Method {
decl := h.CreateCollectionMethodDeclare()
decl.MethodName = "Compact"
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: h.ModelCollectionType(),
})
return &types.Method{
Decl: decl,
Body: []Code{
If(Id("m").Op("==").Nil()).Block(Return(Nil())),
Id("compactedValues").Op(":=").Index().Op("*").Id(h.ModelName()).Values(),
For(List(Id("_"), Id("value")).Op(":=").Range().Add(h.Field("values"))).Block(
If(Id("value").Op("==").Nil()).Block(Continue()),
Id("compactedValues").Op("=").Append(Id("compactedValues"), Id("value")),
),
Return(h.Receiver().Dot(fmt.Sprintf("new%s", h.Class.Name.PluralCamelName())).Call(Id("compactedValues"))),
},
}
}
func (g *Generator) Add(h *types.ModelMethodHelper) *types.Method {
decl := h.CreateCollectionMethodDeclare()
decl.MethodName = "Add"
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: "args",
Type: types.TypeDeclareWithName(fmt.Sprintf("...*%s", h.ModelName())),
})
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: h.ModelCollectionType(),
})
return &types.Method{
Decl: decl,
Body: []Code{
If(Id("m").Op("==").Nil()).Block(Return(Nil())),
For(List(Id("_"), Id("value")).Op(":=").Range().Id("args")).Block(
h.Field("values").Op("=").Append(h.Field("values"), Id("value")),
),
Return(h.Receiver()),
},
}
}
func (g *Generator) Merge(h *types.ModelMethodHelper) *types.Method {
decl := h.CreateCollectionMethodDeclare()
decl.MethodName = "Merge"
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: "args",
Type: types.TypeDeclareWithName(fmt.Sprintf("...*%s", h.ModelCollectionName())),
})
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: h.ModelCollectionType(),
})
return &types.Method{
Decl: decl,
Body: []Code{
If(Id("m").Op("==").Nil()).Block(Return(Nil())),
For(List(Id("_"), Id("arg")).Op(":=").Range().Id("args")).Block(
For(List(Id("_"), Id("value")).Op(":=").Range().Id("arg").Dot("values")).Block(
h.Field("values").Op("=").Append(h.Field("values"), Id("value")),
),
),
Return(h.Receiver()),
},
}
}
func (g *Generator) Len(h *types.ModelMethodHelper) *types.Method {
decl := h.CreateCollectionMethodDeclare()
decl.MethodName = "Len"
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: types.TypeDeclareWithType(types.IntType),
})
return &types.Method{
Decl: decl,
Body: []Code{
If(Id("m").Op("==").Nil()).Block(Return(Lit(0))),
Return(Len(h.Field("values"))),
},
}
}
func (g *Generator) MergeCollection(h *types.ModelMethodHelper) *types.Method {
decl := h.CreateMultipleCollectionMethodDeclare()
decl.MethodName = "Merge"
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: h.ModelCollectionType(),
})
return &types.Method{
Decl: decl,
Body: []Code{
If(Id("m").Op("==").Nil()).Block(Return(Nil())),
If(Len(Op("*").Add(h.Receiver())).Op("==").Lit(0)).Block(Return(Nil())),
If(Len(Op("*").Add(h.Receiver())).Op("==").Lit(1)).Block(Return(Parens(Op("*").Add(h.Receiver())).Index(Lit(0)))),
Id("values").Op(":=").Index().Op("*").Id(h.ModelName()).Values(),
For(List(Id("_"), Id("collection")).Op(":=").Range().Add(Op("*").Add(h.Receiver()))).Block(
For(List(Id("_"), Id("value")).Op(":=").Range().Id("collection").Dot("values")).Block(
Id("values").Op("=").Append(Id("values"), Id("value")),
),
),
Return(Parens(Op("*").Add(h.Receiver())).Index(Lit(0)).Dot(fmt.Sprintf("new%s", h.Class.Name.PluralCamelName())).Call(Id("values"))),
},
}
}
func (g *Generator) Unique(h *types.ModelMethodHelper, member *types.Member) *types.Method {
decl := h.CreateCollectionMethodDeclare()
decl.MethodName = fmt.Sprintf("Unique%s", member.Name.CamelName())
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: h.ModelCollectionType(),
})
return &types.Method{
Decl: decl,
Body: []Code{
If(h.Receiver().Op("==").Nil()).Block(Return(Nil())),
Id("filterMap").Op(":=").Map(member.Type.Code(h.ImportList)).Struct().Values(),
Return(
h.Receiver().Dot("Filter").Call(
Func().Params(Id("value").Op("*").Id(h.ModelName())).Bool().Block(
If(
List(Id("_"), Id("exists")).Op(":=").Id("filterMap").Index(Id("value").Dot(member.Name.CamelName())),
Id("exists"),
).Block(Return(False())),
Id("filterMap").Index(Id("value").Dot(member.Name.CamelName())).Op("=").Struct().Values(),
Return(True()),
),
),
),
},
}
}
func (g *Generator) GroupBy(h *types.ModelMethodHelper, member *types.Member) *types.Method {
decl := h.CreateCollectionMethodDeclare()
decl.MethodName = fmt.Sprintf("GroupBy%s", member.Name.CamelName())
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: types.TypeDeclareWithName(fmt.Sprintf("map[%#v]*%s", member.Type.Code(h.ImportList), h.ModelCollectionName())),
})
return &types.Method{
Decl: decl,
Body: []Code{
If(h.Receiver().Op("==").Nil()).Block(Return(Nil())),
Id("values").Op(":=").Map(member.Type.Code(h.ImportList)).Op("*").Id(h.ModelCollectionName()).Values(),
For(List(Id("_"), Id("value")).Op(":=").Range().Add(h.Field("values"))).Block(
If(
List(Id("_"), Id("exists")).Op(":=").Id("values").Index(Id("value").Dot(member.Name.CamelName())),
Op("!").Id("exists"),
).Block(
Id("values").Index(Id("value").Dot(member.Name.CamelName())).Op("=").Op("&").Id(h.ModelCollectionName()).Values(),
),
Id("values").Index(Id("value").Dot(member.Name.CamelName())).Dot("Add").Call(Id("value")),
),
Return(Id("values")),
},
}
}
func (g *Generator) FirstBy(h *types.ModelMethodHelper, members types.Members) *types.Method {
decl := h.CreateCollectionMethodDeclare()
names := []string{}
for _, name := range members.Names() {
names = append(names, name.CamelName())
}
decl.MethodName = fmt.Sprintf("FirstBy%s", strings.Join(names, "And"))
blocks := []Code{}
for idx, member := range members {
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: fmt.Sprintf("a%d", idx),
Type: member.Type,
})
blocks = append(blocks, If(Id("value").Dot(member.Name.CamelName()).Op("!=").Id(fmt.Sprintf("a%d", idx))).Block(Continue()))
}
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: h.ModelType(),
})
blocks = append(blocks, Return(Id("value")))
return &types.Method{
Decl: decl,
Body: []Code{
If(h.Receiver().Op("==").Nil()).Block(Return(Nil())),
For(List(Id("_"), Id("value")).Op(":=").Range().Add(h.Field("values"))).Block(blocks...),
Return(Nil()),
},
}
}
func (g *Generator) FilterBy(h *types.ModelMethodHelper, members types.Members) *types.Method {
decl := h.CreateCollectionMethodDeclare()
names := []string{}
for _, name := range members.Names() {
names = append(names, name.CamelName())
}
decl.MethodName = fmt.Sprintf("FilterBy%s", strings.Join(names, "And"))
blocks := []Code{}
for idx, member := range members {
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: fmt.Sprintf("a%d", idx),
Type: member.Type,
})
blocks = append(blocks, If(Id("value").Dot(member.Name.CamelName()).Op("!=").Id(fmt.Sprintf("a%d", idx))).Block(Continue()))
}
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: h.ModelCollectionType(),
})
blocks = append(blocks, Id("values").Op("=").Append(Id("values"), Id("value")))
return &types.Method{
Decl: decl,
Body: []Code{
If(h.Receiver().Op("==").Nil()).Block(Return(Nil())),
Id("values").Op(":=").Index().Op("*").Id(h.ModelName()).Values(),
For(List(Id("_"), Id("value")).Op(":=").Range().Add(h.Field("values"))).Block(blocks...),
Return(h.Receiver().Dot(fmt.Sprintf("new%s", h.Class.Name.PluralCamelName())).Call(Id("values"))),
},
}
}
func (g *Generator) collectionBySchemaType(h *types.ModelMethodHelper, member *types.Member) *types.Method {
decl := h.CreateCollectionMethodDeclare()
var methodName string
if member.IsCollectionType() {
methodName = fmt.Sprintf("%sCollection", member.Name.CamelName())
} else {
methodName = member.CollectionName().PluralCamelName()
}
decl.MethodName = methodName
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: "ctx",
Type: &types.TypeDeclare{
Type: &types.Type{
PackageName: "context",
Name: "Context",
},
},
})
if member.Relation.Custom {
if member.IsCollectionType() {
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: types.TypeDeclareWithName(
fmt.Sprintf("%sCollection", types.Name(member.Type.Name()).PluralCamelName()),
),
})
} else {
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: types.TypeDeclareWithName(
fmt.Sprintf("*%s", types.Name(member.Type.Name()).PluralCamelName()),
),
})
}
} else {
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: types.TypeDeclareWithName(member.ModelCollectionTypeName(h.ImportList)),
})
}
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: types.TypeDeclareWithType(types.ErrorType),
})
var (
valuesType Code
appendCode Code
)
if member.Relation.Custom {
if member.IsCollectionType() {
valuesType = Id(fmt.Sprintf("%sCollection", types.Name(member.Type.Name()).PluralCamelName()))
appendCode = Id("values").Op("=").Append(Id("values"), Id(member.Name.CamelLowerName()))
} else {
valuesType = Op("&").Id(types.Name(member.Type.Name()).PluralCamelName())
appendCode = Id("values").Dot("Add").Call(Id(member.Name.CamelLowerName()))
}
} else if member.IsCollectionType() {
valuesType = Id(fmt.Sprintf("%sCollection", member.Type.CollectionName(h.ImportList)))
appendCode = Id("values").Op("=").Append(Id("values"), Id(member.Name.CamelLowerName()))
} else {
valuesType = Op("&").Id(member.Type.CollectionName(h.ImportList))
appendCode = Id("values").Dot("Add").Call(Id(member.Name.CamelLowerName()))
}
return &types.Method{
Decl: decl,
Body: []Code{
If(h.Receiver().Op("==").Nil()).Block(Return(Nil(), Nil())),
Id("values").Op(":=").Add(valuesType).Values(),
For(List(Id("_"), Id("value")).Op(":=").Range().Add(h.Field("values"))).Block(
List(Id(member.Name.CamelLowerName()), Err()).Op(":=").Id("value").Dot(member.Name.CamelName()).Call(Id("ctx")),
If(Err().Op("!=").Nil()).Block(Return(Nil(), Qual(h.Package("xerrors"), "Errorf").Call(
Lit(fmt.Sprintf("failed to get %s: %%w", member.Name.CamelName())), Err(),
))),
If(Id(member.Name.CamelLowerName()).Op("==").Nil()).Block(Continue()),
appendCode,
),
Return(Id("values"), Nil()),
},
}
}
func (g *Generator) collectionByPrimitiveType(h *types.ModelMethodHelper, member *types.Member) *types.Method {
decl := h.CreateCollectionMethodDeclare()
decl.MethodName = member.CollectionName().PluralCamelName()
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: types.TypeDeclareWithName(member.ModelCollectionTypeName(h.ImportList)),
})
return &types.Method{
Decl: decl,
Body: []Code{
If(h.Receiver().Op("==").Nil()).Block(Return(Nil())),
Id("values").Op(":=").Id(member.ModelCollectionTypeName(h.ImportList)).Values(),
For(List(Id("_"), Id("value")).Op(":=").Range().Add(h.Field("values"))).Block(
Id("values").Op("=").Append(Id("values"), Id("value").Dot(member.Name.CamelName())),
),
Return(Id("values")),
},
}
}
func (g *Generator) Collection(h *types.ModelMethodHelper, member *types.Member) *types.Method {
if member.Type.IsSchemaClass() || (member.Relation != nil && member.Relation.Custom) {
return g.collectionBySchemaType(h, member)
}
return g.collectionByPrimitiveType(h, member)
}
func (g *Generator) findBy(h *types.ModelMethodHelper, member *types.Member) *types.Method {
decl := h.CreateCollectionMethodDeclare()
decl.MethodName = fmt.Sprintf("Find%s", member.Name.CamelName())
internalMember := h.Class.MemberByName(member.Relation.Internal.SnakeName())
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: "ctx",
Type: &types.TypeDeclare{
Type: &types.Type{
PackageName: "context",
Name: "Context",
},
},
})
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: internalMember.Name.CamelLowerName(),
Type: internalMember.Type,
})
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: "finder",
Type: types.TypeDeclareWithName(fmt.Sprintf("%sFinder", member.Type.Class().Name.CamelName())),
})
var (
typeName string
filterOrFirstByMethodTemplate string
fieldName string
)
if member.IsCollectionType() {
typeName = member.Type.Class().Name.PluralCamelName()
filterOrFirstByMethodTemplate = "FilterBy%s"
fieldName = member.Name.CamelLowerName()
} else {
typeName = member.Type.Class().Name.CamelName()
filterOrFirstByMethodTemplate = "FirstBy%s"
fieldName = member.Name.PluralCamelLowerName()
}
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: &types.TypeDeclare{
Type: &types.Type{
Name: typeName,
},
IsPointer: true,
},
})
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: types.TypeDeclareWithType(types.ErrorType),
})
externalName := member.Relation.External.CamelName()
externalPluralName := member.Relation.External.PluralCamelName()
body := []Code{
If(h.Receiver().Dot(fieldName).Op("!=").Nil()).Block(
Return(h.Receiver().Dot(fieldName).
Dot(fmt.Sprintf(filterOrFirstByMethodTemplate, externalName)).Call(Id(internalMember.Name.CamelLowerName())), Nil()),
),
List(Id(fieldName), Err()).Op(":=").Id("finder").
Dot(fmt.Sprintf("FindBy%s", externalPluralName)).Call(Id("ctx"), h.Receiver().Dot(internalMember.Name.PluralCamelLowerName())),
If(Err().Op("!=").Nil()).Block(Return(Nil(), Qual(h.Package("xerrors"), "Errorf").Call(Lit(fmt.Sprintf("failed to FindBy%s: %%w", externalPluralName)), Err()))),
}
if !member.Nullable {
if member.IsCollectionType() {
body = append(body,
If(Id(fieldName).Dot("IsEmpty").Call()).Block(
Return(Id(fieldName), Qual(h.Package("xerrors"), "New").Call(Lit("cannot find record"))),
),
)
} else {
body = append(body,
If(Id(fieldName).Op("==").Nil()).Block(
Return(Nil(), Qual(h.Package("xerrors"), "New").Call(Lit("cannot find record"))),
),
)
}
}
body = append(body, []Code{
h.Receiver().Dot(fieldName).Op("=").Id(fieldName),
Return(h.Receiver().Dot(fieldName).
Dot(fmt.Sprintf(filterOrFirstByMethodTemplate, externalName)).Call(Id(internalMember.Name.CamelLowerName())), Nil()),
}...)
return &types.Method{
Decl: decl,
Body: body,
}
}
func (g *Generator) findAll(h *types.ModelMethodHelper, member *types.Member) *types.Method {
decl := h.CreateCollectionMethodDeclare()
decl.MethodName = fmt.Sprintf("Find%s", member.Name.CamelName())
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: "ctx",
Type: &types.TypeDeclare{
Type: &types.Type{
PackageName: "context",
Name: "Context",
},
},
})
decl.Args = append(decl.Args, &types.ValueDeclare{
Name: "finder",
Type: types.TypeDeclareWithName(fmt.Sprintf("%sFinder", member.Type.Class().Name.CamelName())),
})
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: &types.TypeDeclare{
Type: &types.Type{
Name: member.Type.Class().Name.PluralCamelName(),
},
IsPointer: true,
},
})
decl.Return = append(decl.Return, &types.ValueDeclare{
Type: types.TypeDeclareWithType(types.ErrorType),
})
fieldName := member.Name.PluralCamelLowerName()
return &types.Method{
Decl: decl,
Body: []Code{
If(h.Receiver().Dot(fieldName).Op("!=").Nil()).Block(
Return(h.Receiver().Dot(fieldName), Nil()),
),
List(Id(fieldName), Err()).Op(":=").Id("finder").Dot("FindAll").Call(Id("ctx")),
If(Err().Op("!=").Nil()).Block(Return(Nil(), Qual(h.Package("xerrors"), "Errorf").Call(Lit("failed to FindAll: %%w"), Err()))),
h.Receiver().Dot(fieldName).Op("=").Id(fieldName),
Return(Id(fieldName), Nil()),
},
}
}
func (g *Generator) Methods() []func(*types.ModelMethodHelper) *types.Method {
return []func(*types.ModelMethodHelper) *types.Method{
func(h *types.ModelMethodHelper) *types.Method {
return g.NewCollection(h)
},
func(h *types.ModelMethodHelper) *types.Method {
return g.Each(h)
},
func(h *types.ModelMethodHelper) *types.Method {
return g.EachIndex(h)
},
func(h *types.ModelMethodHelper) *types.Method {
return g.EachWithError(h)
},
func(h *types.ModelMethodHelper) *types.Method {
return g.EachIndexWithError(h)
},
func(h *types.ModelMethodHelper) *types.Method {
return g.Map(h)
},
func(h *types.ModelMethodHelper) *types.Method {
return g.Any(h)
},
func(h *types.ModelMethodHelper) *types.Method {
return g.Some(h)
},
func(h *types.ModelMethodHelper) *types.Method {
return g.IsIncluded(h)
},
func(h *types.ModelMethodHelper) *types.Method {
return g.All(h)
},
func(h *types.ModelMethodHelper) *types.Method {
return g.Sort(h)
},
func(h *types.ModelMethodHelper) *types.Method {
return g.SortStable(h)
},
func(h *types.ModelMethodHelper) *types.Method {
return g.Find(h)
},
func(h *types.ModelMethodHelper) *types.Method {
return g.Filter(h)
},
func(h *types.ModelMethodHelper) *types.Method {
return g.IsEmpty(h)
},
func(h *types.ModelMethodHelper) *types.Method {
return g.At(h)
},
func(h *types.ModelMethodHelper) *types.Method {
return g.First(h)
},
func(h *types.ModelMethodHelper) *types.Method {
return g.Last(h)
},
func(h *types.ModelMethodHelper) *types.Method {
return g.Compact(h)
},
func(h *types.ModelMethodHelper) *types.Method {
return g.Add(h)
},
func(h *types.ModelMethodHelper) *types.Method {
return g.Merge(h)
},
func(h *types.ModelMethodHelper) *types.Method {
return g.Len(h)
},
func(h *types.ModelMethodHelper) *types.Method {
return g.MergeCollection(h)
},
}
}
|
/**
* Merger that creates a new manifest by replacing/merging children elements of application from
* feature modules into base module manifest.
*/
public class FusingAndroidManifestMerger implements AndroidManifestMerger {
/** Defines mode how elements should be fused. */
public enum Mode {
/**
* Instructs to take element declaration from feature module and fully replace corresponding one
* in the base.
*/
REPLACE,
/**
* Instructs to take element declaration from feature module but gather all 'intent-filter',
* 'meta-data' child elements from other modules and add them into fused element.
*/
MERGE_CHILDREN
}
private final ImmutableSet<String> elementsToMerge;
private final Mode mode;
public FusingAndroidManifestMerger(ImmutableSet<String> elementsToMerge, Mode mode) {
this.elementsToMerge = elementsToMerge;
this.mode = mode;
}
@Override
public AndroidManifest merge(SetMultimap<BundleModuleName, AndroidManifest> manifests) {
if (!manifests.containsKey(BASE_MODULE_NAME)) {
throw CommandExecutionException.builder()
.withInternalMessage("Expected to have base module.")
.build();
}
return merge(ensureOneManifestPerModule(manifests));
}
private AndroidManifest merge(Map<BundleModuleName, AndroidManifest> manifests) {
AndroidManifest baseManifest = manifests.get(BASE_MODULE_NAME);
List<AndroidManifest> featureManifests =
manifests.entrySet().stream()
.filter(entry -> !BASE_MODULE_NAME.equals(entry.getKey()))
.sorted(Comparator.comparing(entry -> entry.getKey().getName()))
.map(Map.Entry::getValue)
.collect(toImmutableList());
if (featureManifests.isEmpty()) {
return baseManifest;
}
return mergeManifests(baseManifest, featureManifests);
}
private AndroidManifest mergeManifests(
AndroidManifest baseManifest, List<AndroidManifest> featureManifests) {
// Gather all child elements of 'application' from all manifest. If element with the same name
// and type is presented in more than one manifest we give precedency to one in feature module.
// All feature manifests are sorted by feature module name in this method.
ImmutableListMultimap<ApplicationElementId, XmlProtoElement> applicationElements =
gatherApplicationElementsManifests(
ImmutableList.<AndroidManifest>builder()
.addAll(featureManifests)
.add(baseManifest)
.build(),
elementsToMerge);
// This is optimization that allows to skip merging if there is no mergeable elements in
// feature modules.
long numberOfMergeableElementsInBase =
baseManifest
.getManifestRoot()
.getElement()
.getChildrenElements(AndroidManifest.APPLICATION_ELEMENT_NAME)
.flatMap(application -> application.getChildrenElements())
.filter(element -> elementsToMerge.contains(element.getName()))
.count();
if (numberOfMergeableElementsInBase == applicationElements.size()) {
return baseManifest;
}
// Merge manifest elements with the same name and type based on specified mode.
ImmutableMap<ApplicationElementId, XmlProtoElement> mergedElements =
applicationElements.keySet().stream()
.collect(
toImmutableMap(
Function.identity(), key -> mergeElements(key, applicationElements.get(key))));
ManifestEditor manifestEditor = baseManifest.toEditor();
XmlProtoElementBuilder applicationElement =
manifestEditor
.getRawProto()
.getOrCreateChildElement(AndroidManifest.APPLICATION_ELEMENT_NAME);
// Replace original elements from the base manifest with merged ones. This is done in a way to
// preserve original elements ordering and additional elements are added to the end.
Set<XmlProtoElement> replacedElements = Sets.newIdentityHashSet();
applicationElement.modifyChildElements(
child ->
stream(getCorrespondingElementFromMergedElements(child, mergedElements))
.peek(replacedElements::add)
.map(element -> XmlProtoNodeBuilder.createElementNode(element.toBuilder()))
.collect(toOptional())
.orElse(child));
mergedElements.values().stream()
.filter(not(replacedElements::contains))
.forEach(element -> applicationElement.addChildElement(element.toBuilder()));
return manifestEditor.save();
}
/**
* Merges element with the same name and type from different manifests. {@code elements} list in
* this method contains data from feature modules first and element from the base module is the
* last one in the list.
*
* <p>If element is presented in more than one feature module elements are sorted by name of
* feature module. Example: if service with name 'myService' is defined in base module and
* features 'a' and 'b', {@code elements} list will contain its declaration in the following
* order: 'a' feature, 'b' feature, base.
*/
private XmlProtoElement mergeElements(
ApplicationElementId elementId, List<XmlProtoElement> elements) {
// If we don't need to merge nested elements and just replace declarations from base module
// we just take the first element from the list.
if (mode.equals(Mode.REPLACE) || elements.size() == 1) {
return elements.get(0);
}
// Remove source data from nested elements as this data is meaningless for functionality and
// just contains information about line/column where element appeared in the original xml.
List<XmlProtoElement> elementsNoSource =
elements.stream()
.map(element -> element.toBuilder().removeSourceDataRecursive().build())
.collect(toImmutableList());
// For intent filters we gather all distinct filters defined in all modules.
Set<XmlProtoElement> intentFilters =
elementsNoSource.stream()
.flatMap(
element -> element.getChildrenElements(AndroidManifest.INTENT_FILTER_ELEMENT_NAME))
.collect(toImmutableSet());
// For meta-data we group them by name and take one per each name.
ImmutableMap<String, XmlProtoElement> metadataByName =
elementsNoSource.stream()
.flatMap(element -> element.getChildrenElements(AndroidManifest.META_DATA_ELEMENT_NAME))
.filter(meta -> meta.getAndroidAttribute(AndroidManifest.NAME_RESOURCE_ID).isPresent())
.collect(
toImmutableMap(
meta ->
meta.getAndroidAttribute(AndroidManifest.NAME_RESOURCE_ID)
.get()
.getValueAsString(),
Function.identity(),
(a, b) -> {
// If meta-data with the same name but different value is defined in
// different modules throw conflict exception.
if (!a.equals(b)) {
throw CommandExecutionException.builder()
.withInternalMessage(
"Multiple meta-data entries with the same name are found inside"
+ " %s:%s: %s, %s",
elementId.getType(), elementId.getName(), a, b)
.build();
}
return a;
}));
// Take element declaration from feature module and add all intent filters and meta data to it.
XmlProtoElementBuilder builder = elementsNoSource.get(0).toBuilder();
builder.removeChildrenElementsIf(
child -> {
if (!child.isElement()) {
return false;
}
XmlProtoElementBuilder childElement = child.getElement();
String tag = childElement.getName();
Optional<String> name =
childElement
.getAndroidAttribute(AndroidManifest.NAME_RESOURCE_ID)
.map(XmlProtoAttributeBuilder::getValueAsString);
return tag.equals(AndroidManifest.INTENT_FILTER_ELEMENT_NAME)
|| (tag.equals(AndroidManifest.META_DATA_ELEMENT_NAME)
&& name.map(metadataByName::containsKey).orElse(false));
});
intentFilters.forEach(e -> builder.addChildElement(e.toBuilder()));
metadataByName.values().forEach(e -> builder.addChildElement(e.toBuilder()));
return builder.build();
}
private static ImmutableListMultimap<ApplicationElementId, XmlProtoElement>
gatherApplicationElementsManifests(
List<AndroidManifest> featureManifests, ImmutableSet<String> elementsToMerge) {
ImmutableListMultimap.Builder<ApplicationElementId, XmlProtoElement> featureElementsBuilder =
ImmutableListMultimap.builder();
featureManifests.forEach(
manifest -> gatherApplicationElements(manifest, elementsToMerge, featureElementsBuilder));
return featureElementsBuilder.build();
}
private static void gatherApplicationElements(
AndroidManifest manifest,
ImmutableSet<String> elementsToMerge,
ImmutableListMultimap.Builder<ApplicationElementId, XmlProtoElement> featureElementsBuilder) {
Optional<XmlProtoElement> manifestElement =
manifest
.getManifestRoot()
.getElement()
.getOptionalChildElement(AndroidManifest.APPLICATION_ELEMENT_NAME);
stream(manifestElement)
.flatMap(application -> application.getChildrenElements())
.filter(child -> elementsToMerge.contains(child.getName()))
.filter(child -> child.getAndroidAttribute(AndroidManifest.NAME_RESOURCE_ID).isPresent())
.forEach(
child ->
featureElementsBuilder.put(
ApplicationElementId.create(child.getName(), getNameAttribute(child)), child));
}
private static Optional<XmlProtoElement> getCorrespondingElementFromMergedElements(
XmlProtoNodeBuilder node,
ImmutableMap<ApplicationElementId, XmlProtoElement> mergedElements) {
if (!node.isElement()) {
return Optional.empty();
}
Optional<XmlProtoAttributeBuilder> name =
node.getElement().getAndroidAttribute(AndroidManifest.NAME_RESOURCE_ID);
return name.map(
xmlProtoAttributeBuilder ->
mergedElements.get(
ApplicationElementId.create(
node.getElement().getName(), xmlProtoAttributeBuilder.getValueAsString())));
}
private static String getNameAttribute(XmlProtoElement element) {
return element.getAndroidAttribute(AndroidManifest.NAME_RESOURCE_ID).get().getValueAsString();
}
private static ImmutableMap<BundleModuleName, AndroidManifest> ensureOneManifestPerModule(
SetMultimap<BundleModuleName, AndroidManifest> manifests) {
ImmutableMap.Builder<BundleModuleName, AndroidManifest> builder = ImmutableMap.builder();
for (BundleModuleName moduleName : manifests.keys()) {
Set<AndroidManifest> moduleManifests = manifests.get(moduleName);
if (moduleManifests.size() != 1) {
throw CommandExecutionException.builder()
.withInternalMessage(
"Expected exactly one %s module manifest, but found %d.",
moduleName.getName(), moduleManifests.size())
.build();
}
builder.put(moduleName, Iterables.getOnlyElement(moduleManifests));
}
return builder.build();
}
@AutoValue
abstract static class ApplicationElementId {
abstract String getType();
abstract String getName();
static ApplicationElementId create(String type, String name) {
return new AutoValue_FusingAndroidManifestMerger_ApplicationElementId(type, name);
}
}
}
|
Marijuana Patient Can't Get A Transplant Associated Press
Published: Saturday April 26, 2008
|
Print This Email This (AP) Timothy Garon's face and arms are hauntingly skeletal, but the fluid building up in his abdomen makes the 56-year-old musician look eight months pregnant. His liver, ravaged by hepatitis C, is failing. Without a new one, his doctors tell him, he will be dead in days. But Garon's been refused a spot on the transplant list, largely because he has used marijuana, even though it was legally approved for medical reasons. "I'm not angry, I'm not mad, I'm just confused," said Garon, lying in his hospital bed a few minutes after a doctor told him the hospital transplant committee's decision Thursday. With the scarcity of donated organs, transplant committees like the one at the University of Washington Medical Center use tough standards, including whether the candidate has other serious health problems or is likely to drink or do drugs. And with cases like Garon's, they also have to consider _ as a dozen states now have medical marijuana laws _ if using dope with a doctor's blessing should be held against a dying patient in need of a transplant. Most transplant centers struggle with the how to deal with people who have used marijuana, said Dr. Robert Sade, director of the Institute of Human Values in Health Care at the Medical University of South Carolina. "Marijuana, unlike alcohol, has no direct effect on the liver. It is however a concern ... in that it's a potential indicator of an addictive personality," Sade said. The Virginia-based United Network for Organ Sharing, which oversees the nation's transplant system, leaves it to individual hospitals to develop criteria for transplant candidates. I'm not angry, I'm not mad, I'm just confused. Timothy Garon, A Medical Marijuana Patient Who Was Refused A Liver Transplant At some, people who use "illicit substances" _ including medical marijuana, even in states that allow it _ are automatically rejected. At others, such as the UCLA Medical Center, patients are given a chance to reapply if they stay clean for six months. Marijuana is illegal under federal law. Garon believes he got hepatitis by sharing needles with "speed freaks" as a teenager. In recent years, he said, pot has been the only drug he's used. In December, he was arrested for growing marijuana. Garon, who has been hospitalized or in hospice care for two months straight, said he turned to the university hospital after Seattle's Harborview Medical Center told him he needed six months of abstinence. The university also denied him, but said it would reconsider if he enrolled in a 60-day drug-treatment program. This week, at the urging of Garon's lawyer, the university's transplant team reconsidered anyway, but it stuck to its decision. Dr. Brad Roter, the Seattle physician who authorized Garon's pot use for nausea, abdominal pain and to stimulate his appetite, said he did not know it would be such a hurdle if Garon were to need a transplant. That's typically the case, said Peggy Stewart, a clinical social worker on the liver transplant team at UCLA who has researched the issue. "There needs to be some kind of national eligibility criteria," she said. The patients "are trusting their physician to do the right thing. The physician prescribes marijuana, they take the marijuana, and they are shocked that this is now the end result," she said. No one tracks how many patients are denied transplants over medical marijuana use. Pro-marijuana groups have cited a handful of cases, including at least two patient deaths, in Oregon and California, since the mid-to-late 1990s, when states began adopting medical marijuana laws. Many doctors agree that using marijuana _ smoking it, especially _ is out of the question post-transplant. The drugs patients take to help their bodies accept a new organ increase the risk of aspergillosis, a frequently fatal infection caused by a common mold found in marijuana and tobacco. But there's little information on whether using marijuana is a problem before the transplant, said Dr. Emily Blumbrg, an infectious disease specialist who works with transplant patients at the University of Pennsylvania Hospital. Further complicating matters, Blumberg said, is that some insurers require proof of abstinence, such as drug tests, before they'll agree to pay for transplants. Dr. Jorge Reyes, a liver transplant surgeon at the UW Medical Center, said that while medical marijuana use isn't in itself a sign of substance abuse, it must be evaluated in the context of each patient. "The concern is that patients who have been using it will not be able to stop," Reyes said. Dale Gieringer, state coordinator for the California chapter of NORML, the National Organization for the Reform of Marijuana Laws, scoffed at that notion. "Everyone agrees that marijuana is the least habit-forming of all the recreational drugs, including alcohol," Gieringer said. "And unlike a lot of prescription medications, it's nontoxic to the liver." Reyes and other UW officials declined to discuss Garon's case. But Reyes said that in addition to medical concerns, transplant committees _ which often include surgeons, social workers, and nutritionists _ must evaluate whether patients have the support and psychiatric health to cope with a complex post-operative regimen for the rest of their lives. Garon, the lead singer for Nearly Dan, a Steely Dan cover-band, remains charged with manufacturing weed. He insists he was following the state law, which limits patients to a "60-day supply" but doesn't define that amount. "He's just a fantastic musician, and he's a great guy," said his girlfriend, Liesa Bueno. "I wish there was something we could do legally. ... I'm going to miss him terribly if he passes." On the Net: United Nework for Organ Sharing: http://www.unos.org Garon performing his song "Goodbye Baby": http://www.youtube.com/watch?vUJDihYn_fJA
|
/*
*
* Confidential Information of Telekinesys Research Limited (t/a Havok). Not for disclosure or distribution without Havok's
* prior written consent. This software contains code, techniques and know-how which is confidential and proprietary to Havok.
* Product and Trade Secret source code contains trade secrets of Havok. Havok Software (C) Copyright 1999-2014 Telekinesys Research Limited t/a Havok. All Rights Reserved. Use of this software is subject to the terms of an end user license agreement.
*
*/
#ifndef HK_PREVAILING_WIND_H
#define HK_PREVAILING_WIND_H
#include <Physics2012/Utilities/Actions/Wind/hkpWind.h>
#include <Physics2012/Dynamics/World/Listener/hkpWorldPostSimulationListener.h>
/// A wind which can vary over time.
/// If oscillations are added, then the prevailing wind object must be added to the world
/// as a post simulation listener.
class hkpPrevailingWind : public hkpWind, public hkpWorldPostSimulationListener
{
public:
HK_DECLARE_CLASS_ALLOCATOR(HK_MEMORY_CLASS_BASE);
/// Constructor.
/// \param mid the base wind vector.
hkpPrevailingWind( const hkVector4& mid );
/// Gets the wind at position pos due to wind.
virtual void getWindVector( const hkVector4& pos, hkVector4& windOut ) const;
/// Adds a sinusoidal oscillation.
/// \param diff the maximum value of the vector at the positive extent.
/// \param period the period of the oscillation in seconds.
/// \param power the sin is raised to this power.
/// Higher powers give gustier oscillations.
/// \param phase the starting phase of the oscillation (between 0 and 1).
void addOscillation( const hkVector4& diff, hkReal period, hkReal power = 1.0f, hkReal phase = 0.0f );
/// Allows air properties to vary over time.
void postSimulationCallback( hkpWorld* world );
/// Destructor.
virtual ~hkpPrevailingWind() { }
public:
/// Describes a value which varies over time sinusoidally.
class Oscillator
{
public:
HK_DECLARE_NONVIRTUAL_CLASS_ALLOCATOR(HK_MEMORY_CLASS_BASE,hkpPrevailingWind::Oscillator);
/// Constructor.
/// \param diff the maximum value of the vector at the positive extent.
/// \param period the period of the oscillation in seconds.
/// \param phase the starting phase of the oscillation (between 0 and 1).
Oscillator( hkReal period, hkReal phase = 0.0f );
Oscillator() {}
/// Gets the vector at the current state of the oscillation.
inline hkReal getValue() const;
/// Update by delta seconds.
void update ( hkReal delta );
virtual ~Oscillator() { }
private:
/// The period of oscillation.
hkReal m_period;
/// Values between 0 and 1.
hkReal m_accumulator;
};
private:
/// The base wind vector.
hkVector4 m_mid;
/// Combines a vector, an oscillator and a power.
struct Triple {
hkVector4 m_diff;
Oscillator m_oscillator;
hkReal m_power;
Triple() {}
Triple( const hkVector4& d, const Oscillator& o, hkReal p ) : m_diff( d ), m_oscillator( o ), m_power( p ) { }
};
/// The array of oscillating vectors.
hkArray< Triple > m_oscillators;
/// The current wind vector (redundant copy maintained so getWindVector queries are
/// cheap).
hkVector4 m_current;
};
#endif // HK_PREVAILING_WIND_H
/*
* Havok SDK - NO SOURCE PC DOWNLOAD, BUILD(#20140907)
*
* Confidential Information of Havok. (C) Copyright 1999-2014
* Telekinesys Research Limited t/a Havok. All Rights Reserved. The Havok
* Logo, and the Havok buzzsaw logo are trademarks of Havok. Title, ownership
* rights, and intellectual property rights in the Havok software remain in
* Havok and/or its suppliers.
*
* Use of this software for evaluation purposes is subject to and indicates
* acceptance of the End User licence Agreement for this product. A copy of
* the license is included with this software and is also available at www.havok.com/tryhavok.
*
*/
|
/**
* Sign arbitrary unsigned transaction with wallet secrets and also secrets provided.
*
* @param body With this API method an arbitrary unsigned transaction can be signed with secrets provided or stored in the wallet. Both DLOG and Diffie-Hellman tuple secrets are supported.
Please note that the unsigned transaction contains only identifiers of inputs and data inputs. If the node holds UTXO set, it is able to extract boxes needed. Otherwise, input (and data-input) boxes can be provided in "inputsRaw" and "dataInputsRaw" fields. (required)
* @return Call<ErgoTransaction>
*/
@Headers({
"Content-Type:application/json"
})
@POST("wallet/transaction/sign")
Call<ErgoTransaction> walletTransactionSign(
@retrofit2.http.Body TransactionSigningRequest body
);
|
That was the scene from All-New X-Men #40 from six months ago.
In the three-page exclusive preview of Uncanny X-Men #600 below, young Drake confronts his older self about his sexuality, and the truth behind which way the original Iceman swings is finally revealed.
And it plays out as Bleeding Cool’s Joe Glass pretty much had it , when he wrote,
Our outward portrayals can be as much a mask for what is really going on with us than a true representation of our inner state of being. It could explain Iceman’s continuous disastrous relationships with women. In fact, a gay man dating, or marrying a woman, actually has a term in some circles…it’s known as using a ‘beard’. Beards because it’s both a signifier of masculinity (which for decades was considered a mutually exclusive concept from homosexuality) and a classic disguise technique. It was common with people of status and actors…it still is. So why not a superhero?
And not, as some people feared, that Jean Grey just made young Bobby gay with her out of control telepathy…
|
//@ts-check
///<reference path="devkit.d.ts" />
declare namespace DevKit {
namespace Formmsdyn_livechatengagementctx_Information {
interface Tabs {
}
interface Body {
/** The name of the custom entity. */
msdyn_name: DevKit.Controls.String;
/** Owner Id */
OwnerId: DevKit.Controls.Lookup;
}
}
class Formmsdyn_livechatengagementctx_Information extends DevKit.IForm {
/**
* DynamicsCrm.DevKit form msdyn_livechatengagementctx_Information
* @param executionContext the execution context
* @param defaultWebResourceName default resource name. E.g.: "devkit_/resources/Resource"
*/
constructor(executionContext: any, defaultWebResourceName?: string);
/** Utility functions/methods/objects for Dynamics 365 form */
Utility: DevKit.Utility;
/** The Body section of form msdyn_livechatengagementctx_Information */
Body: DevKit.Formmsdyn_livechatengagementctx_Information.Body;
}
class msdyn_livechatengagementctxApi {
/**
* DynamicsCrm.DevKit msdyn_livechatengagementctxApi
* @param entity The entity object
*/
constructor(entity?: any);
/**
* Get the value of alias
* @param alias the alias value
* @param isMultiOptionSet true if the alias is multi OptionSet
*/
getAliasedValue(alias: string, isMultiOptionSet?: boolean): any;
/**
* Get the formatted value of alias
* @param alias the alias value
* @param isMultiOptionSet true if the alias is multi OptionSet
*/
getAliasedFormattedValue(alias: string, isMultiOptionSet?: boolean): string;
/** The entity object */
Entity: any;
/** The entity name */
EntityName: string;
/** The entity collection name */
EntityCollectionName: string;
/** The @odata.etag is then used to build a cache of the response that is dependant on the fields that are retrieved */
"@odata.etag": string;
/** Unique identifier of the user who created the record. */
CreatedBy: DevKit.WebApi.LookupValueReadonly;
/** Date and time when the record was created. */
CreatedOn_UtcDateAndTime: DevKit.WebApi.UtcDateAndTimeValueReadonly;
/** Unique identifier of the delegate user who created the record. */
CreatedOnBehalfBy: DevKit.WebApi.LookupValueReadonly;
/** Sequence number of the import that created this record. */
ImportSequenceNumber: DevKit.WebApi.IntegerValue;
/** Unique identifier of the user who modified the record. */
ModifiedBy: DevKit.WebApi.LookupValueReadonly;
/** Date and time when the record was modified. */
ModifiedOn_UtcDateAndTime: DevKit.WebApi.UtcDateAndTimeValueReadonly;
/** Unique identifier of the delegate user who modified the record. */
ModifiedOnBehalfBy: DevKit.WebApi.LookupValueReadonly;
/** Browser where customer initiated chat */
msdyn_browser: DevKit.WebApi.StringValue;
/** City where customer initiated chat */
msdyn_City: DevKit.WebApi.StringValue;
/** Country where customer initiated chat */
msdyn_country: DevKit.WebApi.StringValue;
/** Device where customer initiated chat */
msdyn_device: DevKit.WebApi.StringValue;
/** Indicates if chat is authenticated */
msdyn_isauthenticated: DevKit.WebApi.BooleanValue;
/** Indicates if chat was initiated from proactive chat */
msdyn_isproactivechat: DevKit.WebApi.BooleanValue;
/** Latitude where customer initiated chat */
msdyn_latitude: DevKit.WebApi.StringValue;
/** Unique identifier for entity instances */
msdyn_livechatengagementctxId: DevKit.WebApi.GuidValue;
/** Unique identifier for engagement context */
msdyn_livechatengagementid: DevKit.WebApi.StringValue;
/** Corresponding conversation identifier for the chat */
msdyn_liveworkitemid: DevKit.WebApi.LookupValue;
/** Locale for this chat */
msdyn_locale: DevKit.WebApi.StringValue;
/** Longitude where customer initiated chat */
msdyn_longitude: DevKit.WebApi.StringValue;
/** The name of the custom entity. */
msdyn_name: DevKit.WebApi.StringValue;
/** Browser URL where customer initiated chat */
msdyn_originurl: DevKit.WebApi.StringValue;
/** Operating system where customer initiated chat */
msdyn_os: DevKit.WebApi.StringValue;
/** Customer portal identifier if exists */
msdyn_portalcontactid: DevKit.WebApi.StringValue;
/** Postal code where customer initiated chat */
msdyn_PostalCode: DevKit.WebApi.StringValue;
/** State where customer initiated chat */
msdyn_State: DevKit.WebApi.StringValue;
/** Street 1 where customer initiated chat */
msdyn_Street1: DevKit.WebApi.StringValue;
/** Street 2 where customer initiated chat */
msdyn_Street2: DevKit.WebApi.StringValue;
/** Street 3 where customer initiated chat */
msdyn_Street3: DevKit.WebApi.StringValue;
/** Corresponding widget application identifier for the chat */
msdyn_widgetappid: DevKit.WebApi.StringValue;
/** Date and time that the record was migrated. */
OverriddenCreatedOn_UtcDateOnly: DevKit.WebApi.UtcDateOnlyValue;
/** Enter the user who is assigned to manage the record. This field is updated every time the record is assigned to a different user */
OwnerId_systemuser: DevKit.WebApi.LookupValue;
/** Enter the team who is assigned to manage the record. This field is updated every time the record is assigned to a different team */
OwnerId_team: DevKit.WebApi.LookupValue;
/** Unique identifier for the business unit that owns the record */
OwningBusinessUnit: DevKit.WebApi.LookupValueReadonly;
/** Unique identifier for the team that owns the record. */
OwningTeam: DevKit.WebApi.LookupValueReadonly;
/** Unique identifier for the user that owns the record. */
OwningUser: DevKit.WebApi.LookupValueReadonly;
/** Status of the Live chat context */
statecode: DevKit.WebApi.OptionSetValue;
/** Reason for the status of the Live chat context */
statuscode: DevKit.WebApi.OptionSetValue;
/** For internal use only. */
TimeZoneRuleVersionNumber: DevKit.WebApi.IntegerValue;
/** Time zone code that was in use when the record was created. */
UTCConversionTimeZoneCode: DevKit.WebApi.IntegerValue;
/** Version Number */
VersionNumber: DevKit.WebApi.BigIntValueReadonly;
}
}
declare namespace OptionSet {
namespace msdyn_livechatengagementctx {
enum statecode {
/** 0 */
Active,
/** 1 */
Inactive
}
enum statuscode {
/** 1 */
Active,
/** 2 */
Inactive
}
enum RollupState {
/** 0 - Attribute value is yet to be calculated */
NotCalculated,
/** 1 - Attribute value has been calculated per the last update time in <AttributeSchemaName>_Date attribute */
Calculated,
/** 2 - Attribute value calculation lead to overflow error */
OverflowError,
/** 3 - Attribute value calculation failed due to an internal error, next run of calculation job will likely fix it */
OtherError,
/** 4 - Attribute value calculation failed because the maximum number of retry attempts to calculate the value were exceeded likely due to high number of concurrency and locking conflicts */
RetryLimitExceeded,
/** 5 - Attribute value calculation failed because maximum hierarchy depth limit for calculation was reached */
HierarchicalRecursionLimitReached,
/** 6 - Attribute value calculation failed because a recursive loop was detected in the hierarchy of the record */
LoopDetected
}
}
}
//{'JsForm':['Information'],'JsWebApi':true,'IsDebugForm':true,'IsDebugWebApi':true,'Version':'2.12.31','JsFormVersion':'v2'}
|
Admittedly, Ryan Reynolds didn't have the easiest upbringing.
The Deadpool 2 star grew up in a lower-middle-class family in Vancouver, the youngest of four boys. As Reynolds tells Mr. Porter, he had a "complicated" and "fractured" relationship with his late father, whom he describes as "a former cop, former boxer, full-time landmine." His father, who died in 2015 after battling Parkinson's disease, was "good in many ways," but he was "tough," too. "This is not meant to be some sob story—everyone carries their own bag of rocks around and I am no different in that regard—but growing up in my house, it was never relaxing or easy," he recalls. "I know that, throughout my life, I've dealt with anxiety in different ways."
Reynolds wouldn't wish his anxiety "on anyone," but he believes it's also a "great" fuel. "I mean, my God, it's the anti- complacency pill, but it's also something that you need to manage." The actor tends to "get pretty depressed," but exercise helps him cope. "Otherwise, I start to get a little bummed. For me, it is more psychological. Exercise is a means of expelling those demons."
And the actor has always relied on comedy to ease his anxieties. "I'll look for the joke in things so that I don't look for the sadness and the grief," he says. In that regard, Reynolds adds, "My brothers and I are all very, very close," and they "all share a bit of that type of humor together."
Reynolds had a falling out with his father, but his wife, Blake Lively, encouraged him to repair their relationship before he passed away. According to the actor, "She has a gift for foresight."
After their reconciliation, the couple named their first daughter after his father. "It felt right," Reynolds says. "All family relationships come with some complications. For better or worse, all roads lead to here. At the end of the day, it's easier to focus on the good stuff than the bad. My father died soon after my daughter was born, but he got to see her, which makes me happy." The couple's second daughter was born in the fall of 2016, Reynolds is now surrounded by female energy. "I love being a dad," he gushes. "It's the best thing that ever happened to me."
|
Absolutely gut-wrenching video of the Indiana State Fair concert stage collapse from last night. Reports indicate a freak wind burst and sudden weather may be partially to blame, and that the concert was delayed at the time.
It goes without saying that our hearts go out to the victims of this awful, awful incident.
Update: There are a now-confirmed five dead and 40-plus injured (including a rumored paralysis). We'll bring you any major updates as they occur. Editor's Note: Labeling this an engineering accident was short-sighted and the post has been updated to reflect that fact. -j.l.
Update 2: Many Gizmodo commenters have duly noted that audience members who were not injured in the collapse are running toward the accident. Even seconds after this disaster unfolded, there were brave men and women sprinting toward potential danger to help others.
|
def download_video(self, video: Video, file_path: str) -> None:
video_content = self.download_video_bytes(video)
if video_content:
path_dir = Path(file_path)
path_file = path_dir.joinpath(video.video_name)
with open(path_file, 'wb') as handler:
handler.write(video_content)
|
<gh_stars>1-10
//Client Side
#include<stdio.h>//STD I/O
#include<stdlib.h>//LIB OPERATIONS
#include<string.h>//STRING OPERATIONS
#include<sys/types.h>//DIFFERENT TYPES OF DATA TYPES
#include<sys/socket.h>//
#include<arpa/inet.h> //MICRO DEFINE OR FUNCTION DEFINE
#include <sys/socket.h>//SYSTEM CALLS
#include<netinet/in.h>/* Provides support for 3rd party protocol stack*/
void main(void)
{int clifd,n;
int bytesReceived=0;
struct sockaddr_in clientaddr;
char recvBuff[3000];
//socket
clifd=socket(AF_INET,SOCK_STREAM,0); //0 indicates optional. AF :- All families
if(clifd==-1)
perror("\n Socket is not created.");
else
printf("\n Socket created successfully.");
//sockaddr_in
clientaddr.sin_family=AF_INET; //sin:- sockaddr_in
clientaddr.sin_addr.s_addr=inet_addr("10.0.2.15");
clientaddr.sin_port=htons(3848);//hostbyte order to network byte order conversion
// bind
if(bind(clifd,(struct sockaddr *)&clientaddr,sizeof(clientaddr))==-1)
perror("\n Bind unsuccessful");
Else
printf("\n Bind successful.");
//connect
if(connect(clifd,(struct sockaddr *)&clientaddr,sizeof(clientaddr))==-1) //clientaddr must have the values of server.
perror("\n Connection failed ");
else
printf("\n Connection established ");
int i=0;
printf("\n**WELCOME TO BANKO**\n");
printf("\n\t\nTo which of the following Landmarks you are closest:");
printf("\n1:NEAR Shivajinagar\n");
printf("\n2:NEAR ShivajiChowk(Hinjewadi)\n");
printf("\n3:NEAR Bhartyavidhyapeeth\n");
printf("\n4:EXIT\n");
printf("\nSelect nearest choice of your current location\n");
printf("\n\n\n\t\t\tBANKO---BANKO---BANKO");
int choice;
printf("\n\nEnter your choice::");
scanf("%d",&choice);
switch(choice)
{
case 1:
printf("So you are near Shivaji Nagar");
break;
case 2:
printf("So you are near ShivajiChowk(Hinjewadi)");
break;
case 3:
printf("So you are near BhartiyaVidhyapeeth");
}
n=write(clifd,&choice,sizeof(int));
while((bytesReceived = read(clifd, recvBuff, 3000)) > 0)
{
printf("\nBytes received %d\n",bytesReceived);
// recvBuff[n] = 0;
// fwrite(recvBuff, 1,bytesReceived,fp);
printf("%s \n", recvBuff);
}
close(clifd);
}
|
Angiotensin-Converting Enzyme/Vitamin D Receptor Gene Polymorphisms and Bioelectrical Impedance Analysis in Predicting Athletic Performances of Italian Young Soccer Players Micheli, ML, Gulisano, M, Morucci, G, Punzi, T, Ruggiero, M, Ceroti, M, Marella, M, Castellini, E, and Pacini, S. Angiotensin converting enzyme/vitamin D receptor gene polymorphisms and bioelectrical impedance analysis in predicting athletic performances of Italian young soccer players. J Strength Cond Res 25: 2084-2091, 2011We evaluated the association between 2 genetic polymorphisms known to be involved in fitness and performance, and anthropometric features, body composition, and athletic performances in young male soccer players with the goal of identifying genetic profiles that can be used to achieve maximal results from training. One hundred twenty-five medium-high-level male soccer players were genotyped for angiotensin-converting enzyme (ACE) I/D, and vitamin D receptor (VDR) FokI gene polymorphisms and scored for anthropometric measurements, body composition, and athletic performance. Body mass index, fat mass, fat-free mass, resistance, reactance, impedance, phase angle (PA), and body cell mass were measured. Athletic performance was evaluated by squat jump, countermovement jump (CMJ), 2-kg medicine ball throw, 10- and 20-m sprint time. We observed that the homozygous ff genotype of the VDR gene was significantly more represented in young soccer players than in a matched sedentary population. Values of reactance and PA were differently distributed in ACE and VDR genotypes with high mean values in subjects with DD (ACE) and FF (VDR) genotypes. No correlation was observed between ACE or VDR genotypes and 2-kg medicine ball throw, 10- and 20-m sprint times. The ID genotype of ACE was associated with the best performances in squat jump and CMJ. Our results suggest that determination of ACE and VDR genotypes might help select those young athletes harboring the most favorable genetic potential to succeed in soccer.
|
Electronic spectra of protonated benzaldehyde clusters with Ar and N2: effect of * excitation on the intermolecular potential. Electronic spectra of the S←S transition of dimers of protonated benzaldehyde (BZH(+)) with Ar and N are recorded by resonance-enhanced photodissociation in a tandem mass spectrometer. The S origins observed are shifted to higher frequency upon complexation with Ar (S = 300 cm(-1)) and N (S = 628 cm(-1)). Ab initio calculations at the CC2/aug-cc-pVDZ level suggest an assignment to H-bonded dimers of L = Ar and N binding to the cis isomer of O-protonated BZH(+), yielding values of S = 242 and 588 cm(-1) for cis-BZH(+)-L(H). Electronic * excitation results in a substantial increase of the proton affinity of BZH(+), which in turn destabilizes the intermolecular H-bonds to the inert ligands by 35%. The drastic effects of electronic * excitation on the geometric and electronic structure as well as the strength and anisotropy of the intermolecular potential (H-bonding and -bonding) are investigated.
|
EA files three new trademark registrations for Syndicate, further teasing us with visions of a downloadable online sequel to Bullfrog's classic real-time tactics game.
The super-sleuths at Superannuation uncovered not one but three separate trademark registrations for Syndicate, each filed on July 30, each filed by Electronic Arts. Combined with last year's copyright registrations and confirmation that Starbreeze Studios is working on a new Syndicate game dating back to 2008, and it seems like we're all just waiting for EA to make this official.
We hoped it would be official at E3. Perhaps we'll hear something at GamesCom?
Advertisement
The three registrations could be hinting at the type of new Syndicate experience we can expect. One filing is for "Computer game software; Downloadable computer game software via a global computer network and wireless devices; Video game software." Another lists "Entertainment services, namely, providing an on-line computer game; Provision of information relating to electronic computer games provided via the Internet."
So we're thinking something downloadable, and definitely something online. The third registration is a bit more puzzling. It reads "Board games; Collectable toy figures; Hand held units for playing electronic games other than those adapted for use with an external display screen or monitor; Modeled plastic toy figurines; Playing cards."
I have no idea what that could mean. I just know that EA needs to stop teasing us and just let it all out. It'll be cathartic.
Advertisement
EA Syndicate Trademark Registrations [Superannuation]
|
// MakeDatabaseTokenManager creates an instance of TokenManager that stores data in RethinkDB
func MakeDatabaseTokenManager(logger slog.Instance, dbToken DBToken) *DatabaseTokenManager {
if logger == nil {
logger = slog.Scope("DB-TM")
} else {
logger = logger.SubScope("DB-TM")
}
logger.Info("Creating Database Token Manager")
return &DatabaseTokenManager{
log: logger,
dbToken: dbToken,
}
}
|
/*
* @(#)FXSvgTinyReaderNew.java
* Copyright © 2021 The authors and contributors of JHotDraw. MIT License.
*/
package org.jhotdraw8.svg.io;
import javafx.scene.Node;
import org.jhotdraw8.annotation.NonNull;
import org.jhotdraw8.draw.figure.Figure;
import org.jhotdraw8.draw.render.SimpleDrawingRenderer;
import javax.xml.transform.Source;
import java.io.IOException;
/**
* Reads an SVG "Tiny" 1.2 file and creates JavaFX nodes from it.
*/
public class FXSvgTinyReader {
public FXSvgTinyReader() {
}
public Node read(@NonNull Source in) throws IOException {
Figure figure = new FigureSvgTinyReader().read(in);
SimpleDrawingRenderer r = new SimpleDrawingRenderer();
Node node = r.render(figure);
node.setManaged(true);
return node;
}
}
|
/**
* @author Lukas Krejci
*/
public class CheckSpecificConfigurationTest {
@Test
public void testEmptyConfigWhenNoExtensionId() throws Exception {
class FakeCheck extends CheckBase {
public boolean emptyConfig = false;
@Override
public EnumSet<Type> getInterest() {
return null;
}
@Override
public void initialize(@Nonnull AnalysisContext analysisContext) {
emptyConfig = !analysisContext.getConfiguration().isDefined();
}
}
FakeCheck check = new FakeCheck();
JavaApiAnalyzer analyzer = new JavaApiAnalyzer(Collections.singleton(check), Collections.emptyList());
analyzer.initialize(AnalysisContext.builder().build().copyWithConfiguration(ModelNode.fromJSONString("{}")));
Assert.assertTrue(check.emptyConfig);
}
@Test
public void testCheckConfigurationInSchema() throws Exception {
class FakeCheck extends CheckBase {
@Override
public EnumSet<Type> getInterest() {
return null;
}
@Nullable
@Override
public String getExtensionId() {
return "testCheck";
}
@Nullable
@Override
public Reader getJSONSchema() {
return new StringReader("{\"type\": \"boolean\"}");
}
}
JavaApiAnalyzer analyzer = new JavaApiAnalyzer(Collections.singleton(new FakeCheck()), Collections.emptyList());
try (Reader rdr = analyzer.getJSONSchema()) {
ModelNode schema = ModelNode.fromJSONString(slurp(rdr));
Assert.assertTrue(
"boolean".equals(schema.get("properties", "checks", "properties", "testCheck", "type").asString()));
}
}
@Test
public void testCheckConfigured() throws Exception {
class FakeCheck extends CheckBase {
Boolean testCheck = null;
@Override
public EnumSet<Type> getInterest() {
return null;
}
@Nullable
@Override
public String getExtensionId() {
return "testCheck";
}
@Nullable
@Override
public Reader getJSONSchema() {
return new StringReader("{\"type\": \"boolean\"}");
}
@Override
public void initialize(@Nonnull AnalysisContext analysisContext) {
testCheck = analysisContext.getConfiguration().asBoolean();
}
}
FakeCheck check = new FakeCheck();
JavaApiAnalyzer analyzer = new JavaApiAnalyzer(Collections.singleton(check), Collections.emptyList());
String config = "{\"checks\": {\"testCheck\": true}}";
analyzer.initialize(AnalysisContext.builder().build().copyWithConfiguration(ModelNode.fromJSONString(config)));
Assert.assertTrue(check.testCheck);
}
@SuppressWarnings("Duplicates")
private String slurp(Reader rdr) throws IOException {
char[] buffer = new char[512];
int cnt;
StringBuilder bld = new StringBuilder();
while ((cnt = rdr.read(buffer)) >= 0) {
bld.append(buffer, 0, cnt);
}
return bld.toString();
}
}
|
<filename>TTF.ts
/**载入ttf字体
* @param fontName: string 注册字体名称
* @param url: string ttf字体文件的路径
* @param deadText: string 如果是在browser下的WEBGL模式,这个字符将不能再用ttf字体打印显示出来,SO请设置一个生僻字吧!
* 注:调用前必须初始化LAYA, 在第一屏加载中对TTF字体进行缓存加载,第一屏加载完成后再进行此方法的调用,确保TTF字体已处理可使用状态。
*/
export default function LoadTTF(url: string, fontName: string = 'TTF', deadText: string = "氇") {
//LayaNative
if (window["conch"]) {
let _ttf: ArrayBuffer = Laya.loader.getRes(url);
window["conch"].setFontFaceFromBuffer(fontName, _ttf);
}
//standard H5
else {
let _css: string = `@font-face { font-family: ${fontName}; src: url(${url}) format('truetype'); }`;
let _style: HTMLStyleElement = document.createElement('style');
_style.type = 'text/css';
_style.innerHTML = _css;
document.head.appendChild(_style);
//缓存激活TTF字体
let _cache: Laya.Text = new Laya.Text();
_cache.font = fontName;
_cache.text = deadText;
_cache.fontSize = 1;
_cache.pos(-1, -1);
Laya.stage.addChild(_cache);
}
}
|
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
@Component({
selector: 'register-fail',
templateUrl: './register-fail.component.html',
styleUrls: ['./register-fail.component.scss']
})
export class RegisterFailComponent implements OnInit {
public isExist: boolean = false;
private sub: any;
constructor(private route: ActivatedRoute) {
this.sub = this.route.params.subscribe(params => {
if(atob(params['errorCode']) == '3') {
this.isExist= true;
}
});
}
ngOnInit() {
}
}
|
<reponame>avranju/msopentech-tools-for-intellij
/**
* Copyright 2014 Microsoft Open Technologies 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.
*/
package com.microsoftopentechnologies.intellij.ui;
import com.intellij.openapi.ui.ValidationInfo;
import com.microsoftopentechnologies.azurecommons.wacommonutil.PreferenceSetUtil;
import com.microsoftopentechnologies.intellij.AzurePlugin;
import com.microsoftopentechnologies.intellij.util.PluginUtil;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import static com.microsoftopentechnologies.intellij.ui.messages.AzureBundle.message;
public class ServiceEndpointsPanel implements AzureAbstractPanel {
private static final String DISPLAY_NAME = "Service Endpoints";
private JPanel contentPane;
private JComboBox prefNameCmb;
private JButton editBtn;
private JTextField txtPortal;
private JTextField txtMangmnt;
private JTextField txtBlobUrl;
private JTextField txtPubSet;
private String valOkToLeave = "";
public ServiceEndpointsPanel() {
if (!AzurePlugin.IS_ANDROID_STUDIO && AzurePlugin.IS_WINDOWS) {
init();
}
}
protected void init() {
prefNameCmb.addItemListener(createPrefNameCmbListener());
setToDefaultName();
populateValues();
editBtn.addActionListener(createEditBtnListener());
}
public JComponent getPanel() {
return contentPane;
}
public String getDisplayName() {
return DISPLAY_NAME;
}
@Override
public boolean doOKAction() {
return true;
}
@Override
public String getSelectedValue() {
return null;
}
public ValidationInfo doValidate() {
return null;
}
@Override
public String getHelpTopic() {
return null;
}
private ItemListener createPrefNameCmbListener() {
return new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
populateValues();
}
};
}
private ActionListener createEditBtnListener() {
return new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
// JdkSrvConfig.custLinkListener(
// Messages.edtPrefTtl,
// Messages.prefFileMsg,
// false,
// getShell(),
// null,
// preferenceFile);
}
};
}
/**
* Method sets extracted <preferenceset> names to
* active set combo box. By default, it is set to
* the default setting of the parent <preferencesets> element.
* But if user is visiting service endpoint page
* after okToLeave then value modified by user is populated.
*/
private void setToDefaultName() {
try {
prefNameCmb.setModel(new DefaultComboBoxModel(PreferenceSetUtil.getPrefSetNameArr(AzurePlugin.prefFilePath)));
if (!valOkToLeave.isEmpty()) {
prefNameCmb.setSelectedItem(valOkToLeave);
} else {
prefNameCmb.setSelectedItem(PreferenceSetUtil.getSelectedPreferenceSetName(AzurePlugin.prefFilePath));
}
} catch (Exception e) {
PluginUtil.displayErrorDialog(message("errTtl"), message("getPrefErMsg"));
}
}
/**
* Blob, Management, Portal
* and Publish Settings
* values from preferencesets.xml
* will be populated according to active set value.
*/
private void populateValues() {
String nameInCombo = (String) prefNameCmb.getSelectedItem();
try {
txtPortal.setText(PreferenceSetUtil.getSelectedPortalURL(nameInCombo, AzurePlugin.prefFilePath));
txtMangmnt.setText(PreferenceSetUtil.getManagementURL(nameInCombo, AzurePlugin.prefFilePath));
txtBlobUrl.setText(PreferenceSetUtil.getBlobServiceURL(nameInCombo, AzurePlugin.prefFilePath));
txtPubSet.setText(PreferenceSetUtil.getSelectedPublishSettingsURL(nameInCombo, AzurePlugin.prefFilePath));
} catch (Exception e) {
PluginUtil.displayErrorDialog(message("errTtl"), message("getPrefErMsg"));
}
}
}
|
I was recently stricken with shingles , the debilitating and excruciatingly painful virus that appears as a blistering rash on one side of the body (or even the face) that sometimes transforms into a maddening itch when it heals. The sneaky disease is actually caused by the reactivation of the Varicella Zoster virus that remains dormant in the body after the recovery of chickenpox. The sleeping virus is suddenly awakened by a jolt of stress or other triggering factor, usually when the immune system is depressed.
Most adults over age 50 have contracted chickenpox, and one in three can expect to develop shingles within their lifetime. Currently 1 million people in this country every year, including younger adults will be clobbered with the disease despite the vaccine meant to prevent its occurrence. If life's stresses have got the best of you, and you've picked up shingles, here's a diet to help wallop the virus and shorten its duration.
Best warriors are probiotic powerhouses loaded with beneficial gut-bacteria that dial up digestion along with the immune system. Be a culture vulture with luscious yogurts brimming with lactobacillus or acidophilus. Goat dairy typically has an added dose of probiotics, while kefir, a fermented dairy beverage that's slightly sour and refreshing is endowed with antioxidants and billions of colony-forming units. Drink it straight up or blend with fresh berries and a drizzle of honey. For savory palates, indulge in a heap of sauerkraut and sour dill pickles or spicy kimchi, a Korean staple of fermented cabbage, one of the highest probiotic sources on the planet.
Crank up consumption of foods with a rich store of vitamins, especially A, B, C, D and E, along with folate, zinc and iron. Stress-balancing Bs are vital to a shingles diet since the virus tinkers with nerve endings causing severe pain. Get cracking with eggs of all manners, along with milk and chicken, packed with B12s, while bananas, brewer's yeast and potatoes have an abundance of calming B6s.
Oranges, pineapple, kiwi and lemons are loaded with the mighty C soldier, or for less acidic choices do broccoli, bell peppers and cabbage. Leafy greens give a shot of Vitamin D to ward off invading viruses, while pomegranates and blueberries are dual-purpose weapons protecting cells from oxidation, along with revving up the precious immune system. At last, seaweed, an oceanic treasure with a slew of vitamins (especially B complex) and minerals has been found to shove shingles under the bus.
Herculean garlic chock-full of allicin, a potent sulfur compound as well as Vitamins A, B6 and C, selenium, magnesium, potassium, calcium and zinc make this "stinky rose" a powerful antioxidant and immune system's best friend. Crush raw in vinaigrette dressings or yoghurt dips (recipe provided), sauté with broccoli rapini and olive oil, simmer in soups and sauces, or roast whole and use as a spread on toast, a topping for baked potatoes or roasted roots to heal blisters quicker.
One of the most potent shingles busters can be found in foods brimming with lysine, an amino acid that puts the skids on the cellular growth of the zoster virus. So lysine up with wild-caught, deep-sea fish and seafood, lamb, turkey, beans, dairy products, along with dried apricots, raisins and figs.
And remember to drink plenty of water to flush toxins through the body.
Foods that have been found to exacerbate the shingles virus should be avoided where possible. The worst culprits contain the amino acid arginine that actually stimulate the herpes virus to replicate, such as, nuts, seeds, soy products, oats, coconut, flour (white and whole-wheat), and alas, chocolate. Also ban booze, which tinkers with the body's immune responses, along with caffeine products (coffee, black tea and colas) that cause jittery nerves.
Fatty, as well as cloyingly sweet, empty calorie and processed foods are no-no's for shingles sufferers.
Finally, steer clear of extreme temperatures in foods like scalding soups or icy treats that are jarring to the nervous system. Foods should be served like Baby Bear's porridge — not too hot, not too cold — just right.
Method: Blend ingredients in a glass bowl. Chill. Serve as a dipping sauce for fresh vegetables, drizzle on burgers, pitas or kebobs.
|
<reponame>nickrfer/microservices-with-spring-cloud-journey<filename>lab-9/gateway-solution/src/main/java/demo/Application.java
package demo;
import javax.servlet.Filter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.context.annotation.Bean;
import org.springframework.web.filter.ShallowEtagHeaderFilter;
@SpringBootApplication
@EnableZuulProxy
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
@Bean
public Filter shallowEtagHeaderFilter() {
return new ShallowEtagHeaderFilter();
}
}
|
Suspected Recurrent SARS-CoV-2 Infections Among Residents of a Skilled Nursing Facility During a Second COVID-19 Outbreak Kentucky, JulyNovember 2020 Reinfection with SARS-CoV-2, the virus that causes coronavirus disease 2019 (COVID-19), is believed to be rare. Some level of immunity after SARS-CoV-2 infection is expected; however, the evidence regarding duration and level of protection is still emerging. The Kentucky Department for Public Health (KDPH) and a local health department conducted an investigation at a skilled nursing facility (SNF) that experienced a second COVID-19 outbreak in October 2020, 3 months after a first outbreak in July. Five residents received positive SARS-CoV-2 reverse transcription-polymerase chain reaction (RT-PCR) test results during both outbreaks. During the first outbreak, three of the five patients were asymptomatic and two had mild symptoms that resolved before the second outbreak. Disease severity in the five residents during the second outbreak was worse than that during the first outbreak and included one death. Because test samples were not retained, phylogenetic strain comparison was not possible. However, interim period symptom resolution in the two symptomatic patients, at least four consecutive negative RT-PCR tests for all five patients before receiving a positive test result during the second outbreak, and the 3-month interval between the first and the second outbreaks, suggest the possibility that reinfection occurred. Maintaining physical distance, wearing face coverings or masks, and frequent hand hygiene are critical mitigation strategies necessary to prevent transmission of SARS-CoV-2 to SNF residents, a particularly vulnerable population at risk for poor COVID-19-associated outcomes.* Testing, containment strategies (isolation and quarantine), and vaccination of residents and health care personnel (HCP) are also essential components to protecting vulnerable residents. The findings of this study highlight the importance of maintaining public health mitigation and protection strategies that reduce transmission risk, even among persons with a history of COVID-19 infection. Reinfection with SARS-CoV-2, the virus that causes coronavirus disease 2019, is believed to be rare. Some level of immunity after SARS-CoV-2 infection is expected; however, the evidence regarding duration and level of protection is still emerging. The Kentucky Department for Public Health (KDPH) and a local health department conducted an investigation at a skilled nursing facility (SNF) that experienced a second COVID-19 outbreak in October 2020, 3 months after a first outbreak in July. Five residents received positive SARS-CoV-2 reverse transcription-polymerase chain reaction (RT-PCR) test results during both outbreaks. During the first outbreak, three of the five patients were asymptomatic and two had mild symptoms that resolved before the second outbreak. Disease severity in the five residents during the second outbreak was worse than that during the first outbreak and included one death. Because test samples were not retained, phylogenetic strain comparison was not possible. However, interim period symptom resolution in the two symptomatic patients, at least four consecutive negative RT-PCR tests for all five patients before receiving a positive test result during the second outbreak, and the 3-month interval between the first and the second outbreaks, suggest the possibility that reinfection occurred. Maintaining physical distance, wearing face coverings or masks, and frequent hand hygiene are critical mitigation strategies necessary to prevent transmission of SARS-CoV-2 to SNF residents, a particularly vulnerable population at risk for poor COVID-19-associated outcomes.* Testing, containment strategies (isolation and quarantine), and vaccination of residents and health care personnel (HCP) are also essential components to protecting vulnerable residents. The findings of this study highlight the importance of maintaining public health mitigation and protection strategies that reduce transmission risk, even among persons with a history of COVID-19 infection. First Outbreak: Investigation and Findings In July, a Kentucky SNF notified the local health department of a case of COVID-19 in one of the facility's HCP; KDPH was also notified. RT-PCR testing was performed in * https://www.cdc.gov/coronavirus/2019-ncov/hcp/long-term-care.html accordance with state protocol to identify additional cases among residents and HCP. A confirmed COVID-19 case was defined as a positive RT-PCR test result for a SNF resident or HCP. The index patient in this outbreak was a symptomatic HCP. Initially, symptomatic persons and exposed residents who had received direct care and HCP who had close contact with the infected HCP were tested. Facility-wide testing for all residents and HCP began when additional positive test results were received. Residents and HCP who received negative results were retested weekly; in addition, anyone experiencing symptoms was tested at the time of symptom onset. Residents with positive test results were cohorted in a separate COVID-19 unit with dedicated HCP who used appropriate personal protective equipment. The SNF required the receipt of two negative test results collected >24 hours apart to release patients from the COVID-19 unit. HCP with positive test results could not return to work until completion of their isolation period. § Residents who had been exposed to COVID-19 with negative test results were cohorted in a separate unit, primarily in double-occupancy rooms. Weekly testing of all noninfected HCP and residents continued for >14 days after the final case of the initial outbreak was identified. In total, 20 (17.4%) of 115 residents and five (3.5%) of 143 HCP in this facility received positive test results during July 16-August 11, representing an overall attack rate of 9.7%. Eight (40.0%) residents with COVID-19 were hospitalized, and five (25.0%) residents with COVID-19 died. No hospitalizations or deaths occurred among HCP with COVID-19. KDPH and the local health department encouraged the facility to continue to monitor hand hygiene of residents and HCP, emphasize environmental cleaning and disinfection, practice universal masking, use standard precautions for general resident contact, quarantine newly-admitted and readmitted patients for 14 days, employ testing, and restrict visitation based on county-level incidence rates. The facility continued to monitor all residents and HCP for signs and symptoms of COVID-19 and to test symptomatic persons. The SNF https://www.cdc.gov/coronavirus/2019-ncov/hcp/nursing-homes-responding.html § At the time of the first outbreak, KDPH guidance for return to work for HCP recommended a time-and symptom-based approach. https://chfs.ky.gov/ agencies/dph/covid19/Guidanceforreleasefromisolation.pdf continued to test HCP at least every other week between the two outbreaks. A total of 597 facility-ordered RT-PCR tests were performed in September, and 331 tests were performed during October 1-29; all results were negative. Second Outbreak: Investigation and Findings On October 30, 2020, the same SNF notified the local health department and KDPH of two COVID-19 cases after two symptomatic residents received positive test results. Testing and cohorting practices similar to those implemented during the first outbreak were initiated, and testing of residents and HCP was increased to twice weekly. During October 30-December 7, a total of 85 (74.6%) of 114 residents and 43 (29.5%) of 146 HCP received positive SARS-CoV-2 RT-PCR test results, representing an attack rate of 49.2% among the 260 SNF residents and HCP present at the start of the outbreak in October. Among the 85 resident cases identified in the second outbreak, 15 (17.6%) patients died. No HCP died. Among 12 residents who received positive test results during the first outbreak (July-August) and were still living in the facility in October, five also received positive results during the second outbreak >90 days after the date that their first specimens were collected. These patients were classified as having recurrent cases of COVID-19. Among the five HCP who had received a positive SARS-CoV-2 test result during the July outbreak, only one was working at the facility at the time of the second outbreak. This staff member did not have a positive SARS-CoV-2 test result during the second outbreak. KDPH performed SNF interviews, reviewed testing results from the National Electronic Disease Surveillance System, and contacted the testing laboratories to investigate exposures, testing history, and course of illness of the five patients identified as having recurrent COVID-19. The activity was reviewed by CDC and conducted consistent with applicable federal law and CDC policy. The five patients with recurrent COVID-19 ranged in age from 67 to 99 years; four were women (Table). Each of the five patients had more than three chronic underlying health conditions, and all were permanent residents of the SNF. None of the patients with recurrent COVID-19 had an immunosuppressive condition or was taking immunosuppressive medications that might have hindered clearance of the virus or predisposed them to virus reactivation. Among these five patients, only two (patients C and D) were symptomatic during the first outbreak; neither had fever or respiratory symptoms, and neither was hospitalized (Figure). Both had complete resolution of symptoms between the two 45 C.F.R. part 46.102(l). outbreaks. All residents with recurrent COVID-19 had at least four consecutive negative RT-PCR test results between their two positive tests. All five patients received their positive RT-PCR results for the second COVID-19 diagnosis in the midst of the second facility outbreak and therefore after facility exposure to SARS-CoV-2. Three patients (patients A, C, and D) with recurrent infection had roommates who received positive SARS-CoV-2 RT-PCR results before they received their own positive test results, confirming direct exposure. Patient B was in a private room, and patient E had a roommate who did not have COVID-19. Although no direct route of exposure was identified for patients B or E, exposure to SARS-CoV-2 was very likely because of the large number of infected persons in the facility during the second outbreak. Cycle threshold (Ct) values ≤30 were reported for positive test results for the five patients in each infectious episode, which suggests at least moderate upper respiratory tract viral loads. Although three of the five patients with recurrent COVID-19 were asymptomatic during their first infectious episode, all five experienced symptoms during their second infectious episode; the two patients who were symptomatic during the first outbreak experienced more severe symptoms during the second infectious episode compared with the symptoms they had during the first outbreak (Table). One resident patient required hospitalization and subsequently died. Discussion After receiving positive COVID-19 test results during a SNF outbreak and subsequently receiving four to five negative SARS-CoV-2 RT-PCR test results, five residents received positive results >90 days later during the facility's second COVID-19 outbreak, suggesting SARS-CoV-2 reinfection. All patients with recurrent COVID-19 experienced more severe disease during the second outbreak, and one died. The exposure history, including the timing of roommates' infections and the new onset of symptoms during the second outbreak, suggest that the second positive RT-PCR results represented new infections after the patients apparently cleared the first infection. The finding that all five patients with recurrent COVID-19 had either asymptomatic or mildly symptomatic courses during their first infections is noteworthy, suggesting the possibility that asymptomatic or mildly symptomatic initial infections do not produce a sufficiently robust immune response to prevent reinfection. The patients with recurrent illness ranged in age from 67 to 99 years; a decline in immune system function with aging is well-documented, but little scientific evidence is available to date regarding whether or how an aging immune system might affect response to initial SARS-CoV-2 infection, likelihood of reinfection upon new exposure, and illness severity associated with reinfection. As with any diagnostic test, false-positive results are possible. The absence of symptoms in three of five patients during the initial episode could support the argument that the test results during the first outbreak were false positives, although it is known that up to 40%-50% of infections are asymptomatic. The probability that all five tests were false positives is a less likely explanation, especially in the context of a facility outbreak with associated severe morbidity and mortality. In addition, Ct values for the positive test results in the first outbreak were within the cutoff for limit of detection, suggesting virus titers consistent with infection. These findings highlight the importance of maintaining public health practices that reduce transmission risk, even among persons who have previously received a positive SARS-CoV-2 test result. These findings support the possibility of reinfection in this population, though more definitive evidence with genomic sequencing is missing. The findings also suggest the possibility that disease can be more severe during a second infection. The findings in this report are subject to at least three limitations. First, because specimens were not stored, genomic sequencing to confirm a reinfection was not possible. Second, no additional testing was performed during the first outbreak until at least 10 days after the first RT-PCR positive test result for the five residents later identified to have recurrent Summary What is already known about this topic? Case reports of reinfection with SARS-CoV-2 exist; however, data are limited as to the frequency and outcomes of reinfection. What is added by this report? Five residents of a skilled nursing facility received positive SARS-CoV-2 nucleic acid test results in two separate COVID-19 outbreaks separated by 3 months. Residents received at least four negative test results between the two outbreaks, suggesting the possibility of reinfection. Severity of disease in the five residents during the second outbreak was worse than that during the first outbreak and included one death. What are the implications for public health practice? Skilled nursing facilities should use strategies to reduce the risk for SARS-CoV-2 transmission among all residents, including among those who have previously had a COVID-19 diagnosis. Vaccination of residents and health care personnel in this setting is particularly important to protect residents. COVID-19. Therefore, no additional test results exist to support the initial test result as a true positive. Finally, no serologic testing was performed after the first outbreak, which could have helped confirm infection before the second infectious episode. Five SNF residents received positive SARS-CoV-2 test results during two separate facility outbreaks that occurred FIGURE. Exposure, symptom onset, and testing timeline for five patients with recurrent COVID-19 cases in a skilled nursing facility -Kentucky, July-December 2020* in July and October 2020, suggesting possible reinfection. Affected persons experienced more severe illness during their second SARS-CoV-2 infection. Reinfection risk to the general population is suspected to be low, but SNF residents might have higher risk for new exposures, given the congregate nature of these settings and ongoing interactions with HCP and other residents. In addition, the level and duration of postinfection immunity in persons with an aging immune system is unknown, but the potential health consequences of reinfection among SNF populations remain serious. Therefore, steps to protect this population from the ongoing potential of SARS-CoV-2 exposures should be implemented. Based on the observations of this study, testing and cohorting practices in SNFs should not assume that residents infected >90 days earlier are immune to COVID-19. Public health interventions to limit transmission are vital for all persons in SNFs, including those who have previously been infected with SARS-CoV-2; these include physical distancing, use of masks (including by SNF residents, if tolerated), and frequent hand hygiene using hand sanitizer with 60%-95% alcohol or washing with soap and water for at least 20 seconds. Vaccination in these settings, as recommended by the Advisory Committee on Immunization Practices, is particularly important to optimally protect these vulnerable persons.
|
The Involvement of MicroRNAs in SARS-CoV-2 Infection Comorbid with HIV-Associated Preeclampsia Purpose of Review This review investigated the potential role of microRNAs (miRNAs) in the synergy of severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2) infection, preeclampsia (PE), and human immunodeficiency virus (HIV) infection. Maternal health is a great concern when treating pregnant women fighting this triad of diseases, which is highly prevalent in South Africa. MicroRNAs are involved in fine-tuning of physiological processes. Disruptions to the balance of this minute protein can lead to various physiological changes that are sometimes pathological. Recent Findings MicroRNAs have recently been implicated in PE and have been linked to the anti-angiogenic imbalance evident in PE. Recent in silico studies have identified potential host miRNAs with anti-viral properties against SARS-CoV-2 infection. Studies have demonstrated dysregulated expression of several miRNAs in HIV-1 infection along with the ability of HIV-1 to downregulate anti-viral host microRNAs. Summary This review has highlighted the significant gap in literature on the potential of miRNAs in women with HIV-associated PE in synergy with the novel SARS-CoV-2 infection. In addition, this review has provided evidence of the critical role that the epigenetic regulatory mechanism of miRNA plays in viral infections and PE, thereby providing a foundation for further research investigating the potential of therapeutic miRNA development with fewer side-effects for pregnant women. Introduction The novel severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2) emerged in late November 2019 and has led to the coronavirus disease 2019 (COVID- 19) pandemic . It is believed that SARS-CoV-2 originated from a wild meat market in Wuhan, Hubei, China. Severe acute respiratory syndrome coronavirus 2 transmission occurs across humans regardless of age and sex; however, it is more prevalent amongst the elderly, the overweight, and those with asthma, diabetes, and other immunocompromised conditions. According to the World Health Organization (WHO), South Africa (SA) has the highest COVID-19 prevalence in Africa. Despite an "early hard lockdown" by the country, more than 700,000 South Africans have been infected with SARS-CoV-2 as of October 2020. Considered to be a low-and middle-income country (LMIC), it seems unlikely that SA will avoid a fall in the local economy. Hence, it is of utmost importance to rapidly discover solutions to overcome the COVID-19 pandemic. MicroRNAs (miRNAs) are endogenous small non-coding RNAs that are able to post-transcriptionally regulate the expression of proteins through modulation of the protein's messenger RNA. MicroRNAs are approximately 22 nucleotides long and possess a long half-life and stability that is 10 times stronger than mRNAs, even in extracellular fluids like urine and plasma. MicroRNAs are able to degrade mRNA and suppress protein translation when the 5 terminal of miRNA pairs with the 3-untranslated region (3-UTR) of mRNA. When miRNAs are incompletely complementary to multiple sites in the 3-UTR, protein synthesis is inhibited. In comparison, when completely base-paired, a single phosphodiester bond is cleaved leading to degradation of the target mRNA. Host miRNAs have been reported to be involved in cell proliferation, angiogenesis, immune cell development, and apoptosis. Differential expression of miRNAs has been implicated in several viral diseases, cancer, diabetes, schizophrenia, and cardiovascular diseases. The diverse role of miRNAs ignites the curiosity of its role in contemporary diseases and associated conditions. Hypertensive disorders in pregnancy (HDP) are one of the commonest direct causes of mortality and morbidity worldwide; approximately 94% of maternal deaths occur in LMIC. Furthermore, it is responsible for 18% of all maternal deaths in SA. Preeclampsia (PE) is an HDP of unknown origin that complicates 5-8% of pregnancies worldwide and occurs more frequently in LMIC compared to high-income countries. Preeclampsia is characterized by new-onset hypertension (systolic blood pressure ≥140 mmHg or diastolic blood pressure ≥90 mmHg) with or without excessive proteinuria (≥300 mg every 24 h); the disorder presents with the clinical signs of hypertension at or after 20-week gestation. The diagnosis of PE is also made in the absence of proteinuria when there is evidence of multi-organ involvement such as acute kidney injury, neurologic signs, liver disease, and intrauterine foetal growth restriction. In addition, evidence of haemolysis, elevated liver enzymes, and low platelet counts leads to a diagnosis of HELLP syndrome. The human immunodeficiency virus (HIV) attack cells of the immune system thereby weakening immunity which leads to the host being susceptible to other infections and diseases.. HIV infection is a global concern with over 30 million people living with HIV at the end of 2019. In 2019, 13.5% of the South African population was infected with HIV (7.97 million). South Africa has the highest antiretroviral (ARV) "rollout program" in the world with 4.7 million citizens receiving treatment. The world health organization (WHO) has recommended that all infected humans initiate and continue the life-long use of highly active antiretroviral therapy (HAART) as a treatment for HIV. Pregnant and breast-feeding women are also encouraged to continue with HAART treatment as it was shown to markedly reduce mother to child transmission. However, ARVs may be associated with PE predisposition . Maternal deaths from HIV infection is high (>34%) in SA followed by obstetric haemorrhage and HDP. Several studies have postulated that HIV infection influences the rate of PE development. In light of the high maternal mortality emanating from HIV infection and PE, it is of paramount importance that one examines their interaction with the new deadly COVID-19 pandemic. This review will address the missing gaps in literature concerning the effects of microRNAs in HIV-associated PE comorbid with COVID-19; thereby providing a foundation for further research investigating the triad of inflammatory-related conditions. Severe Acute Respiratory Syndrome Coronavirus 2 Severe acute respiratory syndrome coronavirus 2 belongs to the subfamily of Beta coronaviruses, similar to SARS-CoV-1 and MERS-CoV. SARS-CoV-2 is an enveloped virus with positive-sense single-stranded RNA (+ssRNA). Beta coronavirus have been attributed to be the most fatal subfamilies of coronaviruses. Based on current literature, SARS-CoV-2 is composed of four structural and functional proteins which include the spike, membrane, envelope, and nucleocapsid proteins, together with RNA viral genome. The route of COVID-19 spread is similar to other coronaviruses via human-to-human contact. Humans have a basic biological imperative to connect with other people, making human-to-human contact a very efficient way to amplify viral dissemination. However, it is also spread through the oral-faecal route. SARS-CoV-2 infection occurs in three stages. Stage one includes the incubation period which lasts for approximately 5 days. The virus becomes detectable in stage two and the patient displays mild flu-like symptoms. Stage three presents with severe symptoms which include acute respiratory distress syndrome (ARDS), multiorgan involvement, and subsequent death. Upon entry of the virus into the host, SARS-CoV-2 attaches to angiotensin-converting enzyme 2 (ACE 2) receptors of pneumocytes, thereby infecting host cells. Current literature suggests that the receptor-binding domain of SARS-CoV-2 spike protein is activated via cleavage by transmembrane serine protease 2 (TMPRSS2). SARS-CoV-2 is then able to follow normal trends in viral infection such as replication, maturation, and release of virions. Since ACE 2 receptors are involved in pregnancy, it is plausible that SARS-CoV-2 infection predispose pregnancy complications. domain of ACE 2 between amino acids 716 and 741; producing the soluble form of ACE 2 (sACE 2) that is released into maternal circulation. Individuals with metabolic conditions have a higher expression of angiotensin II, whereas healthy individuals express angiotensin. SARS-CoV-2 has a greater affinity for sACE 2 in comparison to the membrane-bound form, indicative of potential therapeutic properties. Soluble ACE 2 can potentially neutralize SARS-CoV-2, thereby reducing viral pathogenicity. In light of the dire pandemic, it is vital that we investigate the properties of sACE 2 and its potential therapeutic benefits in HIV-positive preeclamptic women comorbid with COVID-19. The Role of Angiotensin-Converting Enzyme 2 in Pregnancy and Preeclampsia In a normal physiological environment, the juxtaglomerular cells of the kidney secrete renin, which enzymatically converts angiotensinogen to angiotensin I. Angiotensinconverting enzyme (ACE) converts angiotensin I to angiotensin II. Angiotensin II functions to increase blood pressure by acting on the kidney, brain, arterioles, and adrenal cortex, via its receptors-angiotensin II type 1 receptor (AT1R) and angiotensin II type 2 receptor (AT2R), shown in Fig. 1. Angiotensin-converting enzyme 2 serves as a regulatory mechanism by degrading angiotensin II to angiotensin- and angiotensin I to angiotensin-, which have opposing effects to that of angiotensin II. Thus, ACE 2 maintains a balance in the renin-angiotensin system (RAS). Pregnancies begin along various psychological, physical, and physiological changes in the body. It is critical that salt-balance and blood pressure (BP) are maintained during pregnancy, which is a principle function of the RAS. From week 6 of gestation, all components of the classical RAS are found in placental tissue, with the potential to regulate villous and extravillous cytotrophoblast (EVT) proliferation, extravillous cytotrophoblast migration, invasion, and placental angiogenesis. Placental RAS is a vital component for the suboptimal regulation of blood flow at the maternal-foetal interface; hence, its dysregulation may predispose HDP such as PE. ACE 2 is expressed in human placenta within syncytiotrophoblasts (ST), cytotrophoblasts (CT), endothelium, and vascular smooth muscle of conducting villi. Interestingly, ACE 2 is also expressed in the invasive interstitial and intravascular trophoblast cell populations, as well as within decidual cells. This highlights the potential for COVID-19 to induce, mimic, or accelerate PE as the SARS-CoV-2 infection exploits ACE 2. In normal pregnancies, there is a slight increase in the expression of angiotensin II albeit without vasoconstriction or rise in systemic BP because of the development of a refractoriness to the effect of angiotensin II. In contrast, pregnancies complicated by PE are highly sensitized to angiotensin II. This correlates with the clinical findings of PE, which include evidence of elevated BP. Studies by Merrill et al. and Valds et al. provide evidence of angiotensin 1-7 downregulated in the plasma of PE compared to normotensive Fig. 1 Schematic representation of the renin-angiotensin system and the physiological role of ACE-2 receptors healthy pregnancies. These studies confirm potential of ACE 2 suppression in PE. Pathophysiology of Preeclampsia The etiology of PE has not been fully elucidated; however, it is believed to occur in two stages. The preclinical stage of PE development involves deficient EVT invasion of the uterine spiral arterioles. In this stage, endovascular trophoblast invasion does not progress beyond the decidual segment of the spiral artery; additionally, there is reduced interstitial myometrial invasion. Defective spiral artery remodeling causes placental hypoxia, leading to a shift in the balance of antiangiogenic and proangiogenic factors. Soluble endoglin (sEng) is an antiangiogenic factor that was found to be overexpressed in the serum of preeclamptic women. Endoglin (Eng), a transmembrane glycoprotein that is highly expressed on vascular endothelium, functions as a coreceptor for transforming growth factor beta (TGF-). In contrast, sEng inhibits the normal physiology of TGF- by binding to circulating TGF-, which leads to dysregulation of TGF- signalling in ECs. Transforming growth factor receptor I (TGFR-I), otherwise referred to as activin receptor-like kinase 5 (ALK5), and transforming growth factor receptor II (TGFR-II) function as native receptors of TGF-. It was reported that sEng can potentially inhibit the downstream signalling of TGF-, including effects on activation of endothelial nitric oxide synthase (eNOS) and vasodilation. Angiogenic imbalance leads to the clinical stage in which an increase in antiangiogenic factors causes widespread damage to the maternal endothelium. This stage presents the clinical features of PE, including hypertension, proteinuria, and intrauterine growth restriction (IUGR). Delivery of the placenta usually causes rapid resolution of the clinical signs of the disease, making it the only treatment available, which often includes premature delivery of the fetus. The Expression of microRNAs in Pregnancy Pregnancy is a time of significant changes in the body in order to prepare for and accommodate the developing fetus. MicroRNAs are able to regulate many of these changes through its control over the expression of mRNA. MicroRNAs have been implicated in the earliest stages of pregnancy, including embryo implantation. After implantation, the trophoblast cell lineage is the first to begin differentiating. Cuman et al. noted miR-661 and miR-372 upregulation in blastocysts that failed to implant ; the expression of miR-372 was supported by Rosenbluth et al. as they found a similar expression. In contrast, miR-142-3p is highly expressed in blastocysts successfully implanted according to a pilot study conducted by Borges et al.. This suggests an involvement of miRNA in ectopic pregnancies and miscarriages. Although differential expression profiling of miRNAs is achievable, the results are not easily reproducible, as evident in significant variations between similar investigations. The difficulty in reproducing results may be explained due to differences in laboratory conduct of the study, methodological differences, and differences in miRNA array panels, as well as the use of either stored or fresh samples. MicroRNA expression is a very dynamic process and varies greatly with the requirements needed at different times. The endometrium is essential for successful embryo implantation. Kresowik et al. identified miR-31 to be overexpressed in endometrium in the mid-secretory phase. MicroRNA-31 is a potent miRNA that inversely regulates forkhead box P3 (FOXP3), a transcription factor for T regulatory cells, and CXCL12, a homeostatic chemokine. CXCL12 is a chemoattractant for uterine natural killer (NK) cells, with the potential to be involved in providing a suitable environment that is immune-tolerant in the secretory phase. Tochigi et al. and Estella et al. investigated the miRNA expression profiles between decidualized human endometrial stem cells (hESC) and control hESC; only miR-155 was commonly expressed in both studies. The attachment of the blastocyst to the uterine endothelial wall occurs 4-6 days post-conception; following this, the placenta begins to develop. MicroRNAs are highly expressed in the human placenta which undergoes physiological changes throughout pregnancy. The precise role of miRNAs in the placenta is yet to be identified. However, the placenta releases placental miRNAs into the maternal circulation, hence is found in maternal serum and plasma and placental tissue. The expression of placental miRNAs is associated with HDPs, such as PE. Previous studies have highlighted the presence of hypoxic conditions in PE compared to healthy controls. MicroRNA-210 is upregulated in trophoblast cells cultured in hypoxic environments, and importantly, in PE. Additionally, miRNAs that are involved in angiogenesis and immune cell development are dysregulated in trophoblastic cells cultured in hypoxic conditions. Thus, there exists a possible influence of miRNAs in the progression of normal pregnancies, and in pathological pregnancies. MicroRNAs in Pregnancies Complicated by Preeclampsia There are significant gaps in the investigation of miRNAs in pregnancy-related complications and there is a paucity of data on the miRNA regulation of sEng. Importantly, the miRNA regulation of sFlt-1 is yet to be elucidated as no miRNA has been directly correlated with the regulation of sFlt-1. Nevertheless, KG Shyu reported that miR-208a is responsible for the activation of Eng and collagen I in the stimulation of myocardial fibrosis. This was supported by similar studies. Furthermore, several miRNAs have been suggested to play a role in trophoblast proliferation and invasion, including direct effect on TGF- signalling. An investigation analyzing the HTR-8/SVneoplacental cell line concluded that miR-376c inhibits ALK5. Also, miR-29b directly binds to the 3-UTRs of myeloid cell leukaemia sequence 1, matrix metalloproteinase 2, VEGF-A, and integrin-1. When miR-29b is upregulated in the placenta, it causes trophoblastic apoptosis and inhibition of trophoblast invasion and angiogenesis. MicroRNA-193b is increased in preeclamptic patients. Zhou et al. showed that miR-193b-3p decreases migration and invasion of HTR-8/ SVneoplacental cells. Interestingly, inhibition of miR-126 in mouse embryos led to abnormal vasculogenesis, haemorrhage, and loss of vascular integrity. This indicated that miR-126 is necessary for proper vessel formation. Placental Hypoxia Abnormal trophoblast invasion of the placenta in PE leads to hypoperfusion of the placenta and ultimately accelerates the placenta into a hypoxic state. The hypoxic state that is associated with PE correlates with the decrease of eNOS and nitric oxide (NO) in preeclamptic patients. MicroRNA-222 was reported to induce the production of eNOS yet was found to be downregulated in the placenta of PE patients. Furthermore, miR-155 was identified to negatively regulate the expression of eNOS in trophoblastic cells. It was also found to be increased in PE placenta, suggesting a negative regulatory role of miR-155 in the migratory behaviour of trophoblasts through the regulation of eNOS. Sun et al. showed that miR-155 exerts its inhibitory effects on eNOS by binding to the 3-UTR of eNOS mRNA and suggested that silencing of this miRNA can lead to improvement of endothelial dysfunction. Dai et al. reported that miR-155 may inhibit trophoblast invasion and proliferation by downregulating cyclin D1; furthermore, another investigative group reported that miR-155 can inhibit trophoblast invasion by decreasing eNOS expression. This can lead to an exaggerated hypoxic state of the placenta in PE. Many studies have highlighted the overexpression of miR-210 in preeclamptic placentae and plasma . MicroRNA-210, believed to be a miRNA that is induced by hypoxia, is one of the most studied miRNAs. The hypoxic state of the placenta in PE causes oxidative stress which leads to the upregulation of hypoxia inducing factor 1- (HIF-1-) in placental tissue. Research has revealed that miR-210 is regulated by HIF-1-, thereby creating a positive feedback loop inducing hypoxia. Angiogenesis There is evidence of abnormal angiogenesis in PE. Vascular endothelial growth factor (VEGF) is a potent proangiogenic factor that plays a pivotal role in angiogenesis, particularly in endothelial cell proliferation, invasion, and migration. It promotes the production of NO and prostacyclin in the maternal vascular system. Phosphoinositide-3-kinase regulatory subunit 2 (PIK3R2) and sprout-related drosophilia enabled/vasodilator-stimulated phosphoprotein homology 1 (EVH1) domain are a part of the VEGF signalling pathway and are targets of miR-126. It was reported that miR-126 was downregulated in PE patients and the expression of miR-126 is directly proportional to the expression of VEGF mRNA. VEGF is also targeted by miR-29b, miR-16, and miR-155 as they inhibit the expression of VEGF-A. They also inhibit trophoblast cell invasion and tube formation apart from suppressing VEGF-A; thus, they are involved in placental angiogenesis. Ephrin-B2 (EFNB2) has been identified to influence angiogenesis. MicroRNA-126, miR-20a, miR-17, and miR-20b have been identified as miRNA regulators of EFNB2 and interestingly, they were shown to be differentially expressed in PE. These miRNAs can indirectly regulate the expression of VEGF through the inactivation of EFNB2. The microRNAs greatly involved in PE are summarized in Table 1. Placental miRNAs are also released into the maternal circulation, contributing the maternal stage of PE; interestingly, miRNAs have also been found to be contained within exosomes, nanoparticle carrier proteins, in the maternal circulation. The release of antiangiogenic factors and other inflammatory mediators into the maternal circulation leads to the systemic endothelial cell inflammation and endothelial cell dysfunction that are characteristic of PE. The Role of MicroRNAs in Modulating HIV-1 Infection HIV infection is one of the more prevalent viral infections in SA. Currently, HIV-infected individuals are treated with HAART. Although HAART is the most effective treatment at present, it is associated with various side-effects. All pregnant women who are HIV-positive are required to adopt the HAART treatment in SA, as it reduces mother-to-child transmission. However, studies have shown that HAART could exhibit a negative influence during pregnancy. Furthermore, there is evidence that the administration of HAART to pregnant HIV-positive patients predisposes the development of PE. In an ideal situation, PE patients comorbid with HIV infection would have a neutralization of immune response. However, HAART in pregnancy reconstitutes immune response thereby influencing PE development. In light of this, it is essential to thoroughly investigate key regulators in HIV-1 infection in order to identify alternative avenues in the fight against HIV infection globally. Epigenetic regulatory mechanisms, specifically miRNAs, have been shown to play a significant role in HIV infection, as well as other RNA and DNA viral infections. Moreover, miRNAs may be partially responsible for the latency period of the HIV. Huang et al. reported that several miRNAs were differentially expressed in resting CD4 + T cells and activated CD4 + T cells, including miR-28, miR-125b, miR-150, miR-223, and miR-382. These miRNAs have also been shown to target the 3 ends of HIV-1 mRNAs. Additionally, the group showed that inhibition of these miRNAs can stimulate virus production in resting CD4 + T cells isolated from HIV-positive individuals receiving HAART. It is therefore plausible that these differentially expressed miRNAs can inhibit HIV-1 expression in resting CD4 + T cells, thereby contributing to the viral latency observed in HIV infection. Apart from direct targeting of the HIV-1 mRNAs by miRNAs, cellular miRNAs can indirectly affect HIV infection through modulating factors that are essential for HIV-1 expression. Cyclin T1 protein is responsible for efficient transcription of the viral genome. A study in 2012 reported that the expression of cyclin T1 is reduced in resting CD4 + T cells; however, it is induced upon activation of CD4 + T cells. A similar investigation identified miR-198 to be downregulated during monocyte to macrophage differentiation and reported that miR-198 is able to suppress HIV-1 replication by downregulating cyclin T1. Houzet et al. reported that miR-29a and miR-29b are downregulated in HIV-1-infected patients and infected peripheral blood mononuclear cells (PBMCs). It was reported that the host miRNA, miR-29a targets the nef gene of HIV-1. The nef protein serves as an accessory protein of HIV and influences viral pathogenesis. The group suggested that expression of miR-29a leads to a reduction of nef mRNA and a decrease in viral levels was observed. A study conducted by Nathans et al. observed miR-29a to suppress infectivity of HIV through direct targeting of HIV-1 transcripts to processing bodies (P bodies). Chable-Bessia et al. demonstrated that major components of P bodies are able to negatively regulate HIV-1 gene expression via blocking of viral mRNA association with polysomes. They also showed that deletion of these components reactivates the virus in PBMCs isolated from HIV-1 patients receiving HAART. Thus, the downregulation of miR-29a in HIV-infected humans could serve as a mechanism for the maintenance of a latent state of infection. The miR-29 family is composed of miR-29a, miR-29b, and miR-29c. It is important to underline that miR-29a and miR-29b share highly similar sequences. Above and beyond the negative regulation of nef expression by miR-29a, Ahluwalia et al. suggested that miR-29a and miR-29b are able to suppress virus replication in HEK293T cells and Jurkat T cells. An in vivo study revealed that a cytokine-microRNA pathway could potentially impact HIV-1 replication. Specifically, the group identified the IL-21/miR-29a pathway to be associated with HIV-1 replication and infectivity. Adoro et al. reported that the IL-21/miR-29a pathway suppresses viral replication since IL-21-stimulated CD4 + T cells upregulate the expression of miR-29a, and IL-21 reverses the downregulation of miR-29a induced by HIV-1 infection. This reiterates the plausibility of the IL-21/ miR-29a axis influencing HIV-1 replication and infectivity. As important as host miRNAs are, viruses bring along with it a set of its own miRNAs, referred to as viral miRNAs (v-miRNAs). The existence of v-miRNAs has been controversial to a degree due to the failure of reproducing findings. The first v-miRNA that was isolated from HIV-1 was discovered in 2004 and was termed miR-N367. However, subsequent studies that attempted to reproduce the discovery were unsuccessful in their attempts. The transactivation-responsive (TAR) element of HIV-1 is an RNA hairpin structure found at the 5 end of all HIV-1 transcripts. Dominique L Ouellet at al. reported that TAR is a source of miRNAs in cultured HIV-1-infected cell lines and in HIV-1-infected human CD4 + T lymphocytes. TAR has been shown to be involved in cell survival and displays anti-apoptotic properties. HIV-1 TAR miRNAs have been identified to downregulate ERCC1 (excision repair cross complementation group 1) and IER3 (intermediate early response gene 3) which are components involved in apoptosis and cell survival. Therefore, HIV-1-infected cells may be able to evade death and maintain the virulence of HIV-1. The novel microRNAs have proven to have highly intricate regulatory roles in the human genomes. However, evidence also supports their existence in both RNA and DNA viruses which can potentially be involved in epigenetic regulation, by both direct and indirect mechanisms. It is thus of paramount importance that miRNAs and v-miRNAs are investigated more thoroughly utilizing newer sequencing technology. The significant impact of miRNAs in viruses and hosts highlights the possibility of their role in other viral infections threatening mankind. MicroRNAs in Angiotensin-Converting Enzyme 2 Receptors ACE 2 receptors are predominantly found on the endothelial cells, heart, blood vessels, and the kidneys. According to several studies, miRNAs are indeed regulators of ACE 2. ACE 2 abnormalities have been implicated in disorders such as hypertension, cardiovascular disease, diabetes, and old age. MicroRNA-125b is reported to directly target the mRNA of ACE 2. The same miRNA is found to be downregulated in HIV-infected CD4 + T cells and exhibits anti-viral properties. Thus, it is plausible to hypothesize that HIV-positive individuals could be at an increased risk of being infected with SARS-CoV-2 because the host will be experiencing a decline in the expression of miR-125b due to HIV infection. Since miR-125b is a negative regulator of ACE 2, under HIV-positive conditions, the patients will have an increase in the expression of ACE 2, potentially leading to greater viral entry. Supporting this is the work of Batlle et al. who highlighted the fact that healthier people are at a lower risk of developing severe COVID-19 due to lower membrane-bound ACE 2 expression. MicroRNA-125 is also associated with blocking of apoptosis when downregulated. This possibly allows for the virus to replicate without interruption. Recently, miR-155 was reported to be associated with ACE 2 modulation by regulating the expression of AT1R by silencing AT1R mRNA. This receptor is involved in cardiovascular homeostasis mechanisms including vasoconstriction, release of catecholamines, and blood pressure evaluation. Vasoconstriction and elevated blood pressure are characteristics that are evident in PE. MicroRNA-155 was observed to be upregulated in the placenta of PE where it negatively regulates the expression of eNOS in trophoblasts. There is a lack of research investigating miR-155 expression in COVID-19. Nevertheless, miR-155 has been described to exhibit anti-viral properties. Silencing of miR-155 led to an approximate 50% increase in the replication of rhinovirus. In a case-control study, miR-155 was found to be upregulated in patients infected with respiratory syncytial virus (RSV), a condition associated with bronchial inflammation. The overexpression of miR-155 shows a correlation with acute inflammatory responses. Theoretically, a preeclamptic patient would be at a greater risk of experiencing severe symptoms of COVID-19, due to the effect of miR-155. Although the miRNA is unlikely to cause a pregnant woman to be at risk of being infected, the endothelial dysfunction seen in PE will be compounded by the dysregulation effects of miR-155 following SARS-CoV-2 infection. Although there is a paucity of data regarding the expression of miR-155 in COVID-19, it is possible to assume an initial downregulation in order to evade immune detection, followed by overexpression when the host develops an inflammatory response to the infection. Research investigating PE patients with SARS-CoV-2 infection will greatly aid in illuminating the effects of miR-155 both in COVID-19 and PE, which can lead to possible therapeutic actions from antagomirs (antagonistic microRNAs). A geographical study including the USA, Wuhan, Italy, India, and Nepal found several anti-viral host miRNAs that were specific to SARS-CoV-2, one of which was miR-126. MicroRNA-126 has been identified to target the nucleocapsid of the SARS-CoV-2. Interestingly, miR-126 is downregulated in PE. The inhibition of miR-126 in mouse embryos was assessed and it was found that it led to abnormal vessel formation and loss of vascular integrity. Since miR-126 is decreased in PE, pregnant women with PE could be at risk of infection due to the loss of an anti-viral miRNA that targets SARS-CoV-2. Furthermore, it is plausible to expect the further downregulation of miR-126 following infection; this can lead to further endothelial cell damage in pregnant women and hence contribute to worsening the effects of PE, possibly inducing death. Additionally, miR-126-3p was found to be downregulated in HIV-1-positive patients receiving HAART. Interestingly, miR-126-3p was upregulated in patients with HAART resistance in comparison to patients without resistance . It was indicated that this is suggestive of miR-126 being linked with HIV treatment failure . This evidence has possible detrimental results for HIV-associated PE women as both conditions exhibit a decrease in miR-126. Hence, patients with HIV-associated PE could be at a greater risk of both contraction of SARS-CoV-2 infection and the experiencing of severe COVID-19. Furthermore, Li et al. found several miRNAs to be differentially expressed in the peripheral blood of patients with COVID-19 . There is a great need to investigate the expression of miRNAs in COVID-19, which is yet to be achieved. Conclusion Currently, there exists a wide gap in literature interrelating miRNAs and SARS-CoV-2 infection. Analysis of the differential expression of miRNAs in COVID-19 can help identify those at risk as well as aid in the development of therapeutic approaches. An inflammatory response is a common characteristic shared between SARS-CoV-2 infection, pregnancy, PE, and HIV infection. Maternal health should be of utmost importance when SARS-CoV-2 infection arises in HIVpositive preeclamptic women. Thus, further research investigating the functionality of microRNAs on the synergy of SARS-CoV-2 infection, PE, and HIV infection could provide significant breakthroughs that will enhance the treatment in pregnant women. Understanding how miRNAs are affected and identifying which miRNAs are aberrantly expressed will accelerate the development of a vaccine that will also be safe for pregnant women diagnosed with HIV-associated PE. Author Contribution Not applicable Funding The authors appreciate the funding provided by the College of Health Sciences, UKZN. Availability of Data and Material All articles reviewed in this review paper are available online. Declarations Human and Animal Rights and Informed Consent This article does not contain any studies with human or animal subjects performed by any of the authors. Conflict of Interest The authors declare no conflicts of interest relevant to this manuscript.
|
<gh_stars>1-10
import abc
from munch import Munch
from .api import API
from ..type_binder_container import TypeBinderContainer
class APITarget(metaclass=abc.ABCMeta):
"""
Abstract base class for anything that would like to become an API target
"""
OBJECT_TYPES = []
SYSTEM_EVENTS_TYPE = None
SYSTEM_COMPONENTS_TYPE = None
def __init__(self, address, auth=None, use_ssl=False, ssl_cert=None):
"""
:param address: Either a tuple of (host, port), or a list of such tuples for multiple addresses
"""
if self._is_simulator(address):
address = self._get_simulator_address(address, use_ssl=use_ssl)
self._addresses = self._normalize_addresses(address, use_ssl)
self.objects = TypeBinderContainer(self)
if auth is None:
auth = self._get_api_auth() # pylint: disable=assignment-from-none
self.api = API(self, auth, use_ssl=use_ssl, ssl_cert=ssl_cert)
self.api.set_request_default_timeout(self._get_api_timeout())
self.types = Munch()
self._initialize()
self._caching_enabled = True
def _initialize(self):
for object_type in self.OBJECT_TYPES:
self.objects.install(object_type)
self.types[object_type.get_type_name()] = self.types[object_type.__name__] = object_type
self.components = self.SYSTEM_COMPONENTS_TYPE(self) # pylint: disable=not-callable
self.events = self.SYSTEM_EVENTS_TYPE(self) # pylint: disable=not-callable
def _get_api_auth(self):
return None
def is_field_supported(self, field): # pylint: disable=unused-argument
return True
def disable_caching(self):
"""Disables field caching, and causes each field fetching to fetch the actual up-to-date value from the system
"""
self._caching_enabled = False
def enable_caching(self):
"""Enables field caching, and causes each field fetching to use the cache by default
"""
self._caching_enabled = True
def is_caching_enabled(self):
"""Returns whether caching is currently enabled
"""
return self._caching_enabled
def check_version(self):
"""Called automatically by the API on the first request made to the system. Should fetch and verify the
system version to make sure it can be operated against.
"""
raise NotImplementedError() # pragma: no cover
def get_collections_names(self):
return [obj_type.get_plural_name() for obj_type in self.OBJECT_TYPES]
def get_collections(self):
return [obj_type for obj_type in self.objects]
def _normalize_addresses(self, addresses, use_ssl):
if not isinstance(addresses[0], (list, tuple)):
addresses = [addresses]
default_port = 443 if use_ssl else 80
returned = []
for address in addresses:
if not isinstance(address, tuple):
address = (address, default_port)
if len(address) != 2:
raise ValueError("Invalid address specified: {!r}".format(address))
returned.append(address)
return returned
def get_approval_failure_codes(self):
return tuple()
def get_api_addresses(self):
return self._addresses
def get_api_timeout(self):
return self.api.get_request_default_timeout()
def get_api_auth(self):
return self.api.get_auth()
def _get_received_name_or_ip(self):
return self._addresses[0][0]
def __repr__(self):
return self._get_received_name_or_ip()
def _is_simulator(self, address):
raise NotImplementedError() # pragma: no cover
def _get_simulator_address(self, address, use_ssl):
raise NotImplementedError() # pragma: no cover
def _get_api_timeout(self):
"""
:returns: number of seconds to wait for a command to return before raising a timeout
"""
raise NotImplementedError() # pragma: no cover
@classmethod
def get_type_name(cls):
return cls.__name__
|
<filename>src/network/mec/mec_reactor.h
/*
* Copyright (c) 2021 Huawei Technologies Co.,Ltd.
*
* openGauss is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
*
* http://license.coscl.org.cn/MulanPSL2
*
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
* -------------------------------------------------------------------------
*
* mec_reactor.h
* mec process
*
* IDENTIFICATION
* src/network/mec/mec_reactor.h
*
* -------------------------------------------------------------------------
*/
#ifndef __MEC_REACTOR_H__
#define __MEC_REACTOR_H__
#include "cm_defs.h"
#include "cm_thread.h"
#include "cm_queue.h"
#include "cm_spinlock.h"
#include "cm_epoll.h"
#include "mec_agent.h"
#ifdef __cplusplus
extern "C" {
#endif
#define REACOTR_EVENT_WAIT_NUM 256
#define EV_WAIT_TIMEOUT 16
#define EV_WAIT_NUM 256
typedef enum en_reactor_status {
REACTOR_STATUS_RUNNING,
REACTOR_STATUS_PAUSING,
REACTOR_STATUS_PAUSED,
REACTOR_STATUS_STOPPED,
} reactor_status_t;
typedef struct st_reactor {
uint32 id;
thread_t thread;
int epollfd;
atomic32_t channel_count;
uint32 avg_oagents;
reactor_status_t status;
agent_pool_t *agent_pool;
} reactor_t;
typedef struct st_reactor_pool {
uint32 reactor_count;
uint32 roudroubin;
uint32 roudroubin2;
uint32 avg_channels;
reactor_t *reactors;
} reactor_pool_t;
static inline bool32 reactor_in_dedicated_mode(const reactor_t *reactor)
{
return (uint32)reactor->channel_count < (uint32)reactor->avg_oagents;
}
void proc_attached_failed_agent(const mec_pipe_t *pipe);
void reactor_entry(thread_t *thread);
status_t reactor_set_oneshot(mec_pipe_t *pipe);
status_t reactor_register_pipe(mec_pipe_t *pipe, reactor_pool_t *pool);
void reactor_unregister_pipe(mec_pipe_t *pipe);
status_t reactor_create_pool(reactor_pool_t *pool, agent_pool_t *agent_pool, mec_profile_t *profile);
void reactor_destroy_pool(reactor_pool_t *pool);
void reactor_pause_pool(reactor_pool_t *pool);
#ifdef __cplusplus
}
#endif
#endif
|
Catalytically distinct conformations of the ribonuclease H of HIV-1 reverse transcriptase by substrate cleavage patterns and inhibition by azidothymidylate and N-ethylmaleimide. The RNase H activity of recombinant HIV-1 reverse transcriptase (RT) has been characterized with respect to inhibition by azidothymidylate (AZTMP) and N-ethylmaleimide (NEM) and to cleavage patterns using either poly(rA)/poly(dT) or poly(rG)/poly(dC) as model substrate and either Mg2+ or Mn2+ as divalent cation activator. The inhibitory potency of AZTMP and other nucleotide analogues was found to be dependent on both the composition of the substrate and the divalent cation. The enzyme was significantly more sensitive to AZTMP inhibition with poly(rG)/poly(dC) than with poly(rA)/poly(dT) as substrate and in Mn2+ than in Mg2+ with either substrate. Kinetic studies indicated that AZTMP is a competitive inhibitor with respect to the substrate in Mn2+ whereas it behaves as an uncompetitive inhibitor in Mg2+. These results suggest that the enzyme may exist in two distinct forms depending on whether Mg2+ or Mn2+ is the divalent cation activator. Consistent with this suggestion is the alteration in the mode of cleavage of the substrate upon substitution of Mg2+ with Mn2+. In Mg2+, hydrolysis of poly(rA)/poly(dT) appears to be solely endonucleolytic, whereas in Mn2+, hydrolysis is both endonucleolytic and exonucleolytic. With poly(rG)/poly(dC) as substrate, hydrolysis is both endonucleolytic and exonucleolytic in either Mg2+ or Mn2+. There is a positive correlation between sensitivity to AZTMP and production of mononucleotides, suggesting that the exonuclease activity of RNase H is preferentially inhibited by AZTMP. The sensitivity of RNase H to inhibition by N-ethylmaleimide was also found to be markedly influenced by the substrate composition and the divalent cation activator, being most sensitive under conditions in which endonucleolytic activity predominates.(ABSTRACT TRUNCATED AT 250 WORDS)
|
Characterization of the Tensile Strength of FDM-Printed Parts Made from Polylactic Acid Filament using 33 Full-Factorial Design of Experiment This study is about the characterization of the tensile strength of PLA filaments at varied parameters namely, extrusion temperature, layer height and shell thickness. The PLA filaments are printed using a 3D printer under the principle of fused deposition modeling. The printed model abides by the ASTM D638 standard, which is the standard for tensile testing plastics. The three chosen factors have three levels each and three replications. A full factorial design of experimentation was utilized for the analysis of the data, and ANOVA was used to determine the statistically significant effect among the population means, and if interaction exists among the factors. Briefly, all the null hypotheses were rejected, and all alternative hypotheses were accepted, which states that not all means among the factors are equal and that there exists an interaction among the chosen factors. To get the best result on tensile strength, extrusion temperature should be leveled to 220°C, layer height should be maintained at a value of 0.3 mm, and a higher shell thickness should be observed, like for example, 1.2mm.
|
Purification and characterization of FMRFamidelike immunoreactive substances from the lobster nervous system: Isolation and sequence analysis of two closely related peptides In the preceding paper (Kobierski et al: J. Comp. Neurol. 266:115, '87) FMRFamidelike immunoreactivity (FLI) was localized to specific cells and processes in the nervous system of the lobster Homarus americanus. In an effort to establish a role for this material we have purified and characterized a variety of immunoreactive peptides that can be extracted from the secretory pericardial organs. By using gelfiltration chromatography and three different HPLC systems, it has been established that little or no authentic FMRFamide is present. Of the major immunoreactive components two peptides were purified in sufficient quantity for microsequence analysis and have been tentatively identified as the octapeptides SerAspArgAsnPheLeuArgPheamide (FLI 3) and ThrAsnArgAsnPheLeuArgPheamide (FLI 4). Both of these are novel neuropeptides with some sequence homology to the previously described FMRFamide family.
|
// TODO: move to separate package/library
func mdmAuthSignMessageMiddleware(db *boltdepot.Depot, next http.Handler) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
b64sig := r.Header.Get("Mdm-Signature")
if b64sig == "" {
http.Error(w, "Signature missing", http.StatusBadRequest)
return
}
sig, err := base64.StdEncoding.DecodeString(b64sig)
if err != nil {
http.Error(w, "Signature decoding error", http.StatusBadRequest)
return
}
p7, err := pkcs7.Parse(sig)
if err != nil {
http.Error(w, "Signature parsing error", http.StatusBadRequest)
return
}
bodyBuf, err := ioutil.ReadAll(r.Body)
if err != nil {
fmt.Println(err)
http.Error(w, "Problem reading request", http.StatusInternalServerError)
return
}
p7.Content = bodyBuf
r.Body = ioutil.NopCloser(bytes.NewBuffer(bodyBuf))
err = p7.Verify()
if err != nil {
http.Error(w, "Signature verification error", http.StatusBadRequest)
return
}
cert := p7.GetOnlySigner()
if cert == nil {
http.Error(w, "Invalid signer", http.StatusBadRequest)
return
}
hasCN, err := HasCN(db, cert.Subject.CommonName, 0, cert, false)
if err != nil {
fmt.Println(err)
http.Error(w, "Unable to validate signature", http.StatusInternalServerError)
return
}
if !hasCN {
fmt.Println("Unauthorized client signature from:", cert.Subject.CommonName)
http.Error(w, "Unauthorized", http.StatusBadRequest)
return
}
next.ServeHTTP(w, r)
}
}
|
The City of Meriden has given the Meriden Humane Society 120 days to vacate its spot in the city-owned facility on Murdock Avenue.
That means quickly find new homes for the roughly 100 animals currently there and concerns about the very future of the organization.
“I was very angry and disappointed that is what it had come to,” Kim Sauer a Humane Society Board of Directors member, said.
Mayor Kevin Scarpati praised the Humane Society’s past work in the city, which stretches back more than 100 years.
Meriden Humane Society Shelter Closing
Volunteers at the Meriden Humane Society Shelter are concerned about the animals at their shelter after being told that they have four months to move out of the current building. (Published Friday, Oct. 21, 2016)
The city said lease negotiations had lasted several months.
The mayor said there were disagreements over issues including allowing animals to wander freely in the building and cleanliness.
“It’s unfortunate we’ve reached this point where we’ve asked them to fix or change a number of things in how they operate. With refusal to do from their side, we unfortunately had to part ways,” Scarpati said.
Humane Society members said there’s more to the story and also blame personal disputes between the organization and the city.
During all this, the group’s director, Marlena DiBianco, was arrested in September, accused of forging an animal certificate.
Members said the group’s several lease offers were rejected and they were unsure what to expect heading into Thursday’s meeting, which ended with the four-month exit deadline.
“The reasonings that we were given were unfounded and we weren’t really able to say our side of the piece,” Sauer said.
With the shelter ordered to close, the Humane Society is now turning away animals and its focus is on finding spots for about 85 cats and 20 dogs already there.
“It’s going to be very difficult. It’s going to take quite a miracle,” Jason Dunn, a volunteer, said.
The Humane Society will rush to get as many animals adopted as possible, then will find other homes including at sanctuaries for others.
As for the group’s future, that’s unclear, and it would need major donations for it to continue its mission elsewhere.
The city is negotiating with another animal group to take over the spot.
|
package adele.benchmark;
import adele.image.Image;
import adele.image.factory.ImageFactory;
import adele.image.factory.NoiseTemplate;
import java.util.concurrent.TimeUnit;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.State;
@State(Scope.Thread)
public class FrameBenchmarks {
private Image testImage;
private int[] output;
@Setup
public void prepare() {
output = new int[1280*720];
testImage = ImageFactory.buildFromTemplate(new NoiseTemplate(1280, 720, 20));
}
@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void flattenFrameBench() {
testImage.getFrames().get(0).flattenFrame(output);
}
}
|
import six
import platform
import unittest
from . import CommentJsonTest
if six.PY2:
from json.tests.test_encode_basestring_ascii import TestEncodeBasestringAscii
else:
from test.test_json.test_encode_basestring_ascii import TestEncodeBasestringAscii
version = platform.sys.version_info
class TestCommentJsonEncodeBasestringAscii(TestEncodeBasestringAscii, CommentJsonTest):
@unittest.skip('Skip this test since commentjson does not support the API '
'used in the test case.')
def test_encode_basestring_ascii(self):
pass
|
# -*- coding: utf-8 -*-
from django.contrib.auth.mixins import LoginRequiredMixin
from django.views.generic.base import ContextMixin
from django.views.generic import ListView, CreateView, DetailView, UpdateView, DeleteView
from dictionaries.models import Category
from django.core.urlresolvers import reverse_lazy
from dictionaries.views import EDIT_TEMPLATE, get_template
template = 'dictionaries/category/'
class CategoriesBaseView(LoginRequiredMixin, ContextMixin):
model = Category
context_object_name = 'category'
slug_url_kwarg = 'category'
class CategoriesListView(CategoriesBaseView, ListView):
context_object_name = 'categories'
template_name = get_template(template, 'list')
def get_queryset(self):
return Category.objects.all()
def get_context_data(self, **kwargs):
context = super(CategoriesListView, self).get_context_data(**kwargs)
context['add_category'] = reverse_lazy('dictionaries:categories-add')
return context
class CategoriesCreateView(CategoriesBaseView, CreateView):
template_name = EDIT_TEMPLATE
fields = '__all__'
def get_context_data(self, **kwargs):
context = super(CategoriesCreateView, self).get_context_data(**kwargs)
context['back_url'] = self.request.META.get(
'HTTP_REFERER', reverse_lazy('dictionaries:categories-list'))
return context
class CategoriesDetailView(CategoriesBaseView, DetailView):
template_name = get_template(template, 'detail')
class CategoriesUpdateView(CategoriesBaseView, UpdateView):
template_name = EDIT_TEMPLATE
fields = '__all__'
def get_context_data(self, **kwargs):
context = super(CategoriesUpdateView, self).get_context_data(**kwargs)
context['back_url'] = \
self.request.META.get('HTTP_REFERER',
reverse_lazy('dictionaries:categories-detail',
kwargs={'category': self.object.slug}))
return context
class CategoriesDeleteView(CategoriesBaseView, DeleteView):
pass
def get_success_url(self):
return reverse_lazy('dictionaries:categories-list')
|
Want to turn your smartphone into a cosmic ray detector? Well there's an app for that. Cosmic Rays Found in Smartphones, or CRAYFIS, uses smartphones' and tablets' standard camera equipment to detect some of the super-rare particles that shower down on the Earth when a high-energy cosmic ray hits the atmosphere. CRAYFIS collects that data, then sends them onto physicists at the University of California's Irvine and Davis campuses for analysis.
You don't have to do anything yourself except download CRAYFIS. The app is supposed to work a bit like SETI@home or Folding@home, two programs that allowed ordinary people to donate idle computer memory to massive science projects. In this case, CRAYFIS is designed to switch on when it senses the phone is plugged in and has been idle for a few minutes.
One fun bonus: If you sign up for CRAYFIS with your full name and scientists use data from your phone in a scientific paper, the science team will list you as one of the paper's authors, the CRAYFIS website promises. Users may also choose to send their data anonymously.
|
<reponame>phatblat/macOSPrivateFrameworks
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by <NAME>.
//
#import "NSOperation.h"
@class CPDistributedMessagingCenter, NSData, NSDictionary, NSError, NSString, NSThread;
@interface CPDistributedMessagingAsyncOperation : NSOperation
{
CPDistributedMessagingCenter *_center;
NSString *_name;
NSData *_userInfoData;
NSString *_oolKey;
NSData *_oolData;
id _target;
SEL _selector;
void *_context;
BOOL _makeServer;
NSThread *_calloutThread;
NSDictionary *_reply;
NSError *_error;
}
- (void)_performCallout;
- (void)main;
- (void)_releaseSendingData;
- (void)dealloc;
- (id)initWithCenter:(id)arg1 messageName:(id)arg2 userInfoData:(id)arg3 oolKey:(id)arg4 oolData:(id)arg5 target:(id)arg6 selector:(SEL)arg7 context:(void *)arg8 makeServer:(BOOL)arg9;
@end
|
This invention relates generally to rearview mirrors for vehicles and, more particularly, to a device for ensuring an appropriate orientation of the rearview mirror relative to the driver of the vehicle.
Vehicles are designed to accommodate many different drivers of various sizes. However, each time a new driver drives a vehicle, the new driver typically first has to adjust the reflective element of the rearview mirror assemblies on the vehicle (the mirror assemblies typically comprise an interior rearview mirror assembly and a least one, and typically two, exterior side view mirror assemblies) to properly adjust the driver""s rearward field of view, since the height of the driver and seat position may change between drivers, which often results in the mirrors being misaligned for the next driver.
Therefore, the mirrors of vehicles are often being adjusted by the drivers, especially if one car is used by two or more family members. When adjusting the interior rearview mirror assembly, the interior rearview mirror reflective element may be aligned with the rear window aperture to provide proper rearward viewing through the rear window. However, this may be difficult for some vehicles or in certain lighting conditions, such as convertibles, and/or during nighttime conditions, where the rear window aperture is less visible to the driver.
Additionally, the reflective elements of exterior rearview mirrors mounted on the outside of the vehicle may be difficult to adjust for optimal and safe rearward viewing by the driver of the vehicle, and especially for flat mirror reflective elements. If the mirror is adjusted too far outwardly such that a portion of the side of the vehicle is not viewable by the driver, then the driver may not be aware of the degree at which the mirror is adjusted relative to the vehicle. Typically, drivers adjust the exterior mirror reflective element to include a reference point along the side of the vehicle within their field of view, which results in a field of view that is too far inwardly toward the vehicle. Also, if the mirror reflective element is adjusted too far inwardly such that a larger portion of the side of the vehicle is viewable, this may result in a significant blind spot for the driver. This is especially applicable to the driver""s side exterior rearview mirror, which, in the United States, is a flat/planar mirror, which typically provides only about a 15 degree or less field of view to the driver, potentially leaving a blind spot in the driver""s rearward field of view, particularly when the mirror reflective element is adjusted too far inwardly towards the side body of the vehicle.
Accordingly, there is a need for a mirror alignment device which is operable to provide assistance to a driver of a vehicle in achieving an appropriate orientation of either or both of the interior or exterior rearview mirror or mirrors relative to the driver, such that the driver has an optimal and safe rearward field of view. The alignment device would adapt to drivers of various sizes and may be adapted for both interior and exterior rearview mirror assemblies.
The present invention is intended to provide a rearview mirror alignment device which is operable to provide a driver of a vehicle with a visible indication or signal which communicates to the driver when the rearview mirror assembly is properly aligned for optimal and safe rearward viewing. The alignment device is adaptable for interior rearview mirror assemblies and exterior rearview mirror assemblies.
According to a first aspect of the present invention, a rearview mirror assembly for a vehicle comprises an adjustably positioned reflective element, a support and an optically-sighted mirror alignment device. The alignment device is operable to provide a visual indication or signal to a driver of the vehicle when the reflective element is adjusted to provide the driver with an appropriate rearward field of view.
In one form, the alignment device comprises an illumination source positioned within a housing (typically cylindrical) closed with a cover, and with the light source disposed in or behind the housing so as to illuminate through the housing and/or cover. The housing may be positioned adjacent a perimeter of the reflective element or positioned behind the reflective element such that it is viewable by the driver through the reflective element (such as via a window opened in the mirror reflector coating). The housing preferably is colored, such as red or yellow, while the cover is also colored, but preferably with a different color, such as green. The cover color is visible to the driver when the mirror assembly is properly oriented relative to the driver to provide the appropriate rearward field of view. Preferably, the optimal viewing angle for that particular driver and that particular mirror element is provided when the cover color is visible to the driver, thus providing an optically-sighted mirror reflector alignment function.
In one preferred form, the rearview mirror assembly comprises an exterior rearview mirror assembly. In another preferred form, the rearview mirror assembly comprises an interior rearview mirror assembly.
These and other objects, advantages, purposes and features of this invention will become apparent upon review of the following specification in conjunction with the drawings.
|
<gh_stars>1-10
package bnet
import (
"errors"
"github.com/Heanthor/auctioneer-bot/internal/model"
)
// MockHTTP implements HTTP and allows for supplying responses based on URL called
type MockHTTP struct {
responseMap map[string][]byte
urlShouldError []string
}
// NewMockHTTP creates a mocked http accessor that returns data provided for a given url.
// keys are urls, values are json-encoded data
// urlShouldError can be nil, if not any url provided will throw an error in Get
func NewMockHTTP(responseData map[string][]byte, urlShouldError []string) *MockHTTP {
return &MockHTTP{
responseMap: responseData,
urlShouldError: urlShouldError,
}
}
func (m *MockHTTP) refreshOAuth(abLog *model.AucBotContext) {
// no-op :)
}
// Get gets a mocked value by endpoint
func (m *MockHTTP) Get(abLog *model.AucBotContext, endpoint string) (*[]byte, error) {
if m.urlShouldFail(endpoint) {
return nil, errors.New("error")
}
ret, ok := m.responseMap[endpoint]
if ok {
return &ret, nil
} else {
return nil, errors.New("missing mock data")
}
}
func (m *MockHTTP) urlShouldFail(url string) bool {
if m.urlShouldError == nil || len(m.urlShouldError) == 0 {
return false
}
for _, u := range m.urlShouldError {
if url == u {
return true
}
}
return false
}
|
Adoption of agricultural conservation practices in the United States: Evidence from 35 years of quantitative literature This is a comprehensive review of all published, quantitative studies focused on adoption of agricultural conservation practices in the United States between 1982 and 2017. This review finds that, taken as a whole, few independent variables have a consistent statistically significant relationship with adoption. Analyses showed that variables positively associated with adoption include the farmer self-identifying primarily as stewardship motivated or otherwise nonfinancially motivated, environmental attitudes, a positive attitude toward the particular program or practice, previous adoption of other conservation practices, seeking and using information, awareness of programs or practices, vulnerable land, greater farm size, higher levels of income and formal education, engaging in marketing arrangements, and positive yield impact expected. Some variables often thought to be important, such as land tenure, did not emerge as consistently important in this cross-study review. Other variables, such as farmers' sense of place, training, presence of institutional conditions supporting adoption, and the role of collective decision making are not measured in enough studies to draw conclusions but potentially have a relationship with adoption decisions. Implications for how to promote conservation adoption and directions for future research are discussed. Because positive attitudes and awareness of conservation programs or practices are positive predictors of adoption, practitioners should share benefits of specific practices and programs and leverage existing practice adoption. Further work to explore relationships between conservation adoption and the role of farmer identity, nuances of land tenure, and the influence of structural factors is needed. Moreover, we suggest that future research should focus on the impact of different messages and avenues of reaching farmers in order to continue to inform conservation practices. Future research should consider both individual and institutional factors that facilitate and constrain adoption.
|
#include <memory.h>
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <unistd.h>
#include <signal.h>
#include <sys/resource.h>
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
//typedef struct
//{
// char key[128];
// char cluster[64];
// int role;
//} ck_key;
#define MMAP_SIZE 512
inline void* fetch_mmap(char* file_path)
{
// get the file-describer
int fd = open(file_path, O_RDWR | O_CREAT);
ftruncate(fd, MMAP_SIZE);
// use the fd for mapping
void* mem =
mmap(NULL, MMAP_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
if (mem == MAP_FAILED)
printf("Error Mapping !");
printf("Mapped Memory Adrress : %ld \n", (unsigned long) mem);
close(fd);
return mem;
}
#define LockType pthread_mutex_t
#define LOCK_INIT(t,attrib) pthread_mutex_init(t,attrib)
#define LOCK(t) pthread_mutex_lock(t)
#define UNLOCK(t) pthread_mutex_unlock(t)
//#define LockType pthread_spinlock_t
//#define LOCK_INIT(t,attrib) pthread_spin_init(t,PTHREAD_PROCESS_PRIVATE)
//#define LOCK(t) pthread_spin_lock(t)
//#define UNLOCK(t) pthread_spin_unlock(t)
//#define LockType pthread_mutex_t
//#define LOCK_INIT(t,attrib) pthread_mutex_init(t,attrib)
//#define LOCK(t) {}
//#define UNLOCK(t) {}
LockType lock;
uint64_t num = 0;
uint64_t MAX = 65535L*65535L*65535L;
void* thread_fun(void* c)
{
int use_less = 1;
while(1) {
LOCK(&lock);
// num++;
// if (counter.empty()) {
// UNLOCK(&lock);
// break;
// }
//
// int tmp = counter.front();
// counter.pop_front();
use_less++;
UNLOCK(&lock);
if (use_less == 100000000)
break;
}
return NULL;
}
struct fd_vector {
uint32_t num;
};
#define THREADS 2
int main()
{
// *******************************************
int i = 0;
signal(SIGUSR1, SIG_IGN);
time_t t = time(NULL);
LOCK_INIT(&lock,NULL);
pthread_t tid[THREADS];
for (;i!=THREADS;i++)
pthread_create(&tid[i],NULL,thread_fun,NULL);
i = 0;
for (;i!=THREADS;i++)
pthread_join(tid[i],NULL);
// *******************************************
// while(1) {
// printf("%lu\n",num/100000UL);
// sleep(1);
// }
printf("Use[%lus] Every This OK ...",time(NULL)-t);
printf("\n%s\n", "Done !");
return 0;
}
|
<filename>window.py
import numpy as np
import pyglet
from collision_detection import *
from sensors import *
from pyglet.window import key
from robot import *
from robot_status import *
from agents import *
from game_logic import *
from pyglet import clock
class Window(pyglet.window.Window):
def __init__(self, width=800, height=800, visible=True):
"""
This is the class constructor
"""
super(Window, self).__init__(width, height, visible=visible) #It takes the size of the window
self.keys = dict(up=None, left=None, right=None, down=None)
self.possible_actions = list(self.keys.keys())
self.width = width
self.height = height
self.robot_position = [400, 300]
self.center_angle = 0
self.env_objects = []
self.robots = []
if self.visible:
pyglet.clock.schedule_interval(self.update, 1/120.0)
# else:
# # pyglet.clock.schedule_interval(self.update, 0)
# pyglet.clock.schedule(self.update)
# # clock.schedule(self.update)
# pyglet.clock.schedule_interval(self.update, 1/120.0)
self.robot_status = RobotStatus()
# self.robot_agent = AgentRandom(nb_actions=len(self.possible_actions))
self.robot_agent = None
# self.game_logic_instance = Collect_Ball_Simple()
self.game_logic_instance = Collect_Ball_Full()
self.time_counter = 0
def on_draw(self):
"""
Inherited method. We need to override it in order to create
a drawing
"""
if self.visible:
self.clear() # This will clear the window
# Make the background white
pyglet.graphics.draw_indexed(4, pyglet.gl.GL_TRIANGLES,
[0, 1, 2, 1, 2, 3],
('v2i', (0, 0,
self.width, 0,
0, self.height,
self.width, self.height)),
('c3B', (255, 255, 255) * 4))
# Build env_objects
for env_object_id, env_object in enumerate(self.env_objects):
self.env_objects[env_object_id].draw()
for robot_id, robot in enumerate(self.robots):
self.robots[robot_id].draw()
def on_key_press(self, symbol, modifiers):
if symbol == key.UP:
self.keys['up'] = True
elif symbol == key.LEFT:
self.keys['left'] = True
elif symbol == key.RIGHT:
self.keys['right'] = True
elif symbol == key.DOWN:
self.keys['down'] = True
def on_key_release(self, symbol, modifiers):
if symbol == key.UP:
self.keys['up'] = False
elif symbol == key.LEFT:
self.keys['left'] = False
elif symbol == key.RIGHT:
self.keys['right'] = False
elif symbol == key.DOWN:
self.keys['down'] = False
def rest_keys(self):
for item in self.keys:
self.keys[item] = False
def update(self, dt):
# Read agent status
if self.robot_agent != None: # If an agent is set, then override the keyboard
if self.time_counter > 0:
robot_action = self.robot_agent.get_next_move(self.robot_status.get_robot_status())
self.rest_keys()
self.keys[self.possible_actions[robot_action]] = True
else:
self.rest_keys()
step_size = 1
if self.keys["up"]:
for i in range(len(self.robots)):
self.robots[i].circle_position_temp[1] = self.robots[i].circle_position[1] + step_size * np.sin(np.deg2rad(self.robots[i].center_angle))
self.robots[i].circle_position_temp[0] = self.robots[i].circle_position[0] + step_size * np.cos(np.deg2rad(self.robots[i].center_angle))
elif self.keys["down"]:
for i in range(len(self.robots)):
self.robots[i].circle_position_temp[1] = self.robots[i].circle_position[1] - step_size * np.sin(np.deg2rad(self.robots[i].center_angle))
self.robots[i].circle_position_temp[0] = self.robots[i].circle_position[0] - step_size * np.cos(np.deg2rad(self.robots[i].center_angle))
elif self.keys["left"]:
for i in range(len(self.robots)):
self.robots[i].center_angle += 5
elif self.keys["right"]:
for i in range(len(self.robots)):
self.robots[i].center_angle -= 5
for i in range(len(self.robots)):
if self.robots[i].center_angle >= 360:
self.robots[i].center_angle -= 360
elif self.robots[i].center_angle < 0:
self.robots[i].center_angle += 360
for i in range(len(self.robots)):
collision_detection_dic = collision_detection(self.robots[i], self.env_objects)
if True not in list(collision_detection_dic.values()): # Check if there is any collision
self.robots[i].circle_position[1] = self.robots[i].circle_position_temp[1]
self.robots[i].circle_position[0] = self.robots[i].circle_position_temp[0]
# Update robot position
for i in range(len(self.robots)):
self.robots[i].update_robot_pos()
# Perform sensor_readings
sensors_recording = None
for i in range(len(self.robots)):
sensors_recording = sensor_range_detection(self.robots[i], self.env_objects)
for j in range(len(sensors_recording)): # Remove the extra sensory reading --> What is that??? --> This is just to correct the extra reading
# resulting from the fact that the sensors are coming from the center of the robot
if sensors_recording[j] != -1:
sensors_recording[j] -= self.robots[i].circle_radius
if isinstance(self.robot_status, RobotStatus): # TODO: This is suitable for one robot right now
self.robot_status.robot_position.append([self.robots[i].circle_position[0]/self.width, self.robots[i].circle_position[1]/self.height])
self.robot_status.robot_rotation.append(self.robots[i].center_angle / 360)
self.robot_status.robot_sensors_readings.append(sensors_recording)
self.robot_status.collisions.append(collision_detection_dic)
"""
Update the game logic
"""
game_over, game_score, env_changes = self.game_logic_instance.update_fsm(self.robot_status)
self.robot_status.ball_collect.append(self.game_logic_instance.game_fsm['ball_collected'])
self.robot_status.game_over = game_over
self.robot_status.game_score = game_score
try:
for item_to_remove in env_changes['remove']:
for env_object_id in range(len(self.env_objects)):
if self.env_objects[env_object_id].properties['name'] == item_to_remove:
self.env_objects[env_object_id].properties['visible_enabled'] = False
self.env_objects[env_object_id].properties['collision_enabled'] = False
self.env_objects[env_object_id].properties['detectable_enabled'] = False
except:
pass
# print (self.robot_status.get_robot_status())
# print (len(self.robot_status.get_robot_status()))
self.time_counter += 1
print (self.time_counter)
if game_over:
pyglet.app.exit()
# dt = clock.tick()
return game_over, game_score / self.time_counter
def add_env_objects(self, env_object_object):
self.env_objects.append(env_object_object)
def add_robot(self, robot_object):
self.robots.append(robot_object)
def set_agent(self, agent_object):
self.robot_agent = agent_object
def make_invisible(self):
# self.visible = False
self.set_visible(visible=False)
for i, _ in enumerate(self.robots):
self.robots[i].make_invisible()
for i, _ in enumerate(self.env_objects):
self.env_objects[i].make_invisible()
def clean_env_objevts(self):
self.env_objects = []
def clean_robot(self):
self.robots = []
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.