content
stringlengths 7
2.61M
|
---|
// This class must be overloaded to define real, living nodes.
// Especially, the compare function must be implemented.
class StgAvlNode
{
friend class StgAvlIterator;
private:
short Locate( StgAvlNode*, StgAvlNode**, StgAvlNode**, StgAvlNode** );
short Adjust( StgAvlNode**, StgAvlNode* );
StgAvlNode* RotLL();
StgAvlNode* RotLR();
StgAvlNode* RotRR();
StgAvlNode* RotRL();
void StgEnum( short& );
static StgAvlNode* Rem( StgAvlNode**, StgAvlNode*, sal_Bool );
protected:
short nId;
short nBalance;
StgAvlNode* pLeft, *pRight;
StgAvlNode();
public:
virtual ~StgAvlNode();
StgAvlNode* Find( StgAvlNode* );
static sal_Bool Insert( StgAvlNode**, StgAvlNode* );
static sal_Bool Remove( StgAvlNode**, StgAvlNode*, sal_Bool bDel = sal_True );
static sal_Bool Move( StgAvlNode**, StgAvlNode**, StgAvlNode* );
virtual short Compare( const StgAvlNode* ) const = 0;
}
|
The Alsco 300 will be run Saturday at noon after being postponed Friday night because of weather.
The race is scheduled for a noon start and the green flag will drop at 12:10 p.m. Gates to the track will open at 10 a.m. and all Alsco 300 tickets will be honored at the track Saturday.
In the case of a seating conflict, Quaker State 400 tickets will take precedence.
|
Confirmation of anomalous hydrogen generation by plasma electrolysis Abstract: Direct decomposition of water is very difficult in normal conditions. Hydrogen gas is usually obtained by the electrolysis. Pyrolysis decomposition of water occurs at high temperatures, starting at ~3000oC. As we have already reported, anomalous hydrogen is sometimes generated during plasma electrolysis. Excess hydrogen usually appears once certain difficult conditions during high temperature glow discharge electrolysis are met. Here, we show that anomalous amounts of hydrogen and oxygen gas are generated during plasma electrolysis excess gas generation, presumably from pyrolysis. This is indirect proof that exceptionally high temperatures have been achieved. (Direct measurement of the reaction temperature has proved difficult.) Continuous generation of hydrogen above levels predicted by Faradays law is observed when temperature, current density, input voltage and electrode surface meet certain conditions. Although only a few observations of excess hydrogen gas production have been made, production is sometimes 80 times higher than normal Faradic electrolysis gas production.
|
FGF2-induced effects on transcriptome associated with regeneration competence in adult human fibroblasts Background Adult human fibroblasts grown in low oxygen and with FGF2 supplementation have the capacity to tip the healing outcome of skeletal muscle injury by favoring regeneration response in vivo over scar formation. Here, we compare the transcriptomes of control adult human dermal fibroblasts and induced regeneration-competent (iRC) fibroblasts to identify transcriptional changes that may be related to their regeneration competence. Results We identified a unique gene-expression profile that characterizes FGF2-induced iRC fibroblast phenotype. Significantly differentially expressed genes due to FGF2 treatment were identified and analyzed to determine overrepresented Gene Ontology terms. Genes belonging to extracellular matrix components, adhesion molecules, matrix remodelling, cytoskeleton, and cytokines were determined to be affected by FGF2 treatment. Conclusions Transcriptome analysis comparing control adult human fibroblasts with FGF2-treated fibroblasts identified functional groups of genes that reflect transcriptional changes potentially contributing to their regeneration competence. This comparative transcriptome analysis should contribute new insights into genes that characterize cells with greater regenerative potential. Background During development, distinct cell phenotype differentiation is guided by finely tuned and orchestrated changes in transcriptional activity of specific groups of genes that become gradually activated (lineage-specific), gradually repressed (stem cell and progenitor cell genes), or whose activity does not change substantially (housekeeping genes). Ultimately, analyzing the transcriptome of a cell type offers an opportunity to broadly identify transcripts that define it. In addition to these either developmentally regulated or artificially induced phenotype changes that are accompanied by distinct transcriptional changes, a transcriptome of any given cell type can vary substantially depending on cell cycle, passage number, and environmental factors such as oxygen concentration, temperature, and presence of serum. Another important factor that causes transcriptional changes and is crucial for maintaining a cell phenotype is growth substrate. For example, maintenance of undifferentiated state of embryonic stem cells is dependent on favorable substrate, composed of laminin, vitronectin, fibronectin, and collagen IV. In addition to chemical composition, physical properties of substrate also determine cell fate. Roughness and stiffness of the surfaces have also been shown to affect developmental plasticity of cells. Smooth and rigid glass surface supports undifferentiated phenotype, while rough and soft substrates promote differentiation. Lastly, presence of various growth factors in culture media can have a significant effect on a cell transcriptional activity and consequently its phenotype. FGF2 is a mesenchyme-derived growth factor that displays mitogenic, migratory, and morphogenic functions and is also known to play role in angiogenesis, organ development, organ regeneration, and wound healing. Contrary to its predominantly mitogenic effects on differentiated cell types, FGF2 is absolutely required for maintenance of expression of stemness-related genes. With respect to wound healing, FGF2 has been studied as a potential therapeutic anti-scarring agent. We have previously investigated the effects of the aforementioned important cell culture conditions, FGF2 and culture surface, on adult human fibroblasts. We have observed that adult human fibroblasts demonstrated FGF2-and surface-mediated induction of some endogenous stem cell genes and a capacity to acquire a more developmentally plastic phenotype. This low level of activation of stem cell genes was not sufficient for induction of a phenotypic conversion into a pluripotent cell phenotype. However, when transplanted into skeletal muscle injury, adult human fibroblasts grown in low oxygen and with supplementation of FGF2 had the capacity to tip the healing outcome of skeletal muscle injuryby favoring regeneration response in vivo over scar formation. The wound repair process consists of several phases, including immediate response to injury, inflammatory response, cell proliferation and migration, ECM contraction, and ECM remodeling. The roles of dermal fibroblasts in wound healing have been described and in mammals fibroblasts facilitate collagen deposition and formation of a scar. The cascade of molecular events leading to scar formation involves increased proliferation and migration of fibroblasts in response to growth factors, production and organization of specific ECM components, and acquisition of an actin-dependent contractile phenotype. The wound repair process is complete by formation of a scar (disorganized extracellular matrix, mainly collagen). In this study, we compared transcriptomes of control fibroblasts and regeneration-competent fibroblasts to determine whether transcriptional profile that characterizes regeneration-competent cells reflects disregulation of genes involved in the default wound healing pathway leading to scar formationturning the cells into a more pro-regenerative phenotype. Results The effect of cell growth surface and FGF2 on fibroblast transcriptome To obtain a sense of the effects of surface and FGF2 treatment on global transcription, two independent samples (in three technical replicates each) of human dermal fibroblasts grown on glass, glass with FGF2, plastic, and plastic with FGF2 were hybridized to the Human Whole Genome OneArray® microarray, which contains 29,187 human oligonucleotide probes. Backgroundcorrected intensity data was normalized and filtered, which identified 11,124 probes of detectable level of intensity (Additional file 1). The gene expression dataset is of excellent quality as indicated by Pearson's correlation coefficients for biological replicates: 0.987 for glass, 0.973 for glass with FGF2, 0.960 for plastic, and 0.971 for plastic with FGF2 (Additional file 2). To investigate cell culture effects, we examined significantly differentially expressed gene probes using moderated t-statistic and based on the false discovery rate (FDR) cutoff value of 0.05. Comparison of transcriptomes between cells grown on glass and plastic in the absence of FGF2 did not identify any differentially expressed genes. However, FGF2-induced changes in gene expression depended on surface. FGF2 had a more prominent effect on cells when grown on plastic than on glass, as determined by the overall increased number of differentially expressed gene probes (3,349 on plastic versus 2,185 on glass) ( Figure 1A). In response to FGF2 treatment, 2,012 differentially expressed gene probes (1,767 genes) were identified that were disregulated on both surfaces: 1,209 common gene probes were upregulated (1,071 genes) ( Figure 1B) and 803 common gene probes downregulated (696 genes) ( Figure 1C). In addition to these common genes, FGF2 treatment disregulated 173 unique gene probes (168 genes: 139 upregulated and 29 downregulated) on glass and 1,337 unique gene probes (1,282 genes: 753 upregulated and 529 downregulated) on plastic ( Figure 1). The complete list of differentially expressed gene probes on glass and on plastic can be found in Additional file 3 and Additional file 4, respectively. The top 50 significantly differentially expressed genes are represented in the heat maps (Figure 2A and B, respectively). All further analyses were performed on genes whose expression was disregulated in cells grown in the presence of FGF2 on plastic. Gene ontology analysis Differentially expressed genes were analyzed for functional enrichment. To determine the functions of the genes affected by FGF2 treatment and consequently identify the cellular processes that are affected by these transcriptional changes, we performed Gene Ontology (GO) analysis. First, all significantly differentially expressed genes were analyzed to determine broad GO term overrepresentation using GO slim analysis. GO slim analysis identified broad terms describing biological processes ( Figure 3A), molecular functions ( Figure 3B), as well as cellular components to which they belong ( Figure 3C). Additional file 5 includes the number of gene probes representing each GO slim term. A total of 664 overrepresented GO terms (p < 0.05) associated with biological processes were identified. These included genes involved in regulation of cell cycle, cardiovascular system development, extracellular matrix organization, cell proliferation, cell adhesion, regulation of angiogenesis, cell migration, and wound healing. Seventy seven overrepresented GO terms (p < 0.05) were associated with molecular function. The genes belonged to extracellular matrix structural constituents, genes regulating collagen, heparin, integrin binding, and genes regulating cytokine activity. Sixty five overrepresented GO terms (p < 0.05) were associated with cellular components and belonged primarily to extracellular components (Additional file 6). Expression of genes associated with wound healing As FGF2-treated human dermal fibroblasts were previously shown to participate in wound healing of volumetric skeletal muscle by contributing directly to the pool of satellite PAX7 positive cells and by stimulating regeneration of endogenous skeletal muscle tissue, we focused further analysis of differentially expressed genes to those that play a role in wound healing and could be uniquely identifying regeneration-competent fibroblasts. Overall, select genes belonging to extracellular matrix and its remodeling, inflammation, cytoskeleton and migration, and growth factor signaling were found to be affected by FGF2. Cytoskeleton Another group of genes found to be regulated by FGF2 treatment were components of the cytoskeleton that are also involved in wound healing ( Table 2). The most significant effect was observed on ACTC1 and ACTG2. Expression levels of ACTC1 and ACTG2 identified by the microarray ( Figure 5A) were examined by qRT-PCR ( Figure 5B). Cytokines, their receptors, and downstream signaling molecules Cytokines that were identified to be differentially expressed are listed in Table 3. FGF2-induced transcriptional increase was observed in genes associated with inflammation (CXCL1, CXCL5, PTGS2), and growth factor signaling (EGFR, HGF, MAPK1). Expression of pro-inflammatory cytokines interleukin-1B (IL1B) and IL6 decreased upon FGF2 treatment. Signal transducer and activator of transcription 3 (STAT3), which is a known downstream target of IL6 signaling, was downregulated as well as was another downstream IL6/STAT3 gene, CC chemokine ligand CCL2. Expression levels of all these targets identified by the microarray ( Figure 5A) were confirmed by qRT-PCR ( Figure 5B). FGF2 effect on expression of TGFB pathway genes included increase in TGFBR3 expression, decrease in TGFBR1, and decrease in TGFBI (Table 3). TGFB1 and TGFB3 were not significantly differentially expressed due to FGF2 treatment. qRT-PCR results for TGFB1 and TGFBR1 are presented in Figure 5B. Discussion The comparative transcriptome analysis described here demonstrates a unique molecular signature for induced regeneration-competent (iRC) fibroblasts compared with control fibroblasts. Consistent with the notion that these two cell types are distinctly different, we have used both cell types in in vivo regeneration experiments and demonstrated that the induced regeneration-competent fibroblasts participate in regenerative response of skeletal muscle (concomitant with decreased scar formation), contribute to the pool of newly established satellite cells (PAX7 + cells) in a mouse injury model, as well as form mature myotubes. Identification of significantly differentially expressed genes and subsequent Gene Ontology analysis determined that a large number of genes important for the outcome of wound healing such as extracellular matrix genes, adhesion molecules, matrix remodeling genes, and genes involved in inflammation were regulated by FGF2 ( Figure 3). During dermal wound healing, fibroblasts are responsible for ECM production and, here, we show that FGF2 treatment affects a number of genes involved in production and remodeling of ECM. FGF2 caused downregulation of a number of collagens such as collagen IV, collagen XI, collagen V, and collagen I, as well as caused upregulation of collagen XXI and collagen XIV (Table 1). qRT-PCR analysis confirmed downregulation of COL1A1, COL4A1, COL4A2, COL4A4, COL8A1, and COL11A1 ( Figure 4B). FGF2 was previously shown to downregulate expression of interstitial collagen I and III. Collagen I is a major component of ECM in skin, and during wound healing is the main scar forming collagen. Collagen IV is a major constituent of basement membrane (other components include laminin, nidogen, and heparan sulfate proteoglycan perlecan) and is a predominant type of collagen found in skeletal muscle. Other ECM genes affected by FGF2 treatment included laminins and fibronectins (Table 1). Most profoundly affected by FGF2 treatment were laminin gamma 1 (LAMC1) and laminin alpha 5 (LAMA5). qRT-PCR confirmed increased expression levels of these two laminins ( Figure 4B). Fibronectin 1 was downregulated by FGF2 treatment ( Figure 4B). FGF2 treatment of human fibroblasts modulates production of the ECM. The ECM composition of the FGF2-treated fibroblasts favors the pro-regenerative outcome in the wound site directly by affecting the balance between scar formation and tissue regeneration and potentially thorough changes in cell attachment to ECM, cell migration, and cell proliferation. Cell attachment to the ECM is regulated through integrins, heterodimers that recognize specific substrates. Adhesion and migration on collagen substrate is performed through 11 and 21 and formation of collagen type I and type III network is dependent on fibronectin and 21. We show FGF2-induced upregulation of 1 and 2 ( Figure 4B). Integrins 51, V3, and 41 pairs are utilized to bind fibronectin matrix, V5 is used to adhere to vitronectin, and 61, 21, 31 to adhere to laminin and entactin. FGF2 treatment downregulated ITGB2 and upregulated ITGB3 and ITGA10 ( Figure 4B). Integrins connect ECM to actin cytoskeleton via focal adhesions rich in talin, which is recruited to F-actin, and binds integrin pairs, which in turn leads to transmission of F-actin movements to ECM. Change in the composition of integrins, as well as in the components of focal adhesions leads to change in migration, as well as preferential binding to specific substrate, production of which is regulated by FGF2 treatment, and may benefit a pro-regenerative response. During wound healing, fibroblasts acquire a highly migratory phenotype. The process is driven by actin polymerization and resulting microfilaments of the cell's leading edge link to ECM via integrins. Actomyosin contraction then allows for the disassembly of adhesions in the rear and movement forward. Thus, movement of the fibroblasts in the wound site is regulated not only by the ECM and adhesion molecules, but also by the actin cytoskeleton. Actin cytoskeleton is also involved in fibroblast contractile phenotype. During dermis healing, fibroblasts generate stress fibers (weakly contractile actin bundles) to enable contraction. Fibroblasts' shape is regulated by the environment and cell-matrix adhesion determines the cell shape, such as strong cell-ECM adhesion promotes spindle-shaped fibroblast. In vitro fibroblasts were shown to have different morphology depending on the substrate they are grown on; in 3D cultures resembling an in vivo environment, fibroblasts display elongated shape, welldeveloped actin cortex, and filopodia at the leading edge. Alpha actin ACTC1, which is a constituent of the contractile apparatus, was downregulated in human dermal fibroblasts treated with FGF2 (Table 2; Figure 5B). Gamma actin ACTG2, which is involved in cellular motility and adhesion, was 64-fold downregulated ( Table 2), though qRT-PCR did not confirm its expression. By regulating cytoskeleton gene expression, FGF2 potentially promotes cell migration in the wound site, and reduces contraction that leads to the favorable pro-regenerative outcome. Previously, it was shown that administration of FGF2 alone into a dermal wound shows reduced scar formation, which can be attributed to upregulation of matrix metalloproteinase MMP1. Our data shows strong upregulation of MMP1 ( Figure 4B), the metalloproteinase responsible for cleaving collagen type I, II, and III. FGF2 signaling was shown to activate the MMP1 promoter. MMP1 was able to improve the skeletal muscle regeneration process by reducing scar tissue formation and by promoting migration of myoblasts involved in regeneration of skeletal muscle. Interestingly, integrin 21 was shown to increase MMP1 expression. By transplanting FGF2 treated human dermal fibroblasts, continuous increase in production of MMP1 among other factors, may be allowed, indicating that MMP1 is present not only at the time of the resolution phase of wound healing leading to decreased collagen production, but also at earlier stages of wound healing, for example during the inflammation stage. Other MMP molecules, such as stromelysins MMP3, MMP10, MMP11, were upregulated as well (Table 1 and Figure 4). MMP3 was previously shown to be responsible for contraction of fibroblasts during wound healing and was regulated by FGF2 in a mouse model. MMPs, mostly MMP2, 3, 9 and 10, are highly upregulated during amphibian limb regeneration. All of these observations point toward a favorable role of MMPs in the regeneration process. Thus, FGF2-stimulated change in transcriptional profile of various MMPs is an important factor contributing to the regenerationcompetence of fibroblasts. FGF2 treatment also led to a favorable ratio between MMPs and tissue inhibitors of metalloproteinases (TIMPs), as an imbalance between MMPs and TIMPs has been shown to increase scar formation. FGF2 upregulated TIMP4 and downregulated TIMP3 expression ( Figure 4B). ADAM and ADAMTS proteinases that were shown to be differentially regulated by FGF2 ( Table 1) are regulators of ECM and adhesion molecules and affect cell motility, adhesion, and signaling during wound healing processes. ADAMTS1 and ADAMTS5 were downregulated by FGF2 treatment ( Figure 4B). ADAM transmembrane proteinases are involved in cleaving and activating various cell surface molecules, whereas ADAMTS are secreted proteinases that can bind ECM. ADMATS8 that was upregulated by FGF2 treatment ( Figure 4B) has anti-angiogenic properties. The ratio of TGFB1/TGFB3 is a factor that predicts scar formation, the decrease in this ratio being indicative of reduced scar formation. Fetal wounds that are known to heal without scar formation exhibit decreased TGFB1 levels. Administration of TGFB3 has also been shown to reduce scar formation. TGFB pathway was previously shown to be induced by FGF2 treatment in mouse embryonic fibroblasts (MEFs). We observed no change in the levels of TGFB1 due to FGF2 treatment by microarray analysis whereas qRT-PCR showed downregulation of TGFB1 levels ( Figure 5B). We observed upregulation of TGFBR3 due to FGF2 treatment by the array, but qRT-PCR showed no change in expression levels ( Figure 5B). qRT-PCR confirmed downregulation of TGFBR1 ( Figure 5B). These observations may be due to differences between mouse embryonic fibroblasts and adult human dermal fibroblasts, indicating that FGF2 response in these cells may be unique. Decreasing inflammation has been shown to decrease scar formation. For example, when wounds of skin and oral mucosa were compared, there was less inflammation and scarring in oral mucosa. Non-scar wound healing in fetal wounds is also characterized by absence of inflammation. Inflammatory events are integrated by chemokines. Chemokines are chemotactic cytokines that regulate migration of cells during inflammatory process. Figure 5B). CXCL5, a chemokine that attracts and activates neutrophils, amplifies inflammatory cascade, and stimulates local production of cytokines was shown to be upregulated by FGF2 treatment ( Figure 5B). Interestingly, when CXCL5 is cleaved by MMP1, 2, 8, 9, and 13, increased inflammation is observed and cell recruitment to the wound site is activated. CCL2 (monocyte chemoattractant protein-1, MCP-1), which is involved in inflammatory cell recruitment, can be induced through focal adhesion kinase (FAK) leading to inflammation and scar production in a cutaneous injury, and CCL2 knock-out mice showed decreased scarring. Here, we observed downregulation of CCL2 due to FGF2 treatment ( Figure 5B). In agreement with previous publications, implantation of FGF2 treated fibroblasts, which show CCL2 downregulation, into a mouse wound sight leads to reduced scar formation. We also show in this transcriptome analysis that IL6/ STAT3 signaling pathway is regulated by FGF2 ( Figure 5B). Interleukin 6 (IL6) is a pleiotropic cytokine that is produced by a variety of cells such as epidermal cells, endothelial cells, and fibroblasts. IL6 is known to increase production of collagen, thus the decrease in collagen synthesis that we observe in skeletal muscle injury, can be partially explained by decrease in IL6. CCL2 was shown to induce IL6 secretion in human lung fibroblasts, and has a role in regulating fibrosis and was shown previously to be regulated by FGF2. Scarless, fetal wounds are characterized by diminished expression of pro-inflammatory IL6 and IL8. Here, we show that FGF2 treatment significantly reduces IL6 levels ( Figure 5B), whereas levels of IL8 are upregulated with FGF2 treatment (Table 3). FGF2-induced decrease in IL6 level could be contributing to pro-regenerative phenotype of adult human fibroblasts. Signal transducer and activator of transcription (STAT3) conveys signals from IL6. Loss of IL6 was shown to result in deficiency of proliferation and migration of myoblasts. IL6/STAT3 was shown recently to be involved in excessive ECM production and increased cellular proliferation in hypertrophic scars compared to normal human fibroblasts. Conclusions Comparison of transcriptomes between control and regeneration-competent fibroblasts indicates significant differences in expression of genes involved in several biological processes during wound healing. Downregulation of collagens, upregulation of ECM remodeling enzymes, and downregulation of pro-inflammatory cytokines may be in part responsible for the cells' pro-regenerative phenotype. A choice between scar-forming and proregenerative wound healing responses may depend on a balance between ECM production, degradation, consequent ECM contractility, and decreased inflammatory response. Further studies are needed to elucidate functional significance of specific disregulated genes. Cell culture Adult human dermal fibroblasts were obtained from ATCC (CRL-2352) at passage number 1 (p1 RNA isolation Total RNA was isolated from all treatment groups using TRIZOL reagent (Invitrogen) following manufacturer's protocol. OneArray microarray sample and data processing To obtain a sense of global effects of surface and FGF2, two independent samples (in three technical replicates each) of cells grown on glass, glass with FGF2, plastic, and plastic with FGF2 were hybridized to the Human Whole Genome OneArray® v5 (Phalanx Biotech, Palo Alto, CA). RNA quality and integrity were determined utilizing an Agilent 2100 Bioanalyzer (Agilent Technologies, Palo Alto, CA, USA) and absorbance at A260/A280. Only high quality RNA, having a RIN of >7.0, and an A260/280 absorbance ratio of >1.8, was utilized for further experimentation. RNA was converted to double-stranded cDNA and amplified using in vitro transcription that included amino-allyl UTP, and the aRNA product was subsequently conjugated with Cy5™ NHS ester (GEH Lifesciences). Fragmented aRNA was hybridized at 50°C overnight using the HybBag mixing system with 1X OneArray Hybridization Buffer (Phalanx Biotech), 0.01 mg/ml sheared salmon sperm DNA (Promega, Madison, WI, USA), at a concentration of 0.025 mg/ml labeled target. After hybridization, the arrays were washed according to the OneArray protocol. Raw intensity signals for each microarray were captured using a Molecular Dynamics™ Axon 4100A scanner, measured using GenePixPro™ Software, and stored in GPR format. Data analysis The data was analyzed with R/bioconductor using standard statistical functions and analysis modules for the ANOVA, T test, FDR, and functional analysis. Analysis was performed in the following order. First, data was background corrected, normalized, and filtered to remove probes with very low expression or low variance (expression but no variation) across conditions. Next, 2-way ANOVA was performed to determine significant gene probes for the two factors and possible interactions between cell culture surface and FGF2. LIMMA package was used to determine significantly differentially expressed genes (DEG) with moderate t-statistic as main statistic of significance and standard errors moderated using Bayesian model. P-values were adjusted for multiple comparisons using Benjamini and Hochberg method to control the false discovery rate (FDR). FDR cutoff value of 0.05 was used. Gene Ontology (GO) analysis was performed to analyze functional enrichment within DEG due to FGF2 treatment in human dermal fibroblasts cultured on plastic. DEG due to FGF2 treatment were profiled for GO slim using geneListPie package. In order to perform GO analysis, GOstats package was used. Hypergeometric conditional testing was performed to obtain overrepresented GO terms that belong to three groups: biological process, molecular function, and cellular component. Quantitative RT-PCR cDNA was prepared from total RNA using QuantiTect Reverse Transcription kit (Qiagen) using mixture of oligo-dT and random primers method. The kit also includes elimination of genomic DNA step prior to reverse transcription. 1 g of total RNA was used for cDNA preparation. For each qPCR reaction 20 ng of cDNA were used. qPCR was performed using SYBR SE-LECT master mix (Invitrogen). The list of primers can be found in Additional file 7. Quantification of qPCR results was performed by the CT method. Availability of supporting data The data sets supporting the results of this article are available in Gene Expression Omnibus (GEO) repository (GSE48967) and at http://users.wpi.edu/~tdominko/iRC_transcriptome/.
|
<gh_stars>1-10
//////////////////////////////////////////////////////////////////////
// ColorImage.hpp:
//
// A color image class that can read and write PPM files.
// Also defines some useful functions, such as making a color
// from floating point numbers.
//
//////////////////////////////////////////////////////////////////////
#ifndef _COLOR_IMAGE_
#define _COLOR_IMAGE_
//////////////////////////////////////////////////////////////////////
typedef unsigned int pixel_t;
typedef pixel_t* pixel_p;
class ColorImage
{
protected:
int width, height;
pixel_p A;
public:
ColorImage() {A=NULL; height=0; width=0;}
ColorImage(int w, int h);
ColorImage(ColorImage &image);
~ColorImage();
bool copyImage(ColorImage &image);
bool setSize(int w, int h);
void clear(pixel_t rgba=0);
pixel_p getDataArray(void) {return A;}
int getWidth(void) {return width;}
int getHeight(void) {return height;}
int getPixelSz(void) {return sizeof(pixel_t);}
pixel_t getPixel(int x, int y) {return(A[width*y + x]);}
void setPixel(int x, int y, pixel_t rgba) {A[width*y + x] = rgba;}
// Methods to write the image to files
bool writeToFile(char *fName, bool bin=true, char *headerInfo=NULL);
// Methods to load the image from a file
bool loadFromFile(char *fName);
};
//----------------------------------------------------------------------------//
pixel_t makeColor(int r, int g, int b, int a=0);
pixel_t makeColor(float r, float g, float b, float a=0.0f);
void separateColor(pixel_t rgba, int &r, int &g, int &b, int &a);
int maxColorComponentDiff(pixel_t A, pixel_t B);
int colorDiff(pixel_t A, pixel_t B);
int squaredColorDiff(pixel_t A, pixel_t B);
pixel_t colorAverage(pixel_t A, pixel_t B);
pixel_t colorAverage(pixel_t A, pixel_t B, pixel_t C, pixel_t D);
#define RMASK 0x000000ff
#define GMASK 0x0000ff00
#define BMASK 0x00ff0000
#define AMASK 0xff000000
#endif
|
Yes, it’s that time again — the time when I yell at you to dive into the wealth of foreign movies and shows available to stream, and you nod your head and vaguely promise that you totally like reading subtitles. And because of the strange ways that weeks sometimes work, this is our third Pop Culture Imports for May!
This week has a wide variety of titles, from a mellow South Korean reality show, to a South African domestic drama, to an Israeli rom-com, and finally, a documentary about the Chinese restaurateur who introduced the U.S. to authentic Chinese cuisine.
So with that, let’s dive into the best foreign-language movies and shows streaming now.
Like all of you, I was left at a loss after I sped through the latest eight episodes of Terrace House: Opening New Doors (see my write-up of Part 1 two months ago). How now to fill the gap of the soothing reality show balm for the soul that was Terrace House? Should you turn to the pressure cooker of a romance travel show that is Ainori? The crude and malicious Real (L)ove? No, the reality show replacement actually comes from across the sea, in South Korea’s Jeju Island. The South Korean reality show Hyori’s Bed and Breakfast is Terrace House’s successor in so many ways, while managing to be even more low-key than the positively lethargic Terrace House.
More like a travelogue than a dating show, Hyori’s Bed and Breakfast centers around pop diva Hyori Lee and her husband Sang-soon Lee as they open up their isolated Jeju Island estate to guests from around the country. The couple’s zen island life suddenly becomes a hive of activity after they turn their cozy house into a bed and breakfast. Aided by various popular celebrities, Hyori and Sang-soon find themselves thrust into public life for the first time in years — and loving it. The interactions between the couple and the guests are sweet and endearing, and the glimpses of the rustic life on Jeju Island (a popular getaway in South Korea) are idyllic. Hyori’s Bed and Breakfast is a heartwarming slice of life reality show that can scratch your Terrace House itch and make you want to pack your bags for Jeju Island immediately.
Watch This If You Like: Terrace House, Anthony Bourdain’s Parts Unknown, Departures, living vicariously through travel shows so you can plan your own Eat Pray Love trip.
Cast: Noa Koler, Amos Tamam, Oz Zehavi, Dafi Alpern, Roni Merhavi, Irit Sheleg.
The Wedding Plan has a premise straight out of a conventional ’90s romantic-comedy: a 32-year-old devout Israeli woman, Michal, is desperate to marry but on the eve of her wedding, her fiancé admits that he doesn’t love her. Left with a month before her wedding date, Michal brazenly decides to go through with the ceremony anyways, leaving the identity of her groom up to God. While The Wedding Plan sounds generic as hell, it surprisingly is not as quirky as Michal’s hare-brained scheme would have you believe. And that’s in large part thanks to star Noa Kooler‘s prickly and vulnerable performance as an ultra-Orthodox Jewish woman who is looking not for love, but for stability.
Michal is an unusual rom-com heroine, going on a series of blind dates with an attitude befitting a mortician, not a bride-to-be. She borders on unlikable, pushing away friends, family, and even potential love interests in her resolute belief that God will choose her groom. As a devoutly Orthodox woman from Israel herself, director Rama Burshtein infuses The Wedding Plan with an earnest, genuinely religious perspective that gives the film a bit more emotional heft and authenticity — even when each of the men whom Michal meets in the movie is unnaturally rom-com hot.
Watch This If You Like: My Big Fat Greek Wedding, Serendipity, What’s Your Number?, proof that the rom-com is not dead yet.
Cast: Kagiso Lediga, Pearl Thusi, Andrew Buckland, Akin Omotoso, Precious Makgaretsa, Kate Liquorish and Tessa Jubber.
Like any comedy starring, written, and helmed by a stand-up comedian, Catching Feelings can feel somewhat like a self-indulgent stand-up routine. But star and director Kagiso Lediga proves to have a sharp eye for filmmaking, delivering a richly layered, darkly comedic romantic drama. Lediga stars as an embittered English professor suffering from writer’s block and insecurity regarding his beautiful wife Samkelo (Pearl Thusi). But the two of them live a happy life in a middle class area of Johannesburg — with Lediga occasionally rattling the cage whenever he rails against gentrification and racial politics in post-apartheid South Africa. But their urbane life is given a shock to the system when an older celebrity writer, Heiner Miller (a bombastic Andrew Buckland), enters their lives. At first resistant to Heiner’s charms, Lediga’s Max Matsane finds himself drawn into the famous writer’s hedonistic lifestyle. But soon Heiner begins encroaching on Max’s home life, moving into his home and becoming fast friends with his wife. Wracked with insecurity and paranoia, Max’s life and mental state quickly unravels.
Catching Feelings walks a tightrope between screwball comedy and deeper insights on racial tensions in South Africa — sometimes stumbling, but never anything less than entertaining.
Watch This If You Like: The Incredible Jessica James, Young Adult, While We’re Young, turmoiled men self-sabotaging themselves.
Cast: Cecilia Chang, Alice Waters, Ruth Reichl.
Wayne Wang‘s definitive The Joy Luck Club was both a celebration of four generations of Chinese women as much as it was a celebration of the delectable food around which their lives revolved. So it’s no surprise that the Hong Kong-born American would turn his camera to yet another auspicious Chinese woman who introduced high-end Chinese cuisine to America.
Soul of a Banquet is a simple, slow-burning love letter to Cecilia Chang, the famous restaurateur who, in 1961, changed the face of Chinese food in America. Called the matriarch of modern Chinese cooking, Cecilia was an accidental restaurateur whose internationally renowned restaurant The Mandarin would introduce the San Francisco Bay area, and later the rest of the world, to a style of gourmet Chinese cooking that was once thought lost in the wake of Mao Zedong’s cultural purge of China in the Cultural Revolution. For the first time, Chinese food was no longer synonymous with Westernized poor-man’s chop suey — Cecilia gave her cuisine prestige and a whole lotta heart.
While the documentary features a few too many white women explaining to the audience what “real” Chinese food is, Soul of a Banquet springs to life whenever Cecilia Chang comes on screen. The first half of the film is a simple oral history, recounting The Mandarin’s rise to fame and Cecilia’s own life and her family’s struggle against Communism. But the second half becomes the lavish Valentine to Chinese cooking you were all waiting for, as Cecilia prepares for a huge banquet that will leave your mouth watering.
Watch This If You Like: Jiro Dreams of Sushi, The Trip, watching The Food Channel while gorging yourself on Chinese food.
Cast: Belén Rueda, Marián Álvarez, Enrico Lo Verso, Manolo Cardona, Marta Belaustegui, Nick Devlin.
A brutal and horrifying portrait of the war-torn Congo, Sara’s Notebook is anchored in a story about two sisters who must overcome a physical and emotional distance. The Spanish film follows a naive Madrid lawyer named Laura who suddenly finds proof of her sister Sara’s survival after she went missing for two years in the Congo. Flustered and out of her element upon her arrival to Uganda to meet the rescue team, Laura ventures deep into the Congo to find her sister, but soon finds herself in a bloody and violent battle for her own survival.
When it’s not acting as an overt homage to Heart of Darkness (and to an extent, the Joseph Conrad novel’s hugely problematic othering), Sara’s Notebook is a profound tale of two wildly different sisters. The emotional narrative sometimes gets muddied in the film’s ping-ponging between genres — it rapidly moves from crime drama, brutal thriller, to political conspiracy — but it remains effective all the same.
Watch This If You Like: Blood Diamond, Babel, First They Killed My Father, sadness.
|
Unlocking high-potential non-persistent radical chemistry for semi-aqueous redox batteries. A non-persistent radical precursor, N-hydroxyphthalimide (NHPI), is reported as a low-cost, high-potential organic cathode in a binary electrolyte for a semi-aqueous redox battery. A highly reversible NHPI-phthalimide N-oxyl (PINO) radical redox couple at +1.30 VNHE is demonstrated, providing a 1.15 V rechargeable battery with an attractive >85% voltage efficiency when coupled with anthraquinone-2-sulfonic acid (AQS).
|
The effect of dielectric stress on the electrical characteristics of AlGaN/GaN heterostructure field-effect transistors (HFETs) We present an experimental analysis on the effect of dielectric stress on the electrical characteristics of AlGaN/GaN HFETs. Issues such as maximum current (I/sub d-max/), gate leakage and current collapse are presented. Different dielectric deposition conditions were used to vary the amount of stress induced on the wafer and the devices were measured before and after passivation. A striking feature observed was the strong dependence of I/sub d-max/ on the amount of stress induced by the dielectric. I/sub d-max/ increases when the stress is tensile and reduces when it is compressive. The rise in leakage current was found to be dependent on the dielectric film itself and not on the stress induced, which suggests that a surface effect is responsible for the leakage mechanism.
|
<filename>dmn-test-cases/signavio/dmn/dmn2java/expected/complex/dmn/dotproduct/CalculateDotProduct.java<gh_stars>100-1000
import java.util.*;
import java.util.stream.Collectors;
@javax.annotation.Generated(value = {"signavio-decision.ftl", "calculateDotProduct"})
@com.gs.dmn.runtime.annotation.DRGElement(
namespace = "",
name = "calculateDotProduct",
label = "CalculateDotProduct",
elementKind = com.gs.dmn.runtime.annotation.DRGElementKind.DECISION,
expressionKind = com.gs.dmn.runtime.annotation.ExpressionKind.OTHER,
hitPolicy = com.gs.dmn.runtime.annotation.HitPolicy.UNKNOWN,
rulesCount = -1
)
public class CalculateDotProduct extends com.gs.dmn.signavio.runtime.DefaultSignavioBaseDecision {
public static final com.gs.dmn.runtime.listener.DRGElement DRG_ELEMENT_METADATA = new com.gs.dmn.runtime.listener.DRGElement(
"",
"calculateDotProduct",
"CalculateDotProduct",
com.gs.dmn.runtime.annotation.DRGElementKind.DECISION,
com.gs.dmn.runtime.annotation.ExpressionKind.OTHER,
com.gs.dmn.runtime.annotation.HitPolicy.UNKNOWN,
-1
);
private final Componentwise componentwise;
public CalculateDotProduct() {
this(new Componentwise());
}
public CalculateDotProduct(Componentwise componentwise) {
this.componentwise = componentwise;
}
public java.math.BigDecimal apply(String a, String b, com.gs.dmn.runtime.annotation.AnnotationSet annotationSet_) {
try {
return apply((a != null ? com.gs.dmn.serialization.JsonSerializer.OBJECT_MAPPER.readValue(a, new com.fasterxml.jackson.core.type.TypeReference<List<java.math.BigDecimal>>() {}) : null), (b != null ? com.gs.dmn.serialization.JsonSerializer.OBJECT_MAPPER.readValue(b, new com.fasterxml.jackson.core.type.TypeReference<List<java.math.BigDecimal>>() {}) : null), annotationSet_, new com.gs.dmn.runtime.listener.LoggingEventListener(LOGGER), new com.gs.dmn.runtime.external.DefaultExternalFunctionExecutor(), new com.gs.dmn.runtime.cache.DefaultCache());
} catch (Exception e) {
logError("Cannot apply decision 'CalculateDotProduct'", e);
return null;
}
}
public java.math.BigDecimal apply(String a, String b, com.gs.dmn.runtime.annotation.AnnotationSet annotationSet_, com.gs.dmn.runtime.listener.EventListener eventListener_, com.gs.dmn.runtime.external.ExternalFunctionExecutor externalExecutor_, com.gs.dmn.runtime.cache.Cache cache_) {
try {
return apply((a != null ? com.gs.dmn.serialization.JsonSerializer.OBJECT_MAPPER.readValue(a, new com.fasterxml.jackson.core.type.TypeReference<List<java.math.BigDecimal>>() {}) : null), (b != null ? com.gs.dmn.serialization.JsonSerializer.OBJECT_MAPPER.readValue(b, new com.fasterxml.jackson.core.type.TypeReference<List<java.math.BigDecimal>>() {}) : null), annotationSet_, eventListener_, externalExecutor_, cache_);
} catch (Exception e) {
logError("Cannot apply decision 'CalculateDotProduct'", e);
return null;
}
}
public java.math.BigDecimal apply(List<java.math.BigDecimal> a, List<java.math.BigDecimal> b, com.gs.dmn.runtime.annotation.AnnotationSet annotationSet_) {
return apply(a, b, annotationSet_, new com.gs.dmn.runtime.listener.LoggingEventListener(LOGGER), new com.gs.dmn.runtime.external.DefaultExternalFunctionExecutor(), new com.gs.dmn.runtime.cache.DefaultCache());
}
public java.math.BigDecimal apply(List<java.math.BigDecimal> a, List<java.math.BigDecimal> b, com.gs.dmn.runtime.annotation.AnnotationSet annotationSet_, com.gs.dmn.runtime.listener.EventListener eventListener_, com.gs.dmn.runtime.external.ExternalFunctionExecutor externalExecutor_, com.gs.dmn.runtime.cache.Cache cache_) {
try {
// Start decision 'calculateDotProduct'
long calculateDotProductStartTime_ = System.currentTimeMillis();
com.gs.dmn.runtime.listener.Arguments calculateDotProductArguments_ = new com.gs.dmn.runtime.listener.Arguments();
calculateDotProductArguments_.put("A", a);
calculateDotProductArguments_.put("B", b);
eventListener_.startDRGElement(DRG_ELEMENT_METADATA, calculateDotProductArguments_);
// Apply child decisions
List<type.Componentwise> componentwise = this.componentwise.apply(a, b, annotationSet_, eventListener_, externalExecutor_, cache_);
// Iterate and aggregate
java.math.BigDecimal output_ = evaluate(a, b, componentwise, annotationSet_, eventListener_, externalExecutor_, cache_);
// End decision 'calculateDotProduct'
eventListener_.endDRGElement(DRG_ELEMENT_METADATA, calculateDotProductArguments_, output_, (System.currentTimeMillis() - calculateDotProductStartTime_));
return output_;
} catch (Exception e) {
logError("Exception caught in 'calculateDotProduct' evaluation", e);
return null;
}
}
protected java.math.BigDecimal evaluate(List<java.math.BigDecimal> a, List<java.math.BigDecimal> b, List<type.Componentwise> componentwise, com.gs.dmn.runtime.annotation.AnnotationSet annotationSet_, com.gs.dmn.runtime.listener.EventListener eventListener_, com.gs.dmn.runtime.external.ExternalFunctionExecutor externalExecutor_, com.gs.dmn.runtime.cache.Cache cache_) {
Product product = new Product();
return sum(componentwise.stream().map(componentwise4_iterator -> product.apply(type.Componentwise3.toComponentwise3(componentwise4_iterator), annotationSet_, eventListener_, externalExecutor_, cache_)).collect(Collectors.toList()));
}
}
|
Resistance of Different Surfactant Preparations to Inactivation by Meconium A disease similar to acute respiratory distress syndrome may occur in neonates after aspiration of meconium. The aim of the study was to compare the inhibitory effects of human meconium on the following surfactant preparations suspended at a concentration of 2.5 mg/mL: Curosurf, Alveofact, Survanta, Exosurf, Pumactant, rabbit natural surfactant from bronchoalveolar lavage, and two synthetic surfactants based on recombinant surfactant protein-C (Venticute) or a leucine/lysine polypeptide. Minimum surface tension, determined with a pulsating bubble surfactometer, was increased >10 mN/m at meconium concentrations ≥0.04 mg/mL for Curosurf, Alveofact, or Survanta, ≥0.32 mg/mL for recombinant surfactant protein-C, ≥1.25 mg/mL for leucine/lysine polypeptide, and ≥20 mg/mL for rabbit natural surfactant. The protein-free synthetic surfactants Exosurf and Pumactant did not reach minimum surface tension <10 mN/m even in the absence of meconium. We conclude that surfactant activity is inhibited by meconium in a dose-dependent manner. Recombinant surfactant protein-C and leucine/lysine polypeptide surfactant were more resistant to inhibition than the modified natural surfactants Curosurf, Alveofact, or Survanta but less resistant than natural lavage surfactant containing surfactant protein-A. We speculate that recombinant hydrophobic surfactant proteins or synthetic analogs of these proteins can be used for the design of new surfactant preparations that are relatively resistant to inactivation and therefore suitable for treatment of acute respiratory distress syndrome.
|
<filename>utils/py27/Lib/distutils/tests/test_ccompiler.py
"""Tests for distutils.ccompiler."""
import os
import unittest
from test.test_support import captured_stdout
from distutils.ccompiler import (gen_lib_options, CCompiler,
get_default_compiler)
from distutils.sysconfig import customize_compiler
from distutils import debug
from distutils.tests import support
class FakeCompiler(object):
def library_dir_option(self, dir):
return "-L" + dir
def runtime_library_dir_option(self, dir):
return ["-cool", "-R" + dir]
def find_library_file(self, dirs, lib, debug=0):
return 'found'
def library_option(self, lib):
return "-l" + lib
class CCompilerTestCase(support.EnvironGuard, unittest.TestCase):
def test_set_executables(self):
class MyCCompiler(CCompiler):
executables = {'compiler': '', 'compiler_cxx': '', 'linker': ''}
compiler = MyCCompiler()
# set executable as list
compiler.set_executables(compiler=['env', 'OMPI_MPICC=clang', 'mpicc'])
self.assertEqual(compiler.compiler, ['env',
'OMPI_MPICC=clang',
'mpicc'])
# set executable as string
compiler.set_executables(compiler_cxx='env OMPI_MPICXX=clang++ mpicxx')
self.assertEqual(compiler.compiler_cxx, ['env',
'OMPI_MPICXX=clang++',
'mpicxx'])
# set executable as unicode string
compiler.set_executables(linker=u'env OMPI_MPICXX=clang++ mpiCC')
self.assertEqual(compiler.linker, [u'env',
u'OMPI_MPICXX=clang++',
u'mpiCC'])
def test_gen_lib_options(self):
compiler = FakeCompiler()
libdirs = ['lib1', 'lib2']
runlibdirs = ['runlib1']
libs = [os.path.join('dir', 'name'), 'name2']
opts = gen_lib_options(compiler, libdirs, runlibdirs, libs)
wanted = ['-Llib1', '-Llib2', '-cool', '-Rrunlib1', 'found',
'-lname2']
self.assertEqual(opts, wanted)
def test_debug_print(self):
class MyCCompiler(CCompiler):
executables = {}
compiler = MyCCompiler()
with captured_stdout() as stdout:
compiler.debug_print('xxx')
stdout.seek(0)
self.assertEqual(stdout.read(), '')
debug.DEBUG = True
try:
with captured_stdout() as stdout:
compiler.debug_print('xxx')
stdout.seek(0)
self.assertEqual(stdout.read(), 'xxx\n')
finally:
debug.DEBUG = False
@unittest.skipUnless(get_default_compiler() == 'unix',
'not testing if default compiler is not unix')
def test_customize_compiler(self):
os.environ['AR'] = 'my_ar'
os.environ['ARFLAGS'] = '-arflags'
# make sure AR gets caught
class compiler:
compiler_type = 'unix'
def set_executables(self, **kw):
self.exes = kw
comp = compiler()
customize_compiler(comp)
self.assertEqual(comp.exes['archiver'], 'my_ar -arflags')
def test_suite():
return unittest.makeSuite(CCompilerTestCase)
if __name__ == "__main__":
unittest.main(defaultTest="test_suite")
|
(Experimental Reggae Island Music) This song was inspired while I was visiting Lahaina, Maui for my wedding. If you have the pleasure of visiting this majestic island, in the very center of a town named Lahaina there is this colossal growth of a banyan tree cloaked with hanging vines. Planted in 1873 and now covering 2/3 of an acre, it is supported by 16 trunks! Anyway, in my mind that tree was begging to be climbed and teasing me with it's low hanging vines to be swung! But nope, I had to be an adult and obey the damn signs! So all in all this song is really a metaphor for enduring all life's responsibilities and regulations.. This is my first time attempting any kind of music in this genre but after spending almost a month in Hawaii and constantly listening to it on the radio I had to give a whirl! Scott Snodgrass performed vocals & ukelele Tim Schmitt performed guitar & bass Josh Roberts composed & recorded/produced while performing drums, piano, maracas & bongos Lyrics by Scott & Josh Enjoy!
Genre banyan tree
|
<filename>src/utils/file-exists.ts
import { constants } from 'fs';
import { access } from 'fs/promises';
export async function checkFileExists(file: string) {
return access(file, constants.F_OK)
.then(() => true)
.catch(() => false);
}
|
interface ActionBase {
type: string;
}
interface SignallingStartAction extends ActionBase {
type: "SIGNALLING_START";
}
interface SignallingTimeoutAction extends ActionBase {
type: "SIGNALLING_TIMEOUT";
}
interface StreamSetAction extends ActionBase {
type: "SET_STREAM";
stream: MediaStream;
}
interface SetOfferAction extends ActionBase {
type: "SET_OFFER";
offer: RTCSessionDescription;
}
interface StoppingAction extends ActionBase {
type: "STOPPING";
}
interface StoppedAction extends ActionBase {
type: "STOPPED";
}
interface StartPlayingAction extends ActionBase {
type: "START_PLAYING";
}
interface ProcessAnswerErrorAction extends ActionBase {
type: "PROCESS_ANSWER_ERROR";
error: Error;
}
interface ErrorAction extends ActionBase {
type: "ERROR";
error: Error;
}
export type Action =
| SignallingStartAction
| SignallingTimeoutAction
| StreamSetAction
| SetOfferAction
| StoppingAction
| StoppedAction
| StartPlayingAction
| ProcessAnswerErrorAction
| ErrorAction;
|
/*
* GridTools
*
* Copyright (c) 2014-2019, ETH Zurich
* All rights reserved.
*
* Please, refer to the LICENSE file in the root directory.
* SPDX-License-Identifier: BSD-3-Clause
*/
#pragma once
#include "../meta/dedup.hpp"
#include "../meta/filter.hpp"
#include "../meta/is_empty.hpp"
#include "../meta/length.hpp"
#include "../meta/logical.hpp"
#include "../meta/macros.hpp"
#include "../meta/transform.hpp"
namespace gridtools {
namespace _impl {
template <class Stage>
using get_extent_from_stage = typename Stage::extent_t;
template <class Extent>
struct has_same_extent {
template <class Stage>
using apply = std::is_same<Extent, typename Stage::extent_t>;
};
template <class AllStages>
struct stages_with_the_given_extent {
template <class Extent>
using apply = meta::filter<has_same_extent<Extent>::template apply, AllStages>;
};
namespace lazy {
template <template <class...> class CompoundStage, class Stages>
struct fuse_stages_with_the_same_extent;
template <template <class...> class CompoundStage, template <class...> class L, class... Stages>
struct fuse_stages_with_the_same_extent<CompoundStage, L<Stages...>> {
using type = CompoundStage<Stages...>;
};
template <template <class...> class CompoundStage, template <class...> class L, class Stage>
struct fuse_stages_with_the_same_extent<CompoundStage, L<Stage>> {
using type = Stage;
};
} // namespace lazy
GT_META_DELEGATE_TO_LAZY(fuse_stages_with_the_same_extent,
(template <class...> class CompoundStage, class Stages),
(CompoundStage, Stages));
template <template <class...> class CompoundStage>
struct fuse_stages_with_the_same_extent_f {
template <class Stages>
using apply = fuse_stages_with_the_same_extent<CompoundStage, Stages>;
};
} // namespace _impl
namespace lazy {
template <template <class...> class CompoundStage, class Stages>
struct fuse_stages {
GT_STATIC_ASSERT(meta::length<Stages>::value > 1, GT_INTERNAL_ERROR);
using all_extents_t = meta::transform<_impl::get_extent_from_stage, Stages>;
using extents_t = meta::dedup<all_extents_t>;
GT_STATIC_ASSERT(!meta::is_empty<extents_t>::value, GT_INTERNAL_ERROR);
using stages_grouped_by_extent_t =
meta::transform<_impl::stages_with_the_given_extent<Stages>::template apply, extents_t>;
GT_STATIC_ASSERT((!meta::any_of<meta::is_empty, stages_grouped_by_extent_t>::value), GT_INTERNAL_ERROR);
using type = meta::transform<_impl::fuse_stages_with_the_same_extent_f<CompoundStage>::template apply,
stages_grouped_by_extent_t>;
};
template <template <class...> class CompoundStage, template <class...> class L, class Stage>
struct fuse_stages<CompoundStage, L<Stage>> {
using type = L<Stage>;
};
template <template <class...> class CompoundStage, template <class...> class L>
struct fuse_stages<CompoundStage, L<>> {
using type = L<>;
};
} // namespace lazy
/**
* Group the stages from the input by extent and substitute each group by compound stage.
*/
GT_META_DELEGATE_TO_LAZY(
fuse_stages, (template <class...> class CompoundStage, class Stages), (CompoundStage, Stages));
} // namespace gridtools
|
def relation_to_span(self, g1, g2, edges=False, attrs=False):
if g1 not in self.nodes():
raise HierarchyError(
"Node '%s' is not defined in the hierarchy!" % g1)
if g2 not in self.nodes():
raise HierarchyError(
"Node '%s' is not defined in the hierarchy!" % g2)
if (g1, g2) not in self.relations() and\
(g2, g1) not in self.relations():
raise HierarchyError(
"Relation between graphs '%s' and '%s' is not defined" %
(g1, g2)
)
return relation_to_span(
self.node[g1].graph,
self.node[g2].graph,
self.relation[g1][g2].rel,
edges,
attrs,
self.directed)
|
<filename>src/net/minecraft/network/play/server/S14PacketEntity$S15PacketEntityRelMove.java
package net.minecraft.network.play.server;
import java.io.IOException;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.play.server.S14PacketEntity;
public class S14PacketEntity$S15PacketEntityRelMove extends S14PacketEntity {
public S14PacketEntity$S15PacketEntityRelMove() {
}
public S14PacketEntity$S15PacketEntityRelMove(int var1, byte var2, byte var3, byte var4, boolean var5) {
super(var1);
this.posX = var2;
this.posY = var3;
this.posZ = var4;
this.onGround = var5;
}
public void readPacketData(PacketBuffer var1) throws IOException {
super.readPacketData(var1);
this.posX = var1.readByte();
this.posY = var1.readByte();
this.posZ = var1.readByte();
this.onGround = var1.readBoolean();
}
public void writePacketData(PacketBuffer var1) throws IOException {
super.writePacketData(var1);
var1.writeByte(this.posX);
var1.writeByte(this.posY);
var1.writeByte(this.posZ);
var1.writeBoolean(this.onGround);
}
}
|
<filename>src/ts/core/model/TableModel.ts
import {
SIZE_TABLE_HEADER_HEIGHT,
SIZE_COLUMN_HEIGHT,
SIZE_COLUMN_MARGIN_RIGHT,
SIZE_COLUMN_CLOSE,
SIZE_COLUMN_KEY,
SIZE_MIN_WIDTH,
SIZE_START_X,
SIZE_START_Y,
} from "../Layout";
import { Table, TableUI, Column, ColumnWidth } from "../store/Table";
import { Show } from "../store/Canvas";
import { AddTable, LoadTable } from "../command/table";
import {
getMaxWidthColumn,
getDefaultWidthColumn,
} from "../helper/TableHelper";
interface TableData {
addTable?: AddTable;
loadTable?: LoadTable;
}
export class TableModel implements Table {
id: string;
name = "";
comment = "";
columns: Column[] = [];
ui: TableUI = {
active: false,
left: SIZE_START_X,
top: SIZE_START_Y,
zIndex: 2,
widthName: SIZE_MIN_WIDTH,
widthComment: SIZE_MIN_WIDTH,
};
private _show: Show;
constructor(data: TableData, show: Show) {
const { addTable, loadTable } = data;
this._show = show;
if (addTable) {
const { id, ui } = addTable;
this.id = id;
this.ui = Object.assign(this.ui, ui);
} else if (
loadTable &&
typeof loadTable.id === "string" &&
typeof loadTable.name === "string" &&
typeof loadTable.comment === "string" &&
Array.isArray(loadTable.columns) &&
typeof loadTable.ui === "object" &&
loadTable.ui !== null &&
typeof loadTable.ui.active === "boolean" &&
typeof loadTable.ui.left === "number" &&
typeof loadTable.ui.top === "number" &&
typeof loadTable.ui.zIndex === "number" &&
typeof loadTable.ui.widthName === "number" &&
typeof loadTable.ui.widthComment === "number"
) {
const { id, name, comment, columns, ui } = loadTable;
this.id = id;
this.name = name;
this.comment = comment;
this.columns = columns;
this.ui = Object.assign(this.ui, ui);
} else {
throw new Error("not found table");
}
}
width(): number {
// table header width
let width = this.ui.widthName + SIZE_COLUMN_MARGIN_RIGHT;
if (this._show.tableComment) {
width += this.ui.widthComment + SIZE_COLUMN_MARGIN_RIGHT;
}
// default width column
const defaultWidthColumn =
getDefaultWidthColumn(this._show) +
SIZE_COLUMN_CLOSE +
SIZE_COLUMN_KEY +
SIZE_COLUMN_MARGIN_RIGHT;
if (width < defaultWidthColumn) {
width = defaultWidthColumn;
}
// max width column
const maxWidthColumn =
this.maxWidthColumn().width +
SIZE_COLUMN_CLOSE +
SIZE_COLUMN_KEY +
SIZE_COLUMN_MARGIN_RIGHT;
if (width < maxWidthColumn) {
width = maxWidthColumn;
}
return width;
}
height(): number {
return SIZE_TABLE_HEADER_HEIGHT + this.columns.length * SIZE_COLUMN_HEIGHT;
}
maxWidthColumn(): ColumnWidth {
return getMaxWidthColumn(this.columns, this._show);
}
}
|
Impact of Rapid Susceptibility Testing System on the Management of Gram-Negative Bacteremia in a Network of Community Hospitals. BACKGROUND Rapid initiation of optimal antimicrobial therapy is crucial for the management of Gram-negative (GN) bacteremia. We aimed to evaluate the impact of Accelerate PhenoTM (AxDx) system on change in therapy and length of stay among patients with GN bacteremia. METHODS We conducted a retrospective cohort study of adult patients hospitalized who had at least 1 blood culture with presence of Enterobacterales. We compared clinical outcomes among patients who had their blood cultures processed through standard methods alone vs AxDx. RESULTS We identified 255 bacteremia episodes among 243 unique patients. In the AxDx group, 31.1% of patients had deescalation of antibiotics within 48 h from blood culture collection compared to 20.0% of patients in the control group (P = 0.09). We found no impact of AxDx on the odds of deescalation at 48 h from blood culture collection or Gram stain report . Escalation in therapy at 48 h from blood culture collection occurred in 16.8% and 16.9% of patients in the AxDx and control groups, respectively (P = 0.99). There was no impact on the odds of escalation at 48 h from blood culture collection or Gram stain report . No differences were seen in length of stay and mortality between the 2 groups. CONCLUSIONS The impact of rapid identification and susceptibility technologies may differ according to the setting in which they are implemented.
|
//
// MSFramework.h
// MSFramework
//
// Created by <NAME> on 12/25/16.
// Copyright © 2016 <NAME>. All rights reserved.
//
@import Foundation;
//! Project version number for MSFramework.
FOUNDATION_EXPORT double MSFrameworkVersionNumber;
//! Project version string for MSFramework.
FOUNDATION_EXPORT const unsigned char MSFrameworkVersionString[];
|
The Great Public Buildings of London This two-volume work which was first published in 1825-8 presents London's most important buildings at a time of rapid urban transformation. Aiming to project a vision of London as a dynamic city of integrated courtly and commercial power, the 70 entries span a historical range from the medieval (Westminster Hall) to the early nineteenth century (Soane's Museum) and a diversity of building types from palaces and churches to banks, theatres, prisons and bridges. Edited by John Britton, a leading topographical authority of the period, and Auguste Charles Pugin, an Anglo-French architectural draughtsman, the volumes contain 146 engravings of the selected buildings, correctly scaled from different perspectives and including interior scenes as well as external plans. This was a landmark publication in its time and remains a vivid portrait of the London's built environment immediately before the advent of the railway. This new edition includes an extended introduction by Stephen Daniels, Professor Emeritus of Cultural Geography, University of Nottingham.
|
<filename>js/duotone/cid-bug.d.ts
export declare const cidBug: string[];
|
Comparison of age-specific incidence rate patterns for different histopathologic types of breast carcinoma. OBJECTIVE The age-specific incidence rate curve for breast carcinoma overall increases rapidly until age 50 years, and then continues to increase at a slower rate for older women. In this analysis, our objective was to compare age-specific incidence rate patterns for different morphologic types of breast carcinoma. MATERIALS AND METHODS We analyzed age-specific incidence rate curves by histopathologic subclassification using records from 11 standard National Cancer Institute's Surveillance, Epidemiology, and End Results (SEER) registries, diagnosed during the years 1992 to 1999. Data were examined by age <50 and > or /=50 years to simulate menopause. RESULTS Age-specific incidence rate curves showed three dominant patterns: Rates for infiltrating duct carcinoma of no special type (duct NST), tubular, and lobular carcinomas increased rapidly until age 50 years then rose more slowly. Rates for medullary and inflammatory breast carcinomas increased rapidly until age 50 years then failed to increase. Rates for papillary and mucinous carcinomas increased steadily at all ages. Rate patterns varied by estrogen receptor expression but were unaffected by SEER registry, race, nodal status, or grade. CONCLUSION Age-specific incidence rates for breast carcinomas differed by histopathologic type. Rates that failed to increase after 50 years suggested that menopause had greater impact on medullary and inflammatory carcinomas than on duct NST, tubular, and lobular carcinomas. Menopause did not seem to have any effect on papillary or mucinous carcinomas as evidenced by steadily rising rates at all ages. Future etiologic and/or prevention studies should consider the impact of age-specific risk factors and/or exposures on different histopathologic types of breast carcinomas.
|
<gh_stars>1-10
#include "lcm.hpp"
namespace Utils {
long long gcd(long long int a, long long int b)
{
if (b == 0)
return a;
return gcd(b, a % b);
}
// Function to return LCM of two numbers
long long lcm(int a, int b)
{
return (a / gcd(a, b)) * b;
}
}
|
/**
* Moves the directory from the src to dest, creating the parent directory for the dest if one
* does not exist.
*
* @param conf configuration object
* @param src source directory
* @param dest destination directory
* @throws IOException if there's an error moving the directory
*/
public static void moveDir(Configuration conf, Path src, Path dest) throws IOException {
FileSystem srcFs = FileSystem.get(src.toUri(), conf);
FileSystem destFs = FileSystem.get(dest.toUri(), conf);
if (!srcFs.getUri().equals(destFs.getUri())) {
throw new IOException("Source and destination filesystems " + "are different! src: "
+ srcFs.getUri() + " dest: " + destFs.getUri());
}
Path destPathParent = dest.getParent();
if (destFs.exists(destPathParent)) {
if (!destFs.isDirectory(destPathParent)) {
throw new IOException("File exists instead of destination " + destPathParent);
} else {
LOG.debug("Parent directory exists: " + destPathParent);
}
} else {
destFs.mkdirs(destPathParent);
}
boolean successful = srcFs.rename(src, dest);
if (!successful) {
throw new IOException("Error while moving from " + src + " to " + dest);
}
}
|
<gh_stars>1000+
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.preferences.website;
import android.util.Pair;
import org.chromium.base.Callback;
import org.chromium.chrome.browser.ContentSettingsType;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
/**
* Utility class that asynchronously fetches any Websites and the permissions
* that the user has set for them.
*/
public class WebsitePermissionsFetcher {
/**
* A callback to pass to WebsitePermissionsFetcher. This is run when the
* website permissions have been fetched.
*/
public interface WebsitePermissionsCallback {
void onWebsitePermissionsAvailable(Collection<Website> sites);
}
/**
* A specialization of Pair to hold an (origin, embedder) tuple. This overrides
* android.util.Pair#hashCode, which simply XORs the hashCodes of the pair of values together.
* Having origin == embedder (a fix for a crash in crbug.com/636330) results in pathological
* performance and causes Site Settings/All Sites to lag significantly on opening. See
* crbug.com/732907.
*/
public static class OriginAndEmbedder extends Pair<WebsiteAddress, WebsiteAddress> {
public OriginAndEmbedder(WebsiteAddress origin, WebsiteAddress embedder) {
super(origin, embedder);
}
public static OriginAndEmbedder create(WebsiteAddress origin, WebsiteAddress embedder) {
return new OriginAndEmbedder(origin, embedder);
}
private static boolean isEqual(Object o1, Object o2) {
// Returns true iff o1 == o2, handling nulls.
return (o1 == o2) || (o1 != null && o1.equals(o2));
}
@Override
public boolean equals(Object o) {
// Prior to KitKat, android.util.Pair would crash with a NullPointerException in this
// method. This override specialises the post-Kitkat implementation to this class, and
// correctly handles nulls.
if (!(o instanceof OriginAndEmbedder)) return false;
OriginAndEmbedder p = (OriginAndEmbedder) o;
return isEqual(p.first, first) && isEqual(p.second, second);
}
@Override
public int hashCode() {
// This is the calculation used by Arrays#hashCode().
int result = 31 + (first == null ? 0 : first.hashCode());
return 31 * result + (second == null ? 0 : second.hashCode());
}
}
// This map looks up Websites by their origin and embedder.
private final Map<OriginAndEmbedder, Website> mSites = new HashMap<>();
// The callback to run when the permissions have been fetched.
private final WebsitePermissionsCallback mCallback;
private final boolean mFetchSiteImportantInfo;
/**
* @param callback The callback to run when the fetch is complete.
*/
public WebsitePermissionsFetcher(WebsitePermissionsCallback callback) {
this(callback, false);
}
/**
* @param callback The callback to run when the fetch is complete.
* @param fetchSiteImportantInfo if the fetcher should query whether each site is 'important'.
*/
public WebsitePermissionsFetcher(
WebsitePermissionsCallback callback, boolean fetchSiteImportantInfo) {
mCallback = callback;
mFetchSiteImportantInfo = fetchSiteImportantInfo;
}
/**
* Fetches preferences for all sites that have them.
* TODO(mvanouwerkerk): Add an argument |url| to only fetch permissions for
* sites from the same origin as that of |url| - https://crbug.com/459222.
*/
public void fetchAllPreferences() {
TaskQueue queue = new TaskQueue();
// Populate features from more specific to less specific.
// Geolocation lookup permission is per-origin and per-embedder.
queue.add(new GeolocationInfoFetcher());
// Midi sysex access permission is per-origin and per-embedder.
queue.add(new MidiInfoFetcher());
// Cookies are stored per-host.
queue.add(new CookieExceptionInfoFetcher());
// Local storage info is per-origin.
queue.add(new LocalStorageInfoFetcher());
// Website storage is per-host.
queue.add(new WebStorageInfoFetcher());
// Popup exceptions are host-based patterns (unless we start
// synchronizing popup exceptions with desktop Chrome).
queue.add(new PopupExceptionInfoFetcher());
// Ads exceptions are host-based.
queue.add(new AdsExceptionInfoFetcher());
// JavaScript exceptions are host-based patterns.
queue.add(new JavaScriptExceptionInfoFetcher());
// Sound exceptions are host-based patterns.
queue.add(new SoundExceptionInfoFetcher());
// Protected media identifier permission is per-origin and per-embedder.
queue.add(new ProtectedMediaIdentifierInfoFetcher());
// Notification permission is per-origin.
queue.add(new NotificationInfoFetcher());
// Camera capture permission is per-origin and per-embedder.
queue.add(new CameraCaptureInfoFetcher());
// Micropohone capture permission is per-origin and per-embedder.
queue.add(new MicrophoneCaptureInfoFetcher());
// Background sync permission is per-origin.
queue.add(new BackgroundSyncExceptionInfoFetcher());
// Autoplay permission is per-origin.
queue.add(new AutoplayExceptionInfoFetcher());
// USB device permission is per-origin and per-embedder.
queue.add(new UsbInfoFetcher());
// Clipboard info is per-origin.
queue.add(new ClipboardInfoFetcher());
queue.add(new PermissionsAvailableCallbackRunner());
queue.next();
}
/**
* Fetches all preferences within a specific category.
*
* @param catgory A category to fetch.
*/
public void fetchPreferencesForCategory(SiteSettingsCategory category) {
if (category.showAllSites()) {
fetchAllPreferences();
return;
}
TaskQueue queue = new TaskQueue();
// Populate features from more specific to less specific.
if (category.showGeolocationSites()) {
// Geolocation lookup permission is per-origin and per-embedder.
queue.add(new GeolocationInfoFetcher());
} else if (category.showCookiesSites()) {
// Cookies exceptions are patterns.
queue.add(new CookieExceptionInfoFetcher());
} else if (category.showStorageSites()) {
// Local storage info is per-origin.
queue.add(new LocalStorageInfoFetcher());
// Website storage is per-host.
queue.add(new WebStorageInfoFetcher());
} else if (category.showCameraSites()) {
// Camera capture permission is per-origin and per-embedder.
queue.add(new CameraCaptureInfoFetcher());
} else if (category.showMicrophoneSites()) {
// Micropohone capture permission is per-origin and per-embedder.
queue.add(new MicrophoneCaptureInfoFetcher());
} else if (category.showPopupSites()) {
// Popup exceptions are host-based patterns (unless we start
// synchronizing popup exceptions with desktop Chrome.)
queue.add(new PopupExceptionInfoFetcher());
} else if (category.showAdsSites()) {
// Ads exceptions are host-based.
queue.add(new AdsExceptionInfoFetcher());
} else if (category.showJavaScriptSites()) {
// JavaScript exceptions are host-based patterns.
queue.add(new JavaScriptExceptionInfoFetcher());
} else if (category.showSoundSites()) {
// Sound exceptions are host-based patterns.
queue.add(new SoundExceptionInfoFetcher());
} else if (category.showNotificationsSites()) {
// Push notification permission is per-origin.
queue.add(new NotificationInfoFetcher());
} else if (category.showBackgroundSyncSites()) {
// Background sync info is per-origin.
queue.add(new BackgroundSyncExceptionInfoFetcher());
} else if (category.showProtectedMediaSites()) {
// Protected media identifier permission is per-origin and per-embedder.
queue.add(new ProtectedMediaIdentifierInfoFetcher());
} else if (category.showAutoplaySites()) {
// Autoplay permission is per-origin.
queue.add(new AutoplayExceptionInfoFetcher());
} else if (category.showUsbDevices()) {
// USB device permission is per-origin.
queue.add(new UsbInfoFetcher());
} else if (category.showClipboardSites()) {
// Clipboard permission is per-origin.
queue.add(new ClipboardInfoFetcher());
}
queue.add(new PermissionsAvailableCallbackRunner());
queue.next();
}
private Website findOrCreateSite(WebsiteAddress origin, WebsiteAddress embedder) {
OriginAndEmbedder key = OriginAndEmbedder.create(origin, embedder);
Website site = mSites.get(key);
if (site == null) {
site = new Website(origin, embedder);
mSites.put(key, site);
}
return site;
}
private void setException(int contentSettingsType) {
for (ContentSettingException exception :
WebsitePreferenceBridge.getContentSettingsExceptions(contentSettingsType)) {
// The pattern "*" represents the default setting, not a specific website.
if (exception.getPattern().equals("*")) continue;
WebsiteAddress address = WebsiteAddress.create(exception.getPattern());
if (address == null) continue;
Website site = findOrCreateSite(address, null);
switch (contentSettingsType) {
case ContentSettingsType.CONTENT_SETTINGS_TYPE_ADS:
site.setAdsException(exception);
break;
case ContentSettingsType.CONTENT_SETTINGS_TYPE_AUTOPLAY:
site.setAutoplayException(exception);
break;
case ContentSettingsType.CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC:
site.setBackgroundSyncException(exception);
break;
case ContentSettingsType.CONTENT_SETTINGS_TYPE_COOKIES:
site.setCookieException(exception);
break;
case ContentSettingsType.CONTENT_SETTINGS_TYPE_JAVASCRIPT:
site.setJavaScriptException(exception);
break;
case ContentSettingsType.CONTENT_SETTINGS_TYPE_POPUPS:
site.setPopupException(exception);
break;
case ContentSettingsType.CONTENT_SETTINGS_TYPE_SOUND:
site.setSoundException(exception);
break;
default:
assert false : "Unexpected content setting type received: "
+ contentSettingsType;
break;
}
}
}
/**
* A single task in the WebsitePermissionsFetcher task queue. We need fetching of features to be
* serialized, as we need to have all the origins in place prior to populating the hosts.
*/
private abstract class Task {
/** Override this method to implement a synchronous task. */
void run() {}
/**
* Override this method to implement an asynchronous task. Call queue.next() once execution
* is complete.
*/
void runAsync(TaskQueue queue) {
run();
queue.next();
}
}
/**
* A queue used to store the sequence of tasks to run to fetch the website preferences. Each
* task is run sequentially, and some of the tasks may run asynchronously.
*/
private static class TaskQueue extends LinkedList<Task> {
void next() {
if (!isEmpty()) removeFirst().runAsync(this);
}
}
private class AutoplayExceptionInfoFetcher extends Task {
@Override
public void run() {
setException(ContentSettingsType.CONTENT_SETTINGS_TYPE_AUTOPLAY);
}
}
private class ClipboardInfoFetcher extends Task {
@Override
public void run() {
for (ClipboardInfo info : WebsitePreferenceBridge.getClipboardInfo()) {
WebsiteAddress origin = WebsiteAddress.create(info.getOrigin());
if (origin == null) continue;
WebsiteAddress embedder = WebsiteAddress.create(info.getEmbedder());
findOrCreateSite(origin, embedder).setClipboardInfo(info);
}
}
}
private class GeolocationInfoFetcher extends Task {
@Override
public void run() {
for (GeolocationInfo info : WebsitePreferenceBridge.getGeolocationInfo()) {
WebsiteAddress origin = WebsiteAddress.create(info.getOrigin());
if (origin == null) continue;
WebsiteAddress embedder = WebsiteAddress.create(info.getEmbedder());
findOrCreateSite(origin, embedder).setGeolocationInfo(info);
}
}
}
private class MidiInfoFetcher extends Task {
@Override
public void run() {
for (MidiInfo info : WebsitePreferenceBridge.getMidiInfo()) {
WebsiteAddress origin = WebsiteAddress.create(info.getOrigin());
if (origin == null) continue;
WebsiteAddress embedder = WebsiteAddress.create(info.getEmbedder());
findOrCreateSite(origin, embedder).setMidiInfo(info);
}
}
}
private class PopupExceptionInfoFetcher extends Task {
@Override
public void run() {
setException(ContentSettingsType.CONTENT_SETTINGS_TYPE_POPUPS);
}
}
private class AdsExceptionInfoFetcher extends Task {
@Override
public void run() {
setException(ContentSettingsType.CONTENT_SETTINGS_TYPE_ADS);
}
}
private class JavaScriptExceptionInfoFetcher extends Task {
@Override
public void run() {
setException(ContentSettingsType.CONTENT_SETTINGS_TYPE_JAVASCRIPT);
}
}
private class SoundExceptionInfoFetcher extends Task {
@Override
public void run() {
setException(ContentSettingsType.CONTENT_SETTINGS_TYPE_SOUND);
}
}
private class CookieExceptionInfoFetcher extends Task {
@Override
public void run() {
setException(ContentSettingsType.CONTENT_SETTINGS_TYPE_COOKIES);
}
}
private class LocalStorageInfoFetcher extends Task {
@Override
public void runAsync(final TaskQueue queue) {
WebsitePreferenceBridge.fetchLocalStorageInfo(new Callback<HashMap>() {
@Override
public void onResult(HashMap result) {
for (Object o : result.entrySet()) {
@SuppressWarnings("unchecked")
Map.Entry<String, LocalStorageInfo> entry =
(Map.Entry<String, LocalStorageInfo>) o;
WebsiteAddress address = WebsiteAddress.create(entry.getKey());
if (address == null) continue;
findOrCreateSite(address, null).setLocalStorageInfo(entry.getValue());
}
queue.next();
}
}, mFetchSiteImportantInfo);
}
}
private class WebStorageInfoFetcher extends Task {
@Override
public void runAsync(final TaskQueue queue) {
WebsitePreferenceBridge.fetchStorageInfo(new Callback<ArrayList>() {
@Override
public void onResult(ArrayList result) {
@SuppressWarnings("unchecked")
ArrayList<StorageInfo> infoArray = result;
for (StorageInfo info : infoArray) {
WebsiteAddress address = WebsiteAddress.create(info.getHost());
if (address == null) continue;
findOrCreateSite(address, null).addStorageInfo(info);
}
queue.next();
}
});
}
}
private class ProtectedMediaIdentifierInfoFetcher extends Task {
@Override
public void run() {
for (ProtectedMediaIdentifierInfo info :
WebsitePreferenceBridge.getProtectedMediaIdentifierInfo()) {
WebsiteAddress origin = WebsiteAddress.create(info.getOrigin());
if (origin == null) continue;
WebsiteAddress embedder = WebsiteAddress.create(info.getEmbedder());
findOrCreateSite(origin, embedder).setProtectedMediaIdentifierInfo(info);
}
}
}
private class NotificationInfoFetcher extends Task {
@Override
public void run() {
for (NotificationInfo info : WebsitePreferenceBridge.getNotificationInfo()) {
WebsiteAddress origin = WebsiteAddress.create(info.getOrigin());
if (origin == null) continue;
WebsiteAddress embedder = WebsiteAddress.create(info.getEmbedder());
findOrCreateSite(origin, embedder).setNotificationInfo(info);
}
}
}
private class CameraCaptureInfoFetcher extends Task {
@Override
public void run() {
for (CameraInfo info : WebsitePreferenceBridge.getCameraInfo()) {
WebsiteAddress origin = WebsiteAddress.create(info.getOrigin());
if (origin == null) continue;
WebsiteAddress embedder = WebsiteAddress.create(info.getEmbedder());
findOrCreateSite(origin, embedder).setCameraInfo(info);
}
}
}
private class MicrophoneCaptureInfoFetcher extends Task {
@Override
public void run() {
for (MicrophoneInfo info : WebsitePreferenceBridge.getMicrophoneInfo()) {
WebsiteAddress origin = WebsiteAddress.create(info.getOrigin());
if (origin == null) continue;
WebsiteAddress embedder = WebsiteAddress.create(info.getEmbedder());
findOrCreateSite(origin, embedder).setMicrophoneInfo(info);
}
}
}
private class BackgroundSyncExceptionInfoFetcher extends Task {
@Override
public void run() {
setException(ContentSettingsType.CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC);
}
}
private class UsbInfoFetcher extends Task {
@Override
public void run() {
for (ChosenObjectInfo info : WebsitePreferenceBridge.getChosenObjectInfo(
ContentSettingsType.CONTENT_SETTINGS_TYPE_USB_CHOOSER_DATA)) {
WebsiteAddress origin = WebsiteAddress.create(info.getOrigin());
if (origin == null) continue;
WebsiteAddress embedder = WebsiteAddress.create(info.getEmbedder());
findOrCreateSite(origin, embedder).addChosenObjectInfo(info);
}
}
}
private class PermissionsAvailableCallbackRunner extends Task {
@Override
public void run() {
mCallback.onWebsitePermissionsAvailable(mSites.values());
}
}
}
|
<filename>src/libcore/rt/mod.rs
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
/*! The Rust runtime, including the scheduler and I/O interface */
#[doc(hidden)];
use libc::c_char;
use ptr::Ptr;
#[path = "sched/mod.rs"]
mod sched;
mod rtio;
pub mod uvll;
mod uvio;
#[path = "uv/mod.rs"]
mod uv;
#[path = "io/mod.rs"]
mod io;
// FIXME #5248: The import in `sched` doesn't resolve unless this is pub!
pub mod thread_local_storage;
mod work_queue;
mod stack;
mod context;
mod thread;
pub mod env;
pub mod local_services;
mod local_heap;
/// Tools for testing the runtime
#[cfg(test)]
pub mod test;
pub fn start(main: *u8, _argc: int, _argv: **c_char, _crate_map: *u8) -> int {
use self::sched::{Scheduler, Task};
use self::uvio::UvEventLoop;
use sys::Closure;
use ptr;
use cast;
let loop_ = ~UvEventLoop::new();
let mut sched = ~Scheduler::new(loop_);
let main_task = ~do Task::new(&mut sched.stack_pool) {
unsafe {
// `main` is an `fn() -> ()` that doesn't take an environment
// XXX: Could also call this as an `extern "Rust" fn` once they work
let main = Closure {
code: main as *(),
env: ptr::null(),
};
let mainfn: &fn() = cast::transmute(main);
mainfn();
}
};
sched.task_queue.push_back(main_task);
sched.run();
return 0;
}
/// Possible contexts in which Rust code may be executing.
/// Different runtime services are available depending on context.
#[deriving(Eq)]
pub enum RuntimeContext {
// Only the exchange heap is available
GlobalContext,
// The scheduler may be accessed
SchedulerContext,
// Full task services, e.g. local heap, unwinding
TaskContext,
// Running in an old-style task
OldTaskContext
}
pub fn context() -> RuntimeContext {
use task::rt::rust_task;
use self::sched::local_sched;
// XXX: Hitting TLS twice to check if the scheduler exists
// then to check for the task is not good for perf
if unsafe { rust_try_get_task().is_not_null() } {
return OldTaskContext;
} else {
if local_sched::exists() {
let context = ::cell::empty_cell();
do local_sched::borrow |sched| {
if sched.in_task_context() {
context.put_back(TaskContext);
} else {
context.put_back(SchedulerContext);
}
}
return context.take();
} else {
return GlobalContext;
}
}
pub extern {
#[rust_stack]
fn rust_try_get_task() -> *rust_task;
}
}
#[test]
fn test_context() {
use unstable::run_in_bare_thread;
use self::sched::{local_sched, Task};
use self::uvio::UvEventLoop;
use cell::Cell;
assert!(context() == OldTaskContext);
do run_in_bare_thread {
assert!(context() == GlobalContext);
let mut sched = ~UvEventLoop::new_scheduler();
let task = ~do Task::new(&mut sched.stack_pool) {
assert!(context() == TaskContext);
let sched = local_sched::take();
do sched.deschedule_running_task_and_then() |task| {
assert!(context() == SchedulerContext);
let task = Cell(task);
do local_sched::borrow |sched| {
sched.task_queue.push_back(task.take());
}
}
};
sched.task_queue.push_back(task);
sched.run();
}
}
|
<filename>include/traact/pattern/instance/GraphInstance.h
/* BSD 3-Clause License
*
* Copyright (c) 2020, FriederPankratz <<EMAIL>>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**/
#ifndef TRAACT_INCLUDE_TRAACT_PATTERN_SPATIAL_INSTANTIATEDGRAPH_H_
#define TRAACT_INCLUDE_TRAACT_PATTERN_SPATIAL_INSTANTIATEDGRAPH_H_
#include <map>
#include <memory>
#include <traact/pattern/instance/PatternInstance.h>
#include <traact/traact_core_export.h>
namespace traact::pattern::instance {
class TRAACT_CORE_EXPORT GraphInstance {
public:
typedef typename std::shared_ptr<GraphInstance> Ptr;
GraphInstance();
GraphInstance(const std::string &name);
PatternInstance::Ptr addPattern(std::string pattern_id, Pattern::Ptr pattern);
PatternInstance::Ptr getPattern(const std::string &pattern_id) const;
std::set<PatternInstance::Ptr> getAll() const;
bool connect(std::string source_component,
std::string producer_port,
std::string sink_component,
std::string consumer_port);
traact::pattern::instance::PortInstance::ConstPtr getPort(const ComponentID_PortName &id) const;
std::set<traact::pattern::instance::PortInstance::ConstPtr> connectedToPtr(const ComponentID_PortName &id) const;
std::string name;
std::map<std::string, PatternInstance::Ptr> pattern_instances;
std::map<int, traact::buffer::TimeDomainManagerConfig> timedomain_configs;
void initializeGraphConnections();
bool checkSourceAndSink(std::string source_component,
std::string producer_port,
std::string sink_component,
std::string consumer_port);
};
}
#endif //TRAACT_INCLUDE_TRAACT_PATTERN_SPATIAL_INSTANTIATEDGRAPH_H_
|
<filename>mage/src/main/java/mil/nga/giat/mage/sdk/fetch/StaticFeatureServerFetch.java
package mil.nga.giat.mage.sdk.fetch;
import android.content.Context;
import android.util.Log;
import com.google.common.io.ByteStreams;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import mil.nga.giat.mage.sdk.connectivity.ConnectivityUtility;
import mil.nga.giat.mage.sdk.datastore.layer.Layer;
import mil.nga.giat.mage.sdk.datastore.layer.LayerHelper;
import mil.nga.giat.mage.sdk.datastore.staticfeature.StaticFeature;
import mil.nga.giat.mage.sdk.datastore.staticfeature.StaticFeatureHelper;
import mil.nga.giat.mage.sdk.datastore.staticfeature.StaticFeatureProperty;
import mil.nga.giat.mage.sdk.datastore.user.Event;
import mil.nga.giat.mage.sdk.datastore.user.EventHelper;
import mil.nga.giat.mage.sdk.exceptions.StaticFeatureException;
import mil.nga.giat.mage.sdk.http.resource.LayerResource;
public class StaticFeatureServerFetch extends AbstractServerFetch {
public interface OnStaticLayersListener {
void onStaticLayersLoaded(Collection<Layer> layers);
}
private final LayerResource layerResource;
public StaticFeatureServerFetch(Context context) {
super(context);
layerResource = new LayerResource(context);
}
private static final String LOG_NAME = StaticFeatureServerFetch.class.getName();
private static final String FEATURE_TYPE = "Feature";
private Boolean isCanceled = Boolean.FALSE;
// TODO test that icons are pulled correctly
public List<Layer> fetch(boolean deleteLocal, OnStaticLayersListener listener) {
List<Layer> newLayers = new ArrayList<>();
// if you are disconnect, skip this
if (!ConnectivityUtility.isOnline(mContext)) {
Log.d(LOG_NAME, "Disconnected, not pulling static layers.");
return newLayers;
}
Event event = EventHelper.getInstance(mContext).getCurrentEvent();
Log.d(LOG_NAME, "Pulling static layers for event " + event.getName());
try {
LayerHelper layerHelper = LayerHelper.getInstance(mContext);
if (deleteLocal) {
layerHelper.deleteAll(FEATURE_TYPE);
}
Collection<Layer> remoteLayers = layerResource.getLayers(event);
// get local layers
Collection<Layer> localLayers = layerHelper.readAll(FEATURE_TYPE);
Map<String, Layer> remoteIdToLayer = new HashMap<>(localLayers.size());
Iterator<Layer> it = localLayers.iterator();
while(it.hasNext()) {
Layer localLayer = it.next();
//See if the layer has been deleted on the server
if(!remoteLayers.contains(localLayer)){
it.remove();
layerHelper.delete(localLayer.getId());
}else{
remoteIdToLayer.put(localLayer.getRemoteId(), localLayer);
}
}
for (Layer remoteLayer : remoteLayers) {
remoteLayer.setEvent(event);
if (!localLayers.contains(remoteLayer)) {
layerHelper.create(remoteLayer);
} else {
Layer localLayer = remoteIdToLayer.get(remoteLayer.getRemoteId());
if(!remoteLayer.getEvent().equals(localLayer.getEvent())) {
layerHelper.delete(localLayer.getId());
layerHelper.create(remoteLayer);
}
}
}
newLayers.addAll(layerHelper.readAll(FEATURE_TYPE));
if (listener != null) {
listener.onStaticLayersLoaded(newLayers);
}
} catch (Exception e) {
Log.e(LOG_NAME, "Problem creating layers.", e);
}
return newLayers;
}
public void load(OnStaticLayersListener listener, Layer layer) {
// if you are disconnect, skip this
if (!ConnectivityUtility.isOnline(mContext)) {
Log.d(LOG_NAME, "Disconnected, not loading static features.");
return;
}
try {
if (!layer.isLoaded()) {
StaticFeatureHelper staticFeatureHelper = StaticFeatureHelper.getInstance(mContext);
try {
try {
layer.setDownloadId(1l);
LayerHelper.getInstance(mContext).update(layer);
} catch (Exception e) {
throw new StaticFeatureException("Unable to update the layer to loaded: " + layer.getName());
}
Log.i(LOG_NAME, "Loading static features for layer " + layer.getName() + ".");
Collection<StaticFeature> staticFeatures = layerResource.getFeatures(layer);
// Pull down the icons
Collection<String> failedIconUrls = new ArrayList<>();
for (StaticFeature staticFeature : staticFeatures) {
StaticFeatureProperty property = staticFeature.getPropertiesMap().get("styleiconstyleiconhref");
if (property != null) {
String iconUrlString = property.getValue();
if (failedIconUrls.contains(iconUrlString)) {
continue;
}
if (iconUrlString != null) {
File iconFile = null;
try {
URL iconUrl = new URL(iconUrlString);
String filename = iconUrl.getFile();
// remove leading /
if (filename != null) {
filename = filename.trim();
while (filename.startsWith("/")) {
filename = filename.substring(1);
}
}
iconFile = new File(mContext.getFilesDir() + "/icons/staticfeatures", filename);
if (!iconFile.exists()) {
iconFile.getParentFile().mkdirs();
iconFile.createNewFile();
InputStream inputStream = layerResource.getFeatureIcon(iconUrlString);
if (inputStream != null) {
ByteStreams.copy(inputStream, new FileOutputStream(iconFile));
staticFeature.setLocalPath(iconFile.getAbsolutePath());
}
} else {
staticFeature.setLocalPath(iconFile.getAbsolutePath());
}
} catch (Exception e) {
// this block should never flow exceptions up! Log for now.
Log.w(LOG_NAME, "Could not get icon.", e);
failedIconUrls.add(iconUrlString);
if (iconFile != null && iconFile.exists()) {
iconFile.delete();
}
}
}
}
}
layer = staticFeatureHelper.createAll(staticFeatures, layer);
try {
layer.setLoaded(true);
layer.setDownloadId(null);
LayerHelper.getInstance(mContext).update(layer);
} catch (Exception e) {
throw new StaticFeatureException("Unable to update the layer to loaded: " + layer.getName());
}
Log.i(LOG_NAME, "Loaded static features for layer " + layer.getName());
if(listener != null){
List<Layer> layers = new ArrayList<>(1);
layers.add(layer);
listener.onStaticLayersLoaded(layers);
}
} catch (StaticFeatureException e) {
Log.e(LOG_NAME, "Problem creating static features.", e);
}
}
} catch (Exception e) {
Log.e(LOG_NAME, "Problem loading layers.", e);
}
}
public void destroy() {
isCanceled = true;
}
}
|
While in Wolfsburg, we managed to talk to Prof. Ulrich Hackenberg, who will go back to Audi from Volkswagen as Head Of Development next Monday. But on Wednesday, still as a VW Executive Vice President, he confirmed that a cheap Volkswagen is coming.
The Volkswagen brand is doing very well in the biggest emerging market, China. But in other parts of Asia, the Germans don't have the right tool against Toyota's or Suzuki's high-selling budget cars. They plan on changing that in the next few years. Let's hope they find a good name for it.
Hackenberg couldn't go into details as the project is at the designing phase at the moment, but once ready, it's easy to imagine such a car to appear anywhere from India (next to Škodas) to Indonesia. With Nissan reintroducing Datsun for similar reasons on the 15th of July in New Delhi, the game is on.
Just don't expect it to come to the U.S.
|
California Code of Civil Procedure
The California Code of Civil Procedure (commonly abbreviated to Code Civ. Proc. in formal legal citations or just CCP in treatises and other less formal contexts) was enacted by the California State Legislature in March 1872 as the general codification of the law of civil procedure in the U.S. state of California, along with the three other original California Codes. It contains most California statutes that govern the filing and litigation of lawsuits in the Superior Courts of California, as well as legal notices that must be given in a variety of circumstances. It also includes statutes of limitations that control the period of time during which a lawsuit must be commenced. It also contained some statutes governing the legal profession, but those were later relocated into the Business and Professions Code.
Originally, the CCP was the codification of the Practice Act of 1851, as amended and revised. In turn, the Practice Act had been modeled after the New York Code of Civil Procedure of 1850, which was largely drafted by the law reformer David Dudley Field II. Hence, California is considered to be a "Field Code" state.
The CCP also partially codified the law of evidence, but in 1965, the evidentiary provisions were repealed and replaced by the new California Evidence Code, which unlike the CCP, was deliberately intended to displace and supersede the common law of evidence.
Like the 28 other California Codes, the CCP is frequently amended by the Legislature. Unlike most other states, California never followed the federal trend towards transferring authority over procedural law to the courts through statutes like the federal Rules Enabling Act. Instead, the California Rules of Court (CRC) cover only relatively minor matters such as the formatting of court papers and case management rules implementing the Trial Court Delay Reduction Act of 1986.
Nearly all important procedural provisions (i.e., the ones that can make or break a case) continue to exist in the form of CCP sections. As a result, whenever the Judicial Council of California identifies a major defect in California civil procedure, it cannot fix it by promulgating a new court rule, but must instead lobby the Legislature and Governor to amend the CCP.
Today, the CCP is comprehensive only with regard to trial court procedure. As a result of a bill pushed through the Legislature at the suggestion of Chief Justice Phil S. Gibson in 1941, appellate procedure in California is governed primarily by the CRC.
As a Field Code state, California continues to subscribe to the "primary right" or "ultimate fact" theory of pleading (also known as "fact pleading") which has been traditionally followed by Field Code states. This means that California adheres to an arcane distinction between what constitutes pleading of a mere "fact," versus an "ultimate fact," versus a "conclusion of law." Also, California is one of two states, along with Virginia, which uses the demurrer as the primary pre-answer attack on the complaint. Most states and the federal courts have switched to modern "notice pleading" and use the motion to dismiss for failure to state a cause of action instead of the demurrer.
|
Genome-wide reprogramming of metabolism and regulatory networks of Arabidopsis in response to phosphorus. Affymetrix ATH1 arrays, large-scale real-time reverse transcription PCR of approximately 2200 transcription factor genes and other gene families, and analyses of metabolites and enzyme activities were used to investigate the response of Arabidopsis to phosphate (Pi) deprivation and re-supply. Transcript data were analysed with MapMan software to identify coordinated, system-wide changes in metabolism and other cellular processes. Phosphorus (P) deprivation led to induction or repression of > 1000 genes involved in many processes. A subset, including the induction of genes involved in P uptake, the mobilization of organic Pi, the conversion of phosphorylated glycolytic intermediates to carbohydrates and organic acids, the replacement of P-containing phospholipids with galactolipids and the repression of genes involved in nucleotide/nucleic acid synthesis, was reversed within 3 h after Pi re-supply. Analyses of 22 enzyme activities revealed that changes in transcript levels often, but not always, led to changes in the activities of the encoded enzymes in P-deprived plants. Analyses of metabolites confirmed that P deprivation leads to a shift towards the accumulation of carbohydrates, organic acids and amino acids, and that Pi re-supply leads to use of the latter. P-deprived plants also showed large changes in the expression of many genes involved in, for example, secondary metabolism and photosynthesis. These changes were not reversed rapidly upon Pi re-supply and were probably secondary in origin. Differentially expressed and highly P-specific putative regulator genes were identified that presumably play central roles in coordinating the complex responses of plants to changes in P nutrition. The specific responses to Pi differ markedly from those found for nitrate, whereas the long-term responses during P and N deprivation share common and non-specific features.
|
<filename>internal/libraries/db/library.go
// This file is part of libraries-repository-engine.
//
// Copyright 2021 ARDUINO SA (http://www.arduino.cc/)
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published
// by the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//
// You can be released from the requirements of the above licenses by purchasing
// a commercial license. Buying such a license is mandatory if you want to
// modify or otherwise use the software for commercial activities involving the
// Arduino software without disclosing the source code of your own applications.
// To purchase a commercial license, send an email to <EMAIL>.
package db
import (
"fmt"
"regexp"
"strings"
"github.com/arduino/libraries-repository-engine/internal/libraries/metadata"
)
// FromLibraryToRelease extract a Release from LibraryMetadata. LibraryMetadata must be
// validated before running this function.
func FromLibraryToRelease(library *metadata.LibraryMetadata) *Release {
deps, _ := ExtractDependenciesList(library.Depends)
dbRelease := Release{
LibraryName: library.Name,
Version: VersionFromString(library.Version),
Author: library.Author,
Maintainer: library.Maintainer,
License: library.License,
Sentence: library.Sentence,
Paragraph: library.Paragraph,
Website: library.URL, // TODO: Rename "url" field to "website" in library.properties
Category: library.Category,
Architectures: extractStringList(library.Architectures),
Types: library.Types,
Includes: extractStringList(library.Includes),
Dependencies: deps,
}
return &dbRelease
}
func extractStringList(value string) []string {
split := strings.Split(value, ",")
res := []string{}
for _, s := range split {
s := strings.TrimSpace(s)
if s != "" {
res = append(res, s)
}
}
return res
}
var re = regexp.MustCompile("^([a-zA-Z0-9](?:[a-zA-Z0-9._\\- ]*[a-zA-Z0-9])?) *(?: \\(([^()]*)\\))?$")
// ExtractDependenciesList extracts dependencies from the "depends" field of library.properties
func ExtractDependenciesList(depends string) ([]*Dependency, error) {
deps := []*Dependency{}
depends = strings.TrimSpace(depends)
if depends == "" {
return deps, nil
}
for _, dep := range strings.Split(depends, ",") {
dep = strings.TrimSpace(dep)
if dep == "" {
return nil, fmt.Errorf("invalid dep: %s", dep)
}
matches := re.FindAllStringSubmatch(dep, -1)
if matches == nil {
return nil, fmt.Errorf("invalid dep: %s", dep)
}
deps = append(deps, &Dependency{
Name: matches[0][1],
Version: matches[0][2],
})
}
return deps, nil
}
|
Experimental Study on Initial Damage Point of Deep Granite under Step Cyclic Loading Method In deep engineering, the initial damage point of host rock has become an important concern. Nowadays, there are many methods which can work out the initial damage point. However, each existing method introduces some significant subjective or parametric errors. In this paper, a new determination method of initial damage point employing step cyclic loading tests was designed and a series of tests were conducted on deep granite. After analyzing the peak strength and effect of cyclic loading, the turning point of initial damage was confirmed. *e testing results show that the turning stress of initial damage was about 45% peak strength and will present a little decrease with the confining pressure increasing. *ese calculated damage points are much more scientific, accurate, and intuitive, which provides a new method for the study on rock mechanics in deep mining. Introduction For rock-based engineering projects, the damage characteristic of rocks is quite important. Furthermore, attentions must be paid to the initial damage point of rocks in these rock engineering projects, such as high-level radioactive wastes (HLW) disposal, hydropower stations, subways, soft-rock engineering, deep-buried tunnels, and mining engineering, to name a few. In general, the damage point is an inherent property of rock under single loading, independent of loading conditions. is point marks the beginning of rock damage, indicating subsequent crack formation and propagation, and is of great practical significance. An increasing number of scholars have examined the damage point of rocks using laboratory tests. Brace et al. monitored the volume variation of rock specimens. ey thought that when rock was damaged, its volumetric strain would present nonlinear volume expansion, instead of linear development. us, the end point of linear volumetric strain is regarded as the damage point of rocks, and the solution process is shown in Figure 1(a). is method expresses clear physical meaning and convenient application, but the results are deeply influenced by the coordinate scale and discrete data. Taking the volumetric strain in Figure 1(a) as example, it is difficult to determine the No. 1 point, or the No. 2 point is the target point in the partial enlarged Figure 1(b). e confirmation of end point is subjective and arbitrariness. Lajtai thought that the nonlinear lateral strain meant cracks expansion, so he took the beginning point of nonlinear growth in the axial stress-lateral strain curve as damage point (as shown in Figure 2(a)). Compared with the method proposed by Brace, the lateral strain method is much easier and more intuitive. However, it is undeniable that the lateral strain method also has some subjective factors and errors, and the same problem will affect the accuracy of the result. As the enlarged crack volumetric curve shown in Figure 2(b), there will also be some deviations in the determination results under different data curve scales, the initial damage point can be confirmed as point 1, and the other damage point can be selected as point 3 in Figure 2(b). Martin and Chandler conducted a large number of triaxial compression tests on granite samples from mine-by tunnel in Canada. By summarizing the strength relationship of granite samples, they proposed that the stress when the crack volume strain is not zero at first could be treated as the damage point. e accuracy of calculation through this method is largely dependent on the accuracy of elastic modulus and Poisson's ratio of rock, and there are still errors in the calculation of elastic modulus and Poisson's ratio, which also makes this method highly subjective. Studies show that the failure process of rocks is accompanied by the release of acoustic emission (AE) signals. rough monitoring the AE signal strength, the damage process of rocks can be visually obtained. erefore, various studies on rock stress are carried out by acoustic emission monitoring. Eberhardt et al. identified the crack initiation and propagation thresholds in brittle rock by AE monitoring; Ganne and Vervoort confirmed the effect of stress path on pre-peak damage with AE method; Nejati and Ghazvinian studied the brittleness effect during rock fatigue damage process by employing AE equipment; Kim et al. carried out a comparative evaluation of stress-strain and AE methods for quantitative damage assessments of brittle; Zhao et al. analyzed the rock damage characteristics based on the AE monitoring data. It is assumed that the first AE count mutation corresponds to the damage point of rock. AE techniques provide scientific method for exploring rock fracture process, but this method still has subjective errors, noise interference, and absence of theoretical basis. e initial AE records during loading can be related to the setting of loading platens on the specimen, machine displacement, instrument vibration, and other influence factors. It is difficult to determine which AE count is the correct index which corresponds to the damage point of rock. In order to avoid the shortage of the above methods, a new step cyclic loading test was designed. Some scholars have conducted experiments on rocks under cyclic loading. Yang et al. studied the mechanical property of sandstone post-peak under the cyclic loading and unloading; Zhang et al. carried out the lab tests on damage characteristics of sandstone subjected to pre-peak and postpeak cyclic loading; Munoz and Taheri analyzed the post-peak deformability parameters of rocks under cyclic loading. ese studies can provide good experimental ideas and schemes for reference. In this paper, taking advantage of MTS815 rock experimental equipment, the step cyclic loading tests with increasing stress were conducted on deep granite from Sanshandao Gold Mine, China. And, a more accurate initial damage point under confining pressures of 10 MPa, 20 MPa, and 30 MPa was confirmed. e calculated initial damage points are much more scientific and intuitive, which provides a new method for the study on rock mechanics in deep mining engineering. Granite Samples and Basic Parameters. In the tests, the rock specimen is granite, drilled from -895 level of Sanshandao Gold Mine (Shandong Province, China), with the mineral composition of quartz, anorthose, biotite, and alkali feldspar. e density of rock samples is 2.72 g/cm 3, and the porosity is 0.59%. All the rock samples were cut from a whole block rockmass without any obvious cracks. According to the proposed approach of ISRM, the allowed deviation of roughness at the two ends for the specimen is ±0.05 mm, and the allowed perpendicularity deviation is ±0.25°. In the tests, 36 standard rock samples with 50 mm diameter and 100 mm height were acquired, as shown in Figure 3. Experimental Installation. In the step cyclic loading tests, the MTS 815 testing system was adopted, as shown in Figure 4. For this MTS 815 testing system, the maximum axial loading can reach 2700 kN, and the maximum confining pressure is 140 MPa. e strain of rock samples could be monitored by the axial and lateral extensometers, with the largest testing ranges of 5 mm and 8 mm in axial and lateral direction, respectively. And, during the loading process, to avoid the effect of hydraulic oil, the heat shrinkable tube was employed to encircle the granite sample. At the same time, the lubricant was spread on the two ends of samples to decrease the ends' effect. Experimental Design. Firstly, to obtain the basic strength and other mechanical parameters of granite, a set of triaxial compressive tests with different confining pressures (10 MPa, 20 MPa, and 30 MPa) were carried out. During the tests, the AE event will be monitored by AE instrument, and the key parameters of AE instrument related to the measurement are shown in Table 1. e obtained stress thresholds can be conducted for the comparative analysis with next ascending step cyclic loading testing results. e testing programs are as follows: apply the confining pressure to the design value, with the loading rate of 0.25 MPa/s; next, apply axial loading until the granite specimen is completely damaged; the axial loading is controlled by deformation at 0.024 mm/min. e stress and strain data were recorded during the whole testing process. e testing results are listed in Table 2. Secondly, to evaluate the effect degree of cyclic loading on the rock strength and to confirm the initial value of next ascending step cyclic loading tests, two kinds of cyclic loading tests up to 20% peak strength and 40% peak strength were implemented. A large number of studies showed that the ratio of crack initiation stress to peak stress is about or a little bigger than 40% peak strength, so the 40% cyclic loading tests could give an approximate threshold of ascending step cyclic loading tests. For the 20% cyclic loading test, its results can verify whether specimens in 40% cyclic loading test are always in the elastic stage. e testing programs are as follows: apply the confining pressure to design value, with the loading rate of 0.25 MPa/s; apply axial loading to a certain value (about 20% P or 40% P ) with the loading rate of 0.5 kN/s; unload to 2 MPa at the same rate (0.5 kN/s); repeat the above cyclic steps 5 times for one sample and record the stress and strain data during the whole testing process. e loading process is shown in Figure 5(a). e testing data is listed in Table 3. irdly, based on the above confirmed initial range of the elastic stage, the ascending step cyclic loading tests were conducted, to determine the accurate initial damage point of deep granite. In the increasing process of loading, if the ending point of two cyclic curves is different, it is considered that the samples are damaged. e detailed testing program is as follows: apply the confining pressure to design value, with the loading rate of 0.25 MPa/s; apply axial loading from about 40% P, with the loading rate of 0.5 kN/s; unload to 2 MPa at the same rate (0.5 kN/s); repeat this cyclic loading process with ascending axial loading (about 42%, 44%, 46% P......, respectively), as shown in Figure 5(b); in this cyclic process, monitor the stress and strain data; if the end point of two cyclic process are different, apply axial loading with 0.024 mm/min, until the granite specimen is completely damaged. e detailed testing data is listed in Table 4. Testing Results and Data Analysis After the triaxial compression tests under three confining pressures (10 MPa, 20 MPa, and 30 MPa), the stress-strain curves are shown in Figure 6. e triaxial compression strength of deep granite samples can be acquired from Figure 6. e detailed values are shown in Table 2. And, the typical corresponding AE data was shown in Figure 7. After data analyzing, the initial crack stress thresholds are 153 MPa, 186 MPa, and 215 MPa for the confining pressure of 10 MPa, 20 MPa, and 30 MPa, respectively. In addition, by analyzing the stress-strain curves, the elasticity modulus can also be calculated following the method in Figure 8. Here, the elasticity modulus values are 73.06 GPa, 76.35 GPa, and 78.94 GPa, respectively, with computational formula in the ISRM suggestion method : where E is the elasticity modulus, l begin and l end are the beginning and ending values of stress in linear stress-strain curve segment, and l begin and l end are the beginning and ending values of strain in linear stress-strain curve segment. e triaxial compressive tests provide basic mechanical parameters of granite samples. Following the testing program in Table 3 and Figure 5(a), 6 groups of loading and Advances in Civil Engineering unloading tests with 20% P and 40% P fixed values and 10 MPa, 20 MPa, and 30 MPa confining pressures were carried out. Here, the typical stress-strain curves are drawn in Figure 9. As exhibited in Figure 9, after 5 times loading and unloading process cycles, for all testing conditions, the unloading curves all show good overlap, which means there is not any fatigue damage after 5 cycles, and the whole testing processes are all under elastic status. It also indicates that the initial damage point of granite must occur over 40% P. ese tests' results give guidance for the next ascending step cyclic tests. After confirming the approximate range of initial damage point, 3 groups ascending cyclic loading tests were carried out, with loading conditions over 40% P. After the test, the stress and strain curves of step cyclic loading tests with different confining pressure could be obtained. Taking 10 MPa confining pressure testing data as example, the data processing step is shown in Figure 10. As shown in Figure 10, based on the testing data, the step cyclic loading curve of stress and strain could be fitted and is shown in Figure 10(a). During the step cyclic loading tests, if the two unloading curves begin to separate, meaning that the input energy supplied by MTS 815 testing system is consumed by the rock samples, it can be assumed that the granite sample begins to enter damage status from this stress. So, the unloading curve which begins to separate was the target unloading curve (the pink curve in Figure 10(b)); also, the corresponding loading curve could be found (the red curve in Figure 10(c)). To acquire accurate damage threshold, the key segment data of target loading curve was obtained and fitted separately, as shown in Figure 10(d). In Figure 10(d), since the rock sample began to damage, the stress-strain curve would no longer be linear; there would be a turning point, which is the initial damage point. Under 10 MPa confining pressure, the turning point appears at 147 MPa stress value. Other stress-strain curves with 20 MPa and 30 MPa confining pressure are illustrated in Figures 11(a) and 11(b), respectively. Figure 6). e slight errors maybe produced by the instrument, testing process, or different granite samples. ese good verified results also testify that the cyclic loading process produce no effect on the strength characteristics of granite. After calculation with the method shown in Figure 10, the initial damage stress thresholds confirmed by cyclic tests are shown in Table 5. Discussion e initial damage points confirmed by the step cyclic loading method show that the turning stress of initial damage is about 45% peak strength on average. It is similar to the crack initiation thresholds for shale by Li et al. and Beishan granite by Zhao et al confirmed by the AE Advances in Civil Engineering testing method. And, the testing result in this paper presents a little decrease with the increasing of confining pressure. To verify and analyze the step cyclic testing data, the AE testing results are also listed in Table 5. As shown in Table 5, the stress values determined by two testing methods (initial damage stress by cyclic test and initial crack stress by the AE method) are not far apart under the same confining pressure, and the percentage of difference is below 5%. However, the results confirmed by cyclic loading tests have much clearer physical meaning and less error of the combination of two instruments. erefore, the cyclic testing method has more credibility than the AE monitoring method. Conclusions e initial damage point of rock is an important parameter in rock-based engineering. In this paper, by employing a series of scientific laboratory tests, a much more accurate and intuitive initial damage point of deep granite from Sanshandao Gold Mine was confirmed, which provides a new method and scientific data for the study on rock mechanics in deep mining. rough triaxial compression tests, the peak strength, elasticity modulus, and other basic mechanical parameters of granite samples were acquired. On this basis, cyclic loading tests with 20% peak strength and 40% peak strength were carried out. Results show that, under these stress conditions, all the specimens are under elastic status, and the initial damage point of granite must occur over 40% P. Finally, taking advantage of ascending step cyclic loading tests, the accurate initial damage points of deep granite were acquired. e exact values are 47.2% P for 10 MPa, 44.4% P for 20 MPa, and 43.8% P for 30 MPa, respectively. e testing results show that the turning stress of initial damage is about 45% peak strength on average, and it presents a little decrease with the increasing of confining pressure. Data Availability All data used to support the findings of this study are available from the corresponding author upon request. Conflicts of Interest e authors declare that they have no conflicts of interest. Advances in Civil Engineering 9
|
<gh_stars>1-10
// EVMC: Ethereum Client-VM Connector API.
// Copyright 2018 <NAME>.
// Licensed under the MIT License. See the LICENSE file.
package evmc
import (
"os"
"testing"
)
func TestLoad(t *testing.T) {
i, err := Load(os.Getenv("EVMC_PATH"))
if err != nil {
t.Fatal(err.Error())
}
defer i.Destroy()
if i.Name() != "interpreter" {
t.Fatal("name is not 'interpreter'")
}
if i.Version()[0] != '1' {
t.Fatalf("version is %s", i.Version())
}
}
|
Raman Gray Molasses Cooling of Cesium Atoms on the D2 Line We present a systematic study on the Raman gray molasses cooling (RGMC) of cesium atoms on the $D_2$ transition. Due to the large splitting in the excited hyperfine transitions of cesium $D_2$ line, it is relatively simple to implement the RGMC with suitable frequency control on the trapping and repumping lasers of the magneto-optical trap (MOT). We have achieved an atom temperature of 1.7$\pm$0.2 $\mu$K after the RGMC with $3.2\times 10^8$ atoms. The phase space density is $1.43\times 10^{-4}$. Compared to the condition with a bare MOT or the MOT with a standard polarization gradient cooling, the phase space density increases by a factor of more than $10^3$ or $10$, respectively. We present a systematic study on the Raman gray molasses cooling (RGMC) of cesium atoms on the D2 transition. Due to the large splitting in the excited hyperfine transitions of cesium D2 line, it is relatively simple to implement the RGMC with suitable frequency control on the trapping and repumping lasers of the magneto-optical trap (MOT). We have achieved an atom temperature of 1.7±0.2 K after the RGMC with 3.2 10 8 atoms. The phase space density is 1.43 10 −4. Compared to the condition with a bare MOT or the MOT with a standard polarization gradient cooling, the phase space density increases by a factor of more than 10 3 or 10, respectively. I. INTRODUCTION Laser cooling and trapping of atoms in magneto-optical traps and optical molasses, developed around the 1980s, has become a starting point for experiments on quantum optics and quantum many-body physics. The sub-Doppler cooling based on the polarization gradients and optical pumping among Zeeman sublevels in optical molasses with a red-detuned cooling laser driving the F → F = F + 1 cycling transition leads to an atom temperature below the Doppler temperature limit. Around the middle 1990s, a variant sub-Doppler cooling mechanism was proposed and demonstrated in which a blue-detuned cooling laser driving the F → F = F or F → F = F − 1 open transition is used. Because atoms can be optically pumped to Zeeman dark states with a significantly reduced fluorescence rate once they are cold, this cooling method is also called "gray molasses cooling" (GMC) while the cooling with a cycling transition is called "bright molasses cooling"(BMC). The GMC allows one to achieve an even colder temperature and a higher atom density compared to the BMC. With either of the sub-Doppler cooling methods, it is advantageous to increase the phase space density of atoms when loading them to either magnetic traps or optical dipole traps for evaporative cooling to quantum degeneracy. It is usually considered that sub-Doppler cooling could be ineffective for the D 2 transition of lithium and potassium, especially their bosonic isotopes, due to the narrow excited-state structure. However, more careful studies show that one can achieve the sub-Doppler temperature by sophisticated dynamic control of the intensity and detuning of the cooling and repumping lasers, and 87 Rb. In most of the works with Li, K and Na, the RGMC were implemented with the D 1 or the D 2 transition which have well-separated hyperfine spacing. Thanks to the large hyperfine splitting in the D 2 transition of 87 Rb and 133 Cs, the RGMC could be easily implemented based on the trapping and repumping lasers with suitable frequency control. Although there are other cooling schemes, such as degenerate Raman sideband cooling that allows one to cool atoms to sub-K temperature, they require more lasers and a relatively complicated setup. RGMC provides a simple and effective way to increase the phase space density of the atoms, which facilitates the loading into optical dipole traps for further cooling to quantum degeneracies. In this paper, we report the RGMC of 133 Cs to 1.7±0.2 K with a capture efficiency of >80 % with an initial atom number of 3.710 8. This brings a closure of the demonstration of RGMC for stable alkali species. Table I gives a summary of the alkali species and isotopes that RGMC have been implemented. The theoretical aspect of RGMC has been studied in. With the one-dimensional model in a -type three-level system, one can calculate the friction coefficient and the photon scattering rate based on the optical Bloch equation under certain approximations. A narrow dispersive feature in the friction coefficient around the Raman resonance condition appears with the red(blue)-detuned side of the two-photon detuning favoring the cooling (heating) force in the case of one-photon blue-detuned for both lasers. The photon scattering rate reaches a minimum at the exact Raman resonance and rises sharply in the blue-detuned side but relative slowly in the red-detuned side. The equilibrium temperature is determined by both the friction coefficient and the photon scattering rate. The degree of Raman coherence of the dark state directly affects the minimum photon scattering rate and thus the atom temperature. As the dark state physics, the mutual laser coherence, the magnetic field, and its inhomogeneity...etc may affect the Raman coherence. These parameters should be well controlled in order to reach a low atom temperature. We detail our experimental setup in Sec. II and present the results and discussions in Sec. III, followed by a conclusion. II. EXPERIMENTAL SETUP Our cesium magneto-optical trap (MOT) is implemented in a glass cell with six independent trapping and repumping beams. Typically, we have ∼20 and ∼12 mW per beam for the trapping and repumping light, respectively. The power of the trapping and repumping beams can be tuned by controlling the driving radio-frequency (rf) power of the acousto-optic modulator (AOM) through a voltage-controlled attenuator. The diameters of the trapping and repumping beams are ∼23 mm. Two cesium dispensers are put close to the MOT region and operated with a current of ∼3 A. Typically, we trap ∼ 4 10 8 atoms in the MOT. A master laser is locked to the crossover of the |F = 4 → |F = 4 and |F = 4 → |F = 5 transitions of cesium D 2 line. Part of its light passes through a fiber electro-optic modulator (EOM 1) with the +1 order sideband injection locking an intermediate laser (IL1). Part of the light of IL1 passes through an AOM in a double pass configuration then seeds a tampered amplifier. The output of the amplifier passes one AOM and then coupled into a 2 by 6 fiber beam splitter (OZ Optics NEW FUSED-26-850-5/125-16.7-3S-3-2-PM-SF) to act as the repumping light. The frequency of the repumping light is on the resonance of |F = 3 → |F = 4 transition under the normal MOT operation. During the RGMC stage, the frequency of the repumping light jumps to the blue side of the |F = 3 → |F = 4 transition and acts as the cooling laser for RGMC by controlling the driving frequency of the double-passed AOM. We keep the driving frequency of the EOM 1 fixed although it allows a larger frequency tuning range. This is because that part of the light from EOM 1 is also used for another MOT system in the laboratory and both systems are under operation simultaneously. Another part of the IL1 passes through another fiber-EOM (EOM 2) with its -1 order sideband injection locking one intermediate laser (IL2). The light of IL2 seeds another tampered amplifier. The output of this amplifier passes one AOM and then couples into the 2 by 6 fiber splitter to act as the trapping light. The frequency of the trapping light can be switched to the blue side of the |F = 4 → |F = 4, whose detuning w.r.t. this transition is denoted as ∆, by changing the driving frequency of fiber EOM 2. It acts as the coupling light for RGMC. The two-photon detuning for the RGMC cooling relative to the coupling light is denoted as, as shown in Fig.2(a). Three pairs of coils are used to compensate the stray magnetic fields. We use the microwave spectroscopy to diagnose the magnitude of the magnetic field and calibrate the magnetic field per current for each pair of compensation coils. Based on these, it is relatively easy to nullify the stray magnetic field to a few mG level, which is crucial to reach a low atom temperature by RGMC. This is not surprising since minimizing the stray magnetic field effectively reduces the ground-state decoherence rate of the dark states and thus the fluorescence and heating rate. Our timing diagram is shown in Fig. 2(b). The experiment runs at a repetition rate of 7.5 Hz. At the end of MOT loading period, the current for the MOT quadrupole magnetic field is turned off within 200 s. One ms after turning off the quadrupole magnetic field, the frequency of the trapping laser jumps to the detuning for RGMC, which is typically ∆ ≈ 4.73 unless specified. For a duration of 2 ms, we take advantage of the standard bright molasses cooling to pre-cool the atoms to ∼9 K before performing the RGMC. We also check the performance of RGMC directly from MOT without BMC in which the atom temperature is around 120 K. We find that the final atom temperatures after RGMC with and without the pre-cooling are almost the same. We choose the timing with the 2-ms pre-cooling in all data taking. Next, the repumping frequency is switched to the desired value for RGMC, remaining a constant for the following 4 ms. The intensities of both trapping and repumping beams are also reduced to varying values for studying their dependence on the performance of RGMC. The trapping and repumping light act as the role of coupling and cooling light during RGMC stage. We denote the intensities of RGMC coupling and cooling beam as I coup and I cool, respectively. In the following 1 ms, the RGMC cooling light is turned off and the population is optically pumped by RGMC coupling light to the F = 3 hyperfine ground state, which is the desired state for future experiment related to electromagnetically induced transparency. We then turn off all lasers for a certain flight time and fire the imaging beam which drives the |F = 3 → |F = 2 transition. From the absorption imaging we determine the twodimensional profile (referred as x and z, where z is the gravity direction) of the column density. To allow a quicker and more reliable fitting, we sum the column density along x and z-axis, respectively. The results are fitted to one-dimensional Gaussian function to get the e −1 width in each axis ( i, i=x, z). Based on the fit width and amplitude, we obtain the atom number using an absorption cross-section of 5 21 3 2 2 assuming a uniform population in Zeeman sublevels and with a linearly-polarized image beam, where = 852.35 nm is the wavelength of the D 2 transition. The atom temperature can be determined by fitting the e −1 width of atomic clouds versus different flight times with the formula, The maximum flight time can be up to 36 ms for a temperature of ∼2 K. The position shift of the atoms due to gravitational free-fall motion is used to measure the magnification ratio of the imaging system, allowing an accurate determination of the atom temperature. Our atomic clouds are in elliptical shape with the width x 2-3 times larger than z. The fitting result of T x is not as reliable as T z since it needs even longer flight times to allow a sufficient expansion in cloud size. But the images at longer flight times are limited by the size of the CCD chip. The atom temperatures shown in all figures are T z. III. RESULTS AND DISCUSSIONS We have performed a systematic study on the atom number and temperature dependence on various parameters during the Raman gray molasses cooling. A. Cooling time dependence We first study the atom number and temperature dependence versus the RGMC time at a zero two-photon detuning and a one-photon detuning ∆ of 5.73, as shown in Fig.2. During RGMC, the one-beam coupling and cooling intensities (I coup and I cool ) are 0.273 and 0.022 I sat, respectively, where I sat = 1.10 mW/cm 2 is the saturation intensity of cesium D 2 transition. Prior the RGMC, the atoms have been cooled to 8.4 K by the bright molasses cooling for 2 ms. With a RGMC time of >∼2 ms, both atom temperature and number reach a steady-state value. We observed a ∼ 28% reduction in atom number and a fourfold reduction in temperature at the steady state. Because we decrease the laser power suddenly to a lower value, the cooling force also decreases significantly and is not sufficient to capture atoms with larger velocities. This causes some atom losses during the molasses stage. This atom loss could be avoided if one gradually decreases the laser power, although we did not implement it in this work. In all of the following studies, we choose an RGMC duration of 4 ms. B. Magnetic field dependence Because RGMC utilizes the dark state, it is expected that the ground-state decoherence rate plays an important role in the cooling performance. During the cooling period, atoms may distribute among different Zeeman sublevels. Minimization of the stray magnetic field effectively reduces the distribution in Zeeman shifts and thus the ground-state decoherence rate. A smaller decoherence rate for the dark state results in a smaller fluorescence (heating) rate and thus a lower atom temperature. Fig. 3 depicts the atom number and temperature versus the magnetic field by controlling the current through one pair of the compensation coils. The atom temperature shows a quadratic dependence on the magnetic field as ∆T=532B 2 K/G 2. The stray magnetic field needed to be canceled to less than 14 mG in order to have a negligible increase (< 5%) in temperature. Another important factor that affects the decoherence rate of the dark state is the mutual coherence between the RGM coupling and cooling lasers. It has been studied that the laser mutual coherence significantly affect the minimum temperature. The minimum temperature achieved with the cooling and coupling lasers being injection-locked to the same master laser is much lower than that achieved with the two lasers independently locked. Since our RGMC cooling and coupling lasers are injection locked to the same master laser with frequency offsets determined by EOMs or AOMs driven by stable signal generators (stabilities < 10 −10 ), the laser mutual coherence should not be the major limitation in the minimum temperature. C. Intensity dependence At a one-photon detuning ∆ of 5.73 and a zero twophoton detuning, we vary the intensity of RGMC coupling beam (I coup ) while keeping the RGMC cooling beam intensity (I cool ) fixed at 0.023I sat (per beam) and measure the atom number and temperature dependence on the intensity ratio (I cool /I coup ). The results are shown in Fig. 4. We find an optimal intensity ratio (I cool /I coup ) around 0.1 where atom temperature reaches a minimum. We then keep the intensity ratio fixed at 0.08 and vary the power of both beams during the RGMC period. The atom number and temperature versus the RGMC cooling beam intensity are shown in Fig.5. It shows that atom temperature is monotonically proportional to laser intensity. The atom number reduces slightly for lower laser intensities. This is expected as atoms with larger velocities may leave the trap due to weaker trapping forces. detuning, as shown in Fig. 6. The lowest temperature of 1.7± 0.2 K appears at =0, which is a characteristic for Raman gray molasses cooling. At =0, the captured atom number is ∼ 80% of that before RGMC, which is 3.7 10 8. For blue detuning ( >0), the atom temperature rises sharply up to ∼100 K while the atom number drops slightly. The phase space density at the lowest temperature is 1.43 10 −4. Compared to the condition before RGMC, it increases by more than a factor of 10. Compared to the bare MOT without pre-cooling which has a temperature of 120 K, the phase space density increases by more than a factor of 1000. We then keep the two-photon detuning fixed at zero and measure the atom number and temperature dependence on the one-photon detuning ∆, as shown in Fig. 7. The temperatures decrease and reach an almost constant value as the ∆ increase. Limited by the frequency tuning range of the double-passed AOM, the maximum ∆ is 5.73. Similar behaviors were observed in many other works. As ∆ increase further, we expect the temperature will rise up at some point since the RGMC coupling laser may drive the |F = 4 → |F = 5 cycling transition significantly and degrade Raman coherence of the dark states due to spontaneous decay. IV. CONCLUSION In conclusion, we perform a systematic study on Raman gray molasses cooling of cesium with the D 2 line. The lowest atom temperature of 1.7±0.2 K is achieved. The RGMC provides a simple and effective way to increase the phase space density for further magnetic or optical dipole trap loading and evaporative cooling to-wards quantum degeneracy.
|
WITHDRAWN: Antibiotics for exacerbations of chronic obstructive pulmonary disease. BACKGROUND Most patients with an exacerbation of chronic obstructive pulmonary disease (COPD) are treated with antibiotics. However the value of their use remains uncertain. Some controlled trials of antibiotics have shown benefit (Berry 1960; Pines 1972) while others have not (Elmes 1965b; Nicotra 1982). OBJECTIVES To conduct a systematic review of the literature estimating the value of antibiotics in the management of acute COPD exacerbations. SEARCH STRATEGY We searched the Cochrane Central Register of Controlled Trials (CENTRAL) (The Cochrane Library, 2005, issue 4) which contains the Acute Respiratory Infections Group's Specialized Register; MEDLINE (1966 to December 2005); EMBASE (1974 to December 2005); Web of Science (December 2005), and other electronically available databases. SELECTION CRITERIA Randomised controlled trials (RCTs) in patients with acute COPD exacerbations comparing antibiotic (for a minimum of five days) and placebo. DATA COLLECTION AND ANALYSIS Data were analysed using Review Manager software. Continuous data were analysed using weighted mean differences (WMD) and 95% confidence intervals (CI). Relative risks (RR) (and 95% CI) were calculated for all dichotomous data. Where appropriate, number needed to treat to benefit (NNT) and 95% CI were calculated. MAIN RESULTS Eleven trials with 917 patients were included. Ten trials used increased cough, sputum volume and purulence diagnostic criteria for COPD exacerbation. Eight-hundred and fifty-seven patients provided data for outcomes including mortality, treatment failure, increased sputum volume, sputum purulence, PaCO, PaO, peak flow and adverse events. Antibiotic therapy regardless of antibiotic choice significantly reduced mortality (RR 0.23; 95% CI 0.10 to 0.52 with NNT of 8; 95% CI 6 to 17), treatment failure (RR 0.47; 95% CI 0.36 to 0.62 with NNT of 3; 95% CI 3 to 5) and sputum purulence (RR 0.56; 95% CI 0.41 to 0.77 with NNT of 8; 95% CI 6 to 17). There was a small increase in risk of diarrhoea with antibiotics (RR 2.86; 95% CI 1.06 to 7.76). Antibiotics did not improve arterial blood gases and peak flow. AUTHORS' CONCLUSIONS This review shows that in COPD exacerbations with increased cough and sputum purulence antibiotics, regardless of choice, reduce the risk of short-term mortality by 77%, decrease the risk of treatment failure by 53% and the risk of sputum purulence by 44%; with a small increase in the risk of diarrhoea. These results should be interpreted with caution due to the differences in patient selection, antibiotic choice, small number of included trials and lack of control for interventions that influence outcome, such as use of systemic corticosteroids and ventilatory support. Nevertheless, this review supports antibiotics for patients with COPD exacerbations with increased cough and sputum purulence who are moderately or severely ill.
|
<gh_stars>0
package gameengine.propertyimplementation;
import java.util.List;
import gameengine.party.PlayerStats;
import gameengine.properties.Fightable;
/**
* class that implements Fightable; disable the object's ability to fight
* @author Tara
*
*/
public class CannotFight extends Fight implements Fightable {
public CannotFight (List<Object> initialStats) {
super(initialStats);
}
@Override
public PlayerStats obtainPlayerStats() {
// do nothing
return null;
}
}
|
If you glanced at the front page of the Sunday Herald-Tribune, go back.
Take your time and read the first installment of “Breaking the Banks,” an investigative series by Anthony Cormier and Michael Braga that shows conclusively how top-level greed, arrogance and mismanagement led to many of Florida's recent bank failures.
The story is important. Plus there's more to come.
We've invested considerable time, resources and newsprint to publish this important series. The story will dominate the Herald-Tribune's front pages through Wednesday. You'll also find exclusive documents and profiles of all 68 failed banks in our searchable project website, www.HeraldTribune.com/breakingthebanks.
“Breaking the Banks” is no more an indictment against bankers than a plaid shirt worn with plaid shorts is a fashion statement. Anthony and Michael set out on a quest — to find out why so many Florida banks failed — and came back more than a year later with answers that should alarm the governor, lawmakers, prosecutors and, most importantly, taxpayers.
This project couldn't have happened without Florida's sunshine laws. Only transparency can correct transgressions.
In Raymond B. Vickers' book “Panic in Paradise: Florida's Banking Crash of 1926,” the Florida State historian and former state regulator emphasized the importance of public disclosure in examining bank regulatory systems.
We're proud of the work done by Anthony and Michael, two veteran reporters who embody the best of investigative journalism. In the past year, the Herald-Tribune changed its ownership, publisher and executive editor. All of those changes didn't matter. In an isolated corner of our spacious newsroom, they kept plugging away -- cross-checking thousands of documents, making hundreds of phone calls and weaving together a story of risky behaviors that could have been prevented.
Great journalism doesn't operate like pizza delivery. The best work takes more than 30 minutes and comes with plenty of detours. Anthony and Michael pushed to get reports never before released, then followed a splintered money trail that took them from the Panhandle to the Everglades.
Nor does great journalism evolve in a vacuum. Anthony and Michael called on trusted banking experts to look over the stories and offer insights. Editors Matt Sauer, Tony Elkins Jr., Deb Winsor, Jeffrey Rubin and Jennifer Borresen filled invaluable roles, from planning to presentation to line-by-line editing. Digital programming gurus David Adkins and Patrick Carroll took on the complicated coding issues.
Yes, the world is changing. But “Breaking the Banks” shows that we inherently believe in the importance of watchdog journalism. In print. And digital.
“This is different. This project is like a deep breath of fresh air. It's big and bold and expensive. It takes on really powerful interests. And it's the kind of sweeping narrative that only newspapers do well," Anthony Cormier says.
“Our readers may go elsewhere for their memes and cat pictures. But they still come back to us for the important stuff."
Bill Church can be contacted at [email protected] or (941) 361-4991. Follow him on Twitter @BillChurchMedia.
|
/**
* Substitute sub-strings in side of a string.
*
* @param from String to substitute from
* @param to String to substitute to
* @param string String to look for from in
* @return Substituted string
*/
public static String subst(final String from, final String to,
final String string)
{
return subst(new StringBuffer(), from, to, string);
}
|
<reponame>LunarFuror/phantasmal-world
import {
Bone,
BufferGeometry,
Float32BufferAttribute,
Uint16BufferAttribute,
Vector3,
} from "three";
import { map_get_or_put } from "../../util";
export type BuilderData = {
readonly created_by_geometry_builder: boolean;
readonly materials: BuilderMaterial[];
readonly bones: Bone[];
};
export type BuilderVec2 = {
readonly x: number;
readonly y: number;
};
export type BuilderVec3 = {
readonly x: number;
readonly y: number;
readonly z: number;
};
export type BuilderMaterial = {
readonly texture_id?: number;
readonly alpha: boolean;
readonly additive_blending: boolean;
};
/**
* Maps various material properties to material IDs.
*/
export class MaterialMap {
private readonly materials: BuilderMaterial[] = [{ alpha: false, additive_blending: false }];
private readonly map = new Map<number, number>();
/**
* Returns an index to an existing material if one exists for the given arguments. Otherwise
* adds a new material and returns its index.
*/
add_material(
texture_id?: number,
alpha: boolean = false,
additive_blending: boolean = false,
): number {
if (texture_id == undefined) {
return 0;
} else {
const key = (texture_id << 2) | (alpha ? 0b10 : 0) | (additive_blending ? 1 : 0);
return map_get_or_put(this.map, key, () => {
this.materials.push({ texture_id, alpha, additive_blending });
return this.materials.length - 1;
});
}
}
get_materials(): BuilderMaterial[] {
return this.materials;
}
}
type VertexGroup = {
offset: number;
size: number;
material_index: number;
};
export class GeometryBuilder {
private readonly positions: number[] = [];
private readonly normals: number[] = [];
private readonly uvs: number[] = [];
private readonly indices: number[] = [];
private readonly bones: Bone[] = [];
private readonly bone_indices: number[] = [];
private readonly bone_weights: number[] = [];
private readonly groups: VertexGroup[] = [];
/**
* Will contain all material indices used in {@link this.groups} and -1 for the dummy material.
*/
private readonly material_map = new MaterialMap();
get vertex_count(): number {
return this.positions.length / 3;
}
get index_count(): number {
return this.indices.length;
}
get_position(index: number): Vector3 {
return new Vector3(
this.positions[3 * index],
this.positions[3 * index + 1],
this.positions[3 * index + 2],
);
}
get_normal(index: number): Vector3 {
return new Vector3(
this.normals[3 * index],
this.normals[3 * index + 1],
this.normals[3 * index + 2],
);
}
add_vertex(position: BuilderVec3, normal: BuilderVec3, uv: BuilderVec2): void {
this.positions.push(position.x, position.y, position.z);
this.normals.push(normal.x, normal.y, normal.z);
this.uvs.push(uv.x, uv.y);
}
add_index(index: number): void {
this.indices.push(index);
}
add_bone(bone: Bone): void {
this.bones.push(bone);
}
add_bone_weight(index: number, weight: number): void {
this.bone_indices.push(index);
this.bone_weights.push(weight);
}
add_group(
offset: number,
size: number,
texture_id?: number,
alpha: boolean = false,
additive_blending: boolean = false,
): void {
const last_group = this.groups[this.groups.length - 1];
const material_index = this.material_map.add_material(texture_id, alpha, additive_blending);
if (last_group && last_group.material_index === material_index) {
last_group.size += size;
} else {
this.groups.push({
offset,
size,
material_index,
});
}
}
build(): BufferGeometry {
const geom = new BufferGeometry();
geom.setAttribute("position", new Float32BufferAttribute(this.positions, 3));
geom.setAttribute("normal", new Float32BufferAttribute(this.normals, 3));
geom.setAttribute("uv", new Float32BufferAttribute(this.uvs, 2));
geom.setIndex(new Uint16BufferAttribute(this.indices, 1));
let bones: Bone[];
if (this.bone_indices.length && this.bones.length) {
geom.setAttribute("skinIndex", new Uint16BufferAttribute(this.bone_indices, 4));
geom.setAttribute("skinWeight", new Float32BufferAttribute(this.bone_weights, 4));
bones = this.bones;
} else {
bones = [];
}
for (const group of this.groups) {
geom.addGroup(group.offset, group.size, group.material_index);
}
// noinspection UnnecessaryLocalVariableJS
const data: BuilderData = {
created_by_geometry_builder: true,
materials: this.material_map.get_materials(),
bones,
};
geom.userData = data;
geom.computeBoundingSphere();
geom.computeBoundingBox();
return geom;
}
}
|
Wireless Local Area Networks (WLANs), which may be enterprise networks, wireless mesh networks, first-responder networks, home networks, etc., are highly popular and are widely used in commercial as well as residential environments. A main challenge in providing high performance in wireless networks is overcoming variations in wireless channel conditions. Because of the shared medium, the wireless channel quality varies over time due to contention, interference, fading, etc.
In multi-hop wireless networks, multiple channels are used to minimize interference between each route in the network where different routes in the vicinity use different, non-overlapping channels. The quality of a wireless channel varies over time due to contention, interference, fading, mobility, etc. When a link of a route is disconnected, the route is broken, and rediscovering a new route yields to large service disruption time and incurs large messaging overhead.
For example, in order to find a new route, a wireless system (e.g., an access point and clients in the WLAN) scans other channels after the original route has been determined to be unusable. The scanning is performed on all other channels to find an alternative route. The scanning time is proportional to the number of channels, and the number of channels is very large with new standards, such as 802.11n. Thus, the scanning time is long, which may cause packets on the failed path to be dropped until a new suitable path can be found through the channel scanning.
|
def encode_single_character(self, char: str) -> str:
code = self._get_code(char)
self._register_char(char)
return code
|
<reponame>ant-design/sketch-json-api<filename>src/structures/JSONPack.ts
import * as fs from "fs";
import * as fse from "fs-extra";
import * as fsc from "../utils/fs-custom";
import * as path from "path";
import { exec } from "child_process";
import { promisify } from "util";
import { zip } from "compressing";
import { pipeline } from "stream";
import { User } from "./User";
import { Meta } from "./Meta";
import { Document } from "./Document";
import { Page } from "./Page";
import SketchType, { JSONPackComponent } from "../types";
import { bitmap2base64Sync, findAllBitmapInSketchJSON } from "../utils/image";
const pipe = promisify(pipeline);
const STRUCTURE: Record<
JSONPackComponent,
{ fileOrDir: "file" | "dir"; path: string; required: boolean }
> = {
user: {
fileOrDir: "file",
path: "user.json",
required: true,
},
meta: {
fileOrDir: "file",
path: "meta.json",
required: true,
},
document: {
fileOrDir: "file",
path: "document.json",
required: true,
},
pages: {
fileOrDir: "dir",
path: "pages",
required: true,
},
images: {
fileOrDir: "dir",
path: "images",
required: false,
},
};
export type Image = {
fileName: string;
path?: string;
base64: string;
};
export type JSONPackConstructorOptions = {
user: User;
meta: Meta;
document: Document;
pages: Page[];
images?: Image[];
path?: string;
};
export interface ZipOpts {
cli?: boolean;
}
export class JSONPack {
user: User;
meta: Meta;
document: Document;
pages: Page[];
images?: Image[];
path?: string;
constructor();
constructor(options: JSONPackConstructorOptions);
constructor(options?: any) {
this.path = (options && options.path) || null;
this.user = (options && options.user) || new User();
// at least one page
let atLeastOnePage;
if (options && options.pages && options.pages.length) {
this.pages = options.pages;
} else {
atLeastOnePage = new Page();
this.pages = [atLeastOnePage];
}
if (options && options.meta) {
this.meta = options.meta;
} else {
this.meta = new Meta(undefined, this.pages);
}
if (options && options.document) {
this.document = options.document;
} else {
this.document = new Document(undefined, this.pages);
}
if (options?.images) {
this.images = options.images;
}
}
static fromPathSync(packPath: string): JSONPack {
if (!JSONPack.isValidStructure(packPath)) {
throw Error("Invalid structure of path.");
}
const user = User.fromPath(path.join(packPath, "user.json"));
const meta = Meta.fromPath(path.join(packPath, "meta.json"));
const document = Document.fromPath(path.join(packPath, "document.json"));
const pages = fs
.readdirSync(path.join(packPath, "pages"))
.map((pagePath) => Page.fromPath(path.join(packPath, "pages", pagePath)));
const args: JSONPackConstructorOptions = {
user,
meta,
document,
pages,
path: packPath,
};
// maybe images
if (fs.existsSync(path.join(packPath, "images"))) {
const imageFileNames = fs.readdirSync(path.join(packPath, "images"));
if (imageFileNames?.length) {
const base64Images: Image[] = imageFileNames.map((fileName) => {
const pat = path.join(packPath, "images", fileName);
const base64Str = bitmap2base64Sync(pat);
return {
fileName,
base64: base64Str,
};
});
args.images = base64Images;
}
}
return new this(args);
}
static fromPath(packPath: string): Promise<JSONPack> {
return new Promise((resolve, reject) => {
if (!JSONPack.isValidStructure(packPath)) {
reject("Invalid structure of path.");
}
const user = User.fromPath(path.join(packPath, "user.json"));
const meta = Meta.fromPath(path.join(packPath, "meta.json"));
const document = Document.fromPath(path.join(packPath, "document.json"));
const pages = fs
.readdirSync(path.join(packPath, "pages"))
.map((pagePath) =>
Page.fromPath(path.join(packPath, "pages", pagePath))
);
const args: JSONPackConstructorOptions = {
user,
meta,
document,
pages,
path: packPath,
};
// maybe images
if (fs.existsSync(path.join(packPath, "images"))) {
const imageFileNames = fs.readdirSync(path.join(packPath, "images"));
if (imageFileNames?.length) {
const base64Images: Image[] = imageFileNames.map((fileName) => {
const pat = path.join(packPath, "images", fileName);
const base64Str = bitmap2base64Sync(pat);
return {
fileName,
base64: base64Str,
};
});
args.images = base64Images;
}
}
const pack = new this(args);
resolve(pack);
});
}
getPages() {
return this.pages;
}
getImages() {
return this.images;
}
setPath(path: string) {
this.path = path;
}
async write(packPath: string): Promise<void> {
this.path = packPath;
await fsc.resetPath(this.path);
const userPromise = fsc.writeFile(
path.join(packPath, "user.json"),
JSON.stringify(this.user.toSketchJSON())
);
const metaPromise = fsc.writeFile(
path.join(packPath, "meta.json"),
JSON.stringify(this.meta.toSketchJSON())
);
const documentPromise = fsc.writeFile(
path.join(packPath, "document.json"),
JSON.stringify(this.document.toSketchJSON())
);
const pagePromises = this.pages.map((page) => {
return fsc.writeFile(
path.join(packPath, `pages/${page.getPageId()}.json`),
JSON.stringify(page.toSketchJSON())
);
});
const allPromises = [
userPromise,
metaPromise,
documentPromise,
...pagePromises,
];
if (this.images) {
const imagesPromises = this.images.map((image) => {
image.path = path.join(packPath, "images", image.fileName);
return fsc.writeFile(image.path, image.base64, { encoding: "base64" });
});
allPromises.push(...imagesPromises);
}
return new Promise((resolve, reject) => {
Promise.all(allPromises)
.then(() => {
resolve();
})
.catch((err) => reject(err));
});
}
writeSync(packPath: string) {
this.path = packPath;
fsc.resetPathSync(this.path);
fsc.writeFileSync(
path.join(packPath, "user.json"),
JSON.stringify(this.user.toSketchJSON())
);
fsc.writeFileSync(
path.join(packPath, "meta.json"),
JSON.stringify(this.meta.toSketchJSON())
);
fsc.writeFileSync(
path.join(packPath, "document.json"),
JSON.stringify(this.document.toSketchJSON())
);
this.pages.forEach((page) => {
fsc.writeFileSync(
path.join(packPath, `pages/${page.getPageId()}.json`),
JSON.stringify(page.toSketchJSON())
);
});
if (this.images) {
this.images.forEach((image) => {
image.path = path.join(packPath, "images", image.fileName);
fsc.writeFileSync(image.path, image.base64, { encoding: "base64" });
});
}
}
static isValidStructure(packPath: string): boolean {
if (packPath && fs.existsSync(packPath)) {
const keys = Object.keys(STRUCTURE) as JSONPackComponent[];
keys.forEach((key) => {
const value = STRUCTURE[key];
const componentPath = path.join(packPath, value.path);
if (value.required) {
if (value.fileOrDir === "file" && !fs.existsSync(componentPath)) {
return false;
}
if (value.fileOrDir === "dir") {
if (
!fs.existsSync(componentPath) ||
!fs.readdirSync(componentPath)?.length
) {
return false;
}
}
}
});
return true;
}
return false;
}
async zip(sketchPath: string, options?: ZipOpts): Promise<void> {
if (!this.path) {
throw Error(
"Please firstly write() once or set the path for this JSON pack."
);
}
if (!JSONPack.isValidStructure(this.path)) {
await this.write(this.path);
}
// check again
if (!JSONPack.isValidStructure(this.path)) {
throw Error(`The structure of this JSON pack is invalid! ${sketchPath}`);
}
fse.ensureDir(path.dirname(sketchPath));
if (options?.cli) {
await promisify(exec)(
`zip -r -X ${path.resolve(process.cwd(), sketchPath)} *`,
{ cwd: this.path }
);
} else {
const zipStream = new zip.Stream();
const files = await fse.readdir(this.path);
for (let i = 0; i < files.length; i++) {
const file = files[i];
zipStream.addEntry(path.join(this.path, file));
}
const destStream = fse.createWriteStream(sketchPath);
await pipe(zipStream, destStream);
}
}
getAllArtboards(): SketchType.ArtboardLike[] {
const allArtboards: SketchType.ArtboardLike[] = [];
this.pages.forEach((page) => {
page.artboards().forEach((artboard) => {
allArtboards.push(artboard);
});
});
return allArtboards;
}
async getAllArtboardsWithBitmapInfo(): Promise<SketchType.ArtboardLike[]> {
if (!this.path) {
throw Error(
"Please firstly write() once or set the path for this JSON pack."
);
}
const allArtboards: SketchType.ArtboardLike[] = [];
for (let i = 0; i < this.pages.length; i++) {
const page = this.pages[i];
const artboards = page.artboards();
for (let j = 0; j < artboards.length; j++) {
const artboard = artboards[j];
const infos = await findAllBitmapInSketchJSON(
artboard,
this.path as string
);
if (!artboard.userInfo) {
artboard.userInfo = {};
}
artboard.userInfo["bitmapInfos"] = infos;
allArtboards.push(artboard);
}
}
return allArtboards;
}
}
|
package de.warsteiner.jobs.editor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.InventoryView;
import de.warsteiner.datax.SimpleAPI;
import de.warsteiner.datax.api.PluginAPI;
import de.warsteiner.jobs.UltimateJobs;
public class EditLevelEvent implements Listener {
private static UltimateJobs plugin = UltimateJobs.getPlugin();
private PluginAPI up = SimpleAPI.getInstance().getAPI();
@EventHandler
public void onInvClick(InventoryClickEvent e) {
if (e.getClickedInventory() == null) {
return;
}
if (e.getCurrentItem() == null) {
return;
}
if (e.getView().getTitle() == null) {
return;
}
if (e.getCurrentItem().getItemMeta() == null) {
return;
}
if (e.getCurrentItem().getItemMeta().getDisplayName() == null) {
return;
}
Player p = (Player) e.getWhoClicked();
InventoryView inv = e.getView();
String display = up.toHex(e.getCurrentItem().getItemMeta().getDisplayName().replaceAll("&", "§"));
}
}
|
/*
ID: zhaowei10
TASK:
LANG: C++14
*/
#include "bits/stdc++.h"
using namespace std;
#ifdef LOCAL
#include "../../_library/cc/debug.h"
#define FILE "test"
#else
#define debug(...) 0
#define FILE ""
#endif
int mergeSort(vector<int>& a, int l, int r) {
if (l >= r) {
return 0;
}
int m = l + (r - l) / 2;
int f = mergeSort(a, l, m);
int s = mergeSort(a, m + 1, r);
vector<int> next;
int i = l, j = m + 1;
int ans = f + s;
while (i <= m && j <= r) {
if (a[i] <= a[j]) {
next.emplace_back(a[i]);
++i;
} else {
next.emplace_back(a[j]);
++j;
ans += m - i + 1;
}
}
while (i <= m) {
next.emplace_back(a[i]);
++i;
}
while (j <= r) {
next.emplace_back(a[j]);
++j;
}
copy(next.begin(), next.end(), a.begin() + l);
return ans;
}
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
if (fopen(FILE ".in", "r")) {
freopen(FILE ".in", "r", stdin);
freopen(FILE ".out", "w", stdout);
}
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
vector<int> a(n);
for (auto& x : a)
cin >> x;
cout << mergeSort(a, 0, n - 1) << '\n';
}
}
|
<reponame>vanng822/imgmeta
package imgmeta
import (
"fmt"
"github.com/stretchr/testify/assert"
"testing"
"os"
)
func cleanCache(basePath string) {
os.RemoveAll(fmt.Sprintf("%s/%s", basePath, cacheFolder))
}
func TestMain(m *testing.M) {
fmt.Println("Test starting")
retCode := m.Run()
cleanCache("./data")
fmt.Println("Test ending")
os.Exit(retCode)
}
func TestFetchOK(t *testing.T) {
f, _ := Scan("./data")
assert.NotNil(t, f)
assert.Equal(t, 1, len(f.Folders))
ff := f.Find("/photos/")
assert.NotNil(t, ff)
assert.Equal(t, "photos", ff.Name)
assert.Equal(t, "photos", ff.RelPath())
assert.Equal(t, 0, len(ff.Folders))
assert.Equal(t, 2, len(ff.Images))
}
|
THE Union Cabinets decision to set up a new commission of inquiry to probe the riots which broke out in Delhi and other areas of the country in the wake of the assassination of former Prime Minister Indira Gandhi on October 31, 1984, has come after periodical demands and hints. The demands came from the hurt Sikh circles. The hints came from a few ministers in the Bharatiya Janata Party-led government before the last General Election and after it.
DEVELOPMENTS related to the escape of the 17th Karmapa from Tibet to India have followed a predictable course. His escape to freedom, as it were, has given the big cats the opportunity to growl at the smaller members of the feline family.
DEFENCE matters are officially treated as a sacred cow. This may be desirable in highly strategic and sensitive areas. The problem arises when the ruling establishment makes virtue of every necessity. It closely guards even elementary and innocuous bits of information from public gaze, though the world outside may have access to classified facts on the deployment of missiles and other hi-tech weaponry.
IS the much touted reform of the United Nations Security Council proving to be a mirage? This poser was raised by several nations at the recent debate in the General Assembly on the vital issue that the world organisation has been grappling with for the last six years through an open-ended working group. As the president of the 54th session of the assembly, Mr Theo-Ben Gurirab, Foreign Minister of Namibia, himself acknowledged, while all member-states are agreed on the need to reform and enlarge the Security Council, there is an impasse on certain critical issues.
ARE we back to the sulk between India and Nepal? This time, it is over the IA flight hijack. Rather a serious matter. Nepal has much to explain for this episode. Indo-Nepal relations have never been normal. That is because Indians and Nepalese are cousins. The Nepalese take offence easily. They expect India to make all the concessions.
THE Bombay Labour Department has issued interesting statistics regarding the earnings of middle class people. After examining the family budgets of over 1,800 middle class people, it has been found that the average income varies from Rs 30 to 40 per home and of this amount about 42 per cent is spent on food and 10 per cent on rents.
THE Union Cabinets decision to set up a new commission of inquiry to probe the riots which broke out in Delhi and other areas of the country in the wake of the assassination of former Prime Minister Indira Gandhi on October 31, 1984, has come after periodical demands and hints. The demands came from the hurt Sikh circles. The hints came from a few ministers in the Bharatiya Janata Party-led government before the last General Election and after it. The All-India Shiromani Akali Dal (Babbar) was most strident in asking for another inquiry commission after the earlier commission, with its assisting agencies, was accused of conducting Operation Disposal. Home Minister L.K. Advani said last week, confirming certain statements by persons generally perceived as being politically well-informed, that an inquiry was in the offing and that it would aim at meeting the demands. According to Parliamentary Affairs Minister Pramod Mahajan, the Chief Justice of India would nominate a suitable retired judge of the Supreme Court to head the commission. In his opinion, the earlier commission was more of an eyewash and that was why the present Government had decided to institute another probe. The killing of about 5000 citizens should not go unaccounted for.
The terms of reference to be given to the commission would be seminal. If the commission so desires, it can begin at the beginning. The nominated former apex court judge would be required to go into the causes and course of the riots and violence targeting Sikhs. He would examine complaints and allegations either by individuals or by the Government and find out whether the heinous crimes could have been averted. He would also look into the allegations of lapses or dereliction of duty on the part of police officers, policemen and others. And he would go into the adequacy of the administrative measures taken to prevent the carnage. Of course , he would recommend such steps as would meet the ends of justice, feeling free to raise and get answered any other issue relevant to the probe. There are a few positive aspects of the announcement. The nation has never believed that enough was done to bring the criminals to book. Lack of evidence and legal lacunae helped many politicians, members of the police force and goondas escape punishment. Of course, no court can prosecute mobs. But their visible instigators, when clearly identified, must be made to pay for their nefarious acts. However, it would not be proper to continue the vilification campaign against Justice Ranganath Mishra, a former Chief Justice of India. He acted as a judge as the new judge would do. He found no evidence of state planning or instigation in the 1984 episodes. He recommended the setting up of another committee to inquire into the role of the police and order the registration of fresh cases if so required. The new commission will definitely review the fairness or foulness of all the agencies concerned, including the old commission, the four committees formed following Justice Mishras recommendations, the two Lieutenant-Governors and the lower judiciary. It would have been better to make the fresh move after the end of the scheduled Assembly elections. But time, like tide, should not be seen waiting. With its wide terms of reference the new commission should lay the ghost of doubts and controversies in one of the ugliest communal episodes in this country. It is good that the Congress has welcomed the announcement of the time-bound (six-month) hard look at those shocking and shameful happenings.
DEVELOPMENTS related to the escape of the 17th Karmapa from Tibet to India have followed a predictable course. His escape to freedom, as it were, has given the big cats the opportunity to growl at the smaller members of the feline family. In the global context, Indias position appears to be as pathetic as that of a kitten trapped on a hot tin roof while the Karmapa controversy has given to the USA yet another chance to keep up the pretence of being the leader of the pack of alley cats. It is evident that the Ministry of External Affairs is working overtime to cope with the unexpected turn of events at a time when Indias low-key initiative for re-building bridges with China had begun to give at least a glimmer of hope of normalisation of ties between the two most important countries in Asia and together in the world. Beijing too has realised that the escape of the Karmapa has put it in a spot of bother at the global level and only Delhi can help it save face by refusing asylum to the 14-year-old China-ordained Living Buddha. However, instead of using polite diplomatic language for seeking assistance the Chinese leadership has chosen to play to the gallery by using the language of threat that too in the name of preserving the spirit of Panchsheel! What is more disturbing is the fact that the usually suave External Affairs Minister, Mr Jaswant Singh, has left his junior Minister, Mr Ajit Panja, to do all the talking which has merely added to the confusion about how India intends to handle the crisis. One option would be to use the Karmapas Sikkim connection for resolving the issue. The monastery in Sikkim is considered to be the legitimate abode of the Karmapa and, therefore, no one should have any cause of complaint if he were to be allowed to return home. Although there are two other claimants to the title of Karmapa, India can get past the minor hurdle by referring to the fact that Ogyen Trinley Dorjee is recognised as the incarnation of the 16th Karmapa by both the Tibetan Government-in-exile and China.
As far as the USA is concerned, the escape of the Karmapa has given it the opportunity to remind the world of its self-assumed role of the global policeman. After having made heavy investment in the Chinese market the powerful American business lobby is certainly not going to let the State Department crack the whip on China. Therefore, the statement attributed to the official spokesperson in the US Administration, Mr James Rubin, asking China to resume talks with the Dalai Lama for resolving the controversy over the status of Tibet is meant to impress the world rather than make the Chinese leaders tremble with fear. The latest seemingly anti-China rhetoric is part of the US policy of making phoney noises over glaring human rights violations, which evidently forced the Karmapa to flee from Tibet. The USA has even threatened to introduce a resolution against Chinas poor record before the United Nations Commission on Human Rights. By way of a side show Pakistans Chief Executive, Gen Pervez Musharraf, seems to have decided to take advantage of the possibility of deterioration of ties between Beijing and Delhi over the likely course of action for deciding the Karmapas future. To say that the outcome of his proposed visit to China next week would require close monitoring by India is to state the obvious.
Maintaining secrecy in policy matters, especially relating to defence, is a colonial legacy. The British rulers had stakes in protecting their global interests and they were understandably reluctant to share secrets with Indians. After Independence, the new rulers adopted the same attitude and practice with the result we now have a half-informed society. Defence affairs, which have a direct bearing on national integrity, sovereignty and independence, are hardly discussed even in Parliament. Whose interests are we serving?
An ill-informed society in a democratic polity like ours can be vulnerable in times of crisis. The country has actually suffered because of the official tendency to keep the people in the dark about different facets of governance. Where is the much-talked-about transparency? Where is the concept of an open government? How can people have better appreciation of the countrys needs and challenges if they are not taken into confidence.
Take, for example, the 1962 defeat at the hands of the Chinese. For the first time since Independence, the country was caught unawares in the regions geopolitical ambitions. China exposed Indias shockingly poor defence preparedness. The Panchsheel spirit soon evaporated.
The NEFA debacle shook Jawaharlal Nehru and he could never recover, both physically and mentally, after that. Lt-Gen T.B. Henderson Brooks probed the debacle. He died in Sydney a few days before he was to turn 89 on January 11, 1997. His voluminous report is yet to be made public, though several steps were subsequently taken to reorganise the armed forces, including the formation of a highly skilled mountain division.
I believe that the governments decision to keep the Henderson Brooks report a secret even after 38 years is a grave mistake. It should have been made public after 10 years so that experts could evaluate how and where we went wrong at that critical juncture of national life.
We cannot learn from historical blunders if we try to thrive on secrecy. I can appreciate non-publication of the report for a decade or so. But not thereafter.
As it is, we tend to live in a world of make-believe. And if our past failures too are cast in a make-believe mould, we as a nation can hardly learn from the mistakes of our Generals, political leaders and bureaucrats.
The members of the committee, including its chairman, Mr K. Subrahmanyam, are highly respected professionals and persons of integrity. Still, I fail to appreciate the logic behind their plea for selective secrecy. The committee was, after all, constituted in the wake of criticism that the Vajpayee government had failed in its duty to be sufficiently vigilant in defending the integrity of the countrys borders because of a massive intelligence failure.
Mercifully, Kargil ultimately turned out to be an Indian success story. But we should not forget that behind this success was a quiet role played by the Americans who forced Pakistan to withdraw the intruders from the strategic heights.
One, how come we failed to notice such a massive infiltration into the strategic heights of the Kargil sector?
Two, whose failure was itintelligence or operational or both?
Three, how adequate was the response from the field commanders once the intrusion was noticed?
Four, how well-equipped have our units been to detect movements of the infiltrators?
Five, did the Ministry of Defence and political leaders respond promptly and adequately after having been told about the intrusion?
Six, if the response system was not prompt and adequate, what is the nature of politico-security gaps which need to be plugged?
Seven, was there enough coordination at all levels of command?
Eight, how about political responses vis-a-vis Pakistan? Were these in harmony with the ground realities? In other words, did the Lahore bus diplomacy dilute the official Indian response to Kargil developments?
Nine, why did we not procure surveillance and other equipment well in time since we had a fairly good idea about the terrain the armed forces are supposed to guard against a hostile neighbour?
These questions have been discussed and debated during those turbulent Kargil days. They will continue to be debated as doubts persist in the absence of the Subrahmanyam Committee report not seeing the light of the day. There is no earthly reason why such a crucial report should not be made public.
Perhaps, a thorough and honest probe will bring to light the full story of obstructionist red-tapism. Perhaps, this is not the time to talk about such matters. At the same time, this cannot be kept out of focus just to suit the convenience of the powers that be.
Those who rule this country in the name of the people must be accountable and be ready to pay for the consequences of their actions and non-actions. This should be the elementary dharma of a democratically elected government. Enough damage has already been done to the countrys credibility by cover-up operations. Those in position of power conveniently take shelter behind national security and thereby deny the public the right to information. There must not be any secrecy in running national affairs. Strategies and operational matters of security fall in a different category and they have to be protected from prying eyes.
No patriotic Indian would seek operational details of the armed forces in Kargil and beyond. No one would dare question the magnificent role of our officers and jawans in throwing out the intruders. They have given a good account of themselves in the true tradition of the armed forces.
The challenge facing the country is formidable. And we can face it successfully provided we rise above small calculations and change the old mindset on national security.
An honest appraisal and sharing of facts with the people are the key elements of democracy. For this purpose healthy and honest criticism should always be welcome. The authorities in New Delhi need not be afraid of a free debate on the Subrahmanyam Committee findings on the plea of national security.
It is a fact that over a long period a halo has been created around the Ministries of Defence, Home and Foreign Affairs and those dealing with the countrys security and related matters. This tendency can prove to be dangerous for our democracy.
It needs to be appreciated that a democracy may need more criticism in a time of war than in normal times. In this context, it will be interesting to recall the shell scandal that surfaced during World War I. This was the work of an enterprising war correspondent (Col Repington). His startling disclosures actually saved England from near-defeat. Indeed, secrecy in the name of security does not pay.
It is also common knowledge that the whole issue of secrecy in the USA blew up with the publication of the Pentagon Papers by the New York Times of June 13, 1971.
In the US Supreme Court six judges came out in favour of the New York Times and three gave a dissenting verdict.
We can say from our own experience how we have protected visibly guilty persons in sensitive areas in the name of national security. This is absurd.
The Vajpayee government can make a difference to the quality of democratic governance by promptly publishing the Subrahmanyam Committee report. It should not be kept under the wraps to save many a politico-bureaucratic reputation!
Enough is enough. Let us give a chance to open and transparent governance. It will save the nation from several visible and invisible scandals and failures in key areas of national life. Any takers? Over to Prime Minister Atal Behari Vajpayee.
As the United Nations prepares to convene the millennium summit in September this year, it is becoming increasingly obvious that differences over the expansion of the permanent category of council members, potential new members and the veto power have remained irreconcilable. Security Council reform, in the words of Mr Gurirab, is the most ambitious course of action that all member-states have embraced and sustained for the past six years.
What Mr Gurirab did not say was that the political will is lacking among the five permanent members of the Security Council without whose agreement the council reform cannot be undertaken. He is convening the working group in the early part of this year to deal specifically with the issues facing it and to avoid another general debate.
During the General Assembly debate on the issue, the U.S. representative made it clear that his country would oppose any expansion that threatened the ability of the Security Council to carry out its responsibilities under the charter. The gravity of those responsibilities was simply too great to risk compromising the councils ability to meet them, he said. The USA has been consistently favouring the inclusion of Germany and Japan among new permanent members along with representatives of the African, Asian and Latin American regions.
On the other hand, Russia believes that the number of members in the enlarged council should not exceed 20 or 21, as going beyond that number would have negative impact on the councils efficiency. Its principal position was that enlargement in either permanent or non-permanent categories should include both industrial nations and developing countries. India was mentioned by the Russian representative as a strong and worthy candidate for permanent membership in the council. China was non-committal, urging that there should be no haste in securing fair and reasonable reform of the Security Council. France supports the increase in the number of membership in both permanent and non-permanent member-categories and is also in favour of Germany and Japan being made permanent members. Britain would like to have another five permanent members that would include Japan and Germany and three non-industrial nations.
For long, the nonaligned movement which today comprises 114 member-states of the UN approximately two-thirds of the total of 188 has been urging that the current imbalance in representation in the Security Council should be rectified with a sizeable expansion of the council in order to reflect contemporary political and economic realities. The process of expansion, nonaligned countries feel, must be based on the principles of equitable geographical representation and equitable sovereignty. It may be pointed out that the original UN Charter provided for only 11 members, five permanent and six non-permanent. The charter was amended in 1963 to create four additional non-permanent members as a result of pressure from Third World countries. The new expanded 15-member council became effective in 1965. Thirtyfive years later, the battle goes on with no signs of any agreement over the expansion of the council.
If it looks a big if and when the expansion takes place, the clamour for inclusion in the permanent membership category is certain to escalate. If the recent General Assembly debate revealed anything, it was that very many hats will be in the ring and the fate of the aspirants will be in the hands of the five permanent members who hold the veto power. Remember, three years ago when Mr Boutros Boutros-Ghali sought a second term as UN Secretary-General, the USA thwarted his ambition by using its veto, and the Egyptian diplomat later confessed he could not fight a Goliath, Indias quest for a permanent seat in the Security Council has already drawn derisive comments from its neighbour, although what Pakistan thinks is not going to influence other member-states. There are a few countries which appear to believe that the only yardstick by which progress on the issue of Security Council reform can be measured is the achievement of their ambition to become a permanent member, Pakistans representative told the General Assembly. Their desire to seek a permanent status on the Security Council is not motivated by altruistic or noble sentiments. It is an undisguised grab for power and privilege. It might be the the grapes are sour reaction of a country that has no chance of acquiring the status of a permanent member of the Security Council, but it is a pointer to the difficult terrain that countries like India face at the United Nations. Even in the case of Japan and Germany, which have received open endorsements from most of the permanent members of the council Canada raised the pertinent point that because a member-state was a major financial contributor to the United Nations, or influential in other ways, did not mean that the tangible recognition of that contribution or influence ought to be a permanent seat of the Security Council.
While there is no consensus as yet on the expansion of the Security Council, the curtailment or abolition of the right of veto has emerged as an even more complicated issue, especially when the five permanent members are unwilling to give up or dilute their privilege. Their position was only recently confirmed in a statement of the Foreign Ministers of the big five that any attempt to restrict or curtail their veto rights would not be conducive to the reform process. On the other hand, many member-states have argued that the circumstances on which the veto power was based have been superseded by history. Five years ago, at the 50th commemoration session of the UN General Assembly, the Cuban leader, Fidel Castro, had argued that the obsolete veto power and the misuse of the Security Council by the very powerful were resulting in a new form of colonialism within the United Nations itself. Many member-states may not share that extreme view, but there is a growing feeling at the United Nations that short of abolishing the veto system, the question of limiting veto rights deserves serious debate. The very fact that the veto power has virtually been in disuse since the end of the Cold War is sufficient ground for rethinking on the issue.
(The writer was recently at the United Nations).
ARE we back to the sulk between India and Nepal? This time, it is over the IA flight hijack. Rather a serious matter. Nepal has much to explain for this episode.
Indo-Nepal relations have never been normal. That is because Indians and Nepalese are cousins. The Nepalese take offence easily. They expect India to make all the concessions.
Indias major concern in the Himalayas has been its security. First it was the threat from China, and now from various hostile groups, which have made Kathmandu their haven. India has complained. It has pleaded with Nepal. But to no avail. Nepal makes the usual assurances. They are never carried out.
India is willing to pay a price. This is evident in the various concessions it has made to Nepal in trade and economic relations. But there is still no reciprocity. On the contrary, Nepal has converted every discomfiture of India into an opportunity to wring out more concessions from India.
Nepals game began long ago. It used to play China against the British raj. The game continued even after India became independent. And Nepal has added a new card that of Pakistan. There are also small players in this game.
Nepal has little security concern. The threats are more internal. Neither India nor China can ever violate Nepals integrity. So Nepal could concentrate on its economic development. But it was suspicious of both India and China of course for different reasons. With the help of India or China, Nepal could have developed faster. But it made a move only recently. As a result, Nepal is one of the poorest countries in the world, although it could have been an El Dorado. Its per capita income is no more than 200, well below that of Bangladesh. And yet, if only Nepal was willing from the fifties to jointly exploit its water resources with India, it could have been one of the most prosperous countries of Asia. It has a population of only 20 million.
Obsessional suspicion of India that is what has brought about the self-inflicted injury. Even today there is opposition to the Mahakali Treaty between India and Nepal, although Nepal has been a major beneficiary of this scheme.
India has gone out of its way to promote economic development of Nepal in the fond hope that Nepal would be more understanding of Indias security concerns. This policy has not worked. In fact, Nepal has a way of magnifying every small grouse against India so that it is nursing its grievances against India all the time. There is no time for normal relations!
Of course, an open border is what is at the root of much of the problems today. There is little worry from China. The policy of open border was inspired by sentimental reasons in which of course India is adept. But today an open border is an open invitation to anti-social forces. That is how Kathmandu has become one of the crime capitals of the world.
The border must be closed for another reason. Today about four lakh tourists visit Nepal yearly. A good part of them from India. So the traffic is on the increase and an open border is an open invitation for more criminal gangs.
The criminals themselves are no danger to Nepal. (They are more often a danger to India.) In fact, they bring in much needed money to Nepal.
Even since China occupied Tibet in 1949, the Himalayas is no more an abode of peace. Today Tibet is a major centre of the Peoples Liberation Army. Missiles are everywhere targeted on India. Nepal has not tried to remain strictly neutral, which is what it should do in the circumstances. Instead, it has used the China card against India. It has had a highway constructed by China, which could one day be used against India. And it has bought Chinese arms, including anti-aircraft guns.
All these might have sent a message to New Delhi to its bureaucrats but they convey a different message to the people of India. The people of India are unhappy that Nepal, of all countries, is behaving like this to India.
Prime Minister Vajpayee has written to K.P. Bhattarai, Prime Minister of Nepal, asking him to take action against Pak-funded activities in Nepal, and to clean up the ISI network. Mr Vajpayee is a simple man. His Lahore trip showed how simple he could be. And his appeal to President Clinton to declare Pakistan a terrorist state brought a snub from Washington. Mr Vajpayee truly believed that Washington is sincere about its loud commitment to fight terrorism!
Will Bhattarai act on Vajpayees letter? Not likely. Why should Nepal incur the displeasure of the military regime in Islamabad? No one is going to oblige India. Neither Nepal nor Bangladesh. In fact, the ISI is well entrenched in both these countries. India is taking a long time learning the realities of the world.
After the snub we got from Washington, we must know that on the question of terrorism, we are on our own. This being so, we must act in our interest. And one of the first steps in this direction is to close the porous border with Nepal. Nepal cannot complain. Nor can it complain if India refused to give it a land route for its trade with Pakistan, for that is not in Indias interest.
During the visit of Mr Jaswant Singh to Nepal last year, the Nepal authorities spoke of the need for deeper integration of the two countries. We have a way of believing such statements. Not much is to be read into such statements for they are meant for the gullible. Nepal will never say such things at SAARC meetings because it will offend Pakistan.
Remember, even on Kargil, on which the world was united in favour of India, all that Nepal could persuade itself to say was that the two countries i.e. India and Pakistan must exercise maximum restraint. This was not what India expected from Nepal.
It is true, of late, Nepal has been more responsive on the issue of terrorism. But that is because it can be a major problem for Nepal itself one day. But, remember, it was not too long ago that Nepal let off three senior Pakistani diplomats caught in an RDX scandal. The RDX was for use at Indias Republic Day parade, for which the King and Queen of Nepal were the chief guests: Naturally, the Kathmandu establishment was shocked by the audacity of the Pakistanis, and were forced to name the diplomats. But that was all. The Nepalese establishment did not have the courage to proceed further. After this event, the ISI shifted part of its operations to Dhaka.
There are minor issues between India and Nepal. As usual, they have been magnified into mountainous proportions. For example, the question of Nepals freedom to buy arms from where it chooses. There is the issue of Kalapani, a small piece of land at the source of the Mahakali river, which is a disputed territory between Nepal and India. The issue has been festering because the claim is not clear.
India should be willing enough to make concessions on these issues from the point of view of its long-term interests.
As for the hijack episode, we have a better picture of what happened at Kathmandu. We will know how sincere Nepal is from the report on the enquiry it has ordered on the hijacking. Till then, sulk as usual.
In a costly city like Bombay middle class people have thus to live on a paltry sum of 30 to 40 rupees a month a state of poverty which reflects no credit on the employers or the Government which allows such conditions to prevail. The state of affairs disclosed by the statistics urgently calls for suitable ameliorative action.
|
import { ClientSmartBarServiceModel } from 'app/services/SmartBarService';
import { useActionGetIdEditing } from '../actions/actionIdEditing';
import { useFetchTableSmartBar } from '../actions/actionTable';
export const useClickDownload = () => {
const getIdItem = useActionGetIdEditing();
const tableData = useFetchTableSmartBar();
const handleClickDownload = (item: ClientSmartBarServiceModel) => {
getIdItem(item.id);
tableData.request({ id: item.id });
};
return {
handleClickDownload,
};
};
|
#!/usr/bin/env python
"""The setup script."""
from setuptools import find_packages, setup
with open("README.rst") as readme_file:
readme = readme_file.read()
with open("CHANGELOG.rst") as history_file:
history = history_file.read()
with open("AUTHORS.rst") as authors_file:
authors = authors_file.read()
with open("requirements.txt") as installation_requirements_file:
requirements = installation_requirements_file.read().splitlines()
with open("requirements_setup.txt") as setup_requirements_file:
setup_requirements = setup_requirements_file.read().splitlines()
with open("requirements_dev.txt") as test_requirements_file:
test_requirements = test_requirements_file.read().splitlines()
setup(
author="The Quantify consortium consisting of Qblox and Orange Quantum Systems",
python_requires=">=3.7",
classifiers=[
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
],
description="Unified quantum computing, solid-state and pulse sequencing physical experimentation framework.",
install_requires=requirements,
license="BSD-4 license",
long_description=readme + "\n\n" + authors + "\n\n" + history,
include_package_data=True,
keywords="quantify-core",
name="quantify-core",
packages=find_packages(include=["quantify_core", "quantify_core.*"]),
package_data={"": ["*.json"]}, # ensures JSON schema are included
setup_requires=setup_requirements,
test_suite="tests",
tests_require=test_requirements,
url="https://gitlab.com/quantify-os/quantify-core",
version="0.5.0",
zip_safe=False,
)
|
Phytosensors and Phytoactuators Plants continuously sense a wide variety of perturbations and produce various responses known as tropisms in plants. It is essential for all plants to have survival sensory mechanisms and actuators responsible for a specific plant response process. Plants are ideal adaptive structures with smart sensing capabilities based on different types of tropisms, such as chemiotropism, geotropism, heliotropism, hydrotropism, magnetotropism, phototropism, thermotropism, electrotropism, thigmotropism, and host tropism. Plants can sense mechanical, electrical and electromagnetic stimuli, gravity, temperature, direction of light, insect attack, chemicals and pollutants, pathogens, water balance, etc. Here we show how plants sense different environmental stresses and stimuli and how phytoactuators response to them. Plants generate various types of intracellular and intercellular electrical signals in response to these environmental changes. This field has both theoretical and practical significance because these phytosensors and phytoactuators employ new principles of stimuli reception and signal transduction and play a very important role in the life of plants.
|
1. Field of the Invention
The present invention is directed to a work vehicle. In more particular, the present invention is directed to, but not exclusively, a work vehicle that includes an electronic control unit that controls on-board electric components, a first battery that is charged using electric power from an on-board electric generator, and a second battery that is charged from an external electric power source via a charger.
The present invention is also directed to a display device for a work vehicle. In more particular, the present invention is directed to, but not exclusively, a display device for a work vehicle that includes a liquid crystal display provided with a plurality of display units that display information related to an engine, and a display electronic control unit that controls the operations of the liquid crystal display.
2. Description of the Related Art
[1] First Related Art
In recent hybrid work vehicles, a battery for supplying electric power to e.g. a travel oriented electric motor, may be charged with electric power from an external electric power source (e.g. see JP 2012-232724A, in particular, paragraphs 0021 and 0022 and FIGS. 1 and 5).
With a plug-in hybrid work vehicle including first and second batteries as described above, if the output voltage of the first battery is low when charging the second battery from an external electric power source, the output voltage of the first battery may fall below a reference voltage value that is necessary for starting an engine during charging of the second battery. If the output voltage of the first battery falls below the reference voltage value, the engine can no longer be started using electric power from the first battery after charging the second battery from the external electric power source. Furthermore, when an on-board electric generator is an alternator that operates on power from the engine, the first battery can no longer be charged using electric power from the alternator.
In view of the above, there is a demand to prevent the possibility that the output voltage of the first battery may fall below the reference voltage value after charging the second battery from the external electric power source.
[2] Second Related Art
Some of these work vehicles include a display device provided with an approximately four-inch liquid crystal display having a plurality of display units (display areas) for displaying engine-related information, such as an engine revolution display area that displays the number of engine revolutions, an hour meter display area that displays an accumulated period of engine operation, a coolant temperature area that displays a temperature of an engine coolant, and a fuel gauge area that displays a remaining amount of fuel to be supplied to the engine (e.g. JP 2013-252747A, in particular, paragraphs 0020, 0041 and 0042 and FIGS. 6 and 11).
Hybrid work vehicles developed in recent years include not only an engine, but also a motor generator, as its power sources. In such hybrid work vehicles, a display device needs to display not only information related to the engine, but also information related to the motor generator. This need can be fulfilled by increasing the size of a liquid crystal display along with an increase in the amount of information to be displayed. However, increasing the size of the liquid crystal display triggers an increase in the size of the display device and a significant rise in cost. Meanwhile, the size of each display unit can be reduced along with an increase in the amount of information to be displayed. However, this triggers a reduction in the visibility of information displayed on each display unit of the liquid crystal display.
In view of the above, there is a demand to develop a display device that can display not only information related to an engine, but also information related to a motor generator, without triggering an increase in the size of a display device and a significant rise in cost, or a reduction in the visibility of information to be displayed.
|
<gh_stars>0
package com.simplegis.webservice.persistence.dao.impl;
import com.simplegis.webservice.persistence.dao.StreetDao;
import com.simplegis.webservice.persistence.entity.Street;
import com.simplegis.webservice.persistence.util.BatchUpdateWithGeneratedKeys;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BatchPreparedStatementSetter;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.support.GeneratedKeyHolder;
import org.springframework.jdbc.support.KeyHolder;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
/**
* Street data access object.
*/
@Repository
public class StreetDaoImpl implements StreetDao {
@Autowired
private JdbcTemplate jdbcTemplate;
@Autowired
private BatchUpdateWithGeneratedKeys batchUpdateWithGeneratedKeys;
@Override
@Transactional(readOnly = true)
public List<Street> getAll() {
String sql = "SELECT * FROM simplegisdb.street st";
return jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(Street.class));
}
@Override
@Transactional(readOnly = true)
public Street getById(Long id) {
String sql = "SELECT * FROM simplegisdb.street st WHERE st.id = ?";
Object[] args = {id};
return jdbcTemplate.queryForObject(sql, args, new BeanPropertyRowMapper<>(Street.class));
}
@Override
@Transactional
public Integer update(Street street) {
String sql = "UPDATE simplegisdb.street st SET st.name = ?, st.city_id = ?, st.length = ?, st.version = ?"
+ " WHERE st.id = ? AND st.version = ?";
return jdbcTemplate.update(sql,
street.getName(), street.getCityId(), street.getLength(), street.getVersion() + 1, street.getId(), street.getVersion());
}
@Override
@Transactional
public Street insert(Street street) {
String sql = "INSERT INTO simplegisdb.street (name, length, city_id, version)"
+ " VALUES (?, ?, ? ,?)";
KeyHolder keyHolder = new GeneratedKeyHolder();
jdbcTemplate.update(connection -> {
String[] columnNames = {"id"};
PreparedStatement preparedStatement = connection.prepareStatement(sql, columnNames);
int i = 0;
preparedStatement.setString(++i, street.getName());
preparedStatement.setBigDecimal(++i, street.getLength());
preparedStatement.setLong(++i, street.getCityId());
preparedStatement.setLong(++i, 0);
return preparedStatement;
}, keyHolder);
street.setId(keyHolder.getKey().longValue());
street.setVersion(0);
return street;
}
@Override
@Transactional
public List<Street> batchInsert(List<Street> streets) {
String sql = "INSERT INTO simplegisdb.street (name, length, city_id, version)"
+ " VALUES (?, ?, ? ,?)";
List<Map<String, Object>> generatedKeys;
generatedKeys = batchUpdateWithGeneratedKeys.batchUpdate(
sql,
new BatchPreparedStatementSetter() {
@Override
public void setValues(PreparedStatement preparedStatement, int i) throws SQLException {
Street street = streets.get(i);
int index = 0;
preparedStatement.setString(++index, street.getName());
preparedStatement.setBigDecimal(++index, street.getLength());
preparedStatement.setLong(++index, street.getCityId());
preparedStatement.setLong(++index, 0);
}
@Override
public int getBatchSize() {
return streets.size();
}
},
new GeneratedKeyHolder());
for (int i = 0; i < streets.size(); i++) {
streets.get(i).setId((long) generatedKeys.get(i).get("id"));
streets.get(i).setVersion(0);
}
return streets;
}
@Override
@Transactional(readOnly = true)
public List<Street> getByName(String name) {
String sql = "SELECT * FROM simplegisdb.street st WHERE st.name LIKE ?";
String nToken = "%" + name + "%";
Object[] args = {nToken};
return jdbcTemplate.query(sql, args, new BeanPropertyRowMapper<>(Street.class));
}
@Override
@Transactional(readOnly = true)
public List<Street> getByLength(BigDecimal minimalLength, BigDecimal maximumLength) {
String sql = "SELECT * FROM simplegisdb.street st WHERE st.length >= ? AND st.length <= ?";
List<Object> args = new LinkedList<>();
if (minimalLength == null || BigDecimal.ZERO.equals(minimalLength)) {
sql = "SELECT * FROM simplegisdb.street st WHERE st.length <= ?";
} else {
args.add(minimalLength);
}
if (maximumLength == null || BigDecimal.ZERO.equals(maximumLength)) {
sql = "SELECT * FROM simplegisdb.street st WHERE st.length >= ?";
} else {
args.add(maximumLength);
}
if (args.isEmpty()) {
return null;
} else {
return jdbcTemplate.query(sql, args.toArray(), new BeanPropertyRowMapper<>(Street.class));
}
}
@Override
@Transactional(readOnly = true)
public List<Street> getByCityIdAndName(Long cityId, String name) {
String sql = "SELECT * FROM simplegisdb.street st WHERE st.city_id = ? AND st.name LIKE ?";
String nToken = "%" + name + "%";
Object[] args = {cityId, nToken};
return jdbcTemplate.query(sql, args, new BeanPropertyRowMapper<>(Street.class));
}
@Override
@Transactional(readOnly = true)
public List<Street> getByCityIdAndLength(Long cityId, BigDecimal minimalLength, BigDecimal maximumLength) {
String sql = "SELECT * FROM simplegisdb.street st WHERE st.city_id = ? AND st.length >= ? AND st.length <= ?";
List<Object> args = new LinkedList<>();
args.add(cityId);
if (minimalLength == null || BigDecimal.ZERO.equals(minimalLength)) {
sql = "SELECT * FROM simplegisdb.street st WHERE st.city_id = ? AND st.length <= ?";
} else {
args.add(minimalLength);
}
if (maximumLength == null || BigDecimal.ZERO.equals(maximumLength)) {
sql = "SELECT * FROM simplegisdb.street st WHERE st.city_id = ? AND st.length >= ?";
} else {
args.add(maximumLength);
}
if (args.size() == 1) {
return null;
} else {
return jdbcTemplate.query(sql, args.toArray(), new BeanPropertyRowMapper<>(Street.class));
}
}
}
|
Connected Knowledge in Science and Mathematics Education While the traditional meaning of connected knowledge is valuable in some school subjects, it does not address the main activities of knowledge acquisition in subjects such as physics and mathematics. The goal of this article is to analyze the relationships between the concepts learning for understanding and connected knowledge, a central theme in feminist epistemology. In learning for understanding, the learner forms multiple, intricate connections among the concepts she is studying in school, between school concepts and her everyday concepts, and between school concepts and their wider context. Viewing connected knowledge as tightly related to understanding has several important implications. It brings connected knowledge into the central learning activities that take place in school science and mathematics, and gives it a high status. It contributes to our understanding of genderrelated patterns in thinking; and it may form a unifying theoretical framework for many studies and projects in the field of gender fair education.
|
package examples.simple;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class FunctionsTest {
@Test
void celsiusToFahrenheit() {
assertEquals(212, Methods.celsiusToFahrenheit(100));
assertEquals( 32, Methods.celsiusToFahrenheit(0));
}
}
|
Atrial fibrillation and incidence of dementia Background: Previous systematic reviews that examined whether atrial fibrillation (AF) is associated with dementia have relied on different study designs (including retrospective ones) and did not evaluate risk using meta-analysis. Methods: We searched Medline, Embase, and PsychINFO in September 2010 for published prospective studies reporting on the association between baseline AF and incident dementia. Pooled odds ratios for AF and dementia were calculated using the random effects model, with heterogeneity assessed using I2. Results: We identified 15 relevant studies covering 46,637 participants, mean age 71.7 years. One study that reported no significant difference in Mini-Mental State Examination scores between patients with or without AF could not be pooled. Meta-analysis of the remaining 14 studies showed that AF was associated with a significant increase in dementia overall (odds ratio 2.0, 95% confidence interval 1.4 to 2.7, p < 0.0001), with substantial heterogeneity (I2 = 75%). When stratified by participants, the association was significant (with little heterogeneity) in studies focusing solely on patients with stroke (7 studies, OR 2.4, 95% CI 1.7 to 3.5, p < 0.001, I2 = 10%), and of borderline significance (with substantial heterogeneity) for studies in broader populations (7 studies, OR 1.6, 95% CI 1.0 to 2.7, p = 0.05, I2 = 87%). For conversion of mild cognitive impairment to dementia, one study showed a significant association with AF (OR 4.6, 95% CI 1.7 to 12.5). Conclusion: There is consistent evidence supporting an association between AF and increased incidence of dementia in patients with stroke whereas there remains considerable uncertainty about any link in the broader population. The potential association between AF and incident dementia in mild cognitive impairment merits further investigation.
|
def log(self, msg, lvl=2):
if lvl >= self.lvl:
if self.path is not None:
with open(self.path, 'a+') as log_file:
log_file.write(f'{self._lvl_str(lvl)}; {str(datetime.now())[:-3]}; {msg};\n')
DockerLogger.stdout_log(msg, lvl=self._lvl_str(lvl), prefix=self.prefix)
|
Editorial. Drawing in Artistic Research Whence and Wherefore? The topic of this special issue of FormAkademisk is drawing. While the issue is hosted by the Oslo National Academy of the Arts (KHiO), the contributors have come in from different urban locations in Norway, including Volda, Trondheim, Bergen and Oslo. We would like to use this occasion to extend our thanks to the external peer-reviewers. They have helped in bringing the issue to its present level of quality
|
package com.radaee.annotui;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.DashPathEffect;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.drawable.ColorDrawable;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import com.radaee.viewlib.R;
@SuppressLint("AppCompatCustomView")
public class UILStyleButton extends Button {
private static float ms_density = -1;
private int Dp2Px(float dp) {
if (ms_density < 0) ms_density = getContext().getResources().getDisplayMetrics().density;
return (int) (dp * ms_density + 0.5f);
}
private int Px2Dp(float px) {
if (ms_density < 0) ms_density = getContext().getResources().getDisplayMetrics().density;
return (int) (px / ms_density + 0.5f);
}
private LinearLayout m_layout;
private UIAnnotPop m_popup;
private void init() {
setDash(null);
setBackgroundColor(-1);
m_layout = (LinearLayout) LayoutInflater.from(getContext()).inflate(R.layout.pop_lstyle, null);
OnClickListener listener = new OnClickListener() {
@Override
public void onClick(View v) {
setDash(((UILStyleView) v).getDash());
m_popup.dismiss();
}
};
UILStyleView vw_lstyle = m_layout.findViewById(R.id.vw_lsolid);
vw_lstyle.setOnClickListener(listener);
vw_lstyle = m_layout.findViewById(R.id.vw_ldash11);
vw_lstyle.setDash(new float[]{1, 1});
vw_lstyle.setOnClickListener(listener);
vw_lstyle = m_layout.findViewById(R.id.vw_ldash22);
vw_lstyle.setDash(new float[]{2, 2});
vw_lstyle.setOnClickListener(listener);
vw_lstyle = m_layout.findViewById(R.id.vw_ldash44);
vw_lstyle.setDash(new float[]{4, 4});
vw_lstyle.setOnClickListener(listener);
vw_lstyle = m_layout.findViewById(R.id.vw_ldash4222);
vw_lstyle.setDash(new float[]{4, 2, 2, 2});
vw_lstyle.setOnClickListener(listener);
vw_lstyle = m_layout.findViewById(R.id.vw_ldash16242);
vw_lstyle.setDash(new float[]{16, 2, 4, 2});
vw_lstyle.setOnClickListener(listener);
m_popup = new UIAnnotPop(m_layout, Dp2Px(120), Dp2Px(m_layout.getChildCount() * 30));
m_popup.setFocusable(true);
m_popup.setTouchable(true);
m_popup.setBackgroundDrawable(new ColorDrawable(0));
setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (!m_popup.isShowing()) {
int[] location = new int[2];
UILStyleButton.this.getLocationInWindow(location);
m_popup.show(UILStyleButton.this, location[0] + UILStyleButton.this.getWidth() + Dp2Px(10), location[1]);
}
}
});
}
public UILStyleButton(Context context) {
super(context);
init();
}
public UILStyleButton(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
init();
}
private Path mPath;
private Paint m_paint;
private float[] m_dashs_org;
protected void setDash(float[] dashs) {
m_dashs_org = dashs;
mPath = new Path();
m_paint = new Paint();
m_paint.setStyle(Paint.Style.STROKE);
if (dashs != null && dashs.length > 0) {
float[] m_dashs_draw = new float[dashs.length];
float scale = Dp2Px(1);
for (int i = 0; i < dashs.length; i++)
m_dashs_draw[i] = dashs[i] * scale;
m_paint.setPathEffect(new DashPathEffect(m_dashs_draw, 0));
}
m_paint.setStrokeWidth(Dp2Px(1));
m_paint.setColor(0xFF000000);
invalidate();
}
protected float[] getDash() {
return m_dashs_org;
}
protected void onDraw(Canvas canvas) {
float lw = Dp2Px(1);
float right = getWidth() - lw;
float y = getHeight() * 0.5f;
mPath.moveTo(lw, y);
mPath.quadTo(lw, y, right, y);
canvas.drawPath(mPath, m_paint);
}
}
|
Model of inhibition of the NPM-ALK kinase activity by herbimycin A. Anaplastic large cell lymphoma (ALCL) exhibiting the t(2;5) translocation is characterized by the resulting expression of the oncogenic fusion protein nucleophosmin-anaplastic lymphoma kinase (NPM-ALK) gene product. The ALK domain of NPM-ALK contains kinase activity, which is responsible for the autophosphorylation of tyrosine residues of the oncogenic protein and phosphorylation of SH2-protein substrates. Herbimycin A is a general protein tyrosine kinase inhibitor active as an antiproliferative compound against different types of mammalian cells. Herbimycin A inhibited the NPM-ALK-associated autophosphorylating activity in an in vitro cell-free kinase assay. The inhibition was specific when tested against other kinase inhibitors and extended to other cell lines derived from t(2;5)-ALCL. SUDHL-1 cells showed increasing percentage of cells in G after 18 h of incubation with a dose of herbimycin A. NPM-ALK, Akt, and pAkt were down-regulated after 24 h of incubation with herbimycin A. Apoptosis was observed only if the dose of inhibitor was given every 12 h for prolonged time. Our results show that herbimycin A interferes with NPM-ALK and Akt pathways in SUDHL-1 cells. It seems that prolonged inhibition of these biochemical pathways may lead to cell cycle arrest and apoptosis. This study supports the idea of investigating protein kinase inhibitors as therapeutic compounds for t(2;5)-ALCL.
|
/*input
3 101324247
9 1 14
*/
#include <bits/stdc++.h>
#define fi first
#define se second
#define endl '\n'
#define N 100005
#define INF 1000000000
#define mod 1000000007
#define oo 1000000000000000000
// #define int long long
#define MAXN 32000
using namespace std;
typedef pair<int,int> ii;
int n,k,a[N],need[105],cnt[N][105];
vector<int> p,divi;
long long res = 0;
void select(){
bool ok[MAXN + 5];
memset(ok, false, sizeof(ok));
for(int i = 2; i <= MAXN; i++){
if(ok[i]) continue;
p.push_back(i);
for(int j = i * i; j <= MAXN; j += i) ok[j] = true;
}
}
void fact(){
for(int i = 0; i < p.size(); i++){
if(k % p[i]) continue;
divi.push_back(p[i]);
while(!(k % p[i])) k /= p[i], need[divi.size() - 1]++;
}
for(int i = 1; i <= n; i++){
for(int j = 0; j < divi.size(); j++){
while(!(a[i] % divi[j])) a[i] /= divi[j], cnt[i][j]++;
}
if(a[i] == k) a[i] = 1;
else a[i] = 0;
// cout << a[i] << " ";
}
// cout << endl;
}
bool check(int sub, int pos){
for(int i = 0; i < divi.size(); i++)
if(cnt[pos][i] - cnt[sub][i] < need[i]) return false;
if(a[pos] - a[sub] == 0 && k != 1) return false;
return true;
}
void solve(){
for(int i = 1; i <= n; i++){
bool ok = true;
a[i] += a[i - 1];
for(int j = 0; j < divi.size(); j++){
cnt[i][j] += cnt[i - 1][j];
if(cnt[i][j] < need[j]) ok = false;
}
if(a[i] == 0 && k != 1) ok = false;
if(!ok) continue;
int l = 0, r = i - 1, mid;
while(l < r){
mid = (l + r + 1) >> 1;
if(check(mid,i)) l = mid;
else r = mid - 1;
}
res += 1LL * (l + 1);
}
cout << res;
}
signed main(){
ios_base::sync_with_stdio(0);
// freopen(".inp","r",stdin);
// freopen(".out","w",stdout);
select();
cin >> n >> k;
int xxx = k;
for(int i = 1; i <= n; i++) cin >> a[i];
fact();
solve();
// cout << endl << k << endl;
// cout << p.size();
return 0;
}
|
package br.com.vandersonsampaio.model.repository;
import br.com.vandersonsampaio.model.Session;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface ISessionRepository extends JpaRepository<Session, Integer> {
}
|
BUS CLAMPED PWM TECHNIQUE FOR THE SENSORLESS COMMUTATION OF BRUSHLESS The Brushless DC (BLDC) motor is a permanent magnet synchronous motor with trapezoidal back EMF waveform. The sensorless commutation of BLDC motor is the method of commutation of stator windings without using the rotor position sensors. The BLDC motor mainly used in variable speed applications. The motor speed is controlled by controlling the applied voltage and normally PWM switching technique is used to get variable voltage. In this paper a new type of pulse width modulation (PWM) switching technique is implemented for the control of three phase BLDC motor. In this PWM technique, the PWM signals are applied only to the high side switches of the inverter and low side switches signals are clamped to constant high voltage whenever a low side switch is be turned on. The bus clamped PWM will produce high torque in motor even at lower speed. The normal PWM technique and the bus clamped PWM technique are implemented on the dsPIC33CK microcontroller and the results are verified. Keywords Brushless DC (BLDC) motor, Sensorless Commutation, Pulse Width Modulation (PWM), Microcontroller. INTRODUCTION The permanent magnet synchronous motors are commonly used in high speed and high torque applications. "The motors trapezoidal back EMF waveform are known as Brushless DC (BLDC) motor". The rotor of the BLDC motor is a permanent magnet. The behaviour of the BLDC motor is similar to that of the conventional DC motor and they are used significantly in the constant torque applications." The rotor of the BLDC motor is a permanent magnet and the motor is rotated by the commutation of the stator windings". The commutation of the motor can be done using the information of the rotor position. The commutation of the BLDC motor by detecting rotor position using position sensors is known as sensored commutation technique. The commutation without using the position sensors is known as sesorless commutation technique. In the sensorless commutation technique the motor rotor position is detected using the back EMF produced in the motor windings. There are many sensorless algorithms have been developed using the microcontrollers and digital filters. The sensorless commutation is implemented in this paper using new PWM technique called as bus clamped PWM technique. In the bus clamped PWM technique is implemented for the three phase BLDC motor using dsPIC33CK microcontroller. In this PWM technique the motor is commutation through a three-phase inverter. During the turn on time of the high side switches of the inverter are the energised using PWM pulses and during the turn on time of the low side switches, the switches are clamped to the higher voltage. Hence PWM technique is called as bus clamped PWM technique. The bus clamped PWM technique will provide higher toque to the motor even at the lower speed. The hardware results of the bus clamped technique implemented for the BLDC motor are also explained in this paper. II. SENSORLESS CONTROL OF BLDC MOTOR The sensorless control of BLDC motor block diagram is shown in the figure 1. The three phase BLDC motor is excited with the help of a three-phase inverter and it is powered using a DC bus voltage. The PWM signals are generated using the controller and applied to the inverter. Also to detect the rotor position of the motor using the back EMF generated in the motor. There are many sensorless control methods have developed like microcomputer based, zero crossing detection from the back EMF, line to line voltage based, the rotor flux base and virtual third harmonic based algorithms. In this paper the sensolrless control algorithm is implemented based on back EMF detection using digital filter. The main modification is the implementation of bus clamped PWM technique. Fig. 1. Sensorless control of BLDC motor The switches Q1 to Q6 are switched in the 120 degree electrical in the conduction mode and two switches conducting at a time. The speed of the motor is can varied by varying the applied voltage. The standard technique to get variable speed is by PWM based DC voltage to the motor. III. BUS CLAMPED PWM TECHNIQUE In the normal PWM switching technique both the high side switches (Q1 or Q3 or Q4) and the low side switches (Q2 or Q4 or Q6) will turned on and turned off at time. The standard PWM signals that are applied to the inverter to obtain the variable voltage are shown in the figure 2. The PWM2H signal is applied to Q3 switch and PWM1L signal is applied to Q4. In this mode both low side switch and the high side switch will have the same conduction time. Due the same conduction and at very low speed the motor will need very small voltage. Hence the duty cycle applied will be small, correspondingly the conduction time will be less. The winding of the BLDC motor has significant inductance which causes the winding current to go to discontinuous mode of the conduction shown in the figure 3. The discontinuous current is due to the discharge of energy stored in the motor inductance during off time of the PWM signal. "The electromagnetic torque produced by the motor is directly proportional to the phase current of the motor". Due to the discontinuous current the magnitude of the electromagnetic torque produced becomes low. This would be the disadvantage for the high starting torque applications. The bus clamped PWM technique is introduced to overcome the disadvantage of the discontinuous current at low speeds. In the bus clamped PWM switching technique the high side switches (Q1 or Q3 or Q4) will be turned on and off depending on the PWM duty cycle. But the low side switches (Q2 or Q4 or Q6) will be clamped the maximum voltage during their conduction time. The bus clamped PWM signals applied to the motor is shown in figure 3. The low side switching signals are always turned in this PWM technique. Because of this the motor inductance will not have sufficient negative voltage to get discharge and to go into discontinuous conduction mode. The motor inductance energy discharge will be very slow, and magnitude of the motor will be high compared to the normal PWM technique. The motor phase voltage and current waveform is shown 5 with bus clamped PWM technique The bus clamped PWM is implemented on the hardware for Brushless DC motor with sensorless commutation algorithm using dcPIC33CK microcontroller. The motor parameters used for the hardware implementation are shown in table 1. The hardware setup for the implementation of the bus clamped PWM technique based sensorless control scheme is shown in the figure 6. The DC power supply is used to power up the hardware and the motor. The MCLV-2 motor control development board with dsPIC33CK microcontroller is used develop bus clamped PWM signals and the sensorless algorithm. The computer is used write the algorithm and it is programmed to microcontroller using a programmer. The oscilloscope is used watch the signals. The BLDC motor phase voltage and phase current waveform captured at motor running at maximum speed is shown in the figure 8. The phase current and phase voltage are measured at the one of the phases of three phase BLDC motor. The figure 8 also contains the bus clamped PWM signals applied to the motor at the same time. The motor phase voltage and current for the same motor using standard PWM technique is shown in the figure 9 at the same speed. From the figures 8 and 9, the motor takes lesser current in case of standard PWM technique as compared to bus clamped PWM technique at the same speed. Also the current in the standard PWM technique is in discontinuous mode, hence the electromagnetic torque produced by the motor will be less compared to that with the torque produced by the motor using bus clamped PWM technique. VI. CONCLUSION The new PWM technique known bus clamped PWM technique is developed for the sensorless control of the BLDC motor. The advantages of bus clamped PWM technique over the standard PWM technique are discussed. The bus clamped PWM technique will provide the higher electromagnetic torque to the motor at the lower speeds. This technique will be very helpful in the BLDC motor high torque applications.. In bus clamped PWM technique the motor will take lower voltage to produce higher electromagnetic torque when compared to standard PWM technique. The developed PWM technique is implemented and tested on the hardware.
|
Higher Performance Adaptive Control of a Flexible Joint Robot Manipulators Joint flexibility limits the performance of an industrial robot by introducing resonant frequencies in the same range of the control bandwidth. If joint flexibility is considered in the modelling, advanced control techniques can be designed to achieve a higher performance. This paper presents an adaptive control scheme for a twodegree of freedom flexible joint robot. The adaptive approach is applied to design a control signal for each joint (modeled by twoequations of second order), to withstand all uncertainties in parameters and load disturbances. Asymptotic stability is insured regardless of the joint flexibility value, by the use of Liapunov's direct method, i.e., the results are not restricted to weak joint elasticity. A simulation study was carried out to evaluate the performance of the proposed control law in case of flexible joint robot model. It was found that the adaptation technique is robust to parameters and load changes.
|
WHEELING, W.Va. -- Elizabeth Stockton Hazlett and Benjamin Michael Allen were united in marriage on Saturday at St. Matthews Episcopal Church in Wheeling. The Revs. Mark Seitz and Mark Byrer officiated. Music was provided by organist, Robert Troeger, accompanied by trumpet and strings.Parents are George and Verna Hazlett of Wheeling, W.Va., and Scott and Amy Allen of Wooster.The church was decorated with avalanche and amelia roses, peonies and sweet peas.The bride was given in marriage by her father and wore an Alvina Valente gown.Maids of honor were Jane Hazlett, sister of the bride, and Melissa Noble. Bridesmaids were Elizabeth Allen, sister of the groom, Sara Woo, Cole Bozic, Sarah King and Adrienne Sommerville. Flower girl was Caroline Hazlett.Best man was Nicholas Allen, brother of the groom, with groomsmen, John Allevato, Dave Palmer, Clay Schmitt, Steve Schmitz and Jason Young.A reception was held at Glessner Auditorium at Wilson Lodge in Oglebay Park, W.Va.The couple will reside in Morgantown, W.Va., following a wedding trip to Lake Tahoe, Nev.The bride will be a senior at West Virginia University School of Nursing and is a clinical assistant at Ruby Memorial Hospital.The groom will be a senior at West Virginia University School of Business and Economics. He is a technical support associate at Service Plus Payroll Service.The couple are both Young Life leaders at University High School in Morgantown, W.Va.The rehearsal dinner was hosted by the groom's parents at Stratford Springs in Wheeling.
|
// NewDeleteStackDefault creates a DeleteStackDefault with default headers values
func NewDeleteStackDefault(code int) *DeleteStackDefault {
return &DeleteStackDefault{
_statusCode: code,
}
}
|
#include<math.h>
#include<stdlib.h>
#include<stdio.h>
#include<string.h>
#include <ctype.h>
#include"kdtree.c"
int p;
struct IzhNeu{
float a,b,c,d,u,v,I; //Basic arguments of Izhikevich Neuron
float x,y,z;
unsigned int InNum,Nnum;
char fired;
struct IzhNeu** InNeus;//In fact it is the list of output-to neurons.
float* S;
};
struct Network{
struct IzhNeu** Neus;
unsigned int NeuNum;
unsigned int NetNum;//
};
struct NetU{
struct Network **NetList;
int NetNum;
};
unsigned long seed=0;
void SeedInti(){ //Intitial a seed for Rand()
srand((unsigned)time(NULL));
}
int RandIntiFlag=0;
float FloatRandNum(){
//Generate a random number in float
// between 0 and 1
float a;
if(RandIntiFlag==0)
a=rand()/(float)RAND_MAX;
return a;
}
float FSqur(float a){
return a*a;
}
void ExNeuInit(struct IzhNeu* Neu){
if(Neu!=NULL){
float re=FloatRandNum();
re=re*re;
(*Neu).a=0.02;
(*Neu).b=0.2;
(*Neu).c=-65+15*re;
(*Neu).d=8-6*re;
(*Neu).v=-65;
(*Neu).u=((*Neu).b)*((*Neu).v);
}
}
void InNeuInit(struct IzhNeu* Neu){
if(Neu!=NULL){
float re=FloatRandNum();
re=re*re;
(*Neu).a=0.02+0.08*re;
(*Neu).b=0.2-0.05*re;
(*Neu).c=-65;
(*Neu).d=2;
(*Neu).v=-65;
(*Neu).u=((*Neu).b)*((*Neu).v);
}
}
void ExWeightsInit(struct IzhNeu* Neu){
if(Neu!=NULL){
for(unsigned int i=0;i<(*Neu).InNum;i++){
(*Neu).S[i]=FloatRandNum()*0.5;
}
}
}
void InWeightsInit(struct IzhNeu* Neu){
if(Neu!=NULL){
for(unsigned int i=0;i<(*Neu).InNum;i++){
(*Neu).S[i]=-FloatRandNum();
}
}
}
struct IzhNeu* ExNeuGen(unsigned int num,unsigned int nnum){
struct IzhNeu* Neu=malloc(sizeof(struct IzhNeu));
if(Neu!=NULL){
(*Neu).InNum=num;
ExNeuInit(Neu);
(*Neu).S=malloc(num*sizeof(float));
(*Neu).InNeus=malloc(num*sizeof(struct IzhNeu*));
(*Neu).Nnum=nnum;
}
ExWeightsInit(Neu);
return Neu;
}
//
struct IzhNeu* InNeuGen(unsigned int num,unsigned int nnum){
struct IzhNeu* Neu=malloc(sizeof(struct IzhNeu));
if(Neu!=NULL){
(*Neu).InNum=num;
InNeuInit(Neu);
(*Neu).S=malloc(num*sizeof(float));
(*Neu).InNeus=malloc(num*sizeof(struct IzhNeu*));
(*Neu).Nnum=nnum;
}
InWeightsInit(Neu);
return Neu;
}
void NetInit(struct Network* in){//
if(in!=NULL){
for(unsigned int i=0;i<(*in).NeuNum;i++){
if(FloatRandNum()>0.8){
(*in).Neus[i]=InNeuGen(1000,i);
//puts("e");
}else{
(*in).Neus[i]=ExNeuGen(1000,i);
//puts("i");
}
}
}
}
struct Network* NetGen(unsigned int num){
struct Network* Net;
Net=malloc(sizeof(struct Network));
(*Net).NeuNum=num;
(*Net).Neus=malloc(num*(sizeof(struct IzhNeu*)));
return Net;
}
void StepV(struct IzhNeu* Neu){
(*Neu).fired=0;
if((*Neu).v>=30){
(*Neu).fired=1;
(*Neu).v=(*Neu).b;
(*Neu).u=(*Neu).d+(*Neu).u;
}
(*Neu).v=(*Neu).v+(0.04*(*Neu).v*(*Neu).v+5*(*Neu).v+140-(*Neu).u+(*Neu).I);
(*Neu).u=(*Neu).u+(*Neu).a*((*Neu).b*(*Neu).v-(*Neu).u);
(*Neu).I=0;
}
void ConInit(struct Network* net){
puts("ok");
struct heap* pre;
struct kdtree* ptree;
double pos[3],pt[3];
ptree=kd_create(3);
int j=0;
for(int i=0;i<(*net).NeuNum;i++){
while(net->Neus[i]->x==0||net->Neus[i]->y==0||net->Neus[i]->z==0){
net->Neus[i]->x=FloatRandNum();
net->Neus[i]->y=FloatRandNum();
net->Neus[i]->z=FloatRandNum();
}
}
for(int i=0;i<net->NeuNum;i++){
pt[0]=net->Neus[i]->x;
pt[1]=net->Neus[i]->y;
pt[2]=net->Neus[i]->z;
kd_insert3(ptree,(double)pt[0],(double)pt[1],(double)pt[2],(net->Neus)[i]);
printf("inserting tree...%d x y z %f %f %f\n",i,net->Neus[i]->x,net->Neus[i]->y,net->Neus[i]->z);
}
puts("ok2");
for(int i=0;i<net->NeuNum;i++){
printf("Init...%d of %d Neurons...\n",i,net->NeuNum);
pt[0]=net->Neus[i]->x;
pt[1]=net->Neus[i]->y;
pt[2]=net->Neus[i]->z;
//printf("%d x y z %f %f %f\n",i,net->Neus[i]->x,net->Neus[i]->y,net->Neus[i]->z);
pre=kd_nearest_n( ptree, pt, 800,1 );
//printf("%d x y z %f %f %f\n",i,net->Neus[i]->x,net->Neus[i]->y,net->Neus[i]->z);
for(j=0;j<net->Neus[i]->InNum*0.8&&(pre->size>0);j++){
net->Neus[i]->InNeus[j]=(struct IzhNeu*)heap_get_max(pre)->item->data;
heap_remove_max(pre);
}
printf("%d\n ",j);
if(j==0){
printf("%d x y z %f %f %f\n",i,net->Neus[i]->x,net->Neus[i]->y,net->Neus[i]->z);
gets();
}
//gets();
//puts("ok");
for(int j=net->Neus[i]->InNum*0.8;j<net->Neus[i]->InNum;j++){
(*((*net).Neus[i])).InNeus[j]=(*net).Neus[rand()%(*net).NeuNum];
}
heap_free(pre);
}
// kd_free(ptree);
//puts("ok");
}
void StepI(struct IzhNeu* Neu){
float pt[3];
struct IzhNeu* in;
if((*Neu).fired==1){
for(int i=0;i<(*Neu).InNum;i++){
(*((*Neu).InNeus[i])).I=(*Neu).S[i]+(*Neu).S[i]+(*((*Neu).InNeus[i])).I;
}
}
}
void StepNet(struct Network* net){
for(int i=0;i<(*net).NeuNum;i++){
StepV((*net).Neus[i]);
//StepI((*net).Neus[i]);
}
}
struct NetU* NetUGen(int num){
struct NetU* u=malloc(sizeof(struct NetU));
u->NetList=malloc(sizeof(struct Network*));
return u;
}
|
// Copyright 2020 Dean.
// Authors: Dean <<EMAIL>>
// Date: 2020/9/24 12:08 下午
// 文件介绍
package system
import "testing"
func TestGetSystemInfo(t *testing.T) {
info := GetSystemInfo()
t.Log(info)
}
|
import math
array = []
for i in range(5):
array.append(int(input()))
res = 0
round_array = []
for j in array:
round_array.append(math.ceil(j /10) * 10)
tmp = 0
for k, l in zip(array, round_array):
if abs(tmp) < abs(k - l):
tmp = k - l
res = sum(round_array)
print(res + tmp)
|
Taipei, July 23 (CNA) The Environmental Protection Administration (EPA) announced Monday it will subsidize interest on loans and provide credit guarantees to help owners of old trucks purchase new vehicles that meet the latest emission standards.
Many truck drivers have protested in recent weeks the government's plan to phase out old diesel-fueled trucks by instituting tougher emission standards, arguing that it will drive them out of business and make it hard to earn a living.
The new standards were originally planned to take effect in 2020, but during a protest on July 15 when more than 500 old trucks and motorbikes blocked the road outside the EPA building, the EPA said it would move back the start date to 2023 to give the drivers more time to comply.
They will also be able to get financial support to purchase new vehicles, Tsai Hung-teh (蔡鴻德), director-general of the EPA's Department of Air Quality Protection and Noise Control, said on Monday.
Under the incentive program, the administration will provide guarantees for 70-90 percent of the loans for new truck purchases and subsidize 1 percentage point of the interest rate on the loans, Tsai said.
The loan package is set to begin Sept. 1 and will target Level 1 diesel trucks, manufactured prior to June 30, 1993, and Level 2 diesel trucks, produced between July 1, 1993 and June 30, 1999.
Taiwan has five emission standard levels for diesel trucks based on the age of the vehicle, with higher levels representing tighter standards.
Level 3 to Level 5 are for vehicles produced or imported from July 1, 1999 to Sept. 30, 2006; Oct. 1, 2006 to Dec. 31, 2011; and Jan. 1, 2012 to the present.
The EPA originally wanted diesel trucks 14 years and older to meet the Level 4 emission standard by 2020, angering drivers of older trucks, many of whom are in business for themselves.
Tsai said the financial support package is expected to help phase out some 73,000 Level 1 and Level 2 old diesel trucks from public roads.
Air pollution is a matter that concerns everyone, EPA chief Lee Ying-yuan (李應元) said, urging the public to help the government clamp down on auto emissions in the interest of public health.
|
//
// Copyright (c) SRG SSR. All rights reserved.
//
// License information is available from the LICENSE file.
//
#import "ApplicationSectionInfo.h"
NS_ASSUME_NONNULL_BEGIN
/**
* Common protocol for view controllers supporting application navigation.
*/
API_UNAVAILABLE(tvos)
@protocol PlayApplicationNavigation <NSObject>
/**
* Open an application section described by the provided information. If the section is supported by the class
* implementing this protocol, this method must be implemented to display the section and return `YES`. If the
* section is not supported the method must not display anything and return `NO`.
*/
- (BOOL)openApplicationSectionInfo:(ApplicationSectionInfo *)applicationSectionInfo;
@end
NS_ASSUME_NONNULL_END
|
# terrascript/resource/scaleway.py
import terrascript
class scaleway_account_ssh_key(terrascript.Resource):
pass
class scaleway_baremetal_server_beta(terrascript.Resource):
pass
class scaleway_bucket(terrascript.Resource):
pass
class scaleway_instance_ip(terrascript.Resource):
pass
class scaleway_instance_ip_reverse_dns(terrascript.Resource):
pass
class scaleway_instance_volume(terrascript.Resource):
pass
class scaleway_instance_security_group(terrascript.Resource):
pass
class scaleway_instance_server(terrascript.Resource):
pass
class scaleway_instance_placement_group(terrascript.Resource):
pass
class scaleway_k8s_cluster_beta(terrascript.Resource):
pass
class scaleway_k8s_pool_beta(terrascript.Resource):
pass
class scaleway_lb_beta(terrascript.Resource):
pass
class scaleway_lb_backend_beta(terrascript.Resource):
pass
class scaleway_lb_frontend_beta(terrascript.Resource):
pass
class scaleway_rdb_instance_beta(terrascript.Resource):
pass
class scaleway_object_bucket(terrascript.Resource):
pass
class scaleway_user_data(terrascript.Resource):
pass
class scaleway_server(terrascript.Resource):
pass
class scaleway_token(terrascript.Resource):
pass
class scaleway_ssh_key(terrascript.Resource):
pass
class scaleway_ip(terrascript.Resource):
pass
class scaleway_ip_reverse_dns(terrascript.Resource):
pass
class scaleway_security_group(terrascript.Resource):
pass
class scaleway_security_group_rule(terrascript.Resource):
pass
class scaleway_volume(terrascript.Resource):
pass
class scaleway_volume_attachment(terrascript.Resource):
pass
__all__ = [
"scaleway_account_ssh_key",
"scaleway_baremetal_server_beta",
"scaleway_bucket",
"scaleway_instance_ip",
"scaleway_instance_ip_reverse_dns",
"scaleway_instance_volume",
"scaleway_instance_security_group",
"scaleway_instance_server",
"scaleway_instance_placement_group",
"scaleway_k8s_cluster_beta",
"scaleway_k8s_pool_beta",
"scaleway_lb_beta",
"scaleway_lb_backend_beta",
"scaleway_lb_frontend_beta",
"scaleway_rdb_instance_beta",
"scaleway_object_bucket",
"scaleway_user_data",
"scaleway_server",
"scaleway_token",
"scaleway_ssh_key",
"scaleway_ip",
"scaleway_ip_reverse_dns",
"scaleway_security_group",
"scaleway_security_group_rule",
"scaleway_volume",
"scaleway_volume_attachment",
]
|
#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
#define mod 1000000007
int main()
{
int N , M , t;
scanf("%d %d",&N,&M);
int arr[M+5];
char done[M+5][30];
memset(arr ,0 , sizeof(arr));
memset(done , 0 , sizeof(done));
string ip;
for(int i=0;i<N;i++)
{
cin >> ip;
for(int j=0;j<M;j++){
t = ip[j]-'A';
if(done[j][t] == 0){
done[j][t] = 1;
arr[j]++;
}
}
}
//for(int i=0;i<M;i++)
// printf("%d ", arr[i]);
//printf("\n");
long long int ans = 1;
for(int i=0;i<M;i++)
{
ans = ans*arr[i];
if(ans >= mod)
ans = ans%mod;
}
printf("%lld\n", ans);
return 0;
}
|
<gh_stars>10-100
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hadoop.fs;
import java.net.URI;
import org.apache.hadoop.conf.Configuration;
/**
* This class is thin layer to manage the FS related keys in
* a configuration object.
* It provides convenience static method to set and get the keys from a
* a configuration.
*
*/
final class FsConfig {
private FsConfig() {}
// Configuration keys and default values in the config file
// TBD note we should deprecate the keys constants elsewhere
// The Keys
static final String FS_DEFAULT_NAME_KEY = "fs.default.name";
static final String FS_HOME_DIR_ROOT_KEY = "fs.homeDir";
static final String FS_REPLICATION_FACTOR_KEY = "dfs.replication";
static final String FS_BLOCK_SIZE_KEY = "dfs.block.size";
static final String IO_BUFFER_SIZE_KEY ="io.file.buffer.size";
// The default values
// Default values of SERVER_DEFAULT(-1) implies use the ones from
// the target file system where files are created.
static final String FS_DEFAULT_NAME = "file:///";
static final String FS_HOME_DIR_ROOT = "/user"; // relative to FS_DEFAULT
static final short FS_DEFAULT_REPLICATION_FACTOR = 3;
static final long FS_DEFAULT_BLOCK_SIZE = 32 * 1024 * 1024;
static final int IO_BUFFER_SIZE =4096;
public static String getDefaultFsURI(final Configuration conf) {
return conf.get(FS_DEFAULT_NAME_KEY, FS_DEFAULT_NAME);
}
public static String getHomeDir(final Configuration conf) {
return conf.get(FS_HOME_DIR_ROOT_KEY, FS_HOME_DIR_ROOT);
}
public static short getDefaultReplicationFactor(final Configuration conf) {
return (short)
conf.getInt(FS_REPLICATION_FACTOR_KEY, FS_DEFAULT_REPLICATION_FACTOR);
}
public static long getDefaultBlockSize(final Configuration conf) {
return conf.getLong(FS_BLOCK_SIZE_KEY, FS_DEFAULT_BLOCK_SIZE);
}
public static int getDefaultIOBuffersize(final Configuration conf) {
return conf.getInt(IO_BUFFER_SIZE_KEY, IO_BUFFER_SIZE);
}
public static Class<?> getImplClass(URI uri, Configuration conf) {
String scheme = uri.getScheme();
if (scheme == null) {
throw new IllegalArgumentException("No scheme");
}
return conf.getClass("fs." + uri.getScheme() + ".impl", null);
}
/**
* The Setters: see the note on the javdoc for the class above.
*/
public static void setDefaultFS(final Configuration conf, String uri) {
conf.set(FS_DEFAULT_NAME_KEY, uri);
}
public static void setHomeDir(final Configuration conf, String path) {
conf.set(FS_HOME_DIR_ROOT_KEY, path);
}
public static void setDefaultReplicationFactor(final Configuration conf,
short rf) {
conf.setInt(FS_REPLICATION_FACTOR_KEY, rf);
}
public static void setDefaultBlockSize(final Configuration conf, long bs) {
conf.setLong(FS_BLOCK_SIZE_KEY, bs);
}
public static void setDefaultIOBuffersize(final Configuration conf, int bs) {
conf.setInt(IO_BUFFER_SIZE_KEY, bs);
}
}
|
Up-conversion nanomaterial doped with Au nanoparticles with photothermal conversion for multi-modality imaging : In this study, a new method for synthesizing Au-NaYF 4 :Yb 3+ /Er 3+ -DSPE-PEG 2K nanocom-posites was introduced. Using a hydrothermal method, the synthesized Yb 3+ - and Er 3+ -codoped NaYF 4 upconversion luminescent materials and Au nanoparticles were doped into upconversion nanomaterials and modified with DSPE-PEG 2k up-conversion nanomaterials. This material is known as Au-UCNPs-DSPE-PEG 2k, it improves both the luminous intensity because of the doped Au nanoparticles and has low cytotoxicity because of the DSPE-PEG 2k modified. Exciting UCNPs with a wavelength of 980nm near-infrared light will emit light with a wavelength of 520nm to fur-ther excite gold nanoparticles to convert light energy into heat. Successful synthesized gold nanoparticles was confirmed using transmission electron microscopy (TEM). The morphology of UCNPs was observed using scanning electron microscopy (SEM), and the mapping confirmed the successful doping of Au nanoparticles. Fluorescence spectra were used to compare changes in luminescence intensity before and after doping Au nanoparticles. The cytotoxicity of Au-UCNPs-DSPE-PEG 2K was tested via the cell counting kit-8 (CCK-8) method, and its imaging ability was character-ized using the Magnetic Resonance Imaging (MRI) and Tomography Introduction Generally, upconversion rare-earth nanomaterials are used in many fields because of their high fluorescence intensity. Recently, their application in biomedicine has been extensively studied. Many researchers proposed that they can be used in biological imaging because they provide considerable advantage in the fight against major diseases such as cancer. However, the common limitation is that upconversion rare-earth nanomaterials have insufficient luminous intensity and are toxic to biological cells; therefore, the modification of structure and surface is necessary. To increase luminous intensity, many researchers proposed doping Mo 3+, Cu 2+, and other metal ions in the NaYF4:Yb 3+ / Er 3+ unit cell; however, the effect is not significant. Other studies proposed doping with Ag, which has a significant effect but Ag has a high light-to-heat conversion efficiency and can cause cell apoptosis without targeting; therefore, Ag cannot be used in biological studies. Many researchers proposed developing core-shell structures such as NaYF4:Yb 3+ /Er 3+ @NaGdF4:Yb 3+ and NaYF4:Yb 3+ /Er 3+ @NaNdF4:Yb 3+ /Tm 3+ @NaGdF4:Yb 3+. Alternatively, the material surface is covered with a biocompatible coating such as DSPE-PEG2K and ICG. Although these operations can reduce biological toxicity and meet the basic requirements for use in biological cells or animals, these structures will indeed reduce the luminous intensity of upconversion luminescent materials. If such a material is used as a contrast agent for CT imaging, the image will be unclear; moreover, the tumor cannot be observed and additional diagnosis and treatment will be difficult. Therefore, this study proposes a new structural upconversion nanomaterial that has both extremely low cytotoxicity and good luminescence intensity and good targeting that can accurately label tumor cells and can be used for in-vivo imaging and obtain clear tumor images using Micro-CT. Synthesis of Au nanoparticles By dropping, 60 mL of 0.05 mol/L of citric acid solution was added to 3 mL of 0.02 mol/L of HAuCl4 to obtain a mixture. Moreover, after 5 min of continuous stirring, the solution was transferred to a 100 mL reactor and placed in an oven for the reaction at 180°C for 12 h. The reaction was then cooled to room temperature, washed, and centrifuged to obtain solid Au nanoparticles, and then added to 10 mL of deionized water and PVP, and then placed in a test tube to prepare the sol for use. Synthesis of Au-UCNPs RE2O3 (RE = Y, Yb, Er) was heated to achieve complete dissolution in excess nitric acid and then transferred to a vacuum system for evaporation to obtain a solid RE(NO3)3, which was then dissolved in deionized water and recrystallized twice. A certain amount of solid RE(NO3)3 was dissolved in deionized water, and EDTA (molar ratio of EDTA: RE(NO3)3 = 1:1) was added and stirred at 600 rpm for 1 h, the mixture was then weighed and dissolved in sodium fluoride in deionized water by ultrasound, and then the solution was added and stirred at 600 rpm for 1 h. Finally, the pH value was adjusted to 5.5 with NaOH and add 10 ml of sliver, and then place it in a hydrothermal kettle to react at 190°C for 24 h. The reaction products were cooled, centrifuged, and washed twice with ethanol/deionized water (1:1 v/v), and dried in vacuum at 80°C for 3 h. The resultant powder is dispersed in cyclohexane for later use. DSPE-PEG2K modified Au-UCNPs First, 6 mL of Au-UCNPs (0.4 mmol) dispersed in chloroform were mixed with 20 mL of DSPE-PEG2K (100 mg) chloroform solution in 5 mL open glass bottles. After heating at 75°C for 5 min to remove the chloroform, adding 24-mL water to complete the ultrasonic dispersion, stirring at 75°C for 10 min, cool to room temperature, centrifuged at 18000 rpm for 8 min to take the precipitate, and adding 1 mL of normal saline to disperse, large particles were removed by centrifugation at 5000 rpm for 5 min and then dried by a blast at 75 °C. Characterization Transmission electron microscopy (TEM) measurements were performed on a JEOL 2011 microscope operating at 200 kV. All samples were first dispersed in ethanol and then collected using a Cu grid covered with a carbon film for measurement. To determine the elemental composition of the samples, energy-dispersive X-ray spectroscopy (EDS) of the samples was performed on a JEOL 2010 EDS instrument using high-resolution transmission electron microscopy (HRTEM) measurements. Inductively coupled plasma-atomic emission spectrometry (ICPAES) was performed using a Perkin Elmer 7300DV apparatus. Scanning electron microscopy (SEM) images were obtained using a Philips XL30 electron microscope operating at 20 kV. Before this characterization, a Au film was sprayed on the sample. The upconversion luminescence spectrum was obtained using a spectrum analyzer (ANDO AQ6317, Japan). The sample was placed in a 1.0-cm path length support, which was excited using a 980-nm CW semiconductor diode laser (Pmax 800 mW, 1000 mA). The upconversion luminescence spectrum was obtained by the spectrophotometer using a multimode fiber having a core diameter of 0.6 mm. The distance between the top of the fiber and sample is ~2 mm. CCK-8 assay for cytotoxicity The culture medium in the flask was sucked out, washed with PBS, and then 0.25% of trypsin was added to digest cells after culturing HeLa cells in the logarithmic growth phase. After the removal of trypsin, the DMEM medium containing 10% fetal bovine serum was added to blow the cells, which were then transferred to the sampling tank and blown well. Subsequently, 100 L cells were injected into a 96-well plate (1 10 4 cells/well) and incubated for 24 h in a constant temperature incubator at 37°C (5% CO2). The cells were incubated for 1.5 h in an incubator at 37°C with 5% CO2 in accordance with concentrations of 200, 300, 400, 500, and 600 g/mL. The culture medium was blotted out, PBS was rinsed twice, the culture medium was replaced in the 96-well plates with 100 L of fresh DMEM containing 10% fetal bovine serum, and then 10 L of CCK-8 solution was added to each well. The absorbance of each well at 450 nm was measured using a microplate reader after 2 h of culturing in the incubator. The cell survival rate calculation formula is as follows: Cell survival rate (%) = (A sample)/(A control) 100% Establishment of animal tumor model A BALB/c female white mouse with SPF grade weighing 18g was depilated, and Hela cells growing in log phase were subcutaneously injected into the upper right hind leg of the mouse to construct a mouse Hela subcutaneous tumor growth model. MRI and CT imaging of mice Use isoflurane to anaesthetize the mice throughout the entire process, place them in animal MRI machine (NM42-040H-I), which with a magnetic field strength of 1T, and perform a tomographic scan of the tumor site on mice whose tumors grow to 100 mm 3 to obtain pre images. Then 200ug/ml of Au-UCNPs-DESP-PEG2K solution was injected, and images were collected again. Using the same method, place the mouse on a SPECT/CT (tube current: 615 A, tube voltage: 55kV) animal bed, perform pre image acquisition of full-angle CT imaging in precise mode, and then acquire the tomographic image of the tumor site again after the injection of 200ug/ml of Au-UCNPs-DESP-PEG2K solution. H&E stained sections Take one mouse from the control group and one from the experimental group, take out their organs (heart, liver, spleen, lung, kidney) and tumor sites, and soak them in a 10% formalin buffer solution for 24 hours. Carry out H&E pathological staining of longitudinal section, and observe the influence of A on them using electron microscope. Results and Discussion The TEM images of Au nanoparticles (Fig. 1) prepared using the hydrothermal method show that they are spherical and have an average diameter of 5 nm. TEM images show the morphology of Au-UCNPs (Fig. 2). They are rod structures with a length of 50 nm-100 nm and narrow ends. The reason for this phenomenon is that during the nucleation and growth of the nanoparticles by coprecipitation-hydrothermal method, the temperature controls its width and shape, and the time determines its length. When the temperature starts to drop, the two ends of the nanorod begin to shrink with the decrease of temperature, and finally show the phenomenon of narrowing at both ends. The successful doping of Au into nanoparticles was proved by energy spectrum (Fig. 3). Both UCNPs and Au-UCNPs were prepared in 0.2 M solutions and their luminescence intensity (Fig. 4) at a wavelength of 980 nm was tested. The results demonstrated that the luminescence intensity increased by ~2.5 times after doping with Au. The modified rare-earth nanomaterials were dispersed in normal saline to prepare different concentrations, after which HeLa cells were cultured for 4h and their activity was tested (Fig. 5). It has been suggested that when the concentration is less than 400 ug/mL, the cell survival rate is higher than 89%. Especially at a concentration of 200 ug/mL, the cell survival rate was more than 99%. Combined with Fig. 4, the luminescence intensity of rare earth, 200 ug/mL concentration of rare-earth nanomaterials not only have sufficient safety but also have a high luminous intensity. When the concentration of rareearth ions is as high as 500 ug/mL or even 600 ug/mL, the cell survival rate is still higher than 80%. However, no matter how low the concentration of this material is without being modified by DSPE-PEG2K, there is always high cytotoxicity. If such material is used for animal experiments, it will cause serious damage to other animal tissues, so the surface must be modified. A 200 g/mL concentration of Au-UCNPs-DSPE-PEG2K was intratumorally injected in the tumor necrosis area, the enhanced MRI signal can be clearly observed in the injection area (Fig. 6). A 200 g/mL concentration of Au-UCNPs-DSPE-PEG2K was intratumorally injected in the mice. Fig. 7(c) shows that the tumor site of the mouse before injection has no signal under Micro-CT imaging; furthermore, 30 min after the injection of Au-UCNPs-DSPE-PEG2K (Fig. 7 d), the tumor site of the mouse shows a CT Signal. In addition to the imaging function, Au-UCNPs-DSPE-PEG2K has a certain photothermal conversion efficiency, and its temperature rise curve (Fig. 9) meets the requirements of photothermal treatment. In the future, Au-UCNPs-DSPE-PEG2K may be used as a reagent for photothermal treatment of cancer. Conclusions The doped Au nanoparticles increase the luminous intensity of UCNPs; it greatly improves the luminous intensity of up-conversion nano-materials and has extremely low cytotoxicity. These nanoparticles can be used as an excellent biomedical material. Second, compared with the traditional medical imaging, tumor images can be observed in the multi-modality imaging system. The images can play an important role in future treatment of tumor, thus providing complete and clear images for diagnosing and treating complex cancers such as blood metastasis. Finally, the extremely high luminous intensity of this material is primarily attributed to Au nanoparticles, which have good photothermal conversion efficiency. In future, this material could be used along with photothermal therapy (PTT), which is used to complete the cancer treatment and diagnosis. Funding: This research received no external funding. Institutional Review Board Statement: Not applicable. Informed Consent Statement: Not applicable. Data Availability Statement: No new data were created or analyzed in this study. Data sharing is not applicable to this article.
|
/**
* Confirm the path before deleting the image.
*
* @param originalPath image path before update
* @param newPath image path to be updated
*/
public void handleImage(String originalPath, String newPath) {
if (StringUtils.isEmpty(newPath) || (!originalPath.equals(newPath))) {
removeFileFromS3(originalPath);
}
}
|
True Blood alum Sam Trammell is on the call sheet for Fox 2000’s Roxann Dawson-directed film, The Impossible, a faith-based true story of Joyce Smith’s account of how her faith and prayer led to her son’s recovery after he was proclaimed lifeless. Chrissy Metz stars as Smith, along with Josh Lucas, Mike Colter, and Topher Grace co-star. The pic is based on Smith’s book The Impossible: The Miraculous Story of a Mother’s Faith and Her Child’s Resurrection, which was adapted for the screen by Grant Nieporte. Trammell will play Dr. Kurt Sutterer, an eyewitness to how Joyce’s prayers for John manifest. DeVon Franklin is producing the pic, which is in production in Canada. Trammell, who recently had a guest arc on NBC’s ratings juggernaut, This Is Us, is repped by Innovative and Luber Roklin Entertainment.
The African American Film Critics Association (AAFCA) has partnered with the American Cinematheque to curate an ongoing film series to showcase a wide range of Black films and facilitate conversations with prolific Black filmmakers exploring the cultural significance and important themes of the work. The series is slated to commence April 29 and will start off with a special event celebrating the career of Carl Franklin at the historic Egyptian Theatre in Hollywood. Franklin’s debut feature, One False Move, will be screened along with Devil in a Blue Dress, his film adaptation of the Walter Mosley novel. Afterward, Franklin will take part in a Q&A to discuss both works as well as his career overall. More screening to be announced throughout the year.
|
Cognitive Correlates of Cerebral White Matter Lesions and Water Diffusion Tensor Parameters in Community-Dwelling Older People Background: The biological basis of cognitive ageing is unknown. One underlying process might be disruption of white matter tracts connecting cortical regions. White matter lesions (WML) seen on structural MRI may disrupt cortical connections, but diffusion tensor MRI (DT-MRI) parameters mean diffusivity () and fractional anisotropy (FA) may reflect more subtle changes in white matter integrity. Here the relationships between WML load, DT-MRI parameters and cognition in a large cohort of elderly subjects with a very narrow age range were investigated. Methods: 105 community-dwelling volunteers underwent MRI and neuropsychological assessment. Seventy-two (68.6%) were female, and their mean age was 78.4 (SD 1.5) years. Scans were rated for WML load. and FA were measured from regions of interest in normal-appearing frontal and occipital white matter, and centrum semiovale. Results: and FA differed significantly among the three brain regions studied (p ≪ 0.01). increased with age (r = 0.22 to 0.35, p < 0.03), and was negatively correlated with FA (r = 0.20 to 0.51, p < 0.05) in all three regions. There was a trend towards increased WML load correlating with poorer cognitive function, and this was statistically significant for the Mini-Mental State Examination ( = 0.23, p = 0.02). was generally negatively correlated with cognitive test score, and FA was positively correlated. This pattern was more consistent for than for FA, and particularly for verbal fluency (: r = 0.22 to 0.27, p < 0.03), which measures executive function. Conclusions: DT-MRI parameters, in particular, are sensitive to early ultrastructural changes underlying cognitive ageing. Executive function may be the cognitive domain most sensitive to age-related decline in white matter tract integrity.
|
<gh_stars>10-100
import torch
import torch.nn.functional as F
from torch import nn
import pytorch_pfn_extras as ppe
from lib.functions.nll import pytorch_neg_multi_log_likelihood_single
from lib.functions.mse import mse_loss
class LyftRegressor(nn.Module):
"""Single mode prediction"""
def __init__(self, predictor, lossfun=mse_loss):
super().__init__()
self.predictor = predictor
self.lossfun = lossfun
self.prefix = ""
def forward(self, image, targets, target_availabilities):
outputs = self.predictor(image).reshape(targets.shape)
loss = self.lossfun(targets, outputs, target_availabilities)
metrics = {
f"{self.prefix}loss": loss.item(),
f"{self.prefix}nll": pytorch_neg_multi_log_likelihood_single(targets, outputs, target_availabilities).item()
}
ppe.reporting.report(metrics, self)
return loss, metrics
|
export function calculate(s: string) {
const tokens = tokenize(s)
const postfix = toPostfix(tokens)
return calcPostfix(postfix)
}
const isNumber = (s: string) => /-?\d/.test(s)
/**
* 中缀表达式token化
* @param s
* @returns
*/
export function tokenize(s: string): string[] {
s = s.replace(/\s/g, '')
let tokens: string[] = []
let tokenBuffer = ''
for (let i = 0; i < s.length - 1; i++) {
const char = s[i]
if (!isNumber(char)) {
if (
char === '-' &&
(i === 0 || ['(', '+', '-', '*', '/'].includes(s[i - 1]))
) {
tokenBuffer += char
}
else tokens.push(char)
} else {
tokenBuffer += char
if (!isNumber(s[i + 1])) {
tokens.push(tokenBuffer)
tokenBuffer = ''
}
}
}
const lastChar = s[s.length - 1]
if (isNumber(lastChar)) {
tokenBuffer += lastChar
} else {
tokenBuffer = lastChar
}
tokens.push(tokenBuffer)
return tokens
}
const priority = new Map([
['(', 0],
['+', 1],
['-', 1],
['*', 2],
['/', 2],
])
const isPrior = (p: string, q: string) => {
const pWeight = priority.get(p)
const qWeight = priority.get(q)
if (pWeight === undefined || qWeight === undefined) return false
else return pWeight > qWeight
}
/**
* 中缀表达式转后缀表达式
* @param tokens
* @returns
*/
export function toPostfix(tokens: string[]): string[] {
let postfixTokens: string[] = []
const stack: string[] = []
for (let token of tokens) {
if (isNumber(token)) {
postfixTokens.push(token)
}
else if (token === ')') {
let peek = stack.pop()
while (peek && peek !== '(') {
postfixTokens.push(peek as string)
peek = stack.pop()
}
}
else if (token === '(') {
stack.push(token)
}
else {
while (stack.length && !isPrior(token, stack[stack.length - 1])) {
postfixTokens.push(stack.pop() as string)
}
stack.push(token)
}
}
// 表达式遍历完成后,检查操作符栈是否为空
while (stack.length) {
postfixTokens.push(stack.pop() as string)
}
return postfixTokens
}
/**
* 计算后缀表达式
* @param tokens
* @returns
*/
export function calcPostfix(tokens: string[]): number {
let stack: number[] = []
const calc = (cb: (a: number, b: number) => number) => {
const num2 = stack.pop() as number,
num1 = stack.pop() as number
stack.push(cb(num1, num2))
}
for (let token of tokens) {
if (token === '+') calc((a, b) => a + b)
else if (token === '-') calc((a, b) => a - b)
else if (token === '*') calc((a, b) => a * b)
else if (token === '/') {
calc((a, b) => {
const res = a / b
return res < 0 ? Math.ceil(res) : Math.floor(res)
})
}
else stack.push(Number(token))
}
return stack.pop() as number
}
|
/**
* Returns whether the device has been provisioned.
*
* <p>Not for use by third-party applications.
*
* @hide
*/
@SystemApi
@RequiresPermission(android.Manifest.permission.MANAGE_USERS)
public boolean isDeviceProvisioned() {
try {
return mService.isDeviceProvisioned();
} catch (RemoteException re) {
throw re.rethrowFromSystemServer();
}
}
|
username = "IG Username"
password = "<PASSWORD>"
url_comment = 'URL'
url_get_comments = ["URL_1, URL_2, URL_3"]
function = "comment or get_comments"
num_people = 1
|
// Author : <NAME> (snowapril)
#if !defined(VFS_LOADER_THREAD_H)
#define VFS_LOADER_THREAD_H
#include <pch.h>
#include <GUI/UIRenderer.h>
#include <future>
#include <thread>
namespace vfs
{
class SparseVoxelOctree;
class OctreeBuilder;
class LoaderThread : NonCopyable
{
public:
explicit LoaderThread(void) = default;
explicit LoaderThread(vfs::QueuePtr mainQueue, vfs::QueuePtr loaderQueue,
const char* scenePath, const uint32_t octreeLevel);
~LoaderThread(void);
public:
void destroyLoaderThread(void);
void run (vfs::QueuePtr mainQueue, vfs::QueuePtr loaderQueue,
const char* scenePath, const uint32_t octreeLevel);
bool join (void);
inline std::shared_ptr<SparseVoxelOctree> getSparseVoxelOctree(void) const
{
return _svo;
}
private:
void loaderWorker(const char* scenePath);
private:
DevicePtr _device;
QueuePtr _graphicsQueue;
QueuePtr _loaderQueue;
uint32_t _octreeLevel;
std::shared_ptr<SparseVoxelOctree> _svo;
std::promise<std::shared_ptr<vfs::OctreeBuilder>> _builderPromise;
std::future<std::shared_ptr<vfs::OctreeBuilder>> _builderFuture;
std::thread _loaderThread;
};
};
#endif
|
// Subset returns a subset of the series based on the given Indexes.
func (s Series) Subset(indexes Indexes) Series {
if err := s.Err; err != nil {
return s
}
idx, err := parseIndexes(s.Len(), indexes)
if err != nil {
s.Err = err
return s
}
elements := make([]Element, len(idx))
for k, i := range idx {
if i < 0 || i >= s.Len() {
s.Err = fmt.Errorf("subsetting error: index out of range")
return s
}
elements[k] = s.elements[i]
}
return Series{
Name: s.Name,
t: s.t,
elements: elements,
OtherInfo: s.OtherInfo,
}
}
|
/// Returns a copy of the current buffer prepared by this producer. This method will actually
/// construct the buffer when called for the first time after a [`prepare_for_next_buffer`]
/// invocation (or if the producer has been newly constructed). In order to go to the next
/// buffer one needs to call [`prepare_for_next_buffer`] explicitly.
fn buffer(&mut self) -> Vec<u8> {
match &self.current_buffer {
Some(buf) => buf.clone(),
None => {
let buf = self.fill_buffer();
self.current_buffer = Some(buf.clone());
buf
}
}
}
|
<filename>code/258.addDigit.cpp
class Solution {
public:
int addDigits(int num) {
if (!num) return 0;
if (num % 9) return num % 9;
return 9;
}
};
|
/*
* Copyright 2010-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.amazonaws.services.simpleemail.model;
/**
* <p>
* Represents the user's current activity limits returned from a
* successful <code>GetSendQuota</code> request.
* </p>
*/
public class GetSendQuotaResult {
/**
* The maximum number of emails the user is allowed to send in a 24-hour
* interval.
*/
private Double max24HourSend;
/**
* The maximum number of emails the user is allowed to send per second.
*/
private Double maxSendRate;
/**
* The number of emails sent during the previous 24 hours.
*/
private Double sentLast24Hours;
/**
* The maximum number of emails the user is allowed to send in a 24-hour
* interval.
*
* @return The maximum number of emails the user is allowed to send in a 24-hour
* interval.
*/
public Double getMax24HourSend() {
return max24HourSend;
}
/**
* The maximum number of emails the user is allowed to send in a 24-hour
* interval.
*
* @param max24HourSend The maximum number of emails the user is allowed to send in a 24-hour
* interval.
*/
public void setMax24HourSend(Double max24HourSend) {
this.max24HourSend = max24HourSend;
}
/**
* The maximum number of emails the user is allowed to send in a 24-hour
* interval.
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param max24HourSend The maximum number of emails the user is allowed to send in a 24-hour
* interval.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public GetSendQuotaResult withMax24HourSend(Double max24HourSend) {
this.max24HourSend = max24HourSend;
return this;
}
/**
* The maximum number of emails the user is allowed to send per second.
*
* @return The maximum number of emails the user is allowed to send per second.
*/
public Double getMaxSendRate() {
return maxSendRate;
}
/**
* The maximum number of emails the user is allowed to send per second.
*
* @param maxSendRate The maximum number of emails the user is allowed to send per second.
*/
public void setMaxSendRate(Double maxSendRate) {
this.maxSendRate = maxSendRate;
}
/**
* The maximum number of emails the user is allowed to send per second.
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param maxSendRate The maximum number of emails the user is allowed to send per second.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public GetSendQuotaResult withMaxSendRate(Double maxSendRate) {
this.maxSendRate = maxSendRate;
return this;
}
/**
* The number of emails sent during the previous 24 hours.
*
* @return The number of emails sent during the previous 24 hours.
*/
public Double getSentLast24Hours() {
return sentLast24Hours;
}
/**
* The number of emails sent during the previous 24 hours.
*
* @param sentLast24Hours The number of emails sent during the previous 24 hours.
*/
public void setSentLast24Hours(Double sentLast24Hours) {
this.sentLast24Hours = sentLast24Hours;
}
/**
* The number of emails sent during the previous 24 hours.
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param sentLast24Hours The number of emails sent during the previous 24 hours.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public GetSendQuotaResult withSentLast24Hours(Double sentLast24Hours) {
this.sentLast24Hours = sentLast24Hours;
return this;
}
/**
* Returns a string representation of this object; useful for testing and
* debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (max24HourSend != null) sb.append("Max24HourSend: " + max24HourSend + ", ");
if (maxSendRate != null) sb.append("MaxSendRate: " + maxSendRate + ", ");
if (sentLast24Hours != null) sb.append("SentLast24Hours: " + sentLast24Hours + ", ");
sb.append("}");
return sb.toString();
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getMax24HourSend() == null) ? 0 : getMax24HourSend().hashCode());
hashCode = prime * hashCode + ((getMaxSendRate() == null) ? 0 : getMaxSendRate().hashCode());
hashCode = prime * hashCode + ((getSentLast24Hours() == null) ? 0 : getSentLast24Hours().hashCode());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null) return false;
if (obj instanceof GetSendQuotaResult == false) return false;
GetSendQuotaResult other = (GetSendQuotaResult)obj;
if (other.getMax24HourSend() == null ^ this.getMax24HourSend() == null) return false;
if (other.getMax24HourSend() != null && other.getMax24HourSend().equals(this.getMax24HourSend()) == false) return false;
if (other.getMaxSendRate() == null ^ this.getMaxSendRate() == null) return false;
if (other.getMaxSendRate() != null && other.getMaxSendRate().equals(this.getMaxSendRate()) == false) return false;
if (other.getSentLast24Hours() == null ^ this.getSentLast24Hours() == null) return false;
if (other.getSentLast24Hours() != null && other.getSentLast24Hours().equals(this.getSentLast24Hours()) == false) return false;
return true;
}
}
|
OKLAHOMA CITY, Okla -- Hospitality doesn't have restrictions. When Ashley Jiron opened "The Taco" in Oklahoma City, her goal was to feed everyone, regardless of circumstance. Jiron said, "Everyone is welcome whether they have money or not. that has always been our goal."
To date, Ashley and her girls have served more than 600 free meals.
But earlier this summer, a fire destroyed Ashley's small Mexican restaurant on NW 63rd. It could not her conquer her ministry.
Friend, Jenny Collazo told us, "She decided it wasn't going to keep her from getting school supplies to the families that she helps. They set up tables, fed them pizza and gave them school supplies because she said there had to be some happiness somewhere.
Jenny recently found herself in dire straights. but didn't have the courage to seek help. She said, "She didn't actually know but we had been really really struggling, my family of 5. I had been crying and crying that day and I get a text message from Ashley that there is something on the side of my house. And I go outside and find three bags of groceries and 20 dollars. She had no idea we were going through this. She just wanted to help me. Answered prayer."
Ashley's compassion for others is one reason Jenny nominated her for First Fidelity Bank's Pay It Forward. Bank representative, Michelle Jensen said, "At First Fidelity Bank we want to tell Ashley that we are so impressed with what she does for the community. And we want to give $400 and pay it forward."
We surprised Ashley at her home recently.
While her restaurant is being renovated Ashley Jiron will serve in other ways. This money, she says -- is earmarked for others, desperate for blessing. Jiron pledged, "I'm going to keep on paying it forward. You have no idea!"
|
Revisit the Role of Steps/Disconnections on Misfit Cancellation at Semi-Coherent InterfaceBridging the O-Line Model and the Topological Model It has been a long-standing topic how the lattice misfit is cancelled at a semi-coherent interphase boundary consisting of terraces and steps. Apart from a set of misfit dislocations separating the coherent patches, the role of steps (which is frequently called disconnections) on misfit cancellation remains ambiguous because these steps do not destroy the continuity of lattice planes across the interface. This paper aims to clarify such ambiguity through identification of a set of secondary dislocations through a rigorous constrained coincidence site lattice (CCSL)/constrained displacive shift complete lattice (CDSCL) analysis. A semi-coherent interface between body-centred cubic (BCC) Cr-rich precipitate and face-centred cubic (FCC) Cu-rich matrix that holds a near N-W orientation relationship (OR) is used as an example to demonstrate the procedure to determine the secondary dislocations that are coincident with steps along the interface. The current approach does not only redefine the disconnections in the topological model, but also extends the description of interface structure from the O-line model. As a result, the discrepancy between these two popular crystallographic models can be completely eliminated when the interface is required to contain a pair of parallel close-packed directions.
|
As you could guess, 15 years of work is expensive. Resulting therapies come at a cost of more than $2.5 billion per approved product, according to the Tufts Center for the Study of Drug Development. The biopharmaceutical industry invests $48.5 billion in research a year, according to the Pharmaceutical Research and Manufacturers of America. Even so, most therapies don’t make it past the Food and Drug Administration, and more than 80 percent fail in clinical trials.
So, is it worth the cost? As a person like any other who may need innovative medical treatment in my lifetime, I would say so.
But even beyond self-interest, there’s a sound case to be made. The cost of drug development is more than justified when you consider the even higher costs of disease. Patients who take their medication don’t go to the emergency room and are hospitalized less often.
I’m surprised that the concept of value is hardly, if ever, part of the debate. Perhaps this is because drug costs are the most visible part of the health care dollar, mainly in out-of-pocket pharmacy fees and rising co-pays.
But there is more nuance to drug pricing than people realize. These charges do not originate solely from biopharmaceutical companies; they’re also determined by health insurance providers, HMOs and hospitals.
Last year, FDA’s Center for Drug Evaluation and Research approved 45 new drugs, many of them supported by advocacy groups for patients with diseases with few effective therapies or none. Among these drugs was Orkambi, a cystic fibrosis treatment 17 years in the making from San Diego’s Vertex Pharmaceuticals. It is the first therapy to correct mutated genes that are the root cause rather than just treat symptoms. For patients who otherwise would face repeated battles of lung infections and hospitalization, the treatment is beyond life changing.
Hundreds more transformational therapies are in development throughout our state. The biopharmaceutical industry encourages a more thoughtful consideration of the efforts involved in bringing life-changing drugs to market, where they improve patients’ lives in remarkable, priceless ways.
Joe Panetta is chairman of the California Biotechnology Foundation, an advocacy group for the life sciences industry. He can be contacted at [email protected].
|
When a friend told me there were more shots of the still nameless “Tank Man” who stood in front of a phalanx of oncoming weaponry in China’s Tiananmen Square in 1989, I figured I would find a few photos from different angles. I did not expect a widescreen tableau that completely recontextualized the scale of the protests (and the man’s bravery, seeing that he was but armed with two plastic shopping bags).
From this distance, you see past the four tanks in the original iconic photo, to a chillingly expansive mass of tanks and soldiers. The scale of the picture changes the story somewhat, don’t you think? (You can see a larger version here.)
I actually found this shot on the website of the right wing think tank, The Heritage Foundation! I suppose students risking (and often losing) their lives to protest an oppressive Chinese government can be easily co-opted for red scare fodder. Regardless, it’s not every day that I actually learn something new from the right wing!
A closer street-level view of the David and Goliath confrontation—shot just before the tanks reached “Tank Man” and stopped their engines—was published by photographer Terrell Jones in 2009. Look for “Tank Man” behind the guy running.
|
Designing an Educational Program for Teachers Based on TPACK Principles and Wikis In this chapter, an approach to the design of an educational program for teachers is proposed. Three main steps are necessary in the design of such a program. The first step is to determine the goals of the program and connect them with the subsequent teaching goals of teachers. Further on, the knowledge and skills required in order to fulfill the goals set need to be determined. The final step concerns the selection of appropriate pedagogical methods and ICT tools that will assist teachers in their teaching. In the specific program, the goals set are based on Habermas' theory of cognitive interests and Schn's theory of the reflective practitioner. The TPACK model is used to categorize the desired knowledge that teachers will acquire from the program and the knowledge required by the instructor of the program. Wikis are used to support the selected pedagogical methods.
|
def custom_crossentropy(y_actual, y_predicted, epsilon=10e-6, alpha=0.5):
float_labels = tf.cast(y_actual, tf.float32)
cross_entropy_loss = 2*(alpha*float_labels * tf.math.log(y_predicted + epsilon) + (1-alpha)*(1 - float_labels) * tf.math.log(1 - y_predicted + epsilon))
cross_entropy_loss = tf.math.negative(cross_entropy_loss)
return tf.math.reduce_mean(tf.math.reduce_sum(cross_entropy_loss, 1))
|
Videocon Industries chairman Venugopal Dhoot. File photo.
Mumbai: Videocon Industries is looking to sell a 25% stake in its direct-to-home broadcast services business for roughly $75 million to $100 million and is in talks with private equity firms, people with direct knowledge of the matter said.
Videocon and ICICI Venture declined to comment. UBS officials could not be reached for immediate comment.
|
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Sos(AutotoolsPackage):
"""Sandia OpenSHMEM."""
homepage = "https://github.com/Sandia-OpenSHMEM/SOS"
url = "https://github.com/Sandia-OpenSHMEM/SOS/archive/refs/tags/v1.5.0.zip"
# notify when the package is updated.
maintainers = ['rscohn2']
version('1.5.0', sha256='02679da6085cca2919f900022c46bad48479690586cb4e7f971ec3a735bab4d4')
version('1.4.5', sha256='42778ba3cedb632ac3fbbf8917f415a804f8ca3b67fb3da6d636e6c50c501906')
variant('xpmem', default=False, description='Enable xpmem for transport')
variant('ofi', default=True, description='Enable ofi for transport')
variant('shr-atomics', default=False, description='Enable shared memory atomic operations')
depends_on('autoconf', type='build')
depends_on('automake', type='build')
depends_on('libtool', type='build')
depends_on('m4', type='build')
depends_on('libfabric', type='link', when='+ofi')
depends_on('xpmem', type='link', when='+xpmem')
# Enable use of the OSH wrappers outside of Spack by preventing
# them from using the spack wrappers
filter_compiler_wrappers(
'oshcc', 'oshc++', 'oshcc', 'oshfort', relative_root='bin'
)
def setup_dependent_build_environment(self, env, dependent_spec):
self.setup_compiler_environment(env)
# Enable the osh wrappers to use spack wrappers when inside spack
# with env variables
env.set('SHMEM_CC', spack_cc)
env.set('SHMEM_CXX', spack_cxx)
env.set('SHMEM_FC', spack_fc)
def autoreconf(self, spec, prefix):
bash = Executable('bash')
bash('./autogen.sh')
def configure_args(self):
args = []
args.extend(self.with_or_without('xpmem'))
args.extend(self.with_or_without('ofi'))
# This option is not compatiable with remote atomics
args.extend(self.enable_or_disable('shr-atomics'))
args.append('--enable-pmi-simple')
return args
|
def fbx_to_glTF(fbx_file):
pass
|
Preoperative "two-way" enteroscopy, followed by intraoperative enteroscopy in a patient with obscure-overt gastrointestinal bleeding and severe iron-deficiency anemia. We present the case of a 69-year-old woman admitted to hospital because of chronic gastrointestinal bleeding of an unknown source with a consequent severe iron deficiency anemia (IDA), undiagnosed for the past 25 years. In the last three years the episodes of severe bleeding became frequent, usually followed by melena. The patient was admitted 11 times in different departments without the identification of the bleeding source. During the evolution of the disease, the biological exams showed a severe IDA with low values of hemoglobin, low serum iron, mixed deficiency depicted by bone-marrow examination, and a reticulocyte crisis after parenterally administered iron. Repeated upper and lower gastrointestinal endoscopies failed to find a source of bleeding. Push enteroscopy allowed the visualization of approximately 40 cm of the proximal jejunum, after the Treitz angle, and demonstrated multiple punctiform jejunal angiodysplasias, which bled excessively after bipolar coagulation. We also performed a total colonoscopy with intubation of the ileo-cecal valve and visualization of the terminal ileum on approximately 30 cm, without any pathological findings. Because endoscopic treatment was ineffective, we decided to perform a segmentary enterectomy, with the length of small bowel resection tailored by intraoperative enteroscopy. A favourable evolution after limited resection of the small bowel indicated the importance of both preoperative "two-way" enteroscopy associated with intraoperative enteroscopy for diagnosing and treating the source of obscure gastrointestinal bleeding
|
Prime Minister David Cameron has hailed the temporary deal on Iran's nuclear programme as an "important first step".
Iran was now "further away from getting a nuclear weapon", he said, while insisting sanctions would be enforced "robustly" until a final deal.
Iran agreed to curb some of its nuclear activities in return for £4.3bn in sanctions relief after days of talks.
The US secretary of state and the UK foreign secretary paid tribute to each other's diplomatic efforts.
John Kerry joined William Hague at a joint news conference in London after the Geneva summit, telling reporters they would start discussing the next steps on curbing Iran's nuclear ambitions immediately.
"Now the really hard part begins, and that is the effort to get the comprehensive agreement, which will require enormous steps in terms of verification, transparency and accountability," Mr Kerry said.
The two men are also meeting Libyan PM Ali Zeidan to discuss the security situation in his country.
Despite the recent deal, there remain "legitimate concerns" about Iran's nuclear ambitions, Mr Hague had said earlier.
Media captionBenjamin Netanyahu: "This agreement has made the world a much more dangerous place"
Israeli Prime Minister Benjamin Netanyahu called the agreement a "historic mistake".
"Today the world became a much more dangerous place because the most dangerous regime in the world made a significant step in obtaining the most dangerous weapons in the world," he said.
A Saudi Arabian official said his government was "very concerned about these negotiations with Iran", adding: "There is a lot of worry right now about threats to the region."
Mr Hague told BBC Radio 4's World This Weekend: "They do all have very legitimate concerns about Iran's nuclear programme and it's not surprising that people will be sceptical about any agreement."
He continued: "After all, Iran also has a history of not revealing the truth about its nuclear programme to the rest of the world.
"But this is the first time that Iran has entered into an agreement with other nations, with the international community, about what to do about its nuclear programme."
Earlier, he had described the deal as "good for the whole world".
Writing on Twitter, Mr Hague said it was an "important and encouraging first-stage agreement with Iran".
"This is an important moment, an encouraging moment, in our relations with Iran and in our efforts to prevent nuclear proliferation in the world," Mr Hague told journalists.
The deal would mean that Iran's nuclear programme "won't be able to go forward over the next six months, over the six months of this agreement, and in some respects will be rolled back", Mr Hague continued.
"And that, we hope, will give us the opportunity to negotiate a comprehensive and final settlement of these issues.
"It is necessary and in the interests of the world for there to be an international agreement, about Iran's nuclear programme, that can lead then to a comprehensive settlement to us all being assured that that programme is exclusively for peaceful purposes."
On Twitter, the foreign secretary added: "This agreement shows it is possible to work with Iran, and through diplomacy address intractable problems.
"Tonight's agreement with Iran [is] good for the whole world, including Middle Eastern countries and the people of Iran themselves.
"Negotiations were painstaking. Tomorrow hard work begins of implementing and building on the agreement."
The EU's foreign policy chief Baroness Ashton said: "Of course, when you get to the detail of trying to finalise the agreement, in a sense that is the hardest part.
"But we've done it in a spirit of cooperation, good atmosphere, and although it has been intensive, and very, very detailed, it has also been done with a real sense of mutual respect.
"I'm delighted that we've got there."
US President Barack Obama has also welcomed the deal.
"We have pursued intensive diplomacy," he said, "and today that diplomacy opened up a new path towards a world that is more secure, a future in which we can verify that Iran's nuclear programme is peaceful and that it cannot build a nuclear weapon.
"If Iran does not fully meet its commitments during this six-month phase, we will turn off the relief and ratchet up the pressure."
Iran agreed to give better access to inspectors and halt some of its work on uranium enrichment.
President Hassan Rouhani said the deal recognised Iran's nuclear "rights".
|
<filename>Week-2/CommisionEmployee.java
public class CommisionEmployee {
protected String firstName;
protected String lastName;
protected double grossSales;
protected double commissionRate;
public CommisionEmployee( String first, String last, double sales, double rate )
{
firstName = first;
lastName = last;
setGrossSales( sales );
setCommissionRate( rate );
}
//*****************************************
public String getFirstName()
{
return firstName;
}
public String getLastName()
{
return lastName;
}
//************************************
public void setGrossSales( double sales )
{
if ( sales >= 0.0 )
{
grossSales = sales;
}
else
{
//throw new IllegalArgumentException ("Gross sales must be >= 0.0" );
System.out.println("Gross sales must be >= 0.0" );
}
}
public double getGrossSales()
{
return grossSales;
}
//***************************************
public void setCommissionRate( double rate )
{
if ( rate > 0.0 && rate < 1.0 )
{
commissionRate = rate;
}
else
{
System.out.println("Commission rate must be > 0.0 and < 1.0" );
}
}
public double getCommissionRate()
{
return commissionRate;
}
//*****************************************
public double earnings()
{
return commissionRate * grossSales;
}
//*****************************************
// public String toString()
// {
// return String.format( "commission employee" + firstName+ lastName +
// "gross sales" + grossSales +
// "commission rate" + commissionRate );
// }
//******************************************
}
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:author: <NAME>
Axiom decomposer scans axioms (primarily of type subclassof and equivalence)
and creates a hash with a key as the *left_hand_side* of an axiom. We only
treat axioms of OWL-EL, therefore we only accepts atomic classes on the left
hand side of an axiom.
This module contains functionalities needed for
* filter axioms that have a given signature (uri) in the lhs, or rhs (depends on the locality)
* maintain a hash based on a (signature, locality) -> triples
* compute a recursive signature of a hand side (i.e., extract uri of atomic concepts inside a complex definition)
"""
from rdflib import URIRef, BNode
from grontocrawler.axioms import extract_axioms
def filter_axioms_lhs(signature, axioms):
"""
Filters subclassof or equivalence ``axioms`` that contain ``signature`` in the left hand side
Args:
axioms (dict): { 'subclass': [triple, ...], 'equivalent': [triple, ...]
Returns:
dict: filtered axioms the same structure as input
"""
# one axiom is actually a triple (s, p, o)
subclass_axioms = [(s, p, o)
for s, p, o in axioms['subclass']
if s == signature]
equivalent_axioms = [(s, p, o)
for s, p, o in axioms['equivalent']
if s == signature]
return {
'subclass': subclass_axioms,
'equivalent': equivalent_axioms
}
def filter_atomic_complex(axioms):
"""
Filters subclass and equivalent axioms in atomic (atomic concept in rhs)
and complex (complex concept in rhs)
Args:
axioms (list): [triple, ...]
Returns:
list: atomic axioms
list: complex axioms
"""
# one axiom is actually a triple (s, p, o)
atomic_axioms = [(s, p, o) for s, p, o in axioms if isinstance(o, URIRef)]
complex_axioms = [(s, p, o) for s, p, o in axioms if isinstance(o, BNode)]
return {
'atomic': atomic_axioms,
'complex': complex_axioms
}
def extract_complex_rhs(axiom, g):
"""
Extracts complex right hand side's triples. We assume it is simply an
existential restriction.
Args:
axiom (tuple): (s, p, o), such that o is BNode
g (:py:class:`rdflib.Graph`): RDF graph of our ontology
Returns:
list: list of triples
"""
_, _, rhs_bnode = axiom
if not isinstance(rhs_bnode, BNode):
raise Exception('RHS should be complex, no BNode found in {}'.format(rhs))
triples = [(s, p, o)
for (s, p, o) in g.triples((rhs_bnode, None, None))]
return triples + [axiom]
def extract_signature(axiom, g):
"""
Extracts all URIRefs in the axiom. First we extract a possibly complex
rhs of the axiom, and then extract only URIRefs
Args:
axiom (tuple): (s, p, o)
g (:py:class:`rdflib.Graph`): RDF graph of our ontology
classes:
Returns:
list: list of URIRefs
"""
triples = []
s, p, o = axiom
# cached call for all owl_classes
owl_classes = extract_axioms.owl_classes(g)
# if rhs is complex
if isinstance(o, BNode):
triples = extract_complex_rhs(axiom, g)
signature = set([])
for (s, p, o) in triples:
if s in owl_classes: signature.add(s)
if o in owl_classes: signature.add(o)
# in case we have recursively complex axioms
if isinstance(s, BNode) or isinstance(o, BNode):
print('attention recursively complex axiom {}'.format(axiom))
return list(signature)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.